gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright (c) 2012-2014 Andy Davidoff http://www.disruptek.com/
#
# 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... | |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | |
# 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 by applicable law or ag... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
PyTorch implementation of a simple 2-layer-deep LSTM for genre classification of musical audio.
Feeding the LSTM stack are spectral {centroid, contrast}, chromagram & MFCC features (33 total values)
Question: Why is there a PyTorch implementation, when we ... | |
import pytest
import numpy as np
from datetime import timedelta
import pandas as pd
import pandas.util.testing as tm
from pandas import (timedelta_range, date_range, Series, Timedelta,
DatetimeIndex, TimedeltaIndex, Index, DataFrame,
Int64Index)
from pandas.util.testing import ... | |
from datetime import datetime, timedelta
import os
import sys
import subprocess
import hashlib
import re
from io import BytesIO
from contextlib import closing
import yaml
import requests
from tqdm import tqdm
from .utils import ydump, mkdir_p, slugify
TRANSITFEEDS_API_URL = 'https://api.transitfeeds.com/v1/'
def ... | |
import datetime
import re
from typing import Any, Dict, List, Mapping
from unittest import mock
import orjson
from django.conf import settings
from confirmation.models import Confirmation, create_confirmation_link
from zerver.lib.actions import (
do_add_deactivated_redirect,
do_change_plan_type,
do_change... | |
from kinto.core.testing import unittest
from .support import BaseWebTest
BUCKET_URL = '/buckets/blog'
COLLECTION_URL = '/buckets/blog/collections/articles'
RECORDS_URL = '/buckets/blog/collections/articles/records'
SCHEMA = {
"title": "Blog post schema",
"type": "object",
"properties": {
"title... | |
import imp
import importlib
import os
import sys
import time
import traceback
import zipfile
import sublime
import sublime_api
api_ready = False
application_command_classes = []
window_command_classes = []
text_command_classes = []
view_event_listener_classes = []
view_event_listeners = {}
all_command_classes = [... | |
"""Helpers for script and condition tracing."""
from __future__ import annotations
from collections import deque
from collections.abc import Generator
from contextlib import contextmanager
from contextvars import ContextVar
from functools import wraps
from typing import Any, Callable, cast
from homeassistant.helpers.... | |
#Copyright Nick Prowse 2017. Code Licenced under Apache 2.
#Version 11. 21/10/2017.
#Programmed & tested in Python 2.76 only
#This program tests factorise.py - time for factorising first 1*10^20 numbers.
#Results are: Number input, average_time of factorisations, cumulative_time of factorisations, and total time for al... | |
from pyops.utils import is_elapsed_time, parse_time, getMonth
import pandas as pd
from datetime import datetime
import os
class EVF:
def __init__(self, fname):
# Variable initialization
self.WTF = list()
self.meta = dict()
self.header = list()
self.ref_date = None
... | |
from __future__ import unicode_literals
import copy
import datetime
import boto.redshift
from botocore.exceptions import ClientError
from moto.compat import OrderedDict
from moto.core import BaseBackend, BaseModel
from moto.core.utils import iso_8601_datetime_with_milliseconds
from moto.ec2 import ec2_backends
from .... | |
# Copyright 2011 OpenStack Foundation
# Copyright 2012 Justin Santa Barbara
# 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/l... | |
import os
import sys
import argparse
import ConfigParser
import time
import requests
import urllib3
import json
import socket
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
# Enable to disable all alerts
DISABLE_ALERTS = False
# Simulate a fake migration (host mainte... | |
# Copyright 2022 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | |
# coding: utf-8
"""
Tests of the isentropic package.
References
----------
1. NACA-TR-1135 http://hdl.handle.net/2060/19930091059
2. Anderson, J.D.: "Modern compressible flow", 3rd edition.
"""
from __future__ import division, absolute_import
import numpy as np
import numpy.testing
import pytest
from skaero.gasd... | |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 19 19:44:45 2017
@author: login
"""
from collections import OrderedDict
import pandas as pd
pd.options.mode.chained_assignment = None
import numpy as np
from scipy.io import loadmat
import shutil, sys, os
from sklearn.metrics import r2_score
from sk... | |
#!/usr/bin/env python
#
# 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, softwa... | |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import module as mojom
# This module provides a mechanism for determining the packed order and offsets
# of a mojom.Struct.
#
# ps = pack.PackedStruct(struc... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 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.... | |
import pytest
def _setup_batchup_path(monkeypatch, path):
from batchup import config
def get_batchup_path_patch():
return path
monkeypatch.setattr(config, 'get_batchup_path', get_batchup_path_patch)
def _setup_batchup_temp(monkeypatch):
import tempfile
tdir = tempfile.mkdtemp()
_... | |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-01 23:15
import autoslug.fields
import common.utils
import datetime
from django.conf import settings
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
from django.utils.timezone import utc
import... | |
from collections import defaultdict
import os
import json
from logger import Logger
from util import uncamel
#Future proof a bit
try:
#Python 2
from ConfigParser import SafeConfigParser as ConfigParser
except ImportError:
#Python 3
from configparser import ConfigParser
class GameObjectMeta(type):
... | |
from django.core.management.base import BaseCommand, CommandError
from api import models
from pprint import pprint
import urllib2, urllib
import json
import sys
import datetime
def imageURLToDatabase(URL):
if URL:
return URL.replace('http://i.schoolido.lu/', '')
return None
class Command(BaseCommand):... | |
import unittest
from nose.tools import assert_equal, assert_list_equal, nottest, raises
from py_stringmatching.tokenizer.delimiter_tokenizer import DelimiterTokenizer
from py_stringmatching.tokenizer.qgram_tokenizer import QgramTokenizer
import numpy as np
import pandas as pd
from py_stringsimjoin.filter.position_fil... | |
#
# This file is a part of the normalize python library
#
# normalize is free software: you can redistribute it and/or modify
# it under the terms of the MIT License.
#
# normalize is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FI... | |
# flake8: noqa
# yapf: disable
# __import_lightning_begin__
import torch
import pytorch_lightning as pl
from torch.utils.data import DataLoader, random_split
from torch.nn import functional as F
from torchvision.datasets import MNIST
from torchvision import transforms
import os
# __import_lightning_end__
# __import_t... | |
"""Distutils script for cx_Logging.
Windows platforms:
python setup.py build --compiler=mingw32 install
Unix platforms
python setup.py build install
"""
import distutils.command.bdist_rpm
import distutils.command.build_ext
import distutils.command.install_data
import distutils.util
import os
import sys
fro... | |
# 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... | |
import re
from moto.dynamodb2.exceptions import (
InvalidTokenException,
InvalidExpressionAttributeNameKey,
)
class Token(object):
_TOKEN_INSTANCE = None
MINUS_SIGN = "-"
PLUS_SIGN = "+"
SPACE_SIGN = " "
EQUAL_SIGN = "="
OPEN_ROUND_BRACKET = "("
CLOSE_ROUND_BRACKET = ")"
COMMA... | |
#
# Copyright (C) 2009-2020 the sqlparse authors and contributors
# <see AUTHORS file>
#
# This module is part of python-sqlparse and is released under
# the BSD License: https://opensource.org/licenses/BSD-3-Clause
"""This module contains classes representing syntactical elements of SQL."""
import re
from sqlparse ... | |
#!/usr/bin/env python
#
# Dan Levin <dlevin@net.t-labs.tu-berlin.de>
# Brandon Heller <brandonh@stanford.edu>
import logging
from random import choice
import sys
import matplotlib.pyplot as plt
import networkx as nx
from resource_allocator import ResourceAllocator
logger = logging.getLogger(__name__)
class Control... | |
import simplejson
from datetime import datetime
import dateutil.parser
from django.utils.http import urlencode
from django.test import TestCase
from django.core.urlresolvers import reverse
from tastypie.resources import Resource
from tastypie import fields
from corehq.apps.groups.models import Group
from corehq.pillo... | |
# This file is a part of OMPC (http://ompc.juricap.com/)
import sys
sys.path += ['../outside/ply']
OCTAVE = False
# TODO
#
# - make the no ';' print-out an option, the output is ugly
# - add 1 2, or anything like that, everything after the NAME is considered
# a string
# - print -png ... and similar
_keywords = ... | |
import argparse
import socket
import sys
import numpy as np
import random as random
from random import sample
import copy as cp
from HandEvaluator import HandEvaluator
from Brains import RationalBrain
from Brains import AdaptiveBrain
np.set_printoptions(linewidth=300)
class Johnny:
"""
self.bot_name = bot_n... | |
#!/usr/bin/env python3
"""
Handles interactive prompts, part of the Old Spice Voicemail Generator.
Each function prompts the user for a different piece of information.
Functions: gender, phone, reason, ending, filename, show_settings, confirm
"""
import sys
__author__ = 'Tony Zhaocheng Tan'
__copyright__ = "Copyri... | |
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import logging
from collections import defaultdict
from dataclasses import dataclass
from pants.backend.go.target_types import (
GoBinaryDependenci... | |
# Copyright (c) 1996-2015 PSERC. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Tests for step-controlled PIPS-based AC optimal power flow.
"""
from os.path import dirname, join
from numpy import array, ones, zeros, Inf, r_, ix_, argsort,... | |
# -*- coding: utf-8 -*-
from random import random
from math import cos, pi
from functools import lru_cache, partial
WIDTH = 10
HEIGHT = 16
MAX_TMP = 40
TMP_1 = 26
BLOCK_SIZE_H = 15
MAX_ENERGY = 10
class FailedException(BaseException):
pass
class InsufficientEnergyException(BaseException):
def __init__(self,... | |
"""
lineinfo.py -- dealing with Doom linedef trigger types.
Provides functions to create a human-readable description
code from a trigger number, and the inverse operation.
Guide to Trigger Description Codes (R):
Example: "FLOOR SR UP SLOW CRUSH LNC-8"
Categories:
DOOR - Doors (regular and locked)
... | |
# Copyright (c) 2015 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | |
import hashlib
from datetime import datetime
from werkzeug import generate_password_hash, check_password_hash, \
cached_property
from flaskext.sqlalchemy import BaseQuery
from flaskext.principal import RoleNeed, UserNeed, Permission
from newsmeme.extensions import db
from newsmeme.permissions import null
from n... | |
"""
This module has been written to convert transcribed commentaries from text
files to TEI compatible XML.
Funding is provided by an ERC funded project studying Arabic commentaries on
the Hippocratic Aphorisms. The Principal Investigator is Peter E. Pormann,
The University of Manchester.
It is anticipated the module... | |
# Copyright (C) 2009 Duncan McGreggor <duncan@canonical.com>
# Licenced under the txaws licence available at /LICENSE in the txaws source.
from txaws.credentials import AWSCredentials
from txaws.ec2.client import EC2Client
try:
from txaws.s3.client import S3Client
except ImportError:
s3clientSkip = ("S3Client ... | |
# coding: utf-8
"""
Copyright 2016 SmartBear Software
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... | |
#
# 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... | |
# coding: utf-8
# 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 by ap... | |
import os
import sys
import vtkAll as vtk
import math
import time
import types
import functools
import numpy as np
from director import transformUtils
from director import lcmUtils
from director.timercallback import TimerCallback
from director.asynctaskqueue import AsyncTaskQueue
from director import objectmodel as om... | |
"""
Customer Model Tests.
"""
import decimal
import sys
from copy import deepcopy
from unittest.mock import ANY, patch
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.utils import timezone
from stripe.error import InvalidRequestError
from djstripe import settings as djstrip... | |
'''
Created on Jul 31, 2014
@author: tangliuxiang
'''
import subprocess
import tempfile
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from formatters.log import Log
DEBUG = False
DD_BLOCK_SIZE = 512
class Shell(object):
""" Subprocess to... | |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
'''
Image assessment algorithms. Typical overlap and error computation
measures to evaluate results from other processing units.
Change directory to provide relative paths for doctests
>>> import o... | |
# Copyright 2015 NEC 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 required ... | |
import sqlite3
from library.app import app
import library.database as database
import flask
from flask import jsonify
import library.session as session
class SiteNotFound(Exception):
pass
class RoomNotFound(Exception):
pass
def _serialize_sites(rooms):
site_indexes = {}
sites = []
for room in ... | |
# #
# Copyright (c) 2011-2017 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 ... | |
import random
import time
import itertools
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn import preprocessing
from keras.preprocessing import sequence
from keras.utils import np_utils
from keras.models import Sequential
from keras.layers import Dense, Activat... | |
'''
Created on Jul 10, 2017
@author: prkrj
'''
import pytest
import copy
import HNFGen as hg
def read_file(list_file):
file = open(list_file, 'r')
i = 0
matrix = []
final_list = []
for line in file:
row = line.split()
if row != []:
new_row = []
for value in... | |
import inspect
from collections import OrderedDict
from datetime import datetime
from decimal import Decimal
from django.conf import settings
from django.contrib.contenttypes.fields import GenericRel
from django.db import models
from django.db.models import FieldDoesNotExist, ManyToManyRel, ManyToOneRel
from django.ut... | |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
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... | |
#Quizzler Command Line Application
#Author : Mabishi Elizabeth for Andela Kenya
#Date: 5th May 2016
#Version 1.0
# Library to provide way of using operating system dependent functionality i.e.make directories
import os
# Library to manipulate JavaScript Object Notation files with python
import json
# Library to help... | |
import logging
LOG = logging.getLogger(__name__)
# Parameter operations. Just needed if we would get the paramset-descriptions to do some auto-configuration magic.
PARAM_OPERATION_READ = 1
PARAM_OPERATION_WRITE = 2
PARAM_OPERATION_EVENT = 4
PARAM_UNREACH = 'UNREACH'
PARAMSET_VALUES = 'VALUES'
class HMGeneric():
... | |
"""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 or agreed to in writing, software
dis... | |
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
import base64
import binascii
from contextlib import closing
import functools
import sys
import threading
from tornado.escape import utf8
from tornado.httpclient import HTTPRequest, HTTPResponse, _RequestProxy, HTT... | |
# Copyright 2017 Keegan Joseph Brophy
#
# 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... | |
# 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... | |
"""plugins template tag root hooks.
"""
from django.conf import settings
from django.db.models.loading import get_app
from django import template
from inspect import getargspec
from django.template.context import Context
from django.utils.functional import curry
from django.utils.encoding import smart_str
from django.t... | |
# 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 __future__ import division
from io import BytesIO
import math
import numpy
from PIL import Image
from six import PY3
from ._image import window_batch_bchw
from . import ExpectsAxisLabels, SourcewiseTransformer
from .. import config
class ImagesFromBytes(SourcewiseTransformer):
"""Load from a stream of byte... | |
"""BleBox cover entities tests."""
import logging
from unittest.mock import AsyncMock, PropertyMock
import blebox_uniapi
import pytest
from homeassistant.components.cover import (
ATTR_CURRENT_POSITION,
ATTR_POSITION,
DEVICE_CLASS_DOOR,
DEVICE_CLASS_GATE,
DEVICE_CLASS_SHUTTER,
STATE_CLOSED,
... | |
# Copyright (c) 2010 Spotify AB
# Copyright (c) 2010-2011 Yelp
#
# 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, m... | |
from datetime import date, datetime
import os
import pytz
import re
import tempfile
import traceback
from xml.dom import Node
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.core.exceptions import PermissionDenied
from django.c... | |
# -*- 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
#... | |
import numpy as np
import pytest
from scipy import sparse
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_array_equal
from sklearn.utils import check_random_state
from sklearn.utils._testing import assert_allclose
from sklearn.datasets import make_regression
from sklearn.linear_mo... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
import theano
import theano.tensor as T
floatX = theano.config.floatX
import numpy as np
import time, datetime
import sys
import logging
internal_logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG)
from mozi.log import Log
from mozi.utils.theano_utils import shared_zeros
from mozi.utils.... | |
#
# Copyright (c) SAS Institute 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... | |
# coding=utf-8
# Copyright 2019 The Authors of RL Reliability Metrics.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | |
##########################################################################
#
# Copyright (c) 2012, John Haddon. 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 so... | |
from google.appengine.ext import ndb
from controllers.api.api_district_controller import ApiDistrictListController, ApiDistrictEventsController, ApiDistrictRankingsController
from controllers.api.api_event_controller import ApiEventController, ApiEventTeamsController, \
... | |
# 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.
"""Presubmit script for Chromium JS resources.
See chrome/browser/PRESUBMIT.py
"""
import regex_check
class JSChecker(object):
def __init__(self, i... | |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | |
# -*- coding: utf-8 -*-
# TenderComplaintResourceTest
def create_tender_complaint(self):
response = self.app.post_json('/tenders/{}/complaints'.format(
self.tender_id), {
'data': {'title': 'complaint title', 'description': 'complaint description', 'author': self.test_author,
'st... | |
# yellowbrick.model_selection.validation_curve
# Implements a visual validation curve for a hyperparameter.
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Sat Mar 31 06:27:28 2018 -0400
#
# ID: validation_curve.py [] benjamin@bengfort.com $
"""
Implements a visual validation curve for a hyperparamet... | |
# Copyright (c) 2010 Cloud.com, Inc
# Copyright 2012 Cloudbase Solutions Srl
# 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/... | |
#!/usr/bin/env python
# encoding: utf-8
"""
Copyright (c) 2010 The Echo Nest. All rights reserved.
Created by Tyler Williams on 2010-04-25.
The Artist module loosely covers http://developer.echonest.com/docs/v4/artist.html
Refer to the official api documentation if you are unsure about something.
"""
import util
from... | |
#
# 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... | |
import tensorflow as tf
from luminoth.datasets.base_dataset import BaseDataset
from luminoth.utils.image import (
resize_image_fixed, resize_image, flip_image, random_patch, random_resize,
random_distortion, expand
)
DATA_AUGMENTATION_STRATEGIES = {
'flip': flip_image,
'patch': random_patch,
'resi... | |
from unittest import mock
from django.utils import timezone
from freezegun import freeze_time
from rest_framework import test
from waldur_mastermind.common.utils import parse_datetime
from waldur_mastermind.invoices import models as invoices_models
from waldur_mastermind.marketplace import callbacks
from waldur_maste... | |
#!/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
# "Li... | |
"""The WaveBlocks Project
IOM plugin providing functions for handling
linear combinations of Hagedorn wavepackets.
@author: R. Bourquin
@copyright: Copyright (C) 2013, 2016 R. Bourquin
@license: Modified BSD License
"""
import numpy as np
def add_lincombhawp(self, parameters, timeslots=None, lincombsize=None, wave... | |
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
"""
Miscellaneous methods that help in different aspects of model validation.
Does not require explicit instantiation.
The following methods are available:
======================================= ====================================
Action Method
==================================... | |
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 8 13:33:52 2016
@author: Travis
"""
import numpy as np
from scipy import signal
import matplotlib.pyplot as plt
def med_filt(chan,kernel = 11,thresh = 3):
'''
Identifies fractures within the signal by thresholding.
Uses a median filtering method to subtr... | |
# Copyright 2012 IBM Corp.
# 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... | |
#!/usr/bin/python
#
# Copyright 2017 Google Inc.
# Copyright 2018 Open GEE 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 -*-
"""
===========
octavemagic
===========
Magics for interacting with Octave via oct2py.
.. note::
The ``oct2py`` module needs to be installed separately and
can be obtained using ``easy_install`` or ``pip``.
Usage
=====
``%octave``
{OCTAVE_DOC}
``%octave_push``
{OCTAVE_PUSH_DOC}
``%o... | |
#!/usr/bin/env python
#
# Copyright 2016 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 requir... | |
from __future__ import print_function, division
import inspect
from sympy.utilities import default_sort_key
from sympy.external import import_module
from sympy.printing.printer import Printer
import sympy
from functools import partial
theano = import_module('theano')
if theano:
ts = theano.scalar
tt = theano... | |
# -*- coding: utf-8 -*-
import json
import datetime
from flask import current_app
from flask.ext.testing import (TestCase as Base, Twill)
from app import create_app
from app.user import User, UserDetail, ADMIN, USER, ACTIVE
from config import TestConfig
from app.extensions import db, mail
class TestCase(Base):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.