repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
openai/universe
universe/rewarder/env_status.py
EnvStatus.set_env_info
def set_env_info(self, env_state=None, env_id=None, episode_id=None, bump_past=None, fps=None): """Atomically set the environment state tracking variables. """ with self.cv: if env_id is None: env_id = self._env_id if env_state is None: env...
python
def set_env_info(self, env_state=None, env_id=None, episode_id=None, bump_past=None, fps=None): """Atomically set the environment state tracking variables. """ with self.cv: if env_id is None: env_id = self._env_id if env_state is None: env...
[ "def", "set_env_info", "(", "self", ",", "env_state", "=", "None", ",", "env_id", "=", "None", ",", "episode_id", "=", "None", ",", "bump_past", "=", "None", ",", "fps", "=", "None", ")", ":", "with", "self", ".", "cv", ":", "if", "env_id", "is", "...
Atomically set the environment state tracking variables.
[ "Atomically", "set", "the", "environment", "state", "tracking", "variables", "." ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/rewarder/env_status.py#L47-L83
train
Set the environment state tracking variables.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/remotes/compose/container.py
Container.from_ps
def from_ps(cls, client, dictionary, **kwargs): """ Construct a container object from the output of GET /containers/json. """ name = get_container_name(dictionary) if name is None: return None new_dictionary = { 'Id': dictionary['Id'], ...
python
def from_ps(cls, client, dictionary, **kwargs): """ Construct a container object from the output of GET /containers/json. """ name = get_container_name(dictionary) if name is None: return None new_dictionary = { 'Id': dictionary['Id'], ...
[ "def", "from_ps", "(", "cls", ",", "client", ",", "dictionary", ",", "*", "*", "kwargs", ")", ":", "name", "=", "get_container_name", "(", "dictionary", ")", "if", "name", "is", "None", ":", "return", "None", "new_dictionary", "=", "{", "'Id'", ":", "d...
Construct a container object from the output of GET /containers/json.
[ "Construct", "a", "container", "object", "from", "the", "output", "of", "GET", "/", "containers", "/", "json", "." ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/remotes/compose/container.py#L27-L40
train
Construct a container object from the dictionary returned by the GET / containers API.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/remotes/compose/container.py
Container.attach_log_stream
def attach_log_stream(self): """A log stream can only be attached if the container uses a json-file log driver. """ if self.has_api_logs: self.log_stream = self.attach(stdout=True, stderr=True, stream=True)
python
def attach_log_stream(self): """A log stream can only be attached if the container uses a json-file log driver. """ if self.has_api_logs: self.log_stream = self.attach(stdout=True, stderr=True, stream=True)
[ "def", "attach_log_stream", "(", "self", ")", ":", "if", "self", ".", "has_api_logs", ":", "self", ".", "log_stream", "=", "self", ".", "attach", "(", "stdout", "=", "True", ",", "stderr", "=", "True", ",", "stream", "=", "True", ")" ]
A log stream can only be attached if the container uses a json-file log driver.
[ "A", "log", "stream", "can", "only", "be", "attached", "if", "the", "container", "uses", "a", "json", "-", "file", "log", "driver", "." ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/remotes/compose/container.py#L170-L175
train
Attach a log stream to the container.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/remotes/compose/container.py
Container.get
def get(self, key): """Return a value from the container or None if the value is not set. :param key: a string using dotted notation for nested dictionary lookups """ self.inspect_if_not_inspected() def get_value(dictionary, key): return (diction...
python
def get(self, key): """Return a value from the container or None if the value is not set. :param key: a string using dotted notation for nested dictionary lookups """ self.inspect_if_not_inspected() def get_value(dictionary, key): return (diction...
[ "def", "get", "(", "self", ",", "key", ")", ":", "self", ".", "inspect_if_not_inspected", "(", ")", "def", "get_value", "(", "dictionary", ",", "key", ")", ":", "return", "(", "dictionary", "or", "{", "}", ")", ".", "get", "(", "key", ")", "return", ...
Return a value from the container or None if the value is not set. :param key: a string using dotted notation for nested dictionary lookups
[ "Return", "a", "value", "from", "the", "container", "or", "None", "if", "the", "value", "is", "not", "set", "." ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/remotes/compose/container.py#L177-L188
train
Get a value from the container or None if the value is not set.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/remotes/compose/container.py
Container.rename_to_tmp_name
def rename_to_tmp_name(self): """Rename the container to a hopefully unique temporary container name by prepending the short id. """ self.client.rename( self.id, '%s_%s' % (self.short_id, self.name) )
python
def rename_to_tmp_name(self): """Rename the container to a hopefully unique temporary container name by prepending the short id. """ self.client.rename( self.id, '%s_%s' % (self.short_id, self.name) )
[ "def", "rename_to_tmp_name", "(", "self", ")", ":", "self", ".", "client", ".", "rename", "(", "self", ".", "id", ",", "'%s_%s'", "%", "(", "self", ".", "short_id", ",", "self", ".", "name", ")", ")" ]
Rename the container to a hopefully unique temporary container name by prepending the short id.
[ "Rename", "the", "container", "to", "a", "hopefully", "unique", "temporary", "container", "name", "by", "prepending", "the", "short", "id", "." ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/remotes/compose/container.py#L227-L234
train
Rename the container to a hopefully unique temporary container name by prepending the short id.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/spaces/vnc_event.py
KeyEvent.build
def build(cls, keys, down=None): """Build a key combination, such as: ctrl-t """ codes = [] for key in keys.split('-'): key = keycode(key) codes.append(key) events = [] if down is None or down: for code in codes: ...
python
def build(cls, keys, down=None): """Build a key combination, such as: ctrl-t """ codes = [] for key in keys.split('-'): key = keycode(key) codes.append(key) events = [] if down is None or down: for code in codes: ...
[ "def", "build", "(", "cls", ",", "keys", ",", "down", "=", "None", ")", ":", "codes", "=", "[", "]", "for", "key", "in", "keys", ".", "split", "(", "'-'", ")", ":", "key", "=", "keycode", "(", "key", ")", "codes", ".", "append", "(", "key", "...
Build a key combination, such as: ctrl-t
[ "Build", "a", "key", "combination", "such", "as", ":" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/spaces/vnc_event.py#L24-L42
train
Build a key combination such as ctrl - t .
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/runtimes/registration.py
Registry.runtime_spec
def runtime_spec(self, id): """ id is a string describing the runtime, e.g 'flashgames Returns a configured DockerRuntime object """ try: return self.runtimes[id] except KeyError: raise UnregisteredRuntime('No registered runtime with name: {}'.for...
python
def runtime_spec(self, id): """ id is a string describing the runtime, e.g 'flashgames Returns a configured DockerRuntime object """ try: return self.runtimes[id] except KeyError: raise UnregisteredRuntime('No registered runtime with name: {}'.for...
[ "def", "runtime_spec", "(", "self", ",", "id", ")", ":", "try", ":", "return", "self", ".", "runtimes", "[", "id", "]", "except", "KeyError", ":", "raise", "UnregisteredRuntime", "(", "'No registered runtime with name: {}'", ".", "format", "(", "id", ")", ")...
id is a string describing the runtime, e.g 'flashgames Returns a configured DockerRuntime object
[ "id", "is", "a", "string", "describing", "the", "runtime", "e", ".", "g", "flashgames" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/runtimes/registration.py#L100-L109
train
Returns a DockerRuntime object describing the specified runtime
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/rewarder/rewarder_client.py
RewarderClient._manual_recv
def _manual_recv(self, method, body, headers={}): """Used in the tests""" headers.setdefault('sent_at', time.time()) return self.recv(self._make_context(), {'method': method, 'body': body, 'headers': headers})
python
def _manual_recv(self, method, body, headers={}): """Used in the tests""" headers.setdefault('sent_at', time.time()) return self.recv(self._make_context(), {'method': method, 'body': body, 'headers': headers})
[ "def", "_manual_recv", "(", "self", ",", "method", ",", "body", ",", "headers", "=", "{", "}", ")", ":", "headers", ".", "setdefault", "(", "'sent_at'", ",", "time", ".", "time", "(", ")", ")", "return", "self", ".", "recv", "(", "self", ".", "_mak...
Used in the tests
[ "Used", "in", "the", "tests" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/rewarder/rewarder_client.py#L100-L103
train
Used in the tests
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/utils/__init__.py
exit_on_signal
def exit_on_signal(): """ Install a signal handler for HUP, INT, and TERM to call exit, allowing clean shutdown. When running a universe environment, it's important to shut down the container when the agent dies so you should either call this or otherwise arrange to exit on signals. """ def shut...
python
def exit_on_signal(): """ Install a signal handler for HUP, INT, and TERM to call exit, allowing clean shutdown. When running a universe environment, it's important to shut down the container when the agent dies so you should either call this or otherwise arrange to exit on signals. """ def shut...
[ "def", "exit_on_signal", "(", ")", ":", "def", "shutdown", "(", "signal", ",", "frame", ")", ":", "logger", ".", "warn", "(", "'Received signal %s: exiting'", ",", "signal", ")", "sys", ".", "exit", "(", "128", "+", "signal", ")", "signal", ".", "signal"...
Install a signal handler for HUP, INT, and TERM to call exit, allowing clean shutdown. When running a universe environment, it's important to shut down the container when the agent dies so you should either call this or otherwise arrange to exit on signals.
[ "Install", "a", "signal", "handler", "for", "HUP", "INT", "and", "TERM", "to", "call", "exit", "allowing", "clean", "shutdown", ".", "When", "running", "a", "universe", "environment", "it", "s", "important", "to", "shut", "down", "the", "container", "when", ...
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/utils/__init__.py#L198-L209
train
Install a signal handler for HUP INT and TERM to call exit allowing clean shutdown.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/vncdriver/fbs_reader.py
FBSReader.read_safe
def read_safe(self, size=None): """ We currently close our fbs files by killing them, so sometimes they end up with bad data at the end. Close our reader if we expect `size` bytes and get fewer. This is a hack and should be removed when we cleanly close our connections i...
python
def read_safe(self, size=None): """ We currently close our fbs files by killing them, so sometimes they end up with bad data at the end. Close our reader if we expect `size` bytes and get fewer. This is a hack and should be removed when we cleanly close our connections i...
[ "def", "read_safe", "(", "self", ",", "size", "=", "None", ")", ":", "bytes", "=", "self", ".", "file", ".", "read", "(", "size", ")", "if", "len", "(", "bytes", ")", "!=", "size", ":", "# We unexpectedly got to the end of the file", "self", ".", "close"...
We currently close our fbs files by killing them, so sometimes they end up with bad data at the end. Close our reader if we expect `size` bytes and get fewer. This is a hack and should be removed when we cleanly close our connections in fbs_writer. https://github.com/openai/uni...
[ "We", "currently", "close", "our", "fbs", "files", "by", "killing", "them", "so", "sometimes", "they", "end", "up", "with", "bad", "data", "at", "the", "end", ".", "Close", "our", "reader", "if", "we", "expect", "size", "bytes", "and", "get", "fewer", ...
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/vncdriver/fbs_reader.py#L27-L43
train
Read size bytes from the file and return them as a string.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/remotes/allocator_remote.py
AllocatorManager.pop
def pop(self, n=None): """Call from main thread. Returns the list of newly-available (handle, env) pairs.""" self.error_buffer.check() envs = [] if n is None: while True: try: envs += self.ready.get(block=False) except que...
python
def pop(self, n=None): """Call from main thread. Returns the list of newly-available (handle, env) pairs.""" self.error_buffer.check() envs = [] if n is None: while True: try: envs += self.ready.get(block=False) except que...
[ "def", "pop", "(", "self", ",", "n", "=", "None", ")", ":", "self", ".", "error_buffer", ".", "check", "(", ")", "envs", "=", "[", "]", "if", "n", "is", "None", ":", "while", "True", ":", "try", ":", "envs", "+=", "self", ".", "ready", ".", "...
Call from main thread. Returns the list of newly-available (handle, env) pairs.
[ "Call", "from", "main", "thread", ".", "Returns", "the", "list", "of", "newly", "-", "available", "(", "handle", "env", ")", "pairs", "." ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/remotes/allocator_remote.py#L136-L164
train
Call from main thread. Returns the list of newly - available ( handle env ) pairs.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/remotes/allocator_remote.py
AllocatorManager.allocate
def allocate(self, handles, initial=False, params={}): """Call from main thread. Initiate a request for more environments""" assert all(re.search('^\d+$', h) for h in handles), "All handles must be numbers: {}".format(handles) self.requests.put(('allocate', (handles, initial, params)))
python
def allocate(self, handles, initial=False, params={}): """Call from main thread. Initiate a request for more environments""" assert all(re.search('^\d+$', h) for h in handles), "All handles must be numbers: {}".format(handles) self.requests.put(('allocate', (handles, initial, params)))
[ "def", "allocate", "(", "self", ",", "handles", ",", "initial", "=", "False", ",", "params", "=", "{", "}", ")", ":", "assert", "all", "(", "re", ".", "search", "(", "'^\\d+$'", ",", "h", ")", "for", "h", "in", "handles", ")", ",", "\"All handles m...
Call from main thread. Initiate a request for more environments
[ "Call", "from", "main", "thread", ".", "Initiate", "a", "request", "for", "more", "environments" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/remotes/allocator_remote.py#L166-L169
train
Initiate a request for more environments
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/envs/vnc_env.py
VNCEnv.configure
def configure(self, remotes=None, client_id=None, start_timeout=None, docker_image=None, ignore_clock_skew=False, disable_action_probes=False, vnc_driver=None, vnc_kwargs=None, rewarder_driver=None, replace_on_cr...
python
def configure(self, remotes=None, client_id=None, start_timeout=None, docker_image=None, ignore_clock_skew=False, disable_action_probes=False, vnc_driver=None, vnc_kwargs=None, rewarder_driver=None, replace_on_cr...
[ "def", "configure", "(", "self", ",", "remotes", "=", "None", ",", "client_id", "=", "None", ",", "start_timeout", "=", "None", ",", "docker_image", "=", "None", ",", "ignore_clock_skew", "=", "False", ",", "disable_action_probes", "=", "False", ",", "vnc_dr...
Universe method to configure the environment. Args: ignore_clock_skew (bool): Assume remotes are on the same machine as us, for the purposes of diagnostics measurement. If true, we skip measuring the clock skew over the network, and skip generating diagnostics wh...
[ "Universe", "method", "to", "configure", "the", "environment", "." ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/envs/vnc_env.py#L138-L255
train
Configure the environment.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
example/system-diagnostics/system_diagnostics_logger.py
DiagnosticsLogger.cpu_times
def cpu_times(self): ''' return {pid: {'user': 0.0, 'sys': 0.0}}, chrome_reset ''' chrome_procs = self.get_chrome_procs() new_pids = {p.pid for p in chrome_procs} old_pids = {pid for pid in self.last_cpu_times} try: cpu_times = {p.pid: p.cpu_times() for p in chrome_pr...
python
def cpu_times(self): ''' return {pid: {'user': 0.0, 'sys': 0.0}}, chrome_reset ''' chrome_procs = self.get_chrome_procs() new_pids = {p.pid for p in chrome_procs} old_pids = {pid for pid in self.last_cpu_times} try: cpu_times = {p.pid: p.cpu_times() for p in chrome_pr...
[ "def", "cpu_times", "(", "self", ")", ":", "chrome_procs", "=", "self", ".", "get_chrome_procs", "(", ")", "new_pids", "=", "{", "p", ".", "pid", "for", "p", "in", "chrome_procs", "}", "old_pids", "=", "{", "pid", "for", "pid", "in", "self", ".", "la...
return {pid: {'user': 0.0, 'sys': 0.0}}, chrome_reset
[ "return", "{", "pid", ":", "{", "user", ":", "0", ".", "0", "sys", ":", "0", ".", "0", "}}", "chrome_reset" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/example/system-diagnostics/system_diagnostics_logger.py#L32-L53
train
Return the cpu times of all processes in the current process.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/rewarder/merge.py
merge_infos
def merge_infos(info1, info2): """We often need to aggregate together multiple infos. Most keys can just be clobbered by the new info, but e.g. any keys which contain counts should be added. The merge schema is indicated by the key namespace. Namespaces: - stats.timers: Timing - stats.gaug...
python
def merge_infos(info1, info2): """We often need to aggregate together multiple infos. Most keys can just be clobbered by the new info, but e.g. any keys which contain counts should be added. The merge schema is indicated by the key namespace. Namespaces: - stats.timers: Timing - stats.gaug...
[ "def", "merge_infos", "(", "info1", ",", "info2", ")", ":", "for", "key", ",", "value", "in", "six", ".", "iteritems", "(", "info2", ")", ":", "if", "key", "in", "info1", "and", "key", ".", "startswith", "(", "'stats'", ")", ":", "if", "key", ".", ...
We often need to aggregate together multiple infos. Most keys can just be clobbered by the new info, but e.g. any keys which contain counts should be added. The merge schema is indicated by the key namespace. Namespaces: - stats.timers: Timing - stats.gauges: Gauge values - stats.*: Counts...
[ "We", "often", "need", "to", "aggregate", "together", "multiple", "infos", ".", "Most", "keys", "can", "just", "be", "clobbered", "by", "the", "new", "info", "but", "e", ".", "g", ".", "any", "keys", "which", "contain", "counts", "should", "be", "added",...
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/rewarder/merge.py#L4-L28
train
Merge two info dicts together.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/rewarder/merge.py
_merge_observation
def _merge_observation(accum_observation, observation): """ Old visual observation is discarded, because it is outdated frame. Text observations are merged, because they are messages sent from the rewarder. """ if observation is None: # We're currently masking. So accum_observation probably ...
python
def _merge_observation(accum_observation, observation): """ Old visual observation is discarded, because it is outdated frame. Text observations are merged, because they are messages sent from the rewarder. """ if observation is None: # We're currently masking. So accum_observation probably ...
[ "def", "_merge_observation", "(", "accum_observation", ",", "observation", ")", ":", "if", "observation", "is", "None", ":", "# We're currently masking. So accum_observation probably", "# belongs to the previous episode. We may lose a \"text\"", "# observation from the previous episode...
Old visual observation is discarded, because it is outdated frame. Text observations are merged, because they are messages sent from the rewarder.
[ "Old", "visual", "observation", "is", "discarded", "because", "it", "is", "outdated", "frame", ".", "Text", "observations", "are", "merged", "because", "they", "are", "messages", "sent", "from", "the", "rewarder", "." ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/rewarder/merge.py#L42-L58
train
Merge an observation into a single element.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/rewarder/reward_proxy_server.py
RewardProxyServer.begin_recording
def begin_recording(self): """ Open the file and write the metadata header to describe this recording. Called after we establish an end-to-end connection This uses Version 1 of our protocol Version 0 can be seen here: https://github.com/openai/universe/blob/f85a7779c3847fa86ec7bb513a1da...
python
def begin_recording(self): """ Open the file and write the metadata header to describe this recording. Called after we establish an end-to-end connection This uses Version 1 of our protocol Version 0 can be seen here: https://github.com/openai/universe/blob/f85a7779c3847fa86ec7bb513a1da...
[ "def", "begin_recording", "(", "self", ")", ":", "logger", ".", "info", "(", "\"[RewardProxyServer] [%d] Starting recording\"", ",", "self", ".", "id", ")", "if", "self", ".", "_closed", ":", "logger", ".", "error", "(", "\"[RewardProxyServer] [%d] Attempted to star...
Open the file and write the metadata header to describe this recording. Called after we establish an end-to-end connection This uses Version 1 of our protocol Version 0 can be seen here: https://github.com/openai/universe/blob/f85a7779c3847fa86ec7bb513a1da0d3158dda78/bin/recording_agent.py
[ "Open", "the", "file", "and", "write", "the", "metadata", "header", "to", "describe", "this", "recording", ".", "Called", "after", "we", "establish", "an", "end", "-", "to", "-", "end", "connection", "This", "uses", "Version", "1", "of", "our", "protocol" ...
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/rewarder/reward_proxy_server.py#L83-L117
train
Begin recording the rewards.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/rewarder/reward_proxy_server.py
RewardProxyServer.record_message
def record_message(self, msg, from_rewarder): """Record a message to our rewards.demo file if it is has been opened""" if self.file: # Include an authoritative timestamp (because the `sent_at` from the server is likely to be different timestamped_message = { 'time...
python
def record_message(self, msg, from_rewarder): """Record a message to our rewards.demo file if it is has been opened""" if self.file: # Include an authoritative timestamp (because the `sent_at` from the server is likely to be different timestamped_message = { 'time...
[ "def", "record_message", "(", "self", ",", "msg", ",", "from_rewarder", ")", ":", "if", "self", ".", "file", ":", "# Include an authoritative timestamp (because the `sent_at` from the server is likely to be different", "timestamped_message", "=", "{", "'timestamp'", ":", "t...
Record a message to our rewards.demo file if it is has been opened
[ "Record", "a", "message", "to", "our", "rewards", ".", "demo", "file", "if", "it", "is", "has", "been", "opened" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/rewarder/reward_proxy_server.py#L192-L203
train
Record a message to our rewards. demo file if it is opened
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/utils/display.py
display_timestamps_pair_compact
def display_timestamps_pair_compact(time_m_2): """Takes a list of the following form: [(a1, b1), (a2, b2), ...] and returns a string a_mean-b_mean, flooring out at 0. """ if len(time_m_2) == 0: return '(empty)' time_m_2 = np.array(time_m_2) low = time_m_2[:, 0].mean() high = time_m...
python
def display_timestamps_pair_compact(time_m_2): """Takes a list of the following form: [(a1, b1), (a2, b2), ...] and returns a string a_mean-b_mean, flooring out at 0. """ if len(time_m_2) == 0: return '(empty)' time_m_2 = np.array(time_m_2) low = time_m_2[:, 0].mean() high = time_m...
[ "def", "display_timestamps_pair_compact", "(", "time_m_2", ")", ":", "if", "len", "(", "time_m_2", ")", "==", "0", ":", "return", "'(empty)'", "time_m_2", "=", "np", ".", "array", "(", "time_m_2", ")", "low", "=", "time_m_2", "[", ":", ",", "0", "]", "...
Takes a list of the following form: [(a1, b1), (a2, b2), ...] and returns a string a_mean-b_mean, flooring out at 0.
[ "Takes", "a", "list", "of", "the", "following", "form", ":", "[", "(", "a1", "b1", ")", "(", "a2", "b2", ")", "...", "]", "and", "returns", "a", "string", "a_mean", "-", "b_mean", "flooring", "out", "at", "0", "." ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/utils/display.py#L41-L59
train
Takes a list of time_m_2 and returns a string a_mean - b_mean flooring out at 0.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/utils/display.py
display_timestamps_pair
def display_timestamps_pair(time_m_2): """Takes a list of the following form: [(a1, b1), (a2, b2), ...] and returns a string (a_mean+/-a_error, b_mean+/-b_error). """ if len(time_m_2) == 0: return '(empty)' time_m_2 = np.array(time_m_2) return '({}, {})'.format( display_timestam...
python
def display_timestamps_pair(time_m_2): """Takes a list of the following form: [(a1, b1), (a2, b2), ...] and returns a string (a_mean+/-a_error, b_mean+/-b_error). """ if len(time_m_2) == 0: return '(empty)' time_m_2 = np.array(time_m_2) return '({}, {})'.format( display_timestam...
[ "def", "display_timestamps_pair", "(", "time_m_2", ")", ":", "if", "len", "(", "time_m_2", ")", "==", "0", ":", "return", "'(empty)'", "time_m_2", "=", "np", ".", "array", "(", "time_m_2", ")", "return", "'({}, {})'", ".", "format", "(", "display_timestamps"...
Takes a list of the following form: [(a1, b1), (a2, b2), ...] and returns a string (a_mean+/-a_error, b_mean+/-b_error).
[ "Takes", "a", "list", "of", "the", "following", "form", ":", "[", "(", "a1", "b1", ")", "(", "a2", "b2", ")", "...", "]", "and", "returns", "a", "string", "(", "a_mean", "+", "/", "-", "a_error", "b_mean", "+", "/", "-", "b_error", ")", "." ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/utils/display.py#L61-L72
train
Takes a list of time_m_2 and returns a string that contains the timestamps of the two times.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/envs/vnc_core_env/key.py
modifiers_string
def modifiers_string(modifiers): '''Return a string describing a set of modifiers. Example:: >>> modifiers_string(MOD_SHIFT | MOD_CTRL) 'MOD_SHIFT|MOD_CTRL' :Parameters: `modifiers` : int Bitwise combination of modifier constants. :rtype: str ''' mod_names...
python
def modifiers_string(modifiers): '''Return a string describing a set of modifiers. Example:: >>> modifiers_string(MOD_SHIFT | MOD_CTRL) 'MOD_SHIFT|MOD_CTRL' :Parameters: `modifiers` : int Bitwise combination of modifier constants. :rtype: str ''' mod_names...
[ "def", "modifiers_string", "(", "modifiers", ")", ":", "mod_names", "=", "[", "]", "if", "modifiers", "&", "MOD_SHIFT", ":", "mod_names", ".", "append", "(", "'MOD_SHIFT'", ")", "if", "modifiers", "&", "MOD_CTRL", ":", "mod_names", ".", "append", "(", "'MO...
Return a string describing a set of modifiers. Example:: >>> modifiers_string(MOD_SHIFT | MOD_CTRL) 'MOD_SHIFT|MOD_CTRL' :Parameters: `modifiers` : int Bitwise combination of modifier constants. :rtype: str
[ "Return", "a", "string", "describing", "a", "set", "of", "modifiers", "." ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/envs/vnc_core_env/key.py#L93-L126
train
Return a string describing a set of modifiers.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/envs/diagnostics.py
DiagnosticsInstance.add_metadata
def add_metadata(self, observation, info, available_at=None): """Extract metadata from a pixel observation and add it to the info """ observation = observation['vision'] if observation is None: return if self.network is not None and not self.network.active(): return ...
python
def add_metadata(self, observation, info, available_at=None): """Extract metadata from a pixel observation and add it to the info """ observation = observation['vision'] if observation is None: return if self.network is not None and not self.network.active(): return ...
[ "def", "add_metadata", "(", "self", ",", "observation", ",", "info", ",", "available_at", "=", "None", ")", ":", "observation", "=", "observation", "[", "'vision'", "]", "if", "observation", "is", "None", ":", "return", "if", "self", ".", "network", "is", ...
Extract metadata from a pixel observation and add it to the info
[ "Extract", "metadata", "from", "a", "pixel", "observation", "and", "add", "it", "to", "the", "info" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/envs/diagnostics.py#L343-L450
train
Extract metadata from a pixel observation and add it to the info dictionary.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/pyprofile/__init__.py
Profile._print_if_needed
def _print_if_needed(self): """Assumes you hold the lock""" if self._in_txn or self.print_frequency is None: return elif self.last_export is not None and \ self.last_export + self.print_frequency > time.time(): return self.export()
python
def _print_if_needed(self): """Assumes you hold the lock""" if self._in_txn or self.print_frequency is None: return elif self.last_export is not None and \ self.last_export + self.print_frequency > time.time(): return self.export()
[ "def", "_print_if_needed", "(", "self", ")", ":", "if", "self", ".", "_in_txn", "or", "self", ".", "print_frequency", "is", "None", ":", "return", "elif", "self", ".", "last_export", "is", "not", "None", "and", "self", ".", "last_export", "+", "self", "....
Assumes you hold the lock
[ "Assumes", "you", "hold", "the", "lock" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/pyprofile/__init__.py#L271-L279
train
Returns the current version of the record if it is needed.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/remotes/compose/utils.py
split_buffer
def split_buffer(stream, splitter=None, decoder=lambda a: a): """Given a generator which yields strings and a splitter function, joins all input, splits on the separator and yields each chunk. Unlike string.split(), each chunk includes the trailing separator, except for the last one if none was found o...
python
def split_buffer(stream, splitter=None, decoder=lambda a: a): """Given a generator which yields strings and a splitter function, joins all input, splits on the separator and yields each chunk. Unlike string.split(), each chunk includes the trailing separator, except for the last one if none was found o...
[ "def", "split_buffer", "(", "stream", ",", "splitter", "=", "None", ",", "decoder", "=", "lambda", "a", ":", "a", ")", ":", "splitter", "=", "splitter", "or", "line_splitter", "buffered", "=", "six", ".", "text_type", "(", "''", ")", "for", "data", "in...
Given a generator which yields strings and a splitter function, joins all input, splits on the separator and yields each chunk. Unlike string.split(), each chunk includes the trailing separator, except for the last one if none was found on the end of the input.
[ "Given", "a", "generator", "which", "yields", "strings", "and", "a", "splitter", "function", "joins", "all", "input", "splits", "on", "the", "separator", "and", "yields", "each", "chunk", "." ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/remotes/compose/utils.py#L41-L63
train
Given a generator which yields strings and a splitter function splits all input into chunks of size size.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/__init__.py
configure_logging
def configure_logging(path=None): """ Set up log levels, and split verbose logs to a file Configure the client-side environment logs to print to stdout at "info" level, and also to print to a verbose log file located at /tmp/universe-<pid>.log or another path you specify at "deb...
python
def configure_logging(path=None): """ Set up log levels, and split verbose logs to a file Configure the client-side environment logs to print to stdout at "info" level, and also to print to a verbose log file located at /tmp/universe-<pid>.log or another path you specify at "deb...
[ "def", "configure_logging", "(", "path", "=", "None", ")", ":", "global", "_logging_configured", "if", "_logging_configured", ":", "return", "_logging_configured", "=", "True", "if", "path", "is", "False", ":", "# Disable logfile", "return", "elif", "path", "is", ...
Set up log levels, and split verbose logs to a file Configure the client-side environment logs to print to stdout at "info" level, and also to print to a verbose log file located at /tmp/universe-<pid>.log or another path you specify at "debug" level. We suggest calling this met...
[ "Set", "up", "log", "levels", "and", "split", "verbose", "logs", "to", "a", "file" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/__init__.py#L48-L86
train
Configure the logging for the current user.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/remotes/docker_remote.py
get_client
def get_client(): """ Set DOCKER_HOST (and probably DOCKER_TLS_VERIFY and DOCKER_CERT_PATH) to connect to a docker instance through TCP. Leave DOCKER_HOST unset and it will use the default, typically unix:/var/run/docker.sock It also needs to know how to connect to ports on the docker container after c...
python
def get_client(): """ Set DOCKER_HOST (and probably DOCKER_TLS_VERIFY and DOCKER_CERT_PATH) to connect to a docker instance through TCP. Leave DOCKER_HOST unset and it will use the default, typically unix:/var/run/docker.sock It also needs to know how to connect to ports on the docker container after c...
[ "def", "get_client", "(", ")", ":", "info", "=", "{", "}", "host", "=", "os", ".", "environ", ".", "get", "(", "'DOCKER_HOST'", ")", "net_host", "=", "os", ".", "environ", ".", "get", "(", "'DOCKER_NET_HOST'", ")", "client_api_version", "=", "os", ".",...
Set DOCKER_HOST (and probably DOCKER_TLS_VERIFY and DOCKER_CERT_PATH) to connect to a docker instance through TCP. Leave DOCKER_HOST unset and it will use the default, typically unix:/var/run/docker.sock It also needs to know how to connect to ports on the docker container after creating it. Set DOCKER_NET...
[ "Set", "DOCKER_HOST", "(", "and", "probably", "DOCKER_TLS_VERIFY", "and", "DOCKER_CERT_PATH", ")", "to", "connect", "to", "a", "docker", "instance", "through", "TCP", ".", "Leave", "DOCKER_HOST", "unset", "and", "it", "will", "use", "the", "default", "typically"...
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/remotes/docker_remote.py#L113-L157
train
Returns a docker client object for the given container.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/remotes/docker_remote.py
DockerManager.pop
def pop(self, n=None): """Call from main thread. Returns the list of newly-available (handle, env) pairs.""" if self._popped: assert n is None return [] self._popped = True envs = [] for i, instance in enumerate(self.instances): env = remote.R...
python
def pop(self, n=None): """Call from main thread. Returns the list of newly-available (handle, env) pairs.""" if self._popped: assert n is None return [] self._popped = True envs = [] for i, instance in enumerate(self.instances): env = remote.R...
[ "def", "pop", "(", "self", ",", "n", "=", "None", ")", ":", "if", "self", ".", "_popped", ":", "assert", "n", "is", "None", "return", "[", "]", "self", ".", "_popped", "=", "True", "envs", "=", "[", "]", "for", "i", ",", "instance", "in", "enum...
Call from main thread. Returns the list of newly-available (handle, env) pairs.
[ "Call", "from", "main", "thread", ".", "Returns", "the", "list", "of", "newly", "-", "available", "(", "handle", "env", ")", "pairs", "." ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/remotes/docker_remote.py#L60-L77
train
Call from main thread. Returns the list of newly - available ( handle env ) pairs.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/wrappers/recording.py
Recording._get_writer
def _get_writer(self, i): """ Returns a tuple of (log_fn, log_f, bin_fn, bin_f) to be written to by vectorized env channel i Or all Nones if recording is inactive on that channel """ if self._recording_dir is None: return None if self._log_n is None: ...
python
def _get_writer(self, i): """ Returns a tuple of (log_fn, log_f, bin_fn, bin_f) to be written to by vectorized env channel i Or all Nones if recording is inactive on that channel """ if self._recording_dir is None: return None if self._log_n is None: ...
[ "def", "_get_writer", "(", "self", ",", "i", ")", ":", "if", "self", ".", "_recording_dir", "is", "None", ":", "return", "None", "if", "self", ".", "_log_n", "is", "None", ":", "self", ".", "_log_n", "=", "[", "None", "]", "*", "self", ".", "n", ...
Returns a tuple of (log_fn, log_f, bin_fn, bin_f) to be written to by vectorized env channel i Or all Nones if recording is inactive on that channel
[ "Returns", "a", "tuple", "of", "(", "log_fn", "log_f", "bin_fn", "bin_f", ")", "to", "be", "written", "to", "by", "vectorized", "env", "channel", "i", "Or", "all", "Nones", "if", "recording", "is", "inactive", "on", "that", "channel" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/wrappers/recording.py#L77-L88
train
Returns a RecordingWriter instance for the specified recording level.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/wrappers/time_limit.py
UniverseTimeLimit._past_limit
def _past_limit(self): """Return true if we are past our limit""" if self._max_episode_steps is not None and self._max_episode_steps <= self._elapsed_steps: logger.debug("Env has passed the step limit defined by TimeLimit.") return True if self._max_episode_seconds is no...
python
def _past_limit(self): """Return true if we are past our limit""" if self._max_episode_steps is not None and self._max_episode_steps <= self._elapsed_steps: logger.debug("Env has passed the step limit defined by TimeLimit.") return True if self._max_episode_seconds is no...
[ "def", "_past_limit", "(", "self", ")", ":", "if", "self", ".", "_max_episode_steps", "is", "not", "None", "and", "self", ".", "_max_episode_steps", "<=", "self", ".", "_elapsed_steps", ":", "logger", ".", "debug", "(", "\"Env has passed the step limit defined by ...
Return true if we are past our limit
[ "Return", "true", "if", "we", "are", "past", "our", "limit" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/wrappers/time_limit.py#L27-L37
train
Return true if we are past our limit.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/vncdriver/vnc_proxy_server.py
VNCProxyServer.recvProxyData
def recvProxyData(self, data): """Write data to server""" if self.initialized: self.sendData(data) else: self.queued_data.append(data)
python
def recvProxyData(self, data): """Write data to server""" if self.initialized: self.sendData(data) else: self.queued_data.append(data)
[ "def", "recvProxyData", "(", "self", ",", "data", ")", ":", "if", "self", ".", "initialized", ":", "self", ".", "sendData", "(", "data", ")", "else", ":", "self", ".", "queued_data", ".", "append", "(", "data", ")" ]
Write data to server
[ "Write", "data", "to", "server" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/vncdriver/vnc_proxy_server.py#L418-L423
train
Write data to server if necessary.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/vncdriver/vnc_proxy_server.py
VNCProxyClient.sendData
def sendData(self, data): """Write data to server""" # Not set up yet if self.client_log is None: self.client_log_buffer.append(data) else: self.client_log.write(data) self.transport.write(data)
python
def sendData(self, data): """Write data to server""" # Not set up yet if self.client_log is None: self.client_log_buffer.append(data) else: self.client_log.write(data) self.transport.write(data)
[ "def", "sendData", "(", "self", ",", "data", ")", ":", "# Not set up yet", "if", "self", ".", "client_log", "is", "None", ":", "self", ".", "client_log_buffer", ".", "append", "(", "data", ")", "else", ":", "self", ".", "client_log", ".", "write", "(", ...
Write data to server
[ "Write", "data", "to", "server" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/vncdriver/vnc_proxy_server.py#L485-L492
train
Write data to the server.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/wrappers/experimental/observation.py
CropObservations
def CropObservations(env): """" Crops the visual observations of an environment so that they only contain the game screen. Removes anything outside the game that usually belongs to universe (browser borders and so on). """ if env.spec.tags.get('flashgames', False): spec = runtime_spec('flash...
python
def CropObservations(env): """" Crops the visual observations of an environment so that they only contain the game screen. Removes anything outside the game that usually belongs to universe (browser borders and so on). """ if env.spec.tags.get('flashgames', False): spec = runtime_spec('flash...
[ "def", "CropObservations", "(", "env", ")", ":", "if", "env", ".", "spec", ".", "tags", ".", "get", "(", "'flashgames'", ",", "False", ")", ":", "spec", "=", "runtime_spec", "(", "'flashgames'", ")", ".", "server_registry", "[", "env", ".", "spec", "."...
Crops the visual observations of an environment so that they only contain the game screen. Removes anything outside the game that usually belongs to universe (browser borders and so on).
[ "Crops", "the", "visual", "observations", "of", "an", "environment", "so", "that", "they", "only", "contain", "the", "game", "screen", ".", "Removes", "anything", "outside", "the", "game", "that", "usually", "belongs", "to", "universe", "(", "browser", "border...
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/wrappers/experimental/observation.py#L9-L21
train
Crops the visual observations of an environment so that they only contain the game screen.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/envs/vnc_core_env/translator.py
AtariKeyState.apply_vnc_actions
def apply_vnc_actions(self, vnc_actions): """ Play a list of vnc_actions forward over the current keysyms state NOTE: Since we are squashing a set of diffs into a single keyboard state, some information may be lost. For example if the Z key is down, then we receive [(Z-up), (Z-down)], t...
python
def apply_vnc_actions(self, vnc_actions): """ Play a list of vnc_actions forward over the current keysyms state NOTE: Since we are squashing a set of diffs into a single keyboard state, some information may be lost. For example if the Z key is down, then we receive [(Z-up), (Z-down)], t...
[ "def", "apply_vnc_actions", "(", "self", ",", "vnc_actions", ")", ":", "for", "event", "in", "vnc_actions", ":", "if", "isinstance", "(", "event", ",", "spaces", ".", "KeyEvent", ")", ":", "if", "event", ".", "down", ":", "self", ".", "_down_keysyms", "....
Play a list of vnc_actions forward over the current keysyms state NOTE: Since we are squashing a set of diffs into a single keyboard state, some information may be lost. For example if the Z key is down, then we receive [(Z-up), (Z-down)], the output will not reflect any change in Z You can mak...
[ "Play", "a", "list", "of", "vnc_actions", "forward", "over", "the", "current", "keysyms", "state" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/envs/vnc_core_env/translator.py#L19-L34
train
Apply a list of vnc_actions forward over the current keysyms state.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/rewarder/remote.py
ControlBuffer.recv_rpc
def recv_rpc(self, context, payload): """Call from any thread""" logger.debug("Adding RPC payload to ControlBuffer queue: %s", payload) self.buf.put(('rpc', (context, payload))) with self.cv: self.cv.notifyAll()
python
def recv_rpc(self, context, payload): """Call from any thread""" logger.debug("Adding RPC payload to ControlBuffer queue: %s", payload) self.buf.put(('rpc', (context, payload))) with self.cv: self.cv.notifyAll()
[ "def", "recv_rpc", "(", "self", ",", "context", ",", "payload", ")", ":", "logger", ".", "debug", "(", "\"Adding RPC payload to ControlBuffer queue: %s\"", ",", "payload", ")", "self", ".", "buf", ".", "put", "(", "(", "'rpc'", ",", "(", "context", ",", "p...
Call from any thread
[ "Call", "from", "any", "thread" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/rewarder/remote.py#L145-L150
train
Called from any thread to add an RPC to the ControlBuffer queue.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/rewarder/remote.py
ControlBuffer.get
def get(self, *args, **kwargs): """Call from main thread.""" payload = self.buf.get(*args, **kwargs) logger.debug("Removing RPC payload from ControlBuffer queue: %s", payload) return payload
python
def get(self, *args, **kwargs): """Call from main thread.""" payload = self.buf.get(*args, **kwargs) logger.debug("Removing RPC payload from ControlBuffer queue: %s", payload) return payload
[ "def", "get", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "payload", "=", "self", ".", "buf", ".", "get", "(", "*", "args", ",", "*", "*", "kwargs", ")", "logger", ".", "debug", "(", "\"Removing RPC payload from ControlBuffer queu...
Call from main thread.
[ "Call", "from", "main", "thread", "." ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/rewarder/remote.py#L155-L159
train
Call from main thread.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/rewarder/remote.py
AgentConn.send_env_text
def send_env_text(self, text, episode_id): ''' text channel to communicate with the agent ''' reactor.callFromThread(self._send_env_text, text, episode_id)
python
def send_env_text(self, text, episode_id): ''' text channel to communicate with the agent ''' reactor.callFromThread(self._send_env_text, text, episode_id)
[ "def", "send_env_text", "(", "self", ",", "text", ",", "episode_id", ")", ":", "reactor", ".", "callFromThread", "(", "self", ".", "_send_env_text", ",", "text", ",", "episode_id", ")" ]
text channel to communicate with the agent
[ "text", "channel", "to", "communicate", "with", "the", "agent" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/rewarder/remote.py#L252-L254
train
send text to the agent
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/remotes/compose/log_printer.py
build_log_presenters
def build_log_presenters(service_names, monochrome): """Return an iterable of functions. Each function can be used to format the logs output of a container. """ prefix_width = max_name_width(service_names) def no_color(text): return text for color_func in cycle([no_color] if monochrom...
python
def build_log_presenters(service_names, monochrome): """Return an iterable of functions. Each function can be used to format the logs output of a container. """ prefix_width = max_name_width(service_names) def no_color(text): return text for color_func in cycle([no_color] if monochrom...
[ "def", "build_log_presenters", "(", "service_names", ",", "monochrome", ")", ":", "prefix_width", "=", "max_name_width", "(", "service_names", ")", "def", "no_color", "(", "text", ")", ":", "return", "text", "for", "color_func", "in", "cycle", "(", "[", "no_co...
Return an iterable of functions. Each function can be used to format the logs output of a container.
[ "Return", "an", "iterable", "of", "functions", "." ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/remotes/compose/log_printer.py#L40-L51
train
Return an iterable of functions that can be used to format the logs output of a container.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/remotes/compose/log_printer.py
consume_queue
def consume_queue(queue, cascade_stop): """Consume the queue by reading lines off of it and yielding them.""" while True: try: item = queue.get(timeout=0.1) except Empty: yield None continue # See https://github.com/docker/compose/issues/189 ex...
python
def consume_queue(queue, cascade_stop): """Consume the queue by reading lines off of it and yielding them.""" while True: try: item = queue.get(timeout=0.1) except Empty: yield None continue # See https://github.com/docker/compose/issues/189 ex...
[ "def", "consume_queue", "(", "queue", ",", "cascade_stop", ")", ":", "while", "True", ":", "try", ":", "item", "=", "queue", ".", "get", "(", "timeout", "=", "0.1", ")", "except", "Empty", ":", "yield", "None", "continue", "# See https://github.com/docker/co...
Consume the queue by reading lines off of it and yielding them.
[ "Consume", "the", "queue", "by", "reading", "lines", "off", "of", "it", "and", "yielding", "them", "." ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/remotes/compose/log_printer.py#L217-L238
train
Consume the queue by reading lines off of it and yielding them.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/vncdriver/vendor/pydes.py
_baseDes.setKey
def setKey(self, key): """Will set the crypting key for this object.""" key = self._guardAgainstUnicode(key) self.__key = key
python
def setKey(self, key): """Will set the crypting key for this object.""" key = self._guardAgainstUnicode(key) self.__key = key
[ "def", "setKey", "(", "self", ",", "key", ")", ":", "key", "=", "self", ".", "_guardAgainstUnicode", "(", "key", ")", "self", ".", "__key", "=", "key" ]
Will set the crypting key for this object.
[ "Will", "set", "the", "crypting", "key", "for", "this", "object", "." ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/vncdriver/vendor/pydes.py#L130-L133
train
Will set the crypting key for this object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/vncdriver/vendor/pydes.py
_baseDes.setPadding
def setPadding(self, pad): """setPadding() -> bytes of length 1. Padding character.""" if pad is not None: pad = self._guardAgainstUnicode(pad) self._padding = pad
python
def setPadding(self, pad): """setPadding() -> bytes of length 1. Padding character.""" if pad is not None: pad = self._guardAgainstUnicode(pad) self._padding = pad
[ "def", "setPadding", "(", "self", ",", "pad", ")", ":", "if", "pad", "is", "not", "None", ":", "pad", "=", "self", ".", "_guardAgainstUnicode", "(", "pad", ")", "self", ".", "_padding", "=", "pad" ]
setPadding() -> bytes of length 1. Padding character.
[ "setPadding", "()", "-", ">", "bytes", "of", "length", "1", ".", "Padding", "character", "." ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/vncdriver/vendor/pydes.py#L147-L151
train
setPadding - Set padding character.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/vncdriver/vendor/pydes.py
_baseDes.setIV
def setIV(self, IV): """Will set the Initial Value, used in conjunction with CBC mode""" if not IV or len(IV) != self.block_size: raise ValueError("Invalid Initial Value (IV), must be a multiple of " + str(self.block_size) + " bytes") IV = self._guardAgainstUnicode(IV) self._iv = IV
python
def setIV(self, IV): """Will set the Initial Value, used in conjunction with CBC mode""" if not IV or len(IV) != self.block_size: raise ValueError("Invalid Initial Value (IV), must be a multiple of " + str(self.block_size) + " bytes") IV = self._guardAgainstUnicode(IV) self._iv = IV
[ "def", "setIV", "(", "self", ",", "IV", ")", ":", "if", "not", "IV", "or", "len", "(", "IV", ")", "!=", "self", ".", "block_size", ":", "raise", "ValueError", "(", "\"Invalid Initial Value (IV), must be a multiple of \"", "+", "str", "(", "self", ".", "blo...
Will set the Initial Value, used in conjunction with CBC mode
[ "Will", "set", "the", "Initial", "Value", "used", "in", "conjunction", "with", "CBC", "mode" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/vncdriver/vendor/pydes.py#L165-L170
train
Will set the Initial Value used in conjunction with CBC mode
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/vncdriver/vendor/pydes.py
des.__String_to_BitList
def __String_to_BitList(self, data): """Turn the string data, into a list of bits (1, 0)'s""" if _pythonMajorVersion < 3: # Turn the strings into integers. Python 3 uses a bytes # class, which already has this behaviour. data = [ord(c) for c in data] l = len(data) * 8 result = [0] * l pos = 0 for c...
python
def __String_to_BitList(self, data): """Turn the string data, into a list of bits (1, 0)'s""" if _pythonMajorVersion < 3: # Turn the strings into integers. Python 3 uses a bytes # class, which already has this behaviour. data = [ord(c) for c in data] l = len(data) * 8 result = [0] * l pos = 0 for c...
[ "def", "__String_to_BitList", "(", "self", ",", "data", ")", ":", "if", "_pythonMajorVersion", "<", "3", ":", "# Turn the strings into integers. Python 3 uses a bytes", "# class, which already has this behaviour.", "data", "=", "[", "ord", "(", "c", ")", "for", "c", "...
Turn the string data, into a list of bits (1, 0)'s
[ "Turn", "the", "string", "data", "into", "a", "list", "of", "bits", "(", "1", "0", ")", "s" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/vncdriver/vendor/pydes.py#L416-L435
train
Turn the string data into a list of bits ( 1 0 ) s.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/vncdriver/vendor/pydes.py
des.__BitList_to_String
def __BitList_to_String(self, data): """Turn the list of bits -> data, into a string""" result = [] pos = 0 c = 0 while pos < len(data): c += data[pos] << (7 - (pos % 8)) if (pos % 8) == 7: result.append(c) c = 0 pos += 1 if _pythonMajorVersion < 3: return ''.join([ chr(c) for c in resu...
python
def __BitList_to_String(self, data): """Turn the list of bits -> data, into a string""" result = [] pos = 0 c = 0 while pos < len(data): c += data[pos] << (7 - (pos % 8)) if (pos % 8) == 7: result.append(c) c = 0 pos += 1 if _pythonMajorVersion < 3: return ''.join([ chr(c) for c in resu...
[ "def", "__BitList_to_String", "(", "self", ",", "data", ")", ":", "result", "=", "[", "]", "pos", "=", "0", "c", "=", "0", "while", "pos", "<", "len", "(", "data", ")", ":", "c", "+=", "data", "[", "pos", "]", "<<", "(", "7", "-", "(", "pos",...
Turn the list of bits -> data, into a string
[ "Turn", "the", "list", "of", "bits", "-", ">", "data", "into", "a", "string" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/vncdriver/vendor/pydes.py#L437-L452
train
Turn the list of bits -> data into a string
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/vncdriver/vendor/pydes.py
des.__permutate
def __permutate(self, table, block): """Permutate this block with the specified table""" return list(map(lambda x: block[x], table))
python
def __permutate(self, table, block): """Permutate this block with the specified table""" return list(map(lambda x: block[x], table))
[ "def", "__permutate", "(", "self", ",", "table", ",", "block", ")", ":", "return", "list", "(", "map", "(", "lambda", "x", ":", "block", "[", "x", "]", ",", "table", ")", ")" ]
Permutate this block with the specified table
[ "Permutate", "this", "block", "with", "the", "specified", "table" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/vncdriver/vendor/pydes.py#L454-L456
train
Permutate this block with the specified table
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/vncdriver/vendor/pydes.py
des.__create_sub_keys
def __create_sub_keys(self): """Create the 16 subkeys K[1] to K[16] from the given key""" key = self.__permutate(des.__pc1, self.__String_to_BitList(self.getKey())) i = 0 # Split into Left and Right sections self.L = key[:28] self.R = key[28:] while i < 16: j = 0 # Perform circular left shifts wh...
python
def __create_sub_keys(self): """Create the 16 subkeys K[1] to K[16] from the given key""" key = self.__permutate(des.__pc1, self.__String_to_BitList(self.getKey())) i = 0 # Split into Left and Right sections self.L = key[:28] self.R = key[28:] while i < 16: j = 0 # Perform circular left shifts wh...
[ "def", "__create_sub_keys", "(", "self", ")", ":", "key", "=", "self", ".", "__permutate", "(", "des", ".", "__pc1", ",", "self", ".", "__String_to_BitList", "(", "self", ".", "getKey", "(", ")", ")", ")", "i", "=", "0", "# Split into Left and Right sectio...
Create the 16 subkeys K[1] to K[16] from the given key
[ "Create", "the", "16", "subkeys", "K", "[", "1", "]", "to", "K", "[", "16", "]", "from", "the", "given", "key" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/vncdriver/vendor/pydes.py#L460-L482
train
Create the 16 subkeys K1 to K[16 from the given key
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/vncdriver/vendor/pydes.py
des.encrypt
def encrypt(self, data, pad=None, padmode=None): """encrypt(data, [pad], [padmode]) -> bytes data : Bytes to be encrypted pad : Optional argument for encryption padding. Must only be one byte padmode : Optional argument for overriding the padding mode. The data must be a multiple of 8 bytes and will be enc...
python
def encrypt(self, data, pad=None, padmode=None): """encrypt(data, [pad], [padmode]) -> bytes data : Bytes to be encrypted pad : Optional argument for encryption padding. Must only be one byte padmode : Optional argument for overriding the padding mode. The data must be a multiple of 8 bytes and will be enc...
[ "def", "encrypt", "(", "self", ",", "data", ",", "pad", "=", "None", ",", "padmode", "=", "None", ")", ":", "data", "=", "self", ".", "_guardAgainstUnicode", "(", "data", ")", "if", "pad", "is", "not", "None", ":", "pad", "=", "self", ".", "_guardA...
encrypt(data, [pad], [padmode]) -> bytes data : Bytes to be encrypted pad : Optional argument for encryption padding. Must only be one byte padmode : Optional argument for overriding the padding mode. The data must be a multiple of 8 bytes and will be encrypted with the already specified key. Data does not...
[ "encrypt", "(", "data", "[", "pad", "]", "[", "padmode", "]", ")", "-", ">", "bytes" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/vncdriver/vendor/pydes.py#L642-L659
train
Encrypt the data with the key.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/vncdriver/vendor/pydes.py
des.decrypt
def decrypt(self, data, pad=None, padmode=None): """decrypt(data, [pad], [padmode]) -> bytes data : Bytes to be encrypted pad : Optional argument for decryption padding. Must only be one byte padmode : Optional argument for overriding the padding mode. The data must be a multiple of 8 bytes and will be dec...
python
def decrypt(self, data, pad=None, padmode=None): """decrypt(data, [pad], [padmode]) -> bytes data : Bytes to be encrypted pad : Optional argument for decryption padding. Must only be one byte padmode : Optional argument for overriding the padding mode. The data must be a multiple of 8 bytes and will be dec...
[ "def", "decrypt", "(", "self", ",", "data", ",", "pad", "=", "None", ",", "padmode", "=", "None", ")", ":", "data", "=", "self", ".", "_guardAgainstUnicode", "(", "data", ")", "if", "pad", "is", "not", "None", ":", "pad", "=", "self", ".", "_guardA...
decrypt(data, [pad], [padmode]) -> bytes data : Bytes to be encrypted pad : Optional argument for decryption padding. Must only be one byte padmode : Optional argument for overriding the padding mode. The data must be a multiple of 8 bytes and will be decrypted with the already specified key. In PAD_NORMAL...
[ "decrypt", "(", "data", "[", "pad", "]", "[", "padmode", "]", ")", "-", ">", "bytes" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/vncdriver/vendor/pydes.py#L661-L680
train
Decrypt the data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/vncdriver/vendor/pydes.py
triple_des.setKey
def setKey(self, key): """Will set the crypting key for this object. Either 16 or 24 bytes long.""" self.key_size = 24 # Use DES-EDE3 mode if len(key) != self.key_size: if len(key) == 16: # Use DES-EDE2 mode self.key_size = 16 else: raise ValueError("Invalid triple DES key size. Key must be either ...
python
def setKey(self, key): """Will set the crypting key for this object. Either 16 or 24 bytes long.""" self.key_size = 24 # Use DES-EDE3 mode if len(key) != self.key_size: if len(key) == 16: # Use DES-EDE2 mode self.key_size = 16 else: raise ValueError("Invalid triple DES key size. Key must be either ...
[ "def", "setKey", "(", "self", ",", "key", ")", ":", "self", ".", "key_size", "=", "24", "# Use DES-EDE3 mode", "if", "len", "(", "key", ")", "!=", "self", ".", "key_size", ":", "if", "len", "(", "key", ")", "==", "16", ":", "# Use DES-EDE2 mode", "se...
Will set the crypting key for this object. Either 16 or 24 bytes long.
[ "Will", "set", "the", "crypting", "key", "for", "this", "object", ".", "Either", "16", "or", "24", "bytes", "long", "." ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/vncdriver/vendor/pydes.py#L712-L735
train
Will set the crypting key for this object. Either 16 or 24 bytes long.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/vncdriver/vendor/pydes.py
triple_des.setMode
def setMode(self, mode): """Sets the type of crypting mode, pyDes.ECB or pyDes.CBC""" _baseDes.setMode(self, mode) for key in (self.__key1, self.__key2, self.__key3): key.setMode(mode)
python
def setMode(self, mode): """Sets the type of crypting mode, pyDes.ECB or pyDes.CBC""" _baseDes.setMode(self, mode) for key in (self.__key1, self.__key2, self.__key3): key.setMode(mode)
[ "def", "setMode", "(", "self", ",", "mode", ")", ":", "_baseDes", ".", "setMode", "(", "self", ",", "mode", ")", "for", "key", "in", "(", "self", ".", "__key1", ",", "self", ".", "__key2", ",", "self", ".", "__key3", ")", ":", "key", ".", "setMod...
Sets the type of crypting mode, pyDes.ECB or pyDes.CBC
[ "Sets", "the", "type", "of", "crypting", "mode", "pyDes", ".", "ECB", "or", "pyDes", ".", "CBC" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/vncdriver/vendor/pydes.py#L739-L743
train
Sets the type of crypting mode pyDes. ECB or pyDes. CBC
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/vncdriver/vendor/pydes.py
triple_des.setPadding
def setPadding(self, pad): """setPadding() -> bytes of length 1. Padding character.""" _baseDes.setPadding(self, pad) for key in (self.__key1, self.__key2, self.__key3): key.setPadding(pad)
python
def setPadding(self, pad): """setPadding() -> bytes of length 1. Padding character.""" _baseDes.setPadding(self, pad) for key in (self.__key1, self.__key2, self.__key3): key.setPadding(pad)
[ "def", "setPadding", "(", "self", ",", "pad", ")", ":", "_baseDes", ".", "setPadding", "(", "self", ",", "pad", ")", "for", "key", "in", "(", "self", ".", "__key1", ",", "self", ".", "__key2", ",", "self", ".", "__key3", ")", ":", "key", ".", "se...
setPadding() -> bytes of length 1. Padding character.
[ "setPadding", "()", "-", ">", "bytes", "of", "length", "1", ".", "Padding", "character", "." ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/vncdriver/vendor/pydes.py#L745-L749
train
setPadding - Set padding character for all keys in this object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/vncdriver/vendor/pydes.py
triple_des.setPadMode
def setPadMode(self, mode): """Sets the type of padding mode, pyDes.PAD_NORMAL or pyDes.PAD_PKCS5""" _baseDes.setPadMode(self, mode) for key in (self.__key1, self.__key2, self.__key3): key.setPadMode(mode)
python
def setPadMode(self, mode): """Sets the type of padding mode, pyDes.PAD_NORMAL or pyDes.PAD_PKCS5""" _baseDes.setPadMode(self, mode) for key in (self.__key1, self.__key2, self.__key3): key.setPadMode(mode)
[ "def", "setPadMode", "(", "self", ",", "mode", ")", ":", "_baseDes", ".", "setPadMode", "(", "self", ",", "mode", ")", "for", "key", "in", "(", "self", ".", "__key1", ",", "self", ".", "__key2", ",", "self", ".", "__key3", ")", ":", "key", ".", "...
Sets the type of padding mode, pyDes.PAD_NORMAL or pyDes.PAD_PKCS5
[ "Sets", "the", "type", "of", "padding", "mode", "pyDes", ".", "PAD_NORMAL", "or", "pyDes", ".", "PAD_PKCS5" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/vncdriver/vendor/pydes.py#L751-L755
train
Sets the type of padding mode pyDes. PAD_NORMAL or pyDes. PAD_PKCS5.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/vncdriver/vendor/pydes.py
triple_des.setIV
def setIV(self, IV): """Will set the Initial Value, used in conjunction with CBC mode""" _baseDes.setIV(self, IV) for key in (self.__key1, self.__key2, self.__key3): key.setIV(IV)
python
def setIV(self, IV): """Will set the Initial Value, used in conjunction with CBC mode""" _baseDes.setIV(self, IV) for key in (self.__key1, self.__key2, self.__key3): key.setIV(IV)
[ "def", "setIV", "(", "self", ",", "IV", ")", ":", "_baseDes", ".", "setIV", "(", "self", ",", "IV", ")", "for", "key", "in", "(", "self", ".", "__key1", ",", "self", ".", "__key2", ",", "self", ".", "__key3", ")", ":", "key", ".", "setIV", "(",...
Will set the Initial Value, used in conjunction with CBC mode
[ "Will", "set", "the", "Initial", "Value", "used", "in", "conjunction", "with", "CBC", "mode" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/vncdriver/vendor/pydes.py#L757-L761
train
Will set the Initial Value used in conjunction with CBC mode
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
openai/universe
universe/vncdriver/vendor/pydes.py
triple_des.decrypt
def decrypt(self, data, pad=None, padmode=None): """decrypt(data, [pad], [padmode]) -> bytes data : bytes to be encrypted pad : Optional argument for decryption padding. Must only be one byte padmode : Optional argument for overriding the padding mode. The data must be a multiple of 8 bytes and will be dec...
python
def decrypt(self, data, pad=None, padmode=None): """decrypt(data, [pad], [padmode]) -> bytes data : bytes to be encrypted pad : Optional argument for decryption padding. Must only be one byte padmode : Optional argument for overriding the padding mode. The data must be a multiple of 8 bytes and will be dec...
[ "def", "decrypt", "(", "self", ",", "data", ",", "pad", "=", "None", ",", "padmode", "=", "None", ")", ":", "ENCRYPT", "=", "des", ".", "ENCRYPT", "DECRYPT", "=", "des", ".", "DECRYPT", "data", "=", "self", ".", "_guardAgainstUnicode", "(", "data", "...
decrypt(data, [pad], [padmode]) -> bytes data : bytes to be encrypted pad : Optional argument for decryption padding. Must only be one byte padmode : Optional argument for overriding the padding mode. The data must be a multiple of 8 bytes and will be decrypted with the already specified key. In PAD_NORMAL...
[ "decrypt", "(", "data", "[", "pad", "]", "[", "padmode", "]", ")", "-", ">", "bytes" ]
cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c
https://github.com/openai/universe/blob/cc9ce6ec241821bfb0f3b85dd455bd36e4ee7a8c/universe/vncdriver/vendor/pydes.py#L807-L852
train
This method decrypts the data with the encryption key.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/pay/__init__.py
WeChatPay.parse_payment_result
def parse_payment_result(self, xml): """解析微信支付结果通知""" try: data = xmltodict.parse(xml) except (xmltodict.ParsingInterrupted, ExpatError): raise InvalidSignatureException() if not data or 'xml' not in data: raise InvalidSignatureException() da...
python
def parse_payment_result(self, xml): """解析微信支付结果通知""" try: data = xmltodict.parse(xml) except (xmltodict.ParsingInterrupted, ExpatError): raise InvalidSignatureException() if not data or 'xml' not in data: raise InvalidSignatureException() da...
[ "def", "parse_payment_result", "(", "self", ",", "xml", ")", ":", "try", ":", "data", "=", "xmltodict", ".", "parse", "(", "xml", ")", "except", "(", "xmltodict", ".", "ParsingInterrupted", ",", "ExpatError", ")", ":", "raise", "InvalidSignatureException", "...
解析微信支付结果通知
[ "解析微信支付结果通知" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/pay/__init__.py#L196-L216
train
Parse payment result xml
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/material.py
WeChatMaterial.add_articles
def add_articles(self, articles): """ 新增永久图文素材 详情请参考 https://mp.weixin.qq.com/wiki?id=mp1494572718_WzHIY :param articles: 图文素材数组 :type articles: list[dict] :return: 返回的 JSON 数据包 """ articles_data = [] for article in articles: a...
python
def add_articles(self, articles): """ 新增永久图文素材 详情请参考 https://mp.weixin.qq.com/wiki?id=mp1494572718_WzHIY :param articles: 图文素材数组 :type articles: list[dict] :return: 返回的 JSON 数据包 """ articles_data = [] for article in articles: a...
[ "def", "add_articles", "(", "self", ",", "articles", ")", ":", "articles_data", "=", "[", "]", "for", "article", "in", "articles", ":", "articles_data", ".", "append", "(", "{", "'thumb_media_id'", ":", "article", "[", "'thumb_media_id'", "]", ",", "'title'"...
新增永久图文素材 详情请参考 https://mp.weixin.qq.com/wiki?id=mp1494572718_WzHIY :param articles: 图文素材数组 :type articles: list[dict] :return: 返回的 JSON 数据包
[ "新增永久图文素材", "详情请参考", "https", ":", "//", "mp", ".", "weixin", ".", "qq", ".", "com", "/", "wiki?id", "=", "mp1494572718_WzHIY" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/material.py#L9-L37
train
add_articles 详情请参考 图文素材数组 返回的 JSON 数据包含图文素材数组
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/material.py
WeChatMaterial.add
def add(self, media_type, media_file, title=None, introduction=None): """ 新增其它类型永久素材 详情请参考 http://mp.weixin.qq.com/wiki/14/7e6c03263063f4813141c3e17dd4350a.html :param media_type: 媒体文件类型,分别有图片(image)、语音(voice)、视频(video)和缩略图(thumb) :param media_file: 要上传的文件,一个 File-object...
python
def add(self, media_type, media_file, title=None, introduction=None): """ 新增其它类型永久素材 详情请参考 http://mp.weixin.qq.com/wiki/14/7e6c03263063f4813141c3e17dd4350a.html :param media_type: 媒体文件类型,分别有图片(image)、语音(voice)、视频(video)和缩略图(thumb) :param media_file: 要上传的文件,一个 File-object...
[ "def", "add", "(", "self", ",", "media_type", ",", "media_file", ",", "title", "=", "None", ",", "introduction", "=", "None", ")", ":", "params", "=", "{", "'access_token'", ":", "self", ".", "access_token", ",", "'type'", ":", "media_type", "}", "if", ...
新增其它类型永久素材 详情请参考 http://mp.weixin.qq.com/wiki/14/7e6c03263063f4813141c3e17dd4350a.html :param media_type: 媒体文件类型,分别有图片(image)、语音(voice)、视频(video)和缩略图(thumb) :param media_file: 要上传的文件,一个 File-object :param title: 视频素材标题,仅上传视频素材时需要 :param introduction: 视频素材简介,仅上传视频素材时需要 ...
[ "新增其它类型永久素材", "详情请参考", "http", ":", "//", "mp", ".", "weixin", ".", "qq", ".", "com", "/", "wiki", "/", "14", "/", "7e6c03263063f4813141c3e17dd4350a", ".", "html" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/material.py#L39-L69
train
Add a new entry to the cache.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/material.py
WeChatMaterial.get
def get(self, media_id): """ 获取永久素材 详情请参考 http://mp.weixin.qq.com/wiki/4/b3546879f07623cb30df9ca0e420a5d0.html :param media_id: 素材的 media_id :return: 图文素材返回图文列表,其它类型为素材的内容 """ def _processor(res): if isinstance(res, dict): if '...
python
def get(self, media_id): """ 获取永久素材 详情请参考 http://mp.weixin.qq.com/wiki/4/b3546879f07623cb30df9ca0e420a5d0.html :param media_id: 素材的 media_id :return: 图文素材返回图文列表,其它类型为素材的内容 """ def _processor(res): if isinstance(res, dict): if '...
[ "def", "get", "(", "self", ",", "media_id", ")", ":", "def", "_processor", "(", "res", ")", ":", "if", "isinstance", "(", "res", ",", "dict", ")", ":", "if", "'news_item'", "in", "res", ":", "# 图文素材", "return", "res", "[", "'news_item'", "]", "return...
获取永久素材 详情请参考 http://mp.weixin.qq.com/wiki/4/b3546879f07623cb30df9ca0e420a5d0.html :param media_id: 素材的 media_id :return: 图文素材返回图文列表,其它类型为素材的内容
[ "获取永久素材", "详情请参考", "http", ":", "//", "mp", ".", "weixin", ".", "qq", ".", "com", "/", "wiki", "/", "4", "/", "b3546879f07623cb30df9ca0e420a5d0", ".", "html" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/material.py#L71-L94
train
Get a specific entry in the cache.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/material.py
WeChatMaterial.update_article
def update_article(self, media_id, index, article): """ 修改永久图文素材 详情请参考 https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444738732 :param media_id: 要修改的图文消息的 id :param index: 要更新的文章在图文消息中的位置(多图文消息时,此字段才有意义),第一篇为 0 :param article: 图文素材 :return: 返回的 J...
python
def update_article(self, media_id, index, article): """ 修改永久图文素材 详情请参考 https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444738732 :param media_id: 要修改的图文消息的 id :param index: 要更新的文章在图文消息中的位置(多图文消息时,此字段才有意义),第一篇为 0 :param article: 图文素材 :return: 返回的 J...
[ "def", "update_article", "(", "self", ",", "media_id", ",", "index", ",", "article", ")", ":", "article_data", "=", "{", "'thumb_media_id'", ":", "article", "[", "'thumb_media_id'", "]", ",", "'title'", ":", "article", "[", "'title'", "]", ",", "'content'", ...
修改永久图文素材 详情请参考 https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444738732 :param media_id: 要修改的图文消息的 id :param index: 要更新的文章在图文消息中的位置(多图文消息时,此字段才有意义),第一篇为 0 :param article: 图文素材 :return: 返回的 JSON 数据包
[ "修改永久图文素材", "详情请参考", "https", ":", "//", "mp", ".", "weixin", ".", "qq", ".", "com", "/", "wiki?t", "=", "resource", "/", "res_main&id", "=", "mp1444738732" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/material.py#L112-L139
train
Update the article in the national cache.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/material.py
WeChatMaterial.update_articles
def update_articles(self, media_id, index, articles): """ 修改永久图文素材 详情请参考 http://mp.weixin.qq.com/wiki/4/19a59cba020d506e767360ca1be29450.html :param media_id: 要修改的图文消息的 id :param index: 要更新的文章在图文消息中的位置(多图文消息时,此字段才有意义),第一篇为 0 :param articles: 图文素材数组 :retur...
python
def update_articles(self, media_id, index, articles): """ 修改永久图文素材 详情请参考 http://mp.weixin.qq.com/wiki/4/19a59cba020d506e767360ca1be29450.html :param media_id: 要修改的图文消息的 id :param index: 要更新的文章在图文消息中的位置(多图文消息时,此字段才有意义),第一篇为 0 :param articles: 图文素材数组 :retur...
[ "def", "update_articles", "(", "self", ",", "media_id", ",", "index", ",", "articles", ")", ":", "return", "self", ".", "update_article", "(", "media_id", ",", "index", ",", "articles", "[", "index", "]", ")" ]
修改永久图文素材 详情请参考 http://mp.weixin.qq.com/wiki/4/19a59cba020d506e767360ca1be29450.html :param media_id: 要修改的图文消息的 id :param index: 要更新的文章在图文消息中的位置(多图文消息时,此字段才有意义),第一篇为 0 :param articles: 图文素材数组 :return: 返回的 JSON 数据包
[ "修改永久图文素材", "详情请参考", "http", ":", "//", "mp", ".", "weixin", ".", "qq", ".", "com", "/", "wiki", "/", "4", "/", "19a59cba020d506e767360ca1be29450", ".", "html" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/material.py#L141-L152
train
update_article 修改久图文消息中的 id
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/material.py
WeChatMaterial.list_comment
def list_comment(self, msg_data_id, index=1, begin=0, count=50, type=0): """ 查看指定文章的评论数据 """ return self._post( 'comment/list', data={ 'msg_data_id': msg_data_id, 'index': index, 'begin': begin, 'coun...
python
def list_comment(self, msg_data_id, index=1, begin=0, count=50, type=0): """ 查看指定文章的评论数据 """ return self._post( 'comment/list', data={ 'msg_data_id': msg_data_id, 'index': index, 'begin': begin, 'coun...
[ "def", "list_comment", "(", "self", ",", "msg_data_id", ",", "index", "=", "1", ",", "begin", "=", "0", ",", "count", "=", "50", ",", "type", "=", "0", ")", ":", "return", "self", ".", "_post", "(", "'comment/list'", ",", "data", "=", "{", "'msg_da...
查看指定文章的评论数据
[ "查看指定文章的评论数据" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/material.py#L207-L219
train
List all comments for a specific message data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/material.py
WeChatMaterial.markelect_comment
def markelect_comment(self, msg_data_id, index, user_comment_id): """ 将评论标记精选 """ return self._post( 'comment/markelect', data={ 'msg_data_id': msg_data_id, 'index': index, 'user_comment_id': user_comment_id, ...
python
def markelect_comment(self, msg_data_id, index, user_comment_id): """ 将评论标记精选 """ return self._post( 'comment/markelect', data={ 'msg_data_id': msg_data_id, 'index': index, 'user_comment_id': user_comment_id, ...
[ "def", "markelect_comment", "(", "self", ",", "msg_data_id", ",", "index", ",", "user_comment_id", ")", ":", "return", "self", ".", "_post", "(", "'comment/markelect'", ",", "data", "=", "{", "'msg_data_id'", ":", "msg_data_id", ",", "'index'", ":", "index", ...
将评论标记精选
[ "将评论标记精选" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/material.py#L221-L231
train
Markelect a user comment in a message.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/material.py
WeChatMaterial.unmarkelect_comment
def unmarkelect_comment(self, msg_data_id, index, user_comment_id): """ 将评论取消精选 """ return self._post( 'comment/unmarkelect', data={ 'msg_data_id': msg_data_id, 'index': index, 'user_comment_id': user_comment_id, ...
python
def unmarkelect_comment(self, msg_data_id, index, user_comment_id): """ 将评论取消精选 """ return self._post( 'comment/unmarkelect', data={ 'msg_data_id': msg_data_id, 'index': index, 'user_comment_id': user_comment_id, ...
[ "def", "unmarkelect_comment", "(", "self", ",", "msg_data_id", ",", "index", ",", "user_comment_id", ")", ":", "return", "self", ".", "_post", "(", "'comment/unmarkelect'", ",", "data", "=", "{", "'msg_data_id'", ":", "msg_data_id", ",", "'index'", ":", "index...
将评论取消精选
[ "将评论取消精选" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/material.py#L233-L243
train
Unmarkelect a user comment in a message.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/material.py
WeChatMaterial.delete_comment
def delete_comment(self, msg_data_id, index, user_comment_id): """ 删除评论 """ return self._post( 'comment/delete', data={ 'msg_data_id': msg_data_id, 'index': index, 'user_comment_id': user_comment_id, })
python
def delete_comment(self, msg_data_id, index, user_comment_id): """ 删除评论 """ return self._post( 'comment/delete', data={ 'msg_data_id': msg_data_id, 'index': index, 'user_comment_id': user_comment_id, })
[ "def", "delete_comment", "(", "self", ",", "msg_data_id", ",", "index", ",", "user_comment_id", ")", ":", "return", "self", ".", "_post", "(", "'comment/delete'", ",", "data", "=", "{", "'msg_data_id'", ":", "msg_data_id", ",", "'index'", ":", "index", ",", ...
删除评论
[ "删除评论" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/material.py#L245-L255
train
Delete a user comment.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/material.py
WeChatMaterial.add_reply_comment
def add_reply_comment(self, msg_data_id, index, user_comment_id, content): """ 回复评论 """ return self._post( 'comment/reply/add', data={ 'msg_data_id': msg_data_id, 'index': index, 'user_comment_id': user_comment_id, ...
python
def add_reply_comment(self, msg_data_id, index, user_comment_id, content): """ 回复评论 """ return self._post( 'comment/reply/add', data={ 'msg_data_id': msg_data_id, 'index': index, 'user_comment_id': user_comment_id, ...
[ "def", "add_reply_comment", "(", "self", ",", "msg_data_id", ",", "index", ",", "user_comment_id", ",", "content", ")", ":", "return", "self", ".", "_post", "(", "'comment/reply/add'", ",", "data", "=", "{", "'msg_data_id'", ":", "msg_data_id", ",", "'index'",...
回复评论
[ "回复评论" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/material.py#L257-L268
train
Add a reply comment to a user.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/material.py
WeChatMaterial.delete_reply_comment
def delete_reply_comment(self, msg_data_id, index, user_comment_id): """ 删除回复 """ return self._post( 'comment/reply/delete', data={ 'msg_data_id': msg_data_id, 'index': index, 'user_comment_id': user_comment_id, ...
python
def delete_reply_comment(self, msg_data_id, index, user_comment_id): """ 删除回复 """ return self._post( 'comment/reply/delete', data={ 'msg_data_id': msg_data_id, 'index': index, 'user_comment_id': user_comment_id, ...
[ "def", "delete_reply_comment", "(", "self", ",", "msg_data_id", ",", "index", ",", "user_comment_id", ")", ":", "return", "self", ".", "_post", "(", "'comment/reply/delete'", ",", "data", "=", "{", "'msg_data_id'", ":", "msg_data_id", ",", "'index'", ":", "ind...
删除回复
[ "删除回复" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/material.py#L270-L280
train
Delete a reply comment.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/enterprise/client/api/service.py
WeChatService.get_provider_token
def get_provider_token(self, provider_secret): """ 获取服务商凭证 https://work.weixin.qq.com/api/doc#90001/90143/91200 :param provider_secret: 服务商的secret,在服务商管理后台可见 :return: 返回的 JSON 数据包 """ return self._post( 'service/get_provider_token', data=...
python
def get_provider_token(self, provider_secret): """ 获取服务商凭证 https://work.weixin.qq.com/api/doc#90001/90143/91200 :param provider_secret: 服务商的secret,在服务商管理后台可见 :return: 返回的 JSON 数据包 """ return self._post( 'service/get_provider_token', data=...
[ "def", "get_provider_token", "(", "self", ",", "provider_secret", ")", ":", "return", "self", ".", "_post", "(", "'service/get_provider_token'", ",", "data", "=", "{", "'corpid'", ":", "self", ".", "_client", ".", "corp_id", ",", "'provider_secret'", ":", "pro...
获取服务商凭证 https://work.weixin.qq.com/api/doc#90001/90143/91200 :param provider_secret: 服务商的secret,在服务商管理后台可见 :return: 返回的 JSON 数据包
[ "获取服务商凭证" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/enterprise/client/api/service.py#L16-L31
train
Get provider token
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/enterprise/client/api/service.py
WeChatService.get_suite_token
def get_suite_token(self, suite_id, suite_secret, suite_ticket): """ 获取第三方应用凭证 https://work.weixin.qq.com/api/doc#90001/90143/9060 :param suite_id: 以ww或wx开头应用id(对应于旧的以tj开头的套件id) :param suite_secret: 应用secret :param suite_ticket: 企业微信后台推送的ticket :return: 返回的 JSO...
python
def get_suite_token(self, suite_id, suite_secret, suite_ticket): """ 获取第三方应用凭证 https://work.weixin.qq.com/api/doc#90001/90143/9060 :param suite_id: 以ww或wx开头应用id(对应于旧的以tj开头的套件id) :param suite_secret: 应用secret :param suite_ticket: 企业微信后台推送的ticket :return: 返回的 JSO...
[ "def", "get_suite_token", "(", "self", ",", "suite_id", ",", "suite_secret", ",", "suite_ticket", ")", ":", "return", "self", ".", "_post", "(", "'service/get_suite_token'", ",", "data", "=", "{", "'suite_id'", ":", "suite_id", ",", "'suite_secret'", ":", "sui...
获取第三方应用凭证 https://work.weixin.qq.com/api/doc#90001/90143/9060 :param suite_id: 以ww或wx开头应用id(对应于旧的以tj开头的套件id) :param suite_secret: 应用secret :param suite_ticket: 企业微信后台推送的ticket :return: 返回的 JSON 数据包
[ "获取第三方应用凭证" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/enterprise/client/api/service.py#L33-L51
train
Get suite token
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/enterprise/client/api/service.py
WeChatService.get_login_info
def get_login_info(self, auth_code, provider_access_token=None): """ 获取企业号登录用户信息 详情请参考 https://qydev.weixin.qq.com/wiki/index.php?title=获取企业号登录用户信息 :param provider_access_token: 服务提供商的 accesstoken :param auth_code: OAuth 2.0 授权企业号管理员登录产生的 code :return: 返回的 JSON ...
python
def get_login_info(self, auth_code, provider_access_token=None): """ 获取企业号登录用户信息 详情请参考 https://qydev.weixin.qq.com/wiki/index.php?title=获取企业号登录用户信息 :param provider_access_token: 服务提供商的 accesstoken :param auth_code: OAuth 2.0 授权企业号管理员登录产生的 code :return: 返回的 JSON ...
[ "def", "get_login_info", "(", "self", ",", "auth_code", ",", "provider_access_token", "=", "None", ")", ":", "return", "self", ".", "_post", "(", "'service/get_login_info'", ",", "params", "=", "{", "'provider_access_token'", ":", "provider_access_token", ",", "}"...
获取企业号登录用户信息 详情请参考 https://qydev.weixin.qq.com/wiki/index.php?title=获取企业号登录用户信息 :param provider_access_token: 服务提供商的 accesstoken :param auth_code: OAuth 2.0 授权企业号管理员登录产生的 code :return: 返回的 JSON 数据包
[ "获取企业号登录用户信息" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/enterprise/client/api/service.py#L53-L72
train
Get login info.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/enterprise/client/api/service.py
WeChatService.get_login_url
def get_login_url(self, login_ticket, target, agentid=None, provider_access_token=None): """ 获取登录企业号官网的url 详情请参考 https://qydev.weixin.qq.com/wiki/index.php?title=获取登录企业号官网的url :param provider_access_token: 服务提供商的 accesstoken :param login_ticket: 通过get_login_info得到的login...
python
def get_login_url(self, login_ticket, target, agentid=None, provider_access_token=None): """ 获取登录企业号官网的url 详情请参考 https://qydev.weixin.qq.com/wiki/index.php?title=获取登录企业号官网的url :param provider_access_token: 服务提供商的 accesstoken :param login_ticket: 通过get_login_info得到的login...
[ "def", "get_login_url", "(", "self", ",", "login_ticket", ",", "target", ",", "agentid", "=", "None", ",", "provider_access_token", "=", "None", ")", ":", "return", "self", ".", "_post", "(", "'service/get_login_url'", ",", "params", "=", "{", "'provider_acces...
获取登录企业号官网的url 详情请参考 https://qydev.weixin.qq.com/wiki/index.php?title=获取登录企业号官网的url :param provider_access_token: 服务提供商的 accesstoken :param login_ticket: 通过get_login_info得到的login_ticket, 10小时有效 :param target: 登录跳转到企业号后台的目标页面 :param agentid: 可选,授权方应用id :return: 返回...
[ "获取登录企业号官网的url" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/enterprise/client/api/service.py#L74-L97
train
Get login url
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/datacube.py
WeChatDataCube.get_user_summary
def get_user_summary(self, begin_date, end_date): """ 获取用户增减数据 详情请参考 http://mp.weixin.qq.com/wiki/3/ecfed6e1a0a03b5f35e5efac98e864b7.html :param begin_date: 起始日期 :param end_date: 结束日期 :return: 统计数据列表 """ res = self._post( 'getusersumma...
python
def get_user_summary(self, begin_date, end_date): """ 获取用户增减数据 详情请参考 http://mp.weixin.qq.com/wiki/3/ecfed6e1a0a03b5f35e5efac98e864b7.html :param begin_date: 起始日期 :param end_date: 结束日期 :return: 统计数据列表 """ res = self._post( 'getusersumma...
[ "def", "get_user_summary", "(", "self", ",", "begin_date", ",", "end_date", ")", ":", "res", "=", "self", ".", "_post", "(", "'getusersummary'", ",", "data", "=", "{", "'begin_date'", ":", "self", ".", "_to_date_str", "(", "begin_date", ")", ",", "'end_dat...
获取用户增减数据 详情请参考 http://mp.weixin.qq.com/wiki/3/ecfed6e1a0a03b5f35e5efac98e864b7.html :param begin_date: 起始日期 :param end_date: 结束日期 :return: 统计数据列表
[ "获取用户增减数据", "详情请参考", "http", ":", "//", "mp", ".", "weixin", ".", "qq", ".", "com", "/", "wiki", "/", "3", "/", "ecfed6e1a0a03b5f35e5efac98e864b7", ".", "html" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/datacube.py#L23-L40
train
Get user summary
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/datacube.py
WeChatDataCube.get_user_cumulate
def get_user_cumulate(self, begin_date, end_date): """ 获取累计用户数据 详情请参考 http://mp.weixin.qq.com/wiki/3/ecfed6e1a0a03b5f35e5efac98e864b7.html :param begin_date: 起始日期 :param end_date: 结束日期 :return: 统计数据列表 """ res = self._post( 'getusercumu...
python
def get_user_cumulate(self, begin_date, end_date): """ 获取累计用户数据 详情请参考 http://mp.weixin.qq.com/wiki/3/ecfed6e1a0a03b5f35e5efac98e864b7.html :param begin_date: 起始日期 :param end_date: 结束日期 :return: 统计数据列表 """ res = self._post( 'getusercumu...
[ "def", "get_user_cumulate", "(", "self", ",", "begin_date", ",", "end_date", ")", ":", "res", "=", "self", ".", "_post", "(", "'getusercumulate'", ",", "data", "=", "{", "'begin_date'", ":", "self", ".", "_to_date_str", "(", "begin_date", ")", ",", "'end_d...
获取累计用户数据 详情请参考 http://mp.weixin.qq.com/wiki/3/ecfed6e1a0a03b5f35e5efac98e864b7.html :param begin_date: 起始日期 :param end_date: 结束日期 :return: 统计数据列表
[ "获取累计用户数据", "详情请参考", "http", ":", "//", "mp", ".", "weixin", ".", "qq", ".", "com", "/", "wiki", "/", "3", "/", "ecfed6e1a0a03b5f35e5efac98e864b7", ".", "html" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/datacube.py#L42-L60
train
Get user cumulate
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/pay/api/transfer.py
WeChatTransfer.transfer
def transfer(self, user_id, amount, desc, client_ip=None, check_name='OPTION_CHECK', real_name=None, out_trade_no=None, device_info=None): """ 企业付款接口 :param user_id: 接受收红包的用户在公众号下的 openid :param amount: 付款金额,单位分 :param desc: 付款说明 :param ...
python
def transfer(self, user_id, amount, desc, client_ip=None, check_name='OPTION_CHECK', real_name=None, out_trade_no=None, device_info=None): """ 企业付款接口 :param user_id: 接受收红包的用户在公众号下的 openid :param amount: 付款金额,单位分 :param desc: 付款说明 :param ...
[ "def", "transfer", "(", "self", ",", "user_id", ",", "amount", ",", "desc", ",", "client_ip", "=", "None", ",", "check_name", "=", "'OPTION_CHECK'", ",", "real_name", "=", "None", ",", "out_trade_no", "=", "None", ",", "device_info", "=", "None", ")", ":...
企业付款接口 :param user_id: 接受收红包的用户在公众号下的 openid :param amount: 付款金额,单位分 :param desc: 付款说明 :param client_ip: 可选,调用接口机器的 IP 地址 :param check_name: 可选,校验用户姓名选项, NO_CHECK:不校验真实姓名, FORCE_CHECK:强校验真实姓名(未实名认证的用户会校验失败,无法转账), ...
[ "企业付款接口" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/pay/api/transfer.py#L12-L52
train
Transfer amount to a user.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/pay/api/transfer.py
WeChatTransfer.transfer_bankcard
def transfer_bankcard(self, true_name, bank_card_no, bank_code, amount, desc=None, out_trade_no=None): """ 企业付款到银行卡接口 :param true_name: 开户人名称 :param bank_card_no: 银行卡号 :param bank_code: 银行编号 :param amount: 付款金额,单位分 :param desc: 付款说明 :param out_trade_no: 可...
python
def transfer_bankcard(self, true_name, bank_card_no, bank_code, amount, desc=None, out_trade_no=None): """ 企业付款到银行卡接口 :param true_name: 开户人名称 :param bank_card_no: 银行卡号 :param bank_code: 银行编号 :param amount: 付款金额,单位分 :param desc: 付款说明 :param out_trade_no: 可...
[ "def", "transfer_bankcard", "(", "self", ",", "true_name", ",", "bank_card_no", ",", "bank_code", ",", "amount", ",", "desc", "=", "None", ",", "out_trade_no", "=", "None", ")", ":", "if", "not", "out_trade_no", ":", "now", "=", "datetime", ".", "now", "...
企业付款到银行卡接口 :param true_name: 开户人名称 :param bank_card_no: 银行卡号 :param bank_code: 银行编号 :param amount: 付款金额,单位分 :param desc: 付款说明 :param out_trade_no: 可选,商户订单号,需保持唯一性,默认自动生成 :return: 返回的结果信息
[ "企业付款到银行卡接口" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/pay/api/transfer.py#L67-L95
train
Transfer a bank card.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/pay/api/transfer.py
WeChatTransfer.query_bankcard
def query_bankcard(self, out_trade_no): """ 企业付款查询接口 :param out_trade_no: 商户调用企业付款API时使用的商户订单号 :return: 返回的结果数据 """ data = { 'mch_id': self.mch_id, 'partner_trade_no': out_trade_no, } return self._post('mmpaysptrans/query_bank', da...
python
def query_bankcard(self, out_trade_no): """ 企业付款查询接口 :param out_trade_no: 商户调用企业付款API时使用的商户订单号 :return: 返回的结果数据 """ data = { 'mch_id': self.mch_id, 'partner_trade_no': out_trade_no, } return self._post('mmpaysptrans/query_bank', da...
[ "def", "query_bankcard", "(", "self", ",", "out_trade_no", ")", ":", "data", "=", "{", "'mch_id'", ":", "self", ".", "mch_id", ",", "'partner_trade_no'", ":", "out_trade_no", ",", "}", "return", "self", ".", "_post", "(", "'mmpaysptrans/query_bank'", ",", "d...
企业付款查询接口 :param out_trade_no: 商户调用企业付款API时使用的商户订单号 :return: 返回的结果数据
[ "企业付款查询接口" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/pay/api/transfer.py#L97-L108
train
Query the Mpaysptrans s Bank Card.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/template.py
WeChatTemplate.get
def get(self, template_id_short): """ 获得模板ID 详情请参考 https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277 :param template_id_short: 模板库中模板的编号,有“TM**”和“OPENTMTM**”等形式 :return: 模板 ID """ res = self._post( 'template/api_add_template', ...
python
def get(self, template_id_short): """ 获得模板ID 详情请参考 https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277 :param template_id_short: 模板库中模板的编号,有“TM**”和“OPENTMTM**”等形式 :return: 模板 ID """ res = self._post( 'template/api_add_template', ...
[ "def", "get", "(", "self", ",", "template_id_short", ")", ":", "res", "=", "self", ".", "_post", "(", "'template/api_add_template'", ",", "data", "=", "{", "'template_id_short'", ":", "template_id_short", "}", ",", "result_processor", "=", "lambda", "x", ":", ...
获得模板ID 详情请参考 https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277 :param template_id_short: 模板库中模板的编号,有“TM**”和“OPENTMTM**”等形式 :return: 模板 ID
[ "获得模板ID", "详情请参考", "https", ":", "//", "mp", ".", "weixin", ".", "qq", ".", "com", "/", "wiki?t", "=", "resource", "/", "res_main&id", "=", "mp1433751277" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/template.py#L39-L55
train
Get the ID of the current user s template.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/shakearound.py
WeChatShakeAround.apply_device_id
def apply_device_id(self, quantity, reason, poi_id=None, comment=None): """ 申请设备ID 详情请参考 http://mp.weixin.qq.com/wiki/15/b9e012f917e3484b7ed02771156411f3.html :param quantity: 申请的设备ID的数量,单次新增设备超过500个,需走人工审核流程 :param reason: 申请理由,不超过100个字 :param poi_id: 可选,设备关联的门店...
python
def apply_device_id(self, quantity, reason, poi_id=None, comment=None): """ 申请设备ID 详情请参考 http://mp.weixin.qq.com/wiki/15/b9e012f917e3484b7ed02771156411f3.html :param quantity: 申请的设备ID的数量,单次新增设备超过500个,需走人工审核流程 :param reason: 申请理由,不超过100个字 :param poi_id: 可选,设备关联的门店...
[ "def", "apply_device_id", "(", "self", ",", "quantity", ",", "reason", ",", "poi_id", "=", "None", ",", "comment", "=", "None", ")", ":", "data", "=", "optionaldict", "(", ")", "data", "[", "'quantity'", "]", "=", "quantity", "data", "[", "'apply_reason'...
申请设备ID 详情请参考 http://mp.weixin.qq.com/wiki/15/b9e012f917e3484b7ed02771156411f3.html :param quantity: 申请的设备ID的数量,单次新增设备超过500个,需走人工审核流程 :param reason: 申请理由,不超过100个字 :param poi_id: 可选,设备关联的门店ID :param comment: 可选,备注,不超过15个汉字或30个英文字母 :return: 申请的设备信息
[ "申请设备ID", "详情请参考", "http", ":", "//", "mp", ".", "weixin", ".", "qq", ".", "com", "/", "wiki", "/", "15", "/", "b9e012f917e3484b7ed02771156411f3", ".", "html" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/shakearound.py#L25-L47
train
Apply device ID to the current state of the user.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/shakearound.py
WeChatShakeAround.update_device
def update_device(self, device_id=None, uuid=None, major=None, minor=None, comment=None): """ 更新设备信息 详情请参考 http://mp.weixin.qq.com/wiki/15/b9e012f917e3484b7ed02771156411f3.html :param device_id: 设备编号,若填了UUID、major、minor,则可不填设备编号,若二者都填,则以设备编号为优先 :par...
python
def update_device(self, device_id=None, uuid=None, major=None, minor=None, comment=None): """ 更新设备信息 详情请参考 http://mp.weixin.qq.com/wiki/15/b9e012f917e3484b7ed02771156411f3.html :param device_id: 设备编号,若填了UUID、major、minor,则可不填设备编号,若二者都填,则以设备编号为优先 :par...
[ "def", "update_device", "(", "self", ",", "device_id", "=", "None", ",", "uuid", "=", "None", ",", "major", "=", "None", ",", "minor", "=", "None", ",", "comment", "=", "None", ")", ":", "data", "=", "optionaldict", "(", ")", "data", "[", "'comment'"...
更新设备信息 详情请参考 http://mp.weixin.qq.com/wiki/15/b9e012f917e3484b7ed02771156411f3.html :param device_id: 设备编号,若填了UUID、major、minor,则可不填设备编号,若二者都填,则以设备编号为优先 :param uuid: UUID :param major: major :param minor: minor :param comment: 设备的备注信息,不超过15个汉字或30个英文字母。 :ret...
[ "更新设备信息", "详情请参考", "http", ":", "//", "mp", ".", "weixin", ".", "qq", ".", "com", "/", "wiki", "/", "15", "/", "b9e012f917e3484b7ed02771156411f3", ".", "html" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/shakearound.py#L49-L74
train
Update the device identifier.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/shakearound.py
WeChatShakeAround.bind_device_location
def bind_device_location(self, poi_id, device_id=None, uuid=None, major=None, minor=None): """ 配置设备与门店的关联关系 详情请参考 http://mp.weixin.qq.com/wiki/15/b9e012f917e3484b7ed02771156411f3.html :param poi_id: 待关联的门店ID :param device_id: 设备编号,若填了UUID、maj...
python
def bind_device_location(self, poi_id, device_id=None, uuid=None, major=None, minor=None): """ 配置设备与门店的关联关系 详情请参考 http://mp.weixin.qq.com/wiki/15/b9e012f917e3484b7ed02771156411f3.html :param poi_id: 待关联的门店ID :param device_id: 设备编号,若填了UUID、maj...
[ "def", "bind_device_location", "(", "self", ",", "poi_id", ",", "device_id", "=", "None", ",", "uuid", "=", "None", ",", "major", "=", "None", ",", "minor", "=", "None", ")", ":", "data", "=", "optionaldict", "(", ")", "data", "[", "'poi_id'", "]", "...
配置设备与门店的关联关系 详情请参考 http://mp.weixin.qq.com/wiki/15/b9e012f917e3484b7ed02771156411f3.html :param poi_id: 待关联的门店ID :param device_id: 设备编号,若填了UUID、major、minor,则可不填设备编号,若二者都填,则以设备编号为优先 :param uuid: UUID :param major: major :param minor: minor :return: 返回的 JSO...
[ "配置设备与门店的关联关系", "详情请参考", "http", ":", "//", "mp", ".", "weixin", ".", "qq", ".", "com", "/", "wiki", "/", "15", "/", "b9e012f917e3484b7ed02771156411f3", ".", "html" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/shakearound.py#L76-L101
train
bind_device_location 设备与门店的关联关系将 可以设备与门店的关联关系将 uuid major and minor are optional
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/shakearound.py
WeChatShakeAround.search_device
def search_device(self, identifiers=None, apply_id=None, begin=0, count=10): """ 查询设备列表 详情请参考 http://mp.weixin.qq.com/wiki/15/b9e012f917e3484b7ed02771156411f3.html :param identifiers: 设备 ID 信息列表 :param apply_id: 批次ID,申请设备ID超出500个时所返回批次ID :pa...
python
def search_device(self, identifiers=None, apply_id=None, begin=0, count=10): """ 查询设备列表 详情请参考 http://mp.weixin.qq.com/wiki/15/b9e012f917e3484b7ed02771156411f3.html :param identifiers: 设备 ID 信息列表 :param apply_id: 批次ID,申请设备ID超出500个时所返回批次ID :pa...
[ "def", "search_device", "(", "self", ",", "identifiers", "=", "None", ",", "apply_id", "=", "None", ",", "begin", "=", "0", ",", "count", "=", "10", ")", ":", "data", "=", "optionaldict", "(", ")", "data", "[", "'begin'", "]", "=", "begin", "data", ...
查询设备列表 详情请参考 http://mp.weixin.qq.com/wiki/15/b9e012f917e3484b7ed02771156411f3.html :param identifiers: 设备 ID 信息列表 :param apply_id: 批次ID,申请设备ID超出500个时所返回批次ID :param begin: 设备列表的起始索引值 :param count: 待查询的设备个数 :return: 设备列表
[ "查询设备列表", "详情请参考", "http", ":", "//", "mp", ".", "weixin", ".", "qq", ".", "com", "/", "wiki", "/", "15", "/", "b9e012f917e3484b7ed02771156411f3", ".", "html" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/shakearound.py#L103-L127
train
Search for a device in the cache.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/shakearound.py
WeChatShakeAround.update_page
def update_page(self, page_id, title, description, icon_url, page_url, comment=None): """ 编辑页面信息 详情请参考 http://mp.weixin.qq.com/wiki/5/6626199ea8757c752046d8e46cf13251.html :param page_id: 摇周边页面唯一ID :param title: 在摇一摇页面展示的主标题,不超过6个字 :param desc...
python
def update_page(self, page_id, title, description, icon_url, page_url, comment=None): """ 编辑页面信息 详情请参考 http://mp.weixin.qq.com/wiki/5/6626199ea8757c752046d8e46cf13251.html :param page_id: 摇周边页面唯一ID :param title: 在摇一摇页面展示的主标题,不超过6个字 :param desc...
[ "def", "update_page", "(", "self", ",", "page_id", ",", "title", ",", "description", ",", "icon_url", ",", "page_url", ",", "comment", "=", "None", ")", ":", "data", "=", "optionaldict", "(", ")", "data", "[", "'page_id'", "]", "=", "page_id", "data", ...
编辑页面信息 详情请参考 http://mp.weixin.qq.com/wiki/5/6626199ea8757c752046d8e46cf13251.html :param page_id: 摇周边页面唯一ID :param title: 在摇一摇页面展示的主标题,不超过6个字 :param description: 在摇一摇页面展示的副标题,不超过7个字 :param icon_url: 在摇一摇页面展示的图片。图片需先上传至微信侧服务器, 用“素材管理-上传图片素材”接口上传图片,...
[ "编辑页面信息", "详情请参考", "http", ":", "//", "mp", ".", "weixin", ".", "qq", ".", "com", "/", "wiki", "/", "5", "/", "6626199ea8757c752046d8e46cf13251", ".", "html" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/shakearound.py#L156-L184
train
Update a page.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/shakearound.py
WeChatShakeAround.search_pages
def search_pages(self, page_ids=None, begin=0, count=10): """ 查询页面列表 详情请参考 http://mp.weixin.qq.com/wiki/5/6626199ea8757c752046d8e46cf13251.html :param page_ids: 指定页面的id列表 :param begin: 页面列表的起始索引值 :param count: 待查询的页面个数 :return: 页面查询结果信息 """ ...
python
def search_pages(self, page_ids=None, begin=0, count=10): """ 查询页面列表 详情请参考 http://mp.weixin.qq.com/wiki/5/6626199ea8757c752046d8e46cf13251.html :param page_ids: 指定页面的id列表 :param begin: 页面列表的起始索引值 :param count: 待查询的页面个数 :return: 页面查询结果信息 """ ...
[ "def", "search_pages", "(", "self", ",", "page_ids", "=", "None", ",", "begin", "=", "0", ",", "count", "=", "10", ")", ":", "if", "not", "page_ids", ":", "data", "=", "{", "'type'", ":", "2", ",", "'begin'", ":", "begin", ",", "'count'", ":", "c...
查询页面列表 详情请参考 http://mp.weixin.qq.com/wiki/5/6626199ea8757c752046d8e46cf13251.html :param page_ids: 指定页面的id列表 :param begin: 页面列表的起始索引值 :param count: 待查询的页面个数 :return: 页面查询结果信息
[ "查询页面列表", "详情请参考", "http", ":", "//", "mp", ".", "weixin", ".", "qq", ".", "com", "/", "wiki", "/", "5", "/", "6626199ea8757c752046d8e46cf13251", ".", "html" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/shakearound.py#L186-L216
train
Search for pages in a specific language.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/shakearound.py
WeChatShakeAround.add_material
def add_material(self, media_file, media_type='icon'): """ 上传图片素材 详情请参考 http://mp.weixin.qq.com/wiki/5/e997428269ff189d8f9a4b9e177be2d9.html :param media_file: 要上传的文件,一个 File-object :param media_type: 摇一摇素材类型, 取值为 icon或者 license, 默认 icon. :return: 上传的素材信息 ...
python
def add_material(self, media_file, media_type='icon'): """ 上传图片素材 详情请参考 http://mp.weixin.qq.com/wiki/5/e997428269ff189d8f9a4b9e177be2d9.html :param media_file: 要上传的文件,一个 File-object :param media_type: 摇一摇素材类型, 取值为 icon或者 license, 默认 icon. :return: 上传的素材信息 ...
[ "def", "add_material", "(", "self", ",", "media_file", ",", "media_type", "=", "'icon'", ")", ":", "res", "=", "self", ".", "_post", "(", "'shakearound/material/add'", ",", "files", "=", "{", "'media'", ":", "media_file", "}", ",", "params", "=", "{", "'...
上传图片素材 详情请参考 http://mp.weixin.qq.com/wiki/5/e997428269ff189d8f9a4b9e177be2d9.html :param media_file: 要上传的文件,一个 File-object :param media_type: 摇一摇素材类型, 取值为 icon或者 license, 默认 icon. :return: 上传的素材信息
[ "上传图片素材", "详情请参考", "http", ":", "//", "mp", ".", "weixin", ".", "qq", ".", "com", "/", "wiki", "/", "5", "/", "e997428269ff189d8f9a4b9e177be2d9", ".", "html" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/shakearound.py#L234-L254
train
add a new material to the set of known media
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/shakearound.py
WeChatShakeAround.bind_device_pages
def bind_device_pages(self, page_ids, bind, append, device_id=None, uuid=None, major=None, minor=None): """ 配置设备与页面的关联关系 详情请参考 http://mp.weixin.qq.com/wiki/12/c8120214ec0ba08af5dfcc0da1a11400.html :param page_ids: 待关联的页面列表 :param bind: 关联操作标志位, ...
python
def bind_device_pages(self, page_ids, bind, append, device_id=None, uuid=None, major=None, minor=None): """ 配置设备与页面的关联关系 详情请参考 http://mp.weixin.qq.com/wiki/12/c8120214ec0ba08af5dfcc0da1a11400.html :param page_ids: 待关联的页面列表 :param bind: 关联操作标志位, ...
[ "def", "bind_device_pages", "(", "self", ",", "page_ids", ",", "bind", ",", "append", ",", "device_id", "=", "None", ",", "uuid", "=", "None", ",", "major", "=", "None", ",", "minor", "=", "None", ")", ":", "if", "not", "isinstance", "(", "page_ids", ...
配置设备与页面的关联关系 详情请参考 http://mp.weixin.qq.com/wiki/12/c8120214ec0ba08af5dfcc0da1a11400.html :param page_ids: 待关联的页面列表 :param bind: 关联操作标志位, 0为解除关联关系,1为建立关联关系 :param append: 新增操作标志位, 0为覆盖,1为新增 :param device_id: 设备编号,若填了UUID、major、minor,则可不填设备编号,若二者都填,则以设备编号为优先 :param...
[ "配置设备与页面的关联关系", "详情请参考", "http", ":", "//", "mp", ".", "weixin", ".", "qq", ".", "com", "/", "wiki", "/", "12", "/", "c8120214ec0ba08af5dfcc0da1a11400", ".", "html" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/shakearound.py#L256-L288
train
bind_device_pages - Binds a list of page_ids to a device.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/shakearound.py
WeChatShakeAround.get_shake_info
def get_shake_info(self, ticket): """ 获取摇周边的设备及用户信息 详情请参考 http://mp.weixin.qq.com/wiki/3/34904a5db3d0ec7bb5306335b8da1faf.html :param ticket: 摇周边业务的ticket,可在摇到的URL中得到,ticket生效时间为30分钟 :return: 设备及用户信息 """ res = self._post( 'shakearound/user/get...
python
def get_shake_info(self, ticket): """ 获取摇周边的设备及用户信息 详情请参考 http://mp.weixin.qq.com/wiki/3/34904a5db3d0ec7bb5306335b8da1faf.html :param ticket: 摇周边业务的ticket,可在摇到的URL中得到,ticket生效时间为30分钟 :return: 设备及用户信息 """ res = self._post( 'shakearound/user/get...
[ "def", "get_shake_info", "(", "self", ",", "ticket", ")", ":", "res", "=", "self", ".", "_post", "(", "'shakearound/user/getshakeinfo'", ",", "data", "=", "{", "'ticket'", ":", "ticket", "}", ",", "result_processor", "=", "lambda", "x", ":", "x", "[", "'...
获取摇周边的设备及用户信息 详情请参考 http://mp.weixin.qq.com/wiki/3/34904a5db3d0ec7bb5306335b8da1faf.html :param ticket: 摇周边业务的ticket,可在摇到的URL中得到,ticket生效时间为30分钟 :return: 设备及用户信息
[ "获取摇周边的设备及用户信息", "详情请参考", "http", ":", "//", "mp", ".", "weixin", ".", "qq", ".", "com", "/", "wiki", "/", "3", "/", "34904a5db3d0ec7bb5306335b8da1faf", ".", "html" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/shakearound.py#L290-L306
train
get_shake_info 获取摇周边的设备及用户信息
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/shakearound.py
WeChatShakeAround.get_device_statistics
def get_device_statistics(self, begin_date, end_date, device_id=None, uuid=None, major=None, minor=None): """ 以设备为维度的数据统计接口 http://mp.weixin.qq.com/wiki/0/8a24bcacad40fe7ee98d1573cb8a6764.html :param begin_date: 起始时间,最长时间跨度为30天 :param end_date: 结束时间...
python
def get_device_statistics(self, begin_date, end_date, device_id=None, uuid=None, major=None, minor=None): """ 以设备为维度的数据统计接口 http://mp.weixin.qq.com/wiki/0/8a24bcacad40fe7ee98d1573cb8a6764.html :param begin_date: 起始时间,最长时间跨度为30天 :param end_date: 结束时间...
[ "def", "get_device_statistics", "(", "self", ",", "begin_date", ",", "end_date", ",", "device_id", "=", "None", ",", "uuid", "=", "None", ",", "major", "=", "None", ",", "minor", "=", "None", ")", ":", "data", "=", "{", "'device_identifier'", ":", "{", ...
以设备为维度的数据统计接口 http://mp.weixin.qq.com/wiki/0/8a24bcacad40fe7ee98d1573cb8a6764.html :param begin_date: 起始时间,最长时间跨度为30天 :param end_date: 结束时间,最长时间跨度为30天 :param device_id: 设备编号,若填了UUID、major、minor,则可不填设备编号,若二者都填,则以设备编号为优先 :param uuid: UUID :param major: major :param...
[ "以设备为维度的数据统计接口", "http", ":", "//", "mp", ".", "weixin", ".", "qq", ".", "com", "/", "wiki", "/", "0", "/", "8a24bcacad40fe7ee98d1573cb8a6764", ".", "html" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/shakearound.py#L308-L336
train
Get device statistics.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/shakearound.py
WeChatShakeAround.get_page_statistics
def get_page_statistics(self, page_id, begin_date, end_date): """ 以页面为维度的数据统计接口 详情请参考 http://mp.weixin.qq.com/wiki/0/8a24bcacad40fe7ee98d1573cb8a6764.html :param page_id: 页面 ID :param begin_date: 起始时间,最长时间跨度为30天 :param end_date: 结束时间,最长时间跨度为30天 :return: 统...
python
def get_page_statistics(self, page_id, begin_date, end_date): """ 以页面为维度的数据统计接口 详情请参考 http://mp.weixin.qq.com/wiki/0/8a24bcacad40fe7ee98d1573cb8a6764.html :param page_id: 页面 ID :param begin_date: 起始时间,最长时间跨度为30天 :param end_date: 结束时间,最长时间跨度为30天 :return: 统...
[ "def", "get_page_statistics", "(", "self", ",", "page_id", ",", "begin_date", ",", "end_date", ")", ":", "res", "=", "self", ".", "_post", "(", "'shakearound/statistics/page'", ",", "data", "=", "{", "'page_id'", ":", "page_id", ",", "'begin_date'", ":", "se...
以页面为维度的数据统计接口 详情请参考 http://mp.weixin.qq.com/wiki/0/8a24bcacad40fe7ee98d1573cb8a6764.html :param page_id: 页面 ID :param begin_date: 起始时间,最长时间跨度为30天 :param end_date: 结束时间,最长时间跨度为30天 :return: 统计数据
[ "以页面为维度的数据统计接口", "详情请参考", "http", ":", "//", "mp", ".", "weixin", ".", "qq", ".", "com", "/", "wiki", "/", "0", "/", "8a24bcacad40fe7ee98d1573cb8a6764", ".", "html" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/shakearound.py#L338-L358
train
Get statistics for a page.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/shakearound.py
WeChatShakeAround.get_apply_status
def get_apply_status(self, apply_id): """ 查询设备ID申请审核状态 详情请参考 http://mp.weixin.qq.com/wiki/15/b9e012f917e3484b7ed02771156411f3.html :param apply_id: 批次ID,申请设备ID时所返回的批次ID :return: 批次状态信息 """ res = self._post( 'shakearound/device/applystatus', ...
python
def get_apply_status(self, apply_id): """ 查询设备ID申请审核状态 详情请参考 http://mp.weixin.qq.com/wiki/15/b9e012f917e3484b7ed02771156411f3.html :param apply_id: 批次ID,申请设备ID时所返回的批次ID :return: 批次状态信息 """ res = self._post( 'shakearound/device/applystatus', ...
[ "def", "get_apply_status", "(", "self", ",", "apply_id", ")", ":", "res", "=", "self", ".", "_post", "(", "'shakearound/device/applystatus'", ",", "data", "=", "{", "'apply_id'", ":", "apply_id", ",", "}", ",", "result_processor", "=", "lambda", "x", ":", ...
查询设备ID申请审核状态 详情请参考 http://mp.weixin.qq.com/wiki/15/b9e012f917e3484b7ed02771156411f3.html :param apply_id: 批次ID,申请设备ID时所返回的批次ID :return: 批次状态信息
[ "查询设备ID申请审核状态", "详情请参考", "http", ":", "//", "mp", ".", "weixin", ".", "qq", ".", "com", "/", "wiki", "/", "15", "/", "b9e012f917e3484b7ed02771156411f3", ".", "html" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/shakearound.py#L360-L376
train
Get apply status.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/pay/api/withhold.py
WeChatWithhold.apply_signing
def apply_signing(self, plan_id, contract_code, contract_display_account, notify_url, version="1.0", clientip=None, deviceid=None, mobile=None, email=None, qq=None, request_serial=None, openid=None, creid=None, outerid=None): """ 申请签约 api https://pay....
python
def apply_signing(self, plan_id, contract_code, contract_display_account, notify_url, version="1.0", clientip=None, deviceid=None, mobile=None, email=None, qq=None, request_serial=None, openid=None, creid=None, outerid=None): """ 申请签约 api https://pay....
[ "def", "apply_signing", "(", "self", ",", "plan_id", ",", "contract_code", ",", "contract_display_account", ",", "notify_url", ",", "version", "=", "\"1.0\"", ",", "clientip", "=", "None", ",", "deviceid", "=", "None", ",", "mobile", "=", "None", ",", "email...
申请签约 api https://pay.weixin.qq.com/wiki/doc/api/pap.php?chapter=18_1&index=1 :param plan_id: 模板id 协议模板id,设置路径见开发步骤。 :param contract_code: 签约协议号 商户侧的签约协议号,由商户生成 :param contract_display_account: 用户账户展示名称 签约用户的名称,用于页面展示,页面样例可见案例与规范 :param notify_url: 回调通知url 用于接收签约成功消息的回调通知地址,以htt...
[ "申请签约", "api" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/pay/api/withhold.py#L16-L69
train
Apply signing to the base payment.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/pay/api/withhold.py
WeChatWithhold.query_signing
def query_signing(self, contract_id=None, plan_id=None, contract_code=None, openid=None, version="1.0"): """ 查询签约关系 api :param contract_id: 可选 委托代扣协议id 委托代扣签约成功后由微信返回的委托代扣协议id,选择contract_id查询,则此参数必填 :param plan_id: 可选 模板id 商户在微信商户平台配置的代扣模板id,选择plan_id+contract_code查询,则此参数必填 :par...
python
def query_signing(self, contract_id=None, plan_id=None, contract_code=None, openid=None, version="1.0"): """ 查询签约关系 api :param contract_id: 可选 委托代扣协议id 委托代扣签约成功后由微信返回的委托代扣协议id,选择contract_id查询,则此参数必填 :param plan_id: 可选 模板id 商户在微信商户平台配置的代扣模板id,选择plan_id+contract_code查询,则此参数必填 :par...
[ "def", "query_signing", "(", "self", ",", "contract_id", "=", "None", ",", "plan_id", "=", "None", ",", "contract_code", "=", "None", ",", "openid", "=", "None", ",", "version", "=", "\"1.0\"", ")", ":", "if", "not", "contract_id", "and", "not", "(", "...
查询签约关系 api :param contract_id: 可选 委托代扣协议id 委托代扣签约成功后由微信返回的委托代扣协议id,选择contract_id查询,则此参数必填 :param plan_id: 可选 模板id 商户在微信商户平台配置的代扣模板id,选择plan_id+contract_code查询,则此参数必填 :param contract_code: 可选 签约协议号 商户请求签约时传入的签约协议号,商户侧须唯一。选择plan_id+contract_code查询,则此参数必填 :param openid: 可选 openid 用户标识,必须保证...
[ "查询签约关系", "api" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/pay/api/withhold.py#L71-L94
train
Query the API for signing.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/pay/api/withhold.py
WeChatWithhold.apply_deduct
def apply_deduct(self, body, total_fee, contract_id, notify_url, out_trade_no=None, detail=None, attach=None, fee_type='CNY', goods_tag=None, clientip=None, deviceid=None, mobile=None, email=None, qq=None, openid=None, creid=None, outerid=None): """ 申请扣款 api ...
python
def apply_deduct(self, body, total_fee, contract_id, notify_url, out_trade_no=None, detail=None, attach=None, fee_type='CNY', goods_tag=None, clientip=None, deviceid=None, mobile=None, email=None, qq=None, openid=None, creid=None, outerid=None): """ 申请扣款 api ...
[ "def", "apply_deduct", "(", "self", ",", "body", ",", "total_fee", ",", "contract_id", ",", "notify_url", ",", "out_trade_no", "=", "None", ",", "detail", "=", "None", ",", "attach", "=", "None", ",", "fee_type", "=", "'CNY'", ",", "goods_tag", "=", "Non...
申请扣款 api :param body: 商品描述 商品或支付单简要描述 :param out_trade_no: 可选 商户订单号 商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号 :param total_fee: 总金额 订单总金额,单位为分,只能为整数,详见支付金额 :param contract_id: 委托代扣协议id 签约成功后,微信返回的委托代扣协议id :param notify_url: 回调通知url 接受扣款结果异步回调通知的url :param detail: 可选 商品详情 商品名称明...
[ "申请扣款", "api" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/pay/api/withhold.py#L96-L156
train
Applydeduct to a base API
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/pay/api/withhold.py
WeChatWithhold.query_order
def query_order(self, transaction_id=None, out_trade_no=None): """ 查询订单 api :param transaction_id: 二选一 微信订单号 微信的订单号,优先使用 :param out_trade_no: 二选一 商户订单号 商户系统内部的订单号,当没提供transaction_id时需要传这个。 :return: 返回的结果信息 """ if not transaction_id and not out_trade_no: ...
python
def query_order(self, transaction_id=None, out_trade_no=None): """ 查询订单 api :param transaction_id: 二选一 微信订单号 微信的订单号,优先使用 :param out_trade_no: 二选一 商户订单号 商户系统内部的订单号,当没提供transaction_id时需要传这个。 :return: 返回的结果信息 """ if not transaction_id and not out_trade_no: ...
[ "def", "query_order", "(", "self", ",", "transaction_id", "=", "None", ",", "out_trade_no", "=", "None", ")", ":", "if", "not", "transaction_id", "and", "not", "out_trade_no", ":", "raise", "ValueError", "(", "\"transaction_id and out_trade_no must be a choice.\"", ...
查询订单 api :param transaction_id: 二选一 微信订单号 微信的订单号,优先使用 :param out_trade_no: 二选一 商户订单号 商户系统内部的订单号,当没提供transaction_id时需要传这个。 :return: 返回的结果信息
[ "查询订单", "api" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/pay/api/withhold.py#L158-L174
train
Query the order for a given transaction_id and out_trade_no.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/pay/api/withhold.py
WeChatWithhold.apply_cancel_signing
def apply_cancel_signing(self, contract_id=None, plan_id=None, contract_code=None, contract_termination_remark=None, version="1.0"): """ 申请解约 https://pay.weixin.qq.com/wiki/doc/api/pap.php?chapter=18_4&index=6 :param contract_id: 合同ID :param plan_id...
python
def apply_cancel_signing(self, contract_id=None, plan_id=None, contract_code=None, contract_termination_remark=None, version="1.0"): """ 申请解约 https://pay.weixin.qq.com/wiki/doc/api/pap.php?chapter=18_4&index=6 :param contract_id: 合同ID :param plan_id...
[ "def", "apply_cancel_signing", "(", "self", ",", "contract_id", "=", "None", ",", "plan_id", "=", "None", ",", "contract_code", "=", "None", ",", "contract_termination_remark", "=", "None", ",", "version", "=", "\"1.0\"", ")", ":", "if", "not", "(", "contrac...
申请解约 https://pay.weixin.qq.com/wiki/doc/api/pap.php?chapter=18_4&index=6 :param contract_id: 合同ID :param plan_id: 模板ID :param contract_code: 合同号 :param contract_termination_remark: 解约原因 :param version: 版本号 :return:
[ "申请解约" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/pay/api/withhold.py#L176-L202
train
Apply cancel signing to the current order.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/scan.py
WeChatScan.modify_product_status
def modify_product_status(self, standard, key, status): """ 提交审核/取消发布商品 详情请参考 http://mp.weixin.qq.com/wiki/15/1007691d0f1c10a0588c6517f12ed70f.html :param standard: 商品编码标准 :param key: 商品编码内容 :param status: 设置发布状态。on 为提交审核,off 为取消发布 :return: 返回的 JSON 数据包 ...
python
def modify_product_status(self, standard, key, status): """ 提交审核/取消发布商品 详情请参考 http://mp.weixin.qq.com/wiki/15/1007691d0f1c10a0588c6517f12ed70f.html :param standard: 商品编码标准 :param key: 商品编码内容 :param status: 设置发布状态。on 为提交审核,off 为取消发布 :return: 返回的 JSON 数据包 ...
[ "def", "modify_product_status", "(", "self", ",", "standard", ",", "key", ",", "status", ")", ":", "data", "=", "{", "'keystandard'", ":", "standard", ",", "'keystr'", ":", "key", ",", "'status'", ":", "status", ",", "}", "return", "self", ".", "_post", ...
提交审核/取消发布商品 详情请参考 http://mp.weixin.qq.com/wiki/15/1007691d0f1c10a0588c6517f12ed70f.html :param standard: 商品编码标准 :param key: 商品编码内容 :param status: 设置发布状态。on 为提交审核,off 为取消发布 :return: 返回的 JSON 数据包
[ "提交审核", "/", "取消发布商品" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/scan.py#L40-L57
train
Modify the status of a product.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/scan.py
WeChatScan.get_product
def get_product(self, standard, key): """ 查询商品信息 详情请参考 http://mp.weixin.qq.com/wiki/15/7fa787701295b884410b5163e13313af.html :param standard: 商品编码标准 :param key: 商品编码内容 :return: 返回的 JSON 数据包 """ data = { 'keystandard': standard, ...
python
def get_product(self, standard, key): """ 查询商品信息 详情请参考 http://mp.weixin.qq.com/wiki/15/7fa787701295b884410b5163e13313af.html :param standard: 商品编码标准 :param key: 商品编码内容 :return: 返回的 JSON 数据包 """ data = { 'keystandard': standard, ...
[ "def", "get_product", "(", "self", ",", "standard", ",", "key", ")", ":", "data", "=", "{", "'keystandard'", ":", "standard", ",", "'keystr'", ":", "key", ",", "}", "return", "self", ".", "_post", "(", "'product/get'", ",", "data", "=", "data", ")" ]
查询商品信息 详情请参考 http://mp.weixin.qq.com/wiki/15/7fa787701295b884410b5163e13313af.html :param standard: 商品编码标准 :param key: 商品编码内容 :return: 返回的 JSON 数据包
[ "查询商品信息" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/scan.py#L94-L109
train
Get product info.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/scan.py
WeChatScan.list_product
def list_product(self, offset=0, limit=10, status=None, key=None): """ 批量查询商品信息 详情请参考 http://mp.weixin.qq.com/wiki/15/7fa787701295b884410b5163e13313af.html :param offset: 可选,批量查询的起始位置,从 0 开始,包含该起始位置 :param limit: 可选,批量查询的数量,默认为 10 :param status: 可选,支持按状态拉取。on为发布...
python
def list_product(self, offset=0, limit=10, status=None, key=None): """ 批量查询商品信息 详情请参考 http://mp.weixin.qq.com/wiki/15/7fa787701295b884410b5163e13313af.html :param offset: 可选,批量查询的起始位置,从 0 开始,包含该起始位置 :param limit: 可选,批量查询的数量,默认为 10 :param status: 可选,支持按状态拉取。on为发布...
[ "def", "list_product", "(", "self", ",", "offset", "=", "0", ",", "limit", "=", "10", ",", "status", "=", "None", ",", "key", "=", "None", ")", ":", "data", "=", "optionaldict", "(", "offset", "=", "offset", ",", "limit", "=", "limit", ",", "status...
批量查询商品信息 详情请参考 http://mp.weixin.qq.com/wiki/15/7fa787701295b884410b5163e13313af.html :param offset: 可选,批量查询的起始位置,从 0 开始,包含该起始位置 :param limit: 可选,批量查询的数量,默认为 10 :param status: 可选,支持按状态拉取。on为发布状态,off为未发布状态, check为审核中状态,reject为审核未通过状态,all为所有状态 :param...
[ "批量查询商品信息" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/scan.py#L111-L131
train
list_product - List all products in a specific order
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/scan.py
WeChatScan.clear_product
def clear_product(self, standard, key): """ 清除商品信息 详情请参考 http://mp.weixin.qq.com/wiki/15/7fa787701295b884410b5163e13313af.html :param standard: 商品编码标准 :param key: 商品编码内容 :return: 返回的 JSON 数据包 """ data = { 'keystandard': standard, ...
python
def clear_product(self, standard, key): """ 清除商品信息 详情请参考 http://mp.weixin.qq.com/wiki/15/7fa787701295b884410b5163e13313af.html :param standard: 商品编码标准 :param key: 商品编码内容 :return: 返回的 JSON 数据包 """ data = { 'keystandard': standard, ...
[ "def", "clear_product", "(", "self", ",", "standard", ",", "key", ")", ":", "data", "=", "{", "'keystandard'", ":", "standard", ",", "'keystr'", ":", "key", ",", "}", "return", "self", ".", "_post", "(", "'product/clear'", ",", "data", "=", "data", ")"...
清除商品信息 详情请参考 http://mp.weixin.qq.com/wiki/15/7fa787701295b884410b5163e13313af.html :param standard: 商品编码标准 :param key: 商品编码内容 :return: 返回的 JSON 数据包
[ "清除商品信息" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/scan.py#L144-L159
train
Clear the product from the cache.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/device.py
WeChatDevice.send_message
def send_message(self, device_type, device_id, user_id, content): """ 主动发送消息给设备 详情请参考 https://iot.weixin.qq.com/wiki/new/index.html?page=3-4-3 :param device_type: 设备类型,目前为“公众账号原始ID” :param device_id: 设备ID :param user_id: 微信用户账号的openid :param content: 消息内容...
python
def send_message(self, device_type, device_id, user_id, content): """ 主动发送消息给设备 详情请参考 https://iot.weixin.qq.com/wiki/new/index.html?page=3-4-3 :param device_type: 设备类型,目前为“公众账号原始ID” :param device_id: 设备ID :param user_id: 微信用户账号的openid :param content: 消息内容...
[ "def", "send_message", "(", "self", ",", "device_type", ",", "device_id", ",", "user_id", ",", "content", ")", ":", "content", "=", "to_text", "(", "base64", ".", "b64encode", "(", "to_binary", "(", "content", ")", ")", ")", "return", "self", ".", "_post...
主动发送消息给设备 详情请参考 https://iot.weixin.qq.com/wiki/new/index.html?page=3-4-3 :param device_type: 设备类型,目前为“公众账号原始ID” :param device_id: 设备ID :param user_id: 微信用户账号的openid :param content: 消息内容,BASE64编码 :return: 返回的 JSON 数据包
[ "主动发送消息给设备", "详情请参考", "https", ":", "//", "iot", ".", "weixin", ".", "qq", ".", "com", "/", "wiki", "/", "new", "/", "index", ".", "html?page", "=", "3", "-", "4", "-", "3" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/device.py#L14-L35
train
Send a message to the device.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/device.py
WeChatDevice.send_status_message
def send_status_message(self, device_type, device_id, user_id, msg_type, device_status): """ 第三方主动发送设备状态消息给微信终端 详情请参考 https://iot.weixin.qq.com/wiki/document-2_10.html :param device_type: 设备类型,目前为“公众账号原始ID” :param device_id: 设备ID :param user_id: 微信用户账号的openid ...
python
def send_status_message(self, device_type, device_id, user_id, msg_type, device_status): """ 第三方主动发送设备状态消息给微信终端 详情请参考 https://iot.weixin.qq.com/wiki/document-2_10.html :param device_type: 设备类型,目前为“公众账号原始ID” :param device_id: 设备ID :param user_id: 微信用户账号的openid ...
[ "def", "send_status_message", "(", "self", ",", "device_type", ",", "device_id", ",", "user_id", ",", "msg_type", ",", "device_status", ")", ":", "return", "self", ".", "_post", "(", "'transmsg'", ",", "data", "=", "{", "'device_type'", ":", "device_type", "...
第三方主动发送设备状态消息给微信终端 详情请参考 https://iot.weixin.qq.com/wiki/document-2_10.html :param device_type: 设备类型,目前为“公众账号原始ID” :param device_id: 设备ID :param user_id: 微信用户账号的openid :param msg_type: 消息类型:2--设备状态消息 :param status: 设备状态:0--未连接, 1--已连接 :return: 返回的 JSON 数据包
[ "第三方主动发送设备状态消息给微信终端", "详情请参考", "https", ":", "//", "iot", ".", "weixin", ".", "qq", ".", "com", "/", "wiki", "/", "document", "-", "2_10", ".", "html" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/device.py#L37-L59
train
Send status message to the device.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/device.py
WeChatDevice.get_qrcode_url
def get_qrcode_url(self, ticket, data=None): """ 通过 ticket 换取二维码地址 详情请参考 https://iot.weixin.qq.com/wiki/new/index.html?page=3-4-4 :param ticket: 二维码 ticket :param data: 额外数据 :return: 二维码地址 """ url = 'https://we.qq.com/d/{ticket}'.format(ticket=tic...
python
def get_qrcode_url(self, ticket, data=None): """ 通过 ticket 换取二维码地址 详情请参考 https://iot.weixin.qq.com/wiki/new/index.html?page=3-4-4 :param ticket: 二维码 ticket :param data: 额外数据 :return: 二维码地址 """ url = 'https://we.qq.com/d/{ticket}'.format(ticket=tic...
[ "def", "get_qrcode_url", "(", "self", ",", "ticket", ",", "data", "=", "None", ")", ":", "url", "=", "'https://we.qq.com/d/{ticket}'", ".", "format", "(", "ticket", "=", "ticket", ")", "if", "data", ":", "if", "isinstance", "(", "data", ",", "(", "dict",...
通过 ticket 换取二维码地址 详情请参考 https://iot.weixin.qq.com/wiki/new/index.html?page=3-4-4 :param ticket: 二维码 ticket :param data: 额外数据 :return: 二维码地址
[ "通过", "ticket", "换取二维码地址", "详情请参考", "https", ":", "//", "iot", ".", "weixin", ".", "qq", ".", "com", "/", "wiki", "/", "new", "/", "index", ".", "html?page", "=", "3", "-", "4", "-", "4" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/device.py#L78-L94
train
get QRS Code URL
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jxtech/wechatpy
wechatpy/client/api/device.py
WeChatDevice.bind
def bind(self, ticket, device_id, user_id): """ 绑定设备 详情请参考 https://iot.weixin.qq.com/wiki/new/index.html?page=3-4-7 :param ticket: 绑定操作合法性的凭证(由微信后台生成,第三方H5通过客户端jsapi获得) :param device_id: 设备id :param user_id: 用户对应的openid :return: 返回的 JSON 数据包 """ ...
python
def bind(self, ticket, device_id, user_id): """ 绑定设备 详情请参考 https://iot.weixin.qq.com/wiki/new/index.html?page=3-4-7 :param ticket: 绑定操作合法性的凭证(由微信后台生成,第三方H5通过客户端jsapi获得) :param device_id: 设备id :param user_id: 用户对应的openid :return: 返回的 JSON 数据包 """ ...
[ "def", "bind", "(", "self", ",", "ticket", ",", "device_id", ",", "user_id", ")", ":", "return", "self", ".", "_post", "(", "'bind'", ",", "data", "=", "{", "'ticket'", ":", "ticket", ",", "'device_id'", ":", "device_id", ",", "'openid'", ":", "user_id...
绑定设备 详情请参考 https://iot.weixin.qq.com/wiki/new/index.html?page=3-4-7 :param ticket: 绑定操作合法性的凭证(由微信后台生成,第三方H5通过客户端jsapi获得) :param device_id: 设备id :param user_id: 用户对应的openid :return: 返回的 JSON 数据包
[ "绑定设备", "详情请参考", "https", ":", "//", "iot", ".", "weixin", ".", "qq", ".", "com", "/", "wiki", "/", "new", "/", "index", ".", "html?page", "=", "3", "-", "4", "-", "7" ]
4df0da795618c0895a10f1c2cde9e9d5c0a93aaa
https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/device.py#L96-L114
train
bind 设备操作合法性的openid
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...