src stringlengths 721 1.04M |
|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
"""
test_testagent
----------------------------------
Tests for `testagent` module.
"""
import unittest
from testagent.tasks import start_certification
class TestTestagent(unittest.TestCase):
def setUp(self):
pass
... |
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.operations.account_operations as acc_ops
import apibinding.api_actions as api_actions
import zstackwoodpecker.operations.resource_operations as res_op... |
# -*- coding: utf-8 -*-
import json
from Plugins.Extensions.MediaPortal.plugin import _
from Plugins.Extensions.MediaPortal.resources.imports import *
from Plugins.Extensions.MediaPortal.resources.choiceboxext import ChoiceBoxExt
from Plugins.Extensions.MediaPortal.resources.keyboardext import VirtualKeyBoardExt
from... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... |
# -*- coding: utf-8 -*-
#
# @file hocr.py
#
# @remark Copyright 2014 Philippe Elie
# @remark Read the file COPYING
#
# @author Philippe Elie
import sys
import os
from common import utils
import hashlib
from ocr import pdf_to_djvu
from ocr import ocr_djvu
from ocr import djvu_text_to_hocr
from ocr import ocr
from commo... |
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of astroid.
#
# astroid is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
#... |
import sys
from classrooms import *
from learners import *
from datasets import *
from stat_trackers import *
from svmutil import *
import math
#from memory_profiler import profile
#from pympler import muppy
#from pympler import asizeof
#from pympler import summary
#from pympler.classtracker import ClassTracker
import... |
from django.conf.urls import patterns, include, url
from django.contrib.auth.decorators import login_required
from yard import views
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'ciao.views.home', name='home'),
url(r'^accounts/login/$', 'django.contrib.auth.views.login'),
url(r'^accounts/logout/$', '... |
""" Group from which to select manufacturer and model """
import PySide2.QtCore as QtCore
import PySide2.QtWidgets as QtWidgets
from . import config
from ..lib.driver import Driver
class DriverSelectionGroup(QtWidgets.QGroupBox):
""" Group from which to select manufacturer and model """
driver_changed = QtCo... |
import logging
import math
from django.core.files.storage import default_storage as storage
from django.db.models import Count
import elasticutils.contrib.django as elasticutils
from celeryutils import task
import amo
from amo.decorators import set_modified_on
from amo.helpers import user_media_path
from amo.utils i... |
from cattle import ApiError
from common_fixtures import * # NOQA
def test_agent_unique(super_client):
agents = super_client.list_agent(uri='sim://unique')
if len(agents) == 0:
agent = super_client.create_agent(uri='sim://unique')
agent = super_client.wait_success(agent)
assert agent.... |
import urllib
import httplib2
from django.conf import settings
class EsvClientError(Exception):
pass
class PassageNotFoundError(EsvClientError):
pass
class EsvQuotaExceededError(EsvClientError):
pass
class EsvClient(object):
def __init__(self, key='IP'):
http_cache = getattr(settings, 'ESV_... |
import numpy as np
import pandas as pd
arts = pd.DataFrame()
# Clean the dates so you only see numbers.
def clean_years(value):
result = value
chars_to_replace = ["c.", "©", ", CARCC", "no date", "n.d.", " SODRAC", ", CA", " CARCC", ""]
chars_to_split = ["-", "/"]
if isinstance(result, str):
... |
""" Simonyan K., Zisserman A. "`Very Deep Convolutional Networks for Large-Scale Image Recognition
<https://arxiv.org/abs/1409.1556>`_"
"""
import tensorflow as tf
from . import TFModel
from .layers import conv_block
_VGG16_ARCH = [
(2, 0, 64, 1),
(2, 0, 128, 1),
(3, 0, 256, 1),
(3, 0, 512, 1),
(... |
import flask
import flask_restful
import flask.ext.cors
from celery import Celery
from resources.analysis import AnalysisRes, AnalysisStatusRes
from resources.catchment import CatchmentListRes, CatchmentRes
from resources.dataimport import DataImportRes
import floodestimation
import floodestimation.loaders
import flood... |
import numpy as np
import itertools as it
def sample_prior(n_sampler, fitter, thermal_noise=0.023, thermal_noise_std=0.01):
"""Given a fitter object and the number of samplers, sample the prior
distribution of the fit parameters for use as the initial positions for
the walkers.
There are two exceptio... |
#
# Test Creation of Thumbnails.
#
from . import ExchangeTest
from base64 import b64encode
class ThumbnailTest(ExchangeTest):
def setUp(self):
super(ThumbnailTest, self).setUp()
self.login()
def get_thumbnail(self, path):
r = self.client.get(path)
self.assertEqual(r.statu... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Work out the first ten digits of the sum of the
following one-hundred 50-digit numbers.
"""
n = """37107287533902102798797998220837590246510135740250
46376937677490009712648124896970078050417018260538
74324986199524741059474233309513058123726617309629
9194221336357416... |
from __future__ import absolute_import, division, print_function, unicode_literals
import glob
import os
import shutil
class Constants():
def __init__(self, trajs_path=None):
self.trajFolder = "allTrajs"
if trajs_path is not None:
self.trajFolder = os.path.join(trajs_path, self.trajFol... |
from PyQt4 import QtCore
class DataFrameTableModel(QtCore.QAbstractTableModel):
def __init__(self, data=None, parent=None):
QtCore.QAbstractTableModel.__init__(self, parent=parent)
self.set_data(data)
def rowCount(self, parent):
return self._data.shape[0] if self._data is not None els... |
# copyright (c) 2018 paddlepaddle 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 app... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
==================
PyOrganism Package
==================
:Authors:
Moritz Emanuel Beber
:Date:
2012-05-22
:Copyright:
Copyright(c) 2012 Jacobs University of Bremen. All rights reserved.
:File:
setup.py
"""
import sys
from os.path import join
from s... |
#!/usr/bin/env python
import pkgutil
import unittest
from chan.post_producer import PostProducer
from chan.post_collector import PostCollector
json_old_dump = pkgutil.get_data("chan.test.files", "json_old_dump")
json_new_dump = pkgutil.get_data("chan.test.files", "json_new_dump")
json_minimal = pkgutil.get_data("ch... |
import numpy as np
import pandas as pd
import sys
sys.path.append("..")
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.linear_model import LogisticRegression
import src.data.extractor.preprocessing as preprocessing
from sklearn.model_selection import train_test_split
from sklearn.metrics import clas... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-05-02 14:13
from __future__ import unicode_literals
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import sharingcars.helpers.User
class Migration(migrations.Migration... |
#!/usr/bin/env python3
import paho.mqtt.client as mqtt
import configparser
import pifacedigitalio as PFIO
APPNAME = os.path.splitext(os.path.basename(__file__))[0]
INIFILE = os.getenv('INIFILE', APPNAME + '.ini')
config = configparser.ConfigParser()
config.read(INIFILE)
MODULE = 'PFIO'
MQTT_HOST = config.get("gl... |
# coding:utf8
__author__ = 'Marcelo Ferreira da Costa Gomes'
import rpy2.robjects as ro
from numpy import *
from pandas import *
from rpy2.robjects import pandas2ri
from rpy2.robjects.packages import importr
pandas2ri.activate()
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as ... |
import random
import string
from django.contrib.auth import get_user_model
from django.utils.timezone import now
from .. import models
def create_user(**kwargs):
"""Create sample user."""
username = ''.join(random.choice(string.ascii_letters) for x in range(30))
values = {
'username': username,
... |
#!/usr/bin/python
#
#
# cif-router proof of concept
#
# cif-router [-p pubport] [-r routerport] [-m myname] [-h]
# -p default: 5556
# -r default: 5555
# -m default: cif-router
#
# cif-router is a zmq device with the following sockets:
# XPUB
# for republishing messages
# XSUB
# ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import postgrefts.fields
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Index',
... |
import time
from app import db, utils
from app.models import Post, Slide
from flask import redirect, request
from flask_wtf import Form
from wtforms import validators, StringField, SelectField
URL_REGEX = r'((http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&/=]*))|\/[-a-zA-Z0-... |
# 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 sets import Set
import json
import requests
def esami_output(item, sessions):
output = "*Insegnamento:* " + item["insegnamento"]
output += "\n*Docenti:* " + item["docenti"]
for session in sessions:
appeal = [appeal for appeal in item[session] if appeal]
if(a... |
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 3 11:36:58 2017
@author: camacho
"""
import numpy as np
import matplotlib.pyplot as pl
pl.close("all")
##### RV FUNCTION 1 - circular orbit
def RV_circular(P=365,K=0.1,T=0,gamma=0,time=100,space=20):
#parameters
#P = period in days
#K = semi-amplitude of t... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-01-01 19:20
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mundoDeportivo', '0001_initial'),
]
operations = [... |
#!/usr/bin/python
import sys
import wx
import wx.lib.agw.ultimatelistctrl as ULC
from wx.lib.mixins.listctrl import ColumnSorterMixin
import sqlite3
from DBbuilder import create_database, is_in_db, DBbuilderThread, get_from_db
import os
import wx_signal
import wx.html
from html_window import ClickableHtmlWindow
from d... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-01-20 02:16
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('perek_tugas', '0002_auto_20160119_1958'),
]
operations = [
migrations.AlterFie... |
# awl.tests.test_utils.py
import sys
from io import StringIO
from django.test import TestCase
from awl.tests.models import Link
from awl.utils import (URLTree, refetch, refetch_for_update, render_page,
render_page_to_string, get_field_names, get_obj_attr)
from awl.waelsteng import FakeRequest
# =================... |
import matplotlib
matplotlib.use('Agg')
import cPickle
from matplotlib import pyplot as plt
import os
data_dir = '/Volumes/Storage/models'
img_save_dir = '/Volumes/Storage/weights'
models = [('clean', 'AE1110_Scale_Warp_Blocks_2049_500_tanh_tanh_gpu_sgd_clean_continue_20141110_1235_21624029'),
('gaussian... |
import os
import shutil
import tempfile
import argparse
import sys
from six.moves import cStringIO as StringIO
from contextlib import contextmanager
from unittest.case import SkipTest
import netlib.tutils
from mitmproxy import utils, controller
from mitmproxy.models import (
ClientConnection, ServerConnection, Er... |
#!/usr/bin/python2
# This file is part of Curavi Applet.
# Copyright (C) 2011 Kevin Rafael Sarmiento Mendoza
# Curavi Applet is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... |
#!/usr/bin/env python
import urllib
import json
import os
from flask import Flask
from flask import request
from flask import make_response
from pymongo import MongoClient
# Flask app should start in global layout
app = Flask(__name__)
client = MongoClient('mongodb://localhost:27017')
@app.route('/star', methods=['... |
# Copyright (c) 2013 Rackspace, 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 w... |
"""
Aggregating results into DataPoints
Copyright 2015 BlazeMeter 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 ... |
# -*- coding: utf-8 -*-
import random
from genetix.gene import Gene
class Chromosome(object):
"""The base Chromosome class, which is a container for genes, and handles
mutation via the offspring method.
"""
def __init__(self, names=[], genes=[]):
self.names = names
self.genes = gene... |
"""
:mod: ReplicaManager
.. module: ReplicaManager
:synopsis: ReplicaManager links the functionalities of StorageElement and FileCatalog.
This module consists ReplicaManager and related classes.
OBSOLETED !!! DO NOT USE THIS ANYMORE!!!! USE THE DataManager CLASS
"""
# # imports
from datetime import datetime, tim... |
#
# Copyright (C) 2014 FreeIPA Contributors see COPYING for license
#
import os
import pwd
import grp
import ldap
from ipaserver.install import service
from ipaserver.install import installutils
from ipapython.ipa_log_manager import root_logger
from ipapython.dn import DN
from ipapython import ipautil
from ipaplatf... |
import logging
import os
from Queue import Queue
import threading
import argparse
LOG = logging.getLogger(__name__)
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s', level=logging.INFO)
class LineCounterWorker(threading.Thread):
def __init__(self, worker_id, processing_queue, result_queue):... |
"""Test utilities."""
from os.path import basename
import numpy as np
import micom
import micom.util as util
from fixtures import community
URL = "http://bigg.ucsd.edu/static/models/e_coli_core.xml.gz"
tax = micom.data.test_taxonomy()
def test_download(tmpdir):
print(tmpdir.dirpath())
util.download_model(UR... |
#!/urs/bin/python
import os
import wx
from ..core.gk_node import GKNode
from .gkui_node_dlg import GKUINodeEditDialog
class GKUINodeManager(object):
def __init__(self, parentframe, listctrl):
self.m_listctrl = listctrl
assert (self.m_listctrl is not None), "listctrl is None!"
self.m_paren... |
from __future__ import division, print_function
import __common__
(print, print_, print_on, print_off,
rrr, profile) = __common__.init(__name__, '[io]')
# Python
import os
import fnmatch
import pickle
import cPickle
from os.path import normpath, exists, realpath, join, expanduser, dirname
import datetime
import time
#... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Image'
db.create_table(u'catalog_image', (
(u'id', self.gf('django.db.models.fie... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2014 Lukas Kemmer
#
# 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
#
# Unl... |
import capstone
import binwalk.core.common
import binwalk.core.compat
from binwalk.core.module import Module, Option, Kwarg
class ArchResult(object):
def __init__(self, **kwargs):
for (k,v) in kwargs.iteritems():
setattr(self, k, v)
class Architecture(object):
def __init__(self, **kwargs):... |
# coding=utf-8
# This file is part of Medusa.
#
# Medusa is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Medusa is distributed in t... |
# coding=utf-8
from datetime import datetime, timedelta
from pymongo import MongoClient, errors
from config import MONGO_URL
class MongoQueue(object):
OUTSTANDING = 1
PROCESSING = 2
COMPLETE = 3
def __init__(self, db, collection, timeout=300):
self.MongoClient = MongoClient(MONGO_URL, conne... |
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import copy,re,os
from waflib import Logs,Utils
re_imp=re.compile('^(#)*?([^#=]*?)\ =\ (.*?)$',re.M)
class ConfigSet(object):
__slots__=('table','parent')
def __init__(self,... |
"""
Support for RFXtrx components.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/rfxtrx/
"""
import logging
from homeassistant.util import slugify
REQUIREMENTS = ['https://github.com/Danielhiversen/pyRFXtrx/' +
'archive/0.5.zip#pyRFXt... |
# This code is used for "internal docker container" read/write value at etcd.
#
# CoreOS (etcd Activated)
# | ^
# | NAT | iptables
# V |
# Docker Container -> python code.
#
# This can be used for "distriburted or HA environment"
import requests
import json
class etcd... |
# coding: utf-8
# pystacia/tests/lazyenum_tests.py
# Copyright (C) 2011-2012 by Paweł Piotr Przeradowski
# This module is part of Pystacia and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from pystacia.tests.common import TestCase
class Enum(TestCase):
def name_test(s... |
# Copyright (C) 2010-2011 Richard 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 restriction, including without limitation the
# rights to use, copy, modify, merge, publish... |
#########
# Copyright (c) 2013 GigaSpaces Technologies Ltd. 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... |
import os
from OpenGL.GL import *
from PyQt4.QtCore import Qt
from PyQt4.QtGui import QApplication, QMainWindow, QDockWidget
import sys
import traceback
from ert.ecl import EclTypeEnum, EclKW, EclGrid
from ert.ecl.faults import FaultCollection
from ert.geo.xyz_io import XYZIo
from ert_gui.viewer import Texture3D, Bou... |
# Copyright 2017-2018 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 ... |
import datetime
from exceptions import IOError
from threading import Thread
import jsonpickle
import sys
from wx.lib.pubsub import pub
# from pubsub import pub
from GAMUTRawData.odmservices import ServiceManager
from H2OSeries import OdmSeriesHelper
from Common import APP_SETTINGS, InitializeDirectories
from Utilitie... |
# copyright (c) 2018 paddlepaddle 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 app... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... |
# -*- coding: utf-8 -*-
# Copyright 2018 ProjectQ-Framework (www.projectq.ch)
#
# 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
#
# ... |
from PyQt4 import QtGui, QtCore
from core.repository import MovieRepository
import core.Constants as Constants
class MovieTable(QtGui.QTableWidget):
def __init__(self, mainWindow):
self.mainWindow = mainWindow
super(MovieTable, self).__init__()
#Init database
se... |
"""
.. function:: flow(query:None)
Translates the input query results into sql statements if possible.
:Returned table schema:
- *query* text
A complete sql query statement with the semicolon at the end
.. note::
Input query results must be sql statements separated with semicolons in the first place... |
"""
Copyright (c) 2012, fabiodive@gmail.com 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 of source code must retain the above copyright notice, self
list of conditions and the... |
"""
Author : Guillaume "iXce" Seguin
Email : guillaume@segu.in
Copyright (C) 2008, Guillaume Seguin <guillaume@segu.in>.
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 ... |
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
# 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 Apach... |
import json
from uuid import UUID
from twisted.internet import defer
from twisted.web import resource, server
class RecursiveResource(resource.Resource, object):
isLeaf = False
def getChild(self, name, request):
if name == '':
child = self
else:
try:
... |
from __future__ import division, absolute_import, print_function
import os
import re
import sys
import copy
import glob
import atexit
import tempfile
import subprocess
import shutil
import multiprocessing
import textwrap
import distutils
from distutils.errors import DistutilsError
try:
from threading import local... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-28 08:34
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migration... |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Asumi Kamikaze Inc.
# Licensed under the MIT License.
# Author: Alejandro M. Bernardis
# Email: alejandro (dot) bernardis (at) asumikamikaze (dot) com
# Created: 02/Oct/2014 2:46 PM
from backend.api.base import BaseHandler
from tornado import gen
fr... |
#! /usr/bin/python
# Copyright 2012-2013 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This progra... |
"""
:author: yoram@ignissoft.com
"""
import os
import posixpath
import imp
from sys import platform
if platform == 'win32':
app_subdir = 'Spirent TestCenter Application'
else:
app_subdir = 'Spirent_TestCenter_Application_Linux'
class StcPythonWrapper(object):
def __init__(self, logger, stc_install_dir)... |
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... |
#!/usr/bin/env python
#
# Copyright 2007 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... |
# 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... |
#
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 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 r... |
# encoding:utf-8
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from apps.company.models import Company, Comment
from django.shortcuts import get_object_or_404
from utils.page import paginator_objects
def index(request):
return render_to_response('index.html', {... |
#!/usr/bin/env python2
# Copyright (c) 2014 Chaserhkj
# This software is licensed under the MIT license.
# See LICENSE for more details.
import tornado.web as web
import tornado.template as template
import tornado.ioloop as ioloop
import os,sys,mimetypes
import rarfile,zipfile
supported_archive = [".zip", ".rar"]
su... |
from urllib.parse import urlparse
from django.contrib.auth.models import AnonymousUser
from django.db import models
from django.http.request import HttpRequest
from post_office import mail
from post_office.models import EmailTemplate
from shop.conf import app_settings
from shop.models.order import BaseOrder
from shop.... |
# python version 1.0 DO NOT EDIT
#
# Generated by smidump version 0.4.8:
#
# smidump -f python IT-WATCHDOGS-MIB-V3
FILENAME = "./itw_mibv3.mib"
MIB = {
"moduleName" : "IT-WATCHDOGS-MIB-V3",
"IT-WATCHDOGS-MIB-V3" : {
"nodetype" : "module",
"language" : "SMIv2",
"organization" : ... |
# -*- coding: utf-8 -*-
# Used in
# http.py - format_poster_link()
# list.py - add_movies()
import xbmcvfs
import xbmcup.app, xbmcup.net
from .xbmcup.db import SQL
from .xbmcup.system import FS
from .image_size import get_image_size_from_bytesio
from .auth import Auth
from .defines import *
# https://githu... |
# -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2019 by the FIFE team
# http://www.fifengine.net
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#... |
from __future__ import division, absolute_import, print_function
import tempfile
import sys
import os
import shutil
import warnings
import io
from decimal import Decimal
import numpy as np
from nose import SkipTest
from numpy.core import *
from numpy.compat import asbytes, getexception, strchar, sixu
from test_print ... |
# Techniques for outlier detection of speeds. Each of these returns a speed threshold that
# can be used with outlier detection techniques.
# Standard imports
import logging
class BoxplotOutlier(object):
MINOR = 1.5
MAJOR = 3
def __init__(self, multiplier = MAJOR, ignore_zeros = False):
self.mult... |
import numpy as np
import theano
import theano.tensor as T
### Regular Decoder
class Decoder(object):
def __init__(self, rng, input, latent_size, out_size, activation, W_z = None, b = None):
self.input = input
self.activation = activation
# setup the params ... |
#!/usr/bin/env python
# ====================================
# Copyright (c) Microsoft Corporation. All rights reserved.
# See license.txt for license information.
# ====================================
import os
import sys
import pwd
import shutil
import grp
import urllib2
import time
import imp
protocol = imp.load_so... |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
import os, os.path
import shutil
import glob
import sys
from subprocess import check_call, check_output
os.chdir('/home/will/Dropbox/PhredDirectory/')
staden_path = '/home/will/staden-2.0.0b9.x86_64/bin/'
sys.path.append('/home/will/PySeqUtils/')
# <co... |
import pygame
import os
import random
class sound:
def __init__(self):
self.level = 1
self.sound_level = 1
self.state = 0
self.laststate = 0
self.available_sounds = {}
self.sounds = {}
self.music_channel = pygame.mixer.Channel(0)
def update(... |
#!/usr/bin/python
# -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
# Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
# All Rights Reserved
# Credits#######################################... |
import math
import cv2
import imutils
import numpy as np
import settings
MIN_AREA = 500
class Frame():
"""
Takes a given image with a background subtractor and provides
all the functions required to count the vehicles in the frame
for the CLI or drawCountVehicles can be called for the GUI
that ... |
# Copyright (C) 2013-2017 Roland Lutz
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed ... |
import asyncio
import errno
import inspect
import io
import os
import socket
import ssl
import threading
import time
import warnings
from distutils.version import StrictVersion
from itertools import chain
from typing import (
Any,
Iterable,
List,
Mapping,
Optional,
Set,
Tuple,
Type,
... |
# Generated by Django 2.0.6 on 2018-06-08 15:51
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='TModelOne',
fields=[
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.