src stringlengths 721 1.04M |
|---|
import subprocess
class i3Commands(object):
@staticmethod
def send_to_wp(i3_name):
'''Send the currently focused window/container to the named workspace'''
subprocess.Popen(['i3-msg', 'move container to workspace', i3_name], stdout=subprocess.PIPE)
@staticmethod
def go_to_wp(i3_name)... |
from __future__ import absolute_import
from builtins import str
from builtins import range
import matplotlib
matplotlib.use('agg')
import unittest
from .tempdir.tempfile_ import TemporaryDirectory
class TestModuleImports(unittest.TestCase):
def test_import_ascii_table(self):
import nugridpy.ascii_table
... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
# The MIT License (MIT)
# Copyright (c) 2012-2013 Francesco Napolitano, franapoli@gmail.com
# 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... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import random
import socket
import threading
import time
from thrift import Thrift
from thrift.transport import TTransport
from thrift.transport import TSocket
from thrift.protocol import TBinaryProtocol
from .pyesthrift import Rest
from .exceptions impor... |
"""Strings for Alexa to say"""
from settings import SITE_NAME_SPEAKABLE
SITE_NAME = SITE_NAME_SPEAKABLE
# Breaks
BREAK = '<break strength="{strength}">'
XS_BREAK = BREAK.format(strength='x-strong')
S_BREAK = BREAK.format(strength='strong')
# Greet and dismiss
WELCOME_REPROMPT = \
"""
You can ask {site_name} for an... |
# ----------------------------------------------------------------------
# LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
# http://lammps.sandia.gov, Sandia National Laboratories
# Steve Plimpton, sjplimp@sandia.gov
#
# Copyright (2003) Sandia Corporation. Under the terms of Contract
# DE... |
import os
import logging
from thug.ThugAPI.ThugAPI import ThugAPI
log = logging.getLogger("Thug")
class TestMiscSamplesIE(object):
thug_path = os.path.dirname(os.path.realpath(__file__)).split("thug")[0]
misc_path = os.path.join(thug_path, "thug", "samples/misc")
def do_perform_test(self, caplog, sampl... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 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/... |
# Copyright (C) 2020 OpenMotics BV
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribu... |
"""
Functions to create 2D patterns.
Note, in the hopfield model, we define patterns as vectors. To make
the exercise more visual, we use 2D patterns (N by N ndarrays).
"""
# This file is part of the exercise code repository accompanying
# the book: Neuronal Dynamics (see http://neuronaldynamics.epfl.ch)
# located at ... |
import time
from datetime import datetime
from bson import ObjectId, json_util
from collections import defaultdict
from flask import g, request
from flask_mail import Message
from flask_restful import Resource
from service.OrderService import OrderService, DuplicateOrderException
from service.PushNotificationService im... |
#!/usr/bin/env python
#
# Copyright 2011,2013 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, or (at your optio... |
#!/usr/bin/env python
import os
import random
from config import Dirs, Files
from utils import xdg, xga, error, check_files_eq, count_bytes, check_bytes
# Main test
def runtest():
"""check cross-generated output against native reference files"""
# run disassembler
for srcfile, dopts, aopts in [
... |
# 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 law or a... |
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Q
from django.http import HttpResponseRedirect, HttpResponseForbidden, Http404
from django.shortcuts import render_to_respon... |
# coding: utf-8
"""
REST functionality based off pycurlbrowser's Browser.
"""
try:
import simplejson as json
except ImportError:
import json
from . import Browser
class StatusInformational(Exception):
"""
Represent 1xx status codes
"""
class StatusRedirection(Exception):
"""
Represent ... |
# This software may be freely redistributed under the terms of the GNU
# general public license.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
import os
import sys
import v... |
#!/usr/bin/env python
import os
import sys
import string
doClean = ('clean' in sys.argv) or ('uninstall' in sys.argv)
rootDir = os.getcwd()
buildSystemDir = os.path.join(rootDir, 'build_system')
# Generate the configure input files.
setupCmd = 'python ' + os.path.join(buildSystemDir, 'setup.py') + ' --autogen' \
... |
import numpy
class DataReshaper(object):
def __init__(self, dimension, data_order='F'):
if dimension < 1 or dimension > 3:
raise ValueError("Number of dimensions should be between 1 and 3!")
self._dim = dimension
if data_order != 'C' and \
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This file is part of XBMC Mega Pack Addon.
Copyright (C) 2014 Wolverine (xbmcmegapack@gmail.com)
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... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Isaku Yamahata <yamahata at private email ne jp>
# 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
#... |
# 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 ... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, eit... |
#!/usr/bin/env python
# tcp_connection.py
#
# Copyright (C) 2008-2018 Veselin Penev, https://bitdust.io
#
# This file (tcp_connection.py) is part of BitDust Software.
#
# BitDust is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the F... |
import os
import dill
import numpy as np
from sklearn.model_selection import KFold
from marseille.custom_logging import logging
from marseille.datasets import get_dataset_loader, load_embeds
from marseille.io import cache_fname
from marseille.argrnn import ArgumentLSTM
def argrnn_cv_score(dataset, dynet_weight_deca... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\Lib\site-packages\PyQt4\examples\webkit\simpleselector\window.ui'
#
# Created: Wed Jan 18 20:24:02 2017
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
tr... |
"""
The flask application package.
"""
#####################################################################
# Create the Flask app
#####################################################################
from flask import Flask
from .callback_utils import Callbacks
import os
from flask_pyoidc.flask_pyoidc import OIDCA... |
"""
byceps.services.attendance.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from collections import defaultdict
from typing import Dict, Iterable, List, Optional, Set, Tuple
from ...database import db, paginate, Pagination
... |
import cxmate
from networkx.drawing.nx_pydot import graphviz_layout
from cxmate.service import NetworkElementBuilder
import logging
logging.basicConfig(level=logging.DEBUG)
# Label for CXmate output
OUTPUT_LABEL = 'out_net'
class NxLayoutService(cxmate.Service):
def process(self, params, input_stream):
... |
'''
xbmcswift2.listitem
------------------
This module contains the ListItem class, which acts as a wrapper
for xbmcgui.ListItem.
:copyright: (c) 2012 by Jonathan Beluch
:license: GPLv3, see LICENSE for more details.
'''
from xbmcswift2 import xbmcgui
class ListItem(object):
'''A wrapper... |
import paramiko
class GetSolarisData:
def __init__(self, ip, ssh_port, timeout, usr, pwd, use_key_file, key_file,
get_serial_info, get_hardware_info, get_os_details, add_hdd_as_parts,
get_cpu_info, get_memory_info, ignore_domain, upload_ipv6, debug):
self.machine_n... |
from operator import attrgetter
from django.db import connection, connections, router, transaction
from django.db.backends import utils
from django.db.models import signals, Q
from django.db.models.fields import (AutoField, Field, IntegerField,
PositiveIntegerField, PositiveSmallIntegerField, FieldDoesNotExist)
fr... |
#!/usr/bin/python
import json
import re
import copy
import argparse
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
def read_results(input_file, kernels_regexp_list):
'''
Read JSON output of volk_profile returning dict of results with filename
being the top level... |
# Copyright (c) 2014 Montavista Software, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
""" Pattern is just a list (of whatever) that can be specified in compacted form
... with the addition of the Markov expansion of tuples on calling resolve
"""
import random
class Pattern(list):
def __init__(self, value=[0]):
list.__init__(self, value)
self.resolve()
def resolve(self... |
# Homepage documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are... |
# encoding: utf-8
# pylint: disable=too-many-instance-attributes
# pylint: disable=attribute-defined-outside-init
#
# ____________________/\
# \______ \______ )/______
# | ___/| | _// ___/
# | | | | \\___ \
# |____| |______ /____ >
#... |
from __future__ import print_function
import json
import os
import numpy as np
import sys
import h5py
from gensim.models import Word2Vec
from gensim.utils import simple_preprocess
from keras.layers import Embedding
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from ... |
#
# Author : Manuel Bernal Llinares
# Project : trackhub-creator
# Timestamp : 12-09-2017 16:10
# ---
# © 2017 Manuel Bernal Llinares <mbdebian@gmail.com>
# All rights reserved.
#
"""
This file contains different models for the execution of subprocesses / external processes, e.g. via the command line
"""
impor... |
# Copyright (c) 2014-2020, Manfred Moitzi
# License: MIT License
from typing import BinaryIO, cast, TextIO, List, Optional
import zipfile
from contextlib import contextmanager
from ezdxf.lldxf.validator import is_dxf_stream, dxf_info
CRLF = b'\r\n'
LF = b'\n'
class ZipReader:
def __init__(self, zip_archive_name... |
# -*- coding: utf-8 -*-
# Copyright 2008, 2010, 2012-2015 Richard Dymond (rjdymond@gmail.com)
#
# This file is part of Pyskool.
#
# Pyskool 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 t... |
"""
This file is part of snakewatch.
snakewatch 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.
snakewatch is distributed in the hop... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import json
from django.conf import settings as django_settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from sentry.conf import settings
from sentry.models import Group, Project, TeamMember... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
from zrest.basedatamodel import RestfulBaseInterface
import gc
import shelve
import os
from definitions import *
import datetime
from zashel.utils import log
from math import ceil
import glob
import re
from utils import *
import json
import pprint
#TODO: Fix imports order
class Pari(RestfulBaseInterface):
def __... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
DsgTools
A QGIS plugin
Brazilian Army Cartographic Production Tools
-------------------
begin : 2017-02-24
git sha ... |
#!/usr/env python
from error import LoadError
from bmdl import BRenderModel
import pygame
from colorsys import rgb_to_hsv,hsv_to_rgb
import os
COLORWIDTH=8
class WavefrontModel:
def __init__(self,filename=None):
if filename is not None:
self.load(filename)
def load(self,filename):
fop=open(filename,'r')
sel... |
# -*- coding: utf-8 -*-
from troubleshooting.framework.libraries.library import singleton
import re
from troubleshooting.framework.template.Keyword import *
import traceback
@singleton
class Disk(Keyword):
def __init__(self):
super(self.__class__,self).__init__()
self._diskSize = {}
self._di... |
# 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... |
# !/usr/bin/env python
#
# Hornet - SSH Honeypot
#
# Copyright (C) 2015 Aniket Panse <aniketpanse@gmail.com>
#
# 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... |
import os
import bpy
import bmesh
import mathutils
from bpy.props import (BoolProperty, FloatProperty, StringProperty, EnumProperty)
from bpy_extras.io_utils import (ImportHelper, ExportHelper, unpack_list, unpack_face_list, axis_conversion)
# Infomation
bl_info = {
'name' : 'YSFS 2.0 - DNM Parts as SRF file... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pygame import mixer
import threading, random, socket
play = 0
file = 0
sock = socket.socket()
sock.bind(('', 6000))
sock.listen(1)
conn, addr = sock.accept()
#sock.settimeout(.01)
def soundPlayer(arg3, soundPlayer_stop):
global file
global play
while 1... |
#!/usr/bin/env python
#
# Copyright (c) 2011, Yubico AB
# All rights reserved.
#
# Utility to send a MONITOR_EXIT command to a YubiHSM.
#
# MONITOR_EXIT only works if the YubiHSM is in debug mode. It would
# be a security problem to allow remote reconfiguration of a production
# YubiHSM.
#
# If your YubiHSM is not in d... |
from copy import deepcopy
from sklearn.cross_validation import StratifiedKFold, StratifiedShuffleSplit
from xgboost.sklearn import XGBClassifier
import numpy as np
N_FOLDS = 5
CV_NUM = 1
EVAL_METRIC = "auc"
EARLY_STOPPING_ROUNDS = 100
N_ESTIMATORS = 1000000
OBJECTIVE = "binary:logistic"
GET_BEST_SCORE_INDEX = np.argma... |
from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
# Python stdlib imports
from io import BytesIO
import zipfile
# package imports
from openpyxl.tests.helper import compare_xml
from openpyxl.reader.excel import load_workbook
from openpyxl.writer.excel import save_virtual_workbook
from openpyxl... |
# -*- coding: utf-8 -*-
import socket
from .common import * # noqa
# DEBUG
# ------------------------------------------------------------------------------
DEBUG = env.bool("DJANGO_DEBUG", default=True)
TEMPLATES[0]["OPTIONS"]["debug"] = DEBUG
# SECRET CONFIGURATION
# -----------------------------------------------... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Bottle is a fast and simple micro-framework for small web applications. It
offers request dispatching (Routes) with url parameter support, templates,
a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and
template engines - all in a single file an... |
# The MIT License (MIT)
#
# Copyright (c) 2015 Rashied Imambaks
#
# 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, ... |
import os
import glob
import BuildNode
#INPUT_FILENAME = "../Sample Blueprint code/SimpleMoveToActor-Network - Code.txt";
#INPUT_FILENAME = "../Sample Blueprint code/SpawnObjectsWithForLoop - Code.txt";
#INPUT_FILENAME = "../Sample Blueprint code/SpawnRoundTargetPoint - Code.txt";
#INPUT_FILENAME = "../Sample Bluepri... |
# coding=utf-8
"""
Implements PowerManagement functions using GetSystemPowerStatus.
Requires Windows XP+.
Observing is not supported
"""
from ctypes import Structure, wintypes, POINTER, windll, WinError, pointer, WINFUNCTYPE
import warnings
from power import common
# GetSystemPowerStatus
# Returns brief description o... |
from django.conf import settings
from django.db import models
from django.utils import importlib
import MySQLdb as mysql
from nose.tools import assert_raises, eq_
from pyquery import PyQuery as pq
from olympia.amo.tests import TestCase
from olympia.addons.models import Addon
def pubdir(ob):
for name in dir(ob):... |
'''
Created on Feb 18, 2015
@author: adista@bizoft
'''
from openerp.osv import fields, osv
class hr_employee_category(osv.osv):
_inherit = 'hr.employee.category'
_columns = {
'code' : fields.char(string='Kode'),
'type' : fields.selection([('area', 'Area'), ('unitup', 'Unit Up')], string='Tipe... |
#!/bin/env python
#:############################################
#: GZINFLATEKILLER
#: by Les Cordell
#:
#: Hunt through files containing a base64
#: GZInflate Command
#:
#: Written on 07/08/2013
#: last modified @ 07/08/2013
#:############################################
import sys, os, re
#: Extensions constant, th... |
# 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 distributed in the hope that it will be useful
# but... |
#!/usr/bin/env python
'''
Create a program that opens the 'r1_cdp.txt' file and using regular
expressions extracts the remote hostname, remote IP address, model, vendor,
and device_type.
'''
import re
from pprint import pprint
def generic_cdp_parser(pattern, cdp):
'''
Search for pattern in the cdp data
... |
#!/usr/bin/python3
import sys
print("""
petri net "The drinking philosophers for n=2" {
places {
p1h p1e
p2h p2e
req1p1 req1p2
req2p1 req2p2
fork1p1 fork1p2
fork2p1 fork2p2
fork1clean fork1dirty
fork2clean fork2dirty
}
transitions {
... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-26 13:57
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('exercise', '0004_auto_20170126_1157'),
]
operations = [
migrations.AddField... |
import os.path
# Configuration modules.
from ._installed_apps import *
from ._middleware import *
from ._context_processors import *
from ._email import *
from ._eclaim import *
_ = lambda s: s
# Debugging mode.
DEBUG = False
TEMPLATE_DEBUG = False
if DEMO_MODE:
SEND_NOTIF_EMAILS = False
else:
SEND_NOTIF_... |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from flask_pluginengine import plugin_context
from wtforms.fields import SubmitField, TextAreaField
from ... |
# -*- coding: utf-8 -*-
from wakatime.main import execute
from wakatime.packages import requests
import logging
import os
import time
import shutil
from testfixtures import log_capture
from wakatime.compat import is_py26, u
from wakatime.constants import SUCCESS
from wakatime.exceptions import NotYetImplemented
from... |
from setuptools import find_packages
from setuptools import setup
import os
version = '1.0'
setup(
name='docpool.theme',
version=version,
description="DocPool Theme",
long_description=open("README.txt").read()
+ "\n"
+ open(os.path.join("docs", "HISTORY.txt")).read(),
# Get more strings ... |
'''
Copyright (c) 2011-2017, Agora Games, LLC All rights reserved.
https://github.com/agoragames/haigha/blob/master/LICENSE.txt
'''
import logging
from chai import Chai
from haigha import connection, __version__
from haigha.connection import Connection, ConnectionChannel, ConnectionError, ConnectionClosed
from haigh... |
#!/usr/bin/env python
# This script compiles the chosen file(s) or directory
import os
import re
import sys
import getopt
### Define constants ##########################################################
# Executables
GCC2SUIF = 'gcc2suif'
SUIFDRIVER = 'suifdriver'
# Environment variables
CONST_ENV_VAR_ROCCCHOME='R... |
# -*- coding: utf-8 -*-
# Copyright 2017 Akretion (http://www.akretion.com).
# @author Benoît GUILLOT <benoit.guillot@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
promotion_r... |
import sys
import os
import re
import math
import utils
import logging
logger = logging.getLogger('Linalg')
cmd_logger = logging.getLogger('cmd')
# Exact configuration here will depends on instance/hardware type.
def run_rankfile(linalg_params):
logger.info("--- Generating rankfile ---")
machines = linal... |
"""
Given a non-negative integer num represented as a string, remove k digits from
the number so that the new number is the smallest possible.
Note:
The length of num is less than 10002 and will be ≥ k.
The given num does not contain any leading zero.
Example 1:
Input: num = "1432219", k = 3
Output: ... |
from Events.draw import *
from Events.quitcleanup import *
from Libraries.Buttons import *
from config import *
import pygame
class BaseView:
"""..."""
def __init__(self, evManager):
self.evManager = evManager
self.evManager.RegisterListener(self)
size = (Config.DEFAULT_WIDTH, Conf... |
# -*- coding: utf8 -*-
import urllib, urllib2
import json
# key and secret通过创建豆瓣app获得(无审核)
# http://developers.douban.com/apikey/
APIKEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
SECRET = 'xxxxxxxxxxxxxxxx'
CALLBACK_URL = 'http://www.douban.com'
GETTOKEN_URL = 'https://www.douban.com/service/auth2/token'
def getToken(cod... |
# -*- coding: utf-8 -*-
import platform
import struct
from construct import Container
from construct.core import FieldError
from datetime import datetime
from time import sleep
from zlib import crc32
from constants import *
from structs import *
from helpers import *
MESSAGE_HANDLERS = []
DEBUG = True
def prepare_... |
import logging
import knuckle
import ui
logging.basicConfig(level=logging.INFO)
UP = 24
DOWN = 25
LEFT = 27
RIGHT = 26
A = ord('A')
B = ord('B')
class GamepadWindow(ui.Widget):
def __init__(self, ui):
super(GamepadWindow, self).__init__(ui, 10, 10, 40, 20)
self.dirty = True
self.butto... |
run_script = True
import scribus
from tempfile import NamedTemporaryFile
try:
import markdown
except:
scribus.messageBox('python-markdown not installed',
'You need to install python-markdown for this script to work', scribus.ICON_WARNING)
run_script = False
run_script &= bool(scribus.getSelectedObjec... |
#
# 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... |
__author__ = 'Dominic Miglar <dominic.miglar@bitmovin.net>'
import unittest
from bitcodin import create_output
from bitcodin import delete_output
from bitcodin import FTPOutput
from bitcodin.test.settings import ftp_output_config
from bitcodin.test.bitcodin_test_case import BitcodinTestCase
class CreateFTPOutputTest... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free So... |
#!/usr/bin/python2
# Randy Armknecht
# 19 Feb 2014
#
# Playing around with the Natural Language Processing Toolkit (nltk)
# http://www.nltk.org/
#
from __future__ import division
import sys
import nltk
from nltk.corpus import cmudict
from nltk.corpus import stopwords
from pprint import pprint
from hyphen import Hyphe... |
# FIXME -- move back to core
def apply_correspondence(correspondence_src, correspondence_dst, vertices):
"""
Apply a correspondence defined between two vertex sets to a new set.
Identifies a correspondence between `correspondence_src` and
`correspondence_dst` then applies that correspondence to `verti... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from mock import patch, Mock
from pytest import raises, mark
from fabutils.lint import is_pylint_compliant
@patch('fabutils.lint.print', Mock())
@patch('fabutils.lint.infomsg', Mock())
def test_raises_ValueError_if_passed_iterable_is_actually_a_string():
... |
import Downloader.DataOperations as DataOperations
import Downloader.KerasPreparation as KerasPreparation
import os
import shutil
import numpy as np
import random
import math
import Downloader.Defaults
from Omnipresent import file_exists_and_accesible
class Dataset:
'''
Common base class for a Dataset
Wha... |
from __future__ import absolute_import
from opentracing import SpanContextCorruptedException
from .context import SpanContext
from .propagator import Propagator
prefix_tracer_state = 'ot-tracer-'
prefix_baggage = 'ot-baggage-'
field_name_trace_id = prefix_tracer_state + 'traceid'
field_name_span_id = prefix_tracer_st... |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('urlrewriter')
class UrlRewritingError(Exception):
def __init__(s... |
from enum import Enum, unique
TEST_EMAIL_MODE = 'print' # 'test email'
TEST_EMAIL_ADDR = 'Membership Chair <me@mail.com>'
@unique
class MembershipStatus(Enum):
expired = 0 # 'expired' must be < 'expiring'
expiring = 10
active = 11
admin = 100
coordator = 200
CHOICES_MEM_... |
from collections import OrderedDict
from .errors import InvalidData, InvalidDataSize, InvalidModelDeclaration
from .fields import BaseFieldInstructor, DefaultByteOrder
__all__ = (
'InstructorModel',
)
class Opts(object):
pass
class MetaInstructor(type):
def __new__(cls, name, bases, attrs):
d... |
# Copyright (c) 2012 NetApp, Inc.
# Copyright (c) 2014 Red Hat, 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... |
import os
from io import open
import versioneer
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = ''.join([
line for line in f.readlines() if 'travis-ci' not in line
])
setup(
... |
# systemd-sysv-generator integration test
#
# (C) 2015 Canonical Ltd.
# Author: Martin Pitt <martin.pitt@ubuntu.com>
#
# systemd 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 2.1 of the... |
# encoding: utf-8
"""
etag.py
Created by Thomas Mangin on 2014-06-26.
Copyright (c) 2014-2015 Orange. All rights reserved.
Copyright (c) 2014-2015 Exa Networks. All rights reserved.
"""
# TODO: take into account E-VPN specs that specify the role of the first bit of ESI
# (since draft-ietf-l2vpn-evpn-05)
from struct ... |
#!/usr/bin/env python
import SimpleHTTPServer
import SocketServer
import PotGenerator
import os
import logging
import logging.handlers
import sys
import time
import rotate3D2
from urlparse import urlparse, parse_qs
try:
os.chdir('/home/pi/PotteryOnline/')
except:
print 'executing from current direcory'
PORT = 80... |
from __future__ import unicode_literals
from django.db import models
models.options.DEFAULT_NAMES += ('_DATABASE',)
class Booking(models.Model):
setid = models.CharField(max_length=40, blank=True, null=True)
siteid = models.CharField(max_length=40, blank=True, null=True)
roomid = models.CharField(max_l... |
#!/usr/bin/env python
"""
Functions to convert force data
This module can be also executed.
"""
__author__ = 'Oliver Lindemann'
import os
import sys
import gzip
import numpy as np
from .read_force_data import read_raw_data, data_frame_to_text
PAUSE_CRITERION = 500
MSEC_PER_SAMPLES = 1
REF_SAMPLE_PROBE = 1000
MIN_D... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.