text stringlengths 17 737k |
|---|
#!/usr/bin/env python
# Based on previous work by
# Charles Menguy (see: http://stackoverflow.com/questions/10217067/implementing-a-full-python-unix-style-daemon-process)
# and Sander Marechal (see: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/)
# Adapted by M.Hendrix [2015,2016]
# daem... |
from arcpy import ListFields,Describe, SetProgressorLabel,SetProgressorPosition,GetCount_management,SetProgressor,AddMessage,SpatialReference,SearchCursor
from csv import DictWriter
from json import dump
#uncomment the following line and comment the final line to use in the console
#arcpy.env.workspace = os.getcwd(... |
# coding=utf-8
from __future__ import unicode_literals
from collections import defaultdict
from locale import getlocale
from logging import getLogger
from cached_property import threaded_cached_property
from future.utils import raise_from, python_2_unicode_compatible
from six import text_type, string_types
from .aut... |
# Copyright 2011-2013 Colin Scott
# Copyright 2011-2013 Andreas Wundsam
#
# 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... |
#!python
"""\
Easy Install
------------
A tool for doing automatic download/extract/build of distutils-based Python
packages. For detailed documentation, see the accompanying EasyInstall.txt
file, or visit the `EasyInstall home page`__.
__ http://peak.telecommunity.com/DevCenter/EasyInstall
"""
import sys, os.path,... |
#!/usr/bin/env python
# Based on previous work by
# Charles Menguy (see: http://stackoverflow.com/questions/10217067/implementing-a-full-python-unix-style-daemon-process)
# and Sander Marechal (see: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/)
# Adapted by M.Hendrix [2015]
# daemon99.... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright (c) 2015, Matthew Brennan Jones <matthew.brennan.jones@gmail.com>
# Copyright (c) 2008-2011, Kenneth Bell https://discutils.codeplex.com
# A module for reading DVD ISOs (Universal Disk Format) with Python 2 & 3
# See Universal Disk Format (ISO/IEC 13346 and ECM... |
# coding=utf-8
from __future__ import unicode_literals
import logging
from future.utils import python_2_unicode_compatible
from six import string_types
from .errors import ErrorAccessDenied, ErrorCannotDeleteObject
from .fields import IntegerField, TextField, DateTimeField, FieldPath, EffectiveRightsField, MailboxFi... |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
import numpy as np
import matplotlib.pyplot as plt
from mypy.utils import get_info, find_index, find_range
# TODOs:
# MultiDimView:
# - [ ] add colorbar
# - [ ] add topo view
# - [ ] clickable topo view
# - [ ] cickable (blockable) color bar
# - [ ] add window select
# SignalPlotter:
# - [ ] design object API (similar... |
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 21 13:09:30 2016
@author: Alex Kerr
Define the Molecule class and a set of functions that `build' preset molecules.
"""
import numpy as np
#from numpy import array,full
from .forcefield import forcefieldList
#default values
defaultFF = forcefieldList[0]() #Amber
#cha... |
from collections import OrderedDict, MutableMapping
def flatten(d, separator='_', parent_key=None):
"""
Converts a nested hierarchy of key/value object (e.g. a dict of dicts) into a flat (i.e. non-nested) dict.
:param d: the dict (or any other instance of collections.MutableMapping) to be flattened.
... |
#
# Project:
# glideinWMS
#
# File Version:
#
# Description:
# This module implements the functions needed to keep the
# required number of idle glideins
# It also has support for glidein sanitizing
#
# Author:
# Igor Sfiligoi (Sept 7th 2006)
#
import os
import sys
import time
import re
import pwd
import bin... |
#coding=utf-8
import re
from urlparse import urlparse
class ExtractLevelDomain():
def __init__(self):
self.topHostPostfix = [
'.com','.la','.io',
'.co', '.cn','.info',
'.net', '.org','.me',
'.mobi', '.us', '.biz',
'.xxx', '.ca', '.co.jp',
... |
# Scalar functions.
import numpy as np
import struct
def signed(x):
if type(x) == np.uint8:
return np.int8(x)
elif type(x) == np.uint16:
return np.int16(x)
elif type(x) == np.uint32:
return np.int32(x)
else:
return np.int64(x)
def unsigned(x):
if type(x) == np.int8:
return np.uint8(x)
... |
#!/usr/bin/env python2.5
#
# Copyright 2010 the Melange authors.
#
# 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 applic... |
#!/usr/local/bin/python
# Code Fights Digit Degree Problem
def digitDegree(n):
degree = 0
if n < 10:
return 0
while n > 0:
dig = n % 10
n = n // 10
if dig > 0:
degree += 1
return degree
def main():
tests = [
[5, 0],
[100, 1],
[9... |
"""
Easy Install
------------
A tool for doing automatic download/extract/build of distutils-based Python
packages. For detailed documentation, see the accompanying EasyInstall.txt
file, or visit the `EasyInstall home page`__.
__ https://setuptools.readthedocs.io/en/latest/easy_install.html
"""
from glob import gl... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2014, GEM Foundation.
#
# OpenQuake 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... |
import json
import requests
from botkey import Key
class DictionaryReader:
def __init__(self):
self.file = 'dictEntries.txt'
self.dictionary = {}
self.loadDict()
self.loop = 0
def loadDict(self):
try:
with open(self.file, 'r') as f:
... |
#!/usr/bin/env python
'''
Provides classes for loading chunk files from local storage and
putting them out into local storage.
.. This software is released under an MIT/X11 open source license.
Copyright 2012-2014 Diffeo, Inc.
'''
from __future__ import absolute_import, division, print_function
from cStringIO impor... |
from nose.tools import eq_
from mhctools import NetMHCpan
# Defining FileNotFoundError for Python 2.x
try:
FileNotFoundError
except NameError:
FileNotFoundError = IOError
DEFAULT_ALLELE = 'HLA-A*02:01'
protein_sequence_dict = {
"SMAD4-001": "ASIINFKELA",
"TP53-001": "ASILLLVFYW"
}
# Tests will als... |
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
#
# Opserver
#
# Operational State Server for VNC
#
from gevent import monkey
monkey.patch_all()
try:
from collections import OrderedDict
except ImportError:
# python 2.6 or earlier, use backport
from ordereddict import OrderedDict
from ... |
import pytest
from awx.main.models.jobs import JobTemplate
from awx.main.models import Inventory, Credential, Project
from awx.main.models.workflow import (
WorkflowJobTemplate, WorkflowJobTemplateNode, WorkflowJobInheritNodesMixin,
WorkflowJob, WorkflowJobNode
)
import mock
class TestWorkflowJobInheritNodesM... |
# -*- coding: utf-8 -*-
# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END
import time
import json
import asyncpg
import http.client
import pytest
import asyncio
__author__ = "Vaibhav Singhal"
__copyright__ = "Copyright (c) 2017 OSIsoft, LLC"
__license__ = "Apache 2.0"
__version__ = "${VERSION}"
#... |
#!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License");... |
"""Constants used by Home Assistant components."""
MAJOR_VERSION = 0
MINOR_VERSION = 114
PATCH_VERSION = "0b3"
__short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}"
__version__ = f"{__short_version__}.{PATCH_VERSION}"
REQUIRED_PYTHON_VER = (3, 7, 1)
# Truthy date string triggers showing related deprecation warning mes... |
from subprocess import check_output, STDOUT, CalledProcessError
from json import loads
import sys
def die(message):
sys.stderr.write(message + "\n")
sys.exit(1)
class Inspector(object):
def __init__(self, container, no_name, pretty):
self.container = container
self.no_name = no_name
... |
import logging
import config
from haproxycfg import run_haproxy, Haproxy
from utils import get_uuid_from_resource_uri
logger = logging.getLogger("haproxy")
def on_cloud_event(event):
logger.debug(event)
logger.debug(Haproxy.cls_linked_services)
# When service scale up/down or container start/stop/termin... |
#
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS
# FOR A PARTICULAR PURPOSE. THIS CODE AND INFORMATION ARE NOT SUPPORTED BY XEBIALABS.
#
import sys, string, time, traceba... |
# Standard imports
import logging
import os
import sys
from subprocess import Popen
#Tornado
import tornado.httpserver
import tornado.httpclient
import tornado.ioloop
import tornado.web
from tornado.options import define, parse_command_line, options
# agent import
from config import get_config, get_system_stats, get_... |
# -*- coding: utf-8 -*-
#
# Copyright 2015, Foxugly. 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 published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any late... |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
import requests
from django.test import TestCase
from museum_site.common import *
from museum_site.constants import *
from museum_site... |
import sys
import csv
csv.field_size_limit(sys.maxsize)
import time
from collections import defaultdict
import math
DELIMITER = "\t"
class MutualInfo:
INPUTFILE_PAIRS = 'cooccurences.csv'
INPUTFILE_FREQUENCY = 'freq.csv'
def __init__(self):
self.pairs_file_name = self.INPUTFILE_PAIRS
se... |
#######################################################################
# Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #
# Permission given to modify the code as long as you keep this #
# declaration at the top #
################################... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2011, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenQuake is distributed in the hope that it will be ... |
#!/usr/bin/python
# -*- coding: utf8 -*-
#Useful module for grabbing data from Amazon Redshift and manipulating it
# - Most functions either have a docstring or are fairly self explanatory
# - There's another module needed called login but that contains a password
# so isn't listed here.
# - All functions require a cu... |
"""
Django settings for suorganizer project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build pa... |
# Copyright 2012 Nokia Siemens Networks Oyj
#
# 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/python
import sys, os, tempfile
from datetime import datetime
import Queue, threading
import random, time
# just simulate the splitting by sleeping for a randome number of seconds,
# used to test mutoprocess handling
simulate = False
# You should not need to change anything below this line.
# -------------... |
#! /usr/bin/python
# Released as open source by NCC Group Plc - https://www.nccgroup.trust/uk/
# https://github.com/nccgroup/redsnarf
# Released under Apache V2 see LICENCE for more information
import os, argparse, signal, sys, re, binascii, subprocess, string, SimpleHTTPServer, multiprocessing, SocketServer
import so... |
#!/usr/bin/env python
#
# Copyright 2015-2015 breakwa11
#
# 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... |
import re
from collections import OrderedDict
__version__ = "0.4.7"
class Attr(OrderedDict):
pattern = re.compile(r"([\w\-\.:]+?)\s*=\s*(\"[^\"&<]+?\"|\'[^\'&<]+?\')")
def __init__(self, attr_str):
super(Attr, self).__init__()
if attr_str:
for hit in self.pattern.finditer(attr_s... |
import json
import os
from mock import patch
from django.core.urlresolvers import reverse
from django.test import TestCase
from myhpom.models import CloudFactoryDocumentRun
from myhpom.tests.factories import CloudFactoryDocumentRunFactory
CF_PATH = os.path.join(os.path.dirname(__file__), 'fixtures', 'cloudfactory')
SU... |
from __future__ import print_function
# Standard library imports
from collections import namedtuple
import sys
import time
import uuid
# System library imports
from pygments.lexers import PythonLexer
from IPython.external import qt
from IPython.external.qt import QtCore, QtGui
# Local imports
from IPython.core.input... |
import os
ROOT = os.path.abspath(os.path.dirname(__file__))
DEBUG = int(os.environ.get("MYSQLAPI_DEBUG", 1)) != 0
TEMPLATE_DEBUG = DEBUG
ADMINS = ()
MANAGERS = ADMINS
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3", # Add "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
"... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2014-2021 GEM Foundation
#
# OpenQuake 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 Licen... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Irmt
A QGIS plugin
OpenQuake Social Vulnerability and Integrated Risk
-------------------
begin : 2017-08-30
copyright ... |
"""
Tools for manipulating and converting unstructured grids in a range of formats.
"""
from __future__ import print_function
import sys
import inspect
import multiprocessing
import numpy as np
from matplotlib.tri.triangulation import Triangulation
from matplotlib.tri import CubicTriInterpolator
from warnings import... |
from __future__ import absolute_import
from __future__ import unicode_literals
from copy import copy
from datetime import datetime
from decimal import Decimal
import uuid
from django.test import SimpleTestCase, TestCase
from mock import patch
from casexml.apps.case.tests.util import delete_all_ledgers, delete_all_xf... |
# -*- coding: utf-8 -*-
# Copyright 2018 Tecnativa - Pedro M. Baeza
# Copyright 2018 Opener B.V. - Stefan Rijnhart
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
import logging
import functools
from psycopg2 import sql
from psycopg2 import ProgrammingError, IntegrityError
from psycopg2.errorcodes imp... |
# Monocyte - Search and Destroy unwanted AWS Resources relentlessly.
# Copyright 2015 Immobilien Scout GmbH
#
# 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/licens... |
from datetime import date, timedelta
from celery import current_task, current_app
from celery.schedules import crontab
from celery.task import periodic_task, task
from celery.signals import after_task_publish
from casexml.apps.phone.cleanliness import set_cleanliness_flags_for_all_domains
from casexml.apps.phone.utils ... |
# -*- coding: UTF-8 -*-
# Домашнее задание по уроку 2-2
# «Работа с разными форматами данных»
# Выполнил Мартысюк Илья PY-3
import xml.etree.cElementTree as ET
import re
def open_data_file(path, encoding):
parser = ET.XMLParser(encoding=encoding)
tree = ET.parse(path, parser=parser)
root = tree.getroot(... |
#
# Symbol Table
#
import re
from Cython import Utils
from Errors import warning, error, InternalError
from StringEncoding import EncodedString
import Options, Naming
import PyrexTypes
from PyrexTypes import py_object_type
import TypeSlots
from TypeSlots import \
pyfunction_signature, pymethod_signature, \
g... |
# -*- coding: utf-8 -*-
# (c) 2017 KMEE INFORMATICA LTDA - Daniel Sadamo <sadamo@kmee.com.br>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
import logging
from .abstract_arquivos_governo import AbstractArquivosGoverno
import re
_logger = logging.getLogger(__name__)
try:
from pybrasil.base impo... |
# -*- coding: UTF-8 -*-
"""
Authon: Martysyuk Ilya
E-Mail: martysyuk@gmail.com
Домашнее задание 3.4
"""
import osa
def load_data(file_path):
return_data = list()
try:
with open(file_path, 'r') as file:
print('Читаем данные из файла {}'.format(file_path))
line = file.readline(... |
# Copyright 2012 OpenStack LLC.
# 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 b... |
"""
Author: Armon Dadgar
Start Date: January 22nd, 2009
Description:
Provides a method of transferring data to machines behind firewalls or Network Address Translation (NAT).
Abstracts the forwarding specification into a series of classes and functions.
"""
# Define Module Constants
FORWARDER_MAC = "FFFFFFFFFFFF"
... |
""" Functions for fcomm-ctl """
import decorator
import os
import sys
# Local imports
import config
import colors as c
import utils
# load the fedoracommunity config
ctl_config = config.load_config()
# Add moksha's src dir to the path so we can import it
sys.path.insert(0, ctl_config['moksha-src-dir'])
# Import mo... |
# Copyright 2022 Google LLC
#
# 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, ... |
#!/usr/bin/python
import sys
import os
import re
import getopt
import math
import tempfile
import stat
import shlex
import subprocess
from subprocess import Popen
from optparse import OptionParser
from util import get_new_file, sweep_mult, fancify_cmd,\
sweep_mult_low
import platform
from glob import glob
import s... |
# -*- coding: utf-8 -*-
# (c) 2017 KMEE INFORMATICA LTDA - Daniel Sadamo <sadamo@kmee.com.br>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
import logging
from .abstract_arquivos_governo import AbstractArquivosGoverno
import re
_logger = logging.getLogger(__name__)
try:
from pybrasil.base impo... |
from sfa.util.xrn import Xrn
from sfa.util.xml import XpathFilter
from sfa.rspecs.elements.node import NodeElement
from sfa.rspecs.elements.sliver import Sliver
from sfa.rspecs.elements.location import Location
from sfa.rspecs.elements.hardware_type import HardwareType
from sfa.rspecs.elements.element import Element
f... |
#coding: utf8
import logging
log = logging.getLogger(__name__)
from optparse import make_option
import os, os.path
import sys
from zipfile import ZipFile
from tempfile import mkdtemp
from django.conf import settings
from django.contrib.gis.gdal import CoordTransform, DataSource, OGRGeometry, OGRGeomType
from django.... |
import re
import logging
import os
import yaml
from collections import OrderedDict
from textsub import Textsub
from utils import CopyTemplate
logger = logging.getLogger(__name__)
# Configuration file for templates
CONFIG_FILE = '.dotbriefs.yaml'
CONFIG_PATH = '.dotfiles'
# Tag used in regex substitution for secre... |
""" Task object to generate / manage assessors and cluster """
import os
import shutil
import errno
import time
import logging
from datetime import date
import cluster
from cluster import PBS
from dax_settings import DAX_Settings
DAX_SETTINGS = DAX_Settings()
#Logger to print logs
LOGGER = logging.getLogger('dax')
... |
"""
Copyright [2009-2014] EMBL-European Bioinformatics Institute
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... |
"""
A Printer which converts an expression into its LaTeX equivalent.
"""
from sympy.core import S, C, Add, Symbol
from sympy.core.function import _coeff_isneg
from sympy.core.sympify import SympifyError
from printer import Printer
from conventions import split_super_sub, requires_partial
from precedence import prece... |
# Copyright 2011 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is distri... |
#!/usr/bin/python3
from collections import defaultdict
class Locus(object):
def __init__(self, chrom, start, end, id=None ,gene_build='5b', organism='Zea'):
self.chrom = chrom
try:
self.start = int(start)
except TypeError as e:
self.start = None
try:
... |
from InstagramAPI.src.http.Response.Objects.Caption import Caption
from InstagramAPI.src.http.Response.Objects.Comment import Comment
from InstagramAPI.src.http.Response.Objects.Explore import Explore
from InstagramAPI.src.http.Response.Objects.HdProfilePicUrlInfo import HdProfilePicUrlInfo
from InstagramAPI.src.http.R... |
#!/usr/bin/python2.4
# -*- mode: python -*-
#
# Copyright (c) 2004-2006 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is al... |
from __future__ import print_function
from mobilenet.core import MobileNetDefaultFile, MobileNetV1Restored
from mobilenet.fileio import download_and_uncompress_tarball, get_logger
from mobilenet.imagenet import create_readable_names_for_imagenet_labels
import os
import re
import json
import argparse
logger = get_lo... |
import logging
from collections import defaultdict
import copy
import datetime
import json
import pytz
import re
from collections import defaultdict
from consts.event_type import EventType
from consts.playoff_type import PlayoffType
from helpers.match_manipulator import MatchManipulator
from models.match import Matc... |
import logging
import getopt
import sys
import subprocess
import os.path
import smtplib
import datetime, time
import psutil, os
import re
import socket
import urllib2
import getpass
import boto3
from os import access, R_OK
from ConfigParser import SafeConfigParser
from subprocess import Popen,PIPE,STDOUT
from email.MIM... |
import logging
import re
import socket
from kitnirc.events import NUMERIC_EVENTS
from kitnirc.user import User
_log = logging.getLogger(__name__)
class Channel(object):
"""Information about an IRC channel.
This class keeps track of things like who is in a channel, the channel
topic, modes, and so on.
... |
import sys
import os
import numpy as np
import numpy.ma as ma
import argparse
import csv
import time
import traceback
from condor_kmeans.vector import VectorStream
from condor_kmeans.utils import make_directory
JOB_HEADER = '''universe = vanilla
Executable=/lusr/bin/python
Requirements = InMastodon
+Group = "GRAD"
+... |
###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary for... |
import logging
import getopt
import sys
import subprocess
import os.path
import smtplib
import datetime, time
import psutil, os
import re
import socket
import urllib2
import getpass
from os import access, R_OK
from ConfigParser import SafeConfigParser
from subprocess import Popen,PIPE,STDOUT
from email.MIMEMultipart im... |
# -*- coding: utf-8 -*-
"""
jinja2.debug
~~~~~~~~~~~~
Implements the debug interface for Jinja. This module does some pretty
ugly stuff with the Python traceback system in order to achieve tracebacks
with correct line numbers, locals and contents.
:copyright: (c) 2010 by the Jinja Team.
:... |
#! /usr/bin/env python
# Read #define's and translate to Python code.
# Handle #include statements.
# Handle #define macros with one argument.
# Anything that isn't recognized or doesn't translate into valid
# Python is ignored.
# Without filename arguments, acts as a filter.
# If one or more filenames are given, out... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
from global_variables import *
global_variables_m_file = open('./global_variables.m', 'w')
global_variables_m_file.write('g_shapenet_synset_set = {%s};\n' %(''.join(['\''+sy... |
# -*- coding: utf-8 -*-
'''
Manage Dell DRAC
'''
import salt.utils
import logging
log = logging.getLogger(__name__)
def __virtual__():
'''
'''
if salt.utils.which('racadm'):
return True
return False
def __parse_drac(output):
'''
Parse Dell DRAC output
'''
drac = {}
s... |
eb99ed4c-2ead-11e5-a426-7831c1d44c14 |
# Import global settings to make it easier to extend settings.
from django.conf.global_settings import *
#==============================================================================
# Generic Django project settings
#==============================================================================
DEBUG = False
TEMPL... |
import imp
import os
import sys
from os.path import join
from numpy.distutils import log
from distutils.dep_util import newer
def is_npy_no_signal():
"""Return True if the NPY_NO_SIGNAL symbol must be defined in configuration
header."""
return sys.platform == 'win32'
def is_npy_no_smp():
"""Return Tru... |
"""
**************
Synapse Client
**************
The `Synapse` object encapsulates a connection to the Synapse service and is
used for building projects, uploading and retrieving data, and recording
provenance of data analysis.
~~~~~
Login
~~~~~
.. automethod:: synapseclient.client.login
~~~~~~~
Synapse
~~~~~~~
..... |
e01bdc63-2ead-11e5-8cd0-7831c1d44c14 |
import cv2
import gym
import random
import numpy as np
class Environment(object):
def __init__(self, config):
self.env = gym.make(config.env_name)
screen_width, screen_height, self.action_repeat, self.random_start = \
config.screen_width, config.screen_height, config.action_repeat, config.random_sta... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import tensorflow as tf
from niftynet.application.base_application import BaseApplication
from niftynet.engine.application_factory import ApplicationNetFactory
from niftynet.engine.application_factory import OptimiserFactory
from niftynet.... |
from datetime import date, datetime
import os
import pytz
import re
import tempfile
import traceback
from xml.dom import Node
from xml.parsers.expat import ExpatError
from dict2xml import dict2xml
from django.conf import settings
from django.core.exceptions import ValidationError, PermissionDenied
from django.core.fil... |
"""
url_notify.py - Phenny module to check websites for updates
Rewritten again by Mozai
This is free and unencumbered software released into the public domain.
"""
# 2014-08-21 : removed the "raise Exception()" bits
# because the owner-alert messages may be triggering anti-spam K-LINEs
# this is bad Python style... |
c3303f28-2ead-11e5-94c2-7831c1d44c14 |
#
# Kiwi: a Framework and Enhanced Widgets for Python
#
# Copyright (C) 2007 Async Open Source
#
# This library 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 (a... |
#!/usr/bin/env python
import rospy
import numpy as np
from copy import deepcopy
import urx
import logging
import socket
class PID:
"""
Discrete PID control
"""
def __init__(self, P=2.0, I=0.0, D=1.0, Derivator=0, Integrator=0, Integrator_max=500, Integrator_min=-500):
self.Kp=P
self.K... |
'''
synbiochem (c) University of Manchester 2015
synbiochem is licensed under the MIT License.
To view a copy of this license, visit <http://opensource.org/licenses/MIT/>.
@author: neilswainston
'''
import math
import random
import re
import sys
import RBS_Calculator
import RBS_MC_Design
import synbiochem.optimisa... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
firebat-manager.test.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Objects mapping for blueprint
"""
from sqlalchemy import *
from ..__init__ import db
#from firemanager import db
#from .. import db
class Status(db.Model):
__tablename__ = 'status'
id = Column(Intege... |
# 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... |
# -*- coding: utf-8 -*-
from pytest import mark
import sqlalchemy as sa
from sqlalchemy_utils.types import json
from tests import TestCase
@mark.skipif('json.json is None')
class TestJSONType(TestCase):
def create_models(self):
class Document(self.Base):
__tablename__ = 'document'
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.