gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright 2012 Red Hat, Inc.
# Copyright 2013 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.... | |
"""Test the cross_validation module"""
import warnings
import numpy as np
from scipy.sparse import coo_matrix
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_raises
from sklearn... | |
from functools import wraps
import hashlib
import datetime
import mimetypes
import random
from bson import ObjectId
from flask import jsonify, Response, url_for
from flask_jwt import jwt_required, current_user
from flask_restful import reqparse, abort
import pymongo
import werkzeug
from werkzeug.utils import secure_fi... | |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for implementations of L{IReactorProcess}.
@var properEnv: A copy of L{os.environ} which has L{bytes} keys/values on POSIX
platforms and native L{str} keys/values on Windows.
"""
from __future__ import division, absolute_import, pr... | |
"""
plugins/Paypal.py
Author: Trey Stout
Date Added: Mon Jul 24 15:29:48 CDT 2006
New interface to the same old shit...
"""
## STD LIBS
from md5 import md5
from datetime import date, datetime
from xml.dom import minidom
from pprint import pprint, pformat
from math import floor
import time
## OUR LIBS
from AZTKAPI i... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | |
#! /usr/bin/python
import os
import subprocess
import sys
import time
import json
from shock import Client as ShockClient
from biokbase.userandjobstate.client import UserAndJobState
from biokbase.auth import kb_config
from ConfigParser import ConfigParser
from Bio import SeqIO
# Exception thrown when a command failed... | |
"""
Commands that are available from the connect screen.
"""
import re
import time
from collections import defaultdict
from random import getrandbits
from django.conf import settings
from django.contrib.auth import authenticate
from evennia.players.models import PlayerDB
from evennia.objects.models import ObjectDB
from... | |
from __future__ import absolute_import
import copy
import six
import pytest
import pytz
from sentry.utils.compat.mock import patch
from datetime import timedelta
from six.moves.urllib.parse import urlencode
from selenium.webdriver.common.keys import Keys
from sentry.discover.models import DiscoverSavedQuery
from sen... | |
"""fips verb to build the oryol samples webpage"""
import os
import yaml
import shutil
import subprocess
import glob
from string import Template
from mod import log, util, project, emscripten, android, nacl
from tools import texexport
GitHubSamplesURL = 'https://github.com/floooh/oryol/tree/master/code/Samples/'
B... | |
# Copyright (C) Mesosphere, Inc. See LICENSE file for details.
import logging
import time
import pytest
import requests
from mocker.endpoints.mesos import AGENT1_ID, AGENT3_ID
from util import GuardedSubprocess, LineBufferFilter, SearchCriteria
log = logging.getLogger(__name__)
@pytest.fixture()
def empty_file(tm... | |
"""\
NAME
AnalyticDerivatives.py
SYNOPSIS
Workhorse of the force.py module.
DESCRIPTION
AUTHOR
Hatem H. Helal, hhh23@cam.ac.uk
REPORT BUGS
Report bugs to hhh23@cam.ac.uk
COPYRIGHT
"""
from NumWrap import array2string
from math import sqrt
from PGBF import PGBF,coulomb
from pyints imp... | |
# -*- encoding: utf-8 -*-
#
# Copyright 2015 Hewlett Packard Development Company, LP
# Copyright 2015 Universidade Federal de Campina Grande
#
# 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 Lice... | |
import datetime
import hashlib
import random
import re
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.db import transaction
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
try:
from d... | |
from os import path as op
import numpy as np
from numpy.polynomial import legendre
from numpy.testing import (assert_allclose, assert_array_equal, assert_equal,
assert_array_almost_equal)
from nose.tools import assert_raises, assert_true
from mne.forward import _make_surface_mapping, make_f... | |
import os.path
import socket
import logging
import time
import xmltodict
from runfolder import __version__ as version
from arteria.web.state import State
from arteria.web.state import validate_state
from runfolder.lib.instrument import InstrumentFactory
class RunfolderInfo:
"""
Information about a runfolder. ... | |
"""
Updated on 19.12.2009
@author: alen, pinda
Inspired by:
http://github.com/leah/python-oauth/blob/master/oauth/example/client.py
http://github.com/facebook/tornado/blob/master/tornado/auth.py
"""
import time
import base64
import urllib
import urllib2
# parse_qsl was moved from the cgi namespace to urlpars... | |
# Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/
# Copyright 2012-2014 Amazon.com, Inc. 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. A copy of
# the License is located at
#
# http... | |
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Train a Fast R-CNN network."""
import numpy as np
import os
import t... | |
"""
This module allows one to use SWIG2 (SWIG version >= 1.3) wrapped
objects from Weave. SWIG-1.3 wraps objects differently from SWIG-1.1.
This module is a template for a SWIG2 wrapped converter. To wrap any
special code that uses SWIG the user simply needs to override the
defaults in the swig2_converter class. Th... | |
import os
import time
from lib.aws import AWS_USER
from .common import (
AmazonWebServices, run_command
)
from .test_airgap import get_bastion_node
from .test_custom_host_reg import (
random_test_name, RANCHER_SERVER_VERSION, HOST_NAME, AGENT_REG_CMD
)
BASTION_ID = os.environ.get("RANCHER_BASTION_ID", "")
NUMBE... | |
# Copyright 2014 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'ArticleTranslation.meta_title'
db.add_column(u'aldryn_new... | |
from __future__ import annotations
import collections
from datetime import datetime
from decimal import Decimal
from functools import wraps
import operator
import os
import re
import string
from typing import (
TYPE_CHECKING,
Callable,
ContextManager,
Counter,
Iterable,
)
import warnings
import nu... | |
from django.template import loader, RequestContext
from django.core.exceptions import ObjectDoesNotExist
from django.core.xheaders import populate_xheaders
from django.db.models.fields import DateTimeField
from django.http import Http404, HttpResponse
import datetime, time
def archive_index(request, queryset, date_fie... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import unittest
import os
import json
from io import open
import warnings
from pymatgen.electronic_structure.bandstructure import Kpoint
from pymatgen import Lattice
from pymatgen.electronic_structure.core im... | |
# Copyright (c) 2013 - 2015 EMC Corporation.
# 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
#
# Unle... | |
import util
from PicartoClientAPI import PublicApi, rest, logger, OnlineDetails, ApiClient, Category, Configuration, ChannelDetails
from pagination import PaginationStore
configuration = Configuration()
public_api = PublicApi()
api_client = ApiClient()
pages = PaginationStore()
rest.HTTP = HTTP
logger.Log = Log
THUM... | |
"""
Test Webdriver steps.
"""
from aloe.testing import FeatureTest
from aloe_webdriver.tests.base import feature, PAGES
class TestUtil(FeatureTest):
"""Test steps."""
@feature()
def test_I_should_see(self):
"""
Feature: I should see, I should not see
Scenario: Everything fires up
Wh... | |
# Test export module
import sys
sys.path.insert(0, '..')
import copy
import os
import shutil
import numpy as np
import flopy
pth = os.path.join('..', 'examples', 'data', 'mf2005_test')
namfiles = [namfile for namfile in os.listdir(pth) if namfile.endswith('.nam')]
# skip = ["MNW2-Fig28.nam", "testsfr2.nam", "testsfr2... | |
import os
import six
import pytest
from doit import version
from doit.cmdparse import CmdParseError, CmdParse
from doit.exceptions import InvalidCommand, InvalidDodoFile
from doit.dependency import FileChangedChecker
from doit.task import Task
from doit.cmd_base import version_tuple, Command, DoitCmdBase
from doit.cm... | |
"""Automata.py
Manipulation of and conversions between regular expressions,
deterministic finite automata, and nondeterministic finite automata.
D. Eppstein, UC Irvine, November 2003.
"""
from __future__ import generators
from Util import arbitrary_item
import sys
import operator
import unittest
from sets import S... | |
from collections import namedtuple
import mxnet as mx
from stt_layer_batchnorm import batchnorm
GRUState = namedtuple("GRUState", ["h"])
GRUParam = namedtuple("GRUParam", ["gates_i2h_weight", "gates_i2h_bias",
"gates_h2h_weight", "gates_h2h_bias",
... | |
"""
A tentative module for pushing data through branching pipelines.
"""
import csv
from tempfile import NamedTemporaryFile
from operator import itemgetter
from itertools import islice
from collections import defaultdict
import pickle as pickle
from .util import asindices, HybridRow, shortlistmergesorted
import pet... | |
import json
import re
from compare import expect, ensure, matcher
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from tardis.tardis_portal.models import \
Experiment, ObjectACL, User, UserProfile
from tardis.tardis_portal.ParameterSetManager im... | |
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
# Import statements
import sys
sys.path.append("/home/pi/Documents/Robots/slcypi/MA") ### ADD PATH
sys.path.append("/home/pi/Documents/Robots/slcypi/HAT_Python3") ### ADD PATH
import cv2
import numpy as np
import matplotlib.pyplot as plt
from Tank import Tank
from ImageAnalysis import ImageAnalysis
import picamera
impo... | |
#!/usr/bin/env python
"""
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");... | |
import numpy as np
import time
import sys
import subprocess
import os
import random
from NCRFAE.neurocrf_autoencoder_EM import *
import gzip
import cPickle
from NCRFAE.utils import *
import argparse
def run(parsed_args):
lfilename = parsed_args.labeled_set
per_labeled = parsed_args.percent_labeled
per_unl... | |
# -*- coding: UTF-8 -*-
from __future__ import absolute_import
import struct
import sys
import tempfile
import unittest
import six
import pytest
from mock import Mock, patch
from behave.formatter._registry import make_formatters
from behave.formatter import pretty
from behave.formatter.base import StreamOpener
from be... | |
from django.test import TestCase
from ..models import TaxSaveInputs, WorkerNodesCounter
from ..models import convert_to_floats
from ..helpers import (expand_1D, expand_2D, expand_list, package_up_vars,
format_csv, arrange_totals_by_row, default_taxcalc_data)
from ...taxbrain import compute as comp... | |
"""
Searching for names with given scope and name. This is very central in Jedi and
Python. The name resolution is quite complicated with descripter,
``__getattribute__``, ``__getattr__``, ``global``, etc.
If you want to understand name resolution, please read the first few chapters
in http://blog.ionelmc.ro/2015/02/0... | |
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
""" IMPORTS """
import urllib3
import traceback
from typing import List, Dict, Optional, Tuple, Generator
# disable insecure warnings
urllib3.disable_warnings()
INTEGRATION_NAME = "Cofense Feed"
_RESULTS_PER_PAGE = 50... | |
import pytest
import io
import json
import aiohttpretty
from waterbutler.core import streams
from waterbutler.core import exceptions
from waterbutler.providers.figshare import metadata
from waterbutler.providers.figshare import provider
from waterbutler.providers.figshare.settings import PRIVATE_IDENTIFIER, MAX_PAG... | |
#!/usr/bin/env python
###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in... | |
import os
import string
import os.path as op
import sys
import shutil
from collections import namedtuple
try:
from seqcluster import prepare_data as prepare
from seqcluster import templates as template_seqcluster
from seqcluster.seqbuster import _create_counts, _read_miraligner, _tab_output
except ImportEr... | |
#!/usr/bin/env python
'''
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")... | |
import GPy
import numpy as np
import pytest
from scipy.optimize import check_grad
import emukit.multi_fidelity.models
from emukit.multi_fidelity.models.non_linear_multi_fidelity_model import make_non_linear_kernels
class TestNonLinearModel:
@pytest.fixture()
def x_init(self):
x_init = np.zeros((15, 3... | |
import unittest
from covermi.gr import Gr, Entry, Chrom, Iterate, bisect_left
class TestEntry(unittest.TestCase):
def test_constructor(self):
self.assertEqual(Entry("1", 10, 20), Entry("chr1", 10, 20))
self.assertEqual(Entry("23", 10, 20), Entry("23", 10, 20))
self.assertEqual(Entry("23"... | |
""" Functions and Classes used to fit an estimate of an unabsorbed
continuum to a QSO spectrum.
"""
# p2.6+ compatibility
from __future__ import division, print_function, unicode_literals
try:
unicode
except NameError:
unicode = basestring = str
import numpy as np
import matplotlib.pyplot as pl
import matplot... | |
#!/usr/bin/python
# TODO: issues with new oauth2 stuff. Keep using older version of Python for now.
# #!/usr/bin/env python
from participantCollection import ParticipantCollection
import re
import datetime
import time
import pyperclip
# EDIT ME!
currentMonthTotalDays = 31
year = 2018
currentMonthIndex = datetime.dat... | |
import logging, base64
from twisted.words.protocols import irc
from twisted.internet import protocol, reactor
from socbot.pluginapi import API
from socbot.userdb import UserDB
# Credits to ibid for some helpful code:
# - Ping ponger
class Connection(irc.IRCClient):
nickname = "SocBot"
_ping_deferred = None... | |
#!/usr/bin/env python3
# The MIT License (MIT)
#
# Copyright (c) 2016 Ivor Wanders
#
# 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 rig... | |
# Copyright 2013 dotCloud inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed t... | |
import sys
import logging
import uuid
import datetime
import collections
import copy
try:
import ujson as json
except ImportError:
import json
from collections import defaultdict
from simple_n_grams.simple_n_grams import SimpleNGrams
logger = logging.getLogger("analysis")
def analyze_tweets(tweet_generator,r... | |
# -*- coding: utf-8 -*-
"""Tests for the project and solution file writer classes."""
import io
import os
import unittest
from vstools import resources
from vstools import writers
from tests import test_lib
class FileWriterTest(test_lib.BaseTestCase):
"""File writer tests."""
# pylint: disable=protected-acces... | |
# -*- coding: utf-8 -*-
#
# Desc: This file is part of the ecromedos Document Preparation System
# Author: Tobias Koch <tobias@tobijk.de>
# License: MIT
# URL: http://www.ecromedos.net
#
import sys, locale, functools
import lxml.etree as etree
from net.ecromedos.error import ECMDSPluginError
def getInstance(c... | |
#!/usr/bin/env python3
import itertools
from collections import defaultdict
import networkx as nx
import numpy as np
from pgmpy.base import UndirectedGraph
from pgmpy.factors import factor_product, Factor
from pgmpy.independencies import Independencies
from pgmpy.extern.six.moves import map, range, zip
class Markov... | |
#!/usr/bin/env python
"""Manage data servers."""
import atexit
import os
import readline
import time
import urlparse
import urllib3
from urllib3 import connectionpool
# pylint: disable=unused-import,g-bad-import-order
from grr.client import client_plugins
# pylint: enable=unused-import,g-bad-import-order
from grr.... | |
import numpy as np
import scipy as sp
from itertools import product
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_gre... | |
# Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
from __future__ import unicode_literals
from django.core import mail
from django.utils import six
from reviewboard.reviews.models import Review
from reviewboard.webapi.resources import resources
from reviewboard.webapi.tests.base import BaseWebAPITestCase
from reviewboard.webapi.tests.mimetypes import (review_reply_i... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | |
from __future__ import unicode_literals
import time
import responses
from tunigo.api import BASE_QUERY, BASE_URL, Tunigo
from tunigo.genre import Genre, SubGenre
from tunigo.playlist import Playlist
from tunigo.release import Release
class TestApi(object):
@responses.activate
def test_repr(self):
... | |
import unittest
from src.binary_search_tree import BST, PARENT, KEY, LEFT, RIGHT, SIZE, \
BinarySearchTreeNode
class TestBinarySearchTreeNode(unittest.TestCase):
def test_insert(self):
bst = BinarySearchTreeNode('x', 1)
y_node = bst.insert('y', 2)
u_node = bst.insert('u', 3)
... | |
"""
pghoard - main pghoard daemon
Copyright (c) 2015 Ohmu Ltd
See LICENSE for details
"""
from __future__ import print_function
from contextlib import closing
import datetime
import json
import logging
import logging.handlers
import os
import psycopg2
import random
import signal
import shutil
import socket
import sys... | |
#
# Copyright 2018 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys, random, string, requests
LOGGING = True
BASE_URL = "http://localhost:8080"
API_VERSION = "v1.4.0"
DL_TOKEN = { 'Authorization' : 'DirectLogin token=' }
CONTENT_JSON = { 'content-type' : 'application/json' }
def setCounterParty(bank_id, account_id,cou... | |
# -*- coding: utf-8 -*-
from .grammar import SchemaGrammar
from ..blueprint import Blueprint
from ...query.expression import QueryExpression
from ...support.fluent import Fluent
class MySqlSchemaGrammar(SchemaGrammar):
_modifiers = [
'unsigned', 'charset', 'collate', 'nullable',
'default', 'incr... | |
'''@file gmm.py
contains the functionality for Kaldi GMM training, aligning and testing'''
from abc import ABCMeta, abstractproperty
import os
class GMM(object):
'''an abstract class for a kaldi GMM'''
__metaclass__ = ABCMeta
def __init__(self, conf):
'''
KaldiGMM constructor
Arg... | |
# This file is part of khmer, https://github.com/dib-lab/khmer/, and is
# Copyright (C) 2010-2015, Michigan State University.
# Copyright (C) 2015-2016, The Regents of the University of California.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fol... | |
# 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 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... | |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | |
#
# 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
# ... | |
from numpy import matrix, array, abs, ravel, zeros_like, dot
from scipy import rand, linalg, mat, random
from scipy.sparse import csr_matrix
from scipy.linalg import svd, eigvals
from pyamg.util.linalg import approximate_spectral_radius,\
infinity_norm, norm, condest, cond,\
ishermitian, pinv_array
from pyamg... | |
""" $lic$
Copyright (C) 2016-2020 by Tsinghua University and The Board of Trustees of
Stanford University
This program is free software: you can redistribute it and/or modify it under
the terms of the Modified BSD-3 License as published by the Open Source
Initiative.
This program is distributed in the hope that it wi... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | |
#!/usr/bin/env python3
import pytest
import aiospamc
from aiospamc.frontend import (
check,
headers,
process,
ping,
report,
report_if_spam,
symbols,
tell,
)
from aiospamc.exceptions import (
BadResponse,
UsageException,
DataErrorException,
NoInputException,
NoUserEx... | |
#!python3
import io
import re
from enum import Enum
import editor
import console
from blackmamba.ide.annotation import Annotation, Style
from itertools import groupby
from blackmamba.config import get_config_value
import blackmamba.ide.tab as tab
import os
import blackmamba.log as log
def _hud_alert_delay():
ret... | |
# 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 -*-
from __future__ import print_function
from pyqtgraph.flowchart.library.common import CtrlNode, PlottingCtrlNode
from pyqtgraph.graphicsItems.InfiniteLine import InfiniteLine
import numpy as np
import acq4.util.functions as functions
from six.moves import range
class Threshold(CtrlNode):
""... | |
from cloudify import ctx
from cloudify.exceptions import NonRecoverableError
from cloudify.state import ctx_parameters as inputs
import subprocess
import os
import re
import sys
import time
import threading
import platform
from StringIO import StringIO
from cloudify_rest_client import CloudifyClient
from cloudify impo... | |
# -*- coding: utf-8 -*-
"""Constants for PyBEL.
This module maintains the strings used throughout the PyBEL codebase to promote consistency.
"""
from .config import connection
def get_cache_connection() -> str:
"""Get the preferred RFC-1738 database connection string.
1. Check the environment variable ``P... | |
# Copyright (c) 2012 OpenStack Foundation.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | |
""" Python Character Mapping Codec cp1252 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT' with gencodec.py.
""" # "
import codecs
# ## Codec APIs
class Codec(codecs.Codec):
def encode(self, input, errors='strict'):
return codecs.charmap_encode(input, errors, encoding_table)
def decode(... | |
import os
import sys
import base64
import asyncio
import logging
import argparse
import regex
import synapse.exc as s_exc
import synapse.common as s_common
import synapse.telepath as s_telepath
import synapse.lib.output as s_output
import synapse.lib.dyndeps as s_dyndeps
logger = logging.getLogger(__name__)
wflown... | |
from __future__ import unicode_literals
import re
import json
import datetime
from moto.core import BaseBackend, BaseModel
from moto.ec2 import ec2_backends
from .utils import make_arn_for_certificate
import cryptography.x509
import cryptography.hazmat.primitives.asymmetric.rsa
from cryptography.hazmat.primitives im... | |
#
# 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... | |
"""The tests for the emulated Hue component."""
import asyncio
import json
from ipaddress import ip_address
from unittest.mock import patch
from aiohttp.hdrs import CONTENT_TYPE
import pytest
from tests.common import get_test_instance_port
from homeassistant import const, setup
from homeassistant.components import (
... | |
# 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 ... | |
""":mod:`libfeedly.api`
~~~~~~~~~~~~~~~~~~~~~~~
"""
import requests
import time
try:
import simplejson as json
except ImportError:
import json
from .subscription import Subscription
from .stream import Stream
from .item import Item
from .utils import user_id, tag_id, category_id, feed_id, escape
from .compat im... | |
#!/usr/bin/env python
import os
# check if NEOS update is required
while 1:
if (not os.path.isfile("/VERSION") or int(open("/VERSION").read()) < 3) and not os.path.isfile("/sdcard/noupdate"):
os.system("curl -o /tmp/updater https://openpilot.comma.ai/updater && chmod +x /tmp/updater && /tmp/updater")
else:
... | |
# -*- coding: utf-8 -*-
"""
Netconfigit and NetworkDevice classes
"""
__license__ = "MIT License"
__author__ = "Eric Griffin"
__copyright__ = "Copyright (C) 2014, Fluent Trade Technologies"
__version__ = "1.1"
import os
import sys
import time
import shutil
import logging
import os.path
import inspect
import threadin... | |
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | |
#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Snapshot Build Bisect Tool
This script bisects a snapshot archive using binary search. It starts at
a bad revision (it will try... | |
# 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 vpython
# Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import datetime
import sys
import unittest
from test_support import test_env
test_env.setup_test_env()
from google.appeng... | |
# 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... | |
import os
from PyQt4 import QtCore, QtGui
from dependence_repo_manager.ui.ui_repo_manager_window import Ui_repoManagerWindow
import dependence_repo_manager.core.logger as logger
from dependence_repo_manager.core.exceptions import LockException
from dependence_repo_manager.core.dialogs import SettingsDialog, RefreshAl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.