text stringlengths 17 737k |
|---|
import numpy as np
from six.moves import map, range, zip
from collections import namedtuple
from functools import partial
from itertools import tee
class Bunch(dict):
"""
Container object for datasets: dictionary-like object that exposes
its keys as attributes.
Examples
--------
>>> b = Bun... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of Karesansui Core.
#
# Copyright (C) 2009-2012 HDE, Inc.
#
# 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 restric... |
import cgi
import re
import urlparse
from lxml import builder
from lxml import etree
from lxml.html import builder as E
from lxml.html import tostring
from lxml.html.clean import clean_html
from vidscraper.decorators import provide_shortmem, parse_url, returns_unicode
from vidscraper import errors
EMaker = builder.... |
import os
from os import path
from subprocess import Popen, PIPE
import logging
from time import time
from contextlib import contextmanager
import argparse
import picklemsg
from checksum import FileItem, repo_file_events
from uilib import ColorfulUi, DummyUi, pretty_bytes
UI_UPDATE_TIME = 0.5 # half a second
log = ... |
"""
URLs for LMS
"""
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib.admin import autodiscover as django_autodiscover
from django.utils.translation import ugettext_lazy as _
from django.views.generic.base import RedirectView
fro... |
# *****************************************************************************
# Copyright (c) 2014, 2016 IBM Corporation and other Contributors.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distrib... |
from threading import Lock, Event
from weakref import WeakValueDictionary
class TransferEventManager(object):
def __init__(self):
self.events = WeakValueDictionary(dict())
self.events_lock = Lock()
def acquire_event(self, path, force_clear=False):
with self.events_lock:
i... |
if __name__ == "__main__":
__version__ = "0.11.0"
else:
from . import animatedsprite
from . import tilemap
from . import layers
from . import camera
|
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals, division
import binascii
import os
import json
from datetime import timedelta, datetime
from sc2reader.log_utils import loggable
from sc2reader.exceptions import MPQError
from sc2reader.constants import COLOR_CODES, COLO... |
#!/usr/bin/env python2.7
# Copyright 2014 Virantha Ekanayake 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 ... |
# One Convergence, Inc. CONFIDENTIAL
# Copyright (c) 2012-2015, One Convergence, Inc., USA
# All Rights Reserved.
#
# All information contained herein is, and remains the property of
# One Convergence, Inc. and its suppliers, if any. The intellectual and
# technical concepts contained herein are proprietary to One Conv... |
# -*- coding: utf-8 -*-
__version__ = "v0.0.3 - 2015-07-06T14:31:47.419000"
# Third-party libs from PyPI
import unicodedata # for slugifying
import win32com.client # part of pypiwin32
import pywintypes # Part of pypiwin32
import pytz # timezones info - for converting local time to UTC
import e... |
import requests
import urllib2
try:
import simplejson as json
except ImportError:
try:
import json
except ImportError:
try:
from django.utils import simplejson as json
except ImportError:
raise ImportError('A json library is required to use ' + \
... |
__version__ = "0.1.16.deva"
__changelog__ ="""
0.1.16dev update bids layout import
0.1.15dev cleanupt mkdir log
0.1.14dev added gstat RUNNING to check logfiles
0.1.13dev added gstat to check logfiles
0.1.12dev fix version arg issue
0.1.11dev added wait for nfs
0.1.10dev fixed docker_opt bug
0.1.9.dev added --docker_op... |
"""
RenderWidget
:Authors:
Berend Klein Haneveld
"""
from vtk import vtkRenderer
from vtk import vtkVolume
from vtk import vtkInteractorStyleTrackballCamera
from vtk import vtkOpenGLGPUVolumeRayCastMapper
from vtk import vtkVersion
from vtk import vtkOrientationMarkerWidget
from vtk import vtkAxesActor
from vtk impo... |
import os
import bson
import numpy as np
import operator
import util.database_helpers as dh
import util.associate
import util.transform as tf
import util.dict_utils as du
import core.image_source
import core.sequence_type
import core.benchmark
import metadata.camera_intrinsics as cam_intr
import metadata.image_metadata... |
#!/usr/bin/env python3
# coding=UTF-8
#
# Copyright (c) 2015 ChangZhuo Chen (陳昌倬) <czchen@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without l... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Compatibility functionality for Windbg users.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import codecs
import math
import sys
from builtins imp... |
# -*- coding: utf-8 -*-
"""
SPECTRA: A simple one dimensional spectra reduction and analysis package
Created with the Apache Point Observatory (APO) 3.5-m telescope's
Dual Imaging Spectrograph (DIS) in mind. YMMV
e.g. DIS specifics:
- have BLUE/RED channels
- hand-code in that the RED channel wavelength is backwards
... |
# Copyright (c) 2005 Iowa State University
# http://mesonet.agron.iastate.edu/ -- mailto:akrherz@iastate.edu
#
# 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... |
#!/usr/bin/python
########################################################################
#
# Caution: there are two separate, independent build systems:
# 'makepanda', and 'ppremake'. Use one or the other, do not attempt
# to use both. This file is part of the 'makepanda' system.
#
# To build panda using this scrip... |
import sys
import logging
import matplotlib.pyplot as plt
import numpy as np
import faulthandler
faulthandler.enable()
plt.ion()
handler = logging.StreamHandler(sys.stderr)
fmt = logging.Formatter("%(asctime)-15s [%(name)5s:%(levelname)s] %(message)s")
handler.setFormatter(fmt)
handler.setLevel(logging.INFO)
logging... |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import json
import shutil
import logging
import datetime
import argparse
import hashlib
join = os.path.join
from flask import Flask, make_response, request, abort, jsonify
from flask.ext.httpauth import HTTPBasicAuth
from flask.ext.restful import Resource, Api
f... |
# encoding: utf-8
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import unicode_literals
from pyL... |
import numpy as nm
import sfepy.linalg as la
from sfepy.discrete.integrals import Integral
def prepare_remap(indices, n_full):
"""
Prepare vector for remapping range `[0, n_full]` to its subset given
by `indices`.
"""
remap = nm.empty((n_full,), dtype=nm.int32)
remap.fill(-1)
remap[indices... |
# vim: sw=4 ts=4 sts=4 expandtab smarttab
# HXN fly-scan configuration
from hxnfly.bs import (FlyPlan1D, FlyPlan2D, FlyStep1D, maybe_a_table)
from hxnfly.hxn_fly import (Fly1D_MLL, Fly1D_ZP, Fly2D_MLL, Fly2D_ZP,
Fly1D_Diffraction, Fly2D_Diffraction)
# These define which scans can be done by which class:
# 1D s... |
'''
Scroll View
===========
.. versionadded:: 1.0.4
The :class:`ScrollView` widget provides a scrollable/pannable viewport that is
clipped at the scrollview's bounding box.
Scrolling Behavior
------------------
ScrollView accepts only one child, and applies a viewport/window to it
according to the :data:`scroll_x`... |
from sklearn import cross_validation
from readfacedatabases import *
# TODO: move to common?
def splitTrainTest(data1, data2, labels1, labels2, ratio):
assert len(data1) == len(data2)
assert len(labels1) == len(labels2)
assert len(labels1) == len(data1)
assert len(labels1) == len(labels2)
indexShuffle = np... |
from __future__ import print_function
import sys, os
import yaml
from serial import Serial, SerialException
from time import sleep
#
# Logging util
#
def loginfo(*msg):
print("INFO:", *msg)
def logerr(*msg):
print("ERROR:", *msg, file=sys.stderr)
# The recipe gives simple implementation of a Discrete
# Pro... |
from sfepy.base.base import *
from sfepy.base.la import cycle
try:
from enthought.mayavi import mlab
except ImportError:
mlab = None
def add_surf(obj, position, opacity=1.0):
surf = mlab.pipeline.surface(obj, opacity=opacity)
surf.actor.actor.position = position
return surf
def add_scalar_cut_pla... |
#!/usr/bin/env python
# coding=utf-8
# Filename: __version__.py
# pylint: disable=C0103
"""
Pep 386 compliant version info.
(major, minor, micro, alpha/beta/rc/final, #)
(1, 1, 2, 'alpha', 0) => "1.1.2.dev"
(1, 2, 0, 'beta', 2) => "1.2b2"
"""
version_info = (0, 9, 30, 'final', 0)
def _get_version(versio... |
# Filename: __init__.py
"""
A collection of io for different kinds of data formats.
"""
import os.path
import numpy as np
from .evt import EvtPump # noqa
from .daq import DAQPump # noqa
from .clb import CLBPump # noqa
from .aanet import AanetPump # noqa
from .jpp import EventPump # noqa
from .ch import CHPump ... |
'''
Main "pipeline" script for the Legacy Survey (DECaLS, MzLS, BASS)
data reductions.
For calling from other scripts, see:
- :py:func:`run_brick`
Or for much more fine-grained control, see the individual stages:
- :py:func:`stage_tims`
- :py:func:`stage_refs`
- :py:func:`stage_outliers`
- :py:func:`stage_halos`
- ... |
#!/usr/bin/env python
import example_py
import struct
import ctypes
buf = struct.pack('BBBB', 0x41, 0x42, 0x43, 0x44)
print 'python:'
print buf
e = example_py.ExampleClass()
print 'c++:'
e.printBuffer(ctypes.cast(ctypes.c_char_p(buf), ctypes.POINTER(ctypes.c_ubyte)), len(buf))
|
from __future__ import annotations
import logging
logger = logging.getLogger("dials.extensions.dispersion_spotfinder_threshold_ext")
class DispersionSpotFinderThresholdExt:
"""Extensions to do dispersion threshold."""
name = "dispersion"
@staticmethod
def phil():
from libtbx.phil import pa... |
# coding=utf-8
from __future__ import division, absolute_import, print_function, unicode_literals
from collections import deque, namedtuple
class Connection(object):
def __init__(self, id):
self.id = id
self.port = None
self.hostname = None
self.buffers = []
def __repr__(self):... |
import discord
from discord.ext import commands
from discord.permissions import Permissions
from .utils import checks
import asyncio
from .utils.dataIO import dataIO
import os
client = discord.Client()
class EventBets:
"""Create an event which people can bet on"""
def __init__(self, bot):
self.bot = ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Other methods in my package
"""
import string, random, hashlib
DEFAULT_PREFIX = 'abc_'
################################
## UTILITIES
def string_generator(size=32, \
chars=string.ascii_uppercase + string.ascii_lowercase + string.digits):
""" Create a random ... |
import sys
import os
import subprocess
import threading
import wsgiserver
from Maraschino import app
from Logger import maraschinoLogger
from apscheduler.scheduler import Scheduler
FULL_PATH = None
RUNDIR = None
ARGS = None
DAEMON = False
PIDFILE = None
VERBOSE = True
LOG_FILE = None
PORT = None
DATABASE = None
INIT_L... |
"""
Task:
Do fancy shit.
"""
# Import Built-Ins
import logging
import socket
import time
import json
# Import Homebrew
from bitex.api.bitstamp import API
from bitex.http.client import Client
log = logging.getLogger(__name__)
class BitstampHTTP(Client):
def __init__(self, server_addr, key='', secret='', key_fi... |
"""
bjson/connection.py
Asynchronous Bidirectional JSON-RPC protocol implementation over TCP/IP
Copyright (c) 2010 David Martinez Marti
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following condi... |
#!/usr/bin/env python3
from netcdfTools import *
import argparse
import numpy as np
import sys
from utilities import writeLog
#=======================================================================
'''A script to transform 3D numpy array to netCDF.
The 3D array is expected as the S file of the npz archive. The othe... |
"""Datasets for TOVS/ATOVS
"""
import io
import tempfile
import subprocess
import datetime
import logging
import gzip
import shutil
import abc
import numpy
import netCDF4
import dateutil
try:
import coda
except ImportError:
logging.warn("Unable to import coda, won't read IASI EPS L1C")
from .. import ... |
#!/usr/bin/env python
# =============================================================================
# file = api.py
# description = System Information API
# author = GR <https://github.com/shortdudey123>
# create_date = 2014-07-25
# mod_date = 2014-07-25
# version = 0.1
# usage =
# notes =
# python_ver = 2.7.6
# ===... |
class ShiftValidateException(Exception):
"""
Main exception category
All package exceptions extend that to allow you to catch exception by
component in a general way
"""
pass
class PropertyExists(ShiftValidateException, ValueError):
"""
Property exists
Exception indicates certain ... |
from feedly.feeds.aggregated_feed.base import AggregatedFeed
from feedly.serializers.aggregated_activity_serializer import \
NotificationSerializer
from feedly.storage.redis.timeline_storage import RedisTimelineStorage
import copy
import datetime
import json
import logging
logger = logging.getLogger(__name__)
cl... |
from pychecker2.Check import Check
from pychecker2.Check import Warning
from pychecker2 import symbols
from pychecker2.util import BaseVisitor, parents, type_filter
from compiler.misc import mangle
from compiler import ast, walk
_ignorable = {}
for ignore in ['repr', 'dict', 'class', 'doc', 'str']:
_ignorable['_... |
import numpy as np
import openmdao.api as om
from pycycle.thermo.thermo import Thermo, ThermoAdd
from pycycle.thermo.cea.species_data import janaf
from pycycle.constants import AIR_FUEL_ELEMENTS, AIR_ELEMENTS
from pycycle.flow_in import FlowIn
class MixImpulse(om.ExplicitComponent):
"""
Compute the combined... |
import time
import socket
import logging
import json
import os
from dispatch import receiver
from stoppable import StoppableLoopThread
import rlp
import signals
from peer import Peer
DEFAULT_SOCKET_TIMEOUT = .5
logger = logging.getLogger(__name__)
def is_valid_ip(ip): # FIXME, IPV6
return ip.count('.') == 3
... |
# No shebang line, this module is meant to be imported
#
# Copyright 2014 Ambient Entertainment GmbH & Co. KG
# Copyright 2014 Oliver Palmer
#
# 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
#
... |
# No shebang line, this module is meant to be imported
#
# Copyright 2013 Oliver Palmer
#
# 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
#
# U... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.cypher
~~~~~~~~~~~~~~~~~~~~~~
A Lexer for the cypher graph query language use in the neo4j graph database.
`CypherLexer`
the ``tests/examplefiles`` contains file "test.cyp" which has valid
cypher queries that execute against the example database shi... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.puppet
~~~~~~~~~~~~~~~~~~~~~~
Lexer for the Puppet DSL.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, bygroups, include
from pygments.token import Co... |
"""
An interface to the small NORB dataset. Unlike `./norb_small.py`, this reads
the original NORB file format, not the LISA lab's `.npy` version.
Currently only supports the Small NORB Dataset.
Download the dataset from
`here <http://www.cs.nyu.edu/~ylclab/data/norb-v1.0-small/>`_.
NORB dataset(s) by Fu Jie Huang a... |
# This file is part of Lod4Stat.
#
# Copyright (C) 2014 Provincia autonoma di Trento
#
# This program 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 of the License, or
# (at your optio... |
# Copyright (c) 2016 Canonical Ltd
#
# 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 ... |
#!/usr/bin/env python
"""
This module defines the VaspInputSet abstract base class and a concrete
implementation for the parameters used by the Materials Project and the MIT
high throughput project. The basic concept behind an input set is to specify
a scheme to generate a consistent set of VASP inputs from a structu... |
# ======================================================================
# matscipy - Python materials science tools
# https://github.com/libAtoms/matscipy
#
# Copyright (2014) James Kermode, King's College London
# Lars Pastewka, Karlsruhe Institute of Technology
#
# This program is free software: you... |
## $Id$
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN.
##
## CDS Invenio 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 (a... |
import os
import shutil
import subprocess
import socket
import SocketServer
import StringIO
import time
import threading
from Queue import Queue
import numpy as np
from matscipy.elasticity import full_3x3_to_Voigt_6_stress
from matscipy.logger import quiet, screen
from ase.atoms import Atoms
from ase.io.extxyz impor... |
# This file is part of Cockpit.
#
# Copyright (C) 2013 Red Hat, Inc.
#
# Cockpit 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; either version 2.1 of the License, or
# (at your option) any later versio... |
import os
from buildercore import core, config, project, bakery
from buildercore.utils import lookup
from buildercore.decorators import osissue, osissuefn
import utils
from decorators import requires_aws_stack, debugtask, echo_output
import boto
from buildercore.core import boto_cfn_conn, boto_ec2_conn, connect_aws_wit... |
#!/usr/bin/env python
import argparse, os, shutil, subprocess, bagit
parser = argparse.ArgumentParser(description="script for making a bunch of directories with a bunch of files in them")
parser.add_argument('-t', '--target', type=str, required=True, help='where to put the test data')
parser.add_argument('-r', '--ree... |
# Django settings for timetable project.
import os
import sys
from datetime import timedelta
# setup
relative = lambda *x: os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', *x)
if relative('lib') not in sys.path:
sys.path.append(relative('lib'))
# end setup
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMI... |
from __future__ import absolute_import
__author__ = 'katharine'
from gevent import monkey
monkey.patch_all()
import collections
import zipfile
from uuid import UUID
import gevent
import json
import logging
import os
import os.path
import shutil
import urlparse
import urllib
from libpebble2.services.appmessage import... |
"""
Description.
"""
__author__ = 'Dan Gunter <dkgunter@lbl.gov>'
__date__ = '2/21/13'
from email.mime.text import MIMEText
import json
from operator import itemgetter
import smtplib
#
from .util import DoesLogging
from ..util import MongoJSONEncoder
from .diff import Differ # for field constants
class Report:
... |
"""
:mod:`weights` --- Spatial Weights
==================================
"""
__all__ = ['W']
__author__ = "Sergio J. Rey <srey@asu.edu> "
from pysal.common import *
from scipy import sparse, float32
import gc
class W(object):
"""
Spatial weights
Parameters
----------
neighbors : dictiona... |
# -*- coding: utf-8 -*-
import sys
import serial
import config
import time
import dispatch
port = '/dev/tty.usbmodemfd131'
ser = serial.Serial(port, 9600)
def send(text):
#time.sleep(2)
#print ser.readline()
text += '\n'
ser.write(text)
print ">", text
ser.close()
def read():
try:
... |
# -*- coding: utf-8 -*-
"""
Decorators and other functions for hooks.
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
import re
from sheldon.exceptions import catch_plugin_errors
class Hook:
"""
Basic class for hooks
"""
# Every hook has type... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2016, MIT Probabilistic Computing Project
#
# 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/LICENS... |
#!/usr/bin/env python
# Android Device Testing Framework ("dtf")
# Copyright 2013-2015 Jake Valletta (@jake_valletta)
#
# 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... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Created on 2015-03-02
@author: joschi
@author: razavian
"""
from __future__ import print_function
import shelve
import sys
import os.path
#import simplejson as json
import json
def writeRow(cols, out, start, length, colZero):
delim = out['delim'];
quote = out['quo... |
# shrunk - Rutgers University URL Shortener
"""Database-level interactions for shrunk. """
import datetime
import random
import string
import re
import pymongo
from shrunk.aggregations import match_short_url, monthly_visits_aggregation
class DuplicateIdException(Exception):
"""Raised when trying to add a duplicat... |
"""Contains all the core ShutIt methods and functionality.
"""
#The MIT License (MIT)
#
#Copyright (C) 2014 OpenBet Limited
#
#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... |
from __future__ import print_function
import sys
import json
HEADER = {'User-Agent': 'RealTimeWeb Geocode library for educational purposes'}
PYTHON_3 = sys.version_info >= (3, 0)
if PYTHON_3:
import urllib.request as request
from urllib.parse import quote_plus
else:
import urllib2
from urllib import q... |
"""Contains all the core ShutIt methods and functionality.
"""
#The MIT License (MIT)
#
#Copyright (C) 2014 OpenBet Limited
#
#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... |
'''
group.py - Group reads based on their UMI
=========================================
:Author: Tom Smith
:Release: $Id$
:Date: |today|
:Tags: Python UMI
Purpose
-------
The purpose of this command is to identify groups of reads based on
their genomic coordinate and UMI. It is assumed that the FASTQ files
were proc... |
# This file is part of fedmsg.
# Copyright (C) 2012-2014 Red Hat, Inc.
#
# fedmsg 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; either
# version 2.1 of the License, or (at your option) any later versi... |
# Copyright 2013-2014 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
import os
import subprocess
import virtool.utils
from virtool.permissions import PERMISSIONS
from virtool.users import reconcile_permissions
from virtool.history import get_default_isolate
from virtool.virusutils import merge_virus
def organize_analyses(database):
# Make sure all NuVs analysis records reference ... |
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distributed... |
#!/usr/bin/env python
# Copyright (C) 2013-2014 Steven Myint
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, mo... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Peter Mounce <public@neverrunwithscissors.com>
#
# This file is part of Ansible
#
# Ansible 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... |
"""
profilerui
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from PySide import QtGui, QtCore
from mcedit2.util import profiler
from mcedit2.widgets.layout import Column
log = logging.getLogger(__name__)
class ProfilerWidget(QtGui.QWidget):
def __init... |
# encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.44.1"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
|
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""Build Unihan into datapackage-compatible format."""
from __future__ import (absolute_import, division, print_function,
unicode_literals, with_statement)
import argparse
import fileinput
import glob
import os
import sys
import zipfile
sys.path.in... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import functools
import itertools
import lupa
from splash.qtrender import RenderScript, stop_on_error
from splash.lua import (
table_as_kwargs_method,
get_new_runtime,
start_main,
get_script_source,
lua2python,
python2lua,
)
from s... |
#!/usr/bin/env python
"""
Wraps a executable to enable that script to be submitted to an SGE cluster engine
"""
import sys
import os.path
import argparse
from copy import copy
import time
import subprocess
import shutil
class SGESubmitter(object):
"""
This class automates the submission of MPI jobs on a SGE-p... |
# -*- mode: python; coding: utf-8 -*-
# Copyright (c) 2018 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
"""Primary container for radio interferometer datasets."""
import os
import copy
import re
import numpy as np
import warnings
from astropy import constants as const
import astropy.units a... |
"""
`blowdrycss` is a rapid styling tool that compiles DRY CSS from encoded class selectors in your web project files.
"""
# reference:
# http://stackoverflow.com/questions/23164482/created-a-pypi-package-and-it-installs-but-when-run-it-returns-an-import-error#23164865
# ``python setup.py test`` produces 1 failure an... |
#!/usr/bin/env python
#
# Copyright 2012, Rackspace US, 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 applicab... |
__version__ = (2022, 2, 6, '76a59e9e')
VERSION = ".".join(map(str, __version__))
|
#!/usr/bin/env python
"""Sample testing of the Python webscanner client."""
from getpass import getpass
import time
import sys
import urllib.parse
import argparse
from webscanner_client import WebscannerClient
# Change this to the actual URL you want to test against.
WEBSCANNER_URL = 'http://localhost:8080'
# Relat... |
# -*- coding: utf-8 -*-
import time
import etcd
import json
import hashlib
import requests
from os import environ
from argh.decorators import arg, expects_obj
from lain_admin_cli.helpers import TwoLevelCommandBase
from subprocess import check_output, call
from lain_admin_cli.helpers import info, error, sso_login
cla... |
#! /usr/bin/env python
"""
A class used to create and manage regular square raster
grids for 2D numerical models in Landlab.
"""
import numpy as np
import six
from six.moves import range
from landlab.testing.decorators import track_this_method
from landlab.utils import structured_grid as sgrid
from landlab.utils impo... |
#!/usr/bin/env python3
"""
When doing gene finding with tools like Augustus it's common to take a file of curated
genes/transcripts and split these into a set for training and another for evaluation.
This script accepts an input GFF3 file and then generates two files, one of genes to
use as training and another as ev... |
''' -- imports from python libraries -- '''
# import os -- Keep such imports here
import json
''' -- imports from installed packages -- '''
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.http import HttpResponseRedirect
from django.http import HttpRespo... |
"""
mesclan.controllers
~~~~~~~~~~~~~~~~~
"""
from functools import wraps
from flask import request
from ujson import dumps
from mesclan import exceptions
from mesclan.constants import DEBUG_TOKEN, GET_BOTTLE_FIELDS
from mesclan.store import get_bottle
def handle_request(func):
@wraps(func)
def wrapper(*arg... |
import os
import sys
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(BASE_DIR, "apps"))
ALLOWED_HOSTS = ['*',]
SITE_ID = 1
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.co... |
import numpy as np
from ..bath import PseudomodeBath
from ..utils import memoized_property
from .generic import DynamicalModel, SystemOperator
class ZOFESpaceOperator(SystemOperator):
def __init__(self, operator, liouv_subspace_map, dynamical_model):
"""
Parameters
----------
ope... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.