text stringlengths 12 6.59M |
|---|
# -*- coding: utf-8 -*-
from flask import (
Flask,
g,
request,
render_template,
redirect,
url_for,
send_file,
)
from werkzeug.useragents import UserAgent
from uuid import uuid4
import os
import json
import rethinkdb as r
from rethinkdb.errors import RqlDriverError
from gfregression import (
... |
"""
A library of validators that return None and raise ValidationError when the
provided data isn't valid.
Validators may be callable classes, and they may have an 'always_test'
attribute. If an 'always_test' attribute exists (regardless of value), the
validator will *always* be run, regardless of whether its associat... |
# Copyright 2009-2010 by Ka-Ping Yee
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
"""
Field classes
"""
from util import ValidationError, DEFAULT_ENCODING
from widgets import TextInput, CheckboxInput
import datetime
import re
import time
__all__ = (
'Field', 'CharField', 'IntegerField',
'DEFAULT_DATE_INPUT_FORMATS', 'DateField',
'DEFAULT_DATETIME_INPUT_FORMATS', 'DateTimeField',
'R... |
import csv
import glob
import os
from datetime import datetime
from lxml import etree
from openpyxl import load_workbook
from django.apps import apps
from django.conf import settings
from django.core.management import BaseCommand, CommandError
from django.db import connection, transaction
from django.db.models import... |
"""
Field classes
"""
import copy
import datetime
import re
import time
from django.utils.translation import ugettext
from django.utils.encoding import StrAndUnicode, smart_unicode
from util import ErrorList, ValidationError
from widgets import TextInput, PasswordInput, HiddenInput, MultipleHiddenInput, FileInput, C... |
# 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 License, or
# (at your option) any later version.
#
# OpenQuake is distri... |
import os
import re
import inspect
from django.core import meta
from django import templatetags
from django.conf import settings
from django.models.core import sites
from django.views.decorators.cache import cache_page
from django.core.extensions import DjangoContext as Context
from django.core.exceptions import Http40... |
import jinja2
import os
from traitlets.config import Application
from traitlets import Unicode, Integer, Dict
from tempfile import NamedTemporaryFile
class NCHPApp(Application):
name = Unicode("nchp")
aliases = Dict({
'ip': 'NCHPApp.public_ip',
'port': 'NCHPApp.public_port',
'api-ip':... |
# 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 License, or
# (at your option) any later version.
#
# OpenQuake is distri... |
# -*- coding: utf-8 -*-
"""Efficient serialization of Django Models for use in Celery that ensure the state of the world."""
# :copyright: (c) 2015 Alex Hayes and individual contributors,
# All rights reserved.
# :license: MIT License, see LICENSE for more details.
from collections import namedtuple... |
import unittest2
from cfn_sphere.resolver.dependency_resolver import DependencyResolver
from cfn_sphere.config import StackConfig
class DependencyResolverTests(unittest2.TestCase):
def test_get_parameter_key_from_ref_value_returns_valid_key(self):
self.assertEqual("vpc.id", DependencyResolver.get_parame... |
########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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... |
import logging
import random
import time
from django.core import exceptions
from django.http import HttpRequest, HttpResponse
from django.utils.importlib import import_module
import python_digest
from django_digest.utils import get_backend, get_setting, DEFAULT_REALM
# Make sure a NullHandler is available
... |
#!/usr/bin/env python
#
# OmsAgentForLinux Extension
#
# Copyright 2015 Microsoft Corporation
#
# 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.... |
import re
class EventError(Exception):
pass
class Event(object):
"""
Signal-like object for Socket.IO events that supports
filtering on channels. Registering event handlers is
performed by using the Event instance as a decorator::
@on_message
def message(request, socket, message... |
from __future__ import absolute_import
from struct import unpack
import Crypto.Random
import Crypto.Random.random
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazm... |
# Copyright (C) 2012 Yaco Sistemas (http://www.yaco.es)
#
# 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... |
from django.views.generic import DetailView, ListView
from django.shortcuts import get_object_or_404
from django.shortcuts import render, redirect
from django.core.urlresolvers import reverse
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.contrib import ... |
from __future__ import unicode_literals
import logging
import json
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from .compat import urlopen
from .exceptions import RateBackendError
from .models import RateSource, Rate
from .settings import money_rates_settings
logger = loggi... |
#!/usr/bin/env python2.5
#
# Copyright 2009 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... |
# -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from djtools.fields import STATE_CHOICES, REQ_CSS
from localflavor.us.forms import USPhoneNumberField
POLICY_CHOICES = (
('', '---select---'),
('HMO', 'HMO'),
('PPO', 'PPO'),
('POS', 'POS'),
('Gov', 'Medicaid'),
... |
from django.conf import settings
from django.db import connections
import MySQLdb
import datetime
def dictfetchall(cursor):
"Returns all rows from a cursor as a dict"
desc = cursor.description
return [
dict(zip([col[0] for col in desc], row))
for row in cursor.fetchall()
]
def do_mysq... |
#!/usr/bin/env python2.5
#
# Copyright 2011 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... |
"""
Master configuration file for Evennia.
NOTE: NO MODIFICATIONS SHOULD BE MADE TO THIS FILE!
All settings changes should be done by copy-pasting the variable and
its value to game/settings.py. An empty game/settings.py can be
auto-generated by running game/manage.py without any arguments.
Hint: Don't copy&paste ov... |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
from Tkinter import *
class WindowList:
def __init__(self):
self.dict = {}
self.callbacks = []
def add(self, window):
window.after_idle(self.call_callbacks)
self.dict[str(window)] = window
def delete(self, window):
try:
del self.dict[str(window)]
... |
## Automatically adapted for scipy Oct 21, 2005 by
# Author: Travis Oliphant 2001
__all__ = ['quad', 'dblquad', 'tplquad', 'quad_explain', 'Inf','inf']
import _quadpack
import sys
import numpy
error = _quadpack.error
def quad_explain(output=sys.stdout):
output.write("""
Extra information for quad() inputs and ... |
doctests = """
Tests for the tokenize module.
The tests can be really simple. Given a small fragment of source
code, print out a table with tokens. The ENDMARK is omitted for
brevity.
>>> dump_tokens("1 + 1")
ENCODING 'utf-8' (0, 0) (0, 0)
NUMBER '1' (1, 0) (1, 1)
OP '+' ... |
from __future__ import division
import time
from fontTools.ttLib import TTFont, newTable
from fontTools.cffLib import TopDictIndex, TopDict, CharStrings, SubrsIndex, GlobalSubrsIndex, PrivateDict, IndexedStrings
from fontTools.ttLib.tables.O_S_2f_2 import Panose
from fontTools.ttLib.tables._h_e_a_d import mac_epoch_dif... |
"""
This implements the WOFF specification dated September 16, 2009.
The main object is the WOFFFont. It is a subclass for the FontTools
TTFont object, so it has very similar functionality. The WOFFReader
and WOFFWriter are also available for use outside of this module.
Those objects are much faster than WOFFFont, but... |
import requests
import os
import os.path
from flask import Flask, request, redirect
from flask.ext.autodoc import Autodoc
import urllib
import socket
import time
# The following are imported so that these are
# in debug context when needed
import netifaces
import sh
app = Flask(__name__)
auto = Autodoc(app)
port = o... |
__author__ = 'Federico Tomassetti'
import unittest
from lands.common import *
class TestCommon(unittest.TestCase):
def setUp(self):
pass
def test_get_and_set_verbose(self):
self.assertEqual(False, get_verbose(), "By default verbose should be set to False")
set_verbose(True)
... |
import company.package.config
import ConfigParser
import mock
import pytest
import unittest
from company.package.config import DEFAULT_CONFIG_FILE
class LoadConfigurationTestCase(unittest.TestCase):
"""
Tests for the company.package.config.load_configuration() function.
"""
def setUp(self):
... |
# Copyright (c) 2016-2017 Adobe Systems Incorporated. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to... |
from ._core import make_figure, build_dataframe
from ._doc import make_docstring, docs
from ._chart_types import choropleth_mapbox
import plotly.graph_objs as go
import numpy as np
import pandas as pd
import re
def _project_latlon_to_wgs84(lat, lon):
"""
Projects lat and lon to WGS84 to get regular hexagons o... |
# Copyright (C) 2015 Research and Innovation Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2017 The Contributors
#
# 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.ap... |
# Copyright (C) 2015 Research and Innovation Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2017 The Contributors
#
# 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.ap... |
#! /usr/bin/python
# Scans the LAN for all hosts and reports some statistics about them
import syslog, traceback
import subprocess as sp
import MySQLdb as mdb
def storeinsql(line):
#print line
return
def readsql():
#
return
def getuxtime():
cmd = ["date", "+'%s'"]
dt = sp.Popen(cmd, stdout=sp.PIPE, std... |
""" Functions for determinig best-fit template parameters by convolution with a
grid """
from dem import ParameterGrid
import WindowedTemplate as wt
import numpy as np
import matplotlib.pyplot as plt
import pyfftw
from pyfftw.interfaces.numpy_fft import fft2, ifft2, fftshift
eps = np.spacing(1)
pyfftw.interfaces.cach... |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for git_cl.py."""
import datetime
import json
import logging
import os
import StringIO
import sys
import tempfile
im... |
#!/usr/bin/python
NUMTEAMS = 12
ROUNDBITS = 4
MATCHBITS = 4
SLOTBITS = 2
print "(set-info :status unknown)"
print "(set-option :produce-models true)"
print "; Logic is now \"Whatever Z3 accepts\" (set-logic AUFBV)"
print ""
# Configurable number of enum members
print "(declare-datatypes () ((TEAM "
for i in range(N... |
#!/usr/bin/env python3
"""
Client library for scigraph. Since swagger codegen is still broken.
"""
import inspect
import simplejson
import requests
multilevel = (
'path',
'items',
)
level1 = (
'apis', # always
'models',
'swaggerVersion',
'basePath',
'resourcePath',
'apiVersion',
... |
#!/usr/bin/env python3
"""
Client library generator for SciGraph REST api.
"""
import inspect
import requests
class restService:
""" Base class for SciGraph rest services. """
def __init__(self, cache=False):
self._session = requests.Session()
adapter = requests.adapters.HTTPAdapter(pool... |
import pyrtl
router_id = pyrtl.Input(4,'router_id')
dest_id = pyrtl.Input(4,'dest_id')
# -------------------------
# |G|port3bits|VC|N||S|E|W| 9bits
# -------------------------
# port N = 0 | S = 0 | E = 0 | W= 0 | Self = 0 |
#
port = pyrtl.Input(3,'port') #port which is giving Input signals
go_x=pyrtl.Output(9,'g... |
"""
Type inference base on CPA.
The algorithm guarantees monotonic growth of type-sets for each variable.
Steps:
1. seed initial types
2. build constraints
3. propagate constraints
4. unify types
Constraint propagation is precise and does not regret (no backtracing).
Constraints push types forward fol... |
# -*- coding: utf-8 -*-
import sys, os, re
import xml.etree.ElementTree as etree
from datetime import date
from collections import defaultdict
def etree_to_dict(t):
t.tag = re.sub(r'\{[^\}]*\}', '', t.tag)
d = {t.tag: {} if t.attrib else None}
children = list(t)
if children:
dd = defaultdict(li... |
#!/usr/bin/env python3
import os
import sys
from shutil import which
from subprocess import run
import random
from simple_colors import *
import re
script_directory = os.path.dirname(os.path.realpath(__file__))
github_directory = os.path.join(os.environ['HOME'], 'Github')
def homebrew_upgrade():
if sys.platform... |
# stdlib
import itertools
import operator
import sys
from test import support
import unittest
import weakref
# third party
import pytest
# syft absolute
from syft.core.common.uid import UID
from syft.lib.python.list import List
from syft.lib.python.slice import Slice
from syft.lib.python.string import String
from syf... |
import logging
from retrying import retry
@retry(stop_max_attempt_number=64, wait_fixed=500)
def poll_task_for_container_id(eru_client, task_id):
r = eru_client.get_task(task_id)
if r['result'] != 1:
raise ValueError('task not finished')
try:
return r['props']['container_ids'][0]
excep... |
# coding: utf-8
import pianette.errors
import re
import time
import warnings
from pianette.utils import Debug
is_gpio_available = False
try:
import RPi.GPIO as GPIO
except ImportError:
Debug.println("FAIL", "Could not import RPi.GPIO")
else:
is_gpio_available = True
if is_gpio_available:
RPi.GPIO.se... |
#!/usr/bin/env python
# Part of backup-tools
#
# Generates a report of the disk space usage on the root backups directory
#
# Sample output:
# ============
#
# Summary
# * Projects: 7
# * Disk space: 503 GB
# * Free on the same partition: 30 GB
# * Last day backup: 25 GB
#
# Per project
# * hwforum
# - Ba... |
from openerp.osv import fields, osv, orm
from openerp.tools.translate import _
from openerp import tools
from datetime import datetime
# import datetime
import logging
import time
from lxml import etree
from openerp import SUPERUSER_ID
class change_product_qty(osv.osv_memory):
_name = "change.product.qty"
... |
import ctypes
import os
import re
import pygccxml
# see also http://starship.python.net/crew/theller/ctypes/old/codegen.html
def getattr_rec(obj, names):
if len(names) == 0:
return obj
else:
return getattr_rec(getattr(obj, names[0]), names[1:])
def ctypes_from_gccxml(lib, t):
"""Convert a... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import api, fields, models
class SaleOrderLine(models.Model):
_inherit = "sale.order.line"
def _get_real_price_currency(self, product, pricelist_dict, qty, uom, pricelist_id):
"""Retrieve ... |
import logging
import os
import tempfile
import unittest
from .. import git_util
class MyTestGitUtilBase(unittest.TestCase):
def setUp(self):
# assume this tests is running in a subfolder
self.repo_path = os.path.abspath(os.path.join(os.pardir, os.pardir))
if os.path.exists('.git'):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pocores.py
Originally written by Tobias Günther.
Copyright (C) 2011 Tobias Günther, Christian Dittrich.
Copyright (C) 2012 Jonathan Sonntag, Arne Neumann.
Copyright (C) 2014 Arne Neumann. (major rewrite using discoursegraphs library)
License: GNU Affero General Publ... |
# Standard library imports
import json
import logging
# Third party imports
from django.contrib import messages
from django.contrib.auth.decorators import user_passes_test
from django.contrib.admin.utils import NestedObjects
from django.urls import reverse
from django.db import DEFAULT_DB_ALIAS
from django.http import... |
import functools
import datetime
from typing import Union, Optional
from ..compat import basestring, integer_types, json, parse_datetime
class BaseResource:
"""Lightweight data structure for resources.
"""
def __init__(self, **kwargs):
self.elapsed_time = kwargs.pop("elapsed_time", None)
... |
#!/usr/bin/python
# coding=utf-8
import logging
from xmltv.common import XmltvChannel, XmltvProgramme
from libschedulesdirect.common import Program, Broadcast, Channel, ProgramArtwork
from libschedulesdirect.schedulesdirect import SchedulesDirect
from optparse import OptionParser
from datetime import datetime
from lib... |
UL_CATEGORY_LI = '//ul[@class="category"]/li'
H2_A_TITLELINK = './h2/a[@class="titlelink"]'
SPAN_A_TITLELINK = './span/a[@class="titlelink"]'
DIV_BODYFIELD_P = '//div[contains(@class,"bodyfield")]/p'
CATEGORY_H2_XPATH = [ UL_CATEGORY_LI, H2_A_TITLELINK ]
BODYFIELD_SPAN_XPATH = [ DIV_BODYFIELD_P, SPAN_A_TITLELINK ]
""... |
#
# 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"); you may not... |
# Copyright 2018 PerfKitBenchmarker 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 appli... |
"""Various computations"""
import numpy as np
from scipy import integrate
from . import misc
def dt_dt(sdat, tstart=None, tend=None):
"""Derivative of temperature"""
tseries = sdat.tseries_between(tstart, tend)
time = tseries['t'].values
temp = tseries['Tmean'].values
dtdt = (temp[1:] - temp[:-1]... |
#!/usr/bin/env python
# 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
#
# Authors:
# - Paul Nilsson, paul.nilsson@cern.ch, 2017-2018
# - Wen Guan, w... |
# Copyright (c) 2014 Evalf
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, s... |
# encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.13.9"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
|
"""
This module is designed to provide easy Python access to the API provided by
https://submittable.com. Additional information about this API can be found at
https://apidoc.submittable.com.
Requires existence of Python requests module:
http://docs.python-requests.org/
.. moduleauthor:: Shawn Rider <shawn@shawnrider... |
from __future__ import division, print_function
import yaml
import tempfile
import os, re
import logging
import numpy as np
import subprocess
import time
import multiprocessing
from .batch import write_slurm_script, get_job_status
class KwargDict(dict):
def cmd_str(self, skip=["filters"]):
if skip is Non... |
from __future__ import unicode_literals
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models.signals import pre_save
from django.utils import timezone
from django.utils.safestring impo... |
#
# File: Component_Impl.py
# Symbol: py.Component-v0.0
# Symbol Type: class
# Babel Version: 1.4.0 (Revision: 6607 release-1-4-0-branch)
# Description: Implementation of sidl class py.Component in Python.
#
# WARNING: Automatically generated; changes will be lost
#
#
# DO-NOT-DELETE splicer.beg... |
# -*- coding: utf8 -*-
#
# Module FUNCTION
#
# Part of Nutils: open source numerical utilities for Python. Jointly developed
# by HvZ Computational Engineering, TU/e Multiscale Engineering Fluid Dynamics,
# and others. More info at http://nutils.org <info@nutils.org>. (c) 2014
"""
The function module defines the :clas... |
# 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 distributed in the hope that it will be usefu... |
# Copyright 2014 Dave Kludt
#
# 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, s... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations
from boardinghouse.schema import _table_exists
from boardinghouse.signals import schema_aware_operation
def view_from_model(model, connection):
view_parts = [
'CREATE VIEW "{... |
import pdb
import numpy as np
import os
from astropy.wcs import WCS
from invert_sed import single_simple_flux_from_greybody
import readcol
from utils import circle_mask
from utils import dist_idl
from utils import gauss_kern
from utils import smooth_psf
from utils import pad_and_smooth_psf
from utils import shift_twod
... |
# 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"); you may not use ... |
#!/usr/bin/env python3
import os
import re
import json
import asyncio
import secrets
import argparse
import collections
ETCD_IMAGE = "quay.io/coreos/etcd:v3.3.5"
IDE_USER_IMAGE = "pachyderm/ide-user:local"
IDE_HUB_IMAGE = "pachyderm/ide-hub:local"
DELETABLE_RESOURCES = [
"roles.rbac.authorization.k8s.io",
"r... |
from kokki import *
apt_list_path = '/etc/apt/sources.list.d/serverdensity.list'
apt = None
if env.system.platform == "ubuntu":
ver = env.system.lsb['release']
apt = "deb http://www.serverdensity.com/downloads/linux/debian lenny main"
# if ver == "10.04":
# apt = "deb http://apt.librato.com/ubuntu... |
# -*- coding: utf8 -*-
#
# Module TOPOLOGY
#
# Part of Nutils: open source numerical utilities for Python. Jointly developed
# by HvZ Computational Engineering, TU/e Multiscale Engineering Fluid Dynamics,
# and others. More info at http://nutils.org <info@nutils.org>. (c) 2014
"""
The topology module defines the topol... |
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
import os
import sys
import unittest
from iptest import IronPythonTestCase, is_cli, is_mono, is_netcoreapp, pa... |
# Copyright 2014 Dave Kludt
#
# 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, s... |
import logging
from workspace.commands.helpers import expand_product_groups
from workspace.scm import checkout_product, checkout_branch, is_git_repo, all_branches, checkout_files, is_repo, product_checkout_path
from workspace.utils import split_doc
log = logging.getLogger(__name__)
def setup_checkout_parser(subparse... |
#!/usr/bin/env python3
import os
import sys
import time
import select
import logging
import argparse
import threading
import subprocess
ETCD_IMAGE = "quay.io/coreos/etcd:v3.3.5"
LOG_LEVELS = {
"critical": logging.CRITICAL,
"error": logging.ERROR,
"warning": logging.WARNING,
"info": logging.INFO,
... |
import sys
sys.path.append('../CGvsPhoto')
import image_loader as il
from dsift import DsiftExtractor
# import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from sklearn.svm import LinearSVC
from sklearn.metrics import accuracy_score
from sklearn.decomposition import PCA
from sklearn.mixture impo... |
import re
__version__ = '0.1.0'
__author__ = 'Kasper Jacobsen'
__license__ = 'MIT'
__copyright__ = 'Copyright 2014 Kasper Jacobsen'
_start = r'^[v=]?'
_major = r'(?P<major>\d+)'
_minor = r'(\.(?P<minor>\d+))?'
_patch = r'(\.(?P<patch>\d+))?'
_build = r'(?:[:+-](?P<build>\w+))?'
_end = r'$'
_regex = _start + _major +... |
"""
This module provides classes to declare, play and plot auditory scene populated by elements in the (time, frequency) domain
The scene is organized as a tree with Leaves as atom elements of the scene.
The tree offers a way to group atoms, and make group of groups etc...
This is useful:
- to declare structured... |
"""
Basic Container objects: the organizational units for :mod:`MDSynthesis`.
"""
import os, sys
import shutil
import logging
from MDAnalysis import Universe
import Core
class _ContainerCore(object):
"""Core class for all Containers.
The ContainerCore object is not intended to be useful on its own, but
... |
from setuptools import setup
setup(name='csv2mongodb',
version='0.1',
description='Python mongodb ETL for CSV with enhanced data parsing',
url='http://github.com/reinvantveer/edna-ld',
author='Rein van t Veer',
author_email='r.h.vant.veer@vu.nl',
license='MIT',
packages=['lib'],
install... |
import sublime
import sublime_plugin
import os
import subprocess
import re
from .misc import RBoxSettings
def clean(cmd):
cmd = cmd.expandtabs(4)
cmd = cmd.rstrip('\n')
if len(re.findall("\n", cmd)) == 0:
cmd = cmd.lstrip()
return cmd
def escape_dq(cmd):
cmd = cmd.replace('\\', '\\\\')
... |
#!/usr/local/bin/python -O
""" A Python Benchmark Suite
"""
#
# Note: Please keep this module compatible to Python 1.5.2.
#
# Tests may include features in later Python versions, but these
# should then be embedded in try-except clauses in the configuration
# module Setup.py.
#
# pybench Copyright
__copyright__ = ""... |
#!/usr/bin/env python
'''
Usage: seq2ffv1.py source_parent_directory output_directory
The script will look through all subdirectories beneath the source_parent_directory for a DPX or image sequence.
The script will then:
Create folder structure for each image sequence in your designated output_directory
Create framem... |
#!/usr/bin/env python
'''
Usage: seq2ffv1.py source_parent_directory output_directory
The script will fnd a single reel, multi-reel (with or without sidecar WAV)
image sequence beneath the source_parent_directory.
The script will then:
* Create a folder structure for each image sequence in
your designated output_direc... |
import c4d
import contextlib
import logging
import os
import os.path
import platform
import Queue
import shelve
import sys
import tempfile
import traceback
import urlparse
import webbrowser
# Add locale module path
local_modules_path = os.path.join(os.path.dirname(__file__),
'res',
... |
"""serfling.py creates a serfling regression from values from an excel file.
Usage:
Running this script will estimate serfling regression parameters and other
useful data, such as std dev of the error between the data and the curve,
and other curve offsets.
> python serfling.py <file_path> <cycles>
file_path: the p... |
import os
import unittest
import sys
import PyFBA
test_file_loc = os.path.dirname(os.path.realpath(__file__))
class TestFBA(unittest.TestCase):
modeldata = PyFBA.parse.model_seed.parse_model_seed_data('gramnegative', verbose=True)
media = PyFBA.parse.pyfba_media(media_name="ArgonneLB", modeldata=modeldata, ... |
from gevent import Greenlet, monkey, core; monkey.patch_all()
import bottle, bitcoinrpc.authproxy, sys
import logging, logging.config
try:
from recaptcha.client import captcha
except ImportError:
captcha = None
try:
import qrcode
except ImportError:
qrcode = None
class DuplicateKeyError(Exception):
... |
from __future__ import print_function
import sys
import copy
import inspect
import numpy as np
from warnings import warn
from datetime import datetime
from netCDF4 import Dataset, MFDataset, num2date, date2num
from PyFVCOM.ll2utm import lonlat_from_utm, utm_from_lonlat
class FileReader:
""" Load FVCOM model o... |
from __future__ import print_function
import sys
import copy
import inspect
import numpy as np
from warnings import warn
from datetime import datetime
from netCDF4 import Dataset, MFDataset, num2date, date2num
from PyFVCOM.ll2utm import lonlat_from_utm, utm_from_lonlat
class FileReader:
""" Load FVCOM model o... |
__version__ = "0.1.0" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.