gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright 2011 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 a... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
import os.path as op
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_equal)
import pytest
from mne.datasets import testing
from mne import (read_label, read_forward_solution, pick_types_forward,
convert_forward_solution)
f... | |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
import base64
import requests
import time
from pycrest import version
from pycrest.compat import bytes_, text_
from pycrest.errors import APIException, UnsupportedHTTPMethodException
from requests.adapters import HTTPAdapter
try:
from urllib.parse import urlparse, urlunparse, parse_qsl
except ImportError: # pragma... | |
import urllib3
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
from datetime import datetime
# Disable insecure warnings
urllib3.disable_warnings()
class DetectionRatio:
malicious = 0
total = 0
def __init__(self, last_analysis_stats: dict):
self.malic... | |
#!/usr/bin/env python3
import argparse
import atexit
import json
import logging
import os
import re
import shutil
import signal
import sys
import time
from sh import rsync
from sh import uptime
# initialize logging
logging.basicConfig(
format='%(message)s',
# TODO: bump this down by default
level=logging.INFO... | |
import datetime
import math
import os
from collections import namedtuple
from urllib.parse import urlparse
from django.conf import settings
from django.contrib.sitemaps import Sitemap as DjangoSitemap
from django.db.models import Count, Max, Q
from django.template import loader
from django.utils.functional import cach... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
import logging
import socket
from .asynclib import loop
from .codec import encode
from .constants impor... | |
from __future__ import unicode_literals
import platform
import re
import pytest
from easysnmp.exceptions import (
EasySNMPError, EasySNMPConnectionError, EasySNMPTimeoutError,
EasySNMPNoSuchObjectError, EasySNMPNoSuchInstanceError,
EasySNMPNoSuchNameError
)
from easysnmp.session import Session
from .fix... | |
import os
import hashlib
import inspect
import re
import zlib
from lib import BaseTest
def strip_processor(output):
return "\n".join([l for l in output.split("\n") if not l.startswith(' ') and not l.startswith('Date:')])
def ungzip_if_required(output):
if output.startswith("\x1f\x8b"):
return zlib.d... | |
import sys, unittest, socket
import inspect
from raygun4py import raygunmsgs
class TestRaygunMessageBuilder(unittest.TestCase):
def setUp(self):
self.builder = raygunmsgs.RaygunMessageBuilder({}).new()
self.request = {
"headers": {
"referer": "localhost",
... | |
# python3
# Copyright 2020 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 applicab... | |
# 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 ... | |
from __future__ import annotations
import io
from typing import Union, Optional, List
from elma.lgr import LGR, LGR_Image
from elma.constants import LGR_MANDATORY_FILES
from elma.constants import LGR_LIMITED_SIZE_FILES
__all__ = ["check_LGR_error"]
LGR_PCX_MIN = 10 # unused as practically never important
LGR_PCX... | |
"""
Analyse picoscope data.
"""
from __future__ import print_function, division
import sys
import logging
import warnings
from os.path import isfile, isdir, abspath, split
from argparse import (ArgumentTypeError, ArgumentParser,
RawDescriptionHelpFormatter)
import numpy as np
import matplotlib.... | |
from __future__ import absolute_import
from functools import partial
from zerver.lib.actions import check_send_message
from zerver.lib.response import json_success
from zerver.decorator import api_key_only_webhook_view, REQ, has_request_variables
from zerver.lib.webhooks.git import get_push_commits_event_message, EMPTY... | |
import sys
import time
from django.conf import settings
from django.db.utils import load_backend
# The prefix to put on the default database name when creating
# the test database.
TEST_DATABASE_PREFIX = 'test_'
class BaseDatabaseCreation(object):
"""
This class encapsulates all backend-specific differences... | |
"""
pygments.lexers.crystal
~~~~~~~~~~~~~~~~~~~~~~~
Lexer for Crystal.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import ExtendedRegexLexer, include, \
bygroups, default, words
from pygments.tok... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from .base import Type
class Epub(Type):
"""
Implements the EPUB archive type matcher.
"""
MIME = 'application/epub+zip'
EXTENSION = 'epub'
def __init__(self):
super(Epub, self).__init__(
mime=Epub.MIME,
... | |
# Copyright (c) 2019 PaddlePaddle 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 app... | |
# Copyright (c) 2014 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
# distr... | |
from enum import Enum
from graph.pad import Pad
class FilterState(Enum):
"""
This enum contains the various states a filter can be in.
Run Flow:
- Graph manager calls "run" on a filter
- Filter transitions immediately to run_pending
- When the filter completes the transition, it sets interna... | |
"""Support for Homekit switches."""
from __future__ import annotations
from dataclasses import dataclass
from aiohomekit.model.characteristics import (
Characteristic,
CharacteristicsTypes,
InUseValues,
IsConfiguredValues,
)
from aiohomekit.model.services import ServicesTypes
from homeassistant.compo... | |
""" This module deals with encoding and decoding of instructions """
import abc
from .registers import Register
from .token import TokenSequence
class Operand(property):
""" An instruction operand.
When an instruction has
an operand, use this function to create the property.
Arguments:
nam... | |
#
# Albow - Fields
#
#-# Modified by D.C.-G. for translation purpose
import locale
from pygame import draw
import pygame
from pygame import key
from pygame.locals import K_LEFT, K_RIGHT, K_TAB, K_c, K_v, K_x, SCRAP_TEXT, K_UP, K_DOWN, K_RALT, K_LALT, \
K_BACKSPACE, K_DELETE, KMOD_SHIFT, KMOD_CTRL, KMOD_ALT, KMOD_ME... | |
""" Data wrapper class
Manages loading data and prepping batches. Dynamically stores and loads chunks of data to disk to support datasets
larger than the available RAM. Uses numpy for saving and loading data, as it is much faster than pickle and allows
compression.
It can be instantiated with 4 different shuffle_* fl... | |
#!/usr/bin/env python
"""
Sentry
======
Sentry is a realtime event logging and aggregation platform. It specializes
in monitoring errors and extracting all the information needed to do a proper
post-mortem without any of the hassle of the standard user feedback loop.
Sentry is a Server
------------------
The Sentry ... | |
import sys
import numpy as np
import csv
from datetime import datetime
from datetime import timedelta
def subtract_dates(date1, date2):
"""
Takes two dates %Y-%m-%d format. Returns date1 - date2, measured in days.
"""
date_format = "%Y-%m-%d"
a = datetime.strptime(date1, date_format)
b = datetime.strptime(... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
# Copyright 2014 Cloudera 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, so... | |
from datetime import datetime, timedelta
from xml.dom import minidom
import logging
from django.utils.timezone import now, utc
from celery.task import task
from celery.task.sets import subtask
from gargoyle import gargoyle
from eve_proxy.exceptions import *
from eve_proxy.models import CachedDocument
from eve_api.a... | |
# 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 compliance with the License. You may obtain
# a ... | |
#!/usr/bin/env python3
""" cythonize
Cythonize pyx files into C files as needed.
Usage: cythonize [root_dir]
Default [root_dir] is 'numpy'.
Checks pyx files to see if they have been changed relative to their
corresponding C files. If they have, then runs cython on these files to
recreate the C files.
The script t... | |
# 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... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Thierry Lemeunier <thierry at lemeunier dot net>
# 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 th... | |
# coding: utf-8
"""
Main commands available for flatisfy.
"""
from __future__ import absolute_import, print_function, unicode_literals
import collections
import logging
import os
import flatisfy.filters
from flatisfy import database
from flatisfy import email
from flatisfy.models import flat as flat_model
from flatis... | |
# 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... | |
"""The Minecraft Server integration."""
from __future__ import annotations
import asyncio
from datetime import datetime, timedelta
import logging
from typing import Any
from mcstatus.server import MinecraftServer as MCStatus
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HO... | |
#!/usr/bin/python
#
# linearize-data.py: Construct a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2014 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 __future__ import print_func... | |
import pfacets.np as np
import collections
import copy
import errno
import fnmatch
import glob
import imp
import itertools
import os
import os.path as osp
import re
import types
###################################
########### UTILITY FUNCTIONS
###################################
def autonew_dict():
def inner():
... | |
# 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... | |
"""
Support for simple yaml persisted config dicts.
Usual building of the configuration
- with datadir (default or from option)
- create dir if not available
- create minimal config if not available
- load config
- App is initialized with an (possibly empty) config
which is recursively updated (w... | |
#
# 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 ... | |
"""
Copyright 2017-present Airbnb, 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, sof... | |
"""Various implementations of the k-medoids algorithm."""
import numpy as np
from numba import jit
from clustering.kmedoids_helper import _get_clusters, _get_medoid
from clustering.metrics import _dissimilarity_matrix
def pam(data, k, metric=None, method='memory'):
"""Partitioning Around Medoids, a realization of... | |
# 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... | |
#
# 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
# ... | |
# 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, ... | |
import time
import pprint
import sqlalchemy
from testify import *
from dynochemy import db, Table, Solvent, View
from dynochemy import sql
from dynochemy import operation
from dynochemy import operation
class TestTable(Table):
name = "test"
hash_key = 'key'
class FullTestTable(Table):
name = "full_test... | |
# implement samba_tool drs commands
#
# Copyright Andrew Tridgell 2010
#
# based on C implementation by Kamen Mazdrashki <kamen.mazdrashki@postpath.com>
#
# This program 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 Fou... | |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9332")
else:
access = Ser... | |
from .joystickpad import JoystickPad
from .touchdata import TouchData
from kivy.uix.widget import Widget
from kivy.properties import(BooleanProperty, NumericProperty,
ListProperty, ReferenceListProperty)
import math
OUTLINE_ZERO = 0.00000000001
# replaces user's 0 value for outlines, avoids... | |
import os
import tempfile
from glob import glob
from os import getcwd
from os.path import basename, exists, join
from nose.tools import raises
from parameterized import param, parameterized
from rsmtool import compute_and_save_predictions
from rsmtool.configuration_parser import Configuration
from rsmtool.test_utils i... | |
""" Tested with pefile 1.2.10-123 on 32bit PE executable files.
An implementation to push or pop a section header to the section table of a PE file.
For further information refer to the docstrings of pop_back/push_back.
by n0p
"""
import pefile
class SectionDoublePError(Exception):
pass
class Secti... | |
# coding=utf-8
# Copyright 2022 The Trax 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 a... | |
"""
This module contains essential stuff that should've come with Python itself ;)
"""
import os
import re
import inspect
import weakref
import errno
import six
from functools import partial, wraps
from scrapy.utils.decorators import deprecated
def flatten(x):
"""flatten(sequence) -> list
Returns a single, ... | |
"""A module containing analytical objects specific to a particular experiment.
"""
import os
import numpy as np
import pandas as pd
from whaler.analysis import Analysis
class Reactions():
"""
"""
def __init__(self):
self.A = Analysis()
# Analysis output filenames.
self.cr... | |
#-----------------------------------------------------------------------------
# Copyright (c) 2008-2015, David P. D. Moss. All rights reserved.
#
# Released under the BSD license. See the LICENSE file for details.
#-----------------------------------------------------------------------------
"""Set based operation... | |
#
# 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
# ... | |
#!/usr/bin/env python3
"""Update user groups MassMessage lists."""
# Author : JJMC89
# License: MIT
import argparse
import datetime
import json
import re
from collections import OrderedDict
from contextlib import suppress
from datetime import date, time, timedelta
from itertools import chain
from operator import itemge... | |
# markdown is released under the BSD license
# Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later)
# Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
# Copyright 2004 Manfred Stienstra (the original version)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or... | |
import zipfile
from collections import defaultdict
from collections import namedtuple
from contextlib import closing
from cStringIO import StringIO
from itertools import imap
from time import gmtime
from urllib import urlencode
from botocore.exceptions import ClientError
from ModestMaps.Core import Coordinate
from msg... | |
# 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 ... | |
"""
Implementation of Deep Residual Network.
References:
[1] "Deep Residual Learning for Image Recognition" https://arxiv.org/pdf/1512.03385.pdf
[2] "Identity Mappings in Deep Residual Networks" https://arxiv.org/pdf/1603.05027.pdf
"""
from keras import backend as K
from keras.layers import Activation, Dense, Flat... | |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import os... | |
import time
import hmac
import hashlib
import base64
import urllib
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.internet import task
from flask_restful import fields, marshal
import requests
from floranet.appserver.azure_iot import AzureIot
from floranet.models.application import Appli... | |
# 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 ... | |
from UnitCommands import *
from Landing import *
import math
VALID_ROE = 100
def GetMessageParam(BB, messageName):
msg = BB.ReadMessage(messageName)
if (msg == ''):
return 0
else:
return float(msg)
def RadarOn(TI):
UI = TI.GetPlatformInterface()
BB = TI.GetBlackboardInterface()
... | |
#!/usr/bin/env python
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from structdata import g_project
from structdata import Action
from eventeditor import EventEditor
class EditorButton(QPushButton):
entries = None
def __init__(self, item=None, parent=None):
super(EditorButton, self).__init__... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
# Copyright 2015 Deutsche Telekom AG
# 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... | |
from flask import render_template, flash, redirect, session, url_for, request, g, jsonify
from flask_login import login_user, logout_user, current_user, login_required
from sqlalchemy.orm.exc import NoResultFound
from app import app, db, lm
from app.service import factory as serviceFactory
from forms import LoginForm, ... | |
import json
data = [
'abac',
'academ',
'acanth',
'acro',
'actin',
'adeno',
'aero',
'aesth',
'aether',
'olog',
'hellen',
'ether',
'agon',
'gogue',
'agro',
'ailur',
'alcyon',
'aleuro',
'algia',
'algesic',
'allo',
'allel',
'alph',
'alphit',
'amath',
'ambly',
'ammo',
'amnio',
'andr',
'anem',
'anti',
'anth',
'aphrod',
'ara... | |
# encoding: utf8
__all__ = ['CalendarFrame']
import calendar
import locale
import tkinter as tk
import tkinter.ttk as ttk
imgp_data = ('R0lGODlhDAAMAIABAAAAAP///yH+EUNyZWF0ZWQgd2l0aCBHSU1QACH5BAEK' +
'AAEALAAAAAAMAAwAAAIVjI+JoMsdgIRyqmoTfrfCmDWh+DUFADs=')
imgn_data = ('R0lGODlhDAAMAIABAAAAAP///yH+EUNyZW... | |
## A script for extracting info about the patients used in the analysis
## Load necessary modules
from rpy2 import robjects as ro
import numpy as np
import os
ro.r('library(survival)')
##This call will only work if you are running python from the command line.
##If you are not running from the command line manually... | |
#!/usr/bin/env python
# Copyright (c) 2013 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 optparse
import os
import re
import sys
import build_version
from build_paths import SDK_SRC_DIR, SCRIPT_DIR, OUT_DIR
# Ad... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
docker-parse is a useful command to get
docker-run commands or docker-compose configurations from running containers
'''
from __future__ import absolute_import
from __future__ import print_function
import sys
import pipes
import getopt
import yaml
import docker
__ve... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
import json
import webob
from nova import exception
from nova import test
from nova.api.openstack import wsgi
class RequestTest(test.TestCase):
def test_content_type_missing(self):
request = wsgi.Request.blank('/tests/123', method='POST')
request.body ... | |
# -*- coding: utf-8 -*-
from pynes.nes_types import NesRs, NesArray, NesSprite, NesString, NesChrFile
from pynes.game import PPUSprite
class BitPak:
def __init__(self, game):
self.game = game
self.assigned = None
def __call__(self):
return None
def asm(self):
return ''
... | |
__author__ = 'Iurii Sergiichuk'
""" PRESENT block cipher implementation
USAGE EXAMPLE:
---------------
Importing:
-----------
>>> from pypresent import Present
Encrypting with a 80-bit key:
------------------------------
>>> key = "00000000000000000000".decode('hex')
>>> plain = "0000000000000000".decode('hex')
>>> ... | |
# Copyright (c) 2003-2016 CORE Security Technologies
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# Author:
# Andres Blanco
# Gustavo Moreira
#
# RFCs for the DNS Server service
#
# 1034 - Domain Na... | |
import random, math
import pandas as pd
import numpy as np
import scipy.io
import matplotlib
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.decomposition import PCA
from sklearn.manifold import Isomap
from sklearn.neighbors impor... | |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Whitebox tests for TCP APIs.
"""
from __future__ import division, absolute_import
import errno, socket, os
try:
import resource
except ImportError:
resource = None
from twisted.trial.unittest import TestCase
from twisted.python im... | |
# Authors: Danny Sullivan <dbsullivan23@gmail.com>
# Tom Dupre la Tour <tom.dupre-la-tour@m4x.org>
#
# Licence: BSD 3 clause
import math
import numpy as np
import scipy.sparse as sp
from sklearn.linear_model.sag import get_auto_step_size
from sklearn.linear_model.sag_fast import _multinomial_grad_loss_all_sa... | |
# Copyright 2012-2015 The Meson development team
# 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... | |
# encoding: 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):
# Adding field 'Message.message_id'
db.add_column(
'sentry_message',
'message_id',
... | |
#!python
# coding=utf-8
import warnings
from collections import OrderedDict
import numpy as np
import simplejson as json
from netCDF4 import Dataset
from .utils import (
generic_masked,
JSONEncoder,
safe_attribute_typing,
safe_issubdtype
)
from .meta import (
MetaInterface,
ncpyattributes,
... | |
# 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... | |
#
# Copyright (c) 2011-2015 Advanced Micro Devices, Inc.
# All rights reserved.
#
# For use for simulation and test purposes only
#
# 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 co... | |
# Copyright (c) 2011 OpenStack, 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 wr... | |
# merge.py - directory-level update/merge handling for Mercurial
#
# Copyright 2006, 2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from node import nullid, nullrev, hex, bin
from i18n import _... | |
#!/usr/bin/env python
"""
Train an RST parsing model.
This script takes a JSON-formatted training set created by
``convert_rst_discourse_tb.py``, trains a model, and
saves the model in a user-specified location.
:author: Michael Heilman
:author: Nitin Madnani
:organization: ETS
"""
import argparse
import json
import... | |
#
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pyasn1.sf.net/license.html
#
try:
from collections import OrderedDict
except ImportError:
OrderedDict = dict
from pyasn1.type import base, univ, char, useful
from pyasn1 import debug, erro... | |
"""Random variable generators.
integers
--------
uniform within range
sequences
---------
pick random element
pick random sample
generate random permutation
distributions on the real line:
------------------------------
uniform
... | |
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | |
# Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/
# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
The obfs3 module implements the obfs3 protocol.
"""
import random
import obfsproxy.common.aes as aes
import obfsproxy.transports.base as base
import obfsproxy.transports.obfs3_dh as obfs3_dh
import obfsproxy.common.log as logging
import obfsproxy.common.hmac_sha256 as hm... | |
"""
factor.py
"""
from operator import attrgetter
from numbers import Number
from numpy import float64, inf
from toolz import curry
from zipline.errors import (
UnknownRankMethod,
UnsupportedDataType,
)
from zipline.lib.rank import masked_rankdata_2d
from zipline.pipeline.mixins import (
CustomTermMixin,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.