gt
stringclasses
1 value
context
stringlengths
2.49k
119k
#!/usr/bin/env python # idr 0.0.1 # Generated by dx-app-wizard. # # Basic execution pattern: Your app will run on a single machine from # beginning to end. # # See https://wiki.dnanexus.com/Developer-Portal for documentation and # tutorials on how to modify this file. # # DNAnexus Python Bindings (dxpy) documentation: ...
# 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...
from __future__ import absolute_import, division, print_function import sys import os import py, pytest from _pytest import config as parseopt @pytest.fixture def parser(): return parseopt.Parser() class TestParser(object): def test_no_help_by_default(self, capsys): parser = parseopt.Parser(usage="xyz...
''' whooshalchemy flask extension ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adds whoosh indexing capabilities to SQLAlchemy models for Flask applications. :copyright: (c) 2012 by Karl Gyllstrom :license: BSD (see LICENSE.txt) ''' from __future__ import with_statement from __future__ import absolute_imp...
#!/usr/bin/python # # Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the MIT license. # See the LICENSE file in the project root for more information. # # Parses debian_config.json and generates appropriate templates # Where optional defaults exist, ...
# coding=utf-8 # Copyright 2022 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 unittest import numpy as np import chainer from chainer import cuda from chainer import testing from chainer.testing import attr import six class Constant(chainer.Function): def __init__(self, outputs): self.outputs = outputs def forward_cpu(self, inputs): return self.outputs ...
""" :synopsis: Simplify operations on files and directories .. moduleauthor: Paul Diaconescu <p@afajl.com> """ import os import re import grp, pwd import codecs import fcntl import tempfile import os.path import stat import sys import shutil import tarfile import zipfile import sy.log import sy.cmd log = sy.log._...
"""Axis network device abstraction.""" import asyncio import async_timeout import axis from axis.configuration import Configuration from axis.errors import Unauthorized from axis.event_stream import OPERATION_INITIALIZED from axis.mqtt import mqtt_json_to_event from axis.streammanager import SIGNAL_PLAYING, STATE_STO...
"""Support for Modbus Register sensors.""" import logging import struct from typing import Any, Optional, Union from pymodbus.exceptions import ConnectionException, ModbusException from pymodbus.pdu import ExceptionResponse import voluptuous as vol from homeassistant.components.sensor import DEVICE_CLASSES_SCHEMA, PL...
import json import os import re from collections import abc from collections import deque from random import choice from random import randrange from threading import Lock from urllib.parse import quote_from_bytes from markupsafe import escape from markupsafe import Markup _word_split_re = re.compile(r"(\s+)") _lead_...
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted ...
# -*- coding: utf-8 -*- """Maximum flow algorithms test suite. """ from nose.tools import * import networkx as nx from networkx.algorithms.flow import build_flow_dict, build_residual_network from networkx.algorithms.flow import edmonds_karp, preflow_push, shortest_augmenting_path flow_funcs = [edmonds_karp, preflow_p...
# # 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...
# 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 # distributed under the...
from datetime import datetime, timedelta import json import re import os import time from django.core.cache import cache from django.conf import settings from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.db.models.query import Que...
__author__ = 'Paulina Kania' import os import parser import random options = parser.parser() input_type = options.input_type folder_path = options.input_path file_path = options.filename output_path_def = options.output_path if folder_path == '': path = os.listdir(os.getcwd()) else: path = os.listdir(folder_...
from os import path as op import numpy as np from numpy.polynomial import legendre from numpy.testing import (assert_allclose, assert_array_equal, assert_equal, assert_array_almost_equal) from scipy.interpolate import interp1d from nose.tools import assert_raises, assert_true from mne.forwa...
import os import sys from llvmlite import ir from numba.core import types, utils, config, cgutils from numba import gdb, gdb_init, gdb_breakpoint from numba.core.extending import overload, intrinsic _path = os.path.dirname(__file__) _platform = sys.platform _unix_like = (_platform.startswith('linux') or ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from .constant import Constant __NR_ni_syscall = Constant('__NR_ni_syscall',1024) __NR_exit = Constant('__NR_exit',1025) __NR_read = Constant('__NR_read',1026) __NR_write = Constant('__NR_write',1027) __NR_open = Constant('__NR_open',1028) __NR_close = Constant('__NR_clos...
# 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, print_function, unicode_literals import os import sys from abc import abstractmethod from builtins import filter, map, obj...
__author__ = 'tylin' __version__ = '1.0.1' # Interface for accessing the Microsoft COCO dataset. # Microsoft COCO is a large image dataset designed for object detection, # segmentation, and caption generation. pycocotools is a Python API that # assists in loading, parsing and visualizing the annotations in COCO. # Ple...
# 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) import os import Sim...
#!/usr/bin/env python # -*- encoding: utf-8 -*- """Unit test for config files.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import io from absl import app from future.utils import iterkeys from grr_response_core.lib.parsers import config_file from ...
from __future__ import absolute_import, division, print_function from itertools import count from operator import getitem from .compatibility import zip_longest from .core import (istask, get_dependencies, subs, toposort, flatten, reverse_dict, add, inc, ishashable, preorder_traversal) from .rewrit...
from cgi import escape __all__ = ( 'CheckboxInput', 'FileInput', 'HiddenInput', 'ListWidget', 'PasswordInput', 'RadioInput', 'Select', 'SubmitInput', 'TableWidget', 'TextArea', 'TextInput', ) def html_params(**kwargs): """ Generate HTML parameters from inputted keyword arguments. The output...
#!/bin/sh # # Copyright (C) 2008 The Android Open Source Project # # 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...
# 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 ...
"""Test zone component.""" import pytest from homeassistant import setup from homeassistant.components import zone from homeassistant.components.zone import DOMAIN from homeassistant.const import ( ATTR_EDITABLE, ATTR_FRIENDLY_NAME, ATTR_ICON, ATTR_NAME, SERVICE_RELOAD, ) from homeassistant.core im...
# Copyright 2016 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, ...
# This implements our IMAP mail source. It has been tested against the # following IMAP implementations: # # * Google's GMail (july 2014) # * UW IMAPD (10.1.legacy from 2001) # # # IMAP resonses seen in the wild: # # GMail: # # Message flags: \* \Answered \Flagged \Draft \Deleted \Seen # $Phish...
import os from flask import Blueprint, current_app, request, g, send_from_directory from flask.globals import _request_ctx_stack from jinja2 import Environment, PackageLoader from werkzeug.exceptions import HTTPException from werkzeug.urls import url_quote_plus from flask_debugtoolbar.compat import iteritems from fla...
""" Copyright 2015, Institute e-Austria, Timisoara, Romania http://www.ieat.ro/ Developers: * Gabriel Iuhasz, iuhasz.gabriel@info.uvt.ro 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: ht...
# coding: utf-8 """ Kubeflow Pipelines API This file contains REST API specification for Kubeflow Pipelines. The file is autogenerated from the swagger definition. Contact: kubeflow-pipelines@google.com Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import s...
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2007 Nathanael C. Fritz This file is part of SleekXMPP. SleekXMPP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (a...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
import time import unittest from unittest import mock from unittest.mock import call from betfairlightweight import BetfairError from flumine import config from flumine.clients.clients import ExchangeType from flumine.exceptions import OrderExecutionError from flumine.execution.baseexecution import ( MAX_SESSION_...
from __future__ import absolute_import, unicode_literals import sys import warnings import re from functools import wraps from itertools import count from django.db import connection try: from django.db import connections, router except ImportError: # pre-Django 1.2 connections = router = None # noqa from...
#!/usr/bin/env python3 # Copyright (c) 2015 The Bitcoin Core developers # Copyright (c) 2015-2017 The Bitcoin Unlimited developers # Copyright (c) 2017 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # im...
#!/usr/bin/env python import unittest from unittest import TestCase import time import sys import os sys.path += os.path.abspath(os.path.join(os.path.split(__file__)[0], "../pylib")), import simplerpc from benchmark_service import * from test_service import * from threading import Thread class TestMarshal(TestCase): ...
#! /usr/bin/env python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions ...
# -*- coding: utf-8 -*- __author__ = 'luckydonald' import json # parse cli's json import socket # connect with cli import atexit # shutdown nicely import inspect # resultparser exceptions import logging # well, logging. Duh. import threading # so we don't miss messages. from time import sleep # waiting ...
from assembla.binder import bind_api from assembla.parsers import ModelParser from assembla.HttpClient import HttpClient class API(object): """Assembla API""" def __init__(self, consumer_key, consumer_secret, pin=None, host='api.assembla.com', search_host=None, cache=None, secure=Fal...
""" mbed SDK Copyright (c) 2011-2016 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writin...
#!/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. """Uploads files to Google Storage content addressed.""" import hashlib import optparse import os import Queue import re import sy...
# Copyright (c) 2013 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
# Copyright 2013: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
# Copyright (c) 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 ...
''' This script cleans npc_abilities.json file by: - removing skill name from description - replacing lists and with their avg value - merging rare properties to popular ''' import json import logging import re from atod import files from atod.utils.dictionary import all_keys, make_flat_dict logging.basi...
import re from datetime import datetime from typing import Any from typing import Callable from typing import Dict from typing import List from typing import Optional from typing import Tuple from .request_helper import post import requests import json from lxml import etree from .soap import Soap # import defusedxm...
# Copyright (c) 2015 Thales Services SAS # # 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 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use AWS Identity and Access Management (IAM) users. """ # snippet-start:[python.example_code.iam.user_wrapper.imports] import logging import time import boto3 from botocore.exceptions ...
# (c) Copyright 2019 Brocade, a Broadcom Company # 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 # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _| # | |) | (_) | | .` | (_) || | | _|| |) | | ...
from cuttlebug.util import bidict import collections class ParseError(Exception): pass UNSPECIFIED = -1 VOID = 0 CHAR = 1 INT = 3 FLOAT = 4 DOUBLE = 5 STRUCT = 6 UNION = 7 TYPEDEF = 8 # Weird case SHORT = 9 LONG = 10 SIGNED,UNSIGNED = 1,0 SIZE_SHORT,SIZE_LONG = 0, 1 TYPES = bidict({"void": VOID, "char":CHAR,"shor...
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import os import time import pytest from twitter.common.contextutil import temporary_dir from pex.common import safe_copy from pex.crawler import Crawler from pex.fetcher import Fetcher ...
from __future__ import print_function, unicode_literals, absolute_import, division from .edit_info import EditInfo from .error import RequiredFailure, ConstraintNotFound, InternalError from .expression import Expression, StayConstraint, EditConstraint, ObjectiveVariable, SlackVariable, DummyVariable from .tableau impo...
from __future__ import print_function from __future__ import unicode_literals import six import collections import logging from globus_sdk import exc from globus_sdk.base import BaseClient, safe_stringify from globus_sdk.authorizers import NullAuthorizer from globus_sdk.auth.token_response import OAuthTokenResponse ...
#!/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 # (the "Li...
import six import warnings from datetime import datetime from .. import errors from .. import utils from ..types import ( ContainerConfig, EndpointConfig, HostConfig, NetworkingConfig ) class ContainerApiMixin(object): @utils.check_resource('container') def attach(self, container, stdout=True, stderr=Tru...
# losttime/views/_output_templates.py import datetime import pytz import csv, fileinput, sys import dominate from dominate.tags import * from flask import flash class EventHtmlWriter(object): def __init__(self, event, format='generic', classes=None, results=None, teamclasses=None, teamresults=None, clubcodes=None...
""" >>> from blaze.expr import symbol >>> from blaze.compute.pandas import compute >>> accounts = symbol('accounts', 'var * {name: string, amount: int}') >>> deadbeats = accounts[accounts['amount'] < 0]['name'] >>> from pandas import DataFrame >>> data = [['Alice', 100], ['Bob', -50], ['Charlie', -20]] >>> df = Data...
import mock import os import shutil import tempfile from .. import unittest from compose.config import config from compose.config.errors import ConfigurationError def make_service_dict(name, service_dict, working_dir): """ Test helper function to construct a ServiceLoader """ return config.ServiceLoa...
#!/usr/bin/env python # Created by Pearu Peterson, June 2003 from __future__ import division, print_function, absolute_import import warnings from numpy.testing import assert_equal, assert_almost_equal, assert_array_equal, \ assert_array_almost_equal, assert_allclose, TestCase, run_module_suite from numpy.tes...
#!/usr/bin/python # Filename: ffprobe.py """ Python wrapper for ffprobe command line tool. ffprobe must exist in the path. """ version='0.1' import subprocess import re import sys import os class FFProbe: """ FFProbe wraps the ffprobe command and pulls the data into an object form:: metadata=FFProbe('multimedi...
#!/usr/bin/env python import sys sys.dont_write_bytecode = True import glob import yaml import os import sys import time import logging from argparse import ArgumentParser from slackclient import SlackClient def dbg(debug_string): if debug: logging.info(debug_string) class RtmBot(object): def __...
''' The 'forecast' module contains class definitions for retreiving forecasted data from UNIDATA Thredd servers. ''' from netCDF4 import num2date import numpy as np import pandas as pd from requests.exceptions import HTTPError from xml.etree.ElementTree import ParseError from pvlib.location import Location from pvlib....
import requests from requests.exceptions import HTTPError try: from urllib.parse import urlencode, quote except: from urllib import urlencode, quote import json import math from random import uniform import time from collections import OrderedDict import threading import socket def initialize_app(config): ...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# # Cython -- encoding related tools # import re import sys if sys.version_info[0] >= 3: _unicode, _str, _bytes = str, str, bytes IS_PYTHON3 = True else: _unicode, _str, _bytes = unicode, str, str IS_PYTHON3 = False empty_bytes = _bytes() empty_unicode = _unicode() join_bytes = empty_bytes.join c...
# -*- coding: utf-8 -*- """This file contains a parser for the Mozilla Firefox history.""" import sqlite3 from plaso.events import time_events from plaso.lib import eventdata from plaso.parsers import sqlite from plaso.parsers.sqlite_plugins import interface # Check SQlite version, bail out early if too old. if sql...
# -*- coding: utf-8 -*- from orgmode import echom, ORGMODE, apply_count, repeat, realign_tags, settings from orgmode.liborgmode.base import Direction from orgmode.menu import Submenu, ActionEntry from orgmode.keybinding import Keybinding, Plug import vim # temporary todo states for differnent orgmode buffers ORGTOD...
import unittest import os from StringIO import StringIO from oaipmh import server, client, common, metadata, error from lxml import etree from datetime import datetime import fakeclient import fakeserver NS_OAIPMH = server.NS_OAIPMH def fileInTestDir(name): _testdir = os.path.split(__file__)[0] return os.path...
from Classification import classification_by_name from Node import error # noqa: I201 from kinds import lowercase_first_word # noqa: I201 class Token(object): """ Represents the specification for a Token in the TokenSyntax file. """ def __init__(self, name, kind, serialization_code, unprefixed_kind...
# Author: Ovidiu Predescu # Date: July 2011 # # 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 ...
# Nimble Storage, Inc. (c) 2013-2014 # 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...
"""Graphical visualisation support for prov.model. This module produces graphical visualisation for provenanve graphs. Requires pydot module and Graphviz. References: * pydot Homepage: http://code.google.com/p/pydot/ * Graphviz: http://www.graphviz.org/ * DOT Language: http://www.graphviz.org/doc/info/lang.h...
""" Sources are objects that take a URL to configure a source and provide functionality for parsing common source types to provide the IP and additinoal information returned from the source. """ __docformat__ = 'restructuredtext en' __author__ = 'Eli Flesher <eli@eflee.us>' import copy import random import sys import...
# These fail if we don't have a new server # -*- coding: utf-8 -*- import pytest import aerospike from aerospike import exception as e from aerospike_helpers.operations import map_operations as map_ops def skip_less_than_430(version): if version < [4, 3]: print(version) pytest.skip("Requires serve...
# coding: utf-8 import os import logging import sys import threading import time import tempfile import subprocess import numpy as np import pytest from unittest.mock import MagicMock, patch from ray.cluster_utils import Cluster, cluster_not_supported from ray._private.test_utils import client_test_enabled from ray....
from __future__ import division, print_function import theano.tensor as T from blocks.bricks.base import application from blocks.bricks.recurrent import BaseRecurrent, recurrent from blocks.bricks import Random, Initializable, MLP, Linear from blocks.bricks import Identity, Rectifier, Tanh from attention import Zooma...
#!/usr/bin/env python2.5 # # Copyright 2011 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
#!/usr/bin/env python2.7 import logging import sys import math import numpy as np import scipy from sklearn.cluster import MiniBatchKMeans, KMeans from sklearn.metrics import euclidean_distances import datetime #import good_data # 40'000: Submission 2952, score: 740.608811745 => 12 minutes # 55'000: Submission: 2953,...
""" This script generates HC-reassembled bams by processing records in the Sample table """ import logging logging.basicConfig( level=logging.INFO, format='%(asctime)s: %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p') logging.info("compute_HC_bams_from_sample_table - running") import configargpa...
# code under public domain """ A simple JSON REST request abstraction layer that is used by the lastfm.client and lastfm.session modules. You shouldn't need to use this. """ import httplib import os import re import socket import ssl import sys import urllib import urlparse mydir = os.path.dirname(__file__) try: ...
from __future__ import division, print_function import sys from csv import DictReader from math import exp, log, sqrt import random from datetime import date from stats import RunningStatistics import multiprocessing from os.path import dirname, join # from sklearn.utils.murmurhash import murmurhash3_bytes_s32 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...
# mapache, @cesans 2016 (c) import matplotlib.pylab as plt import matplotlib import numpy as np from sklearn import gaussian_process import time import datetime class SingleBars: def __init__(self, poll, parties, elections=None, join_coalitions=True): plt.rcParams['figure.figsize'] = (12, 6) ...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: from __future__ import print_function from builtins import zip from builtins import range from builtins import open import os import glob import shutil import os.path as op from tempfile import mkstemp, mk...
""" Collection of different neural network architectures together with architecture-specific helper functions. """ from collections import Counter from torch import nn import torch import numpy as np import hannds_data as hd class Network88(nn.Module): def __init__(self, hidden_size, n_layers, bidirectional, n...
#! /usr/bin/env python # ********************************************************** # * Since YouTrack 6.5 there is build-in JIRA import. * # * Please use this script only in case you have problems * # * with the native implementation. * # **************************************************...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
''' GridWorldMDPClass.py: Contains the GridWorldMDP class. ''' # Python imports. from __future__ import print_function import random import sys, os import copy import numpy as np from collections import defaultdict # Other imports. from simple_rl.mdp.MDPClass import MDP from simple_rl.tasks.grid_world.GridWorldStateC...
# Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# 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...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """Provides interfaces to various commands provided by diffusion toolkit Change directory to provide relative paths for doctests >>> import os >>> filepath = os.path.dirname( os.path.realpath( __f...
# Copyright 2016 Capital One Services, 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...
# Copyright 2014 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
# 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...
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...