text
stringlengths
475
200k
import datetime import time from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect from django.utils.timezone import utc from django.views.decorators.http import require_POST from . import tasks from .models import Instance, Session from .sseview import SseView, send_e...
#!/usr/bin/env python # -*- coding: utf-8 -*- # The MIT License (MIT) # Copyright (c) 2017 Juan Cabral # 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 withou...
#!/usr/bin/env python import rospy import json from os.path import join from rospkg import RosPack from nips2016.controller import Perception, Learning, Torso, Ergo from trajectory_msgs.msg import JointTrajectory from std_msgs.msg import UInt32 class Controller(object): def __init__(self): self.rospack = ...
#!/usr/bin/env python import os from setuptools import setup, find_packages BASE = os.path.dirname(__file__) README_PATH = os.path.join(BASE, 'README.rst') CHANGES_PATH = os.path.join(BASE, 'CHANGES.rst') long_description = '\n\n'.join(( open(README_PATH).read(), open(CHANGES_PATH).read(), )) setup( nam...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENS...
# # 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 # distr...
from django.contrib.auth.models import User from django.db import models from django.template.defaultfilters import slugify from utils.models import BaseModel, BaseModelManager import hashlib class UserProfileAlreadyExistsException(Exception): pass class UserProfileManager(BaseModelManager): def create_userpr...
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ ...
import sys import time import glob import atexit import threading from serial import Serial IDLE = 0 CLUSTER_ACTIVE = 1 CLUSTER_LOADING = 2 FLOCK_ACTIVE = 3 FLOCK_LOADING = 4 FOLLOW_ACTIVE = 5 FOLLOW_LOADING = 6 MODE_IDLE = 0 MODE_FOLLOW = 1 MODE_FLOCK = 2 MODE_CLUSTER = 3 class RoneRobot: """Class for maintaining...
#!/usr/bin/env python2 # Copyright (c) 2007-2014 Heikki Hokkanen <[EMAIL]> & others (see doc/AUTHOR) # GPLv2 / GPLv3 import datetime import getopt import glob import os import pickle import platform import re import shutil import subprocess import sys import time import zlib if sys.version_info < (2, 6): print >> ...
#!/usr/bin/python # coding=utf-8 ########################################################################## from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch try: from cStringIO import StringIO except ImportError: fr...
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2007, 2008, 2009, 2010, 2011, 2014 CERN. ## ## Invenio 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 ## ...
#!/usr/bin/env python #-*- coding: utf-8 -*- import MySQLdb as mysql from sys import exit class Test(object): def __init__(self): pass def conexao(self): connect = None try: connect = mysql.connect('localhost','root','sicol','sicol',3306)#,use_unicode=True,ch...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Unit tests for rewrite.py regex routing option""" import sys import os import unittest import tempfile import logging if os.path.isdir('gluon'): sys.path.append(os.path.realpath('gluon')) # running from web2py base else: sys.path.append(os.path.realpath('../'...
import numpy as np import cv2 from tabtranslator.transform import ordered, order_points, distance, \ get_target_rectangle_size, resize, \ detect_englobing_polygon, POINTS_ORDER import pkg_resources as pkg def test_order_points(): assert list(P...
import re import sys from lawfactory_utils.urls import download, enable_requests_cache from .common import strip_text # TODO: # - count articles # - count alineas re_br = re.compile(r"[\s\n\r]*</?br[^>]*>[\s\n\r]*", re.S) clean_br = lambda x: re_br.sub("\n", x) re_fioritures = re.compile(r"(<div[^>]*>[\s\n]*</div>|...
from conans import ConanFile, ConfigureEnvironment from conans.tools import download, unzip, untargz import os class BisonConan(ConanFile): name = "bison" version = "3.0.4" url = "https://github.com/lucteo/conan-bison.git" license = "GNU General Public License: https://www.gnu.org/licenses/gpl.html" ...
from waflib.Options import OptionsContext import optparse class Feature(object): def __init__(self, group, feature): self.group = group self.identifier, self.attributes = feature['name'], feature def add_options(self): [self.add_option(option_rule) for option_rule in self.option_rules(...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Generated by Django 1.11.6 on 2017-12-05 01:08 import django.db.models.deletion from django.db import migrations, models from django.db.backends.postgresql.schema import DatabaseSchemaEditor from django.db.migrations.state import StateApps def set_realm_for_existing_scheduledemails( apps: StateApps, schema_edi...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import unittest PERF_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) from telemetry.unittest_util import system_stub class Cl...
from flask import jsonify, request, g, url_for, current_app from .. import db from ..models import Post, Permission, Comment from . import api from .decorators import permission_required @api.route('/comments/') def get_comments(): page = request.args.get('page', 1, type=int) pagination = Comment.query.order_...
#!/usr/bin/env python #------------------------------------------------------------------------------- # # Extract index file header from the SAFE header. # # Author: Martin Paces <[EMAIL]> # #------------------------------------------------------------------------------- # Copyright (C) 2016 EOX IT Services GmbH # # P...
# -*- coding: utf-8 -*- # # Copyright (c) 2010, Monash e-Research Centre # (Monash University, Australia) # Copyright (c) 2010, VeRSI Consortium # (Victorian eResearch Strategic Initiative, Australia) # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are per...
# Copyright (c) 2010-2014 openpyxl # # 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, distr...
import os import csv import sys import re import importlib # settings curDir = 'E:/Copy/Coursera/Bioinformatics Algorithms (part-I)/MyPrograms/week8' #curDir = 'D:/Copy/Coursera/Bioinformatics Algorithms (part-I)/MyPrograms/week8' inputFile = './data/1.greedy_sorting-2.txt' inputFile = 'C:/Users/Ashis/Downloads/datase...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
from chainer import backend import chainer.functions from chainer import variable def gumbel_softmax(log_pi, tau=0.1, axis=1): """Gumbel-Softmax sampling function. This function draws samples :math:`y_i` from Gumbel-Softmax distribution, .. math:: y_i = {\\exp((g_i + \\log\\pi_i)/\\tau) ...
# coding=utf-8 import numpy import unittest # Import InaSAFE modules from safe.gis.interpolation2d import interpolate2d, interpolate_raster from safe.gis.interpolation import BoundsError from safe.gis.interpolation1d import interpolate1d from safe.test.utilities import combine_coordinates from safe.gis.numerics import...
############################################################################## # # # Correct read depths for GC-content using a LOWESS function. # # Copyright(C) 2013 TU Delft & VU University Medical Center Amsterdam # # ...
# 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 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # PCR-GLOBWB (PCRaster Global Water Balance) Global Hydrological Model # # Copyright (C) 2016, Ludovicus P. H. (Rens) van Beek, Edwin H. Sutanudjaja, Yoshihide Wada, # Joyce H. C. Bosmans, Niels Drost, Inge E. M. de Graaf, Kor de Jong, Patricia Lopez Lopez, # Stefanie Pes...
#!/usr/bin/env python # -*- coding: utf-8 -*- import random from pprint import pprint from .machine import EIPMachine from .manager import EIPManager def debug(): """ This shows us some details about the internals of the xworkflows object. """ em = EIPMachine() print dir(em) print prin...
# -*- Mode: Python; py-indent-offset: 4 -*- import os, sys import scmexpr from definitions import BoxedDef, EnumDef, FlagsDef, FunctionDef, \ InterfaceDef, MethodDef, ObjectDef, MiniObjectDef, PointerDef, \ VirtualDef class IncludeParser(scmexpr.Parser): """A simple parser that follows include statements...
#! /usr/bin/env python import logging import serial import time from subprocess import Popen, PIPE # Arduino serial port SERIAL_PORT = "/dev/ttyACM{}" # XBMC settings PROC_NAME = "/usr/local/bin/xbmc" INIT_SCRIPT_NAME = "/etc/init.d/xbmc" # Logging LOG_FILE = "/var/log/mafro/XbmcSwitch/{}.log" LOG_LEVEL = logging....
"""A basic script to store points from a cb2 robot Basic Usage: Run the script, with commandline args. Press `c` to capture a point. Press `s` to save and exit.""" # The MIT License (MIT) # # Copyright (c) 2016 GTRC. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software ...
""" Copyright (c) 2011 Stamen Design 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, distrib...
""" """ from preset import * n_stim = 3 stim_pars = dict( n_stim=n_stim, elements= np.arange(0, n_stim, 1), grammar= None, full_set_length=int(11), transient_set_length=int(1), train_set_length=int(8), test_set_length=int(2)) # Input Parameters inp_resolution = .1 inp_amplitude = 1500. ...
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
# Copyright 2014 Big Switch Networks, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
# python3 import sys def getIND(char): if char == 'A': return 1 elif char == 'C': return 2 elif char == 'G': return 3 elif char == 'T': return 4 else: return 0 def SortCharacters(S): Slen = len(S) order = [-1] * Slen count = [0] * 5 for i in range(0, Slen): count[getIND(S[i]...
"""empty message Revision ID: e80b59063fe8 Revises: f3bebc2450c4 Create Date: 2017-10-12 20:29:23.553157 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'e80b59063fe8' down_revision = 'f3bebc2450c4' branch_labels = None depends_on = None def upgrade(): # ...
"""Support for Genius Hub climate devices.""" from typing import List, Optional from homeassistant.components.climate import ClimateDevice from homeassistant.components.climate.const import ( CURRENT_HVAC_HEAT, CURRENT_HVAC_IDLE, CURRENT_HVAC_OFF, HVAC_MODE_HEAT, HVAC_MODE_OFF, PRESET_ACTIVITY,...
from rest_framework import serializers from olympia import amo from olympia.addons.models import ( Addon, AddonFeatureCompatibility, attach_tags, Persona, Preview) from olympia.amo.helpers import absolutify from olympia.amo.urlresolvers import reverse from olympia.api.fields import ReverseChoiceField, TranslationS...
# # Author: Travis Oliphant, 2002 # from __future__ import division, print_function, absolute_import import warnings import numpy as np from scipy._lib.six import xrange from numpy import (pi, asarray, floor, isscalar, iscomplex, real, imag, sqrt, where, mgrid, sin, place, issubdtype, extract, ...
########################################################################## # # Copyright (c) 2016, John Haddon. 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 so...
import unittest from twelve_days import sing, verse, verses class TwelveDaysTests(unittest.TestCase): def test_verse1(self): expected = ("On the first day of Christmas my true love gave to me, " "a Partridge in a Pear Tree.\n") self.assertEqual(verse(1), expected) def tes...
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Cisco Systems, Inc. # Copyright 2012 NEC Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use...
# -*- coding: utf-8 -*- # ##### BEGIN GPL LICENSE BLOCK ##### # # 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. # # ...
#!/usr/bin/env python import sys import os import time import simplejson as json while True: print 'Reading snapshot information...' ssp = os.popen('shell/snapshot.sh', 'r') ssbl = json.loads(ssp.read()) ssp.close() sn_time = None sn_hash = None for sn_info in ssbl['snapshot...
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015-2017 Canonical Ltd # # 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 ...
#!/usr/bin/python # Copyright (c) 2013, Intel Corporation # Author: Andi Kleen # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This program is distributed in the...
from __future__ import division, absolute_import, print_function import numpy as np from numpy.compat import long from numpy.testing import ( assert_, assert_equal, assert_array_equal, assert_raises ) from numpy.lib.type_check import ( common_type, mintypecode, isreal, iscomplex, isposinf, isneginf, na...
# ################################################### # Copyright (C) 2008-2017 The Unknown Horizons Team # [EMAIL] # This file is part of Unknown Horizons. # Unknown Horizons 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 Softw...
# -*- coding: utf-8 -*- # Dioptas - GUI program for fast processing of 2D X-ray diffraction data # Principal author: Clemens Prescher ([EMAIL]) # Copyright (C) 2014-2019 GSECARS, University of Chicago, USA # Copyright (C) 2015-2018 Institute for Geology and Mineralogy, University of Cologne, Germany # Copyright (C) 201...
# (C) British Crown Copyright 2014 - 2017, Met Office # # This file is part of Iris. # # Iris 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 # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
# Copyright 2016 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 or agreed to in writing, ...
from __future__ import print_function from .base import TestBase from ..core import MemoryBuffer from ..core import PassRegistry from ..core import Context from ..core import Module from ..core import Enums from ..core import OpCode from ..bit_reader import parse_bitcode class TestCore(TestBase): def test_enumera...
from __future__ import absolute_import import responses from exam import fixture from django.contrib.auth.models import AnonymousUser from django.core.urlresolvers import reverse from django.test import RequestFactory from sentry.testutils import TestCase from sentry.utils import json from sentry_plugins.jira.plugin...
#!/usr/bin/env python import os import sys from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord import argparse import logging logging.basicConfig(level=logging.INFO) if __name__ == "__main__": parser = argparse.ArgumentParser(description="Identify shine-dalgarno sequences") parse...
# # Copyright 2012 Filippi Marco <[EMAIL]> # # 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. # # This program is distrib...
''' New Integration Test for Ceph Pool Capacity. @author: Legion ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_state as test_state import time test_stub = test_lib.lib_get_test_stub() test_obj_dict = test_state.TestStateDict() pool_cap = ...
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-10-26 08:03 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0008_localconfig'), ] operations = [ migrations.AlterField( ...
import os.path import time from django.core.management.base import BaseCommand from django.conf import settings import edxmako from django.core.mail import send_mass_mail import sys import datetime def chunks(l, n): """ Yield successive n-sized chunks from l. """ for i in xrange(0, len(l), n): ...
import json from datetime import timedelta, datetime import logging from tornado import escape, web, gen from bson import json_util, objectid from lib.blinx.core.router.routestar import AddRoute from lib.blinx.core.handlers import BaseHandler app_log = logging.getLogger("tornado.application") @AddRoute(r'/v1/topi...
# Copyright 2021 The Magenta Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
from . import models, signals from django.http import HttpResponse from django.shortcuts import get_object_or_404 from django.views.decorators.csrf import csrf_exempt import json @csrf_exempt def process_finished(request, profile_name, token, *args, **kwargs): """ View for when a process is finished. When a pr...
# (c) 2012-2014, Michael DeHaan <[EMAIL]> # # This file is part of Ansible # # Ansible 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. ...
# 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 under t...
# This file is part of EventGhost. # Copyright (C) 2009 Lars-Peter Voss <[EMAIL]> # # 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 version 2 of the License, or # (at your option) any...
### BEGIN GPL LICENSE BLOCK ##### # # 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...
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, [EMAIL], All rights reserved. # LLNL-CODE-647188 # # F...
# regress/neubot/database/table_speedtest_gen.py # # Copyright (c) 2010-2011 Simone Basso <[EMAIL]>, # NEXA Center for Internet & Society at Politecnico di Torino # Copyright (c) 2011 Roberto D'Auria <[EMAIL]> # # This file is part of Neubot <http://www.neubot.org/>. # # Neubot is free software: you can redistribute ...
# Copyright (c) 2012 Rackspace Hosting # 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 req...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
import numpy as NP """ A module which implements the continuous wavelet transform Wavelet classes: Morlet MorletReal MexicanHat Paul2 : Paul order 2 Paul4 : Paul order 4 DOG1 : 1st Derivative Of Gaussian DOG4 : 4th Derivative Of Gaussian Haar : Unnormalised version of continuous Haar trans...
"""Helpers that help with state related things.""" import asyncio from collections import defaultdict import datetime as dt import logging from types import ModuleType, TracebackType from typing import Dict, Iterable, List, Optional, Type, Union from homeassistant.components.sun import STATE_ABOVE_HORIZON, STATE_BELOW...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections import page_sets import re from measurements import timeline_controller from metrics import speedindex from telemetry import benchmark fr...
from __future__ import absolute_import import os import re import numpy as np from itertools import chain def load_task(data_dir, task_id): '''Load readworks tasks Returns a tuple containing the training and testing data for the task. ''' assert task_id in [1,2] #task_id= 1 #data_dir = './da...
# -*- coding: utf-8 -*- # Stalker Pyramid a Web Base Production Asset Management System # Copyright (C) 2009-2014 Erkan Ozgur Yilmaz # # This file is part of Stalker Pyramid. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as publi...
def unique(inlist, keepstr=True): typ = type(inlist) if not typ == list: inlist = list(inlist) i = 0 while i < len(inlist): try: del inlist[inlist.index(inlist[i], i + 1)] except: i += 1 if not typ in (str, unicode): inlist = typ(inlist) else: if keepstr: inlist = ''.jo...
# # Module providing the `SyncManager` class for dealing # with shared objects # # multiprocessing/managers.py # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are m...
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
#!/usr/bin/env python import os from setuptools import setup, find_packages from version import get_git_version VERSION, SOURCE_LABEL = get_git_version() PROJECT = 'dossier.web' AUTHOR = 'Diffeo, Inc.' AUTHOR_EMAIL = '[EMAIL]' URL = 'http://github.com/dossier/dossier.web' DESC = 'DossierStack web services' def rea...
import datetime import hashlib import json import urllib import time import collections from django import http from django.conf import settings from django.contrib.sites.models import RequestSite from django.shortcuts import get_object_or_404, redirect, render from django.core.cache import cache from django.contrib.a...
#!/usr/bin/env python # -*- coding: utf-8 -*- from ebstall.sysctlparser import SysctlConfig import unittest __author__ = 'dusanklinec' test1 = """net.ipv4.ip_forward = 1 # Controls the maximum size of a message, in bytes kernel.msgmax = 65536 # hello-comment test #kernel.msgmax = 65536""" class SysctlParserTest(...
# Copyright 2015 Tesora Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
# -*- coding: utf-8 -*- #************************************************************************* # Copyright (C) 2010 by Bruno Chareyre * # bruno.chareyre_at_grenoble-inp.fr * # ...
#!/usr/bin/env python #Runtime (690,130,128,128): ? import cPickle as pickle import h5py import os, sys, gc import networkx full_output=False def full_output(cloud_times, cloud_graphs, merges, splits, MC): cloud_times = tuple(cloud_times) pickle.dump(cloud_times, open('pkl/cloud_times.pkl','wb')) n = 0...
from settings import * import json DEBUG = False TEMPLATE_DEBUG = DEBUG with open('/home/dotcloud/environment.json') as f: env = json.load(f) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'django_userena', 'USER': env['DOTCLO...
#!/usr/bin/python # Copyright 2012 liquid_amber # # This file is part of PicasaDB. # # PicasaDB 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...
#-*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib.auth import models as auth_models from django.core import urlresolvers from django.core.exceptions import ValidationError from django.db import models from django.db.models import Q from django.utils.http import urlquote from django.uti...
from ..broker import Broker class NeighborBroker(Broker): controller = "neighbors" def show(self, **kwargs): """Shows the details for the specified neighbor. **Inputs** | ``api version min:`` None | ``api version max:`` None | ``required:`` True ...
# Copyright (c) 2015 Mirantis, 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...
# coding: utf-8 # # Reddit Part One: Getting Data # # You're going to scrape the front page of https://www.reddit.com! Reddit is a magic land made of many many semi-independent kingdoms, called subreddits. We need to find out which are the most powerful. # # You are going to scrape the front page of reddit every 4 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2007 Christopher Lenz # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. """Implementation of a view server for functions written in Python.""" import os i...
# Copyright (c) 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
# # Licensed 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...
# DExTer : Debugging Experience Tester # ~~~~~~ ~ ~~ ~ ~~ # # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception """This is a special subtool that is run w...
# Copyright (c) 2014 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...