gt
stringclasses
1 value
context
stringlengths
2.49k
119k
from sympy.core import Add, C, Derivative, Dummy, Expr, S, sympify, Wild from sympy.concrete.gosper import gosper_sum from sympy.functions.elementary.piecewise import piecewise_fold from sympy.polys import apart, PolynomialError from sympy.solvers import solve def _free_symbols(function, limits): """Helper functio...
from StringIO import StringIO from datetime import datetime, timedelta from mock import MagicMock from casexml.apps.case.models import CommCareCase from casexml.apps.case.mock import CaseFactory from casexml.apps.case.tests.util import check_xml_line_by_line from casexml.apps.case.xml import V1 from django.core.urlre...
# Copyright (c) 2013 Rackspace, 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 w...
# Copyright 2011 OpenStack Foundation # 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 requ...
__author__ = 'rcj1492' __created__ = '2016.03' __license__ = 'MIT' import os from jsonmodel.validators import jsonModel from socket import gethostname, gethostbyname class osClient(object): ''' a class of methods for retrieving local os properties ''' def __init__(self): ''' initialization method f...
# Copyright 2011 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 l...
# Copyright 2019 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 ...
#!/usr/bin/env python import pygame import sys import math SCALE = 0.5 sprite_size = [int(85*SCALE), int(112*SCALE)] # Initialize the screen pygame.init() SCREEN_SIZE = (640, 480) screen = pygame.display.set_mode(SCREEN_SIZE) pygame.display.set_caption('Get Off My Head') #pygame.mouse.set_visible(0) # Create the ba...
#!/usr/bin/env python from __future__ import division import os import re import argparse from itertools import izip, compress from collections import defaultdict import numpy as np import pandas as pd from Bio import SeqIO import matplotlib.pyplot as plt def get_parser(): """ Create a parser and add arguments...
from datetime import datetime from django.conf import settings from django.contrib.auth import authenticate from django.contrib.auth.backends import RemoteUserBackend from django.contrib.auth.middleware import RemoteUserMiddleware from django.contrib.auth.models import User from django.contrib.auth.tests.utils import ...
"""Base classes to manage a Client's interaction with a running kernel""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import absolute_import import atexit import errno from threading import Thread import time import zmq # import ZMQError in to...
# Copyright 2016 Adobe. All rights reserved. # Methods: # Parse args. If glyphlist is from file, read in entire file as single string, # and remove all white space, then parse out glyph-names and GID's. # For each font name: # Use fontTools library to open font and extract CFF table. # If error, skip font and re...
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # 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) 2013 eNovance SAS <licensing@enovance.com> # # 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 requir...
import numpy as np from copy import copy from bokeh.core.properties import field from bokeh.io import curdoc from bokeh.layouts import layout,column,row from bokeh.models import ( ColumnDataSource, HoverTool, SingleIntervalTicker, Slider, Button, Label, CategoricalColorMapper, ) from bokeh.models.widgets import...
import collections import datetime import dateutil.parser import dateutil.relativedelta import re class _Enum(tuple): """A simple way to make enum types.""" __getattr__ = tuple.index # 'new' only makes sense for recurring actions. It represents a recurring # action which hasn't been done yet. DateStates = ...
from __future__ import division, absolute_import from sys import stdout import attr import json from io import BytesIO from io import BufferedReader from collections import namedtuple from twisted.logger import Logger from twisted.internet import defer from twisted.internet import reactor from twisted.internet.task i...
# This module contains the analysis options. # All variables with names of all caps will be registered as a state option to SimStateOptions. import string from .sim_state_options import SimStateOptions # This option controls whether or not constraints are tracked in the analysis. TRACK_CONSTRAINTS = "TRACK_CONSTRAINT...
from __future__ import (absolute_import, division, print_function, unicode_literals) import pytest from itertools import chain, product import os.path import uuid import numpy as np from filestore.handlers_base import HandlerBase def _verify_shifted_resource(last_res, new_res): '''Check ...
# -*- coding: utf-8 -*- import shutil import tempfile from contextlib import contextmanager from unittest import TestCase, skip from damnode import Damnode from os import path as osp class LinkTest(TestCase): def test_read_remote_links(self): d = create_damnode() entries = d.read_links('https://no...
import tools as ts import waveletcodec.wave as wvt import math from numpy.numarray.numerictypes import Int import numpy as np import waveletcodec.entropy as tpy class speck(object): #wavelet object wv = 0 #wavelet data dt = 0 LIS = [] LSP = [] nextLIS = [] S = [] I = [] n = 0 ...
# Copyright 2014 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, ...
# 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 ...
#! /usr/bin/python import sys import getopt import time import os.path from subprocess import call verbosity = int(0) evaluateonly = False dictionaryOutputFile = '' corpusOutputFile = '' evaluationOutputFile = '' vocabularyInputFile = '' countOutputDirectory = './counts' order = 1 nrInputFiles = int(0) nrTrainIn...
from jsonrpc import ServiceProxy import sys import string import getpass # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:9332") e...
import numpy as np from .experiments import run_experiments from ..plots import colors from .. import __version__ from . import models from . import methods from . import metrics import sklearn import io import base64 import os try: import matplotlib.pyplot as pl import matplotlib except ImportError: pass ...
# Author: Charles Brummitt, Kenan Huremovic, Paolo Pin, # Matthew Bonds, Fernando Vega-Redondo """Agent-based model of economic complexity and contagious disruptions. This model is used to create Figure 7 in the paper "Contagious disruptions and complexity traps in economic development" (2017) by the above aut...
import asyncio import os.path from unittest.mock import MagicMock from asynctest import CoroutineMock import alarme from alarme import Application from tests.common import BaseTest class ApplicationTest(BaseTest): def setUp(self): super().setUp() self.application = Application() def test_l...
import warnings import numpy as np from numpy.polynomial.hermite_e import HermiteE from scipy.special import factorial from scipy.stats import rv_continuous import scipy.special as special # TODO: # * actually solve (31) of Blinnikov & Moessner # * numerical stability: multiply factorials in logspace? # * ppf & frie...
# 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...
import logging import random import bson import modularodm.exceptions from django.contrib.contenttypes.fields import (GenericForeignKey, GenericRelation) from django.contrib.contenttypes.models import ContentType from django.core.exceptions import MultipleObjectsReturned...
# Copyright 2017 AT&T Corporation. # 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 require...
import cv2 import time import numpy as np import math import os, sys import pdb #width = 1920 #height = 1080 width = 512 height = 428 blackImg = np.zeros((height,width,3), np.uint8) class FingerDetector: def __init__(self, bottomLine, blurPixelSize, threshVal, bothHands=True, kinect=None): self.vidSrc = ...
import re import json from string import digits, ascii_uppercase, capwords import datetime from django import http from django.conf import settings from django.db import transaction import pytest from nomination import url_handler, models from . import factories pytestmark = pytest.mark.django_db alnum_list = sort...
# Copyrighs 2012-2019 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agree...
# encoding: utf-8 from __future__ import unicode_literals from collections import Mapping from functools import reduce from operator import and_ from pymongo.cursor import CursorType from ... import F, Filter, P, S from ...trait import Collection from ....schema.compat import odict from ....package.loader import tr...
import subprocess import sys import os try: import StringIO.StringIO as StringIO except: from io import StringIO root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) sys.path.insert(0, root_dir) from fortls.jsonrpc import write_rpc_request, write_rpc_notification, \ read_rpc_messages, p...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base...
import numpy as np import astropy.units as u from astropy.table import Table from . import filter from . import utils from . import config as cfg class Photometry(object): """Photometry class. This class is used for observations and synthetic photometry. It contains some meta info and lists of photometry...
""" Tests for L{pyflakes.scripts.pyflakes}. """ import os import sys import shutil import subprocess import tempfile from unittest2 import skipIf, TestCase from pyflakes.messages import UnusedImport from pyflakes.reporter import Reporter from pyflakes.api import ( checkPath, checkRecursive, iterSourceCod...
# Copyright 2012 OpenStack Foundation # 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 requ...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
#!/usr/bin/env python # ctypes-opencv - A Python wrapper for OpenCV using ctypes # Copyright (c) 2008, Minh-Tri Pham # All rights reserved. # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # * Redistributions of source...
from django.contrib.admin.filterspecs import FilterSpec from django.contrib.admin.options import IncorrectLookupParameters from django.contrib.admin.util import quote from django.core.paginator import Paginator, InvalidPage from django.db import models from django.utils.encoding import force_unicode, smart_str from dja...
# Copyright 2012 Locaweb. # 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...
''' Filename: OffOnlineMode.py Description: offline and online mode 1) auto. Change from offline to online mode after meet a 90% full @author: yan, chungyan5@gmail.com, 2Store ''' ## import other libraries ################################################## ### logging library import logging ### fil...
import dsz, dsz.lp import sys, random, time import ops, util.ip, ops.timehelper import os.path import helper, scanbase from math import floor from datetime import datetime import scanengine2 import monitorengine import exceptions def main(arguments): scanbase.setup_db() failout = False scansweepHelper = h...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains simple functions for dealing with circular statistics, for instance, mean, variance, standard deviation, correlation coefficient, and so on. This module also cover tests of uniformity, e.g., the Rayleigh and V tests. The Maximum L...
import uqbar.strings import supriya.live def test_build_synthdef_1_1(): synthdef = supriya.live.Send.build_synthdef(1, 1) assert ( str(synthdef) == uqbar.strings.normalize( """ synthdef: name: mixer/send/1x1 ugens: - Control.ir: null ...
#!/usr/bin/env python """ BuildconfigurationsetsApi.py Copyright 2015 Reverb Technologies, 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/LICENS...
# 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...
#!/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");...
#!/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 from prjxray.segmaker import Segmake...
<<<<<<< HEAD <<<<<<< HEAD """This will be the home for the policy that hooks in the new code that adds all the email6 features. """ from email._policybase import Policy, Compat32, compat32, _extend_docstrings from email.utils import _has_surrogates from email.headerregistry import HeaderRegistry as HeaderRegistry from...
# -*- coding: utf-8 -*- """ Export of textX based models and metamodels to dot file. """ from __future__ import unicode_literals from arpeggio import Match, OrderedChoice, Sequence, OneOrMore, ZeroOrMore,\ Optional from textx.const import MULT_ZEROORMORE, MULT_ONEORMORE, MULT_ONE, \ RULE_ABSTRACT, RULE_COMMON, ...
"""Collection of useful functions for the HomeKit component.""" import io import ipaddress import logging import os import re import secrets import socket import pyqrcode import voluptuous as vol from homeassistant.components import binary_sensor, media_player, sensor from homeassistant.components.camera import DOMAI...
from __future__ import division, absolute_import, print_function import numbers import operator import sys import numpy as np from numpy.testing import assert_, assert_equal, assert_raises PY2 = sys.version_info.major < 3 # NOTE: This class should be kept as an exact copy of the example from the # docstring for N...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Joseph Callen <jcallen () csc.com> # Copyright: (c) 2018, Ansible Project # Copyright: (c) 2018, Fedor Vompe <f.vompe () comptek.ru> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import abso...
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # # This file deals with the ifmap id handling for both vnc-user-visible entities # and bgp-visible entities import uuid import re import StringIO from lxml import etree from ifmap.client import client, namespaces from ifmap.request import NewSessionRe...
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:46442") else: access = Se...
import os from mutagen.flac import FLAC, Picture from convert_music import find_inconsistent_tags def test_invalid_filename(tmpdir): """Test when the FLAC filename is invalid.""" flac_dir = tmpdir.mkdir('flac') flac = flac_dir.join('Artist2 - Album - 01 - Title.flac').ensure(file=True) a_messages = fi...
"""Support for Voice mailboxes.""" import asyncio from contextlib import suppress from datetime import timedelta import logging from aiohttp import web from aiohttp.web_exceptions import HTTPNotFound import async_timeout from homeassistant.components.http import HomeAssistantView from homeassistant.core import callba...
import time from datetime import datetime from distutils.version import LooseVersion from threading import Event from cassandra import ConsistencyLevel as CL from cassandra import ReadFailure from cassandra.query import SimpleStatement from ccmlib.node import TimeoutError, Node from nose.tools import timed from asser...
# (c) Copyright 2014 Cisco Systems 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 # # Unl...
# -*- coding: utf-8 -*- # # 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 #...
"""Test event registration and listening.""" from sqlalchemy.testing import eq_, assert_raises, assert_raises_message, \ is_, is_not_ from sqlalchemy import event, exc from sqlalchemy.testing import fixtures from sqlalchemy.testing.util import gc_collect from sqlalchemy.testing.mock import Mock, call from sqlalche...
from __future__ import absolute_import import functools import six from collections import defaultdict, Iterable, OrderedDict from dateutil.parser import parse as parse_datetime from pytz import UTC from django.core.cache import cache from sentry import options from sentry.api.event_search import FIELD_ALIASES, PROJ...
# 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 or agreed to in writing, ...
""" mbed SDK Copyright (c) 2011-2017 ARM Limited 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...
import pytest from future.moves.urllib.parse import urlparse from api_tests.nodes.views.test_node_contributors_list import NodeCRUDTestCase from api.base.settings.defaults import API_BASE from framework.auth.core import Auth from osf_tests.factories import ( ProjectFactory, CommentFactory, RegistrationFact...
""" Testing for the boost module (sklearn.ensemble.boost). """ import numpy as np from numpy.testing import assert_array_equal from numpy.testing import assert_array_almost_equal from numpy.testing import assert_equal from nose.tools import assert_raises from sklearn.dummy import DummyClassifier from sklearn.dummy im...
import numpy as np import openmoc import openmc import openmc.checkvalue as cv # TODO: Get rid of global state by using memoization on functions below # A dictionary of all OpenMC Materials created # Keys - Material IDs # Values - Materials OPENMC_MATERIALS = {} # A dictionary of all OpenMOC Materials created # K...
#Copyright ReportLab Europe Ltd. 2000-2004 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/colors.py __version__=''' $Id$ ''' __doc__='''Defines standard colour-handling classes and colour names. We define standard classes to hold colour...
import os import socket import atexit import re import pkg_resources from pkg_resources import ResolutionError, ExtractionError from setuptools.compat import urllib2 try: import ssl except ImportError: ssl = None __all__ = [ 'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_available', 'cert_paths', 'op...
# -*- coding: utf-8 -*- """ |oauth2| Providers ------------------- Providers which implement the |oauth2|_ protocol. .. autosummary:: OAuth2 Amazon Behance Bitly Cosm DeviantART Eventbrite Facebook Foursquare GitHub Google LinkedIn PayPal Reddit Viadeo ...
# -*- coding: utf-8 -*- from django.contrib import admin from models import Menu, Image, Page, News from django import forms from django.contrib.admin.widgets import AdminFileWidget from django.utils.safestring import mark_safe from django.conf import settings import os, sys, glob from datetime import datetime from t...
# -*- coding: utf-8 -*- """ Created on Wed Jul 28 08:28:04 2010 Author: josef-pktd """ import numpy as np from scipy import stats, special, optimize import statsmodels.api as sm from statsmodels.base.model import GenericLikelihoodModel #redefine some shortcuts np_log = np.log np_pi = np.pi sps_gamln = special.gamm...
from __future__ import absolute_import import six __all__ = [ 'HTML5TreeBuilder', ] import warnings from bs4.builder import ( PERMISSIVE, HTML, HTML_5, HTMLTreeBuilder, ) from bs4.element import NamespacedAttribute import html5lib from html5lib.constants import namespaces from bs4.element i...
# -*- coding: windows-1252 -*- from arelle.xlwt import BIFFRecords from arelle.xlwt import Style from arelle.xlwt.Cell import StrCell, BlankCell, NumberCell, FormulaCell, MulBlankCell, BooleanCell, ErrorCell, \ _get_cells_biff_data_mul from arelle.xlwt import ExcelFormula import datetime as dt try: from decima...
import sys import unittest from ledis import Ledis from ledis.client import Token from walrus import * from walrus.containers import chainable_method from walrus.tusks.helpers import TestHelper class Scannable(object): def _scan(self, cmd, match=None, count=None, ordering=None, limit=None): parts = [sel...
# Authors: Fabian Pedregosa <fabian@fseoane.net> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Nelle Varoquaux <nelle.varoquaux@gmail.com> # License: BSD 3 clause import numpy as np from scipy import interpolate from scipy.stats import spearmanr from .base import BaseEstimator, TransformerMixi...
from warnings import catch_warnings import pytest import numpy as np import pandas as pd from pandas import (Panel, Series, MultiIndex, DataFrame, Timestamp, Index, date_range) from pandas.util import testing as tm from pandas.errors import PerformanceWarning, UnsortedIndexError from pandas.tests.in...
#!/usr/bin/env python #-------------------------------------------------------------- # Function to add the aperture class instances to the linac lattice, # and a function to create the array with aperture nodes and losses. #-------------------------------------------------------------- import math import sys import ...
# 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...
from nose.tools import eq_ import hashlib import json import nose from js_helper import _do_real_test_raw as _js_test from validator.testcases.markup.markuptester import MarkupParser import validator.testcases.jetpack as jetpack from validator.errorbundler import ErrorBundle from validator.xpi import XPIManager def...
import copy import time,pdb import ephem import pandas as pd import numpy as np from astropy.io import ascii from itertools import product from .pdf import * # part of isoclassify package (to do make explicit import) from .priors import * # part of isoclassify package (to do make explicit import) from .plot import *...
# 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 applicable ...
# $Id: roles.py 6451 2010-10-25 08:02:43Z milde $ # Author: Edward Loper <edloper@gradient.cis.upenn.edu> # Copyright: This module has been placed in the public domain. """ This module defines standard interpreted text role functions, a registry for interpreted text roles, and an API for adding to and retrieving from ...
from datetime import datetime from decimal import Decimal from libmt94x.currency_codes import CurrencyCodes from libmt94x.info_acct_owner_subfields import BeneficiaryParty from libmt94x.info_acct_owner_subfields import BusinessPurpose from libmt94x.info_acct_owner_subfields import Charges from libmt94x.info_acct_owner...
"""Testing for K-means""" import re import sys import numpy as np from scipy import sparse as sp from threadpoolctl import threadpool_limits import pytest from sklearn.utils._testing import assert_array_equal from sklearn.utils._testing import assert_array_almost_equal from sklearn.utils._testing import assert_allcl...
from __future__ import unicode_literals, division, absolute_import import logging import math from flexget import plugin from flexget.config_schema import one_or_more from flexget.entry import Entry from flexget.event import event from flexget.plugin import PluginError from flexget.utils.cached_input import cached fro...
#!/usr/bin/env python """Implementations of various collections.""" import cStringIO import itertools import struct import logging from grr.lib import aff4 from grr.lib import config_lib from grr.lib import data_store from grr.lib import rdfvalue from grr.lib import registry from grr.lib import stats from grr.lib ...
""" DarkWorldsMetricMountianOsteric.py Custom evaluation metric for the 'Observing Dark Worlds' competition. [Description of metric, or reference to documentation.] Update: Made for the training set only so users can check there results from the training c @Author: David Harvey Created: 22 August 2012 """ import nu...
from .base import TestBase from nbgrader.api import Gradebook from nose.tools import assert_equal import os import shutil import datetime class TestNbgraderAutograde(TestBase): def _setup_db(self): dbpath = self._init_db() gb = Gradebook(dbpath) gb.add_assignment("ps1", duedate="2015-02-...
import distutils import glob import os import sys import textwrap from os.path import curdir, join, pardir import pytest from pip._internal import pep425tags from pip._internal.status_codes import ERROR from pip._internal.utils.misc import rmtree from tests.lib import ( _create_svn_repo, _create_test_package, cre...
# 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. import copy import logging import os import posixpath from environment import IsPreviewServer from extensions_paths import JSON_TEMPLATES, PRIVATE_TEMPL...
# -*- coding: utf-8 -*- import bisect from cms.models import Title, Page, EmptyTitle from cms.utils import get_language_list from cms.utils.compat import DJANGO_1_5 from cms.utils.conf import get_cms_setting from cms.utils.permissions import get_user_sites_queryset from django.contrib.admin.views.main import ChangeList...
#! /usr/bin/env python # # See README for usage instructions. import glob import os import subprocess import sys import platform # We must use setuptools, not distutils, because we need to use the # namespace_packages option for the "google" package. from setuptools import setup, Extension, find_packages from distuti...
import subprocess from collections import namedtuple import os import sys import tempfile import uuid import re from django.db.backends.base.creation import TEST_DATABASE_PREFIX def is_testing(): return os.environ.get("CCHQ_TESTING") == "1" class SharedDriveConfiguration(object): def __init__(self, shared_...
from __future__ import print_function, absolute_import, division import logging import time from sys import argv import gym import prettytensor as pt from gym.spaces import Box from simple_trpo.tb_logger import TBLogger from simple_trpo.utils import * from simple_trpo.vectorized_env import VectorizedEnv class TRPO(o...