code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
from test_core import *
from test_admin import *
| Python |
"""
Celery functions to be processed in a non-blocking distributed manner.
"""
import os
import re
import shutil
import time
from celery.contrib.abortable import AbortableTask
from celery.task import PeriodicTask
from datetime import datetime, timedelta
from django.conf import settings
from ocradmin.core import utils
... | Python |
"""
Basic OCR functions. Submit OCR tasks and retrieve the result.
"""
import os
import shutil
from django.core import serializers
from django.http import HttpResponse, HttpResponseRedirect, \
HttpResponseServerError, HttpResponseNotFound
from django.core.serializers.json import DjangoJSONEncoder
from django.... | Python |
#!/usr/bin/python
"""
Cruddy script for binarizing files via the OCR web UI.
"""
import os
import sys
import tempfile
import subprocess as sp
import httplib2
import time
from optparse import OptionParser
from poster.encode import multipart_encode
from poster.streaminghttp import register_openers
import urllib
impor... | Python |
"""
Object representing a helper file for an OCR app.
"""
import datetime
from django.db import models
from django.contrib.auth.models import User
from tagging.fields import TagField
import tagging
class OcrModel(models.Model):
"""
OCR model objects.
"""
user = models.ForeignKey(User, related_nam... | Python |
import subprocess as sp
def get_ocropus_model_info(path):
"""
Get the info about an ocropus model/
"""
proc = sp.Popen(["ocropus", "cinfo", path], stdout=sp.PIPE)
return proc.stdout.read()
def get_tesseract_model_info(path):
"""
Get info about Tesseract models.
"""
return... | Python |
import os
import shutil
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.client import Client
from django.utils import simplejson
from ocradmin.core.tests import testutils
from ocradmin.ocrmodels.models import OcrModel
AJAX_HEADERS = {
... | Python |
from django.conf.urls.defaults import *
from django.contrib.auth.decorators import login_required
from ocradmin.ocrmodels import views
urlpatterns = patterns('',
(r'^/?$', views.modellist),
(r'^list/?$', views.modellist),
(r'^show/(?P<pk>\d+)/$', views.modeldetail),
(r'^create/?$', login_required(views.modelcrea... | Python |
"""
Create default app models. Models must be in the etc/defaultmodels directory
and be named thus: <app>_other_stuff_<type>.extension, where <app> is either
'ocropus' or 'tesseract' and <type> is either 'char' or 'lang'.
"""
import os
import sys
from django.core.management.base import BaseCommand, CommandError
fro... | Python |
from django import forms
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.contrib import messages
from django.core import serializers
from django.db.models import Q
from django.http import HttpResponse, Http404, HttpResponseRedirect
from django.shortcuts ... | Python |
from django.conf import settings
from django.test.simple import DjangoTestSuiteRunner
USAGE = """\
Custom test runner to allow testing of celery delayed tasks.
"""
class CeleryTestSuiteRunner(DjangoTestSuiteRunner):
def run_tests(self, test_labels, *args, **kwargs):
"""Django test runner allowing testing ... | Python |
"""
Object representing an OCR project, used to group files, batches,
and presets.
"""
import datetime
from django.db import models
from django.contrib.auth.models import User
from tagging import fields as taggingfields
import autoslug
from ocradmin.core import utils as ocrutils
from ocradmin.storage import registry... | Python |
import os
import shutil
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.client import Client
from django.utils import simplejson
from ocradmin.projects.models import Project
AJAX_HEADERS = {
"HTTP_X_REQUESTED_WITH": "XMLHttpRequest"
}... | Python |
"""
URLConf for OCR projects.
"""
from django.conf.urls.defaults import *
from django.contrib.auth.decorators import login_required
from ocradmin.projects import views
urlpatterns = patterns('',
(r'^/?$', login_required(views.projectlist)),
(r'^list/?$', login_required(views.projectlist)),
(r'^create/?$', vie... | Python |
"""
Celery functions to be processed in a non-blocking distributed manner.
"""
| Python |
"""
Project-related view functions.
"""
import os
from datetime import datetime
from django import forms
from django.conf import settings
from django.contrib.formtools.wizard import FormWizard
from django.contrib import messages
from django.core import serializers
from django.template.defaultfilters import slugify
fro... | Python |
"""
Utils for document storage.
"""
import json
from . import base
class DocumentEncoder(json.JSONEncoder):
"""
Encoder for JSONifying documents.
"""
def default(self, doc):
"""Flatten node for JSON encoding."""
if issubclass(doc.__class__, base.BaseDocument):
return dict(
... | Python |
"""
Fedora storage backend.
"""
import io
import re
import urllib
from django import forms
from django.conf import settings
import eulfedora
import hashlib
from cStringIO import StringIO
from eulfedora.server import Repository
from eulfedora.models import DigitalObject, FileDatastream
from . import base
class Conf... | Python |
"""
Storage backend base class.
"""
import os
import re
import io
import textwrap
from contextlib import contextmanager
from django import forms
from django.conf import settings
from . import registry
from PIL import Image
from cStringIO import StringIO
class BaseConfigForm(forms.Form):
"""Base class for config... | Python |
"""
Filesystem storage module.
"""
import os
import io
import re
import shutil
from cStringIO import StringIO
from django import forms
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from ocradmin.core.utils import media_path_to_url
from PIL import Image
from . import base, e... | Python |
"""
Storage backend exceptions.
"""
class AmbiguousDatastreamError(StandardError):
pass
class DatastreamNotFoundError(StandardError):
pass
| Python |
"""
Storage module. Abstracts various document-storage backends.
"""
from __future__ import absolute_import
from . import registry, fedora, file_system, mongodb
def get_backend(name):
return registry.stores[name]
| Python |
"""
Registry for storage backends.
This class was adapted from the Celery Project's task registry.
"""
import inspect
class NotRegistered(KeyError):
pass
class StorageRegistry(dict):
NotRegistered = NotRegistered
def register(self, store):
"""Register a store class in the store registry."""
... | Python |
"""
Mongodb storage backend.
"""
from django import forms
from pymongo import Connection
import gridfs
from . import base
class ConfigForm(base.BaseConfigForm):
"""Mongodb config form."""
class MongoDbStorage(base.BaseStorage):
"""Mongodb storage backend."""
| Python |
from django.db import models
from ocradmin.projects.models import Project
from ocradmin import storage
from django.conf import settings
#class DocumentBase(object):
# """Document model abstract class. Each storage
# backend implements its own version of this."""
# def __init__(self, label):
# """I... | Python |
# OCR Batch utils
import os
import re
import subprocess as sp
class Aspell(object):
"""
Aspell Wrapper.
"""
suggestre = re.compile("& (?P<word>\S+) (?P<numsuggestions>\d+) \d+: (?P<suggestions>.+)")
nomatchre = re.compile("# (?P<word>\S+) \d+")
def __init__(self):
"""
Initial... | Python |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 a... | Python |
"""
URLConf for OCR documents.
"""
from django.conf.urls.defaults import *
from django.contrib.auth.decorators import login_required
from ocradmin.documents import views
urlpatterns = patterns('',
(r'^/?$', login_required(views.doclist)),
(r'^list/?$', login_required(views.doclist)),
(r'^create/?$', login_re... | Python |
"""
Flags indicating document status
"""
PRETTY_STATUS = {
"initial" : "Initial",
"error" : "Error",
"uncorrected": "Uncorrected",
"part_corrected": "Part Corrected",
"complete" : "Complete",
}
RUNNING = "running"
ERROR = "error"
INITIAL = "initial"
UNCORRECTED = "unc... | Python |
"""
Views for handling documents and document storage.
"""
import json
from django import forms
from django.db import transaction
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect, \
HttpResponseServerError, HttpResponseNotFound
from django.vi... | Python |
from UserDict import DictMixin
class OrderedDict(dict, DictMixin):
def __init__(self, *args, **kwds):
if len(args) > 1:
raise TypeError('expected at most 1 arguments, got %d' % len(args))
try:
self.__end
except AttributeError:
self.clear()
self.u... | Python |
# fedora adaptor
import re
from fcrepo.http.restapi import FCRepoRestAPI
from xml.dom import minidom
import fcobject
DEFAULTS = {
"repository_url": 'http://optiplex:8080/fedora',
"username": 'fedoraAdmin',
"password": 'fedora',
"realm": 'any',
"namespace": 'fedora'
}
NS = "{... | Python |
# Fedora Commons Datastream Object
import utils
reload(utils)
import fcbase
reload(fcbase)
from datetime import datetime
from xml.dom import minidom
import urllib
class FedoraDatastream(fcbase.FedoraBase):
"""
Fedora Datastream.
"""
NAMESPACE = None
# Map attribute names from XML to Objec... | Python |
# Run some tests on the fcobject classes
import fcobject
import unittest
class TestFedoraObject(fcobject.FedoraObject):
NAMESPACE = "test-python-wrapper-object"
class TestFedoraObjectRunner(unittest.TestCase):
def setUp(self):
self.fco = TestFedoraObject()
self.fco.save()
de... | Python |
# Fedora Commons Base Object
import re
import urllib2
from datetime import datetime
from utils import FedoraException
from utils import DEFAULTS
from xml.dom import minidom
from fcrepo.http.restapi import FCRepoRestAPI
def denormalise_query_args(argdict):
"""
Map Python types to REST query strings.
... | Python |
# Risearch Module
import httplib2
import urllib
class RiSearch(object):
"""
Wrapper class for executing ItQL queries.
"""
def __init__(self, url):
self._url = url
def query(self, querystr):
"""
Execute a risearch query.
"""
data = {
"dis... | Python |
# Fedora Commons Object
import re
import utils
from ordereddict import OrderedDict
import fcbase
reload(fcbase)
import fcdatastream
reload(fcdatastream)
import risearch
reload(risearch)
from datetime import datetime
from xml.dom import minidom
import urllib
def query_args(argdict):
args = {}
for arg, val ... | Python |
# Fedora Commons Handler Object
from utils import FedoraException
| Python |
import fcobject
reload(fcobject)
import utils
reload(utils)
import xml.etree.cElementTree as elementtree
from cStringIO import StringIO
def query_args(argdict):
args = {}
for arg, val in argdict.iteritems():
if arg.startswith("_"):
continue
if isinstance(val, bool):
ar... | Python |
""" Python implmentation of the REST API for the Fedora Repository. It is
framework independent in that all it requires is an HTTP module with
a FCRepoRequestFactory class and a FCRepoPesponse class.
The imported FCRepoFactory needs to provide only a constructor and
four methods :
GET : take... | Python |
""" Base implementation of FCRepoRequestFactory interface.
"""
from fcrepo.http.interfaces import I_FCRepoRequestFactory
from fcrepo.http.interfaces import I_FCRepoResponse
from fcrepo.http.interfaces import I_FCRepoResponseBody
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
class B_... | Python |
""" Interfaces for FCRepoRequestFactory, FCRepoResponse and FCRepoResponseBody.
"""
from exceptions import NotImplementedError
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
class I_FCRepoResponseBody:
def __init__(self, raw_content, mime_type):
""" Constructor takes tow... | Python |
#
| Python |
""" Pure Python Implementation of FCRepoRequestFactory and FCRepoResponse
"""
import base64
from types import StringTypes
from httplib2 import Http
from fcrepo.http.base import B_FCRepoRequestFactory
from fcrepo.http.base import B_FCRepoResponse
from fcrepo.http.base import B_FCRepoResponseBody
# # # # # # # # # # # ... | Python |
#
| Python |
"""
Interface to interacting with OCR preset profiles.
"""
from django import forms
from django.conf import settings
from django.http import HttpResponse
from django.shortcuts import get_object_or_404, render
from ocradmin.core import generic_views as gv
from ocradmin.presets.models import Preset, Profile
class Pro... | Python |
"""
Model to store script data.
"""
import json
import datetime
from django.db import models
from django.contrib.auth.models import User
from tagging.fields import TagField
import tagging
import autoslug
from nodetree import script
class JsonTextField(models.TextField):
def to_python(self, value):
retur... | Python |
"""
URLConf for OCR presets.
"""
from django.conf.urls.defaults import *
from django.contrib.auth.decorators import login_required
from ocradmin.presets import views
urlpatterns = patterns('',
(r'^builder/?$', login_required(views.builder)),
(r'^builder/(?P<pid>[^/]+)/?$', login_required(views.builder_doc_edit)),
... | Python |
"""
Import a script file or files into the database.
"""
import os
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from ocradmin.presets.models import Preset
from django.core.exceptions import ImproperlyConfigured
from djan... | Python |
from presets_testmaker import *
from test_scripts import *
from test_builder import *
| Python |
#coding: utf-8
import os
import glob
from django.test import TestCase
from django.test import Client
from django import template
from django.db.models import get_model
from django.contrib.auth.models import User
from ocradmin.core.tests import testutils
from nodetree import script, node
class Testmaker(TestCase):
... | Python |
"""
Run plugin tasks on the Celery queue
"""
import os
import glob
from datetime import datetime, timedelta
from celery.contrib.abortable import AbortableTask
from celery.task import PeriodicTask
from django.core.exceptions import ImproperlyConfigured
from django.conf import settings
from django.utils import simplejson... | Python |
"""
Interface to interacting with OCR presets.
"""
import os
import glob
import json
from django import forms
from django.conf import settings
from django.http import HttpResponse
from django.shortcuts import get_object_or_404, render
from django.core.exceptions import ValidationError
from django.views.decorators.csr... | Python |
"""
URLConf for OCR profiles.
"""
from django.conf.urls.defaults import *
from django.contrib.auth.decorators import login_required
from ocradmin.presets import profileviews as views
urlpatterns = patterns('',
(r'^create/?$', login_required(views.profilecreate)),
(r'^delete/(?P<slug>[-\w]+)/?$', login_require... | Python |
#!/usr/bin/python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run ... | Python |
"""
Virtualenv bootstrap script, borrowed from:
http://www.caktusgroup.com/blog/2010/04/22/basic-django-deployment-with-virtualenv-fabric-pip-and-rsync/
"""
import os
import subprocess
if "VIRTUAL_ENV" not in os.environ:
sys.stderr.write("$VIRTUAL_ENV not found.\n\n")
parser.print_usage()
sys.exit(-1)
virt... | Python |
#!python
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools... | Python |
#!python
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools... | Python |
# -*- coding: utf-8 -*-
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name='Ferlons',
version="0.0.1",
description=u"Controle de Ferias",
author="Claudio Torcato",
author_email="claudiotorcato@gmail.com",
url="http://claudiotorcato.wordp... | Python |
# -*- coding: utf-8 -*-
from tw import forms
from tw.api import WidgetsList
from tw.forms.validators import UnicodeString, Email, Int
forms.FormField.engine_name = "mako"
class UsuarioToscaForm(forms.TableForm):
class fields(WidgetsList):
id = forms.HiddenField(default=0)
matricula = forms.TextFi... | Python |
"""SQLAlchemy Metadata and Session object"""
from sqlalchemy import MetaData
__all__ = ['engine', 'metadata', 'Session']
# SQLAlchemy database engine. Updated by model.init_model().
engine = None
# SQLAlchemy session manager. Updated by model.init_model().
Session = None
# Global metadata. If you have multiple da... | Python |
from pylons import config
from ferlons.model import meta
from sqlalchemy import Column, MetaData, Table, Integer,Unicode,DateTime
from sqlalchemy.orm import mapper, relation
from sqlalchemy import orm
def init_model(engine):
sm = orm.sessionmaker(autoflush=True, autocommit=False, bind=engine)
meta.engine = eng... | Python |
# -*- coding: utf-8 -*-
"""Pylons application test package
When the test runner finds and executes tests within this directory,
this file will be loaded to setup the test environment.
It registers the root directory of the project in sys.path and
pkg_resources, in case the project hasn't been installed with
setuptool... | Python |
"""Setup the artigos application"""
import logging
from paste.deploy import appconfig
from pylons import config
from ferlons.config.environment import load_environment
log = logging.getLogger(__name__)
def setup_config(command, filename, section, vars):
"""Place any commands to setup artigos here"""
conf =... | Python |
"""
ferlons
This file loads the finished app from ferlons.config.middleware.
"""
from ferlons.config.middleware import make_app
| Python |
from ferlons.lib.base import *
from pylons.controllers.util import abort
class TemplateController(BaseController):
def view(self, url):
"""
This is the last place which is tried during a request to try to find a
file to serve. It could be used for example to display a template::
... | Python |
import os.path
from paste.urlparser import StaticURLParser
from pylons.middleware import error_document_template, media_path
from ferlons.lib.base import *
class ErrorController(BaseController):
"""Generates error documents as and when they are required.
The ErrorDocuments middleware forwards to ErrorContro... | Python |
# -*- coding: utf-8 -*-
from ferlons.lib.base import *
from tw.forms.datagrid import DataGrid
from tw.mods.pylonshf import validate
from ferlons.model import meta, Usuario
from ferlons.model import form
import time
from datetime import datetime
#from webhelpers.pagination import paginate
def link_edicao(usuario):
... | Python |
"""Routes configuration
The more specific and detailed routes should be defined first so they may take
precedent over the more generic routes. For more information refer to the
routes manual at http://routes.groovie.org/docs/
"""
from pylons import config
from routes import Mapper
def make_map():
"""Create, confi... | Python |
#
| Python |
"""Pylons middleware initialization"""
from beaker.middleware import CacheMiddleware, SessionMiddleware
from paste.cascade import Cascade
from paste.registry import RegistryManager
from paste.urlparser import StaticURLParser
from paste.deploy.converters import asbool
from pylons import config
from pylons.middleware imp... | Python |
"""Pylons environment configuration"""
import os
from pylons import config
import webhelpers
from ferlons.config.routing import make_map
import ferlons.lib.app_globals as app_globals
import ferlons.lib.helpers
from sqlalchemy import engine_from_config
from ferlons.model import init_model
def load_environment(global... | Python |
"""
Helper functions
All names available in this module will be available under the Pylons h object.
"""
from webhelpers import *
from pylons.controllers.util import log
from pylons.i18n import get_lang, set_lang
from webhelpers.html.tags import *
from routes import url_for
from pylons.controllers.util import redirect... | Python |
# -*- coding: utf-8 -*-
from pylons import Response, c, g, cache, request, session
from pylons.controllers import WSGIController
from pylons.decorators import jsonify, validate
from pylons.templating import render, render_response
from pylons.i18n import N_, _, ungettext
from ferlons.model import meta
from ferlons.mode... | Python |
"""The application's Globals object"""
from pylons import config
class Globals(object):
"""Globals acts as a container for objects available throughout the life of
the application.
"""
def __init__(self):
"""One instance of Globals is created during application initialization
and is av... | Python |
#!BPY
"""
Name: 'OGRE Scene'
Blender: 244
Group: 'Export'
Tooltip: 'Exports the current scene to OGRE'
"""
__author__ = ['Michael Reimpell']
__version__ = '0.0.0'
__url__ = ['OGRE website, http://www.ogre3d.org',
'OGRE forum, http://www.ogre3d.org/phpBB2/']
__bpydoc__ = "Please see the external documentation that co... | Python |
'''
https://svn.blender.org/svnroot/bf-extensions/extern/py/scripts/addons/luxrender/addon_data.py
bl_addon_data = {
(2,5,4): {
(0,7,1): {
'api_compatibility': {
32591:{
(0,7,1): (1105,-1)
}
},
'binary_urls': {
'linux-32': ('http://www.luxrender.net/release/pylux/0.7.1/lin/32/pylux.so.gz'... | Python |
###########################################################################
# program: jacobi_eigen_solver.py
# author: Chunlei Xu
# version: 2.0
# date: Mar... | Python |
"""numerictypes: Define the numeric type objects
This module is designed so 'from numerictypes import *' is safe.
Exported symbols include:
Dictionary with all registered number types (including aliases):
typeDict
Numeric type objects:
Bool
Int8 Int16 Int32 Int64
UInt8 UInt16 UInt32 UInt64
Fl... | Python |
__all__ = ['NewAxis', 'ArrayType']
from numpy import newaxis as NewAxis, ndarray as ArrayType
| Python |
__all__ = ['abs', 'absolute', 'add', 'arccos', 'arccosh', 'arcsin', 'arcsinh',
'arctan', 'arctan2', 'arctanh', 'bitwise_and', 'bitwise_not',
'bitwise_or', 'bitwise_xor', 'ceil', 'cos', 'cosh', 'divide',
'equal', 'exp', 'fabs', 'floor', 'floor_divide',
'fmod', 'greater', 'gre... | Python |
try:
from stsci.convolve import *
except ImportError:
try:
from scipy.stsci.convolve import *
except ImportError:
msg = \
"""The convolve package is not installed.
It can be downloaded by checking out the latest source from
http://svn.scipy.org/svn/scipy/trunk/Lib/stsci or by downloading an... | Python |
""" This module contains a "session saver" which saves the state of a
NumPy session to a file. At a later time, a different Python
process can be started and the saved session can be restored using
load().
The session saver relies on the Python pickle protocol to save and
restore objects. Objects which are not thems... | Python |
from os.path import join
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('numarray',parent_package,top_path)
config.add_data_files('include/numpy/*')
config.add_extension('_capi',
sources=['_capi.c... | Python |
try:
from ndimage import *
except ImportError:
try:
from scipy.ndimage import *
except ImportError:
msg = \
"""The nd_image package is not installed
It can be downloaded by checking out the latest source from
http://svn.scipy.org/svn/scipy/trunk/Lib/ndimage or by downloading and
installing ... | Python |
from numpy.oldnumeric.mlab import *
import numpy.oldnumeric.mlab as nom
__all__ = nom.__all__
del nom
| Python |
"""
This module converts code written for numpy.numarray to work
with numpy
FIXME: finish this.
"""
#__all__ = ['convertfile', 'convertall', 'converttree']
__all__ = []
import warnings
warnings.warn("numpy.numarray.alter_code2 is not working yet.")
import sys
import os
import glob
def makenewfile(name, filestr):
... | Python |
from numpy.oldnumeric.linear_algebra import *
import numpy.oldnumeric.linear_algebra as nol
__all__ = list(nol.__all__)
__all__ += ['qr_decomposition']
from numpy.linalg import qr as _qr
def qr_decomposition(a, mode='full'):
res = _qr(a, mode)
if mode == 'full':
return res
return (None, res)
| Python |
from os.path import join
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('numarray',parent_package,top_path)
config.add_data_files('include/numpy/')
config.add_sconscript('SConstruct', source_files = ['_capi.c'])
retur... | Python |
from numpy.oldnumeric.ma import *
| Python |
__all__ = ['ArgumentError', 'F', 'beta', 'binomial', 'chi_square',
'exponential', 'gamma', 'get_seed', 'multinomial',
'multivariate_normal', 'negative_binomial', 'noncentral_F',
'noncentral_chi_square', 'normal', 'permutation', 'poisson',
'randint', 'random', 'random_integer... | Python |
import os
import numpy as np
__all__ = ['MathDomainError', 'UnderflowError', 'NumOverflowError',
'handleError', 'get_numarray_include_dirs']
class MathDomainError(ArithmeticError):
pass
class UnderflowError(ArithmeticError):
pass
class NumOverflowError(OverflowError, ArithmeticError):
pass
... | Python |
from numpy.oldnumeric.fft import *
import numpy.oldnumeric.fft as nof
__all__ = nof.__all__
del nof
| Python |
__all__ = ['Matrix']
from numpy import matrix as _matrix
def Matrix(data, typecode=None, copy=1, savespace=0):
return _matrix(data, typecode, copy=copy)
| Python |
# missing Numarray defined names (in from numarray import *)
##__all__ = ['ClassicUnpickler', 'Complex32_fromtype',
## 'Complex64_fromtype', 'ComplexArray', 'Error',
## 'MAX_ALIGN', 'MAX_INT_SIZE', 'MAX_LINE_WIDTH',
## 'NDArray', 'NewArray', 'NumArray',
## 'NumError', 'PRECISION'... | Python |
"""
This module converts code written for numarray to run with numpy
Makes the following changes:
* Changes import statements
import numarray.package
--> import numpy.numarray.package as numarray_package
with all numarray.package in code changed to numarray_package
import numarray --> import... | Python |
from util import *
from numerictypes import *
from functions import *
from ufuncs import *
from compat import *
from session import *
import util
import numerictypes
import functions
import ufuncs
import compat
import session
__all__ = ['session', 'numerictypes']
__all__ += util.__all__
__all__ += numerictypes.__all_... | Python |
try:
from stsci.image import *
except ImportError:
try:
from scipy.stsci.image import *
except ImportError:
msg = \
"""The image package is not installed
It can be downloaded by checking out the latest source from
http://svn.scipy.org/svn/scipy/trunk/Lib/stsci or by downloading and
installi... | Python |
#===============================================================================
# encoding utf-8
# author :kanchan mahajan
# module : this module is a part of educational project
# and the calculations here are done according to conventional theory
# book of Finite Elelement Methods
#
# CAUTION: This code is onlly for... | Python |
###########################################################################
# program: jacobi_eigen_solver.py
# author: Chunlei Xu
# version: 2.0
# date:... | Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.