gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# 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...
""" Copyright (C) 2017 Open Source Robotics 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...
#adapted from the example at http://scikit-learn.org/stable/auto_examples/svm/plot_rbf_parameters.html """ This script can be used to get the p value for classifiers. It takes input files with column vectors corresponding to features and lables. Then there are two different routes one can go down. When mode has a val...
# This file is part of beets. # Copyright 2015, Adrian Sampson. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, ...
# Copyright 2014-2015 Spectra Logic 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. A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license" ...
# Copyright 2010-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...
# -*- coding: utf-8 -*- from .base import BaseMessage from .records import RecordUpdateMessage, RecordDeleteMessage, RecordCreateMessage from ..exceptions import PyOrientBadMethodCallException from ..constants import COMMAND_OP, FIELD_BOOLEAN, FIELD_BYTE, FIELD_CHAR, \ FIELD_INT, FIELD_LONG, FIELD_SHORT, FIELD_STRI...
# Copyright (c) 2015 Tom Barron. 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...
__author__ = 'Charlie' # Utils used with tensorflow implemetation import tensorflow as tf import numpy as np import scipy.misc as misc import os, sys from six.moves import urllib import tarfile import zipfile import scipy.io def get_model_data(dir_path, model_url): maybe_download_and_extract(dir_path, model_url) ...
# Copyright 2012, Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can # be found in the LICENSE file. from itertools import izip import logging from net import bsonrpc from net import gorpc from vtdb import cursor from vtdb import dbexceptions from vtdb import field_...
import distutils import distutils.spawn import logging import subprocess import tempfile import types from shlex import quote from ray.tune.error import TuneError logger = logging.getLogger(__name__) S3_PREFIX = "s3://" GS_PREFIX = "gs://" HDFS_PREFIX = "hdfs://" ALLOWED_REMOTE_PREFIXES = (S3_PREFIX, GS_PREFIX, HDF...
# # FBrowserBase.py -- Base class for file browser plugin for fits viewer # # Eric Jeschke (eric@naoj.org) # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # import os, glob import stat, time from ginga...
#coding: utf-8 import unittest import re import sys import os.path as p sys.path.insert(0, p.join(p.dirname(p.abspath(__file__)), '..', 'src')) import ope_manip as om body_if_branch = """ 0: iload_1 1: ifle 12 4: getstatic #2 // Field java/lang/System.out:L...
""" Tests for `bx.align.maf`. """ from io import StringIO import bx.align as align import bx.align.maf as maf # A simple MAF from the rat paper days test_maf = """##maf version=1 scoring=humor.v4 # humor.v4 R=30 M=10 /cluster/data/hg15/bed/blastz.mm3/axtNet300/chr1.maf # /cluster/data/hg15/bed/blastz.rn3/axtNet300/c...
import unittest from datetime import date from enum import Enum from pypika import ( AliasedQuery, Case, ClickHouseQuery, EmptyCriterion, Field as F, Index, MSSQLQuery, MySQLQuery, NullValue, OracleQuery, Order, PostgreSQLQuery, Query, QueryException, Redshif...
#!/usr/bin/python # -*- coding: utf-8 -*- # ---------------------------------------------------------------------------- # Xcode 4 template generator # # Based on the original code by Ricardo Quesada. # Modifications & Ugly Hacks by Nicolas Goles D. # # LICENSE: MIT # # Generates an Xcode4 template given several inpu...
#!/usr/bin/env python # # The MIT License # # Copyright (c) 2010 Kyle Conroy # # (Python 3 compatability fixes made by Mark Nenadov) # # 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 ...
"""All models are direct mappings to the WePay objects. By default only the fields that correspond to the values returned from WePay lookup calls (ex. `/account <https://www.wepay.com/developer/reference/account#lookup>`_) are included in the models. All fields follow the rules outlined in `Storing Data <https://www.we...
''' Weather station: One script to rule them all... HMH - 18/07/2018 ''' import sys,time,os import Adafruit_DHT, Adafruit_MCP3008 import Adafruit_GPIO.SPI as SPI import RPi.GPIO as GPIO import spidev import numpy as np from gpiozero import DigitalInputDevice from time import sleep #import math #import subproce...
"""TUI Textual User Interface - A sane command line user interface. Author: Joel Hedlund <yohell@ifm.liu.se> This module contains format classes for use in textual user interfaces. If you have problems with this package, please contact the author. """ __version__ = "1.0.0" __copyright__ = "Copyright (c) 2011 Joel H...
# Copyright (c) 2013 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 agreed to in writ...
import numpy as np import fcts import random import copy import time import matplotlib.pyplot as plt class ABSIndividual: ''' individual of artificial bee swarm algorithm ''' def __init__(self, fct, vardim, bound): ''' vardim: dimension of variables bound: boundaries of varia...
# Copyright 2014 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 ag...
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------ # file: $Id$ # auth: Philip J Grabner <grabner@cadit.com> # date: 2015/12/01 # copy: (C) Copyright 2015-EOT Cadit Inc., All Rights Reserved. #--------------------------------------------------------------------------...
#!/usr/bin/env python import sys, os, time import difflib import unittest import sublime """ Detect SublimeText version to deal w/ v2 vs v3 deltas """ version = sublime.version() print("Testing with SublimeText version: %s" % version) """ For plugin helper functions, load them so we can hit functionality within th...
# -*- coding: utf-8 -*- from contextlib import closing from pyramid import testing import pytest from journal import connect_db from journal import DB_SCHEMA import datetime from journal import INSERT_ENTRY import os from cryptacular.bcrypt import BCRYPTPasswordManager from webtest import AppError TEST_DSN = 'dbname=...
import uuid import math import traceback from flask import Blueprint, request, make_response, jsonify, g from flask_restful import Api, Resource, url_for, reqparse from helpers import recipe_to_json, json_to_recipe from api import bcrypt, db from api.models.user import User from api.models.recipe import Recipe from a...
# -*- coding: utf-8 -*- u""" sphinxcontrib.ros.mssage ~~~~~~~~~~~~~~~~~~~~~~~~~ :ros:msg: directive. :copyright: Copyright 2015 by Tamaki Nishino. :license: BSD, see LICENSE for details. """ from __future__ import print_function import os import codecs import re from sphinx.locale import l_ from ...
""" "PYSTONE" Benchmark Program Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes) Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013. Translated from ADA to C by Rick Richardson. Every method to preserve ADA-likeness has been used, ...
# coding: utf-8 """ DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501 OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.gi...
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
# Licensed 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...
# -*- coding: utf-8 -*- r""" werkzeug.contrib.sessions ~~~~~~~~~~~~~~~~~~~~~~~~~ This module contains some helper classes that help one to add session support to a python WSGI application. For full client-side session storage see :mod:`~werkzeug.contrib.securecookie` which implements a secure,...
""" Control of SSH known_hosts entries ================================== Manage the information stored in the known_hosts files. .. code-block:: yaml github.com: ssh_known_hosts: - present - user: root - fingerprint: 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 - fingerp...
""" Build an AWS AMI for this service """ import os import sys import time import subprocess import operator import pkg_resources import json from datetime import datetime, timedelta import pytz import random import shlex import tempfile from click import echo, secho import six from six import print_ try: # boto ...
import re import lldb.formatters.Logger # C++ STL formatters for LLDB # These formatters are based upon the version of the GNU libstdc++ # as it ships with Mac OS X 10.6.8 thru 10.8.0 # You are encouraged to look at the STL implementation for your platform # before relying on these formatters to do the right thing for...
""" Processors are little transformation blocks that transform the fragments list from a buffer before the BufferControl will render it to the screen. They can insert fragments before or after, or highlight fragments by replacing the fragment types. """ import re from abc import ABCMeta, abstractmethod from typing imp...
# 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...
# -*- coding: utf-8 -*- """Utility classes and values used for marshalling and unmarshalling objects to and from primitive types. .. warning:: This module is treated as private API. Users should not need to use this module directly. """ from __future__ import unicode_literals from marshmallow import utils f...
#!/usr/bin/env python # # Copyright 2016 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...
#!/usr/bin/env python # # Copyright 2014 Docalytics Inc, Copyright 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 r...
"""The tests for the time_pattern automation.""" from asynctest.mock import patch import pytest import homeassistant.components.automation as automation from homeassistant.setup import async_setup_component import homeassistant.util.dt as dt_util from tests.common import async_fire_time_changed, async_mock_service, m...
# coding: utf-8 from __future__ import unicode_literals import re from .adobepass import AdobePassIE from ..compat import compat_str from ..utils import ( xpath_text, int_or_none, determine_ext, float_or_none, parse_duration, xpath_attr, update_url_query, ExtractorError, strip_or_n...
# -*- coding: utf-8 -*- ''' integration tests for mac_power ''' # Import python libs from __future__ import absolute_import, print_function # Import Salt Testing libs from salttesting.helpers import ensure_in_syspath, destructiveTest ensure_in_syspath('../../') # Import salt libs import integration import salt.utils...
from ict.connection.node import Node as ConnectionNode from ict.protobuf.core_pb2 import MetaMessage from ict.protobuf.obnl_pb2 import * class Node(ConnectionNode): """ This is the base class for all Nodes of the system. Improvement """ SCHEDULER_NAME = "scheduler" SIMULATION = "obnl.simulatio...
#!/usr/bin/env python2.7 """ Toil script to move TCGA data into an S3 bucket. Dependencies Curl: apt-get install curl Docker: wget -qO- https://get.docker.com/ | sh Toil: pip install toil S3AM: pip install --pre s3am """ import argparse import glob import hashlib import os import shutil import su...
"""HMAC (Keyed-Hashing for Message Authentication) module. Implements the HMAC algorithm as described by RFC 2104. """ import warnings as _warnings try: import _hashlib as _hashopenssl except ImportError: _hashopenssl = None _functype = None from _operator import _compare_digest as compare_digest else...
# 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...
#!/usr/bin/env python3 # Copyright (c) 2016-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the SegWit changeover logic.""" from test_framework.address import ( key_to_p2sh_p2wpkh, ...
""" This script migrates data from Midas to Girder. It can migrate users, collections (communities in Midas), folders, items and files (bitstreams in Midas). It can optionally perform multiple operations in parallel to speed up the migration (see N_JOBS). It records its progress to a local SQLite database. If the mi...
#!/usr/bin/python import xml.etree.ElementTree as xml import datetime as dt import os, sys, time, re import sqlite3 import json from . import utils from model import * #SQLAlchemy from sqlalchemy import create_engine, event, func from sqlalchemy.orm import sessionmaker from sqlalchemy.sql.expression import ClauseEle...
#!/usr/bin/env python3 from tkinter import * from tkinter import ttk from geometry import * from random import randint from collections import defaultdict from operator import methodcaller import math PHI = (1 + 5**0.5) / 2 canvas_height = 300 TRIANGLE_MODE = 0 LINE_MODE = 1 RIGHT_MODE = 2 RECT_MODE = 3 mode = TRIANG...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Alarm.last_checked' db.alter_column(u'ddsc_core_alarm', 'last_checked', self.gf('django.d...
#Copyright ReportLab Europe Ltd. 2000-2004 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/docs/userguide/ch1_intro.py from tools.docco.rl_doc_utils import * from reportlab.platypus.tableofcontents import TableOfContents from datetime import ...
import logging from sqlalchemy.orm.attributes import InstrumentedAttribute from sqlalchemy.orm import joinedload from sqlalchemy.sql.expression import desc from sqlalchemy import or_, Column, func from flask import flash from flask.ext.admin._compat import string_types from flask.ext.admin.tools import ObsoleteAttr ...
# Copyright 2015-2018 Yelp Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
import numpy as np import robosuite.utils.transform_utils as T from robosuite.environments.manipulation.two_arm_env import TwoArmEnv from robosuite.models.arenas import EmptyArena from robosuite.models.objects import CylinderObject, PlateWithHoleObject from robosuite.models.tasks import ManipulationTask from robosuite...
from __future__ import unicode_literals from .abc import ABCIE from .abc7news import Abc7NewsIE from .academicearth import AcademicEarthCourseIE from .addanime import AddAnimeIE from .adobetv import AdobeTVIE from .adultswim import AdultSwimIE from .aftenposten import AftenpostenIE from .aftonbladet import Aftonbladet...
#!/usr/bin/env python3 # Copyright 2016 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 argparse import itertools import json import os import glob import platform import re import shutil import sys import tempfile ...
#!/usr/bin/env python # coding=utf-8 # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of c...
""" This module provides convenient functions to transform sympy expressions to lambda functions which can be used to calculate numerical values very fast. """ from __future__ import print_function, division from sympy.external import import_module from sympy.core.compatibility import exec_, is_sequence, iterable, st...
import requests import json import time from collections import OrderedDict from test_framework.test_framework import OpenBazaarTestFramework, TestFailure class OutOfInventoryTest(OpenBazaarTestFramework): def __init__(self): super().__init__() self.num_nodes = 3 def run_test(self): ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2004-2009,2012 Zuza Software Foundation # # This file is part of translate. # # translate 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 vers...
# Copyright 2011 Denali 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 requ...
# Authors: Travis Oliphant, Matthew Brett """ Base classes for MATLAB file stream reading. MATLAB is a registered trademark of the Mathworks inc. """ from __future__ import division, print_function, absolute_import import sys import operator from scipy._lib.six import reduce import numpy as np if sys.version_info...
import copy from spec import Spec, eq_, skip, ok_, raises from invoke.parser import Argument, Context from invoke.tasks import task from invoke.collection import Collection class Context_(Spec): "ParserContext" # meh def may_have_a_name(self): c = Context(name='taskname') eq_(c.name, 'taskna...
# Copyright 2017, OpenCensus Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
"""The tests for the integration sensor platform.""" from datetime import timedelta from unittest.mock import patch from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass from homeassistant.const import ( ENERGY_KILO_WATT_HOUR, ENERGY_WATT_HOUR, POWER_WATT, STATE_UNKNOWN, T...
from keras.models import Model, model_from_json from keras.layers import Flatten, Dense, BatchNormalization, Dropout, Reshape, Permute, Activation, Input from keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2D from keras.optimizers import SGD, Adam from keras.callbacks import CSVLogger, ModelC...
""" Test the model blocks """ import datetime from django.test import TestCase from mock import Mock from django.db.models import Model, IntegerField, DateTimeField, CharField from django.template import Context, Template, TemplateSyntaxError from example_project.pepulator_factory.models import Pepulator, Distribut...
## ## import unittest import urllib2 from HTMLParser import HTMLParser from xml.etree.ElementTree import parse as parseXml from json import load as loadjson from urlparse import urljoin from base64 import b64encode # # Test the localizaiton REST service. # # SOFTWARE HISTORY # # Date Ticket# Engineer Descript...
# Copyright 2017 Google LLC 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 ag...
"""Helper methods to handle the time in Home Assistant.""" import datetime as dt import re from typing import Any, Dict, List, Optional, Tuple, Union, cast import ciso8601 import pytz import pytz.exceptions as pytzexceptions import pytz.tzinfo as pytzinfo from homeassistant.const import MATCH_ALL DATE_STR_FORMAT = "...
# 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...
import numpy as np from mir_eval.melody import hz2cents import scipy.signal class PeakStreamHelper(object): def __init__(self, S, times, freqs, amp_thresh, dev_thresh, n_gap, pitch_cont, peak_thresh=None): '''Init method. Parameters ---------- S : np.array ...
import json from django import forms from django.utils.safestring import mark_safe from django.utils.html import conditional_escape class SelectizeSelect(forms.widgets.Select): class Media: css = { 'all': ( 'selectize/dist/css/selectize.bootstrap3.css', ) }...
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: miha@reciprocitylabs.com # Maintained By: miha@reciprocitylabs.com import random from tests.ggrc import TestCase from freezegun import freeze_time ...
# coding: utf-8 import time import random from jsondb.db import Database from tinydb import TinyDB, Query, where from colorama import init, Fore, Back, Style from thirdworldwar import * class Bot: # Constants CONST_SERVERS = {1:"TERRA", 2: "ANDHERRA", 3: "DUNDHA"} # Variables _groupID = -1 _action...
import logging from mopidy import models import spotify from mopidy_spotify import countries, playlists, translator from mopidy_spotify.utils import flatten logger = logging.getLogger(__name__) ROOT_DIR = models.Ref.directory(uri="spotify:directory", name="Spotify") _TOP_LIST_DIR = models.Ref.directory(uri="spotif...
#!/usr/bin/python import sys import StringIO # Bitfield constants for the 'variant' argument to generate_sigs Proj = 1 Offset = 2 Single = 4 def vec_type(g, size): if size == 1: if g == "i": return "int" elif g == "u": return "uint" return "float" return g + "v...
#!/usr/bin/env python ''' Created on 2012-12-11 @author: jock ''' import SmaliParser import os import re import shutil import Smali import SmaliLib import string import SCheck import SmaliEntry import utils class SmaliTest(object): ''' classdocs ''' def __init__(self, smaliDir): ''' C...
""" Fork of pynxos library from network to code and mzbenami Reimplemented by ktbyers to support XML-RPC in addition to JSON-RPC """ from __future__ import print_function, unicode_literals from builtins import super import requests from requests.auth import HTTPBasicAuth from requests.exceptions import ConnectionErro...
# 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...
import logging import os from collections import namedtuple import xml.etree.ElementTree as ET import timeit import numpy as np import pysimox import pymmm SUPPORTED_JOINTS = ['BPx_joint', 'BPy_joint', 'BPz_joint', 'BTx_joint', 'BTy_joint', 'BTz_joint', 'BUNx_joint', 'BUNy_joint', 'BUNz_joint', ...
#!python # # Format Identification for Digital Objects import cStringIO, zipfile, os import hashlib import urllib from xml.etree import ElementTree as ET class NS: """Helper class for XML name spaces in ElementTree. Use like MYNS=NS("{http://some/uri}") and then MYNS(tag1/tag2). """ def __in...
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # 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 # ...
#!/usr/bin/env python3 # Tests check_format.py. This must be run in a context where the clang # version and settings are compatible with the one in the Envoy # docker. Normally this is run via check_format_test.sh, which # executes it in under docker. from __future__ import print_function from run_command import run...
from django.contrib.contenttypes.models import ContentType from django_dynamic_fixture import G, N from django.test import TestCase from entity.sync import sync_entities from entity.signal_handlers import turn_off_syncing, turn_on_syncing from entity.models import ( Entity, EntityKind, EntityRelationship, EntityG...
#!/usr/bin/env python ## FIXME: move these ones to the config file ZMQ_ADDR='ipc:///tmp/eq/ether_inspector' import colorama from scapy.all import * import pyearthquake from pyearthquake.inspector.ether import * from pyearthquake.signal.signal import * from pyearthquake.signal.event import * from pyearthquake.signal.a...
#----------------------------------------------------------- # Threaded, Gevent and Prefork Servers #----------------------------------------------------------- import datetime import errno import logging import os import os.path import platform import psutil import random if os.name == 'posix': import resource els...
""" This module provides the security predicates used in decorating various models. """ import logging from collections import defaultdict from pylons import c, request from webob import exc from itertools import chain from ming.utils import LazyProperty from allura.lib.utils import TruthyCallable log = logging.getL...
import numpy as np from numpy.testing import assert_array_equal, assert_array_almost_equal from unittest import TestCase from sklearn.datasets.samples_generator import make_spd_matrix from sklearn import hmm from sklearn import mixture from sklearn.utils.extmath import logsumexp from sklearn.utils import check_random...
import datetime import os import uuid from decimal import Decimal import django import pytest from django.http import QueryDict from django.utils import timezone import rest_framework from rest_framework import serializers # Tests for field keyword arguments and core functionality. # -------------------------------...
import io from unittest.mock import Mock import pytest from mitmproxy.net import http from mitmproxy.net.http import http1 from mitmproxy import exceptions from pathod import pathoc, language from pathod.protocols.http2 import HTTP2StateProtocol from mitmproxy.test import tutils from . import tservers def test_res...
# SQL-metodene import MySQLdb import itertools import json import time from sendMail import * debug = False reply = '' splitChar = '#' curMilliTime = lambda: int(round(time.time() * 1000)) lastChangedTime = 0 def interpreter (data): raw = data.split(splitChar) command = raw[0] data = eval(raw[1]) i...
# 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...
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
# Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance 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 -*- """ waveforms.py - Waveform functions used by StimGenerator Copyright 2010 Luke Campagnola Distributed under MIT/X11 license. See license.txt for more infomation. This file defines several waveform-generating functions meant to be called from within a StimGenerator widget. """ import numpy ...
# This file is part of Indico. # Copyright (C) 2002 - 2019 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from sqlalchemy.ext.hybrid import hybrid_property from indico.ut...