gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
"""
Player
The player class is an extension of the default Django user class,
and is customized for the needs of Evennia.
We use the Player to store a more mud-friendly style of permission
system as well as to allow the admin more flexibility by storing
attributes on the Player. Within the game we should normally us... | |
from __future__ import unicode_literals
import os
import warnings
from unittest import skipUnless
from django.apps import AppConfig, apps
from django.apps.registry import Apps
from django.contrib.admin.models import LogEntry
from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured
from django.db i... | |
"""Defines the interface for executing a job"""
from __future__ import unicode_literals
import logging
import re
from jsonschema import validate
from jsonschema.exceptions import ValidationError
from job.configuration.interface import job_interface_1_1 as previous_interface
from job.configuration.interface.exception... | |
import urwid
import blinker
import textwrap
import pprint
from typing import Optional, Sequence
from mitmproxy import exceptions
from mitmproxy import optmanager
from mitmproxy.tools.console import layoutwidget
from mitmproxy.tools.console import signals
from mitmproxy.tools.console import overlay
HELP_HEIGHT = 5
d... | |
# 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 ... | |
# -*- 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 python
#
# Copyright 2015 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 o... | |
# 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... | |
# 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 json
import os.path
import re
from django.conf import settings
from django.utils.translation import ugettext_noop
from casexml.apps.case.models import CommCareCase
from corehq.apps.reports.api import ReportDataSource
from corehq.apps.reports.datatables import DataTablesHeader, DataTablesColumn
from corehq.apps.r... | |
# coding: utf-8
"""
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
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
... | |
"""Tests for ZHA config flow."""
import os
from unittest.mock import AsyncMock, MagicMock, patch, sentinel
import pytest
import serial.tools.list_ports
import zigpy.config
from homeassistant import setup
from homeassistant.components.zha import config_flow
from homeassistant.components.zha.core.const import CONF_RAD... | |
#!/usr/bin/env python
# coding: utf-8
__author__ = 'toly'
"""
script for make per-page dictionaries according to user personal list of known words
"""
import re
import os
import sys
import argparse
from string import lower
import nltk
from nltk.stem.wordnet import WordNetLemmatizer
from nltk.stem.snowball import... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
"""
<Program Name>
wizard.py
<Author>
Lukas Puehringer <lukas.puehringer@nyu.edu>
<Started>
April 06, 2017
<Copyright>
See LICENSE for licensing information.
<Purpose>
Flask web app that provides a wizard to guide through an in-toto
software supply chain lay... | |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
import contextlib
import hashlib
from recipe_engine import recipe_api
PATCH_STORAGE_RIETVELD = 'rietveld'
PATCH_STORAGE_GIT = 'git'
PAT... | |
# 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... | |
from flask import render_template, redirect, request, url_for, flash
from flask.ext.login import (
login_required,
login_user,
logout_user,
current_user
)
from . import account
from ..decorators import merchant_or_vendor_required
from .. import db
from ..email import send_email
from ..models import User... | |
#!/usr/bin/env python
"""
@package mi.dataset.parser.test.test_zplsc_c
@file mi-dataset/mi/dataset/parser/test/test_zplsc_c.py
@author Rene Gelinas
@brief Test code for a zplsc_c data parser
"""
import os
from nose.plugins.attrib import attr
from mi.core.log import get_logger
from mi.dataset.dataset_parser import D... | |
import itertools
import time
import eventlet
import pytest
from mock import Mock, call
from nameko.events import event_handler
from nameko.exceptions import ExtensionNotFound, MethodNotFound
from nameko.extensions import DependencyProvider
from nameko.rpc import RpcProxy, rpc
from nameko.standalone.events import event... | |
# 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... | |
import functools
import hashlib
from flask import jsonify, request, url_for, current_app, make_response, g
from .rate_limit import RateLimit
from .errors import too_many_requests, precondition_failed, not_modified, ValidationError, admin_right, hub_not_active
from .models import User, Hub, Properties
from .common impor... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Nicira Networks, Inc
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apach... | |
#
# Copyright 2013 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... | |
# 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) 2013 Juniper Networks, Inc. All rights reserved.
#
import re
import sys
ExternalEncoding = sys.getdefaultencoding()
Tag_pattern_ = re.compile(r'({.*})?(.*)')
def showIndent(outfile, level, pretty_print=False):
for i in range(level - 1):
outfile.write(" ")
def quote_xml(inStr):
... | |
import unittest
import pexif
import StringIO
import difflib
test_data = [
("test/data/rose.jpg", "test/data/rose.txt"),
("test/data/conker.jpg", "test/data/conker.txt"),
("test/data/noexif.jpg", "test/data/noexif.txt"),
]
DEFAULT_TESTFILE = test_data[0][0]
NONEXIST_TESTFILE = "test/data/noexif.jpg"
c... | |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify 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 law... | |
# Copyright 2017-2021 TensorHub, 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... | |
#!/usr/bin/env python
""" loggerator.py contains the loggerator utility to be used for logging debug,
warning, errors and other information from applications.
:author: Jose Carlos Recuero
:version: 0.1
:since: 08/13/2014
"""
__docformat__ = 'restructuredtext en'
# ----------------------------------------... | |
# ==================================================================================================
# Copyright 2014 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | |
#!/usr/bin/env python
import atexit
import glob
import os
import re
import shutil
import sys
import tempfile
import textwrap
from fabric.api import env, local, hide
from fabric.context_managers import lcd, settings, shell_env
from fabric.contrib.console import confirm
from fabric.contrib.files import exists
from fabr... | |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from mpi4py import MPI
from copy import copy
import random
import sys
import os
import os.path
import shutil
import time
from collections import deque
from pprint import pprint
import itertools
"""
Reduce Not... | |
""" Utilities for interacting with a DC/OS instance via REST API
Most DC/OS deployments will have auth enabled, so this module includes
DcosUser and DcosAuth to be attached to a DcosApiSession. Additionally,
it is sometimes necessary to query specific nodes within a DC/OS cluster,
so there is ARNodeApiClientMixin to a... | |
# -*- coding: utf-8 -*-
'''
SECCorrespondenceLoader is a plug-in to both GUI menu and command line/web service
that loads a Correspondence tar.gz file.
(c) Copyright 2014 Mark V Systems Limited, All rights reserved.
'''
import datetime, re, os, time
from arelle import FileSource, ModelDocument
from arelle.ModelRssObj... | |
"""Test the Network Configuration."""
from unittest.mock import MagicMock, Mock, patch
import ifaddr
from homeassistant.components import network
from homeassistant.components.network.const import (
ATTR_ADAPTERS,
ATTR_CONFIGURED_ADAPTERS,
MDNS_TARGET_IP,
STORAGE_KEY,
STORAGE_VERSION,
)
from homea... | |
from __future__ import absolute_import, print_function, division
import os.path
import urwid
import netlib.http.url
from mitmproxy.console import common
from mitmproxy.console import pathedit
from mitmproxy.console import signals
from netlib import human
class ActionBar(urwid.WidgetWrap):
def __init__(self):
... | |
# Copyright 2020 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... | |
"""
General Description
-------------------
These filters compute the local histogram at each pixel, using a sliding window
similar to the method described in [1]_. A histogram is built using a moving
window in order to limit redundant computation. The moving window follows a
snake-like path:
...--------------------... | |
from flask import render_template, flash, redirect, session, url_for, request, g
from flask_login import login_user, logout_user, current_user, login_required
from app import app, db, lm, oid
from .forms import LoginForm, EditForm, PostForm
from .models import User, Post
from datetime import datetime
from config import... | |
"""Testing TcEx Input module field types."""
# standard library
from typing import TYPE_CHECKING, List, Optional, Union
# third-party
import pytest
from pydantic import BaseModel, validator
# first-party
from tcex.input.field_types import (
GroupEntity,
IndicatorEntity,
TCEntity,
always_array,
ind... | |
import os
import re
from datetime import datetime
import configuration
import shell
import shouter
class Initializer:
def __init__(self):
config = configuration.get()
self.repoName = config.gitRepoName
self.clonedRepoName = config.clonedGitRepoName
self.author = config.user
@... | |
import datetime
import unittest2
import webtest
import json
import md5
import api_main
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from consts.auth_type import AuthType
from consts.event_type import EventType
from models.account import Account
from models.api_auth_access import ApiA... | |
"""
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, merg... | |
# Copyright (c) 2014 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 ... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides the tools used to internally run the astropy test suite
from the installed astropy. It makes use of the `pytest` testing framework.
"""
import os
import sys
import types
import pickle
import warnings
import functools
from distutil... | |
#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Base class for RPC testing."""
import configparser
from enum import Enum
import logging
import argpars... | |
import plac
import mordecai
import random
import jsonlines
from tqdm import tqdm
import re
import numpy as np
import editdistance
import pandas as pd
import os
import json
import pickle
import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
from keras.optimizers import SGD... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 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
"""Flask-SQLAlchemy-Cache
A SQLAlchemy CachingQuery implementation for Flask, using Flask-Cache.
It is based in SQLAlchemy docs example:
http://docs.sqlalchemy.org/en/latest/orm/examples.html#module-examples.dogpile_caching
"""
from hashlib import md5
from sqlalchemy.orm.interfaces import MapperOptio... | |
# 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... | |
#!/usr/bin/env python
from compliance_checker.suite import CheckSuite
from compliance_checker.cf import CFBaseCheck, BaseCheck, dimless_vertical_coordinates
from compliance_checker.cf.util import is_vertical_coordinate, is_time_variable, units_convertible, units_temporal
from compliance_checker.base import DSPair
from... | |
from random import randrange
import string
import math
import logging
class CaesarCipher(object):
def __init__(self, message=None, encode=False, decode=False, offset=False,
crack=None, verbose=None, alphabet=None):
"""
A class that encodes, decodes and cracks strings using the Cae... | |
# Copyright 2016-2017 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | |
#!/usr/bin/env python
# Copyright 2017 The PDFium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Compares the performance of two versions of the pdfium code."""
import argparse
import functools
import glob
import json
import multip... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import math
import numpy as np
from collections import defaultdict
import ray
from ray.rllib.evaluation.metrics import LEARNER_STATS_KEY
from ray.rllib.policy.tf_policy import TFPolicy
from ray.... | |
# Copyright (c) 2014 Hitachi Data Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | |
# -*- coding:utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import pymongo
import json
import time
import os
import gettext
import re
# put your localpath here
localpath = 'var/www/antchain.org/web/'
zh_trans = gettext.translation('lang', localpath+'locale', languages=['zh_CN'])
en_trans = gettext.t... | |
# This file is part of Tryton & Nereid. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import re
import os
import sys
import time
import unittest
import ConfigParser
from setuptools import setup, Command
class SQLiteTest(Command):
"""
Run the te... | |
# Copyright 2017, OpenCensus 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 w... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This script can move pages.
These command line parameters can be used to specify which pages to work on:
¶ms;
Furthermore, the following command line parameters are supported:
-from and -to The page to move from and the page to move to.
-noredirect Leave ... | |
import tensorflow as tf
import numpy as np
from tensorflow.python.ops.rnn_cell import LSTMStateTuple
from memory import Memory
import utility
import os
class DNC:
def __init__(self, controller_class, input_size, output_size, max_sequence_length=100,
memory_words_num = 256, memory_word_size = 64, ... | |
"""ThreatConnect TI Adversary """
# standard library
from urllib.parse import quote_plus
from .mappings import Mappings
class Task(Mappings):
"""Unique API calls for Tasks API Endpoints"""
def __init__(self, tcex, **kwargs):
"""Initialize Class Properties.
Valid status:
+ Not Starte... | |
from toee import *
from utilities import *
from Co8 import *
## Writen By Cerulean the Blue
# Modified by Sitra Achara 04-2011
# Miniature Chest internal flags:
# obj_f_item_pad_i_2 - miniature chest ID
# obj_f_item_pad_i_3 - indicates whether the chest can be summoned ("chest is in the Ethereal Plane (1) or in the ... | |
"""Test Google Smart Home."""
from unittest.mock import Mock, patch
import pytest
from homeassistant.components import camera
from homeassistant.components.climate.const import (
ATTR_MAX_TEMP,
ATTR_MIN_TEMP,
HVAC_MODE_HEAT,
)
from homeassistant.components.demo.binary_sensor import DemoBinarySensor
from h... | |
# Copyright 2020 The AutoKeras 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 i... | |
# 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... | |
import os
import re
import sys
import textwrap
import pytest
from _pytest.monkeypatch import MonkeyPatch
@pytest.fixture
def mp():
cwd = os.getcwd()
sys_path = list(sys.path)
yield MonkeyPatch()
sys.path[:] = sys_path
os.chdir(cwd)
def test_setattr():
class A:
x = 1
monkeypatch... | |
import asyncio
import os
import copy
import shutil
import tempfile
from unittest import mock
from decorator import decorator
import pytest
from tornado import testing
from tornado.platform.asyncio import AsyncIOMainLoop
from waterbutler.core import metadata
from waterbutler.core import provider
from waterbutler.serv... | |
# Copyright (c) 2010 Cloud.com, Inc
# Copyright 2012 Cloudbase Solutions Srl / Pedro Navarro Perez
# 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
#
# ... | |
#!/usr/bin/python
import boto.ec2
import collections
import itertools
import sys
from hotcidr import fetch
from hotcidr import util
class Action(object):
def __call__(self, conn):
try:
self.run(conn)
except:
print("Unexpected exception raised. Aborting.")
raise
... | |
###############################################################################
##
## 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 source and binary for... | |
import sys
from rpython.rlib.debug import check_nonneg
from rpython.rlib.unroll import unrolling_iterable
from rpython.rlib.rsre import rsre_char
from rpython.tool.sourcetools import func_with_new_name
from rpython.rlib.objectmodel import we_are_translated, not_rpython
from rpython.rlib import jit
from rpython.rlib.rsr... | |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
from page_sets import key_mobile_sites_pages
def _Iss... | |
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use... | |
''' IMPORTS '''
from CommonServerPython import *
import urllib3
from pyotrs import Article, Attachment, Client, DynamicField, Ticket
from urllib.parse import unquote
# disable insecure warnings
urllib3.disable_warnings()
''' GLOBAL VARS '''
SERVER = demisto.params()['server'][:-1] if demisto.params()['server'].end... | |
from typing import Dict, Any, Optional # noqa: F401
from vint.ast.plugin.scope_plugin.scope import (
ScopeVisibility,
ExplicityOfScopeVisibility,
Scope,
)
from vint.ast.node_type import NodeType
from vint.ast.dictionary.builtins import (
BuiltinVariablesCanHaveImplicitScope,
BuiltinFunctions,
)
fro... | |
import re
import sys
import types
import appvalidator.unicodehelper as unicodehelper
from . import csstester
from appvalidator.contextgenerator import ContextGenerator
from appvalidator.constants import *
from appvalidator.csp import warn as message_csp
from appvalidator.python.HTMLParser import HTMLParser, HTMLParseE... | |
# Copyright 2016 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
#!/bin/env python3
# Backtracking based solver for Crazy Machines 3 laser puzzles (e.g.campaign 67 (Laser beams and pyramid))
# Solves 67 in 2.5 minutes on an i7-2640m / 1.2 min on an i7-6700
from math import sqrt, pow
class Thingy2D():
def __init__(self, x=0, y=0):
self.x = int(x)
self.y = int(y)
def clone... | |
import config
import random
import csv
import radar
import math
from datetime import timedelta
from models import Location, Individual, Admission
def random_date(start, stop):
return radar.random_date(
start=start,
stop=stop
)
class Movement:
def __init__(self):
self.individu... | |
#
# Module providing manager classes for dealing
# with shared objects
#
# multiprocessing/managers.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token',
'SharedMemoryManager' ]
#
# Imports
#
import sys... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2013 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consi... | |
# -*- coding: utf-8 -*-
# Copyright 2014-2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
from itertools import product
import numpy as np
from scipy.sparse import (bsr_matrix, coo_matrix, csc_matrix, csr_matrix,
dok_matrix, lil_matrix)
from sklearn.cross_validation import train_test_split
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing impo... | |
#!/usr/bin/env python
"""shors.py: Shor's algorithm for quantum integer factorization"""
import math
import random
import argparse
__author__ = "Todd Wildey"
__copyright__ = "Copyright 2013"
__credits__ = ["Todd Wildey"]
__license__ = "MIT"
__version__ = "1.0.0"
__maintainer__ = "Todd Wildey"
__email__ = "toddwilde... | |
import logging
from collections import defaultdict
from datetime import datetime
import pkg_resources
from pylons import c, g, request
from paste.deploy.converters import asbool
from tg import expose, redirect, flash, validate, config
from tg.decorators import with_trailing_slash, without_trailing_slash
from webob imp... | |
# -*- coding: utf-8 -*-
"""
sphinx.application
~~~~~~~~~~~~~~~~~~
Sphinx application object.
Gracefully adapted from the TextPress system by Armin.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import sys
import types
i... | |
from .. import msg
import numpy as np
from .results import DictResult, ListResult
import xml.etree.ElementTree as ET
import re
class TemplateContents(object):
"""Represents the contents of a file template for a single version.
:attr comments: the character that designates the rest of the line
as a comme... | |
# -*- coding: utf-8 -*-
#
# Ray documentation build configuration file, created by
# sphinx-quickstart on Fri Jul 1 13:19:58 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | |
import collections
import numpy
import six
import chainer
from chainer import backend
from chainer.backends import cuda
class Converter(object):
"""Base class of converters.
Converters receive batched data retrieved from iterators and perform
arbitrary transforms as well as device transfer.
Imple... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys
import shlex
import hashlib
import argparse
import subprocess
from difflib import unified_diff
class DocTests:
def __init__(self, args):
scriptpath = os.path.dirname(os.path.realpath(__file__))
self.ledger = os.path.abspa... | |
import thread
import traceback
thread.stack_size(1024 * 512) # reduce vm size
class Input(dict):
def __init__(self, conn, raw, prefix, command, params,
nick, user, host, paraml, msg):
chan = paraml[0].lower()
if chan == conn.nick.lower(): # is a PM
chan = nick
... | |
import logging
import struct
import textwrap
from .exceptions import TockLoaderException
class TabApp:
'''
Representation of a Tock app for a specific architecture and board from a
TAB file. This is different from a TAB, since a TAB can include compiled
binaries for a range of architectures, or compiled for vario... | |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import numpy as np
import torch
from fairseq.data import FairseqDataset, data_utils
logger = logging.getLogger(__name__)
d... | |
import base64
import datetime
import json
from json import JSONEncoder
from google.protobuf.json_format import MessageToJson, ParseDict
from google.protobuf.descriptor import FieldDescriptor
from mlflow.exceptions import MlflowException
from collections import defaultdict
from functools import partial
_PROTOBUF_IN... | |
"""
An example using Amazon's Thread example for motivation
http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SampleTablesAndData.html
"""
import logging
from pynamodb.models import Model
from pynamodb.attributes import (
ListAttribute, UnicodeAttribute, NumberAttribute, UnicodeSetAttribute, UTCDateT... | |
#!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | |
"""Test script for the gzip module.
"""
import unittest
from test import test_support
import os
import io
import struct
import tempfile
gzip = test_support.import_module('gzip')
data1 = """ int length=DEFAULTALLOC, err = Z_OK;
PyObject *RetVal;
int flushmode = Z_FINISH;
unsigned long start_total_out;
"""
dat... | |
"""
26 Jan 2016
last_edited: 08 Jun 2017
Authors: Sai Nudurupati & Erkan Istanbulluoglu
Ref 1: source_tracking_algorithm_user_manual. @
https://github.com/RondaStrauch/pub_strauch_etal_esurf/blob/master/SourceTrackingAlgorithm_RefManual_draft.docx
Ref 2: 'The Landlab LandslideProbability Component User Manual' @
htt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.