text stringlengths 81 112k |
|---|
:return: the :class:`Document` node that contains this node,
or ``self`` if this node is the document.
def document(self):
"""
:return: the :class:`Document` node that contains this node,
or ``self`` if this node is the document.
"""
if self.is_document:
... |
:return: the root :class:`Element` node of the document that
contains this node, or ``self`` if this node is the root element.
def root(self):
"""
:return: the root :class:`Element` node of the document that
contains this node, or ``self`` if this node is the root element.
... |
Convert a list of underlying implementation nodes into a list of
*xml4h* wrapper nodes.
def _convert_nodelist(self, impl_nodelist):
"""
Convert a list of underlying implementation nodes into a list of
*xml4h* wrapper nodes.
"""
nodelist = [
self.adapter.wrap_... |
:return: the parent of this node, or *None* of the node has no parent.
def parent(self):
"""
:return: the parent of this node, or *None* of the node has no parent.
"""
parent_impl_node = self.adapter.get_node_parent(self.impl_node)
return self.adapter.wrap_node(
pare... |
:return: a :class:`NodeList` of this node's child nodes.
def children(self):
"""
:return: a :class:`NodeList` of this node's child nodes.
"""
impl_nodelist = self.adapter.get_node_children(self.impl_node)
return self._convert_nodelist(impl_nodelist) |
:return: the first child node matching the given constraints, or \
*None* if there are no matching child nodes.
Delegates to :meth:`NodeList.filter`.
def child(self, local_name=None, name=None, ns_uri=None, node_type=None,
filter_fn=None):
"""
:return: the first ch... |
:return: a list of this node's sibling nodes.
:rtype: NodeList
def siblings(self):
"""
:return: a list of this node's sibling nodes.
:rtype: NodeList
"""
impl_nodelist = self.adapter.get_node_children(self.parent.impl_node)
return self._convert_nodelist(
... |
:return: a list of this node's siblings that occur *before* this
node in the DOM.
def siblings_before(self):
"""
:return: a list of this node's siblings that occur *before* this
node in the DOM.
"""
impl_nodelist = self.adapter.get_node_children(self.parent.impl_... |
:return: a list of this node's siblings that occur *after* this
node in the DOM.
def siblings_after(self):
"""
:return: a list of this node's siblings that occur *after* this
node in the DOM.
"""
impl_nodelist = self.adapter.get_node_children(self.parent.impl_nod... |
Delete this node from the owning document.
:param bool destroy: if True the child node will be destroyed in
addition to being removed from the document.
:returns: the removed child node, or *None* if the child was destroyed.
def delete(self, destroy=True):
"""
Delete this ... |
Clone a node from another document to become a child of this node, by
copying the node's data into this document but leaving the node
untouched in the source document. The node to be cloned can be
a :class:`Node` based on the same underlying XML library implementation
and adapter, or a "... |
Transplant a node from another document to become a child of this node,
removing it from the source document. The node to be transplanted can
be a :class:`Node` based on the same underlying XML library
implementation and adapter, or a "raw" node from that implementation.
:param node: t... |
Find :class:`Element` node descendants of this node, with optional
constraints to limit the results.
:param name: limit results to elements with this name.
If *None* or ``'*'`` all element names are matched.
:type name: string or None
:param ns_uri: limit results to elements... |
Find the first :class:`Element` node descendant of this node that
matches any optional constraints, or None if there are no matching
elements.
Delegates to :meth:`find` with ``first_only=True``.
def find_first(self, name=None, ns_uri=None):
"""
Find the first :class:`Element` n... |
Find :class:`Element` node descendants of the document containing
this node, with optional constraints to limit the results.
Delegates to :meth:`find` applied to this node's owning document.
def find_doc(self, name=None, ns_uri=None, first_only=False):
"""
Find :class:`Element` node de... |
Serialize this node and its descendants to text, writing
the output to a given *writer* or to stdout.
:param writer: an object such as a file or stream to which XML text
is sent. If *None* text is sent to :attr:`sys.stdout`.
:type writer: a file, stream, etc or None
:param s... |
:return: this node as XML text.
Delegates to :meth:`write`
def xml(self, indent=4, **kwargs):
"""
:return: this node as XML text.
Delegates to :meth:`write`
"""
writer = StringIO()
self.write(writer, indent=indent, **kwargs)
return writer.getvalue() |
Perform an XPath query on the current node.
:param string xpath: XPath query.
:param dict kwargs: Optional keyword arguments that are passed through
to the underlying XML library implementation.
:return: results of the query as a list of :class:`Node` objects, or
a list... |
Add or update this element's attributes, where attributes can be
specified in a number of ways.
:param attr_obj: a dictionary or list of attribute name/value pairs.
:type attr_obj: dict, list, tuple, or None
:param ns_uri: a URI defining a namespace for the new attributes.
:type... |
Get or set this element's attributes as name/value pairs.
.. note::
Setting element attributes via this accessor will **remove**
any existing attributes, as opposed to the :meth:`set_attributes`
method which only updates and replaces them.
def attributes(self):
"""
... |
:return: a list of this element's attributes as
:class:`Attribute` nodes.
def attribute_nodes(self):
"""
:return: a list of this element's attributes as
:class:`Attribute` nodes.
"""
impl_attr_nodes = self.adapter.get_node_attributes(self.impl_node)
wrapp... |
:param string name: the name of the attribute to return.
:param ns_uri: a URI defining a namespace constraint on the attribute.
:type ns_uri: string or None
:return: this element's attributes that match ``ns_uri`` as
:class:`Attribute` nodes.
def attribute_node(self, name, ns_uri=N... |
Define a namespace prefix that will serve as shorthand for the given
namespace URI in element names.
:param string prefix: prefix that will serve as an alias for a
the namespace URI.
:param string ns_uri: namespace URI that will be denoted by the
prefix.
def set_ns_pref... |
Add a new child element to this element, with an optional namespace
definition. If no namespace is provided the child will be assigned
to the default namespace.
:param string name: a name for the child node. The name may be used
to apply a namespace to the child by including:
... |
Add a text node to this element.
Adding text with this method is subtly different from assigning a new
text value with :meth:`text` accessor, because it "appends" to rather
than replacing this element's set of text nodes.
:param text: text content to add to this element.
:param... |
Add an instruction node to this element.
:param string text: text content to add as an instruction.
def add_instruction(self, target, data):
"""
Add an instruction node to this element.
:param string text: text content to add as an instruction.
"""
self._add_instructio... |
:return: a list of name/value attribute pairs sorted by attribute name.
def items(self):
"""
:return: a list of name/value attribute pairs sorted by attribute name.
"""
sorted_keys = sorted(self.keys())
return [(k, self[k]) for k in sorted_keys] |
:param string name: the name of an attribute to look up.
:return: the namespace URI associated with the named attribute,
or None.
def namespace_uri(self, name):
"""
:param string name: the name of an attribute to look up.
:return: the namespace URI associated with the name... |
:param string name: the name of an attribute to look up.
:return: the prefix component of the named attribute's name,
or None.
def prefix(self, name):
"""
:param string name: the name of an attribute to look up.
:return: the prefix component of the named attribute's name,
... |
:return: the :class:`Element` that contains these attributes.
def element(self):
"""
:return: the :class:`Element` that contains these attributes.
"""
return self.adapter.wrap_node(
self.impl_element, self.adapter.impl_document, self.adapter) |
Apply filters to the set of nodes in this list.
:param local_name: a local name used to filter the nodes.
:type local_name: string or None
:param name: a name used to filter the nodes.
:type name: string or None
:param ns_uri: a namespace URI used to filter the nodes.
... |
Get all analytics of a job.
def get_all_analytics(user, job_id):
"""Get all analytics of a job."""
args = schemas.args(flask.request.args.to_dict())
v1_utils.verify_existence_and_get(job_id, models.JOBS)
query = v1_utils.QueryBuilder(_TABLE, args, _A_COLUMNS)
# If not admin nor rh employee then r... |
Get an analytic.
def get_analytic(user, job_id, anc_id):
"""Get an analytic."""
v1_utils.verify_existence_and_get(job_id, models.JOBS)
analytic = v1_utils.verify_existence_and_get(anc_id, _TABLE)
analytic = dict(analytic)
if not user.is_in_team(analytic['team_id']):
raise dci_exc.Unauthori... |
Serialize an *xml4h* DOM node and its descendants to text, writing
the output to a given *writer* or to stdout.
:param node: the DOM node whose content and descendants will
be serialized.
:type node: an :class:`xml4h.nodes.Node` or subclass
:param writer: an object such as a file or stream to w... |
When bool_encry is True, encrypt a chunk of the file with the key and a randomly generated nonce. When it is False,
the function extract the nonce from the cipherchunk (first 16 bytes), and decrypt the rest of the chunk.
:param chunk: a chunk in bytes to encrypt or decrypt.
:param key: a 32 bytes key in byt... |
Query Bugzilla API to retrieve the needed infos.
def retrieve_info(self):
"""Query Bugzilla API to retrieve the needed infos."""
scheme = urlparse(self.url).scheme
netloc = urlparse(self.url).netloc
query = urlparse(self.url).query
if scheme not in ('http', 'https'):
... |
'Minimum length' validation_function generator.
Returns a validation_function to check that len(x) >= min_length (strict=False, default)
or len(x) > min_length (strict=True)
:param min_length: minimum length for x
:param strict: Boolean flag to switch between len(x) >= min_length (strict=False) and len... |
'Maximum length' validation_function generator.
Returns a validation_function to check that len(x) <= max_length (strict=False, default) or len(x) < max_length (strict=True)
:param max_length: maximum length for x
:param strict: Boolean flag to switch between len(x) <= max_length (strict=False) and len(x) ... |
'length equals' validation function generator.
Returns a validation_function to check that `len(x) == ref_length`
:param ref_length:
:return:
def has_length(ref_length):
"""
'length equals' validation function generator.
Returns a validation_function to check that `len(x) == ref_length`
:... |
'Is length between' validation_function generator.
Returns a validation_function to check that `min_len <= len(x) <= max_len (default)`. `open_right` and `open_left`
flags allow to transform each side into strict mode. For example setting `open_left=True` will enforce
`min_len < len(x) <= max_len`.
:pa... |
'Values in' validation_function generator.
Returns a validation_function to check that x is in the provided set of allowed values
:param allowed_values: a set of allowed values
:return:
def is_in(allowed_values # type: Set
):
"""
'Values in' validation_function generator.
Returns a ... |
'Is subset' validation_function generator.
Returns a validation_function to check that x is a subset of reference_set
:param reference_set: the reference set
:return:
def is_subset(reference_set # type: Set
):
"""
'Is subset' validation_function generator.
Returns a validation_f... |
'Contains' validation_function generator.
Returns a validation_function to check that `ref_value in x`
:param ref_value: a value that must be present in x
:return:
def contains(ref_value):
"""
'Contains' validation_function generator.
Returns a validation_function to check that `ref_value in x... |
'Is superset' validation_function generator.
Returns a validation_function to check that x is a superset of reference_set
:param reference_set: the reference set
:return:
def is_superset(reference_set # type: Set
):
"""
'Is superset' validation_function generator.
Returns a va... |
Generates a validation_function for collection inputs where each element of the input will be validated against the
validation_functions provided. For convenience, a list of validation_functions can be provided and will be replaced
with an 'and_'.
Note that if you want to apply DIFFERENT validation_functio... |
Generates a validation_function for collection inputs where each element of the input will be validated against the
corresponding validation_function(s) in the validation_functions_collection. Validators inside the tuple can be
provided as a list for convenience, this will be replaced with an 'and_' operator if... |
Get all the jobs events from a given sequence number.
def get_jobs_events_from_sequence(user, sequence):
"""Get all the jobs events from a given sequence number."""
args = schemas.args(flask.request.args.to_dict())
if user.is_not_super_admin():
raise dci_exc.Unauthorized()
query = sql.select... |
Constructs a :class:`~mwxml.iteration.dump.Dump` from a `file` pointer.
:Parameters:
f : `file`
A plain text file pointer containing XML to process
def from_file(cls, f):
"""
Constructs a :class:`~mwxml.iteration.dump.Dump` from a `file` pointer.
:Parameter... |
Constructs a :class:`~mwxml.iteration.dump.Dump` from a <page> block.
:Parameters:
page_xml : `str` | `file`
Either a plain string or a file containing <page> block XML to
process
def from_page_xml(cls, page_xml):
"""
Constructs a :class:`~mwxml.iter... |
Calculate a 32 bytes key derivation with Argon2.
:param passphrase: A string of any length specified by user.
:param salt: 512 bits generated by Botan Random Number Generator.
:return: a 32 bytes keys.
def calc_derivation(passphrase, salt):
"""
Calculate a 32 bytes key derivation with Argon2.
:... |
Return contatenated value of all text node children of this element
def get_node_text(self, node):
"""
Return contatenated value of all text node children of this element
"""
text_children = [n.nodeValue for n in self.get_node_children(node)
if n.nodeType == xml... |
Set text value as sole Text child node of element; any existing
Text nodes are removed
def set_node_text(self, node, text):
"""
Set text value as sole Text child node of element; any existing
Text nodes are removed
"""
# Remove any existing Text node children
for... |
Create strings from glob strings.
def _get_contents(self):
"""Create strings from glob strings."""
def files():
for value in super(GlobBundle, self)._get_contents():
for path in glob.glob(value):
yield path
return list(files()) |
Test if the given type is a generic type. This includes Generic itself, but
excludes special typing constructs such as Union, Tuple, Callable, ClassVar.
Examples::
is_generic_type(int) == False
is_generic_type(Union[int, str]) == False
is_generic_type(Union[int, T]) == False
is_... |
Test if the type is a union type. Examples::
is_union_type(int) == False
is_union_type(Union) == True
is_union_type(Union[int, int]) == False
is_union_type(Union[T, int]) == True
def is_union_type(tp):
"""Test if the type is a union type. Examples::
is_union_type(int) == F... |
Test if the type represents a class variable. Examples::
is_classvar(int) == False
is_classvar(ClassVar) == True
is_classvar(ClassVar[int]) == True
is_classvar(ClassVar[List[T]]) == True
def is_classvar(tp):
"""Test if the type represents a class variable. Examples::
is_cl... |
Parse an XML document into an *xml4h*-wrapped DOM representation
using an underlying XML library implementation.
:param to_parse: an XML document file, document string, or the
path to an XML file. If a string value is given that contains
a ``<`` character it is treated as literal XML data, othe... |
Return a :class:`~xml4h.builder.Builder` that represents an element in
a new or existing XML DOM and provides "chainable" methods focussed
specifically on adding XML content.
:param tagname_or_element: a string name for the root node of a
new XML document, or an :class:`~xml4h.nodes.Element` node i... |
Returns a user-friendly description of a NonePolicy taking into account NoneArgPolicy
:param none_policy:
:param verbose:
:return:
def get_none_policy_text(none_policy, # type: int
verbose=False # type: bool
):
"""
Returns a user-friendly descri... |
Adds a wrapper or nothing around the provided validation_callable, depending on the selected policy
:param validation_callable:
:param none_policy: an int representing the None policy, see NonePolicy
:return:
def _add_none_handler(validation_callable, # type: Callable
none_policy ... |
Utility method to create a new type dynamically, inheriting from both error_type (first) and additional_type
(second). The class representation (repr(cls)) of the resulting class reflects this by displaying both names
(fully qualified for the first type, __name__ for the second)
For example
```
> n... |
Validates value `value` using validation function(s) `base_validator_s`.
As opposed to `is_valid`, this function raises a `ValidationError` if validation fails.
It is therefore designed to be used for defensive programming, in an independent statement before the code that you
intent to protect.
```pyt... |
Validates value `value` using validation function(s) `validator_func`.
As opposed to `assert_valid`, this function returns a boolean indicating if validation was a success or a failure.
It is therefore designed to be used within if ... else ... statements:
```python
if is_valid(x, isfinite):
..... |
Creates an instance without using a Validator.
This method is not the primary way that errors are created - they should rather created by the validation entry
points. However it can be handy in rare edge cases.
:param validation_function_name:
:param var_name:
:param var_value:... |
The function called to get the details appended to the help message when self.append_details is True
def get_details(self):
""" The function called to get the details appended to the help message when self.append_details is True """
# create the exception main message according to the type of result
... |
Utility method to get the variable value or 'var_name=value' if name is not None.
Note that values with large string representations will not get printed
:return:
def get_variable_str(self):
"""
Utility method to get the variable value or 'var_name=value' if name is not None.
N... |
Asserts that the provided named value is valid with respect to the inner base validation functions. It returns
silently in case of success, and raises a `ValidationError` or a subclass in case of failure. This corresponds
to a 'Defensive programming' (sometimes known as 'Offensive programming') mode.
... |
The function doing the final error raising.
def _create_validation_error(self,
name, # type: str
value, # type: Any
validation_outcome=None, # type: Any
... |
Validates the provided value and returns a boolean indicating success or failure. Any Exception happening in
the validation process will be silently caught.
:param value: the value to validate
:return: a boolean flag indicating success or failure
def is_valid(self,
value # ty... |
Create a tag.
def create_tags(user):
"""Create a tag."""
values = {
'id': utils.gen_uuid(),
'created_at': datetime.datetime.utcnow().isoformat()
}
values.update(schemas.tag.post(flask.request.json))
with flask.g.db_conn.begin():
where_clause = sql.and_(
_TABLE.c... |
Get all tags.
def get_tags(user):
"""Get all tags."""
args = schemas.args(flask.request.args.to_dict())
query = v1_utils.QueryBuilder(_TABLE, args, _T_COLUMNS)
nb_rows = query.get_number_of_rows()
rows = query.execute(fetchall=True)
rows = v1_utils.format_result(rows, _TABLE.name)
return fl... |
Delete a tag.
def delete_tag_by_id(user, tag_id):
"""Delete a tag."""
query = _TABLE.delete().where(_TABLE.c.id == tag_id)
result = flask.g.db_conn.execute(query)
if not result.rowcount:
raise dci_exc.DCIConflict('Tag deletion conflict', tag_id)
return flask.Response(None, 204, content_ty... |
Initialize application object.
:param app: An instance of :class:`~flask.Flask`.
:param entry_point_group: A name of entry point group used to load
``webassets`` bundles.
.. versionchanged:: 1.0.0b2
The *entrypoint* has been renamed to *entry_point_group*.
def init_app(... |
Initialize configuration.
:param app: An instance of :class:`~flask.Flask`.
def init_config(self, app):
"""Initialize configuration.
:param app: An instance of :class:`~flask.Flask`.
"""
app.config.setdefault('REQUIREJS_BASEURL', app.static_folder)
app.config.setdefaul... |
Load entrypoint.
:param entry_point_group: A name of entry point group used to load
``webassets`` bundles.
.. versionchanged:: 1.0.0b2
The *entrypoint* has been renamed to *entry_point_group*.
def load_entrypoint(self, entry_point_group):
"""Load entrypoint.
:p... |
An inlined version of instance_of(var_types)(value) without 'return True': it does not return anything in case of
success, and raises a HasWrongType exception in case of failure.
Used in validate and validation/validator
:param value: the value to check
:param allowed_types: the type(s) to enforce. If... |
An inlined version of subclass_of(var_types)(value) without 'return True': it does not return anything in case of
success, and raises a IsWrongType exception in case of failure.
Used in validate and validation/validator
:param typ: the type to check
:param allowed_types: the type(s) to enforce. If a t... |
A validation function for quick inline validation of `value`, with minimal capabilities:
* None handling: reject None (enforce_not_none=True, default), or accept None silently (enforce_not_none=False)
* Type validation: `value` should be an instance of any of `var_types` if provided
* Value validation:
... |
'Greater than' validation_function generator.
Returns a validation_function to check that x >= min_value (strict=False, default) or x > min_value (strict=True)
:param min_value: minimum value for x
:param strict: Boolean flag to switch between x >= min_value (strict=False) and x > min_value (strict=True)
... |
'Lesser than' validation_function generator.
Returns a validation_function to check that x <= max_value (strict=False, default) or x < max_value (strict=True)
:param max_value: maximum value for x
:param strict: Boolean flag to switch between x <= max_value (strict=False) and x < max_value (strict=True)
... |
'Is between' validation_function generator.
Returns a validation_function to check that min_val <= x <= max_val (default). open_right and open_left flags allow
to transform each side into strict mode. For example setting open_left=True will enforce min_val < x <= max_val
:param min_val: minimum value for x... |
This is the main method for the sub=process, everything we need to create the message pump and
channel it needs to be passed in as parameters that can be pickled as when we run they will be serialized
into this process. The data should be value types, not reference types as we will receive a copy of the origina... |
Run migrations in 'offline' mode.
This configures the context with just a URL
and not an Engine, though an Engine is acceptable
here as well. By skipping the Engine creation
we don't even need a DBAPI to be available.
Calls to context.execute() here emit the given string to the
script output.... |
Run migrations in 'online' mode.
In this scenario we need to create an Engine
and associate a connection with the context.
def run_migrations_online():
"""Run migrations in 'online' mode.
In this scenario we need to create an Engine
and associate a connection with the context.
"""
app_co... |
Sends a 401 reject response that enables basic auth.
def reject():
"""Sends a 401 reject response that enables basic auth."""
auth_message = ('Could not verify your access level for that URL.'
'Please login with proper credentials.')
auth_message = json.dumps({'_status': 'Unauthorized'... |
Modify a contact.
Returns status message
Optional Parameters:
* name -- Contact name
Type: String
* email -- Contact email address
Type: String
* cellphone -- Cellphone number, without the country code part. In
... |
We don't use a pool here. We only have one consumer connection per process, so
we get no value from a pool, and we want to use a heartbeat to keep the consumer
collection alive, which does not work with a pool
:return: the connection to the transport
def _establish_connection(self, conn: Broker... |
For a long runing handler, there is a danger that we do not send a heartbeat message or activity on the
connection whilst we are running the handler. With a default heartbeat of 30s, for example, there is a risk
that a handler which takes more than 15s will fail to send the heartbeat in time and then th... |
If the topic has it's export_control set to True then all the teams
under the product team can access to the topic's resources.
:param user:
:param topic:
:return: True if check is ok, False otherwise
def _check(user, topic):
"""If the topic has it's export_control set to True then all the teams
... |
Ensure the proper content is uploaded.
Stream might be already consumed by authentication process.
Hence flask.request.stream might not be readable and return improper value.
This methods checks if the stream has already been consumed and if so
retrieve the data from flask.request.data where it has be... |
Return result of performing the given XPath query on the given node.
All known namespace prefix-to-URI mappings in the document are
automatically included in the XPath invocation.
If an empty/default namespace (i.e. None) is defined, this is
converted to the prefix name '_' so it can b... |
Return True if the given namespace name/value is defined in an
ancestor of the given node, meaning that the given node need not
have its own attributes to apply that namespacing.
def _is_ns_in_ancestor(self, node, name, value):
"""
Return True if the given namespace name/value is define... |
Find blog entries with the most comments:
qs = generic_annotate(Entry.objects.public(), Comment.objects.public(), Count('comments__id'))
for entry in qs:
print entry.title, entry.score
Find the highest rated foods:
generic_annotate(Food, Rating, Avg('ratings__ratin... |
Find total number of comments on blog entries:
generic_aggregate(Entry.objects.public(), Comment.objects.public(), Count('comments__id'))
Find the average rating for foods starting with 'a':
a_foods = Food.objects.filter(name__startswith='a')
generic_aggregate(a_foods, Rating,... |
Only show me ratings made on foods that start with "a":
a_foods = Food.objects.filter(name__startswith='a')
generic_filter(Rating.objects.all(), a_foods)
Only show me comments from entries that are marked as public:
generic_filter(Comment.objects.public(), Entry.objects.public... |
Generate random etag based on MD5.
def gen_etag():
"""Generate random etag based on MD5."""
my_salt = gen_uuid()
if six.PY2:
my_salt = my_salt.decode('utf-8')
elif six.PY3:
my_salt = my_salt.encode('utf-8')
md5 = hashlib.md5()
md5.update(my_salt)
return md5.hexdigest() |
Delete this email report
def delete(self):
"""Delete this email report"""
response = self.pingdom.request('DELETE',
'reports.shared/%s' % self.id)
return response.json()['message'] |
Validates that x is a multiple of the reference (`x % ref == 0`)
def is_multiple_of(ref):
""" Validates that x is a multiple of the reference (`x % ref == 0`) """
def is_multiple_of_ref(x):
if x % ref == 0:
return True
else:
raise IsNotMultipleOf(wrong_value=x, ref=ref)
... |
Get all components of a topic.
def get_all_components(user, topic_id):
"""Get all components of a topic."""
args = schemas.args(flask.request.args.to_dict())
query = v1_utils.QueryBuilder(_TABLE, args, _C_COLUMNS)
query.add_extra_condition(sql.and_(
_TABLE.c.topic_id == topic_id,
_TA... |
Returns the component types of a topic.
def get_component_types_from_topic(topic_id, db_conn=None):
"""Returns the component types of a topic."""
db_conn = db_conn or flask.g.db_conn
query = sql.select([models.TOPICS]).\
where(models.TOPICS.c.id == topic_id)
topic = db_conn.execute(query).fetch... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.