How to use _resolve method in pyresttest

Best Python code snippet using pyresttest_python

resolve.py

Source:resolve.py Github

copy

Full Screen

...53 return G54def resolve(t, symtab=None, fp=None, func_name=None):55 if symtab is None:56 symtab = {}57 do_resolve(t,symtab)58 G = as_networkx(t)59 #import pdb;pdb.set_trace()60 for n in G.nodes():61 u = G.node[n]["ident"]62 if u.props:63 pass64 elif G.out_edges(n) and G.in_edges(n):65 u.props = "U" # upd66 #print u.name, u.lineno, u.column67 elif G.in_edges(n):68 u.props = "D" # def69 elif G.out_edges(n):70 u.props = "R" # ref71 else:72 u.props = "F" # ???73 G.node[n]["label"] = "%s\\n%s" % (n, u.props)74 for u in node.postorder(t):75 #if u.__class__ is node.func_decl:76 # u.ident.name += "_"77 if u.__class__ is node.funcall:78 try:79 if u.func_expr.props in "UR": # upd,ref80 u.__class__ = node.arrayref81 #else:82 # u.func_expr.name += "_"83 except:84 pass85 for u in node.postorder(t):86 if u.__class__ in (node.arrayref,node.cellarrayref):87 for i,v in enumerate(u.args):88 if v.__class__ is node.expr and v.op == ":":89 v.op = "::"90# for w in node.postorder(v):91# if w.__class__ is node.expr and w.op == "end":92# w.args[0] = u.func_expr93# w.args[1] = node.number(i)94 for u in node.postorder(t):95 if u.__class__ is node.let:96 if (u.ret.__class__ is node.ident and97 u.args.__class__ is node.matrix):98 u.args = node.funcall(func_expr=node.ident("matlabarray"),99 args=node.expr_list([u.args]))100 H = nx.connected_components(G.to_undirected())101 for i,component in enumerate(H):102 for nodename in component:103 if G.node[nodename]["ident"].props == "R":104 has_update = 1105 break106 else:107 has_update = 0108 if has_update:109 for nodename in component:110 G.node[nodename]["ident"].props += "S" # sparse111 #S = G.subgraph(nbunch)112 #print S.edges()113 return G114def do_resolve(t,symtab):115 t._resolve(symtab)116def copy_symtab(symtab):117 new_symtab = copy.copy(symtab)118 for k,v in new_symtab.items():119 new_symtab[k] = copy.copy(v)120 return new_symtab121@extend(node.function)122def _resolve(self,symtab):123 self.head._resolve(symtab)124 self.body._resolve(symtab)125 self.head.ret._resolve(symtab)126 127@extend(node.global_list)128@extend(node.concat_list)129@extend(node.expr_list)130def _resolve(self,symtab):131 for expr in self:132 expr._resolve(symtab)133@extend(node.global_list)134@extend(node.concat_list)135@extend(node.expr_list)136def _lhs_resolve(self,symtab):137 for expr in self:138 expr._lhs_resolve(symtab)139 140@extend(node.stmt_list)141def _resolve(self,symtab):142 for stmt in self:143 stmt._resolve(symtab)144 145@extend(node.number)146@extend(node.string)147def _resolve(self,symtab):148 pass149# @extend(node.call_stmt)150# def _resolve(self,symtab):151# # TODO: does the order of A and B matter? Only if the152# # evaluation of function args may change the value of the153# # func_expr. 154# self.func_expr._resolve(symtab) # A155# self.args._resolve(symtab) # B156# self.ret._lhs_resolve(symtab)157@extend(node.let)158def _lhs_resolve(self,symtab):159 self.args._resolve(symtab)160 self.ret._lhs_resolve(symtab)161@extend(node.let)162def _resolve(self,symtab):163 self.args._resolve(symtab)164 self.ret._lhs_resolve(symtab)165@extend(node.func_decl)166def _resolve(self,symtab):167 if self.ident:168 self.ident._resolve(symtab)169 self.args._lhs_resolve(symtab)170 self.ret._resolve(symtab)171@extend(node.for_stmt)172def _resolve(self,symtab):173 symtab_copy = copy_symtab(symtab)174 self.ident._lhs_resolve(symtab)175 self.expr._resolve(symtab)176 self.stmt_list._resolve(symtab)177 self.stmt_list._resolve(symtab) # 2nd time, intentionally178 # Handle the case where FOR loop is not executed179 for k,v in symtab_copy.items():180 symtab.setdefault(k,set()).update(v)181@extend(node.if_stmt)182def _resolve(self,symtab):183 symtab_copy = copy_symtab(symtab)184 self.cond_expr._resolve(symtab)185 self.then_stmt._resolve(symtab)186 if self.else_stmt:187 self.else_stmt._resolve(symtab_copy)188 for k,v in symtab_copy.items():189 symtab.setdefault(k,set()).update(v)190 191@extend(node.continue_stmt) # FIXME192@extend(node.break_stmt) # FIXME193def _resolve(self,symtab):194 pass195@extend(node.global_stmt)196def _resolve(self,symtab):197 self.global_list._lhs_resolve(symtab)198 199@extend(node.return_stmt)200def _resolve(self,symtab):201 self.ret._resolve(symtab)202 #symtab.clear()203@extend(node.expr_stmt)204def _resolve(self,symtab):205 self.expr._resolve(symtab)206 207@extend(node.where_stmt) # FIXME where_stmt ???208@extend(node.while_stmt)209def _resolve(self,symtab):210 symtab_copy = copy_symtab(symtab)211 self.cond_expr._resolve(symtab)212 self.stmt_list._resolve(symtab)213 self.cond_expr._resolve(symtab)214 self.stmt_list._resolve(symtab)215 # Handle the case where WHILE loop is not executed216 for k,v in symtab_copy.items():217 symtab.setdefault(k,set()).update(v)218@extend(node.try_catch)219def _resolve(self,symtab):220 self.try_stmt._resolve(symtab)221 self.catch_stmt._resolve(symtab) # ???222@extend(node.ident)223def _lhs_resolve(self,symtab):224 symtab[self.name] = set([self])225 226@extend(node.ident)227def _resolve(self,symtab):228 if self.defs is None:229 self.defs = set()230 try:231 self.defs |= symtab[self.name]232 except KeyError:233 # defs == set() means name used, but not defined234 pass235 236@extend(node.arrayref)237@extend(node.cellarrayref)238@extend(node.funcall)239def _resolve(self,symtab):240 # Matlab does not allow foo(bar)(bzz), so func_expr is usually241 # an ident, though it may be a field or a dot expression.242 if self.func_expr:243 self.func_expr._resolve(symtab)244 self.args._resolve(symtab)245 #if self.ret:246 # self.ret._lhs_resolve(symtab)247@extend(node.setfield) # a subclass of funcall248def _resolve(self,symtab):249 self.func_expr._resolve(symtab)250 self.args._resolve(symtab)251 self.args[0]._lhs_resolve(symtab) 252@extend(node.arrayref)253@extend(node.cellarrayref)254@extend(node.funcall) 255def _lhs_resolve(self,symtab):256 # Definitely lhs array indexing. It's both a ref and a def.257 # Must properly handle cases such as foo(foo(17))=42258 # Does the order of A and B matter?259 self.func_expr._resolve(symtab) # A260 self.args._resolve(symtab) # B261 self.func_expr._lhs_resolve(symtab)262 263@extend(node.expr)264def _resolve(self,symtab):265 for expr in self.args:266 expr._resolve(symtab)267@extend(node.expr)268def _lhs_resolve(self,symtab):269 if self.op == ".": # see setfield270 self.args._resolve(symtab)271 self.args[0]._lhs_resolve(symtab)272 elif self.op == "[]":273 for arg in self.args:274 arg._lhs_resolve(symtab)...

Full Screen

Full Screen

rewrite.py

Source:rewrite.py Github

copy

Full Screen

...75# G.node[nodename]["ident"].props += "S" # sparse76# #S = G.subgraph(nbunch)77# #print S.edges()78# return G79def do_resolve(t,symtab):80 t._resolve(symtab)81def copy_symtab(symtab):82 new_symtab = copy.copy(symtab)83 for k,v in new_symtab.items():84 new_symtab[k] = copy.copy(v)85 return new_symtab86@extend(node.arrayref)87@extend(node.cellarrayref)88@extend(node.funcall)89def _lhs_resolve(self,symtab):90 # Definitely lhs array indexing. It's both a ref and a def.91 # Must properly handle cases such as foo(foo(17))=4292 # Does the order of A and B matter?93 self.func_expr._resolve(symtab) # A94 self.args._resolve(symtab) # B95 self.func_expr._lhs_resolve(symtab)96 97@extend(node.expr)98def _lhs_resolve(self,symtab):99 if self.op == ".": # see setfield100 self.args._resolve(symtab)101 self.args[0]._lhs_resolve(symtab)102 elif self.op == "[]":103 for arg in self.args:104 arg._lhs_resolve(symtab)105 106@extend(node.expr_stmt)107def _resolve(self,symtab):108 self.expr._resolve(symtab)109 110@extend(node.for_stmt)111def _resolve(self,symtab):112 symtab_copy = copy_symtab(symtab)113 self.ident._lhs_resolve(symtab)114 self.expr._resolve(symtab)115 self.stmt_list._resolve(symtab)116 self.stmt_list._resolve(symtab) # 2nd time, intentionally117 # Handle the case where FOR loop is not executed118 for k,v in symtab_copy.items():119 symtab.setdefault(k,[]).append(v)120 121@extend(node.func_stmt)122def _resolve(self,symtab):123 if self.ident:124 self.ident._resolve(symtab)125 self.args._lhs_resolve(symtab)126 self.ret._resolve(symtab)127 128@extend(node.global_list)129@extend(node.concat_list)130@extend(node.expr_list)131def _lhs_resolve(self,symtab):132 for expr in self:133 expr._lhs_resolve(symtab)134 135@extend(node.global_list)136@extend(node.concat_list)137@extend(node.expr_list)138def _resolve(self,symtab):139 for expr in self:140 expr._resolve(symtab)141 142@extend(node.global_stmt)143def _resolve(self,symtab):144 self.global_list._lhs_resolve(symtab)145 146@extend(node.ident)147def _lhs_resolve(self,symtab):148 symtab[self.name] = [self]149 150@extend(node.if_stmt)151def _resolve(self,symtab):152 symtab_copy = copy_symtab(symtab)153 self.cond_expr._resolve(symtab)154 self.then_stmt._resolve(symtab)155 if self.else_stmt:156 self.else_stmt._resolve(symtab_copy)157 for k,v in symtab_copy.items():158 symtab.setdefault(k,[]).append(v)159 160@extend(node.let)161def _lhs_resolve(self,symtab):162 self.args._resolve(symtab)163 self.ret._lhs_resolve(symtab)164 165@extend(node.let)166def _resolve(self,symtab):167 self.args._resolve(symtab)168 self.ret._lhs_resolve(symtab)169 170@extend(node.null_stmt)171@extend(node.continue_stmt)172@extend(node.break_stmt)173def _resolve(self,symtab):174 pass175 176@extend(node.setfield) # a subclass of funcall177def _resolve(self,symtab):178 self.func_expr._resolve(symtab)179 self.args._resolve(symtab)180 self.args[0]._lhs_resolve(symtab)181 182@extend(node.try_catch)183def _resolve(self,symtab):184 self.try_stmt._resolve(symtab)185 self.catch_stmt._resolve(symtab) # ???186 187@extend(node.ident)188def _resolve(self,symtab):189 if self.defs is None:190 self.defs = []191 try:192 self.defs += symtab[self.name]193 except KeyError:194 # defs == set() means name used, but not defined195 pass196 197@extend(node.arrayref)198@extend(node.cellarrayref)199@extend(node.funcall)200def _resolve(self,symtab):201 # Matlab does not allow foo(bar)(bzz), so func_expr is usually202 # an ident, though it may be a field or a dot expression.203 if self.func_expr:204 self.func_expr._resolve(symtab)205 self.args._resolve(symtab)206 #if self.ret:207 # self.ret._lhs_resolve(symtab)208 209@extend(node.expr)210def _resolve(self,symtab):211 for expr in self.args:212 expr._resolve(symtab)213 214@extend(node.number)215@extend(node.string)216@extend(node.comment_stmt)217def _resolve(self,symtab):218 pass219# @extend(node.call_stmt)220# def _resolve(self,symtab):221# # TODO: does the order of A and B matter? Only if the222# # evaluation of function args may change the value of the223# # func_expr.224# self.func_expr._resolve(symtab) # A225# self.args._resolve(symtab) # B226# self.ret._lhs_resolve(symtab)227 228@extend(node.return_stmt)229def _resolve(self,symtab):230 self.ret._resolve(symtab)231 #symtab.clear()232 233@extend(node.stmt_list)234def _resolve(self,symtab):235 for stmt in self:236 stmt._resolve(symtab)237 238@extend(node.where_stmt) # FIXME where_stmt ???239@extend(node.while_stmt)240def _resolve(self,symtab):241 symtab_copy = copy_symtab(symtab)242 self.cond_expr._resolve(symtab)243 self.stmt_list._resolve(symtab)244 self.cond_expr._resolve(symtab)245 self.stmt_list._resolve(symtab)246 # Handle the case where WHILE loop is not executed247 for k,v in symtab_copy.items():248 symtab.setdefault(k,[]).append(v)249 @extend(node.function)250def _resolve(self,symtab):251 self.head._resolve(symtab)252 self.body._resolve(symtab)...

Full Screen

Full Screen

index.js

Source:index.js Github

copy

Full Screen

...6Vue.use(VueRouter)7const constantRoutes = [8 {9 path: '/login',10 component: _resolve('user/login'),11 name: 'login'12 },13 {14 path: '/',15 component: Slide,16 name: 'slide',17 children: [18 {19 path: '',20 component: Layout,21 children: [22 {23 path: '',24 name: 'home',25 component: _resolve('home/default')26 }27 ]28 },29 {30 path: '/product-list',31 component: Layout,32 children: [33 {34 path: '',35 name: 'productlist',36 component: _resolve('product/list')37 }38 ]39 },40 {41 path: '/abao-detail',42 component: _resolve('product/abaoDetail'),43 name: 'abaoDetail',44 meta: {45 keepAlive: false46 }47 },48 {49 path: '/nlp-detail',50 component: _resolve('product/nlpDetail'),51 name: 'nlpDetail',52 meta: {53 keepAlive: false54 }55 },56 {57 path: '/face-recognition',58 component: _resolve('product/faceRecognition'),59 name: 'faceRecognition'60 },61 {62 path: '/voice-verification',63 component: _resolve('product/voiceVerification'),64 name: 'voiceVerification'65 },66 {67 path: '/voice-to-words',68 component: _resolve('product/voiceToWords'),69 name: 'voiceToWords'70 },71 {72 path: '/voice-dictation',73 component: _resolve('product/vocieDictation'),74 name: 'vocieDictation'75 },76 {77 path: '/service',78 component: Layout,79 children: [80 {81 path: '',82 name: 'service',83 component: _resolve('doc/list')84 }85 ]86 },87 {88 path: '/my',89 component: Layout,90 children: [91 {92 path: '',93 name: 'my',94 component: _resolve('user/my')95 }96 ]97 },98 {99 path: '/vcCode',100 component: _resolve('user/getVcCode'),101 name: 'vcCode'102 },103 {104 path: '/personal-data',105 component: _resolve('user/personalData'),106 name: 'personalData'107 },108 {109 path: '/edit-personal-data',110 component: _resolve('user/editPersonalData'),111 name: 'editPersonalData'112 },113 {114 path: '/confirm-binding',115 component: _resolve('user/confirmBinding'),116 name: 'confirmBinding'117 },118 {119 path: '/change-binding',120 component: _resolve('user/changeBinding'),121 name: 'changeBinding'122 },123 {124 path: '/abao-doc',125 component: _resolve('doc/abao'),126 name: 'aboDoc'127 },128 {129 path: '/nlp-doc',130 component: _resolve('doc/nlp'),131 name: 'nlpDoc'132 },133 {134 path: '/order-list',135 component: _resolve('order/list'),136 name: 'orderList'137 },138 {139 path: '/order-detail',140 component: _resolve('order/detail'),141 name: 'orderDetail'142 },143 {144 path: '/apply-invoice',145 component: _resolve('invoice/apply'),146 name: 'applyInvoice'147 },148 {149 path: '/invoice-list',150 component: _resolve('invoice/list'),151 name: 'invoiceList'152 },153 {154 path: '/invoice-detail',155 component: _resolve('invoice/detail'),156 name: 'invoiceDetail'157 },158 {159 path: '/message-list',160 component: _resolve('user/messageList'),161 name: 'messageList'162 },163 {164 path: '/message-detail',165 component: _resolve('user/messageDetail'),166 name: 'messageDetail'167 },168 {169 path: '/service-detail',170 component: _resolve('service/detail'),171 name: 'serviceDetail'172 },173 {174 path: '/service-list',175 component: _resolve('service/list'),176 name: 'serviceList'177 },178 {179 path: '/change-email',180 component: _resolve('user/changeEmailBinding'),181 name: 'changeEmailBinding'182 },183 {184 path: '/contract-list',185 component: _resolve('contract/list'),186 name: 'contractList'187 },188 {189 path: '/contract-detail',190 component: _resolve('contract/detail'),191 name: 'contractDetail'192 },193 {194 path: '/apply-contract',195 component: _resolve('contract/apply'),196 name: 'applyContract'197 },198 {199 path: '/chat-room',200 component: _resolve('user/chatRoom'),201 name: 'chatRoom'202 },203 {204 path: '/common-question',205 component: _resolve('user/commonQuestion'),206 name: 'commonQuestion'207 },208 {209 path: '/question-detail',210 component: _resolve('user/questionDetail'),211 name: 'questionDetail'212 },213 {214 path: '/about-us',215 component: _resolve('user/aboutUs'),216 name: 'aboutUs'217 },218 {219 path: '/edit-password',220 component: _resolve('user/editPassword'),221 name: 'editPassword'222 },223 {224 path: '/edit-paymentPwd',225 component: _resolve('user/editPaymentPwd'),226 name: 'editpaymentPwd'227 },228 {229 path: '/forgot-password',230 component: _resolve('user/forgotPassword'),231 name: 'forgotPassword'232 },233 {234 path: '/recharge',235 component: _resolve('recharge/index'),236 name: 'recharge'237 },238 {239 path: '/history-bill',240 component: _resolve('recharge/historyBill'),241 name: 'historyBill'242 },243 {244 path: '/recharge-explain',245 component: _resolve('recharge/explain'),246 name: 'rechargeExplain'247 },248 {249 path: '/recharge-uploader',250 component: _resolve('recharge/uploader'),251 name: 'rechargeUploader'252 },253 {254 path: '/recharge-withdrawal',255 component: _resolve('recharge/withdrawal'),256 name: 'rechargeWithdrawal'257 },258 {259 path: '/recharge-result',260 component: _resolve('recharge/result'),261 name: 'rechargeResult'262 },263 {264 path: '/recharge-withdrawalList',265 component: _resolve('recharge/withdrawalList'),266 name: 'rechargeWithdrawalList'267 },268 {269 path: '/recharge-billDetail',270 component: _resolve('recharge/billDetail'),271 name: 'rechargeBillDetail'272 },273 {274 path: '/forgot-paymentpwd',275 component: _resolve('user/forgotPaymentPwd'),276 name: 'forgotPaymentPwd'277 },278 {279 path: '/abao-serve',280 component: _resolve('service/demo'),281 name: 'serviceDemo'282 },283 {284 path: '/notice-detail',285 component: _resolve('user/noticeDetail'),286 name: 'noticeDetail'287 },288 {289 path: '/exchange-code',290 component: _resolve('user/exchangeCode'),291 name: 'exchangeCode'292 }293 ]294 }295]296const originalPush = VueRouter.prototype.push297VueRouter.prototype.push = function push(location) {298 return originalPush.call(this, location).catch(err => err)299}300const createRouter = () => new VueRouter({301 routes: constantRoutes,302 scrollBehavior() {303 return new Promise(resolve => {304 resolve({ x: 0, y: 0 })...

Full Screen

Full Screen

resolver.js

Source:resolver.js Github

copy

Full Screen

...9 this._delegate = _delegate;10 }11 get capabilities() { return this._delegate.capabilities; }12 write(path, content) {13 return this._delegate.write(this._resolve(path), content);14 }15 read(path) {16 return this._delegate.read(this._resolve(path));17 }18 delete(path) {19 return this._delegate.delete(this._resolve(path));20 }21 rename(from, to) {22 return this._delegate.rename(this._resolve(from), this._resolve(to));23 }24 list(path) {25 return this._delegate.list(this._resolve(path));26 }27 exists(path) {28 return this._delegate.exists(this._resolve(path));29 }30 isDirectory(path) {31 return this._delegate.isDirectory(this._resolve(path));32 }33 isFile(path) {34 return this._delegate.isFile(this._resolve(path));35 }36 // Some hosts may not support stat.37 stat(path) {38 return this._delegate.stat(this._resolve(path));39 }40 // Some hosts may not support watching.41 watch(path, options) {42 return this._delegate.watch(this._resolve(path), options);43 }44}...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run pyresttest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful