code stringlengths 1 199k |
|---|
import os
import json
from mod import get_unique_name, safe_json_load, TextFileFlusher
from mod.settings import BANKS_JSON_FILE, LAST_STATE_JSON_FILE
def list_banks(brokenpedalbundles = [], shouldSave = True):
banks = safe_json_load(BANKS_JSON_FILE, list)
if len(banks) == 0:
return []
changed = ... |
__author__ = 'Mathias'
import timeit
def coin_sum(amount, coins):
if amount == 0 or len(coins) == 1:
return 1
else:
different_ways = 0
coins = sorted(coins)
largest_coin = coins[-1]
ways = amount // largest_coin
for n in range(ways + 1):
different_ways... |
from trepan.processor.command.base_subcmd import DebuggerSubcommand
from pprint import pformat
class InfoReturn(DebuggerSubcommand):
"""return value
Show the value that is to be returned from a function. This command
is useful after a 'finish' command or stepping just after a 'return'
statement."""
min_abbrev ... |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
import json
from six import iteritems
from frappe.utils import flt, getdate
from erpnext.regional.india import state_numbers
class GSTR3BReport(Document):
def before_save(self):
self.get_data()
def get_data(self):
sel... |
from functools import reduce
import ciso8601
import codecs
import datetime
import h5py
import logging
import numpy as np
import os
from osgeo import osr
from matplotlib import colors
from matplotlib import cm
from PIL import Image
from openradar import config
UTM = 3405
DHDN = 4314
WGS84 = 4326
GOOGLE = 900913
AEQD_PRO... |
from cmio import ILImageService
from cmio import ILImageService_init as init
from cmio import ILImageService_v as v |
from agui import Signal
from agui.awidgets import AWidget
class AComboBox(AWidget):
def __init__(self, item = None):
self._list = []
self._selected = 0
self.changed = Signal()
AWidget.__init__(self, item)
def emit_changed(self, *args):
self.changed.emit(self.selected)
... |
import re
from itertools import chain
import mwparserfromhell
from .encodings import dotencode
from .title import canonicalize
__all__ = [
"strip_markup", "get_adjacent_node", "get_parent_wikicode", "remove_and_squash",
"get_section_headings", "get_anchors", "ensure_flagged_by_template",
"ensure_unflagged_b... |
import os
import sys
TEST_ROOT_DIR = os.path.dirname(__file__)
parentdir = os.path.dirname(TEST_ROOT_DIR)
parentdir2 = os.path.dirname(TEST_ROOT_DIR)
sys.path.insert(0,parentdir)
sys.path.insert(0,parentdir2)
os.chdir(TEST_ROOT_DIR) |
"""
The top-level *pypers* package export just one utility function (see below).
The rest of the functionality is in the four sub-packages listed above.
"""
def import_all(namespace, dir):
"""
Import all Python files in the directory `dir` and add all the symbols
they define into the namespace `namespace.__... |
"""
This file contains the `Board` class, which implements the rules for the
game Isolation as described in lecture, modified so that the players move
like knights in chess rather than queens.
You MAY use and modify this class, however ALL function signatures must
remain compatible with the defaults provided, and none ... |
import uuid
import os
import sys
import datetime
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 'lib', 'transit')))
import Transit
import ConfigParser
config = ConfigParser.RawConfigParser()
config.read(os.path.abspath(os.path.join(os.path.dirname(__file__), 'settings.cfg')))
SESSIONS_HOST = co... |
__author__ = 'https://github.com/arkadoel'
"""
Compilar en linux
sudo /opt/miniconda3/bin/python3 ./setup.py build
"""
import sys
from cx_Freeze import setup, Executable
import core.Constantes as const
build_exe_options = {
"packages": ['', 'gui', 'core', 'core.manzana', 'directORM'],
"excludes": ["tkinter"]
}
... |
"""
Tests for ReducePyCkovPlot
"""
import base64
import json
import unittest
from ReducePyCkovPlot import ReducePyCkovPlot
class ReducePyCkovPlotTestCase(unittest.TestCase): # pylint: disable=R0904, C0301
"""
Test class for ReducePyCkovPlot
"""
@classmethod
def setUpClass(self): # pylint: disable=C0... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import division
from builtins import * # noqa
from hamcrest import ( assert_that,
contains,
contains_inanyorder,
empt... |
version_string = "0.1dev" |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "multidatabase_project.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv) |
__author__ = 'onelife'
__license__ = "GPLv3"
__version__ = '1.30'
__setup = False
__depth = 1
import sys
from os import path
while True:
try:
stack = sys._getframe(__depth)
__depth += 1
except:
break
__setup = path.basename(stack.f_globals.get('__file__')) == 'setup.py'
if not __setup:
from .... |
"""
RASP: Rapid Amplicon Sequence Pipeline
Copyright (C) 2016, Jakob Willforss and Björn Canbäck
All rights reserved.
This file is part of RASP.
RASP is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version ... |
__author__ = 'Andrea "TexZK" Zoppi'
__all__ = ('audio', 'compression', 'game', 'graphics', 'persistence', 'utils') |
import datetime
import logging
import pytz
def setup_logging(log_file_path=None):
logging.basicConfig(
filename=log_file_path,
# stream=sys.stdout,
# format='[%(asctime)s][%(name)s][PID: %(process)d][%(levelname)6s]: %(message)s',
format='[%(asctime)s][%(threadName)10s][%(levelname)6... |
"""Factory functions for creating proximal operators.
Functions with ``convex_conj`` mean the proximal of the convex conjugate and
are provided for convenience.
For more details see :ref:`proximal_operators` and references therein. For
more details on proximal operators including how to evaluate the proximal
operator o... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Donation',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=Fal... |
from logger import logLevel
import json
def validateRequest(debugAllowed, data, logger):
try:
request = json.loads(data)
except ValueError:
logger(logLevel.DEBUG, "Request is not valid JSON")
return None
if not isinstance(request, dict):
logger(logLevel.DEBUG, "Requst is not ... |
'''ioriodb CLI client to interact with the api from the command line'''
from __future__ import print_function
import time
import json
import argparse
import iorio
def get_arg_parser():
'''build the cli arg parser'''
parser = argparse.ArgumentParser(description='Iorio DB CLI')
parser.add_argument('--verbose'... |
import os
import sys
import threading
import pprint
from pprint import pformat
from optparse import OptionParser
import json
import urllib
from urlparse import urlparse, parse_qs
from time import time
try:
import astrodata
from astrodata.adutils import jsutil
from astrodata import AstroDataType
from ast... |
from z3 import Const, IntSort
class ClassNode:
"""
Class representing a node in a tree where each node represents a class, and has
references to the base class and subclasses.
"""
def __init__(self, name, parent_node, type_sort):
self.name = name
self.parent_node = parent_node
... |
"""Copyright (c) 2015 TBillTech.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
import json
def as_summary(dct):
if '__Summary__' in dct:
result = Summa... |
value: int = int(input())
example: Dict[str, int] = {"a": 0, "b": 1, "c": 2}
key: str = "b"
example[key]: int = value
i: int = example["a"]
print(i) |
import logging
import web
from bson.objectid import ObjectId
from inginious.frontend.pages.course_admin.utils import INGIniousSubmissionAdminPage
class CourseDownloadSubmissions(INGIniousSubmissionAdminPage):
""" Batch operation management """
_logger = logging.getLogger("inginious.webapp.download")
def val... |
"""Default data initializations for the XBlock, with formatting preserved."""
DEFAULT_PROMPT = """
Censorship in the Libraries
'All of us can think of a book that we hope none of our children or any other children have taken off the shelf. But if I have the right to remove that book from the shelf -- that work ... |
"""
Simple utilities to run hazard calculations from within the toolkit
"""
import sys
import numpy as np
import multiprocessing
from collections import OrderedDict
from openquake.hazardlib.calc import hazard_curve
from openquake.hazardlib.site import Site, SiteCollection
from openquake.hazardlib.gsim import get_availa... |
"""
To generate a migration, make changes to this model file and then run:
django-admin.py schemamigration submission_queue [migration_name] --auto --settings=xqueue.settings --pythonpath=.
"""
import json
from datetime import datetime, timedelta
import pytz
from django.conf import settings
from django.db import models... |
""" Hook Execution.
"""
import os
import fnmatch
import logging
import tempfile
from twisted.internet.defer import (
inlineCallbacks, DeferredQueue, Deferred, DeferredLock, returnValue)
from twisted.internet.error import ProcessExitedAlready
DEBUG_HOOK_TEMPLATE = r"""#!/bin/bash
set -e
export JUJU_DEBUG=$(mktemp -d... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('pppcemr', '0077_auto_20160218_1243'),
]
operations = [
migrations.AlterField(
model_name='treatment',
name='date',
fi... |
from . import contipaq |
from __future__ import unicode_literals
import webnotes
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
def on_submit(self):
webnotes.conn.sql("""update `tabTender` set tender_name='%s'
where name='%s'"""%(self.doc.name, self.doc.name))
webnotes.conn.sql('commit')
def get_opening_d... |
from smashbox.utilities import *
from smashbox.utilities.hash_files import *
from os import listdir
from os.path import isfile, join
from smashbox.utilities.monitoring import push_to_monitoring
import sys,os,os.path,random
username = config.get('reva_tests_username', 'foo')
password = config.get('reva_tests_password', ... |
from django.conf.urls.defaults import *
from django.views.generic import ListView
from open_municipio.people.models import Office
urlpatterns = patterns('',
url(r'^$', ListView.as_view(
model=Office,
template_name='office_list.html',
), name='om_office_list'),
) |
import patten
class data:
def __init__(self):
self.dic = {}
self.mapper = {}
self.p = patten.patten()
self.stop = {}
def rep(self, l):
l = l.replace("[p:", "")
l = l.replace("[a:", "")
l = l.replace("[s:", "")
l = l.replace("[n:", "")
l = l... |
"""
Helpers for the student app.
"""
import json
import logging
import mimetypes
import urllib
import urlparse
from datetime import datetime
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.urls import NoReverseMatch, reverse
from django.core.validators import ValidationE... |
from django.core.urlresolvers import reverse
from taiga.base.utils import json
from .. import factories as f
import pytest
pytestmark = pytest.mark.django_db
def test_userstory_custom_attribute_duplicate_name_error_on_create(client):
custom_attr_1 = f.UserStoryCustomAttributeFactory()
member = f.MembershipFacto... |
import os
import sys
import logging
import openerp
import openerp.netsvc as netsvc
import openerp.addons.decimal_precision as dp
from openerp.osv import fields, osv, expression, orm
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
from openerp import SUPERUSER_ID, api
from opene... |
import mmap
import string
import struct
import types
from utils import hash_160_to_pubkey_address, hash_160_to_script_address, public_key_to_pubkey_address, hash_encode,\
hash_160
class SerializationError(Exception):
"""Thrown when there's a problem deserializing or serializing."""
class BCDataStream(object):
... |
import base64
import glob
import os
import re
import socket
import shutil
import subprocess
import sys
import yaml
import pwd
from itertools import izip, tee
from operator import itemgetter
from charmhelpers.core.host import pwgen, lsb_release, service_restart
from charmhelpers.core.hookenv import (
log,
config... |
import xml.etree.cElementTree as ET
import re
import os
import dateutil.parser as dparser
from juriscraper.lib.string_utils import titlecase, harmonize, clean_string, CaseNameTweaker
from cl.corpus_importer.court_regexes import state_pairs
from regexes_columbia import SPECIAL_REGEXES
from parse_judges import find_judge... |
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 'DataPoint.value'
db.alter_column('datapoint', 'value', self.gf('django.db.models.f... |
from oopgrade import DataMigration
from addons import get_module_resource
def up(cursor, installed_version):
if not installed_version:
return
xml_content = '''<?xml version="1.0" encoding="UTF-8" ?>
<openerp>
<data noupdate="1">
<record model="product.category" id="categ_inve... |
from openerp import models, fields, api
class AccountConfigSettings(models.TransientModel):
_inherit = 'account.config.settings'
_afip_ws_selection = (
lambda self, *args, **kwargs: self.env[
'account.journal']._get_afip_ws_selection(*args, **kwargs))
afip_ws = fields.Selection(
... |
from CRISPResso.CRISPRessoCountCORE import main
if __name__ == '__main__':
main() |
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('meinberlin_plans', '0007_make_plan_description_required'),
]
operations = [
migrations.AlterField(
... |
from __future__ import unicode_literals
AUTHOR = '2016FALLCADP_AG4'
SITENAME = '2016FALLCADP_AG4報告倉儲'
USE_FOLDER_AS_CATEGORY = False
TIMEZONE = 'Asia/Taipei'
DEFAULT_LANG = 'en'
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None
AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None
LINKS = (('40423106... |
"""
Author : tharindra galahena (inf0_warri0r)
Project: image categarizetion using SOM
Blog : http://www.inf0warri0r.blogspot.com
Date : 14/05/2013
License:
Copyright 2013 Tharindra Galahena
This is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as pub... |
from django.apps import AppConfig
class ICNConfig(AppConfig):
name = 'channels.icn'
def ready(self):
from . import content_flow |
import xpensemate.db.proxy.abstract_proxy
import xpensemate.db.proxy.factory
import xpensemate.db.proxy.postgres |
import os
import logging
from sqlalchemy import Column, Integer, ForeignKey
from sqlalchemy.orm import relationship, backref
from sqlalchemy import UniqueConstraint
from tmlib.models.base import ExperimentModel, DateMixIn, IdMixIn
logger = logging.getLogger(__name__)
class Cycle(ExperimentModel, DateMixIn, IdMixIn):
... |
from __future__ import unicode_literals
from django.utils import timezone
from djcelery_transactions import task
from redis_cache import get_redis_connection
from .models import Schedule
from django.core.exceptions import ObjectDoesNotExist
@task(track_started=True, name='check_schedule_task') # pragma: no cover
def c... |
from sst.actions import (
assert_element,
assert_title_contains,
click_button,
get_element,
go_to,
wait_for,
write_textfield,
)
from u1testutils import mail
from u1testutils.sso import mail as sso_mail
from u1testutils.sst import config
from acceptance import helpers, urls
config.set_base_ur... |
import datetime
import logging
from django.contrib.auth.models import User
from django.contrib.gis.geoip2 import GeoIP2
from django.core.files.images import get_image_dimensions
from django.db.models import Count
from django.utils import timezone
logger = logging.getLogger('apps')
def unique_items(list_with_possible_du... |
import argparse
import os
import sys
from openerp.cli import Command
from openerp.modules.module import get_modules
from . import utils
def print_if(flag, text):
if flag:
print(text)
class Get(Command):
""" Get Odoo modules """
def get_module(self, module, env_root, exclude=None,
... |
"""Juju GUI deploy helper."""
from __future__ import print_function
import json
import logging
import os
import tempfile
from charmhelpers.contrib.charmhelpers import make_charm_config_file
from helpers import (
command,
get_password,
juju,
wait_for_unit,
)
DEFAULT_SERIES = 'xenial'
rsync = command('rsy... |
"""
Unit tests for video utils.
"""
from unittest import TestCase
from datetime import datetime
import ddt
import pytz
import requests
from django.conf import settings
from django.core.files.uploadedfile import UploadedFile
from django.test.utils import override_settings
from edxval.api import (
create_profile,
... |
from __future__ import annotations
from typing import Iterable, Optional, Set
from sqlalchemy.orm import Query as BaseQuery
from baseframe import __
from coaster.sqlalchemy import Query, StateManager, auto_init_default, with_roles
from coaster.utils import LabeledEnum
from . import (
BaseScopedIdNameMixin,
Comm... |
import re
from subprocess import Popen, PIPE
from time import time, gmtime, strftime
aliases = {"zoidber": "zoidberg", "zoidberg10": "zoidberg", "webmaster": "dhmh", "mast3rranan": "ranan",
"ranan2": "ranan"}
exclude = ["locale/*", "module/lib/*"]
date_format = "%Y-%m-%d"
line_re = re.compile(r" (\d+) \**", ... |
import logging
from flask import Flask, request, g
from flask.ext.restful import fields, reqparse, marshal_with, abort
from flask.ext.restful.types import boolean
from jormungandr import i_manager
from jormungandr.exceptions import RegionNotFound
from jormungandr.instance_manager import instances_comparator
from jormun... |
from astrobin_apps_equipment.api.filters.equipment_item_filter import EquipmentItemFilter
from astrobin_apps_equipment.models import Sensor
class SensorFilter(EquipmentItemFilter):
class Meta(EquipmentItemFilter.Meta):
model = Sensor |
"""
Specific overrides to the base prod settings to make development easier.
"""
from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import
del DEFAULT_FILE_STORAGE
MEDIA_ROOT = "/edx/var/edxapp/uploads"
DEBUG = True
USE_I18N = True
TEMPLATE_DEBUG = True
SITE_NAME = 'localhost:8000'
PLATFORM_NAME = E... |
from flask import jsonify
from app.api import api
from app.exceptions import CustomError
@api.app_errorhandler(404) # this has to be an app-wide handler
def not_found(e):
response = jsonify({'status': 404, 'error': 'not found', "success": False,
'message': 'invalid resource URI'})
respo... |
from pyramid.httpexceptions import (
HTTPForbidden,
HTTPNotFound,
)
import pyramid_jsonapi.workflow as wf
from . import stages
def get_doc(view, stages, query):
query = wf.execute_stage(
view, stages, 'alter_query', query
)
res_obj = wf.loop.get_one_altered_result_object(view, stages, query)... |
"""
Run tests for the LTI Consumer XBlock
"""
import os
import logging
import sys
import warnings
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'test_settings')
try:
from django.conf import settings # pylint: disable=wrong-import-position
from django.core.management... |
from openquake.hazardlib.gsim.atkinson_macias_2009 import AtkinsonMacias2009
from openquake.hazardlib.tests.gsim.utils import BaseGSIMTestCase
class AtkinsonMacias2009TestCase(BaseGSIMTestCase):
GSIM_CLASS = AtkinsonMacias2009
# Verification tables provided by G. M. Atkinson
def test_mean(self):
# S... |
"""
Automated testing, huzzah
This script automates the regression, module, and fuzz tests.
TODO: interface to formatter tests as well
"""
import glob
import os
import subprocess
import sys
import time
verbose = True
tests = []
root_path = sys.path[0]
log_path = '{0}/log/'.format(root_path)
log_file = '{0}/runtests... |
from spack import *
class SpectrumMpi(Package):
"""
IBM MPI implementation from Spectrum MPI.
"""
homepage = "http://www-03.ibm.com/systems/spectrum-computing/products/mpi"
url = "http://www-03.ibm.com/systems/spectrum-computing/products/mpi"
provides('mpi')
def install(self, spec, prefix):
... |
import sys
from paravistest import datadir, pictureext, get_picture_dir
from presentations import CreatePrsForFile, PrsTypeEnum
import pvserver as paravis
myParavis = paravis.myParavis
picturedir = get_picture_dir("MeshPresentation/B0")
file = datadir + "carre_en_quad4_seg2.med"
print " --------------------------------... |
import os, sys, numpy, time, shutil, glob, traceback
pretty_time = lambda: time.asctime( time.localtime(time.time()))
def server( config_filename , design_filename ,
project_filename , transfer_filename ,
exchange_location , hot_start = False ):
# --------------------------------------... |
import dbus
from saluttest import exec_test
from file_transfer_helper import ReceiveFileTest, SendFileTest
from servicetest import call_async
import constants as cs
class SendFileNoMetadata(SendFileTest):
# this is basically the equivalent of calling CreateChannel
# without these two properties
service_name... |
import os
import sys
import re
import locale
import mimetypes
import psutil
import time
import base64
from Crypto.Cipher import AES
from Crypto import Random
from nxdrive.logging_config import get_logger
NUXEO_DRIVE_FOLDER_NAME = 'Nuxeo Drive'
log = get_logger(__name__)
WIN32_SUFFIX = os.path.join('library.zip', 'nxdri... |
from base64 import urlsafe_b64decode
from datetime import datetime
from email.utils import mktime_tz, parsedate_tz
from gzip import open as gzip_open
from pytz import timezone
from os import getcwd
from os.path import isabs as path_isabs
from os.path import expanduser, realpath, join as path_join
from logging import ge... |
""""""
from __future__ import annotations
import logging
from pprint import pformat
from flask import current_app
from flask.cli import AppGroup
logging.basicConfig()
logger = logging.getLogger("")
config_commands = AppGroup("config")
@config_commands.command()
def show(only_path=False):
"""Show the current config.... |
from pycopia.aid import Enum
import pycopia.SMI.Basetypes
Range = pycopia.SMI.Basetypes.Range
Ranges = pycopia.SMI.Basetypes.Ranges
from pycopia.SMI.Objects import ColumnObject, MacroObject, NotificationObject, RowObject, ScalarObject, NodeObject, ModuleObject, GroupObject
from SNMPv2_SMI import MODULE_IDENTITY, NOTIFI... |
import datetime as dt
import struct
import os
import logging
from hyo2.soundspeed.formats.readers.abstract import AbstractTextReader
from hyo2.soundspeed.profile.dicts import Dicts
from hyo2.soundspeed.base.callbacks.cli_callbacks import CliCallbacks
logger = logging.getLogger(__name__)
class Mvp(AbstractTextReader): ... |
import smtplib
def sendemail(to_addr_list, subject, message, smtpserver='smtp.gmail.com:587'):
try:
email_text = """\
From: %s
To: %s
Subject: %s
%s
""" % (from_addr, ", ".join(to_addr_list), subject, message)
server = smtplib.SMTP(smtpserver)
server.s... |
"""TxORM Property Unit Tests
"""
import gc
import uuid
from fractions import Fraction as fraction
from decimal import Decimal as decimal
from datetime import datetime, date, time, timedelta
from twisted.trial import unittest
from txorm.compat import b, u
from txorm.compiler.state import State
from txorm.object_data imp... |
from ebooklib import epub
import configparser
def ebook_init(config):
ebook = epub.EpubBook()
sec = 'toc'
ebook.set_identifier(config.get(sec, 'id'))
ebook.set_title(config.get(sec, 'title'))
ebook.set_language(config.get(sec, 'language'))
for auth in config.get(sec, 'author').split(','):
ebook.add_auth... |
import unittest
import sys
from concurrent.futures import Future
from wshubsapi.hubs_inspector import HubsInspector
from Test.testingUtils import restore_test_resources, create_compiler_uploader_mock, create_sender_mock
from libs.Version import Version
from libs.WSCommunication.Hubs.VersionsHandlerHub import VersionsHa... |
import pytest
import guitarpro as gp
def testHashable():
song = gp.Song()
hash(song)
anotherSong = gp.Song()
assert song == anotherSong
assert hash(song) == hash(anotherSong)
coda = gp.DirectionSign('Coda')
segno = gp.DirectionSign('Segno')
assert coda != segno
assert hash(coda) != h... |
import plumed
import numpy as np
assert plumed.getNumArgs() == 1
assert plumed.getNumExArgs() == 2
def bias(arg, force, extra):
assert plumed.getNumArgs() == 1
assert plumed.getNumExArgs() == 2
assert isinstance(arg, np.ndarray)
assert isinstance(force, np.ndarray)
assert isinstance(extra, np.ndarra... |
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
with open('ottemplatepython/__init__.py') as fid:
for line in fid:
if line.startswith('__version__'):
version = line.strip().split()[-1][1:-1]
break
"""
http://pyth... |
"""Pyblish Endpoint Server"""
import os
import logging
import threading
import flask
import flask.ext.restful
import mocking
import resource
import service as service_mod
log = logging.getLogger("endpoint")
prefix = "/pyblish/v1"
resource_map = {
"/state": resource.StateApi,
"/client": resource.ClientApi,
"... |
import os
import sys
sys.path.append('..')
import mupif.pyroutil
import mupif.util
import subprocess
sys.path.append('../examples')
import threading
from exconfig import ExConfig
cfg = ExConfig()
import logging
log = logging.getLogger()
threading.current_thread().setName('Pyro5-NameServer')
def main():
# Initializa... |
import argparse
from migen import *
from migen.genlib.resetsync import AsyncResetSynchronizer
from migen.genlib.cdc import MultiReg
from migen.build.generic_platform import *
from migen.build.xilinx.vivado import XilinxVivadoToolchain
from migen.build.xilinx.ise import XilinxISEToolchain
from misoc.interconnect.csr imp... |
dc = {'a' : 'a-ele', 'b' : 'b-ele', 'c' : 'c-ele'}
dd = {'d' : 'd-x', 'e' : 'e-x'}
print "id(dc) = [%d], dc = [%s]" % (id(dc), str(dc))
print "id(dd) = [%d], dd = [%s]" % (id(dd), str(dd))
dc.update(dd)
print "id(dc) = [%d], dc = [%s]" % (id(dc), str(dc))
print "id(dd) = [%d], dd = [%s]" % (id(dd), str(dd)) |
"""
The code is designed to be a server running on RPi waiting for client to initiate drone launching
Creator: Mana Saedan
Date Last Edited: 22 June 2017
Development Logs:
- Server waiting for client to connect
- Data format from client (32-byte-string): mode,height,roll,pitch,yaw,angle,cheksum,..... |
from csmtiser.config import load_config_file
import sys
if len(sys.argv) > 1:
config=load_config_file(sys.argv[1])
else:
config=load_config_file()
import os
sys.stdout.write('Deleting old models in the working directory\n')
os.system('rm -rf '+config.working_dir+'/corpus')
os.system('rm -rf '+config.working_dir+'/m... |
from __future__ import print_function
from dolfin import *
from dolfin_adjoint import *
import sys
dolfin.set_log_level(ERROR)
n = 10
mesh = UnitIntervalMesh(n)
V = FunctionSpace(mesh, "CG", 2)
ic = project(Expression("sin(2*pi*x[0])", degree=1), V)
u = ic.copy(deepcopy=True)
def main(nu):
u_next = Function(V)
... |
"""
This is the boilerplate default configuration file.
Changes and additions to settings should be done in the config module
located in the application root rather than this config.
"""
config = {
'webapp2_extras.sessions' : {'secret_key': '_PUT_KEY_HERE_YOUR_SECRET_KEY_'},
'webapp2_extras.auth' : {'user_model': 'boil... |
"""
Parsing for router status entries, the information for individual routers
within a network status document. This information is provided from a few
sources...
* control port via 'GETINFO ns/\*' and 'GETINFO md/\*' queries
* router entries in a network status document, like the cached-consensus
**Module Overview:**
... |
import sqlite3
def collate_reverse(string1, string2):
if string1 == string2:
return 0
elif string1 < string2:
return 1
else:
return -1
con = sqlite3.connect(":memory:")
con.create_collation("reverse", collate_reverse)
cur = con.cursor()
cur.execute("create table test(x)")
cur.execute... |
predict2020_value_list=[6.961153333332845,
6.882159999997782,
6.84168666666892,
6.869866666668145,
7.013566666669362,
7.2024000000003525,
7.2634200000021,
... |
{
'name': 'Project Move Activity Tasks',
'version': '11.0.1.0.0',
'author': 'Savoir-faire Linux, Odoo Community Association (OCA)',
'maintainer': 'Savoir-faire Linux',
'website': 'http://www.savoirfairelinux.com',
'license': 'AGPL-3',
'category': 'Project Management',
'summary': 'Project... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.