code stringlengths 1 199k |
|---|
"""
Created on Tue Jun 12 13:45:31 2018
@author: huyn
""" |
"""
A test script for the `indextable` module
"""
from random import randrange
import pytest
from HamiltonianPy.indextable import IndexTable
class TestIndexTable:
def test_init(self):
match0 = r"unhashable type"
match1 = r"The .* has different type from the previous ones"
match2 = r"The .* o... |
__author__ = "Laura Martinez Sanchez"
__license__ = "GPL"
__version__ = "1.0"
__email__ = "lmartisa@gmail.com"
from osgeo import gdal, gdalnumeric, ogr, osr
import numpy as np
from PIL import Image, ImageDraw
from collections import defaultdict
import pickle
import time
from texture_common import *
def world2Pixel(geoM... |
import sys
import subprocess
import urllib.request
import copy
def main(argv):
cookie = urllib.request.HTTPCookieProcessor()
oc = copy.deepcopy(cookie)
if __name__ == '__main__':
sys.exit(main(sys.argv)) |
"""
Playlist Generation
"""
from os import path
from random import choice
import string
import pafy
from .. import content, g, playlists, screen, util, listview
from ..playlist import Playlist
from . import command, search, album_search
@command(r'mkp\s*(.{1,100})')
def generate_playlist(sourcefile):
"""Generat... |
import sys,os
os.environ["EPICS_CA_ADDR_LIST"] = "192.168.82.10"
os.environ["EPICS_CA_MAX_ARRAY_BYTES"] = "100000000"
import velaINJMagnetControl as VIMC
a = VIMC.velaINJMagnetController(True,False)
a.switchONpsu('SOL')
print(a.getRI('SOL'))
a.switchONpsu('SOL')
print(a.isON('SOL')) |
from openstates.utils import LXMLMixin
import datetime as dt
from pupa.scrape import Scraper, Event
from .utils import get_short_codes
from requests import HTTPError
import pytz
URL = "http://www.capitol.hawaii.gov/upcominghearings.aspx"
class HIEventScraper(Scraper, LXMLMixin):
def get_related_bills(self, href):
... |
from oauth2 import Consumer, Client, Token
from httplib2 import ProxyInfo
from httplib2.socks import PROXY_TYPE_HTTP
from django.conf import settings
class Authentication(object):
def __init__(self, consumer_key, consumer_secret, token_key, token_secret):
consumer = Consumer(key=consumer_key, secret=consume... |
def classeq(x, y):
return x.__class__==y.__class__
class Element(object): pass |
import json
import time
class TaskQueueInputError(Exception):
def __init__(self, *args, **kwargs):
Exception.__init__(self, *args, **kwargs)
class TaskQueueSystemError(Exception):
def __init__(self, *args, **kwargs):
Exception.__init__(self, *args, **kwargs)
class TaskQueueEmptyError(Exception):... |
"""
Conversion pack for October 2021 release
"""
CONVERSIONS = {
# Renamed items
"Quafe Zero": "Quafe Zero Classic",
"Exigent Sentry Drone Navigation Mutaplasmid": "Exigent Sentry Drone Precision Mutaplasmid",
} |
ROOT = '/.well-known/acme-challenge'
ENDPOINT = '/k9s7WeOPg3HdSjwlAqEVRxnezsGGe-CFOwPfOcU3VgU'
RESPONSE = 'k9s7WeOPg3HdSjwlAqEVRxnezsGGe-CFOwPfOcU3VgU.QBkCfzPq0mKXIJSktgl4_b7psKazh3MSZ8juWnZbJbg' |
import contextlib
import logging
import os
import stat
from unittest import mock
import fixtures
import http.server
import progressbar
import threading
import testscenarios
import testtools
import snapcraft
from snapcraft.internal import common, elf, steps
from snapcraft.internal.project_loader import grammar_processin... |
"""
Copyright (c) 2015, Philipp Klaus. All rights reserved.
License: GPLv3
"""
from distutils.core import setup
setup(name='netio230a',
version = '1.1.9',
description = 'Python package to control the Koukaam NETIO-230A',
long_description = 'Python software to access the Koukaam NETIO-230A and NETIO-23... |
import actor
class Oxygen(actor.Actor):
extra_keys = ['capacity', 'pipe_length', 'is_initial']
def __init__(self, *args, **kwargs):
super(Oxygen, self).__init__(*args, **kwargs)
self.capacity = kwargs.get('capacity', 3000)
self.contained = self.capacity
self.pipe_length = kwargs.... |
"""
Tests for L{twisted.internet.stdio}.
@var properEnv: A copy of L{os.environ} which has L{bytes} keys/values on POSIX
platforms and native L{str} keys/values on Windows.
"""
from __future__ import absolute_import, division
import os
import sys
import itertools
from twisted.trial import unittest
from twisted.pyth... |
"""Contains expectations."""
import inquisition
FISHY = inquisition.SPANISH
FISHY = FISHY.replace('surprise', 'haddock')
print FISHY |
import csv
from datetime import datetime
from django.conf import settings
from django.core.management import BaseCommand
from bustimes.utils import download_if_changed
from ...models import Licence, Registration, Variation
def parse_date(date_string):
if date_string:
return datetime.strptime(date_string, '%... |
from unittest import TestCase
from MyCapytain.resources.collections.cts import XmlCtsTextInventoryMetadata, XmlCtsTextgroupMetadata, XmlCtsWorkMetadata, XmlCtsEditionMetadata, XmlCtsTranslationMetadata
from MyCapytain.resources.prototypes.cts.inventory import CtsTextgroupMetadata
with open("tests/testing_data/examples/... |
from urllib.parse import urlparse
import subprocess
import logging
import boto3
import airflow.hooks.base_hook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
import utils.helpers as helpers
class PostgresToS3Transfer(BaseOperator):
'''Dumps a Postgres database to a S3 ke... |
from weboob.capabilities.recipe import ICapRecipe, Recipe
from weboob.tools.backend import BaseBackend
from .browser import SevenFiftyGramsBrowser
import unicodedata
def strip_accents(s):
return ''.join(c for c in unicodedata.normalize('NFD', s) if unicodedata.category(c) != 'Mn')
__all__ = ['SevenFiftyGramsBackend... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('website', '0007_auto_20170422_1622'),
]
operations = [
migrations.AlterField(
model_name='user',
name='name',
field=m... |
{
'name': 'Order BOM explode report',
'version': '0.1',
'category': 'Report',
'description': '''
Manage report for order product
''',
'author': 'Micronaet S.r.l. - Nicola Riolini',
'website': 'http://www.micronaet.it',
'license': 'AGPL-3',
'depends': [
'base',
... |
from django.apps import AppConfig
class PhotosAppConfig(AppConfig):
name = 'livinglots_usercontent.photos'
def ready(self):
try:
from actstream import registry
from . import signals
registry.register(self.get_model('Photo'))
except ImportError:
# d... |
{
"name" : "GII",
"version" : "1.0",
"depends" : ['sale','product'],
"author" : "Novasoft Consultancy Services Pvt. Ltd.",
'category' : 'Generic Modules/Others',
"description": """ GII - Management Module
""",
'website': 'http://www.novasoftindia.com',
'data': ['giisa.xml',
... |
import sys
import codecs
input_file = sys.stdin # input = file containing the student answer.
oz_file = codecs.open("/task/task.oz", "r", "utf8") # Open the "correction framework file".
new_file = codecs.open("new_file.oz", "w","utf8") # Open the final file.
for line in oz_file:
# "@@q1@@" is the arbitrary marker... |
import numpy as np
class PriceHistoryPack(object):
def __init__(self, input_seq_len, num_features, target_seq_len):
super(PriceHistoryPack, self).__init__()
self.sku_ids = []
self.XX = np.empty((0, input_seq_len, num_features))
self.YY = np.empty((0, target_seq_len))
self.seq... |
"""
Unit tests covering the program listing and detail pages.
"""
import json
import re
from urlparse import urljoin
from uuid import uuid4
import mock
from bs4 import BeautifulSoup
from django.conf import settings
from django.urls import reverse, reverse_lazy
from django.test import override_settings
from lms.envs.tes... |
from django.http import HttpResponse
from openpyxl import Workbook
from openpyxl.writer.excel import save_virtual_workbook
from openpyxl.styles import Color, Style, PatternFill, Font, colors
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from base import models as mdl
from bas... |
from odoo.osv import expression
from odoo.addons.sale_timesheet.models.account import AccountAnalyticLine
def _timesheet_get_portal_domain(self):
""" WE revert this functionality of odoo. We want to show details of ordered quantities also
Only the timesheets with a product invoiced on delivered quantity are... |
class Backstab:
pass |
import logging
import random
import time
import uuid
from openerp import SUPERUSER_ID
import simplejson
from openerp import api
from openerp import tools
from openerp.osv import fields, osv
from openerp.osv import expression
from openerp.tools.translate import _
from openerp.tools.safe_eval import safe_eval
import open... |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('patients', '0026_clinicianother_user'),
]
operations = [
migrations.AddField(
... |
from . import slide_channel_technology_category
from . import slide_channel_technology
from . import slide_channel |
from django.db import transaction
from django.db import connection
@transaction.atomic
def bulk_update_userstory_custom_attribute_order(project, user, data):
cursor = connection.cursor()
sql = """
prepare bulk_update_order as update custom_attributes_userstorycustomattribute set "order" = $1
where c... |
from odoo import models
from odoo.tests.common import SavepointCase
class BaseKanbanAbstractTester(models.TransientModel):
_name = 'base.kanban.abstract.tester'
_inherit = 'base.kanban.abstract'
class TestBaseKanbanAbstract(SavepointCase):
@classmethod
def _init_test_model(cls, model_cls):
""" I... |
"""
Tests for users API
"""
import datetime
import ddt
import pytz
from django.conf import settings
from django.template import defaultfilters
from django.test import RequestFactory, override_settings
from django.utils import timezone
from milestones.tests.utils import MilestonesTestCaseMixin
from mock import patch
fro... |
from .MaterialModifier import *
class MagicOre(MaterialModifier):
pass |
from odoo import models, fields, api, _
from odoo.addons.http_routing.models.ir_http import slug
class EventEvent(models.Model):
_inherit = "event.event"
community_menu = fields.Boolean(
"Community Menu", compute="_compute_community_menu",
readonly=False, store=True,
help="Display commun... |
{
'name': "Absence Management",
'summary': """Create time based absence notifications""",
'author': 'Onestein',
'website': 'http://www.onestein.eu',
'images': ['static/description/main_screenshot.png'],
'category': 'Human Resources',
'version': '10.0.1.0.0',
'license': 'AGPL-3',
'dep... |
{
"name": "Account Invoice Payment Retention",
"version": "14.0.1.0.1",
"category": "Accounting & Finance",
"author": "Ecosoft, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/account-invoicing",
"depends": ["account"],
"data": [
"securi... |
import unittest
import doctest
import sys
import time
import timeside.core
class _TextTestResult(unittest.TestResult):
"""A test result class that can print formatted text results to a stream.
Used by TextTestRunner.
"""
separator1 = '=' * 70
separator2 = '-' * 70
def __init__(self, stream, desc... |
from flask import Flask
from redis import Redis
from rq import Queue
import rq_dashboard
from flask_mongoengine import MongoEngine
from validator.config import Configuration
app = Flask(__name__)
app.config.from_object(Configuration)
db = MongoEngine(app)
redis_conn = Redis()
queue = Queue('high', connection=redis_conn... |
from __future__ import unicode_literals
from django.db import models, migrations
import autoslug.fields
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='ProjectPodcast',
fields=[
... |
from core.managers.containers import *
from core.managers.imports import *
from core.managers.analysis_manager import AnalysisManager
from core.managers.annotation_manager import AnnotationManager
from core.managers.file_manager import FileManager
from core.managers.filter_manager import FilterEngine
from core.managers... |
from __future__ import absolute_import, division, print_function
import json
import os
import sys
from six import PY3
from twisted.internet.selectreactor import SelectReactor
from twisted.internet.task import LoopingCall
from crossbar.controller import cli
from .test_cli import CLITestBase
DEBUG = False
def make_lc(sel... |
from odoo import fields, models
SORTING_CRITERIA = [
("name", "By name"),
("product_id.name", "By product name"),
("product_id.default_code", "By product reference"),
("date_planned", "By date planned"),
("price_unit", "By price"),
("product_qty", "By quantity"),
]
SORTING_DIRECTION = [
("as... |
import os
import gobject
import json
import shutil
import tarfile
from glue.paths import INSTALLER
from data.skarphed.Skarphed import AbstractInstaller, AbstractDestroyer
from glue.lng import _
from glue.paths import COREFILES
import logging
TARGETNAME = "Debian 7 / nginx"
EXTRA_PARAMS = {
'nginx.domain':(_('Domain... |
from documents.models import Document
from categories.models import Category
import os
def move_doc(doc_id, cat_id):
doc = Document.objects.get(pk=int(doc_id))
old_cat = doc.refer_category
new_cat = Category.objects.get(pk=int(cat_id))
for p in doc.pages.all():
cmd = "mv " + p.get_absolute_path(... |
from pyramid.view import view_config
import logging
import pysite.resmgr
L = logging.getLogger('PySite')
@view_config(
name='',
context=pysite.plugins.models.Node,
renderer='pysite:plugins/templates/index.mako',
permission='admin'
)
def index(context, request):
return dict() |
from odoo import _, fields, models
class ResPartner(models.Model):
_inherit = "res.partner"
_allowed_inactive_link_models = ["res.partner"]
_inactive_cascade = True
sta_mandate_ids = fields.One2many(
comodel_name="sta.mandate",
inverse_name="partner_id",
string="State Mandates",
... |
from default import Test, with_context
from factories import reset_all_pk_sequences
class TestAPI(Test):
endpoints = ['app', 'task', 'taskrun', 'user'] |
from odoo import models, fields, api
class AccountGroup(models.Model):
_inherit = 'account.group'
length_account = fields.Integer(
string='Length account', compute='_compute_length_account',
store=True)
without_headquarter = fields.Boolean(
string='Without headquarter in invoices and... |
from openerp import fields, models, api
from openerp.addons.event_track_assistant._common import\
_convert_to_utc_date, _convert_to_local_date, _convert_time_to_float
date2string = fields.Date.to_string
datetime2string = fields.Datetime.to_string
str2datetime = fields.Datetime.from_string
class WizEventAppendAssist... |
from models import *
from django.contrib.auth.models import User as django_User
from datetime import datetime
from django import forms
from django.contrib.gis.geos import Point
class LoginForm(forms.ModelForm):
class Meta:
model = User
widgets = {
'mail': forms.EmailInput(attrs={'aria-in... |
from abc import ABCMeta, abstractmethod
import numbers
import copy
import random
import numpy as np
from nupic.data.fieldmeta import FieldMetaType
import nupic.math.roc_utils as roc
from nupic.data import SENTINEL_VALUE_FOR_MISSING_DATA
from nupic.frameworks.opf.opfutils import InferenceType
from nupic.utils import Mov... |
from . import print_calendar_report |
import datetime
from django.db.models import Q
from django.http import HttpResponse, HttpResponseServerError, Http404, HttpResponseNotFound, HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
fr... |
from __future__ import unicode_literals
import ckeditor.fields
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('meinberlin_budgeting', '0007_update-strings'),
]
operations = [
migrations.AlterField(
model_name... |
import string
import random
import json
from collections import defaultdict
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from catmaid.fields import Double3D
from catmaid.models import Log, NeuronSearch, CELL_BODY_CHOICES, \
... |
from openerp import models, fields, api
import openerp.addons.decimal_precision as dp
class ProductSupplierInfo(models.Model):
_inherit = 'product.supplierinfo'
discount = fields.Float(
string='Discount (%)', digits_compute=dp.get_precision('Discount'))
@api.onchange('name')
@api.multi
def o... |
import sys
sys.path.append('../../lib/python')
sys.path.append('./normalizer/')
import random
import time
import subprocess
import cPickle
import os.path
import imp
import re
import traceback
from voltdbclient import *
from optparse import OptionParser
from Query import VoltQueryClient
from SQLCoverageReport import gen... |
import logging
from openfisca_core.tools import assert_near
from openfisca_country_template import CountryTaxBenefitSystem
from openfisca_survey_manager.tests.test_scenario import (
create_randomly_initialized_survey_scenario
)
log = logging.getLogger(__name__)
tax_benefit_system = CountryTaxBenefitSystem()
def... |
import setuptools
__author__ = 'Damjan Georgievski'
__version__ = '2.0'
__email__ = 'gdamjan@gmail.com'
setuptools.setup(
name = 'convertor',
version = __version__,
author = __author__,
author_email = __email__,
description = 'converts ODF files from a YUSCII font-encoding to proper UTF-8 ODF',
... |
from django.core.management.base import BaseCommand, CommandError
from quotes_app.tasks import rank_all
import logging
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = 'Runs reranking algorithms on the Quotes.'
def handle(self, *args, **options):
logger.info('Running {0} managemen... |
from collections import defaultdict
from django.core.files.storage import DefaultStorage
from django.core.management.base import BaseCommand, CommandError
from candidates.csv_helpers import list_to_csv, memberships_dicts_for_csv
from elections.models import Election
def safely_write(output_filename, memberships_list):
... |
from __future__ import unicode_literals
import webnotes
from webnotes.utils import add_days, cstr, getdate
from webnotes.model.doc import addchild
from webnotes.model.bean import getlist
from webnotes import msgprint, _
from stock.utils import get_valid_serial_nos
from utilities.transaction_base import TransactionBase,... |
class Year(object):
def __init__(self, year):
self.year = year
def is_leap_year(self):
return (self._by_4() and not self._by_100()) \
or self._by_400()
def _by_4(self):
return self.year % 4 == 0
def _by_100(self):
return self.year % 100 == 0
def _by_400... |
from openerp import fields, models, api
import re
class res_partner(models.Model):
_inherit = 'res.partner'
#def _get_default_tp_type(self):
# return self.env.ref('l10n_cl_invoice.res_IVARI').id
# todo: pasar los valores por defecto a un nuevo módulo
# por ejemplo "l10n_cl_res_partner_defaults
... |
""""""
from __future__ import annotations
from flask import Flask
from .criterion import TagCriterion
from .extension import TagsExtension
__all__ = ["TagsExtension", "TagCriterion"]
def register_plugin(app: Flask):
TagsExtension(app) |
import os
import sys
from nxdrive.logging_config import get_logger
from nxdrive.utils import safe_long_path
from tests.common_unit_test import UnitTestCase
if sys.platform == 'win32':
import win32api
log = get_logger(__name__)
FOLDER_A = 'A' * 90
FOLDER_B = 'B' * 90
FOLDER_C = 'C' * 90
FOLDER_D = 'D' * 50
class Tes... |
from __future__ import absolute_import
from fife import fifechan
from fife.extensions.pychan.attrs import IntAttr, FloatAttr
from .widget import Widget
class Slider(Widget):
""" A slider widget
Use a callback to read out the slider value every time the marker
is moved.
New Attributes
==============
- orientatio... |
"""Document management blueprint."""
from __future__ import annotations
from flask import g
from abilian.i18n import _l
from abilian.sbe.apps.communities.blueprint import Blueprint
from abilian.sbe.apps.communities.security import is_manager
from abilian.sbe.apps.documents.actions import register_actions
from abilian.w... |
import os.path
import re
import shutil
import llnl.util.tty as tty
import llnl.util.lang
import spack.compiler
import spack.compilers.clang
import spack.util.executable
import spack.version
class AppleClang(spack.compilers.clang.Clang):
openmp_flag = "-Xpreprocessor -fopenmp"
@classmethod
@llnl.util.lang.me... |
"""Functions to import builds/defconfigs."""
try:
import simplejson as json
except ImportError:
import json
try:
from os import walk
except ImportError:
from scandir import walk
import bson
import datetime
import io
import os
import pymongo.errors
import re
import redis
import types
import models
import... |
import unittest
from pyscsi.pyscsi import scsi_enum_inquiry as INQUIRY
from pyscsi.pyscsi.scsi_cdb_inquiry import Inquiry
from pyscsi.pyscsi.scsi_enum_command import sbc
from pyscsi.utils.converter import scsi_int_to_ba
from .mock_device import MockDevice, MockSCSI
class MockInquiryStandard(MockDevice):
def execute... |
"""
irc/server.py
Copyright © 2009 Ferry Boender
Copyright © 2012 Jason R. Coombs
This server has basic support for:
* Connecting
* Channels
* Nicknames
* Public/private messages
It is MISSING support for notably:
* Server linking
* Modes (user and channel)
* Proper error reporting
* Basically everything else
It is mos... |
import os.path
from celery.task import task
from celery.task.sets import subtask
from django.core.files import File
import logging
import subprocess
import string
import shutil
import pycurl
import tempfile
import re
import pycurl
import sys
class Storage:
def __init__(self):
self.contents = []
def stor... |
"""
setup.py file for augeas
"""
import os
prefix = os.environ.get("prefix", "/usr")
from distutils.core import setup
setup (name = 'python-augeas',
version = '0.3.0',
author = "Harald Hoyer",
author_email = "augeas-devel@redhat.com",
description = """Python bindings for Augeas""",
... |
import sys
import gdb
import os
import os.path
pythondir = '/Users/igrokhotkov/projects/esp8266/esptools/crosstool-NG/builds/xtensa-lx106-elf/share/gcc-4.8.2/python'
libdir = '/Users/igrokhotkov/projects/esp8266/esptools/crosstool-NG/builds/xtensa-lx106-elf/xtensa-lx106-elf/lib'
if gdb.current_objfile () is not None:
... |
from configparser import RawConfigParser
import os
import re
from subprocess import call, check_call, Popen, PIPE, STDOUT
import sys
from errors import Errors
from general import (
exists_and_is_directory, shellquote, print_stderr
)
from githelpers import has_objects_and_refs
class OptionFrom:
'''enum-like valu... |
from __future__ import print_function
import sys
import os
import time
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from Xlib.display import Display
from Xlib.ext import xfixes
def main(argv):
if len(sys.argv) != 2:
sys.exit('usage: {0} SELECTION\n\n'
'SELECTION is typical... |
from sys import argv
import logging
from MonkeyScraper import MonkeyScraper
LOG_FILENAME = 'MonkeyScraper.log'
logging.basicConfig(filename=LOG_FILENAME, level=logging.DEBUG)
def main(username, password, survey_url):
"""
Creates a MonkeyScraper, logs in, and scrapes the survey at the provided url
:param use... |
"""Test suite for language_check."""
from __future__ import unicode_literals
import unittest
import warnings
from collections import namedtuple
import language_check
class TestLanguageTool(unittest.TestCase):
CheckTest = namedtuple('CheckTest', ('text', 'matches'))
Match = namedtuple('Match', ('fromy', 'fromx',... |
import fnmatch
import glob
import itertools
import os
import re
import subprocess
import sys
import fileutil
version_number_re = r'([0-9]+(?:.[0-9]+){2,3})'
incomplete_version_number_re = r'^[0-9]+(?:.[0-9]+){2}$'
version_line_re = r'^### v{0}.*$'.format(version_number_re)
def get_topmost_version_line(changelog_file):
... |
import sys
import os
default_variant = 'PySide'
env_api = os.environ.get('QT_API', 'pyqt')
if '--pyside' in sys.argv:
variant = 'PySide'
elif '--pyqt4' in sys.argv:
variant = 'PyQt4'
elif env_api == 'pyside':
variant = 'PySide'
elif env_api == 'pyqt':
variant = 'PyQt4'
else:
variant = default_varian... |
import _metagam3d
from _metagam3d import AxisAlignment, AlignmentType
from metagam3d.channels import blocking
from metagam3d.scripts import m3d_expr
from concurrence import Tasklet
class LoadError(Exception):
pass
class Object(_metagam3d.Object):
def __init__(self, objid):
_metagam3d.Object.__init__(sel... |
from ufl import (Coefficient, TestFunction, TrialFunction, VectorElement, dot,
dx, grad, triangle)
element = VectorElement("Lagrange", triangle, 1)
u = TrialFunction(element)
v = TestFunction(element)
w = Coefficient(element)
a = dot(dot(w, grad(u)), v) * dx |
import sys, signal, logging, time, RPi.GPIO as GPIO
FLOATSW_HIGH_WL = 26 # high water level float switch
WATER_VALVE = 10 # GPIO port for the Water Electo valve, High by default after boot
VALVE_CHGSTATE_TIMER = 25 # Elect... |
try:
import gnomecanvas
except:
import gnome.canvas as gnomecanvas
from ecell.ui.model_editor.Constants import *
from ecell.ui.model_editor.Utils import *
from ecell.ui.model_editor.ResizeableText import *
class ComplexLine:
def __init__( self, anObject, aCanvas ):
self.theCanvas = aCanvas
s... |
import base64
import struct
__version__ = "0.23"
SBP_PREAMBLE = 0x55
crc16_tab = [0x0000,0x1021,0x2042,0x3063,0x4084,0x50a5,0x60c6,0x70e7,
0x8108,0x9129,0xa14a,0xb16b,0xc18c,0xd1ad,0xe1ce,0xf1ef,
0x1231,0x0210,0x3273,0x2252,0x52b5,0x4294,0x72f7,0x62d6,
0x9339,0x8318,0xb37b,0xa35a,... |
from time import sleep
from NaoCommunication import *
nao=NaoControle(Nao())
for a in range(16):
if a%2==0:
nao.reglerCouleur(a,a*15,50,50)
else :
nao.reglerCouleur(a,255,0,0)
sleep(0.1)
for a in range(15,-1,-1):
nao.eteindreLed(a)
sleep(0.1)
for a in range(15,-1,-1):
nao.allumerLed(a)
sleep(0.1)
for a in ra... |
from gnss_analysis.runner import run as single_run
import pandas as pd
import numpy as np
def main():
import argparse
parser = argparse.ArgumentParser(description='RTK Filter SITL tests.')
parser.add_argument('infile', help='Specify the HDF5 file to use for input.')
parser.add_argument('outfile', help='Specify ... |
"""@brief Lightweight pure-Python neural network library.
@file neuralnet.py
@package pybooster.neuralnet
@version 2019.12.23
@author Devyn Collier Johnson <DevynCJohnson@Gmail.com>
@copyright LGPLv3
@section DESCRIPTION
@code{.py}
from pybooster.neuralnet import NeuroCode
data = [ # The input and output of an XOR gat... |
'''
Created on 05.11.2013
@author: gena
'''
from __future__ import print_function
from PyQt4 import QtCore
from escore.plate import Plate
from escore.approximations import indexByName
class PlateRecord(object):
def __init__(self, plate, name,path):
self.plate=plate
self.name=name
self.path=p... |
"""\
"""
__revision__ = "$Id: mypydoc.py,v 1.9 2009/10/07 20:52:24 rliebscher Exp $"
import sys, inspect
from string import join, split, strip
import pydoc
from pydoc import visiblename, pkgutil, getdoc, isdata
class MyHTMLDoc(pydoc.HTMLDoc):
"""Formatter class for HTML documentation."""
def filelink(self, url,... |
from django.contrib.sites.models import Site
from django.conf import settings
def get_site_url(request, slash=False):
domain = Site.objects.get_current().domain
protocol = 'https' if request.is_secure() else 'http'
root = "%s://%s" % (protocol, domain)
if slash:
root += '/'
return root
def a... |
from hpp.corbaserver.rbprm import Client as RbprmClient
from hpp.corbaserver import Client as BasicClient
import hpp.gepetto.blender.exportmotion as em
class CorbaClient:
"""
Container for corba clients to various interfaces.
"""
def __init__ (self):
self.basic = BasicClient ()
self.rbpr... |
import os
import numpy as np
import flopy
ml = flopy.modflow.Modflow.load('l2a_2k.nam', version='mf2005', verbose=True)
delx = ml.dis.delr.array
dely = ml.dis.delc.array
f = open('l2a_2k.lst', 'r')
for line in f:
if 'LAYER # ROW # COLUMN # LAKE # INTERFACE TYPE LAKEBED LEAKANCE' in line:
break
cda... |
from rbnics.problems.base import NonlinearProblem
from rbnics.problems.elliptic import EllipticProblem
from rbnics.backends import product, sum, transpose
NonlinearEllipticProblem_Base = NonlinearProblem(EllipticProblem)
class NonlinearEllipticProblem(NonlinearEllipticProblem_Base):
# Default initialization of memb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.