gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
vispy headless backend for egl.
"""
from __future__ import division
import atexit
from time import sleep
from ..base import (BaseApplicationBackend, BaseCanvasBackend,
... | |
# Some useful stuff to have in your views.py
import json
import CourseBuilder.settings #replace project with the main project folder with settings
from django.http import HttpResponseRedirect, HttpResponse, HttpResponseNotFound, HttpResponseBadRequest
from django.contrib.admin.views.decorators import staff_member_requ... | |
# Control the rotator and download data from a VNA
# Andrew Temme
# [email protected]
# updated 2015-11-4
# currently written for HP 8753
from __future__ import division
import visa
import numpy as np
from datetime import datetime
from os import path, makedirs
import serial
from time import sleep
from math import t... | |
"""
Ansible action plugin to ensure inventory variables are set
appropriately and no conflicting options have been provided.
"""
import fnmatch
import json
import re
from ansible.plugins.action import ActionBase
from ansible import errors
# pylint: disable=import-error,no-name-in-module
from ansible.module_utils.six.m... | |
import bitcoin
from ecdsa import NIST256p, VerifyingKey
from .Helper import *
from neo.Core.UInt160 import UInt160
from .ECCurve import EllipticCurve
class Crypto(object):
_Instance = None
@staticmethod
def SetupSignatureCurve():
"""
Setup the Elliptic curve parameters.
"""
... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2010 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | |
""" Plugin for playing music.
Some of the logic is very similar to the example at:
https://github.com/Rapptz/discord.py/blob/master/examples/playlist.py
TUTORIAL:
This module would require the bot to have ffmpeg installed and set in
PATH, so that one could run `ffmpeg` in the shell.
See: https://www.f... | |
#!/usr/bin/env python3
# -+-coding: utf-8 -+-
#--------------------------------------------
# Authors:
# Frank Boers <[email protected]>
# Christian Kiefer <[email protected]>
#--------------------------------------------
# Date: 12.112.19
#--------------------------------------------
# License: BSD (3-c... | |
# Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, ... | |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | |
#
# Class to create and store a street map.
# Author: James P. Biagioni ([email protected])
# Company: University of Illinois at Chicago
# Created: 6/6/11
#
import sqlite3
import pyximport; pyximport.install()
from pylibs import spatialfunclib
from pylibs import spatialfunclib_accel
from rtree import Rtree
# global par... | |
import csv
import getpass
import hashlib
import functools
import settings
import modules
class system():
"""Represents a huge megasystem."""
def __init__(self, args):
"""Constructor."""
self._args = args
self._database_changed = False
self._running = False
... | |
"""The tests for the Tasmota switch platform."""
import copy
import json
from unittest.mock import patch
from hatasmota.utils import (
get_topic_stat_result,
get_topic_tele_state,
get_topic_tele_will,
)
from homeassistant.components.tasmota.const import DEFAULT_PREFIX
from homeassistant.const import ATTR_... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
extract_books.py
A script to extract the list of books valid for participating in the
Wikisource contest.
This script is part of wscontest-votecounter.
(<https://github.com/CristianCantoro/wscontest-votecounter>)
---
usage: extract_books.py [-h] [--config CONFIG_FILE... | |
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | |
#!/usr/bin/env python
# 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 ma... | |
# -*- coding: utf-8 -*-
## flashcard_views
import json
import os
import shutil
import glob
from pyramid.response import Response
from pyramid.request import Request
from pyramid.view import view_config
import uuid
import Image
from sqlalchemy.exc import DBAPIError
from sqlalchemy.orm import aliased
from sqlalchemy im... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
impor... | |
# Test packages (dotted-name import)
import sys
import os
import tempfile
import textwrap
import unittest
from test import support
# Helpers to create and destroy hierarchies.
def cleanout(root):
names = os.listdir(root)
for name in names:
fullname = os.path.join(root, name)
if os.path.isdir... | |
# -*- coding: utf-8 -*-
"""
celery.loaders.base
~~~~~~~~~~~~~~~~~~~
Loader base class.
"""
from __future__ import absolute_import
import anyjson
import imp as _imp
import importlib
import os
import re
import sys
from datetime import datetime
from kombu.utils import cached_property
from kombu.utils.enco... | |
#!/usr/bin/env python2
#
# Copyright 2019 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 ... | |
from CommonServerPython import *
import os
import demistomock as demisto
RETURN_ERROR_TARGET = 'HTMLDocsAutomation.return_error'
def test_get_yaml_obj(mocker):
from HTMLDocsAutomation import get_yaml_obj
return_error_mock = mocker.patch(RETURN_ERROR_TARGET)
# sanity
file_path = os.path.join('test_... | |
"""Miscellaneous utility functions and classes."""
import bitarray
import collections
import io
import types
class Error(Exception):
pass
class IncompleteDataError(Error):
pass
class UnexpectedChunkError(Error):
pass
class ChunkPastEndError(UnexpectedChunkError):
pass
class ChunkCollisionError(Unexpe... | |
# -*- coding: utf-8 -*-
#
# MNE documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 11 10:45:48 2010.
#
# This file is execfile()d with the current directory set to its containing
# dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | |
# Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""Viewfinder asset id prefixes and helpers.
"""
__author__ = '[email protected] (Andy Kimball)'
import struct
from collections import namedtuple
from tornado import gen
from viewfinder.backend.base import base64hex, util
from viewfinder.backend.base.except... | |
#!/usr/bin/python
# Copyright 2014 Google.
#
# 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... | |
"""Parse tree transformation module.
Transforms Python source code into an abstract syntax tree (AST)
defined in the ast module.
The simplest ways to invoke this module are via parse and parseFile.
parse(buf) -> AST
parseFile(path) -> AST
"""
# Original version written by Greg Stein ([email protected])
# ... | |
# 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... | |
import mock
import nengo
import numpy as np
import pytest
from nengo_spinnaker.builder import builder, ensemble
from nengo_spinnaker.builder.ports import InputPort, OutputPort
from nengo_spinnaker import operators
class TestBuildEnsembleLIF(object):
@pytest.mark.parametrize("n_neurons, size_in", [(100, 1), (300,... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import BaseHTTPServe... | |
import sys
import os
import numpy as np
import cv2
from scipy.signal import convolve2d
from scipy.ndimage.filters import gaussian_filter
import math
import part0
import part1
import part2
import part3
import run
def sobel_filter_x():
'''Return a 3x3 sobel filter in the x direction.
'''
return np.array([[-1, 0, ... | |
#--------------------------------------------------
# BMP2NC_PY
# Convert bmp file to NC code (python version)
# [email protected]
#---------------------------------------------------
from bmpy import *
import time
import math
# 5mm
z_safe_height = 3
# -5mm
z_drill_height = -3
# > jump_distance, move to high, move... | |
# Copyright 2009-2014 MongoDB, 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 writin... | |
"""
Created on 7 Sep 2020
@author: Bruno Beloff ([email protected])
NB: 1 kPa = 10 mBar
https://www.sensirion.com/en/download-center/carbon-dioxide-sensors-co2/co2-sensor/
https://github.com/Sensirion/embedded-scd/releases/tag/2.1.0
"""
import time
from scs_core.data.datum import Decode, Encode
f... | |
# Copyright (C) 2014,2015 VA Linux Systems Japan K.K.
# Copyright (C) 2014,2015 YAMAMOTO Takashi <yamamoto at valinux co jp>
# 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 t... | |
"""
Cross Site Request Forgery Middleware.
This module provides a middleware that implements protection
against request forgeries from other sites.
"""
import itertools
import re
import random
from django.conf import settings
from django.core.urlresolvers import get_callable
from django.utils.cache import patch_vary... | |
"""
opentrons.protocols.parse: functions and state for parsing protocols
"""
import ast
import functools
import itertools
import json
import logging
import re
from io import BytesIO
from zipfile import ZipFile
from typing import Any, Dict, Optional, Union, Tuple, TYPE_CHECKING
import jsonschema # type: ignore
from ... | |
#!/usr/bin/python
# 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 r... | |
from winnow.utils import deep_copy_dict as deepcopy
import jsonschema
from decimal import Decimal
import os
from winnow.options import OptionsSet
from winnow import inline
from winnow import utils
from winnow import validation
from winnow.exceptions import OptionsExceptionFailedValidation, OptionsExceptionReferenceErr... | |
# 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... | |
# 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 ... | |
from nose.tools import * # flake8: noqa
from website.util import permissions
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase
from tests.factories import ProjectFactory
from tests.factories import AuthUserFactory
from tests.factories import PrivateLinkFactory
from website.models imp... | |
# 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... | |
# 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, software
# distributed under t... | |
import logging
from asyncio import Future, iscoroutinefunction
from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, List, Optional, Tuple, TypeVar, cast
from expression.core import MailboxProcessor, TailCall, tailrec_async
from expression.system import AsyncDisposable, CancellationTokenSource, Di... | |
# Copyright 2014: Dassault Systemes
# 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 requir... | |
import json
import os
import shutil
from datetime import date, timedelta
import mock
from django.conf import settings
from django.core import management
from olympia import amo
from olympia.amo.tests import TestCase
from olympia.addons.models import Addon, Persona
from olympia.stats.management.commands import (
s... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
# Credit to Dr. Shyue Ping Ong for the template of the calculator
"""
This module implements a TEM pattern calculator.
"""
import json
import os
from collections import namedtuple
from fractions import Fractio... | |
# -*- coding: utf-8 -*-
import psycopg2
import sys
import re
class Paper:
pid = None
title = None
author = None
aid = None
wid = None
year = None
venue = None
vid = None
index = None
references = []
abstract = None
keywords = []
def make_keywords(self):
if ... | |
#!/usr/bin/env python
# encoding: utf-8
"""
EyeLinkSession.py
Created by Tomas Knapen on 2011-04-27.
Copyright (c) 2011 __MyCompanyName__. All rights reserved.
"""
import os, sys, pickle, math, thread, time
from subprocess import *
import scipy as sp
import scipy.stats as stats
import numpy as np
import matplotlib.p... | |
"""Test the DLT implementation.
"""
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import dlt
def test_exceptions():
#TODO make some error cases here
pass
def test_3d():
# 3D (x, y, z) coordinates (in cm) of the corner of a cube (the measurement error is at ... | |
##
# Copyright (c) 2014-2015 Apple 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 l... | |
"""
Egg loading utilities.
"""
import cPickle
import os.path
import pickle
import sys
import zipfile
import pkg_resources
from openmdao.util.eggobserver import EggObserver
from openmdao.util.eggsaver import SAVE_CPICKLE, SAVE_PICKLE
from openmdao.util.log import NullLogger, LOG_DEBUG2
__all__ = ('load', 'load_from_e... | |
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
TestGyp.py: a testing framework for GYP integration tests.
"""
import os
import re
import shutil
import stat
import sys
import tempfile
import TestCommon
fr... | |
import inspect
from functools import partial
from typing import Callable, Dict, List, Optional, Tuple, Union, Any, Sequence
import numpy as np
import tensorflow as tf
from six import string_types
from tensorflow.keras.optimizers.schedules import LearningRateSchedule
from odin.fuel import IterableDataset
from tensorflo... | |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Committee.description'
db.add_column('committees_committee', 'description', self.gf('djang... | |
#!/usr/bin/python
import sys
import re
import unicodedata
from StringIO import StringIO
try:
from lxml import etree
LXML_PRESENT = True
except ImportError:
LXML_PRESENT = False
#################################################################################
"""Html2MdException
Base exception clas... | |
"""
This module downloads a package from a given URL using one of potentially
many different methods. We currently support the github web API and
simple HTTP(S). The github method is more developed and returns meta data
about the project (the commit hash and message), but support for other
methods, e.g. download a ta... | |
# 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... | |
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
# Documentation is intended to be processed by Epydoc.
"""
Introduction
============
This file is used to make the input matrix for the munkres algorithm.
It is like a helper file for munkres_test.py file
Description
===========
The input file with student informat... | |
from unittest import mock
from olympia import amo
from olympia.addons.models import Addon
from olympia.amo import search
from olympia.amo.tests import ESTestCaseWithAddons, TestCase
from olympia.tags.models import Tag
class TestESIndexing(ESTestCaseWithAddons):
# This needs to be in its own class for data isola... | |
"""
The :mod:`compat` module provides support for backwards compatibility with older versions of django/python.
"""
import django
# cStringIO only if it's available, otherwise StringIO
try:
import cStringIO as StringIO
except ImportError:
import StringIO
# parse_qs from 'urlparse' module unless python 2.5, i... | |
#!/usr/bin/python
# Usage: Train_Evaluate_7MLP-100PCA.py <label> <target-variable> <data-sources> <train-set-sessions> <test-set-sessions>
# NB: Normally, use quotes around each parameter, as they are strings with commas and stuff
# The script assumes that the dataset is in the same dir as the script, and writes its ... | |
# Copyright 2013 OpenStack Foundation
# Copyright 2013 Spanish National Research Council.
# 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://ww... | |
# Copyright 2016: Mirantis 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... | |
from collections import defaultdict
from django.conf import settings
from django.template.defaultfilters import linebreaksbr
from django.urls import reverse
from django.utils.translation import ugettext as _
from celery import chord
from celery.task import task
from dimagi.utils.logging import notify_exception
from ... | |
# -*- 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 2017-present Kensho Technologies, LLC.
import string
from typing import cast
import unittest
from graphql import parse
from graphql.utilities.build_ast_schema import build_ast_schema
import six
from ..compiler.compiler_frontend import graphql_to_ir
from ..exceptions import GraphQLCompilationError, GraphQL... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2008 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | |
# -*- test-case-name: piped.processing.test.test_utilprocessors -*-
# Copyright (c) 2010-2011, Found IT A/S and Piped Project Contributors.
# See LICENSE for details.
""" Utility processors that are useful in many contexts. """
import collections
import copy
import logging
import pdb
import pprint
import sys
import t... | |
# Copyright (c) 2010 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 required by applicable law or agreed to in wr... | |
#
# This is a script to install yotta. Eventually I would like to add all OS's to this script
# but for now it just works on windows.
#
# There are some ganky hacks in place holding it together, such as opening
# IE to get certificates that windows doesnt have. Currently the script
# just downloads the dependencies a... | |
# 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... | |
#!/usr/bin/env python
"""SeqAn documentation raw object representation.
This is the direct representation as it can be determined from the embedded
Doxygen-style comments without the interpretation of commands within clauses
and cross-linking.
"""
import textwrap
import dox_tokens
import raw_doc
class DoxFormatter(o... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import os
import numpy as np
import tensorflow as tf
from niftynet.io.image_reader import ImageReader
from niftynet.io.image_sets_partitioner import ImageSetsPartitioner
from niftynet.layer.discrete_label_normalisation import \
Discre... | |
# 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
#
# Authors:
# - Mario Lassnig, [email protected], 2016-2017
# - Tobias Wegner, tobias.wegner@ce... | |
# Copyright 2012-2017 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... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Script assumes that database connection information is stored in
# ~/mysql/db_config. Change if needed. Variables are initialized
# this way for compatibility with prior Bash script.
#
# Determination of 3rd next appointment similar that used in Oscar EMR code in
# src/main... | |
# ===============================================================================
# Copyright 2019 Jan Hendrickx and Gabriel Parrish
#
# 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:/... | |
# pylint: disable-msg=W0511,W0212,E1111
#
# Copyright 2008 German Aerospace Center (DLR)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | |
# Copyright 2013 Red Hat 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 ag... | |
# 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 ... | |
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import glob
import logging
import os
import unittest.mock
from pants.binaries.binary_util import (
BinaryRequest,
BinaryToolFetcher,
BinaryToolUrlGenerator,
BinaryUtil,
... | |
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.distributed.ClockDelta import *
from direct.fsm import FSM
from direct.distributed import DistributedObject
from direct.showutil import Rope
from direct.showbase import PythonUtil
from direct.ta... | |
#!/usr/bin/python !/usr/bin/env python
# -*- coding: utf-8 -*
# Functions tha combine modular subfunctions creating
# a task to complete, such as reading from file, extracting concepts
# and saving to disk again.
from config import settings
from utilities import time_log
from data_loader import load_file, load_file_... | |
#
# Copyright 2015 Hewlett Packard
# (c) Copyright 2018 SUSE 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 app... | |
#!/usr/bin/env python
from fabric.api import execute, local, require, settings, task
from fabric.state import env
from termcolor import colored
import app_config
# Other fabfiles
import analysis
import assets
import data
import flat
import issues
import render
import text
import utils
if app_config.DEPLOY_TO_SERVER... | |
# Copyright 2016 Capital One Services, 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... | |
"""
This module contains data types used by Scrapy which are not included in the
Python Standard Library.
This module must not depend on any module outside the Standard Library.
"""
import copy
import six
from collections import OrderedDict
class MultiValueDictKeyError(KeyError):
pass
class MultiValueDict(dict... | |
"""
Helper functions/classes for making HTML report and scaling summary output.
"""
from __future__ import annotations
import json
import logging
from jinja2 import ChoiceLoader, Environment, PackageLoader
from orderedset import OrderedSet
from cctbx import uctbx
from dxtbx import flumpy
from scitbx.array_family im... | |
#!/usr/bin/env python
from __future__ import print_function
from pyVim.connect import SmartConnect, Disconnect
from pyVmomi import vmodl, vim
from datetime import timedelta, datetime
import argparse
import atexit
import getpass
# FIX SSL ISSUES WITH PYVMOMI AND PYTHON 2.7.9
import ssl
import requests
context = None... | |
# python imports
import locale
import math
# django imports
from django.conf import settings
from django.core.cache import cache
from django.core.paginator import Paginator, EmptyPage, InvalidPage
from django.core.urlresolvers import reverse
from django.http import Http404
from django.http import HttpResponse
from dja... | |
"""
A TestRunner for use with the Python unit testing framework. It
generates a HTML report to show the result at a glance.
The simplest way to use this is to invoke its main method. E.g.
import unittest
import HTMLTestRunner
... define your tests ...
if __name__ == '__main__':
HTMLTestRunne... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
cookiecutter.generate
---------------------
Functions for generating a project from a project template.
"""
from __future__ import unicode_literals
from collections import OrderedDict
import fnmatch
import io
import json
import logging
import os
import shutil
from ji... | |
"""
This is fast version of DecisionTreeRegressor for only one target function.
(This is the most simple case, but even multi-class boosting doesn't need more complicated things)
I need numpy implementation mostly for further experiments, rather than for real speedup.
This tree shouldn't be used by itself, only in boo... | |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
#!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... | |
from .. utils import TranspileTestCase, UnaryOperationTestCase, BinaryOperationTestCase, InplaceOperationTestCase
class ListTests(TranspileTestCase):
def test_setattr(self):
self.assertCodeExecution("""
x = [1, 2, 3]
x.attr = 42
print('Done.')
""")
def ... | |
"""
Scikit-learn utilities for input validation.
"""
# Authors: Olivier Grisel
# Gael Varoquaux
# Andreas Mueller
# Lars Buitinck
# Alexandre Gramfort
# Nicolas Tresegnie
# License: BSD 3 clause
import warnings
import numbers
import numpy as np
import scipy.sparse as sp... | |
# Copyright 2015 SimpliVity 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 o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.