prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from kivy.lib import osc
from time import sleep
import pocketclient
from kivy.utils import platform as kivy_platform
SERVICE_PORT = 4000
def <|fim_middle|>():
p = kivy_platform()
if p.lower() in ('linux', 'waindows', 'osx'):
return 'desktop'
else:... | platform |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from kivy.lib import osc
from time import sleep
import pocketclient
from kivy.utils import platform as kivy_platform
SERVICE_PORT = 4000
def platform():
p = kivy_platform()
if p.lower() in ('linux', 'waindows', 'osx'):
return 'desktop'
else:
... | __init__ |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from kivy.lib import osc
from time import sleep
import pocketclient
from kivy.utils import platform as kivy_platform
SERVICE_PORT = 4000
def platform():
p = kivy_platform()
if p.lower() in ('linux', 'waindows', 'osx'):
return 'desktop'
else:
... | send |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from kivy.lib import osc
from time import sleep
import pocketclient
from kivy.utils import platform as kivy_platform
SERVICE_PORT = 4000
def platform():
p = kivy_platform()
if p.lower() in ('linux', 'waindows', 'osx'):
return 'desktop'
else:
... | run |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from kivy.lib import osc
from time import sleep
import pocketclient
from kivy.utils import platform as kivy_platform
SERVICE_PORT = 4000
def platform():
p = kivy_platform()
if p.lower() in ('linux', 'waindows', 'osx'):
return 'desktop'
else:
... | pocket_connect |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from kivy.lib import osc
from time import sleep
import pocketclient
from kivy.utils import platform as kivy_platform
SERVICE_PORT = 4000
def platform():
p = kivy_platform()
if p.lower() in ('linux', 'waindows', 'osx'):
return 'desktop'
else:
... | save_pocket_token |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from kivy.lib import osc
from time import sleep
import pocketclient
from kivy.utils import platform as kivy_platform
SERVICE_PORT = 4000
def platform():
p = kivy_platform()
if p.lower() in ('linux', 'waindows', 'osx'):
return 'desktop'
else:
... | pocket_list |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from kivy.lib import osc
from time import sleep
import pocketclient
from kivy.utils import platform as kivy_platform
SERVICE_PORT = 4000
def platform():
p = kivy_platform()
if p.lower() in ('linux', 'waindows', 'osx'):
return 'desktop'
else:
... | pocket_mark_read |
<|file_name|>WpApiParser.py<|end_file_name|><|fim▁begin|>from cse.util import Util
from collections import OrderedDict
from cse.pipeline import Handler
class WpApiParser(Handler):
def __init__(self):
super()
def parse(self, comments, url, assetId, parentId):
data = self.__buildDataSkeleto... | votes = action_summary["count"] |
<|file_name|>WpApiParser.py<|end_file_name|><|fim▁begin|>from cse.util import Util
from collections import OrderedDict
from cse.pipeline import Handler
class WpApiParser(Handler):
def __init__(self):
super()
def parse(self, comments, url, assetId, parentId):
data = self.__buildDataSkeleto... | |
<|file_name|>WpApiParser.py<|end_file_name|><|fim▁begin|>from cse.util import Util
from collections import OrderedDict
from cse.pipeline import Handler
class WpApiParser(Handler):
<|fim_middle|>
<|fim▁end|> | def __init__(self):
super()
def parse(self, comments, url, assetId, parentId):
data = self.__buildDataSkeleton(url, assetId)
data["comments"] = self.__iterateComments(comments, parentId)
return data
def __buildDataSkeleton(self, url, assetId):
return {
... |
<|file_name|>WpApiParser.py<|end_file_name|><|fim▁begin|>from cse.util import Util
from collections import OrderedDict
from cse.pipeline import Handler
class WpApiParser(Handler):
def __init__(self):
<|fim_middle|>
def parse(self, comments, url, assetId, parentId):
data = self.__buildDat... | super() |
<|file_name|>WpApiParser.py<|end_file_name|><|fim▁begin|>from cse.util import Util
from collections import OrderedDict
from cse.pipeline import Handler
class WpApiParser(Handler):
def __init__(self):
super()
def parse(self, comments, url, assetId, parentId):
<|fim_middle|>
def __bu... | data = self.__buildDataSkeleton(url, assetId)
data["comments"] = self.__iterateComments(comments, parentId)
return data |
<|file_name|>WpApiParser.py<|end_file_name|><|fim▁begin|>from cse.util import Util
from collections import OrderedDict
from cse.pipeline import Handler
class WpApiParser(Handler):
def __init__(self):
super()
def parse(self, comments, url, assetId, parentId):
data = self.__buildDataSkeleto... | return {
"article_url" : url,
"article_id" : assetId,
"comments" : None
} |
<|file_name|>WpApiParser.py<|end_file_name|><|fim▁begin|>from cse.util import Util
from collections import OrderedDict
from cse.pipeline import Handler
class WpApiParser(Handler):
def __init__(self):
super()
def parse(self, comments, url, assetId, parentId):
data = self.__buildDataSkeleto... | commentList = OrderedDict()
for comment in comments:
votes = 0
for action_summary in comment["action_summaries"]:
if action_summary["__typename"] == "LikeActionSummary":
votes = action_summary["count"]
commentObject = {
... |
<|file_name|>WpApiParser.py<|end_file_name|><|fim▁begin|>from cse.util import Util
from collections import OrderedDict
from cse.pipeline import Handler
class WpApiParser(Handler):
def __init__(self):
super()
def parse(self, comments, url, assetId, parentId):
data = self.__buildDataSkeleto... | pass |
<|file_name|>WpApiParser.py<|end_file_name|><|fim▁begin|>from cse.util import Util
from collections import OrderedDict
from cse.pipeline import Handler
class WpApiParser(Handler):
def __init__(self):
super()
def parse(self, comments, url, assetId, parentId):
data = self.__buildDataSkeleto... | result = self.parse(
comments=data["comments"],
url=data["url"],
assetId=data["assetId"],
parentId=data["parentId"]
)
ctx.write(result) |
<|file_name|>WpApiParser.py<|end_file_name|><|fim▁begin|>from cse.util import Util
from collections import OrderedDict
from cse.pipeline import Handler
class WpApiParser(Handler):
def <|fim_middle|>(self):
super()
def parse(self, comments, url, assetId, parentId):
data = self.__buildDataS... | __init__ |
<|file_name|>WpApiParser.py<|end_file_name|><|fim▁begin|>from cse.util import Util
from collections import OrderedDict
from cse.pipeline import Handler
class WpApiParser(Handler):
def __init__(self):
super()
def <|fim_middle|>(self, comments, url, assetId, parentId):
data = self.__buildDa... | parse |
<|file_name|>WpApiParser.py<|end_file_name|><|fim▁begin|>from cse.util import Util
from collections import OrderedDict
from cse.pipeline import Handler
class WpApiParser(Handler):
def __init__(self):
super()
def parse(self, comments, url, assetId, parentId):
data = self.__buildDataSkeleto... | __buildDataSkeleton |
<|file_name|>WpApiParser.py<|end_file_name|><|fim▁begin|>from cse.util import Util
from collections import OrderedDict
from cse.pipeline import Handler
class WpApiParser(Handler):
def __init__(self):
super()
def parse(self, comments, url, assetId, parentId):
data = self.__buildDataSkeleto... | __iterateComments |
<|file_name|>WpApiParser.py<|end_file_name|><|fim▁begin|>from cse.util import Util
from collections import OrderedDict
from cse.pipeline import Handler
class WpApiParser(Handler):
def __init__(self):
super()
def parse(self, comments, url, assetId, parentId):
data = self.__buildDataSkeleto... | registeredAt |
<|file_name|>WpApiParser.py<|end_file_name|><|fim▁begin|>from cse.util import Util
from collections import OrderedDict
from cse.pipeline import Handler
class WpApiParser(Handler):
def __init__(self):
super()
def parse(self, comments, url, assetId, parentId):
data = self.__buildDataSkeleto... | process |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
<|fim_middle|>
################################################
class Server():
def __init_... | def __missing__(self, key):
try:
return super().__missing__(key)
except KeyError:
return NotImplemented |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
<|fim_middle|>
###############################################... | try:
return super().__missing__(key)
except KeyError:
return NotImplemented |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | def __init__(self, shortname, loader):
# Not preloaded
# loaders must produce dictionaries (or an appropriate iterable)
# with the required keys.
# The reason for this is that code for certain servers need not be loaded
# if it's not going to be used at all
# It also ... |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | global __ServerImplementationDict
self.__data = ServerImplementationDict(loader)
self.__shortname = shortname |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | return self.__shortname |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | return str(self.__shortname) |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | return self.__data['str_name'] |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | return self.__data['str_shortname'] |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | return self.__data['bool_tester'] |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | return self.__data['cls_auth'] |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | return self.__data['list_authkeys'] |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | return self.__data['cls_player'] |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | return self.__data['cls_tournament'] |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | return self.__data['cls_auth']
@property
def auth_fields(self):
return self.__data['list_authkeys'] |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def <|fim_middle|>(self, key):
try:
return super().__missing__(key)
exc... | __missing__ |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | __init__ |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | shortname |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | __str__ |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | name |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | internal_shortname |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | beta |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | Auth |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | auth_fields |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | Player |
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except... | Tournament |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | """A Pluma plugin to implement Zen Coding's HTML and CSS shorthand expander."""
def activate(self, window):
actions = [
('ZenCodingMenuAction', None, '_Zen Coding', None, "Zen Coding tools", None),
('ZenCodingExpandAction', ... |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | actions = [
('ZenCodingMenuAction', None, '_Zen Coding', None, "Zen Coding tools", None),
('ZenCodingExpandAction', None, '_Expand abbreviation', '<Ctrl>E', "Expand abbreviation to raw HTML/CSS", self.expand_... |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | windowdata = window.get_data("ZenCodingPluginDataKey")
manager = window.get_ui_manager()
manager.remove_ui(windowdata["ui_id"])
manager.remove_action_group(windowdata["action_group"]) |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | view = window.get_active_view()
windowdata = window.get_data("ZenCodingPluginDataKey")
windowdata["action_group"].set_sensitive(bool(view and view.get_editable())) |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | self.editor.expand_abbreviation(window) |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | self.editor.expand_with_abbreviation(window) |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | self.editor.wrap_with_abbreviation(window) |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | self.editor.match_pair_inward(window) |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | self.editor.match_pair_outward(window) |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | self.editor.merge_lines(window) |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | self.editor.prev_edit_point(window) |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | self.editor.next_edit_point(window) |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | self.editor.remove_tag(window) |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | self.editor.split_join_tag(window) |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | self.editor.toggle_comment(window) |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | activate |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | deactivate |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | update_ui |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | expand_abbreviation |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | expand_with_abbreviation |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | wrap_with_abbreviation |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | match_pair_inward |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | match_pair_outward |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | merge_lines |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | prev_edit_point |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | next_edit_point |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | remove_tag |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | split_join_tag |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | toggle_comment |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | ('ZenCodingExpandWAction', None, 'E_xpand dynamic abbreviation...', '<Ctrl><Alt>E', "Dynamically expand abbreviation as you type", self.expand_with_abbreviation), |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># @file plugin.py
#
# Connect Zen Coding to Pluma.
#
# Adapted to pluma by Joao Manoel (joaomanoel7@gmail.com)
#
# Original Author Franck Marcia (franck.marcia@gmail.com)
#
import pluma, gobject, gtk, os
from zen_editor import ZenEditor
zencoding_ui_str = """
<ui>
... | md = gtk.MessageDialog(window, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR,
gtk.BUTTONS_CLOSE, "There is an error in user settings:")
message = "{0} on line {1} at character {2}\n\nUser settings will not be available."
md.set_title("Zen Coding error")
md.format_se... |
<|file_name|>logHist.py<|end_file_name|><|fim▁begin|>import matplotlib.pyplot as plt
import numpy as np
def logHist(X, N=30,fig=None, noclear=False, pdf=False, **kywds):
'''
Plot logarithmic histogram or probability density function from
sampled data.
Args:
X (numpy.ndarray): 1-D array of samp... | return x,n |
<|file_name|>logHist.py<|end_file_name|><|fim▁begin|>import matplotlib.pyplot as plt
import numpy as np
def logHist(X, N=30,fig=None, noclear=False, pdf=False, **kywds):
<|fim_middle|>
<|fim▁end|> | '''
Plot logarithmic histogram or probability density function from
sampled data.
Args:
X (numpy.ndarray): 1-D array of sampled values
N (Optional[int]): Number of bins (default 30)
fig (Optional[int]): Figure number (default None)
noclear (Optioanl[bool]): Clear figure ... |
<|file_name|>logHist.py<|end_file_name|><|fim▁begin|>import matplotlib.pyplot as plt
import numpy as np
def logHist(X, N=30,fig=None, noclear=False, pdf=False, **kywds):
'''
Plot logarithmic histogram or probability density function from
sampled data.
Args:
X (numpy.ndarray): 1-D array of samp... | plt.clf() |
<|file_name|>logHist.py<|end_file_name|><|fim▁begin|>import matplotlib.pyplot as plt
import numpy as np
def logHist(X, N=30,fig=None, noclear=False, pdf=False, **kywds):
'''
Plot logarithmic histogram or probability density function from
sampled data.
Args:
X (numpy.ndarray): 1-D array of samp... | n /= np.diff(x)
x = x[:-1]+np.diff(x)/2
plt.semilogx(x,n,**kywds) |
<|file_name|>logHist.py<|end_file_name|><|fim▁begin|>import matplotlib.pyplot as plt
import numpy as np
def logHist(X, N=30,fig=None, noclear=False, pdf=False, **kywds):
'''
Plot logarithmic histogram or probability density function from
sampled data.
Args:
X (numpy.ndarray): 1-D array of samp... | plt.bar(x[:len(x)-1],n,width=np.diff(x),**kywds) |
<|file_name|>logHist.py<|end_file_name|><|fim▁begin|>import matplotlib.pyplot as plt
import numpy as np
def <|fim_middle|>(X, N=30,fig=None, noclear=False, pdf=False, **kywds):
'''
Plot logarithmic histogram or probability density function from
sampled data.
Args:
X (numpy.ndarray): 1-D array ... | logHist |
<|file_name|>dialogue.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy import cumsum, sum, searchsorted
from numpy.random import rand
import math
import utils
import core.sentence as sentence
import core.markovchain as mc
import logging
logger = logging.getLogger(__name__)
# Dialogue making class. Need t... |
def make_transition_probs(self):
"""Make transition matrix between speakers, with random symmetric biases added in"""
n = len(self.speakers) # TODO why this line ??? |
<|file_name|>dialogue.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy import cumsum, sum, searchsorted
from numpy.random import rand
import math
import utils
import core.sentence as sentence
import core.markovchain as mc
import logging
logger = logging.getLogger(__name__)
# Dialogue making class. Need t... | """Class to handle creating dialogue based on a list of speakers and a sentence generator."""
def __init__(self, names, pronouns, mc):
self.speakers = [{"name": n, "pronoun": p} for n, p in list(zip(names, pronouns))]
self._transitions = self.make_transition_probs()
self._speech_acts = [... |
<|file_name|>dialogue.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy import cumsum, sum, searchsorted
from numpy.random import rand
import math
import utils
import core.sentence as sentence
import core.markovchain as mc
import logging
logger = logging.getLogger(__name__)
# Dialogue making class. Need t... | self.speakers = [{"name": n, "pronoun": p} for n, p in list(zip(names, pronouns))]
self._transitions = self.make_transition_probs()
self._speech_acts = ["said", "whispered", "shouted", "cried"]
self._acts_transitions = [25, 2, 2, 2]
self.mc = mc
# self.seeds = seeds
... |
<|file_name|>dialogue.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy import cumsum, sum, searchsorted
from numpy.random import rand
import math
import utils
import core.sentence as sentence
import core.markovchain as mc
import logging
logger = logging.getLogger(__name__)
# Dialogue making class. Need t... | """Make transition matrix between speakers, with random symmetric biases added in"""
n = len(self.speakers) # TODO why this line ???
transitions = np.random.randint(5, size=(n, n)) + 1
transitions += transitions.transpose()
for i in range(0, math.floor(n / 2)):
s1 = ... |
<|file_name|>dialogue.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy import cumsum, sum, searchsorted
from numpy.random import rand
import math
import utils
import core.sentence as sentence
import core.markovchain as mc
import logging
logger = logging.getLogger(__name__)
# Dialogue making class. Need t... | """Pick next person to speak"""
row = self._transitions[speaker_id]
sucessor = searchsorted(cumsum(row), rand() * sum(row))
return sucessor |
<|file_name|>dialogue.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy import cumsum, sum, searchsorted
from numpy.random import rand
import math
import utils
import core.sentence as sentence
import core.markovchain as mc
import logging
logger = logging.getLogger(__name__)
# Dialogue making class. Need t... | """Random walk through transitions matrix to produce a sequence of speaker ids"""
seq = []
for i in range(n):
seq.append(speaker_id)
speaker_id = self.after(speaker_id)
return seq |
<|file_name|>dialogue.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy import cumsum, sum, searchsorted
from numpy.random import rand
import math
import utils
import core.sentence as sentence
import core.markovchain as mc
import logging
logger = logging.getLogger(__name__)
# Dialogue making class. Need t... | speech_acts_seq = []
next_speech_id = 0
for i in range(n):
next_speech_id = searchsorted(cumsum(self._acts_transitions), rand() * sum(self._acts_transitions))
speech_acts_seq.append(self._speech_acts[next_speech_id])
return speech_acts_seq |
<|file_name|>dialogue.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy import cumsum, sum, searchsorted
from numpy.random import rand
import math
import utils
import core.sentence as sentence
import core.markovchain as mc
import logging
logger = logging.getLogger(__name__)
# Dialogue making class. Need t... | return([self.speakers[id] for id in sequence]) |
<|file_name|>dialogue.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy import cumsum, sum, searchsorted
from numpy.random import rand
import math
import utils
import core.sentence as sentence
import core.markovchain as mc
import logging
logger = logging.getLogger(__name__)
# Dialogue making class. Need t... | n = len(seeds)
speaker_id = self.speaker_sequence(0, n)
speech_acts_seq = self.speech_sequence(n)
bits = []
ss = sentence.SentenceMaker(self.mc)
for i in range(n):
sent_toks = ss.generate_sentence_tokens([seeds[i]], self.target_len[speaker_id[i]])
... |
<|file_name|>dialogue.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy import cumsum, sum, searchsorted
from numpy.random import rand
import math
import utils
import core.sentence as sentence
import core.markovchain as mc
import logging
logger = logging.getLogger(__name__)
# Dialogue making class. Need t... | "Take a sequence of speech parts and make more natural by removing name reptition etc."
for i in range(0, len(seq_map)):
seq_map[i]['speaker_str'] = seq_map[i]['speaker_name'] # default
# Same speaker contiues:
if i > 0 and seq_map[i]['seq_id'] == seq_map[i - 1]['seq... |
<|file_name|>dialogue.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy import cumsum, sum, searchsorted
from numpy.random import rand
import math
import utils
import core.sentence as sentence
import core.markovchain as mc
import logging
logger = logging.getLogger(__name__)
# Dialogue making class. Need t... | """Convert sequence of speeches to a tokens."""
sents = []
for i in range(0, len(seq_map)):
if seq_map[i]['paragraph']:
# text += "\n "
quote_start = '"'
else:
quote_start = ""
if i > len(seq_map) - 2 or seq_... |
<|file_name|>dialogue.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy import cumsum, sum, searchsorted
from numpy.random import rand
import math
import utils
import core.sentence as sentence
import core.markovchain as mc
import logging
logger = logging.getLogger(__name__)
# Dialogue making class. Need t... | """Returns a list of sentences, each being a list of tokens."""
acts = self.make_speech_bits(seeds)
seq_map = self.simplify(acts)
sents = self.report_seq(seq_map)
return(sents) |
<|file_name|>dialogue.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy import cumsum, sum, searchsorted
from numpy.random import rand
import math
import utils
import core.sentence as sentence
import core.markovchain as mc
import logging
logger = logging.getLogger(__name__)
# Dialogue making class. Need t... | import knowledge.names as names
mcW = mc.MarkovChain()
nm = names.NameMaker()
speakers = [nm.random_person() for i in range(1, 4)]
dm = dialogue_maker([n['name'] for n in speakers], [n['pronoun'] for n in speakers], mcW)
dlg = dm.make_dialogue(["dog", "run", "spot"])
print(dlg) |
<|file_name|>dialogue.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy import cumsum, sum, searchsorted
from numpy.random import rand
import math
import utils
import core.sentence as sentence
import core.markovchain as mc
import logging
logger = logging.getLogger(__name__)
# Dialogue making class. Need t... | seq_map[i]['speaker_str'] = ""
seq_map[i]['speech_act'] = ""
seq_map[i]['paragraph'] = False |
<|file_name|>dialogue.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy import cumsum, sum, searchsorted
from numpy.random import rand
import math
import utils
import core.sentence as sentence
import core.markovchain as mc
import logging
logger = logging.getLogger(__name__)
# Dialogue making class. Need t... | if i > 1 and seq_map[i]['seq_id'] == seq_map[i - 2]['seq_id'] \
and seq_map[i]['seq_id'] != seq_map[i - 1]['seq_id']:
seq_map[i]['speaker_str'] = ""
seq_map[i]['speech_act'] = ""
seq_map[i]['paragraph'] = True |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.