text
stringlengths
475
200k
import re from streamlink.compat import urljoin from streamlink.plugin import Plugin from streamlink.plugin.api import validate from streamlink.plugin.api.utils import parse_json from streamlink.stream import AkamaiHDStream, HLSStream _url_re = re.compile(r"http(s)?://(www\.)?livestream.com/") _stream_config_schema =...
""" Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path operations to manipul...
#!/usr/bin/env python # Copyright (c) 2013 Intel Corporation. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # pylint: disable=C0301 """The script is used to parse an XPK file. It will do: 1. Check the magic file header; 2. Verify the signatu...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
#!/bin/python import roomai.kuhn import roomai.common import random class HumanInputPlayer(roomai.common.AbstractPlayer): """ """ def receive_info(self, info): """ Args: info: """ available_actions = info def take_action(self): """ Returns: ...
############################################################################### # # The MIT License (MIT) # # Copyright (c) Crossbar.io Technologies GmbH # # 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 ...
""" Functions for working with "safe strings": strings that can be displayed safely without further escaping in HTML. Marking something as a "safe string" means that the producer of the string has already turned characters that should not be interpreted by the HTML engine (e.g. '<') into the appropriate entities. """ i...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe out = frappe.response from frappe.utils import cint import frappe.defaults def get_sql_tables(q): if q.find('WHERE') != -1: tl = q.split('FROM')[1].split('...
from __future__ import absolute_import, unicode_literals import hashlib import json import os from django.core.files.uploadedfile import UploadedFile from django.http import HttpResponse, HttpResponseServerError from .models import FileModel, UPLOAD_TO from .tests import UNICODE_FILENAME from .uploadhandler import Q...
# -*- coding: utf-8 -*- # ############################################################################# # # First author: Jose Ernesto Mendez <[EMAIL]> (Open Business Solutions SRL.) # Copyright (c) 2012 -TODAY Open Business Solutions, SRL. (http://obsdr.com). All rights reserved. # # This is a fork to upgrade to odoo ...
""" Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area. Example For example, given the following matrix: 1 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 0 0 1 0 Return 4. """ __author__ = 'Daniel' class Solution: def maxSquare(self, matrix): """ Algo...
# -*- coding: utf-8 -*- #/############################################################################# # # Tech-Receptives Solutions Pvt. Ltd. # Copyright (C) 2004-TODAY Tech-Receptives(<http://www.techreceptives.com>) # Special Credit and Thanks to Thymbra Latinoamericana S.A. # # This program is free sof...
from django.apps.registry import apps as global_apps from django.db import migrations, router from .exceptions import InvalidMigrationPlan from .loader import MigrationLoader from .recorder import MigrationRecorder from .state import ProjectState class MigrationExecutor: """ End-to-end migration execution - ...
# -*- coding: utf-8 -*- import collections import cStringIO import datetime import hashlib import json import itertools import logging import math import os import re import sys import textwrap import uuid from subprocess import Popen, PIPE from urlparse import urlparse import babel import babel.dates import werkzeug ...
import win32evtlog, traceback import win32api, win32con import win32security # To translate NT Sids to account names. from win32evtlogutil import * def ReadLog(computer, logType="Application", dumpEachRecord = 0): # read the entire log back. h=win32evtlog.OpenEventLog(computer, logType) numRecords = win32...
#!/usr/bin/env python # # Copyright 2011 Hunter Freyer and Michael Kelly # # 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...
import pandas as pd ''' The following code is to help you play with the concept of Series in Pandas. You can think of Series as an one-dimensional object that is similar to an array, list, or column in a database. By default, it will assign an index label to each item in the Series ranging from 0 to N, where N...
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
# Copyright 2018 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,...
# Copyright (C) 2005, 2006 Martin von Löwis # Licensed to PSF under a Contributor Agreement. # The bdist_wininst command proper # based on bdist_wininst """ Implements the bdist_msi command. """ import os import sys import warnings from distutils.core import Command from distutils.dir_util import remove_tree from dist...
'''Command line handlers that address the responses in the Google Sheet''' import logging import os from cliff.lister import Lister import seadir.config as config import seadir.model.responses as responses class Dump(Lister): '''Dump the records from the Google Sheet to the screen''' log = logging.getLogg...
import unittest import pickle from ctypes import * import _ctypes_test dll = CDLL(_ctypes_test.__file__) class X(Structure): _fields_ = [("a", c_int), ("b", c_double)] init_called = 0 def __init__(self, *args, **kw): X.init_called += 1 self.x = 42 class Y(X): _fields_ = [("str", c_char...
# coding: utf-8 # pylint: disable=missing-docstring, invalid-name import flask import auth import config import model from main import app dropbox_config = dict( access_token_method='POST', access_token_url='https://api.dropbox.com/1/oauth2/token', authorize_url='https://www.dropbox.com/...
# 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...
""" Python 'zlib_codec' Codec - zlib compression encoding Unlike most of the other codecs which target Unicode, this codec will return Python string objects for both encode and decode. Written by Marc-Andre Lemburg ([EMAIL]). """ import codecs import zlib # this codec needs the optional zlib module ! ##...
""" Machine learning module for Python ================================== sklearn is a Python module integrating classical machine learning algorithms in the tightly-knit world of scientific Python packages (numpy, scipy, matplotlib). It aims to provide simple and efficient solutions to learning problems that are acc...
__all__ = ['splrep', 'splprep', 'splev', 'splint', 'sproot', 'spalde', 'bisplrep', 'bisplev', 'insert', 'splder', 'splantider'] import warnings import numpy as np # These are in the API for fitpack even if not used in fitpack.py itself. from ._fitpack_impl import bisplrep, bisplev, dblint from . import _f...
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from io import BytesIO import logging import os import re import struct import sys from .compat import sysconfig, fsencode, detect_encoding, ...
# ----------------- # normal arguments (no keywords) # ----------------- def simple(a): return a simple(1) #! 6 type-error-too-few-arguments simple() #! 10 type-error-too-many-arguments simple(1, 2) #! 10 type-error-too-many-arguments simple(1, 2, 3) # ----------------- # keyword arguments # -----------------...
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ This module contains classes that help to emulate xcodebuild behavior on top of other build systems, such as make and ninja. """ import copy import gyp.common...
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Visual Studio project reader/writer.""" import gyp.common import gyp.easy_xml as easy_xml class Writer(object): """Visual Studio XML tool file writer.""" ...
""" database_example_formatted.py :copyright: (c) 2015 by C. W. :license: New BSD """ from flask import Flask, request, jsonify, redirect, url_for import flask_excel as excel from flask_sqlalchemy import SQLAlchemy from datetime import datetime # please uncomment the following line if you use pyexcel < 0.2.2 # import ...
from __future__ import unicode_literals from django.contrib.auth.models import User from django.core import management from django.test import TestCase from django.utils.six import StringIO from .models import ( Car, CarDriver, Driver, Group, Membership, Person, UserMembership, ) class M2MThroughTestCase(TestCa...
import os import sys import copy import subprocess WEB2PY_PATH = sys.argv[1] APP = sys.argv[2] changed_table = "org_organisation" new_field = "type_id" new_table = "org_organisation_type" old_field = "type" new_table_field = "name" os.chdir(WEB2PY_PATH) sys.path.append(WEB2PY_PATH) from gluon.custom_import import cu...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ def execute(filters=None): columns = get_columns() proj_details = get_project_details() pr_item_map = get_purchas...
#! /usr/bin/env python from state_ai import StateAi import rospy from math import pi from std_msgs.msg import Bool class IGVCBasicNorth(StateAi): def __init__(self): super(IGVCBasicNorth, self).__init__("igvc_basic_north") def on_start(self): #self.generate_circle(2.0, pi/4, 2 * pi - pi/4, ...
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...
#|############################################################################## #|Copyright (c) 2009, The Green-Span Project. All rights reserved. This code is #|Open Source Free Software - redistribution and use in source and binary forms, #|with or without modification, are permitted under the Two Clause BSD Li...
""" Send emails to users inviting them to add their course certificates to their LinkedIn profiles. """ from smtplib import SMTPServerDisconnected, SMTPDataError, SMTPConnectError, SMTPException import json import logging import urllib from boto.exception import AWSConnectionError from boto.ses.exceptions import ( ...
import pytest from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import TimeoutException, NoSuchElementException, NoAlertPresentException from .conftest import _make_nbserv...
import unittest from task_scheduler import TaskScheduler from task import Task import arrow class TaskSchedulerTestCase(unittest.TestCase): def setUp(self): self.task_scheduler = TaskScheduler() self.tz = 'local' self.datetime = arrow.Arrow(2015, 5, 9, 11, 11, 11, tzinfo=self.tz) s...
# # The Python Imaging Library. # $Id$ # # standard filters # # History: # 1995-11-27 fl Created # 2002-06-08 fl Added rank and mode filters # 2003-09-15 fl Fixed rank calculation in rank filter; added expand call # # Copyright (c) 1997-2003 by Secret Labs AB. # Copyright (c) 1995-2002 by Fredrik Lundh. # # See t...
#!/usr/bin/env python # # Copyright 2001-2002 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright n...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
data = ( 'A', # 0x00 'B', # 0x01 'C', # 0x02 'D', # 0x03 'E', # 0x04 'F', # 0x05 'G', # 0x06 'H', # 0x07 'I', # 0x08 'J', # 0x09 'K', # 0x0a 'L', # 0x0b 'M', # 0x0c 'N', # 0x0d 'O', # 0x0e 'P', # 0x0f 'Q', # 0x10 'R', # 0x11 'S', # 0x12 'T', # 0x13 'U', # 0...
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2012 Isaku Yamahata <yamahata at private email ne jp> # # 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 # # h...
import numpy as np import cv2 from matplotlib import pyplot as plt # test algorithm to recognize digits using kNN # source: http://docs.opencv.org/trunk/doc/py_tutorials/py_ml/py_knn/py_knn_opencv/py_knn_opencv.html img = cv2.imread('../data/digits.png') gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) # Now we split the...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2011-2014 Serpent Consulting Services (<http://www.serpentcs.com>) # # This program is f...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
# coding: utf-8 # PYTHON IMPORTS import os import re # DJANGO IMPORTS from django.core.management.base import BaseCommand, CommandError from django.conf import settings from django.utils.six.moves import input # FILEBROWSER IMPORTS from filebrowser.settings import EXTENSION_LIST, EXCLUDE, DIRECTORY, VERSIONS, EXTENS...
import json from social.tests.backends.oauth import OAuth2Test class StocktwitsOAuth2Test(OAuth2Test): backend_path = 'social.backends.stocktwits.StocktwitsOAuth2' user_data_url = 'https://api.stocktwits.com/api/2/account/verify.json' expected_username = 'foobar' access_token_body = json.dumps({ ...
# https://leetcode.com/problems/number-of-islands/ class Solution(object): def numIslands(self, grid): """ :type grid: List[List[str]] :rtype: int """ if len(grid) == 0: return 0 cols,rows = len(grid), len(grid[0]) def dfs(i, j): """ he...
# # # Copyright (C) 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 copyright notice, # this list of con...
#!/usr/bin/python # Copyright: (c) 2018, Pluribus Networks # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['...
""" Instructor Dashboard Views """ import logging import datetime from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey import uuid import pytz from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_POST from django.utils.translation imp...
# -*- coding: utf-8 -*- # Copyright (C) 2006 Joe Wreschnig # # This program is free software; you can redistribute it and/or modify # it under the terms of version 2 of the GNU General Public License as # published by the Free Software Foundation. """Easier access to ID3 tags. EasyID3 is a wrapper around mutagen.id...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import os import subprocess import tempfile import zipfile from lib.subcommand import SubCommand from lib.symbol import SymbolDataSources L...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
""" A directive for including a matplotlib plot in a Sphinx document. By default, in HTML output, `plot` will include a .png file with a link to a high-res .png and .pdf. In LaTeX output, it will include a .pdf. The source code for the plot may be included in one of three ways: 1. **A path to a source file** as t...
# # Copyright (C) 2006-2016 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...
#!/usr/bin/env python import sys import math from gnuradio import gr, gru, audio, eng_notation, blks2, optfir from gnuradio import usrp from gnuradio.eng_option import eng_option from optparse import OptionParser try: import cqpsk except: from tetra_demod import cqpsk # applies frequency translation, resampl...
#!/usr/bin/env python # Copyright 2014 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import os import sys from common_includes import * class Preparation(Step): MESSAGE = "Preparation." def RunS...
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ This module helps emulate Visual Studio 2008 behavior on top of other build systems, primarily ninja. """ import os import re import subprocess import sys fr...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
# # XCSoar Glide Computer - http://www.xcsoar.org/ # Copyright (C) 2000-2012 The XCSoar Project # A detailed list of copyright holders can be found in the file "AUTHORS". # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published ...
""" Face of a triangle mesh. """ 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 fabmetheus_utilities.geometry.geometry_tools import dictionary fro...
# chat_server.py import sys, socket, select HOST = '' SOCKET_LIST = [] RECV_BUFFER = 4096 PORT = 443 def chat_server(): server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) server_socket.bind((HOST, PORT)) server_soc...
#!/usr/bin/env python # Test whether a client sends a correct PUBLISH to a topic with QoS 2 and responds to a disconnect. import inspect import os import socket import sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder cmd_subfolder = os.path.realpath(os.path.abspath(os.path.jo...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.coverage', 'sphinx.ext.doctest', 'sphinx.ext.extlinks', 'sphinx.ext.ifconfig', 'sphinx.ext.napoleon', 'sphinx.ext.todo', 'sphinx.ext....
# -*- coding: utf-8 -*- import functools import openerp from openerp.http import Controller, route, request, Response def webservice(f): @functools.wraps(f) def wrap(*args, **kw): try: return f(*args, **kw) except Exception, e: return Response(response=str(e), status=500...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
#!/usr/bin/env python # Copyright 2015 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 appli...
""" Test contentstore.mongo functionality """ import logging from uuid import uuid4 import unittest import mimetypes from tempfile import mkdtemp import path import shutil from opaque_keys.edx.locator import CourseLocator, AssetLocator from opaque_keys.edx.keys import AssetKey from xmodule.tests import DATA_DIR from ...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
# -*- coding: utf-8 -*- # vim: set ts=4 # Copyright 2015 Rémi Duraffort # This file is part of DataTag. # # DataTag 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 #...
# -*- coding: utf-8 -*- """ *************************************************************************** sieve.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *********************************...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
from __future__ import absolute_import import datetime try: import pytz except ImportError: pytz = None from django.test import TestCase from django.test.utils import override_settings from django.utils import timezone from django.utils.unittest import skipIf from .models import Article, Comment, Category ...
#!/usr/bin/env python # # 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 # "...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
#!/usr/bin/env python # # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
#! /usr/bin/env python import ctypes from ctypes.util import find_library __author__ = 'Suresh Sundriyal' __license__ = 'CC0 - No rights reserved.' __version__ = '0.0.1' __credits__ = [ 'Joongi Kim: https://gist.github.com/achimnol/3021995', 'sqlite3.org: http://www.sqlite.org/backup.html' ] SQLITE_O...
# Copyright 2017 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
#!/usr/bin/env python # -*- coding: utf-8 -*- import upsidedown import sys from response import Response from pb_logging import PBLogger logger = PBLogger("Rage") # flips text using upsidedown module and has a donger for emohasis def run(response, args=[]): response_obj = Response(sys.modules[__name__]) toFli...
# -*- coding: utf-8 -*- ######################################################################## # # License: BSD # Created: December 17, 2004 # Author: Francesc Alted - [EMAIL] # # $Id$ # ######################################################################## """Declare exceptions and warnings that are specific to...
## Regression Plots from __future__ import print_function from statsmodels.compat import lzip import numpy as np import pandas as pd import matplotlib.pyplot as plt import statsmodels.api as sm from statsmodels.formula.api import ols ### Duncan's Prestige Dataset #### Load the Data # We can use a utility function...
# -*- mode: python -*- # Ansible is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Publ...
""" State Space Model Author: Chad Fulton License: Simplified-BSD """ from __future__ import division, absolute_import, print_function import numpy as np from .representation import Representation from .kalman_filter import KalmanFilter import statsmodels.tsa.base.tsa_model as tsbase class Model(KalmanFilter, Repr...
""" Modified version of build_scripts that handles building scripts from functions. """ from __future__ import division, absolute_import, print_function from distutils.command.build_scripts import build_scripts as old_build_scripts from numpy.distutils import log from numpy.distutils.misc_util import is_string class...
import random from twisted.internet import defer, endpoints, protocol, reactor from twisted.trial import unittest from p2pool import networks, p2p from p2pool.bitcoin import data as bitcoin_data from p2pool.util import deferral class Test(unittest.TestCase): @defer.inlineCallbacks def test_sharereq(self): ...
import os import re import imp import json class TweetProcessor: plugins = {} commands = {} base_path = os.path.dirname(os.path.realpath(__file__)) plugin_path = os.path.join(base_path, "plugins") def __init__(self): self.load_plugins() def load_plugins(self): """Loads plu...
# 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 ...
# Copyright 2014-2017 The ODL contributors # # This file is part of ODL. # # 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 https://mozilla.org/MPL/2.0/. """Partitons of interval products based on ...
class OrderedDict(dict): """ A dictionary that keeps its keys in the order in which they're inserted. Copied from Django's SortedDict with some modifications. """ def __new__(cls, *args, **kwargs): instance = super(OrderedDict, cls).__new__(cls, *args, **kwargs) instance.keyOrd...
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
# This 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 json from random import randint from dateutil.relativedelta import relativedelta from libmozdata import utils as...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# -*- coding: utf-8 -*- """ jinja2.nodes ~~~~~~~~~~~~ This module implements additional nodes derived from the ast base node. It also provides some node tree helper functions like `in_lineno` and `get_nodes` used by the parser and translator in order to normalize python and jinja nodes. :...
#!/usr/bin/python import os import subprocess import re def runCommand(command): p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) p.wait() return iter(p.stdout.readline, b'') def dumpRunCommand(command,...