text stringlengths 12 6.59M |
|---|
#!/usr/bin/env python
"""
Given a BAM file, this script will only allow reads that meet filtering
criteria to be written to output. The output is another BAM file with the
reads not matching the criteria removed.
Currently, the available filters are:
-mapped
-mismatch num # mismatches or in... |
from osv import fields, osv
class mrp_worker_extension(osv.osv_memory):
_name='mrp.product.produce'
_inherit='mrp.product.produce'
_columns= {
'produced_qty': fields.float('Produced Quantity', digits_compute=dp.get_precision('Product Unit of Measure'), required=True),
}
def _get_produced_qty(self, cr, ui... |
#!/usr/bin/env python
## category General
## desc Removes reads from a BAM file based on criteria
"""
Removes reads from a BAM file based on criteria
Given a BAM file, this script will only allow reads that meet filtering
criteria to be written to output. The output is another BAM file with the
reads not matching the ... |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2011-2012 Alcatel, Alcatel-Lucent, Inc. All Rights Reserved.
This source code contains confidential information which is proprietary to Alcatel.
No part of its contents may be used, copied, disclosed or conveyed to any party
in any manner whatsoever without prior written permi... |
"""
Models for the Task application
"""
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import (
Case,
Count,
Max,
Prefetch,
When,
)
from datetime import datetime
import logging
... |
from bs4 import BeautifulSoup
import requests
import jsobj
class Bandcamp:
def parse(self, url):
r = requests.get(url)
self.soup = BeautifulSoup(r.text)
album = {
"tracks": [],
"title": "",
"artist": "",
"full": False,
"art": ""... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# CREATED:2015-02-02 11:07:07 by Brian McFee <brian.mcfee@nyu.edu>
'''Pitch deformation algorithms'''
import librosa
import pyrubberband as pyrb
import re
import numpy as np
import six
from copy import deepcopy
from ..base import BaseTransformer
__all__ = ['PitchShift'... |
"""
multiplication-table.py
Author: Ryan Kynor
Credit: <list sources used, if any>
Assignment:
Write and submit a Python program that prints a multiplication table. The user
must be able to determine the width and height of the table before it is printed.
The final multiplication table should look like this:
Width ... |
# coding: utf-8
"""
muxiwebsite: 木犀团队的官网
~~~~~~~~~~~~~~~~~~~~~~~~~
木犀团队是华中师范大学自由的学生互联网团队,分为
web(前端、后台),设计, 安卓 组
木犀官网是木犀团队的官方网站:
功能模块:
1.muxi: 木犀官网 木犀的简介信息
2.blog: 木犀博客 木犀团队的博客
3.book: 木犀图书 木犀图书管理
4.share: 木犀分享 木犀内部的分享小站
管理模块:
backend... |
##############################################################################
#
# Copyright (C) 2019 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... |
# Copyright 2017 Mycroft AI 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 writin... |
import re
import logging
import feedparser
from testcontroller import TestController
from packagecontroller import PackageController
from datetime import timedelta, datetime
from turbogears import controllers, expose, flash
from turbogears import identity, redirect
from cherrypy import request, response
from toscawi... |
from random import choice
from django.db import IntegrityError
from django.utils.text import slugify
from mygpo.decorators import query_if_required
from mygpo.categories.models import Category, CategoryEntry
class Topics(object):
def __init__(self, total=100, num_cat=10, podcasts_per_cat=10):
self.tota... |
# Copyright (C) 2010 Parker Phinney
# Copyright (C) 2009, 2010 OpenHatch, Inc.
# Copyright (C) 2010 Jessica McKellar
#
# 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 ... |
# This file is part of OpenHatch.
# Copyright (C) 2010, 2011 Jack Grigg
# Copyright (C) 2009 OpenHatch, Inc.
#
# 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 Lice... |
# Imports {{{
# Python
import StringIO
import datetime
import urllib
import simplejson
import re
import collections
# Django
from django.template.loader import render_to_string
from django.core import serializers
from django.http import \
HttpResponse, HttpResponseRedirect, HttpResponseServerError, HttpRespon... |
"""
This class encapsulates the interactions with
the Grad School request resource.
"""
import logging
import traceback
from restclients.grad.degree import get_degree_by_regid
from restclients.grad.committee import get_committee_by_regid
from restclients.grad.leave import get_leave_by_regid
from restclients.grad.petit... |
from __future__ import division
import datetime
import re
import itertools
import random
from collections import defaultdict
from django.conf import settings
from django.core import exceptions
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.utils.dateformat import DateFormat... |
"""
Handler for Cisco CSR device specific information.
Note that for proper import, the classname has to be:
"<Devicename>DeviceHandler"
...where <Devicename> is something like "Default", "Nexus", etc.
All device-specific handlers derive from the DefaultDeviceHandler, which implements the
generic information ne... |
#!/usr/bin/env python
# Copyright 2016 NeuroData (http://neurodata.io)
#
# 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 ... |
# Copyright 2017 NeuroData (http://neurodata.io)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
# vim: fileencoding=utf-8 et ts=4 sts=4 sw=4 tw=0
"""
Green version of the RPC client
Authors:
* Brian Granger
* Alexander Glyzov
* Axel Voitier
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2012-2014. Brian Granger, Min Ragan-Kelley, Alexander Glyzov,
# Axel V... |
import binascii
import socket
from subprocess import Popen, PIPE, STDOUT
import serial
from py_irsend import irsend
SERIAL_CONNECTIONS = {}
TCP_CONNECTIONS = {}
CEC_CLIENT = None
def send_infrared_command(device, command):
irsend.send_once(device, [command])
def send_serial_command(port, baud, bytesize, tim... |
"""
network/conn.py
Network class methods to create connections
Contributors: salvadordura@gmail.com
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from __future__ import absolute_import
from builtins import dict
from builtins import range
from b... |
# -*- coding: utf-8 -*-
from __future__ import division
import pandas as pd
import numpy as np
import biosppy
import cvxopt as cv
import cvxopt.solvers
from ..statistics import z_score
from ..statistics import find_closest_in_list
# ==============================================================================
#... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# necessary for Python2
from __future__ import print_function
import argparse
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.animation as animation
import numpy as np
from itertools import tee
parser = argparse.ArgumentParser(description='Plot data from ... |
'''
neurosynth: plugin for the deepdive python package
functions for working with neurosynth database
'''
from neurosynth.base.dataset import Dataset
from neurosynth.base.dataset import FeatureTable
from wordfish.plugins.pubmed.functions import Pubmed
from neurosynth.base import mask
from neurosynth.base import image... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# My imports
from __future__ import division, print_function
import os
import urllib
import numpy as np
import scipy.interpolate as sci
import matplotlib.pyplot as plt
import matplotlib
from astropy.io import fits
from astropy.modeling import models, fitting
import argparse... |
# coding=utf-8
#
# Copyright © 2011-2015 Splunk, 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 ... |
import datetime
import inspect
import logging
import re
import time
import traceback
import uuid
import warnings
from collections import OrderedDict
from functools import partial
from functools import wraps
from huey import signals as S
from huey.constants import EmptyData
from huey.consumer import Consumer
from huey... |
import traceback
from idaapi import *
from idautils import *
from idc import *
from elftools import *
import iddaautils as utils
class SymbolCollector:
"""Collect symbols from ida pro"""
def __get_ida_symbols(self, rename_only=False):
symbols = []
# func symbols
start_ea, end_ea = uti... |
'''
A collection of functions that other scripts can use.
'''
import subprocess
import sys
import time
import smtplib
import mimetypes
import getpass
import os
import filecmp
import hashlib
import datetime
import uuid
import tempfile
import csv
import json
import ctypes
import platform
from glob import glob
from email... |
import numpy as np
import random
from q1_softmax import softmax
from q2_sigmoid import sigmoid, sigmoid_grad
from q2_gradcheck import gradcheck_naive
def affine_forward(x, w, b):
out = None
N = x.shape[0]
D = np.prod(x.shape[1:])
M = b.shape[1]
out = np.dot(x.reshape(N,D), w.reshape(D,M)) + ... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Specify and constraints to determine which targets are observable for
an observer.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from abc import ABCMeta, abstractmethod
import numpy as... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module defines base classes for all models. The base class of all
models is `~astropy.modeling.Model`. `~astropy.modeling.FittableModel` is
the base class for all fittable models. Fittable models can be linear or
nonlinear in a regression analys... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# This module implements the base NDData class.
from __future__ import absolute_import, division, print_function, unicode_literals
from copy import deepcopy
import numpy as np
from ..units import Unit, UnitsError, dimensionless_unscaled
from .. import ... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains a number of utilities for use during
setup/build/packaging that are useful to astropy as a whole.
"""
from __future__ import absolute_import
import os
import sys
from distutils import log
from distutils.dist import Distribution
... |
from blinker import signal
import base64
import logging
logger = logging.getLogger("asyncirc.plugins.sasl")
import asyncirc.plugins.cap
pending_authentications = {}
class AuthenticationFailed(Exception): pass
def auth(client, username, password):
asyncirc.plugins.cap.cap_wait(client.netid, "sasl")
if clien... |
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
Code for getting source code to put inside container.
"""
import logging
import copy
import os
import shutil
import tempfile
from textwrap impo... |
from .container import Container, Well, WellGroup
from .container_type import ContainerType, _CONTAINER_TYPES
from .unit import Unit
from .instruction import *
from .pipette_tools import assign
from .util import convert_to_ul, convert_to_nl
from .util import check_valid_origin
from .util import check_stamp_append
impo... |
"""Automated rejection and repair of trials in M/EEG."""
# Authors: Mainak Jas <mainak.jas@telecom-paristech.fr>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis A. Engemann <denis.engemann@gmail.com>
import numpy as np
from scipy.stats.distributions import uniform
import mne
... |
"""Automated rejection and repair of trials in M/EEG."""
# Authors: Mainak Jas <mainak.jas@telecom-paristech.fr>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis A. Engemann <denis.engemann@gmail.com>
import numpy as np
from scipy.stats.distributions import uniform
import mne
... |
import gzip
import logging
import boto
import boto3 as boto3
import smart_open
from botocore.exceptions import ClientError
try:
from ConfigParser import DuplicateSectionError
except ImportError:
from configparser import DuplicateSectionError
try:
import cPickle as pickle
except ImportError: # for python 3... |
# Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
import os
import re # noqa
import sys
import ldap
import djcelery
from datetime import timedelta
from kombu import Queue, Exchange
from kombu.common import Broadcast
# global settings
from django.conf import global_settings
# ugettext lazy
from django.utils.... |
# Django settings for b2note_devel project.
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TEMPLATE_PATH = os.path.join(BASE_DIR, 'templates')
STATIC_PATH = os.path.join(BASE_DIR,'static')
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists of v... |
#
# ------------------------------------------------------------
# Copyright (c) All rights reserved
# SiLab, Institute of Physics, University of Bonn
# ------------------------------------------------------------
#
from __future__ import print_function
import time
from basil.HL.RegisterHardwareLayer import HardwareL... |
from __future__ import unicode_literals
from bazaar.utils import money_to_default, has_default_currency
from .exceptions import MovementException
from .models import Movement
from .signals import incoming_movement, outgoing_movement
def move(from_location, to_location, product, quantity, unit_price, agent=None, not... |
"""Module containing tools to assist in building of WSGI routers.
The routing history is a list of named tuples (HistoryChunk) with parts:
before -- What the unrouted path was before this routing step.
after -- What the unrouted path was after this routing step.
router -- Whatever was responsible for this ... |
#!/usr/bin/env python
import os
import shutil
import argparse
import textwrap
import subprocess
import psutil
import sys
class DiscordProcess:
def __init__(self, path, exe):
self.path = path
self.exe = exe
self.processes = []
def terminate(self):
for process in self.processes:... |
# -*- coding: utf-8 -*-
# @Author: oesteban
# @Date: 2016-07-21 11:28:52
""" A robust ANTs T1-to-MNI registration workflow with fallback retry """
from __future__ import print_function, division, absolute_import, unicode_literals
from os import path as op
import shutil
import pkg_resources as pkgr
from multiprocessi... |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2017, Dorian Soergel.
#
# 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 t... |
# Copyright (c) 2016, German Neuroinformatics Node (G-Node)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted under the terms of the BSD License. See
# LICENSE file in the root of the Project.
from __future__ import (absolute_import, division, ... |
from req import Service
from service.base import BaseService
import config
import os
import re
class Judge(BaseService):
def get_submission(self):
res = yield self.db.execute("DELETE FROM wait_submissions WHERE id IN (SELECT id FROM wait_submissions ORDER BY id LIMIT 1) RETURNING submission_id")
#... |
# This file is part of beets.
# Copyright 2013, Fabrice Laporte.
#
# 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,... |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Fabrice Laporte, Yevgeny Bezman, and Adrian Sampson.
#
# 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 restrict... |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
#!/usr/bin/env python3
from plumbum import cli, local, TF, FG, ProcessExecutionError
from plumbum.cmd import tar, mkdir, mv, rm, bash
from benchbuild import settings
from benchbuild.utils import user_interface as ui
from benchbuild.utils import log
from benchbuild.utils.run import uchroot_no_args
from benchbuild.utils... |
"""Experiment helpers."""
import os
from benchbuild.settings import CFG
from benchbuild.utils.cmd import mkdir # pylint: disable=E0401
from benchbuild.utils.path import list_to_path
from contextlib import contextmanager
from types import SimpleNamespace
from benchbuild import settings
import logging
import sys
def h... |
# coding: utf-8
# Copyright 2013 The Font Bakery Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... |
""" Class containing convinient shortcut for calling all things
on objects
"""
from nolang.error import AppError
from nolang.objects.root import W_None, W_Root
from nolang.objects.int import W_IntObject
from nolang.objects.bool import W_BoolObject
from nolang.objects.buffer import W_BufObject
from nolang.objects.dict ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division
from django.conf import settings
import os.path
import errno
import logging
import time
import datetime
import shutil
import re
import types
logger = logging.getLogger("kpcc_backroom_handshakes")
class Framer(object):
"""
"""
... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... |
from __future__ import division, print_function
import os, time, sys
sys.path.insert(0,'../') # path.abspath(path.join(__file__ ,".."))
from io_util import make_dir, remove_dir, tree_to_json, write_json, myopen
import numpy as np
import math
from subprocess import CalledProcessError, check_call, STDOUT
from pprint impo... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
#... |
#!/usr/bin/env python3
import threading
import time
class Widget():
"""
Basic Widget
"""
#: cache the content after update
_content = None
#: background for the widget
bg = None
#: foreground for the widget
fg = None
#: padding
padding = 0
#: list of fonts index used
... |
#
# Module implementing synchronization primitives
#
# multiprocessing/synchronize.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistribution... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
from rest_framework import permissions
from rest_framework.compat import is_authenticated
class CustomUserAPIPermission(permissions.BasePermission):
"""
Set custom permission for UserAPI
* GET : only accessible by admin
* POST : is public, everyone can create a user
"""
def has_permission(... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you m... |
#!/usr/bin/env python
#
# Copyright 2014 Brian Quinlan
# See "LICENSE" file for details.
# pylint: disable=print-statement
"""Run benchmarks among the various execution modes."""
from __future__ import absolute_import
from __future__ import division
import os
import os.path
import random
import subprocess
import te... |
#!/usr/bin/env python3
# coding: utf-8
import sys
import unittest
import nozdormu.main
from nozdormu.batch import BenchBatch
from nozdormu.loader import BenchLoader
from nozdormu.suite import BenchSuite
from nozdormu.runner import BenchRunner
class BatchMock(BenchBatch):
"""Serve as a mock to load a batch from a... |
# Copyright 2015 Leon Sixt
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... |
#!/usr/bin/env python
import datetime
import json
import re
import sys
from bs4 import BeautifulSoup
import requests
"""billboard.py: Unofficial Python API for accessing music charts from Billboard.com."""
__author__ = "Allen Guo"
__license__ = "MIT"
__maintainer__ = "Allen Guo"
__email__ = "guoguo12@gm... |
#!/usr/bin/python
#
# utility to update frontmatter with list of available images
#
import CommonMark
import frontmatter
import os
def process(logohandle, logodir):
srcfile = os.path.join(logodir, "index.md")
if not os.path.isfile(srcfile):
print("WARNING: no index file for '%s' (%s)" % (logohandle... |
from cmd3.shell import command
from cloudmesh_common.logger import LOGGER
import cloudmesh
import time
from pprint import pprint
import os
import yaml
import json
# Hello World
print ("Hello, World!")
# Reading yaml file for configuration
with open('mongo-config.yaml', 'r') as f:
doc = yaml.load(f)
cloud_name = ... |
import binascii
import _dynStruct
import capstone
unsigned_int_instr = [capstone.x86.X86_INS_ADCX, capstone.x86.X86_INS_ADOX,
capstone.x86.X86_INS_DIV, capstone.x86.X86_INS_MUL,
capstone.x86.X86_INS_MULX]
xmm_regs = [xmm for xmm in range(capstone.x86.X86_REG_XMM0 - 1, capst... |
#!/usr/bin/env python
"""
A Web UI for RED, the Resource Expert Droid.
"""
import locale
import os
import sys
from urllib.parse import urlsplit
from redbot import __version__
from redbot.resource.robot_fetch import RobotFetcher
from redbot.formatter import html
from redbot.webui import RedWebUi, except_handler_fact... |
#!/usr/bin/env python
from __future__ import division
from collections import namedtuple
from random import randrange
from functools import partial
from blessed import Terminal
term = Terminal()
# a worm is a list of (y, x) segments Locations
Location = namedtuple('Point', ('y', 'x',))
# a nibble is a (x,y) Location... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from dateutil.parser import parse
from db.team import Team
from db.player import Player
from utils.player_finder import PlayerFinder
ACTIONS = [
'signed', 're-signed', 'acquired',
'announced', 'agreed', 'claimed',
'bought', 'released', 'terminated... |
import pexpect
import sys
import time
import datetime
import sqlite3
from SensorTag import *
from SensorCalcs import *
csvfile = r'testfile.csv'
#set this empty to turn off logging:
logfile = r'pexpect.log'
def usage():
print 'blepiTemp.py Usage:'
print ' blepiTemp.py'
print ''
print ' SensorTag ad... |
import pexpect
import sys
import time
import datetime
from SensorTag import *
from SensorCalcs import *
from Tkinter import *
from random import randint
csvfile = r'testfile.csv'
#set this empty to turn off logging:
logfile = r'pexpect.log'
measureHumid = True
def usage():
print 'blepisensor.py Usage:'
prin... |
# Copyright 2014 Anthony Tonns
#
# 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 w... |
import os
import sqlite3
import markdown
from slugify import slugify
from flask import Flask
from flask import request
from flask import session
from flask import g
from flask import redirect
from flask import url_for
from flask import abort
from flask import render_template
from flask import flash
from werkzeug.securi... |
import numpy as np
import scipy.special
from scipy.ndimage import center_of_mass
from .math import fit_gaussian
def find_center_by_center_of_mass(data, verbose=True, **kwargs):
try:
round = kwargs["round"]
except KeyError:
round = True
com = center_of_mass(data)
center = ... |
from django.db import models, transaction, connection
from django.utils.translation import ugettext as _
from django.conf import settings
from djmoney.models.fields import MoneyField, CurrencyField
from treebeard.ns_tree import NS_Node
from moneyed import Money, CURRENCIES
class Account(NS_Node):
INCOME = 1
E... |
import os
VERSION = '0.3-dev'
# Setting for template directory not found by app_directories.Loader. This
# allows templates to be identified by two paths which enables a template to be
# extended by a template with the same identifier.
TEMPLATE_DIR = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
... |
# coding: utf-8
import datetime
import hashlib
import mimetypes
import optparse
import os
import re
import sys
import time
import requests
from acmd import OK, SERVER_ERROR, USER_ERROR
from acmd import tool, error, log
from acmd.tools.tool_utils import get_argument, get_command
ROOT_IMPORT_DIR = "/tmp/acmd_assets_in... |
# coding: utf-8
import optparse
import sys
import time
from acmd import USER_ERROR, SERVER_ERROR
from acmd import tool, error
from acmd.tools.tool_utils import get_argument, get_command
from acmd.tools.asset_import import *
from acmd.filter import FileFilter
parser = optparse.OptionParser("acmd assets <import|touch>... |
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2017 SML
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... |
"""Tests for metadata """
from ckanext.geocat.utils import csw_mapping
from nose.tools import * # noqa
import os
from datetime import datetime
import time
import unittest
from pprint import pprint
__location__ = os.path.realpath(
os.path.join(
os.getcwd(),
os.path.dirname(__file__)
)
)
class... |
import nose
from ckanapi import LocalCKAN, ValidationError
from ckan.tests import helpers, factories
eq_ = nose.tools.eq_
assert_true = nose.tools.assert_true
class TestValidation(helpers.FunctionalTestBase):
def test_invalid_url(self):
lc = LocalCKAN()
try:
dataset = factories.Datas... |
"""The SparseL1Descent attack."""
import numpy as np
import torch
from cleverhans.torch.utils import zero_out_clipped_grads
def sparse_l1_descent(
model_fn,
x,
eps=10.0,
eps_iter=1.0,
nb_iter=20,
y=None,
targeted=False,
clip_min=None,
clip_max=None,
rand_init=False,
clip_g... |
import logging, os, sys, time, requests, json
from datetime import datetime
from multiprocessing import Process, Queue
import pandas as pd
import sqlalchemy as s
from workers.worker_base import Worker
import seaborn as sns
import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.fea... |
import numpy as np
from astropy.modeling.models import Ellipse2D
from astropy.nddata.utils import extract_array, add_array
from scipy import ndimage as nd
from log import overlap_metric
from utils import consec_split, find_nearest
from profile import _line_profile_coordinates
eight_conn = np.ones((3, 3))
class Bub... |
VERSION = (0, 2, 2)
__version__ = '.'.join(map(str, VERSION)) |
import os
from bcbio.rnaseq import (featureCounts, cufflinks, oncofuse, count, dexseq,
express, variation)
from bcbio.ngsalign import bwa, bowtie2
import bcbio.pipeline.datadict as dd
from bcbio.utils import filter_missing
from bcbio.log import logger
def rnaseq_variant_calling(samples, run_p... |
#!/usr/bin/python
import sys
import os
import shutil
import signal
import time
import random
import getpass
import re
import subprocess
import atexit
class H2OUseCloudNode:
"""
A class representing one node in an H2O cloud which was specified by the user.
Don't try to build or tear down this kind of nod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.