gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import sys
import csv
import json
import shutil
from collections import OrderedDict
pg_system = [
(1024 ** 5, 'PB'),
(1024 ** 4, 'TB'),
(1024 ** 3, 'GB'),
(1024 ** 2, 'MB'),
(1024 ** 1, 'kB'),
(1024 ** 0, 'B'),
]
pg_time = [
(1000 * 1 * 60, 'min'),
(1000 ** 0, 'ms'),
(1000 ** 1... | |
"""
.. Copyright (c) 2014, 2015 Marshall Farrier
license http://opensource.org/licenses/MIT
Options - price (:mod:`pynance.opt.price`)
==================================================
.. currentmodule:: pynance.opt.price
"""
from __future__ import absolute_import
import pandas as pd
from ._common import _getp... | |
# -*- coding: utf-8 -*-
# From implementation generated from reading ui file 'ui_som_om.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_som_om:
def setupUi(self, som_om):
som_om.setObjectName("som... | |
# 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
# distributed under t... | |
#!/usr/bin/env python
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | |
#!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | |
# -*- coding: utf-8 -*-
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | |
data = (
'Ku ', # 0x00
'Ke ', # 0x01
'Tang ', # 0x02
'Kun ', # 0x03
'Ni ', # 0x04
'Jian ', # 0x05
'Dui ', # 0x06
'Jin ', # 0x07
'Gang ', # 0x08
'Yu ', # 0x09
'E ', # 0x0a
'Peng ', # 0x0b
'Gu ', # 0x0c
'Tu ', # 0x0d
'Leng ', # 0x0e
'[?] ', # 0x0f
'Ya ', # 0x10
'Qian ', ... | |
# Copyright 2014-2015 The Alive 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 ... | |
"""Test the stacking classifier and regressor."""
# Authors: Guillaume Lemaitre <[email protected]>
# License: BSD 3 clause
import pytest
import numpy as np
import scipy.sparse as sparse
from sklearn.base import BaseEstimator
from sklearn.base import ClassifierMixin
from sklearn.base import RegressorMixin
from ... | |
#!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Bitcoin test... | |
# 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.
import os
from collections import namedtuple
from datetime import datetime, time, timedelta
from io import... | |
# coding: utf-8
"""
Classes to describe object that help distinguishing events.
"""
__all__ = ["Channel", "Category"]
from order.unique import UniqueObject, unique_tree
from order.mixins import CopyMixin, AuxDataMixin, TagMixin, SelectionMixin, LabelMixin
from order.util import to_root_latex
@unique_tree(plural=... | |
# oxAuth is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
# Copyright (c) 2016, Gluu
#
# Author: Yuriy Movchan
#
# Requires the following custom properties and values:
# otp_type: totp/htop
# issuer: Gluu Inc
# otp_conf_file: /etc/certs/otp_configuration.json
#
# T... | |
import time
import threading
import logging
import os
import json
import select
import re
from queue import Queue
from importlib import import_module
import serial
LOGGER = logging.getLogger(__name__)
class Gateway(object):
"""Base implementation for a RFlink Gateway."""
# pylint: disable=too-many-instance... | |
import logging
from datetime import datetime
import gevent
import gevent.util
from apispec import APISpec
from apispec.ext.marshmallow import MarshmallowPlugin
from gevent.queue import Queue, Empty
from pyramid.httpexceptions import HTTPUnauthorized, HTTPFound
from pyramid.security import remember, forget, NO_PERMISSI... | |
#
# 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... | |
"""
This paver file is intended to help with the release process as much as
possible. It relies on virtualenv to generate 'bootstrap' environments as
independent from the user system as possible (e.g. to make sure the sphinx doc
is built against the built scipy, not an installed one).
The release is assumed to be done... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
from collections imp... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# ChemPy - A chemistry toolkit for Python
#
# Copyright (c) 2010 by Joshua W. Allen ([email protected])
#
# Permission is hereby granted, free of charge, to any person obtaining a
# co... | |
# 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... | |
# module_eigrp.py
#
# Copyright 2009 Daniel Mende <[email protected]>
#
# 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 th... | |
import json
import logging
import os
import shutil
import sys
import time
import urllib2
import warnings
# Dropping a table inexplicably produces a warning despite
# the "IF EXISTS" clause. Squelch these warnings.
warnings.simplefilter('ignore')
import MySQLdb
import environment
import utils
from mysql_flavor import ... | |
from __future__ import annotations
import abc
from collections import defaultdict
from functools import partial
import inspect
import re
from typing import (
TYPE_CHECKING,
Any,
Callable,
DefaultDict,
Dict,
Hashable,
Iterable,
Iterator,
List,
Sequence,
cast,
)
import warning... | |
# Copyright (c) 2013-2015 Centre for Advanced Internet Architectures,
# Swinburne University of Technology. All rights reserved.
#
# Author: Sebastian Zander ([email protected])
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
... | |
"""
Unspecified error handling tests
"""
import numpy as np
import os
from numba import jit, njit, typed, int64, types
from numba.core import errors
import numba.core.typing.cffi_utils as cffi_support
from numba.experimental import structref
from numba.extending import (overload, intrinsic, overload_method,
... | |
# Seshdash imports
from seshdash.models import Sesh_User, Sesh_Site,Site_Weather_Data,BoM_Data_Point, Alert_Rule, Sesh_Alert, RMC_status, Slack_Channel
from seshdash.utils.send_mail import send_mail
from seshdash.utils.send_sms import send_sms
from seshdash.utils.model_tools import get_model_from_string, get_latest_ins... | |
"""
Support for Telldus Live.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/tellduslive/
"""
from datetime import datetime, timedelta
import logging
import voluptuous as vol
from homeassistant.const import (
ATTR_BATTERY_LEVEL, DEVICE_DEFAULT_NAM... | |
#!/usr/bin/python
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Script that deploys a Chrome build to a device.
The script supports deploying Chrome from these sources:
1. A local build out... | |
# -*- coding: utf-8 -*-
"""This file contains the wifi.log (Mac OS X) parser."""
import logging
import re
import pyparsing
from plaso.containers import time_events
from plaso.lib import errors
from plaso.lib import eventdata
from plaso.lib import timelib
from plaso.parsers import manager
from plaso.parsers import te... | |
#!/usr/bin/env python3
# Copyright (C) 2013, 2014 by Yu-Jie Lin
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, ... | |
from cornice import Service
from pyramid.security import Everyone
from daybed.permissions import (
invert_permissions_matrix, merge_permissions, default_model_permissions
)
from daybed.backends.exceptions import ModelNotFound
from daybed.views.errors import forbidden_view
from daybed.schemas.validators import (
... | |
from DOJO.dojo import Dojo
from PERSON.person import Person, Staff, Fellow
from ROOM.room import Room, Office, LivingSpace
from room_allocator import InteractiveRoomAllocator
import unittest
from cmd import Cmd
from sqlalchemy import create_engine
from status import State
from sqlalchemy.orm import sessionmaker
import ... | |
import json
import dcos
import pytest
import shakedown
from tests.command import (
cassandra_api_url,
check_health,
get_cassandra_config,
install,
marathon_api_url,
request,
spin,
uninstall,
unset_ssl_verification,
)
from tests.defaults import DEFAULT_NODE_COUNT, PACKAGE_NAME
def ... | |
""" Defines a KernelClient that provides thread-safe sockets with async callbacks on message replies.
"""
import atexit
import errno
import sys
from threading import Thread, Event
import time
# import ZMQError in top-level namespace, to avoid ugly attribute-error messages
# during garbage collection of threads at exit... | |
"""Unit tests for contextlib.py, and other context managers."""
import io
import sys
import tempfile
import unittest
from contextlib import * # Tests __all__
from test import support
try:
import threading
except ImportError:
threading = None
class ContextManagerTestCase(unittest.TestCase):
def test_con... | |
r"""OS routines for Mac, DOS, NT, or Posix depending on what system we're on.
This exports:
- all functions from posix, nt, os2, mac, or ce, e.g. unlink, stat, etc.
- os.path is one of the modules posixpath, ntpath, or macpath
- os.name is 'posix', 'nt', 'os2', 'mac', 'ce' or 'riscos'
- os.curdir is a string r... | |
# 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 NumFOCUS
#
# 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/l... | |
#
# Copyright (c) 2008-2015 Citrix 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.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
#!/usr/bin/python
# Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, INC
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright n... | |
'''
Created on Jul 1, 2009
This module contains tests for the face recognition algorithms.
@author: bolme
'''
import unittest
import pyvision as pv
import numpy as np
#from optic_flow import *
#from distance import *
#import cv2.cv as cv
import os.path
class _TestNormalize(unittest.TestCase):
def setUp(s... | |
from __future__ import absolute_import
from django.conf import settings
from django.contrib.auth import authenticate, login, get_backends
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponseForbidden, HttpRespo... | |
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
#TODO add bitstamp, CampBx
"""
Active Markets
NOTE:
-> regarding ask/bids list orientation:
- bids: next imminent bid in orderbook and falling
- asks: next imminent ask in orderbook and raising
-> on HTML parsing:
1. get absolute path to the elements in Firefox with firebug
get_bids = '/html/bo... | |
#!/usr/bin/env python
import sys
class Feed( object ):
def __init__( self, entries ):
self.entries = entries
self.pos = 0
def peek( self ):
return self.entries[self.pos]
def skip( self ):
self.pos += 1
def next( self ):
out = self.entries[self.pos]
self.pos += 1
return out
def add( self, ... | |
import time
from django.http import HttpResponse
from django.core.cache import cache
from django import get_version as django_version
from django.core.mail import send_mail, mail_admins
from django.conf import settings
from django.utils.translation import ugettext as _
from django.template import loader, TemplateDoesNo... | |
"""Utilities for comparing files and directories.
Classes:
dircmp
Functions:
cmp(f1, f2, shallow=1, use_statcache=0) -> int
cmpfiles(a, b, common) -> ([], [], [])
"""
import os
import stat
import statcache
__all__ = ["cmp","dircmp","cmpfiles"]
_cache = {}
BUFSIZE=8*1024
def cmp(f1, f2, shallow=1, use... | |
# -*- coding: utf-8 -*-
import pytest
from marshmallow import fields
from marshmallow.marshalling import Marshaller, Unmarshaller, missing
from marshmallow.exceptions import ValidationError
from tests.base import User
def test_missing_is_falsy():
assert bool(missing) is False
class TestMarshaller:
@pytest... | |
from __future__ import unicode_literals
from __future__ import absolute_import
from collections import namedtuple
import logging
import re
import os
import sys
from operator import attrgetter
import six
from docker.errors import APIError
from docker.utils import create_host_config, LogConfig
from docker.utils.ports im... | |
#!/usr/bin/env python3
# Copyright 2014 Alex K (wtwf.com)
"""
Fixes up some posts imported from blogger with permalinks
posts imported with: https://gist.github.com/ngauthier/1506614
make all.txt with this (it finds all the blogger posts' urls):
for yr in $(seq 2005 2014); do \
for mo in $(seq -w 1 12); do \
sl... | |
# -*- coding: ISO-8859-15 -*-
# =============================================================================
# Copyright (c) 2004, 2006 Sean C. Gillies
# Copyright (c) 2007 STFC <http://www.stfc.ac.uk>
#
# Authors :
# Dominic Lowe <[email protected]>
#
# Contact email: [email protected]
# ========================... | |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | |
""" A stylish alternative for caching your map tiles.
TileStache is a Python-based server application that can serve up map tiles
based on rendered geographic data. You might be familiar with TileCache
(http://tilecache.org), the venerable open source WMS server from MetaCarta.
TileStache is similar, but we hope simpl... | |
import sys
class LinkedListCode:
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
def __init__(self):
pass
'''Linked List Cycle'''
def hasCycle(self, head):
if not head or not head.next:
return False
... | |
# Copyright (c) 2012 NetApp, Inc. All rights reserved.
# Copyright (c) 2014 Ben Swartzlander. All rights reserved.
# Copyright (c) 2014 Navneet Singh. All rights reserved.
# Copyright (c) 2014 Clinton Knight. All rights reserved.
# Copyright (c) 2014 Alex Meade. All rights reserved.
# Copyright (c) 2014 Bob Callaw... | |
#!/usr/bin/env python
#===============================================================================
# Copyright 2015 Geoscience Australia
#
# 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
#... | |
from pyiso import client_factory, BALANCING_AUTHORITIES
from pyiso.base import BaseClient
from pyiso.eu import EUClient
from unittest import TestCase
from datetime import datetime, timedelta
import unittest
import pytz
import mock
import libfaketime
libfaketime.reexec_if_needed()
class TestBaseLoad(TestCase):
def... | |
import os
import random
import string
from flask.ext.sqlalchemy import (
orm,
)
from flask_mail import (
Message,
)
from werkzeug.security import (
check_password_hash,
generate_password_hash,
)
from chatschoolette import (
db,
mail,
login_manager,
)
from chatschoolette.mod_account.mod... | |
################################################################################
# Copyright (C) 2015 Jaakko Luttinen
#
# This file is licensed under the MIT License.
################################################################################
"""
Unit tests for `concatenate` module.
"""
import warnings
warnings... | |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
COHORTE debug servlet, to visualize the state of the framework in a browser
:author: Thomas Calmant
:license: Apache Software License 2.0
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may not us... | |
from __future__ import absolute_import, division, print_function
import pytest
pytest.importorskip('numpy')
import dask.array as da
from dask.utils import ignoring
from dask.array.reductions import arg_aggregate
import numpy as np
def eq(a, b):
if isinstance(a, da.Array):
a = a.compute()
if isinstan... | |
# This file is part of the ISIS IBEX application.
# Copyright (C) 2012-2016 Science & Technology Facilities Council.
# All rights reserved.
#
# This program is distributed in the hope that it will be useful.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License... | |
""" The configuration bits of TileStache.
TileStache configuration is stored in JSON files, and is composed of two main
top-level sections: "cache" and "layers". There are examples of both in this
minimal sample configuration:
{
"cache": {"name": "Test"},
"layers": {
"example": {
"... | |
#!/usr/bin/env python
# Landsat Util
# License: CC0 1.0 Universal
import argparse
import textwrap
import json
from os.path import join
from urllib2 import URLError
from dateutil.parser import parse
import pycurl
from boto.exception import NoAuthHandlerFound
from downloader import Downloader, IncorrectSceneId
from s... | |
"""
This script reads the compact workflows.yml file, and and generates files in
.github/workflows/ suitable for the limited expressivity of GitHub's workflow
definition language.
The point is that we had/have a lot of duplications between files in
.github/workflows/, so we use this script to make it easier to update ... | |
# 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 ... | |
#!/usr/bin/env python2.7
# Copyright 2015 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 la... | |
"""
Test functions for models.tools
"""
from statsmodels.compat.python import lrange, range
import numpy as np
from numpy.random import standard_normal
from numpy.testing import (assert_equal, assert_array_equal,
assert_almost_equal, assert_string_equal, TestCase)
from nose.tools import (asse... | |
#
# Copyright 2014-2016 Vinay Vasista, Ravi Teja Mullapudi, Uday Bondhugula,
# and others from Multicore Computing Lab, Department of Computer Science
# and Automation, Indian Institute of Science
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... | |
from __future__ import absolute_import
from sfepy import data_dir
import six
filename_mesh = data_dir + '/meshes/3d/special/cube_cylinder.mesh'
if 0:
from sfepy.discrete.fem.utils import refine_mesh
refinement_level = 1
filename_mesh = refine_mesh(filename_mesh, refinement_level)
material_2 = {
'name... | |
# 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 ... | |
#!/usr/bin/env python3
# Copyright (c) 2018-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the Partially Signed Transaction RPCs.
"""
from decimal import Decimal
from test_framework.test_f... | |
# 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... | |
#!/usr/bin/env python
# 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.
"""Unit tests for git_common.py"""
import binascii
import collections
import os
import signal
import sys
import tempfile
import time
i... | |
import traceback
import sys
import ctypes
import comtypes
from comtypes.hresult import *
import comtypes.automation
import comtypes.typeinfo
import comtypes.connectionpoints
from comtypes.client import wrap
from comtypes.client.dynamic import Dispatch
from comtypes.gen import MSHTML
import logging
logger = logging.getL... | |
"""
:synopsis: Unit Tests for Windows IIS Module 'module.win_iis'
:platform: Windows
:maturity: develop
versionadded:: 2016.11.0
"""
import salt.modules.win_iis as win_iis
import salt.utils.json
from salt.exceptions import SaltInvocationError
from tests.support.mixins import LoaderModuleMockMixin
from t... | |
"""
The module for psi-statistics for RBF kernel for Spike-and-Slab GPLVM
"""
import numpy as np
from ....util.caching import Cache_this
from . import PSICOMP_RBF
gpu_code = """
// define THREADNUM
#define IDX_NMQ(n,m,q) ((q*M+m)*N+n)
#define IDX_NMM(n,m1,m2) ((m2*M+m1)*N+n)
#define IDX_NQ(n,q) (q*... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
import os
import shutil
import stat
import unittest
from common import TestCase
import pyuv
# Make stat return integers
try:
os.stat_float_times(False)
except AttributeError:
pass
pyuv.fs.stat_float_times(False)
BAD_FILE = 'test_file_bad'
TEST_FILE = 'test_file_1234'
TEST_FILE2 = 'test_file_1234_2'
TEST_L... | |
##########################################################################
#
# Copyright (c) 2011, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistribu... | |
"""Manage Fake OF tables for unit tests"""
# pylint: disable=too-many-lines
# Copyright (C) 2015 Research and Innovation Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2019 The Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance wi... | |
# Copyright 2012 SINA 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 app... | |
#!/usr/bin/env python
# * coding: utf8 *
'''
datatable.py
A module that reads the stewardship spreadsheet and builds the sgid index page
'''
from collections import OrderedDict
from os import rename
from os.path import dirname, join
import re
import pygsheets
#: from pydash.strings import start_case
def munge_data... | |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | |
# http://www.danvk.org/2015/01/09/extracting-text-from-an-image-using-ocropus.html
# for character level confidence
# https://github.com/tmbdev/ocropy/pull/25
import io
import json
import os
import subprocess
from wand.image import Image
import logging
from PIL import Image as PillowImage
from bs4 import BeautifulSoup
... | |
import unittest
from hecuba import config
from hecuba.hdict import StorageDict
from hecuba.storageobj import StorageObj
class SObj_Basic(StorageObj):
'''
@ClassField attr1 int
@ClassField attr2 double
@ClassField attr3 str
'''
class SDict_SimpleTypeSpec(StorageDict):
'''
@TypeSpec dict<... | |
# Copyright (c) 2013 Christian Schwede <[email protected]>
#
# 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 b... | |
# 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... | |
"""Provides device automations for homekit devices."""
from typing import List
from aiohomekit.model.characteristics import CharacteristicsTypes
from aiohomekit.model.characteristics.const import InputEventValues
from aiohomekit.model.services import ServicesTypes
from aiohomekit.utils import clamp_enum_to_char
import... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# 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... | |
"""Simple database to track task execution.
"""
import collections
import doctest
import logging
import os
import datetime
import json
import sqlite3
import redis
from ox_herd import settings as ox_settings
def create(run_db=None):
"Create and return RunDB reference based on run_db input."
run_db = run_db ... | |
#
# Copyright (c) 2011-2014 Exxeleron 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | |
# This is Cyder's main settings file. If you need to override a setting
# locally, use cyder/settings/local.py
import glob
import itertools
import logging
import os
import socket
import sys
from django.utils.functional import lazy
from lib.path_utils import ROOT, path
##########################
# copied from funfact... | |
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# for py2/py3 compatibility
from __future__ import print_function
from functools import reduce
from collections import OrderedDict
import json
import mult... | |
import Live
from _Generic.Devices import *
from _Framework.ControlSurfaceComponent import ControlSurfaceComponent
from _Framework.EncoderElement import EncoderElement
from _Framework.ButtonElement import ButtonElement
from _Framework.DisplayDataSource import DisplayDataSource
class Live8DeviceComponent(ControlSurface... | |
# 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
# distributed under th... | |
"Base Cache class."
import time
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.utils.module_loading import import_string
class InvalidCacheBackendError(ImproperlyConfigured):
pass
class CacheKeyWarning(RuntimeWarning):
pass
# Stub class to ensure not passing in a `tim... | |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.