gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apac... | |
# Copyright 2013 IBM Corp.
# 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... | |
#!/usr/bin/env python
"""
Usage example employing Lasagne for digit recognition using the MNIST dataset.
This example is deliberately structured as a long flat file, focusing on how
to use Lasagne, instead of focusing on writing maximally modular and reusable
code. It is used as the foundation for the introductory La... | |
# 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 -*-
import httplib as http
from flask import request
from django.core.exceptions import ValidationError
from framework import forms, status
from framework.auth import cas
from framework.auth.core import get_user, generate_verification_key
from framework.auth.decorators import block_bing_preview, ... | |
"""
Evennia menu system.
Contribution - Griatch 2011
This module offers the ability for admins to let their game be fully
or partly menu-driven. Menu choices can be numbered or use arbitrary
keys. There are also some formatting options, such a putting options
in one or more collumns.
The menu system consists of a Me... | |
"""
Predictions widget
"""
from collections import OrderedDict, namedtuple
import numpy
from PyQt4 import QtCore, QtGui
import Orange
from Orange.data import ContinuousVariable, DiscreteVariable
from Orange.widgets import widget, gui
from Orange.widgets.settings import Setting
# Input slot for the Predictors chan... | |
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apac... | |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import datetime
from math import ceil
from flask import jsonify, request
from flask_restplus import inputs
from flexget.api import api, APIResource
from flexget.plugins.api.se... | |
# coding=utf-8
# 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 requ... | |
from __future__ import print_function
from unittest import TestCase
import numpy as np
from nose import SkipTest
from nose.tools import assert_raises
from numpy.testing import assert_array_equal, assert_array_almost_equal
from sklearn.datasets.samples_generator import make_spd_matrix
from sklearn import mixture
from ... | |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 thomasv@gitorious
#
# 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 witho... | |
from __future__ import unicode_literals
import pytz
from datetime import datetime
from django.utils import timezone
from django.core.exceptions import PermissionDenied, ValidationError
from django.views.generic import ListView, DeleteView, View
from django.shortcuts import redirect
from django.views.defaults import p... | |
##
# Copyright (c) 2007-2013 Apple 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 l... | |
from typing import Callable, List, Sequence, TypeVar
import pytest
from pluggy import HookimplMarker, HookspecMarker, PluginManager, PluginValidationError
from pluggy._hooks import HookImpl, _HookCaller
hookspec = HookspecMarker("example")
hookimpl = HookimplMarker("example")
@pytest.fixture
def hc(pm: PluginManage... | |
#!/usr/bin/env python
"""A Verification, Storage and Query/Retrieve SCP application."""
import argparse
from configparser import ConfigParser
import os
import sys
import pydicom.config
from pydicom.dataset import Dataset
from pynetdicom import (
AE, evt, AllStoragePresentationContexts, ALL_TRANSFER_SYNTAXES
)
fr... | |
r"""OS routines for Mac, NT, or Posix depending on what system we're on.
This exports:
- all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc.
- os.path is either posixpath or ntpath
- os.name is either 'posix', 'nt', 'os2' or 'ce'.
- os.curdir is a string representing the current directory ('.' or... | |
__ver__ = '0.6.2'
import urllib, urlparse
import time, random
import sys, weakref
import socket
import simplejson
import http
import upload
import errors
import listing, page
import compatibility
try:
import gzip
except ImportError:
gzip = None
try:
from cStringIO import StringIO
except ImportError:
from String... | |
"""Tests for the Fronius sensor platform."""
from homeassistant.components.fronius.const import DOMAIN
from homeassistant.components.fronius.coordinator import (
FroniusInverterUpdateCoordinator,
FroniusMeterUpdateCoordinator,
FroniusPowerFlowUpdateCoordinator,
)
from homeassistant.components.sensor import ... | |
"""
Test functions for models.formula
"""
import string
import numpy as np
import numpy.random as R
import numpy.linalg as L
from numpy.testing import *
from statsmodels.sandbox import formula #, contrast #, utils
from statsmodels.sandbox import contrast_old as contrast
class TestTerm(TestCase):
def test_init... | |
# ===============================================================================
# Copyright 2011 Jake Ross
#
# 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/licens... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | |
import sublime
from sublime_plugin import WindowCommand
from ..git_command import GitCommand
INIT_REQUIRED_MSG = "Please run `git: flow init` first."
GITFLOW_CONF = ['branch.master', 'branch.develop', 'prefix.feature',
'prefix.release', 'prefix.hotfix', 'prefix.versiontag',
'prefix.s... | |
from __future__ import absolute_import, division, print_function
import re
from functools import partial
from tornado import httputil
from tornado.httpserver import _CallableAdapter
from tornado.escape import url_escape, url_unescape, utf8
from tornado.log import app_log
from tornado.util import basestring_type, impo... | |
# Copyright (c) 2014 Mirantis, Inc.
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
#
# progressbar - Text progressbar library for python.
# Copyright (c) 2005 Nilton Volpato
#
# 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... | |
import networkx as nx
import numpy as np
import scipy.sparse as sp
import logging
from collections import defaultdict
def stochastic_normalization(matrix):
logging.info('Creating google matrix...')
matrix = matrix.tolil()
try:
matrix.setdiag(0)
except TypeError:
matrix.setdiag(np.zeros... | |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | |
# Copyright 2011 University of Southern California
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | |
#!/usr/bin/python -u
# Copyright (c) 2010-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 ap... | |
"""Copyright 2009 Chris Davis
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
dist... | |
# 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 Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# bu... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 ~ 2014 Andy Stewart
#
# Author: Andy Stewart <[email protected]>
# Maintainer: Andy Stewart <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public... | |
# (c) Copyright 2014 Brocade Communications Systems Inc.
# All Rights Reserved.
#
# Copyright 2014 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
#
# ... | |
# Copyright 2012, Nachi Ueno, NTT MCL, 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
#
# Unles... | |
# 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) 2016 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 functionality ... | |
# -*- coding: utf-8 -*-
import time
import logging
from datetime import datetime
import furl
import pymongo
import requests
from modularodm import fields, StoredObject
from box import CredentialsV2, refresh_v2_token, BoxClientException
from framework.auth import Auth
from framework.exceptions import HTTPError
from w... | |
import re
import logging
from indra.resources import load_resource_json
logger = logging.getLogger(__name__)
identifiers_url = 'https://identifiers.org'
# These are just special cases of name spaces where the mapping from INDRA to
# identifiers.org is not a question of simplecapitalization.
identifiers_mappings = ... | |
#-*- coding: utf-8 -*-
from __future__ import division
import os
import time
import tensorflow as tf
import numpy as np
from ops import *
from utils import *
class BEGAN(object):
model_name = "BEGAN" # name for checkpoint
def __init__(self, sess, epoch, batch_size, z_dim, dataset_name, checkpoint_dir, re... | |
#!/usr/bin/python
# coding=utf-8
# Copyright 2012-2014 MongoDB, 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 appl... | |
"""Support for 1-Wire environment sensors."""
from __future__ import annotations
import asyncio
import copy
from dataclasses import dataclass
import logging
import os
from types import MappingProxyType
from typing import TYPE_CHECKING, Any
from pi1wire import InvalidCRCException, OneWireInterface, UnsupportResponseEx... | |
import boto3
import sure # noqa # pylint: disable=unused-import
import pytest
from botocore.exceptions import ClientError
from moto import mock_ec2
from tests import EXAMPLE_AMI_ID
from .test_instances import retrieve_all_instances
from uuid import uuid4
@mock_ec2
def test_instance_create_tags():
ec2 = boto3.r... | |
from bluetooth import *
from serial_stub import *
from serial_comminication import *
import json
def goodbye(client_sock, server_sock):
if client_sock:
print_msg("goodbye", "Closing bluetooth client")
client_sock.close()
if server_sock:
print_msg("goodbye", "Closing bluetooth server")
... | |
# Copyright (c) 2011 Zadara Storage Inc.
# Copyright (c) 2011 OpenStack Foundation
# Copyright 2011 University of Southern California
# 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 ... | |
#!python
# Collect for each region the list of players by league
# Strategy: we go through the list of all the known players and check their games
# As a starting list, we can take master/challenger players
import os
import multiprocessing
import time
import pickle
import sys
from pickle import PickleError
from Inte... | |
# Copyright 2015 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 ag... | |
# Django & Python
from django.core.urlresolvers import resolve
from django.http import HttpRequest
from django.http import QueryDict
from django.test import TestCase
from django.test import Client
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login, logout
from django.contrib... | |
from __future__ import unicode_literals
from django.contrib.admin import TabularInline, ModelAdmin
from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.contrib.admin.helpers import InlineAdminForm
from django.contrib.auth.models import User, Permission
from django.contrib.contenttypes.mode... | |
"""Onboarding views."""
import asyncio
from http import HTTPStatus
from aiohttp.web_exceptions import HTTPUnauthorized
import voluptuous as vol
from homeassistant.auth.const import GROUP_ID_ADMIN
from homeassistant.components.auth import indieauth
from homeassistant.components.http.const import KEY_HASS_REFRESH_TOKEN... | |
# 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 ... | |
"""
Contains tests that assert the compliance with the
JSON RPC 2.0 specifications (http://www.jsonrpc.org/specification)
"""
import logging
import simplejson as json
import pytest
from tests.services.service_jsonrpc_specs import ServiceJsonRpcSpecs
@pytest.fixture
def app():
service = ServiceJsonRpcSpecs()
... | |
#!/usr/bin/env python
'''
@package ion.processes.data.transforms
@file ion/processes/data/transforms/notification_worker.py
@author Brian McKenna <[email protected]>
@brief NotificationWorker class processes real-time notifications
'''
from datetime import datetime
from email.mime.text import MIMEText
import sm... | |
'''
Clean up test case remnants
@author: Youyk
'''
import threading
import time
import sys
import os
import errno
import traceback
import apibinding.api as api
import apibinding.inventory as inventory
import apibinding.api_actions as api_actions
import zstacklib.utils.http as http
import zstacklib.utils.jsonobject a... | |
# -*- coding: utf-8 -*-
"""
:copyright: (c) 2015 by Jan-Hendrik Dolling.
:license: Apache 2.0, see LICENSE for more details.
"""
import os
import sys
try:
import mock
except ImportError:
from unittest import mock
import re
import types
try:
import unittest2 as unittest
except ImportError:
import unittes... | |
"""The signal processor for Review Board search."""
from __future__ import unicode_literals
import logging
import threading
from functools import partial
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.db.models.signals import post_delete, post_save, m2m_... | |
# -*- coding: utf-8 -*-
"""Tests for `twodolib.cli` module."""
import unittest
import subprocess
from twodolib import TwoDoTask
from twodolib import cli
class TestCliParseArguments(unittest.TestCase):
"""Test the command line interface and argument parsing."""
def test_default_task_is_task_type(self):
... | |
#!/usr/bin/env python
"""
Ascii memcached test client.
"""
import socket
import select
import exceptions
import memcacheConstants
class MemcachedError(exceptions.Exception):
"""Error raised when a command fails."""
def __init__(self, status, msg):
supermsg='Memcached error #' + `status`
if m... | |
# -*- coding: utf-8 -*-
"""
PLIF Toolset
Created on Thu Jan 21 13:56:54 2016
@author: Darren Banks
PLIF Temperature Calculator uses grayscale-average values from video recording
of rhodamine fluorescence to estimate the temperature field from the images.
It assumes an exponential relationship between tempera... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import core.models.plcorebase
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_... | |
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Ternary(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout"
_path_str = "layout.ternary"
_valid_props = {"aaxis", "baxis", "bgcolor", "caxis... | |
#!/usr/bin/python2
# -*-coding:utf-8 -*
# Copyright (c) 2011-2015, Intel Corporation
# 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 co... | |
# 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... | |
# Author: Alexander Fabisch -- <[email protected]>
# Author: Christopher Moody <[email protected]>
# Author: Nick Travers <[email protected]>
# License: BSD 3 clause (C) 2014
# This is the exact and Barnes-Hut t-SNE implementation. There are other
# modifications of the algorithm:
# * Fast Optimi... | |
"""
''' File: grey_harvest.py
''' Author: Gabriel "s0lst1c3" Ryan
''' Created: Tue May 26 2015
''' Source: https://github.com/s0lst1c3/grey_harvest
''' License: MIT (see attached)
''' Description: Scrapes the web for reliable http or https proxies and prints
''' them to stdout. ... | |
################################################################################
# Copyright (C) 2011-2014 Jaakko Luttinen
#
# This file is licensed under the MIT License.
################################################################################
import numpy as np
from bayespy.utils import misc
from .node im... | |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""Python module to download videos.
This module contains the actual downloaders responsible
for downloading the video files.
"""
from __future__ import unicode_literals
import re
import os
import sys
import locale
import signal
import subprocess
from time import sle... | |
# 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... | |
# License: none (public domain)
import errno
import gzip
import hashlib
import logging
import os
import pickle
import smtplib
from datetime import datetime
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from itertools import count, groupby
from bs4 import BeautifulSoup
import tin... | |
from collections import defaultdict
import re
import hashlib
from urllib import quote
#from util import numericOnly, alphaOnly
#from addresses import standardize_country
# for JSON, there would be
# six distinguished attributes:
#
# for database, we don't have to worry about this
# no binning
# def nearest5(x):
# ... | |
# Lint as: 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 ... | |
# -*- coding: utf-8 -*-
import time
from requests.compat import quote
from .rssreadertools import getBasicConfig
ReaderBasicConfig = getBasicConfig()
class ItemsContainer(object):
"""
A base class used for all classes aimed to have items (Categories and Feeds)
"""
def __init__(self):
self.ite... | |
import os
import re
import errno
import logging
import shutil
import tempfile
import platform
import datetime
import pytz
from PyQt5.QtCore import Qt, QCoreApplication, QMetaObject, QThreadPool, pyqtSlot, pyqtSignal
from PyQt5.QtWidgets import qApp, QMainWindow, QWidget, QAction, QSizePolicy, QMessageBox, QStyle, QSpli... | |
import logging
import os
import subprocess
from typing import Any, Dict, List, Set
import bson
from django.conf import settings
from django.forms.models import model_to_dict
from zerver.data_import.import_util import (
SubscriberHandler,
ZerverFieldsT,
build_huddle,
build_huddle_subscriptions,
bui... | |
# -*- coding: utf-8 -*-
import pytest
import sys
import cPickle as pickle
from test_base_class import TestBaseClass
aerospike = pytest.importorskip("aerospike")
try:
from aerospike.exception import *
except:
print "Please install aerospike python client."
sys.exit(1)
class TestMapKeysIndex(object):
d... | |
# -*- coding: utf-8 -*-
import functools
import re
import time
import warnings
from base64 import b64encode, b64decode
from http.client import HTTPResponse
from io import BytesIO
from typing import Union, Dict, Tuple, Optional
import requests
import urllib3
from requests import Timeout, Response, ConnectionError
from ... | |
# 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... | |
import logging
import flask_login
from flask import jsonify, request, Response
import mediacloud
import mediacloud.error
import concurrent.futures
import server.util.csv as csv
import server.util.tags as tag_util
import server.views.topics.apicache as apicache
import server.views.apicache as base_apicache
from server ... | |
"""
###############################################################################
ModelsDict: Abstract Class for Containing Models
###############################################################################
"""
import inspect
from collections import OrderedDict
from OpenPNM.Base import logging, Workspace
logger ... | |
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright 2013 Canonical 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
#
# htt... | |
"""
I/O routines
"""
import os
import time
from astropy.io import fits
import numpy as np
import multiprocessing
from desispec.interpolation import resample_flux
from desispec.io.util import write_bintable
import desispec.io
import desimodel.io
#----------------------------------------------------------------------... | |
# ----------------------------------------------------------------------------
# cocos2d
# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# Copyright (c) 2009-2015 Richard Jones, Claudio Canepa
# All rights reserved.
#
# Redistribution and use in source and binary forms, with o... | |
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
"""
Auto-align the net entities in a given nodespace
"""
__author__ = 'joscha'
__date__ = '15.10.12'
from collections import OrderedDict
from micropsi_core.tools import OrderedSet
import math
BORDER = 50.0
GRID = 170.0
PREFERRED_WIDTH = 8.0
def align(nodenet, nodes... | |
from sklearn.utils.testing import assert_true
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_array_almost_equal, assert_array_equal
from sklearn.utils.testing import assert_almost_equal... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: utils
# Purpose:
#
# Author: Administrator
#
# Created: 15/06/2014
# Copyright: (c) Administrator 2014
# Licence: <your licence>
#------------------------------... | |
# Copyright 2015-2018 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | |
# -*- coding: utf-8 -*-
"""
pygments.lexers
~~~~~~~~~~~~~~~
Pygments lexers.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
import types
import fnmatch
import re
from os.path import basename
from pygments.lexers._mapping ... | |
#############################################################################
#
# 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
#
# ... | |
"""
filename: ArrowObserver.py
description:
This module implements 2 classes, ArrowAnnotation (which is applied to any
annotableObjects to describe as an arrow), and ArrowMarker (which watches
for strokes that looks like arrows and adds the arrow annotation)
Doctest Examples:
>>> c = ArrowMarker()
example... | |
import base64
import cgi
import datetime
from distutils.version import LooseVersion
import errno
import io
import json
import logging
import os
import re
import shutil
import tempfile
import time
import zipfile
from simple_salesforce import Salesforce
from simple_salesforce import SalesforceGeneralError
from salesforc... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import inspect
import pytest
import numpy as np
from astropy.utils.exceptions import AstropyUserWarning
from astropy import units as u
from astropy.wcs import WCS
from astropy.nddata.nddata import NDData
from astropy.nddata.decorators import support_nd... | |
import csv
import time
from collections import OrderedDict
from arff import arff
out_dir = ['']
def get_timestamp():
timestr = time.strftime("%Y%m%d-%H%M")
return timestr
def create_output_folders(windowlength):
import os
newpath = 'output/' + str(windowlength)
if not os.path.exists(newpath):
... | |
from __future__ import unicode_literals
from django.contrib import admin
from calaccess_raw import models
from .base import BaseAdmin
class AcronymsCdAdmin(BaseAdmin):
list_display = ("acronym", "stands_for", "effect_dt", "a_desc")
date_hierarchy = 'effect_dt'
search_fields = ("acronym", "a_desc")
class... | |
# 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... | |
"""Component to interface with various media players."""
import asyncio
import base64
import collections
from datetime import timedelta
import functools as ft
import hashlib
import logging
from random import SystemRandom
from typing import Optional
from urllib.parse import urlparse
from aiohttp import web
from aiohttp... | |
#!/usr/bin/env python
"""AFF4 object representing grr users."""
import crypt
import random
import string
import time
from grr.lib import aff4
from grr.lib import rdfvalue
from grr.proto import flows_pb2
from grr.proto import jobs_pb2
class GlobalNotification(rdfvalue.RDFProtoStruct):
"""Global notification shown... | |
#!/usr/bin/env python3
'''
Perform basic ELF security checks on a series of executables.
Exit status will be 0 if successful, and the program will be silent.
Otherwise the exit status will be 1 and it will log which executables failed which checks.
Needs `readelf` (for ELF) and `objdump` (for PE).
'''
import subprocess... | |
from __future__ import print_function
import numpy
import numpy.random
import scipy.stats
import scipy.signal
import scipy
AF = None
# implement logging in this module
class GenericDataArray(dict):
# base class for single sample volume data (e.g. Vectrino, Vector, current meters)
# sample rate is a scalar
# shape ... | |
#!/usr/bin/env python
import json
import math
import re
class PManager(object):
def __init__(self, data):
if isinstance(data, (str, unicode)):
self.data = json.loads(data)
else:
self.data = data
self.factor = 1
self.unit = "MiB"
self._pre = []
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.