code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
""" Functions to get the initial data for the shock tube problems """
import numpy
import pysph.base.api as base
def get_shock_tube_data(nl, nr, xl, xr,
pl, pr, rhol, rhor, ul, ur,
g1, g2, h0, gamma=1.4,
m0=None):
dxl = numpy.abs(xl)/nl
... | [
[
8,
0,
0.0099,
0.0099,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0297,
0.0099,
0,
0.66,
0.3333,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.0495,
0.0099,
0,
0.66... | [
"\"\"\" Functions to get the initial data for the shock tube problems \"\"\"",
"import numpy",
"import pysph.base.api as base",
"def get_shock_tube_data(nl, nr, xl, xr,\n pl, pr, rhol, rhor, ul, ur,\n g1, g2, h0, gamma=1.4,\n m0=None):\n\n ... |
""" An example script for running the shock tube problem using Standard
SPH.
Global properties for the shock tube problem:
---------------------------------------------
x ~ [-.6,.6], dxl = 0.001875, dxr = dxl*4, m = dxl, h = 2*dxr
rhol = 1.0, rhor = 0.25, el = 2.5, er = 1.795, pl = 1.0, pr = 0.1795
These are obtaine... | [
[
8,
0,
0.12,
0.22,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.24,
0.02,
0,
0.66,
0.0667,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.28,
0.02,
0,
0.66,
0.1333... | [
"\"\"\" An example script for running the shock tube problem using Standard\nSPH.\n\nGlobal properties for the shock tube problem:\n---------------------------------------------\nx ~ [-.6,.6], dxl = 0.001875, dxr = dxl*4, m = dxl, h = 2*dxr\nrhol = 1.0, rhor = 0.25, el = 2.5, er = 1.795, pl = 1.0, pr = 0.1795",
"... |
""" Standard shock tube problem by Monaghan """
import numpy
import pysph.base.api as base
import pysph.solver.api as solver
import get_shock_tube_data as data
CLDomain = base.DomainManagerType
CLLocator = base.OpenCLNeighborLocatorType
Locator = base.NeighborLocatorType
kernel = base.CubicSplineKernel
hks=False
... | [
[
8,
0,
0.0118,
0.0118,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0353,
0.0118,
0,
0.66,
0.0244,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.0588,
0.0118,
0,
0.66... | [
"\"\"\" Standard shock tube problem by Monaghan \"\"\"",
"import numpy",
"import pysph.base.api as base",
"import pysph.solver.api as solver",
"import get_shock_tube_data as data",
"CLDomain = base.DomainManagerType",
"CLLocator = base.OpenCLNeighborLocatorType",
"Locator = base.NeighborLocatorType",
... |
""" Cylindrical Noh's implosion problem using the ADKE algorithm.
Particles are distributed on concentric circles about the origin with
increasing number of particles with increasing radius. The velocity is
initially uniform and directed towards the origin.
"""
import numpy
import pysph.sph.api as sp
import pysph.ba... | [
[
8,
0,
0.037,
0.0648,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0833,
0.0093,
0,
0.66,
0.0333,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.0926,
0.0093,
0,
0.66,... | [
"\"\"\" Cylindrical Noh's implosion problem using the ADKE algorithm.\n\nParticles are distributed on concentric circles about the origin with\nincreasing number of particles with increasing radius. The velocity is\ninitially uniform and directed towards the origin.\n\n\"\"\"",
"import numpy",
"import pysph.sph... |
"""Sedov point explosion problem using the ADKE algorithm.
Particles are distributed on concentric circles about the origin with
increasing number of particles with increasing radius. A unit charge
is distributed about the center which gives the initial pressure
disturbance.
"""
import numpy
import pysph.sph.api as... | [
[
8,
0,
0.0395,
0.0702,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0877,
0.0088,
0,
0.66,
0.0312,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.1053,
0.0088,
0,
0.66... | [
"\"\"\"Sedov point explosion problem using the ADKE algorithm.\n\nParticles are distributed on concentric circles about the origin with\nincreasing number of particles with increasing radius. A unit charge\nis distributed about the center which gives the initial pressure\ndisturbance.\n\n\"\"\"",
"import numpy",
... |
""" Shock tube problem with the ADKE procedure of Sigalotti """
import pysph.solver.api as solver
import pysph.base.api as base
import pysph.sph.api as sph
from pysph.base.kernels import CubicSplineKernel
import numpy
Fluid = base.ParticleType.Fluid
Boundary = base.ParticleType.Boundary
# Shock tube parameters
nl ... | [
[
8,
0,
0.0044,
0.0044,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0133,
0.0044,
0,
0.66,
0.0233,
683,
0,
1,
0,
0,
683,
0,
0
],
[
1,
0,
0.0177,
0.0044,
0,
0.66... | [
"\"\"\" Shock tube problem with the ADKE procedure of Sigalotti \"\"\"",
"import pysph.solver.api as solver",
"import pysph.base.api as base",
"import pysph.sph.api as sph",
"from pysph.base.kernels import CubicSplineKernel",
"import numpy",
"Fluid = base.ParticleType.Fluid",
"Boundary = base.Particle... |
""" Strong blaswave problem proposed by Sigalotti. Mach number = 771 """
import numpy
import pysph.base.api as base
import pysph.solver.api as solver
import get_shock_tube_data as data
Locator = base.NeighborLocatorType
kernel = base.CubicSplineKernel
hks=False
# shock tube parameters
xl = -1.5; xr = 1.5
pl = 1e4... | [
[
8,
0,
0.0122,
0.0122,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0366,
0.0122,
0,
0.66,
0.0244,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.061,
0.0122,
0,
0.66,... | [
"\"\"\" Strong blaswave problem proposed by Sigalotti. Mach number = 771 \"\"\"",
"import numpy",
"import pysph.base.api as base",
"import pysph.solver.api as solver",
"import get_shock_tube_data as data",
"Locator = base.NeighborLocatorType",
"kernel = base.CubicSplineKernel",
"hks=False",
"xl = -1... |
""" An example solving the Ellptical drop test case """
import pysph.base.api as base
import pysph.solver.api as solver
import warnings
dt = 1e-4
tf = 0.0076
app = solver.Application()
# set the integrator type
integrator_type = solver.RK2Integrator
s = solver.FluidSolver(dim=2, integrator_type=integrator_type)
... | [
[
8,
0,
0.0189,
0.0189,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0566,
0.0189,
0,
0.66,
0.0714,
212,
0,
1,
0,
0,
212,
0,
0
],
[
1,
0,
0.0755,
0.0189,
0,
0.66... | [
"\"\"\" An example solving the Ellptical drop test case \"\"\"",
"import pysph.base.api as base",
"import pysph.solver.api as solver",
"import warnings",
"dt = 1e-4",
"tf = 0.0076",
"app = solver.Application()",
"integrator_type = solver.RK2Integrator",
"s = solver.FluidSolver(dim=2, integrator_type... |
"""
PySPH
=====
A general purpose Smoothed Particle Hydrodynamics framework.
This package provides a general purpose framework for SPH simulations
in Python. The framework emphasizes flexibility and efficiency while
allowing most of the user code to be written in pure Python. See here:
http://pysph.googlecode.... | [
[
8,
0,
0.0379,
0.0707,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0808,
0.0051,
0,
0.66,
0.0312,
182,
0,
2,
0,
0,
182,
0,
0
],
[
14,
0,
0.0859,
0.0051,
0,
0.6... | [
"\"\"\"\nPySPH\n=====\n\nA general purpose Smoothed Particle Hydrodynamics framework.\n\nThis package provides a general purpose framework for SPH simulations\nin Python. The framework emphasizes flexibility and efficiency while",
"from setuptools import find_packages, setup",
"HAS_CYTHON=True",
"try:\n f... |
""" Helper functions to generate commonly used geometries.
PySPH used an axis convention as follows:
Y
|
|
|
|
|
| /Z
| /
| /
| /
| /
| /
|/_________________X
"""
import numpy
def create_2D_tank(x1,y1,x2,y2,dx):
""" Generate an open rectangular tank.
Parameters:
-----------
x1,y1... | [
[
8,
0,
0.0786,
0.15,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1643,
0.0071,
0,
0.66,
0.2,
954,
0,
1,
0,
0,
954,
0,
0
],
[
2,
0,
0.3143,
0.2786,
0,
0.66,
... | [
"\"\"\" Helper functions to generate commonly used geometries.\n\nPySPH used an axis convention as follows:\n\nY\n|\n|\n|",
"import numpy",
"def create_2D_tank(x1,y1,x2,y2,dx):\n \"\"\" Generate an open rectangular tank.\n\n Parameters:\n -----------\n\n x1,y1,x2,y2 : Coordinates defining the rectan... |
""" Module to implement various space filling curves for load balancing """
import numpy
from pysph.base.point import IntPoint
try:
from hilbert import Hilbert_to_int
have_hilbert = True
except ImportError:
# TODO: implement Hilbert's SFC
have_hilbert = False
def morton_sfc(cell_id, maxlen=20, dim=3):... | [
[
8,
0,
0.0217,
0.0217,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0652,
0.0217,
0,
0.66,
0.1429,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.087,
0.0217,
0,
0.66,... | [
"\"\"\" Module to implement various space filling curves for load balancing \"\"\"",
"import numpy",
"from pysph.base.point import IntPoint",
"try:\n from hilbert import Hilbert_to_int\n have_hilbert = True\nexcept ImportError:\n # TODO: implement Hilbert's SFC\n have_hilbert = False",
" from... |
from parallel_manager import ParallelManager
from parallel_controller import ParallelController
from pysph.base.particle_array import get_local_real_tag, get_dummy_tag
from pysph.base.fast_utils import arange_long
# logger imports
import logging
logger = logging.getLogger()
# Constants
Dummy = get_dummy_tag()
LocalR... | [
[
1,
0,
0.0118,
0.0118,
0,
0.66,
0,
501,
0,
1,
0,
0,
501,
0,
0
],
[
1,
0,
0.0235,
0.0118,
0,
0.66,
0.125,
346,
0,
1,
0,
0,
346,
0,
0
],
[
1,
0,
0.0471,
0.0118,
0,
0... | [
"from parallel_manager import ParallelManager",
"from parallel_controller import ParallelController",
"from pysph.base.particle_array import get_local_real_tag, get_dummy_tag",
"from pysph.base.fast_utils import arange_long",
"import logging",
"logger = logging.getLogger()",
"Dummy = get_dummy_tag()",
... |
"""
Module to implement parallel decomposition of particles to assign to
different processes during parallel simulations. The method used is an
extension of k-means clustering algorithm
"""
# logging imports
import logging
logger = logging.getLogger()
# standard imports
import numpy
# local imports
from pysph.base.c... | [
[
8,
0,
0.0096,
0.0159,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0255,
0.0032,
0,
0.66,
0.1,
715,
0,
1,
0,
0,
715,
0,
0
],
[
14,
0,
0.0287,
0.0032,
0,
0.66,
... | [
"\"\"\"\nModule to implement parallel decomposition of particles to assign to\ndifferent processes during parallel simulations. The method used is an\nextension of k-means clustering algorithm\n\"\"\"",
"import logging",
"logger = logging.getLogger()",
"import numpy",
"from pysph.base.cell import py_constru... |
"""
Contains class to perform load balancing using space filling curves.
"""
# logging imports
import logging
logger = logging.getLogger()
# standard imports
import numpy
# local imports
from pysph.base.particle_array import ParticleArray
from pysph.base.cell import py_construct_immediate_neighbor_list
from load_bal... | [
[
8,
0,
0.0213,
0.0319,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0638,
0.0106,
0,
0.66,
0.125,
715,
0,
1,
0,
0,
715,
0,
0
],
[
14,
0,
0.0745,
0.0106,
0,
0.66... | [
"\"\"\"\nContains class to perform load balancing using space filling curves.\n\"\"\"",
"import logging",
"logger = logging.getLogger()",
"import numpy",
"from pysph.base.particle_array import ParticleArray",
"from pysph.base.cell import py_construct_immediate_neighbor_list",
"from load_balancer import ... |
""" Contains class to perform load balancing.
"""
#FIXME: usage documentation
# logging imports
import logging
logger = logging.getLogger()
# standard imports
import numpy
# local imports
from pysph.base.particle_array import ParticleArray, get_particle_array
from pysph.base.cell import CellManager, py_construct_im... | [
[
8,
0,
0.001,
0.0013,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0047,
0.0007,
0,
0.66,
0.1111,
715,
0,
1,
0,
0,
715,
0,
0
],
[
14,
0,
0.0053,
0.0007,
0,
0.66... | [
"\"\"\" Contains class to perform load balancing.\n\"\"\"",
"import logging",
"logger = logging.getLogger()",
"import numpy",
"from pysph.base.particle_array import ParticleArray, get_particle_array",
"from pysph.base.cell import CellManager, py_construct_immediate_neighbor_list",
"TAG_LB_PARTICLE_REQUE... |
""" Tests for the parallel cell manager """
import nose.plugins.skip as skip
raise skip.SkipTest("Dont run this test via nose")
from pysph.parallel.simple_block_manager import SimpleBlockManager
from pysph.base.particles import Particles
from pysph.base.particle_array import get_particle_array
from pysph.base.point i... | [
[
8,
0,
0.0049,
0.0049,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0148,
0.0049,
0,
0.66,
0.0256,
548,
0,
1,
0,
0,
548,
0,
0
],
[
1,
0,
0.0296,
0.0049,
0,
0.66... | [
"\"\"\" Tests for the parallel cell manager \"\"\"",
"import nose.plugins.skip as skip",
"from pysph.parallel.simple_block_manager import SimpleBlockManager",
"from pysph.base.particles import Particles",
"from pysph.base.particle_array import get_particle_array",
"from pysph.base.point import IntPoint",
... |
""" Tests for the parallel cell manager """
import nose.plugins.skip as skip
raise skip.SkipTest("Dont run this test via nose")
import pysph.base.api as base
import pysph.parallel.api as parallel
import numpy
import pylab
import time
# mpi imports
from mpi4py import MPI
comm = MPI.COMM_WORLD
num_procs = comm.Get_si... | [
[
1,
0,
0.0147,
0.0147,
0,
0.66,
0,
548,
0,
1,
0,
0,
548,
0,
0
],
[
1,
0,
0.0294,
0.0147,
0,
0.66,
0.1,
212,
0,
1,
0,
0,
212,
0,
0
],
[
1,
0,
0.0441,
0.0147,
0,
0.6... | [
"import nose.plugins.skip as skip",
"import pysph.base.api as base",
"import pysph.parallel.api as parallel",
"import numpy",
"import pylab",
"import time",
"from mpi4py import MPI",
"def draw_cell(cell, color=\"b\"):\n centroid = base.Point()\n cell.get_centroid(centroid)\n \n half_size =... |
""" Tests for the parallel cell manager """
import pysph.base.api as base
import pysph.parallel.api as parallel
import numpy
import time
import pdb
# mpi imports
from mpi4py import MPI
comm = MPI.COMM_WORLD
num_procs = comm.Get_size()
pid = comm.Get_rank()
import logging
logger = logging.getLogger()
logger.setLevel... | [
[
1,
0,
0.1111,
0.1111,
0,
0.66,
0,
212,
0,
1,
0,
0,
212,
0,
0
],
[
1,
0,
0.2222,
0.1111,
0,
0.66,
0.1667,
496,
0,
1,
0,
0,
496,
0,
0
],
[
1,
0,
0.4444,
0.1111,
0,
... | [
"import pysph.base.api as base",
"import pysph.parallel.api as parallel",
"import numpy",
"import time",
"import pdb",
"from mpi4py import MPI",
"import logging"
] |
"""
Simple script to check if the load balancing works on 2-d data.
"""
try:
import mpi4py.MPI as mpi
except ImportError:
import nose.plugins.skip as skip
reason = "mpi4py not installed"
raise skip.SkipTest(reason)
# mpi imports
from mpi4py import MPI
comm = MPI.COMM_WORLD
num_procs = comm.Get_size()
... | [
[
8,
0,
0.0351,
0.0526,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
7,
0,
0.1316,
0.1053,
0,
0.66,
0.05,
0,
0,
1,
0,
0,
0,
0,
1
],
[
1,
1,
0.1053,
0.0175,
1,
0.02,
... | [
"\"\"\"\nSimple script to check if the load balancing works on 2-d data.\n\"\"\"",
"try:\n import mpi4py.MPI as mpi\nexcept ImportError:\n import nose.plugins.skip as skip\n reason = \"mpi4py not installed\"\n raise skip.SkipTest(reason)",
" import mpi4py.MPI as mpi",
" import nose.plugins.s... |
""" Test the share_data function for various cases
cases to run are chosen based on the size of the MPI.COMM_wORLD
case 1: for 5 processes
Processors arrangement:
4
0 1 2 3
Nbr lists:
0: 1,4
1: 0,2,4
2: 1,3,4
3: 2
4: 0,1,2
case 2: for 2 processes
both neighbors of each other
case 3,4,5: n processes (n>1 for case... | [
[
8,
0,
0.0851,
0.1631,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
7,
0,
0.195,
0.0426,
0,
0.66,
0.0833,
0,
0,
1,
0,
0,
0,
0,
1
],
[
1,
1,
0.1844,
0.0071,
1,
0.08,
... | [
"\"\"\" Test the share_data function for various cases\n\ncases to run are chosen based on the size of the MPI.COMM_wORLD\n\ncase 1: for 5 processes\nProcessors arrangement:\n 4\n0 1 2 3",
"try:\n import mpi4py.MPI as mpi\nexcept ImportError:\n import nose.plugins.skip as skip\n reason = \"mpi4py not in... |
"""
Simple script to check if the load balancing works on 1-d data.
"""
try:
import mpi4py.MPI as mpi
except ImportError:
import nose.plugins.skip as skip
reason = "mpi4py not installed"
raise skip.SkipTest(reason)
# mpi imports
from mpi4py import MPI
comm = MPI.COMM_WORLD
num_procs = comm.Get_size()
... | [
[
8,
0,
0.0339,
0.0508,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
7,
0,
0.1271,
0.1017,
0,
0.66,
0.05,
0,
0,
1,
0,
0,
0,
0,
1
],
[
1,
1,
0.1017,
0.0169,
1,
0.29,
... | [
"\"\"\"\nSimple script to check if the load balancing works on 1-d data.\n\"\"\"",
"try:\n import mpi4py.MPI as mpi\nexcept ImportError:\n import nose.plugins.skip as skip\n reason = \"mpi4py not installed\"\n raise skip.SkipTest(reason)",
" import mpi4py.MPI as mpi",
" import nose.plugins.s... |
""" Some checks for the parallel cell manager.
Run this script only with less than 5 processors.
example : mpiexec -n 2 python parallel_cell_check.py
"""
import time
try:
import mpi4py.MPI as mpi
except ImportError:
import nose.plugins.skip as skip
reason = "mpi4py not installed"
raise skip.SkipTest(... | [
[
8,
0,
0.0244,
0.0407,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0569,
0.0081,
0,
0.66,
0.0556,
654,
0,
1,
0,
0,
654,
0,
0
],
[
7,
0,
0.0935,
0.0488,
0,
0.66... | [
"\"\"\" Some checks for the parallel cell manager.\n\nRun this script only with less than 5 processors.\nexample : mpiexec -n 2 python parallel_cell_check.py\n\"\"\"",
"import time",
"try:\n import mpi4py.MPI as mpi\nexcept ImportError:\n import nose.plugins.skip as skip\n reason = \"mpi4py not install... |
#!/bin/env python
"""
Simple test for checking if the control tree is setup properly.
Run this script with the following command
mpiexec -n [num_procs] python controller_check.py
"""
try:
import mpi4py.MPI as mpi
except ImportError:
import nose.plugins.skip as skip
reason = "mpi4py not installed"
rai... | [
[
8,
0,
0.0877,
0.1228,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
7,
0,
0.2193,
0.1053,
0,
0.66,
0.0667,
0,
0,
1,
0,
0,
0,
0,
1
],
[
1,
1,
0.193,
0.0175,
1,
0.96,
... | [
"\"\"\"\nSimple test for checking if the control tree is setup properly.\n\nRun this script with the following command\n\nmpiexec -n [num_procs] python controller_check.py\n\"\"\"",
"try:\n import mpi4py.MPI as mpi\nexcept ImportError:\n import nose.plugins.skip as skip\n reason = \"mpi4py not installed\... |
"""A parallel manager that uses blocks to partition the domain. At
every iteration, the particles are placed in large bins and these bins
are exchanged across processors.
"""
from parallel_controller import ParallelController
from parallel_manager import ParallelManager
from parallel_cell import share_data
from pys... | [
[
8,
0,
0.0056,
0.0094,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0131,
0.0019,
0,
0.66,
0.0833,
346,
0,
1,
0,
0,
346,
0,
0
],
[
1,
0,
0.015,
0.0019,
0,
0.66,... | [
"\"\"\"A parallel manager that uses blocks to partition the domain. At\nevery iteration, the particles are placed in large bins and these bins\nare exchanged across processors. \n\n\"\"\"",
"from parallel_controller import ParallelController",
"from parallel_manager import ParallelManager",
"from parallel_cel... |
"""API module to simplify import of common names from pysph.parallel package"""
from parallel_cell import ParallelCellManager, ProcessorMap
| [
[
8,
0,
0.2,
0.2,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.6,
0.2,
0,
0.66,
1,
568,
0,
2,
0,
0,
568,
0,
0
]
] | [
"\"\"\"API module to simplify import of common names from pysph.parallel package\"\"\"",
"from parallel_cell import ParallelCellManager, ProcessorMap"
] |
""" Contains class to perform load balancing using METIS[1]/SCOTCH[2]
[1] METIS: http://glaros.dtc.umn.edu/gkhome/views/metis
[2] SCOTCH: http://www.labri.fr/perso/pelegrin/scotch/
Note: Either of METIS/SCOTCH is acceptable. Installing one of these is enough.
First METIS is attempted to load and if it fails SCOTCH is... | [
[
8,
0,
0.0281,
0.051,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0663,
0.0051,
0,
0.66,
0.0625,
715,
0,
1,
0,
0,
715,
0,
0
],
[
14,
0,
0.0714,
0.0051,
0,
0.66... | [
"\"\"\" Contains class to perform load balancing using METIS[1]/SCOTCH[2]\n\n[1] METIS: http://glaros.dtc.umn.edu/gkhome/views/metis\n[2] SCOTCH: http://www.labri.fr/perso/pelegrin/scotch/\n\nNote: Either of METIS/SCOTCH is acceptable. Installing one of these is enough.\nFirst METIS is attempted to load and if it f... |
import pysph.base.api as base
import pysph.solver.api as solver
import pysph.sph.api as sph
if solver.HAS_CL:
import pyopencl as cl
else:
try:
import nose.plugins.skip as skip
reason = "PyOpenCL not installed"
raise skip.SkipTest(reason)
except ImportError:
pass
import... | [
[
1,
0,
0.0071,
0.0071,
0,
0.66,
0,
212,
0,
1,
0,
0,
212,
0,
0
],
[
1,
0,
0.0143,
0.0071,
0,
0.66,
0.1111,
683,
0,
1,
0,
0,
683,
0,
0
],
[
1,
0,
0.0214,
0.0071,
0,
... | [
"import pysph.base.api as base",
"import pysph.solver.api as solver",
"import pysph.sph.api as sph",
"if solver.HAS_CL:\n import pyopencl as cl\n\nelse:\n try:\n import nose.plugins.skip as skip\n reason = \"PyOpenCL not installed\"\n raise skip.SkipTest(reason)",
" import pyop... |
"""
Module containing some data required for tests of the sph module.
"""
# standard imports
import numpy
# local imports
from pysph.base.particle_array import *
def generate_sample_dataset_1():
"""
Generate test test data.
Look at image sph_test_data1.png
"""
x = numpy.array([-1.0, 0.0, 1.0, -1.0... | [
[
8,
0,
0.0328,
0.0492,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.082,
0.0164,
0,
0.66,
0.25,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.1311,
0.0164,
0,
0.66,
... | [
"\"\"\"\nModule containing some data required for tests of the sph module.\n\"\"\"",
"import numpy",
"from pysph.base.particle_array import *",
"def generate_sample_dataset_1():\n \"\"\"\n Generate test test data.\n Look at image sph_test_data1.png\n \"\"\"\n x = numpy.array([-1.0, 0.0, 1.0, -1... |
"""API module to simplify import of common names from pysph.sph package"""
#Import from calc
from sph_calc import SPHCalc, CLCalc
from sph_func import SPHFunction, SPHFunctionParticle, CSPHFunctionParticle
############################################################################
# IMPORT FUNCTIONS
################... | [
[
8,
0,
0.0145,
0.0145,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.058,
0.0145,
0,
0.66,
0.0588,
671,
0,
2,
0,
0,
671,
0,
0
],
[
1,
0,
0.0725,
0.0145,
0,
0.66,... | [
"\"\"\"API module to simplify import of common names from pysph.sph package\"\"\"",
"from sph_calc import SPHCalc, CLCalc",
"from sph_func import SPHFunction, SPHFunctionParticle, CSPHFunctionParticle",
"from funcs.basic_funcs import SPHGradient, \\\n SPHLaplacian, CountNeighbors, SPH as SPHInterpolation,... |
import numpy
from pysph.solver.cl_utils import cl_read, get_real, HAS_CL, get_pysph_root,\
create_some_context, enqueue_copy
import pysph.solver.cl_utils as clu
if HAS_CL:
import pyopencl as cl
mf = cl.mem_flags
# Cython functions for neighbor list construction
from nnps_util import cbin, unflatten
fro... | [
[
1,
0,
0.001,
0.001,
0,
0.66,
0,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.0034,
0.0019,
0,
0.66,
0.0909,
529,
0,
6,
0,
0,
529,
0,
0
],
[
1,
0,
0.0058,
0.001,
0,
0.6... | [
"import numpy",
"from pysph.solver.cl_utils import cl_read, get_real, HAS_CL, get_pysph_root,\\\n create_some_context, enqueue_copy",
"import pysph.solver.cl_utils as clu",
"if HAS_CL:\n import pyopencl as cl\n mf = cl.mem_flags",
" import pyopencl as cl",
" mf = cl.mem_flags",
"from nnps... |
# OpenCL conditional imports
import pysph.solver.cl_utils as clu
if clu.HAS_CL:
import pyopencl as cl
mf = cl.mem_flags
import numpy as np
class Scan(object):
def __init__(self, GPUContext,
CommandQueue,
numElements):
# Constants
MAX_WORKGROUP_INCLUSIVE... | [
[
1,
0,
0.0208,
0.0104,
0,
0.66,
0,
529,
0,
1,
0,
0,
529,
0,
0
],
[
4,
0,
0.0521,
0.0312,
0,
0.66,
0.3333,
0,
7,
0,
0,
0,
0,
0,
0
],
[
1,
1,
0.0521,
0.0104,
1,
0.28... | [
"import pysph.solver.cl_utils as clu",
"if clu.HAS_CL:\n import pyopencl as cl\n mf = cl.mem_flags",
" import pyopencl as cl",
" mf = cl.mem_flags",
"import numpy as np",
"class Scan(object):\n def __init__(self, GPUContext,\n CommandQueue,\n numElements):\n\... |
#! python
'''
Module to collect and generate source files from template files
The template files have very similar syntax to php files.
* All text in input is copied straight to output except that within
`<?py` and `?>` tags.
* Text within `<?py=` and `?>` tags is evaluated and the result is written
into the out... | [
[
8,
0,
0.1199,
0.2192,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2397,
0.0068,
0,
0.66,
0.1,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.2466,
0.0068,
0,
0.66,
... | [
"'''\nModule to collect and generate source files from template files\n\nThe template files have very similar syntax to php files.\n\n * All text in input is copied straight to output except that within\n`<?py` and `?>` tags.",
"import os",
"import sys",
"import re",
"from StringIO import StringIO",
"def... |
import nnps_util as util
import pysph.solver.cl_utils as clu
import numpy
# PySPH imports
from carray import LongArray
#CHANGE
class OpenCLNeighborLocatorType:
AllPairNeighborLocator = 0
LinkedListSPHNeighborLocator = 1
RadixSortNeighborLocator = 2
class OpenCLNeighborLocator(object):
pass
class Lin... | [
[
1,
0,
0.0008,
0.0008,
0,
0.66,
0,
501,
0,
1,
0,
0,
501,
0,
0
],
[
1,
0,
0.0017,
0.0008,
0,
0.66,
0.125,
529,
0,
1,
0,
0,
529,
0,
0
],
[
1,
0,
0.0034,
0.0008,
0,
0... | [
"import nnps_util as util",
"import pysph.solver.cl_utils as clu",
"import numpy",
"from carray import LongArray",
"class OpenCLNeighborLocatorType:\n AllPairNeighborLocator = 0\n LinkedListSPHNeighborLocator = 1\n RadixSortNeighborLocator = 2",
" AllPairNeighborLocator = 0",
" LinkedList... |
# standard imports
import numpy
# local imports
from pysph.base.particle_array import *
def generate_sample_dataset_1():
"""
Generate test test data.
Look at image test_cell_case1.png for details.
"""
x = numpy.array([0.25, 0.8, 0.5, 0.8, 0.2, 0.5, 1.5, 1.5])
y = numpy.array([0.25, 0.1, 0.5,... | [
[
1,
0,
0.0455,
0.0227,
0,
0.66,
0,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.1136,
0.0227,
0,
0.66,
0.3333,
505,
0,
1,
0,
0,
505,
0,
0
],
[
2,
0,
0.4091,
0.4773,
0,
... | [
"import numpy",
"from pysph.base.particle_array import *",
"def generate_sample_dataset_1():\n \"\"\"\n Generate test test data.\n\n Look at image test_cell_case1.png for details.\n \"\"\"\n x = numpy.array([0.25, 0.8, 0.5, 0.8, 0.2, 0.5, 1.5, 1.5])\n y = numpy.array([0.25, 0.1, 0.5, 0.8, 0.9,... |
"""
Tests for the particle array module.
"""
# standard imports
import unittest
import numpy
# local imports
import pysph
from pysph.base import particle_array
from pysph.base.carray import LongArray, IntArray, DoubleArray
from pysph.base import carray
import pickle
def check_array(x, y):
"""Check if two arrays... | [
[
8,
0,
0.0034,
0.0051,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0102,
0.0017,
0,
0.66,
0.1,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0119,
0.0017,
0,
0.66,
... | [
"\"\"\"\nTests for the particle array module.\n\"\"\"",
"import unittest",
"import numpy",
"import pysph",
"from pysph.base import particle_array",
"from pysph.base.carray import LongArray, IntArray, DoubleArray",
"from pysph.base import carray",
"import pickle",
"def check_array(x, y):\n \"\"\"C... |
class ParticleType:
"""
An empty class to provide an enum for the different particle types
used in PySPH.
The types defined are:
Fluid -- The default particle type used to represent fluids.
Solid -- Use this to represent solids
DummyFluid --
Probe --
Boundary -- Boundary partic... | [
[
3,
0,
0.4595,
0.8919,
0,
0.66,
0,
894,
0,
1,
0,
0,
0,
0,
0
],
[
8,
1,
0.2973,
0.5135,
1,
0.33,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
1,
0.5676,
0.027,
1,
0.33,
0... | [
"class ParticleType:\n \"\"\"\n An empty class to provide an enum for the different particle types\n used in PySPH.\n\n The types defined are:\n\n Fluid -- The default particle type used to represent fluids.",
" \"\"\"\n An empty class to provide an enum for the different particle types\n ... |
from cell import CellManager
from nnps import NNPSManager, NeighborLocatorType
from particle_array import ParticleArray
from particle_types import ParticleType
from domain_manager import DomainManagerType as CLDomain
from locator import OpenCLNeighborLocatorType as CLLocator
import locator
import domain_manager
from... | [
[
1,
0,
0.0019,
0.0019,
0,
0.66,
0,
787,
0,
1,
0,
0,
787,
0,
0
],
[
1,
0,
0.0039,
0.0019,
0,
0.66,
0.05,
4,
0,
2,
0,
0,
4,
0,
0
],
[
1,
0,
0.0058,
0.0019,
0,
0.66,
... | [
"from cell import CellManager",
"from nnps import NNPSManager, NeighborLocatorType",
"from particle_array import ParticleArray",
"from particle_types import ParticleType",
"from domain_manager import DomainManagerType as CLDomain",
"from locator import OpenCLNeighborLocatorType as CLLocator",
"import lo... |
"""API module to simplify import of common names from pysph.base package"""
# fast utils
from fast_utils import arange_long
# carray
from carray import LongArray, DoubleArray, IntArray, FloatArray
from cell import Cell, CellManager, PeriodicDomain
from kernels import KernelBase, DummyKernel, CubicSplineKernel, \
... | [
[
8,
0,
0.0208,
0.0208,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0833,
0.0208,
0,
0.66,
0.0476,
525,
0,
1,
0,
0,
525,
0,
0
],
[
1,
0,
0.1458,
0.0208,
0,
0.66... | [
"\"\"\"API module to simplify import of common names from pysph.base package\"\"\"",
"from fast_utils import arange_long",
"from carray import LongArray, DoubleArray, IntArray, FloatArray",
"from cell import Cell, CellManager, PeriodicDomain",
"from kernels import KernelBase, DummyKernel, CubicSplineKernel,... |
''' Implement infrastructure for the solver to add various interfaces '''
from functools import wraps, partial
import threading, thread
from pysph.base.particle_array import ParticleArray
import logging
logger = logging.getLogger()
class DummyComm(object):
''' A dummy MPI.Comm implementation as placeholder for f... | [
[
8,
0,
0.0023,
0.0023,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0068,
0.0023,
0,
0.66,
0.0833,
711,
0,
2,
0,
0,
711,
0,
0
],
[
1,
0,
0.0091,
0.0023,
0,
0.66... | [
"''' Implement infrastructure for the solver to add various interfaces '''",
"from functools import wraps, partial",
"import threading, thread",
"from pysph.base.particle_array import ParticleArray",
"import logging",
"logger = logging.getLogger()",
"class DummyComm(object):\n ''' A dummy MPI.Comm im... |
"""
Module contains some common functions.
"""
# standard imports
import pickle
import numpy
import sys
import os
import platform
import commands
from numpy.lib import format
HAS_PBAR = True
try:
import progressbar
except ImportError:
HAS_PBAR = False
import pysph
def check_array(x, y):
"""Check if two ... | [
[
8,
0,
0.0049,
0.0073,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0146,
0.0024,
0,
0.66,
0.0435,
848,
0,
1,
0,
0,
848,
0,
0
],
[
1,
0,
0.017,
0.0024,
0,
0.66,... | [
"\"\"\"\nModule contains some common functions.\n\"\"\"",
"import pickle",
"import numpy",
"import sys",
"import os",
"import platform",
"import commands",
"from numpy.lib import format",
"HAS_PBAR = True",
"try:\n import progressbar\nexcept ImportError:\n HAS_PBAR = False",
" import pr... |
""" An example solver for the circular patch of fluid """
import numpy
from optparse import OptionGroup, Option
import pysph.base.api as base
import pysph.sph.api as sph
from pysph.sph.funcs import stress_funcs
from pysph.sph.funcs import eos_funcs
from pysph.sph.funcs import viscosity_funcs
from solver import Sol... | [
[
8,
0,
0.0033,
0.0033,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0098,
0.0033,
0,
0.66,
0.0588,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.0164,
0.0033,
0,
0.66... | [
"\"\"\" An example solver for the circular patch of fluid \"\"\"",
"import numpy",
"from optparse import OptionGroup, Option",
"import pysph.base.api as base",
"import pysph.sph.api as sph",
"from pysph.sph.funcs import stress_funcs",
"from pysph.sph.funcs import eos_funcs",
"from pysph.sph.funcs impo... |
from pysph.sph.sph_calc import SPHCalc
from pysph.sph.funcs.arithmetic_funcs import PropertyGet
import numpy
import logging
logger = logging.getLogger()
#############################################################################
#`Integrator` class
###################################################################... | [
[
1,
0,
0.0012,
0.0012,
0,
0.66,
0,
79,
0,
1,
0,
0,
79,
0,
0
],
[
1,
0,
0.0024,
0.0012,
0,
0.66,
0.0833,
653,
0,
1,
0,
0,
653,
0,
0
],
[
1,
0,
0.0047,
0.0012,
0,
0.... | [
"from pysph.sph.sph_calc import SPHCalc",
"from pysph.sph.funcs.arithmetic_funcs import PropertyGet",
"import numpy",
"import logging",
"logger = logging.getLogger()",
"class Integrator(object):\n \"\"\" The base class for all integrators. Currently, the following \n integrators are supported:\n ... |
import numpy
class TimeStep(object):
def compute_time_step(self, solver):
return solver.dt
class ViscousTimeStep(TimeStep):
def __init__(self, cfl, co, particles):
self.cfl = cfl
self.co = co
self.particles = particles
def compute_time_step(self, solver):
cfl =... | [
[
1,
0,
0.0141,
0.0141,
0,
0.66,
0,
954,
0,
1,
0,
0,
954,
0,
0
],
[
3,
0,
0.0634,
0.0563,
0,
0.66,
0.25,
373,
0,
1,
0,
0,
186,
0,
0
],
[
2,
1,
0.0775,
0.0282,
1,
0.... | [
"import numpy",
"class TimeStep(object):\n\n def compute_time_step(self, solver):\n return solver.dt",
" def compute_time_step(self, solver):\n return solver.dt",
" return solver.dt",
"class ViscousTimeStep(TimeStep):\n\n def __init__(self, cfl, co, particles):\n self.cf... |
from integrator import Integrator
from cl_utils import HAS_CL, get_pysph_root, get_cl_include,\
get_scalar_buffer, cl_read, get_real, enqueue_copy
if HAS_CL:
import pyopencl as cl
from os import path
import numpy
class CLIntegrator(Integrator):
def setup_integrator(self, context):
""" Setup the... | [
[
1,
0,
0.0026,
0.0026,
0,
0.66,
0,
352,
0,
1,
0,
0,
352,
0,
0
],
[
1,
0,
0.0065,
0.0052,
0,
0.66,
0.125,
842,
0,
7,
0,
0,
842,
0,
0
],
[
4,
0,
0.0144,
0.0052,
0,
0... | [
"from integrator import Integrator",
"from cl_utils import HAS_CL, get_pysph_root, get_cl_include,\\\n get_scalar_buffer, cl_read, get_real, enqueue_copy",
"if HAS_CL:\n import pyopencl as cl",
" import pyopencl as cl",
"from os import path",
"import numpy",
"class CLIntegrator(Integrator):\n\... |
""" Post step functions for the solver """
import pickle
import os
import pysph.base.api as base
from pysph.base.cell import py_find_cell_id
class SaveCellManagerData(object):
"""Post-step function to save the cell manager's data.
Two files are created, 'neighbors' contains partile neighbor
information ... | [
[
8,
0,
0.0097,
0.0097,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0291,
0.0097,
0,
0.66,
0.1667,
848,
0,
1,
0,
0,
848,
0,
0
],
[
1,
0,
0.0388,
0.0097,
0,
0.66... | [
"\"\"\" Post step functions for the solver \"\"\"",
"import pickle",
"import os",
"import pysph.base.api as base",
"from pysph.base.cell import py_find_cell_id",
"class SaveCellManagerData(object):\n \"\"\"Post-step function to save the cell manager's data.\n\n Two files are created, 'neighbors' con... |
# Standard imports.
import logging, os
from optparse import OptionParser, OptionGroup, Option
from os.path import basename, splitext, abspath
import sys
from utils import mkdir
# PySPH imports.
from pysph.base.particles import Particles, CLParticles, ParticleArray
from pysph.solver.controller import CommandManager
fr... | [
[
1,
0,
0.0034,
0.0017,
0,
0.66,
0,
715,
0,
2,
0,
0,
715,
0,
0
],
[
1,
0,
0.0051,
0.0017,
0,
0.66,
0.0769,
323,
0,
3,
0,
0,
323,
0,
0
],
[
1,
0,
0.0068,
0.0017,
0,
... | [
"import logging, os",
"from optparse import OptionParser, OptionGroup, Option",
"from os.path import basename, splitext, abspath",
"import sys",
"from utils import mkdir",
"from pysph.base.particles import Particles, CLParticles, ParticleArray",
"from pysph.solver.controller import CommandManager",
"f... |
""" A simple shock tube solver """
from optparse import OptionGroup, Option
import numpy
import pysph.base.api as base
import pysph.sph.api as sph
from solver import Solver
from sph_equation import SPHOperation, SPHIntegration
from integrator import GSPHIntegrator
Fluids = base.Fluid
Solids = base.Solid
Boundary = ... | [
[
8,
0,
0.0015,
0.0015,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0044,
0.0015,
0,
0.66,
0.0667,
323,
0,
2,
0,
0,
323,
0,
0
],
[
1,
0,
0.0059,
0.0015,
0,
0.66... | [
"\"\"\" A simple shock tube solver \"\"\"",
"from optparse import OptionGroup, Option",
"import numpy",
"import pysph.base.api as base",
"import pysph.sph.api as sph",
"from solver import Solver",
"from sph_equation import SPHOperation, SPHIntegration",
"from integrator import GSPHIntegrator",
"Flui... |
"""
Classes for generators of some simple elements.
"""
# standard imports
import logging
logger = logging.getLogger()
import numpy
# local imports
from pysph.base.carray import DoubleArray, LongArray
from pysph.base.nnps import *
from pysph.base.point import Point
from pysph.solver.particle_generator import *
from ... | [
[
8,
0,
0.0024,
0.0036,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0073,
0.0012,
0,
0.66,
0.0714,
715,
0,
1,
0,
0,
715,
0,
0
],
[
14,
0,
0.0085,
0.0012,
0,
0.6... | [
"\"\"\"\nClasses for generators of some simple elements.\n\"\"\"",
"import logging",
"logger = logging.getLogger()",
"import numpy",
"from pysph.base.carray import DoubleArray, LongArray",
"from pysph.base.nnps import *",
"from pysph.base.point import Point",
"from pysph.solver.particle_generator impo... |
HAS_CL = True
try:
import pyopencl as cl
except ImportError:
HAS_CL=False
from os import path
import numpy
from utils import get_pysph_root
# Return all available devices on the host
def get_cl_devices():
""" Return a dictionary keyed on device type for all devices """
_devices = {'CPU':[], 'GPU':[]... | [
[
14,
0,
0.0037,
0.0037,
0,
0.66,
0,
94,
1,
0,
0,
0,
0,
4,
0
],
[
7,
0,
0.0129,
0.0148,
0,
0.66,
0.0526,
0,
0,
1,
0,
0,
0,
0,
0
],
[
1,
1,
0.0111,
0.0037,
1,
0.67,
... | [
"HAS_CL = True",
"try:\n import pyopencl as cl\nexcept ImportError:\n HAS_CL=False",
" import pyopencl as cl",
" HAS_CL=False",
"from os import path",
"import numpy",
"from utils import get_pysph_root",
"def get_cl_devices():\n \"\"\" Return a dictionary keyed on device type for all dev... |
from numpy import arccos, sin, cos, array, sqrt, pi
r = 2.0/pi
dt = 1e-3
def force(x,y):
theta = arccos(x/sqrt((x**2+y**2)))
return array([-sin(theta), cos(theta)])
def rk2(nsteps=1000, x0=r, y0=0):
t = 0
xinitial = x0
yinitial = y0
while t < nsteps:
_x = xinitial
_y = yiniti... | [
[
1,
0,
0.0132,
0.0132,
0,
0.66,
0,
954,
0,
6,
0,
0,
954,
0,
0
],
[
14,
0,
0.0395,
0.0132,
0,
0.66,
0.1667,
436,
4,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0526,
0.0132,
0,
... | [
"from numpy import arccos, sin, cos, array, sqrt, pi",
"r = 2.0/pi",
"dt = 1e-3",
"def force(x,y):\n\n theta = arccos(x/sqrt((x**2+y**2)))\n return array([-sin(theta), cos(theta)])",
" theta = arccos(x/sqrt((x**2+y**2)))",
" return array([-sin(theta), cos(theta)])",
"def rk2(nsteps=1000, x0=... |
""" An example solver for the circular patch of fluid """
import numpy
import pysph.base.api as base
import pysph.sph.api as sph
from solver import Solver
from sph_equation import SPHOperation, SPHIntegration
Fluids = base.ParticleType.Fluid
Solids = base.ParticleType.Solid
def get_circular_patch(name="", type=0... | [
[
8,
0,
0.023,
0.0115,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.046,
0.0115,
0,
0.66,
0.1111,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.069,
0.0115,
0,
0.66,
... | [
"\"\"\" An example solver for the circular patch of fluid \"\"\"",
"import numpy",
"import pysph.base.api as base",
"import pysph.sph.api as sph",
"from solver import Solver",
"from sph_equation import SPHOperation, SPHIntegration",
"Fluids = base.ParticleType.Fluid",
"Solids = base.ParticleType.Solid... |
from integrator import EulerIntegrator, RK2Integrator, RK4Integrator,\
PredictorCorrectorIntegrator, LeapFrogIntegrator
from cl_integrator import CLEulerIntegrator
from sph_equation import SPHIntegration, SPHOperation
from solver import Solver
from shock_tube_solver import ShockTubeSolver, ADKEShockTubeSolver,\... | [
[
1,
0,
0.0395,
0.0526,
0,
0.66,
0,
352,
0,
5,
0,
0,
352,
0,
0
],
[
1,
0,
0.1053,
0.0263,
0,
0.66,
0.0714,
91,
0,
1,
0,
0,
91,
0,
0
],
[
1,
0,
0.1579,
0.0263,
0,
0.... | [
"from integrator import EulerIntegrator, RK2Integrator, RK4Integrator,\\\n PredictorCorrectorIntegrator, LeapFrogIntegrator",
"from cl_integrator import CLEulerIntegrator",
"from sph_equation import SPHIntegration, SPHOperation",
"from solver import Solver",
"from shock_tube_solver import ShockTubeSolver... |
#! /usr/bin/env python
# Author: Stefan Behnel <scoder@users.berlios.de>
# http://hg.cython.org/cython-devel/file/tip/Tools/cython-epydoc.py
#
# --------------------------------------------------------------------
import re
from epydoc import docstringparser as dsp
CYTHON_SIGNATURE_RE = re.compile(
# Class name ... | [
[
1,
0,
0.1489,
0.0213,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.1702,
0.0213,
0,
0.66,
0.1429,
173,
0,
1,
0,
0,
173,
0,
0
],
[
14,
0,
0.3191,
0.234,
0,
... | [
"import re",
"from epydoc import docstringparser as dsp",
"CYTHON_SIGNATURE_RE = re.compile(\n # Class name (for builtin methods)\n r'^\\s*((?P<class>\\w+)\\.)?' +\n # The function name\n r'(?P<func>\\w+)' +\n # The parameters\n r'\\(((?P<self>(?:self|cls|mcs)),?)?(?P<params>.*)\\)' +\n # T... |
#!/usr/bin/env python
#
# Copyright 2011 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.3864,
0.0227,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.5,
0.0227,
0,
0.66,
0.0833,
884,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.5682,
0.0227,
0,
0.66,
... | [
"\"\"\"Settings for the Au-to-do app.\"\"\"",
"TEMPLATE_BASE_PATH = 'templates/'",
"CREDENTIALS_KEYNAME = 'prediction_credentials'",
"CLIENT_ID = (\n 'your_client_id'\n)",
"CLIENT_SECRET = 'your_client_secret'",
"SCOPES = ['https://www.googleapis.com/auth/prediction']",
"USER_AGENT = 'au-to-do'",
"... |
#!/usr/bin/env python
| [] | [] |
#!/usr/bin/env python
#
# Copyright 2011 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
1,
0,
0.0448,
0.0022,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0471,
0.0022,
0,
0.66,
0.0417,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0493,
0.0022,
0,
... | [
"from datetime import datetime",
"import logging",
"import re",
"import string",
"import StringIO",
"import unicodedata",
"from apiclient import errors",
"from apiclient.discovery import build",
"from oauth2client import client",
"from google.appengine.ext import db",
"from google.appengine.ext ... |
#!/usr/bin/env python
#
# Copyright 2011 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.3778,
0.0222,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.4889,
0.0222,
0,
0.66,
0.1111,
813,
0,
1,
0,
0,
813,
0,
0
],
[
8,
0,
0.5111,
0.0222,
0,
0.66... | [
"\"\"\"Configures all page handlers for the application.\"\"\"",
"from google.appengine.dist import use_library",
"use_library('django', '1.2')",
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp.util import run_wsgi_app",
"from landing import LandingPage",
"from user_settings... |
#!/usr/bin/env python
#
# Copyright 2011 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.1269,
0.0075,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1567,
0.0075,
0,
0.66,
0.1,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.1642,
0.0075,
0,
0.66,
... | [
"\"\"\"Datastore reset page for the application.\"\"\"",
"from datetime import datetime",
"import re",
"from google.appengine.api import users",
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp.util import run_wsgi_app",
"import model",
"class DatastoreResetPage(webapp.Requ... |
#!/usr/bin/env python
#
# Copyright 2011 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.0934,
0.0055,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1154,
0.0055,
0,
0.66,
0.0833,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.1209,
0.0055,
0,
0.66... | [
"\"\"\"Provides utility functions for Tasks API.\"\"\"",
"import logging",
"import traceback",
"from apiclient import errors",
"from apiclient.discovery import build",
"from oauth2client.appengine import StorageByKeyName",
"import httplib2",
"import model",
"def _BuildClient(credentials):\n \"\"\"B... |
#!/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 requir... | [
[
8,
0,
0.037,
0.0449,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0606,
0.0008,
0,
0.66,
0.0385,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0623,
0.0008,
0,
0.66,
... | [
"\"\"\"Simple, extendable, mockable Python client for Google Storage.\n\nThis module only depends on standard Python libraries. It is intended to provide\na set of base client classes with all critical features implemented. Advanced\nfeatures can be added by extending the classes. Or, it can be used as-is.\n\nInsta... |
#!/usr/bin/env python
#
# Copyright 2011 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.1954,
0.0115,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2414,
0.0115,
0,
0.66,
0.0833,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.2529,
0.0115,
0,
0.66... | [
"\"\"\"User settings page for the application.\"\"\"",
"import os",
"import re",
"from apiclient.discovery import build",
"from oauth2client import client",
"from google.appengine.api import users",
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp import template",
"from ... |
#!/usr/bin/env python
#
# Copyright 2011 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.1083,
0.0064,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1338,
0.0064,
0,
0.66,
0.05,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.1401,
0.0064,
0,
0.66,
... | [
"\"\"\"Authorization grant page for the application.\"\"\"",
"import logging",
"import os",
"import pickle",
"from oauth2client.appengine import StorageByKeyName",
"from oauth2client.client import OAuth2WebServerFlow",
"from google.appengine.api import memcache",
"from google.appengine.api import user... |
#!/usr/bin/env python
#
# Copyright 2011 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.3864,
0.0227,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.4773,
0.0227,
0,
0.66,
0.1429,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.5,
0.0227,
0,
0.66,
... | [
"\"\"\"Landing page for the application.\"\"\"",
"import os",
"from google.appengine.api import users",
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp import template",
"from api.handler import INCIDENT_FILTERS",
"from settings import TEMPLATE_BASE_PATH",
"class LandingPa... |
#!/usr/bin/env python
"""ISO 8601 date time string parsing
Basic usage:
>>> import iso8601
>>> iso8601.parse_date("2007-01-25T12:00:00Z")
datetime.datetime(2007, 1, 25, 12, 0, tzinfo=<iso8601.iso8601.Utc ...>)
>>>
"""
from datetime import datetime, timedelta, tzinfo
import re
__all__ = ["parse_date", "ParseError"]
... | [
[
8,
0,
0.0583,
0.0874,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1165,
0.0097,
0,
0.66,
0.0833,
426,
0,
3,
0,
0,
426,
0,
0
],
[
1,
0,
0.1262,
0.0097,
0,
0.66... | [
"\"\"\"ISO 8601 date time string parsing\n\nBasic usage:\n>>> import iso8601\n>>> iso8601.parse_date(\"2007-01-25T12:00:00Z\")\ndatetime.datetime(2007, 1, 25, 12, 0, tzinfo=<iso8601.iso8601.Utc ...>)\n>>>",
"from datetime import datetime, timedelta, tzinfo",
"import re",
"__all__ = [\"parse_date\", \"ParseErr... |
#!/usr/bin/env python
| [] | [] |
#!/usr/bin/env python
#
# Copyright 2011 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.2429,
0.0143,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3,
0.0143,
0,
0.66,
0.1111,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.3143,
0.0143,
0,
0.66,
... | [
"\"\"\"Aggregates individual email messages into a single incident.\"\"\"",
"import logging",
"from time import strftime",
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp import util",
"from google.appengine.ext.webapp.mail_handlers import InboundMailHandler",
"import model"... |
#!/usr/bin/env python
#
# Copyright 2011 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
[
8,
0,
0.0225,
0.0059,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0296,
0.0012,
0,
0.66,
0.0435,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0307,
0.0012,
0,
0.66... | [
"\"\"\"Provides models for Au-to-do data types.\n\nThis module provides data types for Au-to-do data stored in the App Engine\ndatastore.\n\"\"\"",
"from datetime import datetime",
"from datetime import timedelta",
"import email.utils",
"import logging",
"import os",
"import re",
"from sets import Set... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
import sys,os
import re
import ConfigParser
import memcache
import urlparse
import smtplib
from email.mime.text import MIMEText
import urlparse
from BaseHTTPServer import HTTPServer,BaseHTTPRequestHandler
class RequestHandler(BaseHTTPRequestHandler):
... | [
[
1,
0,
0.0128,
0.0128,
0,
0.66,
0,
509,
0,
2,
0,
0,
509,
0,
0
],
[
1,
0,
0.0256,
0.0128,
0,
0.66,
0.1111,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0385,
0.0128,
0,
... | [
"import sys,os",
"import re",
"import ConfigParser",
"import memcache",
"import urlparse",
"import smtplib",
"from email.mime.text import MIMEText",
"import urlparse",
"from BaseHTTPServer import HTTPServer,BaseHTTPRequestHandler",
"class RequestHandler(BaseHTTPRequestHandler):\n def sendmail(s... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
import sys,os
import re
import ConfigParser
import memcache
import urlparse
import smtplib
from email.mime.text import MIMEText
import urlparse
from BaseHTTPServer import HTTPServer,BaseHTTPRequestHandler
class RequestHandler(BaseHTTPRequestHandler):
... | [
[
1,
0,
0.0128,
0.0128,
0,
0.66,
0,
509,
0,
2,
0,
0,
509,
0,
0
],
[
1,
0,
0.0256,
0.0128,
0,
0.66,
0.1111,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0385,
0.0128,
0,
... | [
"import sys,os",
"import re",
"import ConfigParser",
"import memcache",
"import urlparse",
"import smtplib",
"from email.mime.text import MIMEText",
"import urlparse",
"from BaseHTTPServer import HTTPServer,BaseHTTPRequestHandler",
"class RequestHandler(BaseHTTPRequestHandler):\n def sendmail(s... |
import sys, string, re, Queue
arith = ['sub', 'div', 'mod', 'cmple', 'add', 'mul', 'cmpeq', 'cmplt']
operators = ['-', '/', '%', '<=', '+', '*', '==', '<']
arith1 = ['neg']
local_size = 0;
# get operand
def getOperand(t, sline, access_local):
#GP
if sline[t] == 'GP':
print '(char*)global',
return t+1
#FP... | [
[
1,
0,
0.0042,
0.0042,
0,
0.66,
0,
509,
0,
4,
0,
0,
509,
0,
0
],
[
14,
0,
0.0167,
0.0042,
0,
0.66,
0.0833,
899,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.0209,
0.0042,
0,
... | [
"import sys, string, re, Queue",
"arith = ['sub', 'div', 'mod', 'cmple', 'add', 'mul', 'cmpeq', 'cmplt']",
"operators = ['-', '/', '%', '<=', '+', '*', '==', '<']",
"arith1 = ['neg']",
"local_size = 0;",
"def getOperand(t, sline, access_local):\n#GP\n if sline[t] == 'GP':\n print('(char*)global',)\n ... |
import logging
from web.webbase import *
from classes import classes
from imports.n3tagvalue import svalue
def gettag(t):
return t if t[0].isalpha() else t[1:]
def getprop(t):
t=gettag(t)
ns = 'ofx' if t.isupper() else 'a3'
return ns+':'+t
def getclass(items,typ,acctids,dtstart,dtend,uniqueids,fltrex... | [
[
1,
0,
0.0075,
0.0075,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0149,
0.0075,
0,
0.66,
0.0909,
686,
0,
1,
0,
0,
686,
0,
0
],
[
1,
0,
0.0224,
0.0075,
0,
... | [
"import logging",
"from web.webbase import *",
"from classes import classes",
"from imports.n3tagvalue import svalue",
"def gettag(t):\n return t if t[0].isalpha() else t[1:]",
" return t if t[0].isalpha() else t[1:]",
"def getprop(t):\n t=gettag(t)\n ns = 'ofx' if t.isupper() else 'a3'\n ... |
import os
from rdflib import Namespace, BNode, Literal, RDF, URIRef
from semprog.pysesame import connection
import cherrypy
from mako.lookup import TemplateLookup
import urllib
from simplejson import dumps
from classes import classes
user_cfg = os.path.expanduser("~/cherrypy.cfg")
if os.path.exists(user_cfg):
cher... | [
[
1,
0,
0.0088,
0.0088,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0175,
0.0088,
0,
0.66,
0.0345,
926,
0,
5,
0,
0,
926,
0,
0
],
[
1,
0,
0.0263,
0.0088,
0,
... | [
"import os",
"from rdflib import Namespace, BNode, Literal, RDF, URIRef",
"from semprog.pysesame import connection",
"import cherrypy",
"from mako.lookup import TemplateLookup",
"import urllib",
"from simplejson import dumps",
"from classes import classes",
"user_cfg = os.path.expanduser(\"~/cherryp... |
from web.webbase import *
from get import getclass,getpositions,getassets
def accounts():
items={}
getclass(items,'account',None,None,None,None)
return items.values()
def accounttotals(acctids,dtstart,dtend):
# collect information on positions
positions={}
getpositions(positions,acctids,dtstar... | [
[
1,
0,
0.0179,
0.0179,
0,
0.66,
0,
686,
0,
1,
0,
0,
686,
0,
0
],
[
1,
0,
0.0357,
0.0179,
0,
0.66,
0.3333,
607,
0,
3,
0,
0,
607,
0,
0
],
[
2,
0,
0.0982,
0.0714,
0,
... | [
"from web.webbase import *",
"from get import getclass,getpositions,getassets",
"def accounts():\n items={}\n getclass(items,'account',None,None,None,None)\n return items.values()",
" items={}",
" getclass(items,'account',None,None,None,None)",
" return items.values()",
"def accounttot... |
from get import *
def asset(uniqueids):
items={}
getpositions(items,None,None,None,uniqueids)
gettransactions(items,None,None,None,uniqueids)
getassets(items,uniqueids)
return items.values() | [
[
1,
0,
0.125,
0.125,
0,
0.66,
0,
607,
0,
1,
0,
0,
607,
0,
0
],
[
2,
0,
0.6875,
0.75,
0,
0.66,
1,
969,
0,
1,
1,
0,
0,
0,
4
],
[
14,
1,
0.5,
0.125,
1,
0.13,
0,
... | [
"from get import *",
"def asset(uniqueids):\n items={}\n getpositions(items,None,None,None,uniqueids)\n gettransactions(items,None,None,None,uniqueids)\n getassets(items,uniqueids)\n return items.values()",
" items={}",
" getpositions(items,None,None,None,uniqueids)",
" gettransactio... |
"""A dictonary of all the classes of objects that can be found in flat lines.
the keys are the class types (names). The values describe each class:
* The key list describes all the tags that must appear in a flat line
in order for an object of the class to be said to be in the line.
The object is uniquely identi... | [
[
8,
0,
0.1667,
0.3182,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.6667,
0.6818,
0,
0.66,
1,
124,
0,
0,
0,
0,
0,
6,
0
]
] | [
"\"\"\"A dictonary of all the classes of objects that can be found in flat lines.\nthe keys are the class types (names). The values describe each class:\n * The key list describes all the tags that must appear in a flat line\n in order for an object of the class to be said to be in the line.\n The object is uni... |
from get import *
def transactions(acctids,dtstart,dtend):
items={}
gettransactions(items,acctids,dtstart,dtend)
# add information on assets
uniqueids=set(o['UNIQUEID'][0]
for o in items.itervalues()
if 'UNIQUEID' in o) # get all uniqueids in use
getassets(items,... | [
[
1,
0,
0.0909,
0.0909,
0,
0.66,
0,
607,
0,
1,
0,
0,
607,
0,
0
],
[
2,
0,
0.6364,
0.8182,
0,
0.66,
1,
587,
0,
3,
1,
0,
0,
0,
5
],
[
14,
1,
0.3636,
0.0909,
1,
0.95,
... | [
"from get import *",
"def transactions(acctids,dtstart,dtend):\n items={}\n gettransactions(items,acctids,dtstart,dtend)\n # add information on assets\n uniqueids=set(o['UNIQUEID'][0]\n for o in items.itervalues()\n if 'UNIQUEID' in o) # get all uniqueids in use\n ... |
from get import *
def positions(acctids,dtstart,dtend):
items={}
getpositions(items,acctids,dtstart,dtend)
# add information on assets
uniqueids=set(o['UNIQUEID'][0] for o in items.itervalues()) # get all uniqueids in use
getassets(items,uniqueids)
return items.values()
def positionspe... | [
[
1,
0,
0.0213,
0.0213,
0,
0.66,
0,
607,
0,
1,
0,
0,
607,
0,
0
],
[
2,
0,
0.1277,
0.1489,
0,
0.66,
0.5,
320,
0,
3,
1,
0,
0,
0,
5
],
[
14,
1,
0.0851,
0.0213,
1,
0.19... | [
"from get import *",
"def positions(acctids,dtstart,dtend):\n items={}\n getpositions(items,acctids,dtstart,dtend)\n # add information on assets\n uniqueids=set(o['UNIQUEID'][0] for o in items.itervalues()) # get all uniqueids in use\n getassets(items,uniqueids)\n return items.values()",
" ... |
from get import *
def checking(acctids,dtstart,dtend):
items={}
getchecking(items,acctids,dtstart,dtend)
return items.values()
| [
[
1,
0,
0.1667,
0.1667,
0,
0.66,
0,
607,
0,
1,
0,
0,
607,
0,
0
],
[
2,
0,
0.75,
0.6667,
0,
0.66,
1,
732,
0,
3,
1,
0,
0,
0,
2
],
[
14,
1,
0.6667,
0.1667,
1,
0.23,
... | [
"from get import *",
"def checking(acctids,dtstart,dtend):\n items={}\n getchecking(items,acctids,dtstart,dtend)\n return items.values()",
" items={}",
" getchecking(items,acctids,dtstart,dtend)",
" return items.values()"
] |
__version__ = "$Id$"
import os
import threading
import random
import urllib2
import cherrypy
from mako.template import Template
from mako.lookup import TemplateLookup
from urllib import quote_plus
from web.webbase import *
from web.position import positions,positionspercents
from web.asset import asset
from web.account... | [
[
14,
0,
0.0063,
0.0063,
0,
0.66,
0,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0127,
0.0063,
0,
0.66,
0.0455,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.019,
0.0063,
0,
0.... | [
"__version__ = \"$Id$\"",
"import os",
"import threading",
"import random",
"import urllib2",
"import cherrypy",
"from mako.template import Template",
"from mako.lookup import TemplateLookup",
"from urllib import quote_plus",
"from web.webbase import *",
"from web.position import positions,posit... |
# Load an RDF file into local sesame server
#import os
#import sys
#from optparse import OptionParser
#from httplib import BadStatusLine
from rdflib.graph import ConjunctiveGraph
from semprog import pysesame
__version__ = "$Id$"
def loadGraph2Server(g,url,fname=None):
data = g.serialize(format='xml')
c = pyses... | [
[
1,
0,
0.24,
0.04,
0,
0.66,
0,
752,
0,
1,
0,
0,
752,
0,
0
],
[
1,
0,
0.28,
0.04,
0,
0.66,
0.25,
366,
0,
1,
0,
0,
366,
0,
0
],
[
14,
0,
0.32,
0.04,
0,
0.66,
0.5... | [
"from rdflib.graph import ConjunctiveGraph",
"from semprog import pysesame",
"__version__ = \"$Id$\"",
"def loadGraph2Server(g,url,fname=None):\n data = g.serialize(format='xml')\n c = pysesame.connection(url)\n c.use_repository('3account')\n c.putdata(data,context=fname)",
" data = g.seriali... |
########################################################################
# Copyright (C) 2007,8,9 Ehud Ben-Reuven
# udi@benreuven.com
#
# 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 version 2... | [
[
8,
0,
0.6607,
0.0714,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.7321,
0.0714,
0,
0.66,
0.25,
868,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.7857,
0.0357,
0,
0.66,
... | [
"\"\"\"Convert OFX v2.x or XML files to flat lines.\n\"\"\"",
"help=\"\"\"Convert OFX v2.x or XML files to flat lines.\n\"\"\"",
"from ofx2xml import ofx2xml",
"import ofxml2flat",
"def flat(fin,fout,context=None,hashing=False):\n\tofxml2flat.flat(fin,fout,context,hashing)",
"\tofxml2flat.flat(fin,fout,co... |
########################################################################
# Copyright (C) 2007,8,9 Ehud Ben-Reuven
# udi@benreuven.com
#
# 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 version 2... | [
[
8,
0,
0.0542,
0.0159,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0661,
0.0079,
0,
0.66,
0.0435,
868,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0714,
0.0026,
0,
0.66,... | [
"\"\"\"Convert OFX v1.x or QFX files to flat lines.\nThis is done in two stages.\nThe first converts the OFX to N3 file that keeps the structure of the original\nOFX file.\nThe second stage converts the N3 file to a graph and then unstructure it.\n\"\"\"",
"help=\"\"\"Convert OFX v1.x file (MS-Money or Quicken We... |
########################################################################
# 3account - personal finance data-base
# Copyright (C) 2007,8,9 Ehud Ben-Reuven
# udi@benreuven.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published ... | [
[
8,
0,
0.1025,
0.02,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.115,
0.005,
0,
0.66,
0.1111,
514,
0,
1,
0,
0,
514,
0,
0
],
[
1,
0,
0.12,
0.005,
0,
0.66,
0... | [
"\"\"\"Convert Citi N.A. (Citibank North America)\nPortfolio (investment) Account Activity CSV file to flat--OFX-RDF and\nload into Sesame server.\n\"\"\"",
"from csv2flt import *",
"import re",
"import os",
"import time",
"from n3tagvalue import *",
"header = [\n['Account Number','Memo','Price','Quanti... |
########################################################################
# Copyright (C) 2007,8,9 Ehud Ben-Reuven
# udi@benreuven.com
#
# 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 version 2... | [
[
8,
0,
0.29,
0.23,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.42,
0.01,
0,
0.66,
0.25,
509,
0,
3,
0,
0,
509,
0,
0
],
[
1,
0,
0.43,
0.01,
0,
0.66,
0.5,
... | [
"\"\"\"ofx2xml OFX-file-name XML-file-name\nwrite OFX v1.02 file in XML format.\nYou should supply the name of the OFX file to read and the name of the XML file\nin which the result will be written to.\n\nOFX v1.02 is written in SGML which is harder to parse than XML\nAlso OFX v2 are XML based.\nHopefully the same ... |
"""ofx2n3.py -- interpret OFX format as RDF
Converts OFX format (as in downloaded back statements etc
The conversion is only syntactic. The OFX modelling is
pretty weel thought out, so taking it as defining an effecive
RDF ontolofy seems to make sense. Rules can then be used to
define mapping into your favor... | [
[
8,
0,
0.1934,
0.3796,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3905,
0.0146,
0,
0.66,
0.0833,
868,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.4088,
0.0073,
0,
0.66... | [
"\"\"\"ofx2n3.py -- interpret OFX format as RDF\n\nConverts OFX format (as in downloaded back statements etc\n\n The conversion is only syntactic. The OFX modelling is\n pretty weel thought out, so taking it as defining an effecive\n RDF ontolofy seems to make sense. Rules can then be used to\n define mapping ... |
########################################################################
# Copyright (C) 2007,8,9 Ehud Ben-Reuven
# udi@benreuven.com
#
# 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 version 2... | [
[
8,
0,
0.2721,
0.3061,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.4354,
0.0068,
0,
0.66,
0.0714,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.4422,
0.0068,
0,
0.66... | [
"r\"\"\"Flat files\nAll incoming statements are flat lines:\nStatements have a relatively shallow and rigid structrue, in order to simplfy\nthe processing and make all formats of bank statements look the same, the\nstatements are transformed into lines that are completely flat:\neach line contains all the informati... |
########################################################################
# xls2csv2 - convert excel to csv and handle encoding
# Copyright (C) 2007,8,9 Ehud Ben-Reuven
# udi@benreuven.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
#... | [
[
8,
0,
0.2287,
0.0638,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.266,
0.0106,
0,
0.66,
0.1429,
509,
0,
3,
0,
0,
509,
0,
0
],
[
1,
0,
0.2766,
0.0106,
0,
0.66,... | [
"\"\"\"xls2csv2 [-e encoding] Excel-file-name CSV-file-name\n\nwrite the Excel file in CSV format\nhandle unicode strings using specified encoding.\nExample: xls2csv2 -e hebrew foo.xls foo.csv\n\"\"\"",
"import sys, os, string",
"from optparse import OptionParser",
"try:\n import win32com.client\n impor... |
"""Init.py
I'm not actually sure what this does.
"""
__version__ = "$Revision: 1.1 $"
__all__ = [ "string"
]
| [
[
8,
0,
0.3182,
0.5455,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.7273,
0.0909,
0,
0.66,
0.5,
162,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.9545,
0.1818,
0,
0.66,
... | [
"\"\"\"Init.py\n\nI'm not actually sure what this does.\n\n\n\"\"\"",
"__version__ = \"$Revision: 1.1 $\"",
"__all__ = [ \"string\"\n ]"
] |
import hashlib
import logging
import re
import ConfigParser
# List of tags which we want their value to be hashed if "hashing" is True
hash_list = ["ACCTID", "INTU_USERID","owner"];
# List of tags that may contain a sub-string that needs to be hashed
# usually transfers write the account to which the transfer is... | [
[
1,
0,
0.0081,
0.0081,
0,
0.66,
0,
154,
0,
1,
0,
0,
154,
0,
0
],
[
1,
0,
0.0163,
0.0081,
0,
0.66,
0.0714,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0244,
0.0081,
0,
... | [
"import hashlib",
"import logging",
"import re",
"import ConfigParser",
"hash_list = [\"ACCTID\", \"INTU_USERID\",\"owner\"];",
"hash_replace_list = [\"NAME\", \"MEMO\", \"mEMO\",\"acctMemo\"]",
"typeDecimal = [\"MKTVAL\", \"TRNAMT\", \"UNITS\", \"UNITPRICE\",\n \"TOTAL\", \"BALAMT\", \"PA... |
########################################################################
# Copyright (C) 2009 Ehud Ben-Reuven
# udi@benreuven.com
#
# 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 version 2.
#
... | [
[
8,
0,
0.0661,
0.0071,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0714,
0.0036,
0,
0.66,
0.04,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.075,
0.0036,
0,
0.66,
... | [
"\"\"\"Convert a CSV file into a flat file using a set of tables of\nregular expressions\"\"\"",
"import re",
"import csv",
"import logging",
"def eurdtzre(name):\n \"\"\"regular expression for an European Date + Time + TZ\n\tFor example: '15.03.2007 / 21:46 CET'\n\t'11.04.2007 / 11:49 CEST'\n\t\"\"\"\n ... |
from rdflib import Namespace, URIRef, Literal, BNode
from rdflib.graph import Graph
from urllib import quote_plus
from httplib import HTTPConnection
from cStringIO import StringIO
import xml.dom
from simplejson import loads
owlNS = Namespace("http://www.w3.org/2002/07/owl#")
owlClass = owlNS["Class"]
owlObjectProperty... | [
[
1,
0,
0.0025,
0.0025,
0,
0.66,
0,
926,
0,
4,
0,
0,
926,
0,
0
],
[
1,
0,
0.005,
0.0025,
0,
0.66,
0.0417,
752,
0,
1,
0,
0,
752,
0,
0
],
[
1,
0,
0.0074,
0.0025,
0,
0... | [
"from rdflib import Namespace, URIRef, Literal, BNode",
"from rdflib.graph import Graph",
"from urllib import quote_plus",
"from httplib import HTTPConnection",
"from cStringIO import StringIO",
"import xml.dom",
"from simplejson import loads",
"owlNS = Namespace(\"http://www.w3.org/2002/07/owl#\")",
... |
import urllib2
from urllib import quote_plus
from simplejson import loads
from httplib import HTTPConnection
import urlparse
class connection:
def __init__(self,url):
self.baseurl=url
self.sparql_prefix=""
self.host=urlparse.urlparse(url).netloc
def addnamespace(self,id,ns):
... | [
[
1,
0,
0.0118,
0.0118,
0,
0.66,
0,
345,
0,
1,
0,
0,
345,
0,
0
],
[
1,
0,
0.0235,
0.0118,
0,
0.66,
0.1667,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0353,
0.0118,
0,
... | [
"import urllib2",
"from urllib import quote_plus",
"from simplejson import loads",
"from httplib import HTTPConnection",
"import urlparse",
"class connection:\n def __init__(self,url):\n self.baseurl=url\n self.sparql_prefix=\"\"\n self.host=urlparse.urlparse(url).netloc\n \n ... |
# -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version Sep 8 2010)
## http://www.wxformbuilder.org/
##
## PLEASE DO "NOT" EDIT THIS FILE!
##########################################################################... | [
[
1,
0,
0.0704,
0.007,
0,
0.66,
0,
666,
0,
1,
0,
0,
666,
0,
0
],
[
14,
0,
0.0845,
0.007,
0,
0.66,
0.1,
180,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.0915,
0.007,
0,
0.66,
... | [
"import wx",
"wx.ID_Window = 1000",
"wx.ID_Window_StatusBar = 1001",
"wx.ID_Window_MenuBar = 1002",
"wx.ID_Window_Quit = 1003",
"wx.ID_Window_SplitterWindow_LeftPanel = 1004",
"class Window ( wx.Frame ):\n\t\n\tdef __init__( self, parent ):\n\t\twx.Frame.__init__ ( self, parent, id = wx.ID_Window, title... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
# Author: Huang Jiahua <jhuangjiahua@gmail.com>
# License: LGPLv3+
# Last modified:
'''文档格式转换
'''
import os
import subprocess
def doc2html(docfile):
'''将 mso doc 转换为 html
依赖 wv
'''
dir = os.tmpnam()
... | [
[
8,
0,
0.3542,
0.0833,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.4583,
0.0417,
0,
0.66,
0.3333,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.5,
0.0417,
0,
0.66,
... | [
"'''文档格式转换\n'''",
"import os",
"import subprocess",
"def doc2html(docfile):\n '''将 mso doc 转换为 html\n 依赖 wv\n '''\n dir = os.tmpnam()\n dir = dir.replace('file', 'gwrite-%s/file' % os.getlogin() )\n html = 'gwrite.html'\n os.makedirs(dir)",
" '''将 mso doc 转换为 html\n 依赖 wv\n '''... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
'''WebkitLinkView
@author: U{Jiahua Huang <jhuangjiahua@gmail.com>}
@license: LGPLv3+
'''
import gobject
import gtk
import webkit
import re
def proc(html):
"""处理 html 链接
>>> proc(' <a href="#3.2.1">3.2.1 heading</a>')
'<a href="#3.2.1" onDblClick="window.loca... | [
[
8,
0,
0.0616,
0.0548,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1096,
0.0137,
0,
0.66,
0.125,
90,
0,
1,
0,
0,
90,
0,
0
],
[
1,
0,
0.1233,
0.0137,
0,
0.66,
... | [
"'''WebkitLinkView\n@author: U{Jiahua Huang <jhuangjiahua@gmail.com>}\n@license: LGPLv3+\n'''",
"import gobject",
"import gtk",
"import webkit",
"import re",
"def proc(html):\n \"\"\"处理 html 链接\n\n >>> proc(' <a href=\"#3.2.1\">3.2.1 heading</a>')\n '<a href=\"#3.2.1\" onDblClick=\"window.loc... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
'''Gtk 对话框
@author: U{Jiahua Huang <jhuangjiahua@gmail.com>}
@license: LGPLv3+
'''
import os
import gtk
import gobject
__all__ = ['error', 'info', 'inputbox', 'messagedialog', 'open', 'save', 'warning',
'yesno']
try: import i18n
except: from gettext import gettext a... | [
[
8,
0,
0.0085,
0.0076,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0152,
0.0019,
0,
0.66,
0.0455,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0189,
0.0019,
0,
0.66... | [
"'''Gtk 对话框\n@author: U{Jiahua Huang <jhuangjiahua@gmail.com>}\n@license: LGPLv3+\n'''",
"import os",
"import gtk",
"import gobject",
"__all__ = ['error', 'info', 'inputbox', 'messagedialog', 'open', 'save', 'warning',\n 'yesno']",
"try: import i18n\nexcept: from gettext import gettext as _",
"tr... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
'''Gtk LaTex
@author: U{Jiahua Huang <jhuangjiahua@gmail.com>}
@license: LGPLv3+
'''
import gtk, gobject
import thread
import time
import subprocess
import os, sys
import base64
try: import gtksourceview2
except: gtksourceview2 = None
try: import i18n
except: from gettext i... | [
[
8,
0,
0.0111,
0.0099,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0198,
0.0025,
0,
0.66,
0.0556,
166,
0,
2,
0,
0,
166,
0,
0
],
[
1,
0,
0.0222,
0.0025,
0,
0.66... | [
"'''Gtk LaTex\n@author: U{Jiahua Huang <jhuangjiahua@gmail.com>}\n@license: LGPLv3+\n'''",
"import gtk, gobject",
"import thread",
"import time",
"import subprocess",
"import os, sys",
"import base64",
"try: import gtksourceview2\nexcept: gtksourceview2 = None",
"try: import gtksourceview2",
"exce... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
'''GWrite
@author: U{Jiahua Huang <jhuangjiahua@gmail.com>}
@license: LGPLv3+
'''
__version__ = '0.5.1'
import gtk, gobject
import gtkdialogs
import gtklatex
import config
import os, sys
import thread
import re
import urllib2
try: import i18n
except: from gettext import get... | [
[
8,
0,
0.0018,
0.0016,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0032,
0.0004,
0,
0.66,
0.0455,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.004,
0.0004,
0,
0.66,
... | [
"'''GWrite\n@author: U{Jiahua Huang <jhuangjiahua@gmail.com>}\n@license: LGPLv3+\n'''",
"__version__ = '0.5.1'",
"import gtk, gobject",
"import gtkdialogs",
"import gtklatex",
"import config",
"import os, sys",
"import thread",
"import re",
"import urllib2",
"try: import i18n\nexcept: from gette... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
# Author: Huang Jiahua <jhuangjiahua@gmail.com>
# License: LGPLv3+
# Last modified:
app = 'gwrite'
import os, sys
import gettext
if os.path.isdir(os.path.dirname(sys.argv[0]) + '/../build/mo'):
gettext.install(app,... | [
[
14,
0,
0.3636,
0.0455,
0,
0.66,
0,
494,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.4545,
0.0455,
0,
0.66,
0.25,
688,
0,
2,
0,
0,
688,
0,
0
],
[
1,
0,
0.5,
0.0455,
0,
0.66,
... | [
"app = 'gwrite'",
"import os, sys",
"import gettext",
"if os.path.isdir(os.path.dirname(sys.argv[0]) + '/../build/mo'):\n gettext.install(app, os.path.dirname(sys.argv[0]) + '/../build/mo', unicode=True)\nelse:\n gettext.install(app, unicode=True)",
" gettext.install(app, os.path.dirname(sys.argv[0... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
'''config
@author: U{Jiahua Huang <jhuangjiahua@gmail.com>}
@license: LGPLv3+
'''
import gtk, gobject
import os, sys
try: import cPickle as pickle
except: import pickle
try: import i18n
except: from gettext import gettext as _
single_instance_mode = 0
mdi_mode = 1
def getc... | [
[
8,
0,
0.0306,
0.0272,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0544,
0.0068,
0,
0.66,
0.0909,
166,
0,
2,
0,
0,
166,
0,
0
],
[
1,
0,
0.0612,
0.0068,
0,
0.66... | [
"'''config\n@author: U{Jiahua Huang <jhuangjiahua@gmail.com>}\n@license: LGPLv3+\n'''",
"import gtk, gobject",
"import os, sys",
"try: import cPickle as pickle\nexcept: import pickle",
"try: import cPickle as pickle",
"except: import pickle",
"try: import i18n\nexcept: from gettext import gettext as _",... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.