text
stringlengths
475
200k
"""Build a language detector model The goal of this exercise is to train a linear classifier on text features that represent sequences of up to 3 consecutive characters so as to be recognize natural languages by using the frequencies of short character sequences as 'fingerprints'. """ # Author: Olivier Grisel <[EMAIL...
""" AVR architecture. See for good documentation about AVR ABI: - https://gcc.gnu.org/wiki/avr-gcc The stack grows downwards in AVR. The stack pointer points to the current empty stack slot. This is somewhat confusing, because on other machines the stack pointer points to the latests pushed byte. The stack frame is...
import copy import pickle from django.utils.unittest import TestCase from django.utils.functional import SimpleLazyObject, empty class _ComplexObject(object): def __init__(self, name): self.name = name def __eq__(self, other): return self.name == other.name def __hash__(self): r...
""" Classes that represent database functions. """ from django.db.models import Func, Transform, Value, fields class Cast(Func): """ Coerce an expression to a new field type. """ function = 'CAST' template = '%(function)s(%(expressions)s AS %(db_type)s)' mysql_types = { fields.CharFie...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 PLUMgrid, 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/lic...
import falcon import mock import binascii import base64 import json import deuce from deuce.transport.wsgi import hooks from deuce.drivers import swift from deuce.tests import HookTest def before_hooks_swift(req, resp, params): return [ hooks.OpenstackSwiftHook(req, resp, params) ] class DummyClassO...
# Copyright (c) 2013 OpenStack Foundation # 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 ...
#!/usr/bin/env python # # Copyright 2011 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Daniele Lazzari <[EMAIL]> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # This is a windows documentation stub. Actual code lives in the .ps1 # file of the same name. ANSIBLE_METADATA = {'metadata_version...
#!/usr/bin/env python """ script to run configre for all hwdef.dat, to check for syntax errors """ import os import shutil import subprocess import sys import fnmatch import argparse parser = argparse.ArgumentParser(description='configure all ChibiOS boards') parser.add_argument('--build', action='store_true', defa...
from threading import RLock try: from UserDict import DictMixin except ImportError: from collections import Mapping as DictMixin # With lazy loading, we might end up with multiple threads triggering # it at the same time. We need a lock. _fill_lock = RLock() class LazyDict(DictMixin): """Dictionary popu...
# -*- coding: utf-8 -*- ############################################################################## # # Odoo, an open source suite of business apps # This module copyright (C) 2015 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
# Copyright (c) 2014 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. import re from threading import Lock import crash_utils REVIEW_URL_PATTERN = re.compile(r'Review URL:( *)(.*?)/(\d+)') class Match(object): """Re...
#!/usr/bin/env python import argparse import os import platform import subprocess import sys from lib.config import get_target_arch, PLATFORM from lib.util import get_host_arch, import_vs_env SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) def main(): os.chdir(SOURCE_ROOT) if PLATFO...
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from u...
# Originally written by Kevin Breen (@KevTheHermit): # https://github.com/kevthehermit/RATDecoders/blob/master/unrecom.py import string from zipfile import ZipFile from cStringIO import StringIO from Crypto.Cipher import ARC4 import xml.etree.ElementTree as ET from viper.common.out import * def extract_embedded(zip_...
from openerp.osv import osv from openerp.tools.translate import _ from openerp.addons.account.wizard.pos_box import CashBox class PosBox(CashBox): _register = False def run(self, cr, uid, ids, context=None): if not context: context = dict() active_model = context.get('active_mod...
# Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
### Import necessary packages from __future__ import absolute_import from __future__ import division from __future__ import print_function from xml.etree import ElementTree as et import cv2, os, sys, shutil, glob, argparse, re, io import numpy as np import tensorflow as tf import PIL, hashlib, logging from PIL import ...
"""Unit tests for layout functions.""" import networkx as nx from networkx.testing import almost_equal import pytest numpy = pytest.importorskip("numpy") test_smoke_empty_graphscipy = pytest.importorskip("scipy") class TestLayout: @classmethod def setup_class(cls): cls.Gi = nx.grid_2d_graph(5, 5) ...
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( parse_duration, parse_iso8601, js_to_json, ) from ..compat import compat_str class RDSIE(InfoExtractor): IE_DESC = 'RDS.ca' _VALID_URL = r'https?://(?:www\.)?rds\.ca/vid(?:[eé]|%C3%A9)o...
import json from django.contrib.messages import constants from django.contrib.messages.storage.base import Message from django.contrib.messages.storage.cookie import ( CookieStorage, MessageDecoder, MessageEncoder, ) from django.test import SimpleTestCase, override_settings from django.utils.safestring import Safe...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
""" Models for reverification features common to both lms and studio """ from datetime import datetime import pytz from django.core.exceptions import ValidationError from django.db import models from util.validate_on_save import ValidateOnSaveMixin from xmodule_django.models import CourseKeyField class MidcourseReve...
# # (C) Copyright 2011 Jacek Konieczny <[EMAIL]> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License Version # 2.1 as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WI...
import nose.tools from angr import SimState, SimHeapPTMalloc # TODO: Make these tests more architecture-independent (note dependencies of some behavior on chunk metadata size) def chunk_iterators_are_same(iterator1, iterator2): for ck in iterator1: ck2 = next(iterator2) if ck.base != ck2.base: ...
"""This module implements functions that have to do with number theory.""" import random from operator import mul _stock_primes = [2, 3, 5, 7, 11, 13, 17, 19] def int_pow(x, n): """Raise x to the power n (if n is negative a ValueError is raised). intPow(0, 0) is defined to be 0. """ if n < 0: ...
# This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that ...
# 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 u...
"""Default variable filters.""" import re from decimal import Decimal, InvalidOperation, ROUND_HALF_UP import random as random_module try: from functools import wraps except ImportError: from google.appengine._internal.django.utils.functional import wraps # Python 2.4 fallback. from google.appengine._interna...
# 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, software # d...
#!/usr/bin/env python """ Converts netscreen snoop hex-dumps to a hex-dump that text2pcap can read. Copyright (c) 2004 by Gilbert Ramirez <[EMAIL]> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; ei...
# Copyright 2010 Jacob Kaplan-Moss # Copyright 2011 Nebula, Inc. """ Exception definitions. """ class CommandError(Exception): pass class ValidationError(Exception): pass class AuthorizationFailure(Exception): pass class NoTokenLookupException(Exception): """This form of authentication does not ...
#!/usr/local/bin/python import os import datetime import re import docker from jinja2 import Template from yaml import load TEMPLATES_DIRECTORY = os.environ['TEMPLATE_DIRECTORY'] CONFIG_DIRECTORY = os.environ['CONFIG_DIRECTORY'] SERVICE_NAMES = { 'dns': os.environ.get('DNS_SERVICE_NAME', 'dns'), 'dhcp': os....
from test.support import findfile, run_unittest, TESTFN import unittest import os import aifc class AIFCTest(unittest.TestCase): def setUp(self): self.f = self.fout = None self.sndfilepath = findfile('Sine-1000Hz-300ms.aif') def tearDown(self): if self.f is not None: sel...
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
# -*- coding: utf-8 -*- # # 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, software ...
#!/usr/bin/env python ''' The MIT License (MIT) Copyright (c) <2014> <Mathias Lesche> 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 ...
import scipy from scipy import ndimage import cv2 import numpy as np import sys import torch import resnet_dilated_frozen_r5_D #TODO import resnet_dilated_frozen_r5_D #TODO import resnet_dilated_frozen_r5_D_pose #TODO import resnet_dilated_frozen_r5_D_pose #TODO from torch.autograd import Variable import torchvision.m...
# # 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 u...
#!/usr/bin/env python ### # (C) Copyright (2012-2015) Hewlett Packard Enterprise Development LP # # 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 limita...
# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
import unittest import inspect import os from os.path import join import numpy as np from cylp.cy import CyCoinMpsIO from cylp.cy.CyCoinMpsIO import getQpsExample currentFilePath = os.path.dirname(inspect.getfile(inspect.currentframe())) class TestCyCoinMpsIO(unittest.TestCase): def test(self): problem...
#!/usr/bin/python # # (c) 2015 Peter Sprygada, <[EMAIL]> # # Copyright (c) 2017 Dell Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Li...
# 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...
import pytest from cfme import test_requirements from cfme.infrastructure.provider import InfraProvider from cfme.markers.env_markers.provider import ONE_PER_TYPE from cfme.utils.appliance.implementations.ui import navigate_to from cfme.utils.wait import wait_for pytestmark = [ pytest.mark.tier(2), test_requ...
#!/usr/bin/env python3 import zmq import time import pickle import logging import threading logger = logging.getLogger(__name__) class CommandClient(object): """ CommandClient """ def __init__(self, ip_address, port_range): """ Parameters ---------- ip_address: str ...
class User(object): """Information about an authenticated user. Providers return different forms of information. This container is meant to provide a common interface with that information across all vendors. """ ATTRIBUTES = [ 'id', 'name', 'nickname', 'email...
from piston.handler import BaseHandler, rc from systems.models import System, RelengDistro, SystemRack,SystemStatus,NetworkAdapter,KeyValue from truth.models import Truth, KeyValue as TruthKeyValue from dhcp.DHCP import DHCP as DHCPInterface from dhcp.models import DHCP from MacroExpansion import MacroExpansion from Ke...
#!/usr/bin/python import os import smtplib import time from email.mime.text import MIMEText mailserver = "XXXX.de" smtpport = 25 smtpuser = "XXXX" smtpasswd = "XXXXX" recipient = "[EMAIL]" smtpsender = "[EMAIL]" alarmtemp = 25 day = repr(time.localtime()[2]) + "."+repr(time.localtime()[1])+"."+repr(time.localtime()...
""" Classes to provide the LMS runtime data storage to XBlocks. :class:`DjangoKeyValueStore`: An XBlock :class:`~KeyValueStore` which stores a subset of xblocks scopes as Django ORM objects. It wraps :class:`~FieldDataCache` to provide an XBlock-friendly interface. :class:`FieldDataCache`: A object which pro...
import numpy from numpy.testing import assert_raises from fuel.datasets import CalTech101Silhouettes from tests import skip_if_not_available def test_caltech101_silhouettes16(): skip_if_not_available(datasets=['caltech101_silhouettes16.hdf5']) for which_set, size, num_examples in ( ('train', 16, ...
# -*- coding: utf-8 -*- """ Goodreads Activity ================== A Pelican plugin to lists books from your Goodreads shelves. Copyright (c) Talha Mansoor """ from __future__ import unicode_literals import logging logger = logging.getLogger(__name__) from pelican import signals class GoodreadsActivity(): def...
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
# 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...
from functools import partial import inspect import logging import sys import re import six from silk.profiling.profiler import silk_profile Logger = logging.getLogger('silk') def _get_module(module_name): """ Given a module name in form 'path.to.module' return module object for 'module'. """ if '...
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 ...
# -*- coding: utf-8 -*- ############################################################################## # # This file is part of medical_his, # an Odoo module. # # Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>) # # medical_his is free software: # you can redistribute it and/or modify it under t...
# -*- coding: utf-8 -*- # # 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, software ...
# Copyright 2014 Donald Stufft # # 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, so...
from __future__ import unicode_literals from unittest import skipIf from django.db import connection, connections from django.db.migrations.graph import NodeNotFoundError from django.db.migrations.loader import AmbiguityError, MigrationLoader from django.db.migrations.recorder import MigrationRecorder from django.tes...
from __future__ import absolute_import # # Copyright 2012-2016 Red Hat, Inc. # # This program 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 of the License, or # (at your option) any l...
### # Copyright (c) 2005, Daniel DiPaolo # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of condition...
"""This module provides access to operating system functionality that is standardized by the C Standard and the POSIX standard (a thinly disguised Unix interface). Refer to the library manual and corresponding Unix manual entries for more information on calls.""" import datetime F_OK = 0 O_APPEND = 8 O_BINARY = 32...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <[EMAIL]> # # This file is part of Ansible, # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, o...
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP869.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
""" Create and verify jws-js format Ed25519 signatures. """ __all__ = [ 'sign', 'verify' ] import json from ..util import urlsafe_b64decode, urlsafe_b64encode, native, binary ed25519ll = None ALG = "Ed25519" def get_ed25519ll(): """Lazy import-and-test of ed25519 module""" global ed25519ll if not ...
"""Views for the node settings page.""" # -*- coding: utf-8 -*- import httplib as http from flask import request from modularodm.exceptions import ValidationError from framework.exceptions import HTTPError from website.project.decorators import ( must_have_addon, must_have_permission, must_not_be_registr...
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <[EMAIL]> # # Copyright 2012 Zearin <[EMAIL]> #...
#!/usr/bin/env python # WARNING. There is a bug in this script so that it does not simulate the actual Tahoe Two server selection algorithm that it was intended to simulate. See http://allmydata.org/trac/tahoe-lafs/ticket/302 (stop permuting peerlist, use SI as offset into ring instead?) import random SERVER_CAPACIT...
""" --- database.py ~~~~~~~~~~~ Lifts flatfile database accessing / querying functions. """ # For with clause, create new db_manager that connects def dbm(db_file): return DB_Manager(db_file) class DB_Manager(): def __init__(self, db_file): self.db_file = db_file pass # __enter__ a...
#!/usr/bin/env python # This file is part of VoltDB. # Copyright (C) 2008-2014 VoltDB Inc. # # 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 limitati...
#!/usr/bin/env python import os import subprocess import sys import tempfile import urllib # Compresses the contents of a folder and upload the result to Box. # Run this script as: # # $ upload-logs.py LOG_DIR DEST_NAME # # e.g.: # # $ upload-logs.py /tmp/wsklogs logs-5512.tar.gz def upload_file(local_file, remote_fi...
# 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, dis- # tribute, sublicense, and/or sell co...
#!/usr/bin/python ############################################################ # For Penn genomes, 06.2020 # Takes a log file from a clipkit run on amino acid sequence # and removes corresponding sites from codon alignment. ############################################################ import sys, os, core, coreseq, arg...
import urlparse import datetime import urllib2 from smap.driver import SmapDriver from smap.util import periodicSequentialCall from smap.contrib import dtutil from sklearn import linear_model from smap.archiver.client import RepublishClient from functools import partial from mpc import * class SimpleMPC(SmapDriver): ...
#!/usr/bin/env python ''' Small script to rewrite McStas trace output to CSV data for plotting ''' import argparse import sys import numpy as np import x3d from util import parse_multiline, rotate, get_line, debug, draw_circle UC_COMP = 'COMPONENT:' MC_COMP = 'MCDISPLAY: component' MC_COMP_SHORT = 'COMP: '...
import sys import json sys.path.append('../common/tests') from testtools.matchers import Equals, Contains from test_utils import * import test_common import test_case class NBTestExtraFieldsPresenceCodeDefault(test_case.NeutronBackendTestCase): def test_extra_fields_on_network(self): test_obj = self._cre...
# (c) 2012, Jan-Piet Mens <jpmens(at)gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ver...
import time import logging import flexx from flexx import app, ui import faulthandler faulthandler.enable() #logging.log class MyApp(ui.Widget): #_config = ui.App.Config(title='Flexx test app', size=(400, 300), # )#icon='https://assets-cdn.github.com/favicon.ico') ...
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
""" Form generation utilities for App Engine's new ``ndb.Model`` class. The goal of ``model_form()`` is to provide a clean, explicit and predictable way to create forms based on ``ndb.Model`` classes. No malabarism or black magic should be necessary to generate a form for models, and to add custom non-model related fi...
__author__ = 'Bohdan Mushkevych' import unittest from settings import enable_test_mode enable_test_mode() from db.model.site_statistics import DOMAIN_NAME, TIMEPERIOD from constants import PROCESS_SITE_MONTHLY from tests import daily_fixtures from tests import monthly_fixtures from tests.test_abstract_worker import A...
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz <aahz at pobox.com> # and Tim Peters # This module is currently Py2.3 compatibl...
import pandas as pd data = pd.read_csv("DevelopmentData.csv") n = len(data.columns) # Add all parameters (Taylor coefficients) as 0 in rows following the data: for i in range(data.shape[0]): for j in range(n+2, n+34): data.set_value(i, j, 0) data.rename(columns={n+2: "a", n+3: "a1", n+4: "a2"...
from MaKaC.webinterface.rh import contribMod def index(req, **params): return contribMod.RHContributionModification( req ).process( params ) def newPrimAuthor(req, **params): return contribMod.RHNewPrimaryAuthor( req ).process( params ) def searchPrimAuthor(req, **params): return contribMod.RHSearchPrima...
# LayerMapping -- A Django Model/OGR Layer Mapping Utility """ The LayerMapping class provides a way to map the contents of OGR vector files (e.g. SHP files) to Geographic-enabled Django models. For more information, please consult the GeoDjango documentation: https://docs.djangoproject.com/en/dev/ref/contrib/gi...
# -*- coding: utf-8 -*- from collections import namedtuple # Data containers Header = namedtuple( 'Header', ['sample_counter', 'datagram_counter', 'num_items', 'timecode', 'charID', 'extra_data'] ) Euler = namedtuple( 'Euler', ['segment_ID', 'tx', 'ty', 'tz', 'rx', 'ry', 'rz'] ) Quaternion = nam...
"""Test the basics including the bmark and tags""" from bookie.models import ( DBSession, Bmark, ) from bookie.models.auth import User from bookie.tests import gen_random_word from bookie.tests import TestDBBase class TestBmark(TestDBBase): """Handle bmark function checks""" def test_has_access_sa...
import codecs import copy import logging from fluent.syntax import ast, FluentParser, FluentSerializer from pontoon.sync.exceptions import SyncError from pontoon.sync.formats.base import ParsedResource from pontoon.sync.utils import create_parent_directory from pontoon.sync.vcs.models import VCSTranslation log = log...
"""MIME-Type Parser This module provides basic functions for handling mime-types. It can handle matching mime-types against a list of media-ranges. See section 14.1 of the HTTP specification [RFC 2616] for a complete explanation. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1 Contents: - parse_mi...
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # 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...
#------------------------------------------------------------------------ # # Copyright (C) 2000 Autonomous Zone Industries # # License: This is free software. You may use this software for any # purpose including modification/redistribution, so long as # this header remains intact and...
import pytest from bit.base58 import b58decode, b58decode_check, b58encode, b58encode_check from bit.format import MAIN_PUBKEY_HASH from .samples import BINARY_ADDRESS, BITCOIN_ADDRESS, PUBKEY_HASH def test_b58encode(): assert b58encode(BINARY_ADDRESS) == BITCOIN_ADDRESS assert b58encode(BINARY_ADDRESS[:1]) ...
import argparse import inspect from django.contrib.gis import gdal from django.core.management.base import BaseCommand, CommandError class LayerOptionAction(argparse.Action): """ Custom argparse action for the `ogrinspect` `layer_key` keyword option which may be an integer or a string. """ def __...
from idpanel.training.vectorization import load_raw_feature_vectors from idpanel.training.features import load_raw_features from idpanel.labels import load_labels from sklearn.cross_validation import train_test_split from sklearn.linear_model import LogisticRegression from sklearn.metrics import confusion_matrix import...
# Copyright (c) 2009 Denis Bilenko. See LICENSE for details. __all__ = ['wrap_errors', 'lazy_property'] class wrap_errors(object): """Helper to make function return an exception, rather than raise it. Because every exception that is unhandled by greenlet will be logged, it is desirable to prevent non-err...
#!/usr/bin/env python # Copyright 2010 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...
# -*- test-case-name: twisted.web.test.test_http -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ HyperText Transfer Protocol implementation. This is used by twisted.web. Future Plans: - HTTP client support will at some point be refactored to support HTTP/1.1. - Accept chun...