code stringlengths 1 199k |
|---|
from alembic import context
from sqlalchemy import engine_from_config, pool
import mishmash.orm
config = context.config
target_metadata = mishmash.orm.Base.metadata
def run_migrations_offline(): # pragma: nocover
"""Run migrations in 'offline' mode.
This configures the context w... |
"""
The core WDF implementation.
"""
import copy
import collections
import numbers
import vadouvan.symbolic_utils
import vadouvan.exceptions
import sympy
from sympy import Symbol
from sympy.printing.codeprinter import Assignment
__all__ = (
"voltage",
"current",
"WDFTree",
)
def voltage(node_name):
... |
import re
def split(s):
return map(str.lower, filter(lambda x: len(x) > 0, re.split("[^a-zA-Zéèàù-]", s)))
a=split(input())
b=split(input())
print('ANALEXES' if sorted(a) == sorted(b) else 'NON') |
from pyb import Pin, Timer
esc_pins = ['X1', 'X2', 'X3', 'X6', 'Y9', 'Y10']
esc_pins_timers = [5, 5, 5, 2, 2, 2]
esc_pins_channels = [1, 2, 3, 1, 3, 4]
esc_trim = [0, 0, 0, 0, 0, 0]
class ESC:
freq_min = 950
freq_max = 1950
def __init__(self, index):
self.timer = Timer(esc_pins_timers[index], prescaler=83, pe... |
import unittest
import random
import chompack as cp
from cvxopt import matrix,spmatrix,amd
class TestSymbolic(unittest.TestCase):
def setUp(self):
I = list(range(17)) + [2,2,3,3,4,14,4,14,8,14,15,8,15,7,8,14,8,14,14,15,10,12,13,16,12,13,16,12,13,15,16,13,15,16,15,16,15,16,16]
J = list(range(17)) + [... |
f = open("F:/PyWorks/LiaoXueFeng/I_O/test.txt", mode="r")
print(f.read())
f.close()
with open("F:/PyWorks/LiaoXueFeng/I_O/test.txt", mode="r") as x:
print(x.read())
with open("F:/PyWorks/LiaoXueFeng/I_O/test.txt", mode="w") as y:
y.write("Ola")
with open("F:/PyWorks/LiaoXueFeng/I_O/test.txt", mode="r") as z:
... |
from __future__ import absolute_import
from .base import BaseWebServiceScanQuery
class HttpScreenshotQuery(BaseWebServiceScanQuery):
"""
This is an Elasticsearch model class for querying HttpScreenshotModel objects.
"""
# Class Members
# Instantiation
# Static Methods
# Class Methods
@cl... |
r'''
*******************************************************************
* File: writeSBML.py
* Description:
* Author: HarshaRani
* E-mail: hrani@ncbs.res.in
********************************************************************/
/*********************************************************... |
import numpy as np
import os
from OpenGL.GL import *
from OpenGL.GL import shaders
from OpenGL.GL.framebufferobjects import *
from OpenGL.arrays import vbo
from .base import AbstractEffect
from ..textures import Texture
from ..shaders import compileShader
class NoEffect(AbstractEffect):
'''Re-render the object with... |
"""
WSGI config for prueba 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.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_M... |
'''
babac.py - sopel module to search the Cycle Babac catalog
author: Norm1 <normand.cyr@gmail.com>
'''
from sopel.module import commands, example
from sopel import web
from bs4 import BeautifulSoup
import cookielib
import mechanize
import yaml
import re
def get_query(bot, trigger):
query = trigger.group(2)
ret... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('app', '0002_auto_20161030_1849'),
]
operations = [
migrations.CreateModel(
name='Event',
fields=... |
import logging
import random
import spqr_defines as SPQR
import spqr_gui as SGFX
import spqr_events as SEVENTS
import spqr_widgets as SWIDGET
import spqr_window as SWINDOW
import spqr_ybuild as SYAML
import spqr_data as SDATA
logger = logging.getLogger('spqr.battle')
attack_good = ["Good auspices", "Position good", "Su... |
from __future__ import print_function
import argparse
import os
import stat
import sys
if os.path.exists(os.path.join('/opt/ros/indigo/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.path.insert(0, os.path.join('/opt/ros/indigo/share/catkin/cmake', '..', 'python'))
try:
from catkin.environment_cache import ... |
''' casebook reader module
'''
import os
import sys
import simplejson
import datetime
import traceback
import casebook.http
import casebook.messages
import casebook.filestor as stor
import casebook.const as const
import casebook.utils as utils
CP = casebook.CP
def main():
session = casebook.http.HttpSession()
s... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_by': 'core'}
DOCUMENTATION = '''
module: systemd
author:
- Ansible Core Team
version_added: "2.2"
sho... |
import ldap
import ldap.modlist
import string
import sys
import base64
import ConfigParser
STR_RED = "\033[01;31m{0}\033[00m"
STR_GREEN = "\033[1;36m{0}\033[00m"
DRY_RUN = False
config = ConfigParser.RawConfigParser()
config.read('.ldap.conf')
try:
# Active Directory
IN_LDAP_URI = config.get('IN_LDAP', 'IN... |
from gl_site.statistics.data_generation import validate_sessions
from django.test import TestCase
from gl_site.test.factory import Factory
from gl_site.models import Session
class TestValidateSession(TestCase):
""" Test class for validate_sessions """
def setUp(self):
""" Create variables for testing ""... |
'''
DQSEGDB Python Server
Applcation class file
'''
import Admin
import Constants
import DAO
import Request
import LDBDWAuth
import logging
import time
def application(environ, start_response):
# Instantiate logger.
constant = Constants.ConstantsHandle()
logging.basicConfig(filename=constant.log_file_locati... |
import re
from core import httptools, jsontools
from core import scrapertools
from platformcode import logger
video_urls = []
def test_video_exists(page_url):
logger.info("(page_url='%s')" % page_url)
subtitles = ""
global video_urls
response = httptools.downloadpage(page_url)
if not response.sucess... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('keepstuff', '0002_auto_20170530_1150'),
]
operations = [
migrations.CreateModel(
name='Entry',
f... |
import unittest
import time
from appium import webdriver
from tests.apps.config import TEST_OBJECT_API_KEY, TEST_OBJECT_APP_ID
class AppiumTests(unittest.TestCase):
def setUp(self):
desired_caps = {}
desired_caps['testobject_api_key'] = TEST_OBJECT_API_KEY
desired_caps['testobject_app_id'] =... |
import os, arcpy, glob, re, datetime
print("process beginning at: "+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
arcpy.env.overwriteOutput = True
arcpy.env.qualifiedFieldNames = False
wd = r'H:\Projects\COA\HabitatAssociations' # folder location of raster and SGCN habitat association .csv files - make sure on... |
from __future__ import with_statement
from setuptools import setup, find_packages
import parso
__AUTHOR__ = 'David Halter'
__AUTHOR_EMAIL__ = 'davidhalter88@gmail.com'
readme = open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read()
setup(
name='parso',
version=parso.__version__,
description='A Py... |
import optparse
import gettext
__trans = gettext.translation('pisilinux', fallback=True)
_ = __trans.ugettext
import pisilinux.cli.command as command
import pisilinux.context as ctx
import pisilinux.db
class Blame(command.Command, metaclass=command.autocommand):
__doc__ = _("""Information about the package owner an... |
from .base_rsa_field import BaseRsaField
class EncryptedCharField(BaseRsaField):
description = "rsa encrypted field for 'CharField'" |
from pysollib.gamedb import registerGame, GameInfo, GI
from pysollib.game import Game
from pysollib.layout import Layout
from pysollib.hint import DefaultHint
from pysollib.pysoltk import MfxCanvasText
from pysollib.util import ANY_RANK, ANY_SUIT, JACK, KING, NO_RANK, QUEEN, \
UNLIMITED_CARDS, UNLIMITED_REDEALS... |
"""Utility functions for lookups and browser_handlers."""
import logging
from . import error
from . import lookups
AF_BUCKETS = [0.0001, 0.0002, 0.0005, 0.001, 0.002, 0.005, 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1]
EXON_PADDING = 50
CHROMOSOMES = ['chr%s' % x for x in range(1, 23)]
CHROMOSOMES.extend(['chrX', 'chrY', 'chrM'... |
from django.conf import settings
from collections import OrderedDict
DB_PARAM_NAMES = ['NAME', 'USER', 'PASSWORD', 'PORT','HOST']
CHOSEN_DB_SETTING = 'wmdata'
def get_datastore_connection_string(url_format=False):
"""
Create a connection string to access the database directly
Use: settings.DATABASES[CHOSEN_... |
"""
Haldd tem como objetivo, ajudar pessoas sem conhecimentos em
segurança, a manter seus equipamentos seguros.
Copyright (C) 2016 Hugo Torres (hugotorres@protonmail.ch)
Copyright (C) 2016 Dimas Mikael (dimasmikael300@yahoo.com)
This file is part of Haldd.
Haldd is free software: you can redistribute it and... |
import types
from mailutils.c_api import auth
from mailutils.error import AuthError
MU_AF_QUOTA = 0x1
def register_module (name=None):
if name == None:
status = auth.register_module ()
elif isinstance (name, types.TupleType) \
or isinstance (name, types.ListType):
for n in name:
... |
import subprocess
import sys
import atexit
import os
def watch_iphone_syslog():
atexit.register(kill_syslog)
syslog = subprocess.Popen(['idevicesyslog'], stdout=subprocess.PIPE)
while True:
line = syslog.stdout.readline()
if line != '':
sys.stdout.write('.')
if "Finishing... |
'''
"Converts" VCS data into an easier format for clients.
.. warning::
This module is intended for internal *Lychee* use only, so the API may change without notice.
If you wish to use this module outside *Lychee*, please contact us to discuss the best way.
.. tip::
We recommend that you use the converters ... |
import socket
import string
import datetime
from time import sleep, time
from urllib import urlopen, urlretrieve
from re import search
from muzabot import rss
from muzabot.functions import *
from muzabot.conf import botconf
from muzabot import memo
c = botconf()
readbuffer=""
s=socket.socket( )
s.connect((c['host'], c[... |
import supybot.utils as utils
from supybot.commands import *
import supybot.plugins as plugins
import supybot.ircutils as ircutils
import supybot.callbacks as callbacks
import supybot.schedule as schedule
import supybot.ircmsgs as ircmsgs
import time
import re
class Reminder(callbacks.Plugin):
"""Remind me, mighty ... |
"""conf - Sphinx configuration information."""
import os
import sys
from contextlib import suppress
from subprocess import PIPE, CalledProcessError, run
root_dir = os.path.dirname(os.path.dirname(__file__))
sys.path.insert(0, root_dir)
import versionah # NOQA: E402
on_rtd = os.getenv('READTHEDOCS')
if not on_rtd:
... |
"""
midi.py -- MIDI classes and parser in Python
Placed into the public domain in December 2001 by Will Ware
Python MIDI classes: meaningful data structures that represent MIDI events
and other objects. You can read MIDI files to create such objects, or
generate a collection of objects and use them to write a MIDI file... |
string = list(input())
print(''.join(sorted(string[:string.index(".")], key = lambda x: ord(x)) + ["."])) |
from .listtab import UflDialogListTab
from .objecttab import UflDialogObjectTab
from .valuetab import UflDialogValueTab
from .nullablevaluetab import UflDialogNullableValueTab |
import logging
from salmon.routing import route, route_like, stateless
from config.settings import relay
from salmon import view
@route("(address)@(host)", address=".+")
def START(message, address=None, host=None):
return NEW_USER
@route_like(START)
def NEW_USER(message, address=None, host=None):
return NEW_USE... |
import datetime
import collections
from django.db.models.functions.datetime import ExtractMonth
from django.db.models import (Field, NullBooleanField,
Count,
)
from graphos.sources.simple import SimpleDataSource
from graphos.renderers import gchart
from maraud... |
from hls import *
from .common import *
class Transmission():
def __init__(self):
pass
def manifest(self):
manifest = HLSManifest()
return manifest.render()
def media(self):
pass |
from flask import current_app, Blueprint, render_template, abort
from laniakea.db import session_scope, BinaryPackage, SoftwareComponent
from sqlalchemy.orm import joinedload
from ..extensions import cache
import gi
gi.require_version('AppStream', '1.0')
from gi.repository import AppStream
software = Blueprint('softwar... |
'''
Created on Jun 18, 2012
@author: msouza
'''
class AnnotatedProtein(object):
'''
This is an object to represent annotated proteins.
'''
def __init__(self):
'''
Constructor
'''
self.domain_architecture = None
self.protein_sequence = None
self.annotations... |
import sys
import os.path
import unittest
sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), "..")))
from apertium_ui import AboutApertiumUiDialog
class TestExample(unittest.TestCase):
def setUp(self):
self.AboutApertiumUiDialog_members = [
'AboutDialog', 'AboutApertiumUiDia... |
from __future__ import absolute_import, division, print_function
import uuid
from mock import patch
import os
import pkg_resources
import pytest
from invenio_db import db
from invenio_pidstore.models import PersistentIdentifier
from inspirehep.utils.record_getter import get_es_record, RecordGetterError
from inspirehep.... |
'''
Copyright 2014 Nick Conway, Ben Pruitt
GPLv2
http://opensource.org/licenses/gpl-2.0.php
'''
import re
_fasta_re = re.compile(r'>(.*)[\n\r]([^>]+)')
_ALPHABETS = {
'DNA': 'ACGTWSMKRYBDHVN',
'RNA': 'ACGUWSMKRYBDHVN',
'AMINO_ACID': 'ABCDEFGHIJKLMNOPQRSTUVWYZX*-'
}
def sanitizeRecSeq(rec_id, rec_seq, alphab... |
import pdb
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.contrib.auth.models import User
from django.test.client import RequestFactory
from apps.user_management.models import Concepts, Profile
from apps.graph.models import Concept
from apps.user_management.views import user_m... |
import sys
import os
import matplotlib.pyplot as plt
import numpy as np
def main():
# check we have all of the required command line info
if len(sys.argv) != 6:
print("Usage: {} datafile xmin xmax ymax title"
.format(os.path.basename(sys.argv[0])), file=sys.stderr)
sys.exit(1)
# ... |
import sys
from itertools import islice
def isValidIP(octets):
# ip octets greater than 255
if octets[0]>255 or octets[1]>255 or octets[2]>255 or octets[3]>255:
return False
# pvt. ip : 10.*.*.*
if octets[0]==10:
return False
# pvt. ip : 192.168.*.*
if octets[0]==192 and octets[1]==168:
return False
# pvt.... |
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('agents', '0003_auto_20190327_1650'),
]
operations = [
migrations.AlterField(
model_name='agentrelation',
name='create_date',
fie... |
import numpy as np
def calcflux(dn_de, energy):
flux = np.sum(((dn_de[1:] + dn_de[:-1]) / 2.0) * (energy[1:] - energy[:-1]))
return flux
def mpt(energy):
return ((energy[1:] + energy[:-1]) / 2.0)
def fermi():
# numbers from http://arxiv.org/pdf/0911.2412v1.pdf
N0_100Mev = 2.36e-10 # ph cm^-2 s^-1 ... |
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import object
from tkinter import *
class TabPage(object):
def leavePageCallback(self):
'''When leaving page, tidy up any issues.'''
print('Leaving TabPage')
def selectPageC... |
"""multidatabase_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='hom... |
__all__ = 'CachingTitleApi',
if __name__ == '__main__': # DEBUG
import sys
sys.path.append("..")
from title import TitleApi
def _htmlcacher(cls):
from restful.offline import DataCacher
return DataCacher(cls, suffix='.html')
CachingTitleApi =_htmlcacher(TitleApi)
if __name__ == '__main__':
cachedir = 'tmp'
a... |
if __name__ == '__main__':
import sys
sys.path.append('..')
from sakurakit.sknetio import topercentencoding
import baidudef
API = "http://tts.baidu.com/text2audio"
def url(text, language, encoding='UTF-8'):
"""
@param text unicode not None
@param language str not None
@param* encoding utf8 or UTF-8 o... |
from collections import namedtuple
import os.path
import pkgutil
import sys
PackageLoader = namedtuple('PackageLoader', ['fqname', 'loader', 'module'])
class InvalidModuleError(Exception):
def __init__(self, label, name):
s = '{label}: Invalid module name: {name}' \
.format(label=label, name=nam... |
from Thing.item import Item
class Blob(Item):
def __init__(self, colour="yellow", size=0.1):
self.colour = colour
self.sized = size
super().__init__()
def tk_init(self, size=1):
super().tk_init(self.sized)
def shape(self, canvas):
return [
canvas.create_ov... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Trial.end'
db.alter_column(u'feed_trial', 'end', self.gf('django.db.models.fields.... |
"""!
@brief CCORE Wrapper for hsyncnet oscillatory based clustering algorithm.
@authors Andrei Novikov (pyclustering@yandex.ru)
@date 2014-2020
@copyright BSD-3-Clause
"""
from pyclustering.core.wrapper import *;
from pyclustering.core.pyclustering_package import package_builder
def hsyncnet_create_network(sample, numb... |
import asyncio
from aiostream import stream, pipe
async def main():
# This stream computes 11² + 13² in 1.5 second
xs = (
stream.count(interval=0.1) # Count from zero every 0.1 s
| pipe.skip(10) # Skip the first 10 numbers
| pipe.take(5) # Take the following 5
| pipe.filter(la... |
class Page:
"""
Stores information of a Xournal page (e.g. list of layers, dimensions)
A page contains one or more layers
"""
def __init__(self, number=-1, layerList=None, width=-1, height=-1):
"""
Constructor
Keyword arguments:
number -- Page number (default -1)
... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import * # noqa
from ycmd.completers.language_server import language_server_completer as lsc
from ycmd import responses, utils
from ycmd.utils import LOGGER... |
numstrings = int(input())
strings = []
for i in range(numstrings):
strings.append(input().strip())
numsearches = int(input())
searches = []
for i in range(numsearches):
searches.append(input().strip())
answers = []
for i in range(numsearches):
appearances = 0
for j in range(numstrings):
if searc... |
from jqueryui import jq
from browser import document, html
from superpython.virgem.main import Sala, Labirinto, Cena, INVENTARIO
STYLE = dict(position="absolute", width=300, left=0, top=0, background="white")
STYLE["min-height"] = "300px"
IMAGEM = "http://images.akamai.steamusercontent.com/ugc/577886316482675420/F077A6... |
from django.core.checks import register, Tags, Warning
from django.db import ProgrammingError, OperationalError
from fixturedb.utils.hvc import get_all_hvcs_referenced_by_targets
@register(Tags.database)
def check_for_missing_hvcs(app_configs, **kwargs):
try:
missing_hvcs = get_all_hvcs_referenced_by_target... |
import decimal
import boto3
from boto3.dynamodb.conditions import Key, Attr, And
from botocore.exceptions import ClientError
from kev.backends import DocDB
from kev.exceptions import DocNotFoundError, ResourceError
class DynamoDB(DocDB):
db_class = boto3
backend_id = 'dynamodb'
def __init__(self, **kwargs):... |
from random import randint
import pyglet
from pyglet.window import key
import cocos
from cocos import actions, layer, sprite, scene
from cocos.director import director
from math import sqrt
"""class Me(actions.Move):
prevVelocity_x = 10
prevVelocity_y = 0
def __init__(self):
super( Me, self ).__init... |
import ctypes
import _winreg
import struct
import sys
import pywintypes
import win32api
import winerror
DISPLAY_DEVICE_ACTIVE = 0x1 # DISPLAY_DEVICE_ACTIVE specifies whether a monitor is presented as being "on" by the respective GDI view.
# Windows Vista: EnumDisplayDevices will only enumerate monitors that ca... |
from django import template
from django.urls import reverse
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter()
def community_link(community, slug=None):
if community is None:
return ''
link = '<a href="'
link += reverse(
'community:community_page',... |
import sys
import c3linearize
try:
str = unicode # Python 2.* compatible
string_types = (basestring,)
integer_types = (int, long)
except NameError:
string_types = (str,)
integer_types = (int,)
def get_mro(current, bases_getter):
return c3linearize.linearize(c3linearize.build_graph(current, base... |
import sys
import threading
from six import StringIO
logfile = StringIO()
mutex = threading.Lock()
def write(data):
mutex.acquire()
try:
if logfile.tell() > 8000:
# Do a sort of 8k round robin
logfile.seek(0)
logfile.write(data)
finally:
mutex.release()
sys.stdout.write(data)
def getvalue():
mutex.acqu... |
from django.db import models
from datetime import datetime
class ImageFile(models.Model):
path = models.CharField(max_length=150)
scan_date = models.DateField(default=datetime.now)
class ScannedImage(models.Model):
original = models.OneToOneField(ImageFile)
source = models.CharField(max_length=150)
... |
import re
import struct
def re_to_unicode(s):
newstring = ''
for c in s:
newstring += re.escape(c) + '\\x00'
return newstring
def type_unpack(type):
""" return the struct and the len of a particular type """
type = type.lower()
s = None
l = None
if type == 'short':
s = 'h... |
"""
WSGI config for lug_site project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` ... |
"""
Complex that keeps track of its previous versions (conformations).
"""
import Biskit.tools as t
import Biskit.mathUtils as MU
from Biskit import EHandler
from Complex import Complex as ProtComplex
from ComplexList import ComplexList
class ComplexEvolving( ProtComplex ):
"""
Complex that keeps track of its p... |
import pytest
from lib.mlcatconfig.config import *
def test_config_class():
t_config=Config('t_mailbox')
t_config.createVariables();
assert t_config.foldername =='./data/t_mailbox'
assert t_config.mbox_filename=='./data/t_mailbox/mbox/t_mailbox.mbox'
assert t_config.clean_headers_filename=='./data/t... |
import os
import json
import pytest
import aiohttp
import zipfile
from pathlib import Path
from unittest.mock import patch
from unittest.mock import MagicMock
from tests.utils import AsyncioMagicMock, AsyncioBytesIO
from gns3server.controller.project import Project
from gns3server.controller.export_project import expor... |
import sys
import os
import hashlib
sys.path[0:0] = [
'/home/demo/ovizart/eggs/django_tastypie-0.9.11-py2.7.egg',
'/home/demo/ovizart/eggs/hachoir_core-1.3.3-py2.7.egg',
'/home/demo/ovizart/eggs/hachoir_parser-1.3.4-py2.7.egg',
'/home/demo/ovizart/eggs/hachoir_regex-1.0.5-py2.7.egg',
'/home/demo/ovi... |
import argparse
import textwrap
import numpy as np
import os
from wmf import wmf
parser=argparse.ArgumentParser(
prog='Genera_Grafica_Qsim',
formatter_class=argparse.RawDescriptionHelpFormatter,
description=textwrap.dedent('''\
Genera la figura de caudales simulados para un periodo asignado de tiempo, de forma
adi... |
#!/usr/bin/env python3
import importlib
import threading
import operator
import logging
import random
import base64
import json
import time
import copy
import os
import re
from irc import client
from peewee import peewee
try:
from pyfiglet import Figlet
except ImportError:
print("FOR FUCKS SAKE INSTALL PYFIGLE... |
from fp import nm, wielomian, miejscabf, pierwiastkir, mnoz
from fpg import GetWDialog, MyNotebook, sete, LWielomian, DropWTarget, MyWykres, WielomianyPanel, WykresPanel, DzialaniaPanel
import code, wx
class TabPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent=parent, id=wx.ID_ANY)... |
from nepi.execution.ec import ExperimentController
from test_utils import skipIfNotAlive, skipInteractive
import os
import time
import tempfile
import unittest
class LinuxPingTestCase(unittest.TestCase):
def setUp(self):
self.fedora_host = "nepi2.pl.sophia.inria.fr"
self.fedora_user = "inria_nepi"
... |
from paramecio.cromosoma.corefields import IntegerField
class PercentField(IntegerField):
def __init__(self, name, required=False):
super().__init__(name, 2, required)
def check(self, value):
try:
value=int(value)
if value<0:
value=0
if value>1... |
from .common import TestBase
from sarch.database import Meta
class TestFindDups( TestBase ):
def make_identical( self ) -> None:
meta = Meta( "FOO" )
self.repo.fs.meta_update(meta)
fns = []
for loop in range(4):
meta_new = meta.copy()
data = self.repo.fs.file_read( meta.file... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import contextlib
from . import mock
class ExceptionWrapperTestHelper(object):
@contextlib.contextmanager
def assertRaisesWrapped(self, wrapped_class, wrapper_clas... |
"""
Command line client using SWORD version 1 to push content to
Connexions.
"""
from __future__ import division
import sword1cnx
import os
PARAMS = {
'username': raw_input("Enter Connexions username: "),
'password': raw_input("Enter Connexions password: "),
}
print 'Retrieving service document...'
conn = sword... |
from google.appengine.ext import db
from payload import Payload
class Report(Payload):
lat = db.FloatProperty()
lon = db.FloatProperty() |
import nose
from rhuilib.rhui_testcase import *
from rhuilib.rhuimanager import *
from rhuilib.rhuimanager_repo import *
from rhuilib.rhuimanager_entitlements import *
class test_tcms324680(RHUITestcase):
''' for more ditails see bz 957128
try toupload fake rpms and signed rpm from a directory in cli mode
... |
from plexpy import logger, helpers, common, request
from plexpy.helpers import checked, radio
from xml.dom import minidom
from httplib import HTTPSConnection
from urlparse import parse_qsl
from urllib import urlencode
from pynma import pynma
import base64
import cherrypy
import urllib
import urllib2
import plexpy
impor... |
"""
get_gdal_drivers.py
General library to get driver names and extensions for all supported
GDAL drivers.
Author: Dan Clewley (dac)
Date: 07/05/2015
License restrictions: None known. Uses GDAL (MIT/X license)
Known issues: Some drivers must be used with creation options to get the desired
output. For example .bil and ... |
import abc
from pymeppsstream.log_mixin import LoggingMixin
class Node(LoggingMixin):
"""
This class is a base class for a node within the pymepps-streaming
framework. A node is a vertices within the processing graph. Every node has
a dependancies to another nodes. Such that a node is only processed if ... |
import os
import ConfigParser
class Presets(object):
def __init__(self):
self.main_dir = os.path.join(main.cfgpath, 'presets')
def get_plugin_path(self, plugin_name):
names = self.get_plugin_names()
# Create preset folder if not exists.
if plugin_name not in names:
if... |
from cldevel import build
from cldevel import pull
from cldevel import shell
from cldevel import test
commands = [build, pull, shell, test] |
import database
from share import share
config = share.config
class dbConfig:
data = {
'co-name' :'Enter Company name',
'co-logo' :'',
'custSubject' : '4',
'bank' : '1',
'cash' :'14',
'buy' :'17',
'sell' :'18'... |
import os
import time
import wmi
class DiskAnalysis(object):
def __init__(self, path):
self.currentMachine = wmi.WMI()
self.listDisks = []
self.envVarList = {}
self.listPartitions = []
self.os = None
self.mbrDisk = ""
self.path = path + os.path.sep + 'results.... |
'''
Queries for experiments with temporal preference operators
'''
import os
from gen.directory import write_to_txt, write_to_csv, get_env_file, \
get_tup_file, get_query_dir, get_out_file
from gen.experiment import ALGORITHM, CQL_ALG, TS_ATT, FL_ATT, \
RAN, SLI, ATT, LEV, get_attribute_list, MAX_VALUE
from gen... |
__author__ = 'Reza Salari'
__email__ = 'rezasalari@rutgers.edu'
__version__ = '0.1.7' |
XMPP_USERNAME = 'username@gmail.com'
XMPP_PASSWORD = 'password'
OAUTH_CONSUMER_KEY = 'yourkey'
OAUTH_CONSUMER_SECRET = 'yoursecret'
MAX_ID_LIST_NUM = 702
MAX_CONVERSATION_NUM = 4
DATABASE_TYPE = 'sqlite' # only sqlite now.
DATABASE_DIR = '/home/dotcloud/data'
ADMIN_USERS = (
'yourown1@domain.com',
'yourown2@dom... |
"""
Copyright (C) 2013 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from unittest import TestCase
from uuid import uuid4
from bunch import Bunch
from nose.tools import eq_
from ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.