code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
'''
Created on Dec 22, 2010
@author: Nican
'''
import os.path
class ValueSaver(object):
'''
classdocs
'''
def __init__(self, fileName):
self.fileName = fileName
self.Values = {}
def readFromFile(self):
self.Values = {}
... | Python |
'''
Created on Dec 4, 2010
@author: Nican
'''
import wx
class StartMenu(wx.BoxSizer):
'''
classdocs
'''
def __init__(self, parent):
'''
Constructor
'''
wx.BoxSizer.__init__(self, wx.HORIZONTAL)
self.parent = parent
self.sta... | 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 |
#!/usr/bin/env python
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
import os
import os.path
import sys
setup(name="pydicom",
packages = find_packages(),
include_package_data = True,
version="1.0a",
package_data = {'dicom': ['testfile... | Python |
#!python
"""Bootstrap distribute 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 distribute_setup import use_setuptools
use_setuptools()
If you want to require a specific version of se... | Python |
# csv2dict2011.py
# -*- coding: utf-8 -*-
"""Reformat a dicom dictionary csv file (from e.g. standards docs) to Python syntax
Write the DICOM dictionary elements as:
tag: (VR, VM, description, keyword, is_retired)
in python format
Also write the repeating groups or elements (e.g. group "50xx")
as ma... | Python |
# make_UID_dict.py
"""Reformat a UID list csv file (Table A-1 PS3.6-2008) to Python syntax
Write the dict elements as:
UID: (name, type, name_info, is_retired)
in python format
name_info is extra information extracted from very long names, e.g.
which bit size a particular transfer syntax is def... | Python |
# csv2dict.py
"""Reformat a dicom dictionary csv file (from e.g. standards docs) to Python syntax
Write the DICOM dictionary elements as:
tag: (VR, VM, description, is_retired)
in python format
Also write the repeating groups or elements (e.g. group "50xx")
as masks that can be tested later for tag ... | Python |
from __future__ import with_statement
# file "make_private_dict.py"
# Copyright (c) 2009 Daniel Nanz
# This file is released under the pydicom (http://code.google.com/p/pydicom/)
# license.
# See the file license.txt included with the pydicom distribution, also
# available at http://pydicom.googlecode.com
'''
-- ... | Python |
# values.py
"""Functions for converting values of DICOM data elements to proper python types
"""
# Copyright (c) 2010-2012 Darcy Mason
# This file is part of pydicom, relased under an MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
from s... | Python |
# valuerep.py
"""Special classes for DICOM value representations (VR)"""
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
from decimal import D... | Python |
# charset.py
"""Handle alternate character sets for character strings."""
#
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
#
import logging
l... | Python |
# datadict.py
# -*- coding: utf-8 -*-
"""Access dicom dictionary information"""
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
#
import sys
... | Python |
# dataset.py
"""Module for Dataset class
Overview of Dicom object model:
Dataset(derived class of Python's dict class)
contains DataElement instances (DataElement is a class with tag, VR, value)
the value can be a Sequence instance
(Sequence is derived from Python's list),
or just a regular valu... | Python |
# tag.py
"""Define Tag class to hold a dicom (group, element) tag"""
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
# Store the 4 bytes of a ... | Python |
# fileutil.py
"""Functions for reading to certain bytes, e.g. delimiters"""
# Copyright (c) 2009-2012 Darcy Mason
# This file is part of pydicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
from struct import... | Python |
# encaps.py
"""Routines for working with encapsulated (compressed) data
"""
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
# Encapsulated Pi... | Python |
#!/usr/bin/python
""" dicom_dao
Data Access Objects for persisting PyDicom DataSet objects.
Currently we support couchdb through the DicomCouch class.
Limitations:
- Private tags are discarded
TODO:
- Unit tests with multiple objects open at a time
- Unit tests with rtstruct objects
- Support for mongodb (mong... | Python |
# pydicom_PIL.py
"""View DICOM images using Python image Library (PIL)
Usage:
>>> import dicom
>>> from dicom.contrib.pydicom_PIL import show_PIL
>>> ds = dicom.read_file("filename")
>>> show_PIL(ds)
Requires Numpy: http://numpy.scipy.org/
and Python Imaging Library: http://www.pythonware.com/products/pil/
"""
# ... | Python |
#pydicom_Tkinter.py
#
# Copyright (c) 2009 Daniel Nanz
# This file is released under the pydicom (http://code.google.com/p/pydicom/)
# license, see the file license.txt available at
# (http://code.google.com/p/pydicom/)
#
# revision history:
# Dec-08-2009: version 0.1
#
# 0.1: tested with pydicom version 0.9.3, Pytho... | Python |
#==========================================================================
# imViewer-Simple.py
#
# An example program that opens uncompressed DICOM images and
# converts them via numPy and PIL to be viewed in wxWidgets GUI
# apps. The conversion is currently:
#
# pydicom->NumPy->PIL->wxPython.Image->wxPython.B... | Python |
# dicom_series.py
"""
By calling the function read_files with a directory name or list
of files as an argument, a list of DicomSeries instances can be
obtained. A DicomSeries object has some attributes that give
information about the serie (such as shape, sampling, suid) and
has an info attribute, which is a dicom.Data... | Python |
# __init__.py
# Mark the folder as a python package
| Python |
# filewriter.py
"""Write a dicom media file."""
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
from struct import pack
import logging
logger... | Python |
# config.py
"""Pydicom configuration options."""
# Copyright (c) 2012 Darcy Mason
# This file is part of pydicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
# doc strings following items are picked up by sph... | Python |
# misc.py
"""Miscellaneous helper functions"""
# Copyright (c) 2009 Darcy Mason
# This file is part of pydicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
_size_factors = dict(KB=1024, MB=1024*1024, GB=1024*... | Python |
# dicomtree.py
"""Show a dicom file using a hierarchical tree in a graphical window"""
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, relased under an MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
usage = "Usage: ... | Python |
# DicomDiff.py
"""Show the difference between two dicom files.
"""
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, relased under an MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
from __future__ import print_functio... | Python |
# ListBeams.py
"""Given an RTPLAN DICOM file, list basic info for the beams in it
"""
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, relased under an MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
from __future__ i... | Python |
# DicomInfo.py
"""
Read a DICOM file and print some or all of its values.
Usage: python DicomInfo.py imagefile [-v]
-v (optional): Verbose mode, prints all DICOM data elements
Without the -v option, a few of the most common dicom file
data elements are printed: some info about the patient and about
the image.
"""
... | Python |
# show_charset_name.py
"""Very simple app to display unicode person names"""
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, relased under an MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
import Tkinter
from dicom.... | Python |
# write_new.py
"""Simple example of writing a DICOM file from scratch using pydicom.
This example does not produce a DICOM standards compliant file as written,
you will have to change UIDs to valid values and add all required DICOM data
elements
"""
# Copyright (c) 2010-2012 Darcy Mason
# This file is part of pydicom,... | Python |
# anonymize.py
"""Read a dicom file (or directory of files), partially "anonymize" it (them),
by replacing Person names, patient id, optionally remove curves
and private tags, and write result to a new file (directory)
This is an example only; use only as a starting point.
"""
# Copyright (c) 2008-2012 Darcy Mason
# Th... | Python |
# __init__.py
# Mark the folder as a python package
| Python |
# myprint.py
"""Example of printing a dataset in your own format"""
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, relased under an MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
from __future__ import print_functi... | Python |
# filebase.py
"""Hold DicomFile class, which does basic I/O for a dicom file."""
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
from __future_... | Python |
# UID.py
"""Dicom Unique identifiers"""
# Copyright (c) 2008 Darcy Mason
# This file is part of pydicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
import os
import uuid
import time, datetime
from math impor... | Python |
# filereader.py
"""Read a dicom media file"""
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
from __future__ import absolute_import
# Need zli... | Python |
# dataelem.py
"""Define the DataElement class - elements within a dataset.
DataElements have a DICOM value representation VR, a value multiplicity VM,
and a value.
"""
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, released under a modified MIT license.
# See the file license.txt included wit... | Python |
# __init__.py for Dicom package
"""pydicom package -- easily handle DICOM files. See Quick Start below.
Copyright (c) 2008-2012 Darcy Mason
This file is part of pydicom, released under a modified MIT license.
See the file license.txt included with this distribution, also
available at http://pydicom.googlecode.co... | Python |
# charlist.py
"""List summary info for the test files in the charset directory"""
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, relased under an MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
import logging
loggin... | Python |
# sequence.py
"""Hold the Sequence class, which stores a dicom sequence (list of Datasets)"""
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
... | Python |
# dump.py
"""Utility functions used in debugging writing and reading"""
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, relased under an MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
from __future__ import print_fu... | Python |
# hexutil.py
"""Miscellaneous utility routines relating to hex and byte strings"""
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
from binasc... | Python |
# __init__.py
| Python |
# multival.py
"""Code for multi-value data elements values, or any list of items that
must all be the same type.
"""
# Copyright (c) 2009-2012 Darcy Mason
# This file is part of pydicom, relased under an MIT-style license.
# See the file license.txt included with this distribution, also
# available at http://pydi... | Python |
# version_dep.py
"""Holds test code that is dependent on certain python versions"""
# Copyright (c) 2009-2012 Darcy Mason
# This file is part of pydicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
import war... | Python |
# time_test.py
"""Try reading large sets of files, profiling how much time it takes"""
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, relased under an MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
import os.path
i... | Python |
# __init__.py
# Mark the folder as a python package
| Python |
# raw_convert_test.py
"""Try reading a large RTSTRUCT file, profiling how much time it takes"""
# Copyright (c) 2012 Darcy Mason
# This file is part of pydicom, relased under an MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
import os.pa... | Python |
# _write_stds.py
"""Snippets for what a particular dataset (including nested sequences)
should look like after writing in different expl/impl Vr and endian combos,
as well as undefined length sequences and items
"""
# Implicit VR, little endian, SQ's with defined lengths
impl_LE_deflen_std_hex = (
"10 00 10 00 " ... | Python |
# run_tests.py
"""Call all the unit test files in the test directory starting with 'test'"""
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
i... | Python |
# __init__.py
| Python |
# warncheck.py
#
import warnings
import unittest
from sys import version_info
from dicom.test.version_dep import capture_warnings
def assertWarns(self, warn_msg, function, *func_args, **func_kwargs):
"""
Check that the function generates the expected warning
with the arguments given.
warn_msg -- part... | Python |
from sys import argv
from os.path import exists
script, from_file, to_file = argv
print "Copying from %s to %s" % (from_file, to_file)
indata = open(from_file).read()
print "The input file is %d bytes long." % len(indata)
print "Does the output file exist? %r" % exists(to_file)
out_file = open(to_fil... | Python |
def break_words(stuff):
"""This function will break up words for us."""
words = stuff.split(' ')
return words
def sort_words(words):
"""Sorts the words."""
return sorted(words)
def print_first_word(words):
"""Prints the first word after popping it off."""
word = words.pop(0)
... | Python |
from sys import argv
script, file_name = argv
def print_all(f):
print f.read()
def rewind(f):
f.seek(0)
def print_a_line(line_cnt, f):
print line_cnt, f.readline()
current_file = open(file_name)
print "First let's print the whole file:\n"
print_all(current_file)
print "Now let's rewin... | Python |
from sys import argv
script, filename = argv
print " Going to erase %r." % filename
print "If you don't want to continue, hit CTRL+C."
print "If you do want that, hit any keys + RETURN"
raw_input("ready?")
print "Opening file ....."
target = open(filename, 'w')
print "Truncating this file..."
target.truncate()
pr... | Python |
def break_words(stuff):
"""This function will break up words for us."""
words = stuff.split(' ')
return words
def sort_words(words):
"""Sorts the words."""
return sorted(words)
def print_first_word(words):
"""Prints the first word after popping it off."""
word = words.pop(0)
... | Python |
from sys import argv
script, user_name = argv
prompt = '>> '
print "Hi %s, I'm the %s script." % (user_name, script)
print "I'd like to ask a few Questions."
print "Do you like me %s?" % user_name
likes = raw_input(prompt)
print "Where do you live %s?" % user_name
lives = raw_input(prompt)
print "What kind of compu... | Python |
from sys import argv
script, filename = argv
txt = open(filename)
print "Here's your file %r:" % filename
print txt.read()
print "type the filename again:"
file_again = raw_input("> ")
txt_again = open(file_again)
#txt_again.write("--- added by write method ---")
print txt_again.read()
txt.close()
txt_again.close()
... | Python |
print "Let's practice everything."
print 'You\'d need to know \'bout escapes with \\ that do \n newlines and \t tabs.'
poem = """
\tThe lovely world
with logic so firmly planted
cannot discern \n the needs of love
nor comprehend passion from intuition
and requires an explanation
\n\t\twhere there is none.
""... | Python |
#!/usr/bin/env pypy
import os, sys, logging, re
import argparse
import fnmatch
configurations = {'lite', 'pro'}
package_dirs = {
'lite': ('src/cx/hell/android/pdfview',),
'pro': ('src/cx/hell/android/pdfviewpro',)
}
file_replaces = {
'lite': (
'cx.hell.android.pdfview.',
'"cx.hell.an... | Python |
# initialize PETSC & SLEPC
import sys, petsc4py,slepc4py
slepc4py.init(sys.argv)
# load freefem tools
import freefem_bodyforce as ff_body
# load libraries
from numpy import *
import matplotlib.pyplot as plt
import h5py as h5
from petsc4py import PETSc
from slepc4py import SLEPc
from mpi4py import MPI
# load function... | Python |
# initialize PETSC & SLEPC
import sys, petsc4py,slepc4py
slepc4py.init(sys.argv)
# load freefem tools
import freefem as ff
# load libraries
from numpy import *
import matplotlib.pyplot as plt
import h5py as h5
from petsc4py import PETSc
from slepc4py import SLEPc
from mpi4py import MPI
# load functions for stability... | Python |
from numpy import *
import matplotlib.pyplot as plt
import scipy.sparse as sp
from numpy.linalg import norm
from petsc4py import PETSc
from slepc4py import SLEPc
from mpi4py import MPI
from petsc4py import PETSc
Print = PETSc.Sys.Print
# Print in color
REDBOLD_ = "\033[1;31m"
RED_ = "\033[31m"
GREEN_ =... | Python |
# initialize PETSC & SLEPC
import sys, petsc4py,slepc4py
slepc4py.init(sys.argv)
# load freefem tools
import freefem as ff
# load libraries
from numpy import *
import matplotlib.pyplot as plt
import h5py as h5
from petsc4py import PETSc
from slepc4py import SLEPc
from mpi4py import MPI
# load functions for stability... | Python |
import os
from numpy import *
try:
import readmat
except ImportError:
os.system('f2py -m readmat -c readmat.f90 --fcompiler=gnu95')
import readmat
import scipy.sparse as sp
import matplotlib.pyplot as plt
import matplotlib.tri as tri
class FreeFEMdisc():
"""
object that contains all information ... | Python |
from freefem import *
class FreeFEMdisc_bodyforce(FreeFEMdisc):
"""
object that contains all information about the FreeFem++
discretization
GENERAL INFORMATION
ndof : integer, nomber of degrees of freedom
ntot : integer, total number of discretization elements
... | Python |
# initialize PETSC & SLEPC
import sys, petsc4py,slepc4py
slepc4py.init(sys.argv)
# load freefem tools
import freefem_boundaryforce as ff_boundary
# load libraries
from numpy import *
import matplotlib.pyplot as plt
import h5py as h5
from petsc4py import PETSc
from slepc4py import SLEPc
from mpi4py import MPI
# load ... | Python |
# load freefem tools
import freefem_bodyforce as ff_body
# load libraries
from numpy import *
import matplotlib.pyplot as plt
import h5py as h5
di = '../../step'
ffdisc = ff_body.FreeFEMdisc_bodyforce(di+'/ffdata.h5')
h5f = h5.File(di+"/results.h5","r")
Pu,nu = ffdisc.getPu([0,1])
idx = 1
while "freq_%05d"%idx ... | Python |
from numpy import *
import matplotlib.pyplot as plt
import scipy.sparse as sp
import scipy.sparse.linalg as splin
# import scipy.sparse.linalg.eigen.arpack as arpie
# import scipy.io as io
# import progressbar as pbar
# import matplotlib.tri as tri
# import freefem as ff
from numpy.linalg import norm
from scipy.spar... | Python |
from freefem import *
class FreeFEMdisc_boundaryforce(FreeFEMdisc):
"""
object that contains all information about the FreeFem++
discretization
GENERAL INFORMATION
ndof : integer, nomber of degrees of freedom
ntot : integer, total number of discretization elements
... | Python |
# initialize PETSC & SLEPC
import sys, petsc4py,slepc4py
slepc4py.init(sys.argv)
# load freefem tools
import freefem as ff
# load libraries
from numpy import *
import matplotlib.pyplot as plt
import h5py as h5
from petsc4py import PETSc
from slepc4py import SLEPc
from mpi4py import MPI
# load functions for stability... | Python |
#!/usr/bin/env python
import time
t = time.time()
u = time.gmtime(t)
s = time.strftime('%a, %e %b %Y %T GMT', u)
print 'Content-Type: text/javascript'
print 'Cache-Control: no-cache'
print 'Date: ' + s
print 'Expires: ' + s
print ''
print 'var timeskew = new Date().getTime() - ' + str(t*1000) + ';'
| Python |
#!/usr/bin/python
import sys
agl = []
agltab = []
aglmap = {}
print "/*"
f = open("glyphlist.txt", "r")
for line in f.readlines():
if line[0] == '#':
print line.strip()
continue
line = line[:-1]
name, list = line.split(';')
list = map(lambda x: int(x, 16), list.split(' '))
agl.append((name, list))
for nam... | Python |
import sys, os, re
HEADER="""<head>
<style>
body { background-color:#fffff0; color:black; margin:16pt; }
a { text-decoration:none; color:darkblue; }
a.line { position:relative; padding-top:300px; }
.comment { color:green; font-style:italic; }
.comment a { color:darkgreen; }
</style>
</head>
<body><pre><pre>"""
FOOTER... | Python |
#!/usr/bin/python
# Copyright 2011 Google, Inc. All Rights Reserved.
# simple script to walk source tree looking for third-party licenses
# dumps resulting html page to stdout
import os, re, mimetypes, sys
# read source directories to scan from command line
SOURCE = sys.argv[1:]
# regex to find /* */ style commen... | Python |
#!/usr/bin/python
# Copyright 2011 Google, Inc. All Rights Reserved.
# simple script to walk source tree looking for third-party licenses
# dumps resulting html page to stdout
import os, re, mimetypes, sys
# read source directories to scan from command line
SOURCE = sys.argv[1:]
# regex to find /* */ style commen... | Python |
# Copyright (C) 2010 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 agreed to in w... | Python |
# Copyright (C) 2010 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 agreed to in w... | Python |
# Copyright (C) 2010 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 agreed to in w... | Python |
# Copyright (C) 2010 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 agreed to in w... | Python |
# Copyright (C) 2010 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 agreed to in w... | Python |
# Copyright (C) 2010 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 agreed to in w... | Python |
'''
Created on 21-03-2011
@author: maciek
'''
def formatString(format, **kwargs):
'''
'''
if not format: return ''
for arg in kwargs.keys():
format = format.replace("{" + arg + "}", "##" + arg + "##")
format = format.replace ("{", "{{")
format = format.replace("}", "}}")
for... | Python |
'''
Created on 21-03-2011
@author: maciek
'''
from IndexGenerator import IndexGenerator
from optparse import OptionParser
import os
import tempfile
import shutil
import logging
logging.basicConfig(level = logging.DEBUG)
parser = OptionParser()
parser.add_option('-n', '--app-name', action='store', dest='appName', hel... | Python |
'''
Created on 21-03-2011
@author: maciek
'''
from formater import formatString
import os
class IndexGenerator(object):
'''
Generates Index.html for iOS app OTA distribution
'''
basePath = os.path.dirname(__file__)
templateFile = os.path.join(basePath,"templates/index.tmpl")
releaseUrls = ""
... | Python |
#!/usr/bin/python2.5
# Copyright 2009-2010 by Ka-Ping Yee
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | Python |
#!/usr/bin/env python
#
# Copyright 2008 Google Inc.
# Copyright 2010 Joe LaPenna
#
# 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
#
# Un... | Python |
# Copyright 2010 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 agreed to in writi... | Python |
# Copyright 2010 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 agreed to in writi... | Python |
"""
The MIT License
Copyright (c) 2007 Leah Culver
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... | Python |
#!/usr/bin/env python
# Copyright 2009 Joe LaPenna
# Copyright 2009 Google
"""
An appengine OAuthClient based on the oauth-python reference implementation.
"""
import oauth
from google.appengine.api import urlfetch
from google.appengine.ext import db
class OAuthClient(oauth.OAuthClient):
"""A worker to attemp... | Python |
#!/usr/bin/env pypy
import os, sys, logging, re
import argparse
import fnmatch
configurations = {'lite', 'pro'}
package_dirs = {
'lite': ('src/cx/hell/android/pdfview',),
'pro': ('src/cx/hell/android/pdfviewpro',)
}
file_replaces = {
'lite': (
'cx.hell.android.pdfview.',
'"cx.hell.an... | Python |
'''
@author: Deli, BYK
@contact: gulen.ilker@hotmail.com, madbyk@gmail.com
@summary:
Provides solving and post-processing functions.
Solving function uses SciPy's sparse solving function from sparse linear algebra module(sparse.spsolve).
Post process shapes the coordinates and results into a proper form to be ... | Python |
'''
@author: Deli, BYK
@contact: gulen.ilker@hotmail.com, madbyk@gmail.com
@summary:
Provides the routines to read and process problem data to be used in the calculation of the global system.
Also includes Gauss Quadrature and shape function definitions. Calling get_problem_data() from an external
module is en... | Python |
'''
@author: BYK
@contact: madbyk@gmail.com
@summary:
Provides the routines to read an ".inp" file whose format is defined by Dr. Sert into
an easy to use data structure in the program. When run on its own, it converts ".inp"
files into ".json" files.
@version: 1.2
'''
import re
from json import dump as js... | Python |
'''
@author: Deli, BYK
@contact: gulen.ilker@hotmail.com, madbyk@gmail.com
@summary:
Provides the routines to calculate elemental systems, assembling them and applying boundary conditions.
@version: 1.1
'''
from numpy import array, zeros, linalg, matrix
from scipy import sparse
from math import sqrt
glob... | Python |
'''
@author: BYK, Deli
@contact: gulen.ilker@hotmail.com, madbyk@gmail.com
@summary:
A steady 2D advection-diffusion FEM solver in Python 2.7
using NumPy, SciPy and MatPlotLib
@version: 1.6
'''
if __name__ == "__main__":
import argparse
from psetup import get_problem_data
from gsystem import calc_g... | 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.