text
stringlengths
475
200k
# -*- coding: utf-8 -*- ## ## ## This file is part of Indico. ## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN). ## ## Indico 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; eith...
# Copyright 2016 Google 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 applicable law or agree...
# Copyright (c) 2013 OpenStack Foundation # Copyright 2013, Nachi Ueno, NTT MCL, 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.ap...
# -*- coding: utf-8 -*- """ Copyright (C) 2010 Dariusz Suchojad <dsuch at zato.io> Licensed under LGPLv3, see LICENSE.txt for terms and conditions. """ from __future__ import absolute_import, division, print_function, unicode_literals # stdlib import logging # Zato from zato.admin.web.forms import ChangePasswordFo...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2014-2016 GEM Foundation # # OpenQuake 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 Licen...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations def create_homepage(apps, schema_editor): # Get models ContentType = apps.get_model('contenttypes.ContentType') Page = apps.get_model('wagtailcore.Page') Site = apps.get_model('wagtailcore.Site') Home...
"""Core connection objects""" import ast import sys import collections import copy import logging import math import numbers import platform import warnings if sys.version_info > (3,): import urllib.parse as urlparse # pylint: disable=E0611,F0401 else: import urlparse from pika import __version__ from pika i...
from __future__ import absolute_import, print_function from pyximport import pyximport; pyximport.install(reload_support=True) import os, sys import time, shutil import tempfile def make_tempdir(): tempdir = os.path.join(tempfile.gettempdir(), "pyrex_temp") if os.path.exists(tempdir): remove_tempdir...
"""Unit tests for contextlib.py, and other context managers.""" import sys import tempfile import unittest from contextlib import * # Tests __all__ from test import test_support try: import threading except ImportError: threading = None class ContextManagerTestCase(unittest.TestCase): def test_contextm...
# Copyright (c) 2012 NTT DOCOMO, INC. # Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "Lic...
""" ==================== Breadth-first search ==================== Basic algorithms for breadth-first searching. """ __author__ = """\n""".join(['Aric Hagberg <[EMAIL]>']) __all__ = ['bfs_edges', 'bfs_tree', 'bfs_predecessors', 'bfs_successors'] import networkx as nx from collections import defaultdict ...
#A set of model vector visualization tools. #Each visualizer should be a subclass of VisVector, which is an abstract class. #If a visualizer is added, it should be added to the if statement in #VisVectorFactory. Each new class should follow the nameing convention #XVisVector, where X is the string that gets passed to ...
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + from...
"""Routines related to PyPI, indexes""" from __future__ import absolute_import import logging import cgi from collections import namedtuple import itertools import sys import os import re import mimetypes import posixpath import warnings from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._vendor....
from __future__ import unicode_literals from django import http from django.apps import apps from django.contrib.contenttypes.models import ContentType from django.contrib.sites.requests import RequestSite from django.core.exceptions import ObjectDoesNotExist from django.utils.translation import ugettext as _ def sh...
# Copyright (C) 2012 Google, Inc. # # 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 conditions and the following disclaimer...
# -*- 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...
#!/usr/bin/env python2 import sys # check input parameters, generate INDATA list # code placed here to avoid unneccesary vtk loading if len(sys.argv) == 1 : sys.stderr.write('Using standard data set, to use other data:\n'.format(sys.argv[0])) sys.stderr.write('Usage: {0} <pdb file> <connection file> |<protna...
"""Support for interface with a Sony Bravia TV.""" import ipaddress import logging from getmac import get_mac_address import voluptuous as vol from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA from homeassistant.components.media_player.const import ( SUPPORT_NEXT_TRACK, SUPP...
import dbus from dbus.mainloop.glib import DBusGMainLoop as DBusMainLoop from json import dumps, loads from calendar import timegm from hamster.lib import datetime as dt from hamster.lib.fact import Fact """D-Bus communication utilities.""" # file layout: functions sorted in alphabetical order, # not taking into ac...
# -*- coding: utf-8 -*- import os # noqa from dateutil.parser import parse as dateparse from flask import request from website import models from website.project.decorators import must_be_valid_project from website.project.decorators import must_not_be_registration from website.project.decorators import must_have_a...
from flask import Flask from flask_bootstrap import Bootstrap from flask_mail import Mail from flask_moment import Moment from flask_sqlalchemy import SQLAlchemy from config import config # 导入配置 from flask_login import LoginManager from flask_pagedown import PageDown # 初始化flask-login login_manager = LoginManager() #...
""" node for 2 conv's paired together, which allows more flexible combinations of filter size and padding - specifically even filter sizes can have "same" padding """ import numpy as np import theano import theano.tensor as T import treeano import treeano.nodes as tn import canopy fX = theano.config.floatX @treeano...
# -*- coding: utf-8 -*- """ werkzeug.contrib.cache ~~~~~~~~~~~~~~~~~~~~~~ The main problem with dynamic Web sites is, well, they're dynamic. Each time a user requests a page, the webserver executes a lot of code, queries the database, renders templates until the visitor gets the page he sees. ...
"""Tests for binary operators on subtypes of built-in types.""" import unittest from test import test_support def gcd(a, b): """Greatest common divisor using Euclid's algorithm.""" while a: a, b = b%a, a return b def isint(x): """Test whether an object is an instance of int or long.""" re...
import numpy as np class WordClusters(object): def __init__(self, vocab, clusters): self.vocab = vocab self.clusters = clusters def ix(self, word): """ Returns the index on self.vocab and self.clusters for 'word' """ temp = np.where(self.vocab == word)[0] ...
""" media-storage : compression =========================== Offers efficient handlers for compressing and decompressing data, using file-like objects (often tempfiles). This module is shared by every Python facet of the media-storage project and changes to one instance should be reflected in all. Usage ----- (De)co...
#!/usr/bin/python import gearman def check_request_status(job_request): if job_request.complete: print "Job %s finished! Result: %s - %s" % (job_request.job.unique, job_request.state, job_request.result) elif job_request.timed_out: print "Job %s timed out!" % job_request.unique elif job_r...
from __future__ import absolute_import import logging import warnings from pip.basecommand import Command from pip.exceptions import CommandError from pip.index import PackageFinder from pip.utils import ( get_installed_distributions, dist_is_editable) from pip.utils.deprecation import RemovedInPip10Warning from ...
#!/usr/bin/env python3 # -*- mode: python; indent-tabs-mode: nil; tab-width: 2 -*- """ mct_to_mfcdump.py - Converts a dump from MIFARE Classic Tool to mfoc/mfcuk .mfc format (raw data) Copyright 2015-2018 Michael Farrell <[EMAIL]> This program is free software: you can redistribute it and/or modify it under the terms...
# Copyright (c) 2012-2014, GPy authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) import numpy as np from ..core import GP from ..models import GPLVM from ..mappings import * class BCGPLVM(GPLVM): """ Back constrained Gaussian Process Latent Variable Model :param Y: ...
"""This file contains code used in "Think DSP", by Allen B. Downey, available from greenteapress.com Copyright 2013 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ import array import math import numpy import random import scipy import scipy.stats import struct import subprocess import thi...
# Copyright (C) 2016 A10 Networks 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 requi...
"""Tests to ensure that the html5lib tree builder generates good trees.""" import warnings try: from bs4.builder import HTML5TreeBuilder HTML5LIB_PRESENT = True except ImportError, e: HTML5LIB_PRESENT = False from bs4.element import SoupStrainer from bs4.testing import ( HTML5TreeBuilderSmokeTest, ...
# -*- 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...
#!/usr/bin/python # TODO: issues with new oauth2 stuff. Keep using older version of Python for now. # #!/usr/bin/env python from participantCollection import ParticipantCollection import string import re import datetime import pyperclip # Edit Me! # Remember, this is during signup, so current month is not March, it'...
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Presubmit script for Chromium JS resources. See chrome/browser/resources/PRESUBMIT.py """ class JSChecker(object): def __init__(self, input_api, o...
# # (c) 2017 Michael Tinning # # 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) import json from copy import deepcopy import pytest from ansible.module_utils._text import to_bytes from ansible.module_utils...
""" Routines for manipulating RFC2047 encoded words. This is currently a package-private API, but will be considered for promotion to a public API if there is demand. """ # An ecoded word looks like this: # # =?charset[*lang]?cte?encoded_string?= # # for more information about charset see the charset module. ...
""" Load pp, plot and save """ import os, sys import matplotlib matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from matplotlib import rc from matplotlib.font_manager import FontProperties from matplotlib import rcParams from mpl_toolkits.basemap import Basemap rc('font', family = '...
""" Cisco_IOS_XE_environment_oper This module contains a collection of YANG definitions for monitoring Environment of a Network Element.Copyright (c) 2016\-2017 by Cisco Systems, Inc.All rights reserved. """ import re import collections from enum import Enum from ydk.types import Empty, YList, YLeafList, DELETE,...
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. from __future__ import print_function import time import re from six.moves.urllib.parse import quote import requests import logging from tweepy.error import TweepError, RateLimitError, is_rate_limit_error_message from tweepy.utils import co...
""" Utils for video bumper """ import copy import json import pytz import logging from collections import OrderedDict from datetime import datetime, timedelta from django.conf import settings from .video_utils import set_query_parameter try: import edxval.api as edxval_api except ImportError: edxval_api = No...
from model.group import Group from timeit import timeit from model.group_address import Address_data from test.test_string_value import merge_emails from test.test_string_value import merge_phones_like_on_homepage #def test_group_list(app, db): # print(timeit(lambda: app.group.get_group_list(), number=1)) # def ...
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2017 SML 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...
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate() mobi...
# -*- coding: utf-8 -*- """ pygments.lexers.hdl ~~~~~~~~~~~~~~~~~~~ Lexers for hardware descriptor languages. :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, include, using, t...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import nipype.pipeline.engine as pe import nipype.interfaces.fsl as fsl import nipype.interfaces.freesurfer as fs import nipype.interfaces.meshfix as mf import nipype.interfaces.io as nio import nipype.in...
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( smuggle_url, update_url_query, ) class FoxSportsIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?foxsports\.com/(?:[^/]+/)*(?P<id>[^/]+)' _TEST = { 'url': 'http://www.foxsports.com/tennessee/v...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_str, ) from ..utils import ( int_or_none, ExtractorError, ) class VubeIE(InfoExtractor): IE_NAME = 'vube' IE_DESC = 'Vube.com' _VALID_URL = r'https?://vube\.com/(?:[^/]+/)+(?P<id...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Bill Time on Tasks', 'version': '1.0', 'category': 'Project Management', 'description': """ Synchronization of project task work entries with timesheet entries. ================================...
# Copyright (C) 2014 Andrey Antukh <[EMAIL]> # Copyright (C) 2014 Jesús Espino <[EMAIL]> # Copyright (C) 2014 David Barragán <[EMAIL]> # 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, eith...
# 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...
""" Storing files according to a custom storage system ``FileField`` and its variations can take a ``storage`` argument to specify how and where files should be stored. """ import random import tempfile from django.core.files.storage import FileSystemStorage from django.db import models class CustomValidNameStorag...
"""Sparse Dtype""" import re from typing import TYPE_CHECKING, Any, List, Optional, Tuple, Type import warnings import numpy as np from pandas._typing import Dtype, DtypeObj from pandas.errors import PerformanceWarning from pandas.core.dtypes.base import ExtensionDtype, register_extension_dtype from pandas.core.dty...
# Copyright 2012 Nebula, 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 applicable law o...
from __future__ import unicode_literals import threading import time from multiple_database.routers import TestRouter from django.db import DatabaseError, connection, router, transaction from django.test import ( TransactionTestCase, override_settings, skipIfDBFeature, skipUnlessDBFeature, ) from .models im...
import random lane_num = 2 lane = [[], []] max_car_num = 10000 road_len = 1000 h = 6 p_b = 0.94 p_0 = 0.5 p_d = 0.1 v_max = [6, 10] gap = 7 p_car = 1 p_crash = 0 time_period = 200 class Car: car_cnt = 0 def __init__(self, v = 1, lane = 1): self.size = 1 if random.random() < 0.1: ...
"""Append module search paths for third-party packages to sys.path. **************************************************************** * This module is automatically imported during initialization. * **************************************************************** In earlier versions of Python (up to 1.5a3), scripts or...
#!/usr/bin/env python """ Python Character Mapping Codec for ROT13. See http://ucsub.colorado.edu/~kominek/rot13/ for details. Written by Marc-Andre Lemburg ([EMAIL]). """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return ...
"""Test module for the noddy examples Noddy 1: >>> import noddy >>> n1 = noddy.Noddy() >>> n2 = noddy.Noddy() >>> del n1 >>> del n2 Noddy 2 >>> import noddy2 >>> n1 = noddy2.Noddy('jim', 'fulton', 42) >>> n1.first 'jim' >>> n1.last 'fulton' >>> n1.number 42 >>> n1.name() 'jim fulton' >>> n1.first = 'will' >>> n1.n...
import os import menu_main import fr_functions import cfg # ================================= # SERVICES MENU # ================================= def view_services(): os.system('clear') print("\n\nService".ljust(40) + " Price") print("="*60) for n in cfg.SERVICES: print("| " + str(n)....
#! /usr/bin/python # -*- encoding: utf-8 -*- import sys import os import commands import datetime def post_dingtalk(msg): print('sending dingtalk message.....') os.system("curl %s -H 'Content-Type: application/json' \ -d '{\"msgtype\": \"text\",\"text\": {\"content\": \" %s \"}}'"%(dingtalk_url, msg))...
#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 thi...
# -*- coding: utf-8 -*- import copy import datetime import mock import pytest import elastalert.alerts import elastalert.ruletypes from elastalert.config import get_file_paths from elastalert.config import load_configuration from elastalert.config import load_options from elastalert.config import load_rules from elas...
#!/usr/bin/env python3 """ Copyright 2017 Andris Zbitkovskis 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 a...
# -*- 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...
# # 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...
from django.views.generic import TemplateView, DetailView from django.utils.translation import ugettext as _ from common.permissions import PermissionsMixin, IsValidUser from .models import Ticket from . import mixins class TicketListView(PermissionsMixin, TemplateView): template_name = 'tickets/ticket_list.html...
# -*- coding: utf-8 -*- """ This module offers timezone implementations subclassing the abstract :py:`datetime.tzinfo` type. There are classes to handle tzfile format files (usually are in :file:`/etc/localtime`, :file:`/usr/share/zoneinfo`, etc), TZ environment string (in all known formats), given ranges (with help fr...
from __future__ import unicode_literals import os from optparse import make_option from django.core.management.base import LabelCommand from django.utils.encoding import smart_text from django.contrib.staticfiles import finders class Command(LabelCommand): help = "Finds the absolute paths for the given static fi...
#!/usr/bin/python3 ############################################################################### # # # Pakfire - The IPFire package management system # # Copyright (C) 2011 Pakfire development team ...
#!/usr/bin/env python3 # Tool to discover 'smells' in the Discogs data via the API. It downloads # release data and flags releases that need to be fixed. # # The checks are (nearly) identical to cleanup-discogs.py # # The results that are printed by this script are by no means complete # or accurate. # # Licensed unde...
# -*- 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...
#!/usr/bin/env python # # Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
__author__ = 'Michael Isik' from pybrain.supervised.evolino.gpopulation import Population, SimplePopulation from pybrain.supervised.evolino.gfilter import Randomization from pybrain.supervised.evolino.individual import EvolinoIndividual, EvolinoSubIndividual from pybrain.tools.kwargsprocessor import KWArgsProcessor ...
import cPickle as pickle import numpy as np import os from scipy.misc import imread def load_CIFAR_batch(filename): """ load single batch of cifar """ with open(filename, 'rb') as f: datadict = pickle.load(f) X = datadict['data'] Y = datadict['labels'] X = X.reshape(10000, 3, 3...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import frappe import json import copy from frappe import throw, _ from frappe.utils import flt, cint from frappe.model.docume...
# -*- coding: utf-8 -*- # # # Copyright 2013 Netflix, 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 ...
class Solution: # @param words, a list of strings # @param L, an integer # @return a list of strings def fullJustify(self, words, L): result = [] length = len(words) i = 0 c = 0 sublength =0 sub = [] while i < length: lc = len(words[i...
""" Django Views for service status app """ import json import time from django.http import HttpResponse from dogapi import dog_stats_api from service_status import tasks from djcelery import celery from celery.exceptions import TimeoutError def index(_): """ An empty view """ return HttpResponse(...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Liran Nisanov <[EMAIL]> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA = {'metadata_version': ...
#!/usr/bin/python -u # # imports the API description and fills up a database with # name relevance to modules, functions or web pages # # Operation needed: # ================= # # install mysqld, the python wrappers for mysql and libxml2, start mysqld # Change the root passwd of mysql: # mysqladmin -u root password ...
"""Extended file operations available in POSIX. f = posixfile.open(filename, [mode, [bufsize]]) will create a new posixfile object f = posixfile.fileopen(fileobject) will create a posixfile object from a builtin file object f.file() will return the original builtin file object f.dup() ...
#!/usr/bin/env python # # Copyright 2006, 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...
# Copyright (c) 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. """Downloads items from the Chromium continuous archive.""" import os import platform import urllib import util CHROME_27_REVISION = '190466' CHROME_2...
import types import functools from pip._vendor.requests.adapters import HTTPAdapter from .controller import CacheController from .cache import DictCache from .filewrapper import CallbackFileWrapper class CacheControlAdapter(HTTPAdapter): invalidating_methods = set(['PUT', 'DELETE']) def __init__(self, cach...
Experiment(description='Trying to recreate old results using latest code', data_dir='../data/radio/', max_depth=4, random_order=False, k=1, debug=False, local_computation=False, n_rand=9, sd=2, jitter_sd=0.1, ...
""" ACE parser From wotsit.org and the SDK header (bitflags) Partial study of a new block type (5) I've called "new_recovery", as its syntax is very close to the former one (of type 2). Status: can only read totally file and header blocks. Author: Christophe Gisquet <[EMAIL]> Creation date: 19 january 2006 """ from...
"""Base Command class, and related routines""" import os import socket import sys import tempfile import traceback import time import optparse from pip.log import logger from pip.download import urlopen from pip.exceptions import (BadCommand, InstallationError, UninstallationError, Command...
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ Requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> ...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import unittest import frappe import frappe.defaults from frappe.utils import flt, add_days, nowdate from erpnext.buying.doctype.purchase_order.purchase...
""" Classes implementing logic related to the analytical computation of the KL divergence between :math:`q_\\phi(\\mathbf{z} \\mid \\mathbf{x})` and :math:`p_\\theta(\\mathbf{z})` in the VAE framework """ __authors__ = "Vincent Dumoulin" __copyright__ = "Copyright 2014, Universite de Montreal" __credits__ = ["Vincent D...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2013 Daniel Reis # # 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...
""" ===================== SGD: Weighted samples ===================== Plot decision function of a weighted dataset, where the size of points is proportional to its weight. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn import linear_model # we create 20 points np.random.seed(0) X ...
# Copyright (c) 2015 Openstack Foundation # # 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 ...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # 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', ...
"""Cython.Distutils.build_ext Implements a version of the Distutils 'build_ext' command, for building Cython extension modules.""" # This module should be kept compatible with Python 2.3. __revision__ = "$Id:$" import sys import os import re from distutils.core import Command from distutils.errors import DistutilsP...
#!/usr/bin/env python from __future__ import print_function import redis import time import signal import argparse import sys import os # if PAPARAZZI_SRC not set, then assume the tree containing this # file is a reasonable substitute PPRZ_SRC = os.getenv("PAPARAZZI_SRC", os.path.normpath(os.path.join(os.path.dirnam...