gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# -*- coding: utf-8 -*-
import collections
import datetime
import sys
if sys.version_info == (2, 7):
import httplib as HttpStatusCode
elif sys.version_info >= (3, 0):
import http.client as HttpStatusCode
import flask
import flask_restful
import sqlalchemy
import werkzeug.exceptions
from sqlalchemy import orm... | |
"""
Support for the Uber API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.uber/
"""
import logging
from datetime import timedelta
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
_LOGGER = logging.getLog... | |
# Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
import script
from script import *
import shlex
import edition
import layout
import query
import player
import test
import graph
import opendns
class Color(script.Script):
def __init__(self, console):
super(Color, self).__init__(console)
self.colors = {
"red" : [ 1.0, 0.0, 0.0, 1.0 ],
"green" : [ 0.0, ... | |
"""This file contains all calculations related
to spatial explicit calculations of technology/innovation
penetration."""
import logging
from collections import defaultdict
import numpy as np
def spatial_diffusion_values(
regions,
real_values,
speed_con_max,
low_congruence_crit,
... | |
#!/usr/bin/env python
#
# Copyright (C) 2014 Brian Caswell <bmc@lungetech.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights... | |
# Copyright 2011 Denali Systems, 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 requ... | |
# Copyright (c) 2016 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 ... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
"""
Copyright (c) 2016 Keith Sterling
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, distribute,... | |
from __future__ import print_function, division, absolute_import
import subprocess
import re
from ..shell_integration import (BEFORE_PROMPT, AFTER_PROMPT,
BEFORE_OUTPUT, AFTER_OUTPUT, readline_invisible)
import IPython
from IPython.testing.tools import get_ipython_cmd
IPy5 = IPython.version_info >= (5,)
def te... | |
import pandas as pd
s = pd.Series([0, 1, 2], index=['a', 'b', 'c'])
print(s)
# a 0
# b 1
# c 2
# dtype: int64
df = pd.DataFrame(s)
print(df)
# 0
# a 0
# b 1
# c 2
print(type(df))
# <class 'pandas.core.frame.DataFrame'>
df_ = pd.DataFrame([s])
print(df_)
# a b c
# 0 0 1 2
print(type(df_))
# <... | |
# 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... | |
# Copyright 2022 The MT3 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... | |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import datetime
from frappe import _
import frappe
import frappe.database
import frappe.utils
import frappe.utils.user
from frappe import conf
from frappe.sessions import Sess... | |
# Copyright (c) 2006-2009 The Trustees of Indiana University.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without ... | |
#
# ColorHandPose3DNetwork - Network for estimating 3D Hand Pose from a single RGB Image
# Copyright (C) 2017 Christian Zimmermann
#
# 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, eithe... | |
#!/usr/bin/env python
#
# Copyright (c) 2016, 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
# notic... | |
# Copyright 2016 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 agreed to in writing, ... | |
#!/usr/bin/env python
class tree_node(object):
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def create_minimum_BST(data_list, start, end):
if end < start:
return None
mid = (start + end) / 2
n = tree_node(data_list[mid])
n.left = cre... | |
import psycopg2
import psycopg2.extras
import psycopg2.extensions
import re
from dbobject_cache import DBObjectsCache
object_cache = None
''' :type object_cache: DBObjectsCache'''
db_credentials = {}
config_settings = None
psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
psycopg2.extensions.register_t... | |
# 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.
"""Finds perf trybots that can run telemetry tests."""
import json
import logging
import os
import re
import subprocess
import sys
import urllib2
from tele... | |
# ===============================================================================
# Copyright 2011 Jake Ross
#
# 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/licens... | |
# 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... | |
"""
Swaggy Jenkins
Jenkins API clients generated from Swagger / Open API specification # noqa: E501
The version of the OpenAPI document: 1.1.2-pre.0
Contact: blah@cliffano.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from swaggyjenkins.m... | |
#coding=utf-8
import math
from nose.tools import (assert_equals, assert_dict_equal, assert_not_equals,
assert_tuple_equal, assert_true, assert_false,
assert_list_equal, assert_is_none, assert_items_equal,
assert_almost_equal, raises)
import ssdb
fr... | |
#-------------------------------------------------------------------
# Copyright (c) 2013, Scott D. Peckham
#
# Apr 2013. New time interpolator class from/for framework3.py.
#
#-------------------------------------------------------------------
#
# class time_interp_data()
# __init__()
# update()
#
# ... | |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | |
#!/usr/bin/python2
# Copyright 2014 CloudFounders NV
#
# 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 numpy as np
from .settings import MWA_FREQ_EOR_ALL_80KHZ
__all__ = ['bin_freqs', 'crop_arr', 'gen_radius_array', 'gen_radial_mask',
'is_empty_list', 'radial_profile', 'LazyProperty',
'get_channel_indexes_per_bin']
class LazyProperty(object):
def __init__(self, func):
self._fu... | |
from functools import partial
from django.test import TestCase
from django.utils.safestring import SafeString
from wagtail.admin import compare
from wagtail.core.blocks import StreamValue
from wagtail.images import get_image_model
from wagtail.images.tests.utils import get_test_image_file
from wagtail.tests.testapp.m... | |
"""
Django settings for bbp_oa project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | |
from textwrap import dedent
from numpy import (
bool_,
dtype,
float32,
float64,
int32,
int64,
int16,
uint16,
ndarray,
uint32,
uint8,
)
from catalyst.errors import (
WindowLengthNotPositive,
WindowLengthTooLong,
)
from catalyst.lib.labelarray import LabelArray
from ca... | |
#!/usr/bin/env python
# Copyright 2017, 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 ... | |
'''
Frontend module
'''
__all__ = ('frontend', )
from flask import Blueprint, render_template, url_for, redirect, abort, \
send_file, request, make_response, jsonify
from web.job import read_job, read_logs, JobObj
from werkzeug import secure_filename
from web.config import qjob, r
from os.path import exists
from ... | |
# ----------------------------------------------------------------------------
# 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 weakref
import shutil
import logging
from watchdog.events import FileSystemEventHandler
from .utilities import is_jsp_hook
from .deploy import Deploy
from . import sassc
LOG = logging.getLogger(__name__)
def normalize_path(path):
return path.replace('/', os.sep)
def contains_path(path, sub_pa... | |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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 License, or
# (at your option) any later version.
#
# Ansible is distribut... | |
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.contrib.auth.models import User
from django.contrib.messages import add_message
from django.contrib.messages import constants as messages
from django.contrib.messages.views import SuccessMessageMixin
from django.db.models import ... | |
from django.shortcuts import get_object_or_404
from django.views.generic import (TemplateView, ListView, DetailView,
CreateView, UpdateView, DeleteView,
FormView, RedirectView)
from django.core.urlresolvers import reverse, reverse_lazy
from django.core... | |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainGui2.ui'
#
# Created: Thu May 29 11:56:44 2014
# by: pyside-uic 0.2.14 running on PySide 1.2.0
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_mainDialog(object):
def setupUi(... | |
# Copyright 2015 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | |
'''
This is the main program which executes an experiment
description by communicating with the Node_Managers on
the configured nodes.
It has threads.
* The main thread executes the experiment description
* One thread is providing an XMLRPC Server for the Nodes
to sent asynchonous feedback (mainly events) to the m... | |
# 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... | |
# Copyright 2019 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... | |
"""Parse (absolute and relative) URLs.
urlparse module is based upon the following RFC specifications.
RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L. Masinter, January 2005.
RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter
and L.Masinter, Decemb... | |
import os
import sys
import subprocess
import tempfile
from time import sleep
from os.path import exists, join, abspath
from shutil import rmtree, copytree
from tempfile import mkdtemp
import six
from twisted.trial import unittest
from twisted.internet import defer
import scrapy
from scrapy.utils.python import to_nat... | |
# 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... | |
import os
import astropy.io.fits as pyfits
import numpy as np
from scipy.interpolate import RegularGridInterpolator, interp1d
def gaussian_fwhm(sigma):
return 2. * np.sqrt(2. * np.log(2.)) * sigma
class FastFiberAcceptance(object):
"""
This class reads an input fits file generated with specsim.fitgalsim
... | |
import pytest
from jinja2 import DictLoader
from jinja2 import Environment
from jinja2 import PrefixLoader
from jinja2 import Template
from jinja2 import TemplateAssertionError
from jinja2 import TemplateNotFound
from jinja2 import TemplateSyntaxError
from jinja2.utils import pass_context
class TestCorner:
def t... | |
#
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
#
# 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; version 2 of the License.
#
# This program is distributed in th... | |
# Copyright 2014: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | |
# Copyright (c) 2015-2018 by the parties listed in the AUTHORS file.
# 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 numpy as np
import numpy.testing as nt
from ..mpi import MPI
from .mpi import MPITestCase
from ..tod impor... | |
#!/usr/bin/env python
"""Standard actions that happen on the client."""
import cStringIO as StringIO
import ctypes
import gzip
import hashlib
import os
import platform
import socket
import sys
import time
import zlib
import psutil
import logging
from grr.client import actions
from grr.client import client_utils_c... | |
#!/usr/bin/env python
import numpy as np
import jsonrpclib
from simplejson import loads
def get_named_people_from_sen(sen):
"""
returns a list of annotated words that correspond to named entities in sen.
sen must be an annotated sentence dict.
each element of the returned list is a list of annotated w... | |
import chainer
from chainer.backends.cuda import cupy
import chainer.testing
import chainer.testing.attr
import chainermn
from chainermn import nccl
import mock
import numpy as np
import pytest
import unittest
class ExampleModel(chainer.Chain):
def __init__(self):
super(ExampleModel, self).__init__()
... | |
from datetime import datetime
from django.test import SimpleTestCase, override_settings
FULL_RESPONSE = 'Test conditional get response'
LAST_MODIFIED = datetime(2007, 10, 21, 23, 21, 47)
LAST_MODIFIED_STR = 'Sun, 21 Oct 2007 23:21:47 GMT'
LAST_MODIFIED_NEWER_STR = 'Mon, 18 Oct 2010 16:56:23 GMT'
LAST_MODIFIED_INVALID... | |
# Copyright (c) 2008, Casey Duncan (casey dot duncan at gmail dot com)
# see PERLIN_LICENSE.txt for details
"""Perlin noise -- pure python implementation"""
__version__ = '$Id: perlin.py 521 2008-12-15 03:03:52Z casey.duncan $'
from math import floor, fmod, sqrt
from random import randint
# 3D Gradient vectors
_GRA... | |
# 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 agreed... | |
"""
Utilities for local system calls, everything here is cross-platform.
become_daemon was originally taken from Django:
https://github.com/django/django/commit/5836a5771f2aefca83349b111f4191d6485af1d5#diff-f7d80be2ccf77f4f009d08dcac4b7736
We might want to refactor this into:
system/__init__.py
system/posix.py
syste... | |
"""Calendar printing functions
Note when comparing these calendars to the ones printed by cal(1): By
default, these calendars have Monday as the first day of the week, and
Sunday as the last (the European convention). Use setfirstweekday() to
set the first day of the week (0=Monday, 6=Sunday)."""
import sys
import da... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
import pandas as pd
df = pd.DataFrame({'age': [24, 42], 'state': ['NY', 'CA'], 'point': [64, 92]},
index=['Alice', 'Bob'])
print(df)
# age state point
# Alice 24 NY 64
# Bob 42 CA 92
for column_name in df:
print(type(column_name))
print(column_name)
print('==... | |
# 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.
# Copyright 2011 - 2012, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
... | |
#!/usr/bin/env python
'''
Copyright 2012 Root the Box
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 appl... | |
#/usr/bin/python
import urllib, urllib2
import csv
import os
import geojson
from geojson import MultiPoint
from datetime import datetime
import string
from PIL import Image
from copy import deepcopy
north = -1.3000
south = -1.3232
east = 36.8079
west = 36.7663
def readfile(filename):
with open(filename, 'r') as f:
... | |
from collections import Counter
import json
from django.db import models
from django.db.models import DateTimeField, TextField, CharField, ForeignKey, IntegerField, BooleanField, F, \
ManyToManyField, OneToOneField, FloatField
from django.utils import timezone
from django.db import transaction
import sqlparse
#... | |
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
from django.db.models import Index
class DatabaseIntrospection(BaseDatabaseIntrospection):
# Maps type codes to Django Field types.
data_types_reverse = {
16: 'BooleanField',
17: 'BinaryF... | |
#!/usr/bin/env python
'''
client.py: general client for metadata and images in datastore
Copyright (c) 2017 Vanessa Sochat
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, in... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# This is a dummy migration
pass
def backwards(self, orm):
p... | |
"""
Customisable progressbar decorator for iterators.
Includes a default (x)range iterator printing to stderr.
Usage:
>>> from tqdm import trange[, tqdm]
>>> for i in trange(10): #same as: for i in tqdm(xrange(10))
... ...
"""
# future division is important to divide integers and get as
# a result precise fl... | |
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
#
# This test suite validates the scanners by running queries against ALL file formats and
# their permutations (e.g. compression codec/compression type). This works by exhaustively
# generating the table format test vectors for this specific test suite. This way... | |
##########################################################################
#
# Copyright (c) 2014, Image Engine Design 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:
#
# * Redistrib... | |
"""
These classes are wrappers for `XGBoost library <https://github.com/dmlc/xgboost>`_.
"""
from __future__ import division, print_function, absolute_import
import tempfile
import os
from abc import ABCMeta
import pandas
import numpy
from sklearn.utils import check_random_state
from .utils import normalize_weights,... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 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... | |
import asyncio
import pytest
from dask import delayed
from distributed import Client
from distributed.client import futures_of
from distributed.metrics import time
from distributed.protocol import Serialized
from distributed.utils_test import gen_cluster, inc
@gen_cluster()
async def test_publish_simple(s, a, b):
... | |
#
# 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... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
"""The tests for the REST switch platform."""
import asyncio
import aiohttp
from homeassistant.components.rest import DOMAIN
import homeassistant.components.rest.switch as rest
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassistant.const import (
CONF_HEADERS,
CONF_NAME,
CO... | |
# Copyright 2015 Brocade Communications System, 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
#
#... | |
# -*- 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... | |
from collections import deque
import logging
log = logging.getLogger(__name__)
def table_entry_size(name, value):
"""
Calculates the size of a single entry
This size is mostly irrelevant to us and defined
specifically to accommodate memory management for
lower level implementions. The 32 extra b... | |
# 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... | |
# Copyright (C) 2013 VMware, Inc
# 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.apache.org/licens... | |
#!/usr/bin/env python
#############################################################################
# dictReader.py
# 2015 James A. Stapleton
#
# This program parses JSON-dumped barcode-hashed short-read dictionaries
# created by barcodeHasher.py and sends files to SPAdes or Velvet
# for assembly.
#
... | |
# -*- coding: utf-8 -*-
"""
Tests of the neo.core.baseneo.BaseNeo class and related functions
"""
from datetime import datetime, date, time, timedelta
from decimal import Decimal
from fractions import Fraction
import sys
try:
import unittest2 as unittest
except ImportError:
import unittest
import numpy as np... | |
#!/usr/bin/env python
# The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bittorrent.com/li... | |
__author__ = 'jan.zdunek'
# Copyright 2015 Jan Zdunek
#
# 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... | |
""" Tools for doing common subexpression elimination.
"""
from collections import OrderedDict
from sympy.core import Basic, Mul, Add, sympify
from sympy.core.basic import preorder_traversal
from sympy.core.function import _coeff_isneg
from sympy.core.compatibility import iterable
from sympy.utilities.iterables import ... | |
# Copyright (c) 2012-2013 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functional... | |
# -*- 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 field 'PyConTutorialProposal.cte_tutorial_id'
db.add_column(u'pycon_pycontutorialproposal', 'cte_tu... | |
import os, time
import json
from datetime import datetime, tzinfo
from django.core.exceptions import MultipleObjectsReturned
from django.conf import settings
from django.contrib.auth.models import User, Group
from rest_framework.decorators import detail_route
from rest_framework import viewsets
from rest_framework imp... | |
#!/usr/bin/python3
# Copyright 2014 ETH Zurich
#
# 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... | |
import copy
import warnings
from django.conf import compat_patch_logging_config
from django.core import mail
from django.test import TestCase, RequestFactory
from django.test.utils import override_settings
from django.utils.log import CallbackFilter, RequireDebugFalse, getLogger
# logging config prior to using filte... | |
#!/usr/bin/env python
#
# Copyright 2015-2015 breakwa11
#
# 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 la... | |
# Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
from contextlib import contextmanager
import warnings
from numba.core import (errors, types, typing, funcdesc, config, pylowering,
transforms)
from numba.core.compiler_machinery import (FunctionPass, LoweringPass,
register_pass)
from collections import ... | |
'''
Created on Jan 20, 2016
@author: kashefy
'''
from nose.tools import assert_equal, assert_true, assert_false, \
assert_is_not_none, assert_is_instance, assert_greater, assert_list_equal, \
assert_is_not
import os
import tempfile
import shutil
from google.protobuf import text_format
from caffe.proto.caffe_pb... | |
#
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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.