gt
stringclasses
1 value
context
stringlengths
2.49k
119k
import os import re import struct import sys import textwrap Zero = "PyLong_FromLong(0)" One = "PyLong_FromLong(1)" True_ = "(Py_INCREF(Py_True), Py_True)" False_ = "(Py_INCREF(Py_False), Py_False)" None_ = object() AllOnes = "PyLong_FromLong(-1)" MinusInfinity = 'PyFloat_FromDouble(-NPY_INFINITY)' ReorderableNone = "...
from __future__ import unicode_literals from datetime import date, datetime import time import unittest from django.core.exceptions import FieldError from django.db import models from django.db import connection from django.test import TestCase, override_settings from .models import Author, MySQLUnixTimestamp class...
# This file is part of the MicroPython project, http://micropython.org/ # # The MIT License (MIT) # # Copyright (c) 2016 Glenn Ruben Bakke # # 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 wi...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2012 The Plaso Project Authors. # Please see the AUTHORS file for details on individual 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 L...
#------------------------------------------------------------------------------ # Copyright (C) 2009 Richard W. Lincoln # # 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 restrictio...
#!/usr/bin/env python3 # Copyright (c) 2016-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the bumpfee RPC. Verifies that the bumpfee RPC creates replacement transactions successfully when...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # === This file is part of Calamares - <http://github.com/calamares> === # # Copyright 2015, Teo Mrnjavac <teo@kde.org> # Copyright 2017-2018, 2020, Adriaan de Groot <groot@kde.org> # # Calamares is free software: you can redistribute it and/or modify # it under ...
# -------------------------------------------------------- # Fully Convolutional Instance-aware Semantic Segmentation # Copyright (c) 2017 Microsoft # Licensed under The Apache-2.0 License [see LICENSE for details] # Modified by Yi Li # -------------------------------------------------------- import cPickle import cv2...
# # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyri...
''' Biligrab Lite 0.21 Beining@ACICFG cnbeining[at]gmail.com http://www.cnbeining.com MIT licence ''' import sys import os from StringIO import StringIO import gzip import urllib2 import hashlib from xml.dom.minidom import parseString global vid global cid global partname global title global videourl global part_now...
#!/usr/bin/env python3 # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """gyptest.py -- test runner for GYP tests.""" import argparse import os import platform import subprocess import sys import time def is...
#!/usr/bin/env python # Copyright 2016 Criteo # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
"""Utility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. """ import os import sys import stat import fnmatch import collections import errno import tarfile try: import bz2 del bz2 _BZ2_SUPPORTED = True except ...
# -*- coding: utf-8 -*- ''' Module to provide RabbitMQ compatibility to Salt. Todo: A lot, need to add cluster support, logging, and minion configuration data. ''' # Import salt libs from salt import exceptions, utils # Import python libs import logging log = logging.getLogger(__name__) def __virtual__(): '''V...
# Copyright (c) 2010-2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
# # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2013 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 r...
""" test positional based indexing with iloc """ import pytest from warnings import catch_warnings import numpy as np import pandas as pd from pandas.compat import lrange, lmap from pandas import Series, DataFrame, date_range, concat, isna from pandas.util import testing as tm from pandas.tests.indexing.common impor...
import astropy.io.fits as pyfits import astropy.wcs as pywcs import os import numpy as np from pdb import set_trace import montage_wrapper as montage import shutil import sys import gal_data import config import glob #_TOP_DIR = '/data/tycho/0/leroy.42/allsky/' #_INDEX_DIR = os.path.join(_TOP_DIR, 'code/') _HOME_DIR ...
# Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 import math from collections import OrderedDict import torch import pyro import pyro.distributions as dist from pyro.distributions.testing.fakes import NonreparameterizedNormal from pyro.distributions.util import scalar_like from...
# This file is part of Indico. # Copyright (C) 2002 - 2022 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. # flake8: noqa import cgi import math import os import xml.sax.saxutils as saxutils from io import BytesI...
# Copyright 2016 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 agre...
from __future__ import absolute_import import sys from amqp.promise import Thenable, promise, maybe_promise from kombu.exceptions import HttpError from kombu.five import items from kombu.utils import coro from kombu.utils.encoding import bytes_to_str from kombu.utils.functional import maybe_list, memoize try: # pr...
""" @author: Bowen """ from django.shortcuts import render from django.db.models import Q from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render, get_object_or_404, render_to_response from django.template import RequestContext, loader from django.core.mail import send_mail from...
# # 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 us...
from diofant import (Dummy, E, Function, I, MatrixSymbol, Mul, Rational, Symbol, cbrt, exp, exp_polar, gamma, hyper, log, pi, polar_lift, powdenest, powsimp, root, simplify, sin, sqrt, symbols) from diofant.abc import a, b, c, x, y, z __all__ = () def t...
""" paswordstrength module can be used to get a password strength score of a string. It is based on various rules which are similar to those found in Wolfram Alpha. """ import os from argparse import ArgumentParser import getpass import string #only load it once. with open(os.path.join(os.pardir, "english"), 'r') as ...
import gym import os import sys import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from gym import wrappers from datetime import datetime from q_learning_bins import plot_running_avg # so you can test different architectures class HiddenLayer: def __init__(self, M1, M2, f=tf.nn.tanh, use_bia...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2011 Cisco Systems, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache...
#!/usr/bin/env python3 # # Parse and report coverage info from .info files generated by lcov # import os import glob import csv import re import collections as co import bisect as b INFO_PATHS = ['tests/*.toml.info'] def collect(paths, **args): file = None funcs = [] lines = co.defaultdict(lambda: 0) ...
import os from typing import Any, Callable, Dict, FrozenSet, List, Optional, Set, Tuple from unittest.mock import patch import ujson from django.conf import settings from django.db.models import Q from django.utils.timezone import now as timezone_now from zerver.lib import upload from zerver.lib.actions import ( ...
# # 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...
# Copyright (c) 2013 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...
#!/usr/bin/env python """Common import for all tests.""" import base64 import json import logging import optparse import os import shlex import shutil import signal import socket import subprocess import sys import time import unittest import urllib2 import environment from mysql_flavor import mysql_flavor from mysq...
'''UMD Eye-tracking processor. This file in particular generates a table file that can be imported into R for running stats. ''' # CHANGELOG # Edited by: Shevaun Lewis, Ewan Dunbar & Sol Lago # 1. Added code for computing first pass-skips, 'fs' [01/11/13] # Last updated: 04/01/14 # Major revisions by Ilia Kurenkov in ...
from unittest import mock from django.contrib.auth.models import Permission from django.http import HttpRequest, HttpResponse from django.test import TestCase from django.urls import reverse from django.utils.translation import gettext_lazy as _ from wagtail.admin.views.pages.bulk_actions.page_bulk_action import Page...
from itertools import product import math import mpmath from sympy.utilities.pytest import XFAIL, raises from sympy import ( symbols, lambdify, sqrt, sin, cos, tan, pi, acos, acosh, Rational, Float, Matrix, Lambda, Piecewise, exp, Integral, oo, I, Abs, Function, true, false, And, Or, Not, ITE, Min, Max, f...
# # 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...
import hail as hl from hail.ir.base_ir import BaseIR, MatrixIR from hail.utils.misc import escape_str, parsable_strings, dump_json, escape_id from hail.utils.java import Env class MatrixAggregateRowsByKey(MatrixIR): def __init__(self, child, entry_expr, row_expr): super().__init__(child, entry_expr, row_e...
# 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...
""" PageLayout ========== The :class:`PageLayout` class is used to create a simple multi-page layout, in a way that allows easy flipping from one page to another using borders. :class:`PageLayout` does not currently honor :attr:`~kivy.uix.widget.Widget.size_hint` or :attr:`~kivy.uix.widget.Widget.pos_hint` properties...
#!/usr/bin/python # -*- coding: utf-8 -*- """Library to log the bot in to a wiki account.""" # # (C) Rob W.W. Hooft, 2003 # (C) Pywikibot team, 2003-2015 # # Distributed under the terms of the MIT license. # from __future__ import unicode_literals __version__ = '$Id$' # import codecs import os import stat from warni...
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) from powerline.lib.watcher import create_file_watcher def list_segment_key_values(segment, theme_configs, segment_data, key, function_name=None, name=None, module=None, default=None): try: yield segm...
from contextlib import contextmanager import os import threading import pytest from pydev_tests_python import debugger_unittest from pydev_tests_python.debugger_unittest import get_free_port, overrides, IS_CPYTHON, IS_JYTHON, IS_IRONPYTHON, \ IS_PY3K import sys def get_java_location(): from java.lang impor...
# coding: utf-8 # # Sentiment analysis with TFLearn # # In this notebook, we'll continue Andrew Trask's work by building a network for sentiment analysis on the movie review data. Instead of a network written with Numpy, we'll be using [TFLearn](http://tflearn.org/), a high-level library built on top of TensorFlow. ...
""" verktyg.http.cookies ~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2015 Ben Mather, based on Werkzeug, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import string from itertools import chain from time import time from datetime import timedelta from...
# Copyright (c) 2010-2013 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functiona...
"""The tests for the logbook component.""" # pylint: disable=protected-access,invalid-name import collections from datetime import datetime, timedelta import json from unittest.mock import Mock, patch import pytest import voluptuous as vol from homeassistant.components import logbook, recorder from homeassistant.comp...
""" Cross Site Request Forgery Middleware. This module provides a middleware that implements protection against request forgeries from other sites. """ import logging import re import string from urllib.parse import urlparse from django.conf import settings from django.core.exceptions import DisallowedHost, Improperl...
""" Termination criteria used to determine when to stop running a training algorithm. """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" import ...
"""Various helpers not related to the Telegram API itself""" import asyncio import io import enum import os import struct import inspect import logging import functools from pathlib import Path from hashlib import sha1 class _EntityType(enum.Enum): USER = 0 CHAT = 1 CHANNEL = 2 _log = logging.getLogger(...
import json import mock import os import time from girder_worker.app import app from girder_worker_utils import types from girder_worker_utils.decorators import argument from girder.constants import AccessType from girder.models.file import File from girder.models.folder import Folder from girder.models.item import I...
"""Utilities to help with developing using bcbio inside of docker.""" import glob import os import pwd import numpy import yaml from bcbiovm import log as logging from bcbiovm.common import exception from bcbiovm.common import utils as common_utils from bcbiovm.container.docker import mounts as docker_mounts LOG = l...
# 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...
#!/usr/bin/python2.5 # # Provides a WebFinger protocol lookup service. # # Copyright 2009 DeWitt Clinton # # 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/...
from __future__ import unicode_literals from django.db import models from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from project.models import Project, ProjectRelease, SourceElement DOCUMENT_SOURCE = 'd' CHANNEL_SOURCE = 's' LANGUAGES = [ ('j', 'Java'...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import abc import datetime import hashlib import ipaddress import warning...
# -*- coding: utf-8 -*- """ utils.py ~~~~~~~~ <Add description of the module here>. :copyright: (c) 2015-2020 by Jochen Gerhaeusser. :license: BSD, see LICENSE for details. """ import json from konfoo.globals import ItemClass class HexViewer: """ A `HexViewer` writes or prints a source file or a byte stream ...
import binascii from twisted.internet import reactor from twisted.internet.defer import Deferred, inlineCallbacks from twisted.internet.task import Clock from twisted.test.proto_helpers import StringTransport from twisted.trial.unittest import TestCase from txssmi.builder import SSMIRequest from txssmi.commands impor...
#!python from __future__ import print_function import sys import ctypes from ctypes import byref, sizeof from ctypes.wintypes import BOOL, DWORD import select import socket import struct try: import servicemanager import win32api import win32con import win32security import win32service import ...
# # 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 us...
########################################################################## # # Copyright (c) 2021, Cinesite VFX Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions ...
# 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 ...
""" Utilities for importing data See example usage at the bottom. """ import json, numbers import os import psycopg2 import mysql.connector import re try: import vertica_python except: pass try: import pyaccumulo except: pass from Util import Util supportedTypes = ['PostgreSQL', 'MySQL', 'Vertica'...
#!/usr/bin/env python # # Copyright 2017 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 la...
# -*- 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 ...
import pandas as pd import numpy as np from copy import deepcopy from os.path import join, isdir, isfile from os import listdir import re import os from sys import stdout from pathlib import Path from nilmtk.utils import get_datastore from nilmtk.datastore import Key from nilmtk.timeframe import TimeFrame from nilmtk.m...
import idaapi import idc from threading import RLock import itertools import wrapt from .qt import MenuManager import traceback class Update(object): """ A context manager that refreshes the UI on `__exit__`. When nested, only the topmost context manager can update the UI. This is used to make sure t...
from six.moves import queue import chainer import chainermn import chainermn.communicators import chainermn.functions class MultiNodeChainList(chainer.ChainList): """Combining multiple non-connected components of computational graph. This class combines each ``chainer.Chain``, which represents one of the ...
import requests import logging import configparser from impacket.smbconnection import SMBConnection, SessionError from cme.connection import * from cme.helpers.logger import highlight from cme.helpers.bloodhound import add_user_bh from cme.logger import CMEAdapter from io import StringIO from pypsrp.client import Clie...
# # blowfish.py # Copyright (C) 2002 Michael Gilfix <mgilfix@eecs.tufts.edu> # # This module is open source; you can redistribute it and/or # modify it under the terms of the GPL or Artistic License. # These licenses are available at http://www.opensource.org # # This software must be used and distributed in accordance...
from voluptuous import Schema, Required, All, Length, Range, MultipleInvalid from threading import Lock import yaml import logging import random import time import utils import sys import traceback from copy import copy from Queue import Queue from string import ascii_lowercase from numpy import rot90 from music21 impo...
# Copyright (c) 2015 Infoblox 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 require...
# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# Copyright (c) 2014 - 2016 townhallpinball.org # # 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, p...
#!/usr/bin/env python import pytest import string import random import sys import os from pytest_mock import mocker try: from StringIO import StringIO except ImportError: from io import StringIO from plugin import instVHDL ALIGNMENT_SIGN = " " TEST_JOIN_SIGN = " " def get_alignment(name, alignment): co...
# 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 applic...
# 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. """Generic utils.""" import codecs import cStringIO import datetime import logging import os import pipes import platform import Queue import re import ...
# ***************************************************************************** # # 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 # # ...
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a ...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 ...
# coding: utf-8 # Copyright 2017 video++ Project, SJTU MediaLab # # 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 appli...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import json import re import urllib import cStringIO from utils.UnicodeIO import UnicodeReader, UnicodeWriter from db.Corpus_DB import Corpus_DB class Home_Core(object): def __init__(self, request, response): self.request = request self.response = response ...
#----------------------------------------------------------------------------- # 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. #-------------------------------------------------------------------...
# 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 ...
import numpy as np from numpy.linalg import inv #from scipy import optimize from scipy.stats import t from nipy.fixes.scipy.stats.models.utils import pos_recipr import numpy.lib.recfunctions as nprf from descriptors import setattr_on_read class Model(object): """ A (predictive) statistical model. The class M...
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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.apac...
# Copyright (c) 2013 Scality # # 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...
from __future__ import print_function # import matplotlib # matplotlib.use('Agg') import unittest import numpy as np import discretize from SimPEG.electromagnetics import resistivity as dc from SimPEG.electromagnetics.static import utils from SimPEG import maps, mkvc from SimPEG.utils import io_utils import shutil im...
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, publish, ...
from __future__ import unicode_literals import codecs from hashlib import md5 import os import re from path import Path from django.core.management import ManagementUtility from django.core.management.commands.makemessages import Command as BaseCommand from django.utils.six import text_type from django.utils.text im...
from .models import Group, Person from django.views.decorators.csrf import csrf_exempt from django.conf import settings import logging import urllib2 import json logger = logging.getLogger("bellman.bellman") class Bellman: def __init__(self, text, user_name, user_id): temp_command, space, self.text = t...
from django.contrib import comments from django.contrib.auth import get_user_model from django.core import mail from django.core.urlresolvers import reverse from django.test import TestCase from ..models import Job from ..factories import ( ApprovedJobFactory, DraftJobFactory, JobCategoryFactory, JobTypeFactory, ...
import json import unittest import alerta_azuremonitor from alerta.app import create_app, custom_webhooks class AzureMonitoringWebhookTestCase(unittest.TestCase): def setUp(self): test_config = { 'TESTING': True, 'AUTH_REQUIRED': False } self.app = create_app(te...
import sys import unittest import weakref from test_support import run_unittest class C: def method(self): pass class Callable: bar = None def __call__(self, x): self.bar = x def create_function(): def f(): pass return f def create_bound_method(): return C().method def ...
"""App Spec Yml App Config""" # standard library import json import logging import os from pathlib import Path from typing import Optional # third-party import yaml try: # third-party from yaml import CDumper as Dumper from yaml import CLoader as Loader except ImportError: from yaml import Loader, Dum...
__author__ = 'chris' import miniupnpc class PortMapper(object): """ UPnP Port Mapping tool, so we don't need to manually forward ports on a router. Ideally we'd use a random port within a range of about 1000 possible ports. Ideally we'd delete the mapping when we shutdown OpenBazaar but that might...
# pythonequations is a collection of equations expressed as Python classes # Copyright (C) 2008 James R. Phillips # 2548 Vera Cruz Drive # Birmingham, AL 35235 USA # email: zunzun@zunzun.com # # License: BSD-style (see LICENSE.txt in main source directory) # Version info: $Id: EnzymeKinetics.py 274...