gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#! /usr/bin/env python3
# Copyright (c) 2017 Linaro Limited.
# Copyright (c) 2017 Open Source Foundries Limited.
#
# SPDX-License-Identifier: Apache-2.0
"""Zephyr binary runner core interfaces
This provides the core ZephyrBinaryRunner class meant for public use,
as well as some other helpers for concrete runner clas... | |
#!/usr/bin/env python
import os
import sys
import json
import time
import argparse
import ConfigParser
import logging
import logging.config
from twisted.web import server
from twisted.web.server import Site
from twisted.web.resource import Resource
from twisted.internet import defer, reactor, ssl
from twisted.internet... | |
# Copyright 2012 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | |
import pysal
__author__ = "Charles R Schmidt <schmidtc@gmail.com>"
class WorldToViewTransform(object):
"""
An abstract class modeling a View window.
Supports Panning, Zooming, Resizing.
Is observable.
Parameters:
worldExtent -- Extent,List -- Extent of the world, left,lower,right,upper in wo... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# name: colors.py
# author: Harold Bradley III
# email: harold@bradleystudio.net
# created on: 02/23/2016
#
"""
nwid.terminal.colors
~~~~~~~~~~~~~~~~~~~~
Functions for creating and combining terminal text effects and colors using
c... | |
import bpy
import datetime
from . properties import *
from . operators import *
from . sun_calc import Degrees, format_lat_long, degToRad, \
format_time, format_hms, Move_sun
#---------------------------------------------------------------------------
#
# Draw the Sun Panel, sliders, et. al.
... | |
#!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains convenience functions for coordinate-related functionality.
This is generally just wrapping around the object-oriented coordinates
framework, but it is useful for some users who are used to more functional
interfaces.
"""
from _... | |
import sys
import threading
import weakref
from django.utils.six.moves import xrange
if sys.version_info < (3, 4):
from .weakref_backports import WeakMethod
else:
from weakref import WeakMethod
def _make_id(target):
if hasattr(target, '__func__'):
return (id(target.__self__), id(target.__func__)... | |
# coding: utf-8
import inspect
import re
import json
import logging
from itertools import filterfalse
import arrow
from jira import JIRA
from jira.exceptions import JIRAError
from lazy import lazy
from slackbot.bot import Bot, listen_to, respond_to
from . import settings
from utils.messages_cache import MessagesCac... | |
import wx
class AddNewSourcePanelView ( wx.Panel ):
def __init__( self, parent ):
wx.Panel.__init__ ( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 402,528 ), style = wx.TAB_TRAVERSAL )
self.SetMinSize( wx.Size( 402,528 ) )
bSizer1 = wx.Bo... | |
import json
import string
import uuid
from copy import copy
from datetime import datetime
from django.apps import apps
from django.conf import settings
from django.db import models
from django.urls import reverse
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from djan... | |
# standard libraries
import os
import functools
import collections
import collections.abc
import datetime
import json
import multiprocessing
import threading
import traceback
import time
# third party libraries
pass
# first party libraries
pass
__where__ = os.path.dirname(os.path.abspath(__file__))
class repeat(thr... | |
# coding: utf-8
# # quick recap
#
# You now have both `while` loop and `for` loop in your toolset.
# Let's look quickly at yesterday's last tutorial task.
# However, I also will also upload general solution notebook files later today)
# In[ ]:
for fIndex, y in enumerate(range(2, 5)):
countdown = y
yFa... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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... | |
import random
class Move(object):
LEFT = 'left'
UP = 'up'
RIGHT = 'right'
DOWN = 'down'
class Board(object):
def __init__(self, n_init_tiles):
self.BOARD_SIZE = 4
self.board_data = self.initialize_board(n_init_tiles)
self.__score = 0
def generate_board(self):
'''Generate a None board''... | |
"""Functions for generating interesting polynomials, e.g. for benchmarking. """
from sympy.core import Add, Mul, Symbol, sympify, Dummy, symbols
from sympy.functions.elementary.miscellaneous import sqrt
from sympy.core.singleton import S
from sympy.polys.polytools import Poly, PurePoly
from sympy.polys.polyutils impo... | |
# 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 ... | |
# -*- encoding: utf-8 -*-
#
# Copyright 2014 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 applicabl... | |
""" Cisco_IOS_XE_types
Cisco XE Native Common Type Definitions
Copyright (c) 2016 by Cisco Systems, Inc.
All rights reserved.
"""
import re
import collections
from enum import Enum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk.errors import YPYError, YPYModelError
c... | |
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------
from Bunch import Bunch
from OrderedDict import OrderedDict
from Property import Property
# -----------------------------------------... | |
"""
Agent smoketest code.
This python script is meant to be invoked within a docker image in which the proper python version is activated (e.g.
via pyenv). In this way, the agent can be validated against different python versions.
Concept:
This code serves as a common code-base for different types of smoketest "... | |
#
# Copyright (C) 2014 Dell, 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 wri... | |
#! /usr/bin/env python3
# Modules must contain:
# definitions()
# ui_definitions()
# view_definitions()
app_name = "susm"
STATUS = {
0: 'Dead',
1: 'Egg',
2: 'Infertile egg',
3: 'Fertile egg',
4: 'Damaged egg',
5: 'Died off egg',
6: 'Dead in shell',
10: 'Pinkie',
20: 'Fledg... | |
# coding: utf-8
"""
StaSh - Pythonista Shell
https://github.com/ywangd/stash
"""
__version__ = '0.7.5'
import imp as pyimp # rename to avoid name conflict with objc_util
import logging
import logging.handlers
import os
import platform
import sys
from io import IOBase
import six
from six import BytesIO, StringIO
fr... | |
# test for xml.dom.minidom
import pickle
from test.support import verbose, run_unittest, findfile
import unittest
import xml.dom
import xml.dom.minidom
import xml.parsers.expat
from xml.dom.minidom import parse, Node, Document, parseString
from xml.dom.minidom import getDOMImplementation
tstfile = findfile("test.x... | |
# -*- coding: utf-8 -*-
"""
Main module for python-amazon-mws package.
"""
from __future__ import absolute_import
import base64
import datetime
import hashlib
import hmac
import re
import warnings
from zipfile import ZipFile
from io import BytesIO
from requests import request
from requests.exceptions import HTTPErro... | |
import os, glob
import h5py
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
def main():
num = extract_num_trajectory_from_out_files()
an = eval_an_trajectory_at_num_time_points( num )
plot_trajectories( num , an )
def extract_num_trajectory_from_out_files():
... | |
# -*- coding: utf-8 -*-
import requests as r
from simplejson import JSONDecodeError
GET = 1
POST = 2
class Sia(object):
def __init__(self, host='http://localhost', port='9980'):
self.host = host
self.port = port
@property
def _url_base(self):
return self.host + ":" + str(self.port... | |
from __future__ import print_function, division
import os
import sys
root = os.path.join(os.getcwd().split('src')[0], 'src/defects')
if root not in sys.path:
sys.path.append(root)
import warnings
from prediction.model import logistic_model
from py_weka.classifier import classify
from utils import *
from metrics.... | |
# panel.py
# Copyright (c) 2013-2016 Pablo Acosta-Serafini
# See LICENSE for details
# pylint: disable=C0111,C0302,R0912,R0913,R0914,R0915,W0105,W0212
# PyPI imports
import numpy
import matplotlib.pyplot as plt
# Putil imports
import putil.exh
import putil.pcontracts
from .series import Series
from .functions import _... | |
import base64
from django.contrib import messages
from django.contrib.auth.decorators import permission_required, login_required
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.db import transaction, IntegrityError
from django.db.models import Count
from django.shortcuts import get_object_or... | |
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Command-line support for coverage.py."""
import glob
import optparse
import os.path
import sys
import traceback
from coverage import env
from coverage.execfile... | |
"""Support for Hass.io."""
from datetime import timedelta
import logging
import os
import voluptuous as vol
from homeassistant.auth.const import GROUP_ID_ADMIN
from homeassistant.components.homeassistant import SERVICE_CHECK_CONFIG
import homeassistant.config as conf_util
from homeassistant.const import (
ATTR_NA... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
import warnings
from collections import OrderedDict
from importlib import import_module
from django.apps import apps
from django.core.management import call_command
from django.core.management.base import BaseCommand, CommandError
from django... | |
import json
from django.core.urlresolvers import reverse
import responses
from nose.tools import eq_, ok_
from mkt.api.tests.test_oauth import RestOAuth
from mkt.constants.applications import DEVICE_DESKTOP
from mkt.constants.base import CONTENT_ICON_SIZES, STATUS_PENDING
from mkt.constants.regions import URY, USA
f... | |
###############################################################################
##
## Copyright (C) 2011-2013 Tavendo GmbH
##
## 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... | |
# -*- coding: utf-8 -*-
'''
Management zpool
:maintainer: Jorge Schrauwen <sjorge@blackdot.be>
:maturity: new
:depends: zpool
:platform: smartos, illumos, solaris, freebsd, linux
.. versionadded:: 2016.3.0
.. code-block:: yaml
oldpool:
zpool.absent:
- export: true
newpool:
... | |
"""
Unit tests for format checking
"""
from nose.plugins.skip import SkipTest
import os
import pylearn2
from pylearn2.devtools.tests.docscrape import docstring_errors
from pylearn2.devtools.list_files import list_files
from pylearn2.devtools.tests.pep8.pep8 import StyleGuide
whitelist_pep8 = [
"rbm_tools.py",
... | |
'''
Nearly all of the estimations for the paper "The Distribution of Wealth and the
Marginal Propensity to Consume", by Chris Carroll, Jiri Slacalek, Kiichi Tokuoka,
and Matthew White. The micro model is a very slightly altered version of
ConsIndShockModel; the macro model is ConsAggShockModel. See SetupParamsCSTW
fo... | |
import boto3
import time
import pprint
import socket
import traceback
from retrying import retry
import logging
from logging.handlers import SysLogHandler
import memcache
import task_fns as tf
import config as conf
RUN_TASK_RETRIES = 3
RUN_TASK_WAIT_SECS = 2
TASK_INFO_RETRIES = 7
TASK_INFO_WAIT_SECS = 1
DESCRIBE_INSTA... | |
# Copyright 2013 Cloudbase Solutions SRL
# 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 r... | |
# 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 (c) 2010-2012 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 agree... | |
''' This module contains class ParamsFrame which is responsible for
all operations with parameters.
Attributes:
MAX_FILE_LBL_LENGTH (int): maximum length of the label with
file name.
TEXT_FOR_PARAMS_LBL (str): text displayed on one of the labels.
'''
import os
from tkinter import W... | |
# Hidden Markov Model Implementation
import pylab as pyl
import numpy as np
import matplotlib.pyplot as pp
#from enthought.mayavi import mlab
import scipy as scp
import scipy.ndimage as ni
import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3')
import rospy
#import hrl_lib.mayavi2_util as mu
import hrl_lib.viz ... | |
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
from django.db import models
from django.db.models.fields import FieldDoesNotExist
from django.db.models.sql.constants import JOIN_TYPE, LHS_ALIAS, LHS_JOIN_COL, \
TABLE_NAME, RHS_JOIN_COL
from django.utils.tree import Node
from djangotoolbox.fields import ListField
from .lookups import StandardLookup
OR = 'OR'
#... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import shutil
import logging
from migrate import exceptions
from migrate.versioning import pathed, script
log = logging.getLogger(__name__)
class VerNum(object):
"""A version number that behaves like a string and int at the same time"""
_in... | |
#!/usr/bin/env python
#
# Licensed under the BSD license. See full license in LICENSE file.
# http://www.lightshowpi.com/
#
# Author: Todd Giles (todd@lightshowpi.com)
#
# TODO(todd): Refactor the configuration manager into a configuration manager
# class (to remove the extensive use of globals currently u... | |
# -*- coding: utf-8 -*-
# Copyright (c)2012 Rackspace US, 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/LICE... | |
# Copyright 2012 Locaweb.
# 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 appli... | |
# 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 requ... | |
import unittest, doctest, operator
import inspect
from test import test_support
from collections import namedtuple, Counter, OrderedDict
from test import mapping_tests
import pickle, cPickle, copy
from random import randrange, shuffle
import keyword
import re
import sys
from collections import Hashable, Iterable, Iter... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware Inc.
#
# Licensed under the Apache License, Version 2.0 ( the "License" );
# you may not use this file except in compliance with the License.
# You may obtain a cop... | |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
# coding=utf-8
# --------------------------------------------------------------------------
# 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 ... | |
# 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... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import base64
import random
from typing import List
import mock
from django.core.management import call_command
from django.urls import reverse
from rest_framework import status
from account.models import User
from agency.permissions import AgencyPermis... | |
import numpy as np
from scipy.optimize import fsolve
import matplotlib.pyplot as plt
from collections import namedtuple
from utils import riemann_tools
from ipywidgets import interact
from ipywidgets import widgets
conserved_variables = ('Density', 'Momentum', 'Energy')
primitive_variables = ('Density', 'Velocity', 'P... | |
# Copyright 2012 OpenStack Foundation.
# Copyright 2013 NTT corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LI... | |
# Copyright 2015 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
# -*- coding:utf-8 -*-
#
# Copyright (C) 2008 The Android Open Source Project
#
# 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 re... | |
import tempfile
from pyparsing import ParseSyntaxException, ParseException
import pytest
from pyhocon import ConfigFactory, ConfigSubstitutionException
from pyhocon.exceptions import ConfigMissingException, ConfigWrongTypeException
class TestConfigParser(object):
def test_parse_simple_value(self):
config ... | |
import re
from collections import namedtuple
from django.utils.translation import ugettext_lazy as _
# Add-on and File statuses.
STATUS_NULL = 0 # No review type chosen yet, add-on is incomplete.
STATUS_AWAITING_REVIEW = 1 # File waiting for review.
STATUS_PENDING = 2 # Personas (lightweight themes) waiting for r... | |
from __future__ import print_function
import ply.lex as lex
from itertools import groupby
from datetime import datetime
import re
class ParseError(Exception):
def __init__(self, message, **kwargs):
super(Exception, self).__init__(message)
self.info = kwargs
reserved = set(['after', 'receive', 'yi... | |
# -*- coding: UTF-8 -*-
# Copyright 2010-2020 Rumma & Ko Ltd
# License: GNU Affero General Public License v3 (see file COPYING for details)
from django import VERSION
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from django.db.utils import DatabaseError
from django.core.excep... | |
# Copyright 2013 OpenStack Foundation
# Copyright 2013 Spanish National Research Council.
# 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://ww... | |
import os
import re
from bs4 import BeautifulSoup
from .utils import get_siteurl, on_no_errors
EXPORTKEYS = ['odt', 'pdf', 'epub', 'print']
class StablePage(object):
'''A wrapper around mwclients `Page` to make sure the latest revision
is also the stable one'''
def __init__(self, site, title):
... | |
# Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | |
#!/usr/bin/env python2
#
# Prepare a single ECMAScript testcase for execution and (optionally) execute
# it with Duktape or another engine. Interpret testcase results against the
# expect string and known issues.
#
# Currently no support for API testcases which require compilation and
# linking.
#
# XXX: encodin... | |
import sys
from time import sleep
import pygame
from bullet import Bullet
from alien import Alien
def check_keydown_events(event, ai_settings, screen, ship, bullets):
if event.key == pygame.K_RIGHT:
ship.moving_right = True
elif event.key == pygame.K_LEFT:
ship.moving_left = True
elif eve... | |
from collections import Callable
from numbers import Real
import openmc
import openmc.model
import openmc.checkvalue as cv
_SCALAR_BRACKETED_METHODS = ['brentq', 'brenth', 'ridder', 'bisect']
def _search_keff(guess, target, model_builder, model_args, print_iterations,
print_output, guesses, result... | |
#
# Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
#
from gevent import monkey
monkey.patch_all()
import os
import sys
import socket
import subprocess
import json
import time
import datetime
import platform
import select
import gevent
import ConfigParser
from nodemgr.common.event_manager import EventM... | |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
from six.moves import range
import json, os
from semantic_version import Version
import frappe
import requests
import subprocess # nosec
from frappe.utils import cstr
from frappe.... | |
""" makeCSHOREinput.py
makeCSHOREinput(inpth1, inpth2, outpth, transect_id, erod, d50, fb, dconv):
---------------------------------------------------------------------------
This code creates the CSHORE infile for the set of storms specified in the
input folder
infile: This file will be the input file for CSHOR... | |
"""The Fronius integration."""
from __future__ import annotations
import asyncio
from collections.abc import Callable
import logging
from typing import Final, TypeVar
from pyfronius import Fronius, FroniusError
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_MODEL, ATTR_SW_V... | |
import re
import urlparse
from hubcheck.pageobjects.basepagewidget import BasePageWidget
from hubcheck.pageobjects.basepageelement import Link
from selenium.webdriver.common.action_chains import ActionChains
# from hubcheck.pageobjects.widgets.search import Search
class Header(BasePageWidget):
def __init__(self,... | |
# /test/testutil.py
#
# Some utility functions which make testing easier
#
# See /LICENCE.md for Copyright information
"""Some utility functions which make testing easier."""
import atexit
import os
import platform
import shutil
import socket
import subprocess
import sys
import tempfile
from contextlib import ... | |
from __future__ import absolute_import
import atexit
import copy
import logging
import threading
import time
from ..client_async import KafkaClient
from ..structs import TopicPartition
from ..partitioner.default import DefaultPartitioner
from ..protocol.message import Message, MessageSet
from .. import errors as Erro... | |
#
# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
#
from abc import ABCMeta, abstractmethod, abstractproperty
from eventlet import greenthread
from neutron.common import exceptions as n_exc
try:
from neutron.extensions import loadbalancer
except ImportError:
from neutron_lbaas.extensions impor... | |
# ---------------------------
# Imports
# ---------------------------
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
import discord
import sys
import subprocess
import asyncio
import commands
import personalvars
# ---------------------------
# Personal Vari... | |
#!/usr/bin/env python
# Copyright (c) 2004-20010 ActiveState Software Inc.
# Written by: Trent Mick <trentm@gmail.com>
# License: MIT License (http://www.opensource.org/licenses/mit-license.php)
"""
platinfo.py -- standardized determination of platform info
>>> from platinfo import PlatInfo
>>> pi... | |
from __future__ import with_statement
from sqlalchemy import (
testing, exc as sa_exc, event, String, Column, Table, select, func)
from sqlalchemy.testing import (
fixtures, engines, eq_, assert_raises, assert_raises_message,
assert_warnings, mock, expect_warnings)
from sqlalchemy.orm import (
exc as or... | |
'''
Unit tests for oc scale
'''
import os
import six
import sys
import unittest
import mock
# Removing invalid variable names for tests so that I can
# keep them brief
# pylint: disable=invalid-name,no-name-in-module
# Disable import-error b/c our libraries aren't loaded in jenkins
# pylint: disable=import-error
# p... | |
#! /usr/bin/env python
# encoding: utf-8
# DC 2008
# Thomas Nagy 2016-2018 (ita)
import os, re, traceback
from waflib import Utils, Logs, Errors
from waflib.Tools import fc, fc_config, fc_scan, ar, ccroot
from waflib.Configure import conf
from waflib.TaskGen import after_method, feature
@conf
def find_ifort(conf):
f... | |
# 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... | |
# -*- coding: iso-8859-1 -*-
"""Get useful information from live Python objects.
This module encapsulates the interface provided by the internal special
attributes (func_*, co_*, im_*, tb_*, etc.) in a friendlier fashion.
It also provides some help for examining source code and class layout.
Here are some of the usef... | |
#!/usr/bin/env python2.7
from tac import *
class CodeGenState(object):
def __init__(self):
self.output = []
self.param_count = 0
self.pos = 0
self.pos_stack = []
self.strings = []
# This will store the offsets for the
# All of the frames
self.decls ... | |
#!/usr/bin/env python
from src.abstract.lexer.lexer import AbstractLexer
from src.abstract.lexer.token import AbstractToken
import unittest
class TestLexer(unittest.TestCase):
'''
: unit tests for lexer class.
'''
lexer = AbstractLexer()
def test_lexer_string_blank(self):
attempt = self... | |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | |
#!/usr/bin/env python3
# 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
# "L... | |
# -*- coding: utf-8 -*-
"""
thriftpy.thrift
~~~~~~~~~~~~~~~~~~
Thrift simplified.
"""
from __future__ import absolute_import
import functools
from ._compat import init_func_generator, with_metaclass, calling_func_generator
def args2kwargs(thrift_spec, *args):
arg_names = [item[1][1] for item in s... | |
import unittest
import webtest
from rdflib import BNode, ConjunctiveGraph, Graph, Literal, URIRef
from rdflib.namespace import RDF, RDFS, FOAF, XSD
from flask_rdf.wsgi import returns_rdf, output, Decorator
def make_graph():
graph = Graph('IOMemory', BNode())
person = URIRef('http://example.com/#person')
graph.add(... | |
# Authors: Aaron Qiu <zqiu@ulg.ac.be>,
# Antonio Sutera <a.sutera@ulg.ac.be>,
# Arnaud Joly <a.joly@ulg.ac.be>,
# Gilles Louppe <g.louppe@ulg.ac.be>,
# Vincent Francois <v.francois@ulg.ac.be>
#
# License: BSD 3 clause
from __future__ import division, print_function, absolute_import
... | |
"""Support for exposing a templated binary sensor."""
from __future__ import annotations
from datetime import timedelta
from functools import partial
import logging
import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES_SCHEMA,
DOMAIN as BINARY_SENSOR_DOMAIN,
ENTITY_... | |
# strconv.py
# Copyright (c) 2013 Byron Ruth
# BSD License
__version__ = '0.4.0'
from collections import Counter
class TypeInfo(object):
"Sampling and frequency of a type for a sample of values."
def __init__(self, name, size=None, total=None):
self.name = name
self.count = 0
self.sa... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
impor... | |
# -*- coding: utf8 -*-
from __future__ import unicode_literals
from tornado.web import RequestHandler, HTTPError
from tornado import gen
import logging
import json
import inspect
import os
import pkgutil
from tools import model
from tools.utils import lcFirst, ucFirst, genModules
from solvers.optimizer import Optim... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.