text
stringlengths
81
112k
get the filednames for the idfobject based on endswith def getfieldnamesendswith(idfobject, endswith): """get the filednames for the idfobject based on endswith""" objls = idfobject.objls tmp = [name for name in objls if name.endswith(endswith)] if tmp == []: pass return [name for name in o...
return the field name of the node fluid is only needed if there are air and water nodes fluid is Air or Water or ''. if the fluid is Steam, use Water def getnodefieldname(idfobject, endswith, fluid=None, startswith=None): """return the field name of the node fluid is only needed if there are air an...
rename nodes so that the components get connected fluid is only needed if there are air and water nodes fluid is Air or Water or ''. if the fluid is Steam, use Water def connectcomponents(idf, components, fluid=None): """rename nodes so that the components get connected fluid is only needed if ther...
initialze values for all the inlet outlet nodes for the object. if force == False, it willl init only if field = '' def initinletoutlet(idf, idfobject, thisnode, force=False): """initialze values for all the inlet outlet nodes for the object. if force == False, it willl init only if field = '' """ def ...
insert a list of components into a branch fluid is only needed if there are air and water nodes in same object fluid is Air or Water or ''. if the fluid is Steam, use Water def componentsintobranch(idf, branch, listofcomponents, fluid=None): """insert a list of components into a branch fluid is onl...
make an airloop def makeairloop(idf, loopname, sloop, dloop, testing=None): """make an airloop""" # -------- testing --------- testn = 0 # -------- testing --------- newairloop = idf.newidfobject("AirLoopHVAC".upper(), Name=loopname) # -------- testing --------- testn = doingtesting(testing...
make plant loop with pip components def makeplantloop(idf, loopname, sloop, dloop, testing=None): """make plant loop with pip components""" # -------- <testing --------- testn = 0 # -------- testing> --------- newplantloop = idf.newidfobject("PLANTLOOP", Name=loopname) # -------- <testing -----...
make condenser loop with pipe components def makecondenserloop(idf, loopname, sloop, dloop, testing=None): """make condenser loop with pipe components""" # -------- <testing --------- testn = 0 # -------- testing> --------- newcondenserloop = idf.newidfobject("CondenserLoop".upper(), Name=loopname)...
force it to be a list of tuples def _clean_listofcomponents(listofcomponents): """force it to be a list of tuples""" def totuple(item): """return a tuple""" if isinstance(item, (tuple, list)): return item else: return (item, None) return [totuple(item) for it...
force 3 items in the tuple def _clean_listofcomponents_tuples(listofcomponents_tuples): """force 3 items in the tuple""" def to3tuple(item): """return a 3 item tuple""" if len(item) == 3: return item else: return (item[0], item[1], None) return [to3tuple(item...
get idfobject or make it if it does not exist def getmakeidfobject(idf, key, name): """get idfobject or make it if it does not exist""" idfobject = idf.getobject(key, name) if not idfobject: return idf.newidfobject(key, Name=name) else: return idfobject
do I even use this ? .... yup! I do def replacebranch1(idf, loop, branchname, listofcomponents_tuples, fluid=None, debugsave=False): """do I even use this ? .... yup! I do""" if fluid is None: fluid = '' listofcomponents_tuples = _clean_listofcomponents_tuples(listofcomponents_tu...
It will replace the components in the branch with components in listofcomponents def replacebranch(idf, loop, branch, listofcomponents, fluid=None, debugsave=False, testing=None): """It will replace the components in the branch with components in listof...
the main routine def main(): """the main routine""" from six import StringIO import eppy.iddv7 as iddv7 IDF.setiddname(StringIO(iddv7.iddtxt)) idf1 = IDF(StringIO('')) loopname = "p_loop" sloop = ['sb0', ['sb1', 'sb2', 'sb3'], 'sb4'] dloop = ['db0', ['db1', 'db2', 'db3'], 'db4'] # m...
Area of a polygon poly def area(poly): """Area of a polygon poly""" if len(poly) < 3: # not a plane - no area return 0 total = [0, 0, 0] num = len(poly) for i in range(num): vi1 = poly[i] vi2 = poly[(i+1) % num] prod = np.cross(vi1, vi2) total[0] += prod[0] ...
unit normal vector of plane defined by points pt_a, pt_b, and pt_c def unit_normal(pt_a, pt_b, pt_c): """unit normal vector of plane defined by points pt_a, pt_b, and pt_c""" x_val = np.linalg.det([[1, pt_a[1], pt_a[2]], [1, pt_b[1], pt_b[2]], [1, pt_c[1], pt_c[2]]]) y_val = np.linalg.det([[pt_a[0], 1, pt_...
Width of a polygon poly def width(poly): """Width of a polygon poly""" num = len(poly) - 1 if abs(poly[num][2] - poly[0][2]) < abs(poly[1][2] - poly[0][2]): return dist(poly[num], poly[0]) elif abs(poly[num][2] - poly[0][2]) > abs(poly[1][2] - poly[0][2]): return dist(poly[1], poly[0]) ...
Height of a polygon poly def height(poly): """Height of a polygon poly""" num = len(poly) - 1 if abs(poly[num][2] - poly[0][2]) > abs(poly[1][2] - poly[0][2]): return dist(poly[num], poly[0]) elif abs(poly[num][2] - poly[0][2]) < abs(poly[1][2] - poly[0][2]): return dist(poly[1], poly[0...
angle between two vectors def angle2vecs(vec1, vec2): """angle between two vectors""" # vector a * vector b = |a|*|b|* cos(angle between vector a and vector b) dot = np.dot(vec1, vec2) vec1_modulus = np.sqrt(np.multiply(vec1, vec1).sum()) vec2_modulus = np.sqrt(np.multiply(vec2, vec2).sum()) if...
Azimuth of a polygon poly def azimuth(poly): """Azimuth of a polygon poly""" num = len(poly) - 1 vec = unit_normal(poly[0], poly[1], poly[num]) vec_azi = np.array([vec[0], vec[1], 0]) vec_n = np.array([0, 1, 0]) # update by Santosh # angle2vecs gives the smallest angle between the vectors ...
Tilt of a polygon poly def tilt(poly): """Tilt of a polygon poly""" num = len(poly) - 1 vec = unit_normal(poly[0], poly[1], poly[num]) vec_alt = np.array([vec[0], vec[1], vec[2]]) vec_z = np.array([0, 0, 1]) # return (90 - angle2vecs(vec_alt, vec_z)) # update by Santosh return angle2vecs(ve...
get all the fields that have the key 'field' def getfields(comm): """get all the fields that have the key 'field' """ fields = [] for field in comm: if 'field' in field: fields.append(field) return fields
get the names of the repeating fields def repeatingfieldsnames(fields): """get the names of the repeating fields""" fnames = [field['field'][0] for field in fields] fnames = [bunchhelpers.onlylegalchar(fname) for fname in fnames] fnames = [fname for fname in fnames if bunchhelpers.intinlist(fname.split...
put missing keys in commdct for standard objects return a list of keys where it is unable to do so commdct is not returned, but is updated def missingkeys_standard(commdct, dtls, skiplist=None): """put missing keys in commdct for standard objects return a list of keys where it is unable to do so co...
This is an object list where thre is no first field name to give a hint of what the first field name should be def missingkeys_nonstandard(block, commdct, dtls, objectlist, afield='afiled %s'): """This is an object list where thre is no first field name to give a hint of what the first field name should be...
Return a EventLoop instance. A new instance is created for each new HTTP request. We determine that we're in a new request by inspecting os.environ, which is reset at the start of each request. Also, each thread gets its own loop. def get_event_loop(): """Return a EventLoop instance. A new instance is cr...
Remove all pending events without running any. def clear(self): """Remove all pending events without running any.""" while self.current or self.idlers or self.queue or self.rpcs: current = self.current idlers = self.idlers queue = self.queue rpcs = self.rpcs _logging_debug('Cleari...
Insert event in queue, and keep it sorted assuming queue is sorted. If event is already in queue, insert it to the right of the rightmost event (to keep FIFO order). Optional args lo (default 0) and hi (default len(a)) bound the slice of a to be searched. Args: event: a (time in sec since u...
Schedule a function call at a specific time in the future. def queue_call(self, delay, callback, *args, **kwds): """Schedule a function call at a specific time in the future.""" if delay is None: self.current.append((callback, args, kwds)) return if delay < 1e9: when = delay + self.clock....
Schedule an RPC with an optional callback. The caller must have previously sent the call to the service. The optional callback is called with the remaining arguments. NOTE: If the rpc is a MultiRpc, the callback will be called once for each sub-RPC. TODO: Is this a good idea? def queue_rpc(self, rpc...
Add an idle callback. An idle callback can return True, False or None. These mean: - None: remove the callback (don't reschedule) - False: the callback did no work; reschedule later - True: the callback did some work; reschedule soon If the callback raises an exception, the traceback is logged a...
Run one of the idle callbacks. Returns: True if one was called, False if no idle callback was called. def run_idle(self): """Run one of the idle callbacks. Returns: True if one was called, False if no idle callback was called. """ if not self.idlers or self.inactive >= len(self.idlers...
Run one item (a callback or an RPC wait_any). Returns: A time to sleep if something happened (may be 0); None if all queues are empty. def run0(self): """Run one item (a callback or an RPC wait_any). Returns: A time to sleep if something happened (may be 0); None if all queues are...
Run one item (a callback or an RPC wait_any) or sleep. Returns: True if something happened; False if all queues are empty. def run1(self): """Run one item (a callback or an RPC wait_any) or sleep. Returns: True if something happened; False if all queues are empty. """ delay = self.run...
Helper for GQL parsing to extract values from GQL expressions. This can extract the value from a GQL literal, return a Parameter for a GQL bound parameter (:1 or :foo), and interprets casts like KEY(...) and plain lists of values like (1, 2, 3). Args: func: A string indicating what kind of thing this is. ...
Helper for FQL parsing to turn a property name into a property object. Args: modelclass: The model class specified in the query. name: The property name. This may contain dots which indicate sub-properties of structured properties. Returns: A Property object. Raises: KeyError if the prop...
Parse a GQL query string. Args: query_string: Full GQL query, e.g. 'SELECT * FROM Kind WHERE prop = 1'. *args, **kwds: If present, used to call bind(). Returns: An instance of query_class. def gql(query_string, *args, **kwds): """Parse a GQL query string. Args: query_string: Full GQL query, ...
Parse a GQL query string (internal version). Args: query_string: Full GQL query, e.g. 'SELECT * FROM Kind WHERE prop = 1'. query_class: Optional class to use, default Query. Returns: An instance of query_class. def _gql(query_string, query_class=Query): """Parse a GQL query string (internal version...
Apply the filter to values extracted from an entity. Think of self.match_keys and self.match_values as representing a table with one row. For example: match_keys = ('name', 'age', 'rank') match_values = ('Joe', 24, 5) (Except that in reality, the values are represented by tuples produced...
Internal helper to fix the namespace. This is called to ensure that for queries without an explicit namespace, the namespace used by async calls is the one in effect at the time the async call is made, not the one in effect when the the request is actually generated. def _fix_namespace(self): """I...
Run this query, putting entities into the given queue. def run_to_queue(self, queue, conn, options=None, dsquery=None): """Run this query, putting entities into the given queue.""" try: multiquery = self._maybe_multi_query() if multiquery is not None: yield multiquery.run_to_queue(queue, co...
True if results are guaranteed to contain a unique set of property values. This happens when every property in the group_by is also in the projection. def is_distinct(self): """True if results are guaranteed to contain a unique set of property values. This happens when every property in the group...
Return a new Query with additional filter(s) applied. def filter(self, *args): """Return a new Query with additional filter(s) applied.""" if not args: return self preds = [] f = self.filters if f: preds.append(f) for arg in args: if not isinstance(arg, Node): raise Ty...
Return a new Query with additional sort order(s) applied. def order(self, *args): """Return a new Query with additional sort order(s) applied.""" # q.order(Employee.name, -Employee.age) if not args: return self orders = [] o = self.orders if o: orders.append(o) for arg in args: ...
Map a callback function or tasklet over the query results. Args: callback: A function or tasklet to be applied to each result; see below. merge_future: Optional Future subclass; see below. **q_options: All query options keyword arguments are supported. Callback signature: The callback is nor...
Map a callback function or tasklet over the query results. This is the asynchronous version of Query.map(). def map_async(self, callback, pass_batch_into_callback=None, merge_future=None, **q_options): """Map a callback function or tasklet over the query results. This is the asynchronous ...
Fetch a list of query results, up to a limit. This is the asynchronous version of Query.fetch(). def fetch_async(self, limit=None, **q_options): """Fetch a list of query results, up to a limit. This is the asynchronous version of Query.fetch(). """ if limit is None: default_options = self._...
Internal version of get_async(). def _get_async(self, **q_options): """Internal version of get_async().""" res = yield self.fetch_async(1, **q_options) if not res: raise tasklets.Return(None) raise tasklets.Return(res[0])
Count the number of query results, up to a limit. This is the asynchronous version of Query.count(). def count_async(self, limit=None, **q_options): """Count the number of query results, up to a limit. This is the asynchronous version of Query.count(). """ qry = self._fix_namespace() return q...
Internal version of count_async(). def _count_async(self, limit=None, **q_options): """Internal version of count_async().""" # TODO: Support offset by incorporating it to the limit. if 'offset' in q_options: raise NotImplementedError('.count() and .count_async() do not support ' ...
Fetch a page of results. This is the asynchronous version of Query.fetch_page(). def fetch_page_async(self, page_size, **q_options): """Fetch a page of results. This is the asynchronous version of Query.fetch_page(). """ qry = self._fix_namespace() return qry._fetch_page_async(page_size, **q_...
Internal version of fetch_page_async(). def _fetch_page_async(self, page_size, **q_options): """Internal version of fetch_page_async().""" q_options.setdefault('batch_size', page_size) q_options.setdefault('produce_cursors', True) it = self.iter(limit=page_size + 1, **q_options) results = [] wh...
Helper to construct a QueryOptions object from keyword arguments. Args: q_options: a dict of keyword arguments. Note that either 'options' or 'config' can be used to pass another QueryOptions object, but not both. If another QueryOptions object is given it provides default values. If self....
Return a list giving the parameters required by a query. def analyze(self): """Return a list giving the parameters required by a query.""" class MockBindings(dict): def __contains__(self, key): self[key] = None return True bindings = MockBindings() used = {} ancestor = self.a...
Bind parameter values. Returns a new Query object. def _bind(self, args, kwds): """Bind parameter values. Returns a new Query object.""" bindings = dict(kwds) for i, arg in enumerate(args): bindings[i + 1] = arg used = {} ancestor = self.ancestor if isinstance(ancestor, ParameterizedThi...
Return the cursor before the current item. You must pass a QueryOptions object with produce_cursors=True for this to work. If there is no cursor or no current item, raise BadArgumentError. Before next() has returned there is no cursor. Once the loop is exhausted, this returns the cursor after the...
Return the cursor after the current item. You must pass a QueryOptions object with produce_cursors=True for this to work. If there is no cursor or no current item, raise BadArgumentError. Before next() has returned there is no cursor. Once the loop is exhausted, this returns the cursor after th...
Return a Future whose result will say whether a next item is available. See the module docstring for the usage pattern. def has_next_async(self): """Return a Future whose result will say whether a next item is available. See the module docstring for the usage pattern. """ if self._fut is None: ...
Iterator protocol: get next item or raise StopIteration. def next(self): """Iterator protocol: get next item or raise StopIteration.""" if self._fut is None: self._fut = self._iter.getq() try: try: # The future result is set by this class's _extended_callback # method. #...
Run this query, putting entities into the given queue. def run_to_queue(self, queue, conn, options=None): """Run this query, putting entities into the given queue.""" if options is None: # Default options. offset = None limit = None keys_only = None else: # Capture options we ...
An auto-batching wrapper for memcache.get() or .get_multi(). Args: key: Key to set. This must be a string; no prefix is applied. for_cas: If True, request and store CAS ids on the Context. namespace: Optional namespace. deadline: Optional deadline for the RPC. Returns: A Future ...
A decorator to declare that only the first N arguments may be positional. Note that for methods, n includes 'self'. def positional(max_pos_args): """A decorator to declare that only the first N arguments may be positional. Note that for methods, n includes 'self'. """ __ndb_debug__ = 'SKIP' def position...
Converts a function into a decorator that optionally accepts keyword arguments in its declaration. Example usage: @utils.decorator def decorator(func, args, kwds, op1=None): ... apply op1 ... return func(*args, **kwds) # Form (1), vanilla @decorator foo(...) ... # Form (...
A recursive Fibonacci to exercise task switching. def fibonacci(n): """A recursive Fibonacci to exercise task switching.""" if n <= 1: raise ndb.Return(n) a, b = yield fibonacci(n - 1), fibonacci(n - 2) raise ndb.Return(a + b)
A memoizing recursive Fibonacci to exercise RPCs. def memoizing_fibonacci(n): """A memoizing recursive Fibonacci to exercise RPCs.""" if n <= 1: raise ndb.Return(n) key = ndb.Key(FibonacciMemo, str(n)) memo = yield key.get_async(ndb_should_cache=False) if memo is not None: assert memo.arg == n lo...
Actually run the _todo_tasklet. def run_queue(self, options, todo): """Actually run the _todo_tasklet.""" utils.logging_debug('AutoBatcher(%s): %d items', self._todo_tasklet.__name__, len(todo)) batch_fut = self._todo_tasklet(todo, options) self._running.append(batch_fut) # ...
Adds an arg and gets back a future. Args: arg: one argument for _todo_tasklet. options: rpc options. Return: An instance of future, representing the result of running _todo_tasklet without batching. def add(self, arg, options=None): """Adds an arg and gets back a future. Ar...
Passes exception along. Args: batch_fut: the batch future returned by running todo_tasklet. todo: (fut, option) pair. fut is the future return by each add() call. If the batch fut was successful, it has already called fut.set_result() on other individual futs. This method only handles when the...
Return all namespaces in the specified range. Args: start: only return namespaces >= start if start is not None. end: only return namespaces < end if end is not None. Returns: A list of namespace names between the (optional) start and end values. def get_namespaces(start=None, end=None): """Return ...
Return all kinds in the specified range, for the current namespace. Args: start: only return kinds >= start if start is not None. end: only return kinds < end if end is not None. Returns: A list of kind names between the (optional) start and end values. def get_kinds(start=None, end=None): """Retur...
Return all properties of kind in the specified range. NOTE: This function does not return unindexed properties. Args: kind: name of kind whose properties you want. start: only return properties >= start if start is not None. end: only return properties < end if end is not None. Returns: A list ...
Return all representations of properties of kind in the specified range. NOTE: This function does not return unindexed properties. Args: kind: name of kind whose properties you want. start: only return properties >= start if start is not None. end: only return properties < end if end is not None. R...
Return the version of the entity group containing key. Args: key: a key for an entity group whose __entity_group__ key you want. Returns: The version of the entity group containing key. This version is guaranteed to increase on every change to the entity group. The version may increase even in the...
Return the Key for a namespace. Args: namespace: A string giving the namespace whose key is requested. Returns: The Key for the namespace. def key_for_namespace(cls, namespace): """Return the Key for a namespace. Args: namespace: A string giving the namespace whose key is requested...
Return the __property__ key for property of kind. Args: kind: kind whose key is requested. property: property whose key is requested. Returns: The key for property of kind. def key_for_property(cls, kind, property): """Return the __property__ key for property of kind. Args: k...
Return the kind specified by a given __property__ key. Args: key: key whose kind name is requested. Returns: The kind specified by key. def key_to_kind(cls, key): """Return the kind specified by a given __property__ key. Args: key: key whose kind name is requested. Returns: ...
Return the key for the entity group containing key. Args: key: a key for an entity group whose __entity_group__ key you want. Returns: The __entity_group__ key for the entity group containing key. def key_for_entity_group(cls, key): """Return the key for the entity group containing key. ...
Called by Django before deciding which view to execute. def process_request(self, unused_request): """Called by Django before deciding which view to execute.""" # Compare to the first half of toplevel() in context.py. tasklets._state.clear_all_pending() # Create and install a new context. ctx = tas...
Helper to construct a ContextOptions object from keyword arguments. Args: ctx_options: A dict of keyword arguments. config_cls: Optional Configuration class to use, default ContextOptions. Note that either 'options' or 'config' can be used to pass another Configuration object, but not both. If another ...
Set the context cache policy function. Args: func: A function that accepts a Key instance as argument and returns a bool indicating if it should be cached. May be None. def set_cache_policy(self, func): """Set the context cache policy function. Args: func: A function that accepts a K...
Return whether to use the context cache for this key. Args: key: Key instance. options: ContextOptions instance, or None. Returns: True if the key should be cached, False otherwise. def _use_cache(self, key, options=None): """Return whether to use the context cache for this key. Ar...
Set the memcache policy function. Args: func: A function that accepts a Key instance as argument and returns a bool indicating if it should be cached. May be None. def set_memcache_policy(self, func): """Set the memcache policy function. Args: func: A function that accepts a Key inst...
Return whether to use memcache for this key. Args: key: Key instance. options: ContextOptions instance, or None. Returns: True if the key should be cached in memcache, False otherwise. def _use_memcache(self, key, options=None): """Return whether to use memcache for this key. Args:...
Default datastore policy. This defers to _use_datastore on the Model class. Args: key: Key instance. Returns: A bool or None. def default_datastore_policy(key): """Default datastore policy. This defers to _use_datastore on the Model class. Args: key: Key instance. Re...
Set the context datastore policy function. Args: func: A function that accepts a Key instance as argument and returns a bool indicating if it should use the datastore. May be None. def set_datastore_policy(self, func): """Set the context datastore policy function. Args: func: A funct...
Return whether to use the datastore for this key. Args: key: Key instance. options: ContextOptions instance, or None. Returns: True if the datastore should be used, False otherwise. def _use_datastore(self, key, options=None): """Return whether to use the datastore for this key. Ar...
Default memcache timeout policy. This defers to _memcache_timeout on the Model class. Args: key: Key instance. Returns: Memcache timeout to use (integer), or None. def default_memcache_timeout_policy(key): """Default memcache timeout policy. This defers to _memcache_timeout on the M...
Set the policy function for memcache timeout (expiration). Args: func: A function that accepts a key instance as argument and returns an integer indicating the desired memcache timeout. May be None. If the function returns 0 it implies the default timeout. def set_memcache_timeout_policy(self,...
Return the memcache timeout (expiration) for this key. def _get_memcache_timeout(self, key, options=None): """Return the memcache timeout (expiration) for this key.""" timeout = ContextOptions.memcache_timeout(options) if timeout is None: timeout = self._memcache_timeout_policy(key) if timeout is...
Returns a cached Model instance given the entity key if available. Args: key: Key instance. Returns: A Model instance if the key exists in the cache. def _load_from_cache_if_available(self, key): """Returns a cached Model instance given the entity key if available. Args: key: Key i...
Return a Model instance given the entity key. It will use the context cache if the cache policy for the given key is enabled. Args: key: Key instance. **ctx_options: Context options. Returns: A Model instance if the key exists in the datastore; None otherwise. def get(self, key, **...
Call a callback upon successful commit of a transaction. If not in a transaction, the callback is called immediately. In a transaction, multiple callbacks may be registered and will be called once the transaction commits, in the order in which they were registered. If the transaction fails, the callb...
Return a Future for a nickname from an account. def get_nickname(userid): """Return a Future for a nickname from an account.""" account = yield get_account(userid) if not account: nickname = 'Unregistered' else: nickname = account.nickname or account.email raise ndb.Return(nickname)
Marks a task as done. Args: task_id: The integer id of the task to update. Raises: ValueError: if the requested task doesn't exist. def mark_done(task_id): """Marks a task as done. Args: task_id: The integer id of the task to update. Raises: ValueError: if the requested task doesn't exist...
Converts a list of tasks to a list of string representations. Args: tasks: A list of the tasks to convert. Returns: A list of string formatted tasks. def format_tasks(tasks): """Converts a list of tasks to a list of string representations. Args: tasks: A list of the tasks to convert. Returns: ...
Accepts a string command and performs an action. Args: command: the command to run as a string. def handle_command(command): """Accepts a string command and performs an action. Args: command: the command to run as a string. """ try: cmds = command.split(None, 1) cmd = cmds[0] if cmd == ...
Async version of delete(). def delete_async(blob_key, **options): """Async version of delete().""" if not isinstance(blob_key, (basestring, BlobKey)): raise TypeError('Expected blob key, got %r' % (blob_key,)) rpc = blobstore.create_rpc(**options) yield blobstore.delete_async(blob_key, rpc=rpc)
Async version of delete_multi(). def delete_multi_async(blob_keys, **options): """Async version of delete_multi().""" if isinstance(blob_keys, (basestring, BlobKey)): raise TypeError('Expected a list, got %r' % (blob_key,)) rpc = blobstore.create_rpc(**options) yield blobstore.delete_async(blob_keys, rpc=r...
Create upload URL for POST form. Args: success_path: Path within application to call when POST is successful and upload is complete. max_bytes_per_blob: The maximum size in bytes that any one blob in the upload can be or None for no maximum size. max_bytes_total: The maximum size in bytes tha...
Async version of create_upload_url(). def create_upload_url_async(success_path, max_bytes_per_blob=None, max_bytes_total=None, **options): """Async version of create_upload_url().""" rpc = blobstore.create_rpc(**options) rpc = bl...