gt
stringclasses
1 value
context
stringlengths
2.49k
119k
import sys import imp __all__ = ['inject', 'import_patched', 'monkey_patch', 'is_monkey_patched'] __exclude = set(('__builtins__', '__file__', '__name__')) class SysModulesSaver(object): """Class that captures some subset of the current state of sys.modules. Pass in an iterator of module names to the co...
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
import csv import sys import typing import collections from pathlib import Path import chardet import warnings import pycldf.dataset from pathlib import Path from csvw.dsv import UnicodeDictReader from beastling.util import log def sniff(filename, default_dialect: typing.Optional[csv.Dialect] = csv.excel): """...
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Starts(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "streamtube" _path_str = "streamtube.starts" _valid_props = {"x", "xsrc", "y", "ysrc", "z", "...
import pytest from unittest.mock import patch, Mock from aiocache import SimpleMemoryCache, RedisCache, MemcachedCache, caches, Cache, AIOCACHE_CACHES from aiocache.factory import _class_from_string, _create_cache from aiocache.exceptions import InvalidCacheType from aiocache.serializers import JsonSerializer, PickleS...
# Copyright 2012 NEC Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
#!/usr/bin/env python # portable serial port access with python # # This is a module that gathers a list of serial ports including details on OSX # # code originally from https://github.com/makerbot/pyserial/tree/master/serial/tools # with contributions from cibomahto, dgs3, FarMcKon, tedbrandston # and modifications ...
from unittest import mock from django.contrib.postgres.indexes import ( BloomIndex, BrinIndex, BTreeIndex, GinIndex, GistIndex, HashIndex, SpGistIndex, ) from django.db import connection from django.db.models import CharField from django.db.models.functions import Length from django.db.models.query_utils impor...
""" Support for native homogeneous lists. """ import math import operator from llvmlite import ir from numba.core import types, typing, errors, cgutils from numba.core.imputils import (lower_builtin, lower_cast, iternext_impl, impl_ret_borrowed, ...
# (c) Copyright 2014 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses...
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations import dataclasses import logging import textwrap from abc import ABCMeta, abstractmethod from dataclasses import dataclass from enum import Enum from ...
"""Support for SNMP enabled switch.""" import logging import pysnmp.hlapi.asyncio as hlapi from pysnmp.hlapi.asyncio import ( CommunityData, ContextData, ObjectIdentity, ObjectType, SnmpEngine, UdpTransportTarget, UsmUserData, getCmd, setCmd, ) from pysnmp.proto.rfc1902 import ( ...
# encoding: utf-8 from __future__ import unicode_literals from docker.errors import APIError from pytest import raises from ..container import ( scalar, ) from .utils import ( assert_in_logs, TEST_ORG, TEST_TAG, make_container, validate_dict, volume, ) def checked_join(container): co...
"""Sequence-to-sequence model with an attention mechanism.""" import random import numpy as np import tensorflow as tf from tensorflow.models.rnn import rnn_cell from tensorflow.models.rnn import seq2seq from tensorflow.models.rnn.translate import data_utils class Seq2SeqModel(object): """Sequence-to-sequence m...
# coding: utf-8 # # Copyright 2019 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
#!/usr/bin/python2.7 # Compresses the core Blockly files into a single JavaScript file. # # Copyright 2012 Google Inc. # https://developers.google.com/blockly/ # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy o...
#!/usr/bin/env python # Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list o...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
""" .. _optics-app: Optics App ============== App used to help design the lens system used in the microscope. See :ref:`microscope-optics` for the full details of how the app is used to design and select all the lenses in the system. There are three model sections in the app: Focal length / mag from position ------...
from __future__ import division from functools import partial import warnings import dlib from pathlib import Path import numpy as np from menpo.feature import no_op from menpo.base import name_of_callable from menpofit import checks from menpofit.visualize import print_progress from menpofit.compatibility import STR...
# encoding: utf-8 """ mprnlri.py Created by Thomas Mangin on 2009-11-05. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ from struct import unpack from exabgp.protocol.ip import NoNextHop from exabgp.protocol.family import AFI from exabgp.protocol.family import SAFI from exabgp.protocol.family import ...
# -*- coding: utf-8 -*- # This file is part of the pymfony package. # # (c) Alexandre Quercia <alquerci@email.com> # # For the full copyright and license information, please view the LICENSE # file that was distributed with this source code. from __future__ import absolute_import; import unittest; from pymfony.compon...
# coding: utf-8 """ Wavefront REST API Documentation <p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the W...
# Copyright (c) 2010 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
# coding: utf8 from __future__ import unicode_literals def explain(term): if term in GLOSSARY: return GLOSSARY[term] GLOSSARY = { # POS tags # Universal POS Tags # http://universaldependencies.org/u/pos/ 'ADJ': 'adjective', 'ADP': 'adposition', 'ADV': ...
''' Created on 05/nov/2013 @author: <luca.restagno@gmail.com> ''' import markdown, Constants from PyQt4 import QtCore from PyQt4.QtCore import pyqtSlot,SIGNAL from subprocess import call class Controller(): ''' classdocs ''' def __init__(self, view, model): ''' Constructor '''...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2015 Thomas Voegtlin # # 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...
# Copyright 2014 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
''' Translates a source file using a translation model. ''' import argparse import theano import numpy import cPickle as pkl from nmt import (build_sampler, gen_sample, load_params, init_params, init_tparams) from multiprocessing import Process, Queue def translate_model(queue, rqueue, mask_left, ...
import numpy as np from keras import backend as kB import pandas as pd from concise.effects.util import * import copy def predict_vals(input_data, mutated_positions, apply_function=None, output_concat_axis=0, batch_size=100, **kwargs): outputs = {} # if type(input_data) not in [list, tuple, dict]: # inp...
# Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
import json import sys import os import yaml from cloudmesh_base.Shell import Shell from cloudmesh_database.dbconn import get_mongo_dbname_from_collection from cloudmesh_base.ConfigDict import ConfigDict from cloudmesh_base.util import path_expand from cmd3.console import Console from passlib.hash import sha256_crypt ...
# winout.py # # generic "output window" # # This Window will detect itself closing, and recreate next time output is # written to it. # This has the option of writing output at idle time (by hooking the # idle message, and queueing output) or writing as each # write is executed. # Updating the window directly gives a ...
try: # py3 from shlex import quote except ImportError: # py2 from pipes import quote import hashlib import logging import os import subprocess import sys import time from threading import Thread from getpass import getuser from ray.autoscaler.tags import TAG_RAY_NODE_STATUS, TAG_RAY_RUNTIME_CONFIG, \ ST...
import cProfile import logging import time import traceback from typing import Any, AnyStr, Callable, Dict, \ Iterable, List, MutableMapping, Optional, Text from django.conf import settings from django.contrib.sessions.middleware import SessionMiddleware from django.core.exceptions import DisallowedHost from djan...
import logging from ..requests import requests from .common import access_token from itchatmp.config import COMPANY_URL from itchatmp.content import ( IMAGE, VOICE, VIDEO, MUSIC, TEXT, NEWS, CARD) from itchatmp.utils import retry, encode_send_dict from itchatmp.returnvalues import ReturnValue logger = logging.get...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ pgoapi - Pokemon Go API Copyright (c) 2016 tjado <https://github.com/tejado> 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, ...
# -*- coding: utf-8 -*- # pylint: disable=line-too-long """ This module is for generating random, valid web navigator's configs & User-Agent HTTP headers. Functions: * generate_user_agent: generates User-Agent HTTP header * generate_navigator: generates web navigator's config * generate_navigator_js: generates w...
# This is a Python implementation of the following jsonLogic JS library: # https://github.com/jwadhams/json-logic-js from __future__ import unicode_literals import sys from six.moves import reduce import logging logger = logging.getLogger(__name__) try: unicode except NameError: pass else: # Python 2 fal...
from exceptions import CommandError, ParameterError import time import copy # deepcopy from CommandHandler import CommandHandler """ Parsers They are used to validate every arg before sending it to the Expenses functions """ @CommandHandler.addCommand("add") def parseAdd(expenseInstance, args): """ ...
"""The tests for the Season sensor platform.""" # pylint: disable=protected-access import unittest from datetime import datetime from homeassistant.setup import setup_component import homeassistant.components.sensor.season as season from tests.common import get_test_home_assistant HEMISPHERE_NORTHERN = { 'homea...
from mmtf.codecs import encode_array import msgpack from mmtf.utils import constants def make_entity_dict(chain_indices,sequence,description,entity_type): out_d = {} out_d["description"] = description out_d["type"] = entity_type out_d["chainIndexList"] = chain_indices out_d["sequence"] = sequence ...
import datetime import logging from marcottimls.etl import PersonIngest, SeasonalDataIngest from marcottimls.models import (Countries, Players, PlayerSalaries, PartialTenures, AcquisitionPaths, AcquisitionType, PlayerDrafts, Competitions, CompetitionSeasons, Clubs, ...
from __future__ import division, absolute_import, print_function import warnings import sys import os import itertools import textwrap import pytest import weakref import numpy as np from numpy.testing import ( assert_equal, assert_array_equal, assert_almost_equal, assert_array_almost_equal, assert_array_less...
# coding=utf8 """ github.py - Willie Github Module Copyright 2012, Dimitri Molenaars http://tyrope.nl/ Licensed under the Eiffel Forum License 2. http://willie.dftba.net/ """ from __future__ import unicode_literals from datetime import datetime import sys if sys.version_info.major < 3: from urllib2 import HTTPErr...
# Copyright 2013 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
"""Modules for I2C bus on the Opsis. FIXME: Refactor this properly... """ from migen.fhdl import * from migen.fhdl.specials import TSTriple from migen.genlib.cdc import MultiReg from migen.genlib.fsm import FSM, NextState from migen.genlib.misc import chooser from migen.genlib.misc import split, displacer, chooser ...
import logging import os from contextlib import contextmanager from functools import partial from typing import ( TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, TextIO, Tuple, Union, cast, ) from funcy import compact, lremove from rich.rule import Rule from ri...
""" Tests for geo spatial data types""" import numpy as np import pytest from numpy import testing from pytest import param import ibis pytestmark = pytest.mark.geospatial # TODO find a way to just run for the backends that support geo, without # skipping if dependencies are missing pytest.importorskip('geoalchemy2...
# -*- coding: utf-8 -*- """ Created on Wed Aug 30 19:07:37 2017 @author: AmatVictoriaCuramIII """ import numpy as np import random as rand import pandas as pd import time as t from DatabaseGrabber import DatabaseGrabber from YahooGrabber import YahooGrabber Empty = [] Dataset = pd.DataFrame() Portfolio = pd.DataFrame(...
# -*- coding: UTF-8 -*- from __future__ import absolute_import, with_statement import re import six from behave import model, i18n from behave.textutil import text as _text DEFAULT_LANGUAGE = "en" def parse_file(filename, language=None): with open(filename, "rb") as f: # file encoding is assumed to be u...
"""A tasklet decorator. Tasklets are a way to write concurrently running functions without threads; tasklets are executed by an event loop and can suspend themselves blocking for I/O or some other operation using a yield statement. The notion of a blocking operation is abstracted into the Future class, but a tasklet ...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This file defines the classes used to represent a 'coordinate', which includes axes, ticks, tick labels, and grid lines. """ import warnings import numpy as np from matplotlib.ticker import Formatter from matplotlib.transforms import Affine2D, Scal...
# -*- coding: utf-8 -*- import datetime import re from dateutil import parser from nose.tools import * # flake8: noqa import mock from rest_framework import serializers as ser from tests.base import ApiTestCase from tests import factories from api.base.settings.defaults import API_BASE from api.base.filters import...
#!/usr/bin/env python # Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may ...
""" This script contains functionality for downloading, cleaning up and converting Donald Trump tweets to a numpy data format suitable for training a character level modelling network. """ import html import json import os import random import urllib.request as req import numpy as np from unidecode import unidecode #...
"""Support for esphome devices.""" import asyncio import logging import math from typing import Any, Callable, Dict, List, Optional from aioesphomeapi import ( APIClient, APIConnectionError, DeviceInfo, EntityInfo, EntityState, HomeassistantServiceCall, UserService, UserServiceArgType, ...
# -*- coding: utf-8 -*- """ This file is part of pyCMBS. (c) 2012- Alexander Loew For COPYING and LICENSE details, please refer to the LICENSE file """ import numpy as np def get_albedo_colortable(): """ colors(*,i)=[0, 0, 050] & boundary[i]=0.000 & i=i+1 colors(*,i)=[0, 0, 200] & boundary[i]=0.0...
import logging from flask import flash from flask_login import current_user from scout.build import build_managed_variant from scout.constants import CHROMOSOMES, CHROMOSOMES_38 from scout.parse.variant.managed_variant import parse_managed_variant_lines from scout.server.extensions import store from scout.server.util...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www....
# encoding: utf-8 """ Base classes and other objects used by enumerations """ from __future__ import absolute_import, print_function import sys import textwrap def alias(*aliases): """ Decorating a class with @alias('FOO', 'BAR', ..) allows the class to be referenced by each of the names provided as ar...
""" Manage ELBs .. versionadded:: 2014.7.0 Create and destroy ELBs. Be aware that this interacts with Amazon's services, and so may incur charges. This module uses ``boto``, which can be installed via package, or pip. This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instan...
"""Common Shell Utilities.""" import os import sys from subprocess import Popen, PIPE from multiprocessing import Process from threading import Thread from ..core.meta import MetaMixin from ..core.exc import FrameworkError def exec_cmd(cmd_args, *args, **kw): """ Execute a shell call using Subprocess. All a...
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. import os import unittest from iptest import IronPythonTestCase, is_cli, is_netcoreapp, run_test, skipUnlessIron...
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
# Copyright 2010-2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
#!/usr/bin/python # AUTHOR # Daniel Pulido <dpmcmlxxvi@gmail.com> # COPYRIGHT # Copyright (c) 2015 Daniel Pulido <dpmcmlxxvi@gmail.com> # LICENSE # MIT License (http://opensource.org/licenses/MIT) """ Various patterns to scan pixels on a grid. Rectangular patterns are scanned first along the x-coordinate then t...
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
# Unix SMB/CIFS implementation. # Copyright (C) Amitay Isaacs <amitay@gmail.com> 2011 # # 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 Foundation; either version 3 of the License, or # (at your option) any...
# Copyright (C) 2016 ycmd contributors # # This file is part of ycmd. # # ycmd 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 3 of the License, or # (at your option) any later version. # # ycmd...
# # Copyright (c) 2008-2015 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
# Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os from telemetry.core import exceptions from py_trace_event import trace_event DEFAULT_WEB_CONTENTS_TIMEOUT = 90 # TODO(achuith, dtu, nduca): Add...
# -*- coding: utf-8 -*- #MIT License #Copyright (c) 2017 Marton Kelemen #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 limitation the rights #to use, c...
#!/usr/bin/python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
#! /usr/bin/env python2 # # This file is part of khmer, http://github.com/ged-lab/khmer/, and is # Copyright (C) Michigan State University, 2009-2015. It is licensed under # the three-clause BSD license; see LICENSE. # Contact: khmer-project@idyll.org # """ Semi-streaming error correction. Output sequences will be pla...
from IPython.display import HTML from jinja2 import Template from datetime import datetime, timezone, timedelta import copy from typing import List, Tuple import biokbase.narrative.clients as clients from .job import ( Job, EXCLUDED_JOB_STATE_FIELDS, JOB_INIT_EXCLUDED_JOB_STATE_FIELDS, ) from biokbase.narra...
import cwriting.core as core import cwriting.node as node import cwriting.curve as curve import math def makeRiseTween(d, obj, duration, real, diff=node.Placement(start=(0, -0.2, 0))): tl = core.Timeline(d.next()) d.registerTimeline(tl) obj.setPlacement(real.moved(diff)) obj.setVisibility(False) obj.keyPlacement...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
# # Copyright (c) 2008-2015 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
# -*- coding: utf-8 -*- """ pygments.lexers.prolog ~~~~~~~~~~~~~~~~~~~~~~ Lexers for Prolog and Prolog-like languages. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups from pyg...
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
""" This is the Django template system. How it works: The Lexer.tokenize() function converts a template string (i.e., a string containing markup with custom template tags) to tokens, which can be either plain text (TOKEN_TEXT), variables (TOKEN_VAR) or block statements (TOKEN_BLOCK). The Parser() class takes a list ...
# -*- coding: utf-8 -*- from __future__ import (absolute_import, unicode_literals) """ ==================== Metabolic Components ==================== :Authors: Moritz Emanuel Beber Nikolaus Sonnenschein :Date: 2011-04-07 :Copyright: Copyright(c) 2011 Jacobs University of Bremen. All rights reserved...
""" XX. Generating HTML forms from models This is mostly just a reworking of the ``form_for_model``/``form_for_instance`` tests to use ``ModelForm``. As such, the text may not make sense in all cases, and the examples are probably a poor fit for the ``ModelForm`` syntax. In other words, most of these tests should be r...
""" Wishary Random Variates TODO want to move the specific implementation of posteriors outside of the general `stats.rvs` libraries, since e.g. the below Wishart implementation is only valid for vector autoregressions. """ from __future__ import division import numpy as np from rvs import RandomVariable # ...
# this code comes from ABE. it can probably be simplified # # 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 prob...
#Pyjsdl - Copyright (C) 2013 James Garnon <https://gatc.ca/> #Released under the MIT License <https://opensource.org/licenses/MIT> from pyjsdl import env from math import sqrt, sin, cos, atan2, pi, floor class Vector2(object): """ Vector2 - 2-dimensional vector. Build in --optimized mode (-O) lack type ...
import os import Queue import serial import settings import sys import time import threading import traceback import zmq #BASE_PATH = os.path.dirname(os.path.realpath(__file__)) #UPPER_PATH = os.path.split(os.path.dirname(os.path.realpath(__file__)))[0] #DEVICES_PATH = "%s/Hosts/" % (BASE_PATH ) #THIRTYBIRDS_PATH = "...
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
import gspread import config import datetime import uuid import httplib import httplib2 import os from oauth2client.file import Storage from oauth2client.client import Credentials def refresh_access_token(): if creds.access_token_expired: creds._do_refresh_request(httplib2.Http().request) print "Loading...
""" Convenience forms for adding and updating ``Event``s and ``Occurrence``s. """ from __future__ import absolute_import from __future__ import unicode_literals from datetime import datetime, date, time, timedelta from django import forms from django.utils.translation import ugettext_lazy as _ #from django.forms.extra...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
#!/usr/bin/python # # Copyright 2002-2019 Barcelona Supercomputing Center (www.bsc.es) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
from sqlalchemy import schema as sa_schema, types as sqltypes from sqlalchemy.engine.reflection import Inspector from sqlalchemy import event from ..operations import ops import logging from .. import util from ..util import compat from ..util import sqla_compat from sqlalchemy.util import OrderedSet import re from .re...
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse import logging from .sites import foolSlide from .sites import readcomicOnlineli from .sites import comicNaver from .sites import mangaHere from .sites import rawSenManga from ...
""" dataset specification for JEDI """ import re import math from pandajedi.jediconfig import jedi_config class JediDatasetSpec(object): def __str__(self): sb = [] for key in self.__dict__: if key == 'Files': sb.append("{key}='{value}'".format(key=key, value=len...