Search is not available for this dataset
text
stringlengths
75
104k
def expand_defaults(schema, features): """Add to features any default transformations. Not every column in the schema has an explicit feature transformation listed in the featurs file. For these columns, add a default transformation based on the schema's type. The features dict is modified by this function cal...
def invert_features(features): """Make a dict in the form source column : set of transforms. Note that the key transform is removed. """ inverted_features = collections.defaultdict(list) for transform in six.itervalues(features): source_column = transform['source_column'] inverted_features[source_col...
def run_local_analysis(output_dir, csv_file_pattern, schema, features): """Use pandas to analyze csv files. Produces a stats file and vocab files. Args: output_dir: output folder csv_file_pattern: list of csv file paths, may contain wildcards schema: CSV schema list features: features config ...
def _get_query_argument(args, cell, env): """ Get a query argument to a cell magic. The query is specified with args['query']. We look that up and if it is a BQ query just return it. If it is instead a SqlModule or SqlStatement it may have variable references. We resolve those using the arg parser for the SqlM...
def _sample_cell(args, cell_body): """Implements the bigquery sample cell magic for ipython notebooks. Args: args: the optional arguments following '%%bigquery sample'. cell_body: optional contents of the cell interpreted as SQL, YAML or JSON. Returns: The results of executing the sampling query, or ...
def _create_cell(args, cell_body): """Implements the BigQuery cell magic used to create datasets and tables. The supported syntax is: %%bigquery create dataset -n|--name <name> [-f|--friendly <friendlyname>] [<description>] or: %%bigquery create table -n|--name <tablename> [--overwrite] ...
def _delete_cell(args, _): """Implements the BigQuery cell magic used to delete datasets and tables. The supported syntax is: %%bigquery delete dataset -n|--name <name> or: %%bigquery delete table -n|--name <name> Args: args: the argument following '%bigquery delete <command>'. """ # TO...
def _dryrun_cell(args, cell_body): """Implements the BigQuery cell magic used to dry run BQ queries. The supported syntax is: %%bigquery dryrun [-q|--sql <query identifier>] [<YAML or JSON cell_body or inline SQL>] Args: args: the argument following '%bigquery dryrun'. cell_body: optional content...
def _udf_cell(args, js): """Implements the bigquery_udf cell magic for ipython notebooks. The supported syntax is: %%bigquery udf --module <var> <js function> Args: args: the optional arguments following '%%bigquery udf'. js: the UDF declaration (inputs and outputs) and implementation in javascript....
def _execute_cell(args, cell_body): """Implements the BigQuery cell magic used to execute BQ queries. The supported syntax is: %%bigquery execute [-q|--sql <query identifier>] <other args> [<YAML or JSON cell_body or inline SQL>] Args: args: the arguments following '%bigquery execute'. cell_body:...
def _pipeline_cell(args, cell_body): """Implements the BigQuery cell magic used to validate, execute or deploy BQ pipelines. The supported syntax is: %%bigquery pipeline [-q|--sql <query identifier>] <other args> <action> [<YAML or JSON cell_body or inline SQL>] Args: args: the arguments following '%...
def _table_line(args): """Implements the BigQuery table magic used to display tables. The supported syntax is: %bigquery table -t|--table <name> <other args> Args: args: the arguments following '%bigquery table'. Returns: The HTML rendering for the table. """ # TODO(gram): It would be good to ...
def _get_schema(name): """ Given a variable or table name, get the Schema if it exists. """ item = datalab.utils.commands.get_notebook_item(name) if not item: item = _get_table(name) if isinstance(item, datalab.bigquery.Schema): return item if hasattr(item, 'schema') and isinstance(item.schema, datal...
def _schema_line(args): """Implements the BigQuery schema magic used to display table/view schemas. Args: args: the arguments following '%bigquery schema'. Returns: The HTML rendering for the schema. """ # TODO(gram): surely we could just return the schema itself? name = args['table'] if args['tabl...
def _render_table(data, fields=None): """ Helper to render a list of dictionaries as an HTML display object. """ return IPython.core.display.HTML(datalab.utils.commands.HtmlBuilder.render_table(data, fields))
def _datasets_line(args): """Implements the BigQuery datasets magic used to display datasets in a project. The supported syntax is: %bigquery datasets [-f <filter>] [-p|--project <project_id>] Args: args: the arguments following '%bigquery datasets'. Returns: The HTML rendering for the table ...
def _tables_line(args): """Implements the BigQuery tables magic used to display tables in a dataset. The supported syntax is: %bigquery tables -p|--project <project_id> -d|--dataset <dataset_id> Args: args: the arguments following '%bigquery tables'. Returns: The HTML rendering for the list ...
def _extract_line(args): """Implements the BigQuery extract magic used to extract table data to GCS. The supported syntax is: %bigquery extract -S|--source <table> -D|--destination <url> <other_args> Args: args: the arguments following '%bigquery extract'. Returns: A message about whether the...
def _load_cell(args, schema): """Implements the BigQuery load magic used to load data from GCS to a table. The supported syntax is: %bigquery load -S|--source <source> -D|--destination <table> <other_args> Args: args: the arguments following '%bigquery load'. schema: a JSON schema for the dest...
def _create_bigquery_parser(): """ Create the parser for the %bigquery magics. Note that because we use the func default handler dispatch mechanism of argparse, our handlers can take only one argument which is the parsed args. So we must create closures for the handlers that bind the cell contents and thus mus...
def bigquery(line, cell=None): """Implements the bigquery cell magic for ipython notebooks. The supported syntax is: %%bigquery <command> [<args>] <cell> or: %bigquery <command> [<args>] Use %bigquery --help for a list of commands, or %bigquery <command> --help for help on a specific command....
def table(name=None, mode='create', use_cache=True, priority='interactive', allow_large_results=False): """ Construct a query output object where the result is a table Args: name: the result table name as a string or TableName; if None (the default), then a temporary table will be u...
def file(path, format='csv', csv_delimiter=',', csv_header=True, compress=False, use_cache=True): """ Construct a query output object where the result is either a local file or a GCS path Note that there are two jobs that may need to be run sequentially, one to run the query, and the second to e...
def dataframe(start_row=0, max_rows=None, use_cache=True): """ Construct a query output object where the result is a dataframe Args: start_row: the row of the table at which to start the export (default 0). max_rows: an upper limit on the number of rows to export (default None). use_cache: wh...
def list(): """List running TensorBoard instances.""" running_list = [] parser = argparse.ArgumentParser() parser.add_argument('--logdir') parser.add_argument('--port') for p in psutil.process_iter(): if p.name() != 'tensorboard' or p.status() == psutil.STATUS_ZOMBIE: continue ...
def start(logdir): """Start a TensorBoard instance. Args: logdir: the logdir to run TensorBoard on. Raises: Exception if the instance cannot be started. """ if logdir.startswith('gs://'): # Check user does have access. TensorBoard will start successfully regardless # the use...
def stop(pid): """Shut down a specific process. Args: pid: the pid of the process to shutdown. """ if psutil.pid_exists(pid): try: p = psutil.Process(pid) p.kill() except Exception: pass
def build_graph(self): """Forms the core by building a wrapper around the inception graph. Here we add the necessary input & output tensors, to decode jpegs, serialize embeddings, restore from checkpoint etc. To use other Inception models modify this file. Note that to use other models bes...
def restore_from_checkpoint(self, checkpoint_path): """To restore inception model variables from the checkpoint file. Some variables might be missing in the checkpoint file, so it only loads the ones that are avialable, assuming the rest would be initialized later. Args: checkpoint_p...
def calculate_embedding(self, batch_image_bytes): """Get the embeddings for a given JPEG image. Args: batch_image_bytes: As if returned from [ff.read() for ff in file_list]. Returns: The Inception embeddings (bottleneck layer output) """ return self.tf_session.run( self.embeddi...
def loss(logits, labels): """Calculates the loss from the logits and the labels. Args: logits: Logits tensor, float - [batch_size, NUM_CLASSES]. labels: Labels tensor, int32 - [batch_size]. Returns: loss: Loss tensor of type float. """ labels = tf.to_int64(labels) cross_entropy = tf.nn.sparse_s...
def training(loss_op): """Calculates the loss from the logits and the labels. Args: logits: Logits tensor, float - [batch_size, NUM_CLASSES]. labels: Labels tensor, int32 - [batch_size]. Returns: loss: Loss tensor of type float. """ global_step = tf.Variable(0, name='global_step', trainable=False...
def add_final_training_ops(self, embeddings, all_labels_count, bottleneck_tensor_size, hidden_layer_size=BOTTLENECK_TENSOR_SIZE / 4, dropout_keep_prob=None): """Adds a new...
def build_inception_graph(self): """Builds an inception graph and add the necessary input & output tensors. To use other Inception models modify this file. Also preprocessing must be modified accordingly. See tensorflow/contrib/slim/python/slim/nets/inception_v3.py for details about Incept...
def build_graph(self, data_paths, batch_size, graph_mod): """Builds generic graph for training or eval.""" tensors = GraphReferences() is_training = graph_mod == GraphMod.TRAIN if data_paths: _, tensors.examples = _util.read_examples( data_paths, batch_size, shuffle=i...
def restore_from_checkpoint(self, session, inception_checkpoint_file, trained_checkpoint_file): """To restore model variables from the checkpoint file. The graph is assumed to consist of an inception model and other layers including a softmax and a fully connected layer....
def build_prediction_graph(self): """Builds prediction graph and registers appropriate endpoints.""" tensors = self.build_graph(None, 1, GraphMod.PREDICT) keys_placeholder = tf.placeholder(tf.string, shape=[None]) inputs = { 'key': keys_placeholder, 'image_bytes': tensors.input_jpeg ...
def export(self, last_checkpoint, output_dir): """Builds a prediction graph and xports the model. Args: last_checkpoint: Path to the latest checkpoint file from training. output_dir: Path to the folder to be used to output the model. """ logging.info('Exporting prediction graph to %s', outp...
def format_metric_values(self, metric_values): """Formats metric values - used for logging purpose.""" # Early in training, metric_values may actually be None. loss_str = 'N/A' accuracy_str = 'N/A' try: loss_str = 'loss: %.3f' % metric_values[0] accuracy_str = 'accuracy: %.3f' % metric_...
def package_and_copy(package_root_dir, setup_py, output_tar_path): """Repackage an CloudML package and copy it to a staging dir. Args: package_root_dir: the root dir to install package from. Usually you can get the path from inside your module using a relative path to __file__. setup_py: the path t...
def read_file_to_string(path): """Read a file into a string.""" bytes_string = tf.gfile.Open(path, 'r').read() return dlutils.python_portable_string(bytes_string)
def sql(line, cell=None): """ Create a SQL module with one or more queries. Use %sql --help for more details. The supported syntax is: %%sql [--module <modulename>] [<optional Python code for default argument values>] [<optional named queries>] [<optional unnamed query>] At least one query should be pr...
def _date(val, offset=None): """ A special pseudo-type for pipeline arguments. This allows us to parse dates as Python datetimes, including special values like 'now' and 'today', as well as apply offsets to the datetime. Args: val: a string containing the value for the datetime. This can be 'now', 'today'...
def _make_string_formatter(f, offset=None): """ A closure-izer for string arguments that include a format and possibly an offset. """ format = f delta = offset return lambda v: time.strftime(format, (_date(v, delta)).timetuple())
def _make_table_formatter(f, offset=None): """ A closure-izer for table arguments that include a format and possibly an offset. """ format = f delta = offset return lambda v: _resolve_table(v, format, delta)
def _arguments(code, module): """Define pipeline arguments. Args: code: the Python code to execute that defines the arguments. """ arg_parser = CommandParser.create('') try: # Define our special argument 'types' and add them to the environment. builtins = {'source': _table, 'datestring': _datest...
def _split_cell(cell, module): """ Split a hybrid %%sql cell into the Python code and the queries. Populates a module with the queries. Args: cell: the contents of the %%sql cell. module: the module that the contents will populate. Returns: The default (last) query for the module. """ line...
def sql_cell(args, cell): """Implements the SQL cell magic for ipython notebooks. The supported syntax is: %%sql [--module <modulename>] [<optional Python code for default argument values>] [<optional named queries>] [<optional unnamed query>] At least one query should be present. Named...
def get_reader_input_fn(train_config, preprocess_output_dir, model_type, data_paths, batch_size, shuffle, num_epochs=None): """Builds input layer for training.""" def get_input_features(): """Read the input features from the given data paths.""" _, examples = util.read_examples( ...
def get_experiment_fn(args): """Builds the experiment function for learn_runner.run. Args: args: the command line args Returns: A function that returns a tf.learn experiment object. """ def get_experiment(output_dir): # Merge schema, input features, and transforms. train_config = util.merge...
def parse_arguments(argv): """Parse the command line arguments.""" parser = argparse.ArgumentParser( description=('Train a regression or classification model. Note that if ' 'using a DNN model, --layer-size1=NUM, --layer-size2=NUM, ' 'should be used. ')) # I/O file par...
def main(argv=None): """Run a Tensorflow model on the Iris dataset.""" args = parse_arguments(sys.argv if argv is None else argv) tf.logging.set_verbosity(tf.logging.INFO) learn_runner.run( experiment_fn=get_experiment_fn(args), output_dir=args.job_dir)
def sd(line, cell=None): """Implements the stackdriver cell magic for ipython notebooks. Args: line: the contents of the storage line. Returns: The results of executing the cell. """ parser = google.datalab.utils.commands.CommandParser(prog='%sd', description=( 'Execute various Stackdriver rela...
def _monitoring_metrics_list(args, _): """Lists the metric descriptors in the project.""" project_id = args['project'] pattern = args['type'] or '*' descriptors = gcm.MetricDescriptors(context=_make_context(project_id)) dataframe = descriptors.as_dataframe(pattern=pattern) return _render_dataframe(dataframe...
def _monitoring_resource_types_list(args, _): """Lists the resource descriptors in the project.""" project_id = args['project'] pattern = args['type'] or '*' descriptors = gcm.ResourceDescriptors(context=_make_context(project_id)) dataframe = descriptors.as_dataframe(pattern=pattern) return _render_datafram...
def _monitoring_groups_list(args, _): """Lists the groups in the project.""" project_id = args['project'] pattern = args['name'] or '*' groups = gcm.Groups(context=_make_context(project_id)) dataframe = groups.as_dataframe(pattern=pattern) return _render_dataframe(dataframe)
def parse_arguments(argv): """Parse the command line arguments.""" parser = DatalabParser( epilog=('Note that if using a DNN model, --hidden-layer-size1=NUM, ' '--hidden-layer-size2=NUM, ..., is also required. '), datalab_epilog=(""" Note that if using a DNN model, hidden-layer-size1: ...
def recursive_copy(src_dir, dest_dir): """Copy the contents of src_dir into the folder dest_dir. Args: src_dir: gsc or local path. dest_dir: gcs or local path. """ file_io.recursive_create_dir(dest_dir) for file_name in file_io.list_directory(src_dir): old_path = os.path.join(src_dir, file_name) ...
def make_prediction_output_tensors(args, features, input_ops, model_fn_ops, keep_target): """Makes the final prediction output layer.""" target_name = feature_transforms.get_target_name(features) key_names = get_key_names(features) outputs = {} outputs.update({key_name: tf....
def make_export_strategy( args, keep_target, assets_extra, features, schema, stats): """Makes prediction graph that takes json input. Args: args: command line args keep_target: If ture, target column is returned in prediction graph. Target column must...
def read_vocab(args, column_name): """Reads a vocab file if it exists. Args: args: command line flags column_name: name of column to that has a vocab file. Returns: List of vocab words or [] if the vocab file is not found. """ vocab_path = os.path.join(args.analysis, ...
def get_experiment_fn(args): """Builds the experiment function for learn_runner.run. Args: args: the command line args Returns: A function that returns a tf.learn experiment object. """ def get_experiment(output_dir): # Read schema, input features, and transforms. schema_path_with_target = ...
def make_datalab_help_action(self): """Custom action for --datalab-help. The action output the package specific parameters and will be part of "%%ml train" help string. """ datalab_help = self.datalab_help epilog = self.datalab_epilog class _CustomAction(argparse.Action): def __init...
def browse(self, max_lines=None, headers=None): """Try reading specified number of lines from the CSV object. Args: max_lines: max number of lines to read. If None, the whole file is read headers: a list of strings as column names. If None, it will use "col0, col1..." Returns: A pandas Dat...
def get_item(env, name, default=None): """ Get an item from a dictionary, handling nested lookups with dotted notation. Args: env: the environment (dictionary) to use to look up the name. name: the name to look up, in dotted notation. default: the value to return if the name if not found. Returns: ...
def predict(model_dir, images): """Local instant prediction.""" results = _tf_predict(model_dir, images) predicted_and_scores = [(predicted, label_scores[list(labels).index(predicted)]) for predicted, labels, label_scores in results] return predicted_and_scores
def configure_pipeline(p, dataset, model_dir, output_csv, output_bq_table): """Configures a dataflow pipeline for batch prediction.""" data = _util.get_sources_from_dataset(p, dataset, 'predict') if len(dataset.schema) == 2: output_schema = [ {'name': 'image_url', 'type': 'STRING'}, {'name': ...
def sampling_query(sql, context, fields=None, count=5, sampling=None, udfs=None, data_sources=None): """Returns a sampling Query for the SQL object. Args: sql: the SQL statement (string) or Query object to sample. context: a Context object providing project_id and credentials. ...
def results(self, use_cache=True, dialect=None, billing_tier=None): """Retrieves table of results for the query. May block if the query must be executed first. Args: use_cache: whether to use cached results or not. Ignored if append is specified. dialect : {'legacy', 'standard'}, default 'legacy' ...
def extract(self, storage_uris, format='csv', csv_delimiter=',', csv_header=True, compress=False, use_cache=True, dialect=None, billing_tier=None): """Exports the query results to GCS. Args: storage_uris: the destination URI(s). Can be a single URI or a list. format: the format to use...
def to_dataframe(self, start_row=0, max_rows=None, use_cache=True, dialect=None, billing_tier=None): """ Exports the query results to a Pandas dataframe. Args: start_row: the row of the table at which to start the export (default 0). max_rows: an upper limit on the number of rows...
def to_file(self, path, format='csv', csv_delimiter=',', csv_header=True, use_cache=True, dialect=None, billing_tier=None): """Save the results to a local file in CSV format. Args: path: path on the local filesystem for the saved results. format: the format to use for the exported dat...
def sample(self, count=5, fields=None, sampling=None, use_cache=True, dialect=None, billing_tier=None): """Retrieves a sampling of rows for the query. Args: count: an optional count of rows to retrieve which is used if a specific sampling is not specified (default 5). fields:...
def execute_dry_run(self, dialect=None, billing_tier=None): """Dry run a query, to check the validity of the query and return some useful statistics. Args: dialect : {'legacy', 'standard'}, default 'legacy' 'legacy' : Use BigQuery's legacy SQL dialect. 'standard' : Use BigQuery's stan...
def execute_async(self, table_name=None, table_mode='create', use_cache=True, priority='interactive', allow_large_results=False, dialect=None, billing_tier=None): """ Initiate the query and return a QueryJob. Args: table_name: the result table name as a string or T...
def execute(self, table_name=None, table_mode='create', use_cache=True, priority='interactive', allow_large_results=False, dialect=None, billing_tier=None): """ Initiate the query, blocking until complete and then return the results. Args: table_name: the result table name as a string or Ta...
def to_view(self, view_name): """ Create a View from this Query. Args: view_name: the name of the View either as a string or a 3-part tuple (projectid, datasetid, name). Returns: A View for the Query. """ # Do the import here to avoid circular dependencies at top-level. f...
def format_help(self): """Override help doc to add cell args. """ if not self._cell_args: return super(CommandParser, self).format_help() else: # Print the standard argparse info, the cell arg block, and then the epilog # If we don't remove epilog before calling the super, then epilog wil...
def _get_subparsers(self): """Recursively get subparsers.""" subparsers = [] for action in self._actions: if isinstance(action, argparse._SubParsersAction): for _, subparser in action.choices.items(): subparsers.append(subparser) ret = subparsers for sp in subparsers: ...
def _get_subparser_line_args(self, subparser_prog): """ Get line args of a specified subparser by its prog.""" subparsers = self._get_subparsers() for subparser in subparsers: if subparser_prog == subparser.prog: # Found the subparser. args_to_parse = [] for action in subparse...
def _get_subparser_cell_args(self, subparser_prog): """ Get cell args of a specified subparser by its prog.""" subparsers = self._get_subparsers() for subparser in subparsers: if subparser_prog == subparser.prog: return subparser._cell_args return None
def add_cell_argument(self, name, help, required=False): """ Add a cell only argument. Args: name: name of the argument. No need to start with "-" or "--". help: the help string of the argument. required: Whether it is required in cell content. """ for action in self._actions: ...
def parse(self, line, cell, namespace=None): """Parses a line and cell into a dictionary of arguments, expanding variables from a namespace. For each line parameters beginning with --, it also checks the cell content and see if it exists there. For example, if "--config1" is a line parameter, it checks to ...
def _glob_events_files(self, paths, recursive): """Find all tf events files under a list of paths recursively. """ event_files = [] for path in paths: dirs = tf.gfile.Glob(path) dirs = filter(lambda x: tf.gfile.IsDirectory(x), dirs) for dir in dirs: if recursive: dir_fil...
def list_events(self): """List all scalar events in the directory. Returns: A dictionary. Key is the name of a event. Value is a set of dirs that contain that event. """ event_dir_dict = collections.defaultdict(set) for event_file in self._glob_events_files(self._paths, recursive=True): ...
def get_events(self, event_names): """Get all events as pandas DataFrames given a list of names. Args: event_names: A list of events to get. Returns: A list with the same length and order as event_names. Each element is a dictionary {dir1: DataFrame1, dir2: DataFrame2, ...}. ...
def plot(self, event_names, x_axis='step'): """Plots a list of events. Each event (a dir+event_name) is represetented as a line in the graph. Args: event_names: A list of events to plot. Each event_name may correspond to multiple events, each in a different directory. x_axis: whethe...
def from_storage(source, source_format='csv', csv_options=None, ignore_unknown_values=False, max_bad_records=0, compressed=False, schema=None): """ Create an external table for a GCS object. Args: source: the URL of the source objects(s). Can include a wildcard '*' at the end of the i...
def _get_query_argument(args, cell, env): """ Get a query argument to a cell magic. The query is specified with args['query']. We look that up and if it is a BQ query object, just return it. If it is a string, build a query object out of it and return that Args: args: the dictionary of magic arguments. ...
def get_query_parameters(args, cell_body, date_time=datetime.datetime.now()): """Extract query parameters from cell body if provided Also validates the cell body schema using jsonschema to catch errors before sending the http request. This validation isn't complete, however; it does not validate recursive schemas...
def _sample_cell(args, cell_body): """Implements the BigQuery sample magic for sampling queries The supported sytanx is: %%bq sample <args> [<inline SQL>] Args: args: the optional arguments following '%%bq sample'. cell_body: optional contents of the cell Returns: The results of executing t...
def _dryrun_cell(args, cell_body): """Implements the BigQuery cell magic used to dry run BQ queries. The supported syntax is: %%bq dryrun [-q|--sql <query identifier>] [<YAML or JSON cell_body or inline SQL>] Args: args: the argument following '%bq dryrun'. cell_body: optional contents of the cel...
def _udf_cell(args, cell_body): """Implements the Bigquery udf cell magic for ipython notebooks. The supported syntax is: %%bq udf --name <var> --language <lang> // @param <name> <type> // @returns <type> // @import <gcs_path> <js function> Args: args: the optional arguments following '%%bq udf'. ...
def _datasource_cell(args, cell_body): """Implements the BigQuery datasource cell magic for ipython notebooks. The supported syntax is %%bq datasource --name <var> --paths <url> [--format <CSV|JSON>] <schema> Args: args: the optional arguments following '%%bq datasource' cell_body: the datasource's ...
def _query_cell(args, cell_body): """Implements the BigQuery cell magic for used to build SQL objects. The supported syntax is: %%bq query <args> [<inline SQL>] Args: args: the optional arguments following '%%bql query'. cell_body: the contents of the cell """ name = args['name'] udfs...
def _execute_cell(args, cell_body): """Implements the BigQuery cell magic used to execute BQ queries. The supported syntax is: %%bq execute <args> [<inline SQL>] Args: args: the optional arguments following '%%bq execute'. cell_body: optional contents of the cell Returns: QueryResultsTa...
def _get_table(name): """ Given a variable or table name, get a Table if it exists. Args: name: the name of the Table or a variable referencing the Table. Returns: The Table, if found. """ # If name is a variable referencing a table, use that. item = google.datalab.utils.commands.get_notebook_item(...
def _render_list(data): """ Helper to render a list of objects as an HTML list object. """ return IPython.core.display.HTML(google.datalab.utils.commands.HtmlBuilder.render_list(data))
def _dataset_line(args): """Implements the BigQuery dataset magic subcommand used to operate on datasets The supported syntax is: %bq datasets <command> <args> Commands: {list, create, delete} Args: args: the optional arguments following '%bq datasets command'. """ if args['command'] == 'list...
def _table_cell(args, cell_body): """Implements the BigQuery table magic subcommand used to operate on tables The supported syntax is: %%bq tables <command> <args> Commands: {list, create, delete, describe, view} Args: args: the optional arguments following '%%bq tables command'. cell_body: o...