gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/python
#
# Copyright 2012 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 applic... | |
"""
Illustrates an explicit way to persist an XML document expressed using
ElementTree.
Each DOM node is stored in an individual
table row, with attributes represented in a separate table. The
nodes are associated in a hierarchy using an adjacency list
structure. A query function is introduced which can search for... | |
# Copyright 2017,2018 IBM 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 or agr... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apac... | |
from __future__ import unicode_literals
import boto
import boto3
import botocore.exceptions
from boto.exception import SQSError
from boto.sqs.message import RawMessage, Message
import requests
import sure # noqa
import time
from moto import mock_sqs
from tests.helpers import requires_boto_gte
@mock_sqs
def test_cr... | |
"""SCons.Scanner
The Scanner package for the SCons software construction utility.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the... | |
#!/usr/bin/env python2.7
#
# 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 hashlib
import os
import random
import struct
class SMP(object):
def __init__(self, secret=None):
self.p = 2410312426921032588552076022197566074856950548502459942654116941958108831682612228890093858261341614673227141477904012196503648957050582631942730706805009223062734745341073406696246014589361659... | |
import warnings
from django import http
from django.test import TestCase
from django.conf import settings
from django.utils.translation import ugettext_lazy
from django.utils.unittest import skipIf
from django.contrib.messages import constants, utils, get_level, set_level
from django.contrib.messages.api import Messag... | |
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
#!/usr/bin/env python
"""This module defines the "%scd" magic command in an IPython session.
The %scd or smart-cd command can find and change to any directory,
without having to know its exact path. In addition, this module updates
the %cd, %popd, %pushd magic commands so that they record the visited
directory in the... | |
# 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 ... | |
"""
httplib2
A caching http interface that supports ETags and gzip
to conserve bandwidth.
Requires Python 3.0 or later
Changelog:
2009-05-28, Pilgrim: ported to Python 3
2007-08-18, Rick: Modified so it's able to use a socks proxy if needed.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "C... | |
"""
SleekXMPP: The Sleek XMPP Library
Implementation of xeps for Internet of Things
http://wiki.xmpp.org/web/Tech_pages/IoT_systems
Copyright (C) 2013 Sustainable Innovation, Joachim.lindborg@sust.se, bjorn.westrom@consoden.se
This file is part of SleekXMPP.
See the file LICENSE for copying per... | |
from django.shortcuts import render as render_to_response, redirect
from django.contrib.auth import authenticate
from django.contrib.auth import login as auth_login
from django.contrib.auth import logout as auth_logout
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import revers... | |
"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.cloud.tasks_v2beta2.proto import (
cloudtasks_pb2 as google_dot_cloud_dot_tasks__v2beta2_dot_proto_dot_cloudtasks__pb2,
)
from google.cloud.tasks_v2beta2.proto import (
queue_pb2 as google_dot_cloud_dot_tasks__v2beta2... | |
# -*- coding: utf-8 -*-
import sys
from getpass import getpass
import argparse
import pkg_resources
import pyperclip
from .generator import *
from .utils import *
from .constants import *
def show_password_entropy(passwd, word_list):
"""Displays the password entropy calculation results."""
entropy = calcula... | |
import json
import logging
import sys
import traceback
from uuid import UUID
from django.core.urlresolvers import resolve
from silk import models
from silk.collector import DataCollector
from silk.config import SilkyConfig
Logger = logging.getLogger('silk')
content_types_json = ['application/json',
... | |
from __future__ import unicode_literals
"""Benchmark for SQLAlchemy.
An adaptation of Robert Brewers' ZooMark speed tests. """
import datetime
import sys
import time
from sqlalchemy import *
from sqlalchemy.testing import fixtures, engines, profiling
from sqlalchemy import testing
ITERATIONS = 1
dbapi_session = eng... | |
import sonnet as snt
import tensorflow as tf
from luminoth.models.fasterrcnn.rcnn_proposal import RCNNProposal
from luminoth.models.fasterrcnn.rcnn_target import RCNNTarget
from luminoth.models.fasterrcnn.roi_pool import ROIPoolingLayer
from luminoth.utils.losses import smooth_l1_loss
from luminoth.utils.vars import (... | |
#
# File: installerservice.py
# This module provides methods for automating the install of the
# Texo CMS engine. It will setup databases and alter configuration files.
#
# Author:
# Adam Presley
#
import os
import re
import imp
import config
import database
from bottle import redirect
from services.engine import ... | |
# coding=utf8
# 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.
"""Manages a project checkout.
Includes support for svn, git-svn and git.
"""
import fnmatch
import logging
import os
import re
import shu... | |
"""A Dialog Window to display the result of a :class:`jukeboxcore.action.ActionCollection`."""
import abc
from PySide import QtGui, QtCore
from jukeboxcore.gui.main import JB_Dialog, JB_MainWindow
from jukeboxcore.gui.actionreport import create_action_model
from jukeboxcore.gui.widgetdelegate import WidgetDelegate, W... | |
# ----------------------------------------------------------------------------
# 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... | |
import os
import sys
import traceback
import re
import time
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.header.checker as checker_header
import zstackwoodpecker.header.vm as vm_header
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_l... | |
from distutils.version import StrictVersion
from datetime import datetime
from markupsafe import Markup
from flask import current_app
# //cdnjs.cloudflare.com/ajax/libs/moment.js/2.27.0/moment-with-locales.min.js
default_moment_version = '2.29.1'
default_moment_sri = ('sha512-LGXaggshOkD/at6PFNcp2V2unf9LzFq6LE+sChH7ce... | |
import sys
from enum import Enum
import itertools
import pygame
import snakes.plugins
from sortedcontainers import SortedList, SortedSet, SortedDict
snakes.plugins.load('gv', 'snakes.nets', 'nets')
from nets import *
################################################################
# (c) Copyright 2017 all right res... | |
"""fontTools.t1Lib.py -- Tools for PostScript Type 1 fonts (Python2 only)
Functions for reading and writing raw Type 1 data:
read(path)
reads any Type 1 font file, returns the raw data and a type indicator:
'LWFN', 'PFB' or 'OTHER', depending on the format of the file pointed
to by 'path'.
Raises an error when th... | |
# coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.gi... | |
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
from pysnmp.entity.rfc3413 import ntfrcv
from pysnmp.proto.api import v2c
from pysnmp import debug
import os
import argparse
import time
import string
####### The SNMP Agent Daemon #######
def agent(verbose,quiet,server_ip0,server... | |
import sys
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from django.conf import settings
from django.utils.importlib import import_module
import mock
from oscar.test.testcases import WebTestCase
from oscar.test import factories
from . import CheckoutMixin
# Python 3 co... | |
#!/usr/bin/env python
import logging
import random
import numpy.random
from mann import agent
import mann.helper
import mann.lens_in_writer
logger = logging.getLogger(__name__)
def setup_logger(fh, formatter):
logger.setLevel(logging.DEBUG)
fh = fh
# fh.setLevel(logging.DEBUG)
fh.setLevel(logging.CR... | |
"""
This file is part of the everest project.
See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.
Created on Feb 4, 2011.
"""
from datetime import datetime
from datetime import timedelta
from pyramid.compat import iteritems_
import pytest
from everest.querying.operators import UnaryOperator
... | |
#!/usr/bin/env python
################################################################################
# Copyright (c) 2016 Thomas McAllen #
# All Rights Reserved. #
# ... | |
import StringIO
from novaclient.v1_1 import servers
from tests import utils
from tests.v1_1 import fakes
cs = fakes.FakeClient()
class ServersTest(utils.TestCase):
def test_list_servers(self):
sl = cs.servers.list()
cs.assert_called('GET', '/servers/detail')
[self.assertTrue(isinstance... | |
from __future__ import print_function
from builtins import map
from builtins import range
import sys
import os
from flask_testing import TestCase
from flask import request
from flask import url_for, Flask
import unittest
import requests
from requests.exceptions import ReadTimeout
import time
from object_service import ... | |
"""
MIT License
Copyright (c) 2017 Code Society
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, modify, merge, publish, ... | |
import json
import logging
from datetime import date, timedelta
from django.conf import settings
from django.http import Http404, HttpResponseRedirect, HttpResponse
from django.shortcuts import get_object_or_404, render
from django.views.decorators.http import require_GET
from tower import ugettext as _
from kitsune... | |
"""
How to run locally:
Start your local registry:
`INDEX_ENDPOINT=https://indexstaging-docker.dotcloud.com \
SETTINGS_FLAVOR=test DOCKER_REGISTRY_CONFIG=config_sample.yml docker-registry`
Start the tests:
`DOCKER_REGISTRY_ENDPOINT=http://localhost:5000 SETTINGS_FLAVOR=test \
DOCKER_REGISTRY_CONFIG=config_sample.yml ... | |
# Copyright 2013 Red Hat, 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... | |
#!/usr/bin/env python
# Copyright 2015 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.
"""MB - the Meta-Build wrapper around GYP and GN
MB is a wrapper script for GYP and GN that can be used to generate build files
for se... | |
import logging
from collections import namedtuple
import datetime, math
import tkp.db
from tkp.db.generic import get_db_rows_as_dicts
from tkp.db.database import Database
from tkp.db.orm import DataSet, Image
from tkp.db import general as dbgen
from tkp.db import nulldetections
import tkp.testutil.data as testdata
im... | |
from __future__ import print_function
import re
import sys
from . import common
if sys.version_info[0] > 2:
class string:
expandtabs = str.expandtabs
else:
import string
# RegEx: this is where the magic happens.
##### Assembly parser
ASM_FUNCTION_X86_RE = re.compile(
r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*... | |
"""AuthZ Adapter implementations of commenting managers."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
# Number of methods are defined in specification
# pylint: disable=too-many-ancestors
# Inheritance defined in specification
from . im... | |
# -*- coding: utf-8 -*-
"""Influence and Outlier Measures
Created on Sun Jan 29 11:16:09 2012
Author: Josef Perktold
License: BSD-3
"""
from statsmodels.compat.python import lzip
from collections import defaultdict
import numpy as np
from statsmodels.regression.linear_model import OLS
from statsmodels.tools.decorato... | |
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2012 Isaku Yamahata <yamahata at private email ne jp>
#
# 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
#
# h... | |
# -*- coding: utf-8 -*-
#
# Copyright 2014 Rackspace, Inc.
# Copyright 2015 Red Hat, 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://ww... | |
#!/usr/bin/env python
"""
Perform data manipulation tasks in project workflow
"""
import os
try:
import urllib.request as urllib2
except ImportError:
import urllib2
import boto
import numpy as np
import pandas as pd
import boto.s3
from boto.s3.key import Key
from scipy.stats import randint as sp_randint
from... | |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
str_to_int,
unescapeHTML,
unified_strdate,
url_or_none,
)
from ..aes import aes_decrypt_text
class YouPornIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?youporn\.com/(... | |
"""
Test the pipeline module.
"""
import numpy as np
from scipy import sparse
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_array_equal
... | |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2007 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... | |
# 6.00 Problem Set 3A Solutions
#
# The 6.00 Word Game
# Created by: Kevin Luu <luuk> and Jenna Wiens <jwiens>
#
#
import random
import string
VOWELS = 'aeiou'
CONSONANTS = 'bcdfghjklmnpqrstvwxyz'
HAND_SIZE = 7
SCRABBLE_LETTER_VALUES = {
'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1, 'f': 4, 'g': 2, 'h': 4, 'i': 1, 'j'... | |
# Copyright 2020 Nexenta by DDN, 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 unittest import TestCase
import unittest
import os
import datetime
import requests_mock
from blueflood import TenantBluefloodFinder, TenantBluefloodReader, TenantBluefloodLeafNode, \
BluefloodClient, auth, calc_res, secs_per_res
#To run these test you need to set up the environment vars below
try:
auth_api... | |
# -*- coding:utf8 -*-
# File : opr.py
# Author : Jiayuan Mao
# Email : maojiayuan@gmail.com
# Date : 3/18/17
#
# This file is part of TensorArtist.
from tartist.app.rl.base import DiscreteActionSpace
from tartist.app.rl.base import ProxyRLEnvironBase
from tartist.core import get_logger
from tartist.core.utils.met... | |
# coding: utf-8
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Test the Quantity class and related.
"""
from __future__ import (absolute_import, unicode_literals, division,
print_function)
import copy
import decimal
import numpy as np
from numpy.testing import (assert... | |
import mozprocess
import subprocess
from .base import Browser, ExecutorBrowser, require_arg
from .base import get_timeout_multiplier # noqa: F401
from .base import NullBrowser # noqa: F401
from .chrome import executor_kwargs as chrome_executor_kwargs
from ..webdriver_server import ChromeDriverServer
from ..executor... | |
import os
import fnmatch
import shutil
from collections import defaultdict
from conans.util.files import mkdir
def report_copied_files(copied, output):
ext_files = defaultdict(list)
for f in copied:
_, ext = os.path.splitext(f)
ext_files[ext].append(os.path.basename(f))
if not ext_files:... | |
# This file is part of beets.
# Copyright 2013, Adrian Sampson.
#
# 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, ... | |
from unittest import mock
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from django.db import connection
from django.db.models import Prefetch, QuerySet, prefetch_related_objects
from django.db.models.query import get_prefetcher
from django.db.models.s... | |
# fly ArduCopter in SITL
# Flight mode switch positions are set-up in arducopter.param to be
# switch 1 = Circle
# switch 2 = Land
# switch 3 = RTL
# switch 4 = Auto
# switch 5 = Loiter
# switch 6 = Stabilize
import util, pexpect, sys, time, math, shutil, os
from common import *
from pymavlink import mavut... | |
from collections import OrderedDict
from functools import partial
from classytags.utils import flatten_context
from django.contrib.sites.models import Site
from django.template import Context
from django.utils.functional import cached_property
from django.utils.module_loading import import_string
from django.utils.saf... | |
#
# File : menuconfig.py
# This file is part of RT-Thread RTOS
# COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 ... | |
# -*- test-case-name: twisted.python.test.test_release -*-
# Copyright (c) 2007-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Twisted's automated release system.
This module is only for use within Twisted's release system. If you are anyone
else, do not use it. The interface and behaviour will chan... | |
"""Compatibility
This module is to ensure the compatibility between Maya, Avalon and Pyblish
is maintained.
"""
import maya.cmds as cmds
import os
import logging
import avalon.pipeline
log = logging.getLogger(__name__)
create = avalon.pipeline.create
def remove_googleapiclient():
"""Check if the compatibility... | |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import posixpath
import traceback
import xml.dom.minidom as xml
from xml.parsers.expat import ExpatError
from appengine_url_fetcher import AppEngineUrlF... | |
#!/usr/bin/env python
import sys
import os
import re
import string
import glob
import argparse
import subprocess
import tempfile
import shutil
import urllib
PLIST_BUDDY = "/usr/libexec/PlistBuddy"
MOBILE_PROVISIONS = "~/Library/MobileDevice/Provisioning Profiles/*.mobileprovision"
OUTPUT_IPA = "Output.ipa"
ICON_PNG =... | |
''' Tests for fortran sequential files '''
import tempfile
import shutil
from os import path
from glob import iglob
import re
from numpy.testing import assert_equal, assert_allclose
import numpy as np
import pytest
from scipy.io import (FortranFile,
_test_fortran,
FortranE... | |
"""
from search_command import SearchCommand
import sys
class Echo(SearchCommand):
def __init__(self, what_to_echo="Hello World"):
# Save the parameters
self.what_to_echo = what_to_echo
# Initialize the class
SearchCommand.__init__( self, run_in_preview=True,... | |
import pytest
from Analyst1 import *
MOCK_SERVER: str = 'mock.com'
MOCK_USER: str = 'mock'
MOCK_PASS: str = 'mock'
MOCK_INDICATOR: str = 'mock-indicator'
BASE_MOCK_JSON: dict = {
'type': 'domain',
'value': {
'name': f'{MOCK_INDICATOR}',
'classification': 'U'
},
'description': None,
... | |
from __future__ import absolute_import
import sys
from six import StringIO
from mock import patch
from .testcases import DockerClientTestCase
from fig.cli.main import TopLevelCommand
class CLITestCase(DockerClientTestCase):
def setUp(self):
super(CLITestCase, self).setUp()
self.old_sys_exit = sy... | |
from __future__ import unicode_literals
from collections import OrderedDict
import hashlib
import os
import posixpath
import re
import json
from django.conf import settings
from django.core.cache import (caches, InvalidCacheBackendError,
cache as default_cache)
from django.core.exception... | |
# 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.
# Monkeypatch IMapIterator so that Ctrl-C can kill everything properly.
# Derived from https://gist.github.com/aljungberg/626518
from __future__ import prin... | |
##
# This module implements a hierarchy of authorities and performs a similar
# function as the "tree" module of the original SFA prototype. An HRN
# is assumed to be a string of authorities separated by dots. For example,
# "planetlab.us.arizona.bakers". Each component of the HRN is a different
# authority, with the l... | |
"""
bjson/connection.py
Asynchronous Bidirectional JSON-RPC protocol implementation over TCP/IP
Copyright (c) 2010 David Martinez Marti
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
... | |
# Copyright 2015 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.
"""Provides a variety of device interactions with power.
"""
# pylint: disable=unused-argument
import collections
import contextlib
import csv
import loggin... | |
#
# 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
# ... | |
import sys
import socket
import threading
user_recv_tasker_name_get_stat = "block"
user_message_sender_name_get_stat = "block"
login_user_socket = {}
login_user_message = {}
login_user_list = []
login_user_name = ""
def log_in_check( user_name , password ):
if user_name == "Mark":
if password == "IAMMA... | |
import contextlib
import numpy as np
import pytest
from pandas import DataFrame
import pandas._testing as tm
from pandas.io.excel import ExcelWriter
from pandas.io.formats.excel import ExcelFormatter
pytest.importorskip("jinja2")
# jinja2 is currently required for Styler.__init__(). Technically Styler.to_excel
# co... | |
import os
import uuid
#from osipkd.tools import row2dict, xls_reader
from datetime import datetime
from sqlalchemy import not_, func
from pyramid.view import (
view_config,
)
from pyramid.httpexceptions import (
HTTPFound,
)
import colander
from deform import (
Form,
widget,
ValidationFailur... | |
# Copyright (C) Mesosphere, Inc. See LICENSE file for details.
"""Module that defines the behaviour common to all requests handlers used by mocker.
"""
import abc
import http.server
import json
import logging
import socket
import time
import traceback
from urllib.parse import parse_qs, urlparse
from exceptions impo... | |
import multiprocessing
import os
import shutil
import subprocess
import logging
import lib.db as db
import lib.config as config
from lib.exceptions import UnableToAlignException
def create_tiff(raw_path, tmp_path):
exe = os.path.join(config.get_path('ufraw_bindir'), 'ufraw-batch')
args = config.get_exe_args('... | |
# Copyright 2012 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/LI... | |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | |
import numpy as np
try:
from .im2col_cython import col2im_cython, im2col_cython
except ImportError:
print('run the following from the cs231n directory and try again:')
print('python setup.py build_ext --inplace')
print('You may also need to restart your iPython kernel')
from .im2col import (
# get_... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""
frappe.translate
~~~~~~~~~~~~~~~~
Translation tools for frappe
"""
import frappe, os, re, codecs, json
from frappe.utils.jinja import render_include
from frappe.utils im... | |
"""
Linear Discriminant Analysis (LDA)
"""
# Authors: Clemens Brunner
# Martin Billinger
# Matthieu Perrot
# Mathieu Blondel
# License: BSD 3-Clause
from __future__ import print_function
import warnings
import numpy as np
from scipy import linalg
from .externals.six import string_types
f... | |
import asyncio
import pytest
from click.testing import CliRunner
pytest.importorskip("requests")
import requests
import sys
import os
from time import sleep
import distributed.cli.dask_worker
from distributed import Client, Scheduler
from distributed.metrics import time
from distributed.utils import sync, tmpfile, p... | |
from django.db import models
class CompanyManager(models.Manager):
def get_for_index(self, index):
return self.get(index=index)
class Company(models.Model):
"""
A Paranuaran company.
"""
# The index of the company record in the JSON source data
index = models.PositiveIntegerField(u... | |
# -*- coding: 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 model 'TrackedUser'
db.create_table('sentry_trackeduser', (
('id', self.gf('sentry.db.m... | |
from __future__ import division # so that a / b == float(a) / b
import fire
from ep.evalplatform import draw_details
from ep.evalplatform.compatibility import plot_comparison_legacy_parse
from ep.evalplatform.parsers import *
from ep.evalplatform.parsers_image import *
from ep.evalplatform.plotting import Plotter
fr... | |
# 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 2011 Nicholas Bray
#
# 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... | |
import logging
import operator
import os
import pickle
import threading
from collections import deque, namedtuple
from functools import reduce
from itertools import chain
from typing import Optional
import numpy as np
from django.conf import settings
from django.core.cache import cache
from django.utils.functional imp... | |
"""Testing for K-means"""
import re
import sys
import numpy as np
from scipy import sparse as sp
import pytest
from sklearn.utils._testing import assert_array_equal
from sklearn.utils._testing import assert_allclose
from sklearn.utils.fixes import threadpool_limits
from sklearn.base import clone
from sklearn.excepti... | |
from __future__ import unicode_literals
import threading
from datetime import datetime, timedelta
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.db import DEFAULT_DB_ALIAS, DatabaseError, connections
from django.db.models.fields import Field
from django.db.models.manager im... | |
"""
ARIMA model class.
Author: Chad Fulton
License: BSD-3
"""
from statsmodels.compat.pandas import Appender
import warnings
import numpy as np
from statsmodels.tools.data import _is_using_pandas
from statsmodels.tsa.statespace import sarimax
from statsmodels.tsa.statespace.kalman_filter import MEMORY_CONSERVE
from... | |
"""This tutorial introduces the LeNet5 neural network architecture
using Theano. LeNet5 is a convolutional neural network, good for
classifying images. This tutorial shows how to build the architecture,
and comes with all the hyper-parameters you need to reproduce the
paper's MNIST results.
This implementation simpl... | |
"""Test case implementation"""
import sys
import difflib
import pprint
import re
import unittest
import warnings
from django.utils.unittest import result
from django.utils.unittest.util import\
safe_repr, safe_str, strclass,\
unorderable_list_difference
from django.utils.unittest.compatibility import wraps
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.