code stringlengths 1 199k |
|---|
"""
Author: Isabel Restrepo
August 12, 2012
Compute rigid transformation between two point clounds using feature correspondances
"""
import os
import sys
import glob
import time
from optparse import OptionParser
from xml.etree.ElementTree import ElementTree
from vpcl_adaptor import *
from boxm2_utils import *
parser = ... |
from core.Uusipuu import UusipuuModule
import random, time
class Module(UusipuuModule):
def startup(self):
if 'memo' not in self.config:
self.config['memo'] = {}
def privmsg(self, user, target, msg):
if target != self.channel:
return
pieces = msg.strip().split(' '... |
NOTICE_FROM_ANONYMOUS = 1 |
'''A convenient class for parsing HTML pages.'''
from __future__ import unicode_literals
from HTMLParser import HTMLParser
import logging
import re
from RSSvk.core import Error
LOG = logging.getLogger(__name__)
LOG.setLevel(logging.INFO)
class HTMLPageParser(HTMLParser):
'''A convenient class for parsing HTML pages... |
class Company(object):
def __init__(self, name=None, code=None, phone=None, digit=None):
# Company's name
self.name = name
# Codename
self.code = code
# The digit of the invoice number
if digit is None:
digit = []
self.digit = digit
# Phone... |
"""
Created on Mon Feb 14, 2011
@author:Isabel Restrepo
A script to run (fast) k-means on J sets of random subsamples
"""
import os;
import dbrec3d_batch
import multiprocessing
import Queue
import time
import random
import optparse
import sys
from numpy import log, ceil
from xml.etree.ElementTree import ElementTree
imp... |
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
Test file created by XlsxWriter against a file created by Excel.
"""
def setUp(self):
self.set_filename('textbox15.xlsx')
def test_create_file(self):
... |
import sys
if '' not in sys.path:
sys.path.append('')
import time
import unittest
from pyactors.logs import file_logger
from pyactors.exceptions import EmptyInboxException
from tests import ForkedGreActor as TestActor
from multiprocessing import Manager
class ForkedGreenletActorTest(unittest.TestCase):
def test... |
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import messagebird
try:
ACCESS_KEY
except NameError:
print('You need to set an ACCESS_KEY constant in this file')
sys.exit(1)
try:
MESSAGE_ID
except NameError:
print('You need to set a MESSAGE_ID constant in this file')
sys.exit(1... |
with open('README.txt') as f:
long_description = f.read()
from distutils.core import setup
setup(
name = "nomit",
packages = ["nomit"],
version = "1.0",
description = "Process Monit HTTP/XML",
author = "Markus Juenemann",
author_email = "markus@juenemann.net",
url = "https://github.com/m... |
from lino.core.roles import UserRole
class NotesUser(UserRole):
pass
class NotesStaff(NotesUser):
pass |
from __future__ import absolute_import
__author__ = 'noe'
from pyemma._base.model import SampledModel
from pyemma.msm.models.msm import MSM
from pyemma.util.types import is_iterable
class SampledMSM(MSM, SampledModel):
def __init__(self, samples, ref=None, conf=0.95):
r""" Constructs a sampled MSM
P... |
u"""
OMD Livestatus dynamic inventory script
=======================================
If running as an OMD site user, i.e. if ${OMD_ROOT} is set, we try to
connect to the Livestatus socket at the default location
${OMD_ROOT}/tmp/run/live
Alternatively, the path to the Livestatus socket can be set from the
environmen... |
from __future__ import annotations
from os import getenv
import gc
import sys
from unittest import TestCase, main
from unittest import skip as skip
from unittest import skipIf as skipIf
import logging
from progressivis import Scheduler, log_level
from progressivis.storage import init_temp_dir_if, cleanup_temp_dir
impor... |
"""Leetcode 100. Same Tree
Easy
URL: https://leetcode.com/problems/same-tree/
Given two binary trees, write a function to check if they are the same or not.
Two binary trees are considered the same if they are structurally identical and
the nodes have the same value.
Example 1:
Input: 1 1
/ \ ... |
methods = ['method_name_1','method_name_2'] |
from pysnmp import error
class MetaObserver(object):
"""This is a simple facility for exposing internal SNMP Engine
working details to pysnmp applications. These details are
basically local scope variables at a fixed point of execution.
Two modes of operations are offered:
1. Consumer: a... |
import logging
from .. import exceptions
from ..plan import COMPLETE, Plan
from ..status import NotSubmittedStatus, NotUpdatedStatus
from . import build
import difflib
import json
logger = logging.getLogger(__name__)
def diff_dictionaries(old_dict, new_dict):
"""Diffs two single dimension dictionaries
Returns t... |
from .BaseWindow import BaseWindow
class TitledOnBorderWindow(BaseWindow):
"""
A window with a border and a title on border. Subclass of BaseWindow.
"""
def __init__(self, parent, h, w, y, x, title, modal=False, menu=False, colourT=False, colourD=False):
"""Create base window"""
BaseWind... |
default_app_config = 'user_deletion.apps.UserDeletionConfig' |
from django.conf.urls import url
from .views import simple_password
urlpatterns = [
url(r'^$', view=simple_password, name="simple_auth_password"),
] |
import re
import time
import math
import threading
try:
from multiprocessing.pool import ThreadPool
except:
ThreadPool = None
try:
import asyncio
except:
asyncio = None
from .events import Events
from ..core.config.x_config import XCONF
from ..core.comm import SerialPort, SocketPort
from ..core.wrapper ... |
"""
A socket wrapper that uses Event IO.
"""
import socket
import event
import time
import logging
import errno
import traceback
import os
from collections import deque
from cStringIO import StringIO
class EventSocket(object):
"""
A socket wrapper which uses libevent.
"""
def __init__( self, family=socket.AF_IN... |
def test_basic_editor(scratch_tree):
sess = scratch_tree.edit('/')
assert sess.id == ''
assert sess.path == '/'
assert sess.record is not None
assert sess['_model'] == 'page'
assert sess['title'] == 'Index'
assert sess['body'] == 'Hello World!'
sess['body'] = 'A new body'
sess.commit... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('news', '0003_auto_20170228_2249'),
]
operations = [
migrations.CreateModel(
name='Location',
fie... |
__author__="Joao" |
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
urlpatterns = [
url(r'^$', TemplateView.as_view(
template_name='pages/home.html'), name="home"),
url... |
def extractDlscanlationsCom(item):
'''
Parser for 'dlscanlations.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loiterous', 'Loiter... |
from __future__ import unicode_literals
from django import forms
class WSPayForm(forms.Form):
ShopID = forms.CharField(widget=forms.HiddenInput)
ShoppingCartID = forms.CharField(widget=forms.HiddenInput)
TotalAmount = forms.CharField(widget=forms.HiddenInput)
Signature = forms.CharField(widget=forms.Hid... |
import operator
import numpy as np
from pandas._libs import index as libindex
from pandas import compat
from pandas.compat.numpy import function as nv
from pandas.core.dtypes.generic import ABCCategorical, ABCSeries
from pandas.core.dtypes.dtypes import CategoricalDtype
from pandas.core.dtypes.common import (
is_ca... |
from BinPy.Gates import *
class PowerSource:
"""
Models a Power Source from which various connectors can tap by connecting to it.
taps: The list of all connectors connected to this power source.
connect(): Takes in one or more connectors as input and connects them to the power source.
disconnect(): ... |
''' Simple test for apachelogs '''
import unittest
from apachelogs import ApacheLogFile
class apachelogs_test(unittest.TestCase):
def test_foo(self):
log = ApacheLogFile('test.log')
line = iter(log).next()
self.assertEquals(line.ip, '127.0.0.1')
self.assertEquals(line.ident, '-')
... |
d1 = 0.08
l2 = 0.19
d2 = 0.08
l3 = 0.19
initial_state = [0, 0, 0, 0, 0]
dia = 0.1
car_radius = dia/2
wheel = dia/4 |
from django.contrib import messages
from django.http import Http404, HttpResponse
from django.shortcuts import render
from corehq.apps.app_manager.dbaccessors import get_app
from corehq.apps.app_manager.decorators import require_deploy_apps, \
require_can_edit_apps
from corehq.apps.app_manager.xform import XForm
fr... |
''' Provide functions to embed Bokeh models (e.g., plots, widget, layouts)
in various different ways.
There are a number of different combinations of options when embedding
Bokeh plots. The data for the plot can be contained in the document,
or on a Bokeh server, or in a sidecar JavaScript file. Likewise, BokehJS
may b... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 30, transform = "Quantization", sigma = 0.0, exog_count = 20, ar_order = 0); |
from __future__ import unicode_literals
from ..brainsuite import Hemisplit
def test_Hemisplit_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
inputHemisphereLabelFile=dict(argstr... |
"""
Phil scope of options for scaling.
"""
from __future__ import annotations
import iotbx.phil
phil_scope = iotbx.phil.parse(
"""
anomalous = False
.type = bool
.help = "Separate anomalous pairs in scaling and error model optimisation."
.expert_level=0
overwrite_existing_models = False
.type = ... |
import unittest
import pythran
import os.path
class TestSpecParser(unittest.TestCase):
def test_parser(self):
real_path = os.path.splitext(os.path.realpath(__file__))[0]+".py"
with open(real_path) as fd:
print(pythran.spec_parser(fd.read()))
def test_invalid_specs0(self):
cod... |
import pytest
from pontoon.test import factories
@pytest.fixture
def admin():
"""Admin - a superuser"""
return factories.UserFactory.create(username="admin", is_superuser=True,)
@pytest.fixture
def client_superuser(client, admin):
"""Provides a client with a logged in superuser. """
client.force_login(a... |
from __future__ import unicode_literals
import json
import requests
import six
from datetime import datetime
from six.moves.urllib.parse import parse_qs
from xml.etree.ElementTree import Element, SubElement, tostring
from xml.parsers.expat import ExpatError
from .auth import OAuth2Credentials
from .exceptions import (
... |
from jsonapi_requests import base
from jsonapi_requests.orm import registry
class OrmApi:
def __init__(self, api):
self.type_registry = registry.TypeRegistry()
self.api = api
@classmethod
def config(cls, *args, **kwargs):
return cls(base.Api.config(*args, **kwargs))
def endpoint(... |
from __future__ import unicode_literals
from django.conf import settings # noqa
from django.utils.translation import ugettext_lazy as _ # noqa
from appconf import AppConf
class BlogConf(AppConf):
DISQUS_SHORTNAME = 'django-staticgen'
POST_IDENTIFIER = 'current_post'
class Meta:
prefix = 'blog' |
"""All pytest-django fixtures"""
from __future__ import with_statement
import os
import warnings
import pytest
from . import live_server_helper
from .db_reuse import (monkey_patch_creation_for_db_reuse,
monkey_patch_creation_for_db_suffix)
from .django_compat import is_django_unittest
from .lazy_... |
"""empty message
Revision ID: 424f18f4c1df
Revises: 106e3631fe9
Create Date: 2015-06-23 11:31:08.548661
"""
revision = '424f18f4c1df'
down_revision = '106e3631fe9'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
from sqlalchemy.dialects.postgresql import ENUM
providers_list = E... |
"""
JupyterHub Spawner to spawn user notebooks on a Kubernetes cluster.
This module exports `KubeSpawner` class, which is the actual spawner
implementation that should be used by JupyterHub.
"""
import asyncio
import os
import signal
import string
import sys
import warnings
from functools import partial
from functools ... |
from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.config import ConfigValidationError
from txircd.module_interface import Command, ICommand, IModuleData, ModuleData
from txircd.utils import trimStringToByteLength
from zope.interface import implementer
from typing import Any, Callabl... |
from sklearn2sql_heroku.tests.classification import generic as class_gen
class_gen.test_model("AdaBoostClassifier" , "FourClass_100" , "db2") |
"""Package contenant l'éditeur 'spedit'.
Si des redéfinitions de contexte-éditeur standard doivent être faites, elles
seront placées dans ce package.
Note importante : ce package contient la définition d'un éditeur, mais
celui-ci peut très bien être étendu par d'autres modules. Auquel cas,
les extensions n'apparaîtront... |
"""Decorators for Chromium port of Rietveld."""
import mimetypes
import sha
from google.appengine.api import memcache
from django.http import HttpResponseForbidden
from . import decorators as deco
from . import models_chromium
from . import responses
def binary_required(func):
"""Decorator that processes the content ... |
import unittest
import doctest
from pprint import pprint
from interlude import interact
import lxml.etree as etree
optionflags = doctest.NORMALIZE_WHITESPACE | \
doctest.ELLIPSIS | \
doctest.REPORT_ONLY_FIRST_FAILURE #| \
TESTFILES = [
'api.rst',
'script.rst',
]
def fxml(xml):
et... |
from __future__ import absolute_import, unicode_literals
import msgpack
from .base import BaseSerializer
class MSGPackSerializer(BaseSerializer):
def dumps(self, value):
return msgpack.dumps(value)
def loads(self, value):
return msgpack.loads(value, encoding="utf-8") |
from PySide import QtCore, QtGui
class Ui_AboutDialog(object):
def setupUi(self, AboutDialog):
AboutDialog.setObjectName("AboutDialog")
AboutDialog.setWindowModality(QtCore.Qt.ApplicationModal)
AboutDialog.resize(400, 150)
AboutDialog.setMinimumSize(QtCore.QSize(360, 110))
Ab... |
"""The WaveBlocks Project
Compute the transformation to the eigen basis for wavefunction.
@author: R. Bourquin
@copyright: Copyright (C) 2012, 2016 R. Bourquin
@license: Modified BSD License
"""
from WaveBlocksND import BlockFactory
from WaveBlocksND import WaveFunction
from WaveBlocksND import BasisTransformationWF
de... |
from django.conf.urls import url
from .views import BaseView
urlpatterns = [
url(r"^$", BaseView.as_view(), name="base-view-2"),
] |
from datetime import date, timedelta, datetime
import time
def get_first_day(dt, d_years=0, d_months=0):
# d_years, d_months are "deltas" to apply to dt
y, m = dt.year + d_years, dt.month + d_months
a, m = divmod(m-1, 12)
return date(y+a, m+1, 1)
def get_last_day(dt):
return get_first_day(dt, 0, 1) ... |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from cms.models import CMSPlugin, Page, get_plugin_media_path
from os.path import basename
class Picture(CMSPlugin):
"""
A Picture with or without a link
"""
CENTER = "center"
LEFT = "left"
RIGHT = "right"
F... |
from __future__ import print_function
from glyphNameFormatter.tools import camelCase
doNotProcessAsLigatureRanges = [
(0xfc5e, 0xfc63),
(0xfe70, 0xfe74),
#(0xfc5e, 0xfc61),
(0xfcf2, 0xfcf4),
(0xfe76, 0xfe80),
]
def process(self):
# Specifically: do not add suffixes to these ligatures,
# they... |
import datetime
import factory
from django.db.models import signals
from elections.models import (
Election,
ModerationHistory,
ElectionType,
ElectedRole,
ModerationStatus,
ModerationStatuses,
)
from organisations.tests.factories import (
OrganisationFactory,
OrganisationDivisionFactory,... |
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
import commonware.log
import waffle
from users.models import UserProfile
from .models import Access
from .oauth import OAuthServer
log = commonware.log.getLogger('z.api')
class RestOAuthMiddleware(object):
"""
This is based on... |
from setuptools import setup, find_packages
setup(
name = 'django-dzenlog',
version = __import__('django_dzenlog').__version__,
description = '''Django Dzenlog is a set of models and templates, which can be '''
'''used to create blogs with different kinds media.''',
long_description = ... |
class WorkflowRegistry(object):
def __init__(self):
self.workflows = {}
self.class_index = {}
def add(self, name, cls):
self.workflows[id(cls)] = self.workflows.get(id(cls), set())
self.workflows[id(cls)].add(name)
self.class_index[id(cls)] = cls
def get_class_fields(... |
from sympy import (
Abs, Chi, Ci, CosineTransform, Dict, Ei, Eq, FallingFactorial, FiniteSet,
Float, FourierTransform, Function, Integral, Interval,
InverseCosineTransform, InverseFourierTransform,
InverseLaplaceTransform, InverseMellinTransform, InverseSineTransform,
Lambda, LaplaceTransform, Limit... |
from __future__ import absolute_import, unicode_literals
import json
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission
from django.core import mail
from django.core.urlresolvers import reverse, reverse_lazy
from django.test import TestCase, override_settings
from dj... |
from __future__ import unicode_literals
from django.conf import settings
from django.core.cache import cache
from django.db import models
from django.db.models.signals import post_save
try:
from django.db.transaction import atomic
except ImportError:
from django.db.transaction import commit_on_success as atomic... |
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.db import transaction
from django.db.models import Count
from django.http import HttpResponseRedirect, HttpResponseForbidden
from django.shortcuts import render, get_obj... |
def extractQuillofkarnikaWordpressCom(item):
'''
Parser for 'quillofkarnika.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('Top Giants: Rebirth of the Black-Bellied Wife', 'To... |
import os
from flask_script import Manager, Shell, Server
from flask_script.commands import Clean, ShowUrls
from flask_migrate import MigrateCommand
from inspectors.app import create_app
from inspectors.settings import DevConfig, ProdConfig
from inspectors.database import db
app = create_app()
HERE = os.path.abspath(os... |
from __future__ import division, print_function, absolute_import
from io import StringIO
import tempfile
import numpy as np
from numpy.testing import assert_equal, \
assert_array_almost_equal_nulp
from scipy.sparse import coo_matrix, csc_matrix, rand
from scipy.io import hb_read, hb_write
SIMPLE = """\
No Title ... |
import json
from os import linesep
from urllib2 import Request, urlopen
from string import capwords
from django.conf import settings
from django.core.mail import send_mail
from django.contrib.auth.decorators import login_required
from django.contrib.messages.views import SuccessMessageMixin
from django.utils import tim... |
import gzip
import json
import os
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.paginator import EmptyPage
from django.core.paginator import PageNotAnInteger
from django.core.paginator import Paginator
from django.db.model... |
""" Topological sort """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
__all__ = ["DagError", "assert_dag", "topological_sort"]
class DagError(Exception):
""" Dag Exception """
def __init__(self, node, parent, result):
""" DagError I... |
from __future__ import unicode_literals
import copy
import logging
import time
from collections import OrderedDict
from contextlib import contextmanager
import six
from django.utils.functional import cached_property
from .client import get_es_client
logger = logging.getLogger('elasticindex')
class ElasticQuerySet(objec... |
def table_exists(curs, table_name=''):
'''
If table_name is a schema qualified table name and it exists it is returned,
else if it is not schema qualified and the table name exists in the search
path then that schema qualified table name is returned, else None.
'''
curs.execute('SELECT pgpartiti... |
class A:
def foo(self):
print('A.foo()')
class B(A):
def foo(self):
print('B.foo()')
class C(A):
def foo(self):
print('C.foo()')
class D(B, C):
def foo(self):
print('D.foo()')
x = D()
print(D.__mro__) # (D, B, C, A, object)
x.foo() # D.foo() |
"""Implementation of gcloud dataflow jobs cancel command.
"""
from googlecloudsdk.api_lib.dataflow import job_utils
from googlecloudsdk.calliope import base
from googlecloudsdk.core import log
from surface import dataflow as commands
from googlecloudsdk.third_party.apitools.base.py import exceptions
class Cancel(base.C... |
from currencies.models import Currency
def currencies(request):
currencies = Currency.objects.active()
if not request.session.get('currency'):
try:
currency = Currency.objects.get(is_default__exact=True)
except Currency.DoesNotExist:
currency = None
request.sessio... |
"""
Using dates with timeseries models
"""
import statsmodels.api as sm
import numpy as np
import pandas
data = sm.datasets.sunspots.load()
from datetime import datetime
dates = sm.tsa.datetools.dates_from_range('1700', length=len(data.endog))
endog = pandas.TimeSeries(data.endog, index=dates)
ar_model = sm.tsa.AR(endo... |
import inspect
import os
from abc import ABC, ABCMeta
from dataclasses import dataclass
from datetime import datetime, tzinfo
from types import FunctionType, WrapperDescriptorType
from typing import (
Any,
Callable,
Dict,
Generic,
Iterable,
List,
Optional,
Type,
TypeVar,
Union,
... |
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from django.core.cache import cache
from sentry.testutils import PermissionTestCase
from sentry.api.endpoints.setup_wizard import SETUP_WIZARD_CACHE_KEY
class SetupWizard(PermissionTestCase):
def test_redirect(self):
user = ... |
import os
from framework.Targets import ApacheTarget
class Target(ApacheTarget):
def get_path(filename):
return os.path.dirname(os.path.realpath(__file__)) + '/' + filename
name = "eXtplorer 2.1"
application_dir_mapping = [get_path("application"), "/var/www"]
chroot_environment = "Debian5" |
try:
INSTALLED_APPS
except NameError:
INSTALLED_APPS=() |
import sys, time, os
from django.conf import settings
from django.core import mail
from django.core.mail.backends import locmem
from django.db import DEFAULT_DB_ALIAS
from django.test import signals
from django.template import Template
from django.utils.translation import deactivate
from django.utils.unittest import sk... |
"""
Copyright (C) 2018 Roberto Bruttomesso <roberto.bruttomesso@gmail.com>
This file is distributed under the terms of the 3-clause BSD License.
A copy of the license can be found in the root directory or at
https://opensource.org/licenses/BSD-3-Clause.
Author: Roberto Bruttomesso <roberto.bruttomesso@gmail.com>
Date... |
from lazyrunner import pmodule, PModule, preset, presetTree, defaults
from treedict import TreeDict
p = defaults()
p.data_defaults.a = 1
p.data_defaults.b = 2
@preset
def change_default_a(p):
p.data_defaults.a = 10
@pmodule
class Data(PModule):
# Use this to set up the local branch of the preset tree. Calling
... |
from django.db import models
from sampledatahelper.helper import SampleDataHelper
from sampledatahelper import handlers
class Register(object):
fields = {}
ignored_fields = []
_instance = None
sd = SampleDataHelper()
def __new__(cls, *args, **kwargs):
if not cls._instance:
cls._i... |
"""Functional tests using WebTest.
See: http://webtest.readthedocs.org/
"""
from flask import url_for
from recruit_app.user.models import User
from .factories import UserFactory
class TestLoggingIn:
"""Login."""
def test_can_log_in_returns_200(self, user, testapp):
"""Login successful."""
# Goes... |
import numdifftools
numdifftools.test() |
'''The app module, containing the app factory function.'''
from flask import Flask, render_template
from cheapr.settings import ProdConfig
from cheapr.assets import assets
from cheapr.extensions import (
bcrypt,
cache,
db,
login_manager,
migrate,
debug_toolbar,
)
from cheapr import public, user
... |
"""
desispec.pipeline
====================
Tools for pipeline creation and running.
"""
from __future__ import absolute_import, division, print_function
from . import tasks
from .defs import (task_states, prod_options_name,
task_state_to_int, task_int_to_state)
from .db import (all_task_types, DataBaseSqlite, DataB... |
'''Unit tests for writers.android_policy_writer'''
import os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.path.dirname(__file__), '../../../..'))
import unittest
from xml.dom import minidom
from writers import writer_unittest_common
from writers import android_policy_writer
class AndroidPolic... |
from setuptools import setup, find_packages
import versioneer
setup(name='conwhat', #version=versioneer.get_version(),
description='python library for connectome-based white matter atlas analyses in neuroimaging',
long_description='python library for connectome-based white matter atlas analyses in neuroimag... |
from datetime import timedelta
import resource
import time
import urllib
from django.core.exceptions import ObjectDoesNotExist
from snh.models.youtubemodel import *
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
import snhlogger
logger = snhlogger.init_logger(__name__, "youtube.log")
def... |
import datetime, re
from mod_helper import *
debug = True
def sesamstrasseShow():
mediaList = ObjectContainer(no_cache=True)
if debug == True: Log("Running sesamstrasseShow()...")
try:
urlMain = "http://www.sesamstrasse.de"
content = getURL(urlMain+"/home/homepage1077.html")
spl = content.split('<div class="th... |
from code import InteractiveConsole
import sys
try:
import websocket
except:
print('Please install websocket_client')
raise
class InteractiveRemoteConsole(InteractiveConsole):
def __init__(self, uri=None):
if uri is None:
uri = 'ws://localhost:44445/'
InteractiveConsole.__ini... |
from bs4 import BeautifulSoup
from urllib2 import urlopen
import csv
BASE_URL = 'http://www.tutiempo.net'
PAGE_1 = '/en/Climate/India/IN.html'
PAGE_2 = '/en/Climate/India/IN_2.html'
headings = ['Location', 'Year', 'Month', 'T', 'TM', 'Tm', 'SLP', 'H', 'PP', 'VV', 'V', 'VM', 'VG', 'RA', 'SN', 'TS', 'FG']
MAX_ROWS = 1000... |
import csv, datetime
from cStringIO import StringIO
from field_reference import fields
TRANSACTION_MAX_ROWS = 1000
class CSV_dumper(object):
""" Helper class to aggregate electronic filing data rows, which can then be loaded w/ raw postgres 'copy...' in a single transaction block. Because we're using cStringIO we c... |
from logger import Logger
class DeviceMerger:
""" DeviceMerger
Merges several devices into logical groups.
Since most Devices have the same peripherals, but differ in other
parameters, like Flash/RAM/EEPROM sizes, packaging or other minor
differences, it makes sense to group them accordingly.
Please not that this... |
__author__ = "Martin Jakomin, Mateja Rojko"
"""
Classes for boolean operators:
- Var
- Neg
- Or
- And
- Const
Functions:
- nnf
- simplify
- cnf
- solve
- simplify_cnf
"""
import itertools
def nnf(f):
""" Returns negation normal form """
return f.nnf()
def simplify(f):
""" Simplifies the expression """
r... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 7, transform = "Anscombe", sigma = 0.0, exog_count = 100, ar_order = 12); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.