src stringlengths 721 1.04M |
|---|
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Cctools(AutotoolsPackage):
"""The Cooperative Computing Tools (cctools) enable large scale... |
"""Helper module to handle time related stuff"""
from time import sleep as original_sleep
from datetime import datetime
from random import gauss
from random import uniform
# Amount of variance to be introduced
# i.e. random time will be in the range: TIME +/- STDEV %
STDEV = 0.5
sleep_percentage = 1
sleep_percentage =... |
#!/usr/bin/env python
### BEGIN LICENSE
# Copyright (C) 2010 Dave Eddy <dave@daveeddy.com>
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
#
# This program is distributed in the hope ... |
# -*- coding: utf-8 -*-
from importlib import import_module
from collections import defaultdict
from django.conf import settings as django_settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.translation import ugettext_lazy as _
__all__ = [
'city_types', 'district_types',
'impor... |
#
# Stoqdrivers template driver
#
# Copyright (C) 2007 Async Open Source <http://www.async.com.br>
# All rights reserved
#
# 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... |
from flask import Flask, url_for, render_template, request, \
redirect, abort, session, g, flash, Markup
import helpers
from abapi.helpers import *
from abapi import app
@app.route('/event', defaults={"whatever": ""})
@app.route('/event/<path:whatever>')
def event_listener(whatever):
app.logger.info(whatever)... |
"""
Copyright (c) 2016 Gianluca Gerard
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, distribute... |
#!/usr/bin/env python
# Copyright (C) 2017 Aberystwyth University
# 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 3 of the License, or
# (at your option) any later versi... |
__author__ = 'reggie'
import ujson as json
import networkx as nx
import time
import thread
import threading
import copy
import re
from networkx.readwrite import json_graph
from PmkShared import *
class ProcessGraph(object):
MAX_TTL = 60 #seconds
INT_TTL = 15 #seconds
def __init__(self, context):
... |
import abc
import collections
class AutoStorage:
__counter = 0
def __init__(self):
cls = self.__class__
prefix = cls.__name__
index = cls.__counter
self.storage_name = '_{}#{}'.format(prefix, index)
cls.__counter += 1
def __get__(self, instance, owne... |
from django_nose.tools import (
assert_equal,
assert_false,
assert_not_in,
assert_raises,
assert_true
)
from mock import Mock
from pontoon.base.models import Entity
from pontoon.base.tests import (
assert_attributes_equal,
TranslationFactory,
UserFactory,
)
from pontoon.base.utils impor... |
# Copyright 2014 Diamond Light Source Ltd.
#
# 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 t... |
#!/usr/bin/env python3
# Copyright (C) 2013-2014 Florian Festi
#
# 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 3 of the License, or
# (at your option) any later version.... |
"""High level command line interface to hitch."""
from subprocess import call, PIPE, STDOUT, CalledProcessError, Popen
from hitch.click import command, group, argument, option
from os import path, makedirs, listdir, kill, remove
from sys import stderr, exit, modules, argv
from functools import partial
from hitch import... |
# -*- coding: utf-8 -*-
#
# hsmmlearn documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 1 17:33:24 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... |
#!/usr/bin/python
## "isOff48V.py"
## Turn off 48V powersupply on IS (international station)
## can only be used on IS (international) LCU
##
## usage: ./isOff48V.py
##
## Author: Pieter Donker (ASTRON)
## Last change: May 2013
from isEcLib import *
import sys
import time
VERSION = '0.0.1' # version of this script ... |
#!/usr/bin/env python
from cogflect.GeneratorBase import GeneratorBase
from cogflect.common import generate_cppclass_common
from cogflect.util import sanitizeTypename, indent
import cog
_body = """
typedef %(name)s::type enum_type;
// TODO: iterate public/protected/private independently?
// TODO: iterate... |
import sys
# G is the gamma matrix
# par is the parent array
# n is the number of nodes
def writeGammaMatrix(gammaFile, G, par, n):
for i in range(n):
for j in range(n):
G[i][j] = 0
for i in range(n):
G[i][i] = 1
j = par[i]-1
while j > -1:
G[j][i] = 1
j = par[j]-1
for i in range(n):
for j in r... |
"""A plugin to test loading devices. It doesn't do anything."""
###############################################################################
#
# TODO: [ ]
#
###############################################################################
# standard library imports
import logging
from threading import Timer
# rela... |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""
Sends email via outgoing server specified in "Control Panel"
Allows easy adding of Attachments of "File" objects
"""
import webnotes
from webnotes import conf
from webno... |
# noinspection PyProtectedMember
from crawler_fetcher.new_story import _create_child_download_for_story
from .setup_test_stories import TestStories
class TestCreateChildDownloadForStoryContentDelay(TestStories):
def test_create_child_download_for_story_content_delay(self):
"""Test create_child_download_... |
# Copyright 2019-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos 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 versio... |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... |
# -*- coding: utf-8 -*-
import os
import hashlib
from passlib.apache import HtpasswdFile
from cydra.component import Component, implements
from cydra.permission import User
from cydra.permission.interfaces import IUserTranslator, IUserAuthenticator, IUserStore
from cydra.error import InsufficientConfiguration
import ... |
#--------------------------------------------------------------------------
# Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas
# Copyright: (C) 2001 Centro de Pesquisas Renato Archer
# Homepage: http://www.softwarepublico.gov.br
# Contact: invesalius@cti.gov.br
# License: GNU ... |
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
#
# 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, m... |
IDEONE_USERNAME = "ronreiter"
IDEONE_PASSWORD = "18132ce2b97e"
CACHE_HOST = "direct.learnpython.org"
DB_HOST = "direct.learnpython.org"
SECRET_KEY = "this is a secret. really."
LEARNPYTHON_DOMAIN = "learnpython.org"
LEARNJAVA_DOMAIN = "learnjavaonline.org"
LEARNC_DOMAIN = "learn-c.org"
LEARNCPP_DOMAIN = "learn-cpp.org... |
"""
:platform: Unix, Windows
:synopsis: Given a directory of numbered PDF files,
optionally split them into one-page PDFs while retaining the
numeric order, and crop white space on all sides of each PDF.
:requirements: pyPdf package and access to Ghostscript executable (for finding the bounding b... |
"""
This is script should bring existing installations in line with the state
in repository. It is supposed to be run after:
1. The migration_restart branch has been merged to master and deployed.
2. south_migrationhistory has been truncated.
3. The initial migrations for clients and services have been faked.
"... |
"""ACIL_GetImage is a module developed for the internal use of the Applied Chest Imaging Laboratory to download
cases stored in MAD server via ssh.
It works both in Unix/Mac/Windows, and it uses an internal SSH key created specifically for this purpose, so it
doesn't need that the user has an authorized SSH key install... |
#! /usr/bin/env python
# coding=utf-8
#
# Copyright © 2017 Gael Lederrey <gael.lederrey@epfl.ch>
#
# Distributed under terms of the MIT license.
#
# Based on the code of Ulf Astrom (http://www.happyponyland.net)
from camogen.vertex import *
import numpy as np
def distort():
"""
:return: random value between... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('recipies', '0001_initial'),
]
op... |
"""
========================================================
Hierarchical clustering (:mod:`scipy.cluster.hierarchy`)
========================================================
.. currentmodule:: scipy.cluster.hierarchy
These functions cut hierarchical clusterings into flat clusterings
or find the roots of the forest f... |
import unittest, random, sys, time
sys.path.extend(['.','..','py'])
import h2o, h2o_browse as h2b, h2o_exec as h2e, h2o_hosts, h2o_import as h2i
DO_UNIMPLEMENTED = False
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
glo... |
from __future__ import print_function, unicode_literals, absolute_import
import sys
import time
from FIPER.generic.interface import InterfaceFactory
from FIPER.generic.abstract import AbstractListener
from FIPER.generic.subsystem import StreamDisplayer
from FIPER.generic.probeclient import Probe
class DirectConnect... |
"""OpenAPI core contrib flask handlers module"""
from flask.globals import current_app
from flask.json import dumps
from openapi_core.templating.media_types.exceptions import MediaTypeNotFound
from openapi_core.templating.paths.exceptions import OperationNotFound
from openapi_core.templating.paths.exceptions import Pa... |
from troposphere import GetAtt, If, Join, Output, Ref
from troposphere import elasticloadbalancing as elb
from . import USE_ECS, USE_GOVCLOUD
from .security_groups import load_balancer_security_group
from .template import template
from .utils import ParameterWithDefaults as Parameter
from .vpc import public_subnet_a, ... |
#!/usr/bin/env ambari-python-wrap
"""
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... |
#
# The Python Imaging Library.
# $Id$
#
# XV Thumbnail file handler by Charles E. "Gene" Cash
# (gcash@magicnet.net)
#
# see xvcolor.c and xvbrowse.c in the sources to John Bradley's XV,
# available from ftp://ftp.cis.upenn.edu/pub/xv/
#
# history:
# 98-08-15 cec created (b/w only)
# 98-12-09 cec added color palette... |
# -*- coding: utf-8 -*-
#
# This file is a plugin for EventGhost.
# Copyright © 2005-2016 EventGhost Project <http://www.eventghost.net/>
#
# EventGhost 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 v... |
import datetime
from scheduler_failover_controller.utils import date_utils
class BaseMetadataService:
def initialize_metadata_source(self):
raise NotImplementedError
def get_failover_heartbeat(self):
raise NotImplementedError
def set_failover_heartbeat(self):
raise NotImplemente... |
# -*- coding: utf-8 -*-
#
# NOTE: 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 3, or (at your option) any later version.
#
# This program is distributed in the hope that it ... |
# Generated by YCM Generator at 2015-07-01 14:51:38.867126
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publis... |
import json
from django import test
from django.core.cache import cache
from django.test.utils import override_settings
import mock
import waffle
from jingo.helpers import datetime as datetime_filter
from nose.tools import eq_
from pyquery import PyQuery as pq
from tower import strip_whitespace
import amo
import amo... |
# encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of maker.
# License www.tree.io/license
from django.db import models
from django.contrib.auth.models import User
from maker.core.conf import settings
KEY_SIZE = 18
SECRET_SIZE = 32
CONSUMER_DB = getattr(settings, 'MAKER_API_CONSUMER_DB', 'default... |
import importlib
import os
from pyplanet.conf.backends.base import ConfigBackend
from pyplanet.core.exceptions import ImproperlyConfigured
class PythonConfigBackend(ConfigBackend):
name = 'python'
def __init__(self, **options):
super().__init__(**options)
self.module = None
def load(self):
# Make sure we... |
import socket
import json
import struct
import sys
import time
def build_login_cmd():
cmd_dict = {}
cmd_dict["userID"] = sys.argv[1]
cmd_dict["cmd"] = "login"
return json.dumps( cmd_dict )
def send_cmd( sock , cmd ):
cmd_len = len( cmd )
send_str = struct.pack( 'i' , cmd_len )
sock.send( send_str... |
import logging
import testUtils as utils
import time
import threading
from conftest import IPADDRESS1, \
RESOURCE, \
DUMMYVAL,\
OSCORECLIENTCONTEXT
from coap import coapDefines as d, \
coapOption as o, \
... |
from __future__ import absolute_import
# #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://etetoolkit.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the terms of the GNU Gener... |
from typing import List, Dict
from typeguard import check_argument_types
import numpy as np
from neuralmonkey.evaluators.evaluator import Evaluator
# pylint: disable=invalid-name
NGramDicts = List[Dict[str, int]]
# pylint: enable=invalid-name
class ChrFEvaluator(Evaluator[List[str]]):
"""Compute ChrF score.
... |
#!/usr/bin/env python
# -*- coding: ISO-8859-15 -*-
#
# Copyright (C) 2005-2007 David Guerizec <david@guerizec.net>
#
# Last modified: 2007 Dec 08, 20:10:26 by david
#
# 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... |
# Created By: Virgil Dupras
# Created On: 2006/02/21
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses... |
import numpy as np
from hypothesis import given
from crowddynamics.core.motion.adjusting import force_adjust, torque_adjust
from crowddynamics.core.motion.contact import force_contact
from crowddynamics.core.motion.fluctuation import force_fluctuation, \
torque_fluctuation
from crowddynamics.core.motion.helbing im... |
"""Templatetags for the ``document_library`` app."""
from django import template
from ..models import Document
register = template.Library()
@register.assignment_tag
def get_files_for_document(document):
"""
Returns the available files for all languages.
In case the file is already present in another ... |
import os
def status():
print "----RESULT-----------"
os.system("ls -1>progress/file.tmp")
for wgetlog in open("progress/file.tmp").read().splitlines():
if "wget-log" in wgetlog:
percentage="0%"
for line in open(wgetlog).read().splitlines():
if "K ." in line o... |
# Authors: Mainak Jas <mainak.jas@telecom-paristech.fr>
#
# License: BSD (3-clause)
from functools import partial
from ...utils import verbose
from ..utils import (has_dataset, _data_path, _get_version, _version_doc,
_data_path_doc)
has_brainstorm_data = partial(has_dataset, name='brainstorm')
... |
# Copyright 2008-2015 Nokia Solutions and Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
import calendar
import os
from datetime import date, datetime, timedelta
from django.utils import formats, timezone
from django.conf import settings
from django.utils.dateparse import parse_datetime
from django.core.urlresolvers import reverse
from django.utils.formats import get_format
from django.utils.translation im... |
#! /usr/bin/env python3
# readCensusExcel.py - Tabulates population and number of census tracts for
# each county.
import openpyxl, pprint
print('Opening workbook...')
wb = openpyxl.load_workbook('/Users/brisance/Downloads/automate_online-materials/censuspopdata.xlsx')
sheet = wb.get_sheet_by_name('Population by Censu... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from contextlib import contextmanager
import os
import re
import sys
import tempfile
# see http://en.wikipedia.org/wiki/ANSI_escape_code for more ANSI escape codes
class textColors( object ):
grey = '37m'
white = '97m'
cyan = '36m'
lightcy... |
# -*- coding: utf-8 -*-
# YAFF is yet another force-field code.
# Copyright (C) 2011 Toon Verstraelen <Toon.Verstraelen@UGent.be>,
# Louis Vanduyfhuys <Louis.Vanduyfhuys@UGent.be>, Center for Molecular Modeling
# (CMM), Ghent University, Ghent, Belgium; all rights reserved unless otherwise
# stated.
#
# This file is pa... |
#!/usr/bin/env python3
# -*-coding:Utf-8 -*
"""H-AGN LightCone photometric Catalog.
Load catalog and make a match with the true lightcone catalog.
"""
import numpy as np
import matplotlib.pyplot as plt
import pyfits
# from scipy.spatial import cKDTree
# from timeit import default_timer as timer
import numpy.lib.rec... |
from urllib import request
from urllib.error import URLError, HTTPError
import json
from ..webclipboardbase import WebClipBoardBase, WebClipBoardWidNotFound
from .. import hpasteoptions as opt
class HasteBin(WebClipBoardBase):
def __init__(self):
self.__headers = {'Accept': 'text/html,application/xhtml+xml,applic... |
#!/usr/bin/env python
# =============================================================================
# Filename: sortMatrix.py
# Version: 1.0
# Author: Kai Yu - finno@live.cn
# https://github.com/readline
# Last modified: 2015-05-22 15:01
# Description:
# This script can sort a matrix either by row or by column, e... |
import logging
from nyuki.bus.persistence.events import EventStatus
from nyuki.bus.persistence.backend import PersistenceBackend
log = logging.getLogger(__name__)
class FIFOSizedQueue(object):
def __init__(self, size):
self._list = list()
self._size = size
def __len__(self):
retur... |
# This file is part of csvpandas
#
# csvpandas 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.
#
# csvpandas is distribu... |
#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jon Surrell
# Copyright (c) 2013 Jon Surrell
#
# License: MIT
#
"""This module exports the Stack Ghc plugin class."""
from SublimeLinter.lint import Linter, util
from os.path import basename
class StackGhc(Linter)... |
# -*- coding:utf-8 -*-
"""
/***************************************************************************
CopyLayersAndGroupsToClipboard
A QGIS plugin
Copy selected layers and groups from Layers Panel to clipboard, so that they can be pasted in other QGIS instances.
... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 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
#
#... |
#!/usr/bin/env python
import rospy
from autobot.msg import drive_param
from autobot.msg import pid_input
from std_msgs.msg import String
import math
kp = 14.0 * 3
kd = 0.09 * 10 ## handling how fast
servo_offset = 18.5
prev_error = 0.0
vel_input = 0.0
mode = 'wall'
motorPub = rospy.Publisher('drive_parameters', dr... |
# -*- coding: utf8 -*-
"""Quickreport - param_defaults.py
Funzioni per bounds default "dinamici" da assegnare ai parametri.
Le funzioni definite in questo modulo restituiscono valori di default, bounds o
entrambi per i parametri dei report, e possono essere usate in aggiunta a
quelle "standard" messe a disposizion... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('provider', '0009_auto_20160623_1600'),
]
operations = [
migrations.RemoveField(
model_name='organization',
... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 NEC 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.or... |
# (c) 2008-2011 James Tauber and contributors; written for Pinax (http://pinaxproject.com)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
import os
import sys
import bootmachine
BOOTMACHINE_COMMAND_DIR = os.path.join(
os.path.dirname(bootmachine.__file__), "management", "com... |
from __future__ import print_function
from __future__ import unicode_literals
import sys
import pytest
import plumbum as pb
from pb_job_manager import PBJobManager
PY2 = sys.version_info[0] == 2
if PY2:
iteritems = lambda d: d.iteritems()
else:
iteritems = lambda d: iter(d.items())
@pytest.fixture
def ma... |
#!/usr/bin/env python3.6
from isc.client import Client
from threading import Thread, Event
from time import time
from random import random
import logging
ITERATIONS = 1
CONN_POOL_SIZE = 1
COUNT = 1000
class Process(Thread):
def __init__(self, client):
super(Process, self).__init__()
self.procee... |
#!/usr/bin/python2.7
# Copyright 2011 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 requi... |
import argparse
from awsauthhelper import AWSArgumentParser
from awsautodiscoverytemplater.command import TemplateCommand
__author__ = 'drews'
def parse_cli_args_into():
"""
Creates the cli argparser for application specifics and AWS credentials.
:return: A dict of values from the cli arguments
:rtyp... |
["LuxR-lux-AHL",["lux-AHL 3OC6HSL","LuxR-lux-AHL"],[("k_{Rlux}",0.1),("d",0.0231)],"{{k_{Rlux}}}*lux-AHL 3OC6HSL-{{k_{Rlux}}}*LuxR-lux-AHL-{{d}}*LuxR-lux-AHL"]
#all
["LuxR-lux-AHL",["LuxR-lux-AHL"],[("k_{Rlux}",0.1),("d",0.0231)],"-{{k_{Rlux}}}*LuxR-lux-AHL-{{d}}*LuxR-lux-AHL"]
#no lux-AHL 3OC6HSL
["LuxR-lux-AHL",[... |
# -*- coding: utf-8 -*-
#
# Django Mail Templated documentation build configuration file, created by
# sphinx-quickstart on Wed Feb 17 21:51:15 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerat... |
#encoding:utf-8
""" io related
"""
import numpy as np
from _config import *
import warnings
warnings.formatwarning = warning_on_one_line
# use_scientificio is set in config
#use_scientificio = False
# fallback is always scipy.io: least dependencies
# cdf_lib set in _config.py and determines which library to use
... |
import os
from boxbranding import getMachineBrand, getMachineName
import xml.etree.cElementTree
from time import ctime, time
from bisect import insort
from enigma import eActionMap, quitMainloop
from Components.config import config
from Components.Harddisk import internalHDDNotSleeping
from Components.TimerSanityChec... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import importlib
import pkgutil
from collections import defaultdict
import pytest
from multiprocessing import Queue, Process
from six import PY2
def import_submodules(... |
# -*- coding: utf-8 -*-
"""
For details, see
`Section 3.1 <https://www.arpm.co/lab/redirect.php?permalink=setting-flexible-probabilities>`_.
"""
from collections import namedtuple
import numpy as np
class FlexibleProbabilities(object):
"""Flexible Probabilities
"""
def __init__(self, data):
self.x... |
import json
import re
from utilities import tweetTextCleaner
regex_str = [
r'<[^>]+>', # HTML tags
r'(?:@[\w_]+)', # @-mentions
r"(?:\#+[\w_]+[\w\'_\-]*[\w_]+)", # hash-tags
r'http[s]?://(?:[a-z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-f][0-9a-f]))+', # URLs
r'(?:(?:\d+,?)+(?:\.?\d+)?)', # numbe... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals
import gpg
import hkp4py
import os.path
import sys
del absolute_import, division, unicode_literals
# Copyright (C) 2018 Ben McGinnes <ben@gnupg.org>
#
# This program is free software; you can redistribu... |
import os
class Config(object):
"""
The shared configuration settings for the flask app.
"""
# Service settings
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__)))
SERVICE_ONTOLOGY = PROJECT_ROOT + '/sris/config/ontology.json'
# Database settings
CLIENT_NAME = 'cli... |
#!/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 numpy as np
import heapq
class Graph:
def __init__(self,vertices=None):
if vertices is None:
self.vertices = {}
else:
# Need to check data-structure
self.vertices = vertices
def addvertex(self,name,edges):
self.vertices[name] = edges
def ... |
# Copyright 2014 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.org/licenses/LICENSE-2.0
#
# Unless requir... |
# !/usr/bin/env python
# Usage python range_2_ip.py 1.1.1.1/24
# returns all the ip addresses in the range including those provide
# only works from /32 to /10 to avoid overrun
# coverts and print the ip addresses with the CIRD
import sys
ip_start = sys.argv[1]
print ip_start
ip_start_string = str(ip_start) # ... |
#exercício 1
import random
vetor = []
contador = 0
num_maior = 0
num_menor = 100
while contador <= 9:
#biblioteca para gerar números aleatórios
c = random.randint(0,100)
#adicionando valor a lista 'vetor'
vetor.append(c)
c = vetor [contador]
contador = contador + 1
if c >= num_maior:
num_maior = c
if c <= num... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 Brocade Communications System, 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
#
# ... |
# ===============================================================================
# Copyright 2014 Jake Ross
#
# 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/licens... |
# -*- coding: utf-8 -*-
import openerp
from openerp import models, fields, api, SUPERUSER_ID, exceptions
from openerp.addons.saas_utils import connector, database
from openerp import http
from openerp.tools import config, scan_languages
from openerp.tools.translate import _
from openerp.addons.base.res.res_partner impo... |
from django.utils.functional import curry
from django.conf import settings
from django.core.exceptions import MiddlewareNotUsed
from saas.multidb.signals import db_route_read, db_route_write
from saas.multidb.models import Database
class ModelRoutingMiddleware(object):
@classmethod
def request_router_info(cl... |
#!/usr/bin/python
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
import sys
import re
"""Baby Names exercise
Define the extract_names() function below and 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 agreed to in writing, software
# ... |
"""Helper object to identify configuration parameters so we can easily overwrite
them via command line magic or via the steering file
To add additional arguments create either a member variable or a property to a
subclass of the ConfigHelper. To add additional arguments to the add_argument
call for the parser object c... |
import os
from progressbar import *
from modules.androguard import *
from modules.androguard.core.analysis import *
from modules.androlyze import *
########################################################################
# Android API Calls related functions #
########################... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.