prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | charCount = charCount + 1
print operandCount, " 1" |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | numCount = numCount + 1
print operandCount, " 2" |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | print 'TRUE' |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | operandCount = operandCount + 1
print operandCount, " 3"
# if(re.search('[\s*\+|\s*\-|\s*\/]+', userInput[endOfLine])):
if(re.search('[+-/*]+', userInput[endOfLine])):
print "invalid expression"
print "1"
exit(0)
else:
if((re.search('[\s*a-zA-Z]+', userInput[i - 1])) or (re.search('[\s*\d]+', user... |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | print "invalid expression"
print "1"
exit(0) |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | if((re.search('[\s*a-zA-Z]+', userInput[i - 1])) or (re.search('[\s*\d]+', userInput[i - 1]))):
continue
else:
print 'invalid expression'
print '2'
exit(0)
if(re.search('[\s*\d]+', userInput[i - 1])):
continue
else:
print 'invalid expression'
print '3'
exit(0)
if(re.searc... |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | continue |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | print 'invalid expression'
print '2'
exit(0) |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | continue |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | print 'invalid expression'
print '3'
exit(0) |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | continue |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | continue |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | continue |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | continue |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | print 'invalid expression'
print '4'
exit(0) |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | entryBracketCount = entryBracketCount + 1
print operandCount, " 4" |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | exitBracketCount = exitBracketCount + 1
print operandCount, " 5"
if(re.search('[\)]+', userInput[endOfLine])):
continue
else:
if(re.search('[\(]+', userInput[i + 1])):
print 'invalid expression'
print '5'
exit(0) |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | continue |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | if(re.search('[\(]+', userInput[i + 1])):
print 'invalid expression'
print '5'
exit(0) |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | print 'invalid expression'
print '5'
exit(0) |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | print "invalid expression"
print '6'
exit(0) |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | print operandCount
print "invalid expression"
print '7'
exit(0) |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | print "invalid expression"
print '8'
exit(0) |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... | print "valid expression" |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
... | print func.__name__ |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
<|fim_middle|>
_retries(times=3, timeout=2):
"""响应为空的进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
... | """对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
return func(*args, **kw)
except:
att += timeout
if r... |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, <|fim_middle|>
r
def empty_content_retries(times=3, timeout=2):
"""响应为空的进行重试"""
def decorator(func):
de... | **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
return func(*args, **kw)
except:
att += timeout
if retry < times:
time.sleep(att)
retu... |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
<|fim_middle|>
pper
return decorator
def empty_content_retries(times=3, time... | while retry < times:
retry += 1
try:
return func(*args, **kw)
except:
att += timeout
if retry < times:
time.sleep(att)
return _wra |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
... | def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
ret = func(*args, **kw)
if ret:
return ret
att += timeout
time.sleep(att)
retu... |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
... | att, retry = 0, 0
while retry < times:
retry += 1
ret = func(*args, **kw)
if ret:
return ret
att += timeout
time.sleep(att)
return _wrapper
return decorator
def use_loggin |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
... | try < times:
retry += 1
ret = func(*args, **kw)
if ret:
return ret
att += timeout
time.sleep(att)
return _wrapper
return de |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
... |
print func.__name__
def wrapper(*args, **kwargs):
if level == "warn":
print ("level:%s, %s is running" % (level, func.__name__))
elif level == "info":
print ("level:%s, %s is running" % (level, func.__name__))
return func(*args, **... |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
... | rgs):
if level == "warn":
print ("level:%s, %s is running" % (level, func.__name__))
elif level == "info":
print ("level:%s, %s is running" % (level, func.__name__))
return func(*args, **kwargs)
return wrapper
return decorator
if _... |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
... | , %s is running" % (level, func.__name__))
elif level == "info":
print ("level:%s, %s is running" % (level, func.__name__))
return func(*args, **kwargs)
return wrapper
return decorator
if __n |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
... | |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
... | return _wra |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
... | out
|
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
... | me__))
elif level == "info":
p |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
... | me__))
return func(*args, **kwargs)
re |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
... | print("i am %s" % name)
foo() |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def <|fim_middle|>(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
t... | retries |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
<|fim_middle|>_wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try... | def |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw<|fim_middle|> att, retry = 0, 0
while retry < times:
retry += 1
tr... | ):
|
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
... | s(times=3, timeout=2) |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
... | *args, ** |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
... | , retry |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
... | def dec |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
... | def wrap |
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
... | arn":
|
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*-
import time
def retries(times=3, timeout=1):
"""对未捕获异常进行重试"""
def decorator(func):
def _wrapper(*args, **kw):
att, retry = 0, 0
while retry < times:
retry += 1
try:
... | fo |
<|file_name|>official.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#CHANGE ONLY, IF YOU KNOW, WHAT YOU DO!
#OPKMANAGER WILL CRASH IF YOUR OUTPUT IS INVALID!
import subprocess
import argparse
import time
import calendar
import string
import sys
class RegisterAction(argparse.Action):
def __call__(self, parser, nam... | |
<|file_name|>official.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#CHANGE ONLY, IF YOU KNOW, WHAT YOU DO!
#OPKMANAGER WILL CRASH IF YOUR OUTPUT IS INVALID!
import subprocess
import argparse
import time
import calendar
import string
import sys
class RegisterAction(argparse.Action):
<|fim_middle|>
class UpdateA... | def __call__(self, parser, namespace, values, option_string=None):
print "Official Repository" # Name
print "web" # Type (maybe web for web, or anything else for usb)
print "http://www.gcw-zero.com/files/upload/opk/" #URL
print "official.py --update" #Call for updating the list
print "O" #letter to show |
<|file_name|>official.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#CHANGE ONLY, IF YOU KNOW, WHAT YOU DO!
#OPKMANAGER WILL CRASH IF YOUR OUTPUT IS INVALID!
import subprocess
import argparse
import time
import calendar
import string
import sys
class RegisterAction(argparse.Action):
def __call__(self, parser, nam... | print "Official Repository" # Name
print "web" # Type (maybe web for web, or anything else for usb)
print "http://www.gcw-zero.com/files/upload/opk/" #URL
print "official.py --update" #Call for updating the list
print "O" #letter to show |
<|file_name|>official.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#CHANGE ONLY, IF YOU KNOW, WHAT YOU DO!
#OPKMANAGER WILL CRASH IF YOUR OUTPUT IS INVALID!
import subprocess
import argparse
import time
import calendar
import string
import sys
class RegisterAction(argparse.Action):
def __call__(self, parser, nam... | def __call__(self, parser, namespace, values, option_string=None):
process = subprocess.Popen('wget --timeout='+str(values[0])+' -qO- http://ziz.gp2x.de/gcw-repos/count.php',stdout=subprocess.PIPE,shell=True)
process = subprocess.Popen('wget --timeout='+str(values[0])+' -qO- http://www.gcw-zero.com/downloads',stdo... |
<|file_name|>official.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#CHANGE ONLY, IF YOU KNOW, WHAT YOU DO!
#OPKMANAGER WILL CRASH IF YOUR OUTPUT IS INVALID!
import subprocess
import argparse
import time
import calendar
import string
import sys
class RegisterAction(argparse.Action):
def __call__(self, parser, nam... | process = subprocess.Popen('wget --timeout='+str(values[0])+' -qO- http://ziz.gp2x.de/gcw-repos/count.php',stdout=subprocess.PIPE,shell=True)
process = subprocess.Popen('wget --timeout='+str(values[0])+' -qO- http://www.gcw-zero.com/downloads',stdout=subprocess.PIPE,shell=True)
#process = subprocess.Popen('wget -... |
<|file_name|>official.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#CHANGE ONLY, IF YOU KNOW, WHAT YOU DO!
#OPKMANAGER WILL CRASH IF YOUR OUTPUT IS INVALID!
import subprocess
import argparse
import time
import calendar
import string
import sys
class RegisterAction(argparse.Action):
def __call__(self, parser, nam... | parser = argparse.ArgumentParser(description="Ziz's Repository script")
parser.add_argument('--register', nargs=0, action=RegisterAction)
parser.add_argument('--update', nargs=1, action=UpdateAction)
args = parser.parse_args() |
<|file_name|>official.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#CHANGE ONLY, IF YOU KNOW, WHAT YOU DO!
#OPKMANAGER WILL CRASH IF YOUR OUTPUT IS INVALID!
import subprocess
import argparse
import time
import calendar
import string
import sys
class RegisterAction(argparse.Action):
def __call__(self, parser, nam... | not_found = 0;
break; |
<|file_name|>official.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#CHANGE ONLY, IF YOU KNOW, WHAT YOU DO!
#OPKMANAGER WILL CRASH IF YOUR OUTPUT IS INVALID!
import subprocess
import argparse
import time
import calendar
import string
import sys
class RegisterAction(argparse.Action):
def __call__(self, parser, nam... | continue; |
<|file_name|>official.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#CHANGE ONLY, IF YOU KNOW, WHAT YOU DO!
#OPKMANAGER WILL CRASH IF YOUR OUTPUT IS INVALID!
import subprocess
import argparse
import time
import calendar
import string
import sys
class RegisterAction(argparse.Action):
def __call__(self, parser, nam... | continue |
<|file_name|>official.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#CHANGE ONLY, IF YOU KNOW, WHAT YOU DO!
#OPKMANAGER WILL CRASH IF YOUR OUTPUT IS INVALID!
import subprocess
import argparse
import time
import calendar
import string
import sys
class RegisterAction(argparse.Action):
def __call__(self, parser, nam... | not_found = 0;
break; |
<|file_name|>official.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#CHANGE ONLY, IF YOU KNOW, WHAT YOU DO!
#OPKMANAGER WILL CRASH IF YOUR OUTPUT IS INVALID!
import subprocess
import argparse
import time
import calendar
import string
import sys
class RegisterAction(argparse.Action):
def __call__(self, parser, nam... | continue; |
<|file_name|>official.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#CHANGE ONLY, IF YOU KNOW, WHAT YOU DO!
#OPKMANAGER WILL CRASH IF YOUR OUTPUT IS INVALID!
import subprocess
import argparse
import time
import calendar
import string
import sys
class RegisterAction(argparse.Action):
def __call__(self, parser, nam... | version = part[i+1]
version = version.split('>')[1]
version = version.split('<')[0]
t = time.strptime(version,"%A, %d %b %Y")
print "version: " + str(calendar.timegm(t)) #NEEDED!
found_version = 1 |
<|file_name|>official.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#CHANGE ONLY, IF YOU KNOW, WHAT YOU DO!
#OPKMANAGER WILL CRASH IF YOUR OUTPUT IS INVALID!
import subprocess
import argparse
import time
import calendar
import string
import sys
class RegisterAction(argparse.Action):
def __call__(self, parser, nam... | image = part[i];
image = image.split("background-image: url('")[1].split("');")[0];
print "image_url: http://www.gcw-zero.com/" + image |
<|file_name|>official.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#CHANGE ONLY, IF YOU KNOW, WHAT YOU DO!
#OPKMANAGER WILL CRASH IF YOUR OUTPUT IS INVALID!
import subprocess
import argparse
import time
import calendar
import string
import sys
class RegisterAction(argparse.Action):
def __call__(self, parser, nam... | long_description = part[i];
long_description = long_description.split('<p class="more fade">')[1].split("</p>")[0];
long_description = long_description.replace('<br /> ','\\n')
long_description = long_description.split('>')
sys.stdout.write("long_description: ")
for long_description_part i... |
<|file_name|>official.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#CHANGE ONLY, IF YOU KNOW, WHAT YOU DO!
#OPKMANAGER WILL CRASH IF YOUR OUTPUT IS INVALID!
import subprocess
import argparse
import time
import calendar
import string
import sys
class RegisterAction(argparse.Action):
def __call__(self, parser, nam... | break |
<|file_name|>official.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#CHANGE ONLY, IF YOU KNOW, WHAT YOU DO!
#OPKMANAGER WILL CRASH IF YOUR OUTPUT IS INVALID!
import subprocess
import argparse
import time
import calendar
import string
import sys
class RegisterAction(argparse.Action):
def __call__(self, parser, nam... | main() |
<|file_name|>official.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#CHANGE ONLY, IF YOU KNOW, WHAT YOU DO!
#OPKMANAGER WILL CRASH IF YOUR OUTPUT IS INVALID!
import subprocess
import argparse
import time
import calendar
import string
import sys
class RegisterAction(argparse.Action):
def <|fim_middle|>(self, parse... | __call__ |
<|file_name|>official.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#CHANGE ONLY, IF YOU KNOW, WHAT YOU DO!
#OPKMANAGER WILL CRASH IF YOUR OUTPUT IS INVALID!
import subprocess
import argparse
import time
import calendar
import string
import sys
class RegisterAction(argparse.Action):
def __call__(self, parser, nam... | __call__ |
<|file_name|>official.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#CHANGE ONLY, IF YOU KNOW, WHAT YOU DO!
#OPKMANAGER WILL CRASH IF YOUR OUTPUT IS INVALID!
import subprocess
import argparse
import time
import calendar
import string
import sys
class RegisterAction(argparse.Action):
def __call__(self, parser, nam... | main |
<|file_name|>sixth.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# bigcinemas
class InvalidAge(Exception):
def __init__(self,age):<|fim▁hole|> raise InvalidAge(age)
else:
return "Welcome to the movies!!"
age = int(raw_input("please enter your age:"))
#print validate_age(age)
try:
validate_age(age)
# exc... | self.age = age
def validate_age(age):
if age < 18: |
<|file_name|>sixth.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# bigcinemas
class InvalidAge(Exception):
<|fim_middle|>
def validate_age(age):
if age < 18:
raise InvalidAge(age)
else:
return "Welcome to the movies!!"
age = int(raw_input("please enter your age:"))
#print validate_age(age)
try:
vali... | def __init__(self,age):
self.age = age |
<|file_name|>sixth.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# bigcinemas
class InvalidAge(Exception):
def __init__(self,age):
<|fim_middle|>
def validate_age(age):
if age < 18:
raise InvalidAge(age)
else:
return "Welcome to the movies!!"
age = int(raw_input("please enter your age:"))
#print vali... | self.age = age |
<|file_name|>sixth.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# bigcinemas
class InvalidAge(Exception):
def __init__(self,age):
self.age = age
def validate_age(age):
<|fim_middle|>
age = int(raw_input("please enter your age:"))
#print validate_age(age)
try:
validate_age(age)
# except Exception as e:... | if age < 18:
raise InvalidAge(age)
else:
return "Welcome to the movies!!" |
<|file_name|>sixth.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# bigcinemas
class InvalidAge(Exception):
def __init__(self,age):
self.age = age
def validate_age(age):
if age < 18:
<|fim_middle|>
else:
return "Welcome to the movies!!"
age = int(raw_input("please enter your age:"))
#print validate_... | raise InvalidAge(age) |
<|file_name|>sixth.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# bigcinemas
class InvalidAge(Exception):
def __init__(self,age):
self.age = age
def validate_age(age):
if age < 18:
raise InvalidAge(age)
else:
<|fim_middle|>
age = int(raw_input("please enter your age:"))
#print validate_age(age)
... | return "Welcome to the movies!!" |
<|file_name|>sixth.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# bigcinemas
class InvalidAge(Exception):
def __init__(self,age):
self.age = age
def validate_age(age):
if age < 18:
raise InvalidAge(age)
else:
return "Welcome to the movies!!"
age = int(raw_input("please enter your age:"))
#print valid... | print validate_age(age) |
<|file_name|>sixth.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# bigcinemas
class InvalidAge(Exception):
def <|fim_middle|>(self,age):
self.age = age
def validate_age(age):
if age < 18:
raise InvalidAge(age)
else:
return "Welcome to the movies!!"
age = int(raw_input("please enter your age:"))
#print... | __init__ |
<|file_name|>sixth.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# bigcinemas
class InvalidAge(Exception):
def __init__(self,age):
self.age = age
def <|fim_middle|>(age):
if age < 18:
raise InvalidAge(age)
else:
return "Welcome to the movies!!"
age = int(raw_input("please enter your age:"))
#print val... | validate_age |
<|file_name|>4-7-even-solution.py<|end_file_name|><|fim▁begin|># จงเขียนโปรแกรมแสดงเลขคู่ในช่วง 0 ถึง 10 (รวม 10 ด้วย)
for i in range(11):
if (i % 2 == 0):<|fim▁hole|><|fim▁end|> | print(i) |
<|file_name|>4-7-even-solution.py<|end_file_name|><|fim▁begin|># จงเขียนโปรแกรมแสดงเลขคู่ในช่วง 0 ถึง 10 (รวม 10 ด้วย)
for i in range(11):
if (i % 2 == 0):
print(i) <|fim_middle|>
<|fim▁end|> | |
<|file_name|>qubole_operator.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 t... | # software distributed under the License is distributed on an |
<|file_name|>main.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
import sys
def func():
print('{0}.{1}'.format(*sys.version_info[:2]))
print(repr(sys.argv[1:]))
print('Hello World')
return 0<|fim▁end|> | from __future__ import print_function |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import sys
def func():
<|fim_middle|>
<|fim▁end|> | print('{0}.{1}'.format(*sys.version_info[:2]))
print(repr(sys.argv[1:]))
print('Hello World')
return 0 |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import sys
def <|fim_middle|>():
print('{0}.{1}'.format(*sys.version_info[:2]))
print(repr(sys.argv[1:]))
print('Hello World')
return 0
<|fim▁end|> | func |
<|file_name|>test_one_node_shutdown_with_scheduler.py<|end_file_name|><|fim▁begin|>'''
Integration Test for scheduler reboot VM in HA mode.
@author: Quarkonics
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
im... | host_username = os.environ.get('nodeUserName')
|
<|file_name|>test_one_node_shutdown_with_scheduler.py<|end_file_name|><|fim▁begin|>'''
Integration Test for scheduler reboot VM in HA mode.
@author: Quarkonics
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
im... | global vm
global node1_ip
vm = test_stub.create_basic_vm()
vm.check()
start_date = int(time.time())
schd = vm_ops.reboot_vm_scheduler(vm.get_vm().uuid, 'simple', 'simple_reboot_vm_scheduler', start_date+60, 30)
node1_ip = os.environ.get('node1Ip')
node2_ip = os.environ.get('no... |
<|file_name|>test_one_node_shutdown_with_scheduler.py<|end_file_name|><|fim▁begin|>'''
Integration Test for scheduler reboot VM in HA mode.
@author: Quarkonics
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
im... | global vm
global node1_ip
if vm:
try:
vm.destroy()
except:
pass
test_util.test_logger("recover node: %s" % (node1_ip))
os.system('bash -ex %s %s' % (os.environ.get('nodeRecoverScript'), node1_ip))
time.sleep(180)
test_stub.exercise_connection... |
<|file_name|>test_one_node_shutdown_with_scheduler.py<|end_file_name|><|fim▁begin|>'''
Integration Test for scheduler reboot VM in HA mode.
@author: Quarkonics
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
im... | scheduler_execution_count += 1 |
<|file_name|>test_one_node_shutdown_with_scheduler.py<|end_file_name|><|fim▁begin|>'''
Integration Test for scheduler reboot VM in HA mode.
@author: Quarkonics
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
im... | scheduler_execution_count -= 1 |
<|file_name|>test_one_node_shutdown_with_scheduler.py<|end_file_name|><|fim▁begin|>'''
Integration Test for scheduler reboot VM in HA mode.
@author: Quarkonics
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
im... | test_util.test_fail('VM reboot scheduler is expected to executed for more than 5 times, while it only execute %s times' % (scheduler_execution_count)) |
<|file_name|>test_one_node_shutdown_with_scheduler.py<|end_file_name|><|fim▁begin|>'''
Integration Test for scheduler reboot VM in HA mode.
@author: Quarkonics
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
im... | try:
vm.destroy()
except:
pass |
<|file_name|>test_one_node_shutdown_with_scheduler.py<|end_file_name|><|fim▁begin|>'''
Integration Test for scheduler reboot VM in HA mode.
@author: Quarkonics
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
im... | test |
<|file_name|>test_one_node_shutdown_with_scheduler.py<|end_file_name|><|fim▁begin|>'''
Integration Test for scheduler reboot VM in HA mode.
@author: Quarkonics
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
im... | error_cleanup |
<|file_name|>warnings.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
uds.warnings
~~~~~~~~~~~~
:copyright: Copyright (c) 2015, National Institute of Information and Communications Technology.All rights reserved.
:license: GPL2, see LICENSE for more details.
"""
import warnings
def deprecated(func):
... | |
<|file_name|>warnings.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
uds.warnings
~~~~~~~~~~~~
:copyright: Copyright (c) 2015, National Institute of Information and Communications Technology.All rights reserved.
:license: GPL2, see LICENSE for more details.
"""
import warnings
def deprecated(func):
... | """This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emitted
when the function is used.
:param func:
:return: new_func
"""
def new_func(*args, **kwargs):
warnings.warn("Call to deprecated function {}.".format(func.__name__),
... |
<|file_name|>warnings.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
uds.warnings
~~~~~~~~~~~~
:copyright: Copyright (c) 2015, National Institute of Information and Communications Technology.All rights reserved.
:license: GPL2, see LICENSE for more details.
"""
import warnings
def deprecated(func):
... | warnings.warn("Call to deprecated function {}.".format(func.__name__),
category=DeprecationWarning)
return func(*args, **kwargs) |
<|file_name|>warnings.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
uds.warnings
~~~~~~~~~~~~
:copyright: Copyright (c) 2015, National Institute of Information and Communications Technology.All rights reserved.
:license: GPL2, see LICENSE for more details.
"""
import warnings
def deprecated(func):
... | return x + y |
<|file_name|>warnings.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
uds.warnings
~~~~~~~~~~~~
:copyright: Copyright (c) 2015, National Institute of Information and Communications Technology.All rights reserved.
:license: GPL2, see LICENSE for more details.
"""
import warnings
def deprecated(func):
... | @deprecated
def some_old_method(self, x, y):
return x + y |
<|file_name|>warnings.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
uds.warnings
~~~~~~~~~~~~
:copyright: Copyright (c) 2015, National Institute of Information and Communications Technology.All rights reserved.
:license: GPL2, see LICENSE for more details.
"""
import warnings
def deprecated(func):
... | return x + y |
<|file_name|>warnings.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
uds.warnings
~~~~~~~~~~~~
:copyright: Copyright (c) 2015, National Institute of Information and Communications Technology.All rights reserved.
:license: GPL2, see LICENSE for more details.
"""
import warnings
def <|fim_middle|>(func):... | deprecated |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.