text stringlengths 81 112k |
|---|
Repaint the canvas item. This will occur on a thread.
def _repaint(self, drawing_context: DrawingContext.DrawingContext):
"""Repaint the canvas item. This will occur on a thread."""
# canvas size
canvas_width = self.canvas_size.width
canvas_height = self.canvas_size.height
wit... |
Parameters used to initialize the class
def get_params(self):
"Parameters used to initialize the class"
import inspect
a = inspect.getargspec(self.__init__)[0]
out = dict()
for key in a[1:]:
value = getattr(self, "_%s" % key, None)
out[key] = value
... |
Instance file name
def signature(self):
"Instance file name"
kw = self.get_params()
keys = sorted(kw.keys())
l = []
for k in keys:
n = k[0] + k[-1]
v = kw[k]
if k == 'function_set':
v = "_".join([x.__name__[0] +
... |
Class containing the population and all the individuals generated
def population(self):
"Class containing the population and all the individuals generated"
try:
return self._p
except AttributeError:
self._p = self._population_class(base=self,
... |
Returns a random variable with the associated weight
def random_leaf(self):
"Returns a random variable with the associated weight"
for i in range(self._number_tries_feasible_ind):
var = np.random.randint(self.nvar)
v = self._random_leaf(var)
if v is None:
... |
Returns an offspring with the associated weight(s)
def random_offspring(self):
"Returns an offspring with the associated weight(s)"
function_set = self.function_set
function_selection = self._function_selection_ins
function_selection.density = self.population.density
function_se... |
Test whether the stopping criteria has been achieved.
def stopping_criteria(self):
"Test whether the stopping criteria has been achieved."
if self.stopping_criteria_tl():
return True
if self.generations < np.inf:
inds = self.popsize * self.generations
flag = ... |
Number of classes of v, also sets the labes
def nclasses(self, v):
"Number of classes of v, also sets the labes"
if not self.classifier:
return 0
if isinstance(v, list):
self._labels = np.arange(len(v))
return
if not isinstance(v, np.ndarray):
... |
Evolutive process
def fit(self, X, y, test_set=None):
"""Evolutive process"""
self._init_time = time.time()
self.X = X
if self._popsize == "nvar":
self._popsize = self.nvar + len(self._input_functions)
if isinstance(test_set, str) and test_set == 'shuffle':
... |
Decision function i.e. the raw data of the prediction
def decision_function(self, v=None, X=None):
"Decision function i.e. the raw data of the prediction"
m = self.model(v=v)
return m.decision_function(X) |
In classification this returns the classes, in
regression it is equivalent to the decision function
def predict(self, v=None, X=None):
"""In classification this returns the classes, in
regression it is equivalent to the decision function"""
if X is None:
X = v
v ... |
Gevent-based WSGI-HTTP server.
def serve(application, host='127.0.0.1', port=8080):
"""Gevent-based WSGI-HTTP server."""
# Instantiate the server with a host/port configuration and our application.
WSGIServer((host, int(port)), application).serve_forever() |
Returns the subscribers for a given object.
:param obj: Any object.
def get_subscribers(obj):
"""
Returns the subscribers for a given object.
:param obj: Any object.
"""
ctype = ContentType.objects.get_for_model(obj)
return Subscription.objects.filter(content_type=ctype, object_id=obj.pk... |
Returns ``True`` if the user is subscribed to the given object.
:param user: A ``User`` instance.
:param obj: Any object.
def is_subscribed(user, obj):
"""
Returns ``True`` if the user is subscribed to the given object.
:param user: A ``User`` instance.
:param obj: Any object.
"""
if... |
Create a new subclass of Context which incorporates instance attributes and new descriptors.
This promotes an instance and its instance attributes up to being a class with class attributes, then
returns an instance of that class.
def _promote(self, name, instantiate=True):
"""Create a new subclass of Context ... |
Run an individual simulation.
The candidate data has been flattened into the sim_var dict. The
sim_var dict contains parameter:value key value pairs, which are
applied to the model before it is simulated.
def run_individual(sim_var,
reference,
neuroml_file,
... |
Run simulation for each candidate
This run method will loop through each candidate and run the simulation
corresponding to its parameter values. It will populate an array called
traces with the resulting voltage traces for the simulation and return it.
def run(self,candidates,parameter... |
Executed prior to processing a request.
def prepare(self, context):
"""Executed prior to processing a request."""
if __debug__:
log.debug("Assigning thread local request context.")
self.local.context = context |
Register a handler for a given type, class, interface, or abstract base class.
View registration should happen within the `start` callback of an extension. For example, to register the
previous `json` view example:
class JSONExtension:
def start(self, context):
context.view.register(tuple, json)
... |
Serve files from disk.
This utility endpoint factory is meant primarily for use in development environments; in production environments
it is better (more efficient, secure, etc.) to serve your static content using a front end load balancer such as
Nginx.
The first argument, `base`, represents the base path to ... |
Diesel-based (greenlet) WSGI-HTTP server.
As a minor note, this is crazy. Diesel includes Flask, too.
def serve(application, host='127.0.0.1', port=8080):
"""Diesel-based (greenlet) WSGI-HTTP server.
As a minor note, this is crazy. Diesel includes Flask, too.
"""
# Instantiate the server with a host/port co... |
Parse command-line arguments.
def process_args():
"""
Parse command-line arguments.
"""
parser = argparse.ArgumentParser(description="A script for plotting files containing spike time data")
parser.add_argument('spiketimeFiles',
type=str,
meta... |
Python-standard WSGI-HTTP server for testing purposes.
The additional work performed here is to match the default startup output of "waitress".
This is not a production quality interface and will be have badly under load.
def simple(application, host='127.0.0.1', port=8080):
"""Python-standard WSGI-HTTP server ... |
A specialized version of the reference WSGI-CGI server to adapt to Microsoft IIS quirks.
This is not a production quality interface and will behave badly under load.
def iiscgi(application):
"""A specialized version of the reference WSGI-CGI server to adapt to Microsoft IIS quirks.
This is not a production qual... |
Basic FastCGI support via flup.
This web server has many, many options. Please see the Flup project documentation for details.
def serve(application, host='127.0.0.1', port=8080, socket=None, **options):
"""Basic FastCGI support via flup.
This web server has many, many options. Please see the Flup project docum... |
Helper method. Returns kwargs needed to filter the correct object.
Can also be used to create the correct object.
def _get_method_kwargs(self):
"""
Helper method. Returns kwargs needed to filter the correct object.
Can also be used to create the correct object.
"""
me... |
Adds a subscription for the given user to the given object.
def save(self, *args, **kwargs):
"""Adds a subscription for the given user to the given object."""
method_kwargs = self._get_method_kwargs()
try:
subscription = Subscription.objects.get(**method_kwargs)
except Subsc... |
Add the usual suspects to the context.
This adds `request`, `response`, and `path` to the `RequestContext` instance.
def prepare(self, context):
"""Add the usual suspects to the context.
This adds `request`, `response`, and `path` to the `RequestContext` instance.
"""
if __debug__:
log.debug("Pre... |
Called as dispatch descends into a tier.
The base extension uses this to maintain the "current url".
def dispatch(self, context, consumed, handler, is_endpoint):
"""Called as dispatch descends into a tier.
The base extension uses this to maintain the "current url".
"""
request = context.request
... |
Render empty responses.
def render_none(self, context, result):
"""Render empty responses."""
context.response.body = b''
del context.response.content_length
return True |
Return binary responses unmodified.
def render_binary(self, context, result):
"""Return binary responses unmodified."""
context.response.app_iter = iter((result, )) # This wraps the binary string in a WSGI body iterable.
return True |
Perform appropriate metadata wrangling for returned open file handles.
def render_file(self, context, result):
"""Perform appropriate metadata wrangling for returned open file handles."""
if __debug__:
log.debug("Processing file-like object.", extra=dict(request=id(context), result=repr(result)))
response ... |
Attempt to serve generator responses through stream encoding.
This allows for direct use of cinje template functions, which are generators, as returned views.
def render_generator(self, context, result):
"""Attempt to serve generator responses through stream encoding.
This allows for direct use of cinje te... |
CherryPy-based WSGI-HTTP server.
def serve(application, host='127.0.0.1', port=8080):
"""CherryPy-based WSGI-HTTP server."""
# Instantiate the server with our configuration and application.
server = CherryPyWSGIServer((host, int(port)), application, server_name=host)
# Try to be handy as many terminals allow c... |
Returns the colored string
def colorize(self, string, rgb=None, ansi=None, bg=None, ansi_bg=None):
'''Returns the colored string'''
if not isinstance(string, str):
string = str(string)
if rgb is None and ansi is None:
raise TerminalColorMapException(
'col... |
Render serialized responses.
def render_serialization(self, context, result):
"""Render serialized responses."""
resp = context.response
serial = context.serialize
match = context.request.accept.best_match(serial.types, default_match=self.default)
result = serial[match](result)
if isinstance(result, ... |
Eventlet-based WSGI-HTTP server.
For a more fully-featured Eventlet-capable interface, see also [Spawning](http://pypi.python.org/pypi/Spawning/).
def serve(application, host='127.0.0.1', port=8080):
"""Eventlet-based WSGI-HTTP server.
For a more fully-featured Eventlet-capable interface, see also [Spawning](ht... |
Main
def main(args=None):
"""Main"""
vs = [(v-100)*0.001 for v in range(200)]
for f in ['IM.channel.nml','Kd.channel.nml']:
nml_doc = pynml.read_neuroml2_file(f)
for ct in nml_doc.ComponentType:
ys = []
for v in vs:
req_variables = {'v':'%... |
Parse command-line arguments.
def process_args():
"""
Parse command-line arguments.
"""
parser = argparse.ArgumentParser(
description=("A script which can be run to generate a LEMS "
"file to analyse the behaviour of channels in "
... |
A single IV curve
def plot_iv_curve(a, hold_v, i, *plt_args, **plt_kwargs):
"""A single IV curve"""
grid = plt_kwargs.pop('grid',True)
same_fig = plt_kwargs.pop('same_fig',False)
if not len(plt_args):
plt_args = ('ko-',)
if 'label' not in plt_kwargs:
plt_kwargs['label'] = 'Cur... |
Multipart AJAX request example.
See: http://test.getify.com/mpAjax/description.html
def root(context):
"""Multipart AJAX request example.
See: http://test.getify.com/mpAjax/description.html
"""
response = context.response
parts = []
for i in range(12):
for j in range(12):
parts.append(executor.su... |
Get a file and render the content of the template_file_name with kwargs in a file
:param file: A File Stream to write
:param template_file_name: path to route with template name
:param **kwargs: Args to be rendered in template
def render_template_with_args_in_file(file, template_file_name, **kwargs):
"... |
Creates a file or open the file with file_name name
:param file_name: String with a filename
:param initial_template_file_name: String with path to initial template
:param args: from console to determine path to save the files
def create_or_open(file_name, initial_template_file_name, args):
"""
Cre... |
In general we have a initial template and then insert new data, so we dont repeat the schema for each module
:param module_name: String with module name
:paran **kwargs: Args to be rendered in template
def generic_insert_module(module_name, args, **kwargs):
"""
In general we have a initial template and... |
Verify if the work folder is a django app.
A valid django app always must have a models.py file
:return: None
def sanity_check(args):
"""
Verify if the work folder is a django app.
A valid django app always must have a models.py file
:return: None
"""
if not os.path.isfile(
os.p... |
In general if we need to put a file on a folder, we use this method
def generic_insert_with_folder(folder_name, file_name, template_name, args):
"""
In general if we need to put a file on a folder, we use this method
"""
# First we make sure views are a package instead a file
if not os.path.isdir(
... |
The recommended development HTTP server.
Note that this server performs additional buffering and will not honour chunked encoding breaks.
def serve(application, host='127.0.0.1', port=8080, threads=4, **kw):
"""The recommended development HTTP server.
Note that this server performs additional buffering and will... |
Plot the result of the simulation once it's been intialized
def show(self):
"""
Plot the result of the simulation once it's been intialized
"""
from matplotlib import pyplot as plt
if self.already_run:
for ref in self.volts.keys():
plt... |
Multiply two values together and return the result via JSON.
Python 3 function annotations are used to ensure that the arguments are integers. This requires the
functionality of `web.ext.annotation:AnnotationExtension`.
There are several ways to execute this method:
* POST http://localhost:8080/mul
*... |
Returns the colored string to print on the terminal.
This function detects the terminal type and if it is supported and the
output is not going to a pipe or a file, then it will return the colored
string, otherwise it will return the string without modifications.
string = the string to print. Only acc... |
Inspect and potentially mutate the given handler's arguments.
The args list and kw dictionary may be freely modified, though invalid arguments to the handler will fail.
def mutate(self, context, handler, args, kw):
"""Inspect and potentially mutate the given handler's arguments.
The args list and kw dictio... |
Transform the value returned by the controller endpoint.
This extension transforms returned values if the endpoint has a return type annotation.
def transform(self, context, handler, result):
"""Transform the value returned by the controller endpoint.
This extension transforms returned values if the endpoi... |
Parse command-line arguments.
def process_args():
"""
Parse command-line arguments.
"""
parser = argparse.ArgumentParser(
description=("A script which can be run to tune a NeuroML 2 model against a number of target properties. Work in progress!"))
parser.a... |
Parse command-line arguments.
def process_args():
"""
Parse command-line arguments.
"""
parser = argparse.ArgumentParser(description="A file for overlaying POVRay files generated from NeuroML by NeuroML1ToPOVRay.py with cell activity (e.g. as generated from a neuroConstruct simulation)")
parser.a... |
Tornado's HTTPServer.
This is a high quality asynchronous server with many options. For details, please visit:
http://www.tornadoweb.org/en/stable/httpserver.html#http-server
def serve(application, host='127.0.0.1', port=8080, **options):
"""Tornado's HTTPServer.
This is a high quality asynchronous server ... |
Parse command line arguments
def parse_arguments():
"""Parse command line arguments"""
import argparse
parser = argparse.ArgumentParser(
description=('pyNeuroML v%s: Python utilities for NeuroML2' % __version__
+ "\n libNeuroML v%s"%(neuroml.__version__)
... |
Or better just use nml2_doc.summary(show_includes=False)
def quick_summary(nml2_doc):
'''
Or better just use nml2_doc.summary(show_includes=False)
'''
info = 'Contents of NeuroML 2 document: %s\n'%nml2_doc.id
membs = inspect.getmembers(nml2_doc)
for memb in membs:
if isinstance(m... |
Execute a command in specific working directory
def execute_command_in_dir(command, directory, verbose=DEFAULTS['v'],
prefix="Output: ", env=None):
"""Execute a command in specific working directory"""
if os.name == 'nt':
directory = os.path.normpath(directory)
... |
print_comment_v(exec_str)
def evaluate_component(comp_type, req_variables={}, parameter_values={}):
print_comment('Evaluating %s with req:%s; params:%s'%(comp_type.name,req_variables,parameter_values))
exec_str = ''
return_vals = {}
from math import exp
for p in parameter_values:
exec_... |
Executed after dispatch has returned and the response populated, prior to anything being sent to the client.
def after(self, context, exc=None):
"""Executed after dispatch has returned and the response populated, prior to anything being sent to the client."""
duration = context._duration = round((time.time() - ... |
Apply a flat namespace transformation to recreate (in some respects) a rich structure.
This applies several transformations, which may be nested:
`foo` (singular): define a simple value named `foo`
`foo` (repeated): define a simple value for placement in an array named `foo`
`foo[]`: define a simple value... |
Parse command-line arguments.
def process_args():
"""
Parse command-line arguments.
"""
parser = argparse.ArgumentParser(description="A file for converting NeuroML v2 files into POVRay files for 3D rendering")
parser.add_argument('neuroml_file', type=str, metavar='<NeuroML file>',
... |
Prepare the incoming configuration and ensure certain expected values are present.
For example, this ensures BaseExtension is included in the extension list, and populates the logging config.
def _configure(self, config):
"""Prepare the incoming configuration and ensure certain expected values are present.
... |
Initiate a web server service to serve this application.
You can always use the Application instance as a bare WSGI application, of course. This method is provided as
a convienence.
Pass in the name of the service you wish to use, and any additional configuration options appropriate for that
service. Al... |
Process a single WSGI request/response cycle.
This is the WSGI handler for WebCore. Depending on the presence of extensions providing WSGI middleware,
the `__call__` attribute of the Application instance will either become this, or become the outermost
middleware callable.
Most apps won't utilize middlew... |
Swaps the alignment so that the reference becomes the query and vice-versa. Swaps their names, coordinates etc. The frame is not changed
def _swap(self):
'''Swaps the alignment so that the reference becomes the query and vice-versa. Swaps their names, coordinates etc. The frame is not changed'''
self.r... |
Returns a pyfastaq.intervals.Interval object of the start and end coordinates in the query sequence
def qry_coords(self):
'''Returns a pyfastaq.intervals.Interval object of the start and end coordinates in the query sequence'''
return pyfastaq.intervals.Interval(min(self.qry_start, self.qry_end), max(s... |
Returns a pyfastaq.intervals.Interval object of the start and end coordinates in the reference sequence
def ref_coords(self):
'''Returns a pyfastaq.intervals.Interval object of the start and end coordinates in the reference sequence'''
return pyfastaq.intervals.Interval(min(self.ref_start, self.ref_end... |
Returns true iff the direction of the alignment is the same in the reference and the query
def on_same_strand(self):
'''Returns true iff the direction of the alignment is the same in the reference and the query'''
return (self.ref_start < self.ref_end) == (self.qry_start < self.qry_end) |
Returns true iff the alignment is of a sequence to itself: names and all coordinates are the same and 100 percent identity
def is_self_hit(self):
'''Returns true iff the alignment is of a sequence to itself: names and all coordinates are the same and 100 percent identity'''
return self.ref_name == self... |
Changes the coordinates as if the query sequence has been reverse complemented
def reverse_query(self):
'''Changes the coordinates as if the query sequence has been reverse complemented'''
self.qry_start = self.qry_length - self.qry_start - 1
self.qry_end = self.qry_length - self.qry_end - 1 |
Changes the coordinates as if the reference sequence has been reverse complemented
def reverse_reference(self):
'''Changes the coordinates as if the reference sequence has been reverse complemented'''
self.ref_start = self.ref_length - self.ref_start - 1
self.ref_end = self.ref_length - self.re... |
Returns the alignment as a line in MSPcrunch format. The columns are space-separated and are:
1. score
2. percent identity
3. match start in the query sequence
4. match end in the query sequence
5. query sequence name
6. subject sequence start
... |
Given a reference position and a list of variants ([variant.Variant]),
works out the position in the query sequence, accounting for indels.
Returns a tuple: (position, True|False), where second element is whether
or not the ref_coord lies in an indel. If it is, then
returns t... |
Construct the nucmer command
def _nucmer_command(self, ref, qry, outprefix):
'''Construct the nucmer command'''
if self.use_promer:
command = 'promer'
else:
command = 'nucmer'
command += ' -p ' + outprefix
if self.breaklen is not None:
comma... |
Construct delta-filter command
def _delta_filter_command(self, infile, outfile):
'''Construct delta-filter command'''
command = 'delta-filter'
if self.min_id is not None:
command += ' -i ' + str(self.min_id)
if self.min_length is not None:
command += ' -l ' + s... |
Construct show-coords command
def _show_coords_command(self, infile, outfile):
'''Construct show-coords command'''
command = 'show-coords -dTlro'
if not self.coords_header:
command += ' -H'
return command + ' ' + infile + ' > ' + outfile |
Write commands into a bash script
def _write_script(self, script_name, ref, qry, outfile):
'''Write commands into a bash script'''
f = pyfastaq.utils.open_file_write(script_name)
print(self._nucmer_command(ref, qry, 'p'), file=f)
print(self._delta_filter_command('p.delta', 'p.delta.filt... |
Change to a temp directory
Run bash script containing commands
Place results in specified output file
Clean up temp directory
def run(self):
'''
Change to a temp directory
Run bash script containing commands
Place results in specified output file
Clean up... |
Indels are reported over multiple lines, 1 base insertion or deletion per line. This method extends the current variant by 1 base if it's an indel and adjacent to the new SNP and returns True. If the current variant is a SNP, does nothing and returns False
def update_indel(self, nucmer_snp):
'''Indels are repo... |
Helper function to open the results file (coords file) and create alignment objects with the values in it
def reader(fname):
'''Helper function to open the results file (coords file) and create alignment objects with the values in it'''
f = pyfastaq.utils.open_file_read(fname)
for line in f:
if li... |
Converts a coords file to a file in MSPcrunch format (for use with ACT, most likely).
ACT ignores sequence names in the crunch file, and just looks at the numbers.
To make a compatible file, the coords all must be shifted appropriately, which
can be done by providing both the ref_fai and qry_fai op... |
Common handler for all the HTTP requests.
def _request(self, method, url, params=None, headers=None, data=None):
"""Common handler for all the HTTP requests."""
if not params:
params = {}
# set default headers
if not headers:
headers = {
'accept'... |
Sphinx role for linking to a user profile. Defaults to linking to
Github profiles, but the profile URIS can be configured via the
``issues_user_uri`` config value.
Examples: ::
:user:`sloria`
Anchor text also works: ::
:user:`Steven Loria <sloria>`
def user_role(name, rawtext, text,... |
Sphinx role for linking to a CVE on https://cve.mitre.org.
Examples: ::
:cve:`CVE-2018-17175`
def cve_role(name, rawtext, text, lineno, inliner, options=None, content=None):
"""Sphinx role for linking to a CVE on https://cve.mitre.org.
Examples: ::
:cve:`CVE-2018-17175`
"""
opt... |
Write the given iterable of values (line) to the file as items on the
same line. Any argument that stringifies to a string legal as a TSV data
item can be written.
Does not copy the line or build a big string in memory.
def list_line(self, line):
"""
Write the given it... |
Parse metadata to obtain list of mustache templates,
then load those templates.
def prepare(doc):
""" Parse metadata to obtain list of mustache templates,
then load those templates.
"""
doc.mustache_files = doc.get_metadata('mustache')
if isinstance(doc.mustache_files, basestring): # p... |
Apply combined mustache template to all strings in document.
def action(elem, doc):
""" Apply combined mustache template to all strings in document.
"""
if type(elem) == Str and doc.mhash is not None:
elem.text = doc.mrenderer.render(elem.text, doc.mhash)
return elem |
Determine the name of the callback to wrap around the json output.
def get_callback(self, renderer_context):
"""
Determine the name of the callback to wrap around the json output.
"""
request = renderer_context.get('request', None)
params = request and get_query_params(request) ... |
Renders into jsonp, wrapping the json output in a callback function.
Clients may set the callback function name using a query parameter
on the URL, for example: ?callback=exampleCallbackName
def render(self, data, accepted_media_type=None, renderer_context=None):
"""
Renders into jsonp... |
Analyses the measurement with the given parameters
:param measurementId:
:return:
def get(self, measurementId):
"""
Analyses the measurement with the given parameters
:param measurementId:
:return:
"""
logger.info('Loading raw data for ' + measurementId)
... |
Return Julian day count of given ISO year, week, and day
def to_jd(year, week, day):
'''Return Julian day count of given ISO year, week, and day'''
return day + n_weeks(SUN, gregorian.to_jd(year - 1, 12, 28), week) |
Return tuple of ISO (year, week, day) for Julian day
def from_jd(jd):
'''Return tuple of ISO (year, week, day) for Julian day'''
year = gregorian.from_jd(jd)[0]
day = jwday(jd) + 1
dayofyear = ordinal.from_jd(jd)[1]
week = trunc((dayofyear - day + 10) / 7)
# Reset year
if week < 1:
... |
Number of ISO weeks in a year
def weeks_per_year(year):
'''Number of ISO weeks in a year'''
# 53 weeks: any year starting on Thursday and any leap year starting on Wednesday
jan1 = jwday(gregorian.to_jd(year, 1, 1))
if jan1 == THU or (jan1 == WED and isleap(year)):
return 53
else:
... |
For STScI GEIS files, need to do extra steps.
def stsci(hdulist):
"""For STScI GEIS files, need to do extra steps."""
instrument = hdulist[0].header.get('INSTRUME', '')
# Update extension header keywords
if instrument in ("WFPC2", "FOC"):
rootname = hdulist[0].header.get('ROOTNAME', '')
... |
For STScI GEIS files, need to do extra steps.
def stsci2(hdulist, filename):
"""For STScI GEIS files, need to do extra steps."""
# Write output file name to the primary header
instrument = hdulist[0].header.get('INSTRUME', '')
if instrument in ("WFPC2", "FOC"):
hdulist[0].header['FILENAME'] = ... |
Input GEIS files "input" will be read and a HDUList object will
be returned.
The user can use the writeto method to write the HDUList object to
a FITS file.
def readgeis(input):
"""Input GEIS files "input" will be read and a HDUList object will
be returned.
The user can use th... |
Parse two input arguments and return two lists of file names
def parse_path(f1, f2):
"""Parse two input arguments and return two lists of file names"""
import glob
# if second argument is missing or is a wild card, point it
# to the current directory
f2 = f2.strip()
if f2 == '' or f2 == '*':... |
Recursively parse user input based upon the irafglob
program and construct a list of files that need to be processed.
This program addresses the following deficiencies of the irafglob program::
parseinput can extract filenames from association tables
Returns
-------
This program will return... |
Determine if the filename provided to the function belongs to
an association.
Parameters
----------
filename: string
Returns
-------
validASN : boolean value
def checkASN(filename):
"""
Determine if the filename provided to the function belongs to
an association.
Paramet... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.