gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright (c) 2011-2014 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 agre... | |
# Copyright 2016 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 to in... | |
"""
Training costs for unsupervised learning of energy-based models
"""
import functools
import logging
import numpy as np
import sys
from theano.compat.python2x import OrderedDict
from theano import scan
import theano.tensor as T
from theano.compat.six.moves import zip as izip
from pylearn2.costs.cost import Cost, D... | |
# coding: utf-8
"""Plotting library."""
from copy import deepcopy
from io import BytesIO
from typing import Any, Dict, List, Optional, Tuple, Union
import numpy as np
from .basic import Booster, _log_warning
from .compat import GRAPHVIZ_INSTALLED, MATPLOTLIB_INSTALLED
from .sklearn import LGBMModel
def _check_not_t... | |
# Copyright 2012 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 req... | |
# -*- coding: utf-8 -*-
"""
flaskbb.utils.helpers
~~~~~~~~~~~~~~~~~~~~
A few helpers that are used by flaskbb
:copyright: (c) 2014 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
import re
import time
import itertools
import operator
from datetime import datetime, timedelta
... | |
"""
The :mod:`sklearn.kernel_approximation` module implements several
approximate kernel feature maps base on Fourier transforms.
"""
# Author: Andreas Mueller <amueller@ais.uni-bonn.de>
#
# License: BSD 3 clause
import warnings
import numpy as np
import scipy.sparse as sp
from scipy.linalg import svd
from .base im... | |
"""
trello-rss - A Python module for creating an RSS feed for your Trello boards.
Written by Nate Collings
Required:
sarumont's py-trello Trello API Wrapper:
https://github.com/sarumont/py-trello
PyRSS2Gen:
https://pypi.python.org/pypi/PyRSS2Gen
A Trello API Key and token for the boards to view:
https://trello.com... | |
#
# 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... | |
""" Modified from Mezzanine's wordpress_import script
Author: Jiaan Fang <fduodev@gmail.com>
This script is used by myself to import posts from fduo.org, the compatibility
is not tested, use at your own risk.
"""
from __future__ import unicode_literals
from collections import defaultdict
from datetime import dateti... | |
try:
from builtins import object
except ImportError:
pass
from .utils import Stuff, DummyModel
from .test_core import TestTransitions
from transitions.extensions import MachineFactory
from transitions.extensions.nesting import NestedState
from transitions.extensions.states import add_state_features, Timeout, ... | |
import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152']
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',
'resnet34': 'https://download.pytorch.org/models/r... | |
# Copyright 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 requ... | |
#from django.shortcuts import render
from django.core.exceptions import *
import MySQLdb
#from reader import models
from .models import Readings, Beer, TemperatureProfile
from .forms import GranularityForm
import datetime
import time
#from datetime import datetime, timedelta
# Create your views here.
import os
from de... | |
# 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 ... | |
import numpy
from chainer.backend import cuda
from chainer import distribution
from chainer.functions.array import repeat
from chainer.functions.array import reshape
from chainer.functions.array import transpose
from chainer.functions.math import prod
from chainer.functions.math import sum as sum_mod
from chainer.util... | |
import argparse
import sys
import os, os.path
import numpy as np
import pandas as pd
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import matplotlib
from matplotlib import rc, cm
class linReg(object):
'''
This class performs multi variable linear regression.
'''
#
# Some c... | |
#!/usr/bin/python
import threading
import Queue
import time
import logging
import sys
sys.path.insert(0, "../lib/Adafruit_MotorHAT_mod")
from Adafruit_MotorHAT import Adafruit_MotorHAT, Adafruit_DCMotor, Adafruit_StepperMotor
import Adafruit_PWM_Servo_Driver
def main():
logging.basicConfig(stream=sys.stdout, leve... | |
# -*- coding: utf-8 -*-
'''
Updated on Nov, 2017
@author: Todd Baumeister <tbaumeist@gmail.com>
Manage all of the analysis metrics
'''
import logging
import os
import json
from lib.actions.routing_choice_metric import RoutingChoiceMetric
from lib.actions.path_lengths_metric import PathLengthsMetric
from lib.actions.g... | |
# -*- 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):
# Adding field 'ObjectLink.key_link'
db.add_column('links_objectlink', 'key_link',
sel... | |
###########
# testing #
###########
# from websocket import create_connection
import nose
from exhibitionist.isubscriber import ISubscriber
from exhibitionist import get_server
from exhibitionist.providers.websocket import WebSocketProvider
from exhibitionist.toolbox import WSMsg
import unittest
import json
from ws... | |
# -*- coding: utf-8 -*-
"""
hyperframe/frame
~~~~~~~~~~~~~~~~
Defines framing logic for HTTP/2. Provides both classes to represent framed
data and logic for aiding the connection when it comes to reading from the
socket.
"""
import struct
import binascii
from .exceptions import (
UnknownFrameError, InvalidPadding... | |
# 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... | |
import copy
import numpy
import six
from chainer import cuda
from chainer import function
from chainer import link
from chainer.utils import type_check
class TreeParser(object):
def __init__(self):
self.next_id = 0
def size(self):
return self.next_id
def get_paths(self):
retur... | |
# ------------------------------------------------------------------------------
# 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 r... | |
import Queue, time, os.path
from cStringIO import StringIO
import email.utils
from libmproxy import filt, protocol, controller, utils, tnetstring, flow
from libmproxy.protocol.primitives import Error, Flow
from libmproxy.protocol.http import decoded, CONTENT_MISSING
from libmproxy.proxy.connection import ClientConnecti... | |
"""
Functions which are common and require SciPy Base and Level 1 SciPy
(special, linalg)
"""
from __future__ import division, print_function, absolute_import
from scipy.lib.six import xrange
from numpy import exp, log, asarray, arange, newaxis, hstack, product, array, \
where, zeros, extract, plac... | |
"""Implementation of a binary search tree."""
class Node(object):
"""."""
def __init__(self, data, parent=None, left=None, right=None):
"""."""
self.data = data
self.parent = parent
self.left = left
self.right = right
self.balance_number = 0
class BinarySearc... | |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Marker(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "histogram"
_path_str = "histogram.marker"
_valid_props = {
"autocolorscale",
... | |
"""Constants for the LCN component."""
from itertools import product
from homeassistant.const import (
DEGREE,
ELECTRIC_POTENTIAL_VOLT,
PERCENTAGE,
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
TEMP_KELVIN,
Platform,
)
PLATFORMS = [
Platform.BINARY_SENSOR,
Platform.CLIMATE,
Platform.COVER,
... | |
#!/usr/bin/env python
# Dan Blankenberg
from __future__ import print_function
import base64
import datetime
import json
import logging
import optparse
import os
import shutil
import subprocess
import tempfile
from json import (
dumps,
loads
)
from os.path import basename
from xml.etree.ElementTree import tostr... | |
# Marshaling code, contributed by Tiago Tresoldi
# This saves/loads models to/from plain text files.
# Unlike Python's shelve and pickle utilities,
# this is useful for inspecting or tweaking the models.
# We may incorporate this as a marshal method in each model.
# TODO: describe each tagger marshal format in the epy... | |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import collections
import os
from builtins import next, object
from contextlib import con... | |
# -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
"""Constants for the LCN component."""
from itertools import product
from homeassistant.const import (
DEGREE,
PERCENTAGE,
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
TEMP_KELVIN,
VOLT,
)
PLATFORMS = ["binary_sensor", "climate", "cover", "light", "scene", "sensor", "switch"]
DOMAIN = "lcn"
DATA_LCN = "lcn... | |
# -*- coding: utf-8 -*-
"""One-mode (unipartite) projections of bipartite graphs.
"""
import networkx as nx
# Copyright (C) 2011 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
__author__ = """\n""".join(['A... | |
""" test a tensorflow model """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import matplotlib
import csv
import plotly.plotly as py
import plotly.graph_objs as go
matplotlib.use("Agg")
import jinja2 as jinja
import numpy as ... | |
"""Useful utilities for higher level polynomial classes."""
import re
from ..core import Add, Mul, Pow
from ..core.exprtools import decompose_power
from ..utilities import default_sort_key
from .polyerrors import GeneratorsNeeded, PolynomialError
from .polyoptions import build_options
_gens_order = {
'a': 301, ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 IBM, Inc.
# Copyright (c) 2012 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... | |
# 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 ... | |
"""Locally Linear Embedding"""
# Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr>
# Jake Vanderplas -- <vanderplas@astro.washington.edu>
# License: BSD 3 clause (C) INRIA 2011
import numpy as np
from scipy.linalg import eigh, svd, qr, solve
from scipy.sparse import eye, csr_matrix
from ..base import ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Basic interface to Amazon MWS
# Based on http://code.google.com/p/amazon-mws-python
#
import urllib
import hashlib
import hmac
import base64
import logging
import datetime
import re
try:
from xml.etree.ElementTree import ParseError as XMLError
except ImportError:... | |
'''Screen Manager
==============
.. versionadded:: 1.4.0
The screen manager is a widget dedicated to managing multiple screens for your
application. The default :class:`ScreenManager` displays only one
:class:`Screen` at a time and uses a :class:`TransitionBase` to switch from one
Screen to another.
Multiple transit... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import shutil
import time
import subprocess
import numpy as np
from .phonopy_conf_creator import PhonopyConfCreator
from vasp.poscar import Poscar
from autotools import symlink_force
class PhononCalculator(object):
def _... | |
import bz2
from cStringIO import StringIO
from array import array
import numpy
from scipy import stats
import sys
import warnings
#
#
# Global settings
#
warnings.simplefilter("ignore")
algorithm_names = ( "Best", "TBest", "Rand", "TRand", "SMDE k=2", "SMDE r=0.001", "SMDE w=0", "SMDE w=5", "SMDE RBF" )
folder = "./res... | |
"""
Created on May 24, 2016
@author: ionut
"""
import datetime
import hashlib
import json
import logging
import os
from io import BytesIO
import piexif
from tornado.web import asynchronous, RequestHandler
from tornado.gen import coroutine
from PIL import Image as PilImage
import cache
import database
import utils
i... | |
"""
Author: Dr. John T. Hwang <hwangjt@umich.edu>
This package is distributed under New BSD license.
LHS sampling; uses the pyDOE2 package.
"""
from pyDOE2 import lhs
from scipy.spatial.distance import pdist, cdist
import numpy as np
from smt.sampling_methods.sampling_method import SamplingMethod
class LHS(Samplin... | |
# Software License Agreement (BSD License)
#
# Copyright (c) 2009-2011, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
# without modification, are permitted provided that the following conditions
# are met:
#
# Redistributions of source ... | |
import datetime
import unittest
from django.test import TransactionTestCase
from django.db import connection, DatabaseError, IntegrityError, OperationalError
from django.db.models.fields import (BinaryField, BooleanField, CharField, IntegerField,
PositiveIntegerField, SlugField, TextField)
from django.db.models.fi... | |
#!python
import sys
import time
import os.path
import xml.etree.ElementTree as xml
from threading import Thread
import xml.etree.ElementTree
from xml.etree.ElementTree import ElementTree, Element, SubElement, dump
from xml.etree.ElementTree import tostring
from xml.dom import minidom
sys.path.append('/opt/C3STEM/Middle... | |
# -*- coding: utf-8 -*-
from ._analytic_rotation import target_rotation
from ._gpa_rotation import oblimin_objective, orthomax_objective, CF_objective
from ._gpa_rotation import ff_partial_target, ff_target
from ._gpa_rotation import vgQ_partial_target, vgQ_target
from ._gpa_rotation import rotateA, GPA
__all__ = []... | |
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:2222")
else:
access = Ser... | |
'''
Copyright (c) 2012 Bryan Oakley
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, softwa... | |
import time
from logger import logger
from perfrunner.helpers import local
from perfrunner.helpers.cbmonitor import timeit, with_stats
from perfrunner.helpers.misc import pretty_dict
from perfrunner.helpers.profiler import with_profiles
from perfrunner.tests import PerfTest, TargetIterator
class N1QLTest(PerfTest):
... | |
import time
from decorator import decorator
from fabric import state
from fabric.api import execute, get, put, run, parallel, settings
from fabric.exceptions import CommandTimeout
from logger import logger
from perfrunner.helpers.misc import uhex
@decorator
def all_hosts(task, *args, **kargs):
self = args[0]
... | |
#
#
# Copyright (C) 2007, 2008, 2010, 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list ... | |
"""Module that contains functions for EPV ingestion in Graph DB."""
from selinon import run_flow, run_flow_selective
import logging
import os
from f8a_jobs.utils import requires_auth
from f8a_utils.gh_utils import GithubUtils
from f8a_utils.tree_generator import GolangDependencyTreeGenerator
import time
from f8a_jobs ... | |
#!/usr/bin/python
"""
Script that automatically generates a Django patch from the Channels codebase
based on some simple rules and string replacements.
Once Channels lands in Django, will be reversed to instead generate this
third-party app from the now-canonical Django source.
"""
import re
import os.path
import sys... | |
from __future__ import with_statement
import sys
import unittest
from nose.tools import eq_, raises
from nose.exc import SkipTest
import fudge
from fudge.inspector import arg
from fudge import (
Fake, Registry, ExpectedCall, ExpectedCallOrder, Call, CallStack, FakeDeclarationError)
def test_decorator_on_def():
... | |
import json
from typing import Optional
from django.db.models import Model, QuerySet
from ..account.models import User
from ..order import FulfillmentStatus, OrderStatus
from ..order.models import Order
from ..payment import ChargeStatus
from ..product.models import Product
from .event_types import WebhookEventType
f... | |
from math import log10
import time
import serial
__author__ = 'Nathan Waddington'
__email__ = 'nathan_waddington@alumni.sfu.ca'
class SmartNixieTubeDisplay:
"""
Nixie tube display, this class controls 1 or more tubes connected in series.
for more info about these nixie tube display drivers, visit http://... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: efourrier
Purpose : the puropose of this modest patch is to create some new methods for
the class Dataframe in order to simplify a data scientist life.
The module is designed as a monkey patch so just import it before starting your
analysis.
It is providing m... | |
from __future__ import absolute_import
import six
from django.core.urlresolvers import reverse
from exam import fixture
from sentry.models import Authenticator, Organization, OrganizationStatus, TotpInterface
from sentry.testutils import APITestCase, TwoFactorAPITestCase
class OrganizationsListTest(APITestCase):
... | |
u'''
Created on Jan 24, 2011
@author: Mark V Systems Limited
(c) Copyright 2011 Mark V Systems Limited, All rights reserved.
'''
from arelle import ViewFile, ModelDtsObject, XbrlConst, XmlUtil
from arelle.ViewFile import CSV, HTML, XML, JSON
import datetime, re
from collections import defaultdict
stripXmlPattern = re... | |
"""
Extracts features into drafts/features.csv
"""
from datetime import datetime, timedelta
import pandas as pd
import db
from util import Timed, features_csv_filename
pd.set_option('display.expand_frame_repr', False)
# players
res = db.session.query(db.Player.id, db.Player).all()
local = dict(res)
GLDB = {}
de... | |
"""Endpoints integrating with Github, Bitbucket, and other webhooks."""
import hashlib
import hmac
import json
import logging
import re
from django.shortcuts import get_object_or_404
from rest_framework import permissions, status
from rest_framework.exceptions import NotFound, ParseError
from rest_framework.renderers... | |
# Copyright 2015 Datera
# 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... | |
"""Hilbert spaces for quantum mechanics.
Authors:
* Brian Granger
* Matt Curry
"""
from sympy import Basic, Interval, oo, sympify
from sympy.printing.pretty.stringpict import prettyForm
from sympy.physics.quantum.qexpr import QuantumError
from sympy.core.compatibility import reduce
__all__ = [
'HilbertSpaceErr... | |
""" Script that drives the kmean algorithm after parsing the user parameters.
The user inputed parameters are used to customize the kmean algorithm's
parameters. The progress of the convergence of the optimal clustering is shown
in each iteration using pyplot.
"""
import numpy
import matplotlib
matplotlib.use('GTKAgg'... | |
#!/usr/bin/env python3
# Copyright (c) 2015-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.
from test_framework.mininode import *
from test_framework.test_framework import MincoinTestFramework
from... | |
#!BPY
"""
Name: 'VegaStrike (selected) (.xmesh)...'
Blender: 228
Group: 'Export'
Tooltip: 'Export VegaStrike (selected) (.xmesh)'
"""
__author__ = "Dandandaman"
__url__ = ("blender", "http://www.blender.org", "Author's homepage, http://black-paralysis.sf.net/")
__version__ = "0.1"
#
# XMESH exporter for Blender v2.... | |
#!/usr/bin/python3
from os import listdir, walk
from os.path import isfile, join
import sys
import collections
import pprint
base_libs = [
"numeric",
"qvm",
"iterator",
"scope_exit",
"vmd",
"move",
"tti",
"atomic",
"static_assert",
"ratio",
"predef",
"property_map",
... | |
###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary for... | |
#!/usr/bin/env python3
# Copyright (c) 2017-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test bitcoin-cli"""
from decimal import Decimal
import re
from test_framework.blocktools import COINB... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Cisco Systems, Inc.
# Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Vers... | |
'''
List View
===========
.. versionadded:: 1.5
.. note::
ListView has been deprecated, use
:class:`~kivy.uix.recycleview.RecycleView` instead.
.. warning::
This code is still experimental, and its API is subject to change in a
future version.
The :class:`~kivy.uix.listview.ListView` implements an... | |
#!/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.
import BaseHTTPServer
import imp
import logging
import multiprocessing
import optparse
import os
import SimpleHTTPServer # pylint:... | |
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Suppressions for V8 correctness fuzzer failures.
We support three types of suppressions:
1. Ignore test case by pattern.
Map a regular expression to a... | |
import os
import numpy, scipy
import scipy.io
import pysces
from pysces.PyscesModelMap import ModelMap
from pylab import figure, close, show, ioff, figtext
from matplotlib.transforms import offset_copy
import io, string
from colorsys import hsv_to_rgb as htor
from matplotlib.figure import Figure as mplfigure
import war... | |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class AssistantTestCase(Integra... | |
from __future__ import division, print_function
import numpy as np
import tensorflow as tf
def weight_variable(shape, name):
initial = tf.truncated_normal(shape, stddev=0.001)
return tf.Variable(initial, name=name)
def bias_variable(shape, name):
b_init = tf.constant_initializer(0.)
return tf.get_v... | |
# Lint as: python2, python3
# Copyright 2018 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
#
... | |
# -*- coding: utf-8 -*-
from pprint import pprint
from sklearn.linear_model import LogisticRegression
from textlytics.sentiment.document_preprocessing import \
DocumentPreprocessor
__author__ = 'Lukasz Augustyniak'
import glob
import pickle
import logging
import pandas as pd
from os import path
from datetime i... | |
try:
from django.core.urlresolvers import reverse
except ImportError:
# TODO: swap this over when Django 2+ becomes more prevalent
from django.urls import reverse
from django.test import TestCase, RequestFactory
from .models import Book, Country, Location, Student
from smart_selects.views import filterchain... | |
from multiprocessing import Pool
from perfrunner.helpers.cbmonitor import timeit, with_stats
from perfrunner.helpers.misc import target_hash
from perfrunner.helpers.profiler import with_profiles
from perfrunner.settings import TargetSettings
from perfrunner.tests import PerfTest, TargetIterator
class XdcrTest(PerfTe... | |
# -*- coding: utf-8 -*-
import unittest
from driftconfig.config import get_drift_table_store, TSTransaction
# TODO:
# - test 'check_only' in Table.add().
def create_basic_domain():
ts = get_drift_table_store()
ts.get_table('domain').add({
'domain_name': 'unit_test_domain',
'display_name': "U... | |
import os
import enum
import collections
import struct
import select
import time
import ctypes
from errno import EINTR
from termios import FIONREAD
from fcntl import ioctl
__all__ = ['flags', 'masks', 'parse_events', 'INotify', 'Event']
_libc = ctypes.cdll.LoadLibrary('libc.so.6')
_libc.__errno_location.restype = cty... | |
#!/usr/bin/env python
#
# 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 "Li... | |
import numpy as np
import astropy.units as u
from astropy.coordinates import Angle
def radial_profile(gal, moment, header=None, dr=100 * u.pc,
max_rad=10 * u.kpc, pa_bounds=None, beam=None):
'''
Create a radial profile of a moment 2 array, optionally with limits on
the angles used.
... | |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
from past.builtins import basestring
import copy
import itertools
import logging
import threading
import random
import string
from functools import wraps, total_ordering
from s... | |
"""Support for HomematicIP Cloud lights."""
import logging
from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_COLOR_NAME, ATTR_HS_COLOR, SUPPORT_BRIGHTNESS,
SUPPORT_COLOR, Light)
from . import DOMAIN as HMIPC_DOMAIN, HMIPC_HAPID, HomematicipGenericDevice
DEPENDENCIES = ['homematicip_cloud']
... | |
"""
Player.py - File for defining a Game class.
"""
import copy
import logging
import datetime
import textwrap
import pandas as pd
import numpy as np
from monopoly.Constants import TOTAL_MONEY, CARD_WIDTH, PROPERTY_INDX, PROPERTY_DEFS, INIT_CASH
from monopoly.Constants import GO, JAIL
from monopoly.Constants import I... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Use genetic map to break chimeric scaffolds, order and orient scaffolds onto
chromosomes.
"""
import os.path as op
import sys
import logging
import numpy as np
from collections import Counter
from functools import lru_cache
from itertools import combinations, groupby
... | |
import inspect
from django.utils.html import strip_tags
from django.utils.encoding import force_unicode
from fields import model_fields
from fields import model_meta_fields
def process_docstring(app, what, name, obj, options, lines):
# This causes import errors if left outside the function
from django.db imp... | |
#!/usr/bin/env python
# nvPY: cross-platform note-taking app with simplenote syncing
# copyright 2012 by Charl P. Botha <cpbotha@vxlabs.com>
# new BSD license
# inspired by notational velocity and nvALT, neither of which I've used,
# and ResophNotes, which I have used.
# full width horizontal bar at top to search
# ... | |
# -*- coding: utf-8 -*-
"""Tests for imfusion.insertions.util module."""
# pylint: disable=wildcard-import,redefined-builtin,unused-wildcard-import
from __future__ import absolute_import, division, print_function
from builtins import *
# pylint: enable=wildcard-import,redefined-builtin,unused-wildcard-import
import p... | |
from __future__ import unicode_literals
from datetime import datetime, timedelta
import pickle
try:
from unittest import skipUnless
except ImportError: # Python 2.6
from django.utils.unittest import skipUnless
import django
from django.db import models
from django.db.models.fields import FieldDoesNotExist
fro... | |
#
# See top-level LICENSE.rst file for Copyright information
#
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import numpy as np
from ..defs import (task_name_sep, task_state_to_int, task_int_to_state)
from ...util import option_list
from ...io import findfile
from .base ... | |
# -*- coding: utf-8 -*-
"""
debug.py - Functions to aid in debugging
Copyright 2010 Luke Campagnola
Distributed under MIT/X11 license. See license.txt for more infomation.
"""
from __future__ import print_function
import sys, traceback, time, gc, re, types, weakref, inspect, os, cProfile, threading
from . import pt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.