prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>test_iamgen.py<|end_file_name|><|fim▁begin|># Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://w...
invalid.append(p) continue
<|file_name|>test_iamgen.py<|end_file_name|><|fim▁begin|># Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://w...
if not fnmatch.filter(perm_db[s], a): invalid.append(p) continue
<|file_name|>test_iamgen.py<|end_file_name|><|fim▁begin|># Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://w...
invalid.append(p) continue
<|file_name|>test_iamgen.py<|end_file_name|><|fim▁begin|># Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://w...
invalid.append(p)
<|file_name|>test_iamgen.py<|end_file_name|><|fim▁begin|># Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://w...
return []
<|file_name|>test_iamgen.py<|end_file_name|><|fim▁begin|># Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://w...
found = True
<|file_name|>test_iamgen.py<|end_file_name|><|fim▁begin|># Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://w...
missing.add("%s->%s" % (k, mgr.resource_type.service)) continue
<|file_name|>test_iamgen.py<|end_file_name|><|fim▁begin|># Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://w...
continue
<|file_name|>test_iamgen.py<|end_file_name|><|fim▁begin|># Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://w...
for k, perm_set in invalid: perm_set = [i for i in perm_set if not i.startswith('elasticloadbalancing')] if perm_set: all_invalid.append((k, perm_set))
<|file_name|>test_iamgen.py<|end_file_name|><|fim▁begin|># Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://w...
all_invalid.append((k, perm_set))
<|file_name|>test_iamgen.py<|end_file_name|><|fim▁begin|># Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://w...
raise ValueError( "resources missing service %s" % ('\n'.join(sorted(missing))))
<|file_name|>test_iamgen.py<|end_file_name|><|fim▁begin|># Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://w...
raise ValueError( "invalid permissions \n %s" % ('\n'.join(sorted(map(str, all_invalid)))))
<|file_name|>test_iamgen.py<|end_file_name|><|fim▁begin|># Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://w...
check_permissions
<|file_name|>test_iamgen.py<|end_file_name|><|fim▁begin|># Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://w...
test_iam_permissions_validity
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
def createAndWait(self,problem,cancel,**kwargs): solverId = self.create(problem,**kwargs) timeout = 300 while not cancel() and timeout>0:
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
pathbase = "https://thesolvingmachine.com/kangrouter/srv/v1/solvers" def __init__(self,apiKey,licenseId): self.headers = {"content-type": "application/json", "Authorization": apiKey} self.params = {"licenseId" : licenseId } retries = Retry(total=5, backoff_fac...
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
self.headers = {"content-type": "application/json", "Authorization": apiKey} self.params = {"licenseId" : licenseId } retries = Retry(total=5, backoff_factor=0.75) self.session = requests.Session() self.session.mount(KANGROUTER_WEBSERVICE_APPLICATION_ROOT, ...
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
if req.status_code >= 400 and req.status_code <= 500: try: j = req.json() except ValueError: raise exception.InternalError(req.text,req.status_code) raise exception.jsonToException(req.json())
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
path = self.pathbase payload=json.dumps(problem) params = self.params.copy() params.update(kwargs) req = self.session.post(path, params=params, headers=self.headers, data=payload) self.validateReply(req) return req....
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
path = "{base}/{solverId}".format(base=self.pathbase, solverId=str(solverId)) req = self.session.delete(path, params=self.params, headers=self.headers) self.validateReply(req) return True
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
path = "{base}/{solverId}/stop".format(base=self.pathbase, solverId=str(solverId)) req = self.session.put(path, params=self.params, headers=self.headers) self.validateReply(req) return True
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
path = "{base}/{solverId}/status".format(base=self.pathbase, solverId=str(solverId)) req = self.session.get(path, params=self.params, headers=self.headers) self.validateReply(req) return req.json()
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
path = "{base}/{solverId}/solution".format(base=self.pathbase, solverId=str(solverId)) req = self.session.get(path, params=self.params, headers=self.headers) self.validateReply(req) return req.json()
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
solverId = self.create(problem,**kwargs) timeout = 300 while not cancel() and timeout>0: status = self.getStatus(solverId) if status["execStatus"] =="invalid": raise exception.solverError(json.dumps(status["errors"])) if status["execStatus"] =="completed": return self.getSo...
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
try: j = req.json() except ValueError: raise exception.InternalError(req.text,req.status_code) raise exception.jsonToException(req.json())
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
raise exception.solverError(json.dumps(status["errors"]))
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
return self.getSolution(solverId)
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
raise exception.InternalError("Timed out waiting for solver")
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
__init__
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
validateReply
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
create
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
delete
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
stop
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
getStatus
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
getSolution
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
createAndWait
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
def get_node(self): return self.node def get_children(self): return self.children
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
def __init__(self, node, emailMessage, references=list(), children=dict(), slotted=bool("false")): self.node = node self.children = dict(children) self.references = references[:] self.slotted = slotted self.emailMessage = emailMessage def get_node(self): return se...
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
self.node = node self.children = dict(children) self.references = references[:] self.slotted = slotted self.emailMessage = emailMessage
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
return self.node
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
return self.children
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
self.node = node
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
self.children = children
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
return self.references
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
return self.slotted
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
self.slotted = slotted
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
return self.emailMessage
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
return self.node + "\nREF: " + str(self.references) + "\nChildren: " + str(self.children.keys()) + "\n"
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
for reference in referencesToCheck[:] : if reference in referenceNodeNow.get_children() : referencesToCheck.remove(reference) return patchMessageReferenceNode[reference] if len(referencesToCheck) == 0 : referenceNodeNow.get_children()[currentNodeInAction.get_node()] = cur...
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
ref_keys = patchMessageReferenceNode.keys() ref_keys.sort() for messageId in ref_keys: referenceNode = patchMessageReferenceNode[messageId] utils.verboseOutput(verbose, "Managing Message Id:", referenceNode.get_node()) referenceIds = referenceNode.get_references() referenceId...
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
referencesToCheck.remove(reference) return patchMessageReferenceNode[reference]
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
referenceNodeNow.get_children()[currentNodeInAction.get_node()] = currentNodeInAction
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
nextNode = patchMessageReferenceNode[referenceIdsClone[0]] referenceIdsClone.remove(referenceIdsClone[0]) while nextNode != None : utils.verboseOutput(verbose, "Next Node: ", nextNode.get_node()) utils.verboseOutput(verbose, "Curent Node: ", referenceN...
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
arguments = sys.argv verbose = "false" pseudoArgs = arguments[:] while len(pseudoArgs) > 1 : argument = pseudoArgs[1] if argument == "-v" or argument == "--verbose" : verbose = "true" pseudoArgs.remove(argument) utils.verboseOutput(verbose, "Checking POP3 for gmai...
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
verbose = "true"
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
subject = msg['subject'] subjectPattern = "^\[.*PATCH.*\].+" subjectMatch = re.match(subjectPattern, subject) utils.verboseOutput(verbose, "Checking subject: ", subject) if subjectMatch == None : continue
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
continue
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
continue
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
messageId = re.search("<(.*)>", msg['message-id']).group(1) utils.verboseOutput(verbose, 'Message-ID:', messageId)
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
references = msg['references'] referenceIds = re.findall("<(.*)>", references)
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
__init__
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
get_node
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
get_children
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
set_node
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
set_children
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
get_references
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
is_slotted
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
set_slotted
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
get_message
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
__repr__
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
handleNode
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
makeChildren
<|file_name|>DatabaseHandler.py<|end_file_name|><|fim▁begin|><|fim▁hole|> def __init__(self): pass def is_delete(self, tableName): reservedTableNameList = ["mantis_user_table", "mantis_tokens_table", "mantis_config_table"] isDeleteFlag = 1 for name in reservedTableNameList:...
import MySQLdb class DatabaseHandler:
<|file_name|>DatabaseHandler.py<|end_file_name|><|fim▁begin|>import MySQLdb class DatabaseHandler: <|fim_middle|> #if __name__ == '__main__': # databaseHandler = DatabaseHandler() # databaseHandler.clean_database("localhost", "spark", "spark", "robottest") <|fim▁end|>
def __init__(self): pass def is_delete(self, tableName): reservedTableNameList = ["mantis_user_table", "mantis_tokens_table", "mantis_config_table"] isDeleteFlag = 1 for name in reservedTableNameList: isIdentical = cmp(tableName, name) if isIdentical ...
<|file_name|>DatabaseHandler.py<|end_file_name|><|fim▁begin|>import MySQLdb class DatabaseHandler: def __init__(self): <|fim_middle|> def is_delete(self, tableName): reservedTableNameList = ["mantis_user_table", "mantis_tokens_table", "mantis_config_table"] isDeleteFlag = 1 ...
pass
<|file_name|>DatabaseHandler.py<|end_file_name|><|fim▁begin|>import MySQLdb class DatabaseHandler: def __init__(self): pass def is_delete(self, tableName): <|fim_middle|> def Clean_Database(self, hostUrl, account, password, databaseName): print 'clean database1' ...
reservedTableNameList = ["mantis_user_table", "mantis_tokens_table", "mantis_config_table"] isDeleteFlag = 1 for name in reservedTableNameList: isIdentical = cmp(tableName, name) if isIdentical == 0: isDeleteFlag = 0 break return is...
<|file_name|>DatabaseHandler.py<|end_file_name|><|fim▁begin|>import MySQLdb class DatabaseHandler: def __init__(self): pass def is_delete(self, tableName): reservedTableNameList = ["mantis_user_table", "mantis_tokens_table", "mantis_config_table"] isDeleteFlag = 1 for nam...
print 'clean database1' db = MySQLdb.connect(host=hostUrl, user=account, passwd=password, db=databaseName) cursor = db.cursor() cursor.execute("Show Tables from " + databaseName) result = cursor.fetchall() for record in result: tableName = record[0] ...
<|file_name|>DatabaseHandler.py<|end_file_name|><|fim▁begin|>import MySQLdb class DatabaseHandler: def __init__(self): pass def is_delete(self, tableName): reservedTableNameList = ["mantis_user_table", "mantis_tokens_table", "mantis_config_table"] isDeleteFlag = 1 for nam...
isDeleteFlag = 0 break
<|file_name|>DatabaseHandler.py<|end_file_name|><|fim▁begin|>import MySQLdb class DatabaseHandler: def __init__(self): pass def is_delete(self, tableName): reservedTableNameList = ["mantis_user_table", "mantis_tokens_table", "mantis_config_table"] isDeleteFlag = 1 for nam...
print "Reserve " + tableName
<|file_name|>DatabaseHandler.py<|end_file_name|><|fim▁begin|>import MySQLdb class DatabaseHandler: def __init__(self): pass def is_delete(self, tableName): reservedTableNameList = ["mantis_user_table", "mantis_tokens_table", "mantis_config_table"] isDeleteFlag = 1 for nam...
print "TRUNCATE TABLE `" + tableName + "`" cursor.execute("TRUNCATE TABLE `" + tableName + "`")
<|file_name|>DatabaseHandler.py<|end_file_name|><|fim▁begin|>import MySQLdb class DatabaseHandler: def <|fim_middle|>(self): pass def is_delete(self, tableName): reservedTableNameList = ["mantis_user_table", "mantis_tokens_table", "mantis_config_table"] isDeleteFlag = 1 f...
__init__
<|file_name|>DatabaseHandler.py<|end_file_name|><|fim▁begin|>import MySQLdb class DatabaseHandler: def __init__(self): pass def <|fim_middle|>(self, tableName): reservedTableNameList = ["mantis_user_table", "mantis_tokens_table", "mantis_config_table"] isDeleteFlag = 1 fo...
is_delete
<|file_name|>DatabaseHandler.py<|end_file_name|><|fim▁begin|>import MySQLdb class DatabaseHandler: def __init__(self): pass def is_delete(self, tableName): reservedTableNameList = ["mantis_user_table", "mantis_tokens_table", "mantis_config_table"] isDeleteFlag = 1 for nam...
Clean_Database
<|file_name|>97bbc733896c_create_oauthclient_tables.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. "...
op.create_index( 'useridentity_id_user_method', 'oauthclient_useridentity',
<|file_name|>97bbc733896c_create_oauthclient_tables.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. "...
"""Upgrade database.""" op.create_table( 'oauthclient_remoteaccount', sa.Column('id', sa.Integer(), nullable=False), sa.Column('user_id', sa.Integer(), nullable=False), sa.Column('client_id', sa.String(length=255), nullable=False), sa.Column( 'extra_data', ...
<|file_name|>97bbc733896c_create_oauthclient_tables.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. "...
"""Downgrade database.""" ctx = op.get_context() insp = Inspector.from_engine(ctx.connection.engine) op.drop_table('oauthclient_remotetoken') for fk in insp.get_foreign_keys('oauthclient_useridentity'): if fk['referred_table'] == 'accounts_user': op.drop_constraint( ...
<|file_name|>97bbc733896c_create_oauthclient_tables.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. "...
op.drop_constraint( op.f(fk['name']), 'oauthclient_useridentity', type_='foreignkey' )
<|file_name|>97bbc733896c_create_oauthclient_tables.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. "...
upgrade
<|file_name|>97bbc733896c_create_oauthclient_tables.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. "...
downgrade
<|file_name|>android.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- try: from httplib import HTTPSConnection from urlparse import urlparse except ImportError: from http.client import HTTPSConnection from urllib.parse import urlparse from json import dumps, loads from django.conf import sett...
if loads(body).get("failure") > 0: raise GCMError(repr(body)) return True
<|file_name|>android.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- try: from httplib import HTTPSConnection from urlparse import urlparse except ImportError: from http.client import HTTPSConnection from urllib.parse import urlparse from json import dumps, loads from django.conf import sett...
pass
<|file_name|>android.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- try: from httplib import HTTPSConnection from urlparse import urlparse except ImportError: from http.client import HTTPSConnection from urllib.parse import urlparse from json import dumps, loads from django.conf import sett...
""" Site: https://developers.google.com API: https://developers.google.com/cloud-messaging/ Desc: Android notifications """ headers = { "Content-type": "application/json", "Authorization": "key=" + kwargs.pop("gcm_key", settings.GCM_KEY) } hook_url = 'https://android.go...
<|file_name|>android.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- try: from httplib import HTTPSConnection from urlparse import urlparse except ImportError: from http.client import HTTPSConnection from urllib.parse import urlparse from json import dumps, loads from django.conf import sett...
raise GCMError(response.reason)
<|file_name|>android.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- try: from httplib import HTTPSConnection from urlparse import urlparse except ImportError: from http.client import HTTPSConnection from urllib.parse import urlparse from json import dumps, loads from django.conf import sett...
raise GCMError(repr(body))
<|file_name|>android.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- try: from httplib import HTTPSConnection from urlparse import urlparse except ImportError: from http.client import HTTPSConnection from urllib.parse import urlparse from json import dumps, loads from django.conf import sett...
send
<|file_name|>ar1TestScript.py<|end_file_name|><|fim▁begin|>from pybrain.rl.environments.timeseries.maximizereturntask import DifferentialSharpeRatioTask from pybrain.rl.environments.timeseries.timeseries import AR1Environment, SnPEnvironment from pybrain.rl.learners.valuebased.linearfa import Q_LinFA from pybrain.rl.ag...
<|file_name|>node.py<|end_file_name|><|fim▁begin|># Ant # # Copyright (c) 2012, Gustav Tiger <gustav@tiger.name> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, includi...
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
<|file_name|>node.py<|end_file_name|><|fim▁begin|># Ant # # Copyright (c) 2012, Gustav Tiger <gustav@tiger.name> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, includi...
def __init__(self): self._responses_cond = threading.Condition() self._responses = collections.deque() self._event_cond = threading.Condition() self._events = collections.deque() self._datas = Queue.Queue() self.channels = {...
<|file_name|>node.py<|end_file_name|><|fim▁begin|># Ant # # Copyright (c) 2012, Gustav Tiger <gustav@tiger.name> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, includi...
self._responses_cond = threading.Condition() self._responses = collections.deque() self._event_cond = threading.Condition() self._events = collections.deque() self._datas = Queue.Queue() self.channels = {} self.ant = Ant...
<|file_name|>node.py<|end_file_name|><|fim▁begin|># Ant # # Copyright (c) 2012, Gustav Tiger <gustav@tiger.name> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, includi...
channel = Channel(0, self, self.ant) self.channels[0] = channel channel._assign(ctype, 0x00) return channel