gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# mrlib.statistics
# Libraries for implement basic statistical computations
#
# Author: Benjamin Bengfort <ben@cobrain.com>
# Created: Tue Nov 12 07:17:30 2013 -0500
#
# Copyright (C) 2013 Cobrain Company
# For license information, see LICENSE.txt
#
# ID: statistics.py [] ben@cobrain.com $
"""
Dumbo provides a few ... | |
# 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... | |
# -*- test-case-name: twisted.words.test.test_basechat -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Base classes for Instance Messenger clients.
"""
from twisted.words.im.locals import OFFLINE, ONLINE, AWAY
class ContactsList:
"""
A GUI object that displays a contacts list... | |
# coding: utf-8
from __future__ import unicode_literals
import hashlib
import hmac
import itertools
import json
import re
import time
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
parse_age_limit,
parse_iso8601,
sanitized_Request,
)
class VikiBaseIE(InfoExt... | |
# Model III
# Version 23th July 2015
# The python code solves Model III for the optimization of a transit line
# and for the strategic assessment of mode choice, see:
# L. Moccia, and G. Laporte, 'Improved models for technology choice in a transit corridor with fixed demand', 2015
# For comments, please write to:
# ... | |
# 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... | |
#!/usr/bin/env python
from .s_procedure import SimProcedure, SimProcedureError
import re
import simuvex
import logging
l = logging.getLogger("simuvex.parseformat")
class FormatParser(SimProcedure):
"""
For SimProcedures relying on format strings.
"""
# Basic conversion specifiers for format strings, ... | |
"""
API functions relating to user management and registration.
"""
import bcrypt, re, urllib.parse, urllib.request, flask, json, string, re
import api
from api.common import check, validate, safe_fail
from api.common import WebException, InternalException
from api.annotations import log_action
from voluptuous impor... | |
"""\
HTTP digest authentication middleware
This implementation is identical to the `paste.auth.digest
<http://pythonpaste.org/module-paste.auth.digest.html>`_ implemenation.
Note:: If users are prompted to sign in this also seems to have the effect of
signing them out.
"""
# (c) 2005 Clark C. Evans
# This modul... | |
# pylint: disable=redefined-outer-name,protected-access
import pytest
from rlib.string_stream import StringStream
from som.compiler.ast.method_generation_context import MethodGenerationContext
from som.compiler.ast.parser import Parser
from som.compiler.ast.variable import Argument
from som.compiler.class_generation_c... | |
# Copyright 2021 the Ithaca 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | |
import graphviz as gv
import nltk
import csv
import webbrowser
import codecs
import nltk.stem.wordnet as wn
from nltk.parse.stanford import StanfordDependencyParser as sdp
lemmatizer = wn.WordNetLemmatizer()
dependency_parser = sdp(
path_to_jar="stanford-corenlp-full-2016-10-31/stanford-corenlp-3.7.0.jar",
pa... | |
from mongoengine import *
from mongoengine.context_managers import switch_db
from datetime import datetime
import hashlib
import uuid
from user import User, Users
# from comittee import Committee
from pprint import pprint
from cloudmeshobject import CloudmeshObject
from cloudmesh_base.ConfigDict import ConfigDict
from ... | |
"""Calculate MC statistics.
This version is similar to version 2, but it iterates over all input
parameters, including noise_field, e.g. processing one set of file at a time.
It accepts chunks parameters to chunk input data into tiny piece to take
advantage of Dask.
File paths are hard-coded to match data on Agave cl... | |
# postgresql/psycopg2.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: postgresql+psycopg2
:name: psycopg2
:dbapi: psycopg2... | |
"""
Clothing - Provides a typeclass and commands for wearable clothing,
which is appended to a character's description when worn.
Evennia contribution - Tim Ashley Jenkins 2017
Clothing items, when worn, are added to the character's description
in a list. For example, if wearing the following clothing items:
a t... | |
# coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... | |
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
import os
import re
# Monkey patch for pygments reporting an error when generator expressions are
# used.
# https://bitbucket.org/birkenfeld/pygments-main/issue/942/cmake-gener... | |
# Error codes
class PilotErrors:
""" Pilot error handling """
# error codes
ERR_UNKNOWNERROR = 0
ERR_GENERALERROR = 1008
ERR_DIRECTIOFILE = 1009 # harmless, just means that copy-to-scratch was skipped in favor or direct i/o access
ERR_GETDATAEXC = 1097
ERR_NOLOCALSPACE = 1098
ERR_STAGE... | |
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
#
# This document should comply with PEP-8 Style Guide
# Linter: pylint
"""
Interface for setting up and creating a model in Tensorflow.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
im... | |
"""Handle auth and authz activities in ~~~PROJNAME~~~"""
import logging
from decorator import decorator
from pyramid.decorator import reify
from pyramid.httpexceptions import HTTPForbidden
from pyramid.httpexceptions import HTTPFound
from pyramid.request import Request
from pyramid.security import unauthenticated_user... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
class Enum(object):
_attributes_cache = None
_values_dict_cache = None
@classmethod
def _attributes(cls):
if cls._attributes_cache is None:
attrs = [name for name in dir(cls)
if na... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import *
import codecs
import glob
import os
import re
import lxml.etree as et
from bs4 import BeautifulSoup
from snorkel.models import Document
class D... | |
"""Common Utilities."""
import os
import socket
import threading
from collections import deque
from contextlib import contextmanager
from functools import partial
from itertools import count
from uuid import NAMESPACE_OID, uuid3, uuid4, uuid5
from amqp import ChannelError, RecoverableConnectionError
from .entity imp... | |
#!/usr/bin/env python
import rospy
import subprocess
from std_msgs.msg import Bool
import move_base_msgs.msg
from nav_msgs.msg import Path
from nav_msgs.msg import Odometry
from std_msgs.msg import String
from hector_nav_msgs.srv import GetRobotTrajectory # It says 'msgs' but it is a srv!
import tf
import math
from arl... | |
"""
:codeauthor: Mike Place <mp@saltstack.com>
"""
import copy
import logging
import pytest
import salt.utils.platform
from salt import client
from salt.exceptions import (
EauthAuthenticationError,
SaltClientError,
SaltInvocationError,
SaltReqTimeoutError,
)
from tests.support.mock import MagicMo... | |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... | |
"""Loads a CWL document."""
from __future__ import absolute_import
import hashlib
import logging
import os
import re
import uuid
from typing import (Any, Callable, Dict, List, MutableMapping, MutableSequence,
Optional, Tuple, Union, cast)
import requests.sessions
from ruamel.yaml.comments import C... | |
#!/usr/bin/python2.7
# Copyright 2015 The Bazel 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 requ... | |
# 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 the ... | |
import string
from typing import Optional, Any, Dict, List, Tuple
from collections import defaultdict
TOPIC_WITH_BRANCH_TEMPLATE = '{repo} / {branch}'
TOPIC_WITH_PR_OR_ISSUE_INFO_TEMPLATE = '{repo} / {type} #{id} {title}'
EMPTY_SHA = '0000000000000000000000000000000000000000'
COMMITS_LIMIT = 20
COMMIT_ROW_TEMPLATE = ... | |
# 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... | |
# Copyright (C) 2013 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 of source code must retain the above copyright
# notice, this list of conditions and the ... | |
#!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
#
# This is a thin wrapper for native LD. This is not meant to be
# used by the user, but is called from pnacl-translate.
# This ... | |
#!/usr/bin/python
# Copyright 2017 Northern.tech AS
#
# 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 a... | |
"""Tests for deCONZ config flow."""
from unittest.mock import patch
import asyncio
from homeassistant.components.deconz import config_flow
from tests.common import MockConfigEntry
import pydeconz
async def test_flow_works(hass, aioclient_mock):
"""Test that config flow works."""
aioclient_mock.get(pydeconz... | |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Insidetextfont(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "pie"
_path_str = "pie.insidetextfont"
_valid_props = {"color", "colorsrc", "family",... | |
# _*_ encoding: utf-8 _*_
import pytest
NODES_IN_TREE = [(20, True), (22, True), (21, True), (14, True), (75, False),
(0, False), (7, False), (15, False)]
@pytest.fixture()
def populated_tree():
"""Fixture for populating BST."""
from bst import BST
new_bst = BST()
new_bst.insert(20)
... | |
# -*- coding: utf-8 -*-
import six
from . import constants
from .meta.datatype import DataType
from .meta.field import Field, ListField
from .datatype import EnumType, ModelType, datetime_type
from .model import BetfairModel
class Event(BetfairModel):
id = Field(DataType(six.text_type))
name = Field(DataT... | |
# ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems 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.o... | |
#!/usr/bin/env python
"""
vg_msga.py: use vg's banded aligner to align contigs into the graph. By associating BED regions with each
contig, we can parallelize by chromosome.
"""
import argparse, sys, os, os.path, errno, random, subprocess, shutil, itertools, glob, tarfile
import doctest, re, json, collections, time... | |
from steerclear import app, db
from steerclear.models import Ride
from steerclear.api.views import calculate_time_data
from flask import url_for
import json, vcr
from datetime import datetime, timedelta
from testfixtures import replace, test_datetime
from tests.base import base
# vcr object used to record api request ... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Plecost: Wordpress vulnerabilities finder
#
# @url: http://iniqua.com/labs/
# @url: https://github.com/iniqua/plecost
#
# @author:Francisco J. Gomez aka ffranz (http://iniqua.com/)
# @author:Daniel Garcia aka cr0hn (http://www.cr0hn.com/me/)
#
# Copyright (c) 2015, Iniqua T... | |
## 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 applic... | |
import base64
import json
from asyncio import sleep
from time import time
from urllib.parse import parse_qs, urlparse
from aiohttp import WSMsgType
from async_timeout import timeout
from cryptography.fernet import Fernet
from em2 import VERSION
from em2.core import Components, Verbs
from ..conftest import AnyInt, Cl... | |
#%%
# 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 app... | |
"""
All parameters (excluding superparameters) in the model should be in theano var-
iables or theano shared values. In the training part, these variables should be
organized into "theano.function"s. So there should be no theano.function in the
definition of models here. Except for analysis part of codes.
"""
import n... | |
"""
Support for MQTT Template lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.mqtt_template/
"""
import logging
import voluptuous as vol
import homeassistant.components.mqtt as mqtt
from homeassistant.components.light import (
ATTR_BRI... | |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_etree_fromstring
from ..utils import (
ExtractorError,
int_or_none,
sanitized_Request,
parse_iso8601,
)
class VevoIE(InfoExtractor):
'''
Accepts urls from vevo.com or in the format... | |
#
# 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... | |
import dxr.plugins
import os, sys
import fnmatch
import clang.tokenizers as tokenizers
import urllib, re
class ClangHtmlifier:
""" Pygmentizer add syntax regions for file """
def __init__(self, tree, conn, path, text, file_id):
self.tree = tree
self.conn = conn
self.path = pat... | |
'''pyleri.Grammar Class.
When creating a new grammar this class should be used as the base class.
Example:
class MyGrammar(Grammar):
...
:copyright: 2021, Jeroen van der Heijden <jeroen@cesbit.com>
'''
import re
import time
from .node import Node
from .expecting import Expecting
from .endofstatement import e... | |
# -*- coding: utf-8 -*-
'''
Parser for multipart/form-data
==============================
This module provides a parser for the multipart/form-data format. It can read
from a file, a socket or a WSGI environment. The parser can be used to replace
cgi.FieldStorage (without the bugs) and works with Python 2.5+ and 3.x (... | |
#! /usr/bin/env python
from __future__ import print_function
import argparse
import os
import signal
import subprocess
import sys
if sys.platform == 'win32':
# This module was renamed in Python 3. Make sure to import it using a
# consistent name regardless of python version.
try:
import winreg
... | |
# 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 sqlalchemy.orm import create_session, relationship, mapper, \
contains_eager, joinedload, subqueryload, subqueryload_all,\
Session, aliased, with_polymorphic
from sqlalchemy import Integer, String, ForeignKey
from sqlalchemy.engine import default
from sqlalchemy.testing import AssertsCompiledSQL, fixture... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'ar (Alexander Kalinovsky)'
import glob
import os
import sys
import time
import numpy as np
import json
from keras.backend.tensorflow_backend import set_session
import tensorflow as tf
import nibabel as nib
try:
import cPickle as pickle
except:
import pic... | |
#
# 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
# ... | |
from __future__ import generators
"""
httplib2
A caching http interface that supports ETags and gzip
to conserve bandwidth.
Requires Python 2.3 or later
Changelog:
2007-08-18, Rick: Modified so it's able to use a socks proxy if needed.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright... | |
import os
import shutil
import tempfile
import unittest
import yaml
try:
# Python3 imports
import unittest.mock as mock
from unittest.mock import patch
except ImportError:
# Python2 imports
from mock import patch
import mock
from argparse import Namespace
from collections import OrderedDict
... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists of v... | |
from __future__ import unicode_literals
from future.builtins import int, str, zip
from django import forms
from django_comments.forms import CommentSecurityForm, CommentForm
from django_comments.signals import comment_was_posted
from django.utils.safestring import mark_safe
from django.utils.translation import ugettex... | |
# -*- coding: utf-8 -*-
import logging
import json
import random
import re
import requests
logger = logging.getLogger(__name__)
def find_index_of_sequence(data, sequence, start_index=0):
index = start_index
for token in sequence:
index = data.find(token, index)
if index == -1:
re... | |
import mock
from cardboard import core as c, events, exceptions, phases
from cardboard.tests.util import GameTestCase
class TestManaPool(GameTestCase):
def test_iter(self):
self.game.start()
self.p1.mana_pool.add(1, 2, 3, 4, 5, 6)
self.assertEqual(list(self.p1.mana_pool), [1, 2, 3, 4, 5,... | |
import unittest
from biokbase.catalog.Impl import Catalog
from catalog_test_util import CatalogTestUtil
class AdminMethodsTest(unittest.TestCase):
def test_is_admin(self):
madeUpName = 'asdfasdf'
userName = self.cUtil.user_ctx()['user_id']
adminName = self.cUtil.admin_ctx()['user_id']
... | |
from __future__ import with_statement
from StringIO import StringIO
from contextlib import contextmanager
import warnings
from common import TestCase
class _HTablesApiTest(TestCase):
def db_session(self):
return self.db.session()
def preSetUp(self):
super(_HTablesApiTest, self).preSetUp()
... | |
import asyncio
import logging
from uuid import uuid4
from copy import deepcopy
from random import shuffle
from datetime import datetime
from tukio import Engine, TaskRegistry, get_broker, EXEC_TOPIC
from tukio.workflow import Workflow, WorkflowExecState
from tukio.task.factory import TaskExecState
from nyuki import Ny... | |
#!/usr/bin/env python
"""ROS has a parameter server, we have files.
The parameter store is a persistent key value store, implemented as a directory with a writer lock.
On Android, we store params under params_dir = /data/params. The writer lock is a file
"<params_dir>/.lock" taken using flock(), and data is stored in ... | |
# Copyright (c) 2017 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
# The API of the Collection class is adapted from the API of
# the pymongo.Collection class provided as part of the
# mongo-python-driver library [1], which is licensed unde... | |
# -*- coding: utf-8 -*-
from acq4.Manager import getManager
from AnalyzerTemplate import *
from acq4.util.flowchart import *
from PyQt4 import QtGui, QtCore
from acq4.util.DirTreeWidget import DirTreeLoader
from acq4.pyqtgraph.PlotWidget import *
from acq4.util.Canvas import *
import acq4.util.configfile as configfile... | |
from ..utils import TranspileTestCase
class TryExceptTests(TranspileTestCase):
def test_try_except(self):
# No exception
self.assertCodeExecution("""
try:
obj = 3
print('OK')
except:
print("Got an error")
print('D... | |
# 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... | |
#!/usr/bin/env python2
"""
Authors: Fabian Brix, Gabriel Grill, Anton Ovchinnikov
"""
#import tweet_db_handler
#import SimpleClient
from SimpleClient import *
import get_category
import socket
import logging
import cPickle as pickle
import glob
import sys
import threading
import os
import random
import re
from ... | |
#
# The Python Imaging Library.
# $Id$
#
# a Windows DIB display interface
#
# History:
# 1996-05-20 fl Created
# 1996-09-20 fl Fixed subregion exposure
# 1997-09-21 fl Added draw primitive (for tzPrint)
# 2003-05-21 fl Added experimental Window/ImageWindow classes
# 2003-09-05 fl Added fromstring/tostring me... | |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | |
# Uncomplicated VM Builder
# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation.
#
# ... | |
from jsonrpc import ServiceProxy
import sys
import string
# ===== 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:7950")
else:
access = Ser... | |
#!/usr/bin/python
#
# 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 b... | |
import enum
import typing
class Node(object):
"""Base class of all AST nodes. Provides a convenient __init__ and __repr__."""
def __init__(self, **kwargs):
"""Create a node and set all keyword arguments as attributes."""
super().__init__()
for name, value in kwargs.items():
setattr(self, name, value... | |
# Copyright 2014: Mirantis 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 b... | |
"""
Test Swfit api.
"""
from cStringIO import StringIO
from configobj import ConfigObj
import base64
import contextlib
import logging
import os
from teuthology import misc as teuthology
from teuthology import contextutil
from ..config import config as teuth_config
from ..orchestra import run
from ..orchestra.connectio... | |
import string
from sys import exit
def is_number(s):
try:
float(s)
return True
except ValueError:
return False
def get_bin(x, n):
if (not is_number(x)):
raise ValueError('get_bin: parameter is not a number.')
return '{0:{fill}{width}b}'.format((int(x) + 2**n) % 2**n,... | |
import os
import tushare as ts
import pandas as pd
from datetime import datetime
from datetime import timedelta
from log import log
from scipy.stats import norm
import numpy as np
import math
import json
PREFIX = 'data'
def __estimation_formula_bg_dynamic(growth, eps, pe):
''' BG formula, integrate with the norma... | |
import copy
from django import forms
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.models import LogEntry
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.http import HttpRequest
from django.test import Tes... | |
import smtplib
import sys
import traceback
from email.Utils import formatdate
from email.mime.text import MIMEText
from time import time
from urlparse import parse_qsl
from django.utils.http import urlencode
import settings_local as settings
# This has to be imported after the settings so statsd knows where to log ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2018 Kitware 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 cop... | |
# Copyright (C) 2013-2016 Martin Vejmelka, CU Denver
#
# 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, mer... | |
import re
import shortuuid
from allauth.socialaccount.models import SocialApp
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ValidationError
from django.core.validators import validate_email
from django.db.models import Q
from drf_yasg import openapi
from rest_framework i... | |
from __future__ import unicode_literals
import json
from six.moves.urllib.parse import urlparse
from moto.core.responses import BaseResponse
from moto.s3 import s3_backend
from .models import cloudformation_backends
from .exceptions import ValidationError
class CloudFormationResponse(BaseResponse):
@property
... | |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Pattern(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "barpolar.marker"
_path_str = "barpolar.marker.pattern"
_valid_props = {
"bgcolor",
... | |
"""Generate precipitation using the Poisson pulse model.
Landlab component that generates precipitation events using the rectangular
Poisson pulse model described in Eagleson (1978, Water Resources Research).
No particular units must be used, but it was written with the storm units in
hours (hr) and depth units in m... | |
# sql/types_api.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Base types API.
"""
from .. import exc, util
from . import operators
from .visi... | |
"""Support for OwnTracks."""
from collections import defaultdict
import json
import logging
import re
from aiohttp.web import json_response
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components import mqtt
from homeassistant.const import CONF_WEBHOOK_ID
from homeassistant.cor... | |
#
# 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
# ... | |
#!/usr/bin/env python
# encoding: utf-8
"""
Session.py
Created by Tomas HJ Knapen on 2009-11-26.
Copyright (c) 2009 TK. All rights reserved.
"""
import os, sys, datetime
import subprocess, logging
import pickle, datetime, time
import scipy as sp
import numpy as np
# import matplotlib.pylab as pl
from math import *
... | |
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
from io import BytesIO
import mmap
import os
import sys
import zlib
from gitdb.fun import (
msb_size,
... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014-2016 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file LICENSE, which
# you should have received as part of this distribution.
#
import asyncio
import base64
import contextlib
import datetime
import functools
import os
import r... | |
"""The NextState layers.
The NextState layers encapsulate various ways in which the state on an EdgeSet,
a NodeSet or the Context can be computed from its old state (if any) and
various side inputs. Typically, these NextState layers are passed to the
initializer of an EdgeSetUpdate, NodeSetUpdate or ContextUpdate laye... | |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Textfont(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "funnel"
_path_str = "funnel.textfont"
_valid_props = {"color", "colorsrc", "family", "fami... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.