text stringlengths 81 112k |
|---|
Before a command has been sent we wait for an observation of the world and a frame.
def waitForInitialState( self ):
'''Before a command has been sent we wait for an observation of the world and a frame.'''
# wait for a valid observation
world_state = self.agent_host.peekWorldState()
wh... |
After each command has been sent we wait for the observation to change as expected and a frame.
def waitForNextState( self ):
'''After each command has been sent we wait for the observation to change as expected and a frame.'''
# wait for the observation position to have changed
print('Waiting ... |
Take an action from the action_set and set the expected outcome so we can wait for it.
def act( self ):
'''Take an action from the action_set and set the expected outcome so we can wait for it.'''
if self.action_set == 'discrete_absolute':
actions = ['movenorth 1', 'movesouth 1', 'movewest ... |
Simulate a left and right sensor output (from 0 to 1) given the input image.
def processFrame(frame):
"""Simulate a left and right sensor output (from 0 to 1) given the input image."""
# The pixels are grey-scale values from 0-255 - white = 255, black = 0
# We want to turn the image into two values, one fo... |
Build an XML string that contains a square for each city
def getCitiesDrawingXML(points):
''' Build an XML string that contains a square for each city'''
xml = ""
for p in points:
x = str(p.x)
z = str(p.y)
xml += '<DrawBlock x="' + x + '" y="7" z="' + z + '" type="beacon"/>'
... |
Sets a mission running.
Parameters:
mission_spec : MissionSpec instance, specifying the mission.
mission_record_spec : MissionRecordSpec instance, specifying what should be recorded.
role : int, the index of the role this human agent is to play. Zero based.
def runMission( self... |
Create the graphical user interface.
def createGUI( self ):
'''Create the graphical user interface.'''
our_font = "Helvetica 16 bold"
small_font = "Helvetica 9 bold"
self.root_frame = Frame(self.root)
if self.action_space == 'continuous':
desc = "Running continuous-a... |
Called when user presses the 'send' button or presses 'Enter' while the command entry box has focus.
def onSendCommand(self):
'''Called when user presses the 'send' button or presses 'Enter' while the command entry box has focus.'''
self.agent_host.sendCommand(self.command_entry.get())
self.com... |
Called at regular intervals to poll the mouse position to send continuous commands.
def update(self):
'''Called at regular intervals to poll the mouse position to send continuous commands.'''
if self.action_space == 'continuous': # mouse movement only used for continuous action space
if sel... |
Called when a key is pressed when the command entry box has focus.
def onKeyInCommandEntry(self, event):
'''Called when a key is pressed when the command entry box has focus.'''
if event.char == '\r':
self.onSendCommand()
self.canvas.focus_set() |
Called when a key is pressed when the canvas has focus.
def onKeyPressInCanvas(self, event):
'''Called when a key is pressed when the canvas has focus.'''
char_map = { 'w':'move 1', 'a':'strafe -1', 's':'move -1', 'd':'strafe 1', ' ':'jump 1' }
keysym_map = { 'continuous': { 'Left':'turn -1', '... |
Called when a key is released when the command entry box has focus.
def onKeyReleaseInCanvas(self, event):
'''Called when a key is released when the command entry box has focus.'''
char_map = { 'w':'move 0', 'a':'strafe 0', 's':'move 0', 'd':'strafe 0', ' ':'jump 0' }
keysym_map = { 'Left':'tur... |
Build an XML string that contains some randomly positioned goal items
def getItemXML():
''' Build an XML string that contains some randomly positioned goal items'''
xml=""
for item in range(NUM_GOALS):
x = str(random.randint(old_div(-ARENA_WIDTH,2),old_div(ARENA_WIDTH,2)))
z = str(random.ra... |
Return part of the XML string that defines the requested corner
def getCorner(index,top,left,expand=0,y=206):
''' Return part of the XML string that defines the requested corner'''
x = str(-(expand+old_div(ARENA_WIDTH,2))) if left else str(expand+old_div(ARENA_WIDTH,2))
z = str(-(expand+old_div(ARENA_BREAD... |
Build an XML mission string.
def getMissionXML(summary):
''' Build an XML mission string.'''
spawn_end_tag = ' type="mob_spawner" variant="' + MOB_TYPE + '"/>'
return '''<?xml version="1.0" encoding="UTF-8" ?>
<Mission xmlns="http://ProjectMalmo.microsoft.com" xmlns:xsi="http://www.w3.org/2001/XMLSchem... |
Scan through 360 degrees, looking for the best direction in which to take the next step.
def getBestAngle(entities, current_yaw, current_health):
'''Scan through 360 degrees, looking for the best direction in which to take the next step.'''
us = findUs(entities)
scores=[]
# Normalise current yaw:
w... |
Attempt to quit mission if running and kill the client
def restart_minecraft(world_state, agent_host, client_info, message):
""""Attempt to quit mission if running and kill the client"""
if world_state.is_mission_running:
agent_host.sendCommand("quit")
time.sleep(10)
agent_host.killClient(c... |
Initialize a Malmo environment.
xml - the mission xml.
port - the MalmoEnv service's port.
server - the MalmoEnv service address. Default is localhost.
server2 - the MalmoEnv service address for given role if not 0.
port2 - the MalmoEnv service port for given ... |
gym api reset
def reset(self):
"""gym api reset"""
if self.resync_period > 0 and (self.resets + 1) % self.resync_period == 0:
self._exit_resync()
while not self.done:
self.done = self._quit_episode()
if not self.done:
time.sleep(0.1)
... |
gym api step
def step(self, action):
"""gym api step"""
obs = None
reward = None
info = None
turn = True
withturnkey = self.step_options < 2
withinfo = self.step_options == 0 or self.step_options == 2
while not self.done and \
((obs is No... |
gym api close
def close(self):
"""gym api close"""
try:
# Purge last token from head node with <Close> message.
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((self.server, self.port))
self._hello(sock)
comms.send_messa... |
Use carefully to reset the episode count to 0.
def reinit(self):
"""Use carefully to reset the episode count to 0."""
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((self.server, self.port))
self._hello(sock)
comms.send_message(sock, ("<Init>" + self._get... |
Get status from server.
head - Ping the the head node if True.
def status(self, head):
"""Get status from server.
head - Ping the the head node if True.
"""
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
if head:
sock.connect((self.server, self.port... |
Use carefully to cause the Minecraft service to exit (and hopefully restart).
Likely to throw communication errors so wrap in exception handler.
def exit(self):
"""Use carefully to cause the Minecraft service to exit (and hopefully restart).
Likely to throw communication errors so wrap in excep... |
make sure we can ping the head and assigned node.
Possibly after an env.exit()
def resync(self):
"""make sure we can ping the head and assigned node.
Possibly after an env.exit()"""
success = 0
for head in [True, False]:
for _ in range(30):
try:
... |
Exit the current Minecraft and wait for new one to replace it.
def exit_resync(self):
"""Exit the current Minecraft and wait for new one to replace it."""
print("********** exit & resync **********")
try:
if self.client_socket:
self.client_socket.close()
... |
Change q_table to reflect what we have learnt.
def updateQTable( self, reward, current_state ):
"""Change q_table to reflect what we have learnt."""
# retrieve the old action value from the Q-table (indexed by the previous state and the previous action)
old_q = self.q_table[self.prev_s... |
Change q_table to reflect what we have learnt, after reaching a terminal state.
def updateQTableFromTerminatingState( self, reward ):
"""Change q_table to reflect what we have learnt, after reaching a terminal state."""
# retrieve the old action value from the Q-table (indexed by the previous ... |
take 1 action in response to the current world state
def act(self, world_state, agent_host, current_r ):
"""take 1 action in response to the current world state"""
obs_text = world_state.observations[-1].text
obs = json.loads(obs_text) # most recent observation
self.logger.debu... |
run the agent on the world
def run(self, agent_host):
"""run the agent on the world"""
total_reward = 0
self.prev_s = None
self.prev_a = None
is_first_action = True
# main loop:
world_state = agent_host.getWorldState()
while wo... |
Get commands from xml string as a list of (command_type:int, turnbased:boolean, command:string)
def get_commands(self, mission_xml, role):
"""Get commands from xml string as a list of (command_type:int, turnbased:boolean, command:string)"""
mission = etree.fromstring(mission_xml)
return self.ge... |
Get commands from xml file as a list of (command_type:int, turnbased:boolean, command:string)
def get_commands_from_file(self, mission_file, role):
"""Get commands from xml file as a list of (command_type:int, turnbased:boolean, command:string)"""
doc = etree.parse(mission_file)
mission = doc.g... |
Get commands from etree
def get_commands_from_xml(self, mission, role):
"""Get commands from etree"""
handlers = mission.findall(CommandParser.ns + "AgentSection" + "/" + CommandParser.ns + "AgentHandlers")
if len(handlers) <= role:
raise CommandHandlerException("Not enough agents s... |
Get parameterized actions from command list based on command type and verb.
def get_actions(self, commands):
"""Get parameterized actions from command list based on command type and verb."""
actions = []
for type, turn_based, verb in commands:
if len(self.action_filter) != 0 and ver... |
load q table from model_file
def loadModel(self, model_file):
"""load q table from model_file"""
with open(model_file) as f:
self.q_table = json.load(f) |
run the agent on the world
def run(self, agent_host):
"""run the agent on the world"""
total_reward = 0
current_r = 0
tol = 0.01
self.prev_s = None
self.prev_a = None
# wait for a valid observation
world_state = agent_host.peekWorldStat... |
Download Malmo from github and build (by default) the Minecraft Mod.
Example usage: import malmoenv.bootstrap; malmoenv.bootstrap.download()
Args:
branch: optional branch to clone. TODO Default is release version.
build: build the Mod unless build arg is given as False.
installdir: th... |
Set up Minecraft for use with the MalmoEnv gym environment
def setup(build=True, installdir="MalmoPlatform"):
"""Set up Minecraft for use with the MalmoEnv gym environment"""
gradlew = './gradlew'
if os.name == 'nt':
gradlew = 'gradlew.bat'
cwd = os.getcwd()
os.chdir(installdir)
os.ch... |
Launch Minecraft listening for malmoenv connections.
Args:
port: the TCP port to listen on.
installdir: the install dir name. Defaults to MalmoPlatform.
Must be same as given (or defaulted) in download call if used.
replaceable: whether or not to automatically restart Minecraft (def... |
Track through the middle line of the depth data and find the max discontinuities
def processFrame( frame ):
'''Track through the middle line of the depth data and find the max discontinuities'''
global current_yaw_delta_from_depth
y = int(old_div(video_height, 2))
rowstart = y * video_width
v... |
Make sure our coal, if we have any, is in slot 0.
def checkFuelPosition(obs, agent_host):
'''Make sure our coal, if we have any, is in slot 0.'''
# (We need to do this because the furnace crafting commands - cooking the potato and the rabbit -
# take the first available item of fuel in the inventory. If th... |
Build an XML mission string that uses the RewardForCollectingItem mission handler.
def GetMissionXML(summary):
''' Build an XML mission string that uses the RewardForCollectingItem mission handler.'''
positions = buildPositionList(items)
return '''<?xml version="1.0" encoding="UTF-8" ?>
<Miss... |
Re-download all subscriptions and reset the page index
def refresh_content(self, order=None, name=None):
"""
Re-download all subscriptions and reset the page index
"""
# reddit.get_my_subreddits() does not support sorting by order
if order:
self.term.flash()
... |
Store the selected subreddit and return to the subreddit page
def select_subreddit(self):
"""
Store the selected subreddit and return to the subreddit page
"""
name = self.get_selected_item()['name']
self.selected_page = self.open_subreddit_page(name) |
Create a RedditContentObject function mapped to a BaseReddit function.
The BaseReddit classes define the majority of the API's functions. The
first argument for many of these functions is the RedditContentObject that
they operate on. This factory returns functions appropriate to be called on
a RedditCo... |
Deprecate decorated method.
def deprecated(msg=''):
"""Deprecate decorated method."""
@decorator.decorator
def wrap(function, *args, **kwargs):
if not kwargs.pop('disable_warning', False):
warn(msg, DeprecationWarning)
return function(*args, **kwargs)
return wrap |
Truncate the string returned from a function and return the result.
def limit_chars(function, *args, **kwargs):
"""Truncate the string returned from a function and return the result."""
output_chars_limit = args[0].reddit_session.config.output_chars_limit
output_string = function(*args, **kwargs)
if -1... |
Set the _use_oauth keyword argument to True when appropriate.
This is needed because generator functions may be called at anytime, and
PRAW relies on the Reddit._use_oauth value at original call time to know
when to make OAuth requests.
Returned data is not modified.
def oauth_generator(function, *ar... |
Raise client side exception(s) when present in the API response.
Returned data is not modified.
def raise_api_exceptions(function, *args, **kwargs):
"""Raise client side exception(s) when present in the API response.
Returned data is not modified.
"""
try:
return_value = function(*args, ... |
Return a decorator for methods that require captchas.
def require_captcha(function, *args, **kwargs):
"""Return a decorator for methods that require captchas."""
raise_captcha_exception = kwargs.pop('raise_captcha_exception', False)
captcha_id = None
# Get a handle to the reddit session
if hasattr... |
Restrict function access unless the user has the necessary permissions.
Raises one of the following exceptions when appropriate:
* LoginRequired
* LoginOrOAuthRequired
* the scope attribute will provide the necessary scope name
* ModeratorRequired
* ModeratorOrOAuthRequired
... |
Verify that the OAuth functions can be used prior to use.
Returned data is not modified.
def require_oauth(function, *args, **kwargs):
"""Verify that the OAuth functions can be used prior to use.
Returned data is not modified.
"""
if not args[0].has_oauth_app_info:
err_msg = ("The OAuth ... |
Return an iterator that starts and the current index and increments
by the given step.
def iterate(self, index, step, n_cols=70):
"""
Return an iterator that starts and the current index and increments
by the given step.
"""
while True:
if step < 0 and index... |
Flatten a PRAW comment tree while preserving the nested level of each
comment via the `nested_level` attribute.
There are a couple of different ways that the input comment list can be
organized depending on its source:
1. Comments that are returned from the get_submission() api cal... |
Parse through a submission comment and return a dict with data ready to
be displayed through the terminal.
def strip_praw_comment(cls, comment):
"""
Parse through a submission comment and return a dict with data ready to
be displayed through the terminal.
"""
data = {}
... |
Parse through a submission and return a dict with data ready to be
displayed through the terminal.
Definitions:
permalink - URL to the reddit page with submission comments.
url_full - URL that the submission points to.
url - URL that will be displayed on the subreddi... |
Parse through a subscription and return a dict with data ready to be
displayed through the terminal.
def strip_praw_subscription(subscription):
"""
Parse through a subscription and return a dict with data ready to be
displayed through the terminal.
"""
data = {}
... |
Parse through a message and return a dict with data ready to be
displayed through the terminal. Messages can be of either type
praw.objects.Message or praw.object.Comment. The comments returned will
contain special fields unique to messages and can't be parsed as normal
comment objects.
... |
Convert a utc timestamp into a human readable relative-time.
def humanize_timestamp(utc_timestamp, verbose=False):
"""
Convert a utc timestamp into a human readable relative-time.
"""
timedelta = datetime.utcnow() - datetime.utcfromtimestamp(utc_timestamp)
seconds = int(timede... |
Wrap text paragraphs to the given character width while preserving
newlines.
def wrap_text(text, width):
"""
Wrap text paragraphs to the given character width while preserving
newlines.
"""
out = []
for paragraph in text.splitlines():
# Wrap returns a... |
Extract a list of hyperlinks from an HTML document.
def extract_links(html):
"""
Extract a list of hyperlinks from an HTML document.
"""
links = []
soup = BeautifulSoup(html, 'html.parser')
for link in soup.findAll('a'):
href = link.get('href')
if... |
Grab the `i`th submission, with the title field formatted to fit inside
of a window of width `n`
def get(self, index, n_cols=70):
"""
Grab the `i`th submission, with the title field formatted to fit inside
of a window of width `n`
"""
if index < -1:
raise In... |
Toggle the state of the object at the given index.
If it is a comment, pack it into a hidden comment.
If it is a hidden comment, unpack it.
If it is more comments, load the comments.
def toggle(self, index, n_cols=70):
"""
Toggle the state of the object at the given index.
... |
Params:
reddit (praw.Reddit): Instance of the reddit api.
name (text): The name of the desired subreddit, user, multireddit,
etc. In most cases this translates directly from the URL that
reddit itself uses. This is what users will type in the command
... |
Grab the `i`th submission, with the title field formatted to fit inside
of a window of width `n_cols`
def get(self, index, n_cols=70):
"""
Grab the `i`th submission, with the title field formatted to fit inside
of a window of width `n_cols`
"""
if index < 0:
... |
Grab the `i`th object, with the title field formatted to fit
inside of a window of width `n_cols`
def get(self, index, n_cols=70):
"""
Grab the `i`th object, with the title field formatted to fit
inside of a window of width `n_cols`
"""
if index < 0:
raise I... |
Grab the `i`th object, with the title field formatted to fit
inside of a window of width `n_cols`
def get(self, index, n_cols=70):
"""
Grab the `i`th object, with the title field formatted to fit
inside of a window of width `n_cols`
"""
if index < 0:
raise I... |
Pause before making the next HTTP request.
def _delay(self):
"""
Pause before making the next HTTP request.
"""
if self.next_request_timestamp is None:
return
sleep_seconds = self.next_request_timestamp - time.time()
if sleep_seconds <= 0:
return... |
Update the state of the rate limiter based on the response headers:
X-Ratelimit-Used: Approximate number of requests used this period
X-Ratelimit-Remaining: Approximate number of requests left to use
X-Ratelimit-Reset: Approximate number of seconds to end of period
PRAW 5's... |
Clear the cache of timed out results.
def _clear_timeouts(self, cache_timeout):
"""
Clear the cache of timed out results.
"""
for key in list(self.timeouts):
if timer() - self.timeouts[key] > cache_timeout:
del self.timeouts[key]
del self.cac... |
Remove items from cache matching URLs.
Return the number of items removed.
def evict(self, urls):
"""Remove items from cache matching URLs.
Return the number of items removed.
"""
if isinstance(urls, six.text_type):
urls = [urls]
urls = set(normalize_url(ur... |
This is a wrapper function that handles the caching of the request.
See DefaultHandler.with_cache for reference.
def request(self, _cache_key, _cache_ignore, _cache_timeout, **kwargs):
"""
This is a wrapper function that handles the caching of the request.
See DefaultHandler.with_cach... |
This is where we apply rate limiting and make the HTTP request.
def _request(self, request, proxies, timeout, verify, **_):
"""
This is where we apply rate limiting and make the HTTP request.
"""
settings = self.http.merge_environment_settings(
request.url, proxies, False, ... |
Return the user-agent string.
The user-agent string contains PRAW version and platform version info.
def ua_string(praw_info):
"""Return the user-agent string.
The user-agent string contains PRAW version and platform version info.
"""
if os.environ.get('SERVER_SOFTWARE') is n... |
Given a page url and a dict of params, open and return the page.
:param url: the url to grab content from.
:param params: a dictionary containing the GET data to put in the url
:param data: a dictionary containing the extra data to submit
:param files: a dictionary specifying the files ... |
Return an appropriate RedditObject from json_data when possible.
def _json_reddit_objecter(self, json_data):
"""Return an appropriate RedditObject from json_data when possible."""
try:
object_class = self.config.by_kind[json_data['kind']]
except KeyError:
if 'json' in js... |
Evict url(s) from the cache.
:param urls: An iterable containing normalized urls.
:returns: The number of items removed from the cache.
def evict(self, urls):
"""Evict url(s) from the cache.
:param urls: An iterable containing normalized urls.
:returns: The number of items rem... |
A generator method to return reddit content from a URL.
Starts at the initial url, and fetches content using the `after`
JSON data until `limit` entries have been fetched, or the
`place_holder` has been reached.
:param url: the url to start fetching content from
:param params: ... |
Make a HTTP request and return the response.
:param url: the url to grab content from.
:param params: a dictionary containing the GET data to put in the url
:param data: a dictionary containing the extra data to submit
:param retry_on_error: if True retry the request, if it fails, for u... |
Get the JSON processed from a page.
:param url: the url to grab content from.
:param params: a dictionary containing the GET data to put in the url
:param data: a dictionary containing the extra data to submit
:param as_objects: if True return reddit objects else raw json dict.
... |
Return the access information for an OAuth2 authorization grant.
:param code: the code received in the request from the OAuth2 server
:returns: A dictionary with the key/value pairs for ``access_token``,
``refresh_token`` and ``scope``. The ``refresh_token`` value will
be None w... |
Return the URL to send the user to for OAuth2 authorization.
:param state: a unique string of your choice that represents this
individual client
:param scope: the reddit scope to ask permissions for. Multiple scopes
can be enabled by passing in a container of strings.
:p... |
Return updated access information for an OAuth2 authorization grant.
:param refresh_token: the refresh token used to obtain the updated
information
:returns: A dictionary with the key/value pairs for access_token,
refresh_token and scope. The refresh_token value will be done whe... |
Set the app information to use with OAuth2.
This function need only be called if your praw.ini site configuration
does not already contain the necessary information.
Go to https://www.reddit.com/prefs/apps/ to discover the appropriate
values for your application.
:param client... |
Register a new user.
:returns: The json response from the server.
def create_redditor(self, user_name, password, email=''):
"""Register a new user.
:returns: The json response from the server.
"""
data = {'email': email,
'passwd': password,
'pa... |
Return a get_content generator for the default subreddits.
The additional parameters are passed directly into
:meth:`.get_content`. Note: the `url` parameter cannot be altered.
def default_subreddits(self, *args, **kwargs):
"""Return a get_content generator for the default subreddits.
... |
Return a get_content generator for comments in the given subreddit.
:param gilded_only: If True only return gilded comments.
The additional parameters are passed directly into
:meth:`.get_content`. Note: the `url` parameter cannot be altered.
def get_comments(self, subreddit, gilded_only=Fals... |
Return a get_content generator for controversial submissions.
Corresponds to submissions provided by
``https://www.reddit.com/controversial/`` for the session.
The additional parameters are passed directly into
:meth:`.get_content`. Note: the `url` parameter cannot be altered.
def get... |
Return a get_content generator for submissions by domain.
Corresponds to the submissions provided by
``https://www.reddit.com/domain/{domain}``.
:param domain: The domain to generate a submission listing for.
:param sort: When provided must be one of 'hot', 'new', 'rising',
... |
Return the flair for a user on the given subreddit.
:param subreddit: Can be either a Subreddit object or the name of a
subreddit.
:param redditor: Can be either a Redditor object or the name of a
redditor.
:returns: None if the user doesn't exist, otherwise a dictionary... |
Return a get_content generator for the front page submissions.
Corresponds to the submissions provided by ``https://www.reddit.com/``
for the session.
The additional parameters are passed directly into
:meth:`.get_content`. Note: the `url` parameter cannot be altered.
def get_front_pa... |
Look up existing items by thing_id (fullname) or url.
:param url: A url to lookup.
:param thing_id: A single thing_id, or a list of thing_ids. A thing_id
can be any one of Comment (``t1_``), Link (``t3_``), or Subreddit
(``t5_``) to lookup by fullname.
:returns: When a s... |
Return the list of moderators for the given subreddit.
def get_moderators(self, subreddit, **kwargs):
"""Return the list of moderators for the given subreddit."""
url = self.config['moderators'].format(
subreddit=six.text_type(subreddit))
return self.request_json(url, **kwargs) |
Return a get_content generator for new submissions.
Corresponds to the submissions provided by
``https://www.reddit.com/new/`` for the session.
The additional parameters are passed directly into
:meth:`.get_content`. Note: the `url` parameter cannot be altered.
def get_new(self, *args... |
Return a get_content generator for the newest subreddits.
The additional parameters are passed directly into
:meth:`.get_content`. Note: the `url` parameter cannot be altered.
def get_new_subreddits(self, *args, **kwargs):
"""Return a get_content generator for the newest subreddits.
T... |
Return a get_content generator for the most active subreddits.
The additional parameters are passed directly into
:meth:`.get_content`. Note: the `url` parameter cannot be altered.
def get_popular_subreddits(self, *args, **kwargs):
"""Return a get_content generator for the most active subreddi... |
Return a random Subreddit object.
:param nsfw: When true, return a random NSFW Subreddit object. Calling
in this manner will set the 'over18' cookie for the duration of the
PRAW session.
def get_random_subreddit(self, nsfw=False):
"""Return a random Subreddit object.
:... |
Return a random Submission object.
:param subreddit: Limit the submission to the specified
subreddit(s). Default: all
def get_random_submission(self, subreddit='all'):
"""Return a random Submission object.
:param subreddit: Limit the submission to the specified
subredd... |
Return a Redditor instance for the user_name specified.
The additional parameters are passed directly into the
:class:`.Redditor` constructor.
def get_redditor(self, user_name, *args, **kwargs):
"""Return a Redditor instance for the user_name specified.
The additional parameters are p... |
Return a get_content generator for rising submissions.
Corresponds to the submissions provided by
``https://www.reddit.com/rising/`` for the session.
The additional parameters are passed directly into
:meth:`.get_content`. Note: the `url` parameter cannot be altered.
def get_rising(se... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.