code stringlengths 1 199k |
|---|
from .gri import GerritRepoInfo # noqa
from .jbi import JenkinsBuildInfo # noqa
from .wni import WorkfrontNoteInfo # noqa |
import csv
def list_words(text):
words = []
words_tmp = text.lower().split()
for p in words_tmp:
if p not in words and len(p) > 2:
words.append(p)
return words
def training(texts):
c_words ={}
c_categories ={}
c_texts = 0
c_tot_words =0
for t in texts:
c_t... |
import time
def start():
return time.time() |
"""
This file contains the dummy for a magnet interface.
Qudi 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.
Qudi is distributed in the hope... |
def get_word(piter):
a = piter.copy()
b = piter.copy()
while True:
if a.starts_line():
break
a.backward_char()
ch = a.get_char()
#if not (ch.isalnum() or ch in ['_', ':', '.', '-', '>']):
if not (ch.isalnum() or ch in "_:.->"):
a.forward_char()... |
from greencouriers.tests import *
class TestAuthController(TestController):
def test_index(self):
response = self.app.get(url(controller='auth', action='index'))
# Test response... |
from __future__ import with_statement
import os
from os.path import join
from os.path import abspath
import logging
import subprocess
import Image
import TiffImagePlugin
import PngImagePlugin
import GifImagePlugin
import JpegImagePlugin
class OCR(object):
__name__ = "OCR"
__type__ = "ocr"
__version__ = "0.1... |
""" nenga.address.migrations module """ |
from random import randrange
MAX = 100000
args = [randrange(MAX) for x in range(2 * MAX)]
args1 = [randrange(MAX) for x in range(MAX)]
args2 = [randrange(MAX) + MAX for x in range(MAX)]
def mkdel(s):
return "delete " + str(s)
def mkins(s):
return "insert " + str(s)
def mknext(s):
return "next " + str(s)
print ... |
"""
By starting at the top of the triangle below and moving to adjacent
numbers on the row below, the maximum total from top to bottom is 23.
3
7 4
2 4 6
8 5 9 3
... |
p = 'noobie'
if p == 'hacking':
print('Hack the planet!')
else:
print('Falso')
'''
A condição retornou falso pq
o valor atribuído em p não é igual a hacking
''' |
import jarray
g = gs.open(gs.args[0])
istates = gs.associated(g, "initialState", True).getInitialStates()
ssrv = gs.service("stable")
def copy_path(values, coreNodes):
n = len(coreNodes)
path = jarray.zeros(n, 'b')
i = 0
for idx in coreNodes:
path[i] = values[idx]
i += 1
return path
... |
import ftplib
import os.path
import sys
p_debug = False
def ftp_rmdir(ftp, folder, remove_toplevel, dontremove):
for filename, attr in ftp.mlsd(folder):
if attr['type'] == 'file' and filename not in dontremove:
if p_debug:
print(
'removing file [{0}] from fold... |
from __future__ import unicode_literals
import errno
import hashlib
import os
from utils import paths
from utils import context
def get_cache_directory():
return paths.get_launcher_directory('filecache')
def map_file(url):
"""Get the path where the file should be stored in the cache."""
file_name = hashlib.... |
from phystricks import *
def QWEHooSRqSdw():
pspict,fig = SinglePicture("QWEHooSRqSdw")
pspict.dilatation(3)
A=Point(0,0)
O=Point(0,2)
B=Point(3,0)
s1=Segment(A,O)
s2=Segment(O,B)
angle=AngleAOB(A,O,B,r=0.7)
angle.put_mark(text="\( c\)",pspict=pspict)
pspict.DrawGraphs(angle,s1,s... |
import json
import datetime
import time
import supybot.ircmsgs as ircmsgs
import supybot.schedule as schedule
import supybot.conf as conf
import supybot.utils as utils
from supybot.commands import *
import supybot.plugins as plugins
import supybot.ircutils as ircutils
import supybot.callbacks as callbacks
try:
from... |
import pytest
import tempfile
import shutil
import os
import music_rename
from music_rename import checksum
@pytest.fixture()
def empty(request):
dir = tempfile.mkdtemp()
os.mknod(os.path.join(dir, 'empty.txt'))
def cleanup():
shutil.rmtree(dir)
request.addfinalizer(cleanup)
return os.path.j... |
from __future__ import absolute_import, unicode_literals
__author__ = 'admin'
from .celery import appautoticket as celery_app
__all__ = ['celery_app'] |
import setuptools
import sys
import numpy as np
extra_compile_args = []
if sys.platform == 'win32':
extra_compile_args += [
'/std:c++11', '/O2'
]
else:
extra_compile_args += [
'-std=c++11', '-O3', '-ffast-math', '-pthread'
]
if sys.platform == 'darwin':
extra_compile_args += [ '-stdlib=libc++', '-mmac... |
import copy
import time
import socket
import logging
import vdns.common
class Zone0:
"""
Base class for producing zone files
"""
def __init__(self, dt):
self.dt=dt
def fmttd(self, td):
"""
Format a timedelta value to something that's appropriate for
zones
"""
... |
from django.core.management.base import NoArgsCommand
from askbot.models import User
from optparse import make_option
from askbot.utils.console import choice_dialog
NUM_USERS = 40
NUM_QUESTIONS = 40
NUM_ANSWERS = 20
NUM_COMMENTS = 20
INITIAL_REPUTATION = 500
USERNAME_TEMPLATE = "test_user_%s"
PASSWORD_TEMPLATE = "test_... |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('smmapdfs_edit', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='pdfsandwichemailconnector',
name='administrative_un... |
"""
Add a description of the plugin (to be presented to the user inside the wizard)
here. This should describe *what* the plugin does.
"""
import supybot
import supybot.world as world
__version__ = ""
__author__ = supybot.authors.unknown
__contributors__ = {}
__url__ = '' # 'http://supybot.com/Members/yourname/Twitter... |
import scapy
import os,sys
import printerInfo
import enum
from enum import Enum
from scapy.all import *
import time, datetime
class Message(Enum):
AUTH = "0"
DEAUTH = "1"
PROBE_REQ = "2"
PROBE_RESP = "3"
HAND_SUCC = "4"
HAND_FAIL = "5"
CORR_PACK = "6"
RTS = "7"
CTS = "8"
ACK = "9... |
#!/usr/bin/python
"""
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 Foundation, either versi... |
"""Multiple EOF analysis for :py:mod:`numpy` array data."""
import numpy as np
import numpy.ma as ma
from eofsolve import EofSolver
from errors import EofError
class MultipleEofSolver(object):
"""Multiple EOF analysis (:py:mod:`numpy` interface)."""
def __init__(self, *datasets, **kwargs):
"""Create a M... |
from Defines import *
from Utils import *
from ObjEnv import *
from ObjCfg import *
class ObjMailBase( ObjCfgMail ):
DEFAULT_MAIL_CFG = """\
""" % ( SWCFG_STABILIZE_SECT, SWCFG_MAIL_PUSH_SECT )
CMD_SEND_MAIL_TEMPL = "echo -e \"%s\" | /bin/mail \"%s\" -s \"%s\" %s %s %s"
def __init__( self, file, section ):
su... |
import pytest
from tchart.decorators import PaperDecorator
@pytest.mark.parametrize('lines,expected_lines', (
(
[
u'0',
],
[
u' .---. ',
u' / . \\ ',
u' |\\_/| |',
u' | | /|',
u' .-------- |'... |
"""@brief MTTT's core commands, stems from the original version created using Gtk https://github.com/roxana-lafuente/MTTT"""
def install_and_import(package):
import importlib
try:
importlib.import_module(package)
except ImportError:
try:
import pip
except ImportError:
print "no ... |
initial_consul_data = {
"update" : {
"providers/va_standalone_servers" : {"username": "admin", "servers": [], "sec_groups": [], "images": [], "password": "admin", "ip_address": "127.0.0.1", "networks": [], "sizes": [], "driver_name": "generic_driver", "location": "", "defaults": {}, "provider_name": "va_sta... |
"""
testlib.py
==========
Helper functions for unit tests
"""
from copy import deepcopy
import wx
from src.lib.undo import stack as undo_stack
grid_values = { \
(0, 0, 0): "'Test'",
(999, 0, 0): "1",
(999, 99, 0): "$^%&$^",
(0, 1, 0): "1",
(0, 2, 0): "2",
(1, 1, 0): "3",
(1, 2, 0): "4",
... |
from math import log
def make_logarithmic_function(base):
return lambda x: log(x, base)
My_LF = make_logarithmic_function(3)
print(My_LF(9)) |
from odoo.api import Environment
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT
from datetime import date, timedelta
import odoo.tests
class TestUi(odoo.tests.HttpCase):
def test_01_pos_basic_order(self):
env = self.env(user=self.env.ref('base.user_admin'))
journal_obj = env['account.journal']
... |
from collections import namedtuple
from pdfrw import PdfName, PdfDict, PdfObject, PdfString
PageLabelTuple = namedtuple("PageLabelScheme",
"startpage style prefix firstpagenum")
defaults = {"style": "arabic", "prefix": '', "firstpagenum": 1}
styles = {"arabic": PdfName('D'),
"roman... |
""" This does mostly the same as the review token commit hook,
but is designed to run locally.
It will echo to standard out a fixed up version of the
review token given to it; this can be used to quickly
apply any format changes to a token (such as new fields).
It will then echo to standard error a ... |
"""
This package contains different `unittests <https://docs.python.org/3/library/unittest.html>`_ for the project.
Those tests help to validate difficult pieces of the software.
"""
__author__ = 'Wuersch Marcel'
__license__ = "GPLv3" |
import os
import binascii
import json
from txjsonrpc.web.jsonrpc import Proxy
from txjsonrpc.web import jsonrpc
from twisted.web import server
from twisted.internet import reactor
try:
from OpenSSL import SSL
from twisted.internet import ssl
except:
pass
from .base import (get_current_blockheight, CoinSwapP... |
import shutil
from collections import OrderedDict
import math
import os
import copy
import proteindf_tools as pdf
import proteindf_bridge as bridge
from .qcfragment import QcFragment
import logging
logger = logging.getLogger(__name__)
class QcFrame(object):
_pdfparam_filename = "pdfparam.mpac"
_db_filename = "p... |
import numpy as np
import pygame
from sklearn.mixture import GMM
from math import sqrt, atan, pi
def emFit(results, numComponents):
if len(results) == 0:
return None
m =np.matrix(results)
gmm = GMM(numComponents,covariance_type='full', n_iter= 100, n_init = 4)
gmm.fit(results)
components = [... |
class Frequent():
def __init__(self):
self.counters = {}
def add(self, item, k, k2, t):
if item in self.counters:
counters[item] = counters[item] + 1
elif len(self.counters) <= k:
self.counters[item] = 1
else:
for key, value in self.counters.... |
import numpy
class RotationTranslation:
"""Combined translational and rotational transformation.
This is a subclass of Transformation.
Objects of this class are not created directly, but can be the
result of a composition of rotations and translations.
"""
def __init__(self, tensor, vector):
se... |
""" Store only meta data but no real data (except from store state of nodes) """
import logging
import os
import pwd
import yaml
from pySPACE.resources.dataset_defs.base import BaseDataset
class DummyDataset(BaseDataset):
""" Class to store only meta data of collection
This class overrides the 'store' method
... |
"""
WSGI config for ncbi project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODU... |
import logging
from unittest import TestCase
from sass_to_scss import SassToSCSS
class TestSassToSCSS(TestCase):
def setUp(self):
self.sassy = SassToSCSS(loglevel=logging.DEBUG)
def trim_docstring(self, docstring):
return '\n'.join(docstring.split('\n')[1:-1])
def test_double_spaces(self):
... |
from smewt.base.utils import tolist, toresult
from smewt.base.textutils import u
from smewt.base.subtitletask import SubtitleTask
from smewt.plugins import mplayer
from guessit.language import Language
import smewt
import os, sys, time
import subprocess
import logging
log = logging.getLogger(__name__)
def get_episodes_... |
"""
Synchronization between blobs client/server
"""
from collections import defaultdict
from twisted.internet import defer
from twisted.internet import reactor
from twisted.logger import Logger
from twisted.internet import error
from .sql import SyncStatus
from .errors import RetriableTransferError
logger = Logger()
de... |
import logging
import pickle
import random
from gevent import Greenlet, sleep
from threading import Lock
from app import create_app
from dota_bot import DotaBot
from models import db, DynamicConfiguration, Game, GameStatus, GameVIP
from helpers.general import divide_vip_list_per_type
logging.basicConfig(format='[%(asct... |
sh_now = sh.now()
debug = False
def leap_year(year):
if (year % 400 == 0) or ((year % 4 == 0) and not (year % 100 == 0)):
return True
else:
return False
def days_of_month(month, year):
if month in [1, 3, 5, 7, 8, 10, 12]:
days = 31
elif month in [4, 6, 9, 11]:
days = 30
... |
from autopilot.matchers import Eventually
from testtools.matchers import Equals
from bmicalc import tests
class MainViewTestCase(tests.BaseTestCase):
"""Tests for the mainview"""
def setUp(self):
super(MainViewTestCase, self).setUp()
def test_click_button(self):
# Find and click the button
... |
from __future__ import absolute_import, division, unicode_literals
import codecs
import re
from io import StringIO
from pip._vendor import webencodings
from pip._vendor.six import text_type, binary_type
from pip._vendor.six.moves import http_client, urllib
from . import _utils
from .constants import EOF, spaceCharacter... |
"""
Test copying a package category in the library editor
"""
def test(library_editor, helpers):
"""
Copy package category with "New Library Element" wizard
"""
le = library_editor
# Open "New Library Element" wizard
le.action('libraryEditorActionNewElement').trigger(blocking=False)
# Choose... |
"""
quartet_samping.py: Quartet Sampling method for
phylogenetic branch support evaluation
<http://www.github.com/FePhyFoFum/quartetsampling>
"""
import argparse
import os
import sys
import time
from multiprocessing import Manager, Pool
from shutil import copyfile
from tree_data import TreeData, write_test_trees
from r... |
from __future__ import unicode_literals
import time
from operator import itemgetter
from sqlalchemy.sql import func, select
from indico.core.db.sqlalchemy import db
from indico.core.db.sqlalchemy.protection import ProtectionMode
from indico.modules.groups import GroupProxy
from indico_migrate.logger import logger_proxy... |
"""This module provides REST services for Layers"""
import cherrypy
from LmCommon.common.lmconstants import HTTPStatus
from LmWebServer.common.lmconstants import HTTPMethod
from LmWebServer.services.api.v2.base import LmService
from LmWebServer.services.common.access_control import check_user_permission
from LmWebServe... |
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import sys
sys.path.append('./MNIST_data')
import os.path
from download import download
have_data = os.path.exists('MNIST_data/train-images-idx3-ubyte.gz')
if not have_data:
download('./MNIST_data')
mnist = input_data.read_data_sets(... |
import logging
from time import sleep
from ethereum import keys
from golem.ethereum import Client
from golem.ethereum.paymentprocessor import PaymentProcessor
from golem.transactions.transactionsystem import TransactionSystem
log = logging.getLogger('golem.pay')
class EthereumTransactionSystem(TransactionSystem):
"... |
import urllib2, re, json, time, xbmc, traceback
from _header import *
BASE_URL = 'http://cinemaonline.kg/'
BASE_NAME = 'Cinema Online'
BASE_LABEL = 'oc'
GA_CODE = 'UA-34889597-1'
NK_CODE = '1744'
def default_oc_noty():
plugin.notify('Сервер недоступен', BASE_NAME, image=get_local_icon('noty_' + BASE_LABEL))
def get... |
from openpyxl import load_workbook
import os
keyWordList = ['Resume', 'Label', 'Description', 'ClueText', 'Title', 'QTEtitle']
docDir = "d:/svn/ue3/SH8Game/Production/Data/"
logFile = 'd:/sh8/xlsx_python_tests/genlog.txt'
def FindBase(sheetName, keyWord):
for col in range(1,50):
findSpokenCoord = sheetName.cell(row... |
import logging
from email.header import decode_header
from email.utils import formataddr
from odoo import _, api, fields, models, SUPERUSER_ID, tools
from odoo.exceptions import UserError, AccessError
from odoo.osv import expression
_logger = logging.getLogger(__name__)
def decode(text):
"""Returns unicode() string... |
import bpy
def popup_list(op, title: str, msgs: list, icon: str = "INFO") -> None:
def draw(self, context):
for text in msgs:
self.layout.label(text=text)
op.report({"INFO"}, f"{title}:")
for text in msgs:
op.report({"INFO"}, text)
bpy.context.window_manager.popup_menu(draw, ... |
'''
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as published by
the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABI... |
import numpy as np
from .AbstractEval import AbstractEval
class DcgEval(AbstractEval):
"""Compute DCG (with gain = 2**rel-1 and log2 discount)."""
def get_dcg(self, ranked_labels, cutoff=-1):
"""
Get the dcg value of a list ranking.
Does not check if the numer for ranked labels is smalle... |
"""Package for suites and tests related to bots.modules package"""
import pytest
from qacode.core.bots.modules.nav_base import NavBase
from qacode.core.exceptions.core_exception import CoreException
from qacode.core.testing.asserts import Assert
from qacode.core.testing.test_info import TestInfoBotUnique
from qacode.ut... |
from django.db import models
from .common_info import CommonInfo
from django.utils import timezone
from django.urls import reverse
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.core.validators import URLValidator
def validate_nonzero(value):
i... |
import os
from collections import namedtuple
from copy import copy
Colour = namedtuple('Colour', 'r,g,b')
Colour.copy = lambda self: copy(self)
black = Colour(0, 0, 0)
white = Colour(255, 255, 255) # Colour ranges are not enforced.
class Bitmap():
def __init__(self, width=40, height=40, background=white):
... |
import bpy
from functions import *
class Combination():
'''A class containing all properties and methods
relative to combination settings for
Curve To Frame addon'''
def update_curves( self, context ):
'''method that must be over ride: update curve when settings have been changed'''
type(self).update_curves( ... |
import os
import sys
import locale
import signal
from gajim.common import exceptions
from gajim.common.i18n import _
from gajim.common.i18n import Q_
signal.signal(signal.SIGINT, signal.SIG_DFL) # ^C exits the application
try:
PREFERRED_ENCODING = locale.getpreferredencoding()
except Exception:
PREFERRED_ENCODI... |
__RCSID__ = "$Id$"
from DIRAC.AccountingSystem.Client.Types.BaseAccountingType import BaseAccountingType
class Pilot(BaseAccountingType):
def __init__(self):
BaseAccountingType.__init__(self)
self.definitionKeyFields = [('User', 'VARCHAR(64)'),
('UserGroup', 'VARCHAR(32)'),
... |
import logging
EXIF_TAGS = {
0x0100: "ImageWidth",
0x0101: "ImageLength",
0x0102: "BitsPerSample",
0x0103: "Compression",
0x0106: "PhotometricInterpretation",
0x010A: "FillOrder",
0x010D: "DocumentName",
0x010E: "ImageDescription",
0x010F: "Make",
0x0110: "Model",
0x0111: "St... |
SEFARIA_API_NODE = "https://www.sefaria.org/api/texts/"
CACHE_MONITOR_LOOP_DELAY_IN_SECONDS = 86400
CACHE_LIFETIME_SECONDS = 604800
category_colors = {
"Commentary": "#4871bf",
"Tanakh": "#004e5f",
"Midrash": "#5d956f",
"Mishnah": "#5a99b7",
"Talmud": "#cc... |
T = input()
while(T):
T -= 1
buff = []
a,b = [int(i) for i in raw_input().split()]
buff.append(b)
pt = 0
while(a):
a -= 1
c = [i for i in raw_input().split()]
if len(c)==2:
c[1] = int(c[1])
if c[0] == "P":
buff.append(c[1])
#pt ... |
class SingleList:
"""Documentation for SingleList
"""
def __init__(self, initial_list=None):
self.__list = []
if initial_list:
for value in initial_list:
if value not in self.__list:
self.__list.append(value)
def __str__(self):
temp... |
from pyqode.qt import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(1280, 1024)
Dialog.setMinimumSize(QtCore.QSize(500, 500))
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/ide-icons/rc/silex-19... |
"""
================================================
Following the Metal to Mott insulator Transition
================================================
Sequence of plots showing the transfer of spectral weight for a Hubbard
Model in the Bethe Lattice as the local dopping is increased.
"""
from __future__ import division... |
"""
test_url.py
websocket - WebSocket client library for Python
Copyright 2021 engn33r
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... |
""" Script for building the Pieman package. """
from setuptools import setup
try:
import pypandoc
LONG_DESCRIPTION = pypandoc.convert('README.md', 'rst')
except (ImportError, OSError):
# OSError is raised when pandoc is not installed.
LONG_DESCRIPTION = ('Utilities written in Python which are used by '
... |
import sys, re
for fn in sys.argv[1:]:
with open(fn, 'r') as f:
s = f.read()
xx = re.findall(r'([^\n]+)\s+\'\'\'(.*?)\'\'\'', s, re.M|re.S)
for (obj, doc) in xx:
s = re.findall('[^:`]\B(([`*])[a-zA-Z_][a-zA-Z0-9_]*\\2)\B', doc)
if s:
print '-'*50
... |
from vsg import parser
class if_label(parser.label):
'''
unique_id = if_statement : if_label
'''
def __init__(self, sString):
parser.label.__init__(self, sString)
class label_colon(parser.label_colon):
'''
unique_id = if_statement : label_colon
'''
def __init__(self):
par... |
"""This module contains constants used by the Lifemapper web services
"""
import os
from LmServer.base.utilities import get_mjd_time_from_iso_8601
from LmServer.common.lmconstants import SESSION_DIR
from LmServer.common.localconstants import SCRATCH_PATH, APP_PATH
from LmWebServer.common.localconstants import PACKAGING... |
from mrjob.job import MRJob
from mrjob.step import MRStep
def get_id_from_line(line):
if line.find('.","Message-ID: <') > 0:
start = line.find("Message-ID")+13
i=0
for char in line[start:]:
i=i+1
if (not (char.isdigit() or (char == '.'))):
stop = i+start-2
break
return line[start:stop]
class MRMu... |
from MainWindow import Controller |
from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from socketio import sdjango
from web.api import EventResource, SummaryFeedResource, SummaryFeedByCountryCodeResource
from tastypie.api import Api
sdjango.autodiscover()
v1_api = Api(api_name='v1')
v1... |
import numpy
import logging
import sys
from apgl.graph import *
from apgl.generator import *
from sandbox.util.ProfileUtils import ProfileUtils
from exp.sandbox.predictors.leafrank.SVMLeafRank import SVMLeafRank
from exp.sandbox.predictors.TreeRank import TreeRank
logging.basicConfig(stream=sys.stdout, level=logging.DE... |
import sys
from PyQt4 import QtGui,QtCore
from Ui_about_author import Ui_About
_IME = "<p>Author: Bojan Ili""ć</p>"
_FAKULTET = "Faculty of Electrical Engineering, University of Belgrade - ETF"
_MAIL = "https.rs@gmail.com"
_URL = "<a href = ""https://www.facebook.com/puzicius>Facebook link</a>"
class AboutWindow2(... |
from PyQt4.Qsci import QsciLexerCPP
from PyQt4.QtGui import QColor
from src import editor_scheme
from src.core import settings
class Lexer(QsciLexerCPP):
""" Lexer class """
def __init__(self, *args, **kwargs):
super(Lexer, self).__init__(*args, **kwargs)
# Configuración
self.setStylePre... |
def dummy_export_progress_cb(*args, **kwargs):
pass
class Exporter(object):
def __init__(self, obj, export_format):
self.obj = obj
self.export_format = str(export_format)
self.can_change_quality = False
def set_quality(quality_pourcent):
raise NotImplementedError()
def se... |
'''a module to define a cache class for pictures'''
import Cache
class PictureCache(Cache.Cache):
'''a class to maintain a cache of pictures
'''
'''a class to maintain a cache of an user avatars
'''
def __init__(self, config_path, user):
'''constructor
config_path -- the path where t... |
import numpy as np
import sys
import scipy.ndimage as ndimage
from imgmerge.readImg import ReadImageBasic
from imgmerge.image import Image
from imgmerge.readImgFactory import ReadImageFarctory
def get_dtype(color_bits):
if color_bits == 8:
return np.uint8
elif color_bits == 16:
return np.uint16
... |
from functions import logger, config
import asyncio
class MessageHandler:
def __init__(self, client, message, command, args):
''' Create a new messagehandler which handles the required parts for the commands.
disabling this module will fuck up the whole bot.'''
self.client = client
s... |
import Xlib.display
import Xlib.X
import Xlib.XK
import Xlib.protocol.event
from xutils import get_xlib_display
special_X_keysyms = {
' ' : "space",
'\t' : "Tab",
'\n' : "Return", # for some reason this needs to be cr, not lf
'\r' : "Return",
'\e' : "Escape",
'!' : "exclam",
'#' : "numbersi... |
__version__ = "0.1"
import threading
import numpy as np
import pygame
from expyriment.stimuli import Canvas
from expyriment.stimuli._visual import Visual
lock_expyriment = threading.Lock()
Numpy_array_type = type(np.array([]))
def inherit_docs(cls):
for name, func in vars(cls).items():
if not func.__doc__:
... |
import falcon
import msgpack
import json
from btree import BinaryTree
import ZODB, ZODB.FileStorage
import transaction
from persistent import Persistent
import uuid
import urllib
import btree
from pprint import pprint
class Collection (object):
def on_post(self, req, resp):
# req.stream corresponds to the WSGI wsgi.... |
import glob
import optparse
import os
import os.path
import platform
import sys
import time
utils = None
repo_root = {
'anon' : 'http://svn.boost.org/svn/boost/',
'user' : 'https://svn.boost.org/svn/boost/'
}
repo_path = {
'trunk' : 'trunk',
'release' : 'branches/rele... |
""" wrapper to make simple calls to raxml """
import os
import sys
import glob
import subprocess
from ipyrad.analysis.utils import Params
from ipyrad.assemble.utils import IPyradError
OPJ = os.path.join
class Raxml(object):
"""
RAxML analysis utility function. This tool makes it easy to build a
raxml comman... |
import psycopg2
import psycopg2.extras
import os
import subprocess
import sys
sys.path.append("C:\\Program Files\\FME\\fmeobjects\\python27")
import fmeobjects
con = None
try:
con = psycopg2.connect("dbname='chimn2' user='postgres' port='5433'")
cur = con.cursor()
cur.execute("SELECT nameformat FROM prefere... |
""" ivr - A set of IVR functions for Asterisk.
The pyst project includes several python modules to assist in programming
asterisk with python:
ivr - The IVR Template
"""
__all__ = ['ivr','test','connection', 'odbc']
__version__ = '0.0.8' |
helppage = "https://github.com/JorisPLA7/Super-D-mineur"
githubpage = "https://github.com/JorisPLA7/Super-D-mineur/"
rulepage = "http://demineur.hugames.fr/help.php"
import webbrowser
def help():
webbrowser.open(helppage)
def github():
webbrowser.open(githubpage)
def rules():
webbrowser.open(rulepage)
if __... |
import math
MAX_P = 1000
best_p = 120
best_num_sides = 3
for p in range(2, MAX_P+1):
num_sides = 0
if p % 30 == 0:
print(p)
for a in range(1, MAX_P/2 + 2):
for b in range(1, MAX_P/2 + 2):
c = p - a - b
if a > b and b > c and c**2 + b**2 == a**2 and a + b + c == p and ... |
import datetime
import tarfile
import os
import sys
test_or_prod = 'prod'
version = '0_0_5'
DSTAMP = datetime.datetime.now().strftime('%Y%m%d%H%M%S')
pgm_dir = '/var/natmsg'
sql_dir = '/home/postgres/shard/sql/' + test_or_prod
function_dir = '/home/postgres/shard/sql/' + test_or_prod + '/functions'
pgm_files = ('natura... |
"""
VM starter - start your virtual hosts based on config file
--------------------------------------------------------------------------------
@author Petr Juhanak, http://www.hackerlab.cz
@release 1.0, 20130808
@licence GPLv3 http:://www.gnu.org/licenses/gpl-3.0.html
---------------------------------------... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.