code stringlengths 1 199k |
|---|
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os, shutil, uuid, json, glob, time, cPickle, hashlib, errno, sys
from functools im... |
import json
from .utils import Presenter
class JSONPresenter(Presenter):
def __init__(self, print_func):
self.root = []
self.current = self.root
self.print_func = print_func
super().__init__()
def start(self, difference):
super().start(difference)
self.print_func(... |
from pyqtgraph.Qt import QtGui
import pyqtgraph.opengl as gl
import OpenGL.GL as ogl
import numpy as np
class CustomTextItem(gl.GLGraphicsItem.GLGraphicsItem):
def __init__(self, X=None, Y=None, Z=None, text=None, color=(255, 255, 255, 255), size=16):
gl.GLGraphicsItem.GLGraphicsItem.__init__(self)
... |
import math
class SimParam(object):
"""
SimParam
Calculates simulation time parameters based on initial date
and weather data time step, and simulation timestep
properties
dt % Simulation time-step
timeForcing % Weather data time-step
month % Begin month
... |
"""paginate helper tests."""
from __future__ import absolute_import, print_function, unicode_literals
__metaclass__ = type
__all__ = [
'TestPaginateHelper',
]
import unittest
from falcon import HTTPInvalidParam, Request
from mailman.app.lifecycle import create_list
from mailman.database.transaction import trans... |
import pytest
import modelx as mx
def t_arg(t):
pass
@pytest.fixture
def dynmodel():
"""
DynModel-----SpaceA[t]-----foo(x)
| |
| +--SpaceA[1]---foo(2) == 3
|
+--SpaceB-----RefSpaceA = SpaceA[0]
"""
m = mx.new_model("DynM... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0002_profile_reputation'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='reputation',
... |
import re
import time
from pyload.plugin.Account import Account
class TurbobitNet(Account):
__name = "TurbobitNet"
__type = "account"
__version = "0.02"
__description = """TurbobitNet account plugin"""
__license = "GPLv3"
__authors = [("zoidberg", "zoidberg@mujmail.cz")]
def lo... |
from threading import Lock
__lock = Lock()
def idgen():
i = 0
while 1:
i += 1
yield i
__id_generator = idgen()
def get_id():
with __lock:
return __id_generator.next() |
import pytest
from hms_irc.commands.spacestatus import get_instance
from hms_irc.commands.tests import build_command
@pytest.fixture
def instance(irc_server, irc_chan, rabbit):
return get_instance(irc_server, irc_chan, rabbit)
def test_invalid_argument(instance):
"""Calls the spacestatus command with invali... |
bl_info = {
"name": "Raw Binary Arena (*.rba)",
"author": "Damian Jakub Smoczyk",
"blender": (2, 74, 0),
"location": "File > Import-Export",
"description": "Export scene as RBA file",
"category": "reVision"
}
import imp
if "export_rba" in locals():
imp.reload(export_rba)
import os
import bpy
from bpy.props impor... |
import subprocess
import os
from os import walk
from ConfigParser import ConfigParser
from datetime import datetime
import re
from time import sleep
import gitlab_check as GC
import config_parser as CP
import start_fw
import ahtapot_utils
from dmrlogger import Syslogger
from dmrlogger import Filelogger
import sys
abs_p... |
"""
ORCA Open Remote Control Application
Copyright (C) 2013-2020 Carsten Thielepape
Please contact me by : http://www.orca-remote.org/
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 Foun... |
import sys, os, netifaces
from utils.discovery import get_docker_ip
from . import crud
mysql_ip = get_docker_ip('mysql')
crud.connect(
host = mysql_ip,
user = "root",
passwd = "",
db = ""
)
def level( user_id ):
if user_id == None:
return None
cursor = crud.execute(
""" ... |
import json
import redis
import traceback
import tornado.ioloop
import tornado.web
class GeoHandler(tornado.web.RequestHandler):
def initialize(self, conn):
self.conn = conn
def get(self):
try:
self.set_header("Content-Type", "text/json")
lng = self.get_argument('lng', No... |
import logging
import pickle
from time import sleep, time
from typing import Optional
from intercom.common_mongo_binding import InterComMongoInterface, generate_task_id
class InterComFrontEndBinding(InterComMongoInterface):
'''
Internal Communication FrontEnd Binding
'''
def add_analysis_task(self, fw):... |
mcinif='mcini_g63'
runname='col_test0212'
mcpick='col_test1.pickle'
pathdir='/beegfs/work/ka_oj4748/echoRD'
wdir='/beegfs/work/ka_oj4748/gen_tests'
colref='False'
prec2D='True'
update_part=200
import sys
sys.path.append(pathdir)
import run_echoRD as rE
rE.echoRD_job(mcinif=mcinif,mcpick=mcpick,runname=runname,wdir=wdir... |
from .depends import ProductResolver
from .build import TargetSettings, ArchitectureGroup
__all__ = ['ProductResolver', 'TargetSettings', 'ArchitectureGroup'] |
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from graphics.generic import Colors
class Pause(QWidget):
def __init__(self):
super().__init__()
self.background_color = "white"
self.create_background()
def create_background(self):
pal = QPalette... |
import re
from datetime import timedelta
from django.core import mail
from django.contrib.auth import get_user_model
from django.test.utils import override_settings
from django.urls import reverse
from rest_framework import status
from rest_framework.authtoken.models import Token
from rest_framework.test import APITest... |
import os
import subprocess
import wget
CURR_PATH = os.path.abspath('.')
LAST_PATH = os.path.abspath(os.path.join(CURR_PATH, os.pardir))
exe = os.system
isfile = os.path.isfile
expand = os.path.expanduser
def empty_line_at_end(func):
def wrapper():
func()
print()
return wrapper
@empty_line_at_en... |
"""491. Double pandigital number divisible by 11
https://projecteuler.net/problem=491
We call a positive integer _double pandigital_ if it uses all the digits 0 to
9 exactly twice (with no leading zero). For example, 40561817703823564929 is
one such number.
How many double pandigital numbers are divisible by 11?
""" |
from nepi.execution.attribute import Attribute, Flags, Types
from nepi.execution.trace import Trace, TraceAttr
from nepi.execution.resource import ResourceManager, clsinit_copy, \
ResourceState
from nepi.resources.ns3.ns3errormodel import NS3BaseErrorModel
@clsinit_copy
class NS3RateErrorModel(NS3BaseErrorModel... |
"""
Created on 11.05.2010
@author: RevEn
"""
class Neuron( object ):
"""
Defines properties of single neuron.
"""
def __init__( self, ):
"""
Constructor
""" |
from backbacker import command
__author__ = 'Christof Pieloth'
class ExampleCommand(command.Command):
"""An example how to implement a command."""
def __init__(self, name):
super().__init__()
self._name = name
def execute(self):
print('Hello {}!'.format(self._name))
class ExampleCliC... |
import csv
import datetime
from geonode.settings import GEONODE_APPS
from geonode.datarequests.models import DataRequestProfile
from geonode.datarequests.utils import get_juris_data_size, get_area_coverage
import geonode.settings as settings
import os, sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "geonode.settin... |
import requests
import telebot
from telebot import types
from telebot import util
logger = telebot.logger
API_URL = "https://api.telegram.org/bot{0}/{1}"
PWRAPI_URL = "https://api.pwrtelegram.xyz/bot{0}/{1}"
FILE_URL = "https://api.telegram.org/file/bot{0}/{1}"
CONNECT_TIMEOUT = 3.5
READ_TIMEOUT = 9999
def _pwr_make_re... |
import espressomd
from espressomd import thermostat
from espressomd import interactions
from espressomd import analyze
from espressomd import electrostatics
from espressomd import lb
from espressomd import galilei
import sys
import numpy as np
box_l = 48. # size of the simulation box
skin = 0.3
time_step = 0.01
eq... |
from sqlalchemy import *
from migrate import *
from migrate.changeset import schema
pre_meta = MetaData()
post_meta = MetaData()
like = Table('like', post_meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('user_id', Integer),
Column('post_id', Integer),
Column('timestamp', DateTime),... |
def func_module_test():
print("func_module_test...")
pass
def func_test():
print("module_test test...")
pass |
class BinaryTree:
'''A dictionary implemented using an unbalanced binary search tree'''
class _Node:
'''A node in the tree'''
def __init__(self, key, value, parent):
'''Creates a new leaf node'''
self.key = key
self.value = value
self.parent = pare... |
"""add user list conference participants ACL
Revision ID: 9d5a70a8fcd0
Revises: 2ff1ec9abf64
"""
from alembic import op
import sqlalchemy as sa
revision = '9d5a70a8fcd0'
down_revision = '2ff1ec9abf64'
POLICY_NAME = 'wazo_default_user_policy'
ACL_TEMPLATES = ['calld.users.me.conferences.*.participants.read']
policy_tabl... |
''' file name : morphology_1.py
Description : This sample shows how to erode and dilate images
This is Python version of this tutorial : http://opencv.itseez.com/doc/tutorials/imgproc/erosion_dilatation/erosion_dilatation.html#morphology-1
Level : Beginner
Benefits : Learn to 1) Erode, 2) Dilate and 3) Use trackbar
Usa... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tracker', '0005_auto_20170202_1320'),
]
operations = [
migrations.RemoveField(
model_name='finance',
name='yr_contract_value',
... |
from dataclasses import dataclass
import os
import subprocess
import numpy as np
from sdhc.config import logger
from sdhc.fcCalc import fcCalc
__all__ = ["SHCPostProc"]
@dataclass(frozen=True)
class SdhcResult:
smooth: np.ndarray
smooth2: np.ndarray
average: np.ndarray
error: np.ndarray
oms_fft: np.... |
mcinif='mcini_gen1a'
mcpick='gen_test1a.pickle'
runname='gen_test1211'
pathdir='/beegfs/work/ka_oj4748/echoRD'
wdir='/beegfs/work/ka_oj4748/gen_tests'
update_prec=0.01
legacy_pick=True
import sys
sys.path.append(pathdir)
import run_echoRD as rE
rE.echoRD_job(mcinif=mcinif,mcpick=mcpick,runname=runname,wdir=wdir,pathdir... |
"""Collection of os-related utilities.
"""
import os
import shutil
from ximpol.utils.logging_ import logger, abort
def check_input_file(file_path, extension=None):
"""Make sure that an input file exists (and, optionally, has the right
extension).
Note that we abort the execution with no mercy if anything fa... |
"""
Utilities for linear algebra
We only care about 3D:
* vectors are lists of length 3
* matrices are 3-by-3 lists of lists
"""
import math
class Vec3(list):
def norm(u):
return math.sqrt(u.dot(u))
def dot(u, v):
"""Dot product"""
u1, u2, u3 = u
v1, v2, v3 = v
return... |
import os
import traceback
from couchpotato import CPLog
from couchpotato.core.event import addEvent, fireEvent, fireEventAsync
from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.plugins.base import Plugin
import six
log = CPLog(__name__)
class MediaBase(Plugin):
_type = None
def init... |
import os
import unittest
from vsg.rules import port
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError = vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_600_test_input.vhd'))
class test_port_rule(unittest.TestCase):
def setUp(self):
self.oFile =... |
from django import template
from ponyFiction import context_processors
register = template.Library()
class ProjectSettings(template.Node):
def render(self, context):
context.update(context_processors.project_settings(None))
return ''
@register.tag
def project_settings(parser, token):
return Proj... |
from django.test import TestCase
from django.test import Client
from django.core.urlresolvers import reverse
from wbc.process.models import Place
from wbc.region.models import District
from wbc.region.models import Muncipality
from models import Comment
class CommentTestCase(TestCase):
def setUp(self):
a = ... |
from django.db import models
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.conf import settings
import datetime
import random
import string
import re
import os.path
from distutil... |
from gnuradio import gr, audio, blks2, uhd
from gnuradio.eng_option import eng_option
from gnuradio.wxgui import slider, powermate
from gnuradio.wxgui import stdgui2, fftsink2, form
from optparse import OptionParser
import sys
import math
import wx
class my_top_block (stdgui2.std_top_block):
def __init__(self,frame... |
import bpy
def setup(quality, fps):
### unified settings
render = bpy.context.scene.render
render.fps = fps
render.image_settings.file_format = 'TARGA'
render.parts_x = 1
render.parts_y = 1
# HDTV 720p resolution
render.resolution_x = 1280
render.resolution_y = 720
if quality==2:... |
"""This 'module' is the main entry point for the game. If this file is loaded
directly by the python interpreter, it will call the ``main()`` function."""
import os
import sys
import pygame
game_path = os.path.dirname(os.path.realpath(os.path.abspath(__file__)))
data_path = os.path.join(game_path, 'data')
save_path = o... |
from klampt import *
from klampt.math import vectorops,so3,se3
from utils.nearestneighbors import *
from utils.metric import *
from utils.disjointset import *
from collections import defaultdict
from ikdb.utils import mkdir_p
from utils.csp import *
from graph import RedundancyResolutionGraph
import networkx as nx
from... |
from vsg.rules import single_space_between_tokens
from vsg.token import context_declaration as token
class rule_018(single_space_between_tokens):
'''
This rule checks for a single space between the **end** keyword and the **context** keyword.
**Violation**
.. code-block:: vhdl
end;
end c... |
from openerp import api, models
class ProductProduct(models.Model):
_inherit = 'product.product'
@api.multi
def _get_domain_locations(self):
return super(ProductProduct, self.with_context(
force_company=self.env.user.company_id.id))._get_domain_locations() |
from PyQt5.QtCore import Qt, QT_TRANSLATE_NOOP
from PyQt5.QtWidgets import QGroupBox, QVBoxLayout, QGridLayout, QLabel, \
QComboBox, QSpinBox, QFrame
from lisp.core.has_properties import Property
from lisp.cues.cue import Cue
from lisp.modules.midi.midi_output import MIDIOutput
from lisp.modules.midi.midi_utils imp... |
import unittest
from datetime import datetime
from cylc.flow.cycling.iso8601 import init, ISO8601Sequence, ISO8601Point,\
ISO8601Interval, ingest_time
class TestISO8601Sequence(unittest.TestCase):
"""Contains unit tests for the ISO8601Sequence class."""
def setUp(self):
init(time_zone='Z')
def t... |
"""
This script prints each feature in the given JSON file along with
how many apps use it, and how many of each type (malicious or benign).
"""
import sys
import json
def main():
with open(sys.argv[1]) as f:
j = json.load(f)
all_features = j['features']
num_apps_each = {}
for app in... |
import getopt, sys, os, re, time
def usage():
print """
usage:
checkcopies.py -d <directory>
<directory> is a folder containing svg files.
looks for files that have the same content but different names
"""
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "hd:", ["help", "directo... |
import os
from celery.exceptions import TimeoutError
from flask import flash, jsonify, request, session
from markupsafe import escape
from sqlalchemy import Date, cast
from indico.core.celery import AsyncResult
from indico.core.db import db
from indico.core.db.sqlalchemy.links import LinkType
from indico.core.errors im... |
'''
Created on Apr 14, 2018
@author: dario
'''
from datetime import datetime
from sqlalchemy import (Column, DateTime, Integer, Numeric, String,
ForeignKey, Boolean)
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationsh... |
if __name__ == '__main__':
import ctypes
import sys
if sys.platform.startswith('linux'):
try:
x11 = ctypes.cdll.LoadLibrary('libX11.so')
x11.XInitThreads()
except:
print "Warning: failed to XInitThreads()"
import functools
import signal
import time
import ... |
from flask import Blueprint
api = Blueprint('api', __name__)
from . import roshandler, cloud |
import os
import re
import shutil
import uuid
import beets
import threading
import itertools
import headphones
from beets import autotag
from beets import config as beetsconfig
from beets.mediafile import MediaFile, FileTypeError, UnreadableFileError
from beetsplug import lyrics as beetslyrics
from headphones import no... |
import os
import sys
import json
import pymasterlib as lib
from pymasterlib.constants import *
def save():
program_settings = {"previous_run": lib.previous_run,
"data_dirs": lib.data_dirs}
master_settings = {"name": lib.master.name, "sex": lib.master.sex}
slave_settings = {"name": li... |
from django import forms
from django.contrib.auth import authenticate
class Login(forms.Form):
username = forms.CharField(label='Email', max_length=100)
password = forms.CharField(
label='Пароль',
max_length=100,
widget=forms.PasswordInput()
)
def __init__(self, *args, **kwargs):... |
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/pi/Documents/desenvolvimentoRos/src/angles/angles/include".split(';') if "/home/pi/Documents/desenvolvimentoRos/src/angles/angles/include" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "... |
import UserList
import copy
import re
from buildbot.data import exceptions
from twisted.internet import defer
class ResourceType(object):
name = None
plural = None
endpoints = []
keyFields = []
eventPathPatterns = ""
entityType = None
def __init__(self, master):
self.master = master
... |
from os.path import expanduser
from PyQt5 import QtCore
class Globals:
__rootPath = None
configurationPath = expanduser("~")+"/"+".fishnet"
reportABugLink = "https://github.com/cr0wbar/fishnet/issues"
programDescription = "A simple tool to search for torrents."
mailTo = "guglielmo.deconcini@gmail.co... |
'''
The sum of squares of first N natural numbers is given
by the equation ((N) * (N + 1) * (2 * N + 1)) / 6 i.e.
1^2 + 2^2 + 3^2 + 4^2 + 5^2.........N^2 sums upto
((N) * (N + 1) * (2 * N + 1)) / 6
'''
print("Enter the value of N: ")
N = int(input())
ans = ((N) * (N + 1) * (2 * N + 1)) / 6
print(ans)
''... |
from channels import Group as channelsGroup
from channels.sessions import channel_session
import random
import json
import channels
import logging
from otree import constants_internal
import django.test
from otree.common_internal import (get_admin_secret_code)
from .models import Subsession as OtreeSubsession, Player a... |
import numpy as np
class Misc:
def exclude_cols(X, cols):
""" exludes indices in cols, from columns of X """
return X[:, ~np.in1d(np.arange(X.shape[1]), cols)] |
import sys
best = {}
for line in sys.stdin:
idx, text, score = line.rstrip('\n').split(' ||| ')
idx = int(idx)
score = float(score)
if idx not in best or score > best[idx][1]:
best[idx] = (text, score)
assert set(best.keys()) == set(range(len(best)))
for idx, (text, score) in sorted(best.items()... |
import songwrite2.plugins as plugins
class ABCImportPlugin(plugins.ImportPlugin):
def __init__(self):
plugins.ImportPlugin.__init__(self, "ABC", ["abc", "txt"])
def import_from_string(self, data):
import songwrite2.plugins.abc.abc
return songwrite2.plugins.abc.abc.parse(data)
ABCImportPlugin() |
import json
import logging
import werkzeug
from openerp import http
from openerp.http import request
_logger = logging.getLogger(__name__)
class DumyController(http.Controller):
_notify_url = '/exchange_provider/dumy/ipn/'
_return_url = '/exchange_provider/dumy/dpn/'
def _get_return_url(self, **post):
... |
import sys, os, os.path
import ctypes
import unittest
import math
import logging
import types
import tempfile
from PIL import Image
import freetype2 as FT
from cgi import log
class TestCaseHarness(unittest.TestCase):
def test_id(self):
""" Strip off the __main__ part at the beginning """
return '.'.... |
from qball.data import QBallData
import qball.tools.gen as gen
class Data(QBallData):
name = "cross"
default_params = {
'model': {},
'solver': {
'pdhg': {
'n_w_tvw': { 'step_factor': 0.0001, 'step_bound': 1.25, },
'sh_w_tvw': { 'step_factor': 0.001, 's... |
from distutils.core import setup
setup(name = 'AppBDgestEnvoiLivres',
version = '1.0',
author = 'JLL & Morgane',
description = 'Application Bases de Données de gestion des envois de livre',
packages = ['AppBDgestEnvoiLivres', 'PyQt5DbGestEnvLivres', 'PyQt5DbLoginDial'],
) |
def error(text):
return "\N{NO ENTRY SIGN} {}".format(text)
def warning(text):
return "\N{WARNING SIGN} {}".format(text)
def info(text):
return "\N{INFORMATION SOURCE} {}".format(text)
def question(text):
return "\N{BLACK QUESTION MARK ORNAMENT} {}".format(text)
def bold(text):
return "**{}**".forma... |
from django.core.exceptions import ValidationError
from django.urls import reverse
from django.core.validators import RegexValidator
from django.utils.html import conditional_escape, format_html, mark_safe
from django.db import models
from bitfield import BitField
import copy, sys, re, urllib
from enum import IntEnum
f... |
"""autogenerated by genpy from nasa_r2_common_msgs/JointControlCoeffState.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class JointControlCoeffState(genpy.Message):
_md5sum = "966d7f4905b379809fca49c080512d9a"
_type = "nasa_r2_common_msgs/JointCo... |
from __future__ import (absolute_import, division, print_function)
import tempfile
import mantid
sample_user_file = ("PRINT for changer\n"
"MASK/CLEAR \n"
"MASK/CLEAR/TIME\n"
"L/WAV 1.5 12.5 0.125/LIN\n"
"L/Q .001,.001, .0126, -.08, .2\n"
... |
from collections import deque
class Solution(object):
def coinChange(self, coins, amount):
"""
:type coins: List[int]
:type amount: int
:rtype: int
"""
if amount == 0:
return 0
n = len(coins)
flag, count = object(), 1
visited = set(... |
class LoginFailure(Exception):
pass
class SerialNotFound(Exception):
pass |
import unittest
import os
import sys
sys.path.append("..")
from metaMorpher_utils import *
from PSLCoverage import PSLCoverage
class PSLCoverage_Test(PSLCoverage):
'''dummy class for testing'''
def __init__(self):
'''place member variables here'''
self._psl_file = "" # to be set
self.psl = [] # dict holding psl... |
from mock import patch
import mock
import kiwi
from .test_helper import raises
from collections import namedtuple
from kiwi.exceptions import KiwiPxeBootImageError
from kiwi.builder.pxe import PxeBuilder
class TestPxeBuilder(object):
@patch('kiwi.builder.pxe.FileSystemBuilder')
@patch('kiwi.builder.pxe.BootImag... |
"""This is part of the Mouse Tracks Python application.
Source: https://github.com/Peter92/MouseTracks
"""
from __future__ import absolute_import
from AppKit import NSScreen
from AppKit import NSEvent
def get_resolution():
w = NSScreen.mainScreen().frame().size.width
h = NSScreen.mainScreen().frame().size.heigh... |
import time
import argparse
from os.path import join
import os
try:
from process.base import print_col, RED, GREEN, YELLOW
from TriSeq import CleanUp
from ortho import OrthomclToolbox as OT
from ortho import protein2dna
except ImportError:
from trifusion.process.base import print_col, RED, GREEN, YE... |
import sys, string, locale
import numpy
sys.path.append('./')
def read_in_data(self):
mvars = self.mvars
''' NOTE: this assumes active residues is a single line of numbers separated by spaces '''
local_active_residues = []
#st = locale.atof(string.split(lin[1])[0])
count = 0
for line in mvars.ac... |
import os
import sys
import ROOT
STYLE_NAME = 'EEE'
STYLE_TITLE = 'ROOT style for EEE'
PALETTE = 'Default'
TEXT_FONT = 43
TEXT_SIZE = 31
BIG_TEXT_SIZE = 1.5*TEXT_SIZE
LABEL_TEXT_SIZE = 0.9*TEXT_SIZE
LEGEND_TEXT_SIZE = 0.9*TEXT_SIZE
SMALL_TEXT_SIZE = 0.8*TEXT_SIZE
SMALLER_TEXT_SIZE = 0.7*TEXT_SIZE
SMALLEST_TEXT_SIZE = ... |
from datetime import date, timedelta
from random import randint
from time import sleep
import sys
import subprocess
import os
def get_date_string(n, startdate):
d = startdate - timedelta(days=n)
rtn = d.strftime("%a %b %d %X %Y %z -0400")
return rtn
def main(argv):
if len(argv) < 1 or len(argv) > 2:
print "Error:... |
"""
com_gpio_inout.py v1.0.2
Auteur: Bruno DELATTRE
Date : 07/08/2016
"""
import time
from lib import com_config, com_gpio, com_logger
class GPIOINOT:
def __init__(self):
self.gpio = com_gpio.GPIODialog('LED ACQUISITION')
self.gpio.setmodebcm()
conf = com_config.Config()
self.config ... |
import hashlib
class HashMap(object):
'''
Basic hashmap that supports object keys.
'''
def __init__(self):
self._hashToValue = {}
self._hashToKey = {}
def getValue(self, key) :
hash = self.__getHash(key)
hashValue = self._hashToValue[hash];
return hashValue
... |
import copy
from abjad import *
def test_quantizationtools_QGrid___copy___01():
q_grid = quantizationtools.QGrid()
copied = copy.copy(q_grid)
assert format(q_grid) == format(copied)
assert q_grid != copied
assert q_grid is not copied
assert q_grid.root_node is not copied.root_node
assert q_g... |
import os
import folia.main as folia
import Levenshtein #pylint: disable=import-error
from gecco.gecco import Module
from gecco.helpers.caching import getcache
from gecco.helpers.filters import hasalpha
from gecco.helpers.common import stripsourceextensions
import colibricore #pylint: disable=import-error
import aspell... |
from flask import request
from server.common import Resource
from server.resources import SearchRecords
from server.resources import ReadRecord
from server.resources import ValidateRecord
from server.resources import Routing
class PAT_Create(Resource):
def post(self):
'''Create interaction'''
return... |
import json
from django.utils import timezone
from django.http import HttpResponse
from django.contrib.auth import get_user_model
from django.views.decorators.csrf import csrf_exempt
from guardian.models import Group
from oauth2_provider.models import AccessToken
from oauth2_provider.exceptions import OAuthToolkitError... |
import sys
import os
import shlex
import turberfield.utils
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.todo",
#"alabaster"
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = "turberfield-utils"
copyright = "2015, D Haynes"
author = "D Haynes"
version = turberfield.u... |
"""VCS plugin support:
manager to keep track of the VCS plugins and file status"""
import os.path
import logging
import datetime
from utils.settings import Settings
from utils.globals import GlobalData
from utils.project import CodimensionProject
from ui.qt import QObject, QTimer, pyqtSignal
from plugins.categories.... |
import math
from gi.repository import Gdk, GObject, Gtk
from olc.define import App
class ControllerWidget(Gtk.DrawingArea):
"""Controller widget, inherits from Gtk.DrawingArea
Attributes:
angle (int): Controller angle (from -360 to 360)
led (bool): Display LED
"""
__gtype_name__ = "Contr... |
import bpy
import addon_utils
import sys
bpy.context.user_preferences.filepaths.use_relative_paths= False
if(str(bpy.app.version).find("(2, 78") < 0 ):
bpy.context.user_preferences.filepaths.use_load_ui = False
bpy.context.user_preferences.filepaths.save_version=0
bpy.context.user_preferences.system.use_scripts_auto_... |
import xml.etree.ElementTree as etree
from .feed import Feed, FeedItem
class XMLFeedItem(FeedItem):
"""
Represents one item of a XML based feed.
"""
def _find_or_create_(self, tag_name, search_in=None):
"""
Search a tag of type `tag_name` and create if not existing.
Will search i... |
import threading
import queue
from tkinter import Tk, Toplevel, messagebox
from tkinter.constants import *
from tkinter.simpledialog import Dialog
from tkinter.ttk import Progressbar, Label, Frame, Button, Style
import time
_MSG_UPDATE = 0
_MSG_CLOSE = 1
_MSG_NOTIFY = 2
class LoadingScreen(Toplevel):
def __init__(s... |
import random
from direct.actor.Actor import Actor
from direct.interval.MetaInterval import Sequence
from direct.showbase.ShowBase import ShowBase
from panda3d.core import loadPrcFile
import sys
from hex import HexGrid
sys.path.insert(0, "../render_pipeline")
from rpcore import RenderPipeline
from rpcore.util.movement_... |
from mathics.builtin.base import Builtin, Predefined, BinaryOperator, Test
from mathics.core.expression import Expression, String, Symbol, Integer
from mathics.core.rules import Pattern
from mathics.builtin.lists import (python_levelspec, walk_levels,
InvalidLevelspecError)
class Sort... |
import hashlib
def hash_value(data):
"""
Get hash of python object
:param data: object or data
:return: the hash value for the data (full length)
"""
hashId = hashlib.md5()
hashId.update(repr(data).encode('utf-8'))
return hashId.hexdigest()
def hash_raw(data):
hashId = hashlib.md5()
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.