Builds the tag for the counter of a given epoch/field, without the OSSOS base.

    @param epoch_field:
    @param dry_run:
    @return:
8067
def build_counter_tag(epoch_field, dry_run=False):
    
    logger.info("Epoch Field: {}, OBJECT_COUNT {}".format(str(epoch_field), str(OBJECT_COUNT)))
    tag = epoch_field[1] + "-" + OBJECT_COUNT

    if dry_run:
        tag += "-DRYRUN"

    return tag
617991
def is_dry_run(self, override: bool = None) -> bool:
        
        return override if override is not None else self.nornir.data.dry_run
1196100
def counter2trend(counter)
      self.new({
        enterprise: counter.enterprise,
        score: score(counter.divergence),
        uid: counter.uid,
        ts: counter.ts
      })
    end
38614
def _maybe_init_tags(self, run_id, tag_to_metadata):
    
    cursor = self._db.cursor()
    # TODO: for huge numbers of tags (e.g. 1000+), this is slower than just
    # querying for the known tag names explicitly; find a better tradeoff.
    cursor.execute('SELECT tag_name, tag_id FROM Tags WHERE run_id = ?',
                   (run_id,))
    tag_to_id = {row[0]: row[1] for row in cursor.fetchall()
                 if row[0] in tag_to_metadata}
    new_tag_data = []
    for tag, metadata in six.iteritems(tag_to_metadata):
      if tag not in tag_to_id:
        tag_id = self._create_id()
        tag_to_id[tag] = tag_id
        new_tag_data.append((run_id, tag_id, tag, time.time(),
                             metadata.display_name,
                             metadata.plugin_data.plugin_name,
                             self._make_blob(metadata.plugin_data.content)))
    cursor.executemany(
        """
        INSERT INTO Tags (
          run_id, tag_id, tag_name, inserted_time, display_name, plugin_name,
          plugin_data
        ) VALUES (?, ?, ?, ?, ?, ?, ?)
        """,
        new_tag_data)
    return tag_to_id
611599
public function markRun($dryRun = 1)
	{
		$run = Run::blank();
		$run->set('import_id', $this->get('id'))
			->set('count', $this->get('count'))
			->set('ran_by', User::get('id'))
			->set('ran_at', Date::toSql())
			->set('dry_run', $dryRun)
			->save();
	}
1282707
@Override
    public Request<DescribeLaunchTemplateVersionsRequest> getDryRunRequest() {
        Request<DescribeLaunchTemplateVersionsRequest> request = new DescribeLaunchTemplateVersionsRequestMarshaller().marshall(this);
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
1030022
def run_tag_from_session_and_metric(session_name, metric_name):
  
  assert isinstance(session_name, six.string_types)
  assert isinstance(metric_name, api_pb2.MetricName)
  # os.path.join() will append a final slash if the group is empty; it seems
  # like multiplexer.Tensors won't recognize paths that end with a '/' so
  # we normalize the result of os.path.join() to remove the final '/' in that
  # case.
  run = os.path.normpath(os.path.join(session_name, metric_name.group))
  tag = metric_name.tag
  return run, tag
580110
public static Counter counter(String name, Iterable<Tag> tags) {
        return globalRegistry.counter(name, tags);
    }
788919
@Override
    public Request<DescribeTagsRequest> getDryRunRequest() {
        Request<DescribeTagsRequest> request = new DescribeTagsRequestMarshaller().marshall(this);
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
1123981
def _docf(self, tag, val):
        
        # TODO(kelkabany): We're currently just dropping all doc ref tags ...
        # NOTE(praneshp): ... except for versioned routes
        if tag == 'route':
            if ':' in val:
                val, version = val.split(':', 1)
                version = int(version)
            else:
                version = 1
            url = fmt_url(self.cur_namespace.name, val, version)
            # NOTE: In js, for comments, we drop the namespace name and the '/' when
            # documenting URLs
            return url[(len(self.cur_namespace.name) + 1):]

        return val
421525
def jinja_fragment_extension(tag, endtag=None, name=None, tag_only=False, allow_args=True, callblock_args=None):
    
    if endtag is None:
        endtag = "end" + tag

    def decorator(f):
        def parse(self, parser):
            lineno = parser.stream.next().lineno
            args = []
            kwargs = []
            if allow_args:
                args, kwargs = parse_block_signature(parser)

            call = self.call_method("support_method", args, kwargs, lineno=lineno)
            if tag_only:
                return nodes.Output([call], lineno=lineno)

            call_args = []
            if callblock_args is not None:
                for arg in callblock_args:
                    call_args.append(nodes.Name(arg, 'param', lineno=lineno))

            body = parser.parse_statements(['name:' + endtag], drop_needle=True)
            return nodes.CallBlock(call, call_args, [], body, lineno=lineno)

        def support_method(self, *args, **kwargs):
            return f(*args, **kwargs)

        attrs = {"tags": set([tag]), "parse": parse, "support_method": support_method}
        return type(name or f.__name__, (Extension,), attrs)

    return decorator
1128969
def DeleteClusterTags(r, tags, dry_run=False):
    

    query = {
        "dry-run": dry_run,
        "tag": tags,
    }

    return r.request("delete", "/2/tags", query=query)
926251
def tag_builder(parser, token, cls, flow_type):
    """"""
    tokens = token.split_contents()
    tokens_num = len(tokens)

    if tokens_num == 1 or (tokens_num == 3 and tokens[1] == 'for'):
        flow_name = None
        if tokens_num == 3:
            flow_name = tokens[2]
        return cls(flow_name)
    else:
        raise template.TemplateSyntaxError(
            '"sitegate_%(type)s_form" tag requires zero or two arguments. '
            'E.g. {%% sitegate_%(type)s_form %%} or '
            '{%% sitegate_%(type)s_form for ClassicSignup %%}.' % {'type': flow_type})
135683
public void addCounter(String field, Class<? extends Execution> cls) {
        counters.put(field, cls);
    }
693377
@Override
    public Request<CreateTagsRequest> getDryRunRequest() {
        Request<CreateTagsRequest> request = new CreateTagsRequestMarshaller().marshall(this);
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
1009966
def AddClusterTags(r, tags, dry_run=False):
    

    query = {
        "dry-run": dry_run,
        "tag": tags,
    }

    return r.request("put", "/2/tags", query=query)
1027632
def _cx_counters_psutil(self, tags=None):
        
        tags = [] if tags is None else tags
        for iface, counters in iteritems(psutil.net_io_counters(pernic=True)):
            metrics = {
                'bytes_rcvd': counters.bytes_recv,
                'bytes_sent': counters.bytes_sent,
                'packets_in.count': counters.packets_recv,
                'packets_in.error': counters.errin,
                'packets_out.count': counters.packets_sent,
                'packets_out.error': counters.errout,
            }
            self._submit_devicemetrics(iface, metrics, tags)