text stringlengths 17 737k |
|---|
#!/usr/bin/env python
# Corey Brune - Feb 2017
#Description:
# Create and sync a dSource
#
#Requirements
#pip install docopt delphixpy
#The below doc follows the POSIX compliant standards and allows us to use
#this doc to also define our arguments for the script.
"""Create and sync a dSource
Usage:
dx_provision_dsou... |
"""
Contains classes corresponding to the Maya type hierarchy, including `DependNode`, `Transform`, `Mesh`, and `Camera`.
"""
import sys, os, re
import pmcmds as cmds #@UnresolvedImport
import inspect, itertools, math
import pymel.util as util
import factories as _factories
import pymel.api as api #@UnresolvedImport
i... |
# partitioning.py
# Disk partitioning functions.
#
# Copyright (C) 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any... |
import json
import uuid
from uuid import UUID
from sqlalchemy import String, CHAR, types
from sqlalchemy import TypeDecorator
class ArrayType(TypeDecorator):
""" Sqlite-like does not support arrays.
Let's use a custom type decorator.
See http://docs.sqlalchemy.org/en/latest/core/types.html#sqlal... |
import sys
import subprocess
from .exceptions import PyperclipException
EXCEPT_MSG = """
Pyperclip could not find a copy/paste mechanism for your system.
For more information, please visit https://pyperclip.readthedocs.io/en/latest/introduction.html#not-implemented-error """
PY2 = sys.version_info[0] == 2
text... |
import json
from pyramid.decorator import reify
from pyramid.httpexceptions import HTTPBadRequest, HTTPNotFound
from pyramid.response import Response
from zope.interface import implements
from pyramid_restler.interfaces import IView
class RESTfulView(object):
implements(IView)
def __init__(self, context,... |
#! /usr/bin/python
# vim:sw=8:ts=8:et:nowrap
import sys
import re
import os
import string
import cStringIO
import tempfile
import time
import shutil
import xml.sax
xmlvalidate = xml.sax.make_parser()
from filterwranscolnum import FilterWransColnum
from filterwransspeakers import FilterWransSpeakers
from filterwranss... |
from pysteps.io import importers, exporters
_importer_methods = dict()
_importer_methods['bom_rf3'] = importers.import_bom_rf3
_importer_methods['fmi_pgm'] = importers.import_fmi_pgm
_importer_methods['mch_gif'] = importers.import_mch_gif
_importer_methods['mch_hdf5'] = importers.import_mch_hdf5
_importer_methods['mch... |
#!/usr/bin/python
import json
import sys
import time
import random
import string
import os
import subprocess
import logging
# from invoke import run
import awscli.clidriver
from core import utils
import botocore.session
logger = logging.getLogger()
logger.setLevel(logging.INFO)
# random string generator
def randomwo... |
# This program rearranges raw Egderyders data and builds two lists of dicts, userlist and ciommentslist, containing
# of the data needed to buildm graphs. These objects are then saved into files.
import os, sys
import json
import csv
from datetime import datetime
import time
import networkx as nx
import logging
from ... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#MIT Licence
#Copyright (c) 2015 Julien Poupeney
#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 limitatio... |
#!/usr/bin/env python
import argparse
import hashlib
import httplib
import json
import os
import sys
import time
import urllib
import urlparse
import re
import subprocess
REST_ENDPOINT = "http://postgres.ci-connect.net/freesurfer_test"
VERSION = 'PKG_VERSION'
def check_freesurfer():
"""
Check to make sure f... |
# -*- coding: utf-8 -*-
# Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Mail tracking for Mailgun",
"summary": "Mail tracking and Mailgun webhooks integration",
"version": "9.0.1.0.0",
"category": "Social Netwo... |
import __builtin__, types, sys, decimal, re
from itertools import izip, count
from types import NoneType
from compiler import ast
from decimal import Decimal
from datetime import date, datetime
from pony import options
from pony.dbapiprovider import LongStr, LongUnicode
from pony.sqlsymbols import *
from pon... |
# -*- encoding: utf-8 -*-
#########################################################################
#This module intergrates Open ERP with the magento core #
#Core settings are stored here #
########################################################################... |
import logging
from couchdbkit import ChangesStream, ResourceNotFound
from casexml.apps.case.models import CommCareCase
from corehq.apps.indicators.models import FormIndicatorDefinition, \
CaseIndicatorDefinition, CaseDataInFormIndicatorDefinition
from corehq.apps.indicators.utils import get_namespaces, get_indicat... |
import urllib
import cgi
import json
import base64
from functools import partial
import pytest
import requests
TEST_SERVER_HOST = 'http://localhost:8888'
# custom asserts
def assert_required_argument(url, argument, method='GET', headers=None):
error_code = 'invalid_request'
error_description = 'Parameter {0... |
"""
Test subscribing to a contact's presence.
"""
from twisted.words.xish import domish
from servicetest import (EventPattern, assertLength, assertEquals,
call_async, wrap_channel)
from gabbletest import acknowledge_iq, exec_test
import constants as cs
import ns
def test_ancient(q, bus, conn, stream):
t... |
from django.conf import settings
from django.utils.timezone import make_naive, make_aware, is_naive, is_aware, localtime
from datetime import datetime
def ensure_timezone(dateTime,timeZone=None):
'''
Since this project is designed to be used in both time-zone aware
and naive environments, this u... |
# -*- coding: utf-8 -*-
'''
The backed for the mercurial based file server system.
After enabling this backend, branches, bookmarks, and tags in a remote
mercurial repository are exposed to salt as different environments. This
feature is managed by the fileserver_backend option in the salt master config.
This fileser... |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 08 22:28:48 2011
@author: josef
"""
from statsmodels.compat.python import zip
import numpy as np
from numpy.testing import assert_equal, assert_almost_equal, assert_
from statsmodels.tools.eval_measures import (
maxabs, meanabs, medianabs, medianbias, mse, rmse, std... |
'''
(c) 2011, 2012 Georgia Tech Research Corporation
This source code is released under the New BSD license. Please see
http://wiki.quantsoftware.org/index.php?title=QSTK_License
for license details.
Created on May 14, 2012
@author: Jeffrey Portman
@contact: chromox@gmail.com
@summary: <summary>
'''
import os
impor... |
# -*- coding: utf-8 -*-
'''
Module to provide MongoDB functionality to Salt
:configuration: This module uses PyMongo, and accepts configuration details as
parameters as well as configuration settings::
mongodb.host: 'localhost'
mongodb.port: 27017
mongodb.user: ''
mongodb.password:... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from config import Config
from core import Core
from errors import *
import requests
import util
import re
import errors
import consts
import OpenSSL
import json
import base64
from audit import AuditManager
from datetime import datetime
from ebclient.eb_conf... |
#!/usr/bin/env python
# a short program to check the value returned by the GetNameOfClass() methods
import itk, sys
itk.auto_progress(2)
# must force the load to return all the names with dir(itk)
itk.force_load()
# itk.ImageToImageFilter
# a list of classes to exclude
exclude = ["FFTRealToComplexConjugateImageFilt... |
# Natural Earth 110m
assert_has_feature(
1, 0, 0, 'earth',
{ 'kind': 'earth', 'source': 'naturalearthdata.com' })
# Natural Earth 50m
assert_has_feature(
2, 0, 1, 'earth',
{ 'kind': 'earth', 'source': 'naturalearthdata.com' })
# Natural Earth 10m
assert_has_feature(
8, 40, 98, 'earth',
{ 'kind... |
'''
Module for gathering and managing information about MooseFS
'''
def dirinfo(path, opts=None):
'''
Return information on a directory located on the Moose
CLI Example:
salt '*' moosefs.dirinfo /path/to/dir/ [-[n][h|H]]
'''
cmd = 'mfsdirinfo'
ret = {}
if opts:
cmd += ' -' + op... |
import boto
import functools
import json
import logging
import random
import socket
import urllib
from urlparse import urlparse
from boto.exception import BotoServerError
from boto.s3.connection import S3Connection
from radosgw_agent import request as aws_request
from radosgw_agent import exceptions as exc
from rados... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import re
import sys
from ConfigParser import SafeConfigParser
from optparse import OptionParser
import blockdiag
import DiagramDraw
import diagparser
import utils
from builder import ScreenNodeBuilder
def parse_option():
version = "%%prog %s" % blockdiag.__ver... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# SQLMapper.py
# PythonSQLMapper
#
# Copyright 2013 Kenji Nishishiro. All rights reserved.
# Written by Kenji Nishishiro <marvel@programmershigh.org>.
#
import re
from MySQLdb import cursors
class Error(Exception):
def __init__(self, message=None):
se... |
# -*- coding: utf-8 -*-
'''
Module for gathering and managing network information
'''
# Import python libs
from __future__ import absolute_import
import datetime
import hashlib
import logging
import re
import os
import socket
# Import salt libs
import salt.utils
import salt.utils.network
from salt.exceptions import C... |
from collections import namedtuple
import logging
import multiprocessing
import os
import socket
import time
from radosgw_agent import client
from radosgw_agent import lock
from radosgw_agent.exceptions import SkipShard, SyncError, SyncTimedOut, SyncFailed, NotFound, BucketEmpty
from radosgw_agent.constants import DEF... |
#!/usr/bin/env python
#
# merge_authz_tests.py: merge tests that need to write an authz file
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Copyright (c) 2000-2007 CollabNet. All righ... |
import asyncio
import logging
import traceback
from bndl.util.aio import run_coroutine_threadsafe
from bndl.rmi.messages import Request
logger = logging.getLogger(__name__)
class InvocationException(Exception):
'''
Exception indicating a RMI failed. This exception is 'raised from' a 'reconstructed'
exc... |
# -*- coding: utf-8 -*-
'''
Module for gathering and managing network information
'''
# Import python libs
from __future__ import absolute_import
import datetime
import hashlib
import logging
import re
import os
import socket
# Import salt libs
import salt.utils
import salt.utils.decorators as decorators
import salt.... |
# -*- coding: utf-8 -*-
# /***************************************************************************
# Irmt
# A QGIS plugin
# OpenQuake Integrated Risk Modelling Toolkit
# -------------------
# begin : 2016-06-29
# copyright ... |
"""
raven.scripts.runner
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import logging
import os
import sys
import pwd
from raven import Client
def main():
root = logging.getLog... |
# -*- coding: utf-8 -*-
# /***************************************************************************
# Irmt
# A QGIS plugin
# OpenQuake Integrated Risk Modelling Toolkit
# -------------------
# begin : 2016-06-29
# copyright ... |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2015, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#----------------------------------------... |
"""Rovercode app."""
from flask import Flask, jsonify, request
from flask_cors import CORS
import requests, json, socket
from flask_socketio import SocketIO, emit
from dotenv import load_dotenv, find_dotenv
import os
try:
import Adafruit_GPIO.PWM as pwmLib
import Adafruit_GPIO.GPIO as gpioLib
except ImportError... |
from typing import List
from typing import Optional
from typing import Union
import socket
from urllib.parse import urlparse
from api.pricewars_base_api import PricewarsBaseApi
from models import Offer, MerchantRegisterResponse
class Marketplace(PricewarsBaseApi):
DEFAULT_URL = 'http://marketplace:8080'
def... |
#!/usr/bin/env python
import os
import re
import glob
from copy import copy
import multiprocessing
import numpy as np
from numpy.core.defchararray import add as char_add
import fitsio
from astropy.table import Table
from bokpipe import *
from bokpipe import __version__ as pipeVersion
import bokrampcorr
import bokill... |
# -*- coding: UTF-8 -*-
URL = 'http://booking.bettersoftware.it/conference/getinfo.py/empty_attendees'
SUBJECT = "[Better Software 2009] dati mancanti per il tuo badge di ingresso"
BODY = u"""Ciao,
questa mail è inviata automaticamente dal nostro gestionale a tutti gli
utenti che hanno acquistato un biglietto per Be... |
# -*- coding: utf-8 -*-
'''
Provide the service module for systemd
'''
# Import python libs
import logging
import os
import re
log = logging.getLogger(__name__)
__func_alias__ = {
'reload_': 'reload'
}
LOCAL_CONFIG_PATH = '/etc/systemd/system'
VALID_UNIT_TYPES = ['service', 'socket', 'device', 'mount', 'automoun... |
# -*- coding: utf-8 -*-
'''
Manage VMware vCenter servers and ESXi hosts.
.. versionadded:: 2015.8.4
:codeauthor: :email:`Alexandru Bleotu <alexandru.bleotu@morganstaley.com>`
Dependencies
============
- pyVmomi Python Module
- ESXCLI
pyVmomi
-------
PyVmomi can be installed via pip:
.. code-block:: bash
pi... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... |
# Lint as: python3
# Copyright 2020 Google Research. 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 require... |
"""Rovercode app."""
import websocket
import thread
import logging
import time
from flask import Flask, jsonify, request
from flask_cors import CORS
import requests, json, socket
from oauthlib.oauth2 import BackendApplicationClient
from requests_oauthlib import OAuth2Session
from dotenv import load_dotenv, find_dotenv
... |
import mimetypes
import os
from collections import namedtuple
from functools import wraps
from django.core.cache import cache
from django.db.models import Prefetch
from django.http import HttpResponse
from django.shortcuts import redirect
from django.utils.cache import get_conditional_response
from django.utils.http i... |
# Copyright (c) 2010 People Power Co.
# All rights reserved.
#
# This open source code was developed with funding from People Power Company
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# - Redistributions of sour... |
from modularodm import Q
from rest_framework import generics, permissions as drf_permissions
from rest_framework.exceptions import PermissionDenied, ValidationError, NotFound
from rest_framework.status import HTTP_204_NO_CONTENT
from rest_framework.response import Response
from framework.auth.oauth_scopes import CoreS... |
# -*- coding: utf-8 -*-
# Copyright 2017 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# 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... |
import uvloop
from sanic import Sanic
import sanic.response as response
from . import messages
class Messenger:
'''The base class that contains the Facebook Messenger bot, and handles
webhooks and sending.
The application should subclass this class and override the webhook handler
methods as requir... |
#!/usr/bin/env python
#-----------------------------------------------------------------------------------------------------------------------
# INFO:
#-----------------------------------------------------------------------------------------------------------------------
"""
Author: Evan Hubinger
License: Apache 2.0
... |
# coding: utf-8
try:
unicode()
except NameError:
unicode = str
import sys
import os
import re
import hashlib
import imp
import json
import uuid
import binascii
import subprocess
import traceback
import webbrowser
import threading
from collections import defaultdict
import sublime_plugin
import sublime
PY2 = ... |
from __future__ import division
import abc
import numpy as np
from menpo.image import Image
from menpo.feature import no_op
from menpo.visualize import print_dynamic, progress_bar_str
from ..result import AAMAlgorithmResult, LinearAAMAlgorithmResult
# TODO: implement more clever sampling?
class CRAAMInterface(object)... |
#! /usr/bin/env python
import os
import re
def comment (s):
"""
Puts a C-style comment
around a multi-line string.
"""
result = ['/*']
for line in s.strip().split('\n'):
result.append((' * %s' % line) if line else ' *')
result.append(' */')
return '\n'.join(result)
license_... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'sxdk.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
import sxdk
import os
import sys
from PyQt4 import QtCore, QtGui
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4... |
import os
import socket
hostname = socket.gethostname()
build_repos = (
'buildapi',
'buildbot-configs',
'buildbotcustom',
'mozharness',
'partner-repacks',
'puppet',
'talos',
'tools',
)
conversion_repos = []
remote_targets = {}
for repo in build_repos:
conversion_repos.append({
... |
# -*- coding: utf-8 -*-
"""storages.py: messages extends"""
from __future__ import unicode_literals
try:
from django.contrib.messages.storage import get_storage
except ImportError:
# Django 1.7
from django.utils.module_loading import import_string as get_storage
from django.contrib.messages.storage.base ... |
# -*- coding: utf-8 -*-
'''
Manage Docker containers
========================
`Docker <https://www.docker.io>`_
is a lightweight, portable, self-sufficient software container
wrapper. The base supported wrapper type is
`LXC <https://en.wikipedia.org/wiki/Linux_Containers>`_,
`cgroups <https://en.wikipedia.org/wiki/Cgr... |
# -*- coding: utf-8 -*-
'''
Management of Redis server
==========================
.. versionadded:: 2014.7.0
:depends: - redis Python module
:configuration: See :py:mod:`salt.modules.redis` for setup instructions.
.. code-block:: yaml
key_in_redis:
redis.string:
- value: string data
The redis s... |
'''
The EC2 Cloud Module
====================
The EC2 cloud module is used to interact with the Amazon Elastic Cloud
Computing. This driver is highly experimental! Use at your own risk!
To use the EC2 cloud module, when using the old format the following
configuration parameters need to be set in the main cloud confi... |
#!/usr/bin/env python
# Copyright (c) 2009, South African Astronomical Observatory (SAAO) #
# All rights reserved. See LICENSE file for more detail. #
"""
SPECEXTRACT extracts a 1-D spectrum from a 2-D data file.
Author Version Date
----------------------------------------... |
#!/usr/bin/python3
"""
Problem management script.
"""
import argparse
import sys
import imp
import random
import shutil
import os
import api
from api.common import APIException, InternalException
from os import path
from bson import json_util
def insert_problems(files):
problems = get_problems(files)
for pr... |
#!/usr/bin/env ccp4-python
'''
Created on 29 Dec 2015
@author: jmht
'''
import cPickle
import glob
import os, sys
import shutil
import unittest
# Our imports
sys.path.append('/opt/ample-dev1/python')
import workers
class AmpleException(Exception): pass
TESTD = {}
def write_script(name, args):
ample = os.path.j... |
import re
import os
from collections import defaultdict, deque
from functools import partial
from time import time
from vispy import scene, app
import numpy as np
from matplotlib import path
import spiketag
from . import conf
#------------------------------------------------------------------------------
#... |
#!/usr/bin/env pythonmrg
"""
@package mi.dataset.parser A collection of parsers that strip data blocks
out of files and feed them into the system.
@file mi/dataset/parser.py
@author Steve Foley
@brief Base classes for data set agent parsers
"""
__author__ = 'Steve Foley'
__license__ = 'Apache 2.0'
from mi.core.log i... |
"""
This file is part of spinsys.
Spinsys is free software: you can redistribute it and/or modify
it under the terms of the BSD 3-clause license. See LICENSE.txt
for exact terms and conditions.
The constructors module provides several functions that generate
quantum mechanical operators and also three classes that m... |
import numpy as np
import qutip as qtp
import scipy
import time
import logging
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
np.set_printoptions(threshold=np.inf)
# operators
b = qtp.tensor(qtp.destroy(3), qtp.qeye(3)) # spectator qubit
a = qtp.tensor(qtp.qeye(3), qtp.destroy(3)) # fluxin... |
#!/usr/bin/env python
from __future__ import division
'''
Created on Sep 23, 2011
'''
__author__="Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyue@mit.edu"
__date__ = "Sep 23, 2011"
import unittest
from pymatgen.transfor... |
import os
import api
import lrn
l = api.l
from subprocess import call
def check_progress(cmd):
task = api.get_task()
test = task['test']
test_dir = api.get_tests_dir()
command = "python {}/{}.py {}".format(test_dir, test, cmd)
status = call(command.split())
return status
def repl():
tr... |
#! /usr/bin/env python
# -*- coding:utf-8
# Recurrent Neural network with LSTM in Tensorflow
# Special thanks: Harisson@pythonprogramming.net
'''
File name:lstm_rnn.py
Author: chimney37
Date created: 12/09/2017
Python Version: 3.62
'''
'''
We will use the MNIST data, using 60000 training samples and 10... |
""" This modules contains some additional tests that are only used in long-run
development tests.
"""
# standard library
import numpy as np
import pytest
import scipy
import statsmodels.api as sm
from scipy.stats import norm
# testing library
from codes.auxiliary import write_interpolation_grid
from respy.python.sol... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
import RPi.GPIO as GPIO
class relay():
def __init__(self, gpio_num, NC=False):
self.gpio = gpio_num
self.nc = NC
GPIO.setmode(GPIO.BCM)
try:
GPIO.input(self.gpio)
raise LookupError("Relay is already in use!")
except RuntimeError:
GPIO.set... |
# Copyright 2019 D-Wave Systems 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... |
#!/usr/bin/env python
import sys, os, re, glob, cStringIO
def usage():
print >> sys.stderr, """usage: mdoc.py set group file [files...]
Add the tag "\\ingroup group" to all the doxygen comment with a \\class
tag in it.
usage: mdoc.py check group file [files...]
Check that the tag "\\ingroup group" is in all... |
"""
Core module using other modules to:
- extract data from the Transilien's API (use utils_api_client)
- update it with GTFS data (use query_schedule, if data was previously saved with extract_schedule)
- save it in databases, Mongo or/and Dynamo (use utils_dynamo, utils_mongo)
"""
import time
from datetime import da... |
import discord
from discord.ext import commands
import datetime
import emoji
import pycountry
import clients
from modules import utilities
from utilities import checks
def setup(bot):
bot.add_cog(Lichess(bot))
class Lichess:
def __init__(self, bot):
self.bot = bot
self.modes = ("ultraBullet", "bullet",... |
import datetime
from django.test import TestCase
from dojo.models import Test, Engagement, Product
from dojo.tools.generic.parser import GenericFindingUploadCsvParser
class TestFile(object):
def read(self):
return self.content
def __init__(self, name, content):
self.name = name
sel... |
import discord
from discord.ext import commands, tasks
import asyncio
import datetime
import itertools
import json
import logging
import os
import sys
import traceback
import aiohttp
import dateutil.parser
import feedparser
import isodate
import clients
from modules import utilities
from utilities import checks
sy... |
#!/usr/bin/env python
import sys
import svgwrite
def main():
drawing = svgwrite.Drawing(size=('1000', '1400'))
img = svgwrite.image.Image('bullets/NYCS-bull-trans-1.svg',insert=(100, 100), size=(100,100))
drawing.add(img)
sys.stdout.write(drawing.tostring())
if __name__ == '__main__':
main()
|
import os
from django.conf import settings
from django.contrib.staticfiles.management.commands import runserver
from django.contrib.staticfiles.handlers import StaticFilesHandler
from django.views.static import serve
class MezzStaticFilesHandler(StaticFilesHandler):
def get_response(self, request):
res... |
# Copyright 2015 The TensorFlow 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 required by applica... |
"""distutils.command.bdist_rpm
Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions)."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id$"
import sys, os, string
import glob
from types import *
from distutils.core import Command
from distutils.debug i... |
# -*- encoding: utf-8 -*-
# #############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... |
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import os
os.chdir("../..") # to root path
mnist = input_data.read_data_sets("resources/MNIST_data/", one_hot=True, reshape=False, validation_size=0)
K = 200
L = 100
M = 60
N = 30
# initialization
X = tf.placeholder(tf.float32, [None... |
from deps import deps
import repository
import versions
######################################
# Query Types
# findTroves divides queries up into a set of sub queries, depending on
# how the trove is to be found
# Below are the five different types of queries that can be created
# from findTroves
QUERY_BY_VERSION... |
"""
src.__init__
~~~~~~~~~~~
codeink main package
* Copyright (c) 2015 Camilo Roca, carocad@unal.edu.co
"""
__author__ = 'Camilo Roca'
__license__ = 'Apache license 2.0'
__version__ = '1.1.2'
__URL__ = 'https://github.com/carocad/codeInk'
__author_email__ = 'carocad@unal.edu.co'
|
# coding: utf-8
from __future__ import print_function
from datetime import datetime
from jinja2.exceptions import TemplateNotFound
import mkblogs
from mkblogs import utils
from mkblogs.build import html as parser
from mkblogs.compat import urljoin, PY2
from mkblogs.relative_path_ext import RelativePathExtension, Tit... |
# Authors: Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Denis A. Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
from functools import partial
from inspect import getmembers
import numpy as np
from scipy.fftpack import fftfreq
from .utils import check_indices
from ..fixes import _get_args
f... |
"""
IES TM-27-14 Data Input / Output
================================
Defines the :class:`colour.SpectralDistribution_IESTM2714` class handling *IES
TM-27-14* spectral data *XML* files.
References
----------
- :cite:`IESComputerCommittee2014a` : IES Computer Committee, & TM-27-14
Working Group. (2014). IES Stan... |
import os
from django.core.exceptions import ObjectDoesNotExist
from django.http import Http404
from django.shortcuts import render, redirect
from django.views.generic.edit import CreateView
from django.views.generic.edit import UpdateView
from django.views.generic.edit import DeleteView
from django.views.generic.deta... |
# -*- coding: utf-8 -*-
# This file is part of Cockpit.
#
# Copyright (C) 2013 Red Hat, Inc.
#
# Cockpit is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
CKAN Country class (formally known as "group").
This class fetches all relevant information about
a country / group from a specified CKAN instance.
'''
import ckanapi
from app.classes.ckan import CKAN
class Country:
'''
Complete CKAN country class.
'''
def __ini... |
# Copyright (c) 2015 Ultimaker B.V.
# Copyright (c) Thiago Marcos P. Santos
# Copyright (c) Christopher S. Case
# Copyright (c) David H. Bronke
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Event import CallFunctionEvent
from UM.Decorators import deprecated, call_if_enabled
from UM.Logger impo... |
def addition(x,y):
return x-y |
import time
import threading
import base64
from pylinkirc import utils, conf
from pylinkirc.log import log
from pylinkirc.classes import Protocol, IrcUser, IrcServer, ProtocolError
FALLBACK_REALNAME = 'PyLink Relay Mirror Client'
COMMON_PREFIXMODES = [('h', 'halfop'), ('a', 'admin'), ('q', 'owner'), ('y', 'owner')]
I... |
#!/usr/bin/env python2
import sys, os, json, errno, subprocess, yum
class yumoter:
def __init__(self, configFile, repobasepath):
self.repobasepath = repobasepath
self.reloadConfig(configFile)
self.yb = yum.YumBase()
self.yb.setCacheDir()
def reloadConfig(self, jsonFile):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.