text
stringlengths
475
200k
import django.dispatch # # Signals sent by Orders # #: Sent when an order is about to be cancelled and asks listeners if they allow #: to do so. #: #: By default, orders in states 'Shipped', 'Completed' and 'Cancelled' are not #: allowed to be cancelled. The default verdict is stored in #: ``order.is_cancellable`` fl...
# Copyright 2015 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. from __future__ import print_function import logging import os import time from telemetry.testing import tab_test_case from telemetry import decorators im...
from sympy.external import import_module from sympy.utilities.decorator import doctest_depends_on from sympy.functions.elementary.integers import floor, frac from sympy.functions import (log, sin, cos, tan, cot, csc, sec, sqrt, erf, gamma, uppergamma, polygamma, digamma, loggamma, factorial, zeta, LambertW) from sy...
# 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.utils import flt, nowdate import frappe.defaults from frappe.model.document import Document class Bin(Document): def before_...
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import sys import unittest import re _non_local = {'patched': False} def patch(): if not sys.version_info < (2, 7): return if _non_local['patched']: return unittest.TestCase.assertIsInst...
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
#!/usr/bin/env python import npyscreen import curses #npyscreen.disableColor() class BeepForm(npyscreen.ActionForm): def create(self, *args, **keywords): super(BeepForm, self).create(*args, **keywords) #self.keypress_timeout = 10 def while_waiting(self): curses.beep() ...
import os.path import sys import unittest POSSIBLE_TEST_BINARIES = [ 'libreadline.so.5', 'libreadline.so.6', ] POSSIBLE_TEST_BINARY_PATHS = [ '/usr/lib/debug', '/lib', '/usr/lib', '/usr/local/lib', '/lib/i386-linux-gnu', ] class TestBase(unittest.TestCase): if sys.version_info.major ...
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis import tool as tool import numpy as np from sklearn.externals import joblib SIZE = 828 IMAGE_SIZE = 224 NUM_CHANNEL = 1 LABEL = 6 BASE_DIVIDE = 128 ACCELERATION_FACTOR = 256 FEATURE = 5 FILENAME = "/home/elvis/work/ML/tensorflow/separa/check.txt" ut...
# -*- coding: utf-8 -*- """Tests for the C{pywikibot.tools.formatter} module.""" # # (C) Pywikibot team, 2015-2018 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, division, unicode_literals from pywikibot.tools import formatter from pywikibot.tools import UnicodeMixin fro...
# Natural Language Toolkit: Glue Semantics # # Author: Dan Garrette <[EMAIL]> # # Copyright (C) 2001-2013 NLTK Project # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT from __future__ import print_function, division, unicode_literals import os import nltk from nltk.internals import Counter fro...
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101 # Smartsheet Python SDK. # # Copyright 2018 Smartsheet.com, 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....
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 # see LICENSE file (it's BSD) import datetime class IncomingMessage(object): def __init__(self, device, sender, sent, text): # move the arguments into "private" attrs, # to try to prevent from from being modified self._device = device ...
class graph: def __init__(self, num_vertices): self.num_vertices = num_vertices self.adj_list = [[] for _ in xrange(num_vertices)] def add_edge(self, source, destination): self.adj_list[source].append(destination) def dfs(self, start): visited = [False] * self.num_vertices stack_vertex = []...
import os, sys, math import cPickle as pickle import argparse import numpy as np from sklearn.naive_bayes import BernoulliNB from sklearn.metrics import accuracy_score from util.log import _logger from util import * front = None def test(X, y): _logger.info("Fisrt stage accuracy: %f" % front.score(X, y)) impo...
################################ # These variables are overwritten by Zenoss when the ZenPack is exported # or saved. Do not modify them directly here. NAME = "ZenPacks.Nova.Cisco.Catalyst" VERSION = "1.0" AUTHOR = "Ryan Matte" LICENSE = "LGPL" NAMESPACE_PACKAGES = ['ZenPacks', 'ZenPacks.Nova', 'ZenPacks.Nova.Cisco'] ...
""" Ridership vs. Temp Correlation """ import pickle import matplotlib.pyplot as plt from numpy import linspace from pylab import * #load weather data from weather_collection import WeatherDatum weather = pickle.load(open('weatherDataFile', 'rb')) #load hubway data hubway = pickle.load(open('LargeDataStorage/hubwayD...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2014, Timothy Vandenbrande <[EMAIL]> # Copyright: (c) 2017, Artem Zinenko <[EMAIL]> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['pre...
# -*- coding: utf-8 -*- ''' Cobbler Pillar ============== A pillar module to pull data from Cobbler via its API into the pillar dictionary. Configuring the Cobbler ext_pillar ================================== The same cobbler.* parameters are used for both the Cobbler tops and Cobbler pillar modules. .. code-block...
from datetime import datetime from io import StringIO from unittest import mock from django.contrib.auth.models import User from django.core.management import call_command from django.test import TestCase from mainapp.models import UserAlert, UserProfile from mainapp.tests.live.helper import MockMainappSearch class...
import pytest from cobbler import enums from cobbler.api import CobblerAPI from cobbler.items.system import NetworkInterface, System from tests.conftest import does_not_raise def test_object_creation(): # Arrange test_api = CobblerAPI() # Act system = System(test_api) # Arrange assert isins...
# This file is part of SEALEVEL - a tool to estimates future sea-level rise # constrained by past obervations and long-term sea-level commitment # Copyright (C) 2016 Matthias Mengel working at PIK Potsdam # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Pub...
# This file is part of Indico. # Copyright (C) 2002 - 2016 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; either version 3 of the # License, or (a...
from __future__ import absolute_import from __future__ import print_function import types from .use_gpu_numpy import use_gpu_numpy from future.utils import iteritems if use_gpu_numpy(): print("Using GPU-supporting numpy wrapper") import gpu_numpy as np else: import numpy as np import warnings from autogr...
# 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...
# Copyright (C) 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND NOMIN...
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Oakcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test decoding scripts via decodescript RPC command.""" from test_framework.test_framework import Oakco...
#!/usr/bin/env python # # Copyright 2007 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...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- '''网络爬虫主体''' import urllib.request #网络模块 import re #正则表达式模块 import codecs #文件编码转换 import chardet #检测网页编码模块 import sys, time, json def print_list(the_list): """格式化输出列表(非嵌套) """ if len(the_list) == 0: print('') e...
# Copyright 2015 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 agr...
#!/usr/bin/env python #Note: taken from inkscape/extensions/simpletransform.py (with minor changes) ''' Copyright (C) 2006 Jean-Francois Barraud, [EMAIL] 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 Fo...
import os from cStringIO import StringIO from django.conf import settings from django.core.urlresolvers import reverse from django.test import override_settings from dju_image.tools import (get_relative_path_from_img_id, clear_profile_configs_cache, ERROR_MESSAGES as TOOLS_ERRORS) from dju_...
# 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...
# coding: utf-8 # # Copyright 2013 Red Hat, 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 # # ...
# Copyright 2014 PerfKitBenchmarker 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 appli...
# Copyright 2011 Akretion Sébastien BEAU <[EMAIL]> # Copyright 2013 Camptocamp SA (author: Guewen Baconnier) # Copyright 2016 Sodexis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import api, fields, models class SaleWorkflowProcess(models.Model): """ A workflow process is the setup o...
"""This script uses sample data from a YAML to file to test the Benchmarking template. It creates an output HTML file at the path: output/sample.html. """ import yaml import os from jinja2 import Template from jinja2 import Environment, FileSystemLoader, select_autoescape import numpy as np def is_blank(val): try...
from django.views.generic import View from django.utils.translation import get_language from django.db.models import Q from localwiki.utils.models import MultiQuerySet from regions.models import Region from regions.views import RegionListView from blog.models import Post class SplashPageView(RegionListView): tem...
""" 0 - 0 1 - 1 2 - 10 3 - 11 4 - 100 5 - 101 6 - 110 7 - 111 8 - 1000 9 - 1001 10 - 1010 11 - 1011 12 - 1100 13 - 1101 14 - 1110 15 - 1111 2^0 = 1 + 0 = 1 2^1 = 2 + 1 = 3 2^2 = 4 + 3 = 7 2^3 = 8 + 7 = 15 2^4 = 16 + 15 = 31 2^5 = 32 + 31 = 63 2^6 = 64 + 63 = 127 2^7 = 128 + 127 = 255 2^8 = 256 + 255 = 511 2^9 = 512 + ...
# Copyright 2007 Casey Durfee # Copyright 2007 Gabriel Farrell # # This file is part of Kochief. # # Kochief 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 opti...
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------- # Name: sfp_stor_db # Purpose: SpiderFoot plug-in for storing events to the local SpiderFoot # SQLite database. # # Author: Steve Micallef <[EMAIL]> # # Created: 14/05/20...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
#!/usr/bin/env python # coding: utf-8 import os import sys import time import httplib import unittest import threading sys.path.append('.') import argparse import marionette_tg.conf def execute(cmd): os.system(cmd) def exec_download(): client_ip = marionette_tg.conf.get("client.client_ip") conn = htt...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Nebula, 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 # # ...
#!/usr/bin/env python # Copyright 2010-2014 RethinkDB, all rights reserved. import sys """This script is used to generate the mailbox templates in `rethinkdb/src/rpc/mailbox/typed.hpp`. It is meant to be run as follows (assuming that the current directory is `rethinkdb/src/`): $ ../scripts/generate_rpc_templates.py >...
# # This file is part of the PyMeasure package. # # Copyright (c) 2013-2021 PyMeasure Developers # # 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 limit...
#!/usr/bin/env python3 # NOTE: this example requires PyAudio because it uses the Microphone class import speech_recognition as sr # this is called from the background thread def callback(recognizer, audio): # received audio data, now we'll recognize it using Google Speech Recognition try: # for testi...
# Catverbs - A portable Catalan conjugation reference for Android # Copyright (C) 2014 Neil Roberts # # 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; version 2 of the License. # # This program ...
#!/usr/bin/env python import argparse import os import re import cv2 # Parse command-line arguments def options(): parser = argparse.ArgumentParser(description="Resize images") parser.add_argument("-d", "--directory", help="directory to run script over.") parser.add_argument("-o", "--outdir", help="out d...
""" cells.py class to store cell geometry information """ import numpy as np class cells(object): def __init__(self, nx, ny=1, xmin=-0.5, xmax=0.5, ymin=-0.5, ymax=0.5, Nghosts=4): """ Class containing the information regarding the set up of the grid. Parameters ---------- ...
#!/usr/bin/python # # Copyright 2014 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 b...
# Copyright 2017 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...
# Copyright 2011 David Malcolm <[EMAIL]> # Copyright 2011 Red Hat, Inc. # # This 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 ver...
import logging import numpy logger = logging.getLogger("Optimize Finance") APPORT = 102000 PTZ = 75600 PROJET_1 = 276895 PROJET_2 = 265702 def calcul_pas_schedule_1(pas_fix = 99295.0, taux = 2.2, during = 25.0): result = 0 taux = taux / 100.0 # result = p * X / Y index = numpy.array([0.0] * (during + ...
#!/usr/bin/env python # Author : Pierre Schnizer from . import _callback class _workspace: _alloc = None _free = None def __init__(self, size): self._ptr = None assert(self._alloc != None) assert(self._free != None) self._ptr = self._alloc(size) def __del__(se...
# 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 ...
import os import sys import pyowm sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))) from bot_platform import Bot, Intent, Domain owm = pyowm.OWM('21625a9142b94184eabcb93aeb3c7ef9') training_data = { "Weather": { 'getWeather': { 'required_entities': ['LOCATION'], 'ex...
import sys sys.path.insert(0, '..') import ObjectWeb class MainPage(object): def GET(self): ObjectWeb.status("200 OK") return "PASS" def POST(self): ObjectWeb.status("200 OK") return "REDIRECT PASS" class RedirectHandler(object): def GET(self): ObjectWeb.seeoth...
# -*- 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 writing, ...
"""Base class for all tests""" import logging import os import sys import StringIO import unittest import urllib2 from email import message_from_string, message_from_file # add src to PYTHONPATH sys.path.append(os.path.join(os.path.abspath('.'), '..')) import cssutils PY2x = sys.version_info < (3,0) def msg3x(msg...
############################################################################### #cyn.in is an open source Collaborative Knowledge Management Appliance that #enables teams to seamlessly work together on files, documents and content in #a secure central environment. # #cyn.in v2 an open source appliance is distribut...
from django.contrib.auth.models import Group from django.http import Http404 from django.test import TestCase from hs_core import hydroshare from hs_core.testing import MockIRODSTestCaseMixin class TestResolveDOIAPI(MockIRODSTestCaseMixin, TestCase): def setUp(self): super(TestResolveDOIAPI, self).setUp(...
# Copyright (c) 2014 Mirantis 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 writ...
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
#!/usr/bin/env python2.7 # -*- mode: python; coding: utf-8; -*- ''' Created on 03.01.2015 @author: Andreas Peldszus ''' import os import numpy as np from sklearn.pipeline import Pipeline from sklearn.feature_extraction import DictVectorizer from sklearn.feature_selection import VarianceThreshold from sklearn.cross...
#!/usr/bin/env python import unittest from powl import actiontype from powl import exception from powl import parser class ActionItemParserTest(unittest.TestCase): def setUp(self): self.parser = parser.ActionItemParser() def test__parse__bodycomposition__key_is_b(self): """ Test with ...
"""Provides a Track class for the Project CARS Replay Enhancer. Notes ----- Way too many thanks to mrbelowski, who made much of the data publicly available through his CrewChief app, preventing me from having to reinvent the wheel. https://github.com/mrbelowski/CrewChiefV4/ """ import os from json import l...
from distutils.core import setup import py2exe import os, sys #Build tree of files given a dir (for appending to py2exe data_files) def add_path_tree( base_path, path, skip_dirs=[ '.svn', '.git' ]): path = os.path.join( base_path, path ) partial_data_files = [] for root, dirs, files in os.walk( os.pa...
# META: timeout=long import pytest from webdriver.transport import Response from tests.support.asserts import assert_error, assert_same_element, assert_success from tests.support.inline import inline def find_element(session, element_id, using, value): return session.transport.send( "POST", "session/{se...
# -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 # # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com). # All rights reserved. # This file may be distributed and/or modified under the terms of # the GNU General Public License version 2 as published by # the Free ...
#!/usr/bin/python """ Google AJAX Search Module http://code.google.com/apis/ajaxsearch/documentation/reference.html Needs Python 2.6 or later """ try: import json except ImportError,e: import simplejson as json except ImportError,e: print e exit() import sys import urllib import logging import argparse...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated Tue Oct 28 21:10:09 2014 by generateDS.py version 2.12e. # # Command line options: # ('-o', 'schema/vchs/ondemand/sc/sc/bindingType.py') # # Command line arguments: # schema/vchs/ondemand/sc/sc/binding.xsd # # Command line: # ./generateDS-2.12e/generate...
from .util import Zaj4askChecker, Zaj41TestSuite __author__ = 'jb' class TaskChecker(Zaj4askChecker): task_no = 202 display_stdout = False class TestSuite(Zaj41TestSuite): def test_move_praca_dyplomowa(self): original = list(self.session.execute(""" SELECT pd.tytul, pd.type, s.name...
# # FRETBursts - A single-molecule FRET burst analysis toolkit. # # Copyright (C) 2017 Antonino Ingargiola <[EMAIL]> # """ Unit tests for Burst, Bursts, BurstGap, BurstsGap. Running the tests requires `py.test`. """ from __future__ import division from builtins import range, zip import numpy as np import pytest fro...
"""Tests for the data module.""" from datetime import datetime import os import mock import shutil import pytest @pytest.fixture def zip_path(): return os.path.join( "tests", "datasets", "test_export.zip" ) class TestReplayState(object): @pytest.fixture def cleanup(self): ...
# -*- coding: utf-8 -*- # ********************************************************************* # lewis - a library for creating hardware device simulators # Copyright (C) 2016-2017 European Spallation Source ERIC # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU G...
''' Copyright 2013 Sven Reissmann <[EMAIL]> This file is part of ddserver. ddserver is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ...
import os import tensorflow as tf slim = tf.contrib.slim _FILE_PATTERN = '%s-*' _ITEMS_TO_DESCRIPTIONS = { 'image': 'A color image of varying height and width.', 'object/bbox': 'A list of bounding boxes.', } _DOMAINS_TO_SIZES = { 'clothes': 13652, 'models': 11243, } def get_dataset(domain_name, d...
#!/usr/bin/env python #signif reference to http://pastebin.com/k87sfiEf import sys import math import signal import time import os import math, random import numpy as np from numpy import linalg from PIL import Image #interface stuff from PyQt4 import QtCore, QtGui, QtOpenGL import pyqtgraph as pg #comms stuff i...
from Components.Converter.Converter import Converter from Components.Element import cached from Components.config import config from Components.NimManager import nimmanager class FrontendInfo(Converter, object): BER = 0 SNR = 1 AGC = 2 LOCK = 3 SNRdB = 4 SLOT_NUMBER = 5 TUNER_TYPE = 6 STRING = 7 def __init__...
#!/usr/bin/python ###################################################################### # # File: kafka_to_mysql.py # # Copyright 2015 TiVo Inc. All Rights Reserved. # ###################################################################### """ Usage: kafka_to_mysql.py <kafka_topic> <kafka_broker> <mysql-ip> <mysql-port...
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Copyright © 2012-2015 Umang Varma <[EMAIL]> # # This file is part of indicator-stickynotes. # # indicator-stickynotes 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 Found...
# Copyright 2015-2017 F-Secure # 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/python # -*- coding: utf-8 -*- """ Script de comprobación de entrega de ejercicio Para ejecutarlo, desde la shell: $ python check.py login_github """ import os import random import sys ejercicio = 'X-Serv-15.6-Django-CMS_PUT' student_projname = 'myproject' student_appname = 'cms_put' student_files = ...
#!/usr/bin/env python # # GrovePi Example for using the Grove Electricity Sensor (http://www.seeedstudio.com/wiki/Grove_-_Electricity_Sensor) # # The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi # # Have a question about this examp...
#!/usr/bin/env python """ Plots the RHS evaluations per timestep for the B-scan. """ import pickle import matplotlib.pylab as plt import os, sys # If we add to sys.path, then it must be an absolute path commonDir = os.path.abspath("./../../../common") # Sys path is a list of system paths sys.path.append(commonDir) ...
# Copyright 2016 Tesora, 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 ...
from itertools import combinations import numpy as np from pyparsing import alphas, Combine, Literal, Optional, nums, Word from pgmpy.models import BayesianModel, MarkovModel from pgmpy.factors.discrete import TabularCPD, DiscreteFactor from pgmpy.extern.six.moves import map, range class UAIReader(object): """...
from __future__ import print_function import itertools import os import numpy as np import sys from datetime import date, datetime from time import time from .jpllib import SpiceKernel from .timelib import Timescale, julian_date today = date.today try: from fcntl import LOCK_EX, LOCK_UN, lockf except: lockf ...
from django.shortcuts import redirect class RedirectFirstSubpageMiddleware(object): def __init__(self, get_response): self.get_response = get_response # One-time configuration and initialization. def __call__(self, request): # Code to be executed for each request before # the...
from __future__ import print_function import sys from galgebra.printer import Format, xpdf Format() from sympy import symbols, sin, pi, latex, Array, permutedims from galgebra.ga import Ga print(r'\bm{\mbox{Base manifold (three dimensional)}}') print(r'\bm{\mbox{Metric tensor (cartesian coordinates - norm = False)}}'...
# pylint: disable-msg=W0611, W0612, W0511 """Tests suite for MaskedArray. Adapted from the original test_ma by Pierre Gerard-Marchant :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu :version: $Id: test_extras.py 3473 2007-10-29 15:18:13Z jarrod.millman $ """ from __future__ import division, absolute...
""" Tutorial: File upload and download Uploads ------- When a client uploads a file to a CherryPy application, it's placed on disk immediately. CherryPy will pass it to your exposed method as an argument (see "myFile" below); that arg will have a "file" attribute, which is a handle to the temporary uploaded file. If...
# Lint as: python2, python3 # 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 # ...
# Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Module for full text index record builder.""" import ggrc.models.all_models from ggrc.models.reflection import AttributeInfo from ggrc.fulltext import Record class RecordBuilder(object): """Basic rec...
import numpy class DisentagledHalfOneHotDatasetGenerator(object): def __init__(self, size_of_dataset, no_of_scales=2, no_of_rotations=4, no_of_patches=64, no_of_objects=10, rng=None): if rng is not None: self.rng = rng else: ...
#!/usr/bin/python # # Copyright: Ansible Project # 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': ['preview'], ...
""" Copyright (c) 2017, Jairus Martin. Distributed under the terms of the MIT License. The full license is in the file LICENSE, distributed with this software. Created on May 20, 2017 @author: jrm """ from atom.api import Typed, set_default from enamlnative.widgets.checkbox import ProxyCheckBox from .android_comp...
# Copyright 2019 The MLIR 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 wri...