gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@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
ANS... | |
from collections import OrderedDict
import copy
import itertools
import regex as re
import random
def reverse_enumerate(iterable):
'''
Enumerate through an iterable in reverse, reporting the index consistent
with the original iterable.
'''
return itertools.izip(reversed(xrange(len(iterable))), rev... | |
#!/usr/bin/env python3
#
# Copyright (c) 2019, 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
# ... | |
#!/usr/bin/env python
# Copyright 2012 Google Inc. All Rights Reserved.
"""Utils exporting data from AFF4 to the rest of the world."""
import os
import Queue
import stat
import time
import logging
from grr.lib import aff4
from grr.lib import client_index
from grr.lib import rdfvalue
from grr.lib import serialize
fr... | |
"""Test the utils file for the mailer app"""
# pylint: disable=invalid-name
import base64
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import override_settings
from django.utils.dateparse import parse_datetime
from mock import Mock, patch
from open_connect.accou... | |
#!/usr/bin/env python
# coding: utf-8
from datetime import datetime
from distutils import spawn
import argparse
import json
import os
import platform
import shutil
import socket
import sys
import urllib
import urllib2
import main
###############################################################################
# Opti... | |
from typing import Any, Callable, List, Optional, Tuple, Union
import jax
import jax.numpy as jnp
import numpy as np
from .custom_types import PyTree, TreeDef
from .deprecated import deprecated
#
# Filter functions
#
def is_array(element: Any) -> bool:
"""Returns `True` if `element` is a JAX array (but not a ... | |
# -*- 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 'Service'
db.create_table('cabotapp_service', (
('id', self.gf('django.db.models.... | |
# Copyright 2018 FiberHome Telecommunication Technologies CO.,LTD
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LI... | |
# 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 elasticsearch import Elasticsearch
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
plt.ioff()
from matplotlib.backends.backend_pdf import PdfPages
from matplotlib.dates import AutoDateLocator, AutoDateFormatter
import numpy as np
from scipy import stats
import datetime as dt
import math
imp... | |
# stdlib
import hashlib
import re
from os import path
# 3rd-party modules
from lxml.builder import E
# local modules
from jnpr.junos.utils.util import Util
from jnpr.junos.utils.scp import SCP
from jnpr.junos.exception import SwRollbackError, RpcTimeoutError, RpcError
"""
Software Installation Utilities
"""
__all__... | |
"""
Django settings for EDI 2017 project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
import environ
ROOT_DIR = environ.Path(__file__) - 3 # (edi/config/setti... | |
# -*- coding: utf-8 -*-
"""
This module implements a class that implements a latex command.
This can be used directly or it can be inherited to make an easier interface
to it.
.. :copyright: (c) 2014 by Jelte Fennema.
:license: MIT, see License for more details.
"""
from .latex_object import LatexObject
from ..... | |
# Gum sound editor (https://github.com/stackp/Gum)
# Copyright 2009 (C) Pierre Duquesne <stackp@online.fr>
# Licensed under the Revised BSD License.
import gtk
import gobject
import cairo
try:
from gum import fast
except ImportError:
HAVE_FAST = False
else:
HAVE_FAST = True
# -- Base classes for drawing s... | |
# Copyright (c) 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/licenses/LICENSE-2.0
#
# Unless ... | |
# Copyright 2013-2016 DataStax, 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 writi... | |
# 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 ... | |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.tap}.
"""
from __future__ import absolute_import, division
import os
import stat
from twisted.python.reflect import requireModule
from twisted.python.usage import UsageError
from twisted.python.filepath import FilePa... | |
# Copyright (C) 2013-2020 Internet Systems Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET ... | |
from PySide.QtCore import *
from PySide.QtGui import *
import sys
import person
import worker
# import spouse
# import attacher
import csv_handle
import re
import datetime
class MainDialog(QMainWindow, worker.Ui_MainWindow):
def __init__(self,parent=None):
super().__init__()
self.setupUi(self)
... | |
from __future__ import unicode_literals
import logging
import os
import re
import traceback
from zipfile import ZipFile
from django.conf import settings
from django.core.paginator import InvalidPage, Paginator
from django.core.urlresolvers import NoReverseMatch
from django.http import (HttpResponse,
... | |
# Note that the dataset must be already downloaded for this script to work, do:
# $ cd data/
# $ python download_dataset.py
# quoc_trinh
import tensorflow as tf
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from sklearn import metrics
import os
import sys
import datetime
# get current... | |
"""
Creates the config data used by services.
@author: Davandev
"""
import davan.util.helper_functions as common
import os
import imp
def create_config(secret_config, config):
#------------------------------------------------------------------------------------------------
# General server configuration
... | |
# 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... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import sys
import warnings
from string import Template
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.c... | |
"""Tests for tensorflow.ops.random_ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.python.platform
import numpy as np
from six.moves import xrange # pylint: disable=redefined-builtin
import tensorflow as tf
class RandomNormalTes... | |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
import torch
import torch.o... | |
#!/usr/bin/env python2.5
#
# Copyright 2009 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... | |
# -*- coding: UTF-8 -*-
from abc import ABCMeta
from abc import abstractmethod
from . import common
import datetime
import hashlib
import logging
import tweepy
import dbm
import tempfile
import collections
# Module logger
logger = logging.getLogger(__name__)
class ExecutorFactory(common.loggable):
"""
Facto... | |
import json
from datetime import datetime, timedelta
from django.contrib.contenttypes.models import ContentType
from nose.tools import eq_
from kitsune import search as constants
from kitsune.access.tests import permission
from kitsune.forums.tests import forum, post, restricted_forum, thread
from kitsune.products.t... | |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon May 8 03:25:33 2017
@author: alex
"""
#==============================================================================
# This is the algorithm described in the documentation
# But because of the our own problems, we have to split up the process
# and u... | |
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2020 Rapptz
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 u... | |
# -*- coding: utf-8 -*-
import uuid
from . import ABCParticles
from .particles_items import Particle, Bond
from ..core import CUBA
from ..core.data_container import DataContainer
class Particles(ABCParticles):
"""Class that represents a container of particles and bonds.
Class provides methods to add particl... | |
"""
Some algorithms related to lattices.
Here we are concerned with determining random variable induced sigma-algebras.
That is, we want to know the subsigma-algebra (of the underlying sigma-algebra)
that corresponds to a random variable. However, we consider only those random
variables that map outcomes in the underl... | |
# Copyright (c) 2015-2018 Cisco Systems, Inc.
#
# 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... | |
# Extra stress testing for Bessel functions
# Reference zeros generated with the aid of scipy.special
# jn_zero, jnp_zero, yn_zero, ynp_zero
from mpmath import *
V = 15
M = 15
jn_small_zeros = \
[[2.4048255576957728,
5.5200781102863106,
8.6537279129110122,
11.791534439014282,
14.930917708487786,
18.0710639... | |
# 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.
DEPS = [
'archive',
'ct',
'file',
'perf_dashboard',
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/s... | |
#!/usr/bin/env python
from __future__ import print_function
#import sys
import re
import numpy as np
import numpy.linalg as npl
import numpy.testing as npt
import logging
logging.basicConfig(level=logging.DEBUG)
import unittest
# import the module
import tomographer.tomorun
import tomographer.densedm
import tomogr... | |
# Copyright (c) 2015 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 functionality ... | |
from __future__ import unicode_literals
import mock
from io import BytesIO
from textwrap import dedent
from diff_cover.diff_reporter import BaseDiffReporter
from diff_cover.violations_reporter import BaseViolationReporter, Violation
from diff_cover.report_generator import (
BaseReportGenerator, HtmlReportGenerator,... | |
# Copyright 2013-2019 The Meson development team
# 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 agree... | |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import os
import tarfile
import unittest
from builtins import object, str
... | |
##########################################################################
#
# Copyright 2008-2009 VMware, Inc.
# All Rights Reserved.
#
# 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 withou... | |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
# -*- coding: utf-8 -*-
u"""zgoubi datafile parser
:copyright: Copyright (c) 2018 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from pykern import pkcompat
from pykern import pkio
from pykern.pkcollect... | |
#Cancer Sim
from numpy import *
import scipy as sp
import pylab as py
import math
import matplotlib.cm as cm
import matplotlib.colors as colors
import matplotlib.colorbar as cb
import matplotlib.pyplot as plt
import cPickle as pickle
from scipy.spatial.distance import euclidean
from math import pow
from scipy.spat... | |
import functools
import json
import sys
import types
import re
import uuid
import warnings
from datetime import date, datetime
import pytz
from neomodel import config
from neomodel.exceptions import InflateError, DeflateError, RequiredProperty
if sys.version_info >= (3, 0):
unicode = str
def display_for(key):... | |
"""AWS Image Creation, Management, Testing"""
import json
from copy import deepcopy
from typing import Tuple
import boto3
import botocore.exceptions
import pkg_resources
import yaml
from pkg_resources import resource_string
from retrying import retry
import gen
import gen.build_deploy.util as util
import pkgpanda.ut... | |
# Copyright (c) 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 ... | |
import unittest
import Integrator, Pslg, ElementAwarePslg, math
class IntegratorTest(unittest.TestCase):
def testConstantFunction1(self):
p1 = Pslg.GridPoint(0,0)
p2 = Pslg.GridPoint(1,0)
p3 = Pslg.GridPoint(0,1)
e = ElementAwarePslg.Element(p1, p2, p3, 0, 0)
def f(... | |
# -*- coding -*-
"""
Provides step definitions to:
* run commands, like behave
* create textual files within a working directory
TODO:
matcher that ignores empty lines and whitespace and has contains comparison
"""
from __future__ import absolute_import, print_function
from behave import given, when, then,... | |
"""
Automatic Colour Conversion Graph
=================================
Defines the automatic colour conversion graph objects:
- :func:`colour.describe_conversion_path`
- :func:`colour.convert`
"""
from __future__ import annotations
import inspect
import numpy as np
import textwrap
from collections import named... | |
# 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 2017 Mycroft AI 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... | |
#!/usr/bin/env python
"""
mbed SDK
Copyright (c) 2011-2015 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... | |
"""This class stores all of the samples for training. It is able to
construct randomly selected batches of phi's from the stored history.
It allocates more memory than necessary, then shifts all of the
data back to 0 when the samples reach the end of the allocated memory.
"""
import numpy as np
import pyximport
pyxi... | |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for implementations of L{IReactorTime}.
"""
__metaclass__ = type
import os, signal, time
from twisted.internet.defer import TimeoutError, Deferred, gatherResults
from twisted.internet.protocol import ClientFactory, Protocol
from twist... | |
# Copyright 2019 DeepMind Technologies Limited. 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 ... | |
##
# \namespace cross3d.abstract.studiomaxapplication
#
# \remarks The StudiomaxApplication class will define all operations for application interaction. It is a singleton class, so calling cross3d.Application() will
# always return the same instance of Application. One of its main functions is connecting applicatio... | |
# 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... | |
#
# This file is part of pySMT.
#
# Copyright 2014 Andrea Micheli and Marco Gario
#
# 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
... | |
# Copyright 2014 Cisco 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 requir... | |
# -*- coding: utf-8 -*-
""" Sahana Eden Assets Model
@copyright: 2009-2021 (c) Sahana Software Foundation
@license: MIT
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 withou... | |
#!/usr/bin/env python
from __future__ import division
import logging
import os
import shutil
import subprocess
import sys
import tempfile
import warnings
import django
from django import contrib
from django.utils._os import upath
from django.utils import six
CONTRIB_MODULE_PATH = 'django.contrib'
TEST_TEMPLATE_DIR ... | |
import re
from datetime import tzinfo, timedelta, datetime
#########################################################
# source: https://docs.python.org/2/library/datetime.html
# Example tzinfo classes:
# A class capturing the platform's idea of local time.
import time as _time
ZERO = timedelta(0)
class FixedOffset... | |
from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
Bidirectiona... | |
# -*- coding: utf-8 -*-
"""Product models."""
import functools
from datetime import date
from flask import session
from flask_login import current_user, user_logged_in
from fulfil_client.model import (Date, FloatType, ModelType, MoneyType,
One2ManyType, StringType)
from flask_babel imp... | |
from django.contrib import messages
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.core.urlresolvers import reverse
from django.shortcuts import render, redirect, get_object_or_404
from django.utils.translation import ugettext_lazy as _
from helpers.models import Helpers
from offe... | |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | |
"""
sentry.tagstore.snuba.backend
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2018 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import functools
from collections import defaultdict
from datetime import timedelta
fro... | |
from __future__ import unicode_literals
from datetime import date
from django.contrib.auth import models, management
from django.contrib.auth.management import create_permissions
from django.contrib.auth.management.commands import changepassword
from django.contrib.auth.models import User
from django.contrib.auth.test... | |
#!/usr/bin/env python3
# coding=utf-8
"""
Multiple helpers for triggering the bugs more easily. All Triggers should be subclasses of RawTrigger
"""
__author__ = "Benjamin Schubert, benjamin.schubert@epfl.ch"
from abc import ABCMeta, abstractmethod
from contextlib import suppress
import queue
import multiprocessing
... | |
'''
Copyright 2015 Planet Labs, 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, softwa... | |
#!/usr/bin/env python
"""Module to manage Planet4 markings."""
import argparse
import itertools
import logging
import math
from math import cos, degrees, pi, radians, sin
import matplotlib.lines as lines
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 OpenStack Foundation
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# 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 obta... | |
"""Support for alarm control panels that can be controlled through IFTTT."""
from __future__ import annotations
import logging
import re
import voluptuous as vol
from homeassistant.components.alarm_control_panel import (
FORMAT_NUMBER,
FORMAT_TEXT,
PLATFORM_SCHEMA as PARENT_PLATFORM_SCHEMA,
AlarmCont... | |
# 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... | |
import re
from functools import update_wrapper
from weakref import WeakSet
from django.apps import apps
from django.conf import settings
from django.contrib.admin import ModelAdmin, actions
from django.contrib.admin.views.autocomplete import AutocompleteJsonView
from django.contrib.auth import REDIRECT_FIELD_NAME
from... | |
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, 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... | |
import glob
import matplotlib.pylab as plt
import os
import six
import numpy as np
from keras import backend as K
from keras.applications import vgg16
from keras.callbacks import ModelCheckpoint, TensorBoard
from keras.engine import Input
from keras.engine import Model
from keras.layers import Lambda
from keras.layers... | |
"""
Test the parallel module.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2010-2011 Gael Varoquaux
# License: BSD Style, 3 clauses.
import time
import sys
import io
import os
try:
import cPickle as pickle
PickleError = TypeError
except:
import pickle
PickleE... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# run as:
# python web2py.py -S eden -M -R applications/eden/static/scripts/tools/build.sahana.py
# or
# python web2py.py -S eden -M -R applications/eden/static/scripts/tools/build.sahana.py -A gis
#
#
# Built with code/inspiration from MapFish, OpenLayers & Michael C... | |
# -*- coding: utf-8 -*-
'''
Module for managing locales on POSIX-like systems.
'''
from __future__ import absolute_import
# Import python libs
import logging
import re
import os
HAS_DBUS = False
try:
import dbus
HAS_DBUS = True
except ImportError:
pass
# Import salt libs
import salt.utils
import salt.util... | |
# Copyright 2016 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | |
""" Utility functions for sparse matrix module
"""
import sys
import operator
import warnings
import numpy as np
from scipy._lib._util import prod
__all__ = ['upcast', 'getdtype', 'isscalarlike', 'isintlike',
'isshape', 'issequence', 'isdense', 'ismatrix', 'get_sum_dtype']
supported_dtypes = [np.bool_, np... | |
# Copyright 2018 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... | |
#!/usr/bin/env python
# Copyright 2012 Google Inc. All Rights Reserved.
"""Base classes for artifacts.
Artifacts are classes that describe a system artifact. They describe a number
of key properties about the artifact:
Collectors: How to collect it from the client.
Processors: How to process the data from the cl... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright (c) 2019, Matt Layman and contributors
try:
import yaml
LOAD_YAML = True
except ImportError: # pragma: no cover
LOAD_YAML = False
class Line(object):
"""Base type for TAP data.
TAP is a line based protocol. Thus, the most primitive type is a line.
"""
@property
def cate... | |
import editdistance
from timeit import default_timer as timer
from operators import add_extract
from prune_rules import invalid_node, unlikely_introduce_symbols
from collections import defaultdict
import Levenshtein
from collections import Counter
import numpy as np
import string
import itertools
from foofah_table_gra... | |
# coding=utf-8
#
# Copyright 2014 Red Hat, Inc.
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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
#
# ... | |
import os
import re
import sys
import shutil
from datetime import datetime
from flask import g, url_for, make_response, request, send_file, json
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm.exc import NoResultFound
from pegasus.service import app, db
from pegasus.service.command import ClientCommand... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
"""DIF Status Report Generator.
This tool generates a status report for the DIFs by cross referencing the git
commit history ... | |
import itertools
import pytest
import logging
from cassandra.query import dict_factory
from dtest import RUN_STATIC_UPGRADE_MATRIX, Tester
from thrift_bindings.thrift010 import Cassandra
from thrift_bindings.thrift010.Cassandra import (Column, ColumnDef,
ColumnParent, Consis... | |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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... | |
from twisted.trial import unittest
import os
from twisted.internet import defer, reactor, error
from telephus.protocol import ManagedCassandraClientFactory
from telephus.client import CassandraClient
from telephus.cassandra import ttypes
CONNS = 5
HOST = os.environ.get('CASSANDRA_HOST', 'localhost')
PORT = 9160
KEY... | |
# # testAPI_automate
# Created by Davy Yue 2017-06-26
import itertools
import string
import os
from xml.etree import cElementTree as ET
import networkx as nx
from mdtraj.core.element import Element
from foyer.smarts_graph import SMARTSGraph
from foyer.smarts import SMARTS as SMARTSParser
import parmed as pmd
from per... | |
# 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... | |
from __future__ import print_function, division
import matplotlib
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import Net, RealApplianceSource, BLSTMLayer, SubsampleLayer, DimshuffleLayer
from lasagne.nonlinearities import sigmoid, rectify
from lasagne.objectives import c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.