gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import json
from datetime import datetime, timedelta
from decimal import Decimal
from django.conf import settings
from django.contrib.messages.storage.fallback import FallbackStorage
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.test.client import Reques... | |
# -*- coding: utf-8 -*-
import datetime
import unittest
import uuid
from voluptuous import Schema, MultipleInvalid, Required, Invalid
from zombase import validation
class TestUUID(unittest.TestCase):
def test_uuid(self):
self.assertTrue(validation.is_valid_uuid(uuid.uuid4()))
self.assertTrue(va... | |
# Copyright (c) 2005 Divmod, Inc.
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for Twisted plugin system.
"""
from __future__ import absolute_import, division
import sys, errno, os, time
import compileall
import functools
from zope.interface import Interface
from twisted.trial ... | |
import numpy as np
from nolearn_utils.iterators import get_random_idx
from nolearn_utils.image_utils import im_affine_transform
from scipy.ndimage import find_objects
def get_pair_idx(y, same_p=0.5):
n = len(y)
# labels = np.unique(y)
left_idxes = np.zeros(n, dtype=int)
right_idxes = np.zeros(n, dty... | |
#!/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... | |
from base64 import b64decode
from bson import ObjectId
import simplejson as json
from eve.tests import TestBase
from eve.tests.utils import DummyEvent
from eve.tests.test_settings import MONGO_DBNAME
from eve import STATUS_OK, LAST_UPDATED, DATE_CREATED, ISSUES, STATUS, ETAG
from eve.methods.post import post
from ev... | |
"""Provide functionality for TTS."""
from __future__ import annotations
import asyncio
import functools as ft
import hashlib
import io
import logging
import mimetypes
import os
import re
from typing import cast
from aiohttp import web
import mutagen
from mutagen.id3 import ID3, TextFrame as ID3Text
import voluptuous ... | |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -------------------------------------------------------------------------... | |
"""Guess the MIME type of a file.
This module defines two useful functions:
guess_type(url, strict=1) -- guess the MIME type and encoding of a URL.
guess_extension(type, strict=1) -- guess the extension for a given MIME type.
It also contains the following, for tuning the behavior:
Data:
knownfiles -- list of fil... | |
#!/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... | |
# Copyright 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 applicabl... | |
from __future__ import absolute_import, division, print_function
import textwrap
from distutils.version import LooseVersion
from collections import Iterator
import sys
import traceback
from contextlib import contextmanager
import warnings
import numpy as np
import pandas as pd
import pandas.util.testing as tm
from p... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" @todo docstring me """
# @todo break into phases:
# 1. Download, report bad urls
# 2. Check hashes, report bad hashes
# 3. Unzip, report by extract_dirs
from __future__ import (
absolute_import,
division,
print_function,
# unicode_literals
)
import da... | |
from pyramid_handlers import action
from pyramid.response import Response
import pyramid.httpexceptions as exc
from sqlalchemy import or_
import datetime as dt
import json
from webapp.libapp.models.calendar import Calendar
from webapp.libapp.models.event import Event
from webapp.libapp.models.calendar_permission import... | |
# -*- coding: utf-8 -*-
'''
Manage Perl modules using CPAN
.. versionadded:: 2015.5.0
'''
from __future__ import absolute_import
# Import python libs
import os
import os.path
import logging
# Import salt libs
import salt.utils
log = logging.getLogger(__name__)
# Don't shadow built-ins.
__func_alias__ = {
'list... | |
"""Utils for training neural networks.
"""
import os
import Image
from time import time
from datetime import datetime
from copy import deepcopy
import cPickle
import numpy
import skimage.transform
from skimage import color
import theano
import theano.tensor as T
from theano.sandbox.cuda.basic_ops import gpu_contiguou... | |
#!/usr/bin/env python3
import sys
import os
import shutil
import unittest
import mvtools_test_fixture
import git_test_fixture
import create_and_write_file
import path_utils
import git_wrapper
import git_lib
import collect_git_patch
import apply_git_patch
class ApplyGitPatchTest(unittest.TestCase):
def setUp(se... | |
# Copyright 2014 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.
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
from page_sets import key_mobile_site... | |
# Copyright (C) 2011, Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... | |
from rpython.flowspace.model import (Constant, Variable, SpaceOperation,
mkentrymap)
from rpython.rtyper.lltypesystem import lltype
from rpython.rtyper.lltypesystem.lloperation import llop
from rpython.translator.unsimplify import insert_empty_block, split_block
def fold_op_list(operations, constants, exit_early=... | |
from __future__ import unicode_literals
import logging
from functools import update_wrapper
from django import http
from django.core.exceptions import ImproperlyConfigured
from django.template.response import TemplateResponse
from django.utils.decorators import classonlymethod
from django.utils import six
logger = ... | |
from datetime import datetime
from decimal import Decimal
from django.contrib.auth.models import User
from django.core.files.images import ImageFile
from django.db import IntegrityError
from model_mommy import mommy
from .base import RecipeTestCase
from recipes.models import Kind, Ingredient, Recipe, WeightUnit
cla... | |
"""
dj-stripe Card Model Tests.
"""
from copy import deepcopy
from unittest.mock import ANY, patch
import pytest
import stripe
from django.contrib.auth import get_user_model
from django.test import TestCase
from stripe.error import InvalidRequestError
from djstripe import enums
from djstripe.exceptions import StripeO... | |
# -*- coding: utf-8 -*-
#
# Copyright Adam Pritchard 2020
# MIT License : https://adampritchard.mit-license.org/
#
"""
Functions and classes to be used for accessing the data stored in Google Sheets.
Google is inconsistent with terminology for "sheets" stuff. We're going to use
"sheet" or "spreadsheet" to mean the w... | |
"""
gargoyle.models
~~~~~~~~~~~~~~~
:copyright: (c) 2010 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import six
from django.conf import settings
from django.db import models
from django.utils.timezone impor... | |
## @package checkpoint
# Module caffe2.python.checkpoint
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import logging
from caffe2.python import core, context
from caffe2.python.net_builder import ops
from c... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2016 Tobias Gruetzmacher
from __future__ import absolute_import, division, print_function
from re import compile, escape, MULTILINE
from ..util import tagre
from .... | |
# pylint: disable-msg=E1101,W0612
import numpy as np
import pytest
import pandas as pd
from pandas.core.sparse.api import SparseDtype
import pandas.util.testing as tm
class TestSparseSeriesIndexing(object):
def setup_method(self, method):
self.orig = pd.Series([1, np.nan, np.nan, 3, np.nan])
se... | |
"""Config flow for UniFi.
Provides user initiated configuration flow.
Discovery of controllers hosted on UDM and UDM Pro devices through SSDP.
Reauthentication when issue with credentials are reported.
Configuration of options through options flow.
"""
import socket
from urllib.parse import urlparse
import voluptuous... | |
# encoding: utf-8
"""
Prefiltering components.
Prefilters transform user input before it is exec'd by Python. These
transforms are used to implement additional syntax such as !ls and %magic.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from keyword import ... | |
#
# 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 2015 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 os
from hashl... | |
#!/usr/bin/env python
# Copyright 2015 VMware, Inc. All rights reserved. -- VMware Confidential
"""
Base script which takes care of all VECS/VMCA/DIR_CLI operations.
"""
__author__ = 'Charudath Gopal (cgopal@vmware.com)'
__copyright__ = 'Copyright 2015, VMware Inc.'
__version__ = 1.0
import subprocess
import loggin... | |
from __future__ import unicode_literals
from django.db import models
from django.conf import settings
from django.db.models import Q
from django.core.cache import cache
from django.core.exceptions import ValidationError
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from djan... | |
#!/usr/bin/env python3
from unittest import TestCase
from tests.slackwrapper_mock import SlackWrapperMock
import unittest
from util.loghandler import log, logging
from server.botserver import BotServer
from bottypes.invalid_command import InvalidCommand
class BotBaseTest(TestCase):
def setUp(self):
self.b... | |
# -*- coding: ascii -*-
import sys, os, os.path
import unittest, doctest
try:
import pickle as pickle
except ImportError:
import pickle
from datetime import datetime, time, timedelta, tzinfo
import warnings
if __name__ == '__main__':
# Only munge path if invoked as a script. Testrunners should have setup
... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2009 Edgewall Software
# Copyright (C) 2005-2006 Emmanuel Blot <emmanuel.blot@free.fr>
# 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 ht... | |
import urllib2
import re
import bs4
from django.core.management.base import BaseCommand
from django.template.defaultfilters import slugify
from django.utils import timezone
from django.db import DatabaseError
from main.models import Country, CIAWFBEntry
VERBOSE = True
field_data_codes = {'administrative_divisions'... | |
#!/usr/bin/env python
'''@package dctopo
Data center network topology creation and drawing.
@author Brandon Heller (brandonh@stanford.edu)
This package includes code to create and draw networks with a regular,
repeated structure. The main class is StructuredTopo, which augments the
standard Mininet Topo object with... | |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
implementation for ParlAI.
"""
from parlai.core.params import ParlaiParser
import copy
import os
import pandas as p... | |
from active_learning import *
def read_labels(fname):
labels = []
fd = open(fname)
for line in fd:
line = line.strip().split(',')
id = line[0]
v = line[1][1:(len(line[1])-1)].strip().split(' ')
v = [int(vv) for vv in v]
labels.append(set(v))
fd.close()
return labels
def read_label_lst(fname):
labels =... | |
# -*- coding: utf-8 -*-
"""
.. module:: djstripe.fields.
:synopsis: dj-stripe Custom Field Definitions
.. moduleauthor:: Bill Huneke (@wahuneke)
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import decimal
from django.core.exceptions import FieldError, ImproperlyConfigure... | |
"""
mbed SDK
Copyright (c) 2011-2015 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... | |
# 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... | |
# -*- coding: utf-8 -*-
"""
PyLTI decorator implementation for chalice framework
"""
from __future__ import absolute_import
from functools import wraps
import logging
import os
from chalice import Chalice
try:
from urllib.parse import parse_qs
except ImportError:
from urlparse import parse_qs
try:
fro... | |
#
# lasheight_classify.py
#
# (c) 2012, Martin Isenburg
# LASSO - rapid tools to catch reality
#
# uses lasheight to compute the height of LiDAR points above the ground
# and uses the height information to classify the points.
#
# The LiDAR input can be in LAS/LAZ/BIN/TXT/SHP/... format.
# The LiDAR output can be in LA... | |
#!/usr/bin/python
#
# 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 a... | |
# -*- coding: utf-8 -*-
#!/usr/bin/python
#
# Author Yann Bayle
# E-mail bayle.yann@live.fr
# License MIT
# Created 30/03/2017
# Updated 30/03/2017
# Version 1.0.0
#
"""
Description of recisio.py
======================
:Example:
source activate py27
python recisio.py
"""
import os
import re
import s... | |
"""
@Author Mwaruwa Chaka, JKUAT ECE Final Year Project 2014
The overall face recognition code, using OpenCV FisherFaces
Detects, recognizes then saves the video names in a database
Cleans up after the job"""
import logging
import os , shutil
import time
import MySQLdb
# cv2 and helper:
import cv2
from lib.common impo... | |
# -*- coding: utf-8 -*-
# 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... | |
"""
Main Lomb-Scargle Implementation
The ``lombscargle`` function here is essentially a sophisticated switch
statement for the various implementations available in this submodule
"""
import warnings
import numpy as np
from astropy import units
from astropy.utils.compat.numpy import broadcast_arrays
from .slow_impl i... | |
import hashlib
import os
import re
import time
import uuid
from datetime import datetime
from django.conf import settings
from django.core.cache import cache
from django.db import connection, models
import caching.base as caching
from olympia import amo
from olympia.amo.models import ManagerBase, ModelBase
from olym... | |
# Copyright 2010 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""GDB Pretty printers and convenience functions for Go's runtime structures.
This script is loaded by GDB when it finds a .debug_gdb_scripts
section in the compi... | |
#!/usr/bin/env python
#
# Copyright (c) 2018, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | |
#
#
# =================================================================
# =================================================================
"""An os-hypervisors API extension to report additional hypervisor metrics."""
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.api.opensta... | |
from threepio import logger
from django.core.exceptions import ValidationError
from core.models.quota import get_quota, has_storage_count_quota,\
has_storage_quota
from core.models.identity import Identity
from core.models.volume import Volume
from core.models.instance_source import InstanceSource
from service.ca... | |
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 (the "License");
# you may not use this... | |
"""
dj-stripe Model Manager Tests.
"""
import datetime
import decimal
from copy import deepcopy
from unittest.mock import patch
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.utils import timezone
from djstripe.models import Charge, Customer, Plan, Subscription, Transfer
... | |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 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... | |
from steerclear import app
from steerclear.forms import RegisterForm, LoginForm
import unittest, flask
# username string min and max lengths
USERNAME_MIN_LENGTH = 1
USERNAME_MAX_LENGTH = 119
# password string min and max lengths
PASSWORD_MIN_LENGTH = 1
PASSWORD_MAX_LENGTH = 119
"""
RegisterFormTestCase
-------------... | |
from __future__ import print_function, division
from sympy.core import C, Add, Mul, Pow, S
from sympy.core.compatibility import default_sort_key, string_types
from sympy.core.sympify import _sympify
from sympy.core.mul import _keep_coeff
from sympy.printing.str import StrPrinter
from sympy.printing.precedence import p... | |
"""This directory is setup with configurations to run the main functional test.
Inspired in bcbio-nextgen code
"""
from __future__ import print_function
import os
import subprocess
import unittest
import shutil
import contextlib
import functools
from nose import SkipTest
from nose.plugins.attrib import attr
@contex... | |
# Copyright 2014 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... | |
# 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... | |
"""
.. See the NOTICE file distributed with this work for additional information
regarding copyright ownership.
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.... | |
import re
import sublime
from sublime_plugin import WindowCommand
from ..git_command import GitCommand
from ...common import util
class GsLogBase(WindowCommand, GitCommand):
_limit = 6000
def run(self, file_path=None):
self._skip = 0
self._file_path = file_path
sublime.set_timeout_as... | |
from django.apps import AppConfig
from django.apps.registry import Apps
from django.db import models
from django.db.models.options import DEFAULT_NAMES, normalize_unique_together
from django.utils import six
from django.utils.module_loading import import_by_path
class InvalidBasesError(ValueError):
pass
class P... | |
# 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 'BillingAccount.entry_point'
db.add_column(u'accounting_billingaccount', 'entry_point', sel... | |
# Copyright 2013 Huawei Technologies Co.,LTD.
# 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... | |
import os
from fabric.api import (settings, run, sudo, reboot, cd, get, put, prefix,
task, local)
from fabric.contrib.files import sed, exists, append
from crypt import crypt
from config import *
@task
def full_deploy(install_znc="yes", install_tirolbot="yes"):
"""
default is fab full_... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright 2015 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 applicable law... | |
import itertools
import functools
import six
from flex._compat import Mapping, Sequence
from flex.exceptions import (
ValidationError,
ErrorList,
ErrorDict,
)
from flex.error_messages import MESSAGES
from flex.constants import (
ARRAY,
OBJECT,
)
from flex.decorators import skip_if_not_of_type
from... | |
import math
import numpy as np
import copy
import random
import matplotlib.pyplot as plt
from matplotlib import collections as mc
import pylab as pl
def cart2pol(x, y):
rho = np.sqrt(x**2 + y**2)
phi = np.arctan2(y, x)
return(rho, phi)
def cart2pillar(x, y,nbPillar):
rho = np.sqrt(x**2 + y**2)
p... | |
#!/usr/bin/env python
'''
left elbow is in upper arm controller
Created March, 2012
@author: Peter Heim
r_shoulder.py - gateway to Arduino based arm controller
Copyright (c) 2011 Peter Heim. All right reserved.
Borrowed heavily from Mike Feguson's ArbotiX base_controller.py code.
Redistribution and use in s... | |
import logging
import os
import signal
import re
from tornado import gen
from delivery.models.db_models import StagingStatus
from delivery.exceptions import RunfolderNotFoundException, InvalidStatusException,\
ProjectNotFoundException, TooManyProjectsFound
from delivery.services.file_system_service import FileS... | |
"""Support for Ambiclimate ac."""
import asyncio
import logging
import ambiclimate
import voluptuous as vol
from homeassistant.components.climate import ClimateDevice
from homeassistant.components.climate.const import (
SUPPORT_TARGET_TEMPERATURE,
SUPPORT_ON_OFF, STATE_HEAT)
from homeassistant.const import AT... | |
# Copyright 2011 OpenStack Foundation
# Copyright 2013 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/LIC... | |
#!/usr/bin/env python
"""buildpkg.py -- Build OS X packages for Apple's Installer.app.
This is an experimental command-line tool for building packages to be
installed with the Mac OS X Installer.app application.
Please read the file ReadMe.txt for more information!
Dinu C. Gherman,
gherman@europemail.com
Septembe... | |
from cStringIO import StringIO
import calendar
import functools
import logging
import re
import time
from urllib import urlencode
import urllib2
from xml.etree import ElementTree
_log = logging.getLogger('evelink.api')
try:
import requests
_has_requests = True
except ImportError:
_log.info('`requests` not... | |
"""HTML utilities suitable for global use."""
from __future__ import unicode_literals
import re
from django.utils.safestring import SafeData, mark_safe
from django.utils.encoding import force_text, force_str
from django.utils.functional import allow_lazy
from django.utils import six
from django.utils.six.moves.urlli... | |
# This file is part of the MapProxy project.
# Copyright (C) 2010 Omniscale <http://omniscale.de>
#
# 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... | |
from __future__ import unicode_literals
import base64
import logging
import string
from datetime import datetime, timedelta
from django.conf import settings
from django.contrib.sessions.exceptions import SuspiciousSession
from django.core.exceptions import SuspiciousOperation
from django.utils import timezone
from dj... | |
from abpytools.features.regions import ChainDomains
from collections import Counter
import numpy as np
from matplotlib import pyplot as plt
from abpytools.utils.data_loader import DataLoader
import os
from abpytools.utils import PythonConfig
amino_acid_index = {"R": 0,
"N": 1,
"... | |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | |
"""
The Geod class can perform forward and inverse geodetic, or
Great Circle, computations. The forward computation involves
determining latitude, longitude and back azimuth of a terminus
point given the latitude and longitude of an initial point, plus
azimuth and distance. The inverse computation involves
determining... | |
# Copyright 2020 Datera
# 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 applic... | |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unlessf required by ap... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Tests for spline models and fitters"""
# pylint: disable=invalid-name
from astropy.utils.exceptions import AstropyUserWarning
import pytest
import unittest.mock as mk
import numpy as np
from numpy.testing import assert_allclose
from astropy.utils.co... | |
"""
An LSTM with Recurrent Dropout and the option to use highway
connections between layers.
"""
from typing import Optional, Tuple
import torch
from torch.autograd import Variable
from torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence, PackedSequence
from allennlp.common.checks import Configuratio... | |
from luminoso_api.v5_client import LuminosoClient, get_root_url
from luminoso_api.errors import (
LuminosoClientError, LuminosoServerError, LuminosoError,
LuminosoTimeoutError
)
import pytest
import requests
BASE_URL = 'http://mock-api.localhost/api/v5/'
def test_paths():
"""
Test creating a client ... | |
# 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/env python3
# LEMP MANAGER v1.1
# Copyright 2017 Matteo Mattei <info@matteomattei.com>
import sys
import os
import shutil
import subprocess
import getopt
import crypt
import pwd
from tld import get_tld
######### CONFIGURATION ############
BASE_ROOT='/home'
START_USER_NUM=5001
BASE_USER_NAME='web'
PHP_FPM_T... | |
#!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
from django.db import models
from django.utils.translation import ugettext as _
from django.contrib.auth.models import User
from common.models import Project
from celery import states
import logging
import json
from django.conf import settings
import requests
log = logging.getLogger(__name__)
TEST_STATES = (PASSE... | |
'''
Astro.IQ - Trajectory
Christopher Iliffe Sprague
christopher.iliffe.sprague@gmail.com
https://cisprague.github.io/Astro.IQ
'''
''' --------
Dependencies
-------- '''
from numpy import *
from scipy.integrate import odeint
import matplotlib.pyplot as plt
set_printoptions(suppress=True)
from ML import MLP
import os
f... | |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | |
# -*- coding: utf-8 -*-
# pylint: disable=no-self-use, line-too-long
from __future__ import absolute_import, print_function, with_statement
import sys
import unittest
from mock import Mock, patch
from nose.tools import * # pylint: disable=wildcard-import, unused-wildcard-import
import six
from six.moves import range ... | |
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.