src
stringlengths
721
1.04M
""" Plot giant abundances w.r.t. GES. """ import numpy as np import matplotlib.pyplot as plt from collections import OrderedDict from matplotlib.ticker import MaxNLocator from matplotlib.colors import LogNorm from mpl_toolkits.axes_grid1 import make_axes_locatable try: rave_cannon_dr1, kordopatis_comparisons ...
# -*- coding: utf-8 -*- # Define here the models for your spider middleware # # See documentation in: # http://doc.scrapy.org/en/latest/topics/spider-middleware.html from scrapy import signals class SuumoSpiderMiddleware(object): # Not all methods need to be defined. If a method is not defined, # scrapy act...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import unittest from run_length import encode, decode class WordCountTests(unittest.TestCase): def test_encode(self): #PASS self.assertMultiLineEqual('2A3B4C', encode('AABBBCCCC')) def test_decode(self): self.assertMultiLineEq...
# Copyright (c) 2015 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
# Copyright (c) 2014 Christopher L. Felton # # This program 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 later version. # # This program is...
from django.db import models from django_extensions.db.fields import AutoSlugField import mptt from urlparse import urljoin class Category(models.Model): parent = models.ForeignKey('self', null=True, blank=True, related...
#!/usr/bin/python # -*- coding: utf-8 -*- ''' Weborf Copyright (C) 2009 Salvo "LtWorf" Tomaselli Weborf 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 la...
from rest_framework import serializers from ..models import SshHackIP, SshHackLocation class HackIpSerializer(serializers.ModelSerializer): attempts = serializers.SerializerMethodField() def get_attempts(self, obj): return [ { 'id': x.id, 'attempted': x.at...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2013 Arcus, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights #...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # pymlconf documentation build configuration file, created by # sphinx-quickstart on Sat Mar 25 00:12:51 2017. # # 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 # a...
""" The configuration bits of TileStache. TileStache configuration is stored in JSON files, and is composed of two main top-level sections: "cache" and "layers". There are examples of both in this minimal sample configuration: { "cache": {"name": "Test"}, "layers": { "example": { "...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
#!/usr/bin/env python2 # coding=utf-8 """ Task dispatcher """ from __future__ import unicode_literals from __future__ import absolute_import __author__ = "Manuel Ebert" __copyright__ = "Copyright 2015, summer.ai" __date__ = "2015-11-20" __email__ = "manuel@summer.ai" import os import json from serapis.config import c...
from coinlist import CoinList import pandas as pd from time import time from time import sleep import numpy as np NOW = 0 FIVE_MINUTES = 60*5 FIFTEEN_MINUTES = FIVE_MINUTES * 3 HALF_HOUR = FIFTEEN_MINUTES * 2 HOUR = HALF_HOUR * 2 TWO_HOUR = HOUR * 2 FOUR_HOUR = HOUR * 4 DAY = HOUR * 24 YEAR = DAY * 365 CSV_DEFAULT = ...
# coding:utf-8 ''' 数据库 Author : qbeenslee Created : 2014/10/10 ''' import time import datetime import sqlalchemy from sqlalchemy import * from sqlalchemy.orm import sessionmaker, relationship from config import setting from data.base_clazz import Base def get_db(): ''' 获取操作对象集合 :re...
""" {{cookiecutter.project_name}} {{ "=" * cookiecutter.project_name|length}} """ from setuptools import setup, find_packages import re import ast _version_re = re.compile(r'__version__\s+=\s+(.*)') with open('{{cookiecutter.project_slug}}/version.py', 'rb') as f: version = str(ast.literal_eval(_version_re.search(...
# -*- coding: utf-8 -*- """ Created on July 2017 @author: JulienWuthrich """ from mozinor.config.params import * from mozinor.config.explain import * Fast_Classifiers = { "ExtraTreesClassifier": { "import": "sklearn.ensemble", 'n_estimators': n_estimators, "criterion": criterion, ...
# Converted from Route53_RoundRobin.template located at: # http://aws.amazon.com/cloudformation/aws-cloudformation-templates/ from troposphere import Join from troposphere import Parameter, Ref, Template from troposphere.route53 import RecordSet, RecordSetGroup t = Template() t.set_description( "AWS CloudFormat...
#!/usr/bin/env python # encoding: utf-8 """ untitled.py Created by iOsama on 2013-09-24. Copyright (c) 2013 __MyCompanyName__. All rights reserved. """ import sys import os inputfile = "reversed.mtx" outputfile = inputfile + ".out" x_value = 99999 def main(): # open files fin = open(inputfile, '...
#!/usr/bin/env python import sys, os from pyrecon.tools import excelTool from PySide import QtGui, QtCore class excelToolWindow(QtGui.QWidget): def __init__(self, parent = None): QtGui.QWidget.__init__(self, parent) self.parent = parent self.setGeometry(0,0,500,200) self.se...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('proposals', '0011_proposal_created_updated'), ] operations = [ migrations.AlterField( model_name='proposalbase',...
#!/usr/bin/env python2.7 # # Copyright (C) 2016 INRA # # 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 ...
# (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP # (C) Copyright 2017 SUSE 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...
""" =============================================================================== System Logging =============================================================================== author=hal112358 ------------------------------------------------------------------------------- """ from __future__ import print_function im...
from .cpropep._cpropep import ffi, lib __all__ = ['Propellant'] EL_SYMBOLS = [ "H", "HE", "LI", "BE", "B", "C", "N", "O", "F", "NE", "NA", "MG", "AL", "SI", "P", "S", "CL", "AR", "K", "CA", "SC", "TI", "V", "CR", "MN", "FE", "CO", "NI", "CU", "ZN", "GA", "GE", "AS", "SE", "BR", "KR", "RB", "SR", "Y", "ZR", "N...
#!/usr/bin/env python3.2 import argparse import gzip import os ## CONTACT: jorvis@gmail.com def main(): parser = argparse.ArgumentParser( description='Provides simple quantitative statistics for a given FASTQ file') ## output file to be written parser.add_argument('input_files', metavar='N', type=str, n...
import socket import sys import os import curses from threading import Thread class RemoteControlServer(object): """docstring for Curses_control""" def __init__(self): super(RemoteControl, self).__init__() self.data = '' self.stopped = False self.HOST = os.environ.get('COMMAND_...
import hpfeeds from configobj import ConfigObj from base_logger import BaseLogger class HPFeedsLogger(BaseLogger): def __init__(self): self.buttinsky_config = ConfigObj("conf/buttinsky.cfg") if self.buttinsky_config["hpfeeds"]["enabled"] == "False": self.options = {'enabled': 'False...
""" A tickers are responsible for calling into the supervisor periodically, and getting it to handle restarts. """ import logging import os import select import threading import time from jobmon import util LOGGER = logging.getLogger('jobmon.ticker') class Ticker(threading.Thread, util.TerminableThreadMixin): ""...
import json import urllib.request from operator import itemgetter #uses in sorting data from progress.bar import Bar """ find best book that you need and return them @author Ali Najafi (mail.ali.najafi@gmail.com) @source http://it-ebooks-api.info/ """ from oneconf.utils import save_json_file_update ...
# Copyright 2016 Hewlett Packard Enterprise Development, LP. # # 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...
"Create an account with the 'curator' role." import sys from publications import constants from publications import utils from publications.account import AccountSaver def get_args(): parser = utils.get_command_line_parser( description='Create a new curator account.') return parser.parse_args() def...
import numpy as np from alis import almsgs from alis import alfunc_polynomial msgs=almsgs.msgs() class Chebyshev(alfunc_polynomial.Polynomial) : """ Returns a Chebyshev polynomial of the first kind: p[0] = coefficient of the term : 1 p[1] = coefficient of the term : x p[2] = coefficient of the te...
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
# -*- coding: utf8 -*- """ This is part of shot detector. Produced by w495 at 2017.05.04 04:18:27 """ from __future__ import absolute_import, division, print_function import logging from scipy import stats from ..base_stat_swfilter import BaseStatSWFilter class BaseStatTestSWFilter(BaseStatSWFilter): ...
''' Project Euler Problem 9 A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a**2 + b**2 = c**2 For example, 3**2 + 4**2 = 9 + 16 = 25 = 5**2. There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc. Link : https://projecteuler.net/problem=...
"""Loads Feed data from a csv file into the feed table of the database""" import logging import csv from optparse import OptionParser from paste.deploy import appconfig #from pylons import app_globals from abraxas.config.environment import load_environment from sqlalchemy import create_engine, MetaData, select from...
# Copyright 2019 The resource-policy-evaluation-library 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 # # Unl...
__author__ = "Zhenzhou Wu" __copyright__ = "Copyright 2012, Zhenzhou Wu" __credits__ = ["Zhenzhou Wu"] __license__ = "3-clause BSD" __email__ = "hyciswu@gmail.com" __maintainer__ = "Zhenzhou Wu" import theano.tensor as T import theano from pynet.utils.utils import theano_unique floatX = theano.config.floatX class Co...
"""distutils.command.check Implements the Distutils 'check' command. """ __revision__ = "$Id: check.py 85197 2010-10-03 14:18:09Z tarek.ziade $" from distutils.core import Command from distutils.errors import DistutilsSetupError try: # docutils is installed from docutils.utils import Reporter from docuti...
#/usr/bin/env python #coding:utf-8 # Author : tuxpy # Email : q8886888@qq.com.com # Last modified : 2015-05-19 14:03:37 # Filename : args.py # Description : import optparse from replace import version import os def parser_args(): usage = "Usage: %prog [options] target_path" parser = opt...
__author__ = 'dstrohl' import warnings from AdvConfigMgr.utils import IndentedPrinter ip = IndentedPrinter().set_logger('CFG_MGR').set_logger_disp_level('debug') # exception classes class Error(Exception): """Base class for ConfigParser exceptions.""" def __init__(self, msg=''): self.message = msg ...
import re from utils import GetConfig from utils import KalturaBaseTest from KalturaClient.Plugins.Core import KalturaUiConf, KalturaUiConfObjType, KalturaUiConfFilter from KalturaClient.Plugins.Core import KalturaUiConfListResponse class UiConfTests(KalturaBaseTest): def test_list(self): resp = se...
from django.utils import simplejson from allauth.socialaccount.providers.oauth.client import OAuth from allauth.socialaccount.providers.oauth.views import (OAuthAdapter, OAuthLoginView, OAuthCallbackView) ...
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the relevant file with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='Mariana', ...
from keras import backend as K from keras.engine.topology import Layer if K.backend() == 'tensorflow': import tensorflow as tf def K_meshgrid(x, y): return tf.meshgrid(x, y) def K_linspace(start, stop, num): return tf.linspace(start, stop, num) else: raise Exception("Only 'tensorflow...
from master import get_conn try: import simplejson as json except ImportError: import json with open("urls.json") as f: urls_data = json.load(f) def sort(x): return (x.get("success", False), x.get("url", "")) def table(title, l): temp = """ <table width='100%' border=1 cellpadding=3 ce...
#!/usr/bin/env python import os import shutil import sys import ratemyflight class ProjectException(Exception): pass def create_project(): """ Copies the contents of the project_template directory to a new directory specified as an argument to the command line. """ # Ensure a directory na...
''' Indique como um troco deve ser dado utilizando-se um número mínimo de notas. Seu algoritmo deve ler o valor da conta a ser paga e o valor do pagamento efetuado desprezando os centavos. Suponha que as notas para troco sejam as de 50, 20, 10, 5, 2 e 1 reais, e que nenhuma delas esteja em falta no caixa. ''' ...
# Copyright (c) 2018-2019, Manfred Moitzi # License: MIT License from math import radians import ezdxf from ezdxf.render.forms import ellipse from ezdxf.math import Matrix44 NAME = 'ellipse.dxf' doc = ezdxf.new('R12', setup=True) msp = doc.modelspace() def render(points): msp.add_polyline2d(list(points)) def t...
# Implements : class ATOM3Constraint # Author : Juan de Lara # Description : A class for the ATOM3 Constraint type. # Modified : 17 Oct 2002 # Changes : # ____________________________________________________________________________________________________________________ from Tkinter imp...
# Copyright (c) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Plotter for 2D slices of GEOS-Chem output NetCDFs files. NOTES --- - This is setup for Cly, but many other options (plot/species) are availible by just updating passed variables/plotting function called. """ import AC_tools as AC import numpy as np import matplotli...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- """ Commo...
import unittest from unittest.mock import Mock from nbxmpp import dispatcher class XMLVulnerability(unittest.TestCase): def setUp(self): self.stream = Mock() self.stream.is_websocket = False self.dispatcher = dispatcher.StanzaDispatcher(self.stream) self._error_handler = Mock() ...
# 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 ...
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
#-*-coding-utf-8-*- from datetime import datetime import logging from rest_framework import generics from rest_framework import status from rest_framework.response import Response from rest_framework.decorators import api_view from django.conf import settings from django.shortcuts import render_to_response from dja...
# yellowbrick.text.dispersion # Implementations of lexical dispersions for text visualization. # # Author: Larry Gray # Created: 2018-06-21 10:06 # # Copyright (C) 2018 District Data Labs # For license information, see LICENSE.txt # # ID: dispersion.py [] lwgray@gmail.com $ """ Implementation of lexical dispersion ...
# postgresql/pygresql.py # Copyright (C) 2005-2019 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: postgresql+pygresql :name: pygresql :dbapi: pgdb ...
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Marker(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "barpolar" _path_str = "barpolar.marker" _valid_props = { "autocolorscale", "...
############################################################################### # 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 # ...
""" Implementation of optimized einsum. """ from __future__ import division, absolute_import, print_function import itertools from numpy.compat import basestring from numpy.core.multiarray import c_einsum from numpy.core.numeric import asanyarray, tensordot from numpy.core.overrides import array_function_dispatch _...
# Copyright (C) 2011-2012 CRS4. # # This file is part of Seal. # # Seal 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. # # Seal is dis...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Support for "Audit"-related System Backend Methods.""" from hvac.api.system_backend.system_backend_mixin import SystemBackendMixin class Audit(SystemBackendMixin): def list_enabled_audit_devices(self): """List enabled audit devices. It does not li...
from .base import AbstractRenderer from .line import LineRenderer from .cylinder_imp import CylinderImpostorRenderer import numpy as np class BondRenderer(AbstractRenderer): ''' Render chemical bonds as cylinders or lines. **Parameters** widget: The parent QChemlabWidget ...
# This file is part of Shoop. # # Copyright (c) 2012-2016, Shoop 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. """ "Tagged JSON" encoder/decoder. Objects that are normally not unambiguously representable via J...
import os import sys import shutil import unittest import xml.dom.minidom parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, parentdir) from pcs_test_functions import pcs, ac import utils empty_cib = "empty.xml" temp_cib = "temp.xml" class UtilsTest(unittest.TestCase): def...
# blog.py - controller # imports from flask import Flask, render_template, request, session, \ flash, redirect, url_for, g import sqlite3 from functools import wraps # configuration DATABASE = "blog.db" app = Flask(__name__) # pulls in app configuration by looking for UPPERCASE variables in this file app.config...
# Copyright (c) 2014, Cédric Picard # 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 3 of the License, or # (at your option) any later version. # # This pr...
from django.core.management.base import BaseCommand from django.utils.translation import ugettext as _ from datetime import timedelta from django.utils import timezone from pyas2 import models from pyas2 import pyas2init import os import glob class Command(BaseCommand): help = _(u'Automatic maintenance for the AS...
# (c) 2017, Eero Rikalainen <eerorika@gmail.com> # # 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 ve...
"""Hello World API implemented using Google Cloud Endpoints. Contains declarations of endpoint, endpoint methods, as well as the ProtoRPC message class and container required for endpoint method definition. """ import endpoints from protorpc import messages from protorpc import message_types from protorpc import remot...
from django.core.exceptions import ImproperlyConfigured from django.db import models from djangae.core import validators from google.appengine.api.datastore_types import _MAX_STRING_LENGTH class CharOrNoneField(models.CharField): """ A field that stores only non-empty strings or None (it won't store empty strin...
#! /usr/bin/env python # -*- coding: latin-1 -*- from __future__ import with_statement import build_model import pddl_to_prolog import pddl import timers def get_fluent_facts(task, model): fluent_predicates = set() for action in task.actions: for effect in action.effects: fluent_predicates.add(effect.l...
# Copyright 2013 OpenStack LLC. # 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 b...
from tg import jsonify, lurl from datetime import datetime from decimal import Decimal from nose.tools import raises from nose import SkipTest from webob.multidict import MultiDict import json from tg.util import LazyString from tg.util.webtest import test_context class Foo(object): def __init__(self, bar): ...
from predictor.models import DepWords from feedReader.mongoFunctions import Mongo from bs4 import BeautifulSoup from nltk.corpus import stopwords from nltk.stem.wordnet import WordNetLemmatizer from math import ceil, sqrt import logging # Get an instance of a logger logger = logging.getLogger(__name__) class Predict...
import sys import logging import numpy as np import matplotlib.pyplot as plt import robo.models.neural_network as robo_net import robo.models.bagged_networks as bn from robo.initial_design.init_random_uniform import init_random_uniform logging.basicConfig(stream=sys.stdout, level=logging.INFO) def f(x): return...
import sys from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtGui import QPainter from PyQt5.QtGui import QPixmap from PyQt5.QtWidgets import * from PyQt5.QtCore import * windowSizeX = 440 windowSizeY = 250 fontMajor = "Arial" fontMinor = "Dotum" class Form(QWidget): # __init__ : 생성자 # parent : 부모객체 ...
from distantbes import Invocation from distantbes.enums import EXIT_CODES from time import sleep import argparse H = [ "gRPC endpoint of the Build Event Service", "gRPC endpoint of the Content Addressable Storage", "force localhost in File message", "build log file", "one or mor...
# # sublimelinter.py # Part of SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Ryan Hileman and Aparajita Fishman # # Project: https://github.com/SublimeLinter/SublimeLinter3 # License: MIT # """This module provides the SublimeLinter plugin class and supporting methods.""" import os import...
""" Finalproject.py Author: Sam Pych Credit: Thomas Kyle Postans, Hagin, My Space Game, David Wilson Assignment: Create a pong game with two movable blocks and the ball either bounces off the wall or appears on the other side. optional: keep score bounde=self.collidingWithSprites(Pongblock1) """ from ggame import App,...
""" Direct tests of the halo model code against known values from Beutler+2013, with intermediate data provided by David Palomara using his own halo model code. """ from halomod.integrate_corr import ProjectedCF import numpy as np import pytest from pathlib import Path pytestmark = pytest.mark.skip( "These tests ...
def solution(S, P, Q): # write your code in Python 2.7 prefixA = [0] * (len(S) + 1) prefixC = [0] * (len(S) + 1) prefixG = [0] * (len(S) + 1) prefixT = [0] * (len(S) + 1) for i in xrange(len(S)): if S[i] == 'A': prefixA[i + 1] = prefixA[i] + 1 else: prefix...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2016 Christoph Reiter # # 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...
# -*- coding: utf-8 -*- # # Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com> # # This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with # the additional special exception to link portions of this program with the OpenSSL library. # See LICENSE for more details. # i...
from __future__ import unicode_literals from django.conf.urls import url from django.contrib.auth import get_user_model from django.contrib.auth.models import Permission from django.test import Client, TestCase from model_mommy import mommy from model_mommy.recipe import seq SIMPLE_USERNAME = seq('simple_user_') SUPE...
#!/usr/bin/env python ''' Write a script that connects to the lab pynet-rtr1, logins, and executes the 'show ip int brief' command. ''' import telnetlib import time import socket import sys import getpass TELNET_PORT = 23 TELNET_TIMEOUT = 6 def send_command(remote_conn, cmd): ''' Send a command down the teln...
#! /usr/bin/env python import tornado.web import tornado.httpserver import tornado.ioloop import getpass import requests import json import os import hashlib import hmac import argparse #Since bamboo does not have api tokens you will need to provide a real user's password # If you don't want to store the password i...
""" Utility functions for output, executing commands, and downloading files. """ # 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...
#!/usr/bin/env python from logConstructs import * def graph_coloring(graph, colors): if len(graph) < colors: return False variables=[[None for i in range(colors)] for j in range(len(graph))] #construct variables for i in range(len(graph)): for j in range(colors): variable...
from .common import ConfigurableComponent from ebu_tt_live.adapters import document_data, node_carriage data_adapters_by_directed_conversion = { 'xml->ebutt1': document_data.XMLtoEBUTT1Adapter, 'xml->ebutt3': document_data.XMLtoEBUTT3Adapter, 'xml->ebuttd': document_data.XMLtoEBUTTDAdapter, 'ebutt3->...
#!/usr/bin/env python # # Copyright 2003,2004,2005,2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, ...
""" Tests for the memory estimators on JK objects """ import psi4 import pytest from .utils import * def _build_system(basis): mol = psi4.geometry(""" Ar 0 0 0 Ar 0 0 5 Ar 0 0 15 Ar 0 0 25 Ar 0 0 35 """) #psi4.set_options({"INTS_TOLERANCE": 0.0}) basis = psi4.core.B...
#! /usr/bin/env python """ burn-btc: create a bitcoin burn address By James C. Stroud This program requries base58 (https://pypi.python.org/pypi/base58/0.2.1). Call the program with a template burn address as the only argument:: % burn-btc 1BurnBTCForFunBurnBTCForFunXXXXXXX 1BurnBTCForFunBurnBTCForFunXTmJX...
"""engine.SCons.Platform.aix Platform-specific initialization for IBM AIX systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, ...
import os, time, re, string, glob, subprocess from .gettext import * from .resource_template import * from .ragel import * from .template import * from SCons.Script import Chmod, Flatten from SCons.Util import NodeList from SCons.Script.SConscript import SConsEnvironment def MatchFiles (files, path, repath, dir_exclud...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2019 The FATE 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/lic...
# # Copyright (C) 2009 Juan Pedro Bolivar Puente, Alberto Villegas Erce # # This file is part of Pigeoncide. # # Pigeoncide 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 # Lic...