gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import xmlrpclib
import ooop
from datetime import timedelta
from sact.epoch import Time, TzLocal, UTC
from kids.cache import cache
OOOP_NAME_TAG_LIKE_EXPR = "{%s}%%"
LoginFailed = ooop.LoginFailed
## XXXvlab: should propose a modification to OOOP code to get this
## function accessible outside from an instanced ... | |
# -*- coding: utf-8 -*-
#
# SelfTest/Signature/test_pkcs1_pss.py: Self-test for PKCS#1 PSS signatures
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyon... | |
# -*- 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... | |
#!/usr/bin/python
# get data from net
import urllib.request
# parse data
import re
# hash texts to check if it's new or already parsed
import hashlib
# logging
import logging
import sys
# file system: write .txt files to folder
import os.path
# command line
import argparse
import webbrowser
# logging
LOG = logg... | |
"""Strategies for reading from & writing to config files."""
import logging
import os
from abc import ABCMeta, abstractmethod
from configparser import NoSectionError, RawConfigParser
from jsun import Decoder, DecodeError, Encoder
from .exc import SettingsFileNotFoundError, SettingsFileSectionNotFoundError
from .util ... | |
#!/usr/bin/python
import os
import glob
import time
from datetime import datetime
import datetime
import traceback
import decimal
from models import Probe, PowerSwitchTail2, Heater
class Pump(PowerSwitchTail2):
pass
class Heating(object):
def __init__(self, heaters=[]):
assert isinstance(heaters, l... | |
import itertools
import traceback
from eventlet import event
from eventlet import greenthread
from eventlet import queue
from eventlet import semaphore
from eventlet.support import greenlets as greenlet
__all__ = ['GreenPool', 'GreenPile']
DEBUG = True
class GreenPool(object):
"""The GreenPool class is a pool o... | |
##########################################################################
#
# Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios),
# its affiliates and/or its licensors.
#
# Copyright (c) 2010-2015, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary ... | |
import numbers
import numpy as np
import torch
import torch.autograd
import _ext
import _extc
import error_checking as ec
from kernels import KERNELS, KERNEL_NAMES
MAX_FLOAT = float(np.finfo(np.float32).max)
class ImageProjection(torch.nn.Module):
"""
"""
def __init__(self, camera_fl):
""" I... | |
import sys, os, time, logging, shlex, signal, subprocess, errno
import pyev
from ..config import config, get_boolean, get_env
from ..utils import parse_signals, expandvars, enable_nonblocking, disable_nonblocking, get_python_exec, get_signal_name
from ..cnscom import program_state_enum, svrcall_error
from .logmed impor... | |
#!/hint/python3
import io
import os
import re
import shutil
import string
import subprocess
import sys
from contextlib import contextmanager
from traceback import print_exc
from typing import Callable, Generator, List, Optional, TextIO, Tuple
from . import ansiterm
# run()/run_bincapture()/run_txtcapture() and captu... | |
from stomp.connect import StompConnection12
from stomp.exception import ConnectFailedException
import pyxb.utils.domutils as domutils
import darwinpush.xb.pushport as pp
from darwinpush.parser import Parser
from darwinpush import ftp, Source
import enum
import multiprocessing
import sys
import threading
import time... | |
# -*- coding: utf-8 -*-
"""
Download API.
"""
# Standard library imports
from collections import deque
import json
import os
import sys
# Third part imports
from qtpy.QtCore import QByteArray, QObject, QTimer, QThread, QUrl, Signal
from qtpy.QtNetwork import QNetworkAccessManager, QNetworkRequest
import requests
# ... | |
# coding=utf-8
"""
Copyright 2013 LinkedIn Corp. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable l... | |
"""a navigable completer for the qtconsole"""
# coding : utf-8
#-----------------------------------------------------------------------------
# Copyright (c) 2012, IPython Development Team.$
#
# Distributed under the terms of the Modified BSD License.$
#
# The full license is in the file COPYING.txt, distributed with t... | |
from __future__ import generators
"""
httplib2
A caching http interface that supports ETags and gzip
to conserve bandwidth.
Requires Python 2.3 or later
Changelog:
2007-08-18, Rick: Modified so it's able to use a socks proxy if needed.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyrigh... | |
# formhandler/formhandler.py
# Lillian Lemmer <lillian.lynn.lemmer@gmail.com>
#
# This module is part of FormHandler and is released under the
# MIT license: http://opensource.org/licenses/MIT
"""formhandler: sometimes the web interface is an afterthought.
Automate the development of a web/CGI script interface to a f... | |
# urllib3/response.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import logging
import zlib
from .exceptions import DecodeError
from .packages.six import str... | |
from __future__ import unicode_literals
import datetime
from django.contrib import admin
from django.contrib.admin.models import LogEntry
from django.contrib.admin.options import IncorrectLookupParameters
from django.contrib.admin.templatetags.admin_list import pagination
from django.contrib.admin.tests import AdminS... | |
# postgresql/array.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
from .base import ischema_names
from ...sql import expression, operators
from ..... | |
# 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... | |
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from ... | |
# coding: utf-8
#
# 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 requi... | |
import os
import sys
import re
import math
import shutil
import base64
import wx
import sqlite3
import logging, logging.handlers
from wx.lib.mixins.listctrl import ColumnSorterMixin
import wx.lib.delayedresult as DR
from ABEsafe_gen import ABEsafe_generator as GEN
TITLE_COLOR = wx.Colour(19, 57, 204)
LABEL_COLOR = w... | |
# Copyright 2019 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 agreed to in writing, ... | |
#!/usr/bin/env python
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Global system tests for V8 test runners and fuzzers.
This hooks up the framework under tools/testrunner testing high-level scena... | |
# -*- coding: utf-8 -*-
########################################################################
#
# License: BSD
# Created: 2009-11-24
# Author: Francesc Alted - faltet@pytables.org
#
# $Id$
#
########################################################################
"""Test module for diferent kind of links under PyT... | |
# Copyright 2019 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.
"""Sends notifications after automatic exports.
Automatically comments on a Gerrit CL when its corresponding PR fails the Taskcluster check. In
other words, ... | |
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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/env python
#########################################################################################
#
# Parser for PropSeg binary.
#
# ---------------------------------------------------------------------------------------
# Copyright (c) 2015 Polytechnique Montreal <www.neuro.polymtl.ca>
# Authors: Benjami... | |
#!/usr/bin/env python
#
# Field class implementation
import struct
import array
import sys
from pif_ir.meta_ir.common import *
from pif_ir.air.utils.air_exception import *
def field_width_get(field_name, attrs, field_values, remaining_bits=None):
"""
@brief Get the width of a field based on current values
... | |
"""
-----------------------------------------------------------------------------
Copyright (c) 2009-2017, Shotgun Software Inc
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 ret... | |
# -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | |
"""
Unit tests for django-invitation.
These tests assume that you've completed all the prerequisites for
getting django-invitation running in the default setup, to wit:
1. You have ``invitation`` in your ``INSTALLED_APPS`` setting.
2. You have created all of the templates mentioned in this
application's documenta... | |
# Copyright 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 requ... | |
from pandac.PandaModules import *
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from direct.fsm import StateData
from toontown.toon import ToonAvatarPanel
from toontown.friends import ToontownFriendSecret
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
from... | |
"""Interpolation algorithms using piecewise cubic polynomials."""
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy._lib.six import string_types
from . import BPoly, PPoly
from .polyint import _isscalar
from scipy._lib._util import _asarray_validated
from scipy.linalg im... | |
import synapse.common as s_common
import synapse.lib.time as s_time
import synapse.lib.types as s_types
import synapse.lib.module as s_module
import synapse.lib.grammar as s_grammar
class EconModule(s_module.CoreModule):
def getModelDefs(self):
return (('econ', {
'types': (
... | |
"""
This code includes simple dense layer.
Dense layer is also well known as fully-connected alyer.
"""
import numpy as np
import theano
import theano.tensor as T
from collections import OrderedDict
from lemontree.layers.layer import BaseLayer
class DenseLayer(BaseLayer):
"""
This class implements dense laye... | |
import datetime
import pytz
from django import http
from django.shortcuts import get_object_or_404, redirect, render
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.views.decorators.http import require_POST
from djan... | |
import json
from ct.models import *
from django.contrib.auth.models import User
from django.utils import dateparse, timezone
from datetime import datetime
import codecs
def store_errors(q, concept, parentUL, conceptIDdict=None):
'store error models associated with question'
errorModels = []
courseletsMap ... | |
# Copyright 2012 Grid Dynamics
# 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... | |
# Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | |
# Copyright 2015 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.
"""Defines the task controller library."""
import argparse
import datetime
import logging
import os
import socket
import subprocess
import sys
import tempfi... | |
# -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2015 PyBuilder Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/l... | |
# 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... | |
# -*- 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 'SupplyReservationLine.supply'
db.add_column(u'logistics_s... | |
# 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.
"""Thread and ThreadGroup that reraise exceptions on the main thread."""
# pylint: disable=W0212
import logging
import sys
import threading
import time
impo... | |
"""
This module provides solvers for system-bath evoluation using the
HEOM (hierarchy equations of motion).
See https://en.wikipedia.org/wiki/Hierarchical_equations_of_motion for a very
basic introduction to the technique.
The implementation is derived from the BoFiN library (see
https://github.com/tehruhn/bofin) whi... | |
import itertools
from typing import Optional, Text, List, Dict, Tuple, Any
import numpy as np
import pytest
import scipy.sparse
from rasa.shared.nlu.training_data.features import Features
from rasa.shared.nlu.constants import (
FEATURE_TYPE_SENTENCE,
FEATURE_TYPE_SEQUENCE,
TEXT,
INTENT,
)
@pytest.ma... | |
#!/usr/bin/python
import os, sys, time
from collections import defaultdict
from optparse import OptionParser
from trigrams import Trigram, debug, text_to_trigrams, MODES, open_maybe_gzip
from trigrams import TRIGRAM_OFFSET_FACTOR, ANTI_TRIGRAM_OFFSET_FACTOR
def find_git_root():
p = Popen(["git", "rev-parse", "--s... | |
#a simple web server to replace the buggy one in python's standard library
import os, os.path, sys, time, socket, traceback, stat
from math import *
INDEXFILE = "/bluenoise6.html"
PORT = 8080
mimetypes = {
".js" : "application/x-javascript",
".html" : "text/html",
".json" : "application/x-javascript",
".gl... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
import cStringIO
import json
import sys
import time
from logging import StreamHandler, Formatter
import gevent
import IPython
from devp2p.service import BaseService
from ethereum.slogging import getLogger
from ethereum._solidity import compile_file
from et... | |
import sys, os, unittest
import numpy as np
import numpy.testing as nptest
import fcdiff
class UnsharedRegionModelTest(unittest.TestCase):
def test_str(self):
""" Tests informal string representation.
"""
model = fcdiff.UnsharedRegionModel()
model_str = model.__str__()
asse... | |
# Copyright (c) 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 writ... | |
import os
import sys
import tempfile
from dodo_commands import CommandError, Dodo
from dodo_commands.framework.global_config import load_global_config_parser
from dodo_commands.framework.paths import Paths
from dodo_commands.framework.util import bordered, is_using_system_dodo, symlink
def _args():
parser = Dodo... | |
from datetime import datetime
from pandas import DatetimeIndex, Series
import numpy as np
import dateutil.tz
import pytz
import pytest
import pandas.util.testing as tm
import pandas as pd
def test_to_native_types():
index = DatetimeIndex(freq='1D', periods=3, start='2017-01-01')
# First, with no arguments.... | |
# -*- coding:utf-8 -*-
# Copyright 2015 NEC Corporation. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License... | |
# -*- coding: utf-8 -*-
from collections import defaultdict
from django.template import Template
from cms import api
from cms.models import Placeholder
from cms.test_utils.project.placeholderapp.models import Example1
from cms.test_utils.testcases import TransactionCMSTestCase
from cms.toolbar.toolbar import CMSToolb... | |
from django.contrib import admin, messages
from django.core import urlresolvers
from django.contrib.admin.utils import flatten_fieldsets
from django.http import HttpResponse
from django.conf.urls import url
from django.shortcuts import redirect, get_object_or_404
from django.db import transaction
from django.contrib.au... | |
import time
import threading
import collections
import synapse.lib.sched as s_sched
from synapse.eventbus import EventBus
miss = ()
class Cache(EventBus):
'''
A callback driven cache with options for timeout / maxsize.
Example:
cache = Cache(maxtime=60)
cache.put(iden,thing)
# ... | |
import json
import pytest
import responses
from twitch.client import TwitchClient
from twitch.constants import BASE_URL
from twitch.exceptions import TwitchAttributeException
from twitch.resources import Channel, Follow, Subscription, User, UserBlock
example_user = {
"_id": "44322889",
"name": "dallas",
}
e... | |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | |
#!/usr/bin/env python3
"""
$ ./tools/js-dep-visualizer.py
$ dot -Tpng var/zulip-deps.dot -o var/zulip-deps.png
"""
from __future__ import absolute_import
from __future__ import print_function
import os
import re
import subprocess
import sys
from collections import defaultdict
from typing import Any, DefaultDict, Dic... | |
# -*- coding: utf-8 -*-
""" QuerySet for PolymorphicModel
Please see README.rst or DOCS.rst or http://chrisglass.github.com/django_polymorphic/
"""
from __future__ import absolute_import
from collections import defaultdict
import django
from django.db.models.query import QuerySet
from django.contrib.contenttypes.... | |
'''
Created on Mar 21, 2017
@author: matija
FUNCTIONS FOR COMPUTING SIMILARITY BETWEEN TWO DATASETS BASED ON IT'S KEYS
HERE WE USED PERSON AS KEY AND THEIRS VALUES ARE RATINGS FOR THE MOVIES
WE COMPUTED A SIMILARITIES IN THIS MODULE BASED ON TWO FUNCTIONS
1.EUCLIDEAN DISTANCE
2.PEARSON
FROM MY EXPERIANCE RUNNING T... | |
# orm/properties.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
"""MapperProperty implementations.
This is a private module which defines the beh... | |
from __future__ import division, print_function, absolute_import
from numpy import (logical_and, asarray, pi, zeros_like,
piecewise, array, arctan2, tan, zeros, arange, floor)
from numpy.core.umath import (sqrt, exp, greater, less, cos, add, sin,
less_equal, greater_equ... | |
"""Tests for the EntityPlatform helper."""
import asyncio
from datetime import timedelta
import logging
from unittest.mock import Mock, patch
import pytest
from homeassistant.const import EVENT_HOMEASSISTANT_STARTED, PERCENTAGE
from homeassistant.core import CoreState, callback
from homeassistant.exceptions import Ho... | |
# -*- coding: utf-8 -*-
from operator import attrgetter
from django.core.exceptions import ImproperlyConfigured
from django.conf.urls import url, include
from django.contrib.formtools.wizard.views import normalize_name
from django.db.models import signals
from django.template.defaultfilters import slugify
from django.... | |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
The rapidart module provides routines for artifact detection and region of
interest analysis.
These functions include:
* ArtifactDetect: performs artifact detection on functional images
* Stimulu... | |
from collections import deque, OrderedDict
import datetime
import logging
import re
from six import string_types, iteritems, binary_type, text_type, b
logger = logging.getLogger(__name__)
class NoMatchError(Exception):
pass
class unknown(binary_type):
__name__ = 'unknown'
def __new__(cls):
r... | |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2015 BigML
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | |
from sympy.core import Basic, S, C
from sympy.core.function import Function, Derivative, ArgumentIndexError
from sympy.functions.elementary.miscellaneous import sqrt
from sympy.functions.elementary.piecewise import Piecewise
from sympy.core import Add, Mul
from sympy.core.relational import Eq, Ne
from sympy.utilities.i... | |
# 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... | |
# This is a copy of the Python logging.config.dictconfig module,
# reproduced with permission. It is provided here for backwards
# compatibility for Python versions prior to 2.7.
#
# Copyright 2009-2010 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# docu... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Grid Dynamics
# 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/l... | |
import threading
from OSC import *
from pymt import *
def binary(n, digits=8):
'''
Based on: http://www.daniweb.com/code/snippet216539.html
'''
data = '{0:0>{1}}'.format(bin(n)[2:], digits)
return [int(x) for x in data]
class MTMonome(MTButtonMatrix):
'''
An pymt implementation of monome, ... | |
# encoding=utf8
import datetime
from distutils.version import StrictVersion
import hashlib
import os.path
import random
from seesaw.config import realize, NumberConfigValue
from seesaw.item import ItemInterpolation, ItemValue
from seesaw.task import SimpleTask, LimitConcurrent
from seesaw.tracker import GetItemFromTrac... | |
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from qtpy import QtGui
from qtconsole.qstringhelpers import qstring_length
from ipython_genutils.py3compat import PY3, string_types
from pygments.formatters.html import HtmlFormatter
from pygments.lexer import RegexLe... | |
"""A web front end for the Lytspel converter."""
from collections import OrderedDict
from glob import glob
import os
from os import path
import logging
import re
import string
from time import time
from typing import Match, NamedTuple, Optional, Sequence, Tuple
# The following import is for mypy only
from typing impo... | |
"""Monkeypatching and mocking functionality."""
import os
import re
import sys
import warnings
from contextlib import contextmanager
from typing import Any
from typing import Generator
from typing import List
from typing import MutableMapping
from typing import Optional
from typing import overload
from typing import Tu... | |
#
# Module for starting a process object using os.fork() or CreateProcess()
#
# multiprocessing/forking.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
from __future__ import absolute_import
import os
import sys
import signal
import warnings
from pickle import load, HIGHE... | |
from bz2 import BZ2File
import gzip
from io import BytesIO
import numpy as np
import os
import shutil
from tempfile import NamedTemporaryFile
from sklearn.externals.six import b
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert... | |
"""
Management of addresses and names in hosts file
===============================================
The ``/etc/hosts`` file can be managed to contain definitions for specific hosts:
.. code-block:: yaml
salt-master:
host.present:
- ip: 192.168.0.42
Or using the ``names`` directive, you can put sev... | |
from models import Collection, Field, Deck, Decks_Cards, Card, Cards_Fields, Users_Collections
from django.forms.extras.widgets import SelectDateWidget
from . import services
from django import forms
from django.forms.utils import ErrorList
from django.db import transaction
import logging
import datetime
import json
im... | |
"""
The MIT License (MIT)
Copyright (c) 2016 Ilhan Polat
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, ... | |
# -*- coding: utf-8 -*-
#
# This source file is part of the FabSim software toolkit, which is distributed under the BSD 3-Clause license.
# Please refer to LICENSE for detailed information regarding the licensing.
#
# This file contains FabSim definitions specific to FabBioMD.
from ..fab import *
# Add local script... | |
#!/usr/bin/python
# Copyright 2016 Google Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | |
# Copyright (C) 2012 - 2014 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... | |
""" Test suite for the code in fixer_util """
# Testing imports
from . import support
# Local imports
from lib2to3.pytree import Node, Leaf
from lib2to3 import fixer_util
from lib2to3.fixer_util import Attr, Name, Call, Comma
from lib2to3.pgen2 import token
def parse(code, strip_levels=0):
# The topmost node is ... | |
#!/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.
""" Generator for C-Sharp style binding definitions """
import glob
import os
import sys
import string
from idl_log import ErrOut... | |
#!/usr/bin/env python
#
# Copyright 2008 Google 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 a... | |
import pygame
from pygame.locals import *
import threading
import os
from constants import *
MOUSEDOWN = False
BACKDOWN = False
KEYDOWN = False
SPACEDOWN = False
GUIQUIT = False
hover = False
ENABLED_TEXT_COLOR = (235,235,235)
DISABLED_TEXT_COLOR = (200,200,200)
class guiButton(pygame.Surface):
def __init__(self... | |
# -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
import numpy as np
from numpy.testing import assert_array_equal, assert_allclose
from vispy.color import (Color, ColorArray, get_color_names,
... | |
#
# Copyright 2014 Facebook
#
# 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, s... | |
from ..rfb_utils.rfb_node_desc_utils.rfb_node_desc import RfbNodeDesc
from ..rfb_utils import filepath_utils
from ..rfb_utils.filepath import FilePath
from ..rfb_utils import generate_property_utils
from ..rfb_utils.property_callbacks import *
from ..rfb_utils.rman_socket_utils import node_add_inputs
from ..rfb_utils.r... | |
"""SCons.Tool.GettextCommon module
Used by several tools of `gettext` toolset.
"""
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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 withou... | |
# Copyright (c) 2017 Yingxin Cheng
#
# 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... | |
import random
from raiden.constants import EMPTY_SECRET, MAXIMUM_PENDING_TRANSFERS
from raiden.settings import DEFAULT_WAIT_BEFORE_LOCK_REMOVAL
from raiden.transfer import channel
from raiden.transfer.architecture import Event, TransitionResult
from raiden.transfer.events import EventPaymentSentFailed, EventPaymentSen... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.