content string |
|---|
import argparse
import csv
import os
import json
def arguments():
parser = argparse.ArgumentParser()
parser.add_argument('-j', '--jsons', help = 'Path to JSON directory')
parser.add_argument('-o', '--out', help = 'CSV output file path.')
parser.add_argument('-t', '--test', help = 'Name of the MIST t... |
# bagofwords.py
#
# The BagOfWords class implements individual volumes as ordered
# lists of features.
#
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
def all_nonalphanumeric(astring):
nonalphanum = True
for character in astring:
if character.isalpha() or character.isdigi... |
# -*- coding: utf-8 -*-
"""
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import collections
from .compat import cookielib, urlparse, Morsel
try:
import threading
# grr, pyflakes: this fixes "redefinition of unused... |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
fix_xml_ampersands,
parse_duration,
qualities,
strip_jsonp,
unified_strdate,
url_basename,
)
class NPOBaseIE(InfoExtractor):
def _get_token(self, video_id):
token_page = self._download_... |
#encoding=utf8
from sklearn.ensemble import RandomForestClassifier
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#导入数据集与设定因变量及响应变量#
data=pd.read_csv('data.csv')
#data=pd.read_csv('data_p.csv')
df=pd.DataFrame(data)
df=df.dropna()#去除缺失值#
y=df.BAD
x=pd.concat([df.LOAN,df.MORTDUE,df.VALUE,df.YOJ... |
"""Template for the external collections search."""
__revision__ = "$Id$"
import cgi
from invenio.config import CFG_SITE_LANG
from invenio.messages import gettext_set_language
from invenio.urlutils import create_html_link
class Template:
"""Template class for the external collection search. To be loaded with te... |
"""Utilities used by the CIFAR10 and CIFAR100 datasets.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
from six.moves import cPickle
def load_batch(fpath, label_key='labels'):
"""Internal utility for parsing CIFAR data.
Arguments:
... |
import os
import sys
import pygame
from common.constants import *
from client.constants import *
from common import boundint
from common.util.rect import Rect
class FX(object):
def __init__(self, inPos, inFacing, inType):
self.preciseLoc = inPos
self.facingRight = inFacing
self.frames = ... |
import sys
if sys.version_info[0] >= 3: # Python 3
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox as msgbox
else:
import Tkinter as tk
import tkMessageBox as msgbox
import ttk
import pjsua2 as pj
import log
import accountsetting
import account
import buddy
import endpoint
import sett... |
"""
XML Stream processing.
An XML Stream is defined as a connection over which two XML documents are
exchanged during the lifetime of the connection, one for each direction. The
unit of interaction is a direct child element of the root element (stanza).
The most prominent use of XML Streams is Jabber, but this module... |
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
class StudentApplicant(Document):
def autoname(self):
from frappe.model.naming import set_name_by_naming_series
if self.student_admission:
naming_series = frappe.db.get_value('Student Admission... |
"""
Django management command to migrate a course from the old Mongo modulestore
to the new split-Mongo modulestore.
"""
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.split_migrato... |
#!/usr/bin/env python
__author__ = "Antonio Gonzalez Pena"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Antonio Gonzalez Pena"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Antonio Gonzalez Pena"
__email__ = "<EMAIL>"
from qiime.plot_semivariogram import hist_bins, fit_semiv... |
class Node(object):
__slots__ = ('name', 'path', 'local', 'is_leaf')
def __init__(self, path):
self.path = path
self.name = path.split('.')[-1]
self.local = True
self.is_leaf = False
def __repr__(self):
return '<%s[%x]: %s>' % (self.__class__.__name__, id(self), sel... |
"""
Pyste version %s
Usage:
pyste [options] interface-files
where options are:
--module=<name> The name of the module that will be generated;
defaults to the first interface filename, without
the extension.
-I <path> Add an incl... |
"""Config flow for ProgettiHWSW Automation integration."""
from ProgettiHWSW.ProgettiHWSWAPI import ProgettiHWSWAPI
import voluptuous as vol
from homeassistant import config_entries, core, exceptions
from .const import DOMAIN
DATA_SCHEMA = vol.Schema(
{vol.Required("host"): str, vol.Required("port", default=80)... |
"""
This script converts a LowRedux pixel flat into a PYPIT ready one
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
def parser(options=None):
parser = argparse.ArgumentParser(formatter_class... |
import copy
from mistral.db.v2 import api as db_api
from mistral import exceptions as exc
from mistral import utils
def _compare_parameters(expected_input, actual_input):
"""Compares the expected parameters with the actual parameters.
:param expected_input: Expected dict of parameters.
:param actual_inp... |
"""
Base class(es) for all DataProviders.
"""
# there's a blurry line between functionality here and functionality in datatypes module
# attempting to keep parsing to a minimum here and focus on chopping/pagination/reformat(/filtering-maybe?)
# and using as much pre-computed info/metadata from the datatypes module as... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
'''
Compat library for ansible. This contains compatibility definitions for older python
When we need to import a module differently depending on python version, do it
here. Then in the code we can simply import from compat in or... |
import sys
import os
#######################################################################
# global variables
#######################################################################
# first columns: ID (0), name (1), filename (2) => 3
classIdIndex = 0
classNameIndex = classIdIndex+1
fileNameIndex = classNameIndex ... |
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer import function_node
import chainer.functions
from chainer.utils import type_check
if cuda.cudnn_enabled:
cudnn = cuda.cudnn
_algorithm = cuda.libcudnn.CUDNN_SOFTMAX_ACCURATE
class Softmax(function_node.FunctionNode):
... |
from __future__ import absolute_import
import logging
conf = None
def add_package(session, pkg, pkgdir, file_table):
global conf
logging.debug('add-package %s %s' % (pkg, pkgdir))
def rm_package(session, pkg, pkgdir, file_table):
global conf
logging.debug('rm-package %s %s' % (pkg, pkgdir))
def ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
=========================================================================
Program: Visualization Toolkit
Module: TestNamedColorsIntegration.py
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.... |
import logging
from graphql.language.ast import FragmentSpread, Variable
class QueryCostException(Exception):
pass
log = logging.getLogger("graphapi")
def _get_counts(info, fragments, variable_values):
multiplier = 1
inner_multiplier = 0
if isinstance(info, FragmentSpread):
for selection ... |
import os.path
import sys
from config import BASEDIR
from config import WHITE_SPACE
from config import SQLALCHEMY_MIGRATE_REPO
from database_operations import db_create, db_migrate
from controller_generator import generate_controller
from template_generator import generate_index_template
from template_generator impor... |
import inspect
import struct
from . import packet_base
from . import ethernet
class Packet(object):
"""A packet decoder/encoder class.
An instance is used to either decode or encode a single packet.
*data* is a bytearray to describe a raw datagram to decode.
When decoding, a Packet object is iterat... |
from __future__ import absolute_import
from grokcore.component import context
from zope import schema
from zope.component import provideSubscriptionAdapter
from zope.interface import Interface, implements
from opennode.knot.model.compute import Compute
from opennode.knot.model.hangar import Hangar
from opennode.oms.m... |
import numpy as np
import scipy.sparse as sp
from scipy import linalg
from numpy.testing import assert_array_almost_equal, assert_array_equal
from sklearn.datasets import make_classification
from sklearn.utils.sparsefuncs import (mean_variance_axis,
inplace_column_scale,
... |
"""
make file showing boundaries from parcellation
"""
import numpy,nibabel
import nibabel.gifti.giftiio
import os
from myconnectome.utils import set_structure
basedir=os.environ['MYCONNECTOME_DIR']
def mk_parcellation_boundaries():
lh=os.path.join(basedir,'parcellation/all_selected_L_new_parcel_renumbered.func... |
"""Tests for tensorflow.python.framework.device."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import device
from tensorflow.python.framework import test_util
from tensorflow.python.platform import googletest
class Dev... |
"""Tests for google.protobuf.text_encoding."""
from google.apputils import basetest
from google.protobuf import text_encoding
TEST_VALUES = [
("foo\\rbar\\nbaz\\t",
"foo\\rbar\\nbaz\\t",
b"foo\rbar\nbaz\t"),
("\\'full of \\\"sound\\\" and \\\"fury\\\"\\'",
"\\'full of \\\"sound\\\" and \\\"fury... |
# -*- coding: utf-8 -*-
import sys
import os
import re
import urllib
import urlparse
import xbmc
import xbmcgui
import xbmcplugin
import xbmcaddon
import xbmcvfs
if sys.version_info < (2, 7):
import simplejson
else:
import json as simplejson
# Import the common settings
from resources.lib.settings import Sett... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from scipy import stats
from tensorflow.contrib import distributions as distributions_lib
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tenso... |
from __future__ import absolute_import
import argparse
import pytest
import os
import sys
is_python2 = sys.version_info[0] == 2
import bokeh.command.subcommands.json as scjson
from bokeh.command.bootstrap import main
from bokeh.util.testing import TmpDir, WorkingDir, with_directory_contents
from . import basic_scat... |
"""Demonstrates how to combine Struct with abstract base classes."""
from abc import ABCMeta, abstractmethod
from simplestruct import Struct, Field, MetaStruct
# A simple ABC. Subclasses must provide an override for foo().
class Abstract(metaclass=ABCMeta):
@abstractmethod
def foo(self):
pass
# ABCs... |
import pprint
import re
import os
from globalVars import base_vocab_ns
from TropgeneParser import *
__author__ = 'elhassouni'
def tropGeneToRDF(tropGene_map, output_file):
# The differentes variable declaration
tropGene_buffer = '' # initilised the buffer at zero
population_counter, mapefeature_counter, s... |
from __future__ import unicode_literals
from indico.modules.events.models.persons import EventPerson
from indico.modules.users import User
from indico.modules.users.models.users import UserTitle
from indico.util.user import principal_from_fossil
def create_event_person(event, create_untrusted_persons=False, **data):... |
__author__ = "Cyril Jaquier"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
from ..helpers import getLogger
# Gets the instance of the logger.
logSys = getLogger(__name__)
class FailData:
def __init__(self):
self.__retry = 0
self.__lastTime = 0
self.__lastReset = 0
self.__matches =... |
import os
import base64
import logging
import platform
from datetime import date, timedelta
from invoke import run, task
# from elasticsearch import helpers
# from dateutil.parser import parse
# from six.moves.urllib import parse as urllib_parse
# import scrapi.harvesters # noqa
# from scrapi import linter
# from sc... |
"""Tests for variational inference."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
# TODO: #6568 Remove this hack that makes dlopen() not crash.
if hasattr(sys, "getdlopenflags") and hasattr(sys, "setdlopenflags"):
import ctypes
sys.setd... |
ANSIBLE_METADATA = {'status': ['stableinterface'],
'supported_by': 'core',
'version': '1.0'} |
# coding=utf-8
from __future__ import unicode_literals
from decimal import Decimal
import sys
from faker.providers.lorem.la import Provider as Lorem
from .. import BaseProvider
if sys.version_info[0] == 2:
string_types = (basestring,)
elif sys.version_info[0] == 3:
string_types = (str, bytes)
else:
ra... |
from test import test_support
import random
import sys
import unittest
try:
import java
except ImportError:
pass
verbose = test_support.verbose
nerrors = 0
def check(tag, expected, raw, compare=None):
global nerrors
if verbose:
print " checking", tag
orig = raw[:] # save input in ca... |
import os
import posixpath
import sys
import unittest
from environment_wrappers import CreateUrlFetcher
from extensions_paths import (
ARTICLES_TEMPLATES, CHROME_EXTENSIONS, DOCS, JSON_TEMPLATES,
PUBLIC_TEMPLATES)
from fake_fetchers import ConfigureFakeFetchers
from file_system import FileNotFoundError
from rie... |
################################# 1. 宣告原始碼 coding, 導入必要模組
#coding=utf-8
import cherrypy
import random
# for path setup
import os
# for mako
from mako.lookup import TemplateLookup
################################# 2. 全域變數設定, 近端與遠端目錄設定
cwd = os.getcwd()
if 'OPENSHIFT_REPO_DIR' in os.environ.keys():
# 表示程式在雲端執行
... |
"""
String field classes:
- String: Fixed length string (no prefix/no suffix) ;
- CString: String which ends with nul byte ("\0") ;
- UnixLine: Unix line of text, string which ends with "\n" ;
- PascalString8, PascalString16, PascalString32: String prefixed with
length written in a 8, 16, 32-bit integer (use parent e... |
"""Store and retrieve wheel signing / verifying keys.
Given a scope (a package name, + meaning "all packages", or - meaning
"no packages"), return a list of verifying keys that are trusted for that
scope.
Given a package name, return a list of (scope, key) suggested keys to sign
that package (only the verifying key... |
""" The access backend object base class """
from collections import defaultdict
from passlib.apps import custom_app_context as pwd_context
from pyramid.security import (Authenticated, Everyone,
effective_principals, Allow, Deny,
ALL_PERMISSIONS)
from pyramid.... |
"""Sync contribution/abstract friendly ids
Revision ID: 258db7e5a3e5
Revises: 3ca8e62e6c36
Create Date: 2016-04-21 16:56:20.113767
"""
import sqlalchemy as sa
from alembic import context, op
# revision identifiers, used by Alembic.
revision = '258db7e5a3e5'
down_revision = '3ca8e62e6c36'
def _sync_last_contrib_id... |
import os.path as op
import numpy as np
from utils import set_directory
import mne
from jumeg.decompose.ica_replace_mean_std import ICA, read_ica, apply_ica_replace_mean_std
from jumeg.jumeg_preprocessing import get_ics_cardiac, get_ics_ocular
from jumeg.jumeg_plot import plot_performance_artifact_rejection # , plot_... |
import sys
import os
from glob import glob
from collections import Counter
import MeCab
def main():
"""
"""
input_dir = sys.argv[1]
tagger = MeCab.Tagger('')
tagger.parse('')
frequency = Counter()
count_processed = 0
for path in glob(os.path.join(input_dir, '*', 'wiki_*')):
p... |
"""Creates a zip archive for the Chrome Remote Desktop Host installer.
This script builds a zip file that contains all the files needed to build an
installer for Chrome Remote Desktop Host.
This zip archive is then used by the signing bots to:
(1) Sign the binaries
(2) Build the final installer
TODO(garykac) We shou... |
import sys
sys.path.append("../")
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn import decomposition
import jieba
import time
import glob
import sys
import os
import random
if len(sys.argv)<2:
print("usage: extract_topic.py di... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
pct2rgb.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*******************************... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('books', '0004_goodsinfo'),
]
operations = [
migrations.AddField(
model_name='bookinfo',
name='author... |
"""Cloud SDK markdown document renderer base class."""
import abc
from googlecloudsdk.core import log
# Font Attributes.
BOLD, ITALIC, CODE = range(3)
class Renderer(object):
"""Markdown renderer base class.
The member functions provide an abstract document model that matches markdown
entities to output do... |
from collections import Counter
import contextlib
import random
import subprocess as sp
import time
from astropy.io import fits
import numpy as np
import pytest
from pyds9 import pyds9
parametrize = pytest.mark.parametrize
type_mapping = parametrize('bitpix, dtype ',
[(8, np.dtype(np.uint... |
from __future__ import absolute_import, division, print_function, \
with_statement
import os
import logging
def find_library_nt(name):
# modified from ctypes.util
# ctypes.util.find_library just returns first result he found
# but we want to try them all
# because on Windows, users may have both ... |
"""Tests the text output of Google C++ Testing Framework.
SYNOPSIS
gtest_output_test.py --build_dir=BUILD/DIR --gengolden
# where BUILD/DIR contains the built gtest_output_test_ file.
gtest_output_test.py --gengolden
gtest_output_test.py
"""
__author__ = '<EMAIL> (Zhanyong Wan)'
import ... |
from .charsetprober import CharSetProber
from .enums import ProbingState, MachineState
from .codingstatemachine import CodingStateMachine
from .mbcssm import UTF8_SM_MODEL
class UTF8Prober(CharSetProber):
ONE_CHAR_PROB = 0.5
def __init__(self):
super(UTF8Prober, self).__init__()
self.coding_... |
# Global settings for core project.
import os
########## PATH CONFIGURATION
PROJECT_DIR = os.path.dirname(os.path.dirname(__file__))
PUBLIC_DIR = os.path.join(PROJECT_DIR, 'public')
# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'fabric_bolt.core.wsgi.application'
########... |
import json
from nltk.tokenize import TreebankWordTokenizer
def read_referrence_data(filename):
with open(filename, "r") as f:
lines = f.readlines()
return [l.strip('\n\r') for l in lines]
def span_tokenize(text):
tokens = TreebankWordTokenizer().tokenize(text)
dt = 0
end = 0
... |
# -*- coding: utf-8 -*-
"""
zang.connectors.carrier_services_connector
~~~~~~~~~~~~~~~~~~~
Module for communication with `Carrier` endpoint
"""
from zang.connectors.base_connector import BaseConnector
from zang.helpers.helpers import flatDict
from zang.domain.carrier_lookup import CarrierLookup
from zang.domain.list... |
import sys
from distutils.core import setup
from distutils.extension import Extension
try:
from Cython.Distutils import build_ext
except ImportError:
sys.stderr.write("""
==================================================
Please install Cython (http://cython.org/),
which is required to build tre... |
"""
Views file for the Darklang Django App
"""
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.utils.translation import LANGUAGE_SESSION_KEY
from django.utils.translation import ugettext as _
from django.views.generic.base import View
from opene... |
import random
import string
import threading
import urllib
import oauth2 as oauth
import time
PII_FIELDS = ("name", "address", "ssn", "phone", "email", "facebook_id",
"twitter_id", "linkedin_id")
PII_LEN = 8
def random_string(length):
return ''.join(random.choice(string.ascii_lowercase) for x in ra... |
"""
The Manager runs a series of tests (TestType interface) against a set
of test files. If a test file fails a TestType, it returns a list of TestFailure
objects to the Manager. The Manager then aggregates the TestFailures to
create a final report.
"""
import json
import logging
import random
import sys
import time
... |
"""
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit API built into depot_tools.
"""
def CheckChange(input_api, output_api):
"""Checks the DrMemory suppression files for bad suppressions."""
# TODO(timurrrr): find out how to do relative imports
# and... |
# -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import cgi
import codecs
import collections
import io
import os
import platform
import re
import sys
import socket
import struct
from . i... |
from bearlibterminal import terminal
from clubsandwich.ui import (
UIScene,
SingleLineTextInputView,
LabelView,
CyclingButtonView,
ButtonView,
LayoutOptions,
WindowView,
)
from components.needs import Needs
from data.python_templates.classes import character_class_templates
from data.python... |
"""
Provides base classes for XML->object I{unmarshalling}.
"""
from logging import getLogger
from suds import *
from suds.umx import *
from suds.umx.attrlist import AttrList
from suds.sax.text import Text
from suds.sudsobject import Factory, merge
log = getLogger(__name__)
reserved = { 'class':'cls', 'def':'dfn', ... |
"""Coreference version of the Winogender dataset.
Each instance has two edges, one between the pronoun and the occupation and one
between the pronoun and the participant. The pronoun is always span1.
There are 120 templates in the Winogender set, 60 coreferent with the
occupation, and 60 coreferent with the participa... |
from sahara.i18n import _
from sahara.plugins.general import exceptions as ex
from sahara.plugins.general import utils as u
from sahara.plugins.vanilla.hadoop2 import config_helper as cu
from sahara.plugins.vanilla import utils as vu
from sahara.utils import general as gu
def validate_cluster_creating(pctx, cluster):... |
"""Tests for tensorflow.python.framework.random_seed."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.eager import context
from tensorflow.python.framework import random_seed
from tensorflow.python.framework import test_util
from t... |
import sys, os
import essentia, essentia.standard, essentia.streaming
from essentia.streaming import *
tonalFrameSize = 4096
tonalHopSize = 2048
class TuningFrequencyExtractor(essentia.streaming.CompositeBase):
def __init__(self, frameSize=tonalFrameSize, hopSize=tonalHopSize):
super(TuningFrequencyExtra... |
"""
Steam OpenId backend, docs at:
http://psa.matiasaguirre.net/docs/backends/steam.html
"""
from social.backends.open_id import OpenIdAuth
from social.exceptions import AuthFailed
USER_INFO = 'http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?'
class SteamOpenId(OpenIdAuth):
name = 'steam'
... |
class Pose3d ():
def __init__(self):
self.x = 0 # X coord [meters]
self.y = 0 # Y coord [meters]
self.z = 0 # Z coord [meters]
self.h = 1 # H param
self.yaw = 0 #Yaw angle[rads]
self.pitch = 0 # Pitch angle[rads]
self.roll = 0 # Roll angle[rads]
self.q = [0,0,0,0] # Quaternion
self.timeStamp = 0 # ... |
from openerp import netsvc
from openerp.osv import fields, orm
import logging
_logger = logging.getLogger(__name__)
class department_selection(orm.TransientModel):
_name = 'hr.schedule.validate.departments'
_description = 'Department Selection for Validation'
_columns = {
'department_ids': fie... |
#! /usr/bin/env python
# encoding: utf-8
import sys
if sys.hexversion < 0x020400f0: from sets import Set as set
import os,imp,sys,shlex,shutil
from Utils import md5
import Build,Utils,Configure,Task,Options,Logs,TaskGen
from Constants import*
from Configure import conf,conftest
cfg_ver={'atleast-version':'>=','exact-ve... |
"""Tests for TopK op."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import array_ops
from tensorflow.pytho... |
"""SCons.Tool.cyglink
Customization of gnulink for Cygwin (http://www.cygwin.com/)
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
from __future__ import absolute_import, print_function
import re
import os
... |
# -*- coding: utf-8 -*-
import six
from django.conf import settings
from django.contrib import messages
from django.contrib.messages.api import MessageFailure
from django.shortcuts import redirect
from django.utils.http import urlquote
from social.exceptions import SocialAuthBaseException
from social.utils import soc... |
"""California housing dataset.
The original database is available from StatLib
http://lib.stat.cmu.edu/
The data contains 20,640 observations on 9 variables.
This dataset contains the average house value as target variable
and the following input variables (features): average income,
housing average age, averag... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Use finances.gouv.fr web simulator as an API to compute income taxes."""
import argparse
import collections
import logging
import os
import sys
import urllib2
from lxml import etree
app_name = os.path.splitext(os.path.basename(__file__))[0]
log = logging.getLogger... |
#!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe"
# Created by Pearu Peterson, August 2002
from os.path import join
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('fftpack',paren... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Este script hace accounting de todos los correos que mueve postfix.
#
# Con esta información se pretende poder controlar el flujo de mensajes
# salientes de postfix.
#
#
# TODO
# - Implementar un decorador needs_root que verifique si el usuario que ejecuta
# el scri... |
from __future__ import unicode_literals
from django.core.cache import InvalidCacheBackendError, caches
from django.core.cache.utils import make_template_fragment_key
from django.template import (
Library, Node, TemplateSyntaxError, VariableDoesNotExist,
)
register = Library()
class CacheNode(Node):
def __in... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from ansible.compat.tests.mock import patch
from ansible.modules.network.eos import eos_banner
from .eos_module import TestEosModule, load_fixture, set_module_args
class TestEosBannerModule(TestEosModule):
modul... |
"""
This module contains tests for the pulp.server.webservices.views.search module.
"""
import unittest
import mock
from django import http
from base import assert_auth_READ
from pulp.server import exceptions
from pulp.server.webservices.views import search
class TestSearchView(unittest.TestCase):
"""
Test ... |
"""A library to assist automatically downloading files.
This library is used by scripts that download tarballs, zipfiles, etc. as part
of the build process.
"""
import hashlib
import http_download
import os.path
import re
import shutil
import sys
import time
import urllib2
SOURCE_STAMP = 'SOURCE_URL'
HASH_STAMP = 'S... |
"""
This test checks the binary packaging infrastructure
"""
import os
import stat
import sys
import shutil
import pytest
import argparse
from llnl.util.filesystem import mkdirp
import spack.repo
import spack.store
import spack.binary_distribution as bindist
import spack.cmd.buildcache as buildcache
from spack.spec i... |
import os, string
import unittest
from test_all import db, dbobj, test_support, get_new_environment_path, \
get_new_database_path
#----------------------------------------------------------------------
class dbobjTestCase(unittest.TestCase):
"""Verify that dbobj.DB and dbobj.DBEnv work properly"""
db... |
"""
Least Cost is an algorithm for choosing which host machines to
provision a set of resources to. The input is a WeightedHost object which
is decided upon by a set of objective-functions, called the 'cost-functions'.
The WeightedHost contains a combined weight for each cost-function.
The cost-function and weights ar... |
"""Reduction of network adjacency candidates graph.
This module uses NetworkX to facilitate reduction of NAV's network adjacency
candidates graph (loaded from the adjacency_candidate table) into a proper
physical topology graph.
The adjacency_candidate_netbox table can be loaded as a directed graph, from
which reduct... |
#! /usr/bin/env python
#
# clean-xliff.py <l10n_folder>
#
# Remove targets from a locale, remove target-language attribute
#
from glob import glob
from lxml import etree
import argparse
import os
NS = {'x':'urn:oasis:names:tc:xliff:document:1.2'}
def indent(elem, level=0):
# Prettify XML output
# http://eff... |
from openerp.addons.stock.tests.common import TestStockCommon
class TestVirtualAvailable(TestStockCommon):
def setUp(self):
super(TestVirtualAvailable, self).setUp()
self.env['stock.quant'].create({
'product_id': self.productA.id,
'location_id': self.stock_location,
... |
# encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from django.db import models
from haystack.exceptions import NotHandled
class BaseSignalProcessor(object):
"""
A convenient way to attach Haystack to Django's signals & cause things to
index.
By de... |
from openerp.osv import fields,osv
from openerp import tools
from openerp.addons.crm import crm
class crm_lead_report_assign(osv.osv):
""" CRM Lead Report """
_name = "crm.lead.report.assign"
_auto = False
_description = "CRM Lead Report"
_columns = {
'partner_assigned_id':fields.many2one(... |
"""
YAML serializer.
Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__.
"""
import collections
import decimal
import sys
from io import StringIO
import yaml
from django.core.serializers.base import DeserializationError
from django.core.serializers.python import (
Deserializer as PythonDes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.