gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import time
import os
import json
import glob
import traceback
class SolarDb:
def __init__(self, filenamePrefix, config):
self.config = config
self.m_filenamePrefix = filenamePrefix
# self.data = {} [<name>] = {}
# ["10minute_mAsec"] = int
# ... | |
#!/usr/bin/env python
# encoding: utf-8
# PYTHON_ARGCOMPLETE_OK
# from __future__ imports must occur at the beginning of the file
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
### imports
import os
import sys
import time
import io
import json
import ppri... | |
"""
aggregation.py contains utility functions to handle multiple named and lambda
kwarg aggregations in groupby and DataFrame/Series aggregation
"""
from collections import defaultdict
from functools import partial
from typing import Any, Callable, DefaultDict, List, Sequence, Tuple, Union
from pandas.core.dtypes.com... | |
import argparse
import logging
import os
import subprocess
import time
import yaml
from StringIO import StringIO
import teuthology
from . import orchestra
import orchestra.remote
from .orchestra import run
from .config import FakeNamespace
from .lock import list_locks
from .lock import unlock_one
from .lock import fin... | |
# The MIT License (MIT)
#
# Copyright (c) 2016 Yutkin Dmitry
#
# 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, mod... | |
from geopar.angle_class import Angle
__author__ = 'mostly satbek' # edits by eric braude
class TriangulatedFigure:
"""
Class Invariants
1: self.triangles is a list of triangle, each with a unique set of vertices
2: For every triangle t1 in self.triangles, there is a t2 in self.triangles
such ... | |
from __future__ import absolute_import
from collections import namedtuple
from copy import deepcopy
import logging
import random
import sys
import time
import six
from kafka.client import SimpleClient
from kafka.common import (
check_error, NotLeaderForPartitionError, UnknownTopicOrPartitionError,
OffsetOutO... | |
from decimal import Decimal
from django.db.models.query_utils import Q
from corehq import Domain
from corehq.apps.accounting import generator
from corehq.apps.accounting.models import BillingAccount, DefaultProductPlan, SoftwarePlanEdition, Subscription
from corehq.apps.commtrack.models import StockState, SupplyPointCa... | |
#(c) 2016 by Authors
#This file is a part of ABruijn program.
#Released under the BSD license (see LICENSE file)
"""
Separates alignment into small bubbles for further correction
"""
from __future__ import absolute_import
from __future__ import division
import logging
from bisect import bisect
from flye.six.moves imp... | |
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (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.mozilla.org/MPL/
#
# Softwa... | |
# 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 ... | |
import anemoi as an
import pandas as pd
import numpy as np
import itertools
def wind_speed_data_for_annual_shear(mast_data, wind_speed_sensors=None, match_data=True):
"""Perform checks on wind speed data for shear calculations."""
ano_data = an.utils.mast_data.return_data_from_anemometers(mast_data)
if m... | |
# -*- coding: utf-8 -*-
"""
These the test the public routines exposed in types/common.py
related to inference and not otherwise tested in types/test_common.py
"""
from warnings import catch_warnings
import collections
import re
from datetime import datetime, date, timedelta, time
from decimal import Decimal
import n... | |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'HSV-Moder.ui'
#
# Created by: PyQt5 UI code generator 5.9
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindo... | |
""" Module: IDL:Tango:1.0
Automagically generated by:-
The ORB called Fnorb v1.1.Return.of.Fnorb
"""
_FNORB_ID = "IDL:Tango:1.0"
# Fnorb modules.
import Fnorb.orb.CORBA
import Fnorb.orb.TypeManager
import Fnorb.orb.Util
class Device_skel(Fnorb.orb.CORBA.Object_skel):
""" Interface: IDL:Tango/Device:1.0 """
... | |
import random, sys, time, pygame, os
from pygame.locals import *
#import wifitools
import pickle
import sqlite3
import datetime
import medManager
import userManager
##TODO: change for PI
#os.environ["SDL_FBDEV"] = "/dev/fb1"
#os.environ["SDL_MOUSEDEV"] = "/dev/input/touchscreen"
#os.environ["SDL_MOUSEDRV"] = "TSLIB"
... | |
"""Extend introspect.py for Java based Jython classes."""
from org.python.core import PyReflectedFunction
from java.lang import Class, Object
from java.lang.reflect import Modifier
from introspect import *
from sets import Set
import string
import re
import types
__author__ = "Don Coleman <dcoleman@chariotsolutions.c... | |
#!/usr/bin/env python
import argparse
import binascii
import copy
import datetime
import hashlib
import json
import logging
import os
import shutil
import struct
import subprocess
import tempfile
import xml.etree.ElementTree as ET
from collections import defaultdict
from Bio.Data import CodonTable
logging.basicConfig(... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Implements rotations, including spherical rotations as defined in WCS Paper II
[1]_
`RotateNative2Celestial` and `RotateCelestial2Native` follow the convention in
WCS Paper II to rotate to/from a native sphere and the celestial sphere.
The implement... | |
"""Conversion tool from CTF to FIF
"""
# Author: Eric Larson <larson.eric.d<gmail.com>
#
# License: BSD (3-clause)
import os
from os import path as op
import numpy as np
from ...utils import verbose, logger
from ...externals.six import string_types
from ..base import _BaseRaw
from ..utils import _mult_cal_one, _bl... | |
import sys
class colorize(str):
"""
Pretty simple to use::
colorize.make('foo').bold
colorize.make('foo').green
colorize.make('foo').yellow
colorize.make('foo').red
colorize.make('foo').blue
Otherwise you could go the long way (for example if you are
testing t... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apac... | |
#!/usr/bin/env python
"""Simple parsers for the output of WMI queries."""
import binascii
import calendar
from grr.lib import parsers
from grr.lib import rdfvalue
from grr.lib import time_utils
class WMIInstalledSoftwareParser(parsers.WMIQueryParser):
"""Parser for WMI output. Yields SoftwarePackage rdfvalues.""... | |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, UserManager
from django.conf import settings
from django.template import loader
from django.template.context import Context
from django.utils.http import urlsaf... | |
import collections
import os
import sys
import time
import traceback
import six
from chainer import reporter as reporter_module
from chainer import serializer as serializer_module
from chainer.training import extension as extension_module
from chainer.training import trigger as trigger_module
from chainer.utils impor... | |
__author__ = 'krishnab'
from operator import neg, truediv
import numpy as np
import pandas as pd
from numpy.random import binomial
from models.Models import Base_model
class Basic_stochastic_model_fixed_promotion(Base_model):
def __init__(self, **kwds):
Base_model.__init__(self, **kwds)
self.nam... | |
# Copyright 2012, Nachi Ueno, NTT MCL, 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
#
# Unles... | |
"""
Custom manager for Objects.
"""
from itertools import chain
from django.db.models import Q
from django.conf import settings
from django.db.models.fields import exceptions
from evennia.typeclasses.managers import TypedObjectManager, TypeclassManager
from evennia.typeclasses.managers import returns_typeclass, returns... | |
import pexpect
import time
import weakref
from fluxgui.exceptions import *
class XfluxController(object):
"""
A controller that starts and interacts with an xflux process.
"""
def __init__(self, color='3400', pause_color='6500', **kwargs):
if 'zipcode' not in kwargs and 'latitude' not in kwar... | |
from hashlib import sha1
import mimetypes
import traceback
import warnings
from django.contrib.sites.models import Site
from django.core.exceptions import ValidationError
from django.core.files.storage import default_storage
from django.core.urlresolvers import reverse
from django.core.validators import ipv4_re
from d... | |
import inspect
import time
import types
import unittest
from mock import (
call, create_autospec, MagicMock,
Mock, ANY, patch, PropertyMock
)
from mock.mock import _Call, _CallList, _callable
from mock import IS_PYPY
from datetime import datetime
from functools import partial
import pytest
class SomeClass(... | |
"""Test the init file for the Insteon component."""
import asyncio
import logging
from pyinsteon.address import Address
from homeassistant.components import insteon
from homeassistant.components.insteon.const import (
CONF_CAT,
CONF_OVERRIDE,
CONF_SUBCAT,
CONF_X10,
DOMAIN,
PORT_HUB_V1,
POR... | |
# Copyright 2013-present Barefoot Networks, 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 ... | |
"""
Views that inherit from Django's class-based generic views and add methods
for building flat files.
"""
import os
import six
import sys
import gzip
import shutil
import logging
import mimetypes
from django.conf import settings
from bakery import DEFAULT_GZIP_CONTENT_TYPES
from django.test.client import RequestFacto... | |
# -*- coding: utf-8 -*-
"""This file contains a helper library to read binary files."""
import binascii
import logging
import os
from plaso.lib import py2to3
def ByteArrayCopyToString(byte_array, codepage=u'utf-8'):
"""Copies a UTF-8 encoded byte array into a Unicode string.
Args:
byte_array: A byte array ... | |
# 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... | |
import json
import os
import tempfile
from django.conf import settings
from django.core.cache import cache
from django.core.files.storage import default_storage as storage
from django.db.models import Q
from django.test.utils import override_settings
import mock
from PIL import Image
from pyquery import PyQuery as pq... | |
#!/usr/bin/env python3
"""This is main runner of generator
"""
import datetime
import logging
import re
import sys
from argparse import ArgumentParser
from collections import namedtuple, OrderedDict
from inspect import getfile
from os.path import basename
from pprint import pformat
from time import sleep
from xml.etre... | |
# Copyright 2014-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 writin... | |
import asyncio
import sys
import time
import unittest
import six
if six.PY3:
from unittest import mock
else:
import mock
from engineio import asyncio_socket
from engineio import exceptions
from engineio import packet
from engineio import payload
def AsyncMock(*args, **kwargs):
"""Return a mock asynchron... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, 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
DOCUMENTATION = r'''
---
module: bigip_gtm_monitor_bigip... | |
# Copyright (c) 2009-2021 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause
# License.
"""Apply forces to particles."""
import hoomd
from hoomd import _hoomd
from hoomd.md import _md
from hoomd.operation import _HOOMDBaseObject
from hoomd.logging ... | |
"""
Asynchronous Advantage Actor Critic (A3C) with Continuous Action Space.
Actor Critic History
----------------------
A3C > DDPG (for continuous action space) > AC
Advantage
----------
Train faster and more stable than AC.
Disadvantage
-------------
Have bias.
Reference
----------
Original Paper: https://arxiv.or... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2010 Anso Labs, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# ... | |
#!/usr/bin/python
"""This module provides the :class:`Deck` object
"""
import deck_of_cards.card as card
import random
import logging
#: a logger object
LOGGER = logging.getLogger(__name__)
class Deck(object):
"""A Deck object
A new deck starts out ordered.
If jokers are included, contains (2 + 4 * 13)... | |
#!/usr/bin/env python
# Copyright (c) 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.
"""Run Performance Test Bisect Tool
This script is used by a try bot to run the bisect script with the parameters
specified in the... | |
#!/usr/bin/env python
#
# Copyright (C) 2013-2015 eNovance SAS <licensing@enovance.com>
# Author: Erwan Velu <erwan@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# h... | |
"""
This module contains integer constants from a C header file named something
like gl.h.
"""
GL_DEPTH_BUFFER_BIT = 0x00000100
GL_STENCIL_BUFFER_BIT = 0x00000400
GL_COLOR_BUFFER_BIT = 0x00004000
GL_POINTS = 0x0000
GL_LINES = 0x0001
GL_LINE_LOOP = 0x0002
GL_LINE_STRIP = 0x0003
GL_TRIANGLES = 0x0004
GL_TRIANGLE_STRIP =... | |
# -*- coding:utf8 -*-
# File : desc_a3cc_box2d_LunarLanderContinuousV2.py
# Author : Jiayuan Mao
# Email : maojiayuan@gmail.com
# Date : 5/31/17
#
# This file is part of TensorArtist.
"""
A3C-Continuous reproduction on Lunar Lander game. (OpenAI.Gym.Box2D.LunarLander)
This model does not follows the original sett... | |
import unittest
import numpy
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
def sigmoid(x):
return numpy.tanh(x * 0.5) * 0.5 + 0.5
def _split(in... | |
# 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... | |
from __future__ import annotations
import os
from collections import OrderedDict
from collections.abc import Iterable, Sequence
from logging import ERROR, WARNING, getLogger
from typing import ClassVar, Optional
import git
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import yaml
from IPython... | |
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2006,2007,2008,2009 Frank Scholz <coherence@beebits.net>
from sets import Set
from twisted.internet import reactor, defer
from twisted.internet.task import LoopingCall
from twisted.python import failure
from coherence.upnp... | |
#!/usr/bin/env python
import os
import shutil
import subprocess
import tempfile
import unittest
from mozprofile.prefs import Preferences
from mozprofile.profile import Profile
class PreferencesTest(unittest.TestCase):
"""test mozprofile"""
def run_command(self, *args):
"""
runs mozprofile;
... | |
# 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
# d... | |
# -*- 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... | |
import datetime
import json
import furl
import responses
from django.utils import timezone
from nose.tools import * # flake8: noqa
from framework.auth.core import Auth
from addons.github.models import GithubFolder
from addons.github.tests.factories import GitHubAccountFactory
from api.base.settings.defaults import ... | |
# Copyright (c) 2011 Zadara Storage Inc.
# Copyright (c) 2011 OpenStack Foundation
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | |
# -*- coding: utf-8 -*-
#
# Copyright 2015-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | |
#!/usr/bin/env python3
from strips import *
#def astar(p, s, a):
# start = (p, s, a)
# closed = []
# open = []
# gh = []
#
# def heuristic_cost_estimate(x): return 0
#
# def add_to_open(x, g, h):
# if x not in open:
# open.append(x)
# gh = (g, h)
#
# def find_next_bes... | |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, 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 t... | |
##########################################################################
#
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Red... | |
"""Test config utils."""
# pylint: disable=too-many-public-methods,protected-access
import os
import unittest
import unittest.mock as mock
import pytest
from voluptuous import MultipleInvalid
from homeassistant.core import DOMAIN, HomeAssistantError, Config
import homeassistant.config as config_util
from homeassistan... | |
# -*- coding: utf-8 -*-
import base64
from io import BytesIO
import logging
from urllib.parse import urlparse, urljoin
from lxml.html import HtmlElement
from PIL import Image as ImageLib, ImageFile
from scrapy.http import Request
from scrapy.pipelines.media import MediaPipeline
from mydm.util import is_url
logge... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
import pickle
import theano
import theano.tensor as T
from pylearn2.models import mlp
from pylearn2.training_algorithms import sgd
from pylearn2.training_algorithms.learning_rule import AdaGrad
from pylearn2.training_algorithms.learning_rule import Momentum
from pylearn2.training_algorithms.sgd import ExponentialDecay
... | |
"""
Color markups
Contribution, Griatch 2017
Additional color markup styles for Evennia (extending or replacing the default |r, |234 etc).
Installation:
Import the desired style variables from this module into mygame/server/conf/settings.py and add them
to these settings variables. Each are specified as a list, an... | |
import numpy as np
from ..regularization import BaseSimilarityMeasure
from ..utils import eigenvalue_by_power_iteration
from ..optimization import IterationPrinters, StoppingCriteria
from .directives import InversionDirective, SaveEveryIteration
########################################################################... | |
#!/usr/bin/env python
from sys import stdout, stderr, exit, maxint
from optparse import OptionParser
from itertools import product, combinations, izip
from os.path import basename, dirname, join, isfile
from random import shuffle
import logging
import csv
import re
MARKER_PAT = re.compile('^([^:]+):(\d+):(\d+)(\+$|-$... | |
# Copyright(c) 2014, The scLVM developers (Forian Buettner, Paolo Francesco Casale, Oliver Stegle)
#
#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... | |
__author__ = 'chris'
"""
Copyright (c) 2015 Chris Pacia
"""
import bitcoin
import random
from io import BytesIO
from random import shuffle
from protocol import PeerFactory
from twisted.internet import reactor, defer, task
from discovery import dns_discovery
from binascii import unhexlify
from extensions import BloomFil... | |
# 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 ... | |
# This is a patched version of apparentlymart's python-nextbus
# library available on Google. All rights to it remain his. This
# is not a project of Matt Conway or Portland Transport.
from xml.etree import ElementTree
from urllib import urlencode
NEXTBUS_SERVICE_URL = "http://webservices.nextbus.com/service/publicX... | |
#!/usr/bin/env python
# Copyright FuseSoC contributors
# Licensed under the 2-Clause BSD License, see LICENSE for details.
# SPDX-License-Identifier: BSD-2-Clause
import argparse
import os
import shutil
import signal
import subprocess
import sys
import warnings
from fusesoc import __version__
# Check if this is run ... | |
<<<<<<< HEAD
<<<<<<< HEAD
"""Tests for distutils.dir_util."""
import unittest
import os
import stat
import sys
from unittest.mock import patch
from distutils import dir_util, errors
from distutils.dir_util import (mkpath, remove_tree, create_tree, copy_tree,
ensure_relative)
from distu... | |
# Copyright 2011 OpenStack Foundation
# Copyright 2011 Ilya Alekseyev
#
# 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
#
#... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 IBM Corp.
#
# 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
#
# ... | |
from sympy import sympify, Add, ImmutableMatrix as Matrix
from sympy.core.compatibility import u, unicode
from .printing import (VectorLatexPrinter, VectorPrettyPrinter,
VectorStrPrinter)
__all__ = ['Dyadic']
class Dyadic(object):
"""A Dyadic object.
See:
http://en.wikipedia.org/w... | |
# texttable - module for creating simple ASCII tables
# Copyright (C) 2003-2015 Gerome Fournier <jef(at)foutaise.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.... | |
from u2fval import app, exc
from u2fval.model import db, Client
from .soft_u2f_v2 import SoftU2FDevice, CERT
from six.moves.urllib.parse import quote
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.serialization import Encoding
import unittest
i... | |
# 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... | |
"""
Linear Discriminant Analysis and Quadratic Discriminant Analysis
"""
# Authors: Clemens Brunner
# Martin Billinger
# Matthieu Perrot
# Mathieu Blondel
# License: BSD 3-Clause
import warnings
import numpy as np
from .exceptions import ChangedBehaviorWarning
from scipy import linalg
from... | |
import numpy as np
from os import path
from pandas import read_csv
from lib.Astro_Libraries.spectrum_fitting.plot_tools import MCMC_printer
from collections import OrderedDict
from lib.Astro_Libraries.spectrum_fitting.import_functions import ImportModelData, parseObjData, make_folder
from lib.Astro_Libraries.spectrum_f... | |
from __future__ import absolute_import, division
from django.conf import settings
from django.core import urlresolvers
from django.db import connection
from django.db.models import Sum
from django.db.models.query import QuerySet
from django.http import HttpResponseNotFound, HttpRequest, HttpResponse
from django.templa... | |
"""Common test objects."""
import copy
from datetime import datetime
import json
from unittest.mock import ANY, patch
import yaml
from homeassistant import config as hass_config
from homeassistant.components import mqtt
from homeassistant.components.mqtt import debug_info
from homeassistant.components.mqtt.const impo... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__='ar'
import re
import sys
import os
import glob
import time
import json
import numpy as np
import skimage.io as io
import skimage.color as skcolor
import skimage.transform as sktransform
import matplotlib.pyplot as plt
from keras import backend as K
import keras
f... | |
#! /usr/bin/env python
# encoding: utf-8
#
# Copyright (C) 2011 Serge Monkewitz
#
# 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... | |
# -*- coding: utf-8 -*-
from collections import namedtuple
import six
CustomType = namedtuple('CustomType', 'customize reset')
MetaInfo = namedtuple('MetaInfo', 'readonly is_typed source_name')
class SourceMeta(type):
"""Initialize subclasses and source base class"""
def __new__(self, name, bases, dct):
... | |
#!/usr/bin/env python
"""
test2.py
[--log_file PATH]
[--verbose]
"""
################################################################################
#
# test2
#
#
# Copyright (c) 7/16/2010 Leo Goodstadt
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this so... | |
import binascii
import bsdiff4
import os
import tempfile
import unittest
from fuse import FUSE
from basefs import exceptions
from basefs.keys import Key
from basefs.logs import LogEntry
from basefs.views import View
from . import utils
class ViewTests(unittest.TestCase):
def setUp(self):
__, self.logpa... | |
'''``TotoService`` can be used to write general processes that take advantage of the process creation/management features
used by ``TotoServer`` and ``TotoWorker`` - the two built in subclasses of ``TotoService``. ``TotoService`` subclasses can be
run with the ``--start`` (or ``--stop``) and ``--processes`` optio... | |
import json
from abc import ABCMeta
from collections import defaultdict
from django.template.loader import render_to_string
from django.utils import six
from django.utils.functional import Promise
from cms.utils.compat.dj import force_unicode
from cms.constants import RIGHT, LEFT, REFRESH_PAGE, URL_CHANGE
class Ite... | |
#!/usr/bin/env python
from collections import OrderedDict
import inspect
import json
import os
import re
import shutil
import io
from subprocess import call, Popen, PIPE
import sys, getopt
import pkg_resources
import subprocess
from jinja2 import Environment, FileSystemLoader
from drafter_postprocessing.json_process... | |
# -*- coding: utf-8 -*-
# Copyright 2011 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 require... | |
from django.contrib.auth.models import Permission
from django.test import TestCase, override_settings
from django.urls import reverse
from django.utils.text import capfirst
from wagtail.admin.edit_handlers import FieldPanel, ObjectList, TabbedInterface
from wagtail.contrib.settings.registry import SettingMenuItem
from... | |
__author__ = ["Nurendra Choudhary <nurendrachoudhary31@gmail.com>", "Anoop Kunchukuttan <anoop.kunchukuttan@gmail.com>"]
__license__ = "GPLv3"
# Indic NLP Library 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 Foundatio... | |
#!/usr/bin/env python
# standard library
import itertools
import random
# third party
import dendropy as dpy
import numpy as np
from tree_distance import PhyloTree
# treeCl
from .errors import optioncheck
from .constants import ISPY3
from .utils import fileIO, weighted_choice
from .utils.decorators import lazyprop
f... | |
"""
Code base for : The Holy Quran, translations and discussions
@author Abdullah Al Zakir Hossain, Email: aazhbd@yahoo.com
@copyright Copyright (c)2009-2016 ArticulateLogic Labs
"""
from django.shortcuts import render
from django.shortcuts import render_to_response
from django.http import HttpResponse
f... | |
"""
Utilities to extract features from images.
"""
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Olivier Grisel
# Vlad Niculae
# License: BSD
import numpy as np
from scipy import sparse
from ..utils.fixes import in1d... | |
import logging
__author__ = 'tjhunter'
'''
Created on Nov 28, 2011
@author: tjhunter
Plotting script.
PLOT_EXPORT=../papers/2011_PathInference/images/ PYTHONPATH=. MM_DATA_DIR="/home/tjhunter/tmp/high_frequency/" python mm/path_inference_private/plot_final.py
PLOT_EXPORT="/home/tjhunter/work/mm/mm_code/mobilemil... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.