content
string
import partition import graph as gr import state as st ''' A Partition Set is a collection of partition, which, in turn are collections of states which share some common feature. From a deterministic partition set it is possible to recover a graph. ''' class PartitionSet: def __init__(self, partitions): ...
from collections import OrderedDict from collections.abc import MutableMapping from tripoli.util import PlaceOrSymbol, coerce from emacs_raw import eq, cons, intern _nil = intern('nil') _car = intern('car') _cdr = intern('cdr') _setcdr = intern('setcdr') _keywordp = intern('keywordp') _listp = intern('listp') def ...
from osv import osv from osv import fields class ResPartner(osv.osv): _inherit = 'res.partner' _columns = { #'insurance_plan_ids': fields.one2many('oemedical.insurance.plan', # 'relation_id', # string='Insuran...
import synthicity.urbansim.interaction as interaction import pandas as pd, numpy as np, copy from synthicity.utils import misc from drcog.models import transition def simulate(dset,year,depvar = 'building_id',alternatives=None,simulation_table = 'households', output_names=None,agents_groupby = ['income_3...
"""Base client for application relying on OpenID for authentication. .. moduleauthor:: Pierre-Yves Chibon <<EMAIL>> .. moduleauthor:: Toshio Kuratomi <<EMAIL>> .. moduleauthor:: Ralph Bean <<EMAIL>> .. versionadded: 0.3.35 """ # :F0401: Unable to import : Disabled because these will either import on py3 # or py2 ...
# coding=utf-8 from __future__ import (absolute_import, division, print_function, unicode_literals) import time import sys, os import traceback import gzip, json from os.path import dirname, join, isdir, expanduser APP_NAME = "KOHighlights" APP_DIR = dirname(os.path.abspath(sys.argv[0])) os.chdir(APP_DIR) # Set the ...
import numpy import sympy from sympy.printing.theanocode import theano_function def build_mixture_loss_and_grad(build_pseudo_functions=False): class GaussianPDF(sympy.Function): nargs = 3 is_commutative = False @classmethod def eval(cls, x, mu, sigma): std_x = (x - mu)...
from unittest import TestCase, skip from unittest.mock import patch from core.factories.matchday_related_core_factories import MatchdayFactory from core.managers.parser_manager import ParserManager class ParserManagerTest(TestCase): def setUp(self): self.parser_manager = ParserManager() @patch('core...
from play_base import Play from tactics.tactic_goalie import TacticGoalie from tactics.tactic_interpose import TacticInterpose from tactics.tactic_position import TacticPosition import constants class PlayTheirPreKickoff(Play): def __init__(self): super(PlayTheirPreKickoff, self).__init__('PlayTheirPreKic...
import sys import unittest from jsondiff import diff, replace, add, discard, insert, delete, update, JsonDiffer from .utils import generate_random_json, perturbate_json from nose_random import randomize class JsonDiffTests(unittest.TestCase): def test_a(self): self.assertEqual({}, diff(1, 1)) ...
from manager_rest.deployment_update import utils from manager_rest.storage import models, get_node from manager_rest.manager_exceptions import UnknownModificationStageError from manager_rest.deployment_update.constants import ENTITY_TYPES, ACTION_TYPES OUTPUT_ENTITY_LEN = 2 WORKFLOW_ENTITY_LEN = 2 OPERATION_ENTITY_LE...
import logging import re from django.contrib.staticfiles.storage import staticfiles_storage from django.contrib.staticfiles import finders from django.conf import settings from xmodule.contentstore.content import StaticContent from opaque_keys.edx.locator import AssetLocator log = logging.getLogger(__name__) XBLOCK...
import argparse import sys import xml.etree.ElementTree as et import StringIO import re import json from distutils.sysconfig import get_python_lib sys.path.append(get_python_lib() + '/vnc_cfg_api_server') from operator import itemgetter, attrgetter from vnc_api import vnc_api from vnc_cfg_api_server import gen from ...
# TBD Finish Python port ******************************************************************************/ package edu.princeton.cs.algs4 import java.math.BigInteger import java.util.Random # # The <tt>RabinKarp</tt> class finds the first occurrence of a pattern string # in a text string. # <p> # This implementation...
from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.cor...
import importlib from .messaging import message_device from .config import scope_configuration from .util import property_device from .util import logging logger = logging.get_logger(__name__) class Namespace: pass class Scope(message_device.AsyncDeviceNamespace): def __init__(self, property_server=None): ...
#!/usr/bin/python3 """ default on_heartbeat pulse processing... if pulse is emitted for a while, and than missing we will issue a reconnection. caveat 1 : once pulsing has started... it must continue if poll_pulse stops the process will verify the connection, (isAlive) and if th...
from ....const import GRAMPS_LOCALE as glocale _ = glocale.get_translation().gettext #------------------------------------------------------------------------- # # GRAMPS modules # #------------------------------------------------------------------------- from .. import MatchesSourceFilterBase #----------------------...
from pyshell.register.loader.context import ContextLoader from pyshell.register.profile.parameter import ParameterLoaderProfile from pyshell.register.profile.root import RootProfile from pyshell.system.manager.context import ContextParameterManager from pyshell.system.manager.parent import ParentManager from pyshell.sy...
import sys import os reload(sys) sys.setdefaultencoding('UTF8') BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT_DIR = os.path.dirname(BASE_DIR) os.chdir(BASE_DIR) sys.path.insert(0, os.path.join(BASE_DIR, "valle_libs")) sys.path.insert(0, os.path.join(BASE_DIR)) from kivy.app import App from kivy.utils im...
from http import client import io import json import unittest from unittest import mock from adjunct.fixtureutils import FakeSocket, make_fake_http_response from adjunct.oembed import ( _build_url, fetch_oembed_document, find_first_oembed_link, parse_xml_oembed_response, ) class BuildUrlTest(unittest...
import socket import sys import bindpyrame if len(sys.argv)<4 or (len(sys.argv)<5 and sys.argv[1]=="-mo"): print("usage: %s [-mo] host port command [parameters]"%(sys.argv[0])) sys.exit(1) if sys.argv[1]=="-mo": offset=0 mo=True else: offset=1 mo=False host=sys.argv[2-offset] port=sys.argv[...
from data_importers.management.commands import BaseHalaroseCsvImporter class Command(BaseHalaroseCsvImporter): council_id = "WSM" addresses_name = "2021-03-30T13:02:54.918672/polling_station_export-2021-03-30.csv" stations_name = "2021-03-30T13:02:54.918672/polling_station_export-2021-03-30.csv" elect...
# -*- coding: utf-8 -*- import urlparse from dirtyfields import DirtyFieldsMixin from django.db import models from django.utils import timezone from django.utils.functional import cached_property from framework.celery_tasks.handlers import enqueue_task from framework.exceptions import PermissionsError from osf.models...
__author__ = "Sergi Blanch-Torne" __email__ = "<EMAIL>" __copyright__ = "Copyright 2013 Sergi Blanch-Torne" __license__ = "GPLv3+" __status__ = "development" from copy import deepcopy as _deepcopy from .Logger import Logger as _Logger from .Logger import XORctr as _XORctr from .Polynomials import BinaryExtensionModulo...
import os from collections import OrderedDict from dal.oracle.era.experiment import get_experiment_xml_by_acc, retrieve_experiments_by_study_acc from dal.oracle.era.study import get_study_xml_by_acc, get_study_by_acc from models.magetab.idf import IDF # from models.sra_xml.study_api import parse from models.sra_xml im...
from abc import ABCMeta, abstractmethod from datetime import timedelta from typing import Union, Iterable, AnyStr, Generator, Optional, Dict from easysnmp import Session from django.utils.translation import gettext, gettext_lazy as _ from djing.lib import RuTimedelta ListOrError = Union[ Iterable, Union[Exce...
from setuptools import find_packages, setup VERSION = "0.18.0" LONG_DESCRIPTION = """ .. image:: http://pinaxproject.com/pinax-design/patches/pinax-lms-activities.svg :target: https://pypi.python.org/pypi/pinax-lms-activities/ =================== Pinax Announcements =================== .. image:: https://img.shiel...
# coding: utf-8 """ From the mockstream runs, find the best mockstream that fits the data """ from __future__ import division, print_function __author__ = "adrn <<EMAIL>>" # Standard library import os import sys # Third-party from astropy import log as logger import astropy.coordinates as coord import astropy.unit...
import pulsar as psr def load_ref_system(): """ Returns d-arabinose as found in the IQMol fragment library. All credit to https://github.com/nutjunkie/IQmol """ return psr.make_system(""" C 2.3481 -0.9668 0.1807 C 1.2791 0.0840 -0.2072 C -0.161...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import configparser import os import os.path as path class LogParam: FILE_NAME = 'plog.ini' DEFAULT = 'DEFAULT' def __init__(self): self.host_name = None # type: str self.shell = None # type: str self.log_cmd = None # type: str ...
# coding=utf-8 import unittest """38. Count and Say https://leetcode.com/problems/count-and-say/description/ The count-and-say sequence is the sequence of integers with the first five terms as following: 1. 1 2. 11 3. 21 4. 1211 5. 111221 `1` is read off as `"o...
from os import system #2.5 print "Lateral Interactions, SNR = 2.5" system("cp filenames_2_5.txt filenames.txt") system("../Debug/BIDS -p params_LI.pv 1> ../log.txt") system("mv ../log.txt ../output") system("mv ../output ../outputLI2.5") print "No Lateral Interactions, SNR = 2.5" system("../Debug/BIDS -p params_NLI.pv...
"""Utility functions supporting FAUCET/Gauge config parsing.""" # Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer. # Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd. # Copyright (C) 2015--2019 The Contributors # # Licensed under the Apache License, Version 2.0 (the "Licens...
"""Generate zeroconf file.""" from collections import OrderedDict, defaultdict import json from typing import Dict from .model import Integration, Config BASE = """ \"\"\"Automatically generated by hassfest. To update, run python3 -m script.hassfest \"\"\" ZEROCONF = {} HOMEKIT = {} """.strip() def generate_and...
import os import sys import doctest from formencode import compound from formencode import htmlfill from formencode import htmlgen from formencode import national from formencode import schema from formencode import validators """Modules that will have their doctests tested.""" modules = [compound, htmlfill, htmlgen...
import pytest from app.models.broadcast_message import BroadcastMessage from tests import broadcast_message_json def test_simple_polygons(fake_uuid): broadcast_message = BroadcastMessage(broadcast_message_json( id_=fake_uuid, service_id=fake_uuid, template_id=fake_uuid, status='dr...
""" pyexcel_io.readers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ file readers :copyright: (c) 2014-2020 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ from pyexcel_io.plugins import IOPluginInfoChainV2 IOPluginInfoChainV2(__name__).add_a_reader( relative_plugin_cla...
import unittest import torch from gpytorch.kernels import SpectralDeltaKernel from gpytorch.test.base_kernel_test_case import BaseKernelTestCase class TestSpectralDeltaKernel(unittest.TestCase, BaseKernelTestCase): def create_kernel_no_ard(self, num_dims=2, **kwargs): return SpectralDeltaKernel(num_dims...
import os import re import subprocess # Python's line reader does too much buffering. This implementation # returns lines as soon as they are read. def ReadLines(fh): data = '' while True: while '\n' in data: lines = data.split('\n') for line in lines[:-1]: yield line data = lines[-...
import os, sys if __name__ == '__main__': execfile(os.path.join(sys.path[0], 'framework.py')) from Products.UWOshOIE.tests.uwoshoietestcase import UWOshOIETestCase from Products.CMFCore.WorkflowCore import WorkflowException class TestStateWaitingForPrintMaterials(UWOshOIETestCase): """Ensure product is proper...
import os import sys sys.path.insert(0, os.path.abspath('../..')) # -- General configuration ---------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx...
import bisect import fnmatch import os from os.path import isdir, isfile, join, basename, splitext from django.conf import settings # Use the built-in version of scandir/walk if possible, otherwise # use the scandir module version try: from os import scandir, walk except ImportError: from scandir import scandi...
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
#module for definitions of registers and related operations like innner product etc import numpy as np import auxfun as aux #################################################################### class Qbasis(object): """Set of basis vectors spanning the Hiblert space """ def __init__(self,nbits): self.size = n...
import pygame import logging import sys import os class Snake(pygame.sprite.Sprite): # This dictionary contains all the possible combinations that the snake can move in degrees of 90 and 180. # For example, LeftUp means that the current direction of the snake is left and the new direction that the snake wants ...
# -*- coding: utf-8 -*- from Plugins.Extensions.WebInterface.WebScreens import WebScreen class WebAdminScreen(WebScreen): def __init__(self, session, request): WebScreen.__init__(self, session, request) from Components.Sources.StaticText import StaticText from Plugins.Extensions.WebAdmin.WebComponents.Sources.P...
from interpreter.kmp_py import schemeExceptions from interpreter.kmp_py.scheme import * import copy class SyntaxResult(): def __init__(self): self.balance = 0 self.valid = True def isBalanced(self): return self.balance == 0 def isValid(self): return self.valid class Schem...
""" datetimelike delegation """ import numpy as np from pandas.core.dtypes.common import ( is_categorical_dtype, is_datetime64_dtype, is_datetime64tz_dtype, is_datetime_arraylike, is_integer_dtype, is_list_like, is_period_arraylike, is_timedelta64_dtype) from pandas.core.dtypes.generic import ABCSeries fr...
from aredis.utils import (dict_merge, nativestr, list_keys_to_dict, NodeFlag, bool_ok) class ScriptingCommandMixin: RESPONSE_CALLBACKS = { 'SCRIPT EXISTS': lambda r: list(map(bool, r)), 'SCRIPT FLUSH': bool_ok, 'SCRIPT KILL': bool_ok, ...
#!/bin/python3 # coding: utf-8 """ A Sphinx extension that enables inline bold + italic. https://github.com/kallimachos/chios Copyright (C) 2019 Brian Moss This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Found...
#!/usr/bin/env python # -*- coding: utf-8 -*- from tests.helpers import ( create_ctfd, destroy_ctfd, gen_challenge, gen_tag, login_as_user, ) def test_api_tags_get_non_admin(): """Can a user get /api/v1/tags if not admin""" app = create_ctfd() with app.app_context(): gen_chall...
import os, re, subprocess, json, collections from sphinx.addnodes import toctree from docutils import io, nodes, statemachine, utils from docutils.parsers.rst import Directive from jinja2 import Environment, PackageLoader # Maintain a cache of previously loaded examples example_cache = {} # Maintain a cache of previo...
''' COPYRIGHT and LICENSE: --------------------- The MIT License (MIT) Copyright (C) 2016 Sundar Nagarajan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without li...
import __main__, hashlib info = { "names" : [ "hash", "checksum" ], "access" : 0, "version" : 1 } def command( message, user, recvfrom ): try: mpart = message.partition( " " ) alg = mpart[0] data = mpart[2] # There's this other 'sha' besides 'sha1' which produces different results than 'sha1' # 99.99% o...
"""/literature endpoint api client and resources.""" from __future__ import absolute_import, division, print_function from inspirehep.testlib.api.base_resource import BaseResource class LiteratureResourceTitle(BaseResource): def __init__(self, source, title): self.source = source self.title = t...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Core IO, DSP and utility functions.""" import os import warnings import six import audioread import numpy as np import scipy.signal import scipy.fftpack as fft from .time_frequency import frames_to_samples, time_to_samples from .. import cache from .. import util fro...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This exercise shows some important concepts that you should be aware about: - using codecs module to write unicode files - using authentication with web APIs - using offset when accessing web APIs To run this code locally you have to register at the NYTimes developer s...
#!/galaxy/home/mgehrin/hiclib/bin/python """ Reads a maf file from stdin and applies the mapping file specified by `mapping_file` to produce a sequence of integers. Then for each possible word of length `motif_len` in this integer alphabet print the number of times that word occurs in the block. usage: %prog motif_...
import logging logger = logging.getLogger('camelot.view.controls.delegates.delegatemanager') from PyQt4 import QtGui, QtCore from PyQt4.QtCore import Qt class DelegateManager(QtGui.QItemDelegate): """Manages custom delegates, should not be used by the application developer """ def __init__(self, parent=N...
# -*- coding: utf-8 -*- from kivy.animation import Animation from kivy.clock import Clock from kivy.core.window import Window from kivy.metrics import dp from kivy.properties import OptionProperty, NumericProperty, StringProperty, \ BooleanProperty from kivy.uix.relativelayout import RelativeLayout class SlidingPane...
from datagrowth.utils import override_dict from sources.models.wikipedia.query import WikipediaQuery, WikipediaPage class WikipediaRecentChanges(WikipediaQuery): URI_TEMPLATE = 'http://{}.wikipedia.org/w/api.php?rcstart={}&rcend={}' PARAMETERS = override_dict(WikipediaQuery.PARAMETERS, { "list": "re...
""" Template file used by the OPF Experiment Generator to generate the actual description.py file by replacing $XXXXXXXX tokens with desired values. This description.py file was generated by: '~/nupic/eng/lib/python2.6/site-packages/nupic/frameworks/opf/expGenerator/ExpGenerator.py' """ from nupic.frameworks.opf.expd...
# http://bitcoin.stackexchange.com/questions/26869/what-is-chainwork # To use this script, replace "end_block" with the desired one import sys import os DIFFICULTY_1 = 0x00000000FFFF0000000000000000000000000000000000000000000000000000 NUMERATOR = DIFFICULTY_1 * 2**48 # https://en.bitcoin.it/wiki/Difficulty # chainw...
import itertools import numpy as np from numpy.testing import (assert_array_equal, assert_equal, assert_raises, assert_array_almost_equal, run_module_suite) from dipy.segment.clustering import QuickBundlesX, QuickBundles from dipy.segment.featurespeed import ResampleFeature from dipy.segment...
## -*- coding: utf-8 -*- from PyQt4 import QtGui, QtCore import sys, Queue, serial, threading, time, glob class finicial(QtGui.QMainWindow): def __init__(self): global emtruquen global teditdisp emtruquen = 'N' teditdisp = 0 QtGui.QMainWindow.__init__(self) ...
#exec(open('__init__.py').read()) from __future__ import division import numpy as np import params import load_data2 as ld2 import draw_func2 as df2 import match_chips2 as mc2 import vizualizations as viz import helpers import cv2 import spatial_verification2 as sv2 import sys def reload_module(): import imp, sys ...
from pymeasure.experiment import Procedure, IntegerParameter, Parameter, FloatParameter import random class TestProcedure(Procedure): iterations = IntegerParameter('Loop Iterations', default=100) delay = FloatParameter('Delay Time', units='s', default=0.2) seed = Parameter('Random Seed', default='12345')...
import proto # type: ignore __protobuf__ = proto.module( package='google.ads.googleads.v6.enums', marshal='google.ads.googleads.v6', manifest={ 'OptimizationGoalTypeEnum', }, ) class OptimizationGoalTypeEnum(proto.Message): r"""Container for enum describing the type of optimization goal...
from functools import reduce from . import Parameter from re import compile, MULTILINE import re class Configuration: def __init__(self, file_path): self.file_path = file_path def load_parameters(self, names): configs = self._get_parameters_from_config() return {name: self._get_pa...
""" Test setup and initialization of the nodes. Test 1: * Initialize a broker, a master and a servant (do not start them yet). * Check if they are not alive and if they are stopped. Test 2: * Stop broker, master and servant. * Check if stoppage failed (nodes not yet running). Test 3: * Start brok...
from dependencies.dependency import aq_inner from dependencies.dependency import aq_parent from lims.permissions import * from dependencies.dependency import permissions from dependencies.dependency import getToolByName from dependencies.dependency import BadRequest def upgrade(tool): # Hack prevent out-of-date u...
from __future__ import annotations import abc import inspect from typing import ( TYPE_CHECKING, Any, Dict, Iterator, List, Optional, Tuple, Type, Union, cast, ) import numpy as np from pandas._config import option_context from pandas._libs import lib from pandas._typing impo...
#!/usr/bin/env python3 # A class to handle the Honeywell SSCDANN015PG2A3 I2C digital pressure sensor # http://uk.farnell.com/honeywell/sscdann015pg2a3/sensor-trustability-15psi-3-3v/dp/1823259 # # Tips from http://www.circuitbasics.com/raspberry-pi-i2c-lcd-set-up-and-programming/ import smbus import time # i2c bus ...
# -*- coding: utf-8 -*- """ Created on Fri Sep 2 11:39:55 2016 @author: bbalasub """ import sys sys.path.append('../test') sys.path.append('../lib') import scipy import glmnet import importlib import pprint import glmnetPlot import glmnetPredict importlib.reload(glmnet) importlib.reload(glmnetPlot) importlib....
import datetime import sys from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.models import Group, User from django.core.urlresolvers import reverse from django.db.models import F from django.dispatch import receiver from django.http import HttpResponseRedirect from django.shortcuts imp...
from __future__ import annotations from typing import Dict, Iterable, Optional, Set from sqlalchemy.ext.declarative import declared_attr from werkzeug.utils import cached_property from coaster.sqlalchemy import DynamicAssociationProxy, immutable, with_roles from . import db from .helpers import reopen from .member...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ziolkowski1995.py: Runs ziolkowski1995 two-level SIT setup.""" # mbsolve: An open-source solver tool for the Maxwell-Bloch equations. # # Copyright (c) 2016, Computational Photonics Group, Technical University # of Munich. # # This program is free software; you can re...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import logging import os from flexget import plugin from flexget.event import event log = logging.getLogger('free_space') def get_free_space(folder): """ Return fol...
"""The base node types for the Relay language.""" import tvm._ffi import tvm.ir from tvm.driver import lower, build from tvm.target import get_native_generic_func, GenericFunc from tvm.runtime import Object from . import _make def get(op_name): """Get the Op for a given name Parameters ---------- op_...
#!/usr/bin/env python3 """ Build test patterns for lwtnn-test-arbitrary-net Givan a variable specification file, will produce two files: - A file specifying the names of the inputs - A file containing dummy input variables """ from argparse import ArgumentParser, RawDescriptionHelpFormatter import json def _get_...
"""Module containing the playground WSGI handlers.""" import cgi import httplib import json import os import re import StringIO import urllib import zipfile import webapp2 from . import appids from . import error from error import Abort from . import fixit from . import middleware from mimic.__mimic import common fr...
# Initialization file for gallery_get # # Rego Sen # Aug 22, 2013 # DEFAULT_TITLE = r'<title>(.*?)</title>' DEFAULT_REDIRECT = "" # assumes all links are direct links DEFAULT_DIRECT_LINKS = r'src=[\"\'](.+?\.jpe?g)[\"\']' DEFAULT_USE_FILENAME = False DEFAULT_LOAD_JAVASCRIPT = False DEFAULT_PAGE_LOAD_TIME = ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime from dateutil import tz APPLICATION_YEAR = 2020 APPLICATION_URL = "https://www.voforeisestipend.no/" TZONE = tz.gettz('Europe/Oslo') UTC = tz.gettz('UTC') def enum_to_list(items, target_string, props): outlist = [] if len(items) > 0: for ...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin class TestManipulate(object): config = """ tasks: test_1: mock: - {title: 'abc FOO'} manipulate: ...
#!/usr/bin/python # -*- coding: utf-8 -*- __author__ = 'AleksNeStu' # Task04-01: # Create simple data descriptors like `BirthdayField`, `NameField`, `PhoneField` which can perform simple check of types and values. # Example: # ```python # >>> from datetime import datetime # >>> from fields import BirthdayField, Name...
from __future__ import unicode_literals from indico.modules.vc.controllers import (RHVCManageEvent, RHVCManageEventSelectService, RHVCManageEventCreate, RHVCManageEventModify, RHVCManageEventRefresh, RHVCManageEventRemove, RHVCEventP...
"""Metric-based learners.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import gin.tf from meta_dataset.learners.experimental import base as learner_base from meta_dataset.models.experimental import reparameterizable_backbones import tensorflow as tf ...
import kivy kivy.require('1.0.6') # replace with your current kivy version ! from metaData import getArtistInfo from lyrics import getLyrics from kivy.app import App from kivy.uix.label import Label from kivy.uix.widget import Widget from kivy.uix.button import Button from kivy.config import Config from kivy...
""" Routines to detect, symmetrize and generate symmetric geometries. The symmetric axes are automatically found by the principal axes of rotation for convenience. As a result, some axes need to be rearranged to match normal conventions depending on the type of rotor. """ import numpy as np import gimbal.constants as ...
from App.Proxys import * data = IKVMCController( name = '', controlParamsList = [ ControlParams( joint = 'root', kp = 1000.0, kd = 200.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ), ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0,...
import sys # Because the package ardrone_autonomy has not yet been catkinized and roslib.load manifest won't work..use this hack! # You may change the path to your ardrone_autonomy folder. This is needed to actually import the navdata messages, you # can also append your $PYTHONPATH sys.path.append("/opt/ros/groovy/sta...
#!/usr/bin/env python3 import os import os.path import platform import re import tarfile import urllib.request import zipfile from io import BytesIO import shutil import sys import ssl ssl_ctx = ssl.create_default_context() ssl_ctx.check_hostname = False ssl_ctx.verify_mode = ssl.CERT_NONE TOOLS_PATH = os.path.dirna...
class PyAzureMgmtCore(PythonPackage): """Microsoft Azure Management Core Library for Python.""" homepage = "https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/core/azure-mgmt-core" url = "https://pypi.io/packages/source/a/azure-mgmt-core/azure-mgmt-core-1.2.0.zip" version('1.2.0', sha2...
import os from authomatic.providers import oauth2, oauth1 from application.auth_providers import Eventbrite # Get application base dir. _basedir = os.path.abspath(os.path.dirname(__file__)) STATIC_ROOT = 'static' SQLALCHEMY_ECHO = False SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL'] SPARKPOST_API_KEY = os.envir...
import numpy as np from struct import unpack def read_halo_catalog_numpy(filename) : halo_catalog = np.genfromtxt(filename, names=True) clean_columns_numpy(halo_catalog) return halo_catalog def clean_columns_numpy(data): new_names = [] for i, name in enumerate(data.dtype.names) : new_n...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import inspect import types from django.apps import apps from django.core.checks import Error, Tags, register @register(Tags.models) def check_all_models(app_configs=None, **kwargs): errors = [] for model in apps.get_models(): if app_co...
# -*- coding: utf-8 -*- class LazyJIT(object): this = None def __init__(self, decorator, f, *args, **kwargs): self.f = f self.args = args self.kwargs = kwargs self.decorator = decorator def __call__(self, *args, **kwargs): if self.this is None: try: ...
from pandas.util.testing import assert_frame_equal import pandas as pd import feather import util def test_factor_rep(): fpath1 = util.random_path() fpath2 = util.random_path() rcode = """ library(feather) iris <- read_feather("{0}") iris$Species <- as.factor(as.character(iris$Species)) write_feather(i...
import os import dj_database_url BASE_DIR = os.path.dirname(os.path.dirname(__file__)) DEBUG = False TEMPLATE_DEBUG = False INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.s...