prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Sensor to collect the reference daily prices of electricity ('PVPC') in Spain."""
import logging
from random import randint
from typing import Optional
from aiopvpc import PVPCData
from homeassistant import config_entries
from homeassistant.const import CONF_NAME... | ync_setup_entry(
|
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Sensor to collect the reference daily prices of electricity ('PVPC') in Spain."""
import logging
from random import randint
from typing import Optional
from aiopvpc import PVPCData
from homeassistant import config_entries
from homeassistant.const import CONF_NAME... | init__(s |
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Sensor to collect the reference daily prices of electricity ('PVPC') in Spain."""
import logging
from random import randint
from typing import Optional
from aiopvpc import PVPCData
from homeassistant import config_entries
from homeassistant.const import CONF_NAME... | ync_will_remove_from_hass(s |
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Sensor to collect the reference daily prices of electricity ('PVPC') in Spain."""
import logging
from random import randint
from typing import Optional
from aiopvpc import PVPCData
from homeassistant import config_entries
from homeassistant.const import CONF_NAME... | ync_added_to_hass(s |
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Sensor to collect the reference daily prices of electricity ('PVPC') in Spain."""
import logging
from random import randint
from typing import Optional
from aiopvpc import PVPCData
from homeassistant import config_entries
from homeassistant.const import CONF_NAME... | ique_id(s |
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Sensor to collect the reference daily prices of electricity ('PVPC') in Spain."""
import logging
from random import randint
from typing import Optional
from aiopvpc import PVPCData
from homeassistant import config_entries
from homeassistant.const import CONF_NAME... | me(s |
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Sensor to collect the reference daily prices of electricity ('PVPC') in Spain."""
import logging
from random import randint
from typing import Optional
from aiopvpc import PVPCData
from homeassistant import config_entries
from homeassistant.const import CONF_NAME... | ate(s |
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Sensor to collect the reference daily prices of electricity ('PVPC') in Spain."""
import logging
from random import randint
from typing import Optional
from aiopvpc import PVPCData
from homeassistant import config_entries
from homeassistant.const import CONF_NAME... | ailable(s |
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Sensor to collect the reference daily prices of electricity ('PVPC') in Spain."""
import logging
from random import randint
from typing import Optional
from aiopvpc import PVPCData
from homeassistant import config_entries
from homeassistant.const import CONF_NAME... | vice_state_attributes(s |
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Sensor to collect the reference daily prices of electricity ('PVPC') in Spain."""
import logging
from random import randint
from typing import Optional
from aiopvpc import PVPCData
from homeassistant import config_entries
from homeassistant.const import CONF_NAME... | date_current_price(s |
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Sensor to collect the reference daily prices of electricity ('PVPC') in Spain."""
import logging
from random import randint
from typing import Optional
from aiopvpc import PVPCData
from homeassistant import config_entries
from homeassistant.const import CONF_NAME... | ync_update_prices(s |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | """A task that sends a message to a target, and optionally waits for a
reply message. The caller may block until the remote confirms receipt or
the reply message has arrived.
"""
def __init__(self, target, request, wait_for_reply, deadline):
super(SendTask, self).__init__()
self._ta... |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | super(SendTask, self).__init__()
self._target = target
self._request = request
self._deadline = deadline
self._wait_for_reply = wait_for_reply
self._results_queue = moves.queue.Queue() |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | """Wait for the send to complete, and, optionally, a reply message from
the remote. Will raise MessagingTimeout if the send does not complete
or no reply is received within timeout seconds. If the request has
failed for any other reason, a MessagingException is raised.
"""
... |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | """Runs on eventloop thread - sends request."""
if not self._deadline or self._deadline > time.time():
controller.request(self._target, self._request,
self._results_queue, self._wait_for_reply)
else:
LOG.warning(_LW("Send request to %s abort... |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | """A task that creates a subscription to the given target. Messages
arriving from the target are given to the listener.
"""
def __init__(self, target, listener, notifications=False):
"""Create a subscription to the target."""
super(ListenTask, self).__init__()
self._target = tar... |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | """Create a subscription to the target."""
super(ListenTask, self).__init__()
self._target = target
self._listener = listener
self._notifications = notifications |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | """Run on the eventloop thread - subscribes to target. Inbound messages
are queued to the listener's incoming queue.
"""
if self._notifications:
controller.subscribe_notifications(self._target,
self._listener.incoming)
el... |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | """A task that sends 'response' message to 'address'.
"""
def __init__(self, address, response, log_failure):
super(ReplyTask, self).__init__()
self._address = address
self._response = response
self._log_failure = log_failure
self._wakeup = threading.Event()
def ... |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | super(ReplyTask, self).__init__()
self._address = address
self._response = response
self._log_failure = log_failure
self._wakeup = threading.Event() |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | """Wait for the controller to send the message.
"""
self._wakeup.wait() |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | """Run on the eventloop thread - send the response message."""
controller.response(self._address, self._response)
self._wakeup.set() |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | reason = "Timed out waiting for a reply." |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | reason = "Timed out waiting for send to complete." |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | return result.get("response", None) |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | controller.request(self._target, self._request,
self._results_queue, self._wait_for_reply) |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | LOG.warning(_LW("Send request to %s aborted: TTL expired."),
self._target) |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | controller.subscribe_notifications(self._target,
self._listener.incoming) |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | controller.subscribe(self._target, self._listener.incoming) |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | __init__ |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | wait |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | execute |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | __init__ |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | execute |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | __init__ |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | wait |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | execute |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>#__all__ = [ 'search', 'ham_distance', 'lev_distance', 'distance', 'distance_matrix' ]<|fim▁end|> | |
<|file_name|>wechatService.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
"""
# Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today)
# Created Time : Fri Feb 20 21:38:57 2015
# File Name: wechatService.py
# Description:
# :copyright: (c) 2015 by Pegasus Wang.
# :license: MIT, see LICENSE for more ... | @staticmethod
def processRequest(request):
"""process different message types.
|
<|file_name|>wechatService.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
"""
# Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today)
# Created Time : Fri Feb 20 21:38:57 2015
# File Name: wechatService.py
# Description:
# :copyright: (c) 2015 by Pegasus Wang.
# :license: MIT, see LICENSE for more ... | """Auto reply robot service"""
KEY = 'd92d20bc1d8bb3cff585bf746603b2a9'
url = 'http://www.tuling123.com/openapi/api'
@staticmethod
def auto_reply(req_info):
query = {'key': RobotService.KEY, 'info': req_info.encode('utf-8')}
headers = {'Content-type': 'text/html', 'charset': 'utf-8'}... |
<|file_name|>wechatService.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
"""
# Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today)
# Created Time : Fri Feb 20 21:38:57 2015
# File Name: wechatService.py
# Description:
# :copyright: (c) 2015 by Pegasus Wang.
# :license: MIT, see LICENSE for more ... | query = {'key': RobotService.KEY, 'info': req_info.encode('utf-8')}
headers = {'Content-type': 'text/html', 'charset': 'utf-8'}
data = urllib.urlencode(query)
req = urllib2.Request(RobotService.url, data)
f = urllib2.urlopen(req).read()
return json.loads(f).get('text').re... |
<|file_name|>wechatService.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
"""
# Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today)
# Created Time : Fri Feb 20 21:38:57 2015
# File Name: wechatService.py
# Description:
# :copyright: (c) 2015 by Pegasus Wang.
# :license: MIT, see LICENSE for more ... | """process request"""
@staticmethod
def processRequest(request):
"""process different message types.
:param request: post request message
:return: None
"""
requestMap = MessageUtil.parseXml(request)
fromUserName = requestMap.get(u'FromUserName')
toUse... |
<|file_name|>wechatService.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
"""
# Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today)
# Created Time : Fri Feb 20 21:38:57 2015
# File Name: wechatService.py
# Description:
# :copyright: (c) 2015 by Pegasus Wang.
# :license: MIT, see LICENSE for more ... | """process different message types.
:param request: post request message
:return: None
"""
requestMap = MessageUtil.parseXml(request)
fromUserName = requestMap.get(u'FromUserName')
toUserName = requestMap.get(u'ToUserName')
createTime = requestMap.get(u'C... |
<|file_name|>wechatService.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
"""
# Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today)
# Created Time : Fri Feb 20 21:38:57 2015
# File Name: wechatService.py
# Description:
# :copyright: (c) 2015 by Pegasus Wang.
# :license: MIT, see LICENSE for more ... | content = requestMap.get('Content').decode('utf-8') # note: decode first
#respContent = u'您发送的是文本消息:' + content
respContent = RobotService.auto_reply(content)
elif msgT |
<|file_name|>wechatService.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
"""
# Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today)
# Created Time : Fri Feb 20 21:38:57 2015
# File Name: wechatService.py
# Description:
# :copyright: (c) 2015 by Pegasus Wang.
# :license: MIT, see LICENSE for more ... | 送的是图片消息!'
elif msgType == MessageUtil.R |
<|file_name|>wechatService.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
"""
# Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today)
# Created Time : Fri Feb 20 21:38:57 2015
# File Name: wechatService.py
# Description:
# :copyright: (c) 2015 by Pegasus Wang.
# :license: MIT, see LICENSE for more ... | if msgType == MessageUtil.REQ_MESSAGE_TYPE_VIDE |
<|file_name|>wechatService.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
"""
# Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today)
# Created Time : Fri Feb 20 21:38:57 2015
# File Name: wechatService.py
# Description:
# :copyright: (c) 2015 by Pegasus Wang.
# :license: MIT, see LICENSE for more ... | eUtil.REQ_MESSAGE_TYPE_LOCATION:
re |
<|file_name|>wechatService.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
"""
# Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today)
# Created Time : Fri Feb 20 21:38:57 2015
# File Name: wechatService.py
# Description:
# :copyright: (c) 2015 by Pegasus Wang.
# :license: MIT, see LICENSE for more ... | TYPE_LINK:
respContent = u'您发送的是链接消息!'
|
<|file_name|>wechatService.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
"""
# Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today)
# Created Time : Fri Feb 20 21:38:57 2015
# File Name: wechatService.py
# Description:
# :copyright: (c) 2015 by Pegasus Wang.
# :license: MIT, see LICENSE for more ... | entType = requestMap.get(u'Event')
|
<|file_name|>wechatService.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
"""
# Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today)
# Created Time : Fri Feb 20 21:38:57 2015
# File Name: wechatService.py
# Description:
# :copyright: (c) 2015 by Pegasus Wang.
# :license: MIT, see LICENSE for more ... | tent = u'^_^谢谢您的关注,本公众号由王宁宁开发(python2.7+django1.4),如果你有兴趣继续开发,' \
u'可以联系我,就当打发时间了.'
elif eventType == MessageUtil.EVENT_TYPE_UNSUBSCRIBE:
pass
elif eventType == MessageUtil.EVENT_TYPE_SCAN:
# TODO
pass
... |
<|file_name|>wechatService.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
"""
# Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today)
# Created Time : Fri Feb 20 21:38:57 2015
# File Name: wechatService.py
# Description:
# :copyright: (c) 2015 by Pegasus Wang.
# :license: MIT, see LICENSE for more ... | elif eventType == MessageUtil.EVENT_TYPE_UNSUBSCRIBE:
pass
elif eventType == MessageUtil.EVENT_TYPE_SCAN:
# TODO
pass
e |
<|file_name|>wechatService.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
"""
# Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today)
# Created Time : Fri Feb 20 21:38:57 2015
# File Name: wechatService.py
# Description:
# :copyright: (c) 2015 by Pegasus Wang.
# :license: MIT, see LICENSE for more ... | |
<|file_name|>wechatService.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
"""
# Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today)
# Created Time : Fri Feb 20 21:38:57 2015
# File Name: wechatService.py
# Description:
# :copyright: (c) 2015 by Pegasus Wang.
# :license: MIT, see LICENSE for more ... | |
<|file_name|>wechatService.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
"""
# Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today)
# Created Time : Fri Feb 20 21:38:57 2015
# File Name: wechatService.py
# Description:
# :copyright: (c) 2015 by Pegasus Wang.
# :license: MIT, see LICENSE for more ... | |
<|file_name|>wechatService.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
"""
# Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today)
# Created Time : Fri Feb 20 21:38:57 2015
# File Name: wechatService.py
# Description:
# :copyright: (c) 2015 by Pegasus Wang.
# :license: MIT, see LICENSE for more ... | ('Co |
<|file_name|>wechatService.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
"""
# Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today)
# Created Time : Fri Feb 20 21:38:57 2015
# File Name: wechatService.py
# Description:
# :copyright: (c) 2015 by Pegasus Wang.
# :license: MIT, see LICENSE for more ... | auto_reply |
<|file_name|>wechatService.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
"""
# Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today)
# Created Time : Fri Feb 20 21:38:57 2015
# File Name: wechatService.py
# Description:
# :copyright: (c) 2015 by Pegasus Wang.
# :license: MIT, see LICENSE for more ... | processRequest |
<|file_name|>htmls2csvs.py<|end_file_name|><|fim▁begin|># pylint: disable = C0301
from bs4 import BeautifulSoup
from urllib2 import urlopen
import pandas as pd
pos_idx_map = {
'qb': 2,
'rb': 3,
'wr': 4,
'te': 5,
}
def make_url(pos, wk):
ii = pos_idx_map[pos]
fstr = "http://fantasydata.com/nfl... | df.columns = header_clean(df.columns, posn)
dflist.append(df)
return pd.concat(dflist)
|
<|file_name|>htmls2csvs.py<|end_file_name|><|fim▁begin|># pylint: disable = C0301
from bs4 import BeautifulSoup
from urllib2 import urlopen
import pandas as pd
pos_idx_map = {
'qb': 2,
'rb': 3,
'wr': 4,
'te': 5,
}
def make_url(pos, wk):
<|fim_middle|>
def html2df(soup):
table = soup.find('t... | ii = pos_idx_map[pos]
fstr = "http://fantasydata.com/nfl-stats/nfl-fantasy-football-stats.aspx?fs=1&stype=0&sn=1&w=%s&s=&t=0&p=%s&st=FantasyPointsPPR&d=1&ls=&live=false" \
% (wk, ii)
return fstr |
<|file_name|>htmls2csvs.py<|end_file_name|><|fim▁begin|># pylint: disable = C0301
from bs4 import BeautifulSoup
from urllib2 import urlopen
import pandas as pd
pos_idx_map = {
'qb': 2,
'rb': 3,
'wr': 4,
'te': 5,
}
def make_url(pos, wk):
ii = pos_idx_map[pos]
fstr = "http://fantasydata.com/nfl... | table = soup.find('table')
headers = [header.text.lower() for header in table.find_all('th')]
rows = []
for row in table.find_all('tr'):
rows.append([val.text.encode('utf8') for val in row.find_all('td')])
rows = [rr for rr in rows if len(rr) > 0]
df = pd.DataFrame.from_records(rows)
... |
<|file_name|>htmls2csvs.py<|end_file_name|><|fim▁begin|># pylint: disable = C0301
from bs4 import BeautifulSoup
from urllib2 import urlopen
import pandas as pd
pos_idx_map = {
'qb': 2,
'rb': 3,
'wr': 4,
'te': 5,
}
def make_url(pos, wk):
ii = pos_idx_map[pos]
fstr = "http://fantasydata.com/nfl... | dflist = []
for ii in range(1, 17):
fname = '%s%s.html' % (posn, ii)
with open(fname) as f:
df = html2df(BeautifulSoup(f))
df['wk'] = ii
df.columns = header_clean(df.columns, posn)
dflist.append(df)
return pd.concat(dflist) |
<|file_name|>htmls2csvs.py<|end_file_name|><|fim▁begin|># pylint: disable = C0301
from bs4 import BeautifulSoup
from urllib2 import urlopen
import pandas as pd
pos_idx_map = {
'qb': 2,
'rb': 3,
'wr': 4,
'te': 5,
}
def make_url(pos, wk):
ii = pos_idx_map[pos]
fstr = "http://fantasydata.com/nfl... | dflist = []
for ii in range(1, 17):
fname = make_url(posn, ii)
df = html2df(BeautifulSoup(urlopen(fname)))
df['wk'] = ii
df.columns = header_clean(df.columns, posn)
dflist.append(df)
return pd.concat(dflist) |
<|file_name|>htmls2csvs.py<|end_file_name|><|fim▁begin|># pylint: disable = C0301
from bs4 import BeautifulSoup
from urllib2 import urlopen
import pandas as pd
pos_idx_map = {
'qb': 2,
'rb': 3,
'wr': 4,
'te': 5,
}
def make_url(pos, wk):
ii = pos_idx_map[pos]
fstr = "http://fantasydata.com/nfl... | res = []
if posn in pos_header_suffixes:
suffixes = pos_header_suffixes[posn]
seen_dict = {hh: 0 for hh in header}
for hh in header:
if not hh in exclude_cols:
hres = hh + suffixes[seen_dict[hh]]
seen_dict[hh] += 1
res.append(hr... |
<|file_name|>htmls2csvs.py<|end_file_name|><|fim▁begin|># pylint: disable = C0301
from bs4 import BeautifulSoup
from urllib2 import urlopen
import pandas as pd
pos_idx_map = {
'qb': 2,
'rb': 3,
'wr': 4,
'te': 5,
}
def make_url(pos, wk):
ii = pos_idx_map[pos]
fstr = "http://fantasydata.com/nfl... | suffixes = pos_header_suffixes[posn]
seen_dict = {hh: 0 for hh in header}
for hh in header:
if not hh in exclude_cols:
hres = hh + suffixes[seen_dict[hh]]
seen_dict[hh] += 1
res.append(hres)
else:
res.append(... |
<|file_name|>htmls2csvs.py<|end_file_name|><|fim▁begin|># pylint: disable = C0301
from bs4 import BeautifulSoup
from urllib2 import urlopen
import pandas as pd
pos_idx_map = {
'qb': 2,
'rb': 3,
'wr': 4,
'te': 5,
}
def make_url(pos, wk):
ii = pos_idx_map[pos]
fstr = "http://fantasydata.com/nfl... | hres = hh + suffixes[seen_dict[hh]]
seen_dict[hh] += 1
res.append(hres) |
<|file_name|>htmls2csvs.py<|end_file_name|><|fim▁begin|># pylint: disable = C0301
from bs4 import BeautifulSoup
from urllib2 import urlopen
import pandas as pd
pos_idx_map = {
'qb': 2,
'rb': 3,
'wr': 4,
'te': 5,
}
def make_url(pos, wk):
ii = pos_idx_map[pos]
fstr = "http://fantasydata.com/nfl... | res.append(hh) |
<|file_name|>htmls2csvs.py<|end_file_name|><|fim▁begin|># pylint: disable = C0301
from bs4 import BeautifulSoup
from urllib2 import urlopen
import pandas as pd
pos_idx_map = {
'qb': 2,
'rb': 3,
'wr': 4,
'te': 5,
}
def make_url(pos, wk):
ii = pos_idx_map[pos]
fstr = "http://fantasydata.com/nfl... | res = header |
<|file_name|>htmls2csvs.py<|end_file_name|><|fim▁begin|># pylint: disable = C0301
from bs4 import BeautifulSoup
from urllib2 import urlopen
import pandas as pd
pos_idx_map = {
'qb': 2,
'rb': 3,
'wr': 4,
'te': 5,
}
def make_url(pos, wk):
ii = pos_idx_map[pos]
fstr = "http://fantasydata.com/nfl... | data_all = {}
for pp in ['qb', 'wr', 'rb', 'te']:
data_all[pp] = position_html_local(pp)
data_all[pp].to_pickle('%s.pkl' % pp) |
<|file_name|>htmls2csvs.py<|end_file_name|><|fim▁begin|># pylint: disable = C0301
from bs4 import BeautifulSoup
from urllib2 import urlopen
import pandas as pd
pos_idx_map = {
'qb': 2,
'rb': 3,
'wr': 4,
'te': 5,
}
def <|fim_middle|>(pos, wk):
ii = pos_idx_map[pos]
fstr = "http://fantasydata.c... | make_url |
<|file_name|>htmls2csvs.py<|end_file_name|><|fim▁begin|># pylint: disable = C0301
from bs4 import BeautifulSoup
from urllib2 import urlopen
import pandas as pd
pos_idx_map = {
'qb': 2,
'rb': 3,
'wr': 4,
'te': 5,
}
def make_url(pos, wk):
ii = pos_idx_map[pos]
fstr = "http://fantasydata.com/nfl... | html2df |
<|file_name|>htmls2csvs.py<|end_file_name|><|fim▁begin|># pylint: disable = C0301
from bs4 import BeautifulSoup
from urllib2 import urlopen
import pandas as pd
pos_idx_map = {
'qb': 2,
'rb': 3,
'wr': 4,
'te': 5,
}
def make_url(pos, wk):
ii = pos_idx_map[pos]
fstr = "http://fantasydata.com/nfl... | position_html_local |
<|file_name|>htmls2csvs.py<|end_file_name|><|fim▁begin|># pylint: disable = C0301
from bs4 import BeautifulSoup
from urllib2 import urlopen
import pandas as pd
pos_idx_map = {
'qb': 2,
'rb': 3,
'wr': 4,
'te': 5,
}
def make_url(pos, wk):
ii = pos_idx_map[pos]
fstr = "http://fantasydata.com/nfl... | position_html |
<|file_name|>htmls2csvs.py<|end_file_name|><|fim▁begin|># pylint: disable = C0301
from bs4 import BeautifulSoup
from urllib2 import urlopen
import pandas as pd
pos_idx_map = {
'qb': 2,
'rb': 3,
'wr': 4,
'te': 5,
}
def make_url(pos, wk):
ii = pos_idx_map[pos]
fstr = "http://fantasydata.com/nfl... | header_clean |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | def stopTask(self):
if not self.taskStarted:
return
for npc in self.npcs:
|
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | CameraPos = [(0, 203.5, 23.5, 0, 350, 0)]
def __init__(self, effects = []):
ThreeDScene.__init__(self, 'CEOScene', effects)
self.geom = loader.loadModel('phase_12/models/bossbotHQ/BanquetInterior_1')
self.geom.reparentTo(self)
self.ceo = BossCog()
dna = SuitDNA()
... |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | ThreeDScene.__init__(self, 'CEOScene', effects)
self.geom = loader.loadModel('phase_12/models/bossbotHQ/BanquetInterior_1')
self.geom.reparentTo(self)
self.ceo = BossCog()
dna = SuitDNA()
dna.newBossCog('c')
self.ceo.setDNA(dna)
self.ceo.reparentTo(... |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | if self.geom:
self.geom.removeNode()
self.geom = None
if self.ceo:
self.ceo.delete()
self.ceo = None
ThreeDScene.delete(self)
return |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | CameraPos = [(-22, -12.5, 7, 92, -6, 0)]
def __init__(self, effects = []):
ThreeDScene.__init__(self, 'HeadHunterScene', effects)
self.geom = loader.loadModel('phase_12/models/bossbotHQ/BossbotEntranceRoom')
self.geom.reparentTo(self)
self.cog = Suit()
dna = SuitD... |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | ThreeDScene.__init__(self, 'HeadHunterScene', effects)
self.geom = loader.loadModel('phase_12/models/bossbotHQ/BossbotEntranceRoom')
self.geom.reparentTo(self)
self.cog = Suit()
dna = SuitDNA()
dna.newSuit('hh')
self.cog.setDNA(dna)
self.cog.reparen... |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | if self.geom:
self.geom.removeNode()
self.geom = None
if self.cog:
self.cog.delete()
self.cog = None
ThreeDScene.delete(self)
return |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | CameraPos = [(-47.5, 0.5, 3.415, 90, 0, 0)]
ToonPos = {2018: (-59, -1.5, 0.02, 270, 0, 0),
2019: (-59, 0.5, 0.02, 270, 0, 0),
2020: (-59, 2.5, 0.02, 270, 0, 0)}
RandomEmotes = ['wave',
'angry',
'applause',
'cringe',
'confused',
'slip-forward',
'slip-backward... |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | ThreeDScene.__init__(self, 'ScientistScene', effects)
self.geom = loader.loadModel('phase_3.5/models/modules/tt_m_ara_int_toonhall')
self.geom.reparentTo(self)
self.taskStarted = False
self.npcs = []
for id, posHpr in self.ToonPos.iteritems():
npc = NPCT... |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | if self.geom:
self.geom.removeNode()
self.geom = None
for npc in self.npcs:
taskMgr.remove(npc.uniqueName('randomEmote'))
npc.delete()
self.npcs = []
self.taskStarted = False
ThreeDScene.delete(self)
return |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | if self.taskStarted:
return
for i, npc in enumerate(self.npcs):
taskMgr.doMethodLater(0.25 * i, lambda task, npc = npc: self.doRandomEmote(npc, task), npc.uniqueName('randomEmote'))
self.taskStarted = True |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | if not self.taskStarted:
return
for npc in self.npcs:
taskMgr.remove(npc.uniqueName('randomEmote'))
self.taskStarted = False |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | Emote.globalEmote.doEmote(npc, TTEmote.Emotes.index(random.choice(self.RandomEmotes)), 0)
task.delayTime = npc.emoteTrack.getDuration() + 1.0
return task.again |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | self.geom.removeNode()
self.geom = None |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | self.ceo.delete()
self.ceo = None |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | self.geom.removeNode()
self.geom = None |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | self.cog.delete()
self.cog = None |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | self.geom.removeNode()
self.geom = None |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | return |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | return |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | __init__ |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | delete |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | __init__ |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | delete |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | __init__ |
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes
from panda3d.core import Camera
from direct.task.Task import Task
from otp.avatar import Emote
from toontown.television.TVScenes import *
from toontown.televis... | delete |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.