gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# coding=utf-8
"""
Collects data from RabbitMQ through the admin interface
#### Notes
** With added support for breaking down queue metrics by vhost, we have
attempted to keep results generated by existing configurations from
changing. This means that the old behaviour of clobbering queue metrics
whe... | |
# Copyright (c) 2012 Rackspace Hosting
# All Rights Reserved.
# Copyright 2013 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/license... | |
# firebird/base.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: firebird
:name: Firebird
Firebird Dialects
-----------------
... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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... | |
# 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 ... | |
# Natural Language Toolkit: Interface to the Mace4 Model Builder
#
# Author: Dan Garrette <dhgarrette@gmail.com>
# Ewan Klein <ewan@inf.ed.ac.uk>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
A model builder that makes use of the external 'Mace4' package.
"""
from __future__ import ... | |
"""
Cart pole swing-up: Original version from:
https://github.com/zuoxingdong/DeepPILCO/blob/master/cartpole_swingup.py
Modified so that done=True when x is outside of -2.4 to 2.4
Reward is also reshaped to be similar to PyBullet/roboschool version
"""
import logging
import math
import gym
from gym import spaces
from ... | |
"""Freezer swift.py related tests
(c) Copyright 2014,2015 Hewlett-Packard Development Company, L.P.
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
... | |
import nibabel as nib
import os.path as op
import os
import numpy as np
import logging
import pimms
from AFQ.tasks.decorators import as_file
from AFQ.tasks.utils import get_fname, with_name
import AFQ.data.fetch as afd
from AFQ.data.s3bids import write_json
import AFQ.utils.volume as auv
from AFQ.definitions.mapping i... | |
from collections import defaultdict
from contextlib import contextmanager
import windows
import windows.winobject.exception as winexception
from windows import winproxy
from windows.generated_def import windef
from windows.generated_def.winstructs import *
from .breakpoints import *
class FakeDebuggerCurrentThread(o... | |
"""distutils.unixccompiler
Contains the UnixCCompiler class, a subclass of CCompiler that handles
the "typical" Unix-style command-line C compiler:
* macros defined with -Dname[=value]
* macros undefined with -Uname
* include search directories specified with -Idir
* libraries specified with -lllib
* library... | |
"""
=======================================
Clustering text documents using k-means
=======================================
This is an example showing how the scikit-learn can be used to cluster
documents by topics using a bag-of-words approach. This example uses
a scipy.sparse matrix to store the features instead of ... | |
#!/usr/bin/env python
from __future__ import division
"""MODULE_DESCRIPTION"""
__author__ = "Nick Sweet"
__copyright__ = "Copyright 2015, Cohrint"
__credits__ = ["Nick Sweet", "Nisar Ahmed"]
__license__ = "GPL"
__version__ = "1.0.0"
__maintainer__ = "Nick Sweet"
__email__ = "nick.sweet@colorado.edu"
__status__ = "Deve... | |
"""
PSET-6
Your friend, who is also taking 6.00.1x, is really excited about the program she
wrote for Problem 1 of this problem set. She sends you emails, but they're all
encrypted with the Caesar cipher!
If you know which shift key she is using, then decrypting her message is an easy
task. If the string message is ... | |
#!/usr/bin/env python
from __future__ import division, print_function, absolute_import
import warnings
from copy import deepcopy
from itertools import combinations, permutations
import numpy as np
import pytest
from numpy.testing import (assert_allclose, assert_, assert_equal,
assert_raises... | |
#!/usr/bin/env python
# Copyright (c) 2013, 2014 Intel Corporation. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=F0401
import json
import optparse
import os
import re
import shutil
import subprocess
import sys
import tempf... | |
#! /usr/bin/python
# -*- coding:utf-8 -*-
""" arte_plus_7 is a script to help download arte videos
It's only configured for French at the moment.
Usage:
The following commands will return the videos urls found
# The generic program page
./arte_plus_7.py -u http://www.arte.tv/guide/fr/emissions/TRA/tracks
... | |
# -*- 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... | |
import datetime
from django.test import TestCase
from django import template
import ttag
from ttag.tests.setup import tags, models
template.add_to_builtins(tags.__name__)
def render(contents, extra_context=None):
return template.Template(contents).render(template.Context(extra_context))
class TagExecutionTes... | |
from general.utils import format_precision
from decimal import Decimal
def get_min(grid_cells, field):
min = getattr(grid_cells[0], field)
for gc in grid_cells:
if getattr(gc, field) < min:
min = getattr(gc, field)
return min
def get_max(grid_cells, field):
max = getattr(grid_cel... | |
'''
sqlite3 shell modeled after sqlite3 command-line.
Created by: Chris Houser (Briarfox)
Use sqlite ?file? to open a database in the shell.
You can pass params to run one command. ex. sqlite test.db .dump > test.sql
'''
import sqlite3
import os
import cmd
import sys
class SqliteCMD(cmd.Cmd):
'''
Simple sqlit... | |
#!/usr/bin/python2.7
# Compresses the core Blockly files into a single JavaScript file.
#
# Copyright 2012 Google Inc.
# https://developers.google.com/blockly/
#
# 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 o... | |
#
# cocos2d
# http://cocos2d.org
#
# Particle Engine done by Phil Hassey
# http://www.imitationpickles.org
#
from __future__ import division, print_function, unicode_literals
import six
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import pyglet
from pyglet.gl import *
from ... | |
import collections
import copy
import datetime
import hashlib
import json
import logging
import os
import re
import shutil
import sys
import time
import urllib.parse as parse
import uuid
import Bio.SeqIO
from Bio.Data import CodonTable
from Bio.Data.CodonTable import TranslationError
from Bio.Seq import Seq
from Geno... | |
# -*- 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):
# Adding model 'CountryTranslation'
db.create_table(u'cities_light_countr... | |
import bpy
import bpy_extras
import bmesh
import mathutils
import math
#import copy
bl_info = {
"name": "Viewport Vertex Alignment",
"author": "Hades",
"version": (0, 2),
"blender": (2, 6, 9),
"location": "View3D > Mesh Edit > Toolshelf > Vertex Alignment",
"description": "Ali... | |
#!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Build NativeClient toolchain packages."""
import logging
import optparse
import os
import sys
import textwrap
sys.path.append... | |
from sqlalchemy import exc
from sqlalchemy import testing
from sqlalchemy.engine import default
from sqlalchemy.orm import joinedload
from sqlalchemy.orm import relationship
from sqlalchemy.testing import assert_raises_message
from sqlalchemy.testing import AssertsCompiledSQL
from sqlalchemy.testing import eq_
from sql... | |
from unittest import TestCase
from surveygizmo import SurveyGizmo
client = SurveyGizmo(
base_url='',
api_token='token',
api_token_secret='secret',
prepare_url=True,
)
class AccountTests(TestCase):
resource = client.api.account
def test_list(self):
with self.assertRaises(NotImplement... | |
import socket
from unittest import mock
import pytest
from aiohttp.streams import CORK, StreamWriter
has_ipv6 = socket.has_ipv6
if has_ipv6:
# The socket.has_ipv6 flag may be True if Python was built with IPv6
# support, but the target system still may not have it.
# So let's ensure that we really have I... | |
# File: CeReports.py ; This file is part of Twister.
# version: 3.014
# Copyright (C) 2012-2014 , Luxoft
# Authors:
# Andrei Costachi <acostachi@luxoft.com>
# Cristi Constantin <crconstantin@luxoft.com>
# Daniel Cioata <dcioata@luxoft.com>
# Mihai Tudoran <mtudoran@luxoft.com>
# Licensed under the Apac... | |
# 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 to in writing, sof... | |
#
# License: MIT
# https://raw.githubusercontent.com/stonier/feed_the_troll/devel/LICENSE
#
##############################################################################
# Description
##############################################################################
"""
.. module:: servers
:platform: Unix
:synops... | |
# -*- coding: utf-8 -*-
"""PyXB stands for Python U{W3C XML
Schema<http://www.w3.org/XML/Schema>} Bindings, and is pronounced
"pixbee". It enables translation between XML instance documents and
Python objects following rules specified by an XML Schema document.
This is the top-level entrypoint to the PyXB system. I... | |
from __future__ import annotations
import asyncio
from contextlib import contextmanager, ExitStack
import logging
from typing import (Any, Dict, List, Optional,
Tuple, TYPE_CHECKING, Union, Sequence)
try:
import aionotify # type: ignore
except OSError:
aionotify = None # type: ignore
from... | |
IN_LONG_VERSION_PY = True
# 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 (build by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter fi... | |
# 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... | |
"""
File: continuous.py
Author: Come Bertrand
Email: bertrand.cosme@gmail.com
Github: https://github.com/ComeBertrand
Description: Classical continuous functions for performance evaluation of
metaheuristics. All theses functions were taken from the following website :
https://www.sfu.ca/~ssurjano/optimization.html
"""
... | |
"""
Implementations of different cartridge types.
"""
class PBCartridge(object):
MAXBANKS = 8
BANKSIZE = 0x0400
def __init__(self, file_name):
self.max_banks = PBCartridge.MAXBANKS
self.bank_size = PBCartridge.BANKSIZE
self._slice = [0]*4
self._slice[0] = 4
se... | |
from __future__ import division
import json
import os.path
from nflgame import OrderedDict
import nflgame.seq
import nflgame.statmap
_player_json_file = os.path.join(os.path.dirname(__file__), 'players.json')
def _create_players(jsonf=None):
"""
Creates a dict of Player objects from the players.json file, ... | |
"""Models for SQLAlchemy.
This file contains the model definitions for schema version 16,
used by Home Assistant Core 2021.6.0, which was the initial version
to include long term statistics.
It is used to test the schema migration logic.
"""
import json
import logging
from sqlalchemy import (
Boolean,
Column... | |
"""
.. module:: gibson
:synopsis: A high-performance XML difference engine for comparing XML
pairs, and extracting data from pairs whose text elements are
formatted in a specific "mo money" manner.
.. moduleauthor:: Emily Langer <emily.langer@expeditors.com>
"""
import re
import logging... | |
# Copyright 2019 Microsoft Corporation
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import datetime
import logging
from abc import abstractmethod
from email.utils import parseaddr
import jmespath
from c7n_azure import constants
from c7n_azure.actions.base import AzureBaseAction, Azur... | |
'''
All constant data used in the package should be defined here.
'''
from collections import OrderedDict as BASE_DICT
BLENDING_TYPES = type('Blending', (), {
'NONE': 'NoBlending',
'NORMAL': 'NormalBlending',
'ADDITIVE': 'AdditiveBlending',
'SUBTRACTIVE': 'SubtractiveBlending',
'MULTIPLY': 'Multip... | |
import collections
import itertools
import math
import numbers
import numpy as np
from zarr.errors import (
ArrayIndexError,
NegativeStepError,
err_too_many_indices,
VindexInvalidSelectionError,
BoundsCheckError,
)
def is_integer(x):
"""True if x is an integer (both pure Python or NumPy).
... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
""" Compare the output of various Kiva SVG implementations against other
renderers.
"""
from cStringIO import StringIO
import glob
import logging
import os
import pstats
import sys
from xml.etree import cElementTree as ET
import warnings
import Image
import numpy as np
f... | |
import datetime
import inspect
import numpy as np
import numpy.testing as npt
import os.path
import pandas as pd
import pandas.util.testing as pdt
import sys
from tabulate import tabulate
import unittest
#find parent directory and import model
parentddir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pat... | |
import itertools
from time import time
import Errors
import DebugFlags
import Options
from Visitor import CythonTransform
from Errors import CompileError, InternalError, AbortError
#
# Really small pipeline stages
#
def dumptree(t):
# For quick debugging in pipelines
print t.dump()
return t
def abort_on_... | |
import pyqtgraph as pg
from neutronbraggedge.braggedge import BraggEdge
from ..step1.plot import Step1Plot
from ..utilities.retrieve_data_infos import RetrieveGeneralFileInfos, RetrieveGeneralDataInfos
from ..step1.math_utilities import calculate_delta_lambda
from ..utilities.gui_handler import GuiHandler
from .. imp... | |
# -*- 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... | |
# 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... | |
""" A wxPython based color gradient editor for vtkLookupTables and
color transfer functions.
This code is distributed under the conditions of the BSD license.
Based on a Tk version of this widget by Gerald Knizia <cgk.d@gmx.net>
Ported to wxPython by Pete Schmitt <schmitt@colorado.edu>
Cleaned up and enhanced for use... | |
import uuid
from django.conf import settings
from django.db import transaction
from django.forms import ValidationError
from django.utils.translation import gettext
import waffle
from celery import chain, chord
from django_statsd.clients import statsd
import olympia.core.logger
from olympia import amo, core
from o... | |
import numpy as np
from numpy.testing import assert_array_equal
from numpy.testing import assert_allclose
import pytest
from sklearn.base import clone
from sklearn.datasets import make_classification, make_regression
from sklearn.ensemble import HistGradientBoostingRegressor
from sklearn.ensemble import HistGradient... | |
import os
import time
from homely._engine2 import Cleaner, Engine, Helper, getengine
from homely._errors import HelperError
from homely._ui import allowinteractive, allowpull, note
from homely._utils import haveexecutable, isnecessarypath
from homely.system import execute
def installpkg(name, wantcmd=None, **methods... | |
__author__ = 'himanshu'
import hashlib
import datetime
import os
from sqlalchemy import create_engine, ForeignKey, Enum
from sqlalchemy.orm import sessionmaker, relationship, backref, scoped_session, validates
from sqlalchemy import Column, Integer, Boolean, String, DateTime
from sqlalchemy.ext.declarative import decla... | |
"""
Copyright (c) 2016 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from atomic_reactor.plugin import PostBuildPlugin, ExitPlugin
from atomic_reactor.plugins.post_pulp_pull import PulpPullPlugin
from atomic_re... | |
#!/usr/bin/python3
"""
History:
--------
10/2/1016 - G.Guillou - Creation
"""
import getopt
import sys
import os
import binascii
import threading
import random
import time
import boto3
from boto3.s3.transfer import S3Transfer
def usage():
"""
usage: displays the module help. Type createami.py -h for more d... | |
"""Allows the creation of a sensor that filters state property."""
from collections import Counter, deque
from copy import copy
from datetime import timedelta
from functools import partial
import logging
from numbers import Number
import statistics
from typing import Optional
import voluptuous as vol
from homeassista... | |
# coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... | |
import datetime
import json
import os
import sys
import threading
from django import db
from django.db import models
from django.forms.models import model_to_dict
from django.core.urlresolvers import reverse
from django.forms.models import model_to_dict
from django.utils import timezone
from django.core.exceptions impo... | |
# extract-snippets.py v1.2.0 6/24/2021
# Jerry Kindall, Amazon Web Services
# extracts tagged regions from source files and writes them to a snippets directory.
# reads list of paths from stdin and extracts snippets from these files. Takes the
# directory to which snippets should be extracted as a command line argume... | |
from gitcd.git.server import GitServer
from gitcd.git.branch import Branch
from gitcd.exceptions import GitcdGithubApiException
import requests
class Gitlab(GitServer):
tokenSpace = 'gitlab'
baseUrl = 'https://gitlab.com/api/v4'
def open(
self,
title: str,
body: str,
fr... | |
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/master/LICENSE
import sys
from typing import List, Tuple
from pylint.constants import (
_SCOPE_EXEMPT,
MAIN_CHECKER_NAME,
MSG_STATE_CONFIDENCE,
MSG_STATE_SCOPE_CONFIG,
... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014-2019 Edgewall Software
# Copyright (C) 2008 Stephen Hansen
# Copyright (C) 2009-2010 Robert Corsaro
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also av... | |
# 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... | |
# Copyright (c) 2015 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/LIC... | |
import unittest
import sys
import os
import subprocess
import shutil
from copy import copy
from test.support import (run_unittest,
import_module, TESTFN, unlink, check_warnings,
captured_stdout, impl_detail, import_module,
skip_unless_symlin... | |
#-*- coding:utf-8 -*-
"""
This module contains functions and classes for computing similarities across
a collection of vectors.
"""
#Authors: Marcel Caraciolo <marcel@muricoca.com>
#License: BSD Style
import numpy as np
from scikits.crab.similarities.base import BaseSimilarity
from scikits.crab.metrics.pairwise impo... | |
import collections
import subprocess
from . import protocols
from . import transports
from .coroutines import coroutine, From
from .log import logger
class BaseSubprocessTransport(transports.SubprocessTransport):
def __init__(self, loop, protocol, args, shell,
stdin, stdout, stderr, bufsize,
... | |
#!/usr/bin/env python
#
# Copyright 2014 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
import os
import cv2
import time
import pickle
import datetime
import matplotlib.pyplot as plt
from math import floor, sqrt
from mpl_toolkits.mplot3d import Axes3D
from tensorflow.python.framework import graph_io
from tensorflow.python.tools import freeze_graph
from NN.TF.Layers import *
from Util.Util import Util, V... | |
# -*- coding: utf-8 -*-
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Sysroot controller tests."""
from __future__ import print_function
import datetime
import os
import sys
from chromite.api im... | |
from PIL import Image
import cv2
import zbar
import numpy as np
np.set_printoptions(precision=2)
from bottle import *
BaseRequest.MEMFILE_MAX = 1e8
import sys
from sys import argv
sys.path.append('/usr/local/lib/python2.7/site-packages')
import io
import json
import logging
import urllib
import openfaceUtils
impor... | |
# 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... | |
#!/usr/bin/env python2
# transpiled with BefunCompile v1.3.0 (c) 2017
import sys
def td(a,b):
return ((0)if(b==0)else(a//b))
def tm(a,b):
return ((0)if(b==0)else(a%b))
s=[]
def sp():
global s
if (len(s) == 0):
return 0
return s.pop()
def sa(v):
global s
s.append(v)
def sr():
glo... | |
#!/usr/bin/env python
# Copyright 2014 Stanford University and Los Alamos National Security, 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/LICENS... | |
import warnings
import numpy as np
from numpy.testing import assert_allclose, assert_equal
from nose.tools import raises
from menpo.testing import is_same_array
from menpo.image import BooleanImage, MaskedImage, Image
@raises(ValueError)
def test_create_1d_error():
Image(np.ones(1))
def test_image_n_elements():... | |
from ConfigParser import ConfigParser
import errno
import logging
import os
class AirflowConfigException(Exception):
pass
defaults = {
'core': {
'unit_test_mode': False,
'parallelism': 32,
'load_examples': True,
'plugins_folder': None,
},
'webserver': {
'base_u... | |
# Copyright 2018 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
# pylint: disable-msg=E1101,W0612
import operator
from datetime import datetime
import pytest
from numpy import nan
import numpy as np
import pandas as pd
from pandas import (Series, DataFrame, bdate_range,
isna, compat, _np_version_under1p12)
from pandas.tseries.offsets import BDay
import panda... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | |
import os, sys
sys.path.append(os.getcwd())
import time
import numpy as np
import tensorflow as tf
import tflib as lib
import tflib.ops.linear
import tflib.ops.conv2d
import tflib.ops.batchnorm
import tflib.ops.deconv2d
import tflib.save_images
import tflib.cifar10
import tflib.inception_score
import tflib.plot
# D... | |
# killableprocess - subprocesses which can be reliably killed
#
# Parts of this module are copied from the subprocess.py file contained
# in the Python distribution.
#
# Copyright (c) 2003-2004 by Peter Astrand <astrand@lysator.liu.se>
#
# Additions and modifications written by Benjamin Smedberg
# <benjamin@smedbergs.u... | |
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
import sys
import inspect
import logging
from urllib.parse import urlencode
from aatest import Break
from aatest import Unknown
from aatest.events import EV_SEND
from aatest.events import EV_HTTP_RESPONSE
from aatest.operation import Operation
# from saml2 import samlp
from saml2 import SAMLError
from saml2 import BI... | |
#
# Module providing the `Process` class which emulates `threading.Thread`
#
# multiprocessing/process.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#... | |
"""
Copyright (c) 2017 Baidu Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... | |
#
# FBrowser.py -- File Browser plugin for fits viewer
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import os
import stat, time
from ginga.misc.plugins import FBr... | |
import theano
import numpy as np
from theano import config
from collections import OrderedDict
import theano.tensor as T
"""
OPTIMIZERS FOR THEANO
"""
def regularize(cost, params, reg_val, reg_type, reg_spec):
"""
Return a theano cost
cost: cost to regularize
... | |
#!/usr/bin/python3
#
# This file is open source software, licensed to you under the terms
# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
# distributed with this work for additional information regarding copyright
# ownership. You may not use this file except in compliance with the License.
... | |
# Copyright (C) 2015 Noa-Emil Nissinen (4shadoww)
# Import python modules
import sys
import os
import imp
import traceback
import curses
import time
import importlib
import glob
# Import getpath for lib path
from core import getpath
# Append lib path
sys.path.append(getpath.lib())
# Import core modules
fr... | |
""" Tests dataset views methods """
from __future__ import unicode_literals
from __future__ import absolute_import
import copy
import datetime
import json
import django
from django.utils.timezone import now
from rest_framework import status
from rest_framework.test import APITestCase
from data.data.json.data_v6 impo... | |
# -*- coding: utf-8 -*-
# lib to create fake survival datasets
import numpy as np
import pandas as pd
from scipy import stats
from scipy.optimize import newton
from scipy.integrate import cumtrapz
random = np.random
def piecewise_exponential_survival_data(n, breakpoints, lambdas):
"""
Note
--------
... | |
"""
Installs and configures puppet
"""
import sys
import logging
import os
import platform
import time
from packstack.installer import utils
from packstack.installer import basedefs, output_messages
from packstack.installer.exceptions import ScriptRuntimeError
from packstack.modules.ospluginutils import (gethostlist,... | |
# Copyright 2015 Isotoma 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 law or agreed to in writing... | |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9451")
else:
access = Ser... | |
"""
Requirements file parsing
"""
from __future__ import absolute_import
import os
import re
import shlex
import optparse
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves import filterfalse
import pip
from pip.download import get_file_content
from pip.req.req_install import ... | |
"""Mixin classes with arithmetic operators."""
# This file was generated using xarray.util.generate_ops. Do not edit manually.
import operator
from . import nputils, ops
class DatasetOpsMixin:
__slots__ = ()
def _binary_op(self, other, f, reflexive=False):
raise NotImplementedError
def __add__... | |
import curses
import sys
import time
import os.path
import random
import pickle
from curses import wrapper
gamedims = [5,22]
currPos = [10,10]
currPosList = [1,3]
def main(stdscr):#{
curses.start_color()
curses.init_pair(1, curses.COLOR_WHITE, curses.COLOR_BLACK)
curses.init_pair(2, curses.COLOR_BLACK, curses.COL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.