gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# 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 ... | |
from django.test import TestCase
from django.core.exceptions import PermissionDenied
from django.contrib.auth.models import Group
from hs_access_control.models import PrivilegeCodes
from hs_core import hydroshare
from hs_core.testing import MockIRODSTestCaseMixin
from hs_access_control.tests.utilities import global_... | |
"""This class stores all of the samples for training. It is able to
construct randomly selected batches of phi's from the stored history.
"""
import numpy as np
import time
import theano
floatX = theano.config.floatX
class DataSet(object):
"""A replay memory consisting of circular buffers for observed images,
a... | |
#!/usr/bin/python
#
# portchecker.py
#
# Brian Bolander
#
#
import socket
import sys
import re
import pdb
import getopt
import os
"""
_______________________________________________________________________________
readportsfile
_______________________________________________________________________________... | |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
@Create: 2016MMDD
@LastUpdate: 2016MMDD HH:MM:SS
@Version: 0.0
"""
from os.path import abspath, sep, join, exists
from os import mkdir, statvfs
from sys import argv, stdout
from platform import release, linux_distribution
from subprocess impo... | |
#! /usr/bin/env python3
import imp
import os
import sys
import subprocess
import setuptools
NAME = 'Orange'
VERSION = '3.2'
ISRELEASED = False
DESCRIPTION = 'Orange, a component-based data mining framework.'
README_FILE = os.path.join(os.path.dirname(__file__), 'README.md')
LONG_DESCRIPTION = open(README_FILE).rea... | |
# Copyright (c) 2016 by Kaminario Technologies, Ltd.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | |
#!/usr/bin/env python
#
# 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 (th... | |
#
# 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... | |
# -*- coding: utf-8 -*-
"""
Base
====
This file defines the individual classes used to build a simulation, including
a ``Cantilever``, ``Transistor`` and ``Experiment``
NOTE: To use units in your own file, import the
unitregistry (``u``) from ``jittermodel``!
Class structure
---------------
These classes should be ... | |
import math
import util
from pattern.en import wordnet
from pattern.en import NOUN, VERB, ADJECTIVE, ADVERB
from textblob import Word
from lexicons import SentiWords
__sentiwords = SentiWords()
ATTENUATORS_ADVERBS = open('groups_of_adverbs/medium_attenuator_adv.txt','r').readlines()
ATTENUATORS_ADVERBS = ATTENUATORS_... | |
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from django.template import Template, Context
from django.urls import reverse
from django.test.utils import override_settings
from model_mommy import mommy
from coop_cms.models import BaseArticle, ArticleCategory
from coop_cms.settings import get_arti... | |
import unittest
from agent import *
from completesimulation import HamadryasSim, HamaPopulation
from dispersal import HamadryasDispersal
from group import HamadryasGroup
from seedgroups import HamadryasSeed
class FullRunTests(unittest.TestCase):
def test_run(self):
hamadryas_sim = HamadryasSim()
... | |
# Copyright 2018 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, ... | |
import re
import operator
from collections import Counter
from zipfile import ZipFile
from numpy import array
from scipy import zeros
from scipy.stats import chisquare
kWORDS = re.compile("[a-z]{1,}")
kSTOPWORDS = set(['i', 'me', 'my', 'myself', 'we', 'our', 'ours', 'ourselves', 'yo',
'your', 'yours... | |
"""
Helper for views.py
"""
from base_handler import base_handler
import traceback
import app.model
from flask import g, render_template
class single_access_handler(base_handler):
def __init__(self):
"""
Manages all the operations that are involved with a single port association with EPGs
... | |
# Copyright (c) 2014 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 ... | |
# 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 (t... | |
"""
pygments.lexers.praat
~~~~~~~~~~~~~~~~~~~~~
Lexer for Praat
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, words, bygroups, include
from pygments.token import Name, Text, Comment, Keyword, S... | |
#! /usr/env/python
"""
flow_direction_DN.py: calculates single-direction flow directions on a regular
or irregular grid.
GT Nov 2013
Modified Feb 2014
"""
import numpy as np
import inspect
from landlab import RasterModelGrid, BAD_INDEX_VALUE
from landlab.grid.raster_funcs import calculate_steepest_descent_across_ce... | |
from SBaaS_base.postgresql_orm_base import *
class data_stage02_isotopomer_fittedFluxes(Base):
__tablename__ = 'data_stage02_isotopomer_fittedFluxes'
id = Column(Integer, Sequence('data_stage02_isotopomer_fittedFluxes_id_seq'), primary_key=True)
simulation_id = Column(String(500))
simulation_dateAndTime... | |
# -*- coding: utf-8 -*-
"""
ENERPI - python API for accessing handy objects:
- Remote replication or data extraction
- Local configuration variables
- Local ENERPI data catalog
- Constant & config derived definitions
- Receiver value generator
...
"""
import datetime as dt
import os
import pandas as pd
import requests... | |
# Generic CNN classifier that uses a geojson file and gbdx imagery to classify chips
import numpy as np
import os, random
import json, geojson
from mltools import geojson_tools as gt
from mltools.data_extractors import get_data_from_polygon_list as get_chips
from keras.layers.core import Dense, Dropout, Activation, F... | |
# 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... | |
#
# Copyright (c) 2015 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import subprocess
import json
import threading
import warnings
import re
from functools import partial
from collections import defaultdict
from uuid import uuid1
try:
from Queue import Queue
except ImportError:
from queue import ... | |
patterns = {
'bump_on_decreasing_sequence' : {
'a' : '1',
'entry' : 's',
'states' : {
's': {
'>' : { 'semantic' : 'out', 'next_state' : 'r'},
'=' : { 'semantic' : 'out', 'next_state' : 's'},
'<' : { 'semantic' : 'out', 'next_stat... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Developed by niphlod@gmail.com
License MIT/BSD/GPL
Redis-backed sessions
"""
import logging
import thread
from gluon import current
from gluon.storage import Storage
from gluon.contrib.redis_utils import acquire_lock, release_lock
from gluon.contrib.redis_utils import... | |
from datetime import datetime
from active_alchemy import ActiveAlchemy
from sqlalchemy import distinct, func
from elasticsearch import Elasticsearch
from decimal import Decimal
import pytz
import calendar
import json
import os
db = ActiveAlchemy(os.environ['DATABASE_URL'])
es_service = os.environ.get("ES_SERVICE", "lo... | |
#!/usr/bin/env python
import sys
import time, json
from selfdrive.test.plant import plant
from selfdrive.config import Conversions as CV, CruiseButtons as CB
from maneuver import *
maneuvers = [
Maneuver(
'while cruising at 40 mph, change cruise speed to 50mph',
duration=30.,
initial_speed = 40. * CV.M... | |
#!/usr/bin/env python
"""
Copyright (c) 2015-2016 Alex Forencich
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,... | |
import io
import json
import time
from unittest import mock
from http import HTTPStatus
import pytest
import aiohttpretty
from waterbutler.core import exceptions
from waterbutler.core.streams import FileStreamReader, ResponseStreamReader
from waterbutler.providers.googlecloud.metadata import GoogleCloudFileMetadata
f... | |
# Authors : Alexandre Gramfort, alexandre.gramfort@inria.fr (2011)
# Denis A. Engemann <denis.engemann@gmail.com>
# License : BSD-3-Clause
from functools import partial
import numpy as np
from ..parallel import parallel_func, check_n_jobs
from ..io.pick import _picks_to_idx
from ..utils import logger, verbo... | |
from sympy.integrals.transforms import (mellin_transform,
inverse_mellin_transform, laplace_transform, inverse_laplace_transform,
fourier_transform, inverse_fourier_transform,
sine_transform, inverse_sine_transform,
cosine_transform, inverse_cosine_transform,
hankel_transform, inverse_hankel_transfo... | |
import asyncio
import calendar
import datetime
import functools
import time
from typing import Any, Dict
from .base import MovingWindowSupport, Storage
def ensure_indices(func):
@functools.wraps(func)
async def wrapped(self, *args, **kwargs):
await self.create_indices()
return await func(sel... | |
import os
import unittest
from conans.client.importer import IMPORTS_MANIFESTS
from conans.model.manifest import FileTreeManifest
from conans.test.utils.test_files import temp_folder
from conans.test.utils.tools import TestClient
from conans.util.files import load, mkdir
conanfile = """
from conans import ConanFile
f... | |
import numpy as np
import models
import pytest
import matplotlib.pyplot as plt
import matplotlib as mpl
from abc import ABCMeta, abstractmethod
import copy
#====================================================================
# Define "slow" tests
# - indicated by @slow decorator
# - slow tests are run only if using ... | |
# 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... | |
from __future__ import division
import numpy as np
import pandas as pd
from six.moves.urllib.parse import urlparse, parse_qs
from toolz import flip, identity
from toolz.curried import merge_with, operator as op
from zipline.data.bundles.core import _make_bundle_core
from zipline.data.bundles import yahoo_equities
fro... | |
import time
from datetime import datetime
import os
import sys
import dateutil.parser
import requests
try:
from urlparse import urlparse
except:
from urllib.parse import urlparse
try:
import json
except:
import simplejson as json
class IronTokenProvider(object):
def __init__(self, token):
... | |
# Copyright 2020 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) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | |
# Copyright 2012 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 ... | |
#!/usr/bin/env python2.7
#
# 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 l... | |
# Copyright (c) 2012 Citrix 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 ... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
#!/usr/bin/env 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.
"""Creates a directory with with the unpacked contents of the remoting webapp.
The directory will contain a copy-of or a link-to t... | |
"""
Module to set up run time parameters for Clawpack -- AMRClaw code.
The values set in the function setrun are then written out to data files
that will be read in by the Fortran code.
"""
import os
import numpy as np
#-----------------------------------------------
# Set these parameters for adjoint flagging...... | |
#!/usr/bin/env python
import bsplines
import numpy
import scipy.interpolate.fitpack as fp
import scipy.integrate as si
import unittest
def createUniformKnotBSpline(order,segments,dim,knotSpacing=1.0):
aspl = bsplines.EuclideanBSpline(order, dim)
# Choose a uniform knot sequence.
aspl.initConstantUniformSp... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, ... | |
import time, logging
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.cache import cache
from django.core.mail import mail_admins
from djwepay.utils import make_batch_key, make_callback_key
from wepay import calls, WePay as PythonWePay
from wepay.exceptions import WePayErr... | |
# vim:ts=4:sw=4:et:
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import time
from os import path
from watchman.integration.lib import WatchmanEdenTestCase
class TestEdenJournal(Watc... | |
"""
<Program Name>
test_invalid_input.py
<Started>
December 2010
<Author>
Alex Hanson
<Purpose>
A battery of tests to run against the XML-RPC of the Custom Installer
Builder, testing its ability to detect invalid input. Requires the Seattle
integration test libraries, which should be in the Python path. ... | |
#!/usr/bin/env python
import SoftLayer.API
from zenjsonclient import router, ZenJsonClientError
from sets import Set
from time import sleep
import sys
###
DOMAIN_TO_APPEND = ""
if (len(sys.argv) == 2 ):
print sys.argv[1]
DOMAIN_TO_APPEND = sys.argv[1]
if (DOMAIN_TO_APPEND[0] != "."):
DOMAIN_TO_APP... | |
from __future__ import division
from builtins import zip, range
from future.utils import with_metaclass
import numpy as np
import abc
import scipy.stats as stats
import scipy.special as special
from scipy.special import logsumexp
try:
from ..util.cstats import sample_markov
except ImportError:
from ..util.stat... | |
# Copyright 2020 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 web_idl
from . import name_style
from .blink_v8_bridge import blink_class_name
from .code_node import EmptyNode
from .code_node import ListNode
from ... | |
'''
Window Pygame: windowing provider based on Pygame
'''
__all__ = ('WindowPygame', )
# fail early if possible
import pygame
from kivy.compat import PY2
from kivy.core.window import WindowBase
from kivy.core import CoreCriticalException
from os import environ
from os.path import exists, join
from kivy.config import... | |
# Copyright 2013 Cloudbase Solutions Srl
#
# 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 l... | |
# -*- coding: utf-8 -*-
"""
sphinx.util.stemmer
~~~~~~~~~~~~~~~~~~~
Porter Stemming Algorithm
This is the Porter stemming algorithm, ported to Python from the
version coded up in ANSI C by the author. It may be be regarded
as canonical, in that it follows the algorithm presented in
Porter... | |
"""An abstract class for entities."""
import re
from collections import defaultdict
from homeassistant.const import (
ATTR_ASSUMED_STATE, ATTR_FRIENDLY_NAME, ATTR_HIDDEN, ATTR_ICON,
ATTR_UNIT_OF_MEASUREMENT, DEVICE_DEFAULT_NAME, STATE_OFF, STATE_ON,
STATE_UNAVAILABLE, STATE_UNKNOWN, TEMP_CELSIUS, TEMP_FAHR... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from textwrap import... | |
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | |
# Copyright 2015 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... | |
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems 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.o... | |
#!/usr/bin/env python
# -*- mode: python -*-
# Re test suite and benchmark suite v1.5
# The 3 possible outcomes for each pattern
[SUCCEED, FAIL, SYNTAX_ERROR] = range(3)
# Benchmark suite (needs expansion)
#
# The benchmark suite does not test correctness, just speed. The
# first element of each tuple is the regex ... | |
# !/usr/bin/python
# -*- coding: latin-1 -*-
# WAVELET Torrence and Combo translate from Matlab to Python
# author: Mabel Calim Costa
# INPE
# 23/01/2013
#Baseado : Torrence e Combo
# data from http://paos.colorado.edu/research/wavelets/software.html
import numpy as np
import pylab
from pylab import *
import matplot... | |
"""Functions to construct sparse matrices
"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['spdiags', 'eye', 'identity', 'kron', 'kronsum',
'hstack', 'vstack', 'bmat', 'rand', 'random', 'diags', 'block_diag']
import numpy as np
from sci... | |
from django.db import models
from django import forms
import datetime
from django.template.defaultfilters import slugify
from django.conf import settings
CURRENT_SEASON = getattr(settings, 'CURRENT_SEASON', datetime.date.today().year)
STATUS_CHOICES = (
('FR', 'Freshman'),
('SO', 'Sophomore'),
('JR', 'Ju... | |
import os
import json
import argparse
from datetime import datetime
import heapq
#from customer_info import customer_info
#from time_frame import time_frame
class customer_info(object):
def __init__(self, customer_id):
# Customer ID
self.customer_id = customer_id
# Record all the orders
# HashMap<order_id, ... | |
#!/usr/bin/python
doc_name = 'CfA.SNIbc.BIGINFO.list'
#doc_name = 'test'
USR='fedhere'
PWD='*******'
import sys,os
sys.path.append('mypython')
import pylab as pl
import gdata.docs
import gdata.docs.service
import gdata.spreadsheet.service
import re
import optparse
from numpy import array, ma, mean, std, m... | |
# Copyright 2011 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,... | |
# coding: utf-8
#
# Copyright 2015 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 requi... | |
import os
from django.contrib.auth.models import Group
from django.test import TransactionTestCase
from django.core.files.uploadedfile import UploadedFile
from hs_core.hydroshare.resource import add_resource_files
from hs_core import hydroshare
from hs_core.testing import MockIRODSTestCaseMixin
from hs_core.views.uti... | |
#!/usr/bin/env python
import os
import sys
from PyQt4 import QtCore, QtGui
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4 import NavigationToolbar2QT as NavigationToolbar
#from matplotlib.backend_bases import NavigationToolbar2
from matplotlib.... | |
#!/usr/bin/env python
import datetime
try:
from cdecimal import Decimal
except ImportError: #pragma: no cover
from decimal import Decimal
try:
import unittest2 as unittest
except ImportError:
import unittest
from agate import Table
from agate.column_types import *
from agate.columns import *
from ag... | |
# Copyright 2016 gRPC 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 writing... | |
from __future__ import division
try:
from BytesIO import BytesIO
except ImportError:
from io import BytesIO
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
import pandas as pd
from mrjob.job import MRJob
from mrjob.protocol import JSONValueProtocol
from mrjob.... | |
# Copyright 2019 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, ... | |
from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import assert_array_equal, assert_equal, assert_raises
def test_packbits():
# Copied from the docstring.
a = [[[1, 0, 1], [0, 1, 0]],
[[1, 1, 0], [0, 0, 1]]]
for dt in '?bBhHiIlLqQ':
ar... | |
# 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... | |
# -*- coding: utf-8 -*-
import traceback
import pandas as pd
import numpy as np
import dcs
import re
def fillDown(df, columnFrom, columnTo, method):
"""Replaces invalid values in specified columns with the last/next valid value, in-place
Multiple columns can be specified by giving a range of column indices. There... | |
#! /usr/bin/env python2.7
# -*- coding: utf-8 -*-
""" Announcements Plugin for Indigo Home Control Server
The Announcements Plugin is used to construct complex announcements for use
with text-to-speech tools in Indigo. The plugin provides a simple call to the
indigo.server.speak() hook for simple audio announcements;... | |
"""Standard retry behavior.
This contains the default standard retry behavior.
It provides consistent behavior with other AWS SDKs.
The key base classes uses for retries:
* ``BaseRetryableChecker`` - Use to check a specific condition that
indicates a retry should happen. This can include things like
max... | |
# 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 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
#!/usr/bin/env python
"""
runtests.py [OPTIONS] [-- ARGS]
Run tests, building the project first.
Examples::
$ python runtests.py
$ python runtests.py -s {SAMPLE_SUBMODULE}
$ python runtests.py -t {SAMPLE_TEST}
$ python runtests.py --ipython
$ python runtests.py --python somescript.py
$ python... | |
# -*- coding: utf-8 -*-
"""
sale
"""
from trytond.model import fields
from trytond.transaction import Transaction
from trytond.pool import Pool, PoolMeta
from trytond.pyson import Eval, Or, Bool
__all__ = ['Sale', 'SaleLine']
__metaclass__ = PoolMeta
class Sale:
__name__ = 'sale.sale'
channel = fields.... | |
"""
Utility Routines for Working with Matplotlib Objects
====================================================
"""
import itertools
import io
import base64
import numpy as np
import warnings
import matplotlib
from matplotlib.colors import colorConverter
from matplotlib.path import Path
from matplotlib.markers import ... | |
import argparse # parsing command line arguments
import importlib # dynamically importing modules
import random # randint
import time # delay & timing
from math import sqrt
from operator import add, attrgetter
import copy
import sys # to exit and append to path
sys.path.append('../utils')
sys.path.append('../functions... | |
# coding=utf-8
"""
Copyright 2013 Load Impact
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... | |
#################################################
# __ ____ ____ _________ _______ __ #
# .' _| |_ || _|| _ _ ||_ __ \ |_ `. #
# | | | |__| | |_/ | | \_| | |__) | | | #
# | | | __ | | | | ___/ | | #
# | |_ _| | | |_ _| |_ _| |_ _| | #
# `.__| |____||____|... | |
# -*- coding: UTF-8 -*-
import urwid
from urwid.util import (move_prev_char, move_next_char, calc_width,
calc_text_pos, is_wide_char)
from urwid.text_layout import CanNotDisplayText, TextLayout
from urwid.compat import bytes, PYTHON3, B
ONECHAR_NEWLINES = (u'\n', b'\n', u'\r', b'\r')
TWOCHAR_N... | |
from django.test import TestCase
from django.core.exceptions import PermissionDenied
from django.contrib.auth.models import Group
from hs_access_control.models import PrivilegeCodes
from hs_core import hydroshare
from hs_core.testing import MockIRODSTestCaseMixin
from hs_access_control.tests.utilities import global_... | |
###############################################################################
#
# Styles - A class for writing the Excel XLSX Worksheet file.
#
# Copyright 2013-2017, John McNamara, jmcnamara@cpan.org
#
# Package imports.
from . import xmlwriter
class Styles(xmlwriter.XMLwriter):
"""
A class for writing th... | |
"""Event parser and human readable log generator."""
from datetime import timedelta
from itertools import groupby
import logging
import voluptuous as vol
from homeassistant.loader import bind_hass
from homeassistant.components import sun
from homeassistant.components.http import HomeAssistantView
from homeassistant.c... | |
# Default Django settings. Override these with settings in the module
# pointed-to by the DJANGO_SETTINGS_MODULE environment variable.
# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module depends on the settings.
gettext_noop = lambda s: s
#################... | |
# -*- coding: utf-8 -*-
""" Sahana Eden Hospital Management System Model
@copyright: 2009-2015 (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... | |
# Copyright (c) 2015, MapR Technologies
#
# 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... | |
# Copyright 2014 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | |
# Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# 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, publ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.