content stringlengths 4 20k |
|---|
import xlsxwriter
workbook = xlsxwriter.Workbook('chart_data_tools.xlsx')
worksheet = workbook.add_worksheet()
bold = workbook.add_format({'bold': 1})
# Add the worksheet data that the charts will refer to.
headings = ['Number', 'Data 1', 'Data 2']
data = [
[2, 3, 4, 5, 6, 7],
[10, 40, 50, 20, 10, 50],
[3... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
################################################################################
# Documentation
################################################################################
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
"""This sub-module contains functionalities, which are used internally in the SuMPF package"""
from ._persistence import *
from ._convolution import *
from ._enums import *
from ._indexing import *
from ._functions import *
from ._text import *
from . import _interpolation as interpolation
from .._data._filters._ba... |
import unittest, random, sys, time, re, math
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_glm, h2o_util, h2o_jobs as h2j, h2o_gbm
# use randChars for the random chars to use
def random_enum(randChars, maxEnumSize):
choiceStr = randChars
r = ''.join(ran... |
import datetime
import urllib
from django.contrib import auth
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.db.models.manager import EmptyManager
from django.contrib.contenttypes.models import ContentType
from django.utils.encoding import smart_str
from django.utils.h... |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
###############################################
# E-mail: <<EMAIL>>
# Licence: GPL
# Created Time: 2013-10-06 23:14
# Last modified: 2013-10-06 23:14
###############################################
import pygtk
pygtk.require("2.0")
import os
import gobject
imp... |
#!/usr/bin/python3
import re
import imaplib, email
from bs4 import BeautifulSoup
def read_email(message_instance):
'''read_email takes an email.message_from_bytes|string(raw_email)
instance and returns the payload as a BeautifulSoup object.
This is purely to make it quick and easy to read emails (like an HTML r... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import hickle as hkl
import numpy as np
from keras import backend as K
from keras.layers import Dense
from keras.layers import Dropout
from keras.layers import Reshape
from keras.layers.advanced_activations imp... |
import re
import sys
import six
from inspect import getargspec
from jsonrpc.site import jsonrpc_site
from jsonrpc._types import *
from jsonrpc.exceptions import *
try:
from collections import OrderedDict
except ImportError:
# Use SortedDict instead of OrderedDict for python < 2.7
# Can be removed when supp... |
import getpass
import logging
import sys
import transaction
from os.path import basename, join as join_path
from pyramid.paster import get_appsettings, setup_logging
from sqlalchemy import engine_from_config
from sqlalchemy.exc import IntegrityError
from ..model import *
def usage(argv):
"""Print usage instruct... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Book',
fields=[
('id', models.AutoField(verbose... |
from django.conf.urls import patterns
from django.conf.urls import url
from openstack_dashboard.dashboards.admin.images.images import views
VIEWS_MOD = 'openstack_dashboard.dashboards.admin.images.images.views'
urlpatterns = patterns(VIEWS_MOD,
url(r'^create/$', views.CreateView.as_view(), name='create'),
... |
from ConfigParser import ConfigParser
import os.path
class MilterConfigParser(ConfigParser):
def __init__(self,defaults={}):
ConfigParser.__init__(self)
self.defaults = defaults
# The defaults provided by ConfigParser show up in all sections,
# which screws up iterating over all options in a section.
... |
import unittest
from nose.tools import *
from hamcrest import *
from backdrop.core.timeseries import WEEK
from backdrop.core.response import PeriodGroupedData
from tests.support.test_helpers import d, d_tz
class TestWeeklyGroupedData(unittest.TestCase):
def test_adding_documents(self):
stub_document = {"... |
#!/usr/bin/env python3
import subprocess
import os
import sys
import glob
import json
import anymarkup
REPO_PATH = 'git-repo'
def git_clone(url):
r = subprocess.run(['git', 'clone', url, REPO_PATH])
if r.returncode == 0:
return True
else:
print("[COUT] Git clone error: Invalid argument ... |
"""
Utility functions for the user guide.
"""
import re
import app
import simplemarkdown
from .page import Page
class Formatter(object):
"""Format a full userguide page HTML."""
def html(self, name):
"""Return a full userguide page HTML."""
page = Page(name)
from appinfo import app... |
# Module containing generally handy functions used by simulation and inference modules
import numpy as np
import chippr
from chippr import defaults as d
# Choose random seed at import, hopefully carries through everywhere
np.random.seed(d.seed)
def safe_log(arr, threshold=d.eps):
"""
Takes the natural logar... |
import re
import string
import sys
import generate
import rfc3454
if len(sys.argv) != 3:
print "usage: %s rfc3454.txt outdir" % sys.argv[0]
sys.exit(1)
tables = rfc3454.read(sys.argv[1])
bidi_h = generate.Header('%s/bidi_table.h' % sys.argv[2])
bidi_c = generate.Implementation('%s/bidi_table.c' % sys.argv[... |
from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HContract08_CompleteLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HContract08_CompleteLHS
"""
# Flag this instance as compiled now
self.is_compiled = True
... |
# -*- coding: utf-8 -*-
import os
from flask import Flask
from .db import db
from .schema_validator import jsonschema
from .sessions import ItsdangerousSessionInterface
class SubdomainDispatcher(object):
"""Dispatch requests to a specific app based on the subdomain.
"""
def __init__(self, domain, config... |
from bootstrap import settings
from common import http
from galaxy import wrapper
SHOW_G_BYTES_LIMIT = 1024 * 1024 * 1024
def str_pretty(total_bytes):
if total_bytes < SHOW_G_BYTES_LIMIT:
return "%sM"%(total_bytes/(1024*1024))
return "%sG"%(total_bytes/(1024*1024*1024))
def get_status(req):
build... |
# Minimalist mutater
# handles only PUSH (68/6A), CALL (E8), and JUMPS <dword> (FF25)
# no real code analysis, but mutating our original program and using only ADD, MOV, RETN
import pefile, mypacklib
pe, oep, ib, start, size = mypacklib.load()
# mutates the original code
# (needs to parse the hex, transform... |
# -*- coding: utf-8 -*-
r"""
================================
QMC Hirsch - Fye Impurity solver
================================
To treat the Anderson impurity model and solve it using the Hirsch - Fye
Quantum Monte Carlo algorithm for a paramagnetic impurity
"""
from __future__ import division, absolute_import, print... |
from __future__ import absolute_import, division, unicode_literals
from . import support # noqa
import html5lib
from html5lib.treeadapters import sax
from html5lib.treewalkers import getTreeWalker
def test_to_sax():
handler = support.TracingSaxHandler()
tree = html5lib.parse("""<html xml:lang="en">
... |
import shutil
import unittest
import simplejson as json
from nupic.data.file_record_stream import FileRecordStream
from htmresearch.frameworks.classification.classification_network import (
configureNetwork,
trainNetwork)
from htmresearch.frameworks.classification.utils.sensor_data import (
generateSensorData)... |
import FreeCAD
__title__ = "FEM Analysis managment"
__author__ = "Juergen Riegel"
__url__ = "http://www.freecadweb.org"
def makeFemAnalysis(name):
'''makeFemAnalysis(name): makes a Fem Analysis object'''
obj = FreeCAD.ActiveDocument.addObject("Fem::FemAnalysisPython", name)
return obj |
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
from models import Title, Guild, Level
from django.contrib.auth.forms import UserChangeForm
class MyUserChangeForm(UserChangeForm):
class Meta(UserChangeForm.Meta):
model = get_u... |
import simplejson as json
import unittest
from collections import OrderedDict
from functools import wraps
from flask import current_app, Request
from werkzeug.test import create_environ
from eugene import settings_test
from eugene.database import get_session, Base
from eugene.main import create_app
class BaseTestCa... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.factorization.python.ops import gmm
import tensorflow as tf
import numpy as np
from reader_for_dtw_gmm import Data
from mlpy import dtw
train_dir = './SVC2004/Task1'
test_dir = './SVC20... |
import datetime
# Django
from django.contrib.auth.models import User
from django.urls import reverse
# wger
from wger.core.tests.base_testcase import WgerTestCase
from wger.utils.helpers import (
make_token,
next_weekday
)
# TODO: parse the generated calendar files with the icalendar library
class IcalToo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__license__ = """
███╗ ███╗███████╗███████╗ ██████╗
████╗ ████║██╔════╝██╔════╝██╔════╝
██╔████╔██║█████╗ ███████╗██║
██║╚██╔╝██║██╔══╝ ╚════██║██║
██║ ╚═╝ ██║███████╗███████║╚██████╗
╚═╝ ╚═╝╚══════╝╚══════╝ ╚═════╝
MESC: Minimun Essential Security Checks
Author... |
# -*- coding: utf-8 -*-
from django.core import validators
from django.db import models
from django.utils import six
from django.utils.translation import ugettext_lazy
class TestModel(models.Model):
title = models.CharField(ugettext_lazy('title'), max_length=255)
text = models.TextField(blank=True, null=True)... |
'''
Antivirus module for the CyberSoft VFind anti-malware scanner;
a part of the VFind Security Toolkit (VSTK).
More information about these tools can be found at:
https://www.cybersoft.com/products/vstk/
https://www.cybersoft.com/support/training/
Configuration options:
`vstk_home' - path to your VSTK in... |
"""Tests for shape_ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.contrib.signal.python.kernel_tests import test_util
from tensorflow.contrib.signal.python.ops import shape_ops
from tensorflow.python.framework im... |
# -*- Python -*-
"""
UtilFns.py $Id: UtilFns.py,v 1.3 2002/05/18 10:28:24 nordstrom Exp $
Copyright 2001 by Bill Janssen <<EMAIL>>
Distributable under the GNU General Public License Version 2 or newer.
"""
import sys, traceback
MessageStream = sys.stderr
ErrorStream = sys.stderr
CurrentVerbos... |
#!/usr/bin/env python
__all__ = ['HttpTargetServer']
import atexit, datetime, os, re, subprocess, sys, tempfile, time, warnings
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir, os.pardir, os.pardir, "common"))
import utils
# --
def __runServer(httpbinPort=0, httpPort=0, sslPo... |
from lxml import html
import os
import re
import subprocess
import shutil
import time
import urllib
from urllib import request
import zipfile
import zlib
url_root = "http://tumourrasmoinsbete.blogspot.com/"
output_root = "."
months = {"janvier":"01", "février":"02", "mars":"03", "avril":"04", "mai":"05", "juin":"06",... |
import os
import glob
import operator
import errno
import filecmp
import shutil
import numpy
from .smac_output_readers import *
def find_largest_file (glob_pattern):
""" Function to find the largest file matching a glob pattern.
Old SMAC version keep several versions of files as back-ups. This
helper ... |
# pylint: skip-file
# flake8: noqa
def main():
'''
ansible oc module for user
'''
module = AnsibleModule(
argument_spec=dict(
kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'),
state=dict(default='present', type='str',
cho... |
# -*- coding: utf-8 -*-
"""
pygments.lexers._csound_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
# Opcodes in Csound 6.14.0 using:
# python3 -c "
# import re
# from subprocess import Popen... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class ListSets(Choreography):
def __init__(self, temboo_session):
"""
Create a new ... |
import string
from Axon.Component import component
from Kamaelia.Protocol.HTTP.HTTPClient import SimpleHTTPClient
from Kamaelia.Protocol.HTTP.HTTPParser import splitUri
from Kamaelia.Util.PureTransformer import PureTransformer
def HTMLTag():
return { "name" : "", "contents": [], "attributes": {} }
def intval(... |
"""Search Pusher application.
WSGI application for managing search data pushing.
"""
import cgi
import cgitb
import logging
import logging.config
from StringIO import StringIO
import sys
from serve import constants
from serve import http_io
from serve.push.search.core import search_push_servlet
# Load logging config... |
# -*- coding: utf-8 -*-
import struct
from math import asin, atan, cos, exp, log, pi, sin, sqrt, tan
from colorama import init
from networkx.algorithms.clique import find_cliques
import networkx as nx
import numpy as np
from datetime import datetime as dt, timedelta
init()
TIME_PERIODS = (
(60, 'minute'),
... |
from __future__ import unicode_literals
from builtins import object
class State(object):
"""
Static class with task instance states constants and color method to
avoid hardcoding.
"""
# scheduler
NONE = None
REMOVED = "removed"
SCHEDULED = "scheduled"
# set by the executor (t.b.... |
"""
Channels module for Zigbee Home Automation.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/zha/
"""
import asyncio
from concurrent.futures import TimeoutError as Timeout
from enum import Enum
from functools import wraps
import logging
from random im... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
from ansible.errors import AnsibleConnectionFailure
from ansible.plugins.terminal import TerminalBase
class TerminalModule(TerminalBase):
terminal_stdout_re = [
re.compile(br"[\r\n]?[\w\+\-\.:\/\[\]]+(?:\(... |
import json
import requests
from wirecloud.proxy.utils import ValidationError
def first_step_openstack(url, idmtoken):
payload = {
"auth": {
"identity": {
"methods": ["oauth2"],
"oauth2": {
"access_token_id": idmtoken
}
... |
import unittest
from nose.tools import eq_
from nose.tools import ok_
import sys
import lxml.etree as ET
from formencode.doctest_xml_compare import xml_compare
from ryu.lib.of_config import classes as ofc
GET = """<ns0:capable-switch xmlns:ns0="urn:onf:of111:config:yang">
<ns0:id>CapableSwitch0</ns0:id>
<ns0:re... |
from __future__ import division
from datetime import datetime
from logging import getLogger
from nens_graph.common import NensGraph
from nens_graph.common import MultilineAutoDateFormatter
from nens_graph.common import LessTicksAutoDateLocator
from matplotlib import cm
from matplotlib.dates import date2num
logger = g... |
import urllib.request
import sys
OUT = 'Win64OpenSSL.exe'
URL_STR = 'https://slproweb.com/download/Win64OpenSSL-%s.exe'
VERSION_MAJOR = 1
VERSION_MINOR = 0
VERSION_PATCH = 2
VERSION_SUFFIX = 'j'
VERSION_STR = '%d_%d_%d%s'
TRY_COUNT = 4
def main():
for patch in range(VERSION_PATCH, TRY_COUNT):
for suff... |
"""MARC formatted as JSON producer.
This producer could be used in several ways.
It could preserve the input tag from marc::
title:
...
producer:
json_for_marc(), {'a': 'title'}
It will output the old marc tag followed by the subfield (dictionary key) and
the value of this key will b... |
import unittest
import solver
class SolverTest(unittest.TestCase):
def setUp(self):
self.testSolver = solver.Solver()
#Vertical test data
self.testVerticalRowComplete = [[1],[2],[3],[4],[5],[6],[7],[8],[9]]
self.testVerticalRowDuplicate = [[1],[2],[3],[5],[5],[6],[7],[8],[9]]
... |
"""
RSpec validation and printing utilities.
"""
import xml.etree.ElementTree as etree
import subprocess
import tempfile
import xml.parsers.expat
import xml.dom.minidom as md
from rspec_schema import *
RSPECLINT = "rspeclint"
def is_wellformed_xml( string, logger=None ):
# Try to parse the XML code.
# If it... |
import os
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GObject
from utilities import logger
from utilities import preferences as prefs
from utilities import ini_info
from utilities import command
fro... |
import os
import random
import json
import sys
import sqlite3
from subprocess import run, CalledProcessError
from flask import Flask, request, render_template, jsonify
if len(sys.argv) != 2:
print("Usage: py server.py PATH/TO/FAPTP_SOLVER")
exit()
# Caminho para o executável do solver
FAPTP = sys.argv[1]
# No... |
"""Provide functionality to stream HLS."""
from aiohttp import web
from homeassistant.core import callback
from .const import (
EXT_X_START,
FORMAT_CONTENT_TYPE,
HLS_PROVIDER,
MAX_SEGMENTS,
NUM_PLAYLIST_SEGMENTS,
)
from .core import PROVIDERS, HomeAssistant, IdleTimer, StreamOutput, StreamView
fro... |
"""Test the wallet keypool and interaction with wallet encryption/locking."""
from test_framework.test_framework import PivxTestFramework
from test_framework.util import *
class KeyPoolTest(PivxTestFramework):
def set_test_params(self):
self.num_nodes = 1
def run_test(self):
nodes = self.node... |
#!/usr/bin/env python3
import numpy as np
import argparse
# constants
class Parameters:
secpera = 3.15569259747e7 # seconds per year
standard_gravity = 9.81 # m/s^2
B0 = 1.9e8 # ice hardness
rho_ice = 910.0 # in kg/m^3
rho_ocean = 1028.0 # in kg/... |
# coding=utf-8
fiscal_regimes = [
"RF01-Ordinario",
"RF02-Contribuenti minimi (art.1, c.96-117, L. 244/07)",
"RF04-Agricoltura e attività connesse e pesca (artt.34 e 34-bis, DPR 633/72)",
"RF05-Vendita sali e tabacchi (art.74, c.1, DPR. 633/72)",
"RF06-Commercio fiammiferi (art.74, c.1, DPR 633/72... |
"""Functions for working with CNF formulas in JSON format."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
flags = tf.flags
FLAGS = flags.FLAGS
flags.DEFINE_bool('cnf_allow_toplevel_func', True,
'Allow functions... |
from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
import logging
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config ... |
'''
Eventlet compatibility testing module.
Should not be mixed with other test modules,
since eventlet affects all the runtime.
'''
import uuid
from nose.plugins.skip import SkipTest
from utils import require_user
try:
import eventlet
except ImportError:
raise SkipTest('eventlet library is not installed')
from... |
"""Defines tool-wide constants."""
import collections
BYTES_IN_ONE_GB = 2 ** 30
DEFAULT_STANDARD_DISK_SIZE_GB = 500
DEFAULT_SSD_DISK_SIZE_GB = 100
STANDARD_DISK_PERFORMANCE_WARNING_GB = 200
SSD_DISK_PERFORMANCE_WARNING_GB = 10
# The maximum number of results that can be returned in a single list
# response.
MAX_RESU... |
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
class SheetFile(models.Model):
filename = models.CharField(max_length=512)
def __unicode__(self):
return unicode("%s" % self.filename)
cla... |
"""The Wolf SmartSet Service integration."""
from datetime import timedelta
import logging
from httpcore import ConnectError, ConnectTimeout
from wolf_smartset.token_auth import InvalidAuth
from wolf_smartset.wolf_client import WolfClient
from homeassistant.config_entries import ConfigEntry
from homeassistant.const i... |
from __future__ import print_function
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.util.browser import view
from bokeh.resources import INLINE
from bokeh.models.glyphs import Circle, Line
from bokeh.models import (ColumnDataSource, Range1d, Plot, LinearAxis, Grid,
HoverTool, Cro... |
import attr
from cfme.infrastructure.config_management.config_systems import ConfigSystemsCollection
from cfme.modeling.base import BaseCollection
from cfme.modeling.base import BaseEntity
from cfme.utils.appliance.implementations.ui import navigate_to
from cfme.utils.pretty import Pretty
from cfme.utils.wait import w... |
from zope.interface import Interface
class CacheError(Exception):
pass
class IXMLRPCCache(Interface):
def create_service(context, request):
"""
Create the service, given the context and request for which it is being
created for.
"""
def fetch(self, func, args, kwargs, ke... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Importance of Feature Scaling
=========================================================
Feature scaling through standardization (or Z-score normalization)
can be an important preprocessing step for many machine lear... |
from pandac.PandaModules import NodePath, BillboardEffect, Vec3, Point3, TextureStage, TransparencyAttrib, DecalEffect, VBase4
from direct.fsm import FSM
from direct.gui.DirectGui import DirectFrame, DGG
from direct.interval.IntervalGlobal import LerpScaleInterval, LerpColorScaleInterval, Parallel, Sequence, Wait
clas... |
#import socket # only needed on win32-OOo3.0.0
import uno
import sys
###############################################
# Generic part establishing contact with Calc #
###############################################
# get the uno component context from the PyUNO runtime
localContext = uno.getComponentContext()
# creat... |
"""Handle Python version/platform incompatibilities."""
import sys
# Py2K
import __builtin__
# end Py2K
try:
import threading
except ImportError:
import dummy_threading as threading
py32 = sys.version_info >= (3, 2)
py3k = getattr(sys, 'py3kwarning', False) or sys.version_info >= (3, 0)
jython = sys.platfor... |
"""distutils.dir_util
Utility functions for manipulating directories and directory trees."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: dir_util.py 39416 2005-08-26 15:20:46Z tim_one $"
import os, sys
from types import *
from distutils.errors import DistutilsFileError, DistutilsIn... |
import math
import csv
import sys
DELIMITER = ','
FILENAME = 'formulas.csv'
FRAC = "\\frac{"
CDOT = " \\cdot "
def find_est(rate, estimates):
result = {}
result['rate'] = rate
exponent = int(math.floor(math.log(rate,10)))
if not exponent == -1:
rate /= 10**exponent
multStr = "1"
for i i... |
from django.conf import settings
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from ella.core.admin import (PublishableAdmin, ListingInlineAdmin,
RelatedInlineAdmin)
from ella_galleries.models import Gallery, GalleryItem
class GalleryItemTabula... |
"""change metablacks to on-update set-null
Revision ID: 18ced36d0df
Revises: 8ba8c933e2
Create Date: 2015-06-19 12:33:55.629954
"""
# revision identifiers, used by Alembic.
revision = '18ced36d0df'
down_revision = '8ba8c933e2'
from alembic import op
def upgrade():
### commands auto generated by Alembic - plea... |
import datetime, re
from app import db, login_manager, bcrypt
import urllib
import hashlib
def slugify(s):
return re.sub('[^\w]+', '-', s).lower()
entry_tags = db.Table('entry_tags',
db.Column('tag_id', db.Integer, db.ForeignKey('tag.id')),
db.Column('entry_id', db.Integer, db.ForeignKey('entry.id'))
... |
import random
from nupic.regions.ImageSensorExplorers.BaseExplorer import BaseExplorer
class RandomFlash(BaseExplorer):
"""
This explorer flashes each filtered image without sweeping, selecting images
randomly.
It centers each image, but does not resize them. If an image is larger
than the sensor's size, ... |
import warnings
import random
import json
import jinja2
import re
from pyLDAvis._server import serve
from pyLDAvis.utils import get_id, write_ipynb_local_js, NumPyEncoder
from pyLDAvis._prepare import PreparedData
import pyLDAvis.urls as urls
__all__ = ["prepared_data_to_html", "display",
"show", "save_html... |
import re
import sys
import datetime
import json
import hashlib
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
import logging
#t_log calls gets logger and calls logger.log, default level is INFO but can be overriden either by importing loggingto use a constant or just passing... |
from __future__ import (absolute_import, division, print_function)
import unittest
from mantid.kernel import BoolTimeSeriesProperty, FloatTimeSeriesProperty, FloatFilteredTimeSeriesProperty
class FilteredTimeSeriesPropertyTest(unittest.TestCase):
_source = None
_filter = None
def setUp(self):
if... |
"""
Giving models a custom manager
You can use a custom ``Manager`` in a particular model by extending the base
``Manager`` class and instantiating your custom ``Manager`` in your model.
There are two reasons you might want to customize a ``Manager``: to add extra
``Manager`` methods, and/or to modify the initial ``Q... |
from qit.base.function import Function
from qit.base.int import Int
from qit.domains.iterator import Iterator
from qit.domains.domain import Domain
from qit.functions.random import rand_int
class Values(Domain):
def __init__(self, type, values):
values = tuple(type.value(v) for v in values)
iterat... |
# 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 'PageHit'
db.create_table('pagehit_pagehit', (
('id', self.gf('django.db.models... |
import json
import logging
import posixpath
import re
import traceback
from extensions_paths import EXAMPLES
import third_party.json_schema_compiler.json_comment_eater as json_comment_eater
import url_constants
_DEFAULT_ICON_PATH = 'images/sample-default-icon.png'
class SamplesDataSource(object):
'''Constructs a... |
# 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 'TeamParticipation.round_name'
db.add_column('participation_teamparticipation', 'round_name... |
import cgi
import cgitb
cgitb.enable()
from shared.functionality.spell import main
from shared.cgiscriptstub import run_cgi_script
run_cgi_script(main) |
#!/usr/bin/env python
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import shutil
import ansible.constants as C
from ansible.executor.task_queue_manager import TaskQueueManager
from ansible.module_utils.common.collections import ImmutableDict
from ansible.invento... |
"""
Handles 'aria --version'
"""
import argparse
from StringIO import StringIO
from aria_cli import utils
class VersionAction(argparse.Action):
def __init__(self,
option_strings,
dest=argparse.SUPPRESS,
default=argparse.SUPPRESS,
help=None):
... |
#!/usr/bin/python
import Tkinter as tk
from yaffsfs import *
#import examples
import ctypes
yaffs_StartUp()
yaffs_mount("yaffs2/")
root_window =tk.Tk()
root_window.title("YAFFS Browser")
mount_list_text_variable=tk.StringVar()
mount_list_text_variable.set("yaffs2/")
current_directory_dict={}
open_windows_list=[]
cl... |
"""
=============================================
Compute sLORETA inverse solution on raw data
=============================================
Compute sLORETA inverse solution on raw dataset restricted
to a brain label and stores the solution in stc files for
visualisation.
"""
#
# License: BSD (3-clause)
import matpl... |
"""This module is deprecated. Please use :mod:`airflow.providers.google.cloud.secrets.secret_manager`."""
import warnings
# pylint: disable=unused-import
from airflow.providers.google.cloud.secrets.secret_manager import CloudSecretManagerBackend
warnings.warn(
"This module is deprecated. Please use `airflow.prov... |
import base64
import hashlib
import json
import os
import sys
import zlib
def json_exit(msg=None, failed=False, changed=False):
if type(msg) is not dict:
msg = {'msg': str(msg)}
msg.update({'failed': failed, 'changed': changed})
print(json.dumps(msg))
sys.exit()
def read_file(filename):
... |
from __future__ import absolute_import
__all__ = [
"PerMessageCompressOffer",
"PerMessageCompressOfferAccept",
"PerMessageCompressResponse",
"PerMessageCompressResponseAccept",
"PerMessageCompress",
"PerMessageDeflateOffer",
"PerMessageDeflateOfferAccept",
"PerMessageDeflateResponse",
"PerMe... |
import json
import unittest
from unittest.case import SkipTest
from coalib.output.JSONEncoder import create_json_encoder
from coalib.results.Diff import ConflictError, Diff, SourceRange
class DiffTest(unittest.TestCase):
def setUp(self):
self.file = ["1", "2", "3", "4"]
self.uut = Diff(self.file... |
"""Submits task job scripts to Simple Linux Utility for Resource Management.
.. cylc-scope:: flow.cylc[runtime][<namespace>]
Uses the ``sbatch`` command. SLURM directives can be provided in the flow.cylc
file:
.. code-block:: cylc
:caption: global.cylc
[platforms]
[[slurm_platform]]
job runn... |
import os
from ... import runtime
from ...cpreparser import CPreParser
from ...ome_types import BuiltIn, BuiltInMethod
constant_string_method = '''
OME_STATIC_STRING(s, "{name}");
return OME_tag_pointer(OME_Tag_String, &s);
'''
def emit_builtin_header(out, builtin):
out.write(runtime.header)
out.write... |
import unittest
import os
import tempfile
# internal modules:
from yotta.lib.fsutils import rmRf
from . import cli
Test_Module_JSON = '''{
"name": "git-access-testing",
"version": "0.0.2",
"description": "Git Access Testing",
"author": "autopulated",
"homepage": "https://github.com/autopulated/git-access-t... |
from lib.util.mysqlBaseTestCase import mysqlBaseTestCase
server_requirements = [[]]
servers = []
server_manager = None
test_executor = None
class basicTest(mysqlBaseTestCase):
def test_basic1(self):
test_cmd = "./gentest.pl --gendata=conf/drizzle/drizzle.zz --grammar=conf/drizzle/drizzle.yy --queries=100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.