gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from Tkinter import *
import tkFont
from tkSimpleDialog import askstring
from tkFileDialog import asksaveasfilename
from corpus import Corpus
from channel import Channel
from masterchannel import MasterChannel
from load_window import LoadWindow
from text_window import ScrolledText
class Editor(Frame):
def __init__(... | |
#!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import pickle
import re
import autofill_dataset_converter
import autofill_dataset_generator
import pyauto_fun... | |
import os
import sys
import shutil
import logging
import time
try:
# Python 3.x
import queue
except:
# Python 2.x
import Queue as queue
try:
# Python 3.x
from urllib.parse import quote
from urllib.parse import urlencode
from urllib.request import urlopen
from urllib.error import UR... | |
# Copyright 2013 Cisco 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 law o... | |
"""
The Spatial Reference class, represents OGR Spatial Reference objects.
Example:
>>> from django.contrib.gis.gdal import SpatialReference
>>> srs = SpatialReference('WGS84')
>>> print(srs)
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY... | |
"""Metrics to perform pairwise computation."""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# License: MIT
import numpy as np
from scipy.spatial import distance_matrix
from sklearn.base import BaseEstimator
from sklearn.utils import check_consistent_length
from sklearn.utils.multiclass import unique_labels
... | |
import csv
import json
import logging
import numpy as np
import os
import yaml
from typing import Iterable, TYPE_CHECKING, Dict, List, Optional, TextIO, Type
import ray.cloudpickle as cloudpickle
from ray.tune.callback import Callback
from ray.tune.utils.util import SafeFallbackEncoder
from ray.util.debug import log... | |
#
# Copyright 2017 the original author or 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... | |
"""Graph mode TF policy built using build_tf_policy()."""
from collections import OrderedDict
import logging
import numpy as np
from ray.rllib.policy.policy import Policy
from ray.rllib.policy.sample_batch import SampleBatch
from ray.rllib.policy.tf_policy import TFPolicy
from ray.rllib.models.catalog import ModelCat... | |
# -*- coding: utf-8 -*-
import datetime, string, random, decimal
import json
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
import settings as cart_settings
import helpers
class CartProductInterface(object):
"""Minimal ... | |
"""
sentry.utils.email
~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import toronado
from django.conf import settings
from django.core.mail import get_connection, EmailMultiAlterna... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you m... | |
#!/usr/bin/python
from __future__ import print_function
import argparse
import hashlib
import json
import logging
import os
import pipes
import sys
READ_SIZE = 1024 * 4
if not sys.version_info > (3, 0):
if not hasattr(sys, 'setdefaultencoding'):
reload(sys)
sys.setdefaultencoding('utf8')
class Erro... | |
"""
Created on 17 Dec 2012
@author: Zehan Wang
"""
from __future__ import division
import os
import math
from numpy.lib.stride_tricks import as_strided as ast
from numpy.core.umath import logical_and
import numpy
from spatch.utilities.io import open_image, get_voxel_size
from spatch.utilities.misc import auto_non_bac... | |
from collections import OrderedDict
from numpy import array, intersect1d, random, zeros
from pymc import database
from uncertainties import ufloat
from uncertainties.unumpy import uarray, nominal_value... | |
from django.db import models
from django.core import validators
from django.contrib.sites.models import Site
__all__ = [
'State', 'Tag', 'Keyword', 'Link',
'PostalAddress', 'PhoneNumber',
'LocalBusiness', 'Website',
]
class State(models.Model):
name = models.CharField(
max_length=25
)
... | |
# 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 applicable law or ag... | |
#!/usr/bin/env python
#
# Copyright 2007 The Closure Linter 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
#... | |
######################################################################
# CliCon - crf.py #
# #
# Willie Boag wboag@cs.uml.edu #
# ... | |
import os
import subprocess
import re
### Used in both YAN01_00015 and YAN01_00016
objdump_path = "/usr/i386-linux-cgc/bin/objdump"
objdump_options = ["-d", "--insn-width=20"] #we use a long insn width so we can figure out the length of the insn
objdump_header_options = ["-h"]
dump_ext = ".dump"
bin_path = "bin"
bui... | |
import atexit
from concurrent.futures import ThreadPoolExecutor
from math import log, ceil
from tempfile import TemporaryFile
import numpy as np
import scipy
import time
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.utils import check_array, check_random_state, gen_batches
from sklearn.utils.va... | |
import os
import sys
import logging
from c_wrapper import *
from .. import common_utils as msvc_utils
class definition_t(object):
#represents some other symbol
def __init__( self, def_id, bsc ):
self.__bsc = bsc
self.__def_id = def_id
@property
def def_id(self):
return self.__d... | |
"""
Unspecific helper classes
@author: Martin Kuemmel, Jonas Haase
@organization: Space Telescope - European Coordinating Facility (ST-ECF)
@license: Gnu Public Licence
@contact: mkuemmel@eso.org
@since: 2005/09/13
$LastChangedBy: mkuemmel $
$LastChangedDate: 2008-07-03 10:27:47 +0200 (Thu, 03 Jul 2008) $
$HeadURL: h... | |
# 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.
from recipe_engine.config_types import Path
from recipe_engine import config as recipe_config
import DEPS
CONFIG_CTX = DEPS['chromium'].CONFIG_CTX
@CONFIG_... | |
# Copyright (c) 2014, 2015, Oracle and/or its affiliates. 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
... | |
"""The core job_stream adapter in Python. This file is responsible for
providing adaptations for all of the needed C++ code.
.. warning::
New users should look at using the :mod:`job_stream.inline` module instead
of the classes in this file.
Example usage:
.. code-block:: python
from job_stream import... | |
"""
Test suite for the selenium test cases
"""
import os
import pytest
import time
from django.urls import reverse
from tests import BaseSeleniumTest
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as EC
from selenium... | |
# Copyright 2014 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 ... | |
import errno
import gym
import logging
import numpy as np
import os
from typing import Dict, List, Optional, Tuple, Union
import ray
import ray.experimental.tf_utils
from ray.util.debug import log_once
from ray.rllib.policy.policy import Policy, LEARNER_STATS_KEY
from ray.rllib.policy.rnn_sequencing import pad_batch_t... | |
from Crypto.PublicKey import RSA as _RSA
from Crypto.Cipher import AES as _AES
from Crypto.Util import Counter as _Counter
from six.moves import xrange as _xrange
from ._aesmix import lib as _lib
from .keyreg import KeyRegRSA as _KeyRegRSA
from .padder import Padder as _Padder
from .wrapper import mix_and_slice as _mi... | |
"""
The Connection class negotiates and manages the connection state.
"""
import logging
# pylint: disable=import-error
try:
from urllib import parse as urlparse
except ImportError:
import urlparse
try:
import ssl
except ImportError:
ssl = None
import threading
import time
from pamqp import specifica... | |
import copy
import json
import os
import shutil
import time
from django.conf import settings
try:
from django.urls import reverse
except ImportError: # Django < 1.10
from django.core.urlresolvers import reverse
from .base import TestCase
import whisper
from graphite.util import unpickle
class MetricsTeste... | |
# Copyright (c) 2016 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... | |
# -*- coding: utf-8 -*-
import operator
import pytest
import numpy as np
from pandas.compat import range
import pandas as pd
import pandas.util.testing as tm
from pandas.tests.frame.common import _check_mixed_float, _check_mixed_int
# -------------------------------------------------------------------
# Compariso... | |
from __future__ import absolute_import
import atexit
import logging
import time
try:
from queue import Empty, Full, Queue # pylint: disable=import-error
except ImportError:
from Queue import Empty, Full, Queue # pylint: disable=import-error
from collections import defaultdict
from threading import Thread, ... | |
"""
Functions for converting text documents into vector space
and dealing with dirty data.
Features:
- no external dependencies
- feature selection methods:
- CHI
- WCP (Within Class Probability)
- CMFS (Comprehensively Measure Feature Selection)
- improved GINI
- CO matrix calcualtion
- DF calculation
- IDF ... | |
#-*- coding: utf-8 -*-
'''
This file contains classes to handle getting data from different sources,
which provide consistent interface for uploader.
'''
'''
Possible modifications:
1) Change way of obtaining data to upload -> create new class extending BasicDataSrc
2) Change way of defining hierarchy -> create new c... | |
import re
import logging
from tyggbot import TyggBot
from command import Command
log = logging.getLogger('tyggbot')
class Substitution:
def __init__(self, cb, key=None, argument=None):
self.cb = cb
self.key = key
self.argument = argument
class BaseAction:
type = '??'
class MultiA... | |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.water_heaters_and_thermal_storage import WaterHeaterStratified
log = logging.getLogger(__name__)
class TestWaterHeaterStratified(unittest.TestCase):
def setUp(self):
... | |
from django.test import SimpleTestCase, override_settings
from casexml.apps.phone.models import IndexTree, SimplifiedSyncLog
class TestExtendedFootprint(SimpleTestCase):
def test_simple_linear_structure(self):
[grandparent_id, parent_id, child_id] = all_cases = ['grandparent', 'parent', 'child']
... | |
from __future__ import division
import optparse
from mpi4py import MPI
import numpy as np
from serial import find_solution, write_results
from settings import SEARCH_SPACE
def refine_work(work, p, new_min, verbose=False, split=False, split_min=4):
"""
Filter remaining work based on newly found solution and ... | |
from decimal import Decimal as D
from decimal import ROUND_UP
from django.utils import six
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext
from oscar.apps.offer import utils
from oscar.core.loading import get_model
from oscar.templatetags.currency_filters import ... | |
# Copyright 2015-2017 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | |
"""
NEW FEATURES:
1. Score ouptut is now dumped to validation_results.json
2. Custom instructor log lines can now be dumped to validation_logfile.txt
This file presents an example of a python custom validator for use in your Submitty assignment.
In this assignment, the student has been asked to randomly generate
... | |
r"""
The potential fields of a homogeneous sphere.
"""
from __future__ import division, absolute_import
import numpy as np
from ..constants import SI2MGAL, G, CM, T2NT, SI2EOTVOS
from .. import utils
from .._our_duecredit import due, Doi
due.cite(Doi("10.1017/CBO9780511549816"),
description='Forward modeli... | |
"""Predicates indicating if a level or cell should be unlocked."""
from django.db.models.query_utils import Q
from apps.widgets.smartgrid_play_tester import play_tester
from apps.widgets.smartgrid_design.models import DesignerAction, DesignerGrid
from apps.managers.smartgrid_mgr import smartgrid_mgr
def approved_act... | |
#
# 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
# ... | |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 ... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""This file contains a unit test for the timelib in Plaso."""
import datetime
import unittest
import uuid
from plaso.lib import errors
from plaso.lib import timelib
import pytz # pylint: disable=wrong-import-order
class TimeLibTest(unittest.TestCase):
"""Tests for time... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import unittest
from collections import OrderedDict
from sentry.utils.canonical import CanonicalKeyView, CanonicalKeyDict
class CanonicalKeyViewTests(unittest.TestCase):
canonical_data = OrderedDict(
[
("release... | |
import bpy
from bpy.props import PointerProperty, StringProperty, BoolProperty, \
EnumProperty, IntProperty, IntVectorProperty, FloatProperty, FloatVectorProperty, \
CollectionProperty, BoolVectorProperty
from .. import rman_bl_nodes
from .. import rfb_icons
from ..rfb_utils.shadergraph_utils import is_renderma... | |
#!/usr/bin/env python
# Copyright (c) 2002-2007 ActiveState Software Inc.
# See LICENSE.txt for license details.
# Author:
# Trent Mick (TrentM@ActiveState.com)
# Home:
# http://trentm.com/projects/which/
r"""Find the full path to commands.
which(command, path=None, verbose=0, exts=None)
Return the full path ... | |
from itertools import product as cartes
from sympy import (limit, exp, oo, log, sqrt, Limit, sin, floor, cos, ceiling,
atan, gamma, Symbol, S, pi, Integral, cot, Rational, I, zoo,
tan, cot, integrate, Sum, sign)
from sympy.series.limits import heuristics
from sympy.series.order i... | |
from . import Pointer, Structure, Reference, Index, const_index, is_aggregate
from .. import llvm
import ctypes
try:
import numpy as np
except ImportError:
np = None
__all__ = ["Any", "Array", "FastSlice", "Slice"]
class _AnyClass(object):
def __repr__(self):
return "Any"
#: Used in in slice... | |
# @HEADER
# ************************************************************************
#
# TriBITS: Tribal Build, Integrate, and Test System
# Copyright 2013 Sandia Corporation
#
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
# the U.S. Government retains certain ri... | |
import warnings
import numpy as np
from scipy import linalg
from scipy import stats
from numpy.linalg import svd
class Model(object):
name = 'Model'
status_need_for_eval = 0
""" Base class for a model. Actual models should inherit from this class.
In this class the functions that should be implemente... | |
from flask_restful import abort, reqparse, Resource
from marshmallow import Schema, fields, ValidationError, pre_load
from flask import Flask, Blueprint, request, jsonify
from flask_cors import CORS, cross_origin
import psycopg2
import os
from os.path import join, dirname
import threading
from time import sleep
import ... | |
import shutil
import time
import unittest
from unittest import TestCase
from wopmars.tests.resource.model.FooBase import FooBase
from wopmars.tests.resource.wrapper.FooWrapper5 import FooWrapper5
from wopmars.tests.resource.wrapper.sprintFive.Add import Add
from wopmars.tests.resource.wrapper.sprintFive.Query import Q... | |
"""
Tests of the neo.core.irregularlysampledsignal.IrregularySampledSignal class
"""
import unittest
import os
import pickle
import warnings
from copy import deepcopy
import numpy as np
import quantities as pq
from numpy.testing import assert_array_equal
from neo.core.dataobject import ArrayDict
try:
from IPyt... | |
#!/usr/bin/python
import sys
import deproxy
import unittest
import threading
import logging
import socket
import argparse
import time
deproxy_port_base = 9999
deproxy_port_iter = None
def get_next_deproxy_port():
global deproxy_port_iter
if deproxy_port_iter is None:
def deproxy_port_iter_func():
... | |
#copyright ReportLab Europe Limited. 2000-2012
#see license.txt for license details
__version__=''' $Id: pdfencrypt.py 3959 2012-09-27 14:39:39Z robin $ '''
"""helpers for pdf encryption/decryption"""
import string, sys, os
try:
from hashlib import md5
except ImportError:
from md5 import md5
from reportlab.l... | |
"""Module responsible for INI parsing."""
from collections import OrderedDict
import configparser
import os
import re
import time
from typing import Any, Dict, Callable, Iterable, IO, List, Tuple, Pattern
from neuralmonkey.config.builder import ClassSymbol, ObjectRef
from neuralmonkey.config.exceptions import ParseEr... | |
# 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... | |
# -*- coding: utf-8 -*-
"""The extraction CLI tool."""
from __future__ import unicode_literals
import os
from dfvfs.lib import definitions as dfvfs_definitions
from dfvfs.resolver import context as dfvfs_context
# The following import makes sure the analyzers are registered.
from plaso import analyzers # pylint: d... | |
#############################################################################
## ipsec.py --- IPsec support for Scapy ##
## ##
## Copyright (C) 2014 6WIND ##
## ... | |
# Copyright 2014 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 agreed t... | |
#
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | |
import urllib
import sys
import os
import re
import mimetypes
import warnings
from copy import copy
from urlparse import urlparse, urlunparse, urlsplit
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.conf import settings
from django.contrib.auth import authenti... | |
import process
import assign
import utils
import kinectData
import clusters
import numpy as np
def setupComparison(data1,data2):
inds = data1.feature_inds
print data2.feat_array[0,:]
data2.feat_array = data2.all_features[:,inds]
print data2.feat_array[0,:]
data2.feature_inds = inds
def getSeveralBases(data,curr... | |
from __future__ import unicode_literals
from django.test import TestCase
from django.utils import six
from rest_framework import serializers
from tests.models import (
ForeignKeySource, ForeignKeyTarget, ManyToManySource, ManyToManyTarget,
NullableForeignKeySource, NullableOneToOneSource,
NullableUUIDFore... | |
# PyVision License
#
# Copyright (c) 2006-2008 David S. Bolme
# 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
# notice, thi... | |
#!/usr/bin/env python3
#
# Copyright 2013 Simone Campagna
#
# 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 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... | |
# -*- coding: utf-8 -*-
#----------------------------------------------------------------------------#
# Imports.
#----------------------------------------------------------------------------#
from main import db
from main import bcrypt
# from carlae.main import db, bcrypt
import base64
import urlparse
import uuid
i... | |
# -*- coding: utf-8 -*-
import numpy as np
import warnings
from affine import Affine
from numpy import min_scalar_type
from rasterio import features
from rasterstats.io import read_features, Raster
from rasterstats.utils import (get_percentile, check_stats, remap_categories,
key_assoc_val, boxify_po... | |
"""
Is Unique
Implement an algorithm o determine if a string has all unique characters.
What if you cannot use additional data structures?
"""
def is_unique(word):
# if no data structures then sort and count
return len(word) == len(set(word.lower()))
def test_is_uniqure():
assert is_unique('... | |
#!/usr/bin/env python
#
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
#
##########################################################################
###################... | |
# Copyright 2020 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.
"""
The parts module defines the various binary pieces of the Chrome application
bundle that need to be signed, as well as providing utilities to sign them.
"... | |
# 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... | |
from __future__ import absolute_import
import os, datetime, urllib, re
import time, functools, cgi
import json
def timestamp():
"""
Returns a serializable UTC timestamp.
"""
return time.time()
def format_timestamp(s):
s = time.localtime(s)
d = datetime.datetime.fromtimestamp(time.mktime(s... | |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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... | |
import pymongo
import bson
import random
import datetime
from pymongo import MongoClient
from bson.objectid import ObjectId
busStops = ['Flogsta','Polacksbacken','Central Station','Granby','Gamla Uppsala','Uppsala Science Park','Uppsala Centrum','Carolina Rediviva', 'Uppsala Hospital']
coordinates = [[59.851252, 17.5... | |
# -*- coding: utf-8 -*-
import logging
import time
import json
import uuid
# Setup logger
logger = logging.getLogger()
logger.setLevel(logging.INFO)
SAMPLE_APPLIANCES = [
{
"applianceId": "endpoint-001",
"manufacturerName": "Sample Manufacturer",
"modelName": "Smart Switch",
"ver... | |
#!/usr/bin/env python
# ssterm - simple serial-port terminal
# https://github.com/vsergeev/ssterm
#
# Copyright (c) 2014-2016 Ivan (Vanya) A. Sergeev
#
# 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... | |
# coding: utf-8
import os
import socket
import gzip
from gppylib.commands.base import Command, REMOTE, WorkerPool, CommandResult
from gppylib.db import dbconn
from gppylib.test.behave_utils.utils import getRows, validate_parse_email_file
from gppylib.gparray import GpArray
from gppylib.operations.unix import CheckFil... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
from acq4.util import Qt
import pyqtgraph as pg
from acq4.util.debug import Profiler
Ui_Form = Qt.importTemplate('.atlasCtrlTemplate')
class Atlas(Qt.QObject):
DBIdentity = None
"""An Atlas is responsible for determining the position of ... | |
# 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... | |
# 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... | |
#!/usr/bin/env python2.7
# Copyright 2015, Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this li... | |
#-*- coding:utf-8-*-
"""
file: model.py
author: Yoann Dupont
MIT License
Copyright (c) 2018 Yoann Dupont
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 ... | |
"""Private module full of compatibility hacks.
Primarily this is for downstream redistributions of requests that unvendor
urllib3 without providing a shim.
.. warning::
This module is private. If you use it, and something breaks, you were
warned
"""
from collections import Mapping, MutableMapping
import sys
... | |
from __future__ import unicode_literals
from django.contrib import messages
from django.db import transaction
from django.shortcuts import get_object_or_404, redirect
from django.template.context_processors import csrf
from django.template.response import TemplateResponse
from django.utils.translation import pgettext_... | |
import smtk
# Common data structures & functions
ConfigData = type('ConfigData', (object,), dict())
def standard_section(attribute_type, title=None, group_name=None, comment=None):
config = ConfigData()
config.type = 'standard'
config.attribute_type = attribute_type
config.title = title
config.grou... | |
import urllib2
import re
from bs4 import BeautifulSoup
from urlparse import urljoin
from pysqlite2 import dbapi2 as sqlite
import nn
mynet = nn.searchnet('nn.db')
# Create a list of words to ignore
ignorewords = {'the': 1, 'of': 1, 'to': 1,
'and': 1, 'a': 1, 'in': 1, 'is': 1, 'it': 1}
class crawler:
... | |
# 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... | |
#!/usr/bin/env python
#
# Copyright 2010 the V8 project authors. All rights reserved.
# 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
# noti... | |
#
# 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... | |
# Copyright 2014 Cisco Systems, 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 requir... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nicira Networks, 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.apach... | |
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.