text stringlengths 17 737k |
|---|
# -*- coding: UTF-8 -*-
# Copyright 2015 Cloudera 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 random
import time
import string
import os.path
from kvmagent import kvmagent
from kvmagent.plugins import vm_plugin
from zstacklib.utils import lock
from zstacklib.utils import jsonobject
from zstacklib.utils import http
from zstacklib.utils import log
from zstacklib.utils import shell
from zstacklib.utils im... |
# Copyright 2011-2013 Colin Scott
# Copyright 2011-2013 Andreas Wundsam
# Copyright 2012-2012 Kyriakos Zarifis
# Copyright 2012-2013 Sam Whitlock
#
# 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 ... |
#! /usr/bin/env python
import numpy as np
from .structured import StructuredQuadGrid
class RectilinearGrid(StructuredQuadGrid):
"""
Parameters
----------
coord : tuple
Coordinates of node rows and node columns.
Examples
--------
>>> import numpy as np
>>> (y, x) = np.arange(... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import argparse
import math
import numpy
import pickle
from PIL import Image
DEBUG_TEST_EIGENSPACE = False
"""
./eigenimage.py ./img/train-png/*-[123]*.png
"""
def get_k_limit(sigma):
klimit = 1
last_eigenvalue = 0
eigenvalues = numpy.nditer(sigma, flags=[... |
import os
from flask import Flask
from flask import render_template
from flask import request, redirect, url_for
from werkzeug import secure_filename
import hashlib
from pymongo import Connection
from bson.code import Code
import dpkt
import sys
import socket
from celery import Celery
import requests
from requests... |
import urllib
from operator import attrgetter
from django.conf import settings
from django.db.models import Sum, Q
from django.utils.translation import ugettext as _
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.views.generic import ListView
from django.core.cache import cache
from dj... |
"""
Django settings for iotdemo project.
Generated by 'django-admin startproject' using Django 1.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
i... |
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 24 18:22:54 2014
@author: chuong
"""
from __future__ import absolute_import, division, print_function
import sys
import time
from PyQt4 import QtGui, QtCore, uic
from functools import partial
import yaml
import os
import numpy as np
import scipy.misc as misc
import urll... |
#!/usr/bin/env python
#
# @file ValidationRulesForClass.py
# @brief class to generate the validation rules for a particular class
# @author Frank Bergmann
# @author Sarah Keating
#
# <!--------------------------------------------------------------------------
#
# Copyright (c) 2013-2015 by the California Institu... |
"""
Searcjing for names with given scope and name. This is very central in Jedi and
Python. The name resolution is quite complicated with descripter,
``__getattribute__``, ``__getattr__``, ``global``, etc.
Flow checks
+++++++++++
Flow checks are not really mature. There's only a check for ``isinstance``. It
would ch... |
#!/usr/bin/env python
import web
import xml.etree.ElementTree as ET
import sys, getopt, os, json, mapnik2, tempfile, urllib2, cPickle, shutil, zlib
import math
import sqlite3 as lite
import re
import glob
from subprocess import Popen, PIPE
from xml.dom import minidom
from shutil import copyfile
try:
f... |
from IPy import IP
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy
from django.db import models, connection
from django.db.models import sql, query
# FIXME decide if we should use custom lookup names instead of overrides.
# FIXME decide if other "standard" lookups... |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013-2018 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
"""The Assets... |
#!/usr/bin/env python
import argparse
import atexit
import json
import linecache
import os
import platform
import re
import ssl
import subprocess
import sys
import urllib2
REVIEWBOARD_REVIEW_URL = 'https://reviews.apache.org/r'
REVIEWBOARD_API_URL =\
'https://reviews.apache.org/api/review-requests'
REVIEWBOARD_USER... |
import logging
from rest_framework import serializers
from .models import UserAmbulancePermission, UserHospitalPermission, Client
from .permissions import get_permissions
logger = logging.getLogger(__name__)
# Profile serializers
class AmbulancePermissionSerializer(serializers.ModelSerializer):
ambulance_id ... |
# -*- coding: utf-8 -*-
"""
longboxed.helpers
~~~~~~~~~~~~~~~~
longboxed helpers module
"""
import pkgutil
import importlib
from datetime import datetime, timedelta
from HTMLParser import HTMLParser
from flask import Blueprint
from json import JSONEncoder as BaseJSONEncoder
def register_blueprints(app... |
"""Plots tornado reports, storm tracks, and linkages."""
import os.path
import argparse
import numpy
import pandas
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as pyplot
from gewittergefahr.gg_io import tornado_io
from gewittergefahr.gg_utils import linkage
from gewittergefahr.gg_utils import time_... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import re
import sys
from io import open
from os.path import isdir, isfile, join
from conda.compat import iteritems, PY3
from conda.utils import memoized, md5_file
import conda.config as cc
from cond... |
''' -- imports from python libraries -- '''
# import os -- Keep such imports here
import datetime
import csv
import time
import ast
import json
import math
import multiprocessing
''' -- imports from installed packages -- '''
from django.http import HttpResponseRedirect
from django.http import HttpResponse
from django... |
# coding=utf-8
import logging
import os
from subliminal.providers.argenteam import ArgenteamProvider as _ArgenteamProvider, \
ArgenteamSubtitle as _ArgenteamSubtitle, json, ZipFile, io, sanitize, sanitize_release_group, \
get_equivalent_release_groups, guess_matches, guessit, Session
from subliminal_patch.prov... |
"""Module for querying SymPy objects about assumptions."""
import inspect
from sympy.core import sympify
from sympy.utilities.source import get_class
from sympy.assumptions import global_assumptions, Predicate
from sympy.assumptions.assume import eliminate_assume
from sympy.logic.boolalg import to_cnf, And, Not, Or, Im... |
# Copyright (C) 2019 OpenMotics BV
#
# 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 option) any later version.
#
# This program is distribu... |
"""
This module contain solvers for all kinds of equations:
- algebraic or transcendental, use solve()
- recurrence, use rsolve()
- differential, use dsolve()
- nonlinear (numerically), use nsolve()
(you will need a good starting point)
"""
from sympy.core.compatibility import iterable, is_s... |
#-------------------------------------------------------------------------------
# This file is part of PyMad.
#
# Copyright (c) 2011, CERN. 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 obta... |
# -*- coding: utf-8 -*-
# Copyright 2019 New Vector 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 la... |
from __future__ import print_function
import threading
import time
import syncplay
import os
import re
from syncplay import utils
class ConsoleUI(threading.Thread):
def __init__(self):
self.promptMode = threading.Event()
self.PromptResult = ""
self.promptMode.set()
self._syncplayCl... |
import yaml
import logging
import os
def loadYaml(filename):
with open(filename, 'r') as yaml_file:
return yaml.load(yaml_file)
def dumpYaml(filename, obj):
with open(filename, 'w') as yaml_file:
yaml.dump(obj, yaml_file, default_flow_style=False)
def write(filename, content):
with open(f... |
from __future__ import print_function
import pytest
import torch
from torch import nn as nn
from torch.autograd import Variable
from torch.nn import Parameter
import pyro
import pyro.distributions as dist
from pyro.distributions.transformed_distribution import TransformedDistribution
from tests.distributions.test_tra... |
import numpy
import pytest
import xchainer
import xchainer.testing
from tests import array_utils
# Skip if creating an ndarray while casting the data to the parameterized dtype fails.
# E.g. [numpy.inf] to numpy.int32.
def _to_array_safe(xp, a_object, dtype):
try:
return xp.array(a_object, dtype)
ex... |
# coding: utf-8
from __future__ import absolute_import
import wrapt
import opentracing
import types
from ..log import logger
from ..singletons import tracer
try:
import pika
def _extract_broker_tags(span, conn):
span.set_tag("address", "%s:%d" % (conn.params.host, conn.params.port))
def _ext... |
from tcga_encoder.utils.helpers import *
from tcga_encoder.data.data import *
from tcga_encoder.definitions.tcga import *
#from tcga_encoder.definitions.nn import *
from tcga_encoder.definitions.locations import *
#from tcga_encoder.algorithms import *
import seaborn as sns
from sklearn.manifold import TSNE, locally_li... |
# hom2m.py: Simple Harmonic-Oscillator M2M implementation
import numpy
import copy
from scipy import interpolate, integrate
######################### COORDINATE TRANSFORMATIONS ##########################
def zvz_to_Aphi(z,vz,omega):
A= numpy.sqrt(z**2.+vz**2./omega**2.)
phi= numpy.arctan2(-vz/omega,z)
retu... |
#!/usr/bin/env python
#
# pytrader.py
#
#
# Project page
# https://github.com/jmkangkr/pyTrader
#
# To clone the project
# git clone https://github.com/jmkangkr/pyTrader.git
#
# Please send bugs to
# Jaemin Ka... |
from datetime import datetime, timedelta
from django import forms
from produto.models import ProdutoItem
from systextil.models import Colecao, Familia
class LoteForm(forms.Form):
lote = forms.CharField(
label='Lote', max_length=9, min_length=9,
widget=forms.TextInput(attrs={'type': 'number',
... |
#!/usr/bin/env python3
# regainer - advanced ReplayGain tagging
# Copyright 2016 Calvin Walton <calvin.walton@kepstin.ca>
#
# 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 restrictio... |
#!/usr/bin/env python
import ftplib
import pifacedigitalio
import time
from time import sleep
DELAY = 1.0 # seconds
count = 0
pump_start_time = 0
pump_stop_time = 0
pump_interval = 0
vacuum_status = 'NA'
pfd = pifacedigitalio.PiFaceDigital()
pifacedigitalio.init()
def tank_full(event):
if pfd.leds[0].value == 0:
... |
#!/usr/bin/env python2
'''Render volumetric render of a sclr.py output files.
Usage:
render3d.py [options] IN_FORMAT OUT_FORMAT LABEL_FORMAT <lownum> <highnum> [<step>]
render3d.py [options] (--plot-single | -s) INFILE
Options:
--min=MIN -n MIN Set vmin in the volumetric plot to MIN.
--max=MAX ... |
import json
import os
import tornado.httpserver
import tornado.ioloop
import tornado.web
from tornado import escape
from collections import defaultdict
from playhouse.shortcuts import model_to_dict, dict_to_model
from model.gastomodel import Gasto
from model.realizadomodel import Realizado
from connection import db
"... |
# -*- coding: utf-8 -*-
from __future__ import division
import numpy as np
import math
from cea.demand import constants
__author__ = "Gabriel Happle"
__copyright__ = "Copyright 2016, Architecture and Building Systems - ETH Zurich"
__credits__ = ["Gabriel Happle"]
__license__ = "MIT"
__version__ = "0.1"
__maintainer__... |
import getpass
import logging
import os
import subprocess
from time import sleep
import redis
logger = logging.getLogger(__name__)
port = 25530
DEVNULL = open(os.devnull, 'wb')
CURRENT_USER = getpass.getuser()
if CURRENT_USER == 'travis':
SLEEP_TIME = 3
else:
SLEEP_TIME = .5
class Manager(object):
def... |
"""
Custom job model.
Consists on a user-provided jar to be deployed on the cluster.
"""
import logging
from os import makedirs, path
from django.conf import settings
from models import Job, JobModel
LOGGER = logging.getLogger(__name__)
def handle_upload(job, upload):
"""
Accepts the upload file and moves... |
#*****************************************************#
# This file is part of GRIDOPT. #
# #
# Copyright (c) 2015-2016, Tomas Tinoco De Rubira. #
# #
# GRIDOPT is released under the BSD 2-cl... |
"""vbtournaments URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cla... |
# Dependencies: install M2Crypto with sudo apt-get install
# python-m2crypto
import logging
import M2Crypto
import ssl
import threading
import time
def get_fingerprint(host, port=443, external=None, log_prefix=''):
tls_error = None
fingerprint_error = None
cert = None
logging.debug("%sGetting TLS ce... |
# coding: utf-8
# maposmatic, the web front-end of the MapOSMatic city map generation system
# Copyright (C) 2018 Hartmut Holzgraefe
# 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, eit... |
import base64
import datetime
import json
import random
import string
import time
from django.apps.registry import Apps
from django.db import DEFAULT_DB_ALIAS, connections, models, transaction
from django.db.utils import OperationalError
from django.utils import six
from django.utils.functional import cached_property
... |
""" Apply Quality Control of CTD profiles
"""
import pkg_resources
from datetime import datetime
from os.path import basename
import re
import json
import logging
import numpy as np
from numpy import ma
from seabird import cnv
from seabird.exceptions import CNVError
#from seabird.utils import basic_logger
logging.ba... |
# coding=utf-8
from __future__ import unicode_literals
from io import BytesIO
from .marc import Record
from .util import etree, parse_xml, show_diff
class Bib(object):
""" An Alma Bib record """
def __init__(self, alma, xml):
self.alma = alma
self.orig_xml = xml.encode('utf-8')
sel... |
# coding: utf-8
import random, math
import re
import time
from uuid import uuid4, UUID
from dtest import PyTester as Tester
from pyassertions import assert_invalid, assert_one, assert_none, assert_all
from cql import ProgrammingError
from pytools import since, require, rows_to_list
from cassandra import ConsistencyLe... |
from collections import defaultdict
import time
import Shapes
import Colors
import lsdisplay
# TODO: Custom error handlers
def validateFrame(frame):
# print(repr(frame)) # Debugging
frameLen = len(frame) - 1
if frameLen % 3 is not 0:
return False
cells = frameLen/3
if (cells/frame[0]).is_... |
from __future__ import print_function
import time
import logging
import pprint
import math
import os
import cPickle
import cPickle as pickle
import sys
import numpy
import matplotlib
from lvsr.algorithms import BurnIn
from blocks_extras.extensions.embed_ipython import EmbedIPython
matplotlib.use('Agg')
import theano
f... |
import random
from enchantments import Tricked
from traits import Lazy, Sneaky, Determined
from materials import Boulder
from enchantments import SaboteurSpell, Firestarter, Frozen, SleepSpell
from actions import ExploreAction, SleepAction, GoToAction, AttackAction
from allegiance import Allegiance
class Creature:
... |
#! /usr/bin/python
import sys, os
from PySide import QtGui, QtCore
import serial
import platform, glob
class uiClass(QtGui.QWidget):
def __init__(self):
super(uiClass, self).__init__()
self.initUI()
def initUI(self):
self.connectButton = QtGui.QPushButton("Connect")
self.... |
import cgi
import os
import os.path
import re
from PIL import Image
from lxml import etree
from lxml.etree import XMLSyntaxError
from collections import namedtuple, defaultdict
from zipfile import ZipFile, BadZipfile
from docx2html.exceptions import (
ConversionFailed,
FileNotDocx,
MalformedDocx,
Unin... |
#!/usr/bin/python
## Binary Analysis Tool
## Copyright 2015 Armijn Hemel for Tjaldur Software Governance Solutions
## Copyright 2015 Black Duck Software, Inc. All Rights Reserved.
## Licensed under Apache 2.0, see LICENSE file for details
'''
This is a plugin to create JSON output of all results of the Binary Analysi... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Name: Project.py
# Purpose:
#
# Author: Fabien Marteau <fabien.marteau@armadeus.com>
#
# Created: 24/04/2008
# Licence: GPLv3 or newer
#
# -------------------------------------------------... |
'''
Created on Aug 19, 2012
@author: mchrzanowski
'''
import Problem105
import time
def main():
acceptable_groups = list()
# since n = 6:
# 11 (middle from n = 5), 18 (11 + 6 + 1),
# 19 (11 + 9 - 1), 20 (11 + 11 - 2), 22 (11 + 12 - 1),
# 25 (11 + 13 + 1)
# I make the guess that n = 7 is i... |
from Client import Client
from Server import Server
class Rammbock(object):
def __init__(self):
self._client = Client()
self._server = Server()
def start_udp_server(self, nwinterface, port):
self._server.server_startup(nwinterface, port, 'UDP')
def start_tcp_server(self, nwinterf... |
from django.contrib import admin
from django import forms
from django.conf.urls import url
from django.shortcuts import render
from django.db.models.fields import BLANK_CHOICE_DASH
from django.core.urlresolvers import reverse
from tabbed_admin import TabbedModelAdmin
from .models import Driver, Team, Competition, Ci... |
from __future__ import absolute_import
import copy
import logging
import socket
import sys
import time
from kafka.vendor import six
from kafka.client_async import KafkaClient, selectors
from kafka.consumer.fetcher import Fetcher
from kafka.consumer.subscription_state import SubscriptionState
from kafka.coordinator.c... |
from enum import Enum
from typing import ( # noqa: F401, imported for Mypy.
Any,
Callable,
Dict,
FrozenSet,
Mapping,
Optional,
Sequence,
Set,
Tuple,
Type,
TypeVar,
)
from attr import fields, resolve_types
from ._compat import (
get_origin,
is_bare,
is_frozenset... |
from psychopy import visual, core, event, gui, data
import math
import time
#python tcp_send_1d.py -infile=test.1D -tcphost=127.0.0.1 -tcpport=8000 -delay=0.5
def quit():
log_file.close()
conn.close()
s.close()
win.close()
core.quit()
LUMINA = 0
LUMINA_TRIGGER = 4
## initialize communication w... |
#!/usr/bin/env python
"""mjscore.py: Parse mjstat.txt and produce some statistics.
Usage:
mjscore.py [--help] [--version]
mjscore.py [--today] [--verbose] [--input <FILE> ...]
[-l | --language <langspec>]
[-T | --target <playerspec>]
[-c | --config <FILE>]
"""
from argparse import ArgumentParser
from ... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from contextlib import closing
from filecmp import cmp
from multiprocessing.pool import ThreadPool
from operator import attrgetter
from os.path import exists
from .structs import DupType, FileDups, FileInfo, SkipException
from .utils import (_walk, blksi... |
# -*- coding: utf-8 -*-
"""This module contains class objects for all supported DynDNS Record types
These DNS_Records should really only need to be created via a zone instance but
could also be created independently if passed valid zone, fqdn data
"""
from .errors import DynectInvalidArgumentError
from .session import... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2015 by Ecpy Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# ---------------------... |
from __future__ import absolute_import
from git.repo import Repo
import kenja.singles as singles
from kenja.historage import *
from kenja.git.diff import GitDiffParser
from collections import defaultdict
def parse_added_lines(added_lines, method_name):
num_args_list = []
return num_args_list
def detect_extrac... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import sys
class Hpx(CMakePackage, CudaPackage):
"""C++ runtime system for parallel and distrib... |
import configparser
import csv
import datetime
import lzma
import math
import os
import re
from io import StringIO
from itertools import chain
from multiprocessing import Pool
from shutil import copyfile
from urllib.parse import parse_qs, urlencode, urlparse
import grequests
import pandas as pd
import requests
from ge... |
from __future__ import absolute_import
"""
kombu.transport.qpid
=======================
qpid transport.
"""
"""Kombu transport using the Django database as a message store."""
import os
import uuid
import base64
import threading
import Queue
from time import clock
from itertools import count
from multiprocessing.u... |
#!/usr/bin/python
"""Module CNN layer 2 hyperparameter optimization evaluation for Multiple GPUs.
A Convolutional Network implementation example using TensorFlow library.
This example is using the MNIST database of handwritten digits
(http://yann.lecun.com/exdb/mnist/)
Author: Aymeric Damien
Project: https://github.c... |
author = 'Gu Ye <cooyeah at gmail dot com>'
name = 'IPython console'
desc = 'IPythonView plugin for snaked editor'
import gtk
from ipython_view import IPythonView
import pango
import sys
import os
class SnakedIPythonView(IPythonView):
def __init__(self):
IPythonView.__init__(self)
#self.IP.autoind... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, flt, cint, nowdate, add_days, comma_and
from frappe import msgprint, _
from frappe.model.document import ... |
# Copyright 2011 OpenStack LLC.
# Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 Piston Cloud Computing, 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 a... |
from __future__ import unicode_literals
import os
import sys
from warnings import warn
from django.conf import global_settings as defaults
from django.template.base import add_to_builtins
from mezzanine.utils.timezone import get_best_local_timezone
class SitesAllowedHosts(object):
"""
This is a fallback fo... |
import array
import logging
import numpy
import os
import six
import ujson as json
from bisect import bisect_left
from leveldb import LevelDB
from itertools import izip, groupby
from geodata.coordinates.conversion import latlon_to_decimal
from geodata.file_utils import ensure_dir
from geodata.osm.extract import *
fro... |
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Written (W) 2012 Heiko Strathmann
# Copyright (C) 2012 Berlin Inst... |
'''
main.py
A module that contains the main forklift pallets for deq
Note: There is a separate scheduled task that runs this pallet for SGID10.ENVIRONMENT.DAQAirMonitorByStation
on an hourly basis.
'''
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from os import path
import arc... |
#!/usr/bin/env python2.7
"""
parallelMappingEvaluation.py: Run the mapping evaluation on all the servers in
parallel.
BAM files with reads must have been already downloaded.
"""
import argparse, sys, os, os.path, random, subprocess, shutil, itertools, glob
import doctest, re, json, collections, time, timeit
import l... |
#!/usr/bin/env python
'''Access the make-magic HTTP API
contains both make-magic HTTP API access and the policy for dealing with the same
'''
import requests
import json
import random
from constants import *
import config
class MagicError(Exception):
def __init__(self, error, description):
s... |
# coding: utf-8
from base64 import b64encode
import functools
import re
from flask.ext import login
from flask.ext.oauthlib import client as oauth
from google.appengine.api import urlfetch
from google.appengine.api import users
from google.appengine.ext import ndb
from werkzeug import urls
import flask
import unideco... |
"""
Author: Dan McGlinn
Date: 9/21/11
Purpose: to generate spatial community data using the random bisection
scheme and the MaxEnt (i.e., log-series) SAD. The output is a comma
delimited .txt file site x species matrix the first three rows specify
community #, quadrat x coordinate, and quadrat y coordinate. This is
de... |
def initParser(subparsers, base_parser):
import argparse
parser = subparsers.add_parser('msmt_5tt', parents=[base_parser], help='Derive MSMT CSD responses based on a co-registered 5TT image')
arguments = parser.add_argument_group('Positional arguments specific to the \'msmt_5tt\' algorithm')
arguments.add_argum... |
# coding: utf-8
import os
import os.path
import mimetypes
import time
import random
import string
import datetime
import collections
from contextlib import closing
import pytz
import requests
from requests.models import urlencode
import dateutil
import dateutil.parser
import re
import copy
import threading
import sys
... |
"""
Maintain configuration data for the MicroPsi service
The configuration manager takes care of persisting config data for the different MicroPsi components.
At the moment, persistence is achieved with a simple file, into which config data is dumped in json format.
All configuration data is simply stored as a dictio... |
from __future__ import unicode_literals, absolute_import
from django import template
from django.core.urlresolvers import reverse, NoReverseMatch
from django.http import QueryDict
from django.utils.html import escape
from django.utils.safestring import SafeData, mark_safe
from rest_framework.compat import urlparse, for... |
"""
Auxiliary functions for nIRanalysis
"""
import re
import os
import errno
import numpy as np
import matplotlib.pyplot as plt
from eniric.IOmodule import pdread_2col
def read_spectrum(spec_name):
""" Function that reads a flux spectra from the database!.
If a energy flux spectra is read then it converts ... |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2014 Alex Forencich
Copyright (c) 2015 Rikard Lindstrom
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 restricti... |
from subprocess import check_call
from os import path, makedirs, listdir, sep
def snapshot(source, destination, name=None):
"""Snapshot one directory to another. Specify names to snapshot small, named differences."""
source = source + sep
destination = destination + sep
if not path.isdir(source):
... |
#! /usr/bin/env python3
from utils import *
import argparse
import csv
import random
def compile_and_run(csv_writer,
large1, dense1, large2, dense2,
copy_on_write, run_containers,
amalgamation, gcc_optimization, avx_enabled):
init_directory(BUILD_DIR)
compile_exec(amalgamation, gcc_opti... |
import rospy, tf, math, numpy, copy
from nav_msgs.msg import OccupancyGrid #format for reading the map. Data is stored by row.
from nav_msgs.msg import GridCells #format for publishing to rviz display
from geometry_msgs.msg import PoseWithCovarianceStamped #format for reading the start and goal points
from geometry_ms... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import inspect
import frappe
from erpnext.hooks import regional_overrides
from frappe.utils import getdate
__version__ = '10.1.37'
def get_default_company(user=None):
'''Get default company for user'''
from frappe.defaults import get_user_default_as_li... |
import numpy as np
def unique_rows(ar):
"""Remove repeated rows from a 2D array.
Parameters
----------
ar : 2D np.ndarray
The input array.
Returns
-------
ar_out : 2D np.ndarray
A copy of the input array with repeated rows removed.
Raises
------
ValueError : ... |
# coding: utf8
# Python standard library.
from urlparse import urlparse
import locale
import logging
# External packages.
from opbeat.contrib.flask import Opbeat
from opbeat.handlers.logging import OpbeatHandler
from social_core import exceptions as social_exceptions
from social_flask_sqlalchemy.models import init_so... |
"""
homeassistant.components.influx
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
InfluxDB component which allows you to send data to an Influx database.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/influx/
Configuration:
influx:
host: localhost
port: 8086
... |
from itertools import cycle
def cycled(arr=None):
if not arr:
return list()
pool = cycle(arr)
for item in pool:
yield item
if __name__ == "__main__":
l = ["a", "b", "c"]
inf = cycled(l)
for _ in range(6):
print(next(inf))
|
"""
Support for Modbus.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/modbus/
"""
import logging
import threading
import os
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.config import load_yaml_confi... |
#!/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... |
from . import config
from .actions import (IdCardPrepareAction, IdCardFinishAction, SignCompleteAction, MobileIdSignAction, MobileIdStatusAction, BaseAction,
MobileIdAuthenticateAction, MobileIdAuthenticateStatusAction)
from .digidocservice.service import DigiDocService, DigiDocError
from .respons... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.