prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>""" SALTS XBMC Addon Copyright (C) 2015 tknorris This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License,...
get_current_view
<|file_name|>getobject.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of sour...
sha_digest.update(chunk) if pbar is not None:
<|file_name|>getobject.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of sour...
DESCRIPTION = 'Retrieve objects from the server' ARGS = [Arg('source', metavar='BUCKET/KEY', route_to=None, help='the object to download (required)'), Arg('-o', dest='dest', metavar='PATH', route_to=None, default='.', help='''where to download to. If this names a ...
<|file_name|>getobject.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of sour...
S3Request.configure(self) bucket, _, key = self.args['source'].partition('/') if not bucket: raise ArgumentError('source must contain a bucket name') if not key: raise ArgumentError('source must contain a key name') if isinstance(self.args.get('dest'), s...
<|file_name|>getobject.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of sour...
self.path = self.args['source']
<|file_name|>getobject.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of sour...
self.preprocess() bytes_written = 0 md5_digest = hashlib.md5() sha_digest = hashlib.sha1() response = self.send() content_length = response.headers.get('Content-Length') if content_length: pbar = self.get_progressbar(label=self.args['source'], ...
<|file_name|>getobject.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of sour...
raise ArgumentError('source must contain a bucket name')
<|file_name|>getobject.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of sour...
raise ArgumentError('source must contain a key name')
<|file_name|>getobject.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of sour...
if self.args['dest'] == '-': self.args['dest'] = sys.stdout elif os.path.isdir(self.args['dest']): basename = os.path.basename(key) if not basename: raise ArgumentError("specify a complete file path with -o " ...
<|file_name|>getobject.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of sour...
self.args['dest'] = sys.stdout
<|file_name|>getobject.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of sour...
basename = os.path.basename(key) if not basename: raise ArgumentError("specify a complete file path with -o " "to download objects that end in '/'") dest_path = os.path.join(self.args['dest'], basename) ...
<|file_name|>getobject.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of sour...
raise ArgumentError("specify a complete file path with -o " "to download objects that end in '/'")
<|file_name|>getobject.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of sour...
self.args['dest'] = open(self.args['dest'], 'w')
<|file_name|>getobject.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of sour...
pbar = self.get_progressbar(label=self.args['source'], maxval=int(content_length))
<|file_name|>getobject.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of sour...
pbar = self.get_progressbar(label=self.args['source'])
<|file_name|>getobject.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of sour...
pbar.update(bytes_written)
<|file_name|>getobject.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of sour...
self.log.error('rejecting download due to Content-Length size ' 'mismatch (expected: %i, actual: %i)', content_length, bytes_written) raise RuntimeError('downloaded file appears to be corrupt ' '(expected size: ...
<|file_name|>getobject.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of sour...
if md5_digest.hexdigest() != etag: self.log.error('rejecting download due to ETag MD5 mismatch ' '(expected: %s, actual: %s)', etag, md5_digest.hexdigest()) raise RuntimeError('downloaded file appears to be corrupt...
<|file_name|>getobject.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of sour...
self.log.error('rejecting download due to ETag MD5 mismatch ' '(expected: %s, actual: %s)', etag, md5_digest.hexdigest()) raise RuntimeError('downloaded file appears to be corrupt ' '(expecte...
<|file_name|>getobject.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of sour...
configure
<|file_name|>getobject.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of sour...
preprocess
<|file_name|>getobject.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of sour...
main
<|file_name|>haversine.py<|end_file_name|><|fim▁begin|>from math import radians, cos, sin, asin, sqrt def haversine(lon1, lat1, lon2, lat2): """ Calculate the great circle distance between two points on the earth (specified in decimal degrees)<|fim▁hole|> # convert decimal degrees to radians lon1, l...
"""
<|file_name|>haversine.py<|end_file_name|><|fim▁begin|>from math import radians, cos, sin, asin, sqrt def haversine(lon1, lat1, lon2, lat2): <|fim_middle|> <|fim▁end|>
""" Calculate the great circle distance between two points on the earth (specified in decimal degrees) """ # convert decimal degrees to radians lon1, lat1, lon2, lat2 = map(radians, [lon1, lat1, lon2, lat2]) # haversine formula dlon = lon2 - lon1 dlat = lat2 - lat1 a = sin(dlat/...
<|file_name|>haversine.py<|end_file_name|><|fim▁begin|>from math import radians, cos, sin, asin, sqrt def <|fim_middle|>(lon1, lat1, lon2, lat2): """ Calculate the great circle distance between two points on the earth (specified in decimal degrees) """ # convert decimal degrees to radians lon1,...
haversine
<|file_name|>overwriting_attribute.py<|end_file_name|><|fim▁begin|>#Attribute set in both superclass and subclass class C(object): def __init__(self): self.var = 0 class D(C): def __init__(self): self.var = 1 # self.var will be overwritten C.__init__(self) #Attribute set in both supe...
class F(E):
<|file_name|>overwriting_attribute.py<|end_file_name|><|fim▁begin|>#Attribute set in both superclass and subclass class C(object): <|fim_middle|> class D(C): def __init__(self): self.var = 1 # self.var will be overwritten C.__init__(self) #Attribute set in both superclass and subclass class...
def __init__(self): self.var = 0
<|file_name|>overwriting_attribute.py<|end_file_name|><|fim▁begin|>#Attribute set in both superclass and subclass class C(object): def __init__(self): <|fim_middle|> class D(C): def __init__(self): self.var = 1 # self.var will be overwritten C.__init__(self) #Attribute set in both s...
self.var = 0
<|file_name|>overwriting_attribute.py<|end_file_name|><|fim▁begin|>#Attribute set in both superclass and subclass class C(object): def __init__(self): self.var = 0 class D(C): <|fim_middle|> #Attribute set in both superclass and subclass class E(object): def __init__(self): self.var = ...
def __init__(self): self.var = 1 # self.var will be overwritten C.__init__(self)
<|file_name|>overwriting_attribute.py<|end_file_name|><|fim▁begin|>#Attribute set in both superclass and subclass class C(object): def __init__(self): self.var = 0 class D(C): def __init__(self): <|fim_middle|> #Attribute set in both superclass and subclass class E(object): def __init_...
self.var = 1 # self.var will be overwritten C.__init__(self)
<|file_name|>overwriting_attribute.py<|end_file_name|><|fim▁begin|>#Attribute set in both superclass and subclass class C(object): def __init__(self): self.var = 0 class D(C): def __init__(self): self.var = 1 # self.var will be overwritten C.__init__(self) #Attribute set in both supe...
def __init__(self): self.var = 0 # self.var will be overwritten
<|file_name|>overwriting_attribute.py<|end_file_name|><|fim▁begin|>#Attribute set in both superclass and subclass class C(object): def __init__(self): self.var = 0 class D(C): def __init__(self): self.var = 1 # self.var will be overwritten C.__init__(self) #Attribute set in both supe...
self.var = 0 # self.var will be overwritten
<|file_name|>overwriting_attribute.py<|end_file_name|><|fim▁begin|>#Attribute set in both superclass and subclass class C(object): def __init__(self): self.var = 0 class D(C): def __init__(self): self.var = 1 # self.var will be overwritten C.__init__(self) #Attribute set in both supe...
def __init__(self): E.__init__(self) self.var = 1
<|file_name|>overwriting_attribute.py<|end_file_name|><|fim▁begin|>#Attribute set in both superclass and subclass class C(object): def __init__(self): self.var = 0 class D(C): def __init__(self): self.var = 1 # self.var will be overwritten C.__init__(self) #Attribute set in both supe...
E.__init__(self) self.var = 1
<|file_name|>overwriting_attribute.py<|end_file_name|><|fim▁begin|>#Attribute set in both superclass and subclass class C(object): def <|fim_middle|>(self): self.var = 0 class D(C): def __init__(self): self.var = 1 # self.var will be overwritten C.__init__(self) #Attribute set in bot...
__init__
<|file_name|>overwriting_attribute.py<|end_file_name|><|fim▁begin|>#Attribute set in both superclass and subclass class C(object): def __init__(self): self.var = 0 class D(C): def <|fim_middle|>(self): self.var = 1 # self.var will be overwritten C.__init__(self) #Attribute set in bot...
__init__
<|file_name|>overwriting_attribute.py<|end_file_name|><|fim▁begin|>#Attribute set in both superclass and subclass class C(object): def __init__(self): self.var = 0 class D(C): def __init__(self): self.var = 1 # self.var will be overwritten C.__init__(self) #Attribute set in both supe...
__init__
<|file_name|>overwriting_attribute.py<|end_file_name|><|fim▁begin|>#Attribute set in both superclass and subclass class C(object): def __init__(self): self.var = 0 class D(C): def __init__(self): self.var = 1 # self.var will be overwritten C.__init__(self) #Attribute set in both supe...
__init__
<|file_name|>extensions.py<|end_file_name|><|fim▁begin|>from notifications_utils.clients.antivirus.antivirus_client import (<|fim▁hole|>from notifications_utils.clients.redis.redis_client import RedisClient from notifications_utils.clients.zendesk.zendesk_client import ZendeskClient antivirus_client = AntivirusClient(...
AntivirusClient, )
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import eventlet import gettext import sys from staccato.common import config import staccato.openstack.common.wsgi as os_wsgi import staccato.openstack.common.pastedeploy as os_pastedeploy # Monkey patch socket and time eventlet.patcher.monkey_patch(all=False, socket=T...
'staccato-api',
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import eventlet import gettext import sys from staccato.common import config import staccato.openstack.common.wsgi as os_wsgi import staccato.openstack.common.pastedeploy as os_pastedeploy # Monkey patch socket and time eventlet.patcher.monkey_patch(all=False, socket=T...
sys.stderr.write("ERROR: %s\n" % e) sys.exit(returncode)
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import eventlet import gettext import sys from staccato.common import config import staccato.openstack.common.wsgi as os_wsgi import staccato.openstack.common.pastedeploy as os_pastedeploy # Monkey patch socket and time eventlet.patcher.monkey_patch(all=False, socket=T...
try: conf = config.get_config_object() paste_file = conf.find_file(conf.paste_deploy.config_file) wsgi_app = os_pastedeploy.paste_deploy_app(paste_file, 'staccato-api', conf) server ...
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import eventlet import gettext import sys from staccato.common import config import staccato.openstack.common.wsgi as os_wsgi import staccato.openstack.common.pastedeploy as os_pastedeploy # Monkey patch socket and time eventlet.patcher.monkey_patch(all=False, socket=T...
fail
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import eventlet import gettext import sys from staccato.common import config import staccato.openstack.common.wsgi as os_wsgi import staccato.openstack.common.pastedeploy as os_pastedeploy # Monkey patch socket and time eventlet.patcher.monkey_patch(all=False, socket=T...
main
<|file_name|>split.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os,re,sys,pprint,shutil from pathlib import Path PACKAGES_DIR = "../packages" def errorExit(msg): print(msg) sys.exit(1) def isPathDisabled(path): for part in path.parts: if part.lower().startswith("_disab...
curFile = None
<|file_name|>split.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os,re,sys,pprint,shutil from pathlib import Path PACKAGES_DIR = "../packages" def errorExit(msg): <|fim_middle|> def isPathDisabled(path): for part in path.parts: if part.lower().startswith("_disabled"): ...
print(msg) sys.exit(1)
<|file_name|>split.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os,re,sys,pprint,shutil from pathlib import Path PACKAGES_DIR = "../packages" def errorExit(msg): print(msg) sys.exit(1) def isPathDisabled(path): <|fim_middle|> depsFolder = Path("_deps_split") prodFolder...
for part in path.parts: if part.lower().startswith("_disabled"): return True return False
<|file_name|>split.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os,re,sys,pprint,shutil from pathlib import Path PACKAGES_DIR = "../packages" def errorExit(msg): print(msg) sys.exit(1) def isPathDisabled(path): for part in path.parts: if part.lower().startswith("_disab...
return True
<|file_name|>split.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os,re,sys,pprint,shutil from pathlib import Path PACKAGES_DIR = "../packages" def errorExit(msg): print(msg) sys.exit(1) def isPathDisabled(path): for part in path.parts: if part.lower().startswith("_disab...
errorExit("Merged depends file does not exist")
<|file_name|>split.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os,re,sys,pprint,shutil from pathlib import Path PACKAGES_DIR = "../packages" def errorExit(msg): print(msg) sys.exit(1) def isPathDisabled(path): for part in path.parts: if part.lower().startswith("_disab...
errorExit("Merged products file does not exist")
<|file_name|>split.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os,re,sys,pprint,shutil from pathlib import Path PACKAGES_DIR = "../packages" def errorExit(msg): print(msg) sys.exit(1) def isPathDisabled(path): for part in path.parts: if part.lower().startswith("_disab...
os.makedirs(depsFolder)
<|file_name|>split.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os,re,sys,pprint,shutil from pathlib import Path PACKAGES_DIR = "../packages" def errorExit(msg): print(msg) sys.exit(1) def isPathDisabled(path): for part in path.parts: if part.lower().startswith("_disab...
print("Clearing old split folder:" + str(depsFolder)) shutil.rmtree(depsFolder) os.makedirs(depsFolder)
<|file_name|>split.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os,re,sys,pprint,shutil from pathlib import Path PACKAGES_DIR = "../packages" def errorExit(msg): print(msg) sys.exit(1) def isPathDisabled(path): for part in path.parts: if part.lower().startswith("_disab...
os.makedirs(prodFolder)
<|file_name|>split.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os,re,sys,pprint,shutil from pathlib import Path PACKAGES_DIR = "../packages" def errorExit(msg): print(msg) sys.exit(1) def isPathDisabled(path): for part in path.parts: if part.lower().startswith("_disab...
print("Clearing old split folder:" + str(prodFolder)) shutil.rmtree(prodFolder) os.makedirs(prodFolder)
<|file_name|>split.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os,re,sys,pprint,shutil from pathlib import Path PACKAGES_DIR = "../packages" def errorExit(msg): print(msg) sys.exit(1) def isPathDisabled(path): for part in path.parts: if part.lower().startswith("_disab...
enableWrite = False curFile.write(fileBuffer.rstrip("\n")) curFile.close()
<|file_name|>split.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os,re,sys,pprint,shutil from pathlib import Path PACKAGES_DIR = "../packages" def errorExit(msg): print(msg) sys.exit(1) def isPathDisabled(path): for part in path.parts: if part.lower().startswith("_disab...
fileBuffer+=line+"\n"
<|file_name|>split.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os,re,sys,pprint,shutil from pathlib import Path PACKAGES_DIR = "../packages" def errorExit(msg): print(msg) sys.exit(1) def isPathDisabled(path): for part in path.parts: if part.lower().startswith("_disab...
enableWrite = True fileBuffer = "" curFile = open(os.path.join(things[mergefile_name],startR.groups()[0]) ,"w",encoding="utf-8")
<|file_name|>split.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os,re,sys,pprint,shutil from pathlib import Path PACKAGES_DIR = "../packages" def <|fim_middle|>(msg): print(msg) sys.exit(1) def isPathDisabled(path): for part in path.parts: if part.lower().startswith("_...
errorExit
<|file_name|>split.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os,re,sys,pprint,shutil from pathlib import Path PACKAGES_DIR = "../packages" def errorExit(msg): print(msg) sys.exit(1) def <|fim_middle|>(path): for part in path.parts: if part.lower().startswith("_disab...
isPathDisabled
<|file_name|>hello_world.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Sifer Aseph<|fim▁hole|> def main(): """Utterly standard.""" print("Hello cruel world.") if __name__ == "__main__": main()<|fim▁end|>
"""Prints a "hello world" statement."""
<|file_name|>hello_world.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Sifer Aseph """Prints a "hello world" statement.""" def main(): <|fim_middle|> if __name__ == "__main__": main() <|fim▁end|>
"""Utterly standard.""" print("Hello cruel world.")
<|file_name|>hello_world.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Sifer Aseph """Prints a "hello world" statement.""" def main(): """Utterly standard.""" print("Hello cruel world.") if __name__ == "__main__": <|fim_middle|> <|fim▁end|>
main()
<|file_name|>hello_world.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Sifer Aseph """Prints a "hello world" statement.""" def <|fim_middle|>(): """Utterly standard.""" print("Hello cruel world.") if __name__ == "__main__": main() <|fim▁end|>
main
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
def _NCNameStartChar(x): return x.isalpha() or x == "_"
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
return x.isalpha() or x.isdigit() or x == "." or x == '-' or x == "_"
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
return x.isalpha() or x == "_"
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
hexval = hex(ord(x[0]))[2:] hexlen = len(hexval) # Make hexval have either 4 or 8 digits by prepending 0's if (hexlen == 1): hexval = "000" + hexval elif (hexlen == 2): hexval = "00" + hexval elif (hexlen == 3): hexval = "0" + hexval elif (hexlen == 4): hexval...
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
return eval(r'u"\u' + x[2:-1] + '"')
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
"""Convert string to a XML name.""" if string.find(':') != -1: (prefix, localname) = string.split(':', 1) else: prefix = None localname = string T = text_type(localname) N = len(localname) X = [] for i in range(N): if i < N - 1 and T[i] == u'_' and T[i + 1] ...
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
"""Convert XML name to unicode string.""" retval = re.sub(r'_xFFFF_', '', string) def fun(matchobj): return _fromUnicodeHex(matchobj.group(0)) retval = re.sub(r'_x[0-9A-Fa-f]{4}_', fun, retval) return retval
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
return _fromUnicodeHex(matchobj.group(0))
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
hexval = "000" + hexval
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
hexval = "00" + hexval
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
hexval = "0" + hexval
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
hexval = "" + hexval
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
hexval = "000" + hexval
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
hexval = "00" + hexval
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
hexval = "0" + hexval
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
hexval = "" + hexval
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
raise Exception("Illegal Value returned from hex(ord(x))")
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
(prefix, localname) = string.split(':', 1)
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
prefix = None localname = string
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
X.append(u'_x005F_')
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
X.append(u'_xFFFF_' + T[0])
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
X.append(_toUnicodeHex(T[i]))
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
X.append(T[i])
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
return "%s:%s" % (prefix, u''.join(X))
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
_NCNameChar
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
_NCNameStartChar
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
_toUnicodeHex
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
_fromUnicodeHex
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
toXMLname
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
fromXMLname
<|file_name|>XMLname.py<|end_file_name|><|fim▁begin|>import re from six import text_type """Translate strings to and from SOAP 1.2 XML name encoding Implements rules for mapping application defined name to XML names specified by the w3 SOAP working group for SOAP version 1.2 in Appendix A of "SOAP Version 1.2 Part 2:...
fun
<|file_name|>bin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import sys from io import BytesIO import argparse from PIL import Image<|fim▁hole|>from .api import crop_resize parser = argparse.ArgumentParser( description='crop and resize an image without aspect ratio distortion.') parser.add_argument('im...
<|file_name|>bin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import sys from io import BytesIO import argparse from PIL import Image from .api import crop_resize parser = argparse.ArgumentParser( description='crop and resize an image without aspect ratio distortion.') parser.add_argument('image') pars...
parsed_args = parser.parse_args() image = Image.open(parsed_args.image) size = (parsed_args.width, parsed_args.height) new_image = crop_resize(image, size, parsed_args.force) if parsed_args.display: new_image.show() elif parsed_args.output: new_image.save(parsed_args.output) ...
<|file_name|>bin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import sys from io import BytesIO import argparse from PIL import Image from .api import crop_resize parser = argparse.ArgumentParser( description='crop and resize an image without aspect ratio distortion.') parser.add_argument('image') pars...
new_image.show()
<|file_name|>bin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import sys from io import BytesIO import argparse from PIL import Image from .api import crop_resize parser = argparse.ArgumentParser( description='crop and resize an image without aspect ratio distortion.') parser.add_argument('image') pars...
new_image.save(parsed_args.output)
<|file_name|>bin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import sys from io import BytesIO import argparse from PIL import Image from .api import crop_resize parser = argparse.ArgumentParser( description='crop and resize an image without aspect ratio distortion.') parser.add_argument('image') pars...
f = BytesIO() new_image.save(f, image.format) try: stdout = sys.stdout.buffer except AttributeError: stdout = sys.stdout stdout.write(f.getvalue())
<|file_name|>bin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import sys from io import BytesIO import argparse from PIL import Image from .api import crop_resize parser = argparse.ArgumentParser( description='crop and resize an image without aspect ratio distortion.') parser.add_argument('image') pars...
main