gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# -*- coding: utf-8 -*- import unittest from datetime import datetime import json import time import sys import re import os import responses from tests import settings from mangopay.utils import timestamp_from_date today = datetime.utcnow().date() today_timestamp = timestamp_from_date(today) def get_fixture(n...
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-10-13 23:50 from __future__ import unicode_literals import django.contrib.gis.db.models.fields from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ...
"""Recurrence Operators""" from __future__ import print_function, division from sympy import symbols, Symbol, S from sympy.printing import sstr from sympy.core.compatibility import range, string_types from sympy.core.sympify import sympify def RecurrenceOperators(base, generator): """ Returns an Algebra of ...
# Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. import re import os import json import shutil import tempfile import time import unittest import itertools import urllib import mock import flask from gevent import monkey monkey.patch_all() from bs4 import BeautifulSoup import PIL.Image from urlpar...
""" Giving models a custom manager You can use a custom ``Manager`` in a particular model by extending the base ``Manager`` class and instantiating your custom ``Manager`` in your model. There are two reasons you might want to customize a ``Manager``: to add extra ``Manager`` methods, and/or to modify the initial ``Q...
#!/usr/bin/python # @lint-avoid-python-3-compatibility-imports # # ext4slower Trace slow ext4 operations. # For Linux, uses BCC, eBPF. # # USAGE: ext4slower [-h] [-j] [-p PID] [min_ms] # # This script traces common ext4 file operations: reads, writes, opens, and # syncs. It measures the time spent in these...
#!/usr/bin/env python # encoding: utf-8 """Wrapper functionality around the functions we need from Vim.""" import re import vim # pylint:disable=import-error from vim import error # pylint:disable=import-error,unused-import from UltiSnips.compatibility import col2byte, byte2col, \ as_unicode, as_vimencoding f...
#!/usr/bin/env python3 """K-Means Clustering on data set """ __author__ = "Chuanping Yu" __date__ = "Aug 6, 2017" import pandas as pd import numpy as np import matplotlib import matplotlib.pyplot as plt import matplotlib.cm as cm from matplotlib import style style.use("ggplot") import plotly.plotly as py import plo...
import logging import os import types from io import BytesIO, IOBase import pickle import string from collections import defaultdict import archinfo from archinfo.arch_soot import SootAddressDescriptor, ArchSoot import cle from .misc.ux import deprecated l = logging.getLogger(name=__name__) def load_shellcode(shell...
# -*- coding: utf-8 -*- # Copyright 2015 Metaswitch Networks # # 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 applicab...
# Copyright (c) 2019 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 app...
from django.db import connection, connections from django.db.migrations.exceptions import ( AmbiguityError, InconsistentMigrationHistory, NodeNotFoundError, ) from django.db.migrations.loader import MigrationLoader from django.db.migrations.recorder import MigrationRecorder from django.test import TestCase, modify_...
# 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) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 import numbers from functools import partial from queue import LifoQueue from pyro import poutine from pyro.infer.util import is_validation_enabled from pyro.poutine import Trace from pyro.poutine.enum_messenger import enumerate_s...
# Copyright 2020 Makani Technologies 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...
#!/usr/bin/env python """ Cloud connected autonomous RC car. Copyright 2016 Visible Energy Inc. All Rights Reserved. """ __license__ = """ 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 htt...
import datetime import logging from nowin_core.database import tables class BookingModel(object): """Model for managing server status """ def __init__(self, session, logger=None): self.logger = logger if self.logger is None: self.logger = logging.getLogger(__name__) ...
# coding=utf-8 from time import sleep from fabric.api import * # fix ntp so that it can be queried @task @parallel @roles('c4all') def fix_ntp(): run("sed -i 's/restrict default nomodify notrap noquery/restrict default nomodify notrap/g' /etc/ntp.conf") run("service ntpd restart") @task @roles('c4all') def chec...
# SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2021, ARM Limited and contributors. # # 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 # # ...
# -*- 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...
# 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, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """sedmodel.py - classes and methods for storing parameters and predicting observed spectra and photometry from them, given a Source object. """ import numpy as np import os from numpy.polynomial.chebyshev import chebval, chebvander from .parameters import ProspectorParam...
import os import sys import inspect import traceback saved_path = sys.path[:] sys.path.append(os.path.dirname(os.path.abspath(inspect.getsourcefile(lambda:0)))) from internal.memcached_connection import MemcachedBinaryConnection from internal.memcached_connection import STATUS, COMMANDS mc = MemcachedBinaryConnectio...
########################################################################## # # Copyright (c) 2018, 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: # # * Redistrib...
# 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 app...
""" Convert sanitized json data to tfrecord data format. """ import sys import collections import json import pickle import numpy as np import tensorflow as tf def invert_dict(dictionary): """ Invert a dict object. """ return {v:k for k, v in dictionary.items()} def _read_words(filepath): """ ...
from __future__ import absolute_import, print_function, division import numpy as np from .. import jit, typeof, utils, types, numpy_support, sigutils from ..typing import npydecl from ..typing.templates import AbstractTemplate, signature from . import _internal, ufuncbuilder from ..dispatcher import Dispatcher from ....
#!/usr/bin/env python # (c) 2012, Jan-Piet Mens <jpmens () gmail.com> # (c) 2012-2014, Michael DeHaan <[email protected]> and others # # This file is part of Ansible # # Ansible 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 So...
''' Inspector ========= .. versionadded:: 1.0.9 .. warning:: This module is highly experimental, use it with care. The Inspector is a tool for finding a widget in the widget tree by clicking or tapping on it. Some keyboard shortcuts are activated: * "Ctrl + e": activate / deactivate the inspector view ...
#!/usr/bin/env python3 # Copyright 2021 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
from flask import Blueprint, render_template, abort, request, redirect, url_for from flask.ext.login import LoginManager, UserMixin, login_required, current_user, login_user, logout_user from werkzeug.security import generate_password_hash, check_password_hash from db import User, get_user, has_superuser, write_to_db, ...
#!/usr/bin/env python # # ---------------------------------------------------------------------- # # Brad T. Aagaard, U.S. Geological Survey # Charles A. Williams, GNS Science # Matthew G. Knepley, University of Chicago # # This code was developed as part of the Computational Infrastructure # for Geodynamics (http://ge...
# -*- coding: utf-8 -*- from docutils import nodes import traceback from docutils.parsers.rst import Directive from past.builtins import basestring from sphinx.locale import _ from six.moves.urllib import parse as urlparse # Retain Py2 compatibility for urlparse import requests from requests_file import FileAdapte...
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
# This file implements all actions performed by agent to start execution script on exec host and sar data collection # from all exec and stat hosts. Each procedure is mapped with particular daytona command used by scheduler to # communicate with agent. Upon recieving command from daytona scheduler, agent execute below ...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
# SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2015, ARM Limited and contributors. # # 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 # # ...
#!python -u import math import pickle import copy import random import pyglet import pyglet.gl as gl import pyglet.window.key as key import vector as vec from vector import Vector as Vec import timevars as tv import sprites import gameelements import activeobjects as ao from geoip import GeoIPData from gameasset...
# Copyright (c) 2012-2013, Mark Peek <[email protected]> # All rights reserved. # # See LICENSE file for full license. import json import re import types from . import validators __version__ = "1.2.0" # constants for DeletionPolicy Delete = 'Delete' Retain = 'Retain' Snapshot = 'Snapshot' # Pseudo Parameters AWS_ACCO...
''' Widget class ============ The :class:`Widget` class is the base class required for creating Widgets. This widget class was designed with a couple of principles in mind: * *Event Driven* Widget interaction is built on top of events that occur. If a property changes, the widget can respond to the change in the...
# -*- coding: utf-8 -*- from __future__ import with_statement from django.conf import settings from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import (RegexURLResolver, Resolver404, reverse, RegexURLPattern) from django.utils import...
"""API harvester for DataOne - for the SHARE project Example query: https://cn.dataone.org/cn/v1/query/solr/?q=dateModified:[NOW-5DAY%20TO%20*]&rows=10 """ from __future__ import unicode_literals import re import logging from datetime import timedelta, date from lxml import etree from dateutil.parser import parse ...
#!/usr/bin/env python # Copyright 2015 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import os import sys import tempfile import urllib2 from common_includes import * class Preparation(Step): MESSAG...
""" Test the API of the symtable module. """ import symtable import unittest TEST_CODE = """ import sys glob = 42 some_var = 12 class Mine: instance_var = 24 def a_method(p1, p2): pass def spam(a, b, *var, **kw): global bar bar = 47 some_var = 10 x = 23 glob def internal():...
from sitemessage.models import Message, Dispatch, Subscription, DispatchError from sitemessage.toolbox import recipients from sitemessage.utils import Recipient from .testapp.sitemessages import MessageForTest class TestSubscriptionModel: def test_create(self, user): s = Subscription.create('abc', 'mes...
import glob import pandas as pd import numpy as np pd.set_option('display.max_columns', 50) # print all rows import os os.chdir("/gpfs/commons/home/biederstedte-934/evan_projects/correct_phylo_files") cw154 = glob.glob("binary_position_RRBS_cw154*") trito = glob.glob("binary_position_RRBS_trito_pool*") print(len...
import os.path import re import tornado.web import tornado.websocket import logging import json from .. import version, filt class APIError(tornado.web.HTTPError): pass class RequestHandler(tornado.web.RequestHandler): def set_default_headers(self): super(RequestHandler, self).set_default_headers() ...
from setup.linux.installer import Installer from benchmark import framework_test import os import json import subprocess import time import textwrap import pprint import csv import sys import logging import socket from multiprocessing import Process from datetime import datetime class Benchmarker: ################...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack 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 requ...
#!/usr/bin/env python # Dan Blankenberg from __future__ import print_function import base64 import datetime import logging import optparse import os import shutil import subprocess import tempfile from json import ( dumps, loads ) from os.path import basename from xml.etree.ElementTree import tostring try: ...
""" Support for deCONZ light. For more details about this component, please refer to the documentation at https://home-assistant.io/components/light.deconz/ """ from homeassistant.components.deconz.const import ( CONF_ALLOW_DECONZ_GROUPS, DOMAIN as DATA_DECONZ, DATA_DECONZ_ID, DATA_DECONZ_UNSUB, DECONZ_DOMAIN,...
import logging log = logging.getLogger('fabric.fabalicious.scripts') from base import BaseMethod from fabric.api import * from fabric.contrib.files import exists from fabric.network import * from fabric.context_managers import settings as _settings from lib import configuration import re, copy class ScriptMethod(Base...
# -*- coding: utf-8 -*- from copy import copy import sympy from sympy import Matrix from pysymoro.geometry import compute_screw_transform from pysymoro.geometry import compute_rot_trans from pysymoro.kinematics import compute_vel_acc from pysymoro.kinematics import compute_omega from symoroutils import tools from s...
#!/usr/bin/env python3 # jsontotable5.py # Written December, 2015. Rewritten June 2017. # Ted Underwood. # This translates the jsons produced by # David Bamman's BookNLP pipeline into a simpler text file. # As the telltale 5 implies, this is the last in a series # of versions. This version is designed to work only ...
import logging import re from google.appengine.api import mail from twilio import twiml import webapp2 # Update these values as appropriate # These are the different number that the caller can choose from. # The array corresponds to the number that the caller enters on # there keypad. If there is only one number i...
import Bybop_NetworkAL import struct import threading class NetworkStatus: OK = 0 ERROR = 1 TIMEOUT = 2 class Network(object): """ Simple implementation of the ARNetwork protocol. This implementation does not support intenal fifos. If multiple threads tries to send data on the same buff...
# 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...
import glob import logging import os import numpy as np import re import soundfile from keras.models import model_from_json from numpy.lib.stride_tricks import as_strided from python_speech_features import mfcc from char_map import char_map_en, index_map_en, char_map_lt, index_map_lt logger = logging.getLogger(__nam...
""" Agent smoketest code. This python script is meant to be invoked within a docker image in which the proper python version is activated (e.g. via pyenv). In this way, the agent can be validated against different python versions. Concept: This code serves as a common code-base for different types of smoketest "...
# -*- coding: utf-8 -*- # based on original @nephila plugin https://github.com/nephila/djangocms-blog from django.db import models from django.db.models import Q from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse from django.core.cache import cache from django.utils im...
# 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 ag...
import argparse import codecs import logging import pickle import xml.etree.ElementTree as ET import os import sys import pprint import itertools from nltk.corpus import stopwords import nltk import numpy as np import progressbar as pb import time from pycorenlp import StanfordCoreNLP from sklearn import metrics, svm,...
import os import types import shlex import sys import codecs import tempfile import tkinter.filedialog as tkFileDialog import tkinter.messagebox as tkMessageBox import re from tkinter import * from tkinter.simpledialog import askstring from idlelib.configHandler import idleConf from codecs import BOM_UTF8 # Try sett...
""" Support for functionality to keep track of the sun. For more details about this component, please refer to the documentation at https://home-assistant.io/components/sun/ """ import logging from datetime import timedelta import homeassistant.util as util from homeassistant.helpers.entity import Entity from homeass...
# Copyright 2021 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, ...
# Copyright 2013 Google Inc. All Rights Reserved. """Common utility functions for sql tool.""" import json import sys import time from googlecloudapis.apitools.base import py as apitools_base from googlecloudsdk.calliope import exceptions from googlecloudsdk.core.util import console_io class OperationError(exceptio...
# # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and ...
import sys import time from multiprocessing import Process, Queue import yaml import numpy as np import zmq import pycuda.driver as drv #sys.path.append('./lib') from tools import (save_weights, load_weights, save_momentums, load_momentums) from train_funcs import (unpack_configs, adjust_learning_r...
#!/usr/bin/env python # 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. """Tool for automatically creating .nmf files from .nexe/.pexe executables. As well as creating the nmf file this tool can also fi...
############################################################################# ## ## Copyright (C) 2012 Riverbank Computing Limited. ## Copyright (C) 2006 Thorsten Marek. ## All right reserved. ## ## This file is part of PyQt. ## ## You may use this file under the terms of the GPL v2 or the revised BSD ## license as fol...
import unittest from numpy import pi, Infinity, exp, sqrt from abelfunctions.complex_path import ( ComplexPathPrimitive, ComplexPath, ComplexLine, ComplexArc, ComplexRay, ) class TestConstruction(unittest.TestCase): def test_line(self): gamma = ComplexLine(0, 1) self.assertEqua...
""" Implements an Exchange user object and access types. Exchange provides two different ways of granting access for a login to a specific account. Impersonation is used mainly for service accounts that connect via EWS. Delegate is used for ad-hoc access e.g. granted manually by the user. See https://docs.microsoft.com...
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import, division, print_function from datetime import datetime from decimal import Decimal from collections import OrderedDict import pytz import pytest from poker.room.fulltiltpoker import FullTiltPokerHandHistory, _Flop from poker.card import ...
# Copyright 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 in...
from __future__ import annotations from typing import Iterator, List from parsing.ast import Symbol, Nonterm, Token from parsing.errors import UnexpectedToken from parsing.grammar import ( Production, SymbolSpec, TokenSpec, EndOfInput, ShiftAction, ReduceAction, ) from parsing.lrparser import L...
#!/usr/bin/python # # Copyright 2013 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...
# -*- coding: utf8 -*- """ This is part of shot detector. Produced by w495 at 2017.05.04 04:18:27 """ from __future__ import absolute_import, division, print_function import itertools import logging import six from .second import Second class BaseVideoUnit(object): """ ... """ __source...
import os import sys import threading import time import traceback import datetime import pandas as pd import sqlite3 as sqlite from sqlite3 import Error from modules.ExchangeApi import ApiError # Bot libs import modules.Configuration as Config from modules.Data import truncate try: import numpy use_numpy = Tr...
# ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License # Version 1.1 (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.mozilla.org/MPL/ # # Softwa...
#!/usr/bin/env python3 # Copyright (c) 2014-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test mining RPCs - getmininginfo - getblocktemplate proposal mode - submitblock""" import copy from d...
""" MOF sbus. """ import networkx as nx import numpy as np from scipy.spatial import distance def add_distance_matrix(graph): carts = [] if(float('.'.join(nx.__version__.split('.')[:2])) >= 2.0): for j, data in sorted(list(graph.nodes(data=True))): carts.append(data['cartesian_coordinates'...
# This file is part of Buildbot. Buildbot 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. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
# MIT License # Copyright (c) [2017] [Zachary A. Eckstein] # 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, modif...
# -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies and contributors # For license information, please see license.txt import frappe from frappe import _ import json from frappe.model.document import Document from frappe.desk.doctype.notification_log.notification_log import enqueue_create_notification,\ ...
import calendar import time from operator import itemgetter import csv import re import boto.s3 from boto.s3.connection import S3Connection import provider.filesystem as fslib """ EJP data provider Connects to S3, discovers, downloads, and parses files exported by EJP """ class EJP(object): def __init__(self, ...
from abc import ABC, abstractmethod from typing import List, Optional, Pattern, Dict from datetime import datetime import regex from recognizers_text.utilities import RegExpUtility from recognizers_text.extractor import ExtractResult from .constants import Constants, TimeTypeConstants from .extractors import DateTimeE...
#!/usr/bin/python # # offwaketime Summarize blocked time by kernel off-CPU stack + waker stack # For Linux, uses BCC, eBPF. # # USAGE: offwaketime [-h] [-p PID | -u | -k] [-U | -K] [-f] [duration] # # Copyright 2016 Netflix, Inc. # Licensed under the Apache License, Version 2.0 (the "License") # # 20-Ja...
import os.path import time import sys import platform import queue from collections import namedtuple from functools import partial from electrum.i18n import _ from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * if platform.system() == 'Windows': MONOSPACE_FONT = 'Lucida Console' el...
# -*- coding: utf-8 -*- """ pygments.formatters.html ~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for HTML output. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import print_function import os import sys import os.path from ...
import os.path import shutil import sys import tarfile import tempfile import traceback import urllib2 import webbrowser try: import simplejson as json except ImportError: import ioJSON import pprint import StringIO from ConfigParser import SafeConfigParser from argparse import ArgumentParser from subprocess i...
import numpy as np from STObject import STObject from hagelslag.util.munkres import Munkres class ObjectMatcher(object): """ ObjectMatcher calculates distances between two sets of objects and determines the optimal object assignments based on the Hungarian object matching algorithm. ObjectMatcher supports...
# -*- coding: utf-8 -*- import copy import hashlib from bson.json_util import dumps from datetime import datetime, timedelta from eve.tests import TestBase from eve.utils import parse_request, str_to_date, config, weak_date, \ date_to_str, querydef, document_etag, extract_key_values, \ debug_error_message cl...
__source__ = 'https://leetcode.com/problems/maximal-rectangle/' # https://github.com/kamyu104/LeetCode/blob/master/Python/maximal-rectangle.py # Time: O(n^2) # Space: O(n) # DP # # Description: Leetcode # 85. Maximal Rectangle # # Given a 2D binary matrix filled with 0's and 1's, # find the largest rectangle containin...
# -*- coding: utf-8 -*- # Copyright 2016 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Bootstrap for cbuildbot. This script is intended to checkout chromite on the branch specified by -b or --branch (as normally a...
# -*- coding: utf-8 -*- # stationarity tests from pmdarima.arima.stationarity import ADFTest, PPTest, KPSSTest from pmdarima.arima.utils import ndiffs from pmdarima.utils.array import diff from pmdarima.datasets import load_austres from sklearn.utils import check_random_state from numpy.testing import assert_array_al...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'mainwindow.ui' # # Created: Wed Dec 18 11:50:03 2013 # by: PyQt4 UI code generator 4.10.2 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Att...
#!/usr/bin/env python ''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License")...
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ from django.test import TestCase try: # Django >= 1.7 from django.test import override_settings except ImportError: # Django <...
# -*- coding: utf-8 -*- # # GUI and Layout created by: Qt Designer 4.8.7 # Code for UI-Elements generated by: PyQt4 UI code generator 4.11.4 # import sys import os from PyQt4 import QtCore, QtGui from PyQt4.QtCore import SIGNAL from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas import ma...
""" Custom widgets used by the URL form fields. """ from __future__ import unicode_literals import re import django from django.contrib import admin from django.contrib.admin.widgets import ForeignKeyRawIdWidget from django.core.exceptions import ValidationError from django.db.models.fields.related import ManyToOneRe...