patch stringlengths 17 31.2k | y int64 1 1 | oldf stringlengths 0 2.21M | idx int64 1 1 | id int64 4.29k 68.4k | msg stringlengths 8 843 | proj stringclasses 212
values | lang stringclasses 9
values |
|---|---|---|---|---|---|---|---|
@@ -1,3 +1,5 @@
+'use strict';
+
require('classtool');
function ClassSpec(b) { | 1 | require('classtool');
function ClassSpec(b) {
var superclass = b.superclass || require('./util/VersionedData').class();
function Address() {
Address.super(this, arguments);
};
Address.superclass = superclass;
superclass.applyEncodingsTo(Address);
Address.prototype.validate = function() {
this.do... | 1 | 12,145 | For now, don't add "use strict" to any existing files. That's a separate project that we'll do later. (New files can use "use strict".) | bitpay-bitcore | js |
@@ -216,6 +216,12 @@ func TestConfigCommandInteractiveCreateDocrootDenied(t *testing.T) {
// Set up tests and give ourselves a working directory.
assert := asrt.New(t)
+ noninteractive := "DRUD_NONINTERACTIVE"
+ // nolint: errcheck
+ defer os.Setenv(noninteractive, os.Getenv(noninteractive))
+ err := os.Unsetenv(... | 1 | package ddevapp_test
import (
"bufio"
"fmt"
"github.com/drud/ddev/pkg/exec"
"github.com/stretchr/testify/require"
"io/ioutil"
"os"
"path/filepath"
"strings"
"testing"
. "github.com/drud/ddev/pkg/ddevapp"
"github.com/drud/ddev/pkg/fileutil"
"github.com/drud/ddev/pkg/testcommon"
"github.com/drud/ddev/pkg/u... | 1 | 13,217 | I was confused by this env name variable, assuming it was the value, not the name. Silly nit, but maybe name it noninteractiveEnv? | drud-ddev | go |
@@ -139,7 +139,7 @@ def py_run(command_options='', return_std=False, stdout=None, stderr=None):
"""
# Create command line to call pylint
epylint_part = [sys.executable, "-c", "from pylint import epylint;epylint.Run()"]
- options = shlex.split(command_options)
+ options = shlex.split(command_options... | 1 | # -*- coding: utf-8;
# mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4
# -*- vim:fenc=utf-8:ft=python:et:sw=4:ts=4:sts=4
# Copyright (c) 2008-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2014 Jakob Normark <jakobnormark@gmail.com>
# Copyright (c) 2014 Brett Cannon <brett@... | 1 | 9,934 | `sys.platform` could be equal to `darwin` which is posix. Use `not startswith('win')`? | PyCQA-pylint | py |
@@ -38,11 +38,12 @@ func New(cfg *any.Any, logger *zap.Logger, scope tally.Scope) (service.Service,
}
s := &svc{
- logger: logger,
- filter: config.Filter,
- scope: scope,
- slack: slack.New(config.Token),
- channel: config.Channel,
+ logger: logger,
+ filter: config.Filter,
+ overrides: NewOv... | 1 | package slack
// <!-- START clutchdoc -->
// description: Posts events to a configured Slack workspace and channel.
// <!-- END clutchdoc -->
import (
"bytes"
"encoding/json"
"fmt"
"reflect"
"strings"
"text/template"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/any"
"github.com/sla... | 1 | 10,357 | let's move this into `slack_helper.go` | lyft-clutch | go |
@@ -54,7 +54,7 @@ class Azure(base.Base):
driver:
name: azure
ssh_connection_options:
- -o ControlPath=~/.ansible/cp/%r@%h-%p
+ - '-o ControlPath=~/.ansible/cp/%r@%h-%p'
.. important::
| 1 | # Copyright (c) 2015-2018 Cisco Systems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge... | 1 | 9,942 | I doubt it will work, but without space between -o and ControlPath it should. Lets see. What I do not understand is why we did not see a failure on CI related to this? | ansible-community-molecule | py |
@@ -56,7 +56,7 @@ DiscreteBearing BearingClass::getDiscreteBearing(const double bearing)
{
BOOST_ASSERT(0. <= bearing && bearing <= 360.);
auto shifted_bearing = (bearing + 0.5 * discrete_step_size);
- if (shifted_bearing > 360.)
+ if (shifted_bearing >= 360.)
shifted_bearing -= 360;
retu... | 1 | #include "util/guidance/bearing_class.hpp"
#include "util/bearing.hpp"
#include <algorithm>
#include <boost/assert.hpp>
namespace osrm
{
namespace util
{
namespace guidance
{
BearingClass::BearingClass() { available_bearings.reserve(10); }
bool BearingClass::operator==(const BearingClass &other) const
{
BOOST_A... | 1 | 19,648 | this is the reason we might be seeing 360 as discrete bearing | Project-OSRM-osrm-backend | cpp |
@@ -72,6 +72,9 @@ from pylint.__pkginfo__ import version
from pylint.reporters.ureports import nodes as report_nodes
+FULL_VERSION = '%%(prog)s %s\nastroid %s\nPython %s' % (
+ version, astroid_version, sys.version)
+
MANAGER = astroid.MANAGER
| 1 | # -*- coding: utf-8 -*-
# Copyright (c) 2006-2015 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2008 Fabrice Douchant <Fabrice.Douchant@logilab.fr>
# Copyright (c) 2009 Vincent
# Copyright (c) 2009 Mads Kiilerich <mads@kiilerich.com>
# Copyright (c) 2011-2014 Google, Inc.
# Copyright (c) 2012 David ... | 1 | 9,945 | `FULL_VERSION` is available at module level for others to use, but it won't have `%(prog)s` substituted with pylint. Will that be a problem. Also put it here instead of __pkginfo__ with other versions because it isn't pkginfo related. | PyCQA-pylint | py |
@@ -34,6 +34,7 @@ public abstract class BaseColumnIterator {
protected long triplesRead = 0L;
protected long advanceNextPageCount = 0L;
protected Dictionary dictionary;
+ protected long rowPosition;
protected BaseColumnIterator(ColumnDescriptor descriptor) {
this.desc = descriptor; | 1 | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | 1 | 22,235 | Is this needed? I don't see any uses. | apache-iceberg | java |
@@ -29,6 +29,15 @@ func (c *Client) DeletePubSubOrFail(name string) {
}
}
+func (c *Client) DeleteBuildOrFail(name string) {
+ c.T.Helper()
+ builds := c.KnativeGCP.EventsV1alpha1().CloudBuildSources(c.Namespace)
+ err := builds.Delete(name, &metav1.DeleteOptions{})
+ if err != nil {
+ c.T.Fatalf("Failed to delet... | 1 | /*
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | 1 | 16,058 | Shouldn't this be V1beta1? | google-knative-gcp | go |
@@ -102,6 +102,13 @@ class Proposal < ActiveRecord::Base
approval
end
+ def remove_approver(email)
+ user = User.for_email(email)
+ approval = self.approvals.find_by(user_id: user.id)
+ CommunicartMailer.notification_for_approver_removed(email,approval)
+ approval.destroy
+ end
+
def initiali... | 1 | class Proposal < ActiveRecord::Base
include WorkflowModel
include ValueHelper
workflow do
state :pending do
# partial *may* trigger a full approval
event :partial_approve, transitions_to: :approved, if: lambda { |p| p.all_approved? }
event :partial_approve, transitions_to: :pending
eve... | 1 | 13,461 | I think there's an `approval_for` | 18F-C2 | rb |
@@ -719,6 +719,8 @@ public interface Stack<T> extends LinearSeq<T> {
@Override
Stack<T> takeWhile(Predicate<? super T> predicate);
+ <U> U transform(Function<? super List<T>, ? extends U> f);
+
@Override
<U> Stack<U> unit(Iterable<? extends U> iterable);
| 1 | /* / \____ _ _ ____ ______ / \ ____ __ _ _____
* / / \/ \ / \/ \ / /\__\/ // \/ \ / / _ \ Javaslang
* _/ / /\ \ \/ / /\ \\__\\ \ // /\ \ /\\/ \__/ / Copyright 2014-now Daniel Dietrich
* /___/\_/ \_/\____/\_/ \_/\__\/__/___\_/ \_// \__/_____/ Licensed under... | 1 | 7,342 | Here we should use <code>List</code> in generic | vavr-io-vavr | java |
@@ -56,8 +56,7 @@ public final class BaselineReleaseCompatibility extends AbstractBaselinePlugin {
@Override
public Iterable<String> asArguments() {
- JavaVersion jdkVersion =
- JavaVersion.toVersion(javaCompile.getToolChain().getVersion());
+ JavaVersion jdk... | 1 | /*
* (c) Copyright 2019 Palantir Technologies Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless ... | 1 | 9,161 | The `JavaCompile#getToolChain` method got removed and I am not sure what a good replacement is. I replaced it with `targetCompat` for now but they are not equivalent. Maybe we can use `JavaVersion#current` here? | palantir-gradle-baseline | java |
@@ -14,7 +14,7 @@ use Ergonode\SharedKernel\Domain\Aggregate\MultimediaId;
interface MultimediaQueryInterface
{
- public function fileExists(Hash $hash): bool;
+ public function fileExists(string $name): bool;
public function findIdByHash(Hash $hash): ?MultimediaId;
| 1 | <?php
/**
* Copyright © Ergonode Sp. z o.o. All rights reserved.
* See LICENSE.txt for license details.
*/
declare(strict_types=1);
namespace Ergonode\Multimedia\Domain\Query;
use Ergonode\Multimedia\Domain\ValueObject\Hash;
use Ergonode\SharedKernel\Domain\Aggregate\MultimediaId;
interface MultimediaQueryInter... | 1 | 9,582 | The method name is incorrect. It does not check the existence of the file. I'd suggest deprecating both methods `fileExists` and `findIdByHash` and use findIdByFilename instead of fileExits | ergonode-backend | php |
@@ -336,6 +336,7 @@ static CALI_BPF_INLINE int calico_tc(struct __sk_buff *skb)
.reason = CALI_REASON_UNKNOWN,
};
struct calico_nat_dest *nat_dest = NULL;
+ __u8 nat_lvl1_drop = 0;
/* we assume we do FIB and from this point on, we only set it to false
* if we decide not to do it. | 1 | // Project Calico BPF dataplane programs.
// Copyright (c) 2020 Tigera, Inc. All rights reserved.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at... | 1 | 17,892 | We have `stdbool` imported, might as well use that for clarity. | projectcalico-felix | c |
@@ -0,0 +1 @@
+package batchstore | 1 | 1 | 13,198 | File is empty, consider removing? | ethersphere-bee | go | |
@@ -760,7 +760,7 @@ describe('Bulk', function() {
batch.insert({ b: 1 });
// Execute the operations
- batch.execute(self.configuration.writeConcernMax(), function(err, result) {
+ batch.execute(self.configuration.writeConcernMax().writeConcern, function(err, result) {
... | 1 | 'use strict';
const test = require('./shared').assert,
setupDatabase = require('./shared').setupDatabase,
expect = require('chai').expect;
const MongoError = require('../../index').MongoError;
const ignoreNsNotFound = require('./shared').ignoreNsNotFound;
describe('Bulk', function() {
before(function() {
re... | 1 | 19,135 | `writeConcernMax` was changed to return a `writeConcern` formatted the new way-- `writeConcern: {w:1, ...}`. Bulk execute takes an actual `WriteConcern` object as its first parameter (this was changed in master), so we have to un-wrap the `writeConcernMax` result here. | mongodb-node-mongodb-native | js |
@@ -1,9 +1,10 @@
module TabularData
class Container
- attr_reader :columns
+ attr_reader :columns, :frozen_sort
def initialize(name, config)
@name = name
+ @frozen_sort = false
self.init_query(config[:engine].constantize, config.fetch(:joins, []))
self.init_columns(config.fetc... | 1 | module TabularData
class Container
attr_reader :columns
def initialize(name, config)
@name = name
self.init_query(config[:engine].constantize, config.fetch(:joins, []))
self.init_columns(config.fetch(:column_configs, {}), config.fetch(:columns, {}))
self.set_sort(config[:sort])
en... | 1 | 13,737 | How about passing this through the `config`? | 18F-C2 | rb |
@@ -373,10 +373,10 @@ def create_secret(secretsmanager_client):
secretsmanager_client.delete_secret(SecretId=item)
-only_localstack = pytest.mark.skipif(
- os.environ.get("TEST_TARGET") == "AWS_CLOUD",
- reason="test only applicable if run against localstack",
-)
+@pytest.fixture
+def only_localstack... | 1 | import logging
import os
from typing import TYPE_CHECKING, List
import boto3
import botocore.config
import pytest
from localstack.utils import testutil
from localstack.utils.aws import aws_stack
from localstack.utils.aws.aws_stack import create_dynamodb_table
from localstack.utils.common import short_uid
from localst... | 1 | 13,787 | Out of curiosity - did we make this change to allow dynamically assigning a value to `os.environ["TEST_TARGET"]` during test execution? I kind of liked the decorator style `@only_localstack` - makes the condition a bit more explicit. Looks like `skipif` also allows to specify a condition string, e.g. `pytest.mark.skipi... | localstack-localstack | py |
@@ -72,6 +72,7 @@ class SliderItem implements OrderableEntityInterface
*/
public function edit(SliderItemData $sliderItemData)
{
+ $this->domainId = $sliderItemData->domainId;
$this->name = $sliderItemData->name;
$this->link = $sliderItemData->link;
$this->hidden = $sli... | 1 | <?php
namespace Shopsys\FrameworkBundle\Model\Slider;
use Doctrine\ORM\Mapping as ORM;
use Shopsys\FrameworkBundle\Component\Grid\Ordering\OrderableEntityInterface;
/**
* SliderItem
*
* @ORM\Table(name="slider_items")
* @ORM\Entity
*/
class SliderItem implements OrderableEntityInterface
{
/**
* @var in... | 1 | 21,489 | I noticed (SonarCloud noticed actually) that the implementation of `::edit` method is the same as `__construct` is. Does it make sense to call the `edit` method from the constructor? | shopsys-shopsys | php |
@@ -78,6 +78,7 @@ int syslog_prot_process(struct syslog_conn *conn)
/* Incomplete message */
if (eof == end || (*eof != '\n' && *eof != '\0')) {
+ flb_debug("[syslog-prot] incomplete message! (Enable trace log to see the message.)");
return 0;
}
| 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* Fluent Bit
* ==========
* Copyright (C) 2019 The Fluent Bit Authors
* Copyright (C) 2015-2018 Treasure Data Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in co... | 1 | 9,744 | would you please rename the message prefix to: [in_syslog] ..." | fluent-fluent-bit | c |
@@ -600,8 +600,8 @@ struct AtomMatch { // for each seed atom (matched)
};
typedef std::vector<AtomMatch> AtomMatchSet;
-std::string MaximumCommonSubgraph::generateResultSMARTS(
- const MCS& mcsIdx) const {
+std::string MaximumCommonSubgraph::generateResultSMARTSAndQueryMol(
+ const MCS& mcsIdx, RWMol **molEx... | 1 | //
// Copyright (C) 2014 Novartis Institutes for BioMedical Research
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
#include <list>
#incl... | 1 | 20,048 | The pointer to a pointer is kind of gross. How about either taking the `ROMOL_SPTR` directly or, preferably, returning an `std::pair`? | rdkit-rdkit | cpp |
@@ -164,7 +164,12 @@ func (pool *TransactionPool) rememberCommit(flush bool) {
func (pool *TransactionPool) PendingCount() int {
pool.pendingMu.RLock()
defer pool.pendingMu.RUnlock()
+ return pool.pendingCountLocked()
+}
+// pendingCountLocked is a helper for PendingCount that returns the number of
+// transacti... | 1 | // Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) ... | 1 | 38,093 | the name confusing, please rename to `pendingCountNoLock` or similar | algorand-go-algorand | go |
@@ -44,13 +44,11 @@ func addTestingTsfBlocks(bc Blockchain) error {
[]byte{}, uint64(100000),
big.NewInt(10),
)
- sk, err := keypair.DecodePrivateKey(Gen.CreatorPrivKey)
- if err != nil {
- return err
- }
- if err := action.Sign(tsf0, sk); err != nil {
- return err
- }
+ pk, _ := hex.DecodeString(Gen.CreatorP... | 1 | // Copyright (c) 2018 IoTeX
// This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no
// warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent
// permitted by law, all liability for your use of the cod... | 1 | 13,300 | line is 175 characters | iotexproject-iotex-core | go |
@@ -230,12 +230,10 @@ public abstract class SalesforceReactActivity extends ReactActivity {
}
protected void setRestClient(RestClient restClient) {
- if(restClient!= null && client != restClient){
- if(reactActivityDelegate != null){
- reactActivityDelegate.loadReactAppOnceI... | 1 | /*
* Copyright (c) 2016-present, salesforce.com, inc.
* All rights reserved.
* Redistribution and use of this software in source and binary forms, with or
* without modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright noti... | 1 | 15,735 | @ivanbogdanov Does this fix the first time load gray screen issue that @wmathurin noticed? | forcedotcom-SalesforceMobileSDK-Android | java |
@@ -35,11 +35,12 @@ __all__ = ['Dataset', 'Booster',
'print_evaluation', 'record_evaluation', 'reset_parameter', 'early_stopping',
'plot_importance', 'plot_metric', 'plot_tree', 'create_tree_digraph']
+# REMOVEME: remove warning after 2.3.0 version release
if system() == 'Darwin':
warnin... | 1 | # coding: utf-8
"""LightGBM, Light Gradient Boosting Machine.
Contributors: https://github.com/Microsoft/LightGBM/graphs/contributors
"""
from __future__ import absolute_import
from .basic import Booster, Dataset
from .callback import (early_stopping, print_evaluation, record_evaluation,
reset_... | 1 | 19,206 | Is `2.3.0` version OK? | microsoft-LightGBM | cpp |
@@ -26,6 +26,18 @@ describe "Selenium::WebDriver::TargetLocator" do
end
end
+ it "should switch to parent frame" do
+ driver.navigate.to url_for("iframes.html")
+
+ iframe = driver.find_element(:tag_name => "iframe")
+ driver.switch_to.frame(iframe)
+
+ driver.find_element(:name, 'login').should ... | 1 | require File.expand_path("../spec_helper", __FILE__)
describe "Selenium::WebDriver::TargetLocator" do
let(:wait) { Selenium::WebDriver::Wait.new }
it "should find the active element" do
driver.navigate.to url_for("xhtmlTest.html")
driver.switch_to.active_element.should be_an_instance_of(WebDriver::Element... | 1 | 11,085 | I tested it only in Firefox (`./go //rb:firefox-test`) | SeleniumHQ-selenium | rb |
@@ -10,6 +10,8 @@ import (
"net/http/httptest"
)
+// NewTestClient returns a TestClient with a replacement http handler function.
+// Methods on the new TestClient are overrideable as well.
func NewTestClient(handleFunc http.HandlerFunc) (*httptest.Server, *TestClient, error) {
ts := httptest.NewServer(handleFu... | 1 | package compute
import (
"context"
"time"
"google.golang.org/api/compute/v1"
"google.golang.org/api/option"
"net/http"
"net/http/httptest"
)
func NewTestClient(handleFunc http.HandlerFunc) (*httptest.Server, *TestClient, error) {
ts := httptest.NewServer(handleFunc)
opts := []option.ClientOption{
option.Wi... | 1 | 6,559 | separate third party and builtin | GoogleCloudPlatform-compute-image-tools | go |
@@ -818,7 +818,9 @@ public class SalesforceSDKManager {
// Finishes front activity if specified, and if this is the last account.
if (frontActivity != null && (users == null || users.size() <= 1)) {
- frontActivity.finish();
+ // only finish if it isn't hybrid or if hybrid, req... | 1 | /*
* Copyright (c) 2014-present, salesforce.com, inc.
* All rights reserved.
* Redistribution and use of this software in source and binary forms, with or
* without modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright noti... | 1 | 16,681 | @smcnulty-sfdc We do want to finish the hybrid activity in our hybrid apps though. Could the caller not pass in `frontActivity` instead? Or start it up again post-logout? | forcedotcom-SalesforceMobileSDK-Android | java |
@@ -111,7 +111,7 @@ func (o outbound) Call(ctx context.Context, req *transport.Request) (*transport.
response, err := ctxhttp.Do(ctx, o.Client, request)
if err != nil {
- if err == context.DeadlineExceeded {
+ if err == ctx.Err() {
return nil, errors.NewTimeoutError(req.Service, req.Procedure, deadline.Sub(... | 1 | // Copyright (c) 2016 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge... | 1 | 10,304 | isn't this going to return a timeout error if the context is canceled? | yarpc-yarpc-go | go |
@@ -15,6 +15,10 @@ class ArgsParser {
ArgsParser(String[] args) {
for (String arg : args) {
String[] argNameVal = arg.split("=");
+ if (argNameVal.length == 1) {
+ parsedArgs.put(argNameVal[0], "true");
+ continue;
+ }
if (argNameVal.length != 2) {
System.out.print... | 1 | package com.google.api.codegen.bazel;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
class ArgsParser {
private final Map<String, String> parsedArgs = ne... | 1 | 30,769 | `argNameVal.length` will still be !=2, so line 22 will give true and then continue on line 24 | googleapis-gapic-generator | java |
@@ -237,7 +237,7 @@ class FunctionDocblockManipulator
continue;
}
- if ($char === '\\' || preg_match('/\w/', $char)) {
+ if ($chars[$i + 1] === '\\' || preg_match('/\w/', $char)) {
if ($this->return_typehint_start === null) {
$t... | 1 | <?php
namespace Psalm\Internal\FileManipulation;
use PhpParser;
use PhpParser\Node\Expr\ArrowFunction;
use PhpParser\Node\Expr\Closure;
use PhpParser\Node\FunctionLike;
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Function_;
use Psalm\DocComment;
use Psalm\FileManipulation;
use Psalm\Internal\Analyzer\... | 1 | 11,380 | It was `$chars[$i]` I believe. | vimeo-psalm | php |
@@ -246,7 +246,7 @@ module Unix::Exec
else
val = val.to_s
end
- env_array << "#{key.to_s.upcase}=\"#{val}\""
+ env_array << "#{key.to_s}=\"#{val}\""
end
env_array
end | 1 | module Unix::Exec
include Beaker::CommandFactory
def reboot
if self['platform'] =~ /solaris/
exec(Beaker::Command.new("reboot"), :expect_connection_failure => true)
else
exec(Beaker::Command.new("/sbin/shutdown -r now"), :expect_connection_failure => true)
end
sleep(10) #if we attempt a... | 1 | 14,283 | This has the likely potential to break existing tests that are relying on the old beaker behavior. If we are going to release this in beaker 3.x, then we need to preserve the old behavior as well (so set both the `upcase` and original values). On Windows, they env variables will overwrite each other, with the same valu... | voxpupuli-beaker | rb |
@@ -299,6 +299,7 @@ Blockly.Variables.createVariable = function(workspace, opt_callback, opt_type) {
// Prompt the user to enter a name for the variable
Blockly.prompt(newMsg, '',
function(text, additionalVars, variableOptions) {
+ variableOptions = variableOptions || {};
var scope = variab... | 1 | /**
* @license
* Visual Blocks Editor
*
* Copyright 2012 Google Inc.
* https://developers.google.com/blockly/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apach... | 1 | 9,860 | Thanks for fixing this! I probably didn't test the playground when making changes here for cloud variables. | LLK-scratch-blocks | js |
@@ -39,6 +39,7 @@ class PruneColumns extends AvroSchemaVisitor<Schema> {
private final NameMapping nameMapping;
PruneColumns(Set<Integer> selectedIds, NameMapping nameMapping) {
+ Preconditions.checkNotNull(selectedIds, "Selected field ids cannot be null");
this.selectedIds = selectedIds;
this.name... | 1 | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | 1 | 24,956 | I will also check if `nameMapping` needs a precondition null check. | apache-iceberg | java |
@@ -60,9 +60,8 @@ public class Files {
if (!file.getParentFile().isDirectory() && !file.getParentFile().mkdirs()) {
throw new RuntimeIOException(
- String.format(
"Failed to create the file's directory at %s.",
- file.getParentFile().getAbsolutePath()));
+ ... | 1 | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | 1 | 24,303 | Since RuntimeIOException is deprecated and you are touching this code, why not replace it? | apache-iceberg | java |
@@ -59,7 +59,9 @@ class ClusterParamsTest(TestCaseBase):
self.assertGreaterEqual(encodersDict['c1']['resolution'], 0.001,
"Resolution is too low")
-
+ # Ensure incorrect tmImplementation throws exception
+ with self.assertRaises(ValueError):
+ getScalarMetricWithTime... | 1 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditio... | 1 | 20,920 | You should also have a test that calls it with tm_cpp and make sure it returns the correct JSON file. | numenta-nupic | py |
@@ -168,17 +168,12 @@ define(["jQuery", "globalize", "scripts/taskbutton", "dom", "libraryMenu", "layo
}), menuItems.push({
name: "Xml TV",
id: "xmltv"
- }), menuItems.push({
- name: globalize.translate("ButtonOther"),
- id: "other"
}), require(["... | 1 | define(["jQuery", "globalize", "scripts/taskbutton", "dom", "libraryMenu", "layoutManager", "loading", "listViewStyle", "flexStyles", "emby-itemscontainer", "cardStyle", "material-icons", "emby-button"], function($, globalize, taskButton, dom, libraryMenu, layoutManager, loading) {
"use strict";
function getDe... | 1 | 11,663 | One more minor change, the string `ForAdditionalLiveTvOptions` is probably also unused. | jellyfin-jellyfin-web | js |
@@ -107,7 +107,7 @@ bool RowReaderWrapper::reset(meta::SchemaProviderIf const* schema,
currReader_ = &readerV2_;
return true;
} else {
- LOG(ERROR) << "Unsupported row reader version " << readerVer;
+ LOG(WARNING) << "Unsupported row reader version " << readerVer;
currReader_ = nullptr;
ret... | 1 | /* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
#include "codec/RowReaderWrapper.h"
namespace nebula {
// static
RowReaderWrapper RowReaderWrapper::getTagPropReader(meta::SchemaManager* schemaMan,
... | 1 | 33,205 | How to distinguish between warning and error? | vesoft-inc-nebula | cpp |
@@ -171,6 +171,10 @@ def doPreGainFocus(obj,sleepMode=False):
else:
newForeground=obj
api.setForegroundObject(newForeground)
+ import UIAHandler
+ if UIAHandler.isUIAAvailable:
+ # Notify UIAHandler of the new foreground so that it can deregister old events and register new ones
+ UIAHandler.handler.... | 1 | #eventHandler.py
#A part of NonVisual Desktop Access (NVDA)
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
#Copyright (C) 2007-2017 NV Access Limited, Babbage B.V.
import threading
import queueHandler
import api
import speech
import appModuleHandler
import t... | 1 | 23,254 | Perhaps you want to check if UIAHandler.handler is not None. The current check will break NVDA if you call UIAHandler.terminate() for some reason. | nvaccess-nvda | py |
@@ -27,6 +27,7 @@ public class BaseReplacePartitions
extends MergingSnapshotProducer<ReplacePartitions> implements ReplacePartitions {
BaseReplacePartitions(String tableName, TableOperations ops) {
super(tableName, ops);
+ set("replace-partitions", "true");
}
@Override | 1 | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | 1 | 20,223 | can we make `replace-partitions` property a static variable in `SnaphotSummary.java`? | apache-iceberg | java |
@@ -57,8 +57,10 @@ module Selenium
#
# @return [Driver]
#
- # @see Selenium::WebDriver::Remote::Bridge
+ # @see Selenium::WebDriver::Remote::OSSBridge
+ # @see Selenium::WebDriver::Remote::W3CBridge
# @see Selenium::WebDriver::Firefox::Bridge
+ # @see Selenium::WebDriver::Firefox::W3CBri... | 1 | # encoding: utf-8
#
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "Li... | 1 | 14,227 | Maybe call it `WireBridge`? | SeleniumHQ-selenium | js |
@@ -79,7 +79,9 @@ def get_admins():
def activate_response(link):
payload = verify_activation_link(link)
if payload:
- _activate_user(User.query.filter_by(id=payload['id']).with_for_update().one_or_none())
+ user = User.query.filter_by(id=payload['id']).with_for_update().one_or_none()
+ _... | 1 | import base64
from datetime import datetime, timedelta
import json
import uuid
from flask import redirect, request
import itsdangerous
import jwt
from passlib.context import CryptContext
from sqlalchemy import func
from . import app, db
from .const import (ACTIVATE_SALT, CODE_TTL_DEFAULT, INVALID_USERNAMES,
... | 1 | 16,965 | Should really be `one()`, not `one_or_none()` | quiltdata-quilt | py |
@@ -193,7 +193,11 @@ func SetJoinNodeConfigurationOverrides(caCertHash, bootstrapToken string, machin
}
out.NodeRegistration.KubeletExtraArgs["cloud-provider"] = CloudProvider
if !util.IsControlPlaneMachine(machine.GetMachine()) {
- out.NodeRegistration.KubeletExtraArgs["node-labels"] = nodeRole
+ if labels, ok... | 1 | /*
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | 1 | 9,611 | Should we use strings.Split and strings.Join instead of manual concatenation? | kubernetes-sigs-cluster-api-provider-aws | go |
@@ -374,6 +374,18 @@ class In(
asset_partitions=asset_partitions,
)
+ @staticmethod
+ def from_definition(input_def: InputDefinition):
+ return In(
+ dagster_type=input_def.dagster_type,
+ description=input_def.description,
+ default_value=input_def.... | 1 | from collections import namedtuple
from typing import NamedTuple, Optional, Set
from dagster import check
from dagster.core.definitions.events import AssetKey
from dagster.core.errors import DagsterError, DagsterInvalidDefinitionError
from dagster.core.types.dagster_type import (
BuiltinScalarDagsterType,
Dags... | 1 | 16,516 | rough that this needs to exist, but it is what it is | dagster-io-dagster | py |
@@ -117,6 +117,17 @@ describe('render()', () => {
expect(scratch.firstChild).to.have.property('nodeName', 'X-BAR');
});
+ // TODO: the test doesn't seem to work as it throws, maybe due to not knowing the props allowed for x-bar
+ // it('should not set empty string for null props in custom attributes', () => {
+ ... | 1 | import { setupRerender } from 'preact/test-utils';
import { createElement, render, Component, options } from 'preact';
import {
setupScratch,
teardown,
getMixedArray,
mixedArrayHTML,
serializeHtml,
supportsDataList,
sortAttributes,
spyOnElementAttributes,
createEvent
} from '../_util/helpers';
import { clearLo... | 1 | 17,349 | FYI, I pulled your branch and hacked a little on your test case. This passes for me (you may want to tweak further): <pre> it('should not set empty string for null props in custom elements', () => { customElements.define('x-bar', class extends HTMLElement { val; }); // @ts-ignore render(<x-bar val={null} />, scra... | preactjs-preact | js |
@@ -43,7 +43,7 @@ import android.util.Log;
*/
public class SmartStoreLoadExternalStorageTest extends SmartStoreLoadTest {
- static final int ONE_MEGABYTE = 1024 * 1024;
+ static final int LARGE_BYTES = 512 * 1024;
@Override
protected String getPasscode() { | 1 | /*
* Copyright (c) 2011, salesforce.com, inc.
* All rights reserved.
* Redistribution and use of this software in source and binary forms, with or
* without modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright notice, this... | 1 | 15,456 | It is the maximum value that the configured emulator can support. | forcedotcom-SalesforceMobileSDK-Android | java |
@@ -210,14 +210,17 @@ def _load_session(name):
name: The name of the session to load, or None to read state file.
"""
state_config = objreg.get('state-config')
+ session_manager = objreg.get('session-manager')
if name is None:
try:
name = state_config['general']['session... | 1 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... | 1 | 16,951 | Here, I've been giving priority to the session saved by the user. This means, that if the user quits with `:wq`, then restarts `qutebrowser`, and then `qutebrowser` crashes for some reason, next time `qutebrowser` is restarted, the session saved lastly with `wq` will be restored, and not the one autosaved. What do you ... | qutebrowser-qutebrowser | py |
@@ -64,7 +64,7 @@ func membership(l LedgerReader, addr basics.Address, r basics.Round, p period, s
balanceRound := balanceRound(r, cparams)
seedRound := seedRound(r, cparams)
- record, err := l.BalanceRecord(balanceRound, addr)
+ record, err := l.AccountData(balanceRound, addr)
if err != nil {
err = fmt.Erro... | 1 | // Copyright (C) 2019-2020 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) ... | 1 | 39,885 | this line got me confused for few seconds, as the `AccountData` is both the name of the data structure as well as the function name. I think that `GetAccountData` is a better choice for a name. ( note that the same applies for the previous `BalanceRecord` function name ) | algorand-go-algorand | go |
@@ -61,11 +61,7 @@ public:
void helper_block_for_at_least_entries(
uint32_t amount)
{
- std::unique_lock<std::mutex> lck(*xml_mutex_);
- mock_consumer->cv().wait(lck, [this, amount]
- {
- return mock_consumer->ConsumedEntriesSize_nts() >= amount;
- ... | 1 | // Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless re... | 1 | 23,456 | I think this mutex is only used here. Remove it. | eProsima-Fast-DDS | cpp |
@@ -234,6 +234,11 @@ func NewMutableState(
logger: logger,
metricsClient: shard.GetMetricsClient(),
}
+
+ if migration.IsDBVersionEnabled() {
+ s.dbRecordVersion = 1
+ }
+
s.executionInfo = &persistencespb.WorkflowExecutionInfo{
WorkflowTaskVersion: common.EmptyVersion,
WorkflowTaskSchedu... | 1 | // The MIT License
//
// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved.
//
// Copyright (c) 2020 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Soft... | 1 | 12,095 | so this is now init to 1? | temporalio-temporal | go |
@@ -191,7 +191,8 @@ bool ZoneDatabase::LoadSpawnGroups(const char *zone_name, uint16 version, SpawnG
WHERE
spawn2.spawngroupID = spawngroup.ID
AND
- spawn2.version = {} and zone = '{}'
+ (spawn2.version = {} OR version = -1)
+ AND zone = '{}'
{}
),
version, | 1 | /* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is d... | 1 | 10,304 | For future note; not prefixing the table in a join can throw an error in the query parser depending on how the query is built I am making an assumption this was tested | EQEmu-Server | cpp |
@@ -42,9 +42,13 @@ var c client.Client
var expectedRequest = reconcile.Request{NamespacedName: types.NamespacedName{Name: "foo", Namespace: "default"}}
-var jobKey = types.NamespacedName{Name: "install-foo", Namespace: "default"}
+var jobKey = types.NamespacedName{Name: "foo-install", Namespace: "default"}
-cons... | 1 | /*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | 1 | 4,472 | Had to bring this up, will abandon this style of testing based on Joel's work soon. | openshift-hive | go |
@@ -493,7 +493,7 @@ public class HttpSolrCall {
}
if (statusCode == AuthorizationResponse.FORBIDDEN.statusCode) {
if (log.isDebugEnabled()) {
- log.debug("UNAUTHORIZED auth header {} context : {}, msg: {}", req.getHeader("Authorization"), context, authResponse.getMessage()); // logOk
+ lo... | 1 | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | 1 | 37,483 | What does our source validation complain about here? Many of the logok/nowarn places look fine to me at a glance but I'm no match for the logging policeman ;-) | apache-lucene-solr | java |
@@ -22,14 +22,17 @@ import (
"strconv"
"time"
+ "github.com/mysteriumnetwork/node/client/stats"
"github.com/mysteriumnetwork/node/openvpn/management"
)
// SessionStatsHandler is invoked when middleware receives statistics
-type SessionStatsHandler func(SessionStats) error
+type SessionStatsHandler func(stat... | 1 | /*
* Copyright (C) 2017 The "MysteriumNetwork/node" Authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
... | 1 | 11,740 | It feels like this dependency should not be here. Some deep internal openvpn package (middleware) knows about one of possible stats consumers. Maybe as an alternative, statistics and state callbacks can be extracted as separate interfaces in top openvpn package and reused by both sides | mysteriumnetwork-node | go |
@@ -1744,7 +1744,7 @@ func (fd *fileData) deepCopy(ctx context.Context, codec kbfscodec.Codec,
// Handle the single-level case first.
if !topBlock.IsInd {
- newTopBlock, err := topBlock.DeepCopy(codec)
+ newTopBlock := topBlock.DeepCopy()
if err != nil {
return zeroPtr, nil, err
} | 1 | // Copyright 2016 Keybase Inc. All rights reserved.
// Use of this source code is governed by a BSD
// license that can be found in the LICENSE file.
package libkbfs
import (
"fmt"
"time"
"github.com/keybase/client/go/logger"
"github.com/keybase/client/go/protocol/keybase1"
"github.com/keybase/kbfs/kbfsblock"
... | 1 | 15,533 | Can you please remove `codec` from the parameters too? I think it's unused now. | keybase-kbfs | go |
@@ -126,6 +126,7 @@ class ContextTest extends AbstractSymbolResolutionTest {
when(compilationUnitDecl.getName()).thenReturn("CompilationUnit");
when(compilationUnitDecl.getQualifiedName()).thenReturn("com.github.javaparser.ast.CompilationUnit");
TypeSolver typeSolver = mock(TypeSolver.class);... | 1 | /*
* Copyright (C) 2015-2016 Federico Tomassetti
* Copyright (C) 2017-2019 The JavaParser Team.
*
* This file is part of JavaParser.
*
* JavaParser can be used either under the terms of
* a) the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License... | 1 | 14,122 | mocks needed this change so that it returns the "right" thing | javaparser-javaparser | java |
@@ -128,9 +128,14 @@ public class MenuEntrySwapperPlugin extends Plugin
@Getter
private boolean configuringShiftClick = false;
+ @Getter
@Setter
private boolean shiftModifier = false;
+ @Getter
+ @Setter
+ private boolean controlModifier = false;
+
@Provides
MenuEntrySwapperConfig provideConfig(ConfigMa... | 1 | /*
* Copyright (c) 2018, Adam <Adam@sigterm.info>
* Copyright (c) 2018, Kamiel
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above c... | 1 | 14,904 | I don't think the getters for this are needed, but looks good other than that | open-osrs-runelite | java |
@@ -1,3 +1,16 @@
<%= content_tag_for :div, video do %>
- <%= render 'videos/summary', video: video %>
+ <div class="video-text <%= video.status_class %>">
+ <%= link_to video_path(video) do %>
+ <h3><%= video.name %></h3>
+ <% end %>
+ <div class="video-tags">
+ <%= render video.topics %>
+ </d... | 1 | <%= content_tag_for :div, video do %>
<%= render 'videos/summary', video: video %>
<% end %>
| 1 | 15,676 | :+1: to inlining this. | thoughtbot-upcase | rb |
@@ -13785,7 +13785,7 @@ return [
'stream_get_contents' => ['string|false', 'stream'=>'resource', 'length='=>'int', 'offset='=>'int'],
'stream_get_filters' => ['array'],
'stream_get_line' => ['string|false', 'stream'=>'resource', 'length'=>'int', 'ending='=>'string'],
-'stream_get_meta_data' => ['array{timed_out:bool... | 1 | <?php // phpcs:ignoreFile
namespace Phan\Language\Internal;
/**
* CURRENT PHP TARGET VERSION: 8.1
* The version above has to match Psalm\Internal\Codebase\InternalCallMapHandler::PHP_(MAJOR|MINOR)_VERSION
*
* Format
*
* '<function_name>' => ['<return_type>, '<arg_name>'=>'<arg_type>']
* alternative signature fo... | 1 | 11,729 | Does psalm support the same logic internally for object-like arrays? Just want to be certain I can indicate this is a contextual return item `crypto?:mixed`. | vimeo-psalm | php |
@@ -658,8 +658,6 @@ void CreateImageTest(VkLayerTest &test, const VkImageCreateInfo *pCreateInfo, st
VkImage image = VK_NULL_HANDLE;
if (code.length()) {
test.Monitor().SetDesiredFailureMsg(kErrorBit, code);
- // Very possible a test didn't check for VK_ERROR_FORMAT_NOT_SUPPORTED
- test... | 1 | /*
* Copyright (c) 2015-2021 The Khronos Group Inc.
* Copyright (c) 2015-2021 Valve Corporation
* Copyright (c) 2015-2021 LunarG, Inc.
* Copyright (c) 2015-2021 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Y... | 1 | 20,752 | I can't recall if there was a fix specific to this in the past? | KhronosGroup-Vulkan-ValidationLayers | cpp |
@@ -51,14 +51,15 @@ var _ = duck.VerifyType(&PubSubSource{}, &duckv1alpha1.Conditions{})
// PubSubSourceSpec defines the desired state of the PubSubSource.
type PubSubSourceSpec struct {
- // GcpCredsSecret is the credential to use to poll the GCP PubSubSource Subscription. It is not used
+ // Secret is the credent... | 1 | /*
Copyright 2019 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | 1 | 8,011 | Not sure what the todo is here? Is it to support some kind of defaulting based off of that? | google-knative-gcp | go |
@@ -68,11 +68,18 @@ namespace NLog.Targets.Wrappers
/// Delay the flush until the LogEvent has been confirmed as written
/// </summary>
/// <docgen category='General Options' order='10' />
- public bool AsyncFlush { get => _asyncFlush ?? true;
+ public bool AsyncFlush
+ {... | 1 | //
// Copyright (c) 2004-2019 Jaroslaw Kowalski <jaak@jkowalski.net>, Kim Christensen, Julian Verdurmen
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// * Redistributions of s... | 1 | 19,632 | Not sure about this name. I think "explicit" is also a bit difficult here (I think it should be implicit then) Proposal: FlushOnEvents. Or, It would be cool if we could split into 2 options, FlushOnShutdown and FlushOnReload, but I expect that's far more difficult to implement? | NLog-NLog | .cs |
@@ -32,7 +32,11 @@ from qutebrowser.utils import objreg, qtutils
from qutebrowser.browser.webkit import tabhistory
-pytestmark = pytest.mark.qt_log_ignore('QIODevice::read.*: device not open')
+@pytest.fixture(autouse=True)
+@pytest.mark.qt_log_ignore('QIODevice::read.*: device not open')
+def autouse(fake_save_ma... | 1 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... | 1 | 21,768 | I don't think that works - you can't mark a fixture. | qutebrowser-qutebrowser | py |
@@ -42,6 +42,12 @@ module Bolt
PUPPETFILE_OPTIONS = %w[proxy forge].freeze
+ DEFAULT_CONFIG_PATHS = [
+ Bolt::Util.windows? ? 'C:\\Program Files\\Puppet Labs\\Bolt\\bolt.yaml' : '/etc/puppetlabs/bolt/bolt.yaml',
+ File.expand_path('.puppetlabs/etc/bolt/bolt.yaml', Bolt::Util.windows? ? ENV['USERPR... | 1 | # frozen_string_literal: true
require 'etc'
require 'logging'
require 'pathname'
require 'bolt/boltdir'
require 'bolt/transport/ssh'
require 'bolt/transport/winrm'
require 'bolt/transport/orch'
require 'bolt/transport/local'
require 'bolt/transport/local_windows'
require 'bolt/transport/docker'
require 'bolt/transport... | 1 | 13,501 | We should not include this path. | puppetlabs-bolt | rb |
@@ -52,6 +52,19 @@ class SlackWebhooknotifierTest(ForsetiTestCase):
self.assertEqual(expected_output.strip(), actual_output.strip())
+ def test_dump_slack_output_for_string_returns_string(self):
+ violation_data = 'Test violation data string'
+ with mock.patch.object(
+ ... | 1 | # Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 1 | 34,992 | Add newline at end of file | forseti-security-forseti-security | py |
@@ -257,6 +257,9 @@ class DBUpgrader {
db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS
+ " ADD COLUMN " + PodDBAdapter.KEY_EXCLUDE_FILTER + " TEXT DEFAULT ''");
+ db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS
+ + " ADD COLUMN " + Po... | 1 | package de.danoeh.antennapod.core.storage;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.media.MediaMetadataRetriever;
import android.util.Log;
import de.danoeh.antennapod.model.feed.FeedItem;
import static de.danoeh.antennapod.mod... | 1 | 20,823 | This should be done when updating to the next release (2.5). You currently only perform the upgrade when users go from 1.4 to 1.5, so it will lead to crashes for existing users. | AntennaPod-AntennaPod | java |
@@ -320,6 +320,9 @@ const (
// HiveFeatureGatesEnabledEnvVar is the the environment variable specifying the comma separated list of
// feature gates that are enabled.
HiveFeatureGatesEnabledEnvVar = "HIVE_FEATURE_GATES_ENABLED"
+
+ // CentralMachineManagementAnnotation
+ CentralMachineManagementAnnotation = "hive... | 1 | package constants
import (
apihelpers "github.com/openshift/hive/apis/helpers"
hivev1 "github.com/openshift/hive/apis/hive/v1"
)
const (
PlatformAWS = "aws"
PlatformAzure = "azure"
PlatformBaremetal = "baremetal"
PlatformAgentBaremetal = "agent-baremetal"
PlatformGCP = "gcp"... | 1 | 16,946 | suggest hive.openshift.io/cluster-machine-management or something to make it more obvious what it is. | openshift-hive | go |
@@ -45,7 +45,7 @@ using Nethermind.JsonRpc.Modules.Eth.FeeHistory;
namespace Nethermind.Init.Steps
{
- [RunnerStepDependencies(typeof(InitializeNetwork), typeof(SetupKeyStore), typeof(InitializeBlockchain), typeof(InitializePlugins))]
+ [RunnerStepDependencies(typeof(InitializeNetwork), typeof(SetupKeyStore),... | 1 | // Copyright (c) 2021 Demerzel Solutions Limited
// This file is part of the Nethermind library.
//
// The Nethermind library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of ... | 1 | 26,579 | We explicitly don't want to do that. This was a complaint from users before. | NethermindEth-nethermind | .cs |
@@ -28,6 +28,7 @@ use Thelia\Type\TypeCollection;
* {@inheritdoc}
* @method int getId()
* @method int[] getExclude()
+ * @method int[] getExcludeCode()
* @method string getCode()
* @method string[] getOrder()
*/ | 1 | <?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio ... | 1 | 12,400 | Hello, The PHPDoc is `string[]` not `int[]` | thelia-thelia | php |
@@ -20,7 +20,7 @@ import (
"github.com/chaos-mesh/chaos-mesh/pkg/mock"
)
-func applyTc(ctx context.Context, pid uint32, args ...string) error {
+func applyTc(ctx context.Context, pid uint32, enterNS bool, args ...string) error {
// Mock point to return error in unit test
if err := mock.On("TcApplyError"); err ... | 1 | // Copyright 2020 Chaos Mesh Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... | 1 | 19,131 | Same issues with parameters order in `ipset_server.go` | chaos-mesh-chaos-mesh | go |
@@ -82,8 +82,8 @@ const (
SystemLocalNamespace = "temporal-system"
// SystemNamespaceID is namespace id for all temporal system workflows
SystemNamespaceID = "32049b68-7872-4094-8e63-d0dd59896a83"
- // SystemNamespaceRetentionDays is retention config for all temporal system workflows
- SystemNamespaceRetentionDay... | 1 | // The MIT License
//
// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved.
//
// Copyright (c) 2020 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Soft... | 1 | 11,855 | Wow, did it literally mean the retention days is a huge number? | temporalio-temporal | go |
@@ -216,6 +216,11 @@ int FlatCompiler::Compile(int argc, const char **argv) {
flatbuffers::PosixPath(argv[argi]));
include_directories.push_back(
include_directories_storage.back().c_str());
+ } else if (arg == "--bfbs-filenames") {
+ if (++argi > argc) Error("missing path... | 1 | /*
* Copyright 2014 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | 1 | 21,130 | you probably didn't intend to touch those files in `scripts/` | google-flatbuffers | java |
@@ -270,6 +270,7 @@ def eval_map(det_results,
iou_thr=0.5,
dataset=None,
logger=None,
+ tpfp_func=None,
nproc=4):
"""Evaluate mAP of a dataset.
| 1 | from multiprocessing import Pool
import mmcv
import numpy as np
from mmcv.utils import print_log
from terminaltables import AsciiTable
from .bbox_overlaps import bbox_overlaps
from .class_names import get_classes
def average_precision(recalls, precisions, mode='area'):
"""Calculate average precision (for single... | 1 | 21,725 | Similar to `collate_fn`, we may rename it to `tpfp_fn`. | open-mmlab-mmdetection | py |
@@ -320,6 +320,7 @@ export class TopOverlay extends Overlay {
return this.wot.wtTable.holderOffset.top;
}
+
return 0;
} | 1 | import {
addClass,
getScrollbarWidth,
getScrollTop,
getWindowScrollLeft,
hasClass,
outerHeight,
removeClass,
setOverlayPosition,
resetCssTransform,
} from './../../../../helpers/dom/element';
import TopOverlayTable from './../table/top';
import { Overlay } from './_base';
import {
CLONE_TOP,
} from ... | 1 | 18,489 | Awesome! We may also use negative rule `never` to fix new lines after `return`: `{ blankLine: "never", prev: "return", next: "*" }` | handsontable-handsontable | js |
@@ -0,0 +1,18 @@
+// Copyright 2016 Keybase Inc. All rights reserved.
+// Use of this source code is governed by a BSD
+// license that can be found in the LICENSE file.
+
+package libkbfs
+
+import "errors"
+
+// GetJournalServer returns the JournalServer tied to a particular
+// config.
+func GetJournalServer(config ... | 1 | 1 | 12,125 | Why can't this be a function on the `Config` interface like all the others? | keybase-kbfs | go | |
@@ -252,7 +252,9 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem
optionsMenu = menu;
FeedMenuHandler.onCreateOptionsMenu(inflater, menu);
iconTintManager.updateTint();
- MenuItemUtils.setupSearchItem(menu, (MainActivity) getActivity(), feedID);
+ ... | 1 | package de.danoeh.antennapod.fragment;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.Configuration;
import android.content.Intent;
import android.graphics.LightingColorFilter;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import andr... | 1 | 17,332 | If the feed is null, the menu items should still be setup. Just the feed title can be left out. That prevents possible flickering when menu items are displayed/hidden for some feeds. | AntennaPod-AntennaPod | java |
@@ -178,8 +178,12 @@ public class Spark3Util {
private static void apply(UpdateSchema pendingUpdate, TableChange.AddColumn add) {
Type type = SparkSchemaUtil.convert(add.dataType());
- pendingUpdate.addColumn(parentName(add.fieldNames()), leafName(add.fieldNames()), type, add.comment());
-
+ if (add.isN... | 1 | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | 1 | 22,970 | I'm not sure that this should call `allowIncompatibleChanges()` because adding a required column when there are no existing values will break reading the new column in any table with data in it. The only time it is safe to add a required column is if there is no data in the table. What about throwing an exception here ... | apache-iceberg | java |
@@ -154,7 +154,7 @@ class ServiceProvider extends ModuleServiceProvider
*/
WidgetManager::instance()->registerReportWidgets(function($manager){
$manager->registerReportWidget('System\ReportWidgets\Status', [
- 'label' => 'System status',
+ 'label' => Lan... | 1 | <?php namespace System;
use App;
use Lang;
use Event;
use Config;
use Backend;
use DbDongle;
use BackendMenu;
use BackendAuth;
use Twig_Environment;
use Twig_Loader_String;
use System\Classes\ErrorHandler;
use System\Classes\MarkupManager;
use System\Classes\PluginManager;
use System\Classes\SettingsManager;
use Syste... | 1 | 10,468 | Early translation , should be logic-less | octobercms-october | php |
@@ -0,0 +1,19 @@
+package proxy
+
+import "net/http"
+
+type interceptor interface {
+ InterceptRequest(*http.Request) (*http.Request, error)
+ InterceptResponse(*http.Response) (*http.Response, error)
+}
+
+type nullInterceptor struct {
+}
+
+func (i nullInterceptor) InterceptRequest(r *http.Request) (*http.Request, e... | 1 | 1 | 8,643 | I don't understand why these functions return a request/response, respectively. In all implementations we actually _modify_ the request/response given as a parameter. Do you envisage situations where we'd want to construct completely fresh request/response objects? Even if we do, it's not something needed atm, so I'd f... | weaveworks-weave | go | |
@@ -147,8 +147,8 @@ Rails.application.routes.draw do
get 'maintenance', to: 'abouts#maintenance'
get 'tools', to: 'abouts#tools'
- get 'p/compare', to: 'compares#projects', as: :compare_projects
- get 'p/project_graph', to: 'compares#projects_graph', as: :compare_graph_projects
+ get 'p/_compare', to: 'compa... | 1 | Rails.application.routes.draw do
ActiveAdmin.routes(self)
root to: 'home#index'
use_doorkeeper do
skip_controllers :applications, :authorized_applications
end
resources :sessions, only: [:new, :create] do
collection do
delete :destroy
end
end
resources :stack_entries, only: :new
re... | 1 | 8,006 | Wasn't there a subsequent reason why we had to keep the `/p/project_graph` route? Outside references or is the proposed solution to the original proposal we us `/p/g` as the `compares#project_graph` route? | blackducksoftware-ohloh-ui | rb |
@@ -44,6 +44,14 @@ public class GenTest {
assertThat(gen.apply(RANDOM)).isEqualTo(3);
}
+ @Test
+ public void shouldCreateGenOfFixedValues() {
+ final Gen<Integer> gen = Gen.fixed(1,2,3);
+ assertThat(gen.apply(RANDOM)).isIn(1,2,3);
+ assertThat(gen.apply(RANDOM)).isIn(1,2,3);... | 1 | /* / \____ _ _ ____ ______ / \ ____ __ _______
* / / \/ \ / \/ \ / /\__\/ // \/ \ // /\__\ JΛVΛSLΛNG
* _/ / /\ \ \/ / /\ \\__\\ \ // /\ \ /\\/ \ /__\ \ Copyright 2014-2016 Javaslang, http://javaslang.io
* /___/\_/ \_/\____/\_/ \_/\__\/__/\__\_/ \_// \__/\_____/ ... | 1 | 7,612 | Any suggestions on how I would even _approach_ writing tests for arbitrary values.... | vavr-io-vavr | java |
@@ -46,8 +46,8 @@ class Theme
*/
protected static $editThemeCache = false;
- const ACTIVE_KEY = 'cms::theme.active';
- const EDIT_KEY = 'cms::theme.edit';
+ private const ACTIVE_KEY = 'cms::theme.active';
+ private const EDIT_KEY = 'cms::theme.edit';
/**
* Loads the theme. | 1 | <?php namespace Cms\Classes;
use App;
use Url;
use File;
use Yaml;
use Lang;
use Cache;
use Event;
use Config;
use Cms\Models\ThemeData;
use System\Models\Parameter;
use October\Rain\Halcyon\Datasource\FileDatasource;
use ApplicationException;
use SystemException;
use DirectoryIterator;
use Exception;
/**
* This cla... | 1 | 12,955 | Scope declarations for class constants was not added until 7.1, this will not be accepted. | octobercms-october | php |
@@ -126,9 +126,11 @@ void TThreadedServer::onClientDisconnected(TConnectedClient* pClient) {
Synchronized sync(clientMonitor_);
drainDeadClients(); // use the outgoing thread to do some maintenance on our dead client backlog
ClientMap::iterator it = activeClientMap_.find(pClient);
- ClientMap::iterator end = ... | 1 | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ma... | 1 | 14,557 | The assertion here is that find should never return end() because this is the only mechanism that reaps items from the activeClientMap. If it == end something went horribly wrong. | apache-thrift | c |
@@ -24,6 +24,12 @@ import (
// A Collection is a set of documents.
type Collection interface {
+ // Key returns the document key, or nil if the document doesn't have one. Key
+ // should not return an error if the key is missing unless the collection cannot
+ // generate a fresh key for a Create action.
+ // The re... | 1 | // Copyright 2019 The Go Cloud Development Kit Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by appli... | 1 | 17,927 | The `unless the collection ...` part reads a little bit hard, maybe separate into its own sentence and explain what it means by `cannot generate a fresh key`? | google-go-cloud | go |
@@ -50,6 +50,9 @@ const (
// The feature is not implemented.
Unimplemented ErrorCode = 6
+
+ // The system was in the wrong state.
+ FailedPrecondition ErrorCode = 7
)
// Call "go generate" whenever you change the above list of error codes. | 1 | // Copyright 2019 The Go Cloud Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agr... | 1 | 13,793 | Doesn't `gcerr_string.go` need to be updated for this? | google-go-cloud | go |
@@ -2473,6 +2473,8 @@ func (c *Compiler) parseConvert(typeFrom, typeTo types.Type, value llvm.Value, p
switch elemType.Kind() {
case types.Byte:
return c.createRuntimeCall("stringToBytes", []llvm.Value{value}, ""), nil
+ case types.Rune:
+ return c.createRuntimeCall("stringToRunes", []llvm.Value{value}, ""... | 1 | package compiler
import (
"errors"
"fmt"
"go/build"
"go/constant"
"go/token"
"go/types"
"os"
"path/filepath"
"strconv"
"strings"
"github.com/tinygo-org/tinygo/ir"
"github.com/tinygo-org/tinygo/loader"
"golang.org/x/tools/go/ssa"
"tinygo.org/x/go-llvm"
)
func init() {
llvm.InitializeAllTargets()
llvm.... | 1 | 7,222 | Both cases allowed by the Go spec are now supported, so it's a bug in the compiler if we get here. You can replace the `todo:` error with a panic. (Note: getting here would be a bug because when we get to SSA level the code has long been type checked and has already been verified as being valid Go). | tinygo-org-tinygo | go |
@@ -551,6 +551,14 @@ class TabbedBrowser(tabwidget.TabWidget):
return
widget.setFocus()
+ def load_prepared_history(self, idx):
+ tab = self.widget(idx)
+ if len(tab.history_prepared) > 0:
+ tab.history.load_items(tab.history_prepared)
+ tab.history... | 1 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... | 1 | 16,819 | You can simply do `if tab.history_prepared:` here as empty lists are falsey. | qutebrowser-qutebrowser | py |
@@ -25,6 +25,8 @@ import (
"github.com/jetstack/cert-manager/cmd/ctl/pkg/create"
"github.com/jetstack/cert-manager/cmd/ctl/pkg/create/certificatesigningrequest"
+
+ "github.com/jetstack/cert-manager/cmd/ctl/pkg/install"
)
func NewCmdExperimental(ctx context.Context, ioStreams genericclioptions.IOStreams, fact... | 1 | /*
Copyright 2021 The cert-manager Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... | 1 | 27,759 | Remove this whitespace | jetstack-cert-manager | go |
@@ -118,12 +118,14 @@ def preprocess_example_input(input_config):
input_path = input_config['input_path']
input_shape = input_config['input_shape']
one_img = mmcv.imread(input_path)
+ one_img = mmcv.imresize(one_img, input_shape[2:][::-1])
+ show_img = one_img.copy()
if 'normalize_cfg' in inpu... | 1 | from functools import partial
import mmcv
import numpy as np
import torch
from mmcv.runner import load_checkpoint
try:
from mmcv.onnx.symbolic import register_extra_symbolics
except ModuleNotFoundError:
raise NotImplementedError('please update mmcv to version>=v1.0.4')
def generate_inputs_and_wrap_model(con... | 1 | 21,748 | `show_img` is not normalized while `one_img` is normalized. And line 139 pass `show_img` for pytorch2onnx function. Is this expected behavior? | open-mmlab-mmdetection | py |
@@ -45,11 +45,11 @@ function init(instance) {
let inputOffset = /[-+]?\d+\.?\d*/g.exec(this.textContent);
if (inputOffset) {
inputOffset = inputOffset[0];
+ inputOffset = parseFloat(inputOffset);
+ inputOffset = Math.min(30, Math.max(-30, inputOff... | 1 |
import { playbackManager } from '../playback/playbackmanager';
import layoutManager from '../layoutManager';
import template from './subtitlesync.template.html';
import './subtitlesync.css';
let player;
let subtitleSyncSlider;
let subtitleSyncTextField;
let subtitleSyncCloseButton;
let subtitleSyncContainer;
functio... | 1 | 18,375 | Why is this bounded between -30 and 30? | jellyfin-jellyfin-web | js |
@@ -21,7 +21,7 @@ THE SOFTWARE.
*/
/* HIT_START
- * BUILD: %t %s ../../test_common.cpp EXCLUDE_HIP_PLATFORM all
+ * BUILD: %t %s ../../test_common.cpp EXCLUDE_HIP_PLATFORM nvcc
* TEST: %t
* HIT_END
*/ | 1 | /*
Copyright (c) 2015-2017 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, co... | 1 | 8,114 | I think even you can exclude to run it on nvcc | ROCm-Developer-Tools-HIP | cpp |
@@ -179,7 +179,7 @@ func CreateIstgtConf(cStorVolume *apis.CStorVolume) []byte {
buffer.WriteString(`
PhysRecordLength 4096
`)
- buffer.WriteString(" LUN0 Storage " + cStorVolume.Spec.Capacity + " 32k")
+ buffer.WriteString(" LUN0 Storage " + cStorVolume.Spec.Capacity.String() + " 32k")
buffer.WriteString(`
... | 1 | /*
Copyright 2018 The OpenEBS Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 1 | 17,075 | G104: Errors unhandled. (from `gosec`) | openebs-maya | go |
@@ -182,6 +182,11 @@ class ECSTask(luigi.Task):
response = client.run_task(taskDefinition=self.task_def_arn,
overrides=overrides,
cluster=self.cluster)
+
+ if response['failures']:
+ raise Exception(", ".join(["fail to ru... | 1 | # -*- coding: utf-8 -*-
#
# Copyright 2015 Outlier Bio, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 1 | 18,591 | will `failure` always include `arn` and `reason` in its dictionary? If so, :+1: | spotify-luigi | py |
@@ -46,13 +46,13 @@ module Bolt
@logger = Logging.logger[self]
end
- def with_events(target, callback)
+ def with_events(target, callback, action)
callback&.call(type: :node_start, target: target)
result = begin
yield
rescue StandardE... | 1 | # frozen_string_literal: true
require 'logging'
require 'bolt/result'
module Bolt
module Transport
# This class provides the default behavior for Transports. A Transport is
# responsible for uploading files and running commands, scripts, and tasks
# on Targets.
#
# Bolt executes work on the Tran... | 1 | 14,415 | Should this be optional, or default to 'action' as well? | puppetlabs-bolt | rb |
@@ -16,6 +16,12 @@ package client
import (
"context"
+ "github.com/pkg/errors"
+ "k8s.io/apimachinery/pkg/types"
+ ctrl "sigs.k8s.io/controller-runtime"
+
+ "github.com/chaos-mesh/chaos-mesh/controllers/config"
+
"google.golang.org/grpc"
v1 "k8s.io/api/core/v1"
"sigs.k8s.io/controller-runtime/pkg/client" | 1 | // Copyright 2020 Chaos Mesh Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... | 1 | 19,785 | how about formating this import? | chaos-mesh-chaos-mesh | go |
@@ -177,13 +177,14 @@ def getReviewPosition():
globalVars.reviewPosition,globalVars.reviewPositionObj=review.getPositionForCurrentMode(obj)
return globalVars.reviewPosition
-def setReviewPosition(reviewPosition,clearNavigatorObject=True):
+def setReviewPosition(reviewPosition,clearNavigatorObject=True, isCaret=... | 1 | #api.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2006-2012 NVDA Contributors
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
"""General functions for NVDA"""
import config
import textInfos
import review
import globalVars
from logHandler imp... | 1 | 20,304 | Comma police. :) Also, the docstring needs updating. | nvaccess-nvda | py |
@@ -51,6 +51,7 @@ type driver struct {
volume.QuiesceDriver
volume.CredsDriver
volume.CloudBackupDriver
+ volume.CloudMigrateDriver
kv kvdb.Kvdb
thisCluster cluster.Cluster
} | 1 | /*
Package fake provides an in-memory fake driver implementation
Copyright 2018 Portworx
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required... | 1 | 7,061 | Implement an in-memory implementation of this in the fake driver. | libopenstorage-openstorage | go |
@@ -0,0 +1,13 @@
+require 'spec_helper'
+
+describe 'shows/_show.html.erb' do
+ it 'includes published episodes count' do
+ show = create(:show)
+ create_list(:video, 2, :published, watchable: show)
+ create(:video, watchable: show)
+
+ render 'shows/show', show: show
+
+ expect(rendered).to include('2 ... | 1 | 1 | 9,355 | Same question as the other view spec regarding not actually saving records. | thoughtbot-upcase | rb | |
@@ -269,9 +269,9 @@ namespace NLog.Config
factory.RegisterItemsFromAssembly(extensionAssembly);
success = true;
}
- catch (Exception)
+ catch (Exception ex)
{
- InternalLogger.Warn("Auto loading ... | 1 | //
// Copyright (c) 2004-2011 Jaroslaw Kowalski <jaak@jkowalski.net>
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// * Redistributions of source code must retain the above c... | 1 | 12,465 | Rethrow for `MustBeRethrown()`-exceptions? | NLog-NLog | .cs |
@@ -43,11 +43,13 @@ class RandomSampler(BaseSampler):
Tensor or ndarray: sampled indices.
"""
assert len(gallery) >= num
-
is_tensor = isinstance(gallery, torch.Tensor)
if not is_tensor:
- gallery = torch.tensor(
- gallery, dtype=torch.long, dev... | 1 | import torch
from ..builder import BBOX_SAMPLERS
from .base_sampler import BaseSampler
@BBOX_SAMPLERS.register_module()
class RandomSampler(BaseSampler):
"""Random sampler.
Args:
num (int): Number of samples
pos_fraction (float): Fraction of positive samples
neg_pos_up (int, optional... | 1 | 21,729 | May clean the unnecessary modification. | open-mmlab-mmdetection | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.