gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python2.5
#
# Copyright 2011 the Melange 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 applic... | |
import gffutils
import tempfile
import os
import random
import gzip
from bcbio.utils import file_exists
from bcbio.distributed.transaction import file_transaction
from bcbio.provenance import do
from bcbio.log import logger
def guess_infer_extent(gtf_file):
"""
guess if we need to use the gene extent option wh... | |
#!/usr/bin/env python
# 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 os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '../../..'))
import ... | |
"""
This module contains a class that does the though work of chunk / unchunking html.
You may look at :py:class:`.boner.HtmlBoner` if you are looking for a more usable class.
"""
import copy
from collections import namedtuple
from lxml import html
#: a sentence, a list of semantic elts to insert inside sentence, ... | |
import random
import boto3
import pytest
import sure # noqa # pylint: disable=unused-import
from botocore.exceptions import ClientError
from moto import mock_ec2, settings
from tests import EXAMPLE_AMI_ID
from uuid import uuid4
from unittest import SkipTest
@mock_ec2
def test_subnets_boto3():
ec2 = boto3.resou... | |
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import logging
import threading
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Any, Callable, Iterable, Sequen... | |
#!/usr/bin/env python
# encoding: utf-8
# File : Config.py
# Author : Ben Wu
# Contact : benwu@fnal.gov
# Date : 2015 Jul 28
#
# Description :
import ROOT
#============================================================================#
#-------------------------- Drawing Config ---------... | |
from nose.tools import *
from mongoalchemy.document import Document, Index, DocumentField, MissingValueException, DocumentException, DictDoc, document_type_registry
from mongoalchemy.fields import *
from test.util import known_failure, get_session
# Document Types used in some tests
class TestDoc(Document):
int1 =... | |
# Copyright 2014 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 agre... | |
import os, time, datetime, requests, warnings, configparser
import pandas as pd
import numpy as np
import quandl
import concurrent.futures
from tqdm import tqdm
def getSingleStock(symbol, from_date, till_date):
repeat_times = 3
message = ""
for _ in range(repeat_times):
try:
data =... | |
"""
:mod:`psphere.client` - A client for communicating with a vSphere server
========================================================================
.. module:: client
The main module for accessing a vSphere server.
.. moduleauthor:: Jonathan Kinred <jonathan.kinred@gmail.com>
"""
# Copyright 2010 Jonathan Kinred... | |
#!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. 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
#
# U... | |
# Copyright (c) 2018 Intel, 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 ... | |
import numpy as np
import os
def XMLtoCSV(XMLinput):
"""
This function takes as an input the XML file that comes out of the electronic structure calculations and transforms
it into 2 CSV files. The first one is the 'X part' of the data. It contains a sample per line. Each line has a format:
atom label ... | |
#! /usr/bin/env python
"""Classes to handle Unix style, MMDF style, and MH style mailboxes."""
import rfc822
import os
__all__ = ["UnixMailbox","MmdfMailbox","MHMailbox","Maildir","BabylMailbox"]
class _Mailbox:
def __init__(self, fp, factory=rfc822.Message):
self.fp = fp
self.seekp = 0
... | |
import unittest
from test import test_support
from contextlib import closing
import gc
import pickle
import select
import signal
import subprocess
import traceback
import sys, os, time, errno
if sys.platform in ('os2', 'riscos'):
raise unittest.SkipTest("Can't test signal on %s" % sys.platform)
class HandlerBCal... | |
# -*- coding: utf-8 -*-
"""Common interacts."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import numpy as np
from vispy.gloo import Texture2D
from .base import BaseInteract
from .transfor... | |
# coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... | |
"""Application base class.
"""
import argparse
import codecs
import inspect
import locale
import logging
import logging.handlers
import os
import sys
import operator
from .complete import CompleteCommand
from .help import HelpAction, HelpCommand
from .utils import damerau_levenshtein, COST
# Make sure the cliff libr... | |
#!/usr/bin/env python
# Copyright 2014 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... | |
t1 = [ 0x02AAB17CF7E90C5E , 0xAC424B03E243A8EC ,
0x72CD5BE30DD5FCD3 , 0x6D019B93F6F97F3A ,
0xCD9978FFD21F9193 , 0x7573A1C9708029E2 ,
0xB164326B922A83C3 , 0x46883EEE04915870 ,
0xEAACE3057103ECE6 , 0xC54169B808A3535C ,
0x4CE754918DDEC47C , 0x0AA2F4DFDC0DF40C ,... | |
#!/usr/bin/env python
# -*-coding: utf8 -*-
'''
GitHub API Python SDK. (Python >= 2.5)
Michael Liao (askxuefeng@gmail.com)
Usage:
>>> gh = GitHub(username='githubpy', password='test-githubpy-1234')
>>> L = gh.users('githubpy').followers.get()
>>> L[0].id
470058
>>> L[0].login
u'michaelliao'
>>> x_ratelimit_remainin... | |
#!/usr/bin/env python
#Copyright (c) 2011 Walter Bender
#Copyright (c) 2010 Jamie Boisture
#Copyright (c) 2011 Collabora Ltd. <http://www.collabora.co.uk/>
#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 th... | |
#!/usr/bin/python
# Copyright (c) 2011 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 csv
import os
import random
NOT_AVAILABLE_STRING = 'not available'
class MediaTestMatrix:
"""This class reads video test m... | |
#!/usr/bin/env python
# Google Code Jam
# Google Code Jam 2017
# Round 1A 2017
# Problem C. Play the Dragon
from __future__ import print_function, division
import math
import sys
import random
class Game(object):
def __init__(self, hd, ad, hk, ak, b, d):
self.hd = hd
self.ad = ad
self.hk... | |
import logging
from logging import makeLogRecord
from cee_syslog_handler import NamedCeeLogger, RegexFilter, RegexRedactFilter
_DUMMY_HOST = ("localhost", 1337)
_DUMMY_PROTOCOL = 2
class CollectingNamedCeeLogger(NamedCeeLogger):
def __init__(self, *args, **kwargs):
super(CollectingNamedCeeLogger, self).... | |
# 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 applicable ... | |
kENVIRONMENT_LOOKUP = {
'ACTION': 'String',
'ADDITIONAL_SDKS': 'String',
'ALTERNATE_GROUP': 'String',
'ALTERNATE_MODE': 'String',
'ALTERNATE_OWNER': 'String',
'ALTERNATE_PERMISSIONS_FILES': 'StringList',
'ALWAYS_SEARCH_USER_PATHS': 'Boolean',
'APPLE_INTERNAL_DEVELOPER_DIR': 'Path',
... | |
# -*- coding: utf-8 -*-
""" Test for USA address parser """
import re
import pytest
from pyap import utils
from pyap.packages import six
import pyap.source_US.data as data_us
def execute_matching_test(input, expected, pattern):
match = utils.match(pattern, input, re.VERBOSE)
is_found = match is not None
... | |
#!/usr/bin/env python
"""
The JS Shell Test Harness.
See the adjacent README.txt for more details.
"""
import os, sys, textwrap
from copy import copy
from subprocess import list2cmdline, call
from lib.results import NullTestOutput
from lib.tests import TestCase
from lib.results import ResultsSink
from lib.progressba... | |
# Uses the HID API introduced in Mac OS X version 10.5
# http://developer.apple.com/library/mac/#technotes/tn2007/tn2187.html
from ctypes import *
from ctypes import util
# Load frameworks
iokit = cdll.LoadLibrary(util.find_library('IOKit'))
cf = cdll.LoadLibrary(util.find_library('CoreFoundation'))
# Core Foundatio... | |
# 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 ... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
# -*- 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... | |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet backup features.
Test case is:
4 nodes. 1 2 and 3 send transactions between each other... | |
# Copyright 2012 NEC Corporation
#
# 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/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadat... | |
#!/usr/bin/env python
"""
Analyze docstrings to detect errors.
If no argument is provided, it does a quick check of docstrings and returns
a csv with all API functions and results of basic checks.
If a function or method is provided in the form 'pandas.function',
'pandas.module.class.method', etc. a list of all error... | |
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
#!/usr/bin/env python
#
# Use the raw transactions API to spend zapcards received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a zapcardd or Zap... | |
# 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 a... | |
import pytest
import numpy as np
from numpy.testing import assert_allclose
from quimb import (
ham_heis,
expec,
plus,
is_eigenvector,
eigh,
heisenberg_energy,
)
from quimb.tensor import (
MPS_rand_state,
MPS_product_state,
MPS_computational_state,
MPO_ham_ising,
MPO_ham_XY... | |
# Copyright 2012 Nebula, Inc.
# Copyright 2013 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... | |
"""
Copyright 2015 Jatinshravan
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... | |
"""Utilities for implementing `nbio_interface.AbstractIOServices` for
pika connection adapters.
"""
import collections
import errno
import functools
import logging
import numbers
import os
import socket
import ssl
import sys
import traceback
from rez.vendor.pika.adapters.utils.nbio_interface import (AbstractIORefere... | |
#!/usr/bin/env python
#------------------------------------------------------------------------------
#
# Generate EOxServer JSON range type from ENVISAT product
#
# Project: XML Metadata Handling
# Authors: Martin Paces <martin.paces@eox.at>
#
#------------------------------------------------------------------------... | |
# Copyright 2014-2015 The Alive 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 ... | |
import sys, string
import pythoncom
import win32api
from win32com.adsi import *
verbose_level = 0
server = '' # Must have trailing /
local_name = win32api.GetComputerName()
def DumpRoot():
"Dumps the root DSE"
path = "LDAP://%srootDSE" % server
rootdse = ADsGetObject(path)
for item in rootdse.Get("SupportedLDA... | |
# :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
import abc
import sys
import re
import functools
from collections import defaultdict
import lucidity.error
# Type of a RegexObject for isinstance check.
_RegexType = type(re.compile(''))
class Template(object):
... | |
"""
Django settings for stagecraft project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
import json
import sys
from os.path import abspath, dirname, join as pj... | |
"""distutils.msvccompiler
Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio.
"""
# Written by Perry Stoll
# hacked by Robin Becker and Thomas Heller to do a better job of
# finding DevStudio (through the registry)
import sys, os
from distutils.errors import \
... | |
#!/usr/bin/env python
# encoding: utf-8
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2017 Prof. William H. Green (whgreen@mit.edu),
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu)
#
# ... | |
import sys
sys.path.append("..")
from myLib.camera import CameraClient as CamSpectro
from flask import Flask, jsonify, abort, make_response, request
import json,time,logging
import subprocess,os,sys
from astropy.wcs import WCS
from astropy.coordinates import SkyCoord
import astropy.io.fits
import numpy as np
app = Fl... | |
# Copyright 2022 The mT5 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 writ... | |
from __future__ import absolute_import, division, print_function
import argparse
import inspect
import json
import optparse
import os
import tempfile
from imp import reload
import mock
import pytest
import stomp as stomppy
import workflows
import workflows.transport
from workflows.transport.stomp_transport import Sto... | |
"""Tests for :mod:`numpy.core.fromnumeric`."""
import numpy as np
A = np.array(True, ndmin=2, dtype=bool)
B = np.array(1.0, ndmin=2, dtype=np.float32)
A.setflags(write=False)
B.setflags(write=False)
a = np.bool_(True)
b = np.float32(1.0)
c = 1.0
d = np.array(1.0, dtype=np.float32) # writeable
reveal_type(np.take(a... | |
# -*- coding: utf-8 -*-
"""Base TestCase classes for nbextensions tests."""
from __future__ import (
absolute_import, division, print_function, unicode_literals,
)
import logging
import os
from threading import Event, Thread
from jupyter_contrib_core.notebook_compat import serverextensions
from jupyter_contrib_c... | |
# Copyright (c) 2012-2015 Tycho Andersen
# Copyright (c) 2013 xarvh
# Copyright (c) 2013 horsik
# Copyright (c) 2013-2014 roger
# Copyright (c) 2013 Tao Sauvage
# Copyright (c) 2014 ramnes
# Copyright (c) 2014 Sean Vig
# Copyright (c) 2014 Adi Sieker
#
# Permission is hereby granted, free of charge, to any person obtai... | |
# ----------------------------------------------------------------------------
# Copyright (c) 2014-2016, 'prx' developers (see AUTHORS file)
# All rights reserved.
#
# Distributed under the terms of the MIT license.
#
# The full license is in the LICENSE file, distributed with this software.
# ------------------------... | |
from collections import defaultdict
from .._compat import PY2, with_metaclass, iteritems, to_unicode, to_bytes, \
string_types
from .._gae import gae
from ..helpers._internals import Dispatcher
from ..helpers.regex import REGEX_TYPE
representers = Dispatcher("representer")
class for_type(object):
def __init_... | |
#!/usr/bin/env python2.7
import h5py, os, sys
from fast5tools.f5class import *
from fast5tools.f5ops import *
from fast5tools.helperops import process_outdir, process_filesused
from fast5tools.plotops import qualhist
import argparse
from glob import glob
from collections import defaultdict
import numpy as np
import m... | |
# -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
from re import compile, escape, IGNORECASE, sub
from os.path import splitext
from ..scraper import _BasicScraper, _ParserScraper
from ..helpers import indirectStarter, bounceStarter... | |
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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... | |
# 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
# d... | |
# PyMoBu - Python enhancement for Autodesk's MotionBuilder
# Copyright (C) 2010 Scott Englert
# scott@scottenglert.com
#
# 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 3 of the ... | |
# -*- 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... | |
# -*- coding: utf-8 -*-
from gluon import current
from s3 import *
from s3layouts import *
try:
from .layouts import *
except ImportError:
pass
import s3menus as default
red_cross_filter = {"organisation.organisation_type_id$name" : "Red Cross / Red Crescent"}
# ==============================================... | |
# occiput
# Stefano Pedemonte
# Harvard University, Martinos Center for Biomedical Imaging
# Apr. 2014, Boston, MA
import numpy
from .ilang_models import SSD_ilang
from ilang.Graphs import ProbabilisticGraphicalModel
from ilang.Samplers import Sampler
from occiput.Visualization import MultipleVolumesNiftyCore
f... | |
import sys
import json
import codecs
import re
import copy
import getopt
#for now contains dummy rules
class ValidationRule:
def __init__(self, type, param = None):
if type == "USER_REGEX":
type = ValidationType.USER_REGEX
if type == "NOT_NULL":
type = ValidationType.NOT_NU... | |
"""Module containing the Train class and support functionality."""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
from datetime import datetime
i... | |
import tensorflow as tf
import numpy as np
import cv2
from configs.kitti_config import config
# ################## From SqueezeDet #########################
def safe_exp(w, thresh):
"""Safe exponential function for tensors."""
slope = np.exp(thresh)
with tf.name_scope('safe_exponential'):
lin_region = tf.... | |
"""
Support for Bluesound devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.bluesound/
"""
import asyncio
from asyncio.futures import CancelledError
from datetime import timedelta
import logging
import aiohttp
from aiohttp.client_exce... | |
"""Script to check the configuration file."""
import argparse
import logging
import os
from collections import OrderedDict, namedtuple
from glob import glob
from typing import Dict, List, Sequence
from unittest.mock import patch
import attr
import voluptuous as vol
from homeassistant import bootstrap, core, loader
f... | |
#!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. 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
#
# U... | |
"""
Local templates for the archetype zopeskel project
"""
import os
from zopeskel.base import var
from zopeskel.localcommands import ZopeSkelLocalTemplate
from Cheetah.Template import Template as cheetah_template
class ArchetypeSubTemplate(ZopeSkelLocalTemplate):
use_cheetah = True
parent_templates = ['arch... | |
# Copyright 2013-2014 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | |
import unittest
from test import support
from test.test_grammar import (VALID_UNDERSCORE_LITERALS,
INVALID_UNDERSCORE_LITERALS)
from random import random
from math import atan2, isnan, copysign
import operator
INF = float("inf")
NAN = float("nan")
# These tests ensure that complex math ... | |
# -*- coding: utf-8 -*-
"""
Stock handling module for lpm
All stock entries are connected to a revisionless part number. The revision number is not considered since
lpm considers revisions to be compatible and thus interchangeable.
The database stores the current count and optionally a BOM for a component.
When the c... | |
from django.shortcuts import redirect
from django.utils.translation import ugettext_lazy as _
from urllib.parse import urlencode
from urllib.request import urlopen
from django.core.urlresolvers import reverse
from django.conf import settings as project_settings
from .base import BackendBase
class PaypalBackend(Backe... | |
# -*- 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 'Food'
db.create_table(u'usda_food', (
('ndb_number', self.gf('django.db.models.f... | |
from collections import defaultdict
import os
def classify(instance, classes_instances, extractor=str.split, priors=None):
"""
Using `classes_instances` as supervised learning, classify `instance` into
one of the example classes. `extractor` is a function to convert instances
into a list of events/feat... | |
from south.db import db
from django.db import models
from ietf.ietfworkflows.models import *
class Migration:
def forwards(self, orm):
# Adding model 'StateDescription'
db.create_table('ietfworkflows_statedescription', (
('id', orm['ietfworkflows.statedescription:id']),
... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from builtins import range, next, zip, map
from future.utils import viewvalues
import sys
if sys.version < '3':
text_type = unicode
binary_type = str
int_type = long
else:
text_type = str
binary_type = bytes
unicode = str
int_type = int
import itert... | |
# REFS Some (most) of those functions come from the keras library (https://github.com/fchollet/keras)
# Some are modified to add output images and output centerline
# keras.preprocessing.image: flip_axis, random_channel_shift, apply_transform, transform_matrix_offset_center, ApplyRandomTransformations
import time
impor... | |
from twisted.internet import defer, reactor
from twisted.trial import unittest
from twisted.internet import base
from twisted.python import failure, filepath
base.DelayedCall.debug = True
from txtemplate import templates
from txtemplate import clearsilver
TEMPLATE_DIR = filepath.FilePath(__file__
... | |
###
# Copyright (c) 2009, Juju, 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 condi... | |
import random
import hashlib
from typing import Sequence, List
from django.conf import settings
NAMES = [
"3_d_man",
"alars",
"aardwolf",
"abdul_alhazred",
"abe_brown",
"abigail_brand",
"abner_jenkins",
"abner_little",
"abominable_snowman",
"abomination",
"abominatrix",
... | |
"""
Tests for L{eliot.testing}.
"""
from __future__ import unicode_literals
from unittest import SkipTest, TestResult, TestCase
from ..testing import (
issuperset, assertContainsFields, LoggedAction, LoggedMessage,
validateLogging, UnflushedTracebacks, assertHasMessage, assertHasAction,
validate_logging,... | |
from . import controllers
from . import messages
from grow.pods import locales
from grow.pods import urls
from datetime import datetime
import fnmatch
import hashlib
import mimetypes
import os
import re
import time
import webob
mimetypes.add_type('application/font-woff', '.woff')
mimetypes.add_type('application/font-w... | |
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
# Copyright 2015 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 a... | |
"""Config flow for Universal Devices ISY994 integration."""
import logging
from urllib.parse import urlparse
from pyisy.configuration import Configuration
from pyisy.connection import Connection
import voluptuous as vol
from homeassistant import config_entries, core, exceptions
from homeassistant.components import ss... | |
"""CLI script to annotate gpd entries
"""
import sys, argparse, gzip, re, itertools, os, uuid
from multiprocessing import cpu_count
from tempfile import mkdtemp, gettempdir
from random import shuffle
from seqtools.format.gpd import GPD, GPDStream
from seqtools.structure.transcriptome import Transcriptome
from seqtools... | |
# coding: utf-8
"""
Salt Edge Account Information API
API Reference for services # noqa: E501
OpenAPI spec version: 5.0.0
Contact: support@saltedge.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ConsentRequestBod... | |
# Copyright 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.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
from zeit.cms.checkout.helper import checked_out
from zeit.cms.interfaces import ICMSContent
import transaction
import unittest
import zeit.cms.tagging.testing
import zeit.content.article.edit.browser.testing
import zeit.content.author.author
import zope.security.management
class HeadTest(zeit.content.article.edit.br... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-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.... | |
"""
This module provides classes to build an OrderList for input to a plant,
including the Order instances and their Recipe instances.
"""
from xml.dom import minidom
from plant import CraneMoveTime
class Recipe(object):
"""
This class provides a Recipe for an Order. It is a list (or dictionary) of
tuples (str mac... | |
"""
Puppy experiments are executed within the [Webots]_ simulator. Since
this module is linked to :py:mod:`PuPy` through the class
:py:class:`ActorCritic`, this is the native approach. For the purpose of
Puppy, an adapted Actor-Critic is implemented in :py:class:`PuppyHDP`,
handling Puppy specifics. It inherits from :p... | |
#!/usr/bin/env python
#
# Copyright 2015 Naver 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.