src
stringlengths
721
1.04M
# -*- coding: utf-8 -*- # Copyright 2020 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 logging from flask import Blueprint, request from flask_babel import gettext from werkzeug.exceptions import NotFound from followthemoney import model from followthemoney.compare import compare from pantomime.types import ZIP from aleph.core import db, url_for from aleph.search import EntitiesQuery, MatchQuery,...
from mapwidgets.widgets import GooglePointFieldWidget from django.contrib import admin from django.contrib.gis.db import models from django.utils.translation import ugettext as _ from homes.models import Block, Banner, SEO, SearchPrice, Branch, PropertyTenure, PropertyType, Alert, MediaType class SearchPriceAdmin(a...
# 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 t...
#!/usr/bin/env python3 import sys import os sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)) + '/..') import yogi import unittest from proto import yogi_0000d007_pb2 from test_terminals import AsyncCall class TestSubscription(unittest.TestC...
import math import numpy as np from itertools import combinations, chain from collections import Counter def compare(s, t): return Counter(s) == Counter(t) def math_stuff(x1, y1, x2, y2): slope = float((y2 - y1) / (x2 - x1) if ((x2 - x1) != 0) else math.inf) line_len = math.sqrt((x2 - x1) **...
# Copyright 2016 The Kubernetes 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 ...
# Copyright (c) 2009, South African Astronomical Observatory (SAAO) # # All rights reserved. See LICENSE for more details # """INTERIDENTIFY provides an interactive method for identifying lines in an arc image. The tasks displays the full image, a line extracted from the image, and resid...
# coding=utf-8 from django.db import models from django.utils.translation import ugettext_lazy as _ from datetime import datetime, timedelta import sys class Driver(models.Model): POLL_STATUS_CHOICES = ( ('AA', _('Ready')), ('BA', _('Running')), ('CA', _('Finished')), ('ZA', _('Fini...
# blaplay, Copyright (C) 2014 Niklas Koep # 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 2 # of the License, or (at your option) any later version. # This program is distribut...
import pytest from datadog_checks.base.errors import CheckException from datadog_checks.dev.utils import get_metadata_metrics from datadog_checks.riak_repl import RiakReplCheck from .common import INSTANCE def test_config(): c = RiakReplCheck('riak_repl', {}, {}, None) # Empty instance instance = {} ...
#!/usr/bin/env python ################################################## # Gnuradio Python Flow Graph # Title: Simple Trx # Generated: Mon Apr 8 15:22:22 2013 ################################################## import os from gnuradio import eng_notation from gnuradio import gr from gnuradio.eng_option import eng_opti...
from anarcho.models.token import Token from anarcho.models.user import User from flask.json import jsonify import os from anarcho import storage_worker, app, db from anarcho.serializer import serialize from anarcho.access_manager import app_permissions, login_required from flask.helpers import send_file from anarcho.mo...
#!/usr/bin/env python """ This module tries to retrieve as much platform-identifying data as possible. It makes this information available via function APIs. If called from the command line, it prints the platform information concatenated as single string to stdout. The output format is useable...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # list是一种有序的集合,可以随时添加和删除其中的元素 classmates = ['Michael', 'Bob', 'Tracy'] print(classmates) print(len(classmates)) print(classmates[0]) print(classmates[1]) print(classmates[2]) print(classmates[-1]) print(classmates[-2]) print(classmates[-3]) print() # 追加元素到末尾 classmates....
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, ## 2010, 2011, 2012, 2013 CERN. ## ## Invenio 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 Softwar...
"""Test the collective reducescatter API on a distributed Ray cluster.""" import pytest import ray import numpy as np import torch from ray.util.collective.types import Backend from ray.util.collective.tests.cpu_util import create_collective_workers, \ init_tensors_for_gather_scatter @pytest.mark.parametrize("b...
import sys,os import time from os import walk, path from os.path import splitext, join from json import dumps from config import * import signal import subprocess import re import shutil import glob from flask import * def wl_batchprocess(args, cmd, func): wloads = args.get('wlnames').split(',') print "In wl" ...
from lino.api import dd from django.db import models class Floor(dd.Model): number = models.IntegerField('Number', null=False) def __unicode__(self): return 'Floor: {0}'.format(self.number) class Meta: verbose_name = 'Floor' verbose_name_plural = 'Floors' class Room(dd.Model): ...
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.org/> # # 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, eithe...
# we use pygame for our nice little thermometer! import pygame # let's try it... class Thermo(object): """ So... this class displays, using pygame, a nice thermometer on the screen. You can set the height of the thing as a percentage, using: set_percentage(some percentage) This is really just as s...
from collections import defaultdict import math import numpy as np import random import feature_extractors import game as g import hand_optimizer class BasePolicy(object): ''' Base class for all policies. ''' def __init__(self, game, args=None): self.game = game # Must return the optimal action as det...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models class AccountInvoiceLine(models.Model): _inherit = ['account.move.line'] def get_digital_purchases(self): partner = self.env.user.partner_id # Get paid invoices ...
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
from collections import OrderedDict from cell import High, Low, Invisible import wire import cell import pygame import utils from pygame import Rect LEFT = 1 MID = 2 RIGHT = 3 WHEEL_UP = 4 WHEEL_DOWN = 5 MODE_IDLE = 0 MODE_MOVE = 1 MODE_ADD = 2 MODE_DEL = 3 MODE_WIRE = 4 MODE_PAN = 5 MODE_SELECT...
from setuptools import setup # Remove build status and move Gitter link under title for PyPi README = open('README.rst').read() \ .replace('|Build Status|', '', 1) \ .replace('|Gitter|', '', 1) \ .replace('===\n', '===\n\n|Gitter|\n') setup( name='django-cacheops', version='6.0', au...
import copy import json from indy_common.constants import REVOC_REG_DEF_ID, TO, CRED_DEF_ID, REVOC_TYPE, TAG, VALUE from indy_common.state import domain from plenum.common.constants import DATA, STATE_PROOF from plenum.common.types import f, OPERATION from plenum.common.util import get_utc_epoch from plenum.test.helpe...
# -*- coding: utf-8 -*-} """Adding missing port interfaces Revision ID: 38745782554d Revises: b2b823fe47b1 Create Date: 2017-06-07 15:16:30.224298 """ from alembic import op from sqlalchemy import Integer, String from sqlalchemy.sql import table, column, text # revision identifiers, used by Alembic. revision = '387...
from django.conf.urls import url, include from . import views app_name = 'fileuploads' urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^(?P<filename_id>[0-9]+)/$', views.detail, name='detail'), url(r'^(?P<filename_id>[0-9]+)/results/$', views.results, name='results'), url(r'^about/$', vie...
#! /usr/bin/env python import time import threading import os, sys, Queue from time import gmtime, strftime from itertools import groupby from operator import itemgetter import os.path import imapfile import logging import honeypotconfig import scan import bing import executemechanize import malwebsites import normali...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2013 Kitware 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 cop...
# encoding: utf-8 from django.db import models import os from mencoder import * class Video(models.Model): """This is a small demo using just two fields. The slug field is really not necessary, but makes the code simpler. ImageField depends on PIL or pillow (where Pillow is easily installable in a virtual...
#!/usr/bin/python # encoding: utf-8 """ scaffold_model_design.py A PSE builder for scaffold/model/design structures. Created by Shane O'Connor 2014. The PyMOL commands are adapted from scripts developed and written by Roland A. Pache, Ph.D., Copyright (C) 2012, 2013. """ from klab.fs.fsio import write_file from klab ...
#!/usr/bin/env python """healthgraph-api Setup Script """ import os from setuptools import setup __author__ = "Ali Onur Uyar" __copyright__ = "Copyright 2012, Ali Onur Uyar" __credits__ = [] __license__ = "GPL" __version__ = "0.3.0" __email__ = "aouyar at gmail.com" __status__ = "Development" def read_file(filenam...
import time, urllib from twisted.python import log from twisted.web import html from twisted.web.util import Redirect from buildbot.status.web.base import HtmlResource, abbreviate_age, OneLineMixin, path_to_slave from buildbot import version, util # /buildslaves/$slavename class OneBuildSlaveResource(HtmlResource, O...
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: url(r'^$', 'biz.views.index', name='home'), url(r'^map.geojson$', 'biz.views.geojson', name='map'), url(r'^stats$', "biz.views.stats", name="stats"), url...
import discord from discord.ext import commands from PIL import Image from PIL import ImageOps from PIL import ImageDraw from PIL import ImageFont import asyncio, aiohttp, io, time, imghdr, os, json, textwrap, re class Profile: """ Profile card setup and display """ def __init__(self, client, config):...
# # 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 # ...
import os import sys import shutil import numpy as np import tensorflow as tf from tensorflow.python.ops import init_ops from tensorflow.contrib.layers.python.layers import regularizers module_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), "..") if module_path not in sys.path: sys.path.append(mod...
# -*- coding: utf-8 -*- """ This module allows developer to query zipcode with super clean API. """ import heapq import math import sys from collections import OrderedDict import sqlalchemy as sa from pathlib_mate import Path from six import integer_types, string_types from sqlalchemy.orm import sessionmaker from ....
""" The B{0install remove-feed} command-line interface. """ # Copyright (C) 2011, Thomas Leonard # See the README file for details, or visit http://0install.net. syntax = "[INTERFACE] FEED" from zeroinstall import SafeException, _ from zeroinstall.injector import model, writer from zeroinstall.cmd import add_feed, U...
#!/usr/bin/env python # # Author: Pablo Iranzo Gomez (Pablo.Iranzo@redhat.com) # # Description: Script for monitoring host Memory status and VM's rhevm-sdk # api and produce NAGIOS valid output # # Requires rhevm-sdk to work # # This program is free software; you can redistribute it and/or modify # it under the terms o...
#!/usr/bin/python # -*- coding:utf-8; tab-width:4; mode:python -*- import sys import Ice Ice.loadSlice('-I {} cannon.ice'.format(Ice.getSliceDir())) import Cannon import time from matrix_utils import matrix_multiply def load_matrix_from_file(filename): with file(filename) as f: rows = f.readlines() ...
# -*- coding: utf-8 -*- """ valid_number.py ~~~~~~~~~~~~~~ A brief description goes here. """ import re class Solution: # @param s, a string # @return a boolean def isNumber(self, s): s = s.strip().lower() if len(s) == 0: return False if s.count('.') > 1 ...
## @file # This file is used to define common items of class object # # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. ...
import rpy2.robjects.packages as rpackages import rpy2.robjects as ro import click import csv import sys from typing import List from typing import Dict from ..get_stats.util import * class GeneLinregEntry: def __init__(self, symbol: str): self.symbol = symbol self.symbol_key = symbol.casefold() self.count = 0...
# Copyright 2021 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...
#!/usr/bin/python import openpanzer as op from oppSql import * from oppRdf import * import util from dbpedia import DbpediaQuery from websearch import GoogleQuery, BingQuery from urllib import quote, unquote from pprint import pprint import time,os, sys, errno reload(sys) sys.setdefaultencoding("utf-8") OFFLINE_JSON...
import os import itertools import numpy import scipy import pandas import seaborn import matplotlib.pyplot as plt from pgtools import toolbox PSEUDO_COUNT = 1 EXPRESSION_THRESHOLD = 1 FIG_EXTS = ['pdf', 'png'] PNG_DPI = 600 def load_and_clean(datafile): exp_data = pandas.read_csv(datafile, sep='\t', index_col=0)...
""" User interfaces for the nek-workflow script Currently, there is only a command line interface """ def command_line_ui(): """ Command line interface for nek-workflow Uses python's ArgumentParser to read the command line and then creates shortcuts for common argument combinations """ # grab defaults ...
import numpy as np def update_parameters_with_gd_test_case(): np.random.seed(1) learning_rate = 0.01 W1 = np.random.randn(2, 3) b1 = np.random.randn(2, 1) W2 = np.random.randn(3, 3) b2 = np.random.randn(3, 1) dW1 = np.random.randn(2, 3) db1 = np.random.randn(2, 1) dW2 = np.random....
# -*- coding: utf-8 -*- """ chemdataextractor.cli.pos ~~~~~~~~~~~~~~~~~~~~~~~~~ Part of speech tagging commands. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import logging import click from ..doc import Document, Text from ..nlp.corpus import gen...
from tests.base import JarrFlaskCommon from tests.api.common import ApiCommon class CategoryApiTest(JarrFlaskCommon, ApiCommon): urn = 'category' urns = 'categories' def test_api_list(self): resp = self._api('get', self.urns, data={'order_by': '-id'}, user='user1') ...
# -*- coding: utf-8 -*- """ Copyright (C) 2010 Vincent Ollivier <contact@vincentollivier.com> This file is part of OpenNMS Configuration Tools. OpenNMS Configuration Tools 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 Fou...
info = { "name": "ksf", "date_order": "DMY", "january": [ "ŋ1", "ŋwíí a ntɔ́ntɔ" ], "february": [ "ŋ2", "ŋwíí akǝ bɛ́ɛ" ], "march": [ "ŋ3", "ŋwíí akǝ ráá" ], "april": [ "ŋ4", "ŋwíí akǝ nin" ], "may": [ "ŋ...
import os import sys from amitools.vamos.astructs import FileHandleStruct class FileHandle: """represent an AmigaOS file handle (FH) in vamos""" def __init__(self, obj, ami_path, sys_path, need_close=True, is_nil=False): self.obj = obj self.name = os.path.basename(sys_path) self.ami_path = ami_path ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime import swampdragon.models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Announce', fields=[ ...
import socket, random, threading, Queue, sys, traceback, time, ssl, signal from string import maketrans import Config, Global, Hooks, Logger, Commands lowercase = "abcdefghijklmnopqrstuvwxyz[]~\\" uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ{}^|" caseless = "0123456789_-`@" ircupper = maketrans(lowercase, uppercase) def ...
# -*- coding: utf-8 -*- import 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 'PageTranslation.title' db.alter_column(u'blocks_page_translation', 'title', self.gf('djan...
# -*- coding: utf-8 -*- # # diffoscope: in-depth comparison of files, archives, and directories # # Copyright © 2015 Jérémy Bobbio <lunar@debian.org> # # diffoscope 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 Foundati...
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_set...
#!/usr/bin/env python2 # vim:fileencoding=utf-8 # License: GPLv3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net> from __future__ import absolute_import, division, print_function, unicode_literals import base64 from calibre.constants import preferred_encoding from calibre.ebooks.metadata.book import SERIALIZAB...
# Copyright 2017-2018 The Tangram Developers. See the AUTHORS file at the # top-level directory of this distribution and at # https://github.com/renatoGarcia/tangram/blob/master/AUTHORS. # # This file is part of Tangram. # # Tangram is free software: you can redistribute it and/or modify # it under the terms of the GNU...
"""empty message Revision ID: 8c866896f76e Revises: 0e5babc5b9ee Create Date: 2017-07-19 12:57:58.086196 """ from alembic import op import sqlalchemy as sa import commandment.dbtypes from alembic import context # revision identifiers, used by Alembic. revision = '8c866896f76e' down_revision = '0e5babc5b9ee' branch...
__author__ = 'Matt Croydon, Mikhail Korobov, Pawel Tomasiewicz' __version__ = (0, 7, 0) from functools import partial import datetime from dateutil.relativedelta import relativedelta from dateutil.parser import parse from django.db.models import Count from django.db import DatabaseError, transaction from django.conf ...
# -*- coding: utf-8 -*- # Copyright 2020 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...
# Copyright (c) 2014, Charles Duyk # 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 of conditions and the fo...
from __future__ import absolute_import, print_function import argparse import os import sys from collections import OrderedDict from distutils.spawn import find_executable from datetime import timedelta from six import iterkeys, itervalues, iteritems from . import config from . import wpttest from .formatters import c...
""" This module adds the default axis argument to code which did not specify it for the functions where the default was changed in NumPy. The functions changed are add -1 ( all second argument) ====== nansum nanmax nanmin nanargmax nanargmin argmax argmin compress 3 add 0 ====== take 3 rep...
from setuptools import setup about = {} with open('wakadump/__about__.py') as f: exec(f.read(), about) packages = [ about['__title__'], ] install_requires = [x.strip() for x in open('requirements.txt').readlines()] setup( name=about['__title__'], version=about['__version__'], license=about['__...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Version.object_type' db.add_column('workflow_version', 'object_type', ...
# Copyright 2018 The TensorFlow Probability 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 o...
# -*- coding: utf-8 -*- ''' Created on Sep 29, 2014 @author: tim ''' from flask import Flask from flask import request from flask import Response from flask.ext.cors import CORS from relation_calculator import Relation_Calculator import sys import json import re from crossdomain import crossdomain http_regex = re.com...
# -*- coding: utf-8 -*- from copy import deepcopy from jsonpointer import resolve_pointer, set_pointer #py2-py3 try: from collections import MutableMapping except ImportError: from collections.abc import MutableMapping class TDict(MutableMapping): def __init__(self, d=None): if d is None: ...
#!/usr/bin/python """Test of ARIA button presentation.""" from macaroon.playback import * import utils sequence = MacroSequence() #sequence.append(WaitForDocLoad()) sequence.append(PauseAction(5000)) sequence.append(utils.StartRecordingAction()) sequence.append(KeyComboAction("Tab")) sequence.append(utils.AssertPr...
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-04-03 16:45 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('player', '0001_initial'), ] operations = [ ...
# Copyright 2012 OpenStack LLC. # 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 b...
#!/usr/bin/env python3 # # Copyright John Marshall 2020 # # Flatten function is from a comment by Jordan Callicoat on # http://code.activestate.com/recipes/363051-flatten/ # from __future__ import print_function import os import sys import argparse import errno import subprocess class Args(): def __init__(s...
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: david@reciprocitylabs.com # Maintained By: david@reciprocitylabs.com import datetime from flask import Blueprint, session, g import sqlalchemy.orm ...
import predict as pd import copy import os import numpy as np import util import shutil import pickle import pylab as plt import pandas import local_multiprocessing import load_data import features.featurization as feat def check_feature_set_dims(feature_sets): F2 = None for set in feature_sets.keys(): ...
__author__ = 'gabriel' import numpy as np from data.models import CartesianSpaceTimeData, NetworkData, CartesianData import logging from streetnet import NetPoint, Edge, NetPath from collections import OrderedDict, defaultdict import operator uint_dtypes = [(t, np.iinfo(t)) for t in ( np.uint8, np.uint16, ...
# LICENCE: This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will...
import argparse import gym import numpy as np import os import tensorflow as tf import tempfile import time import json import random import rlattack.common.tf_util as U from rlattack import logger from rlattack import deepq from rlattack.deepq.replay_buffer import ReplayBuffer, PrioritizedReplayBuffer from rlattack....
from copy import copy from . import bind from .validators_combination import ValidatorsNullCombination from .errors import ValidationError, InvalidDocument, MissingKey # compatibility : used to generate schema names if not provided (2018-07-04) _globals = { "schemas_count": 0 } def _generate_name(): """Gene...
from dimagi.ext.couchdbkit import Document from django.db import models COUCH_UUID_MAX_LEN = 50 class DeviceReportEntry(models.Model): xform_id = models.CharField(max_length=COUCH_UUID_MAX_LEN, db_index=True) i = models.IntegerField() msg = models.TextField() type = models.CharField(max_length=32, db...
# -*- coding: utf-8 -*- """ Created on Fri Feb 12 01:01:50 2010 Author: josef-pktd latest result ------------- all are very close garch0 has different parameterization of constant ordering of parameters is different seed 2780185 h.shape (2000,) Optimization terminated successfully. Current function value: ...
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
#!/usr/bin/env python import sys from Files.shared import Config, Device42rest from Files.warranty_cisco import Cisco from Files.warranty_dell import Dell from Files.warranty_hp import Hp from Files.warranty_ibm_lenovo import IbmLenovo from Files.warranty_meraki import Meraki def get_hardware_by_vendor(name): # ...
a = 3 # type: str #? str() a b = 3 # type: str but I write more #? int() b c = 3 # type: str # I comment more #? str() c d = "It should not read comments from the next line" # type: int #? str() d # type: int e = "It should not read comments from the previous line" #? str() e class BB: pass def test(a, b): ...
import xbmcgui import xbmcplugin import comm import config import sys import urlparse import urllib from aussieaddonscommon import utils _url = sys.argv[0] _handle = int(sys.argv[1]) def list_categories(): """ Make initial list """ try: listing = [] categories = config.CATEGORIES ...
""" A label command (sub-command) for the Organice management command. """ from django.utils.translation import ugettext as _ from ._helper import HelperMixin class InitblogCommandMixin(HelperMixin): def initblog_command(self): """ Create sample blog entries """ self.log(_('Blog:...
#!/usr/bin/python import json import socket import sys import time import os import array import math import sqlite3 import xdriplib import mongo import db SensorData = {"_id":0, "started_at":0, "stopped_at":0, "latest_battery_level":0, "uuid":'', "sensor_location":'' } def StartSensor(): if SensorisActive()==Fa...
# -*- coding: utf-8 -*- # # mkala_live documentation build configuration file, created by # sphinx-quickstart. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values hav...
from MenuList import MenuList from Tools.Directories import resolveFilename, SCOPE_SKIN_IMAGE from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmapAlphaTest from enigma import eListboxPythonMultiContent, gFont from Tools.LoadPixmap import LoadPixmap def PluginEntryComponent(plugin, width...
import unittest from tube.tflAPI import TFLapi import vcr my_vcr = vcr.VCR( serializer = 'json', cassette_library_dir = 'tube/tests/fixtures/cassettes', record_mode = 'once', match_on = ['uri', 'method'], ) import logging logging.basicConfig() # you need to initialize logging, otherwise you will not see anything...
# -*- coding: utf-8 -*- # Copyright (C) 2012 Yahoo! Inc. All Rights Reserved. # Copyright (C) 2013 Rackspace Hosting 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 ...
"""Class to hold all light accessories.""" import logging from pyhap.const import CATEGORY_LIGHTBULB from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_BRIGHTNESS_PCT, ATTR_COLOR_TEMP, ATTR_HS_COLOR, ATTR_MAX_MIREDS, ATTR_MIN_MIREDS, DOMAIN, SUPPORT_BRIGHTNESS, SUPP...
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Romain Bignon # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your...
#coding=utf-8 import time import cPickle from in_trip.store_data.views import pg_db,conn import logging logger = logging.getLogger('parser') def creat_table(): sql_str = ''' create table "tmp_hbase_to_pg"( data text, timestamp float(24) ) ''' pg_db...
# # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. # Use of this file is governed by the BSD 3-clause license that # can be found in the LICENSE.txt file in the project root. # # # A {@link Token} object representing an entire subtree matched by a parser # rule; e.g., {@code <expr>}. These tokens are ...