prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>step6.py<|end_file_name|><|fim▁begin|>import json
f = open('text-stripped-3.json')
out = open('text-lines.json', 'w')
start_obj = json.load(f)
end_obj = {'data': []}
characters_on_stage = []
currently_speaking = None
last_scene = '1.1'
for i in range(len(start_obj['data'])):
obj = start_obj['data'][i... | if obj['characters'] in characters_on_stage:
raise Exception('Character tried to enter stage when already on stage at object ' + str(i))
characters_on_stage = characters_on_stage + obj['characters'] |
<|file_name|>step6.py<|end_file_name|><|fim▁begin|>import json
f = open('text-stripped-3.json')
out = open('text-lines.json', 'w')
start_obj = json.load(f)
end_obj = {'data': []}
characters_on_stage = []
currently_speaking = None
last_scene = '1.1'
for i in range(len(start_obj['data'])):
obj = start_obj['data'][i... | raise Exception('Character tried to enter stage when already on stage at object ' + str(i)) |
<|file_name|>step6.py<|end_file_name|><|fim▁begin|>import json
f = open('text-stripped-3.json')
out = open('text-lines.json', 'w')
start_obj = json.load(f)
end_obj = {'data': []}
characters_on_stage = []
currently_speaking = None
last_scene = '1.1'
for i in range(len(start_obj['data'])):
obj = start_obj['data'][i... | characters_on_stage = [] |
<|file_name|>step6.py<|end_file_name|><|fim▁begin|>import json
f = open('text-stripped-3.json')
out = open('text-lines.json', 'w')
start_obj = json.load(f)
end_obj = {'data': []}
characters_on_stage = []
currently_speaking = None
last_scene = '1.1'
for i in range(len(start_obj['data'])):
obj = start_obj['data'][i... | characters_on_stage = [char for char in characters_on_stage if char not in obj['characters']] |
<|file_name|>step6.py<|end_file_name|><|fim▁begin|>import json
f = open('text-stripped-3.json')
out = open('text-lines.json', 'w')
start_obj = json.load(f)
end_obj = {'data': []}
characters_on_stage = []
currently_speaking = None
last_scene = '1.1'
for i in range(len(start_obj['data'])):
obj = start_obj['data'][i... | if obj['speaker'] not in characters_on_stage:
raise Exception('Character tried to speak when not on stage at object ' + str(i), start_obj['data'][i + 1])
currently_speaking = obj['speaker'] |
<|file_name|>step6.py<|end_file_name|><|fim▁begin|>import json
f = open('text-stripped-3.json')
out = open('text-lines.json', 'w')
start_obj = json.load(f)
end_obj = {'data': []}
characters_on_stage = []
currently_speaking = None
last_scene = '1.1'
for i in range(len(start_obj['data'])):
obj = start_obj['data'][i... | raise Exception('Character tried to speak when not on stage at object ' + str(i), start_obj['data'][i + 1]) |
<|file_name|>step6.py<|end_file_name|><|fim▁begin|>import json
f = open('text-stripped-3.json')
out = open('text-lines.json', 'w')
start_obj = json.load(f)
end_obj = {'data': []}
characters_on_stage = []
currently_speaking = None
last_scene = '1.1'
for i in range(len(start_obj['data'])):
obj = start_obj['data'][i... | if currently_speaking == None:
raise Exception('A line did not have an associated speaker at object ' + str(i))
identifier_info = obj['identifier'].split('.')
scene = identifier_info[0] + '.' + identifier_info[1]
#if scene != last_scene:
# if len(characters_on_stage) != 0:
# print('Warning: scene ' + ... |
<|file_name|>step6.py<|end_file_name|><|fim▁begin|>import json
f = open('text-stripped-3.json')
out = open('text-lines.json', 'w')
start_obj = json.load(f)
end_obj = {'data': []}
characters_on_stage = []
currently_speaking = None
last_scene = '1.1'
for i in range(len(start_obj['data'])):
obj = start_obj['data'][i... | raise Exception('A line did not have an associated speaker at object ' + str(i)) |
<|file_name|>step6.py<|end_file_name|><|fim▁begin|>import json
f = open('text-stripped-3.json')
out = open('text-lines.json', 'w')
start_obj = json.load(f)
end_obj = {'data': []}
characters_on_stage = []
currently_speaking = None
last_scene = '1.1'
for i in range(len(start_obj['data'])):
obj = start_obj['data'][i... | currently_speaking = None |
<|file_name|>prescript.py<|end_file_name|><|fim▁begin|>import os
import sys
import argparse
from pandaharvester.harvesterconfig import harvester_config
from pandaharvester.harvestermisc.selfcheck import harvesterPackageInfo
def main():
oparser = argparse.ArgumentParser(prog='prescript', add_help=True)<|fim▁hole|... | oparser.add_argument('-f', '--local_info_file', action='store', dest='local_info_file', help='path of harvester local info file')
if len(sys.argv) == 1:
print('No argument or flag specified. Did nothing') |
<|file_name|>prescript.py<|end_file_name|><|fim▁begin|>import os
import sys
import argparse
from pandaharvester.harvesterconfig import harvester_config
from pandaharvester.harvestermisc.selfcheck import harvesterPackageInfo
def main():
<|fim_middle|>
if __name__ == '__main__':
main()
<|fim▁end|> | oparser = argparse.ArgumentParser(prog='prescript', add_help=True)
oparser.add_argument('-f', '--local_info_file', action='store', dest='local_info_file', help='path of harvester local info file')
if len(sys.argv) == 1:
print('No argument or flag specified. Did nothing')
sys.exit(0)
arg... |
<|file_name|>prescript.py<|end_file_name|><|fim▁begin|>import os
import sys
import argparse
from pandaharvester.harvesterconfig import harvester_config
from pandaharvester.harvestermisc.selfcheck import harvesterPackageInfo
def main():
oparser = argparse.ArgumentParser(prog='prescript', add_help=True)
oparse... | print('No argument or flag specified. Did nothing')
sys.exit(0) |
<|file_name|>prescript.py<|end_file_name|><|fim▁begin|>import os
import sys
import argparse
from pandaharvester.harvesterconfig import harvester_config
from pandaharvester.harvestermisc.selfcheck import harvesterPackageInfo
def main():
oparser = argparse.ArgumentParser(prog='prescript', add_help=True)
oparse... | print('Harvester package changed')
#TODO
pass
hpi.renew_local_info() |
<|file_name|>prescript.py<|end_file_name|><|fim▁begin|>import os
import sys
import argparse
from pandaharvester.harvesterconfig import harvester_config
from pandaharvester.harvestermisc.selfcheck import harvesterPackageInfo
def main():
oparser = argparse.ArgumentParser(prog='prescript', add_help=True)
oparse... | print('Harvester package unchanged. Skipped') |
<|file_name|>prescript.py<|end_file_name|><|fim▁begin|>import os
import sys
import argparse
from pandaharvester.harvesterconfig import harvester_config
from pandaharvester.harvestermisc.selfcheck import harvesterPackageInfo
def main():
oparser = argparse.ArgumentParser(prog='prescript', add_help=True)
oparse... | main() |
<|file_name|>prescript.py<|end_file_name|><|fim▁begin|>import os
import sys
import argparse
from pandaharvester.harvesterconfig import harvester_config
from pandaharvester.harvestermisc.selfcheck import harvesterPackageInfo
def <|fim_middle|>():
oparser = argparse.ArgumentParser(prog='prescript', add_help=True)
... | main |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | _else_template = u"else: %(name)s = %(default)s"
_kwargs_default_name = u"_3to2kwargs"
|
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | u"""
Generator that yields tuples of (name, default_value) for each parameter in the list
If no default is given, then it is default_value is None (not Leaf(token.NAME, 'None'))
"""
assert raw_params[0].type == token.STAR and len(raw_params) > 2
curr_idx = 2 # the first place a keyword-only par... |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | u"""
Removes all keyword-only args from the params list and a bare star, if any.
Does not add the kwargs dict if needed.
Returns True if more action is needed, False if not
(more action is needed if no kwargs dict exists)
"""
assert raw_params[0].type == token.STAR
if raw_params[1].type ... |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | u"""
Returns string with the name of the kwargs dict if the params after the first star need fixing
Otherwise returns empty string
"""
found_kwargs = False
needs_fix = False
for t in raw_params[2:]:
if t.type == token.COMMA:
# Commas are irrelevant at this stage.
... |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | run_order = 7 # Run after function annotations are removed
PATTERN = u"funcdef< 'def' NAME parameters< '(' arglist=typedargslist< params=any* > ')' > ':' suite=any >"
def transform(self, node, results):
params_rawlist = results[u"params"]
for i, item in enumerate(params_rawlist):
... |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | params_rawlist = results[u"params"]
for i, item in enumerate(params_rawlist):
if item.type == token.STAR:
params_rawlist = params_rawlist[i:]
break
else:
return
# params is guaranteed to be a list starting with *.
# if fixin... |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | curr_idx += 1
continue |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | break |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | default_value = nxt.next_sibling
curr_idx += 2 |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | default_value = None |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | raw_params[0].remove()
raw_params[1].remove()
kw_params = raw_params[2:] |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | kw_params = raw_params[3:] |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | param.remove() |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | return False |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | return True |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | continue |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | needs_fix = True |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | return t.value if needs_fix else u'' |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | found_kwargs = True |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | return kwargs_default if needs_fix else u'' |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | params_rawlist = params_rawlist[i:]
break |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | return |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | return |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | suite.insert_child(2, Newline())
suite.insert_child(2, String(_assign_template % {u'name': name, u'kwargs': new_kwargs}, prefix=ident)) |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | suite.insert_child(2, Newline())
suite.insert_child(2, String(_else_template % {u'name': name, u'default': default_value}, prefix=ident))
suite.insert_child(2, Newline())
suite.insert_child(2, String(
_if_template % {u'assign': _assign_... |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | arglist = results[u'arglist']
if len(arglist.children) > 0 and arglist.children[-1].type != token.COMMA:
arglist.append_child(Comma())
arglist.append_child(DoubleStar(prefix=u" "))
arglist.append_child(Name(new_kwargs)) |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | arglist.append_child(Comma()) |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | gen_params |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | remove_params |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | needs_fixing |
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token,... | transform |
<|file_name|>isobands_matplotlib.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
isobands_matplotlib.py is a script for creating isobands.
Works in a similar way as gdal_contour, but creating polygons
instead of polylines
This version requires matplotlib, but there is another one,
isobands_gdal.py that uses ... |
for level in range(len(contours.collections)):
paths = contours.collections[level].get_paths() |
<|file_name|>isobands_matplotlib.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
isobands_matplotlib.py is a script for creating isobands.
Works in a similar way as gdal_contour, but creating polygons
instead of polylines
This version requires matplotlib, but there is another one,
isobands_gdal.py that uses ... | return v.lower() in ("yes", "true", "t", "1") |
<|file_name|>isobands_matplotlib.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
isobands_matplotlib.py is a script for creating isobands.
Works in a similar way as gdal_contour, but creating polygons
instead of polylines
This version requires matplotlib, but there is another one,
isobands_gdal.py that uses ... | '''
The method that calculates the isobands
'''
ds_in = gdal.Open(in_file)
band_in = ds_in.GetRasterBand(band)
xsize_in = band_in.XSize
ysize_in = band_in.YSize
geotransform_in = ds_in.GetGeoTransform()
srs = osr.SpatialReference()
srs.ImportFromWkt( ds_in.GetProjectionRef() ) ... |
<|file_name|>isobands_matplotlib.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
isobands_matplotlib.py is a script for creating isobands.
Works in a similar way as gdal_contour, but creating polygons
instead of polylines
This version requires matplotlib, but there is another one,
isobands_gdal.py that uses ... | remove(out_file) |
<|file_name|>isobands_matplotlib.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
isobands_matplotlib.py is a script for creating isobands.
Works in a similar way as gdal_contour, but creating polygons
instead of polylines
This version requires matplotlib, but there is another one,
isobands_gdal.py that uses ... | min_level = offset + interval * floor((min_value - offset)/interval) |
<|file_name|>isobands_matplotlib.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
isobands_matplotlib.py is a script for creating isobands.
Works in a similar way as gdal_contour, but creating polygons
instead of polylines
This version requires matplotlib, but there is another one,
isobands_gdal.py that uses ... | out_val = contours.levels[level] + interval |
<|file_name|>isobands_matplotlib.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
isobands_matplotlib.py is a script for creating isobands.
Works in a similar way as gdal_contour, but creating polygons
instead of polylines
This version requires matplotlib, but there is another one,
isobands_gdal.py that uses ... | out_val = contours.levels[level] |
<|file_name|>isobands_matplotlib.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
isobands_matplotlib.py is a script for creating isobands.
Works in a similar way as gdal_contour, but creating polygons
instead of polylines
This version requires matplotlib, but there is another one,
isobands_gdal.py that uses ... | if ring != None:
pol.AddGeometry(ring)
ring = ogr.Geometry(ogr.wkbLinearRing) |
<|file_name|>isobands_matplotlib.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
isobands_matplotlib.py is a script for creating isobands.
Works in a similar way as gdal_contour, but creating polygons
instead of polylines
This version requires matplotlib, but there is another one,
isobands_gdal.py that uses ... | pol.AddGeometry(ring) |
<|file_name|>isobands_matplotlib.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
isobands_matplotlib.py is a script for creating isobands.
Works in a similar way as gdal_contour, but creating polygons
instead of polylines
This version requires matplotlib, but there is another one,
isobands_gdal.py that uses ... | print "Failed to create feature in shapefile.\n"
exit( 1 ) |
<|file_name|>isobands_matplotlib.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
isobands_matplotlib.py is a script for creating isobands.
Works in a similar way as gdal_contour, but creating polygons
instead of polylines
This version requires matplotlib, but there is another one,
isobands_gdal.py that uses ... | PARSER = ArgumentParser(
description="Calculates the isobands from a raster into a vector file")
PARSER.add_argument("src_file", help="The raster source file")
PARSER.add_argument("out_file", help="The vectorial out file")
PARSER.add_argument("-b",
help="The band in the source file to p... |
<|file_name|>isobands_matplotlib.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
isobands_matplotlib.py is a script for creating isobands.
Works in a similar way as gdal_contour, but creating polygons
instead of polylines
This version requires matplotlib, but there is another one,
isobands_gdal.py that uses ... | str2bool |
<|file_name|>isobands_matplotlib.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
isobands_matplotlib.py is a script for creating isobands.
Works in a similar way as gdal_contour, but creating polygons
instead of polylines
This version requires matplotlib, but there is another one,
isobands_gdal.py that uses ... | isobands |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from pymongo.connection import Connection
from django.db import models
from eventtracker.conf import settings
def get_mongo_collection():
"Open a connection to MongoDB and return the collection to use."
if settings.RIGHT_MONGO... | collection.insert({
'event': event, |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from pymongo.connection import Connection
from django.db import models
from eventtracker.conf import settings
def get_mongo_collection():
<|fim_middle|>
def save_event(collection, event, timestamp, params):
"Save the ev... | "Open a connection to MongoDB and return the collection to use."
if settings.RIGHT_MONGODB_HOST:
connection = Connection.paired(
left=(settings.MONGODB_HOST, settings.MONGODB_PORT),
right=(settings.RIGHT_MONGODB_HOST, settings.RIGHT_MONGODB_PORT)
)
else:
... |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from pymongo.connection import Connection
from django.db import models
from eventtracker.conf import settings
def get_mongo_collection():
"Open a connection to MongoDB and return the collection to use."
if settings.RIGHT_MONGO... | "Save the event in MongoDB collection"
collection.insert({
'event': event,
'timestamp': datetime.fromtimestamp(timestamp),
'params': params
}) |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from pymongo.connection import Connection
from django.db import models
from eventtracker.conf import settings
def get_mongo_collection():
"Open a connection to MongoDB and return the collection to use."
if settings.RIGHT_MONGO... | "Dummy model for development."
timestamp = models.DateTimeField(auto_now_add=True)
event = models.SlugField()
params = models.TextField() |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from pymongo.connection import Connection
from django.db import models
from eventtracker.conf import settings
def get_mongo_collection():
"Open a connection to MongoDB and return the collection to use."
if settings.RIGHT_MONGO... | connection = Connection.paired(
left=(settings.MONGODB_HOST, settings.MONGODB_PORT),
right=(settings.RIGHT_MONGODB_HOST, settings.RIGHT_MONGODB_PORT)
) |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from pymongo.connection import Connection
from django.db import models
from eventtracker.conf import settings
def get_mongo_collection():
"Open a connection to MongoDB and return the collection to use."
if settings.RIGHT_MONGO... | connection = Connection(host=settings.MONGODB_HOST, port=settings.MONGODB_PORT) |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from pymongo.connection import Connection
from django.db import models
from eventtracker.conf import settings
def <|fim_middle|>():
"Open a connection to MongoDB and return the collection to use."
if settings.RIGHT_MONGODB_HOS... | get_mongo_collection |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from pymongo.connection import Connection
from django.db import models
from eventtracker.conf import settings
def get_mongo_collection():
"Open a connection to MongoDB and return the collection to use."
if settings.RIGHT_MONGO... | save_event |
<|file_name|>target_list.py<|end_file_name|><|fim▁begin|>'''
Copyright (C) 2014 Travis DeWolf
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any ... | """ |
<|file_name|>target_list.py<|end_file_name|><|fim▁begin|>'''
Copyright (C) 2014 Travis DeWolf
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any ... | """
"""
def __init__(self, controller, target_list,
threshold=.01, pen_down=False):
"""
control Control instance: the controller to use
pen_down boolean: True if the end-effector is drawing
"""
self.controller = controller
self.pen_down = ... |
<|file_name|>target_list.py<|end_file_name|><|fim▁begin|>'''
Copyright (C) 2014 Travis DeWolf
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any ... | """
control Control instance: the controller to use
pen_down boolean: True if the end-effector is drawing
"""
self.controller = controller
self.pen_down = pen_down
self.target_list = target_list
self.threshold = threshold
self.not_at_start =... |
<|file_name|>target_list.py<|end_file_name|><|fim▁begin|>'''
Copyright (C) 2014 Travis DeWolf
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any ... | """Move to a series of targets.
"""
if self.controller.check_distance(arm) < self.threshold:
if self.target_index < len(self.target_list)-1:
self.target_index += 1
self.set_target()
self.controller.apply_noise = True
self.not_at_s... |
<|file_name|>target_list.py<|end_file_name|><|fim▁begin|>'''
Copyright (C) 2014 Travis DeWolf
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any ... | """
Set the current target for the controller.
"""
if self.target_index == len(self.target_list)-1:
target = [1, 2]
else:
target = self.target_list[self.target_index]
if target[0] != target[0]: # if it's NANs
self.target_index += 1
... |
<|file_name|>target_list.py<|end_file_name|><|fim▁begin|>'''
Copyright (C) 2014 Travis DeWolf
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any ... | if self.target_index < len(self.target_list)-1:
self.target_index += 1
self.set_target()
self.controller.apply_noise = True
self.not_at_start = not self.not_at_start
self.pen_down = not self.pen_down |
<|file_name|>target_list.py<|end_file_name|><|fim▁begin|>'''
Copyright (C) 2014 Travis DeWolf
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any ... | self.target_index += 1 |
<|file_name|>target_list.py<|end_file_name|><|fim▁begin|>'''
Copyright (C) 2014 Travis DeWolf
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any ... | target = [1, 2] |
<|file_name|>target_list.py<|end_file_name|><|fim▁begin|>'''
Copyright (C) 2014 Travis DeWolf
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any ... | target = self.target_list[self.target_index] |
<|file_name|>target_list.py<|end_file_name|><|fim▁begin|>'''
Copyright (C) 2014 Travis DeWolf
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any ... | self.target_index += 1
self.set_target() |
<|file_name|>target_list.py<|end_file_name|><|fim▁begin|>'''
Copyright (C) 2014 Travis DeWolf
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any ... | self.controller.target = target |
<|file_name|>target_list.py<|end_file_name|><|fim▁begin|>'''
Copyright (C) 2014 Travis DeWolf
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any ... | __init__ |
<|file_name|>target_list.py<|end_file_name|><|fim▁begin|>'''
Copyright (C) 2014 Travis DeWolf
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any ... | control |
<|file_name|>target_list.py<|end_file_name|><|fim▁begin|>'''
Copyright (C) 2014 Travis DeWolf
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any ... | set_target |
<|file_name|>packet5.py<|end_file_name|><|fim▁begin|>from . import packet
<|fim▁hole|>
class Packet5(packet.Packet):
def __init__(self, player, slot):
super(Packet5, self).__init__(0x5)
self.add_data(player.playerID)
self.add_data(slot)
self.add_structured_data("<h", 0) # Stack
... | |
<|file_name|>packet5.py<|end_file_name|><|fim▁begin|>from . import packet
class Packet5(packet.Packet):
<|fim_middle|>
<|fim▁end|> | def __init__(self, player, slot):
super(Packet5, self).__init__(0x5)
self.add_data(player.playerID)
self.add_data(slot)
self.add_structured_data("<h", 0) # Stack
self.add_data(0) # Prefix
self.add_structured_data("<h", 0) # ItemID |
<|file_name|>packet5.py<|end_file_name|><|fim▁begin|>from . import packet
class Packet5(packet.Packet):
def __init__(self, player, slot):
<|fim_middle|>
<|fim▁end|> | super(Packet5, self).__init__(0x5)
self.add_data(player.playerID)
self.add_data(slot)
self.add_structured_data("<h", 0) # Stack
self.add_data(0) # Prefix
self.add_structured_data("<h", 0) # ItemID |
<|file_name|>packet5.py<|end_file_name|><|fim▁begin|>from . import packet
class Packet5(packet.Packet):
def <|fim_middle|>(self, player, slot):
super(Packet5, self).__init__(0x5)
self.add_data(player.playerID)
self.add_data(slot)
self.add_structured_data("<h", 0) # Stack
... | __init__ |
<|file_name|>cecog.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Methods for working with cecog
Copyright 2010 University of Dundee, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import os
import re
import sys
from omero.cli import... | import omero
import omero.constants
from omero.rtypes import rstring |
<|file_name|>cecog.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Methods for working with cecog
Copyright 2010 University of Dundee, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import os
import re
import sys
from omero.cli import... | """CeCog integration plugin.
Provides actions for prepairing data and otherwise integrating with Cecog. See
the Run_Cecog_4.1.py script.
"""
# [MetaMorph_PlateScanPackage]
# regex_subdirectories = re.compile('(?=[^_]).*?(?P<D>\d+).*?')
# regex_position = re.compile('P(?P<P>.+?)_')
# continuous... |
<|file_name|>cecog.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Methods for working with cecog
Copyright 2010 University of Dundee, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import os
import re
import sys
from omero.cli import... | sub = parser.sub()
merge = parser.add(sub, self.merge, self.merge.__doc__)
merge.add_argument("path", help="Path to image files")
rois = parser.add(sub, self.rois, self.rois.__doc__)
rois.add_argument(
"-f", "--file", required=True, help="Details file to be parsed")... |
<|file_name|>cecog.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Methods for working with cecog
Copyright 2010 University of Dundee, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import os
import re
import sys
from omero.cli import... | """Uses PIL to read multiple planes from a local folder.
Planes are combined and uploaded to OMERO as new images with additional T, C,
Z dimensions.
It should be run as a local script (not via scripting service) in order that
it has access to the local users file system. Therefore need EMAN2 or PIL
installed ... |
<|file_name|>cecog.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Methods for working with cecog
Copyright 2010 University of Dundee, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import os
import re
import sys
from omero.cli import... | """Parses an object_details text file, as generated by CeCog Analyzer
and saves the data as ROIs on an Image in OMERO.
Text file is of the form:
frame objID classLabel className centerX centerY mean sd
1 10 6 lateana 1119 41 76.8253796095 \
54.9305640673
Example usage:
bin/omero... |
<|file_name|>cecog.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Methods for working with cecog
Copyright 2010 University of Dundee, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import os
import re
import sys
from omero.cli import... | subDirs.append(fullpath) |
<|file_name|>cecog.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Methods for working with cecog
Copyright 2010 University of Dundee, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import os
import re
import sys
from omero.cli import... | p = path[:-1] # will remove the last folder
p = os.path.dirname(p) |
<|file_name|>cecog.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Methods for working with cecog
Copyright 2010 University of Dundee, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import os
import re
import sys
from omero.cli import... | if os.path.basename(path) == "":
p = path[:-1] # remove slash |
<|file_name|>cecog.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Methods for working with cecog
Copyright 2010 University of Dundee, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import os
import re
import sys
from omero.cli import... | p = path[:-1] # remove slash |
<|file_name|>cecog.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Methods for working with cecog
Copyright 2010 University of Dundee, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import os
import re
import sys
from omero.cli import... | for subDir in subDirs:
self.ctx.err("Processing images in %s" % subDir)
rv = uploadDirAsImages(client.sf, queryService, updateService,
pixelsService, subDir, dataset)
self.ctx.out("%s" % unwrap(rv)) |
<|file_name|>cecog.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Methods for working with cecog
Copyright 2010 University of Dundee, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import os
import re
import sys
from omero.cli import... | self.ctx.err("Processing images in %s" % path)
rv = uploadDirAsImages(client.sf, queryService, updateService,
pixelsService, path, dataset)
self.ctx.out("%s" % unwrap(rv)) |
<|file_name|>cecog.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Methods for working with cecog
Copyright 2010 University of Dundee, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import os
import re
import sys
from omero.cli import... | self.ctx.die(654, "Could find the object_details file at %s"
% filePath) |
<|file_name|>cecog.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Methods for working with cecog
Copyright 2010 University of Dundee, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import os
import re
import sys
from omero.cli import... | cli = CLI()
cli.register("cecog", CecogControl, CecogControl.__doc__)
cli.invoke(sys.argv[1:]) |
<|file_name|>cecog.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Methods for working with cecog
Copyright 2010 University of Dundee, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import os
import re
import sys
from omero.cli import... | _configure |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.