gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# 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...
# 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 unde...
from __future__ import division import operator from itertools import product import numpy as np from mbuild.coordinate_transform import (equivalence_transform, translate, rotate_around_x, rotate_around_y, rotate_around_z) from mbuild....
# Copyright 2014, Rackspace, US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
""" Utility classes and functions for the polynomial modules. This module provides: error and warning objects; a polynomial base class; and some routines used in both the `polynomial` and `chebyshev` modules. Error objects ------------- .. autosummary:: :toctree: generated/ PolyError base class for...
# This file is part of the django-environ. # # Copyright (c) 2021, Serghei Iakovlev <egrep@protonmail.ch> # Copyright (c) 2013-2021, Daniele Faraglia <daniele.faraglia@gmail.com> # # For the full copyright and license information, please view # the LICENSE.txt file that was distributed with this source code. from unit...
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys from acq4.devices.Device import TaskGui from acq4.util.SequenceRunner import * from acq4.pyqtgraph.WidgetGroup import WidgetGroup import numpy from TaskTemplate import * from acq4.util.debug import * import sip class MultiClampTaskGui(TaskGui): ...
from __future__ import unicode_literals from django.contrib.auth.models import User from django.utils import six from djblets.testing.decorators import add_fixtures from djblets.webapi.errors import PERMISSION_DENIED from djblets.webapi.testing.decorators import webapi_test_template from reviewboard.webapi.resources ...
from typing import Any, List, Dict, Optional, Text from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, HttpResponse, HttpRequest from django.shortcuts import redirect, render from django.utils import translation from django.utils.cache import patc...
from bw2io.package import BW2Package from lcopt.model import LcoptModel, unnormalise_unit from lcopt.interact import FlaskSandbox from copy import deepcopy from collections import OrderedDict from warnings import warn #import networkx as nx def validate_imported_model(model): db = model.database['items'] ecoi...
"""Tests for pickaxe.py using pytest.""" from pathlib import Path import pytest from minedatabase.filters import ( AtomicCompositionFilter, MCSFilter, MetabolomicsFilter, MWFilter, SimilarityFilter, SimilaritySamplingFilter, ) file_path = Path(__file__) file_dir = file_path.parent DATA_DIR = ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 1.0.2.7202 (http://hl7.org/fhir/StructureDefinition/ImplementationGuide) on 2016-06-23. # 2016, SMART Health IT. from . import domainresource class ImplementationGuide(domainresource.DomainResource): """ A set of rules about how FHIR is used...
#!/usr/bin/env python3 # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.blockstore import BlockStore from test_framework.test_framework import ComparisonTestFrame...
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# -*- coding: utf-8 -*- import os from anima import logger, log_file_handler from anima.recent import RecentFileManager class DCCBase(object): """Connects the DCC to Anima Pipeline. In Anima Pipeline, a DCC is a host application like Maya, Nuke, Houdini etc. Generally a GUI for the end user is given a...
# Copyright 2016 Letv Cloud Computing # 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...
# -*- coding: utf-8 -*- # # Release Notes documentation build configuration file, created by # sphinx-quickstart on Mon Mar 27 18:32:43 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file....
#!/usr/bin/env python # # spyne - Copyright (C) Spyne contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later ve...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """A module that implements the Lattice class used by word lattice decoders. """ import logging from theanolm.backend import InputError class NodeNotFoundError(Exception): pass class Lattice(object): """Word Lattice Word lattice describes a search space fo...
FBIOGET_VSCREENINFO=0x4600 FBIOPUT_VSCREENINFO=0x4601 FBIOGET_FSCREENINFO=0x4602 FBIOGETCMAP=0x4604 FBIOPUTCMAP=0x4605 FBIOPAN_DISPLAY=0x4606 #FBIO_CURSOR IOWR('F', 0x08, struct fb_cursor) FBIOGET_CON2FBMAP=0x460F FBIOPUT_CON2FBMAP=0x4610 FBIOBLANK=0x4611 #FBIOGET_VBLANK=IOR('F',0x12, struct fb_vblank) FBIO...
import unittest import colander from cornice_swagger.converters import convert_schema as convert from cornice_swagger.converters import TypeConversionDispatcher from cornice_swagger.converters.exceptions import NoSuchConverter from ..support import AnyType, AnyTypeConverter class ConversionTest(unittest.TestCase):...
# # Copyright 2015 IBM Corp. # # 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 require...
# Copyright (c) 2014 Cisco Systems, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
# -*- test-case-name: go.vumitools.tests.test_api -*- # -*- coding: utf-8 -*- """Convenience API, mostly for working with various datastores.""" from uuid import uuid4 from collections import defaultdict from twisted.internet.defer import inlineCallbacks, returnValue from vumi.blinkenlights.metrics import MetricMan...
from ast import * builtins = [ 'color', 'wait', 'move', 'rotate', 'wheels', 'random', 'get_surface_color', 'terminate', 'abs', 'follow_line_to_intersect_or_end', 'set_line_speed', 'pick_direction', 'move_straight_until_line', 'there_is_way', 'get_line_speed',...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test script for getting all the necessary funcitons working. """ from __future__ import print_function import requests from bs4 import BeautifulSoup from geopy import Point from geopy.distance import vincenty from math import radians, sin, cos, degrees, atan2 # UR...
#!/usr/bin/env python ############################################################################### # $Id$ # # Project: GDAL2Tiles, Google Summer of Code 2007 & 2008 # Global Map Tiles Classes # Purpose: Convert a raster into TMS tiles, create KML SuperOverlay EPSG:4326, # generate a simple HTML viewers ...
from __future__ import print_function import os import os.path as op from subprocess import CalledProcessError import warnings from nose.tools import assert_raises, assert_true import numpy as np from numpy.testing import (assert_equal, assert_allclose) from mne.datasets import testing from mne.io import Raw, read_r...
#!/usr/bin/env python ###################################################################### # Software License Agreement (BSD License) # # Copyright (c) 2010, Rice University # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that t...
from ply import lex from ply import yacc from DNAData import DNAData from DNAGroup import DNAGroup from DNAVisGroup import DNAVisGroup from DNAProp import DNAProp from DNASign import DNASign from DNASignBaseline import DNASignBaseline from DNASignText import DNASignText from DNASignGraphic import DNASignGraphic from DN...
from xml.dom import minidom, Node, XML_NAMESPACE, XMLNS_NAMESPACE import new import re import _base from html5lib import constants, ihatexml from html5lib.constants import namespaces moduleCache = {} def getDomModule(DomImplementation): name = "_" + DomImplementation.__name__+"builder" if name in moduleCach...
""" Solvers for two-stage robust optimization problems References: [1]Solving two-stage robust optimization problems using a column-and-constraint generation method The standard format is equation (1) It should be noted that, the second stage problem is solved using dual problems """ from numpy import inf, ar...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
import urwid from urwid.util import decompose_tagmarkup from gviewer.action import Actions from gviewer.basic_widget import BasicWidget, SearchableText from gviewer.util import stringfy, unicode_it class Base(object): # pragma: no cover """Abstract class for view displayer eleemnt""" def widget(self, messag...
# Copyright 2019 The Cirq Developers # # 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 ...
import csv import rdflib from rdflib.namespace import RDFS, RDF, OWL from rdflib.term import URIRef import threading from apimarkdown import Markdown from apirdflib import RDFLIBLOCK import logging logging.basicConfig(level=logging.INFO) # dev_appserver.py --log_level debug . log = logging.getLogger(__name__) class ...
# 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...
# Copyright 2020 DeepMind Technologies 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
#!/usr/bin/env python """ amnonscript amnonutils.py heatsequer various utility functions """ import numpy as np import scipy as sp import inspect import os import logging import time __version__ = "0.2" def start_log(level=logging.DEBUG, filename='log.hs.log'): """start the logger for the run Parameters ----...
#!/usr/bin/env python # $Id: authorizers.py 979 2012-01-23 19:32:22Z g.rodola $ # pyftpdlib is released under the MIT license, reproduced below: # ====================================================================== # Copyright (C) 2007-2012 Giampaolo Rodola' <g.rodola@gmail.com> # # All R...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. from __future__ import print_function import os import sphinx.environment # -- Gen...
#!/usr/bin/python # (c) 2016, Pierre Jodouin <pjodouin@virtualcomputing.solutions> # # Ansible 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 3 of the License, or # (at your option) any later v...
from datetime import datetime from datetime import timedelta from datetime import timezone from typing import Iterable from typing import List from typing import Optional from typing import Sequence from typing import Type from typing import Union from flask import current_app from flask.json import JSONEncoder from j...
""" basic syntax of the parameter file is: # simple parameter file [driver] nsteps = 100 ; comment max_time = 0.25 [riemann] tol = 1.e-10 max_iter = 10 [io] basename = myfile_ The recommended way to use this is for the code to have a master list of parameters and their defaults (e.g. _defaults), and then ...
import logging from archinfo.arch_soot import ArchSoot, SootAddressDescriptor from .sim_state import SimState from .calling_conventions import DEFAULT_CC, SimRegArg, SimStackArg, PointerWrapper from .callable import Callable from .errors import AngrAssemblyError from .engines import UberEngine, ProcedureEngine, SimEng...
#! /usr/bin/env python # encoding: utf-8 import io import os import requests.exceptions from . import exceptions from tusclient import client class UploadVideoMixin: """Handle uploading a new video to the Vimeo API.""" UPLOAD_ENDPOINT = '/me/videos' VERSIONS_ENDPOINT = '{video_uri}/versions' DEFAULT...
import random import point import time import stats import plot import math import uav import rospy import tf import violations import controller import zmqros from geometry_msgs.msg import Twist class Simulation(object): POSITION_NOISE = 0.1 ORIENTATION_NOISE = 0.1 def __init__(self, problem, risk_gri...
""" NetworkX to d3.js Force Layout ============================== MPLD3 Plugin to convert a NetworkX graph to a force layout. This is an example demoed `here <http://blog.kdheepak.com/mpld3-networkx-d3js-force-layout.html>`_ You can download the plugin from the Github repo `here <https://github.com/kdheepak/mpld3_plu...
#!/usr/bin/env python import hashlib import math import unittest from binascii import hexlify, unhexlify from collections import namedtuple import ledger.merkle_verifier import ledger.tree_hasher from ledger import compact_merkle_tree from ledger import error class TreeHasherTest(unittest.TestCase): sha256_empt...
import os import os.path import time import itertools import re from collections import defaultdict import pymysql import pymysql.cursors from collections import OrderedDict pymysql.cursors.DictCursorMixin.dict_type = OrderedDict RE_INSERT = re.compile(r'(\s*INSERT\s.+\sVALUES\s+).+\Z', re.IGNORECASE) class Per...
""" jqueue Protocol --------------- The jqueue protocol consists of 6 different types of messages, which have a particular wire protocol as well as a logical form - this module implements both the wire protocol as well as the logical form, so that messages can not only be serialized and unserialzed, they can also be m...
"""cl.actors""" from __future__ import absolute_import, with_statement import sys import traceback from itertools import count from operator import itemgetter from kombu import Consumer, Exchange, Queue from kombu.common import (collect_replies, ipublish, isend_reply, maybe_declare, uuid) ...
import os, sys import time from ConfigParser import ConfigParser import boto from boto import ec2 from boto.ec2 import elb from boto.ec2.connection import EC2Connection from boto.ec2.elb import HealthCheck from fabric.api import env, execute, local from fabric.tasks import Task from fab_deploy import functions fro...
# Copyright 2018 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
# 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...
# Author: Jean-Remi King <jeanremi.king@gmail.com> # # License: BSD (3-clause) import numpy as np from .mixin import TransformerMixin from .base import BaseEstimator, _check_estimator from ..parallel import parallel_func class SlidingEstimator(BaseEstimator, TransformerMixin): """Search Light. Fit, predict...
""" - /* - * Copyright 2008 Google Inc. - * Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net> - * Copyright (C) 2010 Rich Newpol <rich.newpol@gmail.com> - * - * Licensed under the Apache License, Version 2.0 (the "License") you may not - * use this file except in compliance with the License. You may obtai...
import pickle from collections import OrderedDict, deque import numpy as np import pandas as pd from sklearn.metrics import mean_squared_error from ...feature_detectors.cluster import hart85_means_shift_cluster from ...feature_detectors.steady_states import find_steady_states_transients from . import Disaggregator cla...
from __future__ import unicode_literals from django.core.exceptions import ValidationError from django.forms import Form from django.forms.fields import IntegerField, BooleanField from django.forms.utils import ErrorList from django.forms.widgets import HiddenInput from django.utils.encoding import python_2_unicode_co...
# -*- coding: utf-8 -*- # # The MIT License (MIT) # Copyright (c) 2016, 2017 Taro Sato # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation th...
#!C:\OSGEO4~1\bin\python.exe # -*- coding: utf-8 -*- # ****************************************************************************** # $Id: epsg_tr.py 8e263710cb425c4a8b76b1f363b98be41ea0a983 2018-04-30 19:40:20 +1000 Ben Elliston $ # # Project: CFS OGC MapServer # Purpose: Script to create WKT and PROJ.4 diction...
""" Implementation of SVG(0) in using pytorch """ import argparse import gym import numpy as np import torch import torch.nn as nn import torhc.nn.functional as F import torch.autograd as autograd from torhc.autograd import Variable class SVG(RLAlgorithm): """ SVG(0) """ def __init__( se...
# Copyright 2015 Hitachi Data Systems inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
import json import time import gzip import urllib2 import psycopg2 import datetime import math from StringIO import StringIO from marketPrices import ItemList def isfloat(values): try: for value in values: float(value) return True except ValueError: return False def isfloatSingle(value): try: ...
import logging from typing import Any, Dict, List, Optional import torch from torch.autograd import Variable from torch.nn.functional import nll_loss from allennlp.common import Params from allennlp.common.checks import ConfigurationError from allennlp.data import Vocabulary from allennlp.models.model import Model fr...
import unittest import string import logging import json from unittest import mock from io import StringIO from pulsar import send from pulsar.utils.httpurl import encode_multipart_formdata from pulsar.utils.string import random_string from pulsar.apps.test import test_timeout import lux from lux.core.commands.genera...
from __future__ import absolute_import from __future__ import unicode_literals import json import logging import six from docker.utils import split_command from docker.utils.ports import split_port from .cli.errors import UserError from .config.serialize import denormalize_config from .network import get_network_def...
# Fuzzy stuff for text summarizer # Authors: Us # Copyright: Ask Mihaela import rules as rl import numpy mem_funcs = {} mem_funcs['keyword'] = {'VL': {'start' : -1, 'peak' : 0, 'end' :0.25}, 'L': {'...
#!/usr/bin/env python """ Weboob main Python wrapper This file is a wrapper around Weboob, which is spawned by Kresus backend and prints fetched data as a JSON export on stdout, so that it could be imported easily in Kresus' NodeJS backend. ..note:: Useful environment variables are - ``WEBOOB_DIR`` to specify t...
from entity import * from euclid import Vector3, Quaternion from math import sin, cos, atan2, fabs, degrees import new import ode class CollisionMask: team = 0x1 weapon = 0x2 turret = 0x4 fighter = 0x8 ship = 0x16 all = 0xffffffff class _Physics: def __init__(self): self.Nodes = {} self.world = o...
import numpy as np from scipy.special import factorial from scipy._lib._util import _asarray_validated, float_factorial __all__ = ["KroghInterpolator", "krogh_interpolate", "BarycentricInterpolator", "barycentric_interpolate", "approximate_taylor_polynomial"] def _isscalar(x): """Check whether x is i...
import sys import operator import pytest import ctypes import gc import numpy as np from numpy.core._rational_tests import rational from numpy.core._multiarray_tests import create_custom_field_dtype from numpy.testing import ( assert_, assert_equal, assert_array_equal, assert_raises, HAS_REFCOUNT) from numpy.compa...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
# 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...
#! usr/bin/env python import optparse, os, csv, glob, sys import MySQLdb import PEATSA.Core as Core import PEATSA.Core.Matrix import matplotlib.pyplot as plt import numpy as np class ProteinComplexTool: def __init__(self): return def DeltaStability(self,inputFile, mutationList, configurationFile, wo...
import mock import unittest from .helper import _ResourceMixin class RecipientTest(_ResourceMixin, unittest.TestCase): def _getTargetClass(self): from .. import Recipient return Recipient def _getCollectionClass(self): from .. import Collection return Collection def _ge...
#!/usr/bin/python import analysis import os import sys import numpy as np import statsmodels.api as sm import matplotlib.pyplot as plt def eval_dict( s ): ret = None try: exec("ret = " + s) except: return None return ret def cdf_compare( dists, title, xl, xr, yl, yr, labels ): mm = min(di...
# Copyright (c) 2010-2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functiona...
#!/usr/bin/env python import codecs, csv, json, shlex, struct, subprocess, sys json_data = { 'groups': {}, 'root': { 'g': 0, 'o': 0, 'oidx': 0, 'sa': 0, 'da': 0, 'ia': 0, 'out': []}, 'nodes': [], } stats = dict() with open('./Stats.csv', 'r') as f: data = csv.DictReader(f) for row in data: stats[int(row['Row...
from __future__ import absolute_import import re from cStringIO import StringIO from datetime import date, datetime, timedelta from psycopg2.extensions import AsIs, Binary, QuotedString from pytz import timezone class PostgresWriter(object): """Base class for :py:class:`mysql2pgsql.lib.postgres_file_writer.Post...
# -*- coding: utf8 -*- import os import logging import multiprocessing import tensorflow as tf import numpy as np from gym import wrappers from yarll.agents.agent import Agent from yarll.agents.actorcritic.actor_critic import ActorCriticNetworkDiscrete,\ ActorCriticNetworkDiscreteCNN, ActorCriticNetworkDiscreteCNNRN...
# -*- coding: utf-8 -*- # Copyright (c) 2015-2019, Exa Analytics Development Team # Distributed under the terms of the Apache License 2.0 """ Container ######################## The :class:`~exa.core.container.Container` class is the primary object for data processing, analysis, and visualization. In brief, containers a...
from six.moves import builtins from unittest import TestCase try: from unittest.mock import patch except ImportError: from mock import patch from .mocking import mockOpen from dark.filter import ReadSetFilter, TitleFilter from dark.reads import Read from dark.titles import TitleAlignment, TitleAlignments c...
from __future__ import print_function import msgpackrpc #install as admin: pip install msgpack-rpc-python import numpy as np #pip install numpy import msgpack import math import time import sys import os import inspect import types import re class MsgpackMixin: def to_msgpack(self, *args, **kwargs): retur...
# Copyright 2018 Google. 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 agree...
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
""" Packet handling functionality for Empire. Defines packet types, builds tasking packets and parses result packets. Packet format: RC4s = RC4 encrypted with the shared staging key HMACs = SHA1 HMAC using the shared staging key AESc = AES encrypted using the client's session key HMACc = first 10 bytes of a SHA256 ...
# -*- coding: utf-8 -*- # # Copyright (C)2005-2014 Edgewall Software # Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de> # 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 available at http://trac.e...
#!/usr/bin/python # TBD: d7m5 # TBD: complexity # TBD: w+b, w-b # TBD: percentile # DONE: alt_scores, mean of score in each block # DONE: final score # DONE: index of 1st move where ahead X (100) # DONE debug final_score # DONE mean/median/dev raw score import chess_util import cjson import gflags import glob import...
# Copyright 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 req...
#from numpy import np.dot, arange, abs #from numpy.linalg import lstsq import numpy as np import random def computeErrorAndCount(A,b,x,group,tol): error = np.abs(b - np.dot(A,x)) tot_error = 0.0 count = 0 inliers = np.zeros(b.shape,dtype=np.bool) for j in range(0,len(error),group): e = 0 ...
# 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 re from datetime import datetime, timedelta import mock from nose.tools import eq_ from pyquery import PyQuery as pq import amo import amo.tests from amo.urlresolvers import reverse from amo.tests import formset, initial from addons.models import Addon from applications.models import Application, AppVersion fr...
#!/usr/bin/env python # Full license can be found in License.md # Full author list can be found in .zenodo.json file # DOI:10.5281/zenodo.1199703 # ---------------------------------------------------------------------------- """Tests the pysat MetaLabels object.""" import datetime as dt import logging import numpy as ...
from __future__ import unicode_literals from celery import chain from waldur_core.core import executors as core_executors from waldur_core.core import tasks as core_tasks from waldur_core.core import utils as core_utils from waldur_core.structure import executors as structure_executors from waldur_openstack.openstack...
"""The config flow tests for the forked_daapd media player platform.""" import pytest from homeassistant import data_entry_flow from homeassistant.components.forked_daapd.const import ( CONF_LIBRESPOT_JAVA_PORT, CONF_MAX_PLAYLISTS, CONF_TTS_PAUSE_TIME, CONF_TTS_VOLUME, DOMAIN, ) from homeassistant....
""" Dictionary learning """ from __future__ import print_function # Author: Vlad Niculae, Gael Varoquaux, Alexandre Gramfort # License: BSD 3 clause import time import sys import itertools from math import sqrt, ceil import numpy as np from scipy import linalg from numpy.lib.stride_tricks import as_strided from ..b...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
import unittest, random, sys, time, re, getpass sys.path.extend(['.','..','../..','py']) import h2o2 as h2o import h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_glm, h2o_util import h2o_print as h2p, h2o_gbm from h2o_xl import Key, Fcn, Assign, Cbind # FIX! This has some abbreviated stuff from h2o...look back the...