code stringlengths 1 199k |
|---|
import os
path = os.path.dirname(os.path.realpath(__file__))
sbmlFilePath = os.path.join(path, 'BIOMD0000000014.xml')
with open(sbmlFilePath,'r') as f:
sbmlString = f.read()
def module_exists(module_name):
try:
__import__(module_name)
except ImportError:
return False
else:
return... |
from setuptools import setup, find_packages
setup(name='MODEL1302010044',
version=20140916,
description='MODEL1302010044 from BioModels',
url='http://www.ebi.ac.uk/biomodels-main/MODEL1302010044',
maintainer='Stanley Gu',
maintainer_url='stanleygu@gmail.com',
packages=find_packages()... |
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from gestao.contrato.models.contrato.Contrato import Contrato
from gestao.contrato.models.documentos.ContratoDocumento import \
ContratoDocumento
def documentos_contrato( request, id_contrato):
title = ... |
"""O(n) time and O(n) space solution to problem 3-28 from
/The Algorithm Design Manual/, 2nd ed., by Steven Skiena
"""
import operator, random
def calculate_m(x):
"""Calculates values of array M without using division.
Args:
x: list of n integers
Returns:
List of n elements where i-th elemen... |
import MySQLdb as mdb
from datetime import datetime
from logging import getLogger; log = getLogger(__name__)
from contextlib import contextmanager
@contextmanager
def _log_db_error(action, args=None):
try:
yield
except mdb.Error as e:
if args:
try:
action = action % a... |
"""
Plucked string part types.
"""
from PyQt5.QtWidgets import (
QCheckBox, QComboBox, QCompleter, QGridLayout, QHBoxLayout, QLabel,
QLineEdit, QSpinBox,
)
import listmodel
import completionmodel
import ly.dom
from . import _base
from . import register
class TablaturePart(_base.Part):
"""Base class for tabl... |
'''
The Pitt API, to access workable data of the University of Pittsburgh
Copyright (C) 2015 Ritwik Gupta
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 o... |
print "We will use floating point numbers"
print "The value of expression 20.0 + 40.0 + 28.93 * 43.93 is: ", 20.0 + 40.0 + 28.93 * 43.93 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r"^$", views.preferences_view, name="preferences"),
url(r"^/privacy$", views.privacy_options_view, name="privacy_options"),
url(r"^/ldap_test$", views.ldap_test, name="ldap_test")
] |
import logging
import re
import time
from autotest.client.shared import error
from autotest.client import utils
from virttest import utils_net, utils_misc, utils_test
@error.context_aware
def run_multi_queues_test(test, params, env):
"""
Enable MULTI_QUEUE feature in guest
1) Boot up VM(s)
2) Login gues... |
from django.contrib import messages
from django.core.exceptions import ImproperlyConfigured
from .classes import Label, QuerysetLabel, AliquotLabel
from .exceptions import LabelPrinterError
def print_test_label(modeladmin, request, queryset):
for zpl_template in queryset:
label = Label(template=zpl_template... |
{
'name': 'Personalizaciones para OfiSolutio',
'version': '1.0',
'category': 'Website',
'author': 'Serv. Tecnol. Avanzados - Pedro M. Baeza',
'website': 'http://www.serviciosbaeza.com',
'depends': [
'sale',
'account',
],
'data': [
'views/sale_order_view.xml',
... |
"""Python code format's checker.
By default try to follow Guido's style guide :
http://www.python.org/doc/essays/styleguide.html
Some parts of the process_token method is based from The Tab Nanny std module.
"""
import keyword
import sys
import tokenize
if not hasattr(tokenize, 'NL'):
raise ValueError("tokenize.NL ... |
import sys
import sqlite3
connOld = sqlite3.connect(sys.argv[1])
connNew = sqlite3.connect(sys.argv[2])
cursorOld = connOld.cursor()
cursorNew = connNew.cursor()
tables = []
for table in cursorOld.execute("select name from sqlite_master where type = 'table'") :
tables.append(table[0])
for table in tables :
print("\n\... |
from Quantum import *
"""
Transpose BOT
"""
class myBot():
def __init__(self):
self.name = "transpose Bot"
# any persistene data structures
def do_setup(self, game):
print(game.number_of_words)
print(game.words)
pass
def do_turn(self, game):
"""
take transpose
"""
for i in range(0, game.number_of_w... |
import minimalmodbus
import serial
__author__ = "Nick Ma"
class Nilan( minimalmodbus.Instrument ):
"""Instrument class for nilan heat pump.
communication via RS485
"""
HOLDINGREG_OFFSET = 10000
def __init__(self, portname, slaveaddress=30):
minimalmodbus.Instrument.__init__(self, portname, ... |
from django.conf.urls import patterns, include, url
from django.conf import settings
from django.conf.urls.static import static
from sirius import views
from django.contrib.flatpages.views import flatpage
from django.contrib import admin
urlpatterns = patterns('',
# Examples:
url(r'^$', views.home, name='home')... |
from __future__ import absolute_import
from Screens.Screen import Screen
from Components.Label import Label
class NumericalTextInputHelpDialog(Screen):
def __init__(self, session, textinput):
Screen.__init__(self, session)
self["help1"] = Label(text="<")
self["help2"] = Label(text=">")
for x in (1, 2, 3, 4, 5,... |
import time, os
os.system("sudo pigpiod") # enable pigpio system
from max7219bang import Max7219bang
brightness = 8
dataPin = 14 ; clockPin = 15 ; loadPin = 18 # matrix wiring
matrix = Max7219bang(dataPin,clockPin,loadPin,brightness)
def main():
print("Matrix demo - Ctrl C to stop")
print("Read switches and light... |
__copyright__ = """
Copyright (C) 2015, Benjamin S. Meyers <bsm9339@rit.edu>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
b... |
from replacement_policies.Cache import Cache
import re
import externmodules.pylru as pylru
class SubsetCache(Cache):
def __init__(self, size, **args):
#It only caches content from certain users
Cache.__init__(self, size)
assert size > 0
self._store = pylru.lrucache(size)
self... |
import sys, os, re, traceback, types, pickle
from uplib.plibUtil import note, configurator
from uplib.ripper import Ripper, rerip_generic
from uplib.paragraphs import read_paragraphs_file
from uplib.plibUtil import read_file_handling_charset_returning_bytes, read_wordboxes_file, wordboxes_for_span
from uplib.webutils i... |
"""
Enable OpenMP compiler support in Python C extensions. By default, your
`setup.py` script will check if the compiler supports OpenMP by compiling a test
program. If you specify the command line option `--enable-openmp`, then if the
compiler does not support OpenMP, then `setup.py` will fail with an error
message. I... |
from __future__ import absolute_import
from numpy.testing import (
assert_,
assert_array_equal,
)
import mmtf
import mock
import MDAnalysis as mda
from MDAnalysis.core.groups import AtomGroup
from MDAnalysisTests.topology.base import ParserBase
from MDAnalysisTests.datafiles import MMTF, MMTF_gz
class TestMMTFP... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('signage', '0002_auto_20151230_2151')]
operations = [migrations.AddField(
model_name='sign',
name='use_frameset',
field=models.BooleanField(default=Fal... |
from PIL import Image
import requests
import pytesseract
from bs4 import BeautifulSoup
import StringIO
from openerp import models, api
from openerp.osv import osv
from lxml import etree
from openerp.tools.translate import _
class res_partner(models.Model):
_inherit = 'res.partner'
def _get_captcha(self, type):
... |
from time import localtime, time, strftime, mktime
from enigma import eServiceReference, eTimer, eServiceCenter, ePoint
from Screen import Screen
from Screens.HelpMenu import HelpableScreen
from Components.About import about
from Components.ActionMap import HelpableActionMap, HelpableNumberActionMap
from Components.But... |
"""A high level SpiNNaker network tester/traffic generator."""
from .experiment import Experiment, Core, Flow, Group
from .results import Results
from .errors import NetworkTesterError
from .results import to_csv |
input = raw_input("Please enter an IP adddress:")
input = input.split('.')
for i, v in enumerate(input):
input[i] = bin(int(v))
print '%-15s %-15s %-15s %-15s' % ('first_octet', 'second_octet', 'third_octet', 'fourth_octet')
print '%-15s %-15s %-15s %-15s' % (input[0], input[1], input[2], input[3]) |
"""EBS Mount - triggered by udev on EBS attach and detach
Arguments:
action action trigger (add | remove)
Environment variables (Amazon EC2):
DEVNAME (required: e.g., /dev/xvdf)
PHYSDEVPATH (required: e.g., /devices/xen/vbd-2160)
Environment variables (Eucalyptus):
DEVNAME (... |
import unittest
from ziphmm import Vector
from _internal import format_vector
class TestVector(unittest.TestCase):
def test_indexers(self):
v = Vector(3)
v[0] = 1
v[1] = 2
v[2] = 3
self.assertEqual(1, v[0])
self.assertEqual(2, v[1])
self.assertEqual(3, v[2])
... |
"""
Tests for misc tools
"""
from __future__ import absolute_import
import unittest
from taxon_names_resolver import manip_tools as mt
idents = ['Homo sapiens', 'Pongo pongo', 'Mus musculus', 'Bacillus subtilus',
'Gorilla gorilla', 'Ailuropoda melanoleuca', 'Ailurus fulgens',
'Arabidopsis thaliana',... |
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS, TEMPLATE_LOADERS, STATICFILES_FINDERS
from django.utils.translation import ugettext_lazy as _
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
PROJECT_ROOT = os.path.join(BASE_DIR, '..')
SECRET_KEY = '{{ SECRET_KEY }}'
DEBUG = True
TEMP... |
from scripts import launch
import sys
if len(sys.argv) < 3:
launch.do_launch(None, None)
else:
launch.do_launch(sys.argv[1], sys.argv[2:]) |
"""
Generate centreline and write it out as .vtk legacy format.
"""
import os
import sys
os.chdir(os.path.dirname(os.path.abspath(__file__)))
importPath = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../util'))
if not importPath in sys.path:
sys.path.insert(1, importPath)
del importPath
import Cen... |
import os
import glob
import shutil
def safe_copy(fn, specfemdir, targetdir):
origin_file = os.path.join(specfemdir, fn)
target_file = os.path.join(targetdir, fn)
if not os.path.exists(origin_file):
raise ValueError("No such file: %s" % fn)
if not os.path.exists(os.path.dirname(target_file)):
... |
"""
Created on Mon Jan 4 21:05:51 2016
@author: jussi
"""
SAMPLES_TO_DETECT_MOVEMENT = 100
STILLNESS_JITTER_MAX = 10
import uinput
import serial
def get_channel_vals(ser):
# Update from RC controller
ser.write('p') # ask for reading
ctr = ser.readline().split(",")
if len(ctr)==2:
throttle = int... |
"""
A profile represents a distro paired with a kickstart file.
For instance, FC5 with a kickstart file specifying OpenOffice
might represent a 'desktop' profile. For Virt, there are many
additional options, with client-side defaults (not kept here).
Copyright 2006-2008, Red Hat, Inc
Michael DeHaan <mdehaan@redhat.com... |
'''
resolveurl Kodi plugin
Copyright (C) 2016 Gujal
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.
... |
import ConfigParser
MODULE = '[config]'
FILENAME = '.config'
class Config:
def __init__(self, log):
self.log = log
def __exit__(self):
pass
def get(self, item):
config = ConfigParser.ConfigParser()
#config.readfp('.conf',"rb")
config.read(FILENAME)
try:
c = config.get("ALL", item)
except:
c = ''
... |
import organ
from organ import ORGAN
organ_params = {
'PRETRAIN_GEN_EPOCHS': 250, 'PRETRAIN_DIS_EPOCHS': 10, 'MAX_LENGTH': 60, 'LAMBDA': 0.5, "DIS_EPOCHS": 2, 'SAMPLE_NUM': 6400, 'WGAN':True}
disc_params = {"DIS_L2REG": 0.2, "DIS_EMB_DIM": 32, "DIS_FILTER_SIZES": [
1, 2, 3, 4, 5, 8, 10, 15], "DIS_NUM_FILTERS": ... |
import sys
import argparse
import os.path
from amitools.util.CommandQueue import CommandQueue
from amitools.fs.FSError import FSError
from amitools.fs.FSString import FSString
from amitools.fs.rdb.RDisk import RDisk
from amitools.fs.blkdev.RawBlockDevice import RawBlockDevice
from amitools.fs.blkdev.DiskGeometry import... |
from __future__ import print_function
from PySide.QtCore import QPointF
from PySide.QtGui import QPolygonF
from shapely import affinity
from shapely.geometry import Point, MultiPoint, Polygon
from shapely.geometry.base import BaseMultipartGeometry
from src import cadfileparser
from src.argumentparser import ArgumentPar... |
import os
import re
import urlparse
_my_proxies = {}
_my_noproxy = None
_my_noproxy_list = []
def set_proxy_environ():
global _my_noproxy, _my_proxies
if not _my_proxies:
return
for key in _my_proxies.keys():
os.environ[key + "_proxy"] = _my_proxies[key]
if not _my_noproxy:
retur... |
import gtk
import gnome
import gnome.ui
import gtk.gdk
import pango
class NoteBuffer(gtk.TextBuffer):
tag_list = []
def __init__(self):
gtk.TextBuffer.__init__(self)
self.create_tags()
def get_cursor_iter(self):
return self.get_iter_at_mark(self.get_insert())
def create_tags(self):
self.scale_tags = []
se... |
from com.googlecode.fascinator import QueueStorage
from com.googlecode.fascinator.api import PluginManager
from com.googlecode.fascinator.common import JsonConfig
from com.googlecode.fascinator.common import JsonConfigHelper
from com.googlecode.fascinator.common.storage.impl import GenericDigitalObject
from com.googlec... |
NIPRELEASE="1.0.4"
DEFAULT_GAME_CHANNELS="#otfbot #otf-quiz #nip" #also refer to NIP.channels and config.WriteDefaultValues
NIP_RULES_LINK="https://otf-chat.otfbot.org/games/nobody-is-perfect"
HELPUSER="MitNipper -> #CCHAR#join #CCHAR#part (mitspielen/aussteigen) #CCHAR#score #CCHAR#rules #CCHAR#players"
HELPADMIN="Adm... |
import os
import sys
from gui.window import Window
from util.manager import Manager
"""
This is the summer of our discontent made glorious by example messages
Initiate CoPa. Start the GUI and await connections.
"""
if not os.geteuid() == 0:
exit("\n Needs to be run as root user. \n")
def callback(gui, string):
... |
import PyQt4.QtCore as __PyQt4_QtCore
from .QWidget import QWidget
class QAbstractSpinBox(QWidget):
""" QAbstractSpinBox(QWidget parent=None) """
def alignment(self): # real signature unknown; restored from __doc__
""" QAbstractSpinBox.alignment() -> Qt.Alignment """
pass
def buttonSymbols(s... |
"""Base classes for parameters of algorithms with biomod functionality"""
from zope.interface import provider
from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
from zope.schema.interfaces import IVocabularyFactory
brt_var_monotone_vocab = SimpleVocabulary([
SimpleTerm(-1, '-1', u'-1'),
SimpleTerm(... |
'''
concatenate line by line from two files and print the horizontally joined lines
to the STDOUT
Haipeng Cai @ Aug 4th, 2011
'''
import os
import sys
import string
'''file containing coordinates needing calibration, box position file in our case'''
g_fnsrc1 = None
'''file of the first geometry data, typically that of ... |
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('127.0.0.1', 8888))
print s.recv(1024)
for data in ['gwq', '1234', 'gsj']:
s.send(data)
print s.recv(1024)
s.send('exit')
s.close() |
import string
import shutil
import iutil
import socket
import os
import time
import tempfile
import simpleconfig
import re
import IPy
import uuid
from flags import flags
import itertools
from simpleconfig import SimpleConfigFile
from blivet.devices import FcoeDiskDevice, iScsiDiskDevice
import blivet.arch
from pyanacon... |
"""
Invenio international messages functions, to be used by all
I18N interfaces. Typical usage in the caller code is:
from messages import gettext_set_language
[...]
def square(x, ln=CFG_SITE_LANG):
_ = gettext_set_language(ln)
print _("Hello there!")
print _("The square of %s is %s.") % ... |
"""Codelets"""
from copycat.coderack.codelets.answer import AnswerBuilder
from copycat.coderack.codelets.bond import BondBottomUpScout
from copycat.coderack.codelets.bond import BondBuilder
from copycat.coderack.codelets.bond import BondStrengthTester
from copycat.coderack.codelets.bond import BondTopDownCategoryScout
... |
from contextlib import contextmanager
import xbmcgui
VIDEO_CODECS = {
"x264": "h264",
"h264": "h264",
"xvid": "xvid",
}
AUDIO_CODECS = {
"mp3": "mp3",
"aac": "aac",
"dts": "dts",
"ac3": "ac3",
"5.1ch": "ac3",
"dd5.1ch": "ac3",
}
RESOLUTIONS = {
# "dvdscr": (853, 480),
# "dvdr... |
"""Test Jinja views."""
from __future__ import absolute_import, division, print_function, \
unicode_literals
import json
import pytest
def test_available_methods(app):
"""Check if the documentation is available."""
with app.test_client() as client:
res = client.get("/api/clustering/")
data =... |
from .cell import *
import numpy as np
class IntervalCell(Cell):
"""
Implements an interval cell along with interval algebra
"""
def __init__(self, low=None, high=None):
"""
Creates a new IntervalCell with values restricted to between `low` and `high`.
"""
self.low = -np.... |
import sys
import time
import pdb
import re
import numpy as np
from scipy.interpolate import splrep, splev, interp1d
from scipy.integrate import quad, romberg, simps
import socket
import getpass
import os
DEBUGLEVEL = 1 # 0: none, 1: some, 2: more, 3: all
def LOG(level, message, var=''):
if level > DEBUGLEVEL:
... |
import pickle
celebrity = {}
followers = {}
added_total = 0
for i in range(80):
fname = "checkpt_80_%s" % i
print fname
with open(fname) as f:
data = pickle.load(f)
for k in data:
added_followers = 0
celebrity[k] = data[k]
for u in data[k]:
added_followers += 1
added_tota... |
import logging
import time
import os
import sys
import re
from autotest.client.shared import error
from autotest.client import utils
from autotest.client.shared.syncdata import SyncData
from virttest import data_dir, env_process, utils_test, aexpect
@error.context_aware
def run_floppy(test, params, env):
"""
Te... |
class preformated_text:
def __init__(self):
pass
@staticmethod
def process(data, args):
data['note_viewer'].call_function('preformated_text') |
from PIP import Image
from DataClass import Data
def Encoder:
__metaclass__ abc.ABCMeta
data_queue = []
neural_networks = []
description = None
def __init__(self, description="Data Encoder"):
self.description = description |
modes_map = ("Position", "Torque")
class RobotYARP(): #TODO: Save history (if save enabled)
'''
Interface to the YARP python bindings
Creates a robot and allows reads and writes easily
'''
def __init__(
self
, device_name="nemo_yarp_ctrl" #this controller's name
,... |
"""
Modification of a csv file
"""
import csv
from hw5_solution1 import Person
def modifier(file):
"""
This function accepts a csv file and modifies it according to the task:
creates Person classes, adds fullname and age columns
"""
fp = open(file, "r")
csv_reader = csv.reader(fp)
new = []
... |
n1 = 1;
n2 = 0;
def fibonnacci(n):
for num in range(1, n):
op = n1 + n2
n2 = op;
print $op
?> |
"""
This file provides multiple markers for environmental parameters
A test can be marked with
@pytest.mark.browser(ALL)
@pytest.mark.browser(NONE)
@pytest.mark.browser('firefox')
At the moment, lists of parameters are not supported
"""
from cfme.utils import testgen
class EnvironmentMarker(object):
"""Base Environ... |
import threading
import tornado.ioloop
import tornado.web
txt = ''
class WebHandler(tornado.web.RequestHandler):
def get(self):
self.write(txt or '')
class GuiDisplay(tornado.web.RequestHandler):
PORT = 9415
def __init__(self):
self.application = tornado.web.Application([
(r"/mes... |
from tests import TestCase, skipIf
from quodlibet.util.tags import USER_TAGS
from quodlibet.qltk import is_wayland
class TagsCombo(TestCase):
def setUp(self):
self.all = self.Kind()
self.some = self.Kind(["artist", "album", "~people", "foobar"])
def tearDown(self):
self.all.destroy()
... |
import ide
abjad_ide = ide.AbjadIDE(test=True)
def test_AbjadIDE_go_to_segment_directory_01():
"""
From segment directory.
"""
abjad_ide("red gg 01 q")
transcript = abjad_ide.io.transcript
assert transcript.titles == [
"Abjad IDE : scores",
"Red Score (2017)",
"Red Score ... |
import numpy as np
import matplotlib.pyplot as plt
import csv
import pandas as pd
from PIL import Image
SAMPLE_FILE = './AMZN/AMZN_TEST/AMZN-test.csv'
WINDOW_SIZE = 30
with open(SAMPLE_FILE,'r') as file:
time = []
close_price = []
total_data = []
earning = []
reader = csv.reader(file)
for line i... |
from django.core.management.base import NoArgsCommand
from django.conf import settings
from evesch.org.avatar.models import Avatar
from evesch.org.avatar import AUTO_GENERATE_AVATAR_SIZES
class Command(NoArgsCommand):
help = "Regenerates avatar thumbnails for the sizes specified in " + \
"settings.AUTO_GENE... |
"""
file: notifier.py
author: Christoffer Rosen <cbr4830@rit.edu>
date: December, 2013
description: Notification system using gmail to notify subscribers that
a repo's analysis has been completed.
"""
import smtplib
from caslogging import logging
class Notifier:
def __init__(self, gmail_user, gmail_pwd):
"""
Const... |
import unittest
import xml.dom.expatbuilder
import xml.dom.minidom
from domapi import DOMImplementationTestSuite
def DOMParseString(self, text):
return xml.dom.expatbuilder.parseString(text)
def test_suite():
"""Return a test suite for the Zope testing framework."""
return DOMImplementationTestSuite(xml.dom... |
from config import *
from lxml import html
print(Color(
'{autored}[{/red}{autoyellow}+{/yellow}{autored}]{/red} {autocyan} update_rotation.py importado.{/cyan}'))
backward = {
'Chogath': 'ChoGath',
'FiddleSticks': 'Fiddlesticks',
'Leblanc': 'LeBlanc',
'Khazix': 'KhaZix',
'MonkeyKing': 'Wukong'
... |
import os
import sys
import logging
from logging import handlers
class ogerlogger:
def __init__(self, name, level=logging.INFO):
self.logger = logging.getLogger(name)
self.logger.setLevel(level)
fmter = logging.Formatter('%(asctime)s %(name)4s [%(levelname)s] %(message)s')
console = ... |
import threading
import datetime
import time
from sdAPI import SdAPI
from strings import *
from fileFetcher import *
import xbmcgui
import xbmcvfs
import sqlite3
from utils import *
SETTINGS_TO_CHECK = ['source', 'sd.interval', 'sd.changed']
class DatabaseSchemaException(sqlite3.DatabaseError):
pass
class Database(... |
from datetime import datetime
from dateutil import parser
from bson import ObjectId
from worker.dbcontext import db
from worker.celeryapp import celery
from worker.crawler.tasks import crawl
from worker.analyzer.tasks import analyze
from celery.signals import after_task_publish
from ast import literal_eval as make_tupl... |
"""The image utilities module contains plugins that do not fit in
any other category, like image copying or computing histograms."""
from gamera.plugin import PluginFunction, PluginModule
from gamera.args import ImageType, ImageList, Pixel, Args, Class, Rect, Float
from gamera.args import Choice, NoneDefault, FileSave,... |
from ipmininet.iptopo import IPTopo
class NetworkCaptureTopo(IPTopo):
"""
This topology captures traffic from the network booting.
This capture the initial messages of the OSPF/OSPFv3 daemons and save the capture
on /tmp next to the logs.
"""
def build(self, *args, **kw):
"""
... |
"""command to allow external programs to compare revisions
The extdiff Mercurial extension allows you to use external programs
to compare revisions, or revision with working directory. The external
diff programs are called with a configurable set of options and two
non-option arguments: paths to directories containing ... |
import PyFlxInstrument
from Structures import *
class Image( object):
def get_entrypoint( self):
try:
return self.cached.entrypoint
except:
return self.ldr_data_table_entry.EntryPoint
def get_sizeofimage( self):
try:
return self.cached.sizeofimage
... |
STATIC_ROOT = '/home/scorio/webapps/beta_static/assets'
STATIC_URL = 'http://beta-static.listingpanda.com/assets/'
MEDIA_ROOT = '/home/scorio/webapps/beta_content'
MEDIA_URL = 'http://beta-content.listingpanda.com/' |
import Base
import dynamic_mission
import VS
import quest
time_of_day=''
bar=-1
weap=-1
room0=-1
plist=VS.musicAddList('perry.m3u')
VS.musicPlayList(plist)
dynamic_mission.CreateMissions()
room = Base.Room ('Confederation_Base_Perry_Landing_Bay')
room0 = room
Base.Texture (room, 'background', 'bases/perry/Perry_Landing... |
import sys
import os
import shlex
sys.path.insert(0, os.path.abspath('..'))
from django.conf import settings
settings.configure()
import sphinx_bootstrap_theme
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.coverage',
]
templates_path = ['_templates']
source_suffix = ['.rst']
master_doc = 'index'
project = u'... |
"""This module contains functions and classes to facilitate geometrical
calculations"""
import math
epsilon = 0.5
class Vector:
"""A vector in the cartesian plane
Vector(x, y) -> creates a vector
"""
def __init__(self, x, y):
self.x = x
self.y = y
def __add__(self, u):
return... |
import boto.sqs
import boto.sqs.queue
from boto.sqs.message import Message
from boto.sqs.connection import SQSConnection
from boto.exception import SQSError
import sys
import requests
response = requests.get("http://ec2-52-30-7-5.eu-west-1.compute.amazonaws.com:81/key").text
key = response.split(":")
access_key_id = ke... |
"""Have the underlying SCM absorb the applied patches."""
from . import cli_args
from . import db_utils
PARSER = cli_args.SUB_CMD_PARSER.add_parser(
"absorb",
description=_("Have underlying SCM import/absorb all applied patches."),
)
def run_absorb(args):
"""Execute the "absorb" sub command using the suppli... |
from gi.repository import GObject, Gtk
from quodlibet.browsers.playlists import PlaylistsBrowser
from quodlibet.browsers.playlists.menu import PlaylistMenu
from quodlibet import _
from quodlibet import browsers
from quodlibet import qltk
from quodlibet.qltk.ratingsmenu import RatingsMenuItem
from quodlibet.qltk.x impor... |
import numpy as np
from rerpy._artifact import flat_spans
def test_flat_spans():
assert np.all(flat_spans(10.0, np.asarray([
10, 15, 20, 23, -10, -5, 100, 100, 105, 95], dtype=float))
== [3, 3, 2, 1, 2, 1, 4, 3, 2, 1])
assert np.all(flat_spans(10.0, np.asarray([
... |
import os
import tempfile
import shutil
from gi.repository import Gtk, Gio, Gdk, GtkSource, Gedit, GObject
from .snippet import Snippet
from .helper import *
from .library import *
from .importer import *
from .exporter import *
from .document import Document
from .languagemanager import get_language_manager
class Mana... |
if __name__ == '__main__' :
import impo
import sys
m = impo.Main ()
m.main ()
sys.exit (0)
try :
import sys
import impo
m = impo.Main ()
m.main ()
#pod.test.test19 ()
except KeyboardInterrupt :
print 'impo: interrupted'
sys.exit (1)
... |
'''TsumuFS, a NFS-based caching filesystem.'''
import os
import errno
import threading
import cPickle
import logging
logger = logging.getLogger(__name__)
import tsumufs
from extendedattributes import extendedattribute
class PermissionsOverlay(object):
'''
Class that provides management for permissions of files in t... |
from base_efiction_adapter import BaseEfictionAdapter
class FanfictionLucifaelComAdapter(BaseEfictionAdapter):
@staticmethod
def getSiteDomain():
return 'fanfiction.lucifael.com'
@classmethod
def getSiteAbbrev(self):
return 'luci'
@classmethod
def getDateFormat(self):
ret... |
import os
import sys
sys.path.insert(0, os.path.abspath('../.'))
extensions = ['sphinx.ext.autodoc']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'rna2D'
copyright = '2017, Dawid Rech'
author = 'Dawid Rech'
version = '1.0'
release = '1.0.0'
language = None
exclude_patterns = ['_... |
import json
from hashlib import md5
from django.db import models
from django.core.urlresolvers import reverse
class Payload(models.Model):
payload_hash = models.CharField(max_length=32, unique=True,
blank=True, null=True)
payload = models.TextField()
created = models.Date... |
from meowth import Cog, command, bot, checks
from discord.ext import commands
import discord
from meowth.utils.fuzzymatch import get_match, get_matches
from meowth.utils import formatters
import pywraps2 as s2
from staticmap import StaticMap, Line
import aiohttp
import asyncio
import datetime
import time
import pytz
fr... |
from mock import (
patch, Mock
)
from pytest import raises
from kiwi.solver.repository import SolverRepository
from kiwi.exceptions import KiwiSolverRepositorySetupError
class TestSolverRepository:
def setup(self):
self.uri = Mock()
self.uri.repo_type = 'some-unknown-type'
def test_solver_re... |
"""
This module conducts a majority vote on each cluster to determine the function
There should only be 7 possible function classes: toxins, modifiers, regulators, transporters, immunity, null, NA (not assigned)
"""
import os,site,sys
import re
from collections import Counter
base_path = os.path.dirname(os.path.dirname... |
import subprocess
import elasticsearch
from elasticsearch import helpers as eshelpers
import migrates
def callmigrates(args):
return subprocess.check_output([
'python -m migrates.__main__ ' + args
], shell=True).decode('utf-8')
def iterate_test_data(connection, index='migrates_test_*'):
for document... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.