gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
"""
Analysis tools for Topographica, other than plotting tools.
Configures the interface to the featuremapper and holoviews projects
and sets the appropriate Topographica-specific hooks.
"""
import numpy as np
from holoviews.interface.collector import Reference
from holoviews import HSV, Image
from holoviews.core.op... | |
# Copyright (c) 2015 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
#
# Unle... | |
from __future__ import unicode_literals
import datetime
import unittest
import warnings
from decimal import Decimal
import pytest
from django.conf.urls import url
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.test import TestCase
from django.test.utils import overrid... | |
#!/usr/bin/env python
#
# Copyright 2010,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your opt... | |
# Copyright (c) 2013 Mattias Svala
# Copyright (c) 2013 Tao Sauvage
# Copyright (c) 2014 ramnes
# Copyright (c) 2014 Sean Vig
# Copyright (c) 2014 dmpayton
# Copyright (c) 2014 dequis
# Copyright (c) 2014 Tycho Andersen
# Copyright (c) 2015 Serge Hallyn
#
# Permission is hereby granted, free of charge, to any person ob... | |
import sys
from functools import wraps
# Code by Gary Bernhardt, taken from https://github.com/garybernhardt/dingus
# Needed this code to do reliable loading of initial data using fixtures in
# south. See http://stackoverflow.com/questions/5472925/django-loading-data-from-fixture-after-backward-migration-loaddata-is-u... | |
# Copyright (c) 2015 Clinton Knight. 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... | |
#########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | |
"""
@file wifi.py
"""
##
# @addtogroup sanity sanity
# @brief This is sanity component
# @{
# @addtogroup comm_wifi_connect comm_wifi_connect
# @brief This is comm_wifi_connect module
# @{
##
import time
import os
import string
from oeqa.utils.helper import shell_cmd_timeout
class WiFiFunction(object):
"""
@... | |
import ctypes
import socket
import threading
import time
import sys
from zeroconf import ServiceBrowser, Zeroconf
import logging
logger = logging.getLogger('c6dwifi')
logger.setLevel(logging.INFO)
libgphoto_names = ['libgphoto2.so.6', 'libgphoto2.6.dylib']
class GPhotoError(Exception):
def __init__(self, result,... | |
# SRE test harness for the Python regression suite
# this is based on test_re.py, but uses a test function instead
# of all those asserts
import sys
sys.path=['.']+sys.path
from test_support import verbose, TestFailed, have_unicode
import sre
import sys, os, string, traceback
#
# test support
def test(expression, ... | |
"""Access to Python's configuration information."""
import os
import sys
from os.path import pardir, realpath
__all__ = [
'get_config_h_filename',
'get_config_var',
'get_config_vars',
'get_makefile_filename',
'get_path',
'get_path_names',
'get_paths',
'get_platform',
'get_python_ve... | |
#!/usr/bin/env python
# Copyright 2013 The Swarming 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.
# pylint: disable=W0212,W0223,W0231,W0613
import base64
import hashlib
import json
import logging
import os
import Stri... | |
"""
Utilities for validating inputs to user-facing API functions.
"""
from textwrap import dedent
from functools import wraps
from inspect import getargspec
from uuid import uuid4
from six import iteritems, viewkeys, exec_
from toolz import valmap
NO_DEFAULT = object()
def expect_types(*_pos, **named):
"""
... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... | |
#!/usr/bin/env python3
#
# Copyright (c) 2017-2018 Weitian LI <weitian@aaronly.me>
# MIT License
#
"""
Convert a FITS image to OSKAR sky model for simulation usage.
NOTE
----
The OSKAR sky model consists of all the valid pixels (with absolute
values within the specified minimum and maximum thresholds) from
the given ... | |
# -*- test-case-name: twisted.test.test_pb -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Perspective Broker
\"This isn\'t a professional opinion, but it's probably got enough
internet to kill you.\" --glyph
Introduction
============
This is a broker for proxies for and copies of ob... | |
"""
The service module for OpenBSD
.. important::
If you feel that Salt should be using this module to manage services on a
minion, and it is using a different module (or gives an error similar to
*'service.start' is not available*), see :ref:`here
<module-provider-override>`.
"""
import fnmatch
impo... | |
"""Selector event loop for Unix with signal handling."""
import errno
import io
import itertools
import os
import selectors
import signal
import socket
import stat
import subprocess
import sys
import threading
import warnings
from . import base_events
from . import base_subprocess
from . import constants
from . impor... | |
# 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... | |
from neo.Prompt.Commands.Wallet import CommandWallet
from neo.Prompt.Commands.tests.test_wallet_commands import UserWalletTestCaseBase
from neo.Implementations.Wallets.peewee.UserWallet import UserWallet
from neo.Prompt.PromptData import PromptData
from neo.Prompt.Commands.WalletAddress import SplitUnspentCoin, CreateA... | |
# 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... | |
"""
borrowed from jython
https://bitbucket.org/jython/jython/raw/28a66ba038620292520470a0bb4dc9bb8ac2e403/Lib/select.py
"""
import errno
import os
class error(Exception):
pass
ALL = None
_exception_map = {}
def _map_exception(exc, circumstance=ALL):
try:
mapped_exception = _exception_map[(exc.__cla... | |
"""
Module for support V_sim ascii fileformat
Contains routines to load .ascii files and
create pychemia Structure objects and to save
back to .ascii files
This code was originally created for ASE
"""
import re as _re
from pychemia.utils.constants import bohr_angstrom
from pychemia.core import Structure
def load(fi... | |
import boto
import datetime
import json
import logging
import os
import time
from boto.ec2.autoscale import AutoScaleConnection
from boto.ec2.autoscale import Tag # needed for Phantom
from boto.ec2.autoscale.group import AutoScalingGroup
from boto.ec2.autoscale.launchconfig import LaunchConfiguration
from boto.region... | |
import numpy as np
import scipy.sparse as sp
import pytest
from re import escape
from sklearn.utils._testing import assert_array_equal
from sklearn.utils._testing import assert_almost_equal
from sklearn.utils._testing import assert_raises
from sklearn.utils._testing import assert_warns
from sklearn.utils._testing imp... | |
# 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 (c) 2013 Huawei Technologies Co., Ltd.
# 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:... | |
##########################################################################
#
# Copyright (c) 2007-2013, Image Engine Design Inc. All rights reserved.
# Copyright (c) 2011, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... | |
# 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 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... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.... | |
# fileserverclient.py - client for communicating with the cache process
#
# Copyright 2013 Facebook, Inc.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
import io
import os
import threading... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import errno
import ... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.test import TestCase, override_settings
from django.db.migrations.autodetector import MigrationAutodetector
from django.db.migrations.questioner import MigrationQuestioner
from django.db.migrations.state import ProjectState, ModelState
from django.db.... | |
# -*- coding: utf-8 -*-
"""
Markov Decision Process solver.
"""
__author__ = "Julian Jara-Ettinger"
__license__ = "MIT"
import numpy as np
import math
import random
class MDP(object):
def __init__(self, S=[], A=[], T=[], R=[], gamma=0.95, tau=0.01):
"""
Markov Decision Process (MDP) class.
... | |
import os
import time
import umsgpack
import datetime
import threading
import btctxstore
import storjnode
from storjnode.util import safe_log_var
from storjnode.common import THREAD_SLEEP
from kademlia.network import Server as KademliaServer
from kademlia.storage import ForgetfulStorage
from kademlia.node import Node a... | |
# -*- coding: utf-8 -*-
"""
Django settings for distadmin project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
# Build paths inside the project like this: os.p... | |
from django.conf import settings
from django.http import JsonResponse
from rest_framework.viewsets import ViewSet
from rest_framework.parsers import JSONParser
from rest_framework.decorators import detail_route, parser_classes
from rest_api.tools import set_ikeys, split_cols
from rest_api.exceptions import (
Jasmi... | |
# -*- coding: utf-8 -*-
import mock
from django import test
from django import http
from django.conf import settings
from django.utils import timezone
from cradmin_legacy import cradmin_testhelpers
from model_bakery import baker
from devilry.devilry_account import models as account_models
from devilry.apps.core impo... | |
# Natural Language Toolkit: Clusterer Utilities
#
# Copyright (C) 2001-2013 NLTK Project
# Author: Trevor Cohn <tacohn@cs.mu.oz.au>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import print_function, unicode_literals
import copy
from sys import stdout
from math import sqrt
try:... | |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
from django.shortcuts import *
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.core.paginator import Paginator
from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_protect
from django.contrib.auth.models import User
f... | |
# Copyright 2014-2015 ARM Limited
#
# 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 w... | |
# ABC Parser for ABC Music Notation Files
from __future__ import division
import re
import string
import math
from Preprocess import globalConstant
class TuneBook(object):
"""
Represents a tunebook with tunes and free text.
Properties
----------
text
An array of free text blocks, as strings.
tune
An arra... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
import json
import random
from frappe.model.document import Document
from six import iteritems
cla... | |
import os
import matplotlib.pyplot as plt
def save(path, ext='png', close=True, verbose=True):
"""Save a figure from pyplot.
Parameters
----------
path : string
The path (and filename, without the extension) to save the
figure to.
ext : string (default='png')
The file extens... | |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
"""
"""
import mutex
#########################################################################
class SchedulerException(Exception):
pass
class CyclesDetectedException(SchedulerException):
pass
################... | |
import geopandas as gpd
import pandas
import numpy
import os
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
local_palattes = {
'radar': ['deep purple', 'deep green', 'green', 'green', 'yellow', 'orange',]
}
def color_palette_alpha(palatte='Reds', low_alpha=0.0, high_alpha=1.0):
if palatt... | |
from __future__ import print_function
from ctypes import py_object
class Array():
"""
ctypes array of fixed size
"""
def __init__(self, *args, **kwargs):
if 'size' in kwargs:
self.size = kwargs['size']
else:
self.size = len(args)
if len(args) > self.siz... | |
"""Automatically adapted for numpy Sep 19, 2005 by convertcode.py
"""
import functools
import warnings
__all__ = ['iscomplexobj', 'isrealobj', 'imag', 'iscomplex',
'isreal', 'nan_to_num', 'real', 'real_if_close',
'typename', 'asfarray', 'mintypecode',
'common_type']
import numpy.core... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | |
# -*- coding: utf-8 -*-
__author__ = "isparks"
import unittest
from rwslib.builders import *
from rwslib.tests.common import obj_to_doc
from datetime import datetime
class TestClinicalData(unittest.TestCase):
"""Test ClinicalData classes"""
def setUp(self):
self.tested = ClinicalData("STUDY1", "DE... | |
import pytest
from orderedset._orderedset import OrderedSet
from plenum.common.event_bus import InternalBus
from plenum.common.messages.node_messages import PrePrepare
from plenum.common.startable import Mode
from plenum.common.constants import POOL_LEDGER_ID, DOMAIN_LEDGER_ID, CURRENT_PROTOCOL_VERSION, AUDIT_LEDGER_I... | |
"""
make_base_installers.py --
Build the installers for one or more of the supported operating systems,
depending on options given. Runs on Linux systems only.
Usage: python make_base_installer.py m|l|w|i|a|t path/to/trunk/ pubkey
privkey output/dir/ [version of seattle]
[--wg path/to/Windows... | |
import warnings
import numpy
import six
from chainer import configuration
from chainer import functions
from chainer import initializer
from chainer import link
from chainer.links.caffe.protobuf3 import caffe_pb2 as caffe_pb
from chainer.links.connection import convolution_2d
from chainer.links.connection import deco... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013, Nachi Ueno, NTT I3, 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... | |
import datetime
import pytz
import json
from django.contrib.sessions.models import Session
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login, logout
from django.conf.urls import url
from django.core.exceptions import MultipleObjectsReturned
from django.core.management impo... | |
# Copyright (c) 2020-2021, Manfred Moitzi
# License: MIT License
"""
This module provides "nested Polygon" detection for multiple paths.
Terminology
-----------
exterior
creates a filled area, has counter-clockwise (ccw) winding in matplotlib
exterior := Path
hole
creates an unfilled area, has clockwis... | |
# -*- coding: utf-8 -*-
import os
import subprocess
import sys
import time
from contextlib import contextmanager
from subprocess import PIPE
from genestack.genestack_exceptions import GenestackException
from genestack.core_files.genestack_file import File
from genestack.environment import PROGRAMS_DIRECTORY
from gene... | |
#Bandwidth optimization methods
__author__ = "Taylor Oshan"
import numpy as np
from scipy import linalg
from copy import deepcopy
import copy
from collections import namedtuple
def golden_section(a, c, delta, function, tol, max_iter, int_score=False):
"""
Golden section search routine
Method: p212, 9.6.4... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from ansible.module_utils.basic import *
import copy
import os
from subprocess import Popen, PIPE, STDOUT
import time
DOCUMENTATION = """
---
module: sdc_pipeline
short_description: Performs common actions on a StreamSets pipeline
description:
- Performs common actions su... | |
"""GANDI Simple-Hosting Configuration for Let's Encrypt."""
# pylint: disable=too-many-lines
import logging
import os
import re
import xmlrpclib
import tempfile
import subprocess
import zope.interface
from acme import challenges
try:
from letsencrypt import errors
from letsencrypt import interfaces
from ... | |
# Copyright 2018 The TensorFlow Probability 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 o... | |
# office/controllers.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from .models import ContestOfficeListManager, ContestOfficeManager, CONTEST_OFFICE_UNIQUE_IDENTIFIERS, ContestOffice
from ballot.controllers import move_ballot_items_to_another_office
from ballot.models import OFFICE
from bookmark.mo... | |
# --- import --------------------------------------------------------------------------------------
import collections
import numpy as np
import WrightTools as wt
from ..mixed import propagate
# --- functions -----------------------------------------------------------------------------------
def do_work(arglist... | |
from django.db.transaction import non_atomic_requests
from django.utils.translation import (
ugettext, ugettext_lazy as _, pgettext_lazy)
import jingo
import jinja2
from olympia import amo
from olympia.amo.helpers import urlparams
from olympia.amo.urlresolvers import reverse
from olympia.amo.utils import render
... | |
#!/usr/bin/python2
'''
MIT License
Copyright (c) 2017 LIT
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, modify, merge... | |
# 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... | |
# ext/associationproxy.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Contain the ``AssociationProxy`` class.
The ``AssociationProxy`` is a Py... | |
"""Core views, including the main homepage, post-commit build hook,
documentation and header rendering, and server errors.
"""
from django.core.mail import mail_admins
from django.core.urlresolvers import reverse
from django.core.cache import cache
from django.conf import settings
from django.contrib.auth.models impor... | |
"""A Jupyter Notebook interface to Klampt.
Examples:
Basic usage::
from klampt import *
from klampt.vis.ipython import KlamptWidget
from IPython.display import display
world = WorldModel()
... #set up the world...
kvis = KlamptWidget(world,width=800,height=640)
... | |
# -*- coding: utf-8 -*-
'''
Create virtualenv environments
'''
# Import python libs
import glob
import shutil
import logging
import os
import os.path
# Import salt libs
import salt.utils
from salt.modules import state_std
import salt.exceptions
log = logging.getLogger(__name__)
__opts__ = {
'venv_bin': 'virtual... | |
"""Kraken - objects.operators.canvas_operator module.
Classes:
CanvasOperator - Canvas operator object.
"""
import pprint
from kraken.core.maths import MathObject, Mat44, Vec2, Vec3, Xfo
from kraken.core.objects.object_3d import Object3D
from kraken.core.objects.operators.operator import Operator
from kraken.core.o... | |
from twisted.trial.unittest import TestCase
from twisted.internet import defer, reactor
from mock import MagicMock
from alchimia import TWISTED_STRATEGY
from sqlalchemy import MetaData, Table, Column, Integer, String, DateTime
from sqlalchemy import create_engine, ForeignKey
from sqlalchemy.schema import CreateTable... | |
"""
Test the Command state
"""
import os
from sermin import File, AppendParser, IniParser
from sermin.utils import shell
from .utils import FullTestCase
class FileMixin(object):
# Path to use for file test
path = '/tmp/sermin_test'
path_src = '/tmp/sermin_test_src'
def clean(self):
"""
... | |
import json
from django.test import TestCase
from django.test import Client
from local_settings import userdata_storage_path
class FileManagerViewTests(TestCase):
"""
Tests for the Index app views
"""
fixtures = ['seed.json']
def test_get_data_set_list(self):
"""
Test '/file_manag... | |
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: zosutils.py
# Purpose: Utilities for pyzos
# Licence: MIT License
# This file is subject to the terms and conditions of the MIT License.
# For further details, please... | |
# This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
import errno
import grp
import logging
import os
import shutil
import signal
import stat
i... | |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
f... | |
# Copyright 2017 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... | |
#!/usr/bin/python
'''
The MIT License (MIT)
Copyright (c) 2016 Charles 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, c... | |
import operator
import unittest2
from pykafka import protocol
from pykafka.common import CompressionType
from pykafka.utils.compat import buffer
class TestMetadataAPI(unittest2.TestCase):
maxDiff = None
def test_request(self):
req = protocol.MetadataRequest()
msg = req.get_bytes()
se... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module defines the events signaled by abinit during the execution. It also
provides a parser to extract these events form the main output file and the log file.
"""
from __future__ import unicode_litera... | |
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.urls import reverse
from ..categories import category_value
from ..models import Rating
from ..templatetags.pinax_ratings_tags import (
overall_rating,
rating_count,
ratings,
user_rating,
user_ra... | |
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
# sqlalchemy/pool.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Connection pooling for DB-API connections.
Provides a number of connection poo... | |
"""Client interface for MongoDB."""
import itertools
import os
import shutil
import subprocess
import sys
import time
from collections import defaultdict
from copy import deepcopy
from pathlib import Path
from tempfile import TemporaryDirectory
from ruamel.yaml import YAML
#
# setup mongo
#
try:
import pymongo
... | |
from datetime import date
from unittest import mock
from django.contrib.auth import (
BACKEND_SESSION_KEY, SESSION_KEY, authenticate, get_user, signals,
)
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.hashers import MD5PasswordHasher
from django.contrib.auth.models import Anonymous... | |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | |
# ./darwinpush/xb/raw/tor.py
# -*- coding: utf-8 -*-
# PyXB bindings for NM:454478a728396cf19a8fffa7ba6764ae205b33f8
# Generated 2015-04-23 16:42:14.516405 by PyXB version 1.2.4 using Python 3.4.1.final.0
# Namespace http://www.thalesgroup.com/rtti/PushPort/TrainOrder/v1 [xmlns:tor]
from __future__ import unicode_lite... | |
"""A collection of integration tests for the ephemeral
container service.
"""
import base64
from ConfigParser import ConfigParser
import httplib
import os
import signal
import subprocess
import tempfile
import time
import unittest
import uuid
from nose.plugins.attrib import attr
from tor_async_util.nose_plugins import... | |
import gevent
import sys
from gevent.server import StreamServer
from JumpScale import j
import inspect
import time
import os
from PortalTCPChannels import ManholeSession, WorkerSession, TCPSessionLog
try:
import fcntl
except:
pass
raise RuntimeError("is not working now")
#THERE ARE SOME GOOD IDEAS IN HERE I... | |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | |
# 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... | |
# 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... | |
"""Common operations on Posix pathnames.
Instead of importing this module directly, import os and refer to
this module as os.path. The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Mac, Windows),
os.path provides the same operations in a manner specific to that
platform, and is a... | |
# Author: Vikram Melapudi aka makechaos (makechaos [at] gmail [dot] com)
# Updated: 07 Jan 2014
# Started: 25 Dec 2013
# Summary: Backend of python server to process the user input and link with the MongoDB database
import photoServer
import web
import StringIO
import string
from PIL import Image
from pymongo import M... | |
#!/usr/bin/env python
"""Channel notifications support.
Classes and functions to support channel subscriptions and notifications
on those channels.
Notes:
- This code is based on experimental APIs and is subject to change.
- Notification does not do deduplication of notification ids, that's up to
the receiver... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.