src stringlengths 721 1.04M |
|---|
"""
Author: Elias Bakken
email: elias(dot)bakken(at)gmail(dot)com
Website: http://www.thing-printer.com
License: GNU GPL v3: http://www.gnu.org/copyleft/gpl.html
Redeem 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 Foun... |
class Solution:
# @param obstacleGrid, a list of lists of integers
# @return an integer
# [[0 for j in range(len(obstacleGrid[i]))]
# for i in range(len(obstacleGrid))]
# F[i][j] = F[i-1][j] + F[i][j-1], F[i][j] if i <0 or j < 0 or
def uniquePathsWithObstacles(self, obstacleGrid):
r... |
# -*- coding: utf-8 -*-
"""
flask.ext.security.registerable
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Flask-Security registerable module
:copyright: (c) 2012 by Matt Wright.
:license: MIT, see LICENSE for more details.
"""
from flask import current_app as app
from werkzeug.local import LocalProxy
from .co... |
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import _, fields, models
_STATES = [
("draft", _("Draft")),
("analysis", _("Analysis")),
("pending", _("Action Plan")),
("open", _("In Progress")),
... |
#
# Copyright 2013 Red Hat, Inc.
# Cole Robinson <crobinso@redhat.com>
#
# 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.... |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
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/local/bin/python3
# -*- coding: utf-8 -*-
'''
geetest offline 6.0.0 spider for gd.gsxt.org.cn
'''
import os
import time
import random
import logging
from logging import NullHandler
import json
import requests
import execjs
from bs4 import BeautifulSoup
import constants
import util
logging... |
import math
from schedule import Schedule
def parseSolutions(solutions, plant, orderList):
parsedSolutions = []
for solution in solutions:
solutionItems = solution.items()
schedule = Schedule()
for item in solutionItems:
if "enter" in item[0]:
parsedItem = item[0].split("-")
order = orderList.orderF... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Fernando Hidalgo (http://www.hidalgofernando.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
## begin license ##
#
# "Meresco Harvester" consists of two subsystems, namely an OAI-harvester and
# a web-control panel.
# "Meresco Harvester" is originally called "Sahara" and was developed for
# SURFnet by:
# Seek You Too B.V. (CQ2) http://www.cq2.nl
#
# Copyright (C) 2006-2007 SURFnet B.V. http://www.surfnet.nl
# ... |
"""
Illustrate different ways of using the various fill functions.
"""
import numpy as np
import matplotlib.pyplot as plt
import example_utils
def main():
fig, axes = example_utils.setup_axes()
fill_example(axes[0])
fill_between_example(axes[1])
stackplot_example(axes[2])
example_utils.title(fig... |
#----------------------------------------------------------------------
# Purpose: This test compares k-means centers between H2O and MLlib.
#----------------------------------------------------------------------
import sys
sys.path.insert(1, "../../")
import h2o
import numpy as np
def kmeans_mllib(ip, port):
h2... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
"""Basic unittests for the server resource control operations."""
from __future__ import absolute_import
from functools import partial
from six.moves import http_client
from django.contrib.auth.models import User
from django.test import Client, TransactionTestCase
from rotest.management.models import DemoComplexReso... |
'''
Validate if a given string is numeric.
Some examples:
"0" => true
" 0.1 " => true
"abc" => false
"1 a" => false
"2e10" => true
Note: It is intended for the problem statement to be ambiguous. You should gather all requirements up front before implementing one.
'''
class Solution(object):
def isNumber(self, s):... |
"""
.. module:: release_status
The **Release Status** is one of:
1. Official
2. Promotion
3. Bootleg
4. Pseudo-Release
The Release Status is referenced by the Release model. Read more at the
`Release documentation on MusicBrainz`_.
.. _Release documentation on MusicBrainz: https://musicbrainz.org/doc/Release
Postr... |
"""Nice small extensions that maybe will it make to Blocks at some point."""
from __future__ import print_function
import subprocess
import pkgutil
import math
from theano.scan_module.scan_op import Scan
from blocks.extensions import TrainingExtension, SimpleExtension
class CGStatistics(SimpleExtension):
def __... |
# Modified based on Phatch
#---PIL modules import
from shadow import fill_background_color, generate_layer, \
remove_alpha, has_transparency, get_alpha, paste
from PIL import Image
#from reflection import HTMLColorToRGBA
FILL_CHOICES = ('Color', 'Image')
def background(image, fill, mark, color,
horizonta... |
from collections import deque
import threading
import time
from functional import dummy
from functional.networkTests import IP_ADDRESS, IP_CIDR
from vdsm.netlink import monitor
from vdsm.sysctl import is_disabled_ipv6
from vdsm.utils import monotonic_time
from testValidation import ValidateRunningAsRoot
from testlib ... |
from enum import IntEnum
class Message(dict):
class Type(IntEnum):
Plain = 0x00001
Notice = 0x00002
Action = 0x00004
Nick = 0x00008
Mode = 0x00010
Join = 0x00020
Part = 0x00040
Quit = 0x00080
Kick = 0x00... |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... |
# Copyright 2015-2016 Yelp 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 agreed to in writin... |
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
import csv
import io
from tastypie.serializers import Serializer
import string
class CsvSerializer(Serializer):
formats = ['json', 'xml', 'csv']
content_types = {
'json': 'application/json',
... |
# -*- coding: utf-8 -*-
#
# Copyright 2015-2020 BigML
#
# 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
# -*- coding: utf-8 -*-
# libavg - Media Playback Engine.
# Copyright (C) 2010-2021 Ulrich von Zadow
#
# 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
# vers... |
from django.shortcuts import render, redirect
from django.conf import settings
from common.views import AbsReferenceSelection
from common.views import AbsSegmentSelection
#from common.views import AbsTargetSelection
from common.views import AbsTargetSelectionTable
# from common.alignment_SITE_NAME import Alignment
Ali... |
"""Event handler to backup the server.
This file is part of MiSMaP.
MiSMaP 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.
MiSMaP is distr... |
# -*- encoding: utf-8 -*-
import unittest
from treetaggerwrapper import Tag
from strephit.classification import feature_extractors
class TestFactExtractorFeatureExtractor(unittest.TestCase):
def setUp(self):
self.gazetteer = {
'sentence': ['feature1', 'feature2']
}
self.sent... |
import asyncio
import sys
from toolbot.adapter import Adapter
from toolbot.message import TextMessage
class ShellAdapter(Adapter):
def __init__(self, bot):
super().__init__(bot)
def send(self, envelope, *strings):
for string in strings:
# TODO: async print?
print("\x... |
import json
from abc import ABCMeta
from collections import defaultdict
from django.template.loader import render_to_string
from django.utils.encoding import force_str
from django.utils.functional import Promise
from cms.constants import RIGHT, LEFT, REFRESH_PAGE, URL_CHANGE
class ItemSearchResult:
def __init__... |
# -*- coding: utf-8 -*-
#
# ADCpy documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 07 11:54:34 2014.
#
# 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... |
import reversion
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from crm_core.models import (UserExtension, Customer, Invoice, PurchaseOrder,
Quote, Supplie... |
# coding=utf-8
"""Tests for engine."""
import unittest
import cPickle
import numpy
import sys
import os
from os.path import join
# Import InaSAFE modules
from safe.engine.core import calculate_impact
from safe.engine.interpolation import (
interpolate_polygon_raster,
interpolate_raster_vector_points,
assig... |
# How to update the database schema
# 1. Create a new function that takes a sqlite3 db connection as an argument.
# 2. Have the function update schema and increase the user version, preferrably in a transaction
# 3. Put your function in the upgrade dict in check(). Its key is the schema version it is upgrading from.
#... |
# Django settings for example project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
import os
import sys
APP = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
PROJ_ROOT = os.path.abspath(os.path.dirname(__file__))
sys.path.append(APP)
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
D... |
# dictionary just like remap in linux
# 3 ways to define dictionary
dictionary_1 = {"wm": "me", "hlh": "ok"}
dictionary_2 = dict((("wm", "me"), ("hlh", "ok")))
dictionary_3 = dict(wm="me", hlh='ok')
print(type(dictionary_1), list(dictionary_1), dictionary_1)
print(type(dictionary_2), list(dictionary_2), dictionary_2... |
# Copyright 2019 DeepMind Technologies Limited. 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 ... |
"""Forms to render HTML input & validate request data."""
from wtforms import Form, BooleanField, DateTimeField, PasswordField
from wtforms import TextAreaField, TextField
from wtforms.validators import Length, required
class AppointmentForm(Form):
"""Render HTML input for Appointment model & validate submission... |
# This file is part of the GOsa project.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
"""
The *MQTTClientService* is responsible for connecting the *client* to the MQTT
bus, registers the ... |
import pyroms
# Part of Arctic2 grid containing the Beaufort
irange=(420,580)
jrange=(470,570)
#irange=None
#jrange=None
srcgrd = pyroms.grid.get_ROMS_grid('ARCTIC2')
dstgrd = pyroms.grid.get_ROMS_grid('BEAUFORT')
pyroms.remapping.make_remap_grid_file(srcgrd,irange=irange,jrange=jrange)
pyroms.remapping.make_remap_g... |
#-*- coding: utf-8 -*-
"""
PyShop Pyramid configuration helpers.
"""
from pyramid.interfaces import IBeforeRender
from pyramid.url import static_path, route_path
from pyramid.httpexceptions import HTTPNotFound
from pyramid_jinja2 import renderer_factory
from pyramid_rpc.xmlrpc import XMLRPCRenderer
from pyshop.helper... |
from .base_icann_compliant import BaseIcannCompliantParser
from ..record import Contact
from ..record import Registrar
from dateutil import parser as time_parser
class ZaCentralRegistryParser(BaseIcannCompliantParser):
@property
def domain_id(self):
return self.node('Domain ID')
@property
def... |
import wave,time
import wave,struct,numpy,numpy.fft
import scipy.signal#,matplotlib.pyplot
def read_wave(wavefilename):
wav = wave.open(wavefilename,'r')
fs = wav.getframerate()
sig = []
stime = 0
etime = 0
wavnframes = wav.getnframes()
sframe = int(stime * fs) ... |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, 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... |
import abjad
def test_mutate__split_container_by_duration_01():
"""
Split one container in score.
Adds tie after split.
"""
staff = abjad.Staff()
staff.append(abjad.Container("c'8 d'8"))
staff.append(abjad.Container("e'8 f'8"))
leaves = abjad.select(staff).leaves()
abjad.beam(leav... |
# -*- coding: utf-8 -*-
# Copyright © 2012-2021 Roberto Alsina and others.
# 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 t... |
import os.path
import json
from gii.core import *
from gii.qt.dialogs import requestString, alertMessage
from mock import _MOCK
##----------------------------------------------------------------##
class AnimatorDataCreator(AssetCreator):
def getAssetType( self ):
return 'animator_data'
def getLabel( self ):
... |
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may n... |
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
# ============================================================================
# Project Name : iTrade
# Module Name : itrade_wxoperations.py
#
# Description: wxPython portfolio operations screen
#
# The Original Code is iTrade code (http://itrade.sourceforge.... |
import modelx as mx
import pytest
@pytest.fixture
def refmode_model():
"""
A---B---C---foo <-+
| | |
| +---bar --+
D
"""
import modelx as mx
m = mx.new_model()
A = mx.new_space('A')
B = A.new_space('B')
C = B.new_space('C')
@mx.d... |
# Copyright 2011 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 agreed to in writing, ... |
# -*- coding: utf-8 -*-
# Copyright 2014, 2015 OpenMarket Ltd
#
# 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 -*-
"""
ReSTructured additional roles
"""
import os, re
from docutils import nodes, utils
from docutils.parsers.rst import roles
from django.conf import settings
from django.core.urlresolvers import reverse
from django.core.cache import cache
from django.contrib.sites.models import Site
from svee... |
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either... |
__author__ = 'noor'
from PySide.QtGui import (QDialog, QLabel, QIcon, QWidget, QVBoxLayout, QPushButton, QListWidget, QFont)
from PySide.QtCore import QRect
class managebkm(QDialog):
def __init__(self, parent=None):
super(managebkm, self).__init__(parent)
appicom = QIcon(":/icons/njnlogo.png")
self.setW... |
# -*- coding: utf-8 -*-a
import sys
import os.path
from PyQt4 import QtGui, QtCore
from controllers import *
from models import *
from global_functions import images_dir
class Window(QtGui.QMainWindow):
"""
Main window of the app.
"""
def __init__(self):
"""
Setup widgets.
... |
###############################################################################
##
## Copyright (C) 2014-2015, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... |
"""Tests for module ``robottelo.datafactory``."""
import itertools
import random
import six
import unittest2
from robottelo.config import settings
from robottelo.constants import STRING_TYPES
from robottelo.datafactory import (
generate_strings_list,
invalid_emails_list,
invalid_id_list,
invalid_names_... |
#encoding:utf-8
import word_util
import numpy as np
import codecs
def transform_wordseq_to_phrase_weighted(word_seq,word2vec_map,word_weighted_value = None,word_keys = None):
phrase_distributed = np.zeros(256)
word_freq = {}
for word in word_seq:
#print("0")
if not word_keys:
if ... |
"""
Help has buttons and menu items to open help, blog and forum pages in your primary browser.
"""
from __future__ import absolute_import
#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module.
import __init__
from... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2019-08-18 18:10
from __future__ import unicode_literals
import import_string
import chamber.models.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import is_core.contrib.background_export.models... |
# 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... |
# MenuTitle: Delete all non-Master layers
# -*- coding: utf-8 -*-
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
__doc__ = """
Goes through selected glyphs and deletes all glyph layers which are not a Master, Bracket or Brace layer.
"""
Font = Glyphs.font
sele... |
# Copyright 2013: 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 b... |
# VAE MLP for Fashion MNIST
# Code based on
# https://github.com/ageron/handson-ml2/blob/master/17_autoencoders_and_gans.ipynb
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import os
figdir = "../figures"
def save_fig(fname):
plt.tight_layout()
plt.savefig(os.path.join(figdir, ... |
from sqlite3 import IntegrityError
from controller.util import get_image_from_blob
from database_manager.friend_manager import MinimumFriendParameterException
from database_manager.util import ChumMeDBManager
from .friend_form import FriendForm
class UpdateFriendForm(FriendForm):
def __init__(self, friend, **kwar... |
#!/usr/bin/python
# Copyright (c) 2016-2021 Julien Peloton, Giulio Fabbian.
#
# This file is part of s4cmb
#
# 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
#... |
# -*- coding: utf-8 -*-
from openerp import fields, models
class partner_configuration(models.TransientModel):
_inherit = 'base.config.settings'
group_ref = fields.Boolean(
"Show Reference On Partners Tree View",
implied_group='partner_views_fields.group_ref',
)
group_user_id = fi... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import bisect
import itertools
import operator
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
class _BNode(object):
__slots__ = ["tree", "contents", "children"]
def __init__(self, tree, contents=None, children=None):
self.tree = tree
self... |
#
# Copyright (c) 2008--2016 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... |
import os
from contextlib import suppress
from flask import render_template_string
from flask_restx import Resource, Namespace
from helperFunctions.database import ConnectTo
from helperFunctions.fileSystem import get_src_dir
from storage.db_interface_frontend import FrontEndDbInterface
from web_interface.components.c... |
# Copyright (c) 2010 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 ... |
import hashlib
import random
from flask import Blueprint, request, jsonify
from flask_mail import Message
from sqlalchemy.exc import IntegrityError
from flask_security.utils import (
login_user as login, verify_and_update_password,
encrypt_password, logout_user as logout)
from mhn import db, mail
from... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... |
import json
import os
import collections
import itertools
class DCache(object):
"""
DCache keeps a cache of files in the folder tree for efficiency and emergency purposes.
"""
def __init__(self):
self.root = None
self.cached_file = None
self.files = None
... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2011 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... |
# -*- 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 'GroupMigration.hidden'
db.add_column('vkontakte_groups_groupstatmembers', 'hidden',
... |
import os
from django.test import TestCase
from django.core.files import File as DjangoFile
from filer.models.foldermodels import Folder
from filer.models.imagemodels import Image
from filer.models.clipboardmodels import Clipboard
from filer.admin.clipboardadmin import UploadImageFileForm
from filer.tests.helpers impo... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'schmidUI.ui'
#
# Created by: PyQt4 UI code generator 4.12.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
... |
#!/usr/bin/env python
import logging
import os
import re
import shutil
import stat
import subprocess
import sys
import tempfile
import unittest
from subprocess import Popen
from unittest import TestCase
import lief
from lief.ELF import Segment
from utils import get_sample, has_recent_glibc, is_linux, is_x86_64, is_aar... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Module: l10n_hr_fiskal
# Author: Davor Bojkić
# mail: bole@dajmi5.com
# Copyright (C) 2012- Daj Mi 5,
# http://www.dajmi5.com
# Co... |
import os, tempfile, pickle
from copy import deepcopy
class ModifyCache():
def __init__(self, fname):
self.f = fname
self.cache = ModifyCache.load(self.f)
self._cache = deepcopy(self.cache)
@staticmethod
def load(fname):
try:
f = os.path.join(tempfile.gettempdi... |
import mango.utils
from .Gaussian import *
import copy
import re
import sys
import scipy as sp
import numpy as np
import scipy.stats
from mango import mpi
try:
from mango.fmm._PwGaussianMixelMixtureModel import csvParsePgmmm
except:
csvParsePgmmm = None
logger, rootLogger = mpi.getLoggers(__name__)
class Mi... |
# coding=utf-8
#
#
# 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 writi... |
# coding: utf-8
# In[1]:
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from keras.layers import Input, Dense, Convolution2D, MaxPooling2D, UpSampling2D
from keras.models import Model
from keras.callbacks import TensorBoard
from keras.models import model_from_json
from keras.models import load_model
from keras i... |
import os, re, itertools
from base64 import b32decode
import simplejson
from twisted.trial import unittest
from twisted.internet import defer, address
from twisted.python import log
from foolscap.api import Tub, Referenceable, fireEventually, flushEventualQueue
from twisted.application import service
from allmydata.... |
import contextlib
import datetime
import sys
import types
import warnings
from freezegun import freeze_time
class ModuleWithWarning(object):
"""
A module that triggers warnings on attribute access.
This does not happen with regular modules, there has to be a bit of lazy
module magic going on in orde... |
#! /usr/bin/python
"""
Wordtrack (Griatch 2014)
Usage:
wordtrack.py start [days [wordgoal]] | plot | <wordcount>
A wordcount tracker that mimics the word-counting mechanism of
NaNoWriMo (www.nanowrimo.org). No code of theirs were used and this is
not in any way related or endorsed by nanowrimo. I just thought the... |
#!/usr/bin/env python
# This application is released under the GNU General Public License
# v3 (or, at your option, any later version). You can find the full
# text of the license under http://www.gnu.org/licenses/gpl.txt.
# By using, editing and/or distributing this software you agree to
# the terms and condition... |
from __future__ import absolute_import
from __future__ import print_function
#!/usr/bin/env python
import os
import sys
### START UPDATE SYS.PATH ###
### END UPDATE SYS.PATH ###
try:
from iocbio.optparse_gui import OptionParser
except ImportError:
from optparse import OptionParser
from fparser.script_options im... |
#!/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... |
#
# Copyright (C) 2006-2019 Nexedi SA
#
# 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 distributed... |
import inspect
from supriya.patterns.Pattern import Pattern
from supriya.patterns.RandomNumberGenerator import RandomNumberGenerator
class Pseed(Pattern):
### CLASS VARIABLES ###
__slots__ = ("_pattern", "_seed")
_file_path = __file__
### INITIALIZER ###
def __init__(self, pattern, seed=0):
... |
"""Learning rate scheduler utilities."""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
from resnet.utils import logger
log = logger.get()
class FixedLearnRateScheduler(object):
"""Adjusts learning rate according to a fixed schedule... |
#!/usr/bin/python
"""
ZincView example visualisation application using OpenCMISS-Zinc, python, Qt (PySide)
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
import os
impo... |
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
import unittest
import rx
from rx import operators as ops
from rx.scheduler import ImmediateScheduler
from rx.testing import TestScheduler, ReactiveTest
on_next = ReactiveTest.on_next
on_completed = ReactiveTest.on_completed
on_error = ReactiveTest.on_error
subscribe = ReactiveTest.subscribe
subscribed = ReactiveTest... |
#!/usr/bin/env python
"""Find GenBank records that the parser has problems with within a big file.
This is meant to make it easy to get accession numbers for records that
don't parse properly.
Usage:
find_parser_problems.py <GenBank file to parse>
"""
# standard library
from __future__ import print_function
import s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.