src stringlengths 721 1.04M |
|---|
"""
Monitoring (and logging) for ETL steps.
This module provides a context for the ETL that allows to monitor
the start time of an ETL step along with its successful or
unsuccessful completion. Events for start, finish or failure
may be emitted to a persistence layer.
"""
import http.server
import itertools
import l... |
import os
import glob
import subprocess
import calendar
import time
import urllib2
import json
import Adafruit_DHT
#initialize
os.system('modprobe w1-gpio')
os.system('modprobe w1-therm')
sensor = Adafruit_DHT.DHT22
pin = 8
#Temperature device
base_dir = '/sys/bus/w1/devices/'
device_folder = glob.glob(base_dir + '28... |
#!/usr/bin/env python
########################################################
#
# fregion.py : read structured data files
#
# to load a file from the path P into the variable f:
# f = fregion.FRegion(P)
#
# to read the stored field 'x' out of f:
# f.x
#
# to read the 'metadata' for the field 'x' (t... |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2008 Brian G. Matherly
# Copyright (C) 2008 Jerome Rapinat
# Copyright (C) 2008 Benny Malengier
#
# 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 Fre... |
# Copyright 2016 EMC Corporation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... |
import pgindex
import sys
from django.core.management.base import BaseCommand, CommandError
from django.utils.translation import ugettext as _
from optparse import make_option
from pgindex.models import Index
class Command(BaseCommand):
help = _('Reindex for django-pgindex')
option_list = BaseCommand.option_... |
#!/usr/bin/env python
"""compile, build and download the ATLYS demo to the ATLYS development kit"""
import sys
import os
import shutil
from user_settings import ise, vivado
def build_ise(chip, bsp, working_directory):
"""Build using Xilinx ISE an FPGA using the specified BSP
chip is a chip instance.
... |
#!/usr/local/bin/python
import httplib2
import os, pdb
from apiclient import discovery
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
try:
import argparse
flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args()
except ImportError:
flags... |
#
# Module implementing queues
#
# multiprocessing/queues.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = ['Queue', 'SimpleQueue', 'JoinableQueue']
import sys
import os
import threading
import collections
import time
import weakref
import errno
from queue import... |
# 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 ... |
"""Helper functions and class to map between OGM Elements <-> DB Elements"""
import functools
import logging
from goblin import exception
logger = logging.getLogger(__name__)
def map_props_to_db(element, mapping):
"""Convert OGM property names/values to DB property names/values"""
property_tuples = []
... |
from datetime import datetime
from datetime import timedelta
from datetime import date
class SanityChecker:
"""Validate input from URL arguments.
This helps keep code that needs to check input succinct and consistent
across the various reports. The main purpose for encapsulating these
methods is so t... |
import pickle
import pandas as pd
#import numpy as np
import nltk
import time
start_time = time.time()
a=pd.read_table('tweets_pos_clean.txt')
b=pd.read_table('tweets_neg_clean.txt')
aux1=[]
aux2=[]
auxiliar1=[]
auxiliar2=[]
for element in a['Text']:
for w in element.split():
if (w==':)' or len(w)>3):
auxiliar... |
#!/usr/bin/env python
#
import argparse
import sys
import os
import csv
import time
import math
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + '/../../lib/')
from naturalli import *
"""
Parse the command line arguments
"""
def parseargs():
parser = argparse.ArgumentParser(description=
'Conve... |
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.db import models
from django.utils import timezone
from django.contrib.gis.db.models import PointField
from enum import Enum
from democracylab.models import Contributor
from common.models.tags import Tag
from taggit.manager... |
# -*- coding: utf-8 -*-
'''
CloudStack Cloud Module
=======================
The CloudStack cloud module is used to control access to a CloudStack based
Public Cloud.
Use of this module requires the ``apikey``, ``secretkey``, ``host`` and
``path`` parameters.
.. code-block:: yaml
my-cloudstack-cloud-config:
... |
# Copyright 2020 The Matrix.org Foundation C.I.C.
#
# 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... |
"""
A deep neural network with or w/o dropout in one file.
"""
import numpy
import theano
import sys
import math
from theano import tensor as T
from theano import shared
from theano.tensor.shared_randomstreams import RandomStreams
from collections import OrderedDict
BATCH_SIZE = 100
STACKSIZE = 69
def relu_f(vec):
... |
# -*- coding:utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import mock
from django.test import SimpleTestCase, TestCase
from django_perf_rec.db import AllDBRecorder, DBOp, DBRecorder
from .utils import run_query
class DBOpTests(SimpleTestCase):
def test_create(se... |
import sys, os
import contextlib
import subprocess
# find_library(name) returns the pathname of a library, or None.
if os.name == "nt":
def _get_build_version():
"""Return the version of MSVC that was used to build Python.
For Python 2.3 and up, the version number is included in
sys.versi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2018: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free So... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('lesson', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
oper... |
# Copyright 2019-2021 Peppy Player peppy.player@gmail.com
#
# This file is part of Peppy Player.
#
# Peppy Player 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 you... |
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/475160
# Was accepted into Python 2.5, but earlier versions still have
# to do stuff manually
import threading
from pychess.compat import Queue
def TaskQueue():
if hasattr(Queue, "task_done"):
return Queue()
return _TaskQueue()
class _TaskQu... |
#!/usr/bin/env python
# Evaluating Activity-Entity model
#
# By chenxm
#
import os
import sys
import groundtruth
from PyOmniMisc.model.aem import AEM
def print_usage():
print("Usage: python exHttp.py <omniperf_trace>")
cut_gap = 8 # sec
def modelAEM(etrs):
print("Modeling AEM ...")
# Modeling traffic wi... |
#!/usr/bin/env python
"""Test get_all_parents vs """
from __future__ import print_function
__copyright__ = "Copyright (C) 2010-2019, DV Klopfenstein, H Tang et al. All rights reserved."
import os
import sys
import timeit
from goatools.base import get_godag
from goatools.godag.go_tasks import get_id2lowerselect
from ... |
from functools import partial
from random import sample
from navmazing import NavigateToSibling, NavigateToAttribute
from cfme.common.provider import BaseProvider
from cfme.fixtures import pytest_selenium as sel
from cfme.web_ui import (
Quadicon, Form, AngularSelect, form_buttons, Input, toolbar as tb,
InfoB... |
#!/usr/bin/python3
from SettingsWidgets import SidePage
from xapp.GSettingsWidgets import *
class Module:
name = "workspaces"
category = "prefs"
comment = _("Manage workspace preferences")
def __init__(self, content_box):
keywords = _("workspace, osd, expo, monitor")
sidePage = SideP... |
'''
Quick and dirty base for console-based python utility apps.
Created on May 28, 2012
@author: John Vrbanac
'''
import re
class ConsoleInterface(object):
__registeredCommands = []
def add_command(self, name, callback):
cmd = Command()
cmd.command = name
cmd.callback = callback
... |
#
# bluetooth_config.py
#
# Copyright (C) 2016 - 2018 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPLv2
#
# Bluetooth setup screen
#
import os
import threading
from gi import require_version
require_version('Gtk', '3.0')
from gi.repository import Gtk, GObject
from kano.gtk3.scrolled_w... |
from datetime import datetime as dt
from nose.tools import raises, assert_equal
from pyparsing import ParseException
import os
import pytoml
TOMLS = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'tomlfiles')
def test_toml_files():
for filename in os.listdir(TOMLS):
abs = os.path.join(TOMLS, fil... |
import logging
import re
import os
import xmlrpclib
from DocXMLRPCServer import DocXMLRPCServer
from DocXMLRPCServer import DocXMLRPCRequestHandler
from mode import Mode
from helper import get_config
class Server(Mode):
def _initialise(self, args):
logging.debug('Starting server mode checks on config fil... |
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django import forms
from django.utils.transla... |
"""
BinomialQueue.py
Meldable priority queues
Written by Gregoire Dooms and Irit Katriel
"""
class LinkError(Exception): pass
class EmptyBinomialQueueError(Exception): pass
class BinomialTree:
"A single Binomial Tree"
def __init__(self, value):
"Create a one-node tree. value is the priority of thi... |
from zope.interface import implementer
from sqlalchemy import (
Column,
Unicode,
Integer,
ForeignKey,
)
from sqlalchemy.orm import relationship, backref
from sqlalchemy.ext.declarative import declared_attr
from clld import interfaces
from clld.db.meta import Base, CustomModelMixin
from clld.db.models.c... |
"""
Test cases for Dimension and Dimensioned object comparison.
"""
from holoviews.core import Dimension, Dimensioned
from holoviews.element.comparison import ComparisonTestCase
class DimensionsComparisonTestCase(ComparisonTestCase):
def setUp(self):
super(DimensionsComparisonTestCase, self).setUp()
... |
# -*- coding: utf-8 -*-
#
# goodtechgigs documentation build configuration file, created by
# sphinx-quickstart.
#
# 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 configuration values h... |
import webob
from prestans import exception
from prestans.http import STATUS
from prestans.parser import AttributeFilter
from prestans import serializer
from prestans.types import Array
from prestans.types import BinaryResponse
from prestans.types import DataCollection
from prestans.types import Model
class Response... |
import numpy as np
import scipy.linalg as scla
from ...utils import splogdet
from pysal.spreg.utils import spdot
def logp_rho_prec(state, val):
"""
This computes the logp of the spatial parameter using the precision, rather than the covariance. This results in fewer matrix operations in the case of a SE formul... |
"""
Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.
37107287533902102798797998220837590246510135740250
46376937677490009712648124896970078050417018260538
74324986199524741059474233309513058123726617309629
91942213363574161572522430563301811072406154908250
23067588207539346171171... |
import os
from binascii import hexlify
from django.db import models
def _createId():
return hexlify(os.urandom(8))
class Deck(models.Model):
hash = models.CharField(max_length=256, primary_key=True, default=_createId)
branch = models.ForeignKey('branch.Branch', on_delete=models.CASCADE)
version = mo... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 TUBITAK/BILGEM
# Renan Çakırerk <renan at pardus.org.tr>
#
# 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 ... |
# 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 ... |
#| This file is part of pyCAF. |
#| |
#| pyCAF is free software: you can redistribute it and/or modify |
#| it under the terms of the GNU General Public License as published by |
#| t... |
from setuptools import setup, find_packages
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f:
long_description=f.read()
setup(
name='pyEnFace',
version='0.9.6',
description='A python interface to the Enphase Develo... |
from datetime import datetime
from moulinette import db
# This file includes all the definitions for the homework model in the
# database. Any change here must then be applied to the database using the
# migrate.py file in the root folder of this project.
class Homework(db.Model):
"""
Class Homework repres... |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
#! /usr/bin/env python
###=============================================================
### Multifit 3
### Nicola Ferralis <feranick@hotmail.com>
### The entire code is covered by GNU Public License (GPL) v.3
###=============================================================
### Uncomment this if for headless servers.
... |
# -*- coding: utf-8 -*-
# code for console Encoding difference. Dont' mind on it
import sys
import imp
imp.reload(sys)
try:
sys.setdefaultencoding('UTF8')
except Exception as E:
pass
import testValue
from popbill import FaxService, PopbillException
faxService = FaxService(testValue.LinkID, testValue.SecretK... |
from __future__ import print_function, division
from plumbum import colors
from plumbum.cli.termsize import get_terminal_size
from plumbum import cli
import sys
class Image(object):
__slots__ = "size char_ratio".split()
def __init__(self, size=None, char_ratio=2.45):
self.size = size
self.ch... |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... |
#!/usr/bin/env python
"""
Example RIFF (WAV contents) Data Parser
Sample data is written to a CSV file for analysis.
If matplotlib and numpy are available, signal plots (DFTs) are generated.
"""
import math
import os
import struct
import wave
try:
import matplotlib.pyplot as plot
import numpy
import nu... |
#!/usr/bin/python
import MySQLdb #MySQL interfacing library
#Init connection to DB on Heroku server
connection = MySQLdb.connect(host="us-cdbr-east-04.cleardb.com",
user="b2699bab0d03bc",
passwd="92c968bb",
db="heroku_62b297a4786cfb1")
cursor = connection.cursor()
# Function: get_user
# Input: User object containing... |
from datetime import datetime
import logging
from rest_framework import status
from rest_framework.mixins import RetrieveModelMixin, ListModelMixin, DestroyModelMixin
from rest_framework.parsers import MultiPartParser
from rest_framework.relations import PrimaryKeyRelatedField
from rest_framework.renderers import JSON... |
from ant.core import event, message, node
from ant.core.constants import *
from constants import *
from config import NETKEY, VPOWER_DEBUG
# Receiver for Speed and/or Cadence ANT+ sensor
class SpeedCadenceSensorRx(event.EventCallback):
def __init__(self, antnode, sensor_type, sensor_id):
self.sensor_type... |
# -*- coding: utf-8 -*-
from django.test import TestCase
from django.contrib.gis.geos import Point
from .model_factories import LocalityF, DomainF
from ..models import LocalityArchive
class TestModelLocalityArchive(TestCase):
def test_LocalityArchive_fields(self):
self.assertListEqual(
[fld.... |
import numpy as np
from math import sqrt
from Activations import *
__author__ = 'ptoth'
class Loss(object):
@staticmethod
def delta(pred, target, loss_function="MSE"):
if loss_function == "MSE":
return pred - target
elif loss_function == "CROSS_ENTROPY":
return -1.0 *... |
#
# 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... |
import numpy as np
def lic_flow(vectors,len_pix=10):
vectors = np.asarray(vectors)
m,n,two = vectors.shape
if two!=2:
raise ValueError
result = np.zeros((2*len_pix+1,m,n,2),dtype=np.int32) # FIXME: int16?
center = len_pix
result[center,:,:,0] = np.arange(m)[:,np.newaxis]
result[ce... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2018 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum 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... |
import datetime
def format_published_at(episode):
if not episode.published_at:
return ""
elif episode.published_today():
format = "Published today %H:%M"
return episode.published_at.strftime(format)
elif episode.published_yesterday():
format = "Published yesterday %H:%M"
... |
# Copyright 2015 Cloudera 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 writing, so... |
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2014, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
#####################################... |
# -*- 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 ... |
# Configuration file for ipython-notebook.
c = get_config()
#------------------------------------------------------------------------------
# NotebookApp configuration
#------------------------------------------------------------------------------
# NotebookApp will inherit config from: BaseIPythonApplication, Appli... |
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
from django.utils.translation import ugettext_lazy as _
from authemail.forms import EmailUserCreationForm, EmailUserChangeForm
from authemail.models import SignupCode, PasswordResetCode, Emai... |
# coding: utf-8
import logging
# TODO Remove only for testing
import json
import io
from utils import get_percentage, format_percentage, sort_results_by_percentage
from config import JSON_EXAMPLE_PATH, SPECIAL_PARTIES, PASS_THRESHOLD
from config import Paso2015
log = logging.getLogger('paso.%s' % (__name__))
PERC_KEYS... |
# -*- coding: utf8 -*-
#
# Copyright (C) 2016 NDP Systèmes (<http://www.ndp-systemes.fr>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# Licen... |
# -*- coding: utf-8 -*-
"""Family module for Wikipedia."""
from __future__ import unicode_literals
from pywikibot import family
__version__ = '$Id: 3f958b3aee3b7b6794546f2ee7f13757d36b0a30 $'
# The Wikimedia family that is known as Wikipedia, the Free Encyclopedia
class Family(family.WikimediaFamily):
"""Fami... |
import memebotjones.base as base
import discord
import asyncio
import json
import pickle
from random import choice
# set up some needed globals
with open("config.json") as data:
config = json.load(data)
queue_list = []
skip_list = []
player = None
shutdown_flag = False
snark_list = [
"is not in the sudoers fi... |
from django.conf.urls import patterns, include, url
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import login_required
from . import views
from . import global_preferences_registry
from .forms import GlobalPreferenceForm
urlpatterns = patterns('',
ur... |
# !/usr/bin/python
# -*- coding: utf-8 -*-
#
# Created on Oct 16, 2015
# @author: Bo Zhao
# @email: bo_zhao@hks.harvard.edu
# @website: http://yenching.org
# @organization: Harvard Kennedy School
# libraries
import socket
import smtplib
from pymongo import MongoClient
from qqcrawler.settings import ... |
"""The sound effects section of a Pico-8 cart.
The sound effects region consists of 4352 bytes. The .p8
representation is 64 lines of 168 hexadecimal digits (84 bytes).
Each line represents one sound effect/music pattern. The values are as follows:
0 The editor mode: 0 for pitch mode, 1 for note entry mode.
1 ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 06 20:00:30 2016
@author: Jiansen
"""
import requests
import threading
import copy
import logging
import os
#import urllib3
import json
from scipy import stats
#from decimal import Decimal, getcontext, ROUND_HALF_DOWN
#from event00 import TickEvent,Tick... |
# !usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under a 3-clause BSD license.
#
# @Author: Brian Cherinka
# @Date: 2017-11-21 11:56:56
# @Last modified by: Brian Cherinka
# @Last Modified time: 2018-07-19 15:42:46
from __future__ import print_function, division, absolute_import
from docutils import node... |
#!C:\OSGEO4~1\bin\python.exe
# ******************************************************************************
# $Id: esri2wkt.py 7464f4b11b93bb2d1098d1b962907228932bf8c1 2018-05-03 19:56:49 +1000 Ben Elliston $
#
# Project: GDAL
# Purpose: Simple command line program for translating ESRI .prj files
# ... |
#!/usr/bin/python
import sys
import sys
from sympy import Symbol,symbols,sin,cos,Rational,expand,simplify,collect
from printer import enhance_print,Get_Program,Print_Function,Format
from mv import MV,Com,Nga,ONE,ZERO
def basic_multivector_operations():
Print_Function()
(ex,ey,ez) = MV.setup('e*x|y|z')
A ... |
#!/usr/bin/env python
import sys
import os
import re
import pygraphviz
import pysb.bng
def run(model):
pysb.bng.generate_equations(model)
graph = pygraphviz.AGraph(name="%s species" % model.name, rankdir="LR", fontname='Arial')
graph.edge_attr.update(fontname='Arial', fontsize=8)
for si, cp in enumera... |
# -*- coding: utf-8 -*-
"""
Produces simple Sankey Diagrams with matplotlib.
@author: Anneya Golob & marcomanz & pierre-sassoulas
.-.
.--.( ).--.
<-. .-.-.(.-> )_ .--.
`-`( )-' `) )
(o o ) `)`-'
( ... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
# 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
# distributed unde... |
# -*- coding: utf-8 -*-
"""
exceptions - Different Exceptions classes used in the project.
Copyright (C) 2012 Pierre-Yves Chibon
Author: Pierre-Yves Chibon <pingou@pingoured.fr>
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
t... |
import os
import json
import logging
# from pprint import pprint
from common import database, DATA_PATH
log = logging.getLogger('pa')
DATA_FILE = os.path.join(DATA_PATH, 'pa', 'pombola.json')
pa_parties = database['sa_pa_parties']
pa_committees = database['sa_pa_committees']
pa_persons = database['sa_pa_persons']
pa... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
# Imports =====================================================================
"""
AMQP binding for LTP exporter. See `edeposit.amqp.ltp
<https://github.com/edeposit/edeposit.amqp.ltp>`_ for details.
"""
import os
import sys
import os... |
# -*- coding: utf-8 -*-
"""Factories for the OSF models, including an abstract ModularOdmFactory.
Example usage: ::
>>> from tests.factories import UserFactory
>>> user1 = UserFactory()
>>> user1.username
fred0@example.com
>>> user2 = UserFactory()
fred1@example.com
Factory boy docs: http://f... |
"""
"""
import random
import simpy
from math import trunc
import numpy
from configuration import *
ARRIVAL_RATE = 1/ARRIVAL_RATE
ARRIVAL_RATE *= 8
MAX_RATE = max(ARRIVAL_RATE)
SERVICE_TIME_SUM = 0.0
TIME_IN_THE_SYSTEM_SUM = 0.0
SERVICE_TIME_COUNT = 0
latency = []
latency_peak = []
REQUIRED_VMS = []
def source(e... |
'''
Copyright (c) 2005-2011, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
WSO2 Inc. licenses this file to you 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.a... |
#!/usr/bin/env python
"""The in memory database methods for event handling."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import collections
from grr_response_core.lib import rdfvalue
from grr_response_core.lib import utils
class InMemoryDBEventMix... |
# This file is part of Fail2Ban.
#
# Fail2Ban 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.
#
# Fail2Ban is distributed in the hope t... |
from base64 import b64encode
from pwn import *
def s_array(*args):
assert len(args) % 2 == 0
return 'a:%d:{' % (len(args) // 2) + ''.join(args) + '}'
def s_bool(val):
return 'b:%d;' % val
def s_str(s):
return 's:%d:"%s";' % (len(s), s)
def s_ref(val):
return 'r:%d;' % val... |
from django.core.exceptions import ImproperlyConfigured
from django.utils.translation import ugettext_lazy, ugettext
import os
from ..downloading import DownloadServer, FsError
class WatchfolderDownloadServer(DownloadServer):
def __init__(self, dirpath, **kwargs):
if not os.path.isdir(dirpath):
... |
# -*- coding: utf-8 -*-
"""Stock Alert Test"""
from stock_alerter.stock import Stock
from datetime import datetime
import unittest
class StockTest(unittest.TestCase):
"""The Stock Test suite"""
def setUp(self):
"""This method is called before every test method below is executed"""
self.goog =... |
# -*- coding: utf8 -*-
from pprint import pprint
import linear_algebra as la
def gauss_jordan(A):
# 행렬의 크기
n_row = len(A)
n_column = len(A[0])
# 단위 행렬과의 Augmented Matrix 를 만듦
AI = []
for i_row in xrange(n_row):
AI_row = [0.0] * (n_column * 2)
for j_column in xrange(n_column):... |
# -*- coding: utf-8 -*-
import click
import sys
from IPython.terminal.interactiveshell import TerminalInteractiveShell
IMPORTS = [
'from cfme.utils import conf',
'from fixtures.pytest_store import store',
'from cfme.utils.appliance.implementations.ui import navigate_to',
'from cfme.utils import provid... |
from random import randint
import sys
import os
MAX_PWD_LEN = 30
def main():
defaultMaxIterations = 10000
defaultGeneratedResults = 50
inputEnable = False
outputEnable = True
customIterationNumber = False
try:
if len(sys.argv) > 1:
i = 1
... |
import os
from django.test import TestCase
from cyder.base.eav.models import Attribute
from cyder.base.utils import copy_tree, remove_dir_contents
from cyder.base.vcs import GitRepo, GitRepoManager, SanityCheckFailure
from cyder.core.ctnr.models import Ctnr
from cyder.core.system.models import System
from cyder.cydh... |
import json
def write_json_task(task):
database = {}
database['type'] = task.type
database['distance'] = task.distance
database['aat_min_time'] = task.aat_min_time
database['start_max_speed'] = task.start_max_speed
database['start_max_height'] = task.start_max_height
database['start_max_h... |
#!/usr/bin/env python
import simplejson
import json
import urllib
import time
import re
import nose
from nose.tools import assert_equals
import sys
import os
# This hack is to add current path when running script from command line
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import BaseP... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014 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... |
#!/usr/bin/env python -W ignore
# -*- coding: utf-8 -*-
"""
Control you Sonos system from you Mac Menu Bar
"""
# <bitbar.title>SonosBar</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Jonas Marcello</bitbar.author>
# <bitbar.author.github>anergictcell</bitbar.author.github>
# <bitbar.desc>Contr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.