content string |
|---|
'''module for single-thread Heron Instance in python'''
import collections
import logging
import os
import sys
import traceback
import signal
import yaml
from heron.api.src.python import api_constants, HashMapState
from heron.common.src.python.basics import GatewayLooper
from heron.common.src.python.config import syst... |
from collections import defaultdict, namedtuple
import traceback
from picard import log, config
from picard.plugin import ExtensionPoint
from picard.ui.options import OptionsPage, register_options_page
_cover_art_providers = ExtensionPoint()
class ProviderOptions(OptionsPage):
""" Template class for provider'... |
"""Testing the linked_list class - CF 401 Python Week 2 Assignment."""
import pytest
@pytest.fixture
def new_empty_stack():
"""Create an empty object of type Stack to be used in test functions."""
from stack import Stack
this_stack = Stack()
return this_stack
@pytest.fixture
def stack_123():
"""R... |
"""
example for how to run a double ended connect routine without using the system class.
We strongly recommend not doing it this way and setting up a system class first. It
will be much easier for you.
We will do the connections for a cluster of 38 Lennard-Jones atoms.
We will load two sets of coordinates from a fil... |
# -*- coding: utf-8 -*-
from rest_framework import serializers
from rest_framework.authtoken.models import Token
from django.contrib.auth import get_user_model
class OAuth2InputSerializer(serializers.Serializer):
provider = serializers.CharField()
code = serializers.CharField()
redirect_uri = serializers.... |
# -*- coding: utf-8 -*-
"""Defines fixtures available to all tests."""
import pytest
from shop.app import create_app
from shop.settings import TestConfig
from shop.extensions import redis_store
from shop.user.models import User
from webtest import TestApp
from .factories import UserFactory
@pytest.yield_fixture(scop... |
"""Tests for TracingReducer."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# Dependency imports
import tensorflow.compat.v2 as tf
import tensorflow_probability as tfp
from tensorflow_probability.python.experimental.mcmc.internal import test_fixtures
f... |
"""
homeassistant.components.device_tracker.asuswrt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Device tracker platform that supports scanning a ASUSWRT router for device
presence.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.asuswrt... |
import os
import ops
import re
from sqlite3 import connect
def getoui(mac):
norm_mac = normalize(mac, sep=None, case='upper')
assert validate_ethii(norm_mac), 'MAC address must be valid'
if norm_mac.startswith('0050C2'):
oui = norm_mac[0:9]
conn = connect(os.path.join(ops.OPSDIR, 'Databases... |
#!/usr/bin/python
import sys, os, threading, re
import tornado.web
import tornado.gen
import logging
import random
reload(sys)
sys.setdefaultencoding('utf8')
sys.path.append('..')
import common
import config
from handler import RequestHandler
from db import MySQLHelper
logger = logging.getLogger('web')
class AuthKe... |
import logging
from apiclient.discovery import DISCOVERY_URI
_logger = logging.getLogger(__name__)
# TODO(dustin): Move this module to the *config* directory, eliminate this
# class, and use the module directly.
class Conf(object):
"""Manages options."""
api_credentials = {
"web": {
... |
#!/usr/bin/env python
# Class 4
# Exercise 3
# Author Mateusz Blaszczyk
""" III. Create a program that converts the following uptime strings to a time
in seconds.
uptime1 = 'twb-sf-881 uptime is 6 weeks, 4 days, 2 hours, 25 minutes'
uptime2 = '3750RJ uptime is 1 hour, 29 minutes'
uptime3 = 'CATS3560 uptime is 8 wee... |
import unittest
import numpy.testing as testing
import numpy as np
import healpy as hp
import tempfile
import shutil
import fitsio
import os
from redmapper import DepthMap
from redmapper import Configuration
from redmapper import VolumeLimitMask
class VolumeLimitMaskTestCase(unittest.TestCase):
"""
Tests of r... |
"""
Support for Satel Integra zone states- represented as binary sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.satel_integra/
"""
import asyncio
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice... |
#encoding:utf-8
# Some utils can be useful.
from utils import get_url
from utils import SupplyResult
# Write here subreddit name. Like this one for /r/jokes.
subreddit = 'jokes'
# This is for your public telegram channel.
t_channel = '@r_jokes'
def send_post(submission, r2t):
# Check what is inside this submis... |
# encoding: utf-8
from __future__ import unicode_literals
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 'FieldEntry.value'
db.alter_column('forms_fieldentry', 'v... |
__authors__ = [
# alphabetical order by last name, please
'"David Anderson" <<EMAIL>>',
]
class Error(Exception):
"""Base class for release script exceptions."""
pass
class ObstructionError(Error):
"""An operation was obstructed by existing data."""
pass
class ExpectationFailed(Error):
"""An... |
import json
from termcolor import cprint
import numpy as np
from tabulate import tabulate
from time import time
from pathlib import Path
from evoflow import __version__ as evoflow_version
class Logger():
def __init__(self, system_info, backend):
self.system_info = system_info
self.ts = int(time())... |
#!/usr/bin/env python
# Module: syslog_test.py
# Purpose: test syslog using syslog module and syslog handler
# Notes:
# 1) https://docs.python.org/2/library/syslog.html
# https://docs.python.org/2/library/logging.handlers.html
# 2) Notes about older Python 2.4 as used by CentOS 5.
#
PNAME="syslog_test"
print "sy... |
__all__ = [
'BitPackedBuffer',
'BitPackedDecoder',
'CorruptedError',
'TruncatedError',
'VersionedDecoder',
]
import six
import struct
class CorruptedError(Exception):
pass
class TruncatedError(Exception):
pass
class BitPackedBuffer:
def __init__(self, contents, endian='big'):
... |
import pandas as pd
import numpy as np
import pickle
from axiomatic.base import AxiomSystem, TrainingPipeline
from axiomatic.axiom_training_stage import DummyAxiomTrainingStage
from axiomatic.genetic_recognizer_training_stage import GeneticRecognizerTrainingStage
from axiomatic.objective_function import ObjectiveFunct... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('learn5', '0007_auto_20150819_1717'),
]
operations = [
migrations.RemoveField(
model_name='running_material',
... |
import logging
from sleekxmpp import ClientXMPP
from sleekxmpp.exceptions import IqError, IqTimeout
class EchoBot(ClientXMPP):
def __init__(self, jid, password):
ClientXMPP.__init__(self, jid, password)
self.add_event_handler("session_start", self.session_start)
self.add_event_handler("... |
import logging
import re
from cloudferry import discover
from cloudferry import model
from cloudferry.model import compute
from cloudferry.lib.utils import remote
LOG = logging.getLogger(__name__)
IFACE_RE = re.compile(r'^\d+: ([^:]+):.*$')
ADDR_RE = re.compile(r'^inet (\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}/\d{1,2}) .*$')
... |
from gns3server.web.route import Route
from gns3server.controller import Controller
from gns3server.schemas.compute import (
COMPUTE_CREATE_SCHEMA,
COMPUTE_OBJECT_SCHEMA,
COMPUTE_UPDATE_SCHEMA
)
import logging
log = logging.getLogger(__name__)
class ComputeHandler:
"""API entry points for compute se... |
import os
import weakref
import IECore
import Gaffer
import GafferUI
## The Bookmarks class provides a registry of named locations for use
# in Path UIs. To allow different gaffer applications to coexist in the
# same process, separate bookmarks are maintained per application.
class Bookmarks :
## Use acquire() in... |
from peewee import *
from lib.Models.Base import BaseModel
from lib.Models.Url import Url
from lib.Models.History import History
class HistoryHeader(BaseModel):
url = ForeignKeyField(Url, related_name = 'history_headers')
history = ForeignKeyField(History, related_name = 'history_headers')
name = CharFie... |
import logging
from time import sleep
from itertools import chain
from threading import Thread
try:
from Queue import Queue, Full
except ImportError:
from queue import Queue, Full
try:
from urllib.parse import quote
except ImportError:
from urllib import quote
from sys import version_info
PY2 = versio... |
import os
import numpy as np
import matplotlib
matplotlib.use('Agg')
from scipy.cluster.vq import kmeans2
import pylab
pylab.close()
###############################################################################
__author__ = "Maciej Pacula"
__url__ = """http://blog.mpacula.com/2011/04/27/
k-means-clusterin... |
import os
from django.template import TemplateDoesNotExist
from django.template.loaders import filesystem, app_directories
from hamlpy import hamlpy
from djaml.utils import get_django_template_loaders
def get_haml_loader(loader):
if hasattr(loader, 'Loader'):
baseclass = loader.Loader
else:
... |
from pyanaconda.modules.common.constants.services import PAYLOAD
from pyanaconda.modules.common.base import KickstartModuleInterface
from pyanaconda.dbus.interface import dbus_interface
@dbus_interface(PAYLOAD.interface_name)
class PayloadInterface(KickstartModuleInterface):
"""DBus interface for Payload module."... |
import fnmatch
import json
import logging
import os
import re
import shutil
from termcolor import colored, cprint
class Profiler(object):
"""Maintain and implement pre-compiled modules and profiles."""
def __init__(self, config):
super(Profiler, self).__init__()
self.logger = logging.getLogg... |
"""Misc. utility commands exposed to the user."""
# QApplication and objects are imported so they're usable in :debug-pyeval
import functools
import os
import traceback
from typing import Optional
from PyQt5.QtCore import QUrl
from PyQt5.QtWidgets import QApplication
from qutebrowser.browser import qutescheme
from ... |
'''
Author: Hans Erik Heggem
Email: <EMAIL>
Project: Master"s Thesis - Autonomous Inspection Of Wind Blades
Repository: Master"s Thesis - CV (Computer Vision)
'''
############# EXTERNAL LIB ################
'''
@brief Gets a single character from standard input.
Does not echo to the screen.
Taken from h... |
'''Checkerboard Matrix
Description
Given an even integer ‘n’, create an ‘n*n’ checkerboard matrix with the values 0 and 1, using the tile function.
Format:
Input: A single even integer 'n'.
Output: An 'n*n' NumPy array in checkerboard format.
Example:
Input 1:
2
Output 1:
[[0 1]
[1 0]]
Input 2:
4
Output 2:
[[0 1 0 ... |
from morphforge.traces.tracetypes.trace import Trace
from morphforge import units
import numpy as np
from morphforge.units import qty
class TracePointBased(Trace):
def __init__(self, time, data, name=None, comment=None, tags=None):
super(TracePointBased, self).__init__(name=name,
comment... |
# -*- coding: utf-8 -*-
# !/usr/bin/python
################################### PART0 DESCRIPTION #################################
# Description:
# E-mail: <EMAIL>
# Create: 2015-9-24 17:50:39
# Last:
__author__ = 'yuens'
################################### PART1 IMPORT ######################################
import My... |
# Converted from IAM_Policies_SNS_Publish_To_SQS.template located at:
# http://aws.amazon.com/cloudformation/aws-cloudformation-templates/
from troposphere import GetAtt, Output, Ref, Template
from troposphere.sns import Subscription, Topic
from troposphere.sqs import Queue, QueuePolicy
t = Template()
t.set_descript... |
import unittest
import numpy as np
from .. import helpers, plots, DataSet
from ..nodes import featsel
class TestAUCFilter(unittest.TestCase):
def setUp(self):
np.random.seed(1)
# generate dataset with features based on labels with increasing noise
Y = helpers.to_one_of_n(np.linspace(0, 1, 1000).round())
... |
import matplotlib.pyplot as plt
import numpy as np
# The following instructions define some characteristics for the figures
# In order to be able to use latex formulas in legends and text in
# figures:
# plt.rc('text', usetex=True)
# Turn on interactive mode to display the figures:
plt.ion()
# Characteristics of the f... |
from math import sqrt
class Parameters:
def __init__(self,file):
self.file = open(file).readlines()
self.readSimu(self.file)
self.readProd(self.file)
self.readWareHouses(self.file)
self.readOrders(self.file)
def readSimu(self,l):
lst = ... |
from os.path import dirname, basename
import glob
import importlib.util
import BotPreferences
from util.Ranks import Ranks
import ClientWrapper
import asyncio
class PluginManager(object):
# Container for all loaded plugins, dictionary: { filename: Plugin object }
plugins = {}
# Event handler containers, ... |
import copy
from nose.tools import *
from vcloudtools.vcloud import Link, Org, OrgList
MOCK_LINK = {
'type': 'application/foo+xml',
'href': 'https://test/foo',
'rel': 'test_rel',
'name': 'foo',
}
MOCK_ORG = {
'type': 'application/vnd.vmware.vcloud.org+xml',
'href': 'http://test-api-client/org... |
from .SolutionSubfield import SolutionSubfield
class SubfieldLagrangeFault(SolutionSubfield):
"""Python object for fault Lagrange multipliers subfield.
FACTORY: soln_subfield
"""
import pythia.pyre.inventory
from .SolutionSubfield import validateAlias
userAlias = pythia.pyre.inventory.str("... |
import matplotlib.pyplot as plt
import numpy as np
def plot_nodes(graph, color="r", with_id=True, markersize=10):
for node in range(len(graph.x_of_node)):
x, y = graph.x_of_node[node], graph.y_of_node[node]
plt.plot(
graph.x_of_node[node],
graph.y_of_node[node],
... |
"""MQTT interface class."""
import socket
import string
import json
from glances.logger import logger
from glances.exports.glances_export import GlancesExport
# Import paho for MQTT
from requests import certs
import paho.mqtt.client as paho
class Export(GlancesExport):
"""This class manages the MQTT export mo... |
import os
import httplib2
from django.db import models
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from pombola.hansard.models.base import HansardModelBase
# check that the cache is setup and the directory exists
try:
HANSARD_CACHE = settings.HANSARD_CACHE
if not ... |
"""Test shift app views.
All messages are tested for the default English strings.
"""
from django.contrib.messages import get_messages
from django.utils import timezone, translation
from freezegun import freeze_time
from test_plus.test import TestCase
from clock.contracts.models import Contract
from clock.shifts.mode... |
import logging
import mohawk
# suppress 'No handlers could be found for logger "mohawk.base"' error
logging.getLogger('mohawk.base').addHandler(logging.NullHandler())
class HawkAuthScheme(object):
token = None
algorithm = 'sha256'
sender = None
def __init__(self, token, algorithm=None):
self... |
import argparse
import os
import shutil
import sys
import sbxg
from sbxg.utils import ANSI_STYLE
from sbxg import error as E
def show_library(board_dirs, lib_dirs):
"""
Dump the board and lib path's contents.
"""
# First, go through the board directories to see the boards that
# are available.
... |
#!/usr/bin/python
# encoding: utf-8
from functools import wraps
import logging
import signal
import sys
from time import sleep, time
import traceback
import uuid
# NB: pool should be initialized before importing
# any of cocaine-framework-python modules to avoid
# tornado ioloop dispatcher issues
import monitor_pool
... |
"""
I am a flask app
"""
from flask import Flask
from flask import request
from flask import render_template
from flask import Response
from utils import gen_disp_text
app = Flask(__name__)
app.config.from_object('siteconfig')
@app.route("/robots.txt")
def robots():
return ""
@app.route("/")
def hello():
return... |
import gdal, ogr, os, osr
import numpy as np
def array2raster(newRasterfn,rasterOrigin,pixelWidth,pixelHeight,array):
cols = array.shape[1]
rows = array.shape[0]
originX = rasterOrigin[0]
originY = rasterOrigin[1]
driver = gdal.GetDriverByName('GTiff')
outRaster = driver.Create(newRasterfn, ... |
"""This file contains a console, the CLI friendly front-end to plaso."""
import argparse
import logging
import os
import random
import sys
import tempfile
from dfvfs.lib import definitions
from dfvfs.path import factory as path_spec_factory
from dfvfs.resolver import resolver as path_spec_resolver
try:
# Support v... |
import unittest2
_DATASET_ID = 'DATASET'
_KIND = 'KIND'
_ID = 1234
class TestEntity(unittest2.TestCase):
def setUp(self):
from gcloud.datastore._testing import _setup_defaults
_setup_defaults(self)
def tearDown(self):
from gcloud.datastore._testing import _tear_down_defaults
... |
import mysql.connector
from datetime import datetime, date
import time
import os
import sys
import threading
from PyQt4.QtCore import pyqtSlot,SIGNAL,SLOT,Qt
from PyQt4.QtGui import *
set_mode=0
@pyqtSlot()
def coolOn():
global set_mode
global override
if not cool.isChecked():
#print('Cooling')
... |
from openstack.auth import service_filter
class ExampleService(service_filter.ServiceFilter):
"""The example service extension."""
valid_versions = [service_filter.ValidVersion('v1')]
def __init__(self, version=None):
"""Create an example service
The service_type should match what is sp... |
import os
import re
import subprocess
import shutil
import imp
from avocado.utils import process
from testlib import Browser
class Cockpit():
def __init__(self,):
self.cleanup_funcs = []
self.setUp()
def atcleanup(self, func):
self.cleanup_funcs.append(func)
def run_shell_comma... |
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from qgis.gui import *
from roam.maptools.touchtool import TouchMapTool
from roam.api import GPS
import roam.resources_rc
class RubberBand(QgsRubberBand):
def __init__(self, canvas, geometrytype, width=5, iconsize=20):
super(Rub... |
from __future__ import (absolute_import, division, print_function, unicode_literals)
from builtins import *
from tower.controllers import pid
class QuadrotorPID(object):
"""
The Quadrotor PID plugin is designed to run 'on top of' vehicles with orientation set-point control;
for example, the stock crazy... |
"""
Faulty Temporal Memory implementation in Python.
"""
import numpy
from nupic.algorithms.temporal_memory import TemporalMemory
class FaultyTemporalMemory(TemporalMemory):
"""
Class implementing a fallible Temporal Memory class. This class allows the
user to kill a certain number of cells. The dead cells can... |
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
# SECURITY WARNING: keep the... |
class Solution(object):
def countRangeSum(self, nums, lower, upper):
"""
:type nums: List[int]
:type lower: int
:type upper: int
:rtype: int
"""
def countAndMergeSort(sums, start, end, lower, upper):
if end - start <= 1:
# The size ... |
import bcrypt
import database.dbcommand as dbcommand
import entities.playerstatus as playerstatus
class Player(object):
def __init__(self):
self.__name = ""
self.__password = ""
self.__gender = ""
self.__status = None
@property
def name(self):
return self.__na... |
# -*- coding: utf-8 -*-
from abc import ABCMeta, abstractmethod
class Provider:
"""Base class for the provider.
Providers are components that are responsible for acquiring resources on
existing testbeds. Concretely, a provider takes a declarative description
of the expected resources as argument. It ... |
from django.conf.urls import patterns, include, url
from django.contrib.auth.decorators import login_required
import deck_views
urlpatterns = patterns('',
url(r'^$',
login_required(deck_views.DeckList.as_view(
template_name="cardbox/deck... |
import time
import subprocess
import logging
logger = logging.getLogger()
_tshark_filter_arg = '-Y'
def run_tshark(filename, filter, display=None, wait=True):
global _tshark_filter_arg
if wait:
# wait a bit to make it more likely for wlantest sniffer to have
# captured and written the result... |
import logging
import os
import re
import pyauto_functional # Must be imported before pyauto
import pyauto
import test_utils
class InfobarTest(pyauto.PyUITest):
"""TestCase for Infobars."""
def Debug(self):
"""Test method for experimentation.
This method will not run automatically.
To run:
p... |
from __future__ import unicode_literals
from django.test import TestCase
from .fields import NAMES
from .models import Form
class TestsForm(TestCase):
def test_forms(self):
"""
Simple 200 status check against rendering and posting to forms
with both optional and required fields.
... |
# -*- coding: utf-8 -*-
version = '2.3.2'
release = False
#-----------------------------------------------------------------------------#
import commands
import datetime
import os
import glob
class CommandError(Exception):
pass
def execute_command(commandstring):
status, output = commands.getstatusoutput(... |
import pigpio as pigpio
import time
import threading
#//-----------------------------------------------------------------------------
#//
#// Copyright (C) 2014-2015 James Ward
#//
#// This software is free software; you can redistribute it and/or
#// modify it under the terms of the GNU Lesser General Public
#// Licen... |
"ArticlePage object for ecrans"
# -*- coding: utf-8 -*-
# Copyright(C) 2011 Julien Hebert
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 o... |
from autopilot.emulators.unity import UnityIntrospectionObject
from autopilot.emulators.unity.quicklist import Quicklist
class SimpleLauncherIcon(UnityIntrospectionObject):
"""Holds information about a simple launcher icon.
Do not instantiate an instance of this class yourself. Instead, use the
appropriat... |
import tensorflow as tf
import numpy as np
import GPflow
from GPflow import kernels
from GPflow.tf_wraps import eye
from GPflow._settings import settings
from GPflow.param import ParamList
float_type = settings.dtypes.float_type
np_float_type = np.float32 if float_type is tf.float32 else np.float64
class Kern(object):... |
from vexbot.extension_metadata import extensions as _ext_meta
def extension(base,
alias: list=None,
name: str=None,
hidden: bool=False,
instancemethod: bool=False,
roles: list=None,
short: str=None):
def wrapper(function):
... |
import os
import shutil
import tempfile
from distutils.version import LooseVersion
import pytest
from dask.dataframe import read_orc
from dask.dataframe.utils import assert_eq
import dask.dataframe as dd
pytest.importorskip("pyarrow.orc")
# Skip for broken ORC reader
import pyarrow as pa
pytestmark = pytest.mark.s... |
from jobman import DD, expand, flatten
import pynet.layer as layer
from pynet.model import *
from pynet.layer import *
from pynet.datasets.mnist import Mnist, Mnist_Blocks
import pynet.datasets.spec as spec
import pynet.datasets.mnist as mnist
import pynet.datasets.transfactor as tf
import pynet.datasets.mapping as ma... |
import math
def translate(coords, angle):
x = (math.cos(angle) * coords[0]) + (math.sin(angle) * coords[1])
y =(-math.sin(angle) * coords[0]) + (math.cos(angle) * coords[1])
return (x,y)
def init(server, logger, sender, req):
return {}
def delete(server, logger, sender):
pass
"""
Calculate what is in front... |
from fb_messages_parser import parse_to_deep_qa
from fb_messages_aggregator import aggregate_stats_for_target_usr
# LICENSE INFORMATION HEADER
__author__ = "Logan Martel"
__copyright__ = "Copyleft (c) 2018, Logan Martel"
__credits__ = ["Logan Martel"]
__license__ = "ApacheV2.0"
__version__ = "0.1.0"
__maintainer__ = ... |
"""
Tools for generating forms based on mongoengine Document schemas.
"""
import decimal
from bson import ObjectId
from operator import itemgetter
try:
from collections import OrderedDict
except ImportError:
# Use bson's SON implementation instead
from bson import SON as OrderedDict
from wtforms import fi... |
import argparse
import logging
def parse_args(parser=None, include_name=True):
if parser is None:
parser = argparse.ArgumentParser()
if include_name:
parser.add_argument('--name', '-n',
help='name of the requested interest')
parser.add_argument('-v', action='cou... |
"""
This test checks that the Spack cc compiler wrapper is parsing
arguments correctly.
"""
import os
import unittest
import tempfile
import shutil
from llnl.util.filesystem import *
import spack
from spack.util.executable import *
# Complicated compiler test command
test_command = [
'-I/test/include', '-L/test/l... |
"""
Rotated pole mapping
=====================
This example uses several visualisation methods to achieve an array of
differing images, including:
* Visualisation of point based data
* Contouring of point based data
* Block plot of contiguous bounded data
* Non native projection and a Natural Earth shaded relief ... |
import sys
import numpy
from scipy import special
import statsmodels.api as sm
from galpy.util import bovy_plot
import define_rcsample
def plot_rcdistancecomparison(plotfilename):
# Get the sample
rcdata= define_rcsample.get_rcsample()
# Now plot the differece
bovy_plot.bovy_print()
levels= special.... |
#!/usr/bin/python
# usage: to say hello world to world.
# logs : <kumar> - <data> - i felt the world needs two bangs.
print ("hello world !!!")
'''
khyaathi@khyaathipython:~/Documents/git_repos$ ls
python-batches
khyaathi@khyaathipython:~/Documents/git_repos$ cd python-batches/
khyaathi@khyaathipython:~/Documents/g... |
from __future__ import division
from phoneclassification.confusion_matrix import confusion_matrix
import numpy as np
import argparse,collections
from phoneclassification._fast_EM import sparse_soft_dotmm, soft_e_step, soft_m_step, soft_bernoulli_EM
from phoneclassification.binary_sgd import binary_to_bsparse, add_final... |
import sys
import os
import struct
import binascii
import time
class PreLoginToken:
def __init__(self):
self.tokenPosition = 0
self.type = 0
self.position = 0
self.length = 0
class TDSPacket:
def __init__(self):
self.type = 12
self.tokens = []
# Returns string version of the packet
def writePacket(se... |
"""Experimental API for controlling optimizations in `tf.data` pipelines."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.data.util import options
from tensorflow.python.util.tf_export import tf_export
@tf_export("data.experimenta... |
import logging
from django.utils.translation import ugettext_lazy as _
from horizon import messages
from horizon import tabs
from openstack_dashboard import api
from openstack_dashboard.dashboards.project.stacks \
import api as project_api
from openstack_dashboard.dashboards.project.stacks \
import tables as... |
#! /usr/local/bin/python
import os
from fmri.catreward.roi.data import (get_durations, get_cumrewards,
get_trials_combined, get_behave_data, get_similarity_data)
from fmri.catreward.roi.misc import subdir
from fmri.catreward.rl.data import get_rl_data, recode_rl_data
from fmri.catreward.roi.exps.base2 import R... |
"""
Example demonstrating how to write Schema and Cred Definition on the ledger
As a setup, Steward (already on the ledger) adds Trust Anchor to the ledger.
After that, Steward builds the SCHEMA request to add new schema to the ledger.
Once that succeeds, Trust Anchor uses anonymous credentials to issue and store
cla... |
def getFileList(fileNameListFileName):
# Get a list of files from a file with a list of file names
fileNameListFile = open(fileNameListFileName)
fileList = []
for line in fileNameListFile:
# Iterate through the lines of the file with file names and open each file
fileList.append(gzip.open(line.strip()))
retu... |
'''
thevideo urlresolver plugin
Copyright (C) 2014 Eldorado
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 3 of the License, or
(at your option) any later version.
This program is di... |
import traceback
from absl import logging
from google.api_core.exceptions import NotFound
from google.cloud import bigquery
from google.cloud.bigquery import Table
from termcolor import cprint
import app_settings
from flagmaker.settings import AbstractSettings
from utilities import Aggregation
from utilities import S... |
# 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 model 'Entry'
db.create_table('samklang_blog_entry', (
('id', self.gf('django.db.mode... |
"""The tests for the Shell command component."""
import os
import tempfile
from typing import Tuple
from unittest.mock import MagicMock, patch
from homeassistant.components import shell_command
from homeassistant.setup import async_setup_component
def mock_process_creator(error: bool = False):
"""Mock a corouti... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Generates a Sphinx inventory for MDN's JavaScript reference."""
try:
import argcomplete
except ImportError:
argcomplete = None
import argparse
import logging
from sphinx_inventory import Inventory
from sphinx_inventory.js import mdn
import sys
if sys.version_in... |
from __future__ import print_function, division, absolute_import
import matplotlib
matplotlib.use('Agg')
import os
import numpy as np
from odin import preprocessing as pp
from odin import fuel as F, visual as V
from odin.utils import (ctext, get_logpath, get_module_from_path,
get_script_path, ... |
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement
import sys
import StringIO
import unittest
import os.path
import json
sys.path.append(os.path.join(os.path.dir... |
# -*- coding: utf-8 -*-
import numpy as np
from scipy.stats.distributions import norm, expon
import matplotlib.pylab as plt
from scipy.stats import genpareto
#import sys
#from os.path import join, dirname
#sys.path.append(join(dirname(__file__), "..", "..", "resources", "pyfak"))
#sys.path.append(join(dirname(__file... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.