gt
stringclasses
1 value
context
stringlengths
2.49k
119k
#!/usr/bin/env python """Pathspecs are methods of specifying the path on the client. The GRR client has a number of drivers to virtualize access to different objects to create a Virtual File System (VFS) abstraction. These are called 'VFS Handlers' and they provide typical file-like operations (e.g. read, seek, tell a...
# -*- coding: utf-8 -*- """ pidSim2++.py A simulation of a vision control to steering PID loop accounting for communication and processing latency and variation; demonstrates the impact of variation to successful control. THIS VERSION models the control as a 1st order input (velocity) and then integrates once to get ...
""" A collection of NMR processing functions for filtering, smoothing, and correcting spectral baselines. """ import numpy as np import scipy import scipy.ndimage # Linear (First order) baseline correction def base(data,nl,nw=0): """ Linear (first-order) Baseline Correction based on node list. Param...
import os from tools_testcase import ToolTestCase, skipped from aql import Tempdir, Tempfile, Project, ProjectConfig # ============================================================================== class TestToolMsvc(ToolTestCase): def test_msvc_compiler(self): with Tempdir() as tmp_dir: ...
from test.test_support import run_unittest, verbose import unittest import locale import sys import codecs enUS_locale = None def get_enUS_locale(): global enUS_locale if sys.platform == 'darwin': import os tlocs = ("en_US.UTF-8", "en_US.ISO8859-1", "en_US") if int(os.uname()[2].split...
# Copyright 2016 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 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 writ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2016 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
# -*- coding: utf-8 -*- # # SelfTest/Hash/common.py: Common code for Cryptodome.SelfTest.Hash # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that ded...
# Copyright 2013 IBM Corp. # # 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 t...
# -*- coding: utf-8 -*- import copy from functools import wraps import json import sys from cms.utils.compat import DJANGO_1_7 import django from django.contrib.admin.helpers import AdminForm from django.conf import settings from django.conf.urls import url from django.contrib import admin, messages from django.contri...
from basic import Basic, Atom from core import C from sympify import sympify, _sympify, SympifyError from singleton import S, Singleton from expr import Expr, AtomicExpr from cache import cacheit from compatibility import any, all from function import FunctionClass from sympy.logic.boolalg import Boolean import re cl...
import pytest from datetime import date, time from chronophore import controller from chronophore.models import Entry UNREGISTERED_ID = '000000000' def test_signed_in_users(db_session, test_users): """List all signed in users. Don't list users who forgot to sign out on previous days.""" sam_id = test_use...
''' Work of Cameron Palk ''' import sys import pandas as pd import numpy as np import matplotlib.pyplot as plt from collections import Counter classes = [ 'NONE', 'SOUTHERN_US', 'FILIPINO', 'INDIAN', 'ITALIAN', 'MEXICAN', 'CHINESE', 'BRITISH', 'THAI', 'VIETNAMESE', 'CAJUN_CREOLE', 'B...
""" Files Pipeline """ import hashlib import os import os.path import rfc822 import time from six.moves.urllib.parse import urlparse from collections import defaultdict import six try: from cStringIO import StringIO as BytesIO except ImportError: from io import BytesIO from twisted.internet import defer, thr...
# # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicen...
import time from zope.interface import implementer from twisted.internet import defer from tensor.interfaces import ITensorSource from tensor.objects import Source from tensor.utils import fork from tensor.aggregators import Counter64 @implementer(ITensorSource) class LoadAverage(Source): """Reports system loa...
from django.contrib import admin from django.db.models.fields import FieldDoesNotExist from .models import ( Charge, CurrentSubscription, Customer, Event, EventProcessingException, Invoice, InvoiceItem, Transfer ) from .utils import get_user_model def user_search_fields(): User = ...
import numpy as np #todo: finish specifications #todo: add input checking (with ability to turn off) #todo: Cython implementation def sequential_rounding(rho, Z, C_0, compute_loss_from_scores_real, get_L0_penalty, objval_cutoff = float('Inf')): """ Parameters ---------- rho: ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2017-2020 The Project X-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC import re import argparse import jso...
from JumpScale import j import telegram import datetime from telegrambot.Repo import AYS_REPO_DIR # from JumpScale.baselib.atyourservice.robot.ActionRequest import * class RunMgmt(object): def __init__(self, bot): self.bot = bot self.rootpath = bot.rootpath self.callbacks = bot.question_c...
# Author: Pearu Peterson # Created: June 2010 __all__ = ['bytes2str', 'isindisk'] import os import optparse VERBOSE = False def isindisk(path): """ Return True if path is stored in a local disk. """ return os.major(os.stat(path).st_dev) in [3, # HD 8, # S...
import datetime try: import cPickle as pickle except ImportError: import pickle from django.db import models from django.db.models.query import QuerySet from django.conf import settings from django.core.mail import send_mail, EmailMultiAlternatives from django.core.urlresolvers import reverse from django.temp...
# Copyright (c) 2013 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 law or agreed to...
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import os import re from abc import ABC, ABCMeta, abstractmethod from dataclasses import dataclass from typing import ( TYPE_CHECKING, Dict, Iterable, Iterator, List, ...
# 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. """ Generator that produces an externs file for the Closure Compiler. Note: This is a work in progress, and generated externs may require tweaking. See https...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # king_phisher/client/graphs.py # # 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, th...
# 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. """Top-level presubmit script for Blink. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmi...
# smartmirror.py # requirements # requests, feedparser, traceback, Pillow from Tkinter import * import locale import threading import time import locale import requests import json import traceback import feedparser import serial import subprocess #checks if camera connected from time import sleep #from serial import ...
# Copyright 2018 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, ...
""" A collection of functions to simplfy common VSX operations. """ import logging import os import re from otto.lib.otypes import ReturnCode from otto.appliances.vsx import Vsx from otto.lib.decorators import wait_until instance = os.environ.get('instance') or '' logger = logging.getLogger('otto' + instance + '.lib'...
"""Demo platform for the cover component.""" from homeassistant.helpers.event import track_utc_time_change from homeassistant.components.cover import ( ATTR_POSITION, ATTR_TILT_POSITION, SUPPORT_CLOSE, SUPPORT_OPEN, CoverDevice, ) def setup_platform(hass, config, add_entities, discovery_info=None...
""" Pygam utilities """ from __future__ import division from copy import deepcopy import numbers import sys import warnings import scipy as sp from scipy import sparse import numpy as np from numpy.linalg import LinAlgError try: from sksparse.cholmod import cholesky as spcholesky from sksparse.test_cholmod impor...
#!/usr/bin/python # coding=utf-8 ################################################################################ from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch try: from cStringIO import StringIO except ImportError: ...
import json import io import pytest import GoogleSheets import os from googleapiclient.discovery import build from googleapiclient.http import HttpMock from googleapiclient.http import HttpMockSequence def util_load_json(path): with io.open(path, mode='r', encoding='utf-8') as f: return json.loads(f.read(...
# # Copyright (c) 2014 Tom Carroll # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, dis...
# Copyright 2022 The Brax 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...
class BSTNode(object): def __init__(self, key, value=None, left=None, right=None, parent=None): self.key = key self.value = value self.left = left self.right = right self.parent = parent def is_leaf(self): return self.has_any_children() is False def is_root...
# Copyright 2017 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 a...
""" CSV wrapper objects. """ import codecs import csv import io import os from .pyver import PY3 DEFAULT_CHARSET = "utf-8" CSV_CHARSET = "utf-8" def set_global_csv_field_size_limit(limit): """ Wrapper function. """ csv.field_size_limit(limit) def csv_open(file_name, mode, **kwargs): """ Wrapper func...
"""Utilities for writing code that runs on Python 2 and 3""" import operator import sys import types __author__ = "Benjamin Peterson <benjamin@python.org>" __version__ = "1.2.0" # True if we are running on Python 3. PY3 = sys.version_info[0] == 3 if PY3: string_types = str, integer_types = int, class_t...
# # Copyright 2014 Quantopian, 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 wr...
#!/usr/bin/python # # linearize-data.py: Construct a linear, no-fork version of the chain. # # Copyright (c) 2013-2014 The Flirtcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from __future__ import print_fun...
""" The ``zen.io.gml`` module (available as ``zen.gml``) supports the reading and writing network data in the `Graph Modeling Language (GML) <http://en.wikipedia.org/wiki/Graph_Modelling_Language>`_. At present only reading GML is supported. GML is a flexible language for specifying the structure of a network (nod...
""" Collection of views related to how talks and events in general are scheduled on barcamps. """ import datetime import collections import logging from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext from django.core.urlresolvers import reverse from django.http...
import imp import re from functools import partial from inspect import getargspec from django.conf import settings from django.template.context import Context, RequestContext, ContextPopException from django.utils.importlib import import_module from django.utils.itercompat import is_iterable from django.utils.function...
#!/usr/bin/env python3 # -*-coding:utf-8-*- """ This module is used to extract features from the data """ import numpy as np from scipy.fftpack import fft from scipy.fftpack.realtransforms import dct import python_speech_features eps = 0.00000001 def file_length(soundParams): """Returns the file length, in sec...
""" The MIT License (MIT) Copyright (c) 2015-present Rapptz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merg...
# coding: utf-8 from __future__ import unicode_literals """ This module implements various transmuter classes. Transmuters are essentially classes that generate TransformedStructures from various data sources. They enable the high-throughput generation of new structures and input files. It also includes the helper f...
#Graham Rockwell #7.6.2009 from core.model.LinearModel import LinearModel from core.model.ModelFactory import CreateLinearModel from core.reader.FluxModelParser import FluxModelFlatFileParser from util.Report import Report import re, os, pickle class MatrixTools: def __init__(self): pass de...
########################################################################## # # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Red...
# Copyright 2014 The Oppia 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 applicable ...
# # 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.shortcuts import render_to_response, get_object_or_404 from django.http import HttpResponse, HttpResponseRedirect from django.db.models import Q from datetime import datetime import re from youbama.main.models import Video, Upload, Contact from youbama.settings import MEDIA_ROOT from youbama.main.helpers...
# -*- coding: utf-8 -*- import networkx as nx import matplotlib.pyplot as plt from networkx.utils import powerlaw_sequence import operator import random import csv import copy import subprocess, os import time import UtilityFunctions as UF import NetworkModels as NM import math import sys import numpy as np import stru...
# Copyright 2008-2013 Nokia Siemens Networks Oyj # # 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...
from direct.interval.IntervalGlobal import * from pandac.PandaModules import * from DistributedNPCToonBase import * from toontown.chat.ChatGlobals import * from toontown.hood import ZoneUtil from toontown.nametag.NametagGlobals import * from toontown.quest import QuestChoiceGui from toontown.quest import QuestParser f...
from django.core.urlresolvers import resolve, reverse import furl from rest_framework import serializers as ser import pytz from modularodm import Q from framework.auth.core import Auth, User from website import settings from website.files.models import FileNode from website.project.model import Comment from website...
# Copyright 2021 Google Research. 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...
import syslog from datetime import datetime import time import re import sys class APIKeys(object): def __init__ (self, dbh, debug): self.dbh = dbh self.debug = debug self.table = self.dbh.table('apikeys') self.currow = None self.updateable_row_names = ['alias', 'restricted...
import copy import urllib3 import jwt from CommonServerPython import * # Disable insecure warnings urllib3.disable_warnings() PARAMS = demisto.params() # Remove trailing slash to prevent wrong URL path to service SERVER = PARAMS['url'][:-1] \ if (PARAMS['url'] and PARAMS['url'].endswith('/')) else PARAMS['url']...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- # pylint: ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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 (t...
"""distutils.cygwinccompiler Provides the CygwinCCompiler class, a subclass of UnixCCompiler that handles the Cygwin port of the GNU C compiler to Windows. It also contains the Mingw32CCompiler class which handles the mingw32 port of GCC (same as cygwin in no-cygwin mode). """ # problems: # # * if you use a msvc com...
""" This module contains tests for combinator.branchmgr. """ import os, sys, StringIO from twisted.trial.unittest import TestCase from twisted.python.filepath import FilePath from combinator import branchmgr from combinator.branchmgr import DuplicateBranch, NonExistentBranch from combinator.branchmgr import Invalid...
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
import asyncio import warnings from inspect import isawaitable from typing import ( Any, Awaitable, Callable, Dict, List, MutableMapping, Optional, Tuple, Union, ) from urllib.parse import quote import sanic.app # noqa from sanic.compat import Header from sanic.exceptions import ...
import json import logging import time from datetime import datetime, timedelta from itertools import chain from django.conf import settings from django.http import ( HttpResponse, HttpResponseBadRequest, HttpResponseRedirect) from django.shortcuts import render from django.utils.html import escape from django.uti...
"""Support for interfacing to iTunes API.""" import requests import voluptuous as vol from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity from homeassistant.components.media_player.const import ( MEDIA_TYPE_MUSIC, MEDIA_TYPE_PLAYLIST, SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, ...
import const from json_document import ResultSet from util import prettify class SearchQuery(object): """ Container class for constructing and executing ElasticSearch queries for some SeachModel class. Each SearchQuery instance may contain a number of query expressions (filters, queries, facet fi...
# Copyright (c) 2020 PaddlePaddle 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...
# 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 ...
# Copyright 2013 dotCloud 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 t...
""" Script used to test the adaptive interpolation and the evaluation of said interpolant """ from __future__ import absolute_import import os import time import numpy as np import numpy.linalg as la import scipy.special as spec import matplotlib as mpl mpl.use("Agg") import matplotlib.pyplot as plt from mpl_toolkits...
import mimetypes import os from email import ( charset as Charset, encoders as Encoders, generator, message_from_string, ) from email.errors import InvalidHeaderDefect, NonASCIILocalPartDefect from email.header import Header from email.headerregistry import Address from email.message import Message from email.mime....
import networkx as nx import re import matplotlib.pyplot as plt import networkx.algorithms.isomorphism as iso import math import numpy as np import time from itertools import cycle from collections import deque, defaultdict from .generalFunctions import * from .path import Path class SuperG(): def __init__(self, ...
# coding: ascii # pygame - Python Game Library # Copyright (C) 2000-2003 Pete Shinners # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your o...
# Copyright 2016 Pinterest, 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 writi...
import os import time import json import struct import logging import platform import subprocess from fcntl import ioctl from pyroute2.common import map_namespace from pyroute2.common import ANCIENT # from pyroute2.netlink import NLMSG_ERROR from pyroute2.netlink import nla from pyroute2.netlink import nlmsg from pyrou...
"""Text feature extraction""" __author__ = 'thor' from sklearn.base import BaseEstimator from sklearn.feature_extraction.text import CountVectorizer from pandas import Series import numpy as np from urllib.parse import urlsplit import re from collections import Counter from itertools import chain from operator import...
from __future__ import absolute_import import re import os import json import tempfile import subprocess import io from six.moves import map from six.moves import range from six.moves import zip import IPython.nbformat.v4.nbbase as nbbase import IPython.nbformat.v4 as v4 from IPython.nbformat.v4.rwbase import Noteb...
"""test_resources""" import unittest from nose.tools import eq_, assert_raises from routes import * class TestResourceGeneration(unittest.TestCase): def _assert_restful_routes(self, m, options, path_prefix=''): baseroute = '/' + path_prefix + options['controller'] eq_(baseroute, m.generate(action=...
"""multipart/form-data encoding module This module provides functions that faciliate encoding name/value pairs as multipart/form-data suitable for a HTTP POST or PUT request. multipart/form-data is the standard way to upload files over HTTP""" unicode = str __all__ = ['gen_boundary', 'encode_and_quote', 'MultipartPa...
"""Implements the Astropy TestRunner which is a thin wrapper around py.test.""" from __future__ import (absolute_import, division, print_function, unicode_literals) import inspect import os import copy import shlex import sys import tempfile import warnings from collections import OrderedDict ...
#!/usr/bin/env python ''' test.test_wind_flags Tests for Flag Setting and Checking for In-situ temperature and salinity ''' from ioos_qartod.flags import QARTODEval from ioos_qartod.flags.temp_salinity import * import numpy as np import unittest class TestWindFlags(unittest.TestCase): def setUp(self): ...
#!/usr/bin/python # -*- coding: utf-8 -*- import os import sys if sys.version_info >= (3, 0): from unittest.mock import patch else: from mock import patch from pyfakefs import fake_filesystem_unittest from shellfoundry.utilities.shell_package_builder import ShellPackageBuilder from tests.asserts import asse...
# 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 ...
"""Convert epydoc markup into renderable content.""" import __builtin__ import exceptions import inspect import itertools import os import re import sys import urllib from twisted.web.template import Tag, tags, XMLString from pydoctor import model STDLIB_DIR = os.path.dirname(os.__file__) STDLIB_URL = 'http://docs...
"""Support to interface with the Plex API.""" from datetime import timedelta import json import logging import requests import voluptuous as vol from homeassistant import util from homeassistant.components.media_player import ( MediaPlayerDevice, PLATFORM_SCHEMA) from homeassistant.components.media_player.const i...
#author Philippe Raipin #licence : apache v2 from flask import Flask, request,Response from pymongo import MongoClient, MongoReplicaSetClient from pymongo.read_preferences import ReadPreference import json from bson.dbref import DBRef from bson.json_util import dumps from bson import ObjectId import time configfi...
# Copyright 2016 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...
import csv import re from django import forms from django.core.urlresolvers import reverse_lazy from django.utils.encoding import force_text from django.utils.html import format_html from django.utils.safestring import mark_safe EXPANSION_PATTERN = '\[(\d+-\d+)\]' def expand_pattern(string): """ Expand a n...
#!/usr/bin/env python import web import ovsdb import simplejson as json import ofctrl urls = ( '/', 'Index', # All Bridges '/bridges', 'Bridges', '/bridges/add', 'Bridges', # A single Bridge '/bridges/(\w+)', 'Bridge', '/bridges/(\w+)/(update|del)', 'Bridge', # Controllers '/bridges/(\w+)/cont...
# -*- coding: utf-8 -*- # # msoAutoShapeType.py # # original source for msoAutoShapeType constants and spec definitions # def msdn_msoAutoShapeTypes(): """ Return sequence of tuples representing the msoAutoShapeType enumeration as defined in the MS Office API. Access with:: for ms_name, id_,...
#!/usr/bin/env python3 """ Rules for building C/API module with f2py2e. Copyright 1999,2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy License. NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RI...
# 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 or agreed to in writing, ...
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
from __future__ import print_function, division try: import cPickle as pickle except: import pickle from pdb import set_trace import numpy as np from sklearn.feature_extraction.text import TfidfVectorizer import csv from collections import Counter from sklearn import svm from sklearn import linear_model import ...
'''This is the Android implementation of NFC Scanning using the built in NFC adapter of some android phones. ''' from kivy.app import App from kivy.clock import Clock #Detect which platform we are on from kivy.utils import platform if platform != 'android': raise ImportError import threading from . import NFCBase...
from __future__ import absolute_import from functools import wraps import os import string from google.appengine.api import ( namespace_manager, oauth, ) from google.appengine.ext import ( db, ndb, ) from protorpc import ( messages, remote, ) from webapp2_extras import sessions import endpoints import web...