prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># coding: utf-8 import unittest from config_reader import ConfigReader class TestConfigReader(unittest.TestCase): def setUp(self): self.config = ConfigReader(""" <root> <person> <name>山田</name> ...
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># coding: utf-8 import unittest from config_reader import ConfigReader class TestConfigReader(unittest.TestCase): <|fim_middle|> <|fim▁end|>
def setUp(self): self.config = ConfigReader(""" <root> <person> <name>山田</name> <age>15</age> </person> <person> <name>佐藤</name> <age>43</age> </person>...
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># coding: utf-8 import unittest from config_reader import ConfigReader class TestConfigReader(unittest.TestCase): def setUp(self): <|fim_middle|> ef test_get_names(self): self.assertEqual(self.config.get_names(), ['山田', '佐藤']) def test_get_...
self.config = ConfigReader(""" <root> <person> <name>山田</name> <age>15</age> </person> <person> <name>佐藤</name> <age>43</age> </person> </root> ...
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># coding: utf-8 import unittest from config_reader import ConfigReader class TestConfigReader(unittest.TestCase): def setUp(self): self.config = ConfigReader(""" <root> <person> <name>山田</name> ...
ertEqual(self.config.get_names(), ['山田', '佐藤']) def test_g
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># coding: utf-8 import unittest from config_reader import ConfigReader class TestConfigReader(unittest.TestCase): def setUp(self): self.config = ConfigReader(""" <root> <person> <name>山田</name> ...
(self.config.get_ages(), ['15', '43'])
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># coding: utf-8 import unittest from config_reader import ConfigReader class TestConfigReader(unittest.TestCase): def <|fim_middle|>(self): self.config = ConfigReader(""" <root> <person> <name>山田</name> ...
setUp
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># coding: utf-8 import unittest from config_reader import ConfigReader class TestConfigReader(unittest.TestCase): def setUp(self): self.config = ConfigReader(""" <root> <person> <name>山田</name> ...
_names(self):
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># coding: utf-8 import unittest from config_reader import ConfigReader class TestConfigReader(unittest.TestCase): def setUp(self): self.config = ConfigReader(""" <root> <person> <name>山田</name> ...
lf):
<|file_name|>dimension.py<|end_file_name|><|fim▁begin|># coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generat...
"""Dimension of a resource metric. For e.g. instance specific HTTP requests for a web app,
<|file_name|>dimension.py<|end_file_name|><|fim▁begin|># coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generat...
"""Dimension of a resource metric. For e.g. instance specific HTTP requests for a web app, where instance name is dimension of the metric HTTP request. :param name: :type name: str :param display_name: :type display_name: str :param internal_name: :type internal_name: str :param...
<|file_name|>dimension.py<|end_file_name|><|fim▁begin|># coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generat...
super(Dimension, self).__init__() self.name = name self.display_name = display_name self.internal_name = internal_name self.to_be_exported_for_shoebox = to_be_exported_for_shoebox
<|file_name|>dimension.py<|end_file_name|><|fim▁begin|># coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generat...
__init__
<|file_name|>artnet-server.py<|end_file_name|><|fim▁begin|>from artnet import * import SocketServer import time, os, random, datetime, sys import argparse import socket import struct from subprocess import Popen, PIPE, STDOUT import glob<|fim▁hole|>DEBUG = False UDP_IP = "2.0.0.61" UDP_PORT = 6454<|fim▁end|>
<|file_name|>liste.py<|end_file_name|><|fim▁begin|># -*-coding:Utf-8 -* # Copyright (c) 2013 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code m...
<|file_name|>liste.py<|end_file_name|><|fim▁begin|># -*-coding:Utf-8 -* # Copyright (c) 2013 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code m...
""Commande 'matelot liste'. """ def __init__(self): """Constructeur du paramètre""" Parametre.__init__(self, "liste", "list") self.tronquer = True self.aide_courte = "liste les matelots de l'équipage" self.aide_longue = \ "Cette commande liste les matelo...
<|file_name|>liste.py<|end_file_name|><|fim▁begin|># -*-coding:Utf-8 -* # Copyright (c) 2013 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code m...
""Constructeur du paramètre""" Parametre.__init__(self, "liste", "list") self.tronquer = True self.aide_courte = "liste les matelots de l'équipage" self.aide_longue = \ "Cette commande liste les matelots de votre équipage. " \ "Elle permet d'obtenir rapide...
<|file_name|>liste.py<|end_file_name|><|fim▁begin|># -*-coding:Utf-8 -* # Copyright (c) 2013 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code m...
terprétation du paramètre""" salle = personnage.salle if not hasattr(salle, "navire"): personnage << "|err|Vous n'êtes pas sur un navire.|ff|" return navire = salle.navire equipage = navire.equipage if not navire.a_le_droit(personnage, "officier")...
<|file_name|>liste.py<|end_file_name|><|fim▁begin|># -*-coding:Utf-8 -* # Copyright (c) 2013 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code m...
age << "|err|Vous n'êtes pas sur un navire.|ff|" return
<|file_name|>liste.py<|end_file_name|><|fim▁begin|># -*-coding:Utf-8 -* # Copyright (c) 2013 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code m...
ge << "|err|Vous ne pouvez donner d'ordre sur ce " \ "navire.|ff|" return
<|file_name|>liste.py<|end_file_name|><|fim▁begin|># -*-coding:Utf-8 -* # Copyright (c) 2013 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code m...
ge << "|err|Votre équipage ne comprend aucun matelot.|ff|" return
<|file_name|>liste.py<|end_file_name|><|fim▁begin|># -*-coding:Utf-8 -* # Copyright (c) 2013 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code m...
atelot.personnage.salle.titre_court.capitalize()
<|file_name|>liste.py<|end_file_name|><|fim▁begin|># -*-coding:Utf-8 -* # Copyright (c) 2013 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code m...
_init__(
<|file_name|>liste.py<|end_file_name|><|fim▁begin|># -*-coding:Utf-8 -* # Copyright (c) 2013 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code m...
preter(self
<|file_name|>fc_scan.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re<|fim▁hole|>from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure import conf INC_REGEX="""(?:^|[...
from waflib import Utils,Task,TaskGen,Logs
<|file_name|>fc_scan.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re from waflib import Utils,Task,TaskGen,Logs from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure...
def __init__(self,incpaths): self.seen=[] self.nodes=[] self.names=[] self.incpaths=incpaths def find_deps(self,node): txt=node.read() incs=[] uses=[] mods=[] for line in txt.splitlines(): m=re_inc.search(line) if m: incs.append(m.group(1)) m=re_use.search(line) if m: uses.append...
<|file_name|>fc_scan.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re from waflib import Utils,Task,TaskGen,Logs from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure...
self.seen=[] self.nodes=[] self.names=[] self.incpaths=incpaths
<|file_name|>fc_scan.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re from waflib import Utils,Task,TaskGen,Logs from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure...
txt=node.read() incs=[] uses=[] mods=[] for line in txt.splitlines(): m=re_inc.search(line) if m: incs.append(m.group(1)) m=re_use.search(line) if m: uses.append(m.group(1)) m=re_mod.search(line) if m: mods.append(m.group(1)) return(incs,uses,mods)
<|file_name|>fc_scan.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re from waflib import Utils,Task,TaskGen,Logs from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure...
self.waiting=[node] while self.waiting: nd=self.waiting.pop(0) self.iter(nd)
<|file_name|>fc_scan.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re from waflib import Utils,Task,TaskGen,Logs from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure...
path=node.abspath() incs,uses,mods=self.find_deps(node) for x in incs: if x in self.seen: continue self.seen.append(x) self.tryfind_header(x) for x in uses: name="USE@%s"%x if not name in self.names: self.names.append(name) for x in mods: name="MOD@%s"%x if not name in self.names:...
<|file_name|>fc_scan.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re from waflib import Utils,Task,TaskGen,Logs from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure...
found=None for n in self.incpaths: found=n.find_resource(filename) if found: self.nodes.append(found) self.waiting.append(found) break if not found: if not filename in self.names: self.names.append(filename)
<|file_name|>fc_scan.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re from waflib import Utils,Task,TaskGen,Logs from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure...
incs.append(m.group(1))
<|file_name|>fc_scan.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re from waflib import Utils,Task,TaskGen,Logs from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure...
uses.append(m.group(1))
<|file_name|>fc_scan.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re from waflib import Utils,Task,TaskGen,Logs from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure...
mods.append(m.group(1))
<|file_name|>fc_scan.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re from waflib import Utils,Task,TaskGen,Logs from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure...
continue
<|file_name|>fc_scan.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re from waflib import Utils,Task,TaskGen,Logs from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure...
self.names.append(name)
<|file_name|>fc_scan.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re from waflib import Utils,Task,TaskGen,Logs from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure...
self.names.append(name)
<|file_name|>fc_scan.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re from waflib import Utils,Task,TaskGen,Logs from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure...
self.nodes.append(found) self.waiting.append(found) break
<|file_name|>fc_scan.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re from waflib import Utils,Task,TaskGen,Logs from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure...
if not filename in self.names: self.names.append(filename)
<|file_name|>fc_scan.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re from waflib import Utils,Task,TaskGen,Logs from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure...
self.names.append(filename)
<|file_name|>fc_scan.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re from waflib import Utils,Task,TaskGen,Logs from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure...
__init__
<|file_name|>fc_scan.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re from waflib import Utils,Task,TaskGen,Logs from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure...
find_deps
<|file_name|>fc_scan.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re from waflib import Utils,Task,TaskGen,Logs from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure...
start
<|file_name|>fc_scan.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re from waflib import Utils,Task,TaskGen,Logs from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure...
iter
<|file_name|>fc_scan.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re from waflib import Utils,Task,TaskGen,Logs from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure...
tryfind_header
<|file_name|>procurement_pull.py<|end_file_name|><|fim▁begin|>############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or mod...
<|file_name|>procurement_pull.py<|end_file_name|><|fim▁begin|>############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or mod...
_inherit = 'procurement.order' def check_buy(self, cr, uid, ids, context=None): for procurement in self.browse(cr, uid, ids, context=context): for line in procurement.product_id.flow_pull_ids: if line.location_id==procurement.location_id: return line.type_...
<|file_name|>procurement_pull.py<|end_file_name|><|fim▁begin|>############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or mod...
for procurement in self.browse(cr, uid, ids, context=context): for line in procurement.product_id.flow_pull_ids: if line.location_id==procurement.location_id: return line.type_proc=='buy' return super(procurement_order, self).check_buy(cr, uid, ids)
<|file_name|>procurement_pull.py<|end_file_name|><|fim▁begin|>############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or mod...
for procurement in self.browse(cr, uid, ids, context=context): for line in procurement.product_id.flow_pull_ids: if line.location_id==procurement.location_id: return line.type_proc=='produce' return super(procurement_order, self).check_produce(cr, uid, ids...
<|file_name|>procurement_pull.py<|end_file_name|><|fim▁begin|>############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or mod...
for procurement in self.browse(cr, uid, ids, context=context): for line in procurement.product_id.flow_pull_ids: if line.location_id==procurement.location_id: return (line.type_proc=='move') and (line.location_src_id) return False
<|file_name|>procurement_pull.py<|end_file_name|><|fim▁begin|>############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or mod...
proc_obj = self.pool.get('procurement.order') move_obj = self.pool.get('stock.move') picking_obj=self.pool.get('stock.picking') wf_service = netsvc.LocalService("workflow") for proc in proc_obj.browse(cr, uid, ids, context=context): line = None for line in...
<|file_name|>procurement_pull.py<|end_file_name|><|fim▁begin|>############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or mod...
return line.type_proc=='buy'
<|file_name|>procurement_pull.py<|end_file_name|><|fim▁begin|>############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or mod...
return line.type_proc=='produce'
<|file_name|>procurement_pull.py<|end_file_name|><|fim▁begin|>############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or mod...
return (line.type_proc=='move') and (line.location_src_id)
<|file_name|>procurement_pull.py<|end_file_name|><|fim▁begin|>############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or mod...
break
<|file_name|>procurement_pull.py<|end_file_name|><|fim▁begin|>############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or mod...
move_obj.write(cr,uid, [proc.move_id.id], { 'state':'waiting' }, context=context)
<|file_name|>procurement_pull.py<|end_file_name|><|fim▁begin|>############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or mod...
move_obj.write(cr, uid, [proc.move_id.id], {'location_id':proc.location_id.id})
<|file_name|>procurement_pull.py<|end_file_name|><|fim▁begin|>############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or mod...
check_buy
<|file_name|>procurement_pull.py<|end_file_name|><|fim▁begin|>############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or mod...
check_produce
<|file_name|>procurement_pull.py<|end_file_name|><|fim▁begin|>############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or mod...
check_move
<|file_name|>procurement_pull.py<|end_file_name|><|fim▁begin|>############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or mod...
action_move_create
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
rs = cur.execute("select * from SYS.SYSTABLES") assert all({isinstance(row, rs.Row) for row in rs.fetchmany(5)})
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): <|fim_middle|> def test_execute(derby): cur = derby.cursor() rs = cur.exe...
url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway) cur = conn.cursor() rs = cur.execute("select * from SYS.SYSTABLES") assert isinstance(rs, ResultSet)
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
cur = derby.cursor() rs = cur.execute("select * from SYS.SYSTABLES") assert isinstance(rs, ResultSet)
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
derby.autocommit = False cur = derby.cursor() cur.execute("create schema x_with_params") cur.execute("create table x_with_params.cowtest(a int, b char(1))") # Verify table is empty. rows = cur.execute("select * from x_with_params.cowtest as r").fetchall() assert len(rows) == 0 # Insert o...
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
cur = derby.cursor() rs = cur.execute("select * from SYS.SYSTABLES") assert isinstance(rs.fetchone(), rs.Row)
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
'''Assert all rows of result set have the correct class. ''' cur = derby.cursor() rs = cur.execute("select * from SYS.SYSTABLES") assert all({isinstance(row, rs.Row) for row in rs.fetchmany(5)})
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
derby.autocommit = False cur = derby.cursor() cur.execute("create schema x_with_params") cur.execute("create table x_with_params.cowtest(a int, b char(1))") sql = "insert into x_with_params.cowtest (a, b) values (?, ?)" params = list(enumerate("thecowsaremooing")) cur.executemany(sql, params...
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
'''Assert all rows of result set have the correct class. ''' cur = derby.cursor() rs = cur.execute("select * from SYS.SYSTABLES") assert all({isinstance(row, rs.Row) for row in rs.fetchall()})
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
cur = derby.cursor() rs = cur.execute("select * from SYS.SYSTABLES") assert all({isinstance(row, rs.Row) for row in rs})
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
cur = derby.cursor() rs = cur.execute("select * from SYS.SYSTABLES") # Exhaust all rows. list(rs) assert rs.fetchone() == None
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
cur = derby.cursor() cur.close() with pytest.raises(Error): cur.execute("select * from SYS.SYSTABLES")
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
cur = derby.cursor() cur.execute("select * from SYS.SYSTABLES") cur.close() with pytest.raises(Error): cur.fetchone()
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
cur = derby.cursor() cur.close() with pytest.raises(Error): cur.close()
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
break
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def <|fim_middle|>(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gatew...
test_connect
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
test_execute
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
test_execute_with_params
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
test_fetchone
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
test_fetchmany
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
test_fetchManyCount
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
test_fetchall
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
test_Cursor__iter__
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
test_Cursor__iter__
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
test_close_and_execute
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
test_close_and_fetchone
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway...
test_close_twice
<|file_name|>scan.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # @Author: yancz1989 # @Date: 2017-01-17 23:43:18 # @Last Modified by: yancz1989 # @Last Modified time: 2017-02-22 20:33:29 import utilities as util from utilities import parse_image_file, filterBoxes, voxel_2_world, mkdir import numpy as np ...
generate_scan_image(sys.argv[2])
<|file_name|>scan.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # @Author: yancz1989 # @Date: 2017-01-17 23:43:18 # @Last Modified by: yancz1989 # @Last Modified time: 2017-02-22 20:33:29 import utilities as util from utilities import parse_image_file, filterBoxes, voxel_2_world, mkdir import numpy as np ...
list_dirs = os.walk(TRUNK_DIR + subset) jsobjs = [] output_dir = SAMPLE_DIR + subset mkdir(output_dir) for root, dirs, files in list_dirs: for f in files: if f.lower().endswith('mhd'): key = os.path.splitext(f)[0] numpyImage, numpyOrigin, numpySpacing = ( util.load_itk_imag...
<|file_name|>scan.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # @Author: yancz1989 # @Date: 2017-01-17 23:43:18 # @Last Modified by: yancz1989 # @Last Modified time: 2017-02-22 20:33:29 import utilities as util from utilities import parse_image_file, filterBoxes, voxel_2_world, mkdir import numpy as np ...
result_map = {} with open(input_file) as f: result_list = json.load(f) for it in result_list: key, subset, z = parse_image_file(it['file']) src_file = os.path.join( data_root, subset, key + ".mhd") boxes = filterBoxes(it['box'], threshold) if not result_map.get(src_file): result_ma...
<|file_name|>scan.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # @Author: yancz1989 # @Date: 2017-01-17 23:43:18 # @Last Modified by: yancz1989 # @Last Modified time: 2017-02-22 20:33:29 import utilities as util from utilities import parse_image_file, filterBoxes, voxel_2_world, mkdir import numpy as np ...
with open(output_file) as fout: fout.write("seriesuid,coordX,coordY,coordZ,probability\n") for fkey, val in result_map.items(): itkimage = sitk.ReadImage(fkey) for it in val: key, z, boxes = val for box in boxes: world_box = voxel_2_world( [z, box[1], box[0]],...
<|file_name|>scan.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # @Author: yancz1989 # @Date: 2017-01-17 23:43:18 # @Last Modified by: yancz1989 # @Last Modified time: 2017-02-22 20:33:29 import utilities as util from utilities import parse_image_file, filterBoxes, voxel_2_world, mkdir import numpy as np ...
key = os.path.splitext(f)[0] numpyImage, numpyOrigin, numpySpacing = ( util.load_itk_image( os.path.join(root, f))) for z in range(numpyImage.shape[0]): patch = numpyImage[z, 0:512, 0:512] patch = util.normalizePlanes(patch) im = Image.fromarra...
<|file_name|>scan.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # @Author: yancz1989 # @Date: 2017-01-17 23:43:18 # @Last Modified by: yancz1989 # @Last Modified time: 2017-02-22 20:33:29 import utilities as util from utilities import parse_image_file, filterBoxes, voxel_2_world, mkdir import numpy as np ...
result_map[src_file] = []
<|file_name|>scan.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # @Author: yancz1989 # @Date: 2017-01-17 23:43:18 # @Last Modified by: yancz1989 # @Last Modified time: 2017-02-22 20:33:29 import utilities as util from utilities import parse_image_file, filterBoxes, voxel_2_world, mkdir import numpy as np ...
if sys.argv[1] == 'gen': generate_scan_image(sys.argv[2]) else: result_map = get_image_map(TRUNK_DIR, sys.argv[2], 0.01) generate_result(result_map, OUTPUT_FILE)
<|file_name|>scan.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # @Author: yancz1989 # @Date: 2017-01-17 23:43:18 # @Last Modified by: yancz1989 # @Last Modified time: 2017-02-22 20:33:29 import utilities as util from utilities import parse_image_file, filterBoxes, voxel_2_world, mkdir import numpy as np ...
generate_scan_image(sys.argv[2])
<|file_name|>scan.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # @Author: yancz1989 # @Date: 2017-01-17 23:43:18 # @Last Modified by: yancz1989 # @Last Modified time: 2017-02-22 20:33:29 import utilities as util from utilities import parse_image_file, filterBoxes, voxel_2_world, mkdir import numpy as np ...
result_map = get_image_map(TRUNK_DIR, sys.argv[2], 0.01) generate_result(result_map, OUTPUT_FILE)
<|file_name|>scan.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # @Author: yancz1989 # @Date: 2017-01-17 23:43:18 # @Last Modified by: yancz1989 # @Last Modified time: 2017-02-22 20:33:29 import utilities as util from utilities import parse_image_file, filterBoxes, voxel_2_world, mkdir import numpy as np ...
generate_scan_image
<|file_name|>scan.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # @Author: yancz1989 # @Date: 2017-01-17 23:43:18 # @Last Modified by: yancz1989 # @Last Modified time: 2017-02-22 20:33:29 import utilities as util from utilities import parse_image_file, filterBoxes, voxel_2_world, mkdir import numpy as np ...
get_image_map
<|file_name|>scan.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # @Author: yancz1989 # @Date: 2017-01-17 23:43:18 # @Last Modified by: yancz1989 # @Last Modified time: 2017-02-22 20:33:29 import utilities as util from utilities import parse_image_file, filterBoxes, voxel_2_world, mkdir import numpy as np ...
generate_result
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache Licens...
html_use_smartypants = True
<|file_name|>app.py<|end_file_name|><|fim▁begin|><|fim▁hole|> urls = ( '/hello','Index' ) app = web.application(urls,globals()) render = web.template.render('/usr/local/LPTHW/ex51/gothonweb/templates/',base="layout") class Index(object): def GET(self): return render.hello_form() ...
import web