gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python
"""
Create and install a Let's Encrypt cert for an API Gateway.
This file is a descendant of @diafygi's 'acme-tiny',
with http-01 replaced with dns-01 via AWS Route 53.
You must generate your own account.key:
openssl genrsa 2048 > account.key # Keep it secret, keep safe!
"""
import base64
impo... | |
#!/usr/bin/env python
from __future__ import print_function
import json
import os
import re
import sys
import logging
import getpass
import random
import requests
import string
import traceback
import inspect
import pickle
from time import sleep
import py
import pytest
from six import print_ as print
from six import i... | |
import datetime
from decimal import Decimal
from unittest import mock
from django.test import TestCase, modify_settings, override_settings
from django.urls import reverse
from django.utils import timezone
from django_webtest import WebTest
from mymoney.apps.bankaccounts.factories import BankAccountFactory
from mymon... | |
# utils/SwiftBuildSupport.py - Utilities for Swift build scripts -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.tx... | |
"""
Title: Semantic Similarity with BERT
Author: [Mohamad Merchant](https://twitter.com/mohmadmerchant1)
Date created: 2020/08/15
Last modified: 2020/08/29
Description: Natural Language Inference by fine-tuning BERT model on SNLI Corpus.
"""
"""
## Introduction
Semantic Similarity is the task of determining how simila... | |
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
#!/usr/bin/python
import urllib2, base64, re, struct, time, socket, sys, datetime, os.path
try:
import json
except:
import simplejson as json
zabbix_host = '{{ zabbix_server_ipaddr }}' # Zabbix server IP
zabbix_port = 10051 # Zabbix server port
hostname = '{{ hostname }}' # Name of monitored host... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import importlib
import itertools
import os
import sys
import compas_rhino
import compas._os
import compas.plugins
__all__ = [
'install',
'installable_rhino_packages',
'after_rhino_install'
]
IN... | |
"""Module for sending notifications to an iPhone via Prowl.
Includes a `post` method for one-off messages, a `Prowl` class to assist in
sending multiple messages, and a `LogHandler` for sending log records via
prowl.
See: http://www.prowlapp.com/
"""
__author__ = 'Mike Boers'
__author_email__ = 'github@mikeboers.co... | |
import argparse
import os
import librosa
from tensorflow.python.ops import gen_audio_ops as contrib_audio
import tensorflow as tf
import numpy as np
import pickle as pkl
# mel spectrum constants.
_MEL_BREAK_FREQUENCY_HERTZ = 700.0
_MEL_HIGH_FREQUENCY_Q = 1127.0
def _mel_to_hertz(mel_values, name=None):
"""Conve... | |
from __future__ import absolute_import
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import datetime
from lxml.builder import E
from lxml.etree import tostring
try:
import mx.DateTime
HAS_MX_DATETIME = True
except ImportError:
HAS_MX_DATETIME = False
from ... | |
import json
class Event(object):
def __init__(self, sender=None, recipient=None, timestamp=None, **kwargs):
if sender is None:
sender = dict()
if recipient is None:
recipient = dict()
self.sender = sender
self.recipient = recipient
self.timestamp = ti... | |
# Copyright 2020 The gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | |
#!/usr/bin/env python
import tweepy
import time
import sys
import os
import random
import gspread
import logging
from configobj import ConfigObj
from subprocess import call
def find_col_or_none(name, wks):
"""A short function which returns None or the column cell. """
logger = logging.getLogger(__name__)
... | |
#!/usr/bin/env python
"""
Based on a tutorial from deeplearning.net
gradient descent.
"""
__docformat__ = 'restructedtext en'
import cPickle
import gzip
import os
import sys
import time
import csv
import numpy as np
import IPython as ipy
import pandas as pd
import theano
import theano.tensor as T
sys.path.append(... | |
# ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.o... | |
import pytest
from conans.model.build_info import CppInfo
from conans.model.new_build_info import NewCppInfo, _DIRS_VAR_NAMES, _FIELD_VAR_NAMES, \
fill_old_cppinfo, from_old_cppinfo
def test_components_order():
cppinfo = NewCppInfo()
cppinfo.components["c1"].requires = ["c4", "OtherPackage::OtherComponen... | |
"""Annotation and rtyping support for the result of os.stat(), os.lstat()
and os.fstat(). In RPython like in plain Python the stat result can be
indexed like a tuple but also exposes the st_xxx attributes.
"""
import os, sys
from rpython.flowspace.model import Constant
from rpython.flowspace.operation import op
from... | |
# -----------------------------------------------------------------------------
# ply: lex.py
#
# Eli Bendersky [http://eli.thegreenplace.net]
# David M. Beazley (Dabeaz LLC)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fol... | |
import numpy as np
import pywt
from PIL import Image, ImageOps
import colorsys
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import matplotlib.cm as cm
import matplotlib.rcsetup as rcsetup
from haar2d import haar2d, ihaar2d
#print matplotlib.matplotlib_fname()
#print(rcsetup.all_ba... | |
#!/usr/bin/env python
# coding=utf-8
# Copyright [2017] [B2W Digital]
#
# 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 ... | |
# -*- coding: utf-8 -*-
'''
Interaction with Git repositories
=================================
Important: Before using git over ssh, make sure your remote host fingerprint
exists in "~/.ssh/known_hosts" file. To avoid requiring password
authentication, it is also possible to pass private keys to use explicitly.
.. c... | |
# Copyright 2014 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... | |
import uuid
from datetime import date, datetime
from unittest.mock import MagicMock, patch
from django.test import TestCase
from django.test.testcases import SimpleTestCase
from corehq.apps.case_search.const import IS_RELATED_CASE, RELEVANCE_SCORE
from corehq.apps.case_search.models import (
CaseSearchConfig,
)
f... | |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import logging
import os
import typing
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Text
from ty... | |
from troposphere import rds, Ref, Sub, ec2, GetAZs, Select, Output, Export, GetAtt
from . import ExportTemplate
class Network(ExportTemplate):
def __init__(self, configuration=None, description="An Export Template", metadata={}):
super(Network, self).__init__(configuration, description, metadata)
... | |
# Copyright (c) 2012 NetApp, 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 bpy
import math
import mathutils
from os.path import join, dirname, abspath
class PBSMaterial(bpy.types.Panel):
""" This is a panel to display the PBS properties of the currently
selected material """
bl_idname = "MATERIAL_PT_pbs_material_props"
bl_label = "Physically Based Shading Properti... | |
# 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... | |
# 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 ... | |
"""Config flow to configure the AsusWrt integration."""
import logging
import os
import socket
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components.device_tracker.const import (
CONF_CONSIDER_HOME,
DEFAULT_CONSIDER_HOME,
)
from homeassistant.const import (
CONF_H... | |
from __future__ import unicode_literals
from django.apps import apps
from django.db import models
from django.db.utils import OperationalError, ProgrammingError
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_text, force_text
from django.utils.encoding import python_2_un... | |
'''
Created on Oct 23, 2015
@author: kelvinguu
'''
import logging
import operator
import os.path
import random
import shutil
import traceback
import types
import json
import warnings
from abc import ABCMeta, abstractmethod, abstractproperty
from collections import OrderedDict, defaultdict, MutableMapping, Mapping
from... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Beat and tempo
==============
.. autosummary::
:toctree: generated/
beat_track
estimate_tempo
"""
import numpy as np
import scipy
from . import cache
from . import core
from . import onset
from . import util
from .util.exceptions import ParameterError
__all... | |
"""Module for commonly reused classes and functions."""
import os
import sys
from contextlib import contextmanager
from distutils.util import strtobool
from enum import EnumMeta, IntEnum
from typing import Any, Dict, List, Optional, Union
import requests
from tqdm import tqdm
class CLTKEnumMeta(EnumMeta):
def _... | |
"""Control tasks execution order"""
import fnmatch
from collections import deque
from collections import OrderedDict
import re
from .exceptions import InvalidTask, InvalidCommand, InvalidDodoFile
from .task import Task, DelayedLoaded
from .loader import generate_tasks
class RegexGroup(object):
'''Helper to keep ... | |
import json
import common
from objs.gametime import Gametime
from objs.poll import Poll
class WeekendGames(object):
"""
Defines the WeekendGames class
"""
def __init__(self,):
"""
WeekendGames constructor
"""
db = common.db
self.people = []
if 'people... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Nicira, 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/lic... | |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from operator import attrgetter
from flask import session
from indico.core import signals
from indico.co... | |
# Copyright 2015 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... | |
'''
def generatorA_28x28_mnist(self,z_pholder,reuse=False,is_phase_train=True):
"""
Args:
z_pholder: has shape [batch_size,self.seed_size]
reuse: Set to False to generate new variable scopes
(e.g.: a fresh copy of the n... | |
"""Provide methods to bootstrap a Home Assistant instance."""
import logging
import logging.handlers
import os
import sys
from time import time
from collections import OrderedDict
from typing import Any, Optional, Dict
import voluptuous as vol
from homeassistant import (
core, config as conf_util, config_entries,... | |
# -*- coding: utf-8 -*-
# Simple Bot (SimpBot)
# Copyright 2016-2017, Ismael Lugo (kwargs)
import re
import time
import logging
from . import requires
from six.moves import queue
from simpbot import modules
from simpbot import envvars
from simpbot import parser
from simpbot import localedata
from simpbot.bottools.dumm... | |
from input import parse
from word2vec1 import word2vec, dictionaries
from collections import namedtuple,OrderedDict
import numpy as np
import json
import gensim
import copy
import logging
def training(fn, wordvecpath):
if not wordvecpath:
word2vec(fn)
wordvecpath = './tmpdata/vecs.bin'
ndeprel... | |
#!/usr/bin/env python3
import argparse
import contextlib
import io
import math
import os
import os.path
import re
import string
import subprocess
import sys
import signal
import tempfile
import threading
if sys.platform == 'win32':
import winreg
else:
signal.signal(signal.SIGPIPE,signal.SIG_DFL)
@contextlib... | |
import ldap
import ldap.filter
import logging
class LDAPConn(object):
"""
LDAP connector class
Defines methods for retrieving users and groups from LDAP server.
"""
def __init__(self, config):
self.uri = config.ldap_uri
self.base = config.ldap_base
self.ldap_user = conf... | |
""" Module for reading the MPD file
Author: Parikshit Juluri
Contact : pjuluri@umkc.edu
"""
from __future__ import division
import re
import config_dash
FORMAT = 0
URL_LIST = list()
# Dictionary to convert size to bits
SIZE_DICT = {'bits': 1,
'Kbits': 1024,
'Mbits': 1024*1024,
... | |
# Copyright 2020 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) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# pylint: disable=maybe-no-member, invalid-name
"""Test request import and updates."""
from ggrc import db
from ggrc import models
from ggrc.converters import errors
from integration.ggrc import TestCase
f... | |
#!/usr/bin/env python
"""
@file HybridVAControl.py
@author Craig Rafter
@date 19/08/2016
class for fixed time signal control
"""
import signalControl, readJunctionData, traci
from math import atan2, degrees, hypot
import numpy as np
from collections import defaultdict
class HybridVAControl(signalControl.signa... | |
#
# Copyright (c) 2015, 2016, 2017, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... | |
#!/usr/bin/env python
"""
Module to test combinator-based grid match functions
"""
__author__ = "Graham Klyne (GK@ACM.ORG)"
__copyright__ = "Copyright 2011-2013, University of Oxford"
__license__ = "MIT (http://opensource.org/licenses/MIT)"
import os, os.path
import sys
import re
import shutil
import unit... | |
# -*- coding: utf-8 -*-
"""Helper to create filters based on forensic artifact definitions."""
from artifacts import definitions as artifact_types
from dfwinreg import registry_searcher
from dfvfs.helpers import file_system_searcher
from plaso.engine import filters_helper
from plaso.engine import logger
from plaso.... | |
from unicodedata import normalize
import datetime
from operator import itemgetter
import keys # local module handling API key
import analysis
from pprint import pprint
# set up access with these global vars
sp = None
def set_access(token=None):
global sp
global username
# if token == None:
# sp ... | |
# 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... | |
# ===================================================================
#
# Copyright (c) 2016, Legrandin <helderijs@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributio... | |
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import warnings
from ._DataCollection_class import DataCollection
from . import _comp_spectrallines
from . import _DataCollection_comp
from . import _DataCollection_plot
__all__ = ['SpectralLines', 'TimeTra... | |
# Copyright 2019 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... | |
"""
pyapi-gitlab tests
"""
import unittest2 as unittest
import gitlab
import os
import time
import random
import string
try:
from Crypto.PublicKey import RSA
ssh_test = True
except ImportError:
ssh_test = False
user = os.environ.get('gitlab_user', 'root')
password = os.environ.get('gitlab_password', '5ive... | |
from datanator.data_source import sabio_rk_nosql
from datanator.util import file_util
import datanator.config.core
import unittest
import tempfile
import shutil
import requests
import libsbml
import bs4
import time
class TestSabioRk(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.cache_dirnam... | |
import seabreeze.backends
# get the backend and add some functions/classes to this module
lib = seabreeze.backends.get_backend()
# from . import cseabreeze as lib
list_devices = lib.device_list_devices
SeaBreezeError = lib.SeaBreezeError
SeaBreezeDevice = lib.SeaBreezeDevice
import numpy
class _HelperFeatureAdder(ob... | |
# Copyright 2020 The TensorFlow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | |
#!/usr/bin/env python
import numpy as np
import itertools
from grid import Grid
import tools
# A class that carries the logic of evaluating the energy, force and torque
# of a pair of rigid molecules. The coordinates of each molecule are given
# in the form of Xcom and q, with Xcom being the Cartesian coordinates ... | |
##########################################################################
#
# Copyright (c) 2011, John Haddon. All rights reserved.
# Copyright (c) 2012-2015, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... | |
from logging import debug, error, exception
import sqlite3, re
from functools import wraps, lru_cache
from unidecode import unidecode
from typing import Set, List, Optional
from .models import Show, ShowType, Stream, Service, LinkSite, Link, Episode, EpisodeScore, UnprocessedStream, UnprocessedShow
def living_in(the_... | |
# 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 json
import o... | |
################################################################################
# Copyright (C) 2013 Jaakko Luttinen
#
# This file is licensed under the MIT License.
################################################################################
r"""
General functions random sampling and distributions.
"""
import ... | |
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
#!/usr/bin/env python3
#
# Copyright (C) 2016-2017 ShadowMan
#
import os
import json
import time
import flask
import logging
import asyncio
import aiohttp
from collections import namedtuple
from functools import partial
from aiohttp import web
from trainquery import train_station, utils, train_query, train_query_resul... | |
import re
import sys
for path in sys.path:
if path and 'anaconda' in path:
sys.path.remove(path)
import numpy as np
from pybedtools import *
import subprocess, os, shutil
from collections import *
import time
import dill as pickle
from difflib import SequenceMatcher
def similar(a, b):
return Sequ... | |
#!/usr/bin/python
# Copyright: (c) 2017, VEXXHOST, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['pr... | |
import json
from django.core import mail
import six
from olympia import amo
from olympia.abuse.models import AbuseReport
from olympia.amo.tests import (
APITestClient, TestCase, addon_factory, reverse_ns, user_factory)
class AddonAbuseViewSetTestBase(object):
client_class = APITestClient
def setUp(sel... | |
"""
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
:codeauthor: Alexandru Bleotu (alexandru.bleotu@morganstanley.com)
salt.utils.schema
~~~~~~~~~~~~~~~~~
Object Oriented Configuration - JSON Schema compatible generator
This code was inspired by `jsl`__, "A Python DSL for describing JSON
... | |
import os
import ImagingReso._utilities as reso_util
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy.interpolate import interp1d
import ResoFit._utilities as fit_util
from ResoFit._utilities import load_txt_csv
class Experiment(object):
def __init__(self,
spect... | |
""" Associative and Commutative unification
This module provides goals for associative and commutative unification. It
accomplishes this through naively trying all possibilities. This was built to
be used in the computer algebra systems SymPy and Theano.
>>> from logpy import run, var, fact
>>> from logpy.assoccomm... | |
# -*- 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 doctest
import random
import unittest
import gc
from sys import getsizeof
import pympler.muppy
from pympler import muppy
class MuppyTest(unittest.TestCase):
def test_objects(self):
"""Test that objects returns a non-empty list."""
self.assertTrue(len(muppy.get_objects()) > 0)
def tes... | |
from discord.ext import commands, tasks, menus
from .utils import checks, db, cache
from .utils.formats import plural, human_join
from .utils.paginator import SimplePages
from collections import Counter, defaultdict
import discord
import datetime
import time
import json
import random
import asyncio
import asyncpg
impo... | |
from __future__ import unicode_literals
import transaction
from pyramid.view import view_config
from pyramid.security import Allow
from pyramid.httpexceptions import HTTPFound
from pyramid.httpexceptions import HTTPNotFound
from ez2pay.i18n import LocalizerFactory
from ez2pay.models.user import UserModel
from ez2pay.... | |
'''SSL with SNI_-support for Python 2. Follow these instructions if you would
like to verify SSL certificates in Python 2. Note, the default libraries do
*not* do certificate checking; you need to do additional work to validate
certificates yourself.
This needs the following packages installed:
* pyOpenSSL (tested wi... | |
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 ... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import xmpp
from confs import getConfs, getConfByTarget, getConfByName, getConfsCount
from utils import sEq, answerPrivate, answerConf, getConferenceJid, normalize, protect
from registry import Registry
from logic import *
import time
import logging
import config
... | |
from hazelcast.exception import HazelcastSerializationError
from hazelcast.serialization import bits
from hazelcast.serialization.api import PortableReader
from hazelcast.serialization.portable.classdef import FieldType
class DefaultPortableReader(PortableReader):
def __init__(self, portable_serializer, data_inpu... | |
# Copyright 2014 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 inspect import isclass
from celery.datastructures import AttributeDict
from tower import ugettext_lazy as _
__all__ = ('LOG', 'LOG_BY_ID', 'LOG_KEEP',)
class _LOG(object):
action_class = None
class CREATE_ADDON(_LOG):
id = 1
action_class = 'add'
format = _(u'{addon} was created.')
keep =... | |
"""
Created on 28 Sep 2020
@author: Jade Page (jade.page@southcoastscience.com)
"""
from botocore.exceptions import ClientError
from collections import OrderedDict
from scs_core.data.datetime import LocalizedDatetime
from scs_core.data.json import JSONable
from scs_core.data.tokens import Tokens
from scs_core.sys.p... | |
# -*- coding: utf-8 -*-
"""The source file generator for include source files."""
import logging
import os
from yaldevtools.source_generators import interface
class IncludeSourceFileGenerator(interface.SourceFileGenerator):
"""Include source file generator."""
def _GenerateFeaturesHeader(
self, project_c... | |
#!/usr/bin/env python
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, ServerError, InvalidRequestE... | |
# 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... | |
# Copyright 2015, 2018 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 require... | |
"""
SoftLayer.file
~~~~~~~~~~~~~~~
File Storage Manager
:license: MIT, see LICENSE for more details.
"""
from SoftLayer import exceptions
from SoftLayer.managers import storage_utils
from SoftLayer import utils
# pylint: disable=too-many-public-methods
class FileStorageManager(utils.IdentifierMixin,... | |
# Copyright (c) 2014 Red Hat, 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... | |
"""Abstraction for Arcyd's conduit operations."""
# =============================================================================
# CONTENTS
# -----------------------------------------------------------------------------
# abdt_conduit
#
# Public Classes:
# Conduit
# .describe
# .refresh_cache_on_cycle
# .cr... | |
"""
Database configuration functions.
Main class is DBConfig, which encapsulates a database configuration
passed in as a file or object. For example::
cfg1 = DBConfig() # use defaults
cfg2 = DBConfig("/path/to/myfile.json") # read from file
f = open("/other/file.json")
cfg3 = DBConfig(f) # read fro... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pymongo
import json
import getopt, sys
import os
import subprocess
try:
import matplotlib.pyplot as plt
is_plt = True
except ImportError:
is_plt = False
class http_stats:
def __init__(self, server, outdir):
self._con = pymongo.Connection... | |
# Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | |
from __future__ import absolute_import
from __future__ import print_function
from pylab import *
from six.moves import map
from six.moves import range
def plot_mem(p, use_histogram=True):
with open(p, "r") as rfile:
ms = []
started = False
mx, mn = -Inf, Inf
for line in rfile:
... | |
"""Support for KNX/IP lights."""
from enum import Enum
import voluptuous as vol
from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_HS_COLOR, PLATFORM_SCHEMA,
SUPPORT_BRIGHTNESS, SUPPORT_COLOR, SUPPORT_COLOR_TEMP, Light)
from homeassistant.const import CONF_ADDRESS, CONF_NAME
f... | |
# Copyright 2021 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | |
# Copyright (c) 2011 OpenStack, LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.