prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>media.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
eve.io.media
~~~~~~~~~~~~
Media storage for Eve-powered APIs.
:copyright: (c) 2014 by Nicola Iarocci.
:license: BSD, see LICENSE for more details.
"""
class MediaStorage(object):
""" The MediaStorage class provid... | delete |
<|file_name|>media.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
eve.io.media
~~~~~~~~~~~~
Media storage for Eve-powered APIs.
:copyright: (c) 2014 by Nicola Iarocci.
:license: BSD, see LICENSE for more details.
"""
class MediaStorage(object):
""" The MediaStorage class provid... | exists |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | RE_PARAM = re.compile('^<([a-zA-Z][a-zA-Z0-9_]*)>$')
def is_param(value): |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
<|fim_middle|>
def parse_format(data):
"""Returns root input... | """Return the root input type from JSON formatted string."""
return parse_format(json.loads(data)) |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | """Returns root input type from data."""
input_types = {}
data = data['ist_nodes']
root_id = data[0]['id'] # set root type
for item in data:
input_type = _get_input_type(item)
if input_type is not None:
input_types[input_type['id']] = input_type # register by id
... |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | """Returns True if input_type is scalar."""
return input_type['base_type'] in SCALAR |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | """Determine whether given value is a parameter string."""
if not isinstance(value, str):
return False
return RE_PARAM.match(value) |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | """Replaces ids or type names with python object references."""
input_type = {}
def _substitute_implementations():
"""Replaces implementation ids with input_types."""
impls = {}
for id_ in input_type['implementations']:
type_ = input_types[id_]
impls[type_['n... |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | """Replaces implementation ids with input_types."""
impls = {}
for id_ in input_type['implementations']:
type_ = input_types[id_]
impls[type_['name']] = type_
input_type['implementations'] = impls |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | """Replaces default descendant id with input_type."""
id_ = input_type.get('default_descendant', None)
if id_ is not None:
input_type['default_descendant'] = input_types[id_] |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | """Replaces key type with input_type."""
# pylint: disable=unused-variable, invalid-name
for __, value in input_type['keys'].items():
value['type'] = input_types[value['type']] |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | """Returns the input_type data structure that defines an input type
and its constraints for validation."""
if 'id' not in data or 'input_type' not in data:
return None
input_type = dict(
id=data['id'],
base_type=data['input_type']
)
input_type['name'] = data.get('name', '... |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | """Parses the format range properties - min, max."""
input_type = {}
try:
input_type['min'] = data['range'][0]
except (KeyError, TypeError): # set default value
input_type['min'] = float('-inf')
try:
input_type['max'] = data['range'][1]
except (KeyError, TypeError): # s... |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | """
Transforms a list of dictionaries into a dictionary of dictionaries.
Original dictionaries are assigned key specified in each of them
by key_label.
"""
dict_ = {}
for item in list_:
dict_[item[key_label]] = item
return dict_ |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | input_types[input_type['id']] = input_type # register by id |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | return False |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | input_type['default_descendant'] = input_types[id_] |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | input_type['subtype'] = input_types[input_type['subtype']] |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | _substitute_implementations()
_substitute_default_descendant() |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | _substitute_key_type() |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | return None |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | input_type.update(_parse_range(data)) |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | input_type.update(_parse_range(data))
if input_type['min'] < 0:
input_type['min'] = 0
input_type['subtype'] = data['subtype'] |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | input_type['min'] = 0 |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | input_type['file_mode'] = data['file_mode'] |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | input_type['values'] = _list_to_dict(data['values'], 'name') |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | input_type['keys'] = _list_to_dict(data['keys'])
input_type['implements'] = data.get('implements', [])
input_type['reducible_to_key'] = data.get('reducible_to_key', None) |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | input_type['implementations'] = data['implementations']
input_type['default_descendant'] = data.get('default_descendant', None) |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def <|fim_middle|>(data):
"""Return the root input type from JSON formatted string."""
return parse_form... | get_root_input_type_from_json |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | parse_format |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | is_scalar |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | is_param |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | _substitute_ids_with_references |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | _substitute_implementations |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | _substitute_default_descendant |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | _substitute_key_type |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | _get_input_type |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | _parse_range |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | _list_to_dict |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# SymPy documentation build configuration file, created by
# sphinx-quickstart.py on Sat Mar 22 19:34:32 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don'... | |
<|file_name|>hash_file.py<|end_file_name|><|fim▁begin|>import hashlib
from core.analytics import InlineAnalytics
from core.observables import Hash
HASH_TYPES_DICT = {
"md5": hashlib.md5,
"sha1": hashlib.sha1,
"sha256": hashlib.sha256,
"sha512": hashlib.sha512,
}
class HashFile(InlineAnalytics):
... |
@staticmethod |
<|file_name|>hash_file.py<|end_file_name|><|fim▁begin|>import hashlib
from core.analytics import InlineAnalytics
from core.observables import Hash
HASH_TYPES_DICT = {
"md5": hashlib.md5,
"sha1": hashlib.sha1,
"sha256": hashlib.sha256,
"sha512": hashlib.sha512,
}
class HashFile(InlineAnalytics):
... | default_values = {
"name": "HashFile",
"description": "Extracts MD5, SHA1, SHA256, SHA512 hashes from file",
}
ACTS_ON = ["File", "Certificate"]
@staticmethod
def each(f):
if f.body:
f.hashes = []
for hash_type, h in HashFile.extract_hashes(f.body.co... |
<|file_name|>hash_file.py<|end_file_name|><|fim▁begin|>import hashlib
from core.analytics import InlineAnalytics
from core.observables import Hash
HASH_TYPES_DICT = {
"md5": hashlib.md5,
"sha1": hashlib.sha1,
"sha256": hashlib.sha256,
"sha512": hashlib.sha512,
}
class HashFile(InlineAnalytics):
... | if f.body:
f.hashes = []
for hash_type, h in HashFile.extract_hashes(f.body.contents):
hash_object = Hash.get_or_create(value=h.hexdigest())
hash_object.add_source("analytics")
hash_object.save()
f.active_link_to(
... |
<|file_name|>hash_file.py<|end_file_name|><|fim▁begin|>import hashlib
from core.analytics import InlineAnalytics
from core.observables import Hash
HASH_TYPES_DICT = {
"md5": hashlib.md5,
"sha1": hashlib.sha1,
"sha256": hashlib.sha256,
"sha512": hashlib.sha512,
}
class HashFile(InlineAnalytics):
... | hashers = {k: HASH_TYPES_DICT[k]() for k in HASH_TYPES_DICT}
while True:
chunk = body_contents.read(512 * 16)
if not chunk:
break
for h in hashers.values():
h.update(chunk)
return hashers.items() |
<|file_name|>hash_file.py<|end_file_name|><|fim▁begin|>import hashlib
from core.analytics import InlineAnalytics
from core.observables import Hash
HASH_TYPES_DICT = {
"md5": hashlib.md5,
"sha1": hashlib.sha1,
"sha256": hashlib.sha256,
"sha512": hashlib.sha512,
}
class HashFile(InlineAnalytics):
... | f.hashes = []
for hash_type, h in HashFile.extract_hashes(f.body.contents):
hash_object = Hash.get_or_create(value=h.hexdigest())
hash_object.add_source("analytics")
hash_object.save()
f.active_link_to(
hash_obje... |
<|file_name|>hash_file.py<|end_file_name|><|fim▁begin|>import hashlib
from core.analytics import InlineAnalytics
from core.observables import Hash
HASH_TYPES_DICT = {
"md5": hashlib.md5,
"sha1": hashlib.sha1,
"sha256": hashlib.sha256,
"sha512": hashlib.sha512,
}
class HashFile(InlineAnalytics):
... | break |
<|file_name|>hash_file.py<|end_file_name|><|fim▁begin|>import hashlib
from core.analytics import InlineAnalytics
from core.observables import Hash
HASH_TYPES_DICT = {
"md5": hashlib.md5,
"sha1": hashlib.sha1,
"sha256": hashlib.sha256,
"sha512": hashlib.sha512,
}
class HashFile(InlineAnalytics):
... | each |
<|file_name|>hash_file.py<|end_file_name|><|fim▁begin|>import hashlib
from core.analytics import InlineAnalytics
from core.observables import Hash
HASH_TYPES_DICT = {
"md5": hashlib.md5,
"sha1": hashlib.sha1,
"sha256": hashlib.sha256,
"sha512": hashlib.sha512,
}
class HashFile(InlineAnalytics):
... | extract_hashes |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | -1, # Wait for any child process
os.WNOHANG # Do not block and return EWOULDBLOCK error
)
print( |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | while True:
try:
pid, status = os.waitpid(
-1, # Wait for any child process
os.WNOHANG # Do not block and return EWOULDBLOCK error
)
print(
'Child {pid} terminated with status {status}'
'\n'.format... |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | address_family = socket.AF_INET
socket_type = socket.SOCK_STREAM
request_queue_size = 1024
def __init__(self, server_address):
# Create a listening socket
self.listen_socket = listen_socket = socket.socket(
self.address_family,
self.socket_type
)
... |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | self.listen_socket = listen_socket = socket.socket(
self.address_family,
self.socket_type
)
# Allow to reuse the same address
listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
# Bind
listen_socket.bind(server_address)
# Ac... |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | self.application = application |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | listen_socket = self.listen_socket
while True:
try:
self.client_connection, client_address = listen_socket.accept()
except IOError as e:
code, msg = e.args
# restart 'accept' if it was interrupted
if code == errno.EI... |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | self.request_data = request_data = self.client_connection.recv(1024)
# Print formatted request data a la 'curl -v'
print(''.join(
'< {line}\n'.format(line=line)
for line in request_data.splitlines()
))
self.parse_request(request_data)
# Construct... |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | request_line = text.splitlines()[0]
request_line = request_line.rstrip('\r\n')
# Break down the request line into components
(self.request_method, # GET
self.path, # /hello
self.request_version # HTTP/1.1
) = request_line.split() |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | env = {}
# The following code snippet does not follow PEP8 conventions
# but it's formatted the way it is for demonstration purposes
# to emphasize the required variables and their values
#
# Required WSGI variables
env['wsgi.version'] = (1, 0)
env['w... |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | server_headers = [
('Date', 'Tue, 31 Mar 2015 12:54:48 GMT'),
('Server', 'WSGIServer 0.2'),
]
self.headers_set = [status, response_headers + server_headers]
# To adhere to WSGI specification the start_response must return
# a 'write' callable. We simplicit... |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | try:
status, response_headers = self.headers_set
response = 'HTTP/1.1 {status}\r\n'.format(status=status)
for header in response_headers:
response += '{0}: {1}\r\n'.format(*header)
response += '\r\n'
for data in result:
... |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | signal.signal(signal.SIGCHLD, grim_reaper)
server = WSGIServer(server_address)
server.set_app(application)
return server |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | return |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | continue |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | raise |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | listen_socket.close() # close child copy
# Handle one request and close the client connection.
self.handle_one_request()
os._exit(0) |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | self.client_connection.close() # close parent copy |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | if len(sys.argv) < 2:
sys.exit('Provide a WSGI application object as module:callable')
app_path = sys.argv[1]
module, application = app_path.split(':')
module = __import__(module)
application = getattr(module, application)
httpd = make_server(SERVER_ADDRESS, application)
print('WSGIS... |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | sys.exit('Provide a WSGI application object as module:callable') |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | grim_reaper |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | __init__ |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | set_app |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | serve_forever |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | handle_one_request |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | parse_request |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | get_environ |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | start_response |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | finish_response |
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>###########################################################################
# Concurrent WSGI server - webserver3h.py #
# #
# Tested with Python 2.7.9 on Ubun... | make_server |
<|file_name|>horrorkino.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Covenant Add-on
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, o... |
r = client.request(urlparse.urljoin(self.base_link, url))
r = re.findall('''vicode\s*=\s*["'](.*?)["'];''', r)[0].decode('string_escape')
r = dom_parser.parse_dom(r, 'iframe', req='src') |
<|file_name|>horrorkino.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Covenant Add-on
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, o... | def __init__(self):
self.priority = 1
self.language = ['de']
self.genre_filter = ['horror']
self.domains = ['horrorkino.do.am']
self.base_link = 'http://horrorkino.do.am/'
self.search_link = 'video/shv'
def movie(self, imdb, title, localtitle, aliases, year):
... |
<|file_name|>horrorkino.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Covenant Add-on
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, o... | self.priority = 1
self.language = ['de']
self.genre_filter = ['horror']
self.domains = ['horrorkino.do.am']
self.base_link = 'http://horrorkino.do.am/'
self.search_link = 'video/shv' |
<|file_name|>horrorkino.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Covenant Add-on
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, o... | try:
url = self.__search([localtitle] + source_utils.aliases_to_array(aliases), year)
if not url and title != localtitle: url = self.__search([title] + source_utils.aliases_to_array(aliases), year)
return url
except:
return |
<|file_name|>horrorkino.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Covenant Add-on
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, o... | sources = []
try:
if not url:
return sources
r = client.request(urlparse.urljoin(self.base_link, url))
r = re.findall('''vicode\s*=\s*["'](.*?)["'];''', r)[0].decode('string_escape')
r = dom_parser.parse_dom(r, 'iframe', req='src')
... |
<|file_name|>horrorkino.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Covenant Add-on
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, o... | return url |
<|file_name|>horrorkino.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Covenant Add-on
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, o... | try:
t = [cleantitle.get(i) for i in set(titles) if i]
y = ['%s' % str(year), '%s' % str(int(year) + 1), '%s' % str(int(year) - 1), '0']
r = client.request(urlparse.urljoin(self.base_link, self.search_link), post={'query': cleantitle.query(titles[0])})
r = dom_p... |
<|file_name|>horrorkino.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Covenant Add-on
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, o... | url = self.__search([title] + source_utils.aliases_to_array(aliases), year) |
<|file_name|>horrorkino.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Covenant Add-on
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, o... | return sources |
<|file_name|>horrorkino.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Covenant Add-on
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, o... | continue |
<|file_name|>horrorkino.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Covenant Add-on
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, o... | __init__ |
<|file_name|>horrorkino.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Covenant Add-on
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, o... | movie |
<|file_name|>horrorkino.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Covenant Add-on
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, o... | sources |
<|file_name|>horrorkino.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Covenant Add-on
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, o... | resolve |
<|file_name|>horrorkino.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Covenant Add-on
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, o... | __search |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
Tools and data structures for working with genomic intervals (or sets of
regions on a line in general) efficiently.
"""
# For compatiblity with existing stuff<|fim▁hole|>from bx.intervals.intersection import *<|fim▁end|> | |
<|file_name|>pipeline.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function
import logging
from django.contrib import messages
from django.core.urlresolvers import reverse<|fim▁hole|>from sentry.pipeline import Pipeline
from sentry.models import Identity, IdentityStatus, IdentityProvi... | from django.http import HttpResponseRedirect
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
|
<|file_name|>pipeline.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function
import logging
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils import timezone
from django.utils.translation impo... | logger = logger
pipeline_name = 'identity_provider'
provider_manager = default_manager
provider_model_cls = IdentityProvider
def redirect_url(self):
associate_url = reverse('sentry-extension-setup', kwargs={
# TODO(adhiraj): Remove provider_id from the callback URL, it's unused... |
<|file_name|>pipeline.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function
import logging
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils import timezone
from django.utils.translation impo... | associate_url = reverse('sentry-extension-setup', kwargs={
# TODO(adhiraj): Remove provider_id from the callback URL, it's unused.
'provider_id': 'default',
})
# Use configured redirect_url if specified for the pipeline if available
return self.config.get('redire... |
<|file_name|>pipeline.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function
import logging
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils import timezone
from django.utils.translation impo... | identity = self.provider.build_identity(self.state.data)
defaults = {
'status': IdentityStatus.VALID,
'scopes': identity.get('scopes', []),
'data': identity.get('data', {}),
'date_verified': timezone.now(),
}
identity, created = Identity.... |
<|file_name|>pipeline.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function
import logging
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils import timezone
from django.utils.translation impo... | identity.update(**defaults) |
<|file_name|>pipeline.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function
import logging
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils import timezone
from django.utils.translation impo... | redirect_url |
<|file_name|>pipeline.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function
import logging
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils import timezone
from django.utils.translation impo... | finish_pipeline |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.