prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|># OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(obj...
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
"""OpenSSL Connection Wrapper""" def __init__(self, context, sock): self._context = context self._sock = sock self._connection = OpenSSL.SSL.Connection(context, sock) self._makefile_refs = 0 def __getattr__(self, attr): if attr not in ('_context', '_sock', '_connect...
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
self._context = context self._sock = sock self._connection = OpenSSL.SSL.Connection(context, sock) self._makefile_refs = 0
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
if attr not in ('_context', '_sock', '_connection', '_makefile_refs'): return getattr(self._connection, attr)
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
timeout = self._sock.gettimeout() or 0.1 fd = self._sock.fileno() time_start = time.time() while True: try: return io_func(*args, **kwargs) except (OpenSSL.SSL.WantReadError, OpenSSL.SSL.WantX509LookupError): sys.exc_clear() ...
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
sock, addr = self._sock.accept() client = OpenSSL.SSL.Connection(sock._context, sock) return client, addr
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
self.__iowait(self._connection.do_handshake)
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
return self.__iowait(self._connection.connect, *args, **kwargs)
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
try: return self.__iowait(self._connection.send, data, flags) except OpenSSL.SSL.SysCallError as e: if e[0] == -1 and not data: # errors when writing empty strings are expected and can be ignored return 0 raise
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
if hasattr(data, 'tobytes'): data = data.tobytes() return self.__send(data, flags)
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
pending = self._connection.pending() if pending: return self._connection.recv(min(pending, bufsiz)) try: return self.__iowait(self._connection.recv, bufsiz, flags) except OpenSSL.SSL.ZeroReturnError: return '' except OpenSSL.SSL.SysCallError as...
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
return self.recv(bufsiz, flags)
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
return self.sendall(buf, flags)
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
if self._makefile_refs < 1: self._connection = None if self._sock: socket.socket.close(self._sock) else: self._makefile_refs -= 1
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
self._makefile_refs += 1 return socket._fileobject(self, mode, bufsize, close=True)
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
global ssl_version if not ssl_version: if hasattr(OpenSSL.SSL, "TLSv1_2_METHOD"): ssl_version = "TLSv1_2" elif hasattr(OpenSSL.SSL, "TLSv1_1_METHOD"): ssl_version = "TLSv1_1" elif hasattr(OpenSSL.SSL, "TLSv1_METHOD"): ...
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
return getattr(self._connection, attr)
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
break
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
break
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
break
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
break
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
return 0
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
data = data.tobytes()
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
return self._connection.recv(min(pending, bufsiz))
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
return ''
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
self._connection = None if self._sock: socket.socket.close(self._sock)
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
socket.socket.close(self._sock)
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
self._makefile_refs -= 1
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
if hasattr(OpenSSL.SSL, "TLSv1_2_METHOD"): ssl_version = "TLSv1_2" elif hasattr(OpenSSL.SSL, "TLSv1_1_METHOD"): ssl_version = "TLSv1_1" elif hasattr(OpenSSL.SSL, "TLSv1_METHOD"): ssl_version = "TLSv1" else: s...
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
ssl_version = "TLSv1_2"
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
ssl_version = "TLSv1_1"
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
ssl_version = "TLSv1"
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
ssl_version = "SSLv23"
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
ssl_version = "TLSv1"
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
ssl_context.load_verify_locations(os.path.abspath(ca_certs)) ssl_context.set_verify(OpenSSL.SSL.VERIFY_PEER, lambda c, x, e, d, ok: ok)
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
ssl_context.set_verify(OpenSSL.SSL.VERIFY_NONE, lambda c, x, e, d, ok: ok)
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
__init__
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
__getattr__
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
__iowait
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
accept
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
do_handshake
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
connect
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
__send
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
__send_memoryview
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
recv
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
read
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
write
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
close
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
makefile
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|> # OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(ob...
context_builder
<|file_name|>album.py<|end_file_name|><|fim▁begin|>from ..models import Album from ..resource import SingleResource, ListResource from ..schemas import AlbumSchema class SingleAlbum(SingleResource): schema = AlbumSchema()<|fim▁hole|> routes = ('/album/<int:id>/',) model = Album class ListAlbums(ListResou...
<|file_name|>album.py<|end_file_name|><|fim▁begin|>from ..models import Album from ..resource import SingleResource, ListResource from ..schemas import AlbumSchema class SingleAlbum(SingleResource): <|fim_middle|> class ListAlbums(ListResource): schema = AlbumSchema(many=True) routes = ('/album/', '/tr...
schema = AlbumSchema() routes = ('/album/<int:id>/',) model = Album
<|file_name|>album.py<|end_file_name|><|fim▁begin|>from ..models import Album from ..resource import SingleResource, ListResource from ..schemas import AlbumSchema class SingleAlbum(SingleResource): schema = AlbumSchema() routes = ('/album/<int:id>/',) model = Album class ListAlbums(ListResource): <...
schema = AlbumSchema(many=True) routes = ('/album/', '/tracklist/') model = Album
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): <|fim_middle|> class Actor(Sprite): def __init__(self, xPos, yPos): super(Actor, self).__init__(xPos, yPos) self.speed = 5 self.dy = 0 self.d = 3 self.dir = "right" # self.newdi...
def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x < self.x + self.tw and self.y < otherSprite.y + otherSprite.th and o...
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): <|fim_middle|> def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x < self.x + self.tw and self.y < otherSprite.y + ot...
self.x = xPos self.y = yPos self.th = 32 self.tw = 32
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): <|fim_middle|> class Actor(Sprite): def __init__(se...
if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x < self.x + self.tw and self.y < otherSprite.y + otherSprite.th and otherSprite.y < self.y + self.th): return True else: return False
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
def __init__(self, xPos, yPos): super(Actor, self).__init__(xPos, yPos) self.speed = 5 self.dy = 0 self.d = 3 self.dir = "right" # self.newdir = "right" self.state = "standing" self.walkR = [] self.walkL = [] def loadPics(self): ...
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
super(Actor, self).__init__(xPos, yPos) self.speed = 5 self.dy = 0 self.d = 3 self.dir = "right" # self.newdir = "right" self.state = "standing" self.walkR = [] self.walkL = []
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
self.standing = loadImage("gripe_stand.png") self.falling = loadImage("grfalling.png") for i in range(8): imageName = "gr" + str(i) + ".png" self.walkR.append(loadImage(imageName)) for i in range(8): imageName = "gl" + str(i) + ".png" self....
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
if wall.state == "hidden": if (self.x >= wall.x - self.d and (self.x + 32 <= wall.x + 32 + self.d)): return False
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
if self.dir == "right": if self.state == "walking": self.im = self.walkR[frameCount % 8] self.dx = self.speed elif self.state == "standing": self.im = self.standing self.dx = 0 elif self.state == "falling": ...
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
image(self.im, self.x, self.y)
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
def __init__(self, xPos, yPos): super(Block, self).__init__(xPos, yPos) self.state = "visible" def loadPics(self): self.im = loadImage("block.png") def display(self): if self.state == "visible": image(self.im, self.x, self.y)
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
super(Block, self).__init__(xPos, yPos) self.state = "visible"
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
self.im = loadImage("block.png")
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
if self.state == "visible": image(self.im, self.x, self.y)
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
return True
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
return False
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
if (self.x >= wall.x - self.d and (self.x + 32 <= wall.x + 32 + self.d)): return False
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
return False
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
if self.state == "walking": self.im = self.walkR[frameCount % 8] self.dx = self.speed elif self.state == "standing": self.im = self.standing self.dx = 0 elif self.state == "falling": self.im = self.fallin...
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
self.im = self.walkR[frameCount % 8] self.dx = self.speed
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
self.im = self.standing self.dx = 0
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
self.im = self.falling self.dx = 0 self.dy = 5
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
if self.state == "walking": self.im = self.walkL[frameCount % 8] self.dx = -self.speed elif self.state == "standing": self.im = self.standing self.dx = 0 elif self.state == "falling": self.im = self.falli...
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
self.im = self.walkL[frameCount % 8] self.dx = -self.speed
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
self.im = self.standing self.dx = 0
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
self.im = self.falling self.dx = 0 self.dy = 5
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
self.dx = 0
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
self.x = 0
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
self.x = 640 -self.tw
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
image(self.im, self.x, self.y)
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def <|fim_middle|>(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSpr...
__init__
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def <|fim_middle|>(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
checkCollision
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
__init__
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
loadPics
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
checkWall
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
move
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
display
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
__init__
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
loadPics
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
display
<|file_name|>test_sql.py<|end_file_name|><|fim▁begin|># # GeoCoon - GIS data analysis library based on Pandas and Shapely # # Copyright (C) 2014 by Artur Wroblewski <wrobell@pld-linux.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
from shapely.geometry import Point from geocoon.sql import read_sql from geocoon.core import GeoDataFrame, PointSeries
<|file_name|>test_sql.py<|end_file_name|><|fim▁begin|># # GeoCoon - GIS data analysis library based on Pandas and Shapely # # Copyright (C) 2014 by Artur Wroblewski <wrobell@pld-linux.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
""" Test SQL GeoCoon SQL routines. """ @mock.patch('pandas.io.sql.read_sql') def test_read_sql(self, f_sql): """ Test SQL data frame read """ points = Point(1, 1), Point(2, 2), Point(3, 3) data = { 'a': PointSeries([p.wkb for p in points]), ...
<|file_name|>test_sql.py<|end_file_name|><|fim▁begin|># # GeoCoon - GIS data analysis library based on Pandas and Shapely # # Copyright (C) 2014 by Artur Wroblewski <wrobell@pld-linux.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
""" Test SQL data frame read """ points = Point(1, 1), Point(2, 2), Point(3, 3) data = { 'a': PointSeries([p.wkb for p in points]), 'b': list(range(3)), } data = GeoDataFrame(data) data = data[['a', 'b']] f_sql.return_value ...
<|file_name|>test_sql.py<|end_file_name|><|fim▁begin|># # GeoCoon - GIS data analysis library based on Pandas and Shapely # # Copyright (C) 2014 by Artur Wroblewski <wrobell@pld-linux.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
test_read_sql
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|>from celery.task import Task import requests<|fim▁hole|>class StracksFlushTask(Task): def run(self, url, data): requests.post(url + "/", data=data)<|fim▁end|>
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|>from celery.task import Task import requests class StracksFlushTask(Task): <|fim_middle|> <|fim▁end|>
def run(self, url, data): requests.post(url + "/", data=data)
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|>from celery.task import Task import requests class StracksFlushTask(Task): def run(self, url, data): <|fim_middle|> <|fim▁end|>
requests.post(url + "/", data=data)