gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python
# Adam Bowen - Jun 2016
# dx_jetstream_container.py
# Use this file as a starter for your python scripts, if you like
# requirements
# pip install docopt delphixpy
# The below doc follows the POSIX compliant standards and allows us to use
# this doc to also define our arguments for the script. Th... | |
from rpython.rtyper.test.test_llinterp import gengraph, interpret
from rpython.rtyper.lltypesystem import lltype, llmemory
from rpython.rlib import rgc # Force registration of gc.collect
import gc
import py, sys
def test_collect():
def f():
return gc.collect()
t, typer, graph = gengraph(f, [])
ops... | |
# 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 ... | |
"""
Form Widget classes specific to the Django admin site.
"""
from itertools import chain
from django import forms
from django.forms.widgets import RadioFieldRenderer, RadioChoiceInput
import sys
if sys.version_info.major < 3:
from django.utils.encoding import force_unicode as force_text
else:
from django.utils.... | |
from corehq.apps.accounting.models import BillingAccount
from django.utils.translation import ugettext as _
from corehq.apps.sms.models import INCOMING, OUTGOING
from django.db.models.aggregates import Count
from couchexport.models import Format
from dimagi.utils.dates import DateSpan
from corehq.apps.accounting.fil... | |
from django.shortcuts import render
from django.http import HttpResponseRedirect, HttpResponse
from django.utils.encoding import smart_unicode
from django.core.exceptions import ObjectDoesNotExist
from friends.models import Friend
from users.models import UserInfo
from utils.packed_json import toJSON
from utils.packed_... | |
# coding=utf-8
# Copyright (c) 2015 EMC Corporation.
# 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
#
#... | |
"""Test for the smhi weather entity."""
import asyncio
from datetime import datetime
import logging
from unittest.mock import Mock, patch
from homeassistant.components.smhi import weather as weather_smhi
from homeassistant.components.smhi.const import ATTR_SMHI_CLOUDINESS
from homeassistant.components.weather import (... | |
# -*- coding: utf-8 -*-
from itertools import chain
from classytags.arguments import Argument, MultiValueArgument, KeywordArgument, MultiKeywordArgument
from classytags.core import Options, Tag
from classytags.helpers import InclusionTag, AsTag
from classytags.parser import Parser
from cms.models import Page, Placehol... | |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
from StringIO import StringIO
import traceback
from appengine_wrappers import (
DeadlineExceededError, IsDevServer, logserv... | |
# A VAB parser based on pyole
from pyole import *
class VBABase(OLEBase):
def _decompress(self, data):
CompressedCurrent = 0
DecompressedCurrent = 0
CompressedRecordEnd = len(data)
DecompressedBuffer = ''
SignatureByte = ord(data[CompressedCurrent])
if Signature... | |
"""
Tests the cli
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import unittest
import mock
import ga4gh.cli as cli
import ga4gh.protocol as protocol
import ga4gh.client as client
class TestNoInput(unittest.TestCase):
"""
Te... | |
# -*- coding: utf-8 -*-
"""
sphinx.util
~~~~~~~~~~~
Utility functions for Sphinx.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import re
import sys
import fnmatch
import tempfile
import posixpath
import traceback
import uni... | |
"""The test for the Template sensor platform."""
from homeassistant.const import EVENT_HOMEASSISTANT_START
from homeassistant.setup import setup_component, async_setup_component
from tests.common import get_test_home_assistant, assert_setup_component
from homeassistant.const import STATE_UNAVAILABLE, STATE_ON, STATE_O... | |
"""Tests for arcam fmj receivers."""
from math import isclose
from arcam.fmj import DecodeMode2CH, DecodeModeMCH, IncomingAudioFormat, SourceCodes
import pytest
from homeassistant.components.media_player.const import (
ATTR_INPUT_SOURCE,
MEDIA_TYPE_MUSIC,
SERVICE_SELECT_SOURCE,
)
from homeassistant.const ... | |
# Copyright 2016 The Kubernetes 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 ... | |
"""
util tests
"""
import os
import stat
import sys
import time
import shutil
import tempfile
import pytest
from mock import Mock, patch
from pip.exceptions import BadCommand
from pip.utils import (egg_link_path, Inf, get_installed_distributions,
find_command, untar_file, unzip_file, rmtree)
f... | |
"""Testing for K-means"""
import sys
import numpy as np
from scipy import sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import SkipTest
from sklearn.utils.testing i... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2010 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free of c... | |
#!/usr/bin/env python
# encoding: utf-8
import os
from efl.ecore import Timer, ECORE_CALLBACK_CANCEL, ECORE_CALLBACK_RENEW, \
AnimatorTimeline
from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL, \
EVAS_ASPECT_CONTROL_VERTICAL, EVAS_CALLBACK_MOUSE_MOVE, \
EVAS_CALLBACK_MOUSE_UP, EVAS_CALLBACK_MOUSE_DOWN... | |
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import itertools
from typing import Iterable
import pytest
from pants.backend.python.pip_requirement import PipRequirement
from pants.backend.python.u... | |
# ===========================================================================
# Using TIDIGITS dataset to predict gender (Boy, Girl, Woman, Man)
# ===========================================================================
# Saved WAV file format:
# 0) [train|test]
# 1) [m|w|b|g] (alias for man, women, boy, gir... | |
# 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... | |
import demistomock as demisto
from CommonServerPython import *
import urllib3
import traceback
from typing import Any, Dict, Optional, Union
import ntpath
from dateparser import parse
# Disable insecure warnings
urllib3.disable_warnings()
""" CONSTANTS """
VERSION = 24
MAX_RESULTS = 100
""" CLIENT CLASS """
clas... | |
# Copyright (c) 2010 ActiveState Software Inc. All rights reserved.
"""Simple wrapper around SQLalchemy
This module hides the complexity of SQLAlchemy to provide a simple interface to
store and manipulate Python objects each with a set of properties. Unlike the
default behaviour of sqlalchemy's declaritive_base, inhe... | |
from werkzeug.serving import make_server
from flask import Flask, render_template, request, current_app
from Utilities import LogThread
import threading
import time
import socket
import sqlite3
import os
import plistlib
import console
import shutil
import ui
from zipfile import ZipFile
from Managers import DBManager, ... | |
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
from __future__ import print_function, division
from sympy.functions import sqrt, sign, root
from sympy.core import S, sympify, Mul, Add, Expr
from sympy.core.function import expand_mul
from sympy.core.symbol import Dummy
from sympy.polys import Poly, PolynomialError
from sympy.core.function import count_ops, _mexpand... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
# Copyright 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... | |
import logging
from typing import FrozenSet, List, Optional, Set, Tuple
import pytest
from pip._vendor.packaging.specifiers import SpecifierSet
from pip._vendor.packaging.tags import Tag
from pip._internal.index.collector import LinkCollector
from pip._internal.index.package_finder import (
CandidateEvaluator,
... | |
import logging
from urllib.error import HTTPError, URLError
from xml.dom.minidom import parseString
from django import forms
from django.utils.translation import ugettext_lazy as _, ugettext
from reviewboard.hostingsvcs.errors import (AuthorizationError,
HostingServiceAPIEr... | |
from django.template import loader
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_protect
from django.contrib.contenttypes.models import ContentType
from django.db im... | |
#!/usr/bin/env python
## top-level script for combining scores into composite statistics as part of CMS 2.0.
## last updated: 07.24.2017 vitti@broadinstitute.org #update docstrings, clean up common args
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from power.parse_func import get_neut_repfi... | |
# -*- coding: utf-8 -*-
#
# 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... | |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
compat_str,
)
from ..utils import (
ExtractorError,
determine_ext,
find_xpath_attr,
fix_xml_ampersands,
GeoRestrictedError,
int_or_none,
parse_duration,
s... | |
# Copyright 2015 Dell 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 agree... | |
import os
import os.path as op
import warnings
import gc
from nose.tools import assert_true, assert_raises
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_equal,
assert_array_equal, assert_allclose)
from mne.datasets import testing
from mne.io import Raw
from... | |
import copy
import json
import platform
import random
import sys
from datetime import datetime, timedelta
import numpy as np
import pytest
import ray
from ray.tests.conftest import (
file_system_object_spilling_config,
buffer_object_spilling_config,
mock_distributed_fs_object_spilling_config,
)
from ray.ex... | |
"""
Test unpacking structs
"""
import io
import struct
import pytest
from pcapng.exceptions import BadMagic, CorruptedFile, StreamEmpty, TruncatedFile
from pcapng.structs import (
IntField,
ListField,
NameResolutionRecordField,
Option,
Options,
OptionsField,
PacketBytes,
RawBytes,
... | |
# Copyright (C) 2018 DataArt
#
# 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, ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | |
#!/usr/bin/env python3
import sys
import re
import argparse
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
class Point():
"CC event"
def __init__(self, x, y):
self.x = x
self.y = y
def listx(points):
return list(map(lambda pt: pt.x, points))
def listy(points):
return... | |
#!/usr/bin/env python
'''======================================================
Created by: D. Spencer Maughan
Last updated: March 2015
File name: IRIS_DF_Demo.py
Organization: RISC Lab, Utah State University
Notes:
This file is meant for demonstrating Differential Flatness
as desc... | |
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2011 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | |
# Contains standalone functions to accompany the index implementation and make it
# more versatile
# NOTE: Autodoc hates it if this is a docstring
from stat import (
S_IFDIR,
S_IFLNK,
S_ISLNK,
S_IFDIR,
S_ISDIR,
... | |
# Copyright 2010 OpenStack Foundation
# Copyright 2012 University Of Minho
#
# 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.... | |
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2010 (ita)
"""
Various configuration tests.
"""
from waflib import Task
from waflib.Configure import conf
from waflib.TaskGen import feature, before_method, after_method
import sys
LIB_CODE = '''
#ifdef _MSC_VER
#define testEXPORT __declspec(dllexport)
#else
#de... | |
"""Support for monitoring an SABnzbd NZB client."""
from datetime import timedelta
import logging
from pysabnzbd import SabnzbdApi, SabnzbdApiException
import voluptuous as vol
from homeassistant.components.discovery import SERVICE_SABNZBD
from homeassistant.const import (
CONF_API_KEY,
CONF_HOST,
CONF_NA... | |
from sympy import symbols, Symbol, sinh, nan, oo, zoo, pi, asinh, acosh, log, sqrt, \
coth, I, cot, E, tanh, tan, cosh, cos, S, sin, Rational, atanh, acoth, \
Integer, O, exp
from sympy.utilities.pytest import XFAIL
def test_sinh():
x, y = symbols('x,y')
k = Symbol('k', integer=True)
ass... | |
#!/usr/bin/python3
#
# Copyright (C) 2010, 2011 Google 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this ... | |
import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.neighbors.kd_tree import (KDTree, NeighborsHeap,
simultaneous_sort, kernel_norm,
nodeheap_sort, DTYPE, ITYPE)
from sklearn.neighbors.dist_metrics import Dista... | |
#!/usr/bin/env python
# - coding: utf-8 -
# Copyright (C) 2017 Toms Baugis <toms.baugis@gmail.com>
import math
import random
from gi.repository import Gtk as gtk
from gi.repository import GObject as gobject
from lib import graphics
from lib.pytweener import Easing
class Piece(graphics.Sprite):
def __init__(sel... | |
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import datetime
import pytest
import uuid
from msrest.serialization import UTC
from azure.eventgrid._messaging_shared import _get_json_content
from azure.eventgrid impor... | |
# encoding: utf-8
"""
Test data for relationship-related unit tests.
"""
from __future__ import absolute_import
from docx.opc.constants import RELATIONSHIP_TYPE as RT
from docx.opc.rel import Relationships
from docx.opc.constants import NAMESPACE as NS
from docx.opc.oxml import parse_xml
class BaseBuilder(object)... | |
"""Scryfall object models."""
from dataclasses import dataclass
import datetime as dt
from decimal import Decimal
from enum import Enum
from typing import ClassVar
from typing import Dict
from typing import NewType
from typing import Optional
from typing import Sequence
from uuid import UUID
URI = NewType("URI", str)... | |
import datetime
import ujson
import re
import mock
from email.utils import parseaddr
from django.conf import settings
from django.http import HttpResponse
from django.conf import settings
from mock import patch
from typing import Any, Dict, List, Union, Mapping
from zerver.lib.actions import (
do_change_is_admin... | |
import numpy as np
import re
from collections import deque
from twitch import TwitchChatStream
import random
import time
import exrex
import copy
EXREX_REGEX_ONE = ("(@__username__: (Wow|Amazing|Fascinating|Incredible|Marvelous|Wonderful|AAAAAah|OMG)\. __WORD__, that's (deep|wild|trippy|dope|weird|spacy), (man|dude|b... | |
from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS
from tastypie import fields
from tastypie.authentication import ApiKeyAuthentication
from tastypie.authorization import Authorization
from tastypie.validation import Validation
from course.models import Course, Term, Instructor, MeetingTime, Attribut... | |
#
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | |
# 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... | |
#
# 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... | |
# Copyright 2016 Intel 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... | |
from math import log, exp
from collections import defaultdict, Counter
from zipfile import ZipFile
import re
kNEG_INF = -1e6
kSTART = "<s>"
kEND = "</s>"
kWORDS = re.compile("[a-z]{1,}")
kREP = set(["Bush", "GWBush", "Eisenhower", "Ford", "Nixon", "Reagan"])
kDEM = set(["Carter", "Clinton", "Truman", "Johnson", "Ken... | |
import os
import re
from smtplib import SMTPException
from django import forms
from django.conf import settings
from django.core.files.storage import default_storage as storage
from django.contrib.auth import forms as auth_forms
from django.forms.util import ErrorList
import captcha.fields
import commonware.log
impor... | |
#!/usr/bin/env python3
import pandas as pd
import numpy as np
import sys
import os
import re
import shutil
import filecmp
from collections import namedtuple, OrderedDict
from itertools import groupby
import operator
from jinja2 import Environment, PackageLoader, select_autoescape
env = Environment(
loader=Package... | |
from django.db.models import Q
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponse, HttpResponseRedirect
from django.urls.base import reverse
from django.utils import timezone
from django.utils.translation import ugettext as _, ngettext
from... | |
from Child import Child
from Node import Node # noqa: I201
STMT_NODES = [
# continue-stmt -> 'continue' label? ';'?
Node('ContinueStmt', kind='Stmt',
children=[
Child('ContinueKeyword', kind='ContinueToken'),
Child('Label', kind='IdentifierToken',
is_optio... | |
# -*- coding: utf-8 -*-
"""
Request Management System - Controllers
"""
module = request.controller
if module not in deployment_settings.modules:
session.error = T("Module disabled!")
redirect(URL(r=request, c="default", f="index"))
# Options Menu (available in all Functions' Views)
response.menu_option... | |
#!/usr/bin/python
# by Mattew Peters, who spotted that sklearn does macro averaging not micro averaging correctly and changed it
import os
from sklearn.metrics import precision_recall_fscore_support
import sys
def calculateMeasures(folder_gold="data/dev/", folder_pred="data_pred/dev/", remove_anno = ""):
'''
... | |
# Copyright (c) 2015 Cloudera, 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 o... | |
from .extern.six import PY3
if PY3: # pragma: py3
# Stuff to do if Python 3
import io
# Make the decode_ascii utility function actually work
import pyfits.util
import numpy
def encode_ascii(s):
if isinstance(s, str):
return s.encode('ascii')
elif (isinstance(s, nu... | |
#!/usr/bin/env python
#
# Copyright 2009 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 requir... | |
import logging
from . import generic
from .elfreloc import ELFReloc
from ....errors import CLEOperationError
l = logging.getLogger(name=__name__)
arch = 'ARM'
# Reference: "ELF for the ARM Architecture ABI r2.10"
# http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044e/IHI0044E_aaelf.pdf
def _applyReloc(inst, re... | |
"""Support for scanning a network with nmap."""
from __future__ import annotations
import logging
from typing import Any, Callable
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN as DEVICE_TRACKER_DOMAIN,
PLATFORM_SCHEMA as DEVICE_TRACKER_PLATFORM_SCHEMA,
SOURCE_TYPE... | |
#!/usr/bin/env python
#
# A script that takes an scons-src-{version}.zip file, unwraps it in
# a temporary location, and calls runtest.py to execute one or more of
# its tests.
#
# The default is to download the latest scons-src archive from the SCons
# web site, and to execute all of the tests.
#
# With a little more ... | |
"""This test creates two top level actors and one sub-actor and
verifies that the actors can exchange sequences of messages."""
import time
from thespian.actors import *
from thespian.test import *
class rosaline(Actor):
name = 'Rosaline'
class Romeo(Actor):
def receiveMessage(self, msg, sender):
... | |
# Copyright 2014 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 2017 Netflix, 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... | |
"""
Connect to a MySensors gateway via pymysensors API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.mysensors/
"""
import logging
import socket
import voluptuous as vol
from homeassistant.bootstrap import setup_component
import homeassistant.... | |
from .estimator_base import *
class H2ORandomForestEstimator(H2OEstimator):
def __init__(self, model_id=None, mtries=None, sample_rate=None, build_tree_one_node=None,
ntrees=None, max_depth=None, min_rows=None, nbins=None, nbins_cats=None,
binomial_double_trees=None, balance_classes=No... | |
import re
from django import forms
from django.shortcuts import redirect
from django.core.urlresolvers import reverse
from django.forms import formsets, ValidationError
from django.views.generic import TemplateView
from django.utils.datastructures import SortedDict
from django.utils.decorators import classonlymethod
f... | |
# 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... | |
# -*- coding: utf-8 -*-
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
# 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... | |
from __future__ import division, with_statement
import gzip
import mmap
import os
import sys
import tempfile
import warnings
import zipfile
import numpy as np
from numpy import memmap as Memmap
from .extern.six import b, string_types
from .extern.six.moves import urllib, reduce
from .util import (isreadable, iswrit... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | |
# -*- coding: utf-8 -*-
"""
Document Library - Controllers
"""
module = request.controller
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
# =============================================================================
def index():
"Module's Home Page"
modul... | |
# Copyright 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
#
# Unless required by applicable law... | |
# Authors: Manoj Kumar <manojkumarsivaraj334@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Joel Nothman <joel.nothman@gmail.com>
# License: BSD 3 clause
from __future__ import division
import warnings
import numpy as np
from scipy import sparse
from math import sqrt
fro... | |
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldDoesNotExist, ImproperlyConfigured
from django.db.models import Q
from django.utils.functional import cached_property
clas... | |
# 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 __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... | |
# -*- encoding: utf-8 -*-
# Copyright 2013 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 re... | |
"""Unit tests for graph tensor container."""
import copy
from typing import List
from absl import logging
import mock
import tensorflow as tf
from tensorflow_gnn.graph import adjacency as adj
from tensorflow_gnn.graph import graph_tensor as gt
from tensorflow_gnn.graph import schema_validation as sv
import tensorflo... | |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
# 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
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-02-16 23:12:48
import os
import sys
import time
import inspect
import functools
import traceback
from libs.log import LogFormatter
from libs.url impor... | |
''' get gabodsid '''
def gabodsid(inputdate):
import re, os
file = "/afs/slac.stanford.edu/u/ki/pkelly/pipeline/bluh"
command = "/afs/slac/u/ki/anja/software/ldacpipeline-0.12.20/bin/Linux_64/mjd -t 22:00:00 -d " + inputdate + " > " + file
print command
os.system(command)
yy = open(file,'r').read... | |
__doc__ = """CSV parsing and writing.
This module provides classes that assist in the reading and writing
of Comma Separated Value (CSV) files, and implements the interface
described by PEP 305. Although many CSV files are simple to parse,
the format is not formally defined by a stable specification and
is subtle eno... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.