text
stringlengths
12
6.59M
#!/usr/bin/env python2 # Copyright 2016 The Fontbakery 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 applica...
from __future__ import ( unicode_literals, absolute_import, print_function, division, ) import logging import sys import os import io import math import weakref from array import array from struct import Struct import struct from collections import deque from .utils import ( read_u8, read_u16...
import leancloud import cfg import constants as cons # class AppInfo(leancloud.Object): # pass class DBBase(object): def initialize_sdk(self): leancloud.init(cfg.get_app_id(), cfg.get_app_key()) print('DBBase init() -- called') class AppInfoHelper(DBBase): # AppInfo = leancloud.Object....
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from itertools import count ''' Problem 112 Working from left-to-right if no digit is exceeded by the digit to its left it is called an increasing number; for example, 134468. Similarly if no digit is exceeded by the digit to its right it is called a decreasing number; fo...
import os import pytest import tempfile import shutil import yaml from falafel.content.manager import ContentManager TEST_CONFIG = { "content_fields": ["resolution"], "metadata_fields": [ "product_code", "role", "rule_id", "error_key", "active", "playbooks" ], "interpolated_fields": []...
# pylint: disable=W0231,E1101 import warnings import operator import weakref import gc import numpy as np import pandas.lib as lib import pandas as pd from pandas.core.base import PandasObject from pandas.core.index import (Index, MultiIndex, _ensure_index, InvalidIndexError) import pan...
from itertools import groupby from operator import itemgetter import numpy from ..base import SearchAlgorithm from ..mo import argsortNondominated, dominates, hypervolume_indicator class CMAES(SearchAlgorithm): """Covariance Matrix Adaptation Evolution Strategy minimization method. A CMA-ES strategy that c...
#!/usr/bin/env python2 # Copyright 2016 The Fontbakery 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 applica...
# # spyne - Copyright (C) Spyne contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This libra...
import numpy as np from pandas.compat import zip from pandas.core.dtypes.generic import ABCSeries, ABCIndex from pandas.core.dtypes.missing import isna, notna from pandas.core.dtypes.common import ( is_bool_dtype, is_categorical_dtype, is_object_dtype, is_string_like, is_list_like, is_scalar, ...
# -*- coding: utf-8 -*- import argparse import importlib import os import sys os.environ['PYWIKIBOT_DIR'] = os.path.dirname(os.path.realpath(__file__)) import pywikibot sys.path.append('..') animeSite = (importlib.import_module('util.ani_gamer_com_tw_animeVideo', 'AniGamerComTwAnimeVideo') .AniGamerComT...
########################################################################## # # Copyright (c) 2007-2008, Image Engine Design 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: # # * Redis...
# -*- coding: utf-8 -*- import datetime import json import logging import os import re from ast import literal_eval import numpy as np import pandas as pd from fooltrader.consts import CHINA_STOCK_INDEX, USA_STOCK_INDEX from fooltrader.contract import data_contract from fooltrader.contract import files_contract from...
import urwid from wikicurses import formats, add_bookmark, remove_bookmark, get_bookmarks from wikicurses.wiki import wiki #TODO: Turn this into a class? class SearchBox(urwid.Edit): def keypress(self, size, key): if key != 'enter': return super().keypress(size, key) loop.widget = main...
import argparse import numpy as np from multiprocessing import cpu_count from data_io import write_fpt_and_params from firstpassage import fast_fp_times, fpt_histogram from params import Params def fpt_argparser(): parser = argparse.ArgumentParser(description='FPT data multiprocessing script') parser.add_arg...
''' Class for doing stuff with output from AccuRT. ''' import os import numpy as np import matplotlib.pyplot as plt import scipy.io as sio from scipy.ndimage.filters import gaussian_filter1d as gaussf class ReadART(object): '''Reads the output text files from AccuRT, and includes methods for calculating albed...
import re import hashlib, uuid from decimal import Decimal from django.db import models from django.utils.translation import ugettext, ugettext_lazy as _ from django.forms import widgets from django.core.mail import send_mail from django.conf import settings as django_settings from django.utils.datastructures import S...
from django import forms from django.conf import settings from django.core.mail import send_mail from django.db import models from django.db.models.fields import BLANK_CHOICE_DASH from django.template import RequestContext from django.template.loader import render_to_string from django.template.defaultfilters import sl...
from django import forms from django.conf import settings from django.core.mail import send_mail from django.db import models from django.db.models.fields import BLANK_CHOICE_DASH from django.template import RequestContext from django.template.loader import render_to_string from django.template.defaultfilters import sl...
import math from interval_utils import * import gui import random friendly_players=["Windfisch","windfisch","Cyanide","cyanide"] +\ ["Midna","Nayru","Farore","Din","Ezelo","Navi","Zelda","Tetra","Link","Ciela","Linebeck","Salia","Epona","Shiek"] +\ ["Vaati","Ganon","Ganondorf","Ghirahim","Agahnim"] class Stra...
import math from interval_utils import * import gui import random class Strategy: def __init__(self): self.target = (0,0) self.has_target = False self.target_cell = None self.color = (0,0,0) def process_frame(self,c): runaway = False my_smallest...
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2016, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
""" Generic support for objects with full-featured Parameters and messaging. """ import copy import re import sys import inspect import random from collections import namedtuple from operator import itemgetter,attrgetter from types import FunctionType from functools import partial, wraps, reduce import logging from ...
""" Generic support for objects with full-featured Parameters and messaging. $Id$ """ __version__='$Revision$' import sys import copy import re import __main__ from operator import itemgetter,attrgetter from types import FunctionType # JABALERT: Could consider using Python's logging facilities instead. SILENT = ...
# """ # Definitions of object schema # """ # DATASET_FIELDS = { # 'core': [ # 'author', 'author_email', 'license_id', 'maintainer', # 'maintainer_email', 'name', 'notes', 'owner_org', 'private', 'state', # 'type', 'url' # ], # 'cruft': [ # 'ckan_url', 'creator_user_id', 'iso...
import mimetypes import urlparse import os from logging import getLogger from pylons import config from ckan import plugins as p import ckan.lib.helpers as h try: from ckan.lib.datapreview import on_same_domain except ImportError: from ckan.lib.datapreview import _on_same_domain as on_same_domain log = get...
""" Easy delegation definition. A quick example: from forwardable import forwardable @forwardable() # Note the () here, which is required. class Foo(object): def_delegators('bar', ('add', '__len__')) def __init__(self) self.bar = set() foo = Foo() foo.add(1) # Delegat...
#!/usr/bin/env python3 # daemon98.py file post-processor. import configparser import os import subprocess import sys import syslog import time import traceback from libdaemon import Daemon from random import randrange as rnd # constants DEBUG = False IS_JOURNALD = os.path.isfile('/bin/journalctl') MYID ...
#!/usr/bin/env python import unittest import tempfile import os import commands import math import cmath import sys import re import testbase import absyn import ir import fsymbol from fracttypes import * import codegen import translate import fractparser import fractlexer import stdlib import optimize import instru...
# coding: utf-8 # Author: Allen Zou # 2017/4/15 下午10:07 __version__ = (0, 0, 3) from .sql import *
#!/usr/bin/python # -*- coding: utf-8 -*- import re from datetime import timedelta from decimal import Decimal from math import floor from .paperdoll import Paperdoll booleans = "gl" functions = ["cond", "eq", "floor", "max", "min"] macros = "FMRSabderfhimnoqrstuvxz" variables = ["pbhd", "spfi", "spfr", "bc2", "hnd...
#!/usr/bin/python # -*- coding: utf-8 -*- import re from datetime import timedelta from decimal import Decimal from math import ceil, floor from .paperdoll import Paperdoll def case_insensitive(lower): upper = [k.upper() for k in lower] lower.extend(upper) paperdolldict = { "ap": "ATTACK_POWER", "ar": "AR...
# -*- coding: utf-8 -*- import datetime import httplib as http from flask import request from modularodm import Q from modularodm.exceptions import NoResultsFound from modularodm.exceptions import ValidationValueError import framework.auth from framework.auth import cas, campaigns from framework import forms, statu...
#!/usr/bin/python import os import json import re import logging import traceback import urllib2 import neo4j_util as dbu log = logging.getLogger('rhizi') class DB_op(object): """ tx wrapped DB operation possibly composing multiple DB queries """ def __init__(self): self.s_id = 0 # statem...
# Copyright (C) 2015 Artem Chepurnoy <artemchep@gmail.com> # # This script is published under the terms of the MIT license. # See http://opensource.org/licenses/mit-license.php # Python 3 is required import itertools from sudoku import Clue class _Data: pass class _Ceil: def __init__(self, data): ...
#sys.path.append('./TL') import sys import types def imports(): for name, val in globals().items(): if isinstance(val, types.ModuleType): print val.__name__#yield val.__name__ class DUT: def __init__(self, config): self._transfer_layer = dict() self._hardware_layer =...
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the # following conditions are met: # # The software must be used only for Non-Commercial Use which mean...
# Copyright 2019 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/env python3 # Copyright (c) 2016-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test segwit transactions and blocks on P2P network.""" from test_framework.mininode import * from test...
import sys import numpy as np import re import time import json import matplotlib.pyplot as plt import math from datetime import date colors=['#D3132D', '#1527F5', '#1F76B4','#903864','#D61E28', '#C8C8C8', '#8C582D'] month = {'Jan':1,'Feb':2,'Mar':3,'Apr':4,'May':5,'Jun':6,'Jul':7,'Aug':8,'Sep':9,'Oct':10,'Nov':11,...
#!/usr/bin/env python3 # Copyright (c) 2016-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test segwit transactions and blocks on P2P network.""" from binascii import hexlify import math import ...
#!/usr/bin/env python """ Based on http://groups.google.com/group/dropio-api/web/full-api-documentation """ __author__ = 'jimmyorr@gmail.com (Jimmy Orr)' from StringIO import StringIO import urllib import urllib2 import simplejson as json from resource import Asset, Drop API_VERSION = '1.0' API_F...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 OpenStack, 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 r...
# -*- coding: utf-8 -*- # # Electrum - lightweight Bitcoin client # Copyright (C) 2016 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 witho...
from django.contrib import admin # Register your models here. from apps.predict.models import PredictDatasetStatus, PredictDataset,\ PredictDatasetNote, DatasetScriptRun,\ ScriptToRun, PipelineScriptsDirectory from apps.dropbox_helper.models import DropboxRetrievalLog from apps.predict.admin_f...
#!/usr/bin/env python # # Copyright (C) 2013 Matt Shirley # 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 # any later version. # This program is distribute...
""" App models """ import urllib import re import io from datetime import datetime from bs4 import BeautifulSoup from mongoengine import * from flask import render_template import nbformat from nbconvert.preprocessors import ExecutePreprocessor from nbconvert.preprocessors.execute import CellExecutionError from ...
#!/usr/bin/python # Copyright (c) 2012 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Library containing utility functions used for Chrome-specific build tasks. """ import functools import glob import logging im...
from ftw import ruleset, http, errors import pytest import sys def test_cookies1(): """Tests accessing a site that sets a cookie and then wants to resend the cookie""" http_ua = http.HttpUA() x = ruleset.Input(dest_addr="ieee.org",headers={"Host":"ieee.org"}) http_ua.send_request(x) with pytest.rai...
import os import re import datetime from vcs.backends.base import BaseRepository, BaseChangeset from vcs.exceptions import RepositoryError, ChangesetError from vcs.nodes import FileNode, DirNode, NodeKind, RootNode, RemovedFileNode from vcs.utils.paths import abspath from vcs.utils.lazy import LazyProperty from dulwi...
from .clients import vcstool_clients # noqa __version__ = '0.2.9'
#-*- coding: utf-8 -*- import os import logging import urllib try: import hashlib sha1 = hashlib.sha1 except ImportError: import sha sha1 = sha.new from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app as run from google.appengine.ext import db from google.a...
from datetime import datetime from requests import Session from django.contrib.gis.geos import Point from django.db.models import Q from django.core.cache import cache from django.db import transaction from django.utils import timezone from multidb.pinning import use_primary_db from busstops.models import DataSource, J...
# # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 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: # # 1. Redistributions of source code must retain the above copyri...
""" verktyg.request ~~~~~~~~~~~~~~~ The wrappers are simple request and response objects which you can subclass to do whatever you want them to do. The request object contains the information transmitted by the client (webbrowser) and the response object contains all the information sent back ...
''' Created on Aug 14, 2014 @author: David Zwicker <dzwicker@seas.harvard.edu> ''' from __future__ import division import sys import multiprocessing as mp import logging import numpy as np import cv2 try: import sharedmem except ImportError: sharedmem = None logger = logging.getLogger('v...
""" Copyright (c) 2021 Alex Forencich 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, copy, modify, merge, publish, distribute...
import numpy as np from scipy import interpolate, optimize import matplotlib.pyplot as plt import matplotlib from astropy import units, constants class TECBase(object): """ Base thermoelectron engine class This class provides the base API for subclasses which implement particular models of TEC electron t...
# Copyright 2015 ETH Zurich # # 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, sof...
import numpy as np from scipy import interpolate, optimize import matplotlib.pyplot as plt import matplotlib from astropy import units, constants class TECBase(object): """ Base thermoelectron engine class This class provides the base API for subclasses which implement particular models of TEC electron tr...
import datetime from django.core.exceptions import ValidationError from django.db.models.fields import IntegerField from django.forms.fields import CharField from django.utils.translation import ugettext_lazy as _ """ All credit for WorkingHoursFieldForm and WorkingHoursField go to http://charlesleifer.com/blog/writi...
# Copyright 2015 ETH Zurich # # 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, sof...
from pprint import pprint from django.db import connections from django.shortcuts import render from django.views import View from django.urls import reverse from utils.views import totalize_data, totalize_grouped_data from geral.functions import has_permission from . import forms from . import models def index(re...
# -*- coding: utf-8 -*- # # Copyright (c) 2018, the cclib development team # # This file is part of cclib (http://cclib.github.io) and is distributed under # the terms of the BSD 3-Clause License. """Test the various population analyses (MPA, LPA, CSPA) in cclib""" from __future__ import print_function im...
#!/usr/bin/env python3.5 ######################################################################################################################## # IMPORTS ######################################################################################################################## import argparse import glob import dicom...
#!/usr/bin/env python """ Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import codecs import contextlib import cookielib import copy import getpass import hashlib import httplib import inspect import json import logging import ntpath import os imp...
#!/usr/bin/env python """ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import codecs import contextlib import cookielib import copy import ctypes import httplib import inspect import logging import ntpath import os import pickle import posixpath ...
#!/usr/bin/env python """ $Id$ Copyright (c) 2006-2010 sqlmap developers (http://sqlmap.sourceforge.net/) See the file 'doc/COPYING' for copying permission """ import codecs import ctypes import inspect import os import random import re import socket import string import sys import time import urlparse import ntpath...
#!/usr/bin/env python """ Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import codecs import functools import os import re import tempfile import time import urlparse from lib.core.common import Backend from lib.core.common import getUnicode from...
import os import arrow import virtool.virus import virtool.virus_index import virtool.sample import virtool.organize_utils from virtool.user_permissions import PERMISSIONS from virtool.user_groups import merge_group_permissions async def organize_jobs(db): """ Unset deprecated fields ``_version`` and ``archi...
#! /usr/bin/env python # -*- coding:utf-8 -*- # # StereoVision application # # External dependencies import sys from PySide import QtGui import StereoVision as sv # Main application if __name__ == '__main__' : application = QtGui.QApplication( sys.argv ) widget = sv.VmbStereoVision() widget.show() sys.exit( appl...
#!/usr/bin/env python # -*- coding: utf-8 -*- """General configuration module""" from __future__ import with_statement import os import ConfigParser from . import assignments DATE_FORMAT = '%Y.%m.%d %H:%M:%S' class VmcheckerConfig: """An object that encapsulates parsing of the config file of a course""" ...
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/globocom/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com timehome@corp.globo.com import mimetypes import urllib from os.path import abspath, join, di...
# ###################################################################### # Copyright (c) 2014, Brookhaven Science Associates, Brookhaven # # National Laboratory. All rights reserved. # # # # Redistribution and use in ...
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2005-2010 (ita) """ Configuration system A :py:class:`waflib.Configure.ConfigurationContext` instance is created when ``waf configure`` is called, it is used to: * create data dictionaries (ConfigSet instances) * store the list of modules to import * hold config...
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2005-2010 (ita) "Module called for configuring, compiling and installing targets" import os, shutil, traceback, errno, sys, stat from waflib import Utils, Configure, Logs, Options, ConfigSet, Context, Errors, Build, Node build_dir_override = None no_climb_comma...
""" Theming template tags. To load the theming tags just do: ``{% load theming_tags %}``. """ from django import template from django.conf import settings from django.contrib.staticfiles.storage import staticfiles_storage register = template.Library() def render_theming_css(): """ Template tag that renders ...
import csv import datetime import glob import io import logging import os import subprocess import sys import psycopg2 import psycopg2.extensions logging.basicConfig(level=logging.INFO) log = logging.getLogger(__name__) class SQLRunner(object): def __init__(self, host='localhost', port='5432', dbname='postgres'...
import os import mysql.connector from mysql.connector import errorcode from db_connector import DBConnector from checksum_calculator import ChecksumCalculator from logger import Logger class ChecksumManager: """ Provides an interface to control checksum/filename pair table. Checksum Database Table +-...
#! /usr/bin/env python """ What this will do Based on the Python script template at https://github.com/BrianGallew/script_templates/blob/master/template.py """ import logging import logging.handlers import argparse LOGGER = logging.getLogger(__name__) OPTION_GROUP = argparse.Namespace() def setup_logging(): """...
#!/usr/bin/env python """ @package ion.services.mi.test.test_instrument_agent @file ion/services/mi/test_instrument_agent.py @author Edward Hunter @brief Test cases for R2 instrument agent. """ __author__ = 'Edward Hunter' __license__ = 'Apache 2.0' from pyon.public import log from nose.plugins.attrib import attr im...
import cerberus import copy import json import logging import os from string import Template import schema import pprint from models import Context from query import Query logger = logging.getLogger('grafanizer.template') class BaseTemplate(object): """ Base Template class. Actual templates should extend thi...
#!/usr/bin/env python2.6 #Copyright (C) 2009-2010 : # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # #This file is part of Shinken. # #Shinken 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 Fr...
import argparse import datetime import os from string import Template from utils import create_dir SUBSTITUTIONS = { "2.0": {"template_eol": "2001-06-22"}, "2.1": {"template_eol": "2002-04-08"}, "2.2": {"template_eol": "2003-05-30"}, "2.3": {"template_eol": "2008-03-11"}, "2.4": {"template_eol": "...
# # Copyright (C) 2009 The Android Open Source Project # # 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 la...
# -*- coding: utf-8 -*- import sys import json import yaml import argparse from time import time from time import sleep from config import validate_config from utils import usage, pseudorandom_long, java_string_hashcode from row_generator import RowGenerator from kafka import KafkaProducer def maxwell_message(databa...
"""Module specifying interface for publishing and receiving data in MCL. This module defines an interface for publishing and receiving data to network interfaces in MCL. This is done by providing abstract objects for broadcasting and listening for data. The following abstract objects are defined and ensure network int...
# Copyright 2015 Mirantis, Inc. # 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...
"""Stateful programmatic WWW navigation, after Perl's WWW::Mechanize. Copyright 2003-2005 John J. Lee <jjl@pobox.com> Copyright 2003 Andy Lester (original Perl code) This code is free software; you can redistribute it and/or modify it under the terms of the BSD License (see the file COPYING included with the distribu...
# -*- coding: UTF-8 -*- import os import json import sys from twisted.internet.protocol import Factory, Protocol from twisted.internet import reactor, ssl from twisted.application import internet, service from twisted.web import server, wsgi, static from twisted.python import threadpool, log from autobahn.twisted.webso...
#Crawls data from the Alexa API #This can be run as follows: # python -c "import alexa;alexa.crawl()" #It assumes that there's a folder called 'alexa_data' in the same directory import requests from codecs import open as copen from os import listdir from subprocess import call from datetime import datetime from xml....
from .data import DataProvider def get_data_provider_by_name(name, train_params): """Return required data provider class""" if name == 'UCF101': return DataProvider(**train_params) if name == 'MERL': return DataProvider(**train_params) if name == 'KTH': return DataProvider(**tra...
# -*- coding: utf-8 -*- import os import re import mpq from .db2 import DB2File from .dbc import DBCFile from .main import DBFile from .utils import getfilename, fopen def defaultBase(): # Try $MPQ_BASE_DIR, otherwise use ~/mpq/WoW/12911.direct/Data return os.environ.get("MPQ_BASE_DIR", os.path.join(os.path.expand...
from google.appengine.ext import db """ Used for aggregating data of various kinds. For example: Results of questionaries; Scores given to students; There are lots of reports that system should be able to generate. Calculating various averages, sums and medians on the fly could be quite resource ...
#!/usr/bin/env python3 import math import numpy import sys import matplotlib.pyplot as plt import scipy.stats as stats def point_estimates(samples): mean = numpy.mean(samples) var = numpy.var(samples) alpha = mean * mean / var beta = mean / var return alpha,beta def pdf(x, alpha, beta): retur...
""" Built-in pipeline """ import time import logging import logging.config import shutil import os import matplotlib matplotlib.use('Agg') # supress PCA unpickle userwarning # Cat: TODO: this is dangersous, may wish to fix the problem in cluster.py # import warnings # warnings.filterwarnings("ignore", category=UserWa...
#!/usr/bin/python from pymongo import MongoClient from random import randint client = MongoClient('mongodb://root:pacab12345@ds039484.mongolab.com:39484/uno-parking') json = client['uno-parking']['lots'].find()[0] for lot in json['lots']: for lane in lot['lanes']: availability = randint(0,lane['totalSpace']) l...
# -*- coding: utf-8 -*- """ License Copyright (C) 2014 YUNOHOST.ORG 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) a...
import os import uuid from datetime import datetime from couchdbkit.exceptions import ResourceNotFound from django.conf import settings from django.core.files.uploadedfile import UploadedFile from django.core.management import call_command from django.test import TestCase from django.test import override_settings fro...
# -*- coding: utf-8 -*- """ License Copyright (C) 2014 YUNOHOST.ORG 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) a...