hash
stringlengths 40
40
| diff
stringlengths 131
26.7k
| message
stringlengths 7
694
| project
stringlengths 5
67
| split
stringclasses 1
value | diff_languages
stringlengths 2
24
|
---|---|---|---|---|---|
70d091fe117d65bc6ea53508963bfccd73e537e8 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -20,10 +20,14 @@ except pkg_resources.VersionConflict:
pkg_resources.require('Django >= 1.7')
django_bootstrap3 = 'django-bootstrap3 >= 5.4,<7.0.0'
django = 'Django >= 1.7,<1.8'
- except pkg_resources.VersionConflict:
+ except (pkg_resources.VersionConflict, pkg_resources.DistributionNotFound):
# Else we need to install Django, assume version will be >= 1.8
django_bootstrap3 = 'django-bootstrap3 >= 5.4'
django = 'Django >= 1.8,<1.10'
+# No version of django installed, assume version will be >= 1.8
+except pkg_resources.DistributionNotFound:
+ django_bootstrap3 = 'django-bootstrap3 >= 5.4'
+ django = 'Django >= 1.8,<1.10'
setup(
name='django-cas-server', | Case when django is not installed | nitmir_django-cas-server | train | py |
100c596033973437e65356b658c9507ebeb5a93a | diff --git a/lib/metamorpher/builders/ruby/uppercase_constant_rewriter.rb b/lib/metamorpher/builders/ruby/uppercase_constant_rewriter.rb
index <HASH>..<HASH> 100644
--- a/lib/metamorpher/builders/ruby/uppercase_constant_rewriter.rb
+++ b/lib/metamorpher/builders/ruby/uppercase_constant_rewriter.rb
@@ -1,29 +1,15 @@
require "metamorpher/builders/ast"
+require "metamorpher/builders/ruby/uppercase_rewriter"
module Metamorpher
module Builders
module Ruby
- class UppercaseConstantRewriter
+ class UppercaseConstantRewriter < UppercaseRewriter
include Metamorpher::Rewriter
include Metamorpher::Builders::AST
def pattern
- builder.const(
- builder.literal!(nil),
- builder.VARIABLE_TO_BE { |v| v.name && v.name.to_s[/^[A-Z_]*$/] }
- )
- end
-
- def replacement
- builder.derivation!(:variable_to_be) do |variable_to_be, builder|
- name = variable_to_be.name.to_s
-
- if name.end_with?("_")
- builder.greedy_variable! name.chomp("_").downcase.to_sym
- else
- builder.variable! name.downcase.to_sym
- end
- end
+ builder.const(builder.literal!(nil), super)
end
end
end | Reduce duplication in Ruby builder code. | ruby-mutiny_metamorpher | train | rb |
869960c0fa42eb6cb6c25ce796311c6a75ac3650 | diff --git a/utp.go b/utp.go
index <HASH>..<HASH> 100644
--- a/utp.go
+++ b/utp.go
@@ -179,6 +179,11 @@ func DialTimeout(addr string, timeout time.Duration) (nc net.Conn, err error) {
return s.DialTimeout(addr, timeout)
}
+// Listen creates listener Socket to accept incoming connections.
+func Listen(laddr string) (net.Listener, error) {
+ return NewSocket("udp", laddr)
+}
+
func nowTimestamp() uint32 {
return uint32(time.Now().UnixNano() / int64(time.Microsecond))
}
diff --git a/utp_test.go b/utp_test.go
index <HASH>..<HASH> 100644
--- a/utp_test.go
+++ b/utp_test.go
@@ -95,6 +95,15 @@ func TestDialTimeout(t *testing.T) {
t.Log(err)
}
+func TestListen(t *testing.T) {
+ defer goroutineLeakCheck(t)()
+ ln, err := NewSocket("udp", "localhost:0")
+ if err != nil {
+ t.Fatal(err)
+ }
+ ln.Close()
+}
+
func TestMinMaxHeaderType(t *testing.T) {
require.Equal(t, stSyn, stMax)
} | provide Listen method that returns net.Listener | anacrolix_utp | train | go,go |
7e5e0c3185cf1c3132db376b9248b61e2225c903 | diff --git a/holoviews/plotting/plot.py b/holoviews/plotting/plot.py
index <HASH>..<HASH> 100644
--- a/holoviews/plotting/plot.py
+++ b/holoviews/plotting/plot.py
@@ -426,7 +426,7 @@ class GenericElementPlot(DimensionedPlot):
keys = keys if keys else list(self.hmap.data.keys())
plot_opts = self.lookup_options(self.hmap.last, 'plot').options
- dynamic = element.mode if isinstance(element, DynamicMap) else False
+ dynamic = False if not isinstance(element, DynamicMap) or element.sampled else element.mode
super(GenericElementPlot, self).__init__(keys=keys, dimensions=dimensions,
dynamic=dynamic,
**dict(params, **plot_opts)) | Fixed display of sampled DynamicMaps with items in cache | pyviz_holoviews | train | py |
c8c84b0935365745da87b4010743565f4afa5a9b | diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index <HASH>..<HASH> 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -42,9 +42,6 @@ if(isset($_SERVER['argv'][2])) {
$_REQUEST = array_merge($_REQUEST, $_GET);
}
-// Always flush the manifest for phpunit test runs
-$_GET['flush'] = 1;
-
// Connect to database
require_once $frameworkPath . '/core/Core.php';
require_once $frameworkPath . '/tests/FakeController.php';
@@ -65,4 +62,4 @@ $controller = new FakeController();
TestRunner::use_test_manifest();
// Remove the error handler so that PHPUnit can add its own
-restore_error_handler();
+restore_error_handler();
\ No newline at end of file | Don't flush manifest in test bootstrap for performance reasons
Leave the decision to the phpunit.xml config (via <get> setting),
or to the individual run via "phpunit <folder> '' flush=1".
Flushing takes multiple seconds even on my fast SSD,
which greatly reduces the likelyhood of developers adopting TDD. | silverstripe_silverstripe-framework | train | php |
6c5e5366270f167ed0472c31aa8958566fbf7049 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -17,7 +17,7 @@ function matchLicense(licenseString) {
return license.name
}
}
- return 'nomatch'
+ return null
}
// Read source licenses from license-files directory
@@ -30,7 +30,7 @@ fs.readdirSync(licenseDir).forEach(function(name) {
function getLicenseType(filename) {
var fileContents = fs.readFileSync(filename, "utf8")
- return matchLicense(fileContents)
+ return matchLicense(fileContents) || 'nomatch'
}
function getReadmeLicense(filename) { | don't complain about readme if license is not found in it | marcello3d_node-licensecheck | train | js |
ed21e488b95fbbca656ae77410c1ce0b6f3eea31 | diff --git a/mode/markdown/markdown.js b/mode/markdown/markdown.js
index <HASH>..<HASH> 100644
--- a/mode/markdown/markdown.js
+++ b/mode/markdown/markdown.js
@@ -700,14 +700,15 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
state.formatting = false;
if (stream.sol()) {
- var forceBlankLine = stream.match(/^\s*$/, true) || state.header;
+ var forceBlankLine = !!state.header;
// Reset state.header
state.header = 0;
- if (forceBlankLine) {
+ if (stream.match(/^\s*$/, true) || forceBlankLine) {
state.prevLineHasContent = false;
- return blankLine(state);
+ blankLine(state);
+ return forceBlankLine ? this.token(stream, state) : null;
} else {
state.prevLineHasContent = state.thisLineHasContent;
state.thisLineHasContent = true; | [markdown] Fix handling of forced blank lines (after headers)
Closes #<I> | codemirror_CodeMirror | train | js |
c68caec87383db01b3e55a634cd957824e181cf9 | diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -18,8 +18,9 @@ var rename = require('gulp-rename');
gulp.task('jshint', function() {
return gulp.src(['public/**/*.js', 'lib/**/*.js'])
.pipe(jshint())
- .pipe(jshint.reporter('jshint-stylish'));
- //.pipe(jshint.reporter('fail'));
+ .pipe(jshint.reporter('jshint-stylish'))
+ // fail (non-zero exit code) if there are any errors or warnings
+ .pipe(jshint.reporter('fail'));
});
gulp.task('csslint', function() { | Adding fail reporter to jshint.
This causes the linter to return a non-zero exit code, which means the travis build fails if there are any jshint warnings / errors. #<I> | VisionistInc_jibe | train | js |
dfa963905682397e4235939768c2f46cc74900fe | diff --git a/views/build/grunt/sass.js b/views/build/grunt/sass.js
index <HASH>..<HASH> 100644
--- a/views/build/grunt/sass.js
+++ b/views/build/grunt/sass.js
@@ -8,9 +8,7 @@ module.exports = function (grunt) {
// Override include paths
sass.taoqtiitem = {
- options : {
- includePaths : [ '../scss', '../js/lib', root + 'scss/inc', root + 'scss/qti' ]
- },
+ options : {},
files : {}
}; | Remove unneccessary include path sass options
tao-<I> | oat-sa_extension-tao-itemqti | train | js |
c02e3f0a397557fa144b82fa1fa0222d21e8c3ca | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -36,7 +36,7 @@ pkg_data = {
}
pkgs = ["branca"]
-LICENSE = read("LICENSE.txt")
+LICENSE = "MIT"
long_description = "{}".format(read("README.md"))
# Dependencies. | Update license in setup.py (#<I>) | python-visualization_branca | train | py |
97a3a33a0bd299c7921c9e35c5ca25831b6dc532 | diff --git a/lifelines/tests/test_suite.py b/lifelines/tests/test_suite.py
index <HASH>..<HASH> 100644
--- a/lifelines/tests/test_suite.py
+++ b/lifelines/tests/test_suite.py
@@ -321,6 +321,15 @@ class StatisticalTests(unittest.TestCase):
with_array = naf.fit(np.array(T),np.array(C)).cumulative_hazard_.values
npt.assert_array_equal(with_list,with_array)
+ def test_timeline_to_NelsonAalenFitter(self):
+ T = [2,3,1.,6,5.]
+ C = [1,0,0,1,1]
+ timeline = [2,3,4.,1.,6,5.]
+ naf = NelsonAalenFitter()
+ with_list = naf.fit(T,C,timeline=timeline).cumulative_hazard_.values
+ with_array = naf.fit(T,C,timeline=np.array(timeline)).cumulative_hazard_.values
+ npt.assert_array_equal(with_list,with_array)
+
def test_pairwise_allows_dataframes(self):
N = 100
df = pd.DataFrame(np.empty((N,3)), columns=["T", "C", "group"]) | Update test_suite.py
adding unit test with timeline argument to fit | CamDavidsonPilon_lifelines | train | py |
b96a4f1d1b862883971a08d55ad1354ca05271b3 | diff --git a/public/js/models/Image.js b/public/js/models/Image.js
index <HASH>..<HASH> 100755
--- a/public/js/models/Image.js
+++ b/public/js/models/Image.js
@@ -75,6 +75,8 @@ Garp.dataTypes.Image.on('init', function(){
// because images won't reload if their ID is
// still the same, we need to reload the page
this.refOwner.formcontent.on('loaddata', function(){
+ var lm = new Ext.LoadMask(Ext.getBody());
+ lm.show();
document.location.href = url;
});
this.refOwner.fireEvent('save-all'); | Image changed? Reload, but *with* loadmask | grrr-amsterdam_garp3 | train | js |
dbbf2a6dd9290bc6a962e0b9c1b0e8a070536703 | diff --git a/fragman/apply.py b/fragman/apply.py
index <HASH>..<HASH> 100644
--- a/fragman/apply.py
+++ b/fragman/apply.py
@@ -10,10 +10,10 @@ def apply_changes(changed_path, config):
weave.add_revision(2, file(changed_path, 'r').readlines(), [1])
for i, other_key in enumerate(config['files']):
- revision = i + 3
other_path = os.path.join(config.root, other_key)
if other_path == changed_path:
continue # don't try to apply changes to ourself
+ revision = i + 3
weave.add_revision(revision, file(other_path, 'r').readlines(), [])
merge_result = weave.cherry_pick(2, revision) # Can I apply changes in revision 2 onto this other file?
if tuple in (type(mr) for mr in merge_result): | don't count current file when incrementing revisions | glyphobet_fragments | train | py |
f5048ae9a8bc7a35111f03f01edbbe3aaff9e0c9 | diff --git a/mstate/state.go b/mstate/state.go
index <HASH>..<HASH> 100644
--- a/mstate/state.go
+++ b/mstate/state.go
@@ -137,7 +137,13 @@ func (s *State) AddCharm(ch charm.Charm, curl *charm.URL, bundleURL *url.URL, bu
BundleURL: bundleURL,
BundleSha256: bundleSha256,
}
- err = s.charms.Insert(cdoc)
+ op := []txn.Operation{{
+ Collection: s.charms.Name,
+ DocId: curl,
+ Assert: txn.DocMissing,
+ Insert: cdoc,
+ }}
+ err = s.runner.Run(op, "", nil)
if err != nil {
return nil, fmt.Errorf("cannot add charm %q: %v", curl, err)
} | mstate: use txn for Add Charm | juju_juju | train | go |
f12dfe2c452c9bba770c5835410a81dda00fc5f3 | diff --git a/lnwallet/btcwallet/signer.go b/lnwallet/btcwallet/signer.go
index <HASH>..<HASH> 100644
--- a/lnwallet/btcwallet/signer.go
+++ b/lnwallet/btcwallet/signer.go
@@ -141,7 +141,7 @@ func (b *BtcWallet) SignOutputRaw(tx *wire.MsgTx,
amt := signDesc.Output.Value
sig, err := txscript.RawTxInWitnessSignature(tx, signDesc.SigHashes,
- signDesc.InputIndex, amt, witnessScript, txscript.SigHashAll,
+ signDesc.InputIndex, amt, witnessScript, signDesc.HashType,
privKey)
if err != nil {
return nil, err
@@ -227,7 +227,7 @@ func (b *BtcWallet) ComputeInputScript(tx *wire.MsgTx,
// TODO(roasbeef): adhere to passed HashType
witnessScript, err := txscript.WitnessSignature(tx, signDesc.SigHashes,
signDesc.InputIndex, signDesc.Output.Value, witnessProgram,
- txscript.SigHashAll, privKey, true)
+ signDesc.HashType, privKey, true)
if err != nil {
return nil, err
} | lnwallet/btcwallet: Use signDesc.HashType when signing
Tis commit makes the btcwallet signer implementation use
signDesc.HashType instead of SigHashAll when signing
transactions. This will allow the creator of the transaction
to specify the sighash policy when creating the accompanying
sign descriptior. | lightningnetwork_lnd | train | go |
398b6f5668ced3a8f50ee6e66ac05924ea8cf5b4 | diff --git a/gffutils/test/test_biopython_integration.py b/gffutils/test/test_biopython_integration.py
index <HASH>..<HASH> 100644
--- a/gffutils/test/test_biopython_integration.py
+++ b/gffutils/test/test_biopython_integration.py
@@ -1,4 +1,4 @@
-from gffutils import example_filename, create, parser, feature
+from gffutils import example_filename
import gffutils
import gffutils.biopython_integration as bp
@@ -12,5 +12,7 @@ def test_roundtrip():
feature.keep_order = True
dialect = feature.dialect
s = bp.to_seqfeature(feature)
+ assert s.location.start.position == feature.start - 1
+ assert s.location.end.position == feature.stop
f = bp.from_seqfeature(s, dialect=dialect, keep_order=True)
assert feature == f | add test for 0- and 1-based indexing | daler_gffutils | train | py |
38b083f0bee43089a01c50a32f93bfad31bc52f7 | diff --git a/model/execution/DeliveryExecutionManagerService.php b/model/execution/DeliveryExecutionManagerService.php
index <HASH>..<HASH> 100644
--- a/model/execution/DeliveryExecutionManagerService.php
+++ b/model/execution/DeliveryExecutionManagerService.php
@@ -71,7 +71,7 @@ class DeliveryExecutionManagerService extends ConfigurableService
/** @var TestSessionService $testSessionService */
$testSessionService = $this->getServiceLocator()->get(TestSessionService::SERVICE_ID);
- $testSession = $testSessionService->getTestSession($deliveryExecution);
+ $testSession = $testSessionService->getTestSession($deliveryExecution, true);
if ($testSession instanceof TestSession) {
$timer = $testSession->getTimer();
} else { | get test session in readonly mode in DeliveryExecutionManagerService::getDeliveryTimer | oat-sa_extension-tao-proctoring | train | php |
e0147f8a6b72e4c4c3f9ec73333fc7a18d01b2ab | diff --git a/core_spec/language/fixtures/super.rb b/core_spec/language/fixtures/super.rb
index <HASH>..<HASH> 100644
--- a/core_spec/language/fixtures/super.rb
+++ b/core_spec/language/fixtures/super.rb
@@ -40,4 +40,22 @@ module Super
end
end
end
+
+ class S5
+ def here
+ :good
+ end
+ end
+
+ class S6 < S5
+ def under
+ yield
+ end
+
+ def here
+ under {
+ super
+ }
+ end
+ end
end
diff --git a/core_spec/language/super_spec.rb b/core_spec/language/super_spec.rb
index <HASH>..<HASH> 100644
--- a/core_spec/language/super_spec.rb
+++ b/core_spec/language/super_spec.rb
@@ -15,4 +15,8 @@ describe "The super keyword" do
Super::S2::C.new.foo([]).should == ["B#foo", "C#baz", "A#baz"]
Super::S2::C.new.baz([]).should == ["C#baz", "A#baz"]
end
+
+ it "calls the superclass method when in a block" do
+ Super::S6.new.here.should == :good
+ end
end | Add failing super() spec which tests super inside a block | opal_opal | train | rb,rb |
4f7144c652b52417093593c99610de1d4adc8092 | diff --git a/version/version.go b/version/version.go
index <HASH>..<HASH> 100644
--- a/version/version.go
+++ b/version/version.go
@@ -6,12 +6,12 @@ const (
// VersionMajor is for an API incompatible changes
VersionMajor = 5
// VersionMinor is for functionality in a backwards-compatible manner
- VersionMinor = 5
+ VersionMinor = 6
// VersionPatch is for backwards-compatible bug fixes
- VersionPatch = 2
+ VersionPatch = 0
// VersionDev indicates development branch. Releases will be empty string.
- VersionDev = "-dev"
+ VersionDev = ""
)
// Version is the specification version that the package types support. | <I>
* When we can't store signatures, point the user at the destination.
* Update for <URL> | containers_image | train | go |
e2265466fb3632539dbc4823d8df02575ca1dfa2 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -36,7 +36,7 @@ if sys.version_info < (2,6):
setup(
name = "backports.lzma",
- version = "0.0.1",
+ version = "0.0.1b",
description = descr,
author = "Peter Cock, based on work by Nadeem Vawda and Per Oyvind Karlsen",
author_email = "[email protected]",
@@ -46,6 +46,7 @@ setup(
long_description = long_descr,
classifiers = [
#'Development Status :: 5 - Production/Stable',
+ 'Development Status :: 4 - Beta',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules', | Call this a beta for first public release... | peterjc_backports.lzma | train | py |
8cd4908740aab35588965896f5c2c864171005be | diff --git a/app_generators/ahn/ahn_generator.rb b/app_generators/ahn/ahn_generator.rb
index <HASH>..<HASH> 100644
--- a/app_generators/ahn/ahn_generator.rb
+++ b/app_generators/ahn/ahn_generator.rb
@@ -23,7 +23,6 @@ class AhnGenerator < RubiGen::Base
m.file *["config/environment.rb"]*2
m.file *["config/adhearsion.rb"]*2
- m.file *["dialplan.rb"]*2
m.file *["README"]*2
m.file *["Rakefile"]*2
m.file *["Gemfile"]*2 | [BUGFIX] Remove the dialplan.rb reference from the generator manifest | adhearsion_adhearsion | train | rb |
b8f1015067f2391c9120f75e33d955845acf24a5 | diff --git a/runcommands/completion/__init__.py b/runcommands/completion/__init__.py
index <HASH>..<HASH> 100644
--- a/runcommands/completion/__init__.py
+++ b/runcommands/completion/__init__.py
@@ -32,12 +32,12 @@ def complete(config, command_line, current_token, position, shell: dict(choices=
run_args = read_run_args(run)
debug = run_args.get('debug', debug)
- module = run_args.get('commands-module')
+ module = run_args.get('commands_module')
module = extract_from_argv(run_argv, run.args['commands-module'].options) or module
module = module or DEFAULT_COMMANDS_MODULE
module = normalize_path(module)
- config_file = run_args.get('config-file')
+ config_file = run_args.get('config_file')
config_file = extract_from_argv(run_argv, run.args['config-file'].options) or config_file
if not config_file and os.path.exists(DEFAULT_CONFIG_FILE):
config_file = DEFAULT_CONFIG_FILE | Fix run arg names in complete command | wylee_runcommands | train | py |
68793cfcbb6b1ae35cd28c9c33abfcb34f7d2118 | diff --git a/http/service.go b/http/service.go
index <HASH>..<HASH> 100644
--- a/http/service.go
+++ b/http/service.go
@@ -103,7 +103,7 @@ const (
PermBackup = "backup"
// LoadBatchSz is the batch size for loading a dump file.
- LoadBatchSz = 100
+ LoadBatchSz = 1000
)
func init() {
diff --git a/store/store.go b/store/store.go
index <HASH>..<HASH> 100644
--- a/store/store.go
+++ b/store/store.go
@@ -479,7 +479,7 @@ func (s *Store) Load(r io.Reader, sz int) (int64, error) {
queries = append(queries, cmd)
if len(queries) == sz {
- _, err = s.Execute(queries, false, false)
+ _, err = s.Execute(queries, false, true)
if err != nil {
return n, err
}
@@ -490,7 +490,7 @@ func (s *Store) Load(r io.Reader, sz int) (int64, error) {
// Flush residual
if len(queries) > 0 {
- _, err = s.Execute(queries, false, false)
+ _, err = s.Execute(queries, false, true)
if err != nil {
return n, err
} | Use a transaction for loaded batch
Bump the batch size to <I> too. | rqlite_rqlite | train | go,go |
199e96c8f7edf59f9d150312e787e95c14d6dc48 | diff --git a/_tests/integration/version_test.go b/_tests/integration/version_test.go
index <HASH>..<HASH> 100644
--- a/_tests/integration/version_test.go
+++ b/_tests/integration/version_test.go
@@ -10,7 +10,7 @@ import (
)
const (
- expectedCLIVersion = "1.45.0"
+ expectedCLIVersion = "1.45.1"
)
func Test_VersionOutput(t *testing.T) {
diff --git a/version/version.go b/version/version.go
index <HASH>..<HASH> 100644
--- a/version/version.go
+++ b/version/version.go
@@ -1,4 +1,4 @@
package version
// VERSION ...
-const VERSION = "1.45.0"
+const VERSION = "1.45.1" | Prepare for release <I> (#<I>) (#<I>)
* Prepare for release <I> (#<I>)
* Changed version too | bitrise-io_bitrise | train | go,go |
91d2914aabf0c8c705a5161d6f4e624172eeab33 | diff --git a/lib/aequitas.rb b/lib/aequitas.rb
index <HASH>..<HASH> 100644
--- a/lib/aequitas.rb
+++ b/lib/aequitas.rb
@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*-
-if RUBY_VERSION < '1.9.1'
+if RUBY_VERSION < '1.9'
require 'backports'
end
diff --git a/spec/suite.rb b/spec/suite.rb
index <HASH>..<HASH> 100644
--- a/spec/suite.rb
+++ b/spec/suite.rb
@@ -3,6 +3,8 @@ spec_dir = File.expand_path('..', __FILE__)
$LOAD_PATH << spec_dir
$LOAD_PATH << File.join(spec_dir,'integration')
+require 'aequitas'
+
%w[unit integration].each do |spec_type|
Dir[File.join(spec_dir, spec_type, '**', '*.rb')].each { |spec| require spec }
end | Fix backport require conditional and require aequitas from spec_helper | emmanuel_aequitas | train | rb,rb |
68144f7394ad9e1c118c66a33d480c32b09de1b2 | diff --git a/spin.js b/spin.js
index <HASH>..<HASH> 100644
--- a/spin.js
+++ b/spin.js
@@ -186,10 +186,13 @@
var self = this
, o = self.opts
- , el = self.el = css(createEl(0, {className: o.className}), {position: o.position, width: 0, zIndex: o.zIndex})
+ , el = self.el = createEl(0, {className: o.className})
css(el, {
- left: o.left
+ position: o.position
+ , width: 0
+ , zIndex: o.zIndex
+ , left: o.left
, top: o.top
}) | Deobfuscate some variable declaration | fgnass_spin.js | train | js |
be04ac2370b497b94fbaaf5f7e5afceb6f77b344 | diff --git a/rpcserver.go b/rpcserver.go
index <HASH>..<HASH> 100644
--- a/rpcserver.go
+++ b/rpcserver.go
@@ -868,7 +868,7 @@ func handleGenerate(s *rpcServer, cmd interface{}, closeChan <-chan struct{}) (i
Code: btcjson.ErrRPCDifficulty,
Message: fmt.Sprintf("No support for `generate` on "+
"the current network, %s, as it's unlikely to "+
- "be possible to main a block with the CPU.",
+ "be possible to mine a block with the CPU.",
s.cfg.ChainParams.Net),
}
} | rpcserver: Fix typo in generate handler.
"mine a block" instead of "main a block". | btcsuite_btcd | train | go |
f09c839a27ccafb789e227dc18f3eb510228b722 | diff --git a/jquery.floatThead.js b/jquery.floatThead.js
index <HASH>..<HASH> 100644
--- a/jquery.floatThead.js
+++ b/jquery.floatThead.js
@@ -684,6 +684,7 @@
if (wrappedContainer) {
$scrollContainer.unwrap();
}
+ $table.css('minWidth', '');
$floatContainer.remove();
$table.data('floatThead-attached', false);
@@ -710,4 +711,4 @@
});
return this;
};
-})(jQuery);
\ No newline at end of file
+})(jQuery); | Remove css min-width from table on destroy | mkoryak_floatThead | train | js |
ee9aaee758f02d52554b6e5d453639cb33730f30 | diff --git a/liquibase-core/src/main/java/liquibase/change/core/LoadDataChange.java b/liquibase-core/src/main/java/liquibase/change/core/LoadDataChange.java
index <HASH>..<HASH> 100644
--- a/liquibase-core/src/main/java/liquibase/change/core/LoadDataChange.java
+++ b/liquibase-core/src/main/java/liquibase/change/core/LoadDataChange.java
@@ -479,8 +479,8 @@ public class LoadDataChange extends AbstractChange implements ChangeWithColumns<
// 2. The database supports batched statements (for improved performance) AND we are not in an
// "SQL" mode (i.e. we generate an SQL file instead of actually modifying the database).
if
- ((needsPreparedStatement || (databaseSupportsBatchUpdates && ! isLoggingExecutor(database) &&
- hasPreparedStatementsImplemented()))) {
+ ((needsPreparedStatement || (databaseSupportsBatchUpdates && ! isLoggingExecutor(database))) &&
+ hasPreparedStatementsImplemented()) {
anyPreparedStatements = true;
ExecutablePreparedStatementBase stmt =
this.createPreparedStatement( | Fix issue with loadUpdateData GH-<I> | liquibase_liquibase | train | java |
b263ee3af688c528fae893c3535a5512f47ca5f9 | diff --git a/lib/Tmdb/Model/Common/SpokenLanguage.php b/lib/Tmdb/Model/Common/SpokenLanguage.php
index <HASH>..<HASH> 100644
--- a/lib/Tmdb/Model/Common/SpokenLanguage.php
+++ b/lib/Tmdb/Model/Common/SpokenLanguage.php
@@ -25,7 +25,7 @@ class SpokenLanguage extends AbstractModel implements LanguageFilter
private $name;
public static $properties = [
- 'iso_369_1',
+ 'iso_639_1',
'name',
]; | Update SpokenLanguage.php
Changed 'iso_<I>_1' on line <I> to 'iso_<I>_1'. | php-tmdb_api | train | php |
08ce533f0960af569729d11fe03b52055073b96c | diff --git a/src/main/java/com/cloudbees/jenkins/support/impl/ThreadDumps.java b/src/main/java/com/cloudbees/jenkins/support/impl/ThreadDumps.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/cloudbees/jenkins/support/impl/ThreadDumps.java
+++ b/src/main/java/com/cloudbees/jenkins/support/impl/ThreadDumps.java
@@ -222,6 +222,17 @@ public class ThreadDumps extends Component {
}
}
+ // Print any information about deadlocks.
+ long[] deadLocks = mbean.findDeadlockedThreads();
+ if (deadLocks != null && deadLocks.length != 0) {
+ writer.println(" Deadlock Found ");
+ ThreadInfo[] deadLockThreads = mbean.getThreadInfo(deadLocks);
+
+ for (ThreadInfo threadInfo : deadLockThreads) {
+ writer.println(threadInfo.getStackTrace());
+ }
+ }
+
writer.println();
writer.flush();
} | Add information about dead lock threads. | jenkinsci_support-core-plugin | train | java |
649d1577088b0c90db29dd895315455cae44c895 | diff --git a/pypsa/linopt.py b/pypsa/linopt.py
index <HASH>..<HASH> 100644
--- a/pypsa/linopt.py
+++ b/pypsa/linopt.py
@@ -742,8 +742,8 @@ def run_and_read_gurobi(n, problem_fn, solution_fn, solver_logfile,
For more information on solver options:
https://www.gurobi.com/documentation/{gurobi_verion}/refman/parameter_descriptions.html
"""
- if find_spec('gurobi') is None:
- raise ModuleNotFoundError("Optional dependency 'gurobi' not found. "
+ if find_spec('gurobipy') is None:
+ raise ModuleNotFoundError("Optional dependency 'gurobipy' not found. "
"Install via 'conda install -c gurobi gurobi' or follow the "
"instructions on the documentation page "
"https://www.gurobi.com/documentation/") | search for gurobipy not gurobi (#<I>) | PyPSA_PyPSA | train | py |
75edd0b771dcf5212f8ed8ddb4b17a6c13977363 | diff --git a/happymongo/__init__.py b/happymongo/__init__.py
index <HASH>..<HASH> 100644
--- a/happymongo/__init__.py
+++ b/happymongo/__init__.py
@@ -72,10 +72,12 @@ class HapPyMongo(object):
"""
config = {}
app_name = get_app_name()
+ is_flask = False
# If the object is a flask.app.Flask instance
if flask_app and isinstance(app_or_object_or_dict, flask_app.Flask):
config.update(app_or_object_or_dict.config)
app_name = app_or_object_or_dict.name
+ is_flask = True
# If the object is a dict
elif isinstance(app_or_object_or_dict, dict):
config.update(app_or_object_or_dict)
@@ -148,6 +150,11 @@ class HapPyMongo(object):
if any(auth):
db.authenticate(username, password)
+ if is_flask:
+ if not hasattr(app_or_object_or_dict, 'extensions'):
+ app_or_object_or_dict.extensions = {}
+ app_or_object_or_dict.extensions['happymongo'] = (mongo, db)
+
# Return the tuple
return mongo, db | If it is a flask app, register as an extension | sivel_happymongo | train | py |
a6270cb534925fff695a6848bdb09ec8d9d9abec | diff --git a/src/api_data_fetcher.php b/src/api_data_fetcher.php
index <HASH>..<HASH> 100644
--- a/src/api_data_fetcher.php
+++ b/src/api_data_fetcher.php
@@ -214,7 +214,7 @@ class ApiDataFetcher{
$d = json_decode($u->getContent(),true);
if(is_null($d)){
- error_log("ApiDataFetcher:
+ trigger_error("ApiDataFetcher:
URL: $url
response code: ".$u->getStatusCode()."
invalid json:\n".$u->getContent() | error_log() replaced with trigger_error() | atk14_ApiDataFetcher | train | php |
1b7d644fac17b38bbcece8ac5152e5cc322504fa | diff --git a/framer/protocol.py b/framer/protocol.py
index <HASH>..<HASH> 100644
--- a/framer/protocol.py
+++ b/framer/protocol.py
@@ -14,7 +14,10 @@
# along with this program. If not, see
# <http://www.gnu.org/licenses/>.
-import asyncio
+try:
+ import asyncio
+except ImportError:
+ import trollius as asyncio
class FramedProtocol(asyncio.BaseProtocol): | Fix asyncio import
The trollius library no longer installs as the 'asyncio' package, but
as 'trollius'. Change the one import we have to import trollius as
asyncio if asyncio is not present. | klmitch_framer | train | py |
67d7db0cfed420907a69ec44a8e9785153ea3497 | diff --git a/src/Datasource/EntityTrait.php b/src/Datasource/EntityTrait.php
index <HASH>..<HASH> 100644
--- a/src/Datasource/EntityTrait.php
+++ b/src/Datasource/EntityTrait.php
@@ -270,10 +270,10 @@ trait EntityTrait {
* ### Example:
*
* {{{
- * $entity = new Entity(['id' => 1, 'name' => null]);
- * $entity->has('id'); // true
- * $entity->has('name'); // false
- * $entity->has('last_name'); // false
+ * $entity = new Entity(['id' => 1, 'name' => null]);
+ * $entity->has('id'); // true
+ * $entity->has('name'); // false
+ * $entity->has('last_name'); // false
* }}}
*
* @param string $property The property to check.
@@ -288,9 +288,10 @@ trait EntityTrait {
*
* ### Examples:
*
- * ``$entity->unsetProperty('name');``
- *
- * ``$entity->unsetProperty(['name', 'last_name']);``
+ * {{{
+ * $entity->unsetProperty('name');
+ * $entity->unsetProperty(['name', 'last_name']);
+ * }}}
*
* @param string|array $property The property to unset.
* @return \Cake\DataSource\EntityInterface | Tidy up docblock. | cakephp_cakephp | train | php |
1a1835a346cec3906e3028e8b3946a70bded3771 | diff --git a/app/controllers/katello/api/v2/host_collections_controller.rb b/app/controllers/katello/api/v2/host_collections_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/katello/api/v2/host_collections_controller.rb
+++ b/app/controllers/katello/api/v2/host_collections_controller.rb
@@ -26,7 +26,6 @@ module Katello
api :GET, "/host_collections", N_("List host collections")
api :GET, "/organizations/:organization_id/host_collections", N_("List host collections within an organization")
api :GET, "/activation_keys/:activation_key_id/host_collections", N_("List host collections in an activation key")
- api :GET, "/hosts/:host_id/host_collections", N_("List host collections containing a content host")
param_group :search, Api::V2::ApiController
param :organization_id, :number, :desc => N_("organization identifier"), :required => false
param :name, String, :desc => N_("host collection name to filter by") | Refs #<I> - update endpoint for host collections | Katello_katello | train | rb |
bf40a586161148f10c1958cf22736a1e22cf1def | diff --git a/lib/allscripts_unity_client/json_client_driver.rb b/lib/allscripts_unity_client/json_client_driver.rb
index <HASH>..<HASH> 100644
--- a/lib/allscripts_unity_client/json_client_driver.rb
+++ b/lib/allscripts_unity_client/json_client_driver.rb
@@ -117,7 +117,10 @@ module AllscriptsUnityClient
end
# Configure proxy
- options[:proxy] = @options.proxy
+ if @options.proxy?
+ options[:proxy] = @options.proxy
+ end
+
options
end | Don't set proxy unless an option has been set for JSON client. | healthfinch_allscripts-unity-client | train | rb |
fdb50fab790366bef5f40fee97b9ac8df099b703 | diff --git a/post_office/tests/utils.py b/post_office/tests/utils.py
index <HASH>..<HASH> 100644
--- a/post_office/tests/utils.py
+++ b/post_office/tests/utils.py
@@ -102,7 +102,7 @@ class UtilsTest(TestCase):
self.assertIsInstance(attachments[0], Attachment)
self.assertTrue(attachments[0].pk)
self.assertEquals(attachments[0].file.read(), b'content')
- self.assertEquals(attachments[0].name, 'attachment_file1.txt')
+ self.assertTrue(attachments[0].name.startswith('attachment_file'))
def test_create_attachments_open_file(self):
attachments = create_attachments({ | Fix tests failing because of dict sort order | ui_django-post_office | train | py |
1916fb512cadc3d30daae54c7ec46649a189cb45 | diff --git a/scuba/scuba.py b/scuba/scuba.py
index <HASH>..<HASH> 100644
--- a/scuba/scuba.py
+++ b/scuba/scuba.py
@@ -15,11 +15,6 @@ from .dockerutil import make_vol_opt
from .utils import shell_quote_cmd, flatten_list
-def verbose_msg(fmt, *args):
- # TODO: remove
- pass
-
-
class ScubaError(Exception):
pass
@@ -227,11 +222,9 @@ class ScubaDive:
'''
if not self.context.script:
# No user-provided command; we want to run the image's default command
- verbose_msg('No user command; getting command from image')
default_cmd = get_image_command(self.context.image)
if not default_cmd:
raise ScubaError('No command given and no image-specified command')
- verbose_msg('{} Cmd: "{}"'.format(self.context.image, default_cmd))
self.context.script = [shell_quote_cmd(default_cmd)]
# Make scubainit the real entrypoint, and use the defined entrypoint as | scuba: Remove stub verbose_msg
These two calls don't add much information for the user. If we want this
level of detail, we should use the logging API. | JonathonReinhart_scuba | train | py |
efc4da03da909be63b68777b837653605e3e3532 | diff --git a/core/lib/generators/refinery/cms/cms_generator.rb b/core/lib/generators/refinery/cms/cms_generator.rb
index <HASH>..<HASH> 100644
--- a/core/lib/generators/refinery/cms/cms_generator.rb
+++ b/core/lib/generators/refinery/cms/cms_generator.rb
@@ -39,7 +39,7 @@ module Refinery
# Refinery has set config.assets.initialize_on_precompile = false by default.
config.assets.initialize_on_precompile = false
-}, :after => "Application.configure do\n" if env == 'production'
+}, :after => "Application.configure do\n" if env =~ /production/
end
# Stop pretending | Use regular expression to detect if current env contains 'production'. | refinery_refinerycms | train | rb |
d1d31971931e338923ed4c4076c5518a348b9269 | diff --git a/src/ProxyManager/Factory/AbstractBaseFactory.php b/src/ProxyManager/Factory/AbstractBaseFactory.php
index <HASH>..<HASH> 100644
--- a/src/ProxyManager/Factory/AbstractBaseFactory.php
+++ b/src/ProxyManager/Factory/AbstractBaseFactory.php
@@ -23,6 +23,8 @@ namespace ProxyManager\Factory;
use ProxyManager\Configuration;
use ProxyManager\Generator\ClassGenerator;
use ProxyManager\ProxyGenerator\ProxyGeneratorInterface;
+use ProxyManager\Signature\Exception\InvalidSignatureException;
+use ProxyManager\Signature\Exception\MissingSignatureException;
use ProxyManager\Version;
use ReflectionClass;
@@ -61,6 +63,9 @@ abstract class AbstractBaseFactory
* @param mixed[] $proxyOptions
*
* @return string proxy class name
+ *
+ * @throws InvalidSignatureException
+ * @throws MissingSignatureException
*/
protected function generateProxy(string $className, array $proxyOptions = []) : string
{ | Documenting thrown exceptions in the base factory | Ocramius_ProxyManager | train | php |
d68ed9281491e8a9892d2f92b63ee9fe5462c528 | diff --git a/Phrozn/Processor/Twig.php b/Phrozn/Processor/Twig.php
index <HASH>..<HASH> 100644
--- a/Phrozn/Processor/Twig.php
+++ b/Phrozn/Processor/Twig.php
@@ -58,11 +58,6 @@ class Twig
{
$path = Loader::getInstance()->getPath('library');
- // Twig uses perverted file naming (due to absense of NSs at a time it was written)
- // so fire up its own autoloader
- require_once $path . '/Vendor/Twig/Autoloader.php';
- \Twig_Autoloader::register();
-
if (count($options)) {
$this->setConfig($options)
->getEnvironment();
diff --git a/Phrozn/Twig/Loader/String.php b/Phrozn/Twig/Loader/String.php
index <HASH>..<HASH> 100644
--- a/Phrozn/Twig/Loader/String.php
+++ b/Phrozn/Twig/Loader/String.php
@@ -19,7 +19,6 @@
*/
namespace Phrozn\Twig\Loader;
-require_once(dirname(__FILE__) . '/../../Vendor/Twig/Loader/String.php');
/**
* Twig String Loader | Composer: Removed hardcoded Twig loaders. | Pawka_phrozn | train | php,php |
bfc1563c2c2c0911bf2978c06de9811c0346d52d | diff --git a/lib/faraday/adapter/net_http.rb b/lib/faraday/adapter/net_http.rb
index <HASH>..<HASH> 100644
--- a/lib/faraday/adapter/net_http.rb
+++ b/lib/faraday/adapter/net_http.rb
@@ -17,6 +17,7 @@ module Faraday
Errno::EHOSTUNREACH,
Errno::EINVAL,
Errno::ENETUNREACH,
+ Errno::EPIPE,
Net::HTTPBadResponse,
Net::HTTPHeaderSyntaxError,
Net::ProtocolError, | Update net_http.rb (#<I>)
Add recognition of uncaught `Errno::EPIPE: Broken pipe` error to `NET_HTTP_EXCEPTIONS` | lostisland_faraday | train | rb |
586c5117135647254ef820e3d07120448e79bf79 | diff --git a/spec/Suite/Document.spec.php b/spec/Suite/Document.spec.php
index <HASH>..<HASH> 100644
--- a/spec/Suite/Document.spec.php
+++ b/spec/Suite/Document.spec.php
@@ -136,6 +136,26 @@ describe("Document", function() {
});
+ it("returns `null` for undefined field", function() {
+
+ $document = new Document();
+ expect($document->get('value'))->toBe(null);
+ expect($document->get('nested.value'))->toBe(null);
+
+ });
+
+ it("throws an error when the path is invalid", function() {
+
+ $closure = function() {
+ $document = new Document();
+ $document->set('value', 'Hello World');
+ $document->get('value.invalid');
+ };
+
+ expect($closure)->toThrow(new ORMException("The field: `value` is not a valid document or entity."));
+
+ });
+
});
describe("->set()", function() {
diff --git a/src/Document.php b/src/Document.php
index <HASH>..<HASH> 100644
--- a/src/Document.php
+++ b/src/Document.php
@@ -386,6 +386,9 @@ class Document implements DataStoreInterface, HasParentsInterface, \ArrayAccess,
if ($keys) {
$value = $this->get($name);
+ if (!$value) {
+ return;
+ }
if (!$value instanceof DataStoreInterface) {
throw new ORMException("The field: `" . $name . "` is not a valid document or entity.");
} | Change `Document.get()` to return the default value when present or `null` when a field doesn't exists. | crysalead_chaos-orm | train | php,php |
233ae91e19e51af1e74bdb5f927fbe0aeb2c0120 | diff --git a/suds/transport/http.py b/suds/transport/http.py
index <HASH>..<HASH> 100644
--- a/suds/transport/http.py
+++ b/suds/transport/http.py
@@ -56,8 +56,9 @@ class HttpTransport(Transport):
def open(self, request):
try:
url = request.url
+ headers = request.headers
log.debug('opening (%s)', url)
- u2request = u2.Request(url)
+ u2request = u2.Request(url, None, headers)
self.proxy = self.options.proxy
return self.u2open(u2request)
except HTTPError as e: | Added basic auth support for wsdl download also | cackharot_suds-py3 | train | py |
9be84a0bbb19ffea3951cd042a2631cdca281400 | diff --git a/test.py b/test.py
index <HASH>..<HASH> 100644
--- a/test.py
+++ b/test.py
@@ -1,7 +1,10 @@
+import os
+import arrow
+
from urllib import parse
from tfatool.info import Config, WifiMode, DriveMode
from tfatool.config import config
-from tfatool import command
+from tfatool import command, upload
def test_config_construction():
@@ -62,3 +65,18 @@ def test_command_cgi_url():
url, _ = parse.splitquery(req.url)
assert url == "http://192.168.0.1/command.cgi"
+
+def test_datetime_encode_decode():
+ ctime = os.stat("README.md").st_ctime
+ dtime = arrow.get(ctime)
+
+ # encode to FAT32 time
+ encoded = upload._encode_time(ctime)
+
+ # decode to arrow datetime
+ decoded = command._decode_time(encoded >> 16, encoded & 0xFFFF)
+
+ # accurate down to the second
+ for attr in "year month day hour minute second".split():
+ assert getattr(dtime, attr) == getattr(decoded, attr)
+ | added unit test for FAT<I> time encode/decode | TadLeonard_tfatool | train | py |
67cc6279557af94e28133ecb1ee83107725591c7 | diff --git a/elastic-harvester.js b/elastic-harvester.js
index <HASH>..<HASH> 100644
--- a/elastic-harvester.js
+++ b/elastic-harvester.js
@@ -1046,7 +1046,7 @@ ElasticHarvest.prototype.enableAutoSync= function(){
var _this = this;
if(!!this.harvest_app.options.oplogConnectionString){
console.warn("[Elastic-Harvest] Will sync primary resource data via oplog");
- this.harvest_app.onChange(endpoint,{insert:resourceChanged,update:resourceChanged,delete: resourceDeleted});
+ this.harvest_app.onChange(endpoint,{insert:resourceChanged,update:resourceChanged,delete: resourceDeleted, asyncInMemory: _this.options.asyncInMemory});
function resourceDeleted(resourceId){
_this.delete(resourceId)
.catch(function(error){ | fixed a but, there is another part in the code where an onChange handler is defined
didn't pass through the asyncInMemory option in that case | agco_elastic-harvesterjs | train | js |
3460e1e8bd73af0775a79ebb4404d336ee660a1d | diff --git a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php
index <HASH>..<HASH> 100644
--- a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php
+++ b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php
@@ -31,12 +31,12 @@ use Webmozart\Assert\Assert;
class Kernel extends HttpKernel
{
- public const VERSION = '1.4.6';
- public const VERSION_ID = '10406';
+ public const VERSION = '1.4.7-DEV';
+ public const VERSION_ID = '10407';
public const MAJOR_VERSION = '1';
public const MINOR_VERSION = '4';
- public const RELEASE_VERSION = '6';
- public const EXTRA_VERSION = '';
+ public const RELEASE_VERSION = '7';
+ public const EXTRA_VERSION = 'DEV';
public function __construct(string $environment, bool $debug)
{ | Change application's version to <I>-DEV | Sylius_Sylius | train | php |
6ea121476059b55e5a963a16e9b0b37669c4df46 | diff --git a/src/SearchDrivers/BaseSearchDriver.php b/src/SearchDrivers/BaseSearchDriver.php
index <HASH>..<HASH> 100755
--- a/src/SearchDrivers/BaseSearchDriver.php
+++ b/src/SearchDrivers/BaseSearchDriver.php
@@ -72,7 +72,7 @@ abstract class BaseSearchDriver implements SearchDriverInterface
*/
public function query($searchString)
{
- $this->searchString = trim(\DB::connection()->getPdo()->quote($searchString), "'");
+ $this->searchString = substr(substr(\DB::connection()->getPdo()->quote($searchString), 1), 0, -1);
return $this;
} | Fix search query with quotes by replacing trim function to substr. | TomLingham_Laravel-Searchy | train | php |
4d51d000f8f25414ac489a618cc563d8b215d0bf | diff --git a/molgenis-data-elasticsearch/src/main/java/org/molgenis/data/elasticsearch/ElasticsearchService.java b/molgenis-data-elasticsearch/src/main/java/org/molgenis/data/elasticsearch/ElasticsearchService.java
index <HASH>..<HASH> 100644
--- a/molgenis-data-elasticsearch/src/main/java/org/molgenis/data/elasticsearch/ElasticsearchService.java
+++ b/molgenis-data-elasticsearch/src/main/java/org/molgenis/data/elasticsearch/ElasticsearchService.java
@@ -803,6 +803,10 @@ public class ElasticsearchService implements SearchService, MolgenisTransactionL
}
});
+ if( request.request().getItems().isEmpty() ){
+ return Stream.<Entity>empty();
+ }
+
MultiGetResponse response = request.get();
if (LOG.isDebugEnabled()) | Fix #<I> Uploading a VCF will throw an error | molgenis_molgenis | train | java |
9e8b55e2f7f64f9ed3c6df42d39f7a0fce1d596c | diff --git a/src/extensions/renderer/base/coord-ele-math.js b/src/extensions/renderer/base/coord-ele-math.js
index <HASH>..<HASH> 100644
--- a/src/extensions/renderer/base/coord-ele-math.js
+++ b/src/extensions/renderer/base/coord-ele-math.js
@@ -590,7 +590,7 @@ BRp.getLabelText = function( ele ){
//console.log('wrap');
// save recalc if the label is the same as before
- if( rscratch.labelWrapKey !== undefined && rscratch.labelWrapKey === rscratch.labelKey ){
+ if( rscratch.labelWrapKey && rscratch.labelWrapKey === rscratch.labelKey ){
// console.log('wrap cache hit');
return rscratch.labelWrapCachedText;
} | Allow only truthy value instead of just defined | cytoscape_cytoscape.js | train | js |
1139ea2c816f77ac3ed687f200941dcfe21fbbf3 | diff --git a/cmd/syncthing/gui.go b/cmd/syncthing/gui.go
index <HASH>..<HASH> 100644
--- a/cmd/syncthing/gui.go
+++ b/cmd/syncthing/gui.go
@@ -119,12 +119,16 @@ type guiFile scanner.File
func (f guiFile) MarshalJSON() ([]byte, error) {
type t struct {
- Name string
- Size int64
+ Name string
+ Size int64
+ Modified int64
+ Flags uint32
}
return json.Marshal(t{
- Name: f.Name,
- Size: scanner.File(f).Size,
+ Name: f.Name,
+ Size: scanner.File(f).Size,
+ Modified: f.Modified,
+ Flags: f.Flags,
})
} | Expose a bit more information about needed file in REST interface | syncthing_syncthing | train | go |
60e3a8ecace71ab5846d12aac26444655794fed3 | diff --git a/lib/Extension/LanguageServerRename/Adapter/ReferenceFinder/ClassMover/ClassRenamer.php b/lib/Extension/LanguageServerRename/Adapter/ReferenceFinder/ClassMover/ClassRenamer.php
index <HASH>..<HASH> 100644
--- a/lib/Extension/LanguageServerRename/Adapter/ReferenceFinder/ClassMover/ClassRenamer.php
+++ b/lib/Extension/LanguageServerRename/Adapter/ReferenceFinder/ClassMover/ClassRenamer.php
@@ -91,7 +91,7 @@ final class ClassRenamer implements Renamer
$oldUri = $this->oldNameToUriConverter->convert($originalName->getFullyQualifiedNameText());
$newUri = $this->newNameToUriConverter->convert($newName);
} catch (CouldNotConvertClassToUri $error) {
- throw new CouldNotRename($e->getMessage(), 0, $error);
+ throw new CouldNotRename($error->getMessage(), 0, $error);
}
if ($newName === $originalName->getFullyQualifiedNameText()) { | Fix error when renaming (#<I>) | phpactor_phpactor | train | php |
425596a8472e91995ce7c43f1039d5df06249510 | diff --git a/spec/unit/request_spec.rb b/spec/unit/request_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/request_spec.rb
+++ b/spec/unit/request_spec.rb
@@ -660,4 +660,20 @@ describe RestClient::Request do
response.should_not be_nil
response.code.should eq 204
end
+
+ describe "raw response" do
+ it "should read the response into a binary-mode tempfile" do
+ @request = RestClient::Request.new(:method => "get", :url => "example.com", :raw_response => true)
+
+ tempfile = double("tempfile")
+ tempfile.should_receive(:binmode)
+ tempfile.stub(:open)
+ tempfile.stub(:close)
+ Tempfile.should_receive(:new).with("rest-client").and_return(tempfile)
+
+ net_http_res = Net::HTTPOK.new(nil, "200", "body")
+ net_http_res.stub(:read_body).and_return("body")
+ @request.fetch_body(net_http_res)
+ end
+ end
end | Test that raw responses are read into a binary-mode tempfile
Re: <URL> | rest-client_rest-client | train | rb |
1123e5ca1f55a31cd2dcd2b78bd3fbfd428cea3c | diff --git a/pkg/cli/environment.go b/pkg/cli/environment.go
index <HASH>..<HASH> 100644
--- a/pkg/cli/environment.go
+++ b/pkg/cli/environment.go
@@ -95,12 +95,12 @@ func (s *EnvSettings) EnvVars() map[string]string {
"HELM_REGISTRY_CONFIG": s.RegistryConfig,
"HELM_REPOSITORY_CACHE": s.RepositoryCache,
"HELM_REPOSITORY_CONFIG": s.RepositoryConfig,
- "HELM_NAMESPACE": s.Namespace,
+ "HELM_NAMESPACE": s.Namespace(),
"HELM_KUBECONTEXT": s.KubeContext,
}
- if s.KubeConfig != "" {
- envvars["KUBECONFIG"] = s.KubeConfig
+ if s.kubeConfig != "" {
+ envvars["KUBECONFIG"] = s.kubeConfig
}
return envvars | fix(cli): Fixes incorrect variable reference
Because these were additions, git didn't pick up that the recent refactor of
env settings had changed some of the variables. This fixes those small changes | helm_helm | train | go |
abd07a5ed2fb67ce0d250d0e837819896e8bdf8a | diff --git a/src/org/opencms/xml/A_CmsXmlDocument.java b/src/org/opencms/xml/A_CmsXmlDocument.java
index <HASH>..<HASH> 100644
--- a/src/org/opencms/xml/A_CmsXmlDocument.java
+++ b/src/org/opencms/xml/A_CmsXmlDocument.java
@@ -289,9 +289,17 @@ public abstract class A_CmsXmlDocument implements I_CmsXmlDocument {
// if it's a multiple choice element, the child elements must not be sorted into their types,
// but must keep their original order
if (isMultipleChoice) {
+ List<Element> nodeList = new ArrayList<Element>();
List<Element> elements = CmsXmlGenericWrapper.elements(root);
- checkMaxOccurs(elements, cd.getChoiceMaxOccurs(), cd.getTypeName());
- nodeLists.add(elements);
+ Set<String> typeNames = cd.getSchemaTypes();
+ for (Element element : elements) {
+ // check if the node type is still in the definition
+ if (typeNames.contains(element.getName())) {
+ nodeList.add(element);
+ }
+ }
+ checkMaxOccurs(nodeList, cd.getChoiceMaxOccurs(), cd.getTypeName());
+ nodeLists.add(nodeList);
}
// if it's a sequence, the children are sorted according to the sequence type definition
else { | Improved Fix for issue #<I>: Filter elements no longer contained in the choice definition | alkacon_opencms-core | train | java |
5a64f7d88c23dd498c16a86bd5452ccc8b1a1006 | diff --git a/tests/Routing/RouteTest.php b/tests/Routing/RouteTest.php
index <HASH>..<HASH> 100644
--- a/tests/Routing/RouteTest.php
+++ b/tests/Routing/RouteTest.php
@@ -419,7 +419,7 @@ class RouteTest extends TestCase
$responseProphecy = $this->prophesize(ResponseInterface::class);
$callableResolverProphecy = $this->prophesize(CallableResolverInterface::class);
- $callable = 'callableWhatever';
+ $callable = 'callable';
$callableResolverProphecy
->resolve(Argument::is($callable)) | Rename test callable to make it clear that Callable:toCall is not expected to be called | slimphp_Slim | train | php |
dcaa04168ede9e421142548d45b5713faf192bc3 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -2,9 +2,9 @@
# Generated by jaraco.develop (https://bitbucket.org/jaraco/jaraco.develop)
import setuptools
-with open('README.txt') as readme:
+with open('README.txt', encoding='utf-8') as readme:
long_description = readme.read()
-with open('CHANGES.txt') as changes:
+with open('CHANGES.txt', encoding='utf-8') as changes:
long_description += '\n\n' + changes.read()
setup_params = dict( | Seems some platforms (*glares at Ubuntu*) have Python <I> default to ASCII. It's a sad, sad day for text. | jaraco_portend | train | py |
afc729552d0971f6dcd9f73742e2fe8c41290ace | diff --git a/helpers.py b/helpers.py
index <HASH>..<HASH> 100644
--- a/helpers.py
+++ b/helpers.py
@@ -362,7 +362,7 @@ def find_project_by_short_name(short_name, pbclient, all=None):
def check_api_error(api_response):
"""Check if returned API response contains an error."""
- if 'status' not in api_response:
+ if type(api_response) == dict and 'status' not in api_response:
msg = "Unable to find 'status' in server response; Misconfigured URL?"
print(msg)
print("Server response: %s" % api_response)
@@ -382,6 +382,7 @@ def check_api_error(api_response):
raise TaskNotFound(message='PyBossa Task not found',
error=api_response)
else:
+ print("Server response: %s" % api_response)
raise exceptions.HTTPError | Better robustness check; Force printing of HTTP response in case of general HTTPError | Scifabric_pbs | train | py |
b2eadf1251bb3e87096b8ddb93db51f169f9dfc9 | diff --git a/pymongo/bson.py b/pymongo/bson.py
index <HASH>..<HASH> 100644
--- a/pymongo/bson.py
+++ b/pymongo/bson.py
@@ -36,6 +36,12 @@ try:
except ImportError:
_use_c = False
+try:
+ import uuid
+ _use_uuid = True
+except ImportError:
+ _use_uuid = False
+
def _get_int(data):
try:
@@ -256,12 +262,8 @@ def _get_binary(data):
if length2 != length - 4:
raise InvalidBSON("invalid binary (st 2) - lengths don't match!")
length = length2
- if subtype == 3:
- try:
- import uuid
- return (uuid.UUID(bytes=data[:length]), data[length:])
- except ImportError:
- pass
+ if subtype == 3 and _use_uuid:
+ return (uuid.UUID(bytes=data[:length]), data[length:])
return (Binary(data[:length], subtype), data[length:]) | only try importing uuid once | mongodb_mongo-python-driver | train | py |
9e90740bc3ff8b4ece9496e6c233b5b53b41fe55 | diff --git a/go/client/fork_server.go b/go/client/fork_server.go
index <HASH>..<HASH> 100644
--- a/go/client/fork_server.go
+++ b/go/client/fork_server.go
@@ -144,6 +144,7 @@ func makeServerCommandLine(g *libkb.GlobalContext, cl libkb.CommandLine,
"no-debug",
"api-dump-unsafe",
"plain-logging",
+ "disable-cert-pinning",
}
strings := []string{
@@ -166,7 +167,6 @@ func makeServerCommandLine(g *libkb.GlobalContext, cl libkb.CommandLine,
"tor-proxy",
"tor-hidden-address",
"proxy-type",
- "disable-cert-pinning",
}
args = append(args, arg0) | Use correct type for --disable-cert-pinning command line flag in server spawn (#<I>) | keybase_client | train | go |
81129b71562a4e7a735f5094fef2ac7d3de6c8fa | diff --git a/hotdoc/core/formatter.py b/hotdoc/core/formatter.py
index <HASH>..<HASH> 100644
--- a/hotdoc/core/formatter.py
+++ b/hotdoc/core/formatter.py
@@ -528,7 +528,8 @@ class Formatter(Configurable):
'link_title': title})
return out
- def _format_type_tokens(self, type_tokens):
+ # pylint: disable=unused-argument
+ def _format_type_tokens(self, symbol, type_tokens):
out = ''
link_before = False
@@ -556,7 +557,7 @@ class Formatter(Configurable):
out = ""
if isinstance(symbol, QualifiedSymbol):
- out += self._format_type_tokens(symbol.type_tokens)
+ out += self._format_type_tokens(symbol, symbol.type_tokens)
# FIXME : ugly
elif hasattr(symbol, "link") and type(symbol) != FieldSymbol:
@@ -568,7 +569,7 @@ class Formatter(Configurable):
out += ' ' + symbol.argname
elif type(symbol) == FieldSymbol and symbol.member_name:
- out += self._format_type_tokens(symbol.qtype.type_tokens)
+ out += self._format_type_tokens(symbol, symbol.qtype.type_tokens)
if symbol.is_function_pointer:
out = "" | Pass currenly formatting symbol to _format_type_token
To give some context to subclasses, as, for example in the GIFormatte
needs to know in what language it is formatting | hotdoc_hotdoc | train | py |
a7709045f549fc2ba9155abbcd80a8affd07aff8 | diff --git a/troposphere/firehose.py b/troposphere/firehose.py
index <HASH>..<HASH> 100644
--- a/troposphere/firehose.py
+++ b/troposphere/firehose.py
@@ -136,13 +136,22 @@ class ExtendedS3DestinationConfiguration(AWSProperty):
}
+class KinesisStreamSourceConfiguration(AWSProperty):
+ props = {
+ 'KinesisStreamARN': (basestring, True),
+ 'RoleARN': (basestring, True)
+ }
+
+
class DeliveryStream(AWSObject):
resource_type = "AWS::KinesisFirehose::DeliveryStream"
props = {
'DeliveryStreamName': (basestring, False),
+ 'DeliveryStreamType': (basestring, False),
'ElasticsearchDestinationConfiguration': (ElasticsearchDestinationConfiguration, False), # noqa
'ExtendedS3DestinationConfiguration': (ExtendedS3DestinationConfiguration, False), # noqa
+ 'KinesisStreamSourceConfiguration': (KinesisStreamSourceConfiguration, False), # noqa
'RedshiftDestinationConfiguration': (RedshiftDestinationConfiguration, False), # noqa
'S3DestinationConfiguration': (S3DestinationConfiguration, False),
} | Adding kinesis stream source to firehose (#<I>) | cloudtools_troposphere | train | py |
ecb26b34322e21b0cc3240abcfb91bd434448da6 | diff --git a/bin/prettier.js b/bin/prettier.js
index <HASH>..<HASH> 100755
--- a/bin/prettier.js
+++ b/bin/prettier.js
@@ -33,6 +33,13 @@ if (!filenames.length && !stdin) {
process.exit(1);
}
+function formatWithShebang(input) {
+ const index = input.indexOf("\n");
+ const shebang = input.slice(0, index + 1);
+ const programInput = input.slice(index + 1);
+ return shebang + format(programInput);
+}
+
function format(input) {
return jscodefmt.format(input, {
printWidth: argv["print-width"],
@@ -70,7 +77,7 @@ if (stdin) {
let output;
try {
- output = format(input);
+ output = input.startsWith("#!") ? formatWithShebang(input) : format(input);
} catch (e) {
process.exitCode = 2;
console.error(e); | treat shebang outside of parsing (#<I>)
* treat shebang outside of parsing
* use less costly indexOf and reuse format function
* avoid reprinting new line and potential double space at start
* move options back to format function | josephfrazier_prettier_d | train | js |
6e9bdfe6a203acd1112f7e8f83cd91052dcd8642 | diff --git a/src/Serializers/Entity.php b/src/Serializers/Entity.php
index <HASH>..<HASH> 100644
--- a/src/Serializers/Entity.php
+++ b/src/Serializers/Entity.php
@@ -31,7 +31,7 @@ class Entity {
*/
protected function getSkeleton() : array {
return [
- 'app' => [
+ 'service' => [
'name' => $this->config->get( 'appName' ),
'version' => $this->config->get( 'appVersion' ),
'pid' => getmypid(), | APM Server <I> now looks for a service key | philkra_elastic-apm-php-agent | train | php |
5a888a0405905c1b8ae21b5bf1a7f53fa78cedda | diff --git a/src/Codeception/Lib/Connector/Lumen.php b/src/Codeception/Lib/Connector/Lumen.php
index <HASH>..<HASH> 100644
--- a/src/Codeception/Lib/Connector/Lumen.php
+++ b/src/Codeception/Lib/Connector/Lumen.php
@@ -106,7 +106,12 @@ class Lumen extends Client
}
$this->app = $this->kernel = require $this->module->config['bootstrap_file'];
-
+
+ // in version 5.6.*, lumen introduced the same design pattern like Laravel
+ // to load all service provider we need to call on Laravel\Lumen\Application::boot()
+ if (method_exists($this->app, 'boot')) {
+ $this->app->boot();
+ }
// Lumen registers necessary bindings on demand when calling $app->make(),
// so here we force the request binding before registering our own request object,
// otherwise Lumen will overwrite our request object. | [Lumen] add support for Laravel\Lumen\Application::boot
in version <I>.*, lumen introduced the same design pattern like Laravel
@see <URL> | Codeception_base | train | php |
876d0925df5269aa0b331872b894c399f8872eeb | diff --git a/lib/jekyll-admin/data_file.rb b/lib/jekyll-admin/data_file.rb
index <HASH>..<HASH> 100644
--- a/lib/jekyll-admin/data_file.rb
+++ b/lib/jekyll-admin/data_file.rb
@@ -30,7 +30,7 @@ module JekyllAdmin
# Returns unparsed content as it exists on disk
def raw_content
- @raw_content ||= File.read(absolute_path)
+ @raw_content ||= File.open(absolute_path, "r:UTF-8", &:read)
end
# Returnes (re)parsed content using Jekyll's native parsing mechanism | read raw_content in UTF-8 | jekyll_jekyll-admin | train | rb |
1701785f243ffb457c1137dcf9c9458585e06165 | diff --git a/lib/sprockets/environment.rb b/lib/sprockets/environment.rb
index <HASH>..<HASH> 100644
--- a/lib/sprockets/environment.rb
+++ b/lib/sprockets/environment.rb
@@ -24,8 +24,6 @@ module Sprockets
attr_accessor :logger
- attr_accessor :css_compressor, :js_compressor
-
def initialize(root = ".")
@trail = Hike::Trail.new(root)
engine_extensions.replace(DEFAULT_ENGINE_EXTENSIONS + CONCATENATABLE_EXTENSIONS)
@@ -33,14 +31,30 @@ module Sprockets
@logger = Logger.new($stderr)
@logger.level = Logger::FATAL
- @cache = {}
- @lock = nil
-
+ @lock = nil
@static_root = nil
+ expire_cache
+
@server = Server.new(self)
end
+ def expire_cache
+ @cache = {}
+ end
+
+ attr_reader :css_compressor, :js_compressor
+
+ def css_compressor=(compressor)
+ expire_cache
+ @css_compressor = compressor
+ end
+
+ def js_compressor=(compressor)
+ expire_cache
+ @js_compressor = compressor
+ end
+
def use_default_compressors
begin
require 'yui/compressor'
@@ -71,6 +85,7 @@ module Sprockets
end
def static_root=(root)
+ expire_cache
@static_root = root ? ::Pathname.new(root) : nil
end | Expire cache when static root or compressors are updated | rails_sprockets | train | rb |
1089bef6496f34b14e6be01d40203c1b7e69999d | diff --git a/urbansim/server/urbansimd.py b/urbansim/server/urbansimd.py
index <HASH>..<HASH> 100644
--- a/urbansim/server/urbansimd.py
+++ b/urbansim/server/urbansimd.py
@@ -1,3 +1,4 @@
+import inspect
import os
import sys
@@ -10,7 +11,7 @@ from bottle import route, run, response, hook, request
from cStringIO import StringIO
from urbansim.utils import misc, yamlio
-import inspect
+# should be a local file
import models | removing compile route
The model templates no longer exist so the compile route no longer exists. | UDST_urbansim | train | py |
7e5463ccbe80236414fdcd239b2a1f749c9f5ae5 | diff --git a/aeron-samples/src/main/java/io/aeron/samples/archive/EmbeddedReplayThroughput.java b/aeron-samples/src/main/java/io/aeron/samples/archive/EmbeddedReplayThroughput.java
index <HASH>..<HASH> 100644
--- a/aeron-samples/src/main/java/io/aeron/samples/archive/EmbeddedReplayThroughput.java
+++ b/aeron-samples/src/main/java/io/aeron/samples/archive/EmbeddedReplayThroughput.java
@@ -50,7 +50,6 @@ public class EmbeddedReplayThroughput implements AutoCloseable
private static final String CHANNEL = SampleConfiguration.CHANNEL;
private static final FragmentHandler NOOP_FRAGMENT_HANDLER = (buffer, offset, length, header) -> {};
-
private MediaDriver driver;
private Archive archive;
private Aeron aeron;
@@ -75,7 +74,7 @@ public class EmbeddedReplayThroughput implements AutoCloseable
do
{
- System.out.println("Replaying " + NUMBER_OF_MESSAGES + " messages");
+ System.out.printf("Replaying %,d messages%n", NUMBER_OF_MESSAGES);
final long start = System.currentTimeMillis();
test.replayRecording(recordingLength, recordingId); | [Java] Output formatting. | real-logic_aeron | train | java |
eebbaae4003e0d0116fee1c46a87793c3be1179f | diff --git a/src/Providers/FortServiceProvider.php b/src/Providers/FortServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/Providers/FortServiceProvider.php
+++ b/src/Providers/FortServiceProvider.php
@@ -121,6 +121,7 @@ class FortServiceProvider extends ServiceProvider
$this->app->booted(function () use ($router) {
$router->getRoutes()->refreshNameLookups();
+ $router->getRoutes()->refreshActionLookups();
});
}
} | refreshActionLookups after routes registration | rinvex_cortex-auth | train | php |
4b00b94cbae8019398951f76ee8ea7885292bfa9 | diff --git a/lib/devise_invitable/model.rb b/lib/devise_invitable/model.rb
index <HASH>..<HASH> 100644
--- a/lib/devise_invitable/model.rb
+++ b/lib/devise_invitable/model.rb
@@ -254,7 +254,7 @@ module Devise
invitable = find_or_initialize_with_errors(invite_key_array, attributes_hash)
invitable.assign_attributes(attributes)
invitable.invited_by = invited_by
- unless invitable.password || invitable.encrypted_password
+ unless invitable.password || invitable.encrypted_password.present?
invitable.password = Devise.friendly_token[0, 20]
end | fix previous commit for #<I> | scambra_devise_invitable | train | rb |
b0197bd13a3ed268f56e98bbe5c370dd988f237d | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -7,14 +7,14 @@ from distutils.core import setup
setup(
name = 'febio',
- version = '0.1',
+ version = '0.1.1',
packages = ['febio',],
py_modules = ['febio.__init__','febio.MatDef','febio.MeshDef','febio.Boundary','febio.Control','febio.Load','febio.Model'],
author = 'Scott Sibole',
author_email = '[email protected]',
license = 'MIT',
package_data = {'febio': ['verification/*'],},
- url = 'https:/github.com/siboles/pyFEBio',
- download_url = 'https://github.com/siboles/pyFEBio/tarball/0.1',
+ url = 'https://github.com/siboles/pyFEBio',
+ download_url = 'https://github.com/siboles/pyFEBio/tarball/0.1.1',
description = 'A Python API for FEBio',
) | Updated version to correct URL to homepage. | siboles_pyFEBio | train | py |
87ef39aeb0ce441e6de5f32eeae615774bace906 | diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb
index <HASH>..<HASH> 100644
--- a/lib/jekyll/site.rb
+++ b/lib/jekyll/site.rb
@@ -122,7 +122,7 @@ module Jekyll
base = File.join(self.source, self.config['layouts'])
return unless File.exists?(base)
entries = []
- Dir.chdir(base) { entries = filter_entries(Dir['*.*']) }
+ Dir.chdir(base) { entries = filter_entries(Dir['**/*.*']) }
entries.each do |f|
name = f.split(".")[0..-2].join(".") | Add support for use of folders inside _layout path, closes #<I> | jekyll_jekyll | train | rb |
b3db309716ef43e03b849d026e2b5e90790458d0 | diff --git a/tests/library/CM/Model/SplitfeatureTest.php b/tests/library/CM/Model/SplitfeatureTest.php
index <HASH>..<HASH> 100644
--- a/tests/library/CM/Model/SplitfeatureTest.php
+++ b/tests/library/CM/Model/SplitfeatureTest.php
@@ -133,6 +133,15 @@ class CM_Model_SplitfeatureTest extends CMTest_TestCase {
$this->assertEquals($splitfeature, CM_Model_Splitfeature::find('foo'));
}
+ public function testFindChildClass() {
+ CM_Model_Splitfeature::createStatic(array('name' => 'bar', 'percentage' => 0));
+ $mockClass = $this->mockClass('CM_Model_Splitfeature');
+ /** @var CM_Model_Splitfeature $className */
+ $className = $mockClass->getClassName();
+
+ $this->assertInstanceOf($className, $className::find('bar'));
+ }
+
/**
* @param CM_Model_User[] $userList
* @param CM_Model_Splitfeature $splitfeature | Add test for CM_Model_Splitfeature::find() when it should create child instance | cargomedia_cm | train | php |
5a7c3870da558692eb29cfcdee86bbcd4fe9e68d | diff --git a/gifi/feature.py b/gifi/feature.py
index <HASH>..<HASH> 100644
--- a/gifi/feature.py
+++ b/gifi/feature.py
@@ -117,16 +117,17 @@ def _get_pull_requests(repo):
def _discard(repo=None):
repo = get_repo(repo)
config = configuration(repo)
- current_branch = _current_feature_branch(repo)
+ _fetch(repo, config)
+ feature_branch = _current_feature_branch(repo)
repo.git.checkout(config.target_branch)
repo.git.rebase('%s/%s' % (config.target_remote, config.target_branch))
try:
repo.git.commit('--amend', '-C', 'HEAD')
- repo.git.push(config.working_remote, ':%s' % current_branch)
+ repo.git.push(config.working_remote, ':%s' % feature_branch)
except GitCommandError as e:
logging.warn('Unable to drop remote feature branch: %s' % e)
print 'WARNING: Unable to remove remote feature branch. Maybe it was not yet created?'
- repo.git.branch('-D', current_branch)
+ repo.git.branch('-D', feature_branch)
def configuration(repo=None): | Fetch repository before rebase'ing master after feature is discarded | kokosing_git-gifi | train | py |
1f1d4aaf6881dd40e69a0388d42b78b072ba4e8c | diff --git a/src/_pytest/cacheprovider.py b/src/_pytest/cacheprovider.py
index <HASH>..<HASH> 100755
--- a/src/_pytest/cacheprovider.py
+++ b/src/_pytest/cacheprovider.py
@@ -319,7 +319,8 @@ def cache(request):
def pytest_report_header(config):
- if config.option.verbose:
+ """Display cachedir with --cache-show and if non-default."""
+ if config.option.verbose or config.getini("cache_dir") != ".pytest_cache":
cachedir = config.cache._cachedir
# TODO: evaluate generating upward relative paths
# starting with .., ../.. if sensible | cacheprovider: display cachedir also in non-verbose mode if customized | pytest-dev_pytest | train | py |
c580f908e9535e8acb19469940f598f7487ae17c | diff --git a/library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java b/library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java
index <HASH>..<HASH> 100644
--- a/library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java
+++ b/library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java
@@ -1771,13 +1771,6 @@ public class DrawerBuilder {
}
/**
- * resets the DrawerBuilder's internal `mUsed` variable to false so the `DrawerBuilder` can be reused
- */
- public void reset() {
- this.mUsed = false;
- }
-
- /**
* helper method to close the drawer delayed
*/
protected void closeDrawerDelayed() { | * remove reset method as it is not possible | mikepenz_MaterialDrawer | train | java |
51da143f48ac9dbce45381c828cb68e0f90c1e63 | diff --git a/src/API/Implementation/TTS/IbmWatson/AudioFormat/IbmWatsonAudioFormatsTrait.php b/src/API/Implementation/TTS/IbmWatson/AudioFormat/IbmWatsonAudioFormatsTrait.php
index <HASH>..<HASH> 100644
--- a/src/API/Implementation/TTS/IbmWatson/AudioFormat/IbmWatsonAudioFormatsTrait.php
+++ b/src/API/Implementation/TTS/IbmWatson/AudioFormat/IbmWatsonAudioFormatsTrait.php
@@ -14,7 +14,7 @@ use GinoPane\PHPolyglot\Exception\InvalidAudioFormatCodeException;
*/
trait IbmWatsonAudioFormatsTrait
{
- private $formatMapping = [
+ private static $formatMapping = [
TtsAudioFormat::AUDIO_BASIC => 'audio/basic',
TtsAudioFormat::AUDIO_FLAC => 'audio/flac',
TtsAudioFormat::AUDIO_L16 => 'audio/l16',
@@ -36,7 +36,7 @@ trait IbmWatsonAudioFormatsTrait
*/
public function getAcceptParameter(TtsAudioFormat $format, array $additionalData = []): string
{
- $accept = $formatMapping[$format] ?? '';
+ $accept = self::$formatMapping[$format->getFormat()] ?? '';
if (empty($accept)) {
throw new InvalidAudioFormatCodeException($format->getFormat()); | Updates:
- fixed undefined local variable. | GinoPane_PHPolyglot | train | php |
7294f6334ab2f08c506ebc2ecab3d36c39e28988 | diff --git a/commands/command.go b/commands/command.go
index <HASH>..<HASH> 100644
--- a/commands/command.go
+++ b/commands/command.go
@@ -40,12 +40,6 @@ type HelpText struct {
Subcommands string // overrides SUBCOMMANDS section
}
-// TODO: check Argument definitions when creating a Command
-// (might need to use a Command constructor)
-// * make sure any variadic args are at the end
-// * make sure there aren't duplicate names
-// * make sure optional arguments aren't followed by required arguments
-
// Command is a runnable command, with input arguments and options (flags).
// It can also have Subcommands, to group units of work into sets.
type Command struct { | commands: Removed old TODOs | ipfs_go-ipfs | train | go |
083c9bddbd32f74c61a0798737cdc3b1c7c990c9 | diff --git a/bat/dataframe_to_parquet.py b/bat/dataframe_to_parquet.py
index <HASH>..<HASH> 100644
--- a/bat/dataframe_to_parquet.py
+++ b/bat/dataframe_to_parquet.py
@@ -20,7 +20,7 @@ def df_to_parquet(df, filename, compression='SNAPPY'):
arrow_table = pa.Table.from_pandas(df)
if compression == 'UNCOMPRESSED':
compression = None
- pq.write_table(arrow_table, filename, use_dictionary=False, compression=compression)
+ pq.write_table(arrow_table, filename, compression=compression, use_deprecated_int96_timestamps=True)
def parquet_to_df(filename, nthreads=1): | use the int<I> timestamps for now | SuperCowPowers_bat | train | py |
493567965958e2f89e6bfce6b76a872c08e66f28 | diff --git a/system/src/Grav/Console/Gpm/UninstallCommand.php b/system/src/Grav/Console/Gpm/UninstallCommand.php
index <HASH>..<HASH> 100644
--- a/system/src/Grav/Console/Gpm/UninstallCommand.php
+++ b/system/src/Grav/Console/Gpm/UninstallCommand.php
@@ -117,7 +117,7 @@ class UninstallCommand extends Command
$this->output->writeln('');
} else {
$this->output->write(" |- Uninstalling package... ");
- $uninstall = $this->uninstallPackage($package);
+ $uninstall = $this->uninstallPackage($slug, $package);
if (!$uninstall) {
$this->output->writeln(" '- <red>Uninstallation failed or aborted.</red>");
@@ -135,12 +135,16 @@ class UninstallCommand extends Command
/**
+ * @param $slug
* @param $package
+ *
* @return bool
*/
- private function uninstallPackage($package)
+ private function uninstallPackage($slug, $package)
{
- $path = self::getGrav()['locator']->findResource($package->package_type . '://' . $package->slug);
+ $locator = self::getGrav()['locator'];
+
+ $path = self::getGrav()['locator']->findResource($package->package_type . '://' .$slug);
Installer::uninstall($path);
$errorCode = Installer::lastErrorCode(); | fix #<I> - incorrect slug name causing issues | getgrav_grav | train | php |
7069c66285e79724abc18f73f327f881ba990ba9 | diff --git a/testsuite/domain/src/test/java/org/jboss/as/test/integration/domain/suites/AuditLogTestCase.java b/testsuite/domain/src/test/java/org/jboss/as/test/integration/domain/suites/AuditLogTestCase.java
index <HASH>..<HASH> 100644
--- a/testsuite/domain/src/test/java/org/jboss/as/test/integration/domain/suites/AuditLogTestCase.java
+++ b/testsuite/domain/src/test/java/org/jboss/as/test/integration/domain/suites/AuditLogTestCase.java
@@ -367,6 +367,7 @@ public class AuditLogTestCase {
final PathAddress serverAddress = PathAddress.pathAddress(baseAddress.getElement(0)).append(SERVER_CONFIG, servers.get(0));
final ModelNode restartOp = Util.createEmptyOperation("reload", serverAddress);
restartOp.get(BLOCKING).set(true);
+ masterLifecycleUtil.executeForResult(restartOp);
expectNoSyslogData();
//Now enable the server logger again | Execute the server reload op that the test creates | wildfly_wildfly-core | train | java |
919b2c45a1ad3826d0d4226905456d03c9d1b1a2 | diff --git a/spec/index.spec.js b/spec/index.spec.js
index <HASH>..<HASH> 100644
--- a/spec/index.spec.js
+++ b/spec/index.spec.js
@@ -190,7 +190,7 @@ describe('phonegap-plugin-contentsync', function() {
jasmine.any(Function),
'Sync',
'cancel',
- []
+ [ options.id ]
]);
done();
}, 100);
diff --git a/www/index.js b/www/index.js
index <HASH>..<HASH> 100644
--- a/www/index.js
+++ b/www/index.js
@@ -58,9 +58,8 @@ var ContentSync = function(options) {
options.headers = null;
}
- if (typeof options.id === 'undefined') {
- options.id = null;
- }
+ // store the options to this object instance
+ this.options = options;
// triggered on update and completion
var that = this;
@@ -97,7 +96,7 @@ ContentSync.prototype.cancel = function() {
that.emit('cancel');
};
setTimeout(function() {
- exec(onCancel, onCancel, 'Sync', 'cancel', []);
+ exec(onCancel, onCancel, 'Sync', 'cancel', [ that.options.id ]);
}, 10);
}; | [www] Pass id to cancel operation. | phonegap_phonegap-plugin-contentsync | train | js,js |
0ee1376219a36099d15c7128278b47698204e185 | diff --git a/src/runners/cucumber/CucumberReporter.js b/src/runners/cucumber/CucumberReporter.js
index <HASH>..<HASH> 100644
--- a/src/runners/cucumber/CucumberReporter.js
+++ b/src/runners/cucumber/CucumberReporter.js
@@ -154,6 +154,8 @@ export default class CucumberReporter {
caseResult.endTime = oxutil.getTimeStamp();
caseResult.duration = caseResult.endTime - caseResult.startTime;
caseResult.status = this.determineCaseStatus(caseResult);
+ caseResult.logs = this.oxygenEventListener.resultStore && this.oxygenEventListener.resultStore.logs ? this.oxygenEventListener.resultStore.logs : [];
+ caseResult.har = this.oxygenEventListener.resultStore && this.oxygenEventListener.resultStore.har ? this.oxygenEventListener.resultStore.har : null;
// call oxygen onAfterCase if defined
if (typeof this.oxygenEventListener.onAfterCase === 'function') { | cucumber add logs collecting support (#<I>) | oxygenhq_oxygen | train | js |
0882565867e8654c4da4fc3c4fdfae6eac25fed6 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -331,7 +331,7 @@ module.exports = function (connect) {
clear(callback) {
return withCallback(this.collectionReady()
- .then(collection => collection.drop())
+ .then(collection => collection.drop(this.writeOperationOptions))
, callback)
} | Add writeOperationOptions support to collection.drop() call (supported as of MongoDB <I>) | jdesboeufs_connect-mongo | train | js |
0e0615e09e052688bd8efac36067776bc2e299a8 | diff --git a/lib/octopress-deploy/git.rb b/lib/octopress-deploy/git.rb
index <HASH>..<HASH> 100644
--- a/lib/octopress-deploy/git.rb
+++ b/lib/octopress-deploy/git.rb
@@ -50,7 +50,7 @@ git_url: #{options[:git_url]}
# Branch defaults to master.
# If using GitHub project pages, set the branch to 'gh-pages'.
#
-# git_branch: #{options[:git_branch] || 'master'}
+git_branch: #{options[:git_branch] || 'master'}
CONFIG
end | Removed git branch comment. It was not necessary; broke tests. | octopress_deploy | train | rb |
da131a44db8d90c91c52a19a46b015cd6a6eb1b8 | diff --git a/tests/test_commands.py b/tests/test_commands.py
index <HASH>..<HASH> 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -72,6 +72,17 @@ def test_commit_retry_works(mocker):
assert not os.path.isfile(temp_file)
+def test_commit_when_nothing_to_commit(mocker):
+ is_staging_clean_mock = mocker.patch("commitizen.git.is_staging_clean")
+ is_staging_clean_mock.return_value = True
+
+ with pytest.raises(SystemExit) as err:
+ commit_cmd = commands.Commit(config, {})
+ commit_cmd()
+
+ assert err.value.code == commands.commit.NOTHING_TO_COMMIT
+
+
def test_example():
with mock.patch("commitizen.out.write") as write_mock:
commands.Example(config)() | test(commands/commit): test aborting commit when there is nothing to commit
#<I> | Woile_commitizen | train | py |
5aad2fa287c76417efa890d03c8a8b26bb9d6177 | diff --git a/src/test/java/com/messners/gitlab/api/TestGitLabApiEvents.java b/src/test/java/com/messners/gitlab/api/TestGitLabApiEvents.java
index <HASH>..<HASH> 100644
--- a/src/test/java/com/messners/gitlab/api/TestGitLabApiEvents.java
+++ b/src/test/java/com/messners/gitlab/api/TestGitLabApiEvents.java
@@ -11,8 +11,8 @@ import org.codehaus.jackson.map.ObjectMapper;
import org.junit.BeforeClass;
import org.junit.Test;
-import com.messners.gitlab.api.event.EventObject;
-import com.messners.gitlab.api.event.PushEvent;
+import com.messners.gitlab.api.webhook.EventObject;
+import com.messners.gitlab.api.webhook.PushEvent;
public class TestGitLabApiEvents { | Mods for renamed classes. | gmessner_gitlab4j-api | train | java |
73567710c5dba4bba857614134beb1d59d5d734c | diff --git a/src/main/java/hex/DGLM.java b/src/main/java/hex/DGLM.java
index <HASH>..<HASH> 100644
--- a/src/main/java/hex/DGLM.java
+++ b/src/main/java/hex/DGLM.java
@@ -1214,7 +1214,7 @@ public abstract class DGLM {
} else {
int d = (int) data[i]; // Enum value d can be -1 if we got enum values not seen in training
if(d == 0) continue; // level 0 of factor is skipped (coef==0).
- if( d > 0 && (idx += d) < _colCatMap[i + 1] ) p += _beta[idx]/* *1.0 */;
+ if( d > 0 && (idx += d) <= _colCatMap[i + 1] ) p += _beta[idx-1]/* *1.0 */;
else // Enum out of range?
p = Double.NaN;// Can use a zero, or a NaN
} | Bugfix in glm scoring. | h2oai_h2o-2 | train | java |
40a612cc9ccaf4afe60fac0b48a811552979e6a3 | diff --git a/src/Adapter/MapperInterface.php b/src/Adapter/MapperInterface.php
index <HASH>..<HASH> 100644
--- a/src/Adapter/MapperInterface.php
+++ b/src/Adapter/MapperInterface.php
@@ -33,5 +33,5 @@ interface MapperInterface
*
* @return void
*/
- public function map(array $input, MetadataInterface $output);
+ public function map(array $input, MetadataInterface &$output);
} | Bugfix: Mapper should use by-reference | PHPExif_php-exif-common | train | php |
f23c4664d3d62d735c69cd737bd2b32b57af2b24 | diff --git a/ext/extconf.rb b/ext/extconf.rb
index <HASH>..<HASH> 100644
--- a/ext/extconf.rb
+++ b/ext/extconf.rb
@@ -48,7 +48,8 @@ def check_libmemcached
Dir.chdir(HERE) do
Dir.chdir(BUNDLE_PATH) do
- run("find . | xargs touch", "Touching all files so autoconf doesn't run.")
+ ts_now=Time.now.strftime("%Y%m%d%H%M.%S")
+ run("find . | xargs touch -t #{ts_now}", "Touching all files so autoconf doesn't run.")
run("env CFLAGS='-fPIC #{LIBM_CFLAGS}' LDFLAGS='-fPIC #{LIBM_LDFLAGS}' ./configure --prefix=#{HERE} --without-memcached --disable-shared --disable-utils --disable-dependency-tracking #{$CC} #{$EXTRA_CONF} 2>&1", "Configuring libmemcached.")
end | Determine timestamp to use one time, and then update all files with that timestamp
in order to avoid a possible race condition which could cause autoconf
to run | arthurnn_memcached | train | rb |
b60afa47ed89e515f263ef37053eb1a5c1c75242 | diff --git a/core/src/elements/ons-ripple/index.js b/core/src/elements/ons-ripple/index.js
index <HASH>..<HASH> 100644
--- a/core/src/elements/ons-ripple/index.js
+++ b/core/src/elements/ons-ripple/index.js
@@ -51,10 +51,18 @@ class RippleElement extends BaseElement {
*/
/**
- * @attribute center
+ * @attribute color
+ * @type {String}
+ * @description
+ * [en]Color of the ripple effect.[/en]
+ * [ja]リップルエフェクトの色を指定します。[/ja]
+ */
+
+ /**
+ * @attribute background
* @description
- * [en]If this attribute is set, the effect will originate from the center.[/en]
- * [ja]この属性が設定された場合、その効果は要素の中央から始まります。[/ja]
+ * [en]Color of the background.[/en]
+ * [ja]背景の色を設定します。[/ja]
*/
/** | docs(ons-ripple): Add docs for "background" attribute. | OnsenUI_OnsenUI | train | js |
e24c4525d4b29eb4656abe0e012b6edb6c00250d | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -32,6 +32,7 @@ if __name__ == "__main__":
author_email="[email protected]",
url="https://github.com/Salamek/cron-descriptor",
long_description=long_description,
+ long_description_content_type='text/markdown',
packages=setuptools.find_packages(),
package_data={
'cron_descriptor': [ | Tell PyPI the long_description is markdown
As per [packaging tutorial](<URL>) (see bottom). This should render it as markdown on <URL> | Salamek_cron-descriptor | train | py |
d1f70fa521cf43bf5d63c6737f1ba84456a70150 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -29,7 +29,10 @@ dev_requires = docs_requires + [
from pathlib import Path
this_directory = Path(__file__).parent
-long_description = (this_directory / "README.md").read_text()
+readme_text = (this_directory / "README.md").read_text()
+parts = readme_text.partition("A library for event sourcing in Python.")
+long_description = "".join(parts[1:])
+
packages = [
"eventsourcing",
@@ -58,6 +61,7 @@ setup(
},
zip_safe=False,
long_description=long_description,
+ long_description_content_type="text/markdown",
keywords=[
"event sourcing",
"event store", | Trimmed README text for package (to avoid including links to buttons and project image). | johnbywater_eventsourcing | train | py |
c80ad1c6b13c94b2503399966c1f5f2ec273353a | diff --git a/algoliasearch/algoliasearch.py b/algoliasearch/algoliasearch.py
index <HASH>..<HASH> 100644
--- a/algoliasearch/algoliasearch.py
+++ b/algoliasearch/algoliasearch.py
@@ -195,7 +195,7 @@ class Client:
params['indexes'] = indexes
return AlgoliaUtils_request(self.headers, self.hosts, "POST", "/1/keys", params)
- def generate_secured_api_key(self, private_api_key, tag_filters, user_token = None):
+ def generateSecuredApiKey(self, private_api_key, tag_filters, user_token = None):
"""
Generate a secured and public API Key from a list of tagFilters and an
optional user token identifying the current user | Keep using camelCase | algolia_algoliasearch-client-python | train | py |
4abc9957b2a373588a63852e6945ad826005c68e | diff --git a/src/saml2/sigver.py b/src/saml2/sigver.py
index <HASH>..<HASH> 100644
--- a/src/saml2/sigver.py
+++ b/src/saml2/sigver.py
@@ -27,7 +27,13 @@ import base64
import random
import os
-XMLSEC_BINARY = "/opt/local/bin/xmlsec1"
+def get_xmlsec_binary():
+ for path in ('/opt/local/bin/xmlsec1',
+ '/usr/bin/xmlsec1'):
+ if os.path.exists(path):
+ return path
+
+XMLSEC_BINARY = get_xmlsec_binary()
ID_ATTR = "ID"
NODE_NAME = "urn:oasis:names:tc:SAML:2.0:assertion:Assertion"
ENC_NODE_NAME = "urn:oasis:names:tc:SAML:2.0:assertion:EncryptedAssertion" | Added a function that attempts to find the xmlsec1 binaries, made by Lorenzo Gil Sanchez | IdentityPython_pysaml2 | train | py |
ff63af3029aedd6545ad30a2b641222dfa7fca9a | diff --git a/tests/testnumbergen.py b/tests/testnumbergen.py
index <HASH>..<HASH> 100644
--- a/tests/testnumbergen.py
+++ b/tests/testnumbergen.py
@@ -18,7 +18,7 @@ class TestUniformRandom(unittest.TestCase):
seed=_seed,
lbound=lbound,
ubound=ubound)
- for _ in xrange(_iterations):
+ for _ in range(_iterations):
value = gen()
self.assertTrue(lbound <= value < ubound)
@@ -30,7 +30,7 @@ class TestUniformRandomOffset(unittest.TestCase):
seed=_seed,
mean=(ubound + lbound) / 2,
range=ubound - lbound)
- for _ in xrange(_iterations):
+ for _ in range(_iterations):
value = gen()
self.assertTrue(lbound <= value < ubound) | Fixed numbergen unit tests for Python 3 compatibility | pyviz_param | train | py |
887d348cf4cef4792667a0c54a2f87d2b1d5e44e | diff --git a/lib/server/index.js b/lib/server/index.js
index <HASH>..<HASH> 100644
--- a/lib/server/index.js
+++ b/lib/server/index.js
@@ -47,11 +47,11 @@ module.exports = {
return callback(error);
}
- var html = data.toString().replace('</head>',
- '<script type="text/javascript" src="/socket.io/socket.io.js"></script>\n' +
- '<script type="text/javascript" src="/'
+ var html = data.toString().replace('</body>',
+ ' <script type="text/javascript" src="/socket.io/socket.io.js"></script>\n' +
+ ' <script type="text/javascript" src="/'
+ config.adapterPath + '/' + config.adapters + '"></script>\n' +
- '</head>\n');
+ ' </body>\n');
callback(null, html);
});
}); | Issue #<I> Testee client script injection needs to move to the page body | bitovi_testee | train | js |
Subsets and Splits