gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
"""
Base classes for writing management commands (named commands which can
be executed through ``tipi.py``).
"""
import os
import sys
from ConfigParser import ConfigParser
from optparse import make_option, OptionParser
from virtualenv import resolve_interpreter
class CommandError(Exception):
"""
Exception cl... | |
# Copyright 2014 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.
from __future__ import division
from __future__ import absolute_import
import logging
import time
import six
import six.moves.urllib.parse # pylint: disable=... | |
import OpenGL
OpenGL.USE_ACCELERATE = True
OpenGL.ERROR_ON_COPY = False
OpenGL.ERROR_CHECKING = False
OpenGL.FULL_LOGGING = False
OpenGL.ARRAY_SIZE_CHECKING = True
import numpy as np
np.set_printoptions(precision=2, suppress=True)
from OpenGL.GL import *
from OpenGL.GL.shaders import compileProgram, compileShader
fr... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from asdf.versioning import AsdfVersion
from astropy.modeling import mappings
from astropy.modeling import functional_models
from astropy.modeling.core import CompoundModel
from astropy.io.misc.asdf.types import AstropyAsdfType, A... | |
# ------------------------------------------------------------------------
#
# Copyright 2005-2015 WSO2, Inc. (http://wso2.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.... | |
#!/usr/bin/env python
import uuid
import json
from time import time
import gevent
from gevent import event as gevent_event
from pyon.public import log
from pyon.core.exception import NotFound, BadRequest, ServerError
from pyon.util.containers import create_valid_identifier
from pyon.ion.event import EventPublisher, ... | |
"""
blog.test_views.py
==================
Test Views for Blog App
"""
import logging
import datetime
from django.core.urlresolvers import reverse
from django_dynamic_fixture import G
from rest_framework import status
from rest_framework.test import APIClient, APITestCase
from accounts.models import Acc... | |
# -*- coding: utf-8 -*-
#
# 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
... | |
"""Support for LG TV running on NetCast 3 or 4."""
from datetime import timedelta
import logging
from pylgnetcast import LgNetCastClient, LgNetCastError
from requests import RequestException
import voluptuous as vol
from homeassistant import util
from homeassistant.components.media_player import PLATFORM_SCHEMA, Medi... | |
# 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... | |
# Copyright 2013 Google Inc. All Rights Reserved.
"""Base classes for calliope commands and groups.
"""
import abc
from googlecloudsdk.calliope import usage_text
from googlecloudsdk.core import log
from googlecloudsdk.core.util import resource_printer
class LayoutException(Exception):
"""An exception for when a ... | |
#!/usr/bin/env python
# Copyright 2017 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... | |
import math
import os
import shutil
import tempfile
import unittest
import mleap.pyspark # noqa
from mleap.pyspark.spark_support import SimpleSparkSerializer # noqa
import pandas as pd
from pandas.testing import assert_frame_equal
from pyspark.ml import Pipeline
from pyspark.sql.types import FloatType
from pyspark.... | |
# 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
#
# Unless required by applica... | |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
import re
import weakref
from threading import local, Thread
from ..compat import implements_to_string, text_type, string_types, number_types
from . import dataindex
from .dataindex import parse, join,... | |
# -*- coding: utf-8 -*-
from girder.exceptions import ValidationException
from girder.models.folder import Folder
from girder.models.setting import Setting
from girder.models.user import User
from tests import base
from girder_item_licenses.settings import PluginSettings
def setUpModule():
base.enabledPlugins.ap... | |
"""
Topographica cortical map simulator package.
Topographica is designed as a collection of packages from which
elements can be selected to model specific systems. For more
information, see the individual subpackages::
base - Core Topographica functions and classes
plotting - Visualization funct... | |
__authors__ = ['Andrew Taylor']
import random
import time
import pygame
# Python comes with some color conversion methods.
import colorsys
# For Math things, what else
import math
from VisualisationPlugin import VisualisationPlugin
import logging
# Video available here:
# http://www.youtube.com/watch?v=ySJlUu2926A&... | |
from __future__ import absolute_import
import logging
from enum import Enum as NativeEnum, IntEnum as NativeIntEnum
from typing import Any, Dict, List, Optional, Sequence, Tuple, TypeVar, Union, cast
import six
try:
from django.utils.functional import classproperty # type: ignore
except ImportError:
# Pre-D... | |
# 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 agreed to in writing, s... | |
# 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 ... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2017, Zhijiang Yao, Jie Dong and Dongsheng Cao
# All rights reserved.
# This file is part of the PyBioMed.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the PyBioMed source tree.
"""
#####... | |
import datetime
import mongoengine as mongo
import urllib2
import redis
from django.conf import settings
from apps.social.models import MSharedStory
from apps.profile.models import Profile
from apps.statistics.rstats import RStats, round_time
from utils import json_functions as json
from utils import db_functions
from ... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
from sklearn.datasets import base as bunch
from learner.strategy import Joint, Sequential
import numpy as np
from nltk import RegexpTokenizer
from nltk.stem import PorterStemmer
def sample_data(data, train_idx, test_idx):
sample = bunch.Bunch(train=bunch.Bunch(), test=bunch.Bunch())
if len(test_idx) > 0... | |
import datetime
import logging
import os
import time
import hashlib
import json
import random
import requests
import signal
import socket
import subprocess
import sys
import traceback
import datetime
from datetime import timedelta
import tarfile
import copy
import shutil
import tempfile
import io
import locale
import j... | |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
#!/usr/bin/env python
# A robot morphology (currently a snake and a phantomx robot morphology) is set out to learn locomotion patterns to perform according to the reward function. The reward
# function can be something like moving along or reaching a certain speed in the direction of a certain axis. The morphologies ... | |
# Copyright 2017 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
# -*- coding: utf-8 -*-
#
# Copyright 2017 Ricequant, 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 ... | |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | |
""" Utility functions for algebra etc """
import itertools
import math
import numpy as np
import numpy.linalg as npl
# epsilon for testing whether a number is close to zero
_EPS = np.finfo(float).eps * 4.0
# axis sequences for Euler angles
_NEXT_AXIS = [1, 2, 0, 1]
# map axes strings to/from tuples of inner axis, p... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division
from collections import namedtuple
import copy
import math
import os
import re
import warnings
import numpy as np
from ..common.constants import FLOAT_dtype
from ..common.functions import pyNormalizeAngle
from ..geometry import affineTransform
... | |
#!/usr/bin/python
import sys
import zmq
import random
import time
import os, pwd
import datetime
import json
import getopt
import socket
import happybase
import hashlib
import struct
import traceback
import re
# adjust to match your $PREFIX if you specified one
# default PREFIX = /usr/local
sys.path.append('/usr/loc... | |
import logging
log = logging.getLogger(__name__)
import itertools
import importlib
from functools import partial
from collections import defaultdict
import numpy as np
import pandas as pd
import pyqtgraph as pg
from atom.api import (Unicode, Float, Tuple, Int, Typed, Property, Atom, Bool,
Enum... | |
'''
Copyleft Mar 26, 2017 Arya Iranmehr, PhD Student, Bafna Lab, UC San Diego, Email: [email protected]
'''
import numpy as np;
np.set_printoptions(linewidth=200, precision=5, suppress=True)
import pandas as pd;
pd.options.display.max_rows = 20;
pd.options.display.expand_frame_repr = False
import seaborn as sns
im... | |
#!/usr/bin/env python
# Copyright 2016 Vijayaditya Peddinti
# Apache 2.0
from __future__ import print_function
import argparse
import sys
import os
import subprocess
import errno
import copy
import shutil
import warnings
def GetArgs():
# we add compulsary arguments as named arguments for readability
parser =... | |
"""Symbolic primitives + unicode/ASCII abstraction for pretty.py"""
from __future__ import print_function, division
import sys
import warnings
unicode_warnings = ''
from sympy.core.compatibility import u, unicode, range
# first, setup unicodedate environment
try:
import unicodedata
def U(name):
"""... | |
import base64
import collections
import functools
import logging
import six
from six.moves import urllib
from . import cosmos
from .. import util
from ..errors import (DCOSAuthenticationException,
DCOSAuthorizationException, DCOSBadRequest,
DCOSConnectionError, DCOSExceptio... | |
# Copyright 2012, Nachi Ueno, NTT MCL, 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 applic... | |
"""
This module defines the database models for all in-game objects, that
is, all objects that has an actual existence in-game.
Each database object is 'decorated' with a 'typeclass', a normal
python class that implements all the various logics needed by the game
in question. Objects created of this class transparentl... | |
# -*- coding: utf-8 -*-
from flexmock import flexmock, flexmock_teardown
from orator.connections import Connection
from orator.schema.grammars import SQLiteSchemaGrammar
from orator.schema.blueprint import Blueprint
from ... import OratorTestCase
class SqliteSchemaGrammarTestCase(OratorTestCase):
def tearDown(se... | |
"""Component for controlling Pandora stations through the pianobar client."""
from datetime import timedelta
import logging
import os
import re
import shutil
import signal
import pexpect
from homeassistant import util
from homeassistant.components.media_player import MediaPlayerDevice
from homeassistant.components.me... | |
# Copyright (C) 2016 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | |
#!/usr/bin/env python
import copy
import unittest
from nose.tools import *
import networkx
from test_graph import TestGraph
class TestMultiGraph(TestGraph):
def setUp(self):
self.Graph=networkx.MultiGraph
# build K3
ed1,ed2,ed3 = ({0:{}},{0:{}},{0:{}})
self.k3adj={0: {1: ed1, 2: ed... | |
#!/usr/bin/env python
# (C) Copyright IBM Corporation 2004, 2005
# All Rights Reserved.
#
# 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
# ... | |
from unittest import TestCase
import filters as f
from filters.test import BaseFilterTestCase
from iota import Address, Iota, AsyncIota
from iota.adapter import MockAdapter, async_return
from iota.commands.extended.is_reattachable import IsReattachableCommand
from test import patch, MagicMock, async_test
class IsRea... | |
#!/usr/bin/env python
"""
Asset Management - Deployments: Support for cache related functions.
"""
__author__ = 'Edna Donoughe'
from copy import deepcopy
from ooiservices.app import cache
from ooiservices.app.uframe.config import get_cache_timeout
from ooiservices.app.uframe.uframe_tools import _get_id_by_uid
from o... | |
"""Test the Xiaomi Aqara config flow."""
from socket import gaierror
import pytest
from homeassistant import config_entries
from homeassistant.components import zeroconf
from homeassistant.components.xiaomi_aqara import config_flow, const
from homeassistant.const import CONF_HOST, CONF_MAC, CONF_NAME, CONF_PORT
from... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Utility functions used across api code."""
import logging
import subprocess
from decorator import decorator
try:
from google.protobuf.descriptor import FieldDescriptor
#Map descriptor.CPPTYPE -> python type.
_python_to_cpp_types = {
long: ('int32',... | |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
from telemetry import benchmark
from telemetry import page as page_module
from telemetry.core import util
from telemetry.page import page_set
from... | |
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | |
# -*- coding: utf-8 -*-
'''
Many aspects of the salt payload need to be managed, from the return of
encrypted keys to general payload dynamics and packaging, these happen
in here
'''
# Import python libs
from __future__ import absolute_import
# import sys # Use if sys is commented out below
import logging
import gc
i... | |
# The MIT License (MIT)
#
# Copyright (c) 2015 Philippe Proulx <eepp.ca>
#
# 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 us... | |
#
# 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... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This is a port of the MicroPython upip utility to CPython
# Port Copyright (c) Peter Hinch
# Licensed under the MIT license.
# upip licensing/attribution
# upip - Package manager for MicroPython
#
# Copyright (c) 2015-2018 Paul Sokolovsky
#
# Licensed under the MIT lic... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Red Hat, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | |
#!/usr/bin/env python
# Author: Andrew Jewett (jewett.aij at g mail)
# License: MIT License (See LICENSE.md)
# Copyright (c) 2020, Scripps Research
# All rights reserved.
man_page_text = """
Usage (example):
postprocess_transitions.py ttree_assignments.txt -t file.template \
> new_file.template
Where "file.tem... | |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.23
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | |
# 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... | |
'''
#------------------------------------------------------------------------------
# TF Dataset object for training & validation using TFGRAND5
#------------------------------------------------------------------------------
# Features:
# Input/Output
# - Input (from GRAND5)
# Dimension : 24x320x320
# ... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
"""
This module implements an interface to enumlib, Gus Hart"s excellent Fortran
code for enumerating derivative structures.
This module depends on a compiled... | |
"""
Command-line interface for model evaluation
@author Siddharth Reddy <[email protected]>
"""
from __future__ import division
import click
import logging
import math
import pickle
import os
import pandas as pd
import numpy as np
from lentil import datatools
from lentil import models
from lentil import est
from l... | |
from datetime import date
from datetime import datetime
from dateutil import tz
import time
def nordic2Arrival(data, arrival_id):
"""
Function for converting a nordic file into a Arrival string
:param NordicData data: NordicData object to be converted
:param int arrival_id: arrival id of the assoc
... | |
## This code is written by Davide Albanese, <[email protected]>.
## (C) 2008 mlpy Developers.
## This program 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 op... | |
# -*- coding: utf-8 -*-
"""
sphinx.util.nodes
~~~~~~~~~~~~~~~~~
Docutils node-related utility functions for Sphinx.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from six import text_type
from docutils import nodes
from sp... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import unittest
import json
import os
from pymatgen.electronic_structure.cohp import CompleteCohp, Cohp, IcohpValue, IcohpCollection
from pymatgen.electronic_structure.core import Spin, Orbital
from pymatgen.u... | |
#!/usr/bin/env python
#################################################################################
# # #
# GraphCSV converts CSV input files into a HTML file containing all CSS and #
# JavaScript inline. #
# #
# @author Shane Brennan ... | |
# 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 time
import subprocess
import logging
from emuvim.dcemulator.net import DCNetwork
from emuvim.api.rest.rest_api_endpoint import RestApiEndpoint
from emuvim.dcemulator.resourcemodel.upb.simple import UpbSimpleCloudDcRM
from emuvim.dcemulator.resourcemodel import ResourceModelRegistrar
import os
import sys
impor... | |
"""Provide data suitable for Fava's charts. """
from datetime import date
from datetime import timedelta
from typing import Any
from typing import Dict
from typing import Generator
from typing import List
from typing import Optional
from typing import Pattern
from typing import Tuple
from typing import Union
from bean... | |
"""This is a helper which provides a set of definitions and Actors
that can be used to run external commands and gather responses from
them.
Create a RunCommand Actor and send it a Command object defining the
command to be run; the RunCommand will execute the command, monitoring
its progress, and sends a CommandResult... | |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
from __future__ import unicode_literals
import copy
import datetime
from django.db import models
from django.utils.functional import curry
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from audit_log.models.fields import LastUserField
try:
from django.utils.timezone im... | |
from datetime import datetime, timedelta
from django.conf import settings
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import permission_required
from django.contrib.contenttypes.models import ContentType
from django.core.mail import EmailMultiAlternatives
... | |
import numpy as np
import matplotlib.pyplot as pl
from matplotlib import rcParams
from scvelo.tools.utils import groups_to_bool
from scvelo.tools.velocity_embedding import velocity_embedding
from .docs import doc_params, doc_scatter
from .scatter import scatter
from .utils import (
default_basis,
default_colo... | |
import datetime
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
import pytz
from django.test import TestCase
from django.utils import timezone
from django.contrib.auth.models import User
from schedule.models import Event, Rule, Calendar, EventRelation
class TestEvent(Tes... | |
"""This component provides HA sensor support for Ring Door Bell/Chimes."""
from __future__ import annotations
from dataclasses import dataclass
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
)
from homeassistant.const import PERCENTAGE, SIGNAL_STREN... | |
from openerp import models
from openerp.tools import mute_logger
from openerp.tests import common
from openerp.exceptions import AccessError
class TestAPI(common.TransactionCase):
""" test the new API of the ORM """
def assertIsRecordset(self, value, model):
self.assertIsInstance(value, models.BaseM... | |
# File to hold auxiliary functions for performing logistic regression with the Titanic data set.
import numpy as np
import pandas as pd
def cat2indicator(df, columns):
"""
Convert columns of categorical variables to multiple columns of
indicator variables.
"""
# Create new dataframe to hold data
df2 = ... | |
import unittest
import io
from python_digest import *
from python_digest.http import *
from python_digest.utils import *
class HttpTests(unittest.TestCase):
def test_parse_quoted_string(self):
test_cases = [
('""', ''), # OK
('"hello"', 'hello'), # OK
('', False), # no... | |
from django.core.urlresolvers import reverse
from unittest2 import skipIf
from django.test import RequestFactory
from django.test.utils import override_settings
from django.test.client import Client
from sqlshare_rest.util.db import get_backend
from sqlshare_rest.test.api.base import BaseAPITest
from sqlshare_rest.test... | |
"""This script implements the main application logic for Doctrine."""
##==============================================================#
## DEVELOPED 2015, REVISED 2015, Jeff Rimko. #
##==============================================================#
##================================================... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2009,2010, Oracle and/or its affiliates. All rights reserved.
# Use is subject to license terms. (See COPYING)
# This program is free software; you can redistribute it and/or modify
# it under the t... | |
# pylint: disable=W0611
'''
Utils
=====
.. versionchanged:: 1.6.0
OrderedDict class has been removed. Use the collections.OrderedDict.
'''
__all__ = ('intersection', 'difference', 'strtotuple',
'get_color_from_hex', 'get_hex_from_color', 'get_random_color',
'is_color_transparent', 'boundary... | |
# -*- coding: utf-8 -*-
import logging
import sys
import argparse
import sqlalchemy.exc
import gmalthgtparser as hgt
import gmaltcli.tools as tools
import gmaltcli.worker as worker
import gmaltcli.database as database
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s')
def create_read_from_hgt_... | |
from .solverwrapper import SolverWrapper
import numpy as np
from ..constraint import ConstraintType
from ..constants import QPOASES_INFTY, TINY, SMALL
from ..exceptions import SolverNotFound
try:
from qpoases import (
PyOptions as Options,
PyPrintLevel as PrintLevel,
PyReturnValue as Retur... | |
# -*- coding: utf-8-*-
"""
A Speaker handles audio output from Jasper to the user
Speaker methods:
say - output 'phrase' as speech
play - play the audio in 'filename'
is_available - returns True if the platform supports this implementation
"""
import os
import platform
import re
import tempfile
import subp... | |
"""Search (Chapters 3-4)
The way to use this code is to subclass Problem to create a class of problems,
then create problem instances and solve them with calls to the various search
functions."""
from __future__ import generators
from utils import *
import math, random, sys, time, bisect, string
#___________________... | |
# Copyright (c) 2008-2015 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Tests for the `station_plot` module."""
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pytest
from metpy.plots import nws_layout, simple_layout... | |
# Copyright 2017 Google LLC.
#
# 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 of conditions and the following disclaimer.
#
#... | |
import unittest
from numba import objmode
import numpy as np
from numba.core import ir, compiler
class TestIR(unittest.TestCase):
def test_IRScope(self):
filename = "<?>"
top = ir.Scope(parent=None, loc=ir.Loc(filename=filename, line=1))
local = ir.Scope(parent=top, loc=ir.Loc(filename=fi... | |
#!/usr/bin/env python
# cardinal_pythonlib/argparse_func.py
"""
===============================================================================
Original code copyright (C) 2009-2021 Rudolf Cardinal ([email protected]).
This file is part of cardinal_pythonlib.
Licensed under the Apache License, Version 2.... | |
from PyQt4 import QtGui, QtCore#, Qsci
#from diagramscene import DiagramItem, DiagramTextItem
from FsmState import FsmState
from FsmStateAction import FsmStateAction
from FsmTransition import FsmTransition
class FsmScene(QtGui.QGraphicsScene):
InsertState, InsertStateAction, InsertLine, InsertText, MoveItem = ra... | |
"""Base Command class, and related routines"""
from __future__ import absolute_import
import logging
import logging.config
import optparse
import os
import sys
import warnings
from pip._internal import cmdoptions
from pip._internal.baseparser import (
ConfigOptionParser, UpdatingDefaultsHelpFormatter,
)
from pip.... | |
"""Gaussian processes regression."""
# Authors: Jan Hendrik Metzen <[email protected]>
# Modified by: Pete Green <[email protected]>
# License: BSD 3 clause
import warnings
from operator import itemgetter
import numpy as np
from scipy.linalg import cholesky, cho_solve, solve_triangular
import scip... | |
from __future__ import unicode_literals
import json
import six
from moto.core.responses import BaseResponse
from moto.core.utils import camelcase_to_underscores
from .models import dynamodb_backend, dynamo_json_dump
GET_SESSION_TOKEN_RESULT = """
<GetSessionTokenResponse xmlns="https://sts.amazonaws.com/doc/2011-06-... | |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | |
"""Read the balance of your bank accounts via FinTS."""
from __future__ import annotations
from collections import namedtuple
from datetime import timedelta
import logging
from typing import Any
from fints.client import FinTS3PinTanClient
from fints.dialog import FinTSDialogError
import voluptuous as vol
from homeas... | |
#!/usr/bin/python2
#
# Copyright 2018 Google LLC
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
"""Functions for data source to DSPL model conversion."""
from __future__ import print_function
__auth... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.