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
24ed36341c004578416f403a8ca5013ff420ae49
diff --git a/sllurp/cli.py b/sllurp/cli.py index <HASH>..<HASH> 100644 --- a/sllurp/cli.py +++ b/sllurp/cli.py @@ -8,7 +8,7 @@ import click from . import log, __version__ from .verb import reset as _reset from .verb import inventory as _inventory -from .llrp_proto import Modulation_Name2Type, DEFAULT_MODULATION +from .llrp_proto import Modulation_Name2Type logger = logging.getLogger(__name__) @@ -34,8 +34,7 @@ def cli(debug, logfile): @click.option('-X', '--tx-power', type=int, default=0, help='transmit power (default 0=max power)') @click.option('-M', '--modulation', type=click.Choice(mods), - default=DEFAULT_MODULATION, - help='modulation (default={})'.format(DEFAULT_MODULATION)) + help='Reader-to-Tag Modulation') @click.option('-T', '--tari', type=int, default=0, help='Tari value (default 0=auto)') @click.option('-s', '--session', type=int, default=2,
remove default modulation as of <I>eda8, default mode selection is better, so no need to specify this explicitly anymore
ransford_sllurp
train
py
8ca591e6b0408bbe1408218910df25f89f5db762
diff --git a/lib/relations/HtmlShortcutIcon.js b/lib/relations/HtmlShortcutIcon.js index <HASH>..<HASH> 100644 --- a/lib/relations/HtmlShortcutIcon.js +++ b/lib/relations/HtmlShortcutIcon.js @@ -20,7 +20,17 @@ extendWithGettersAndSetters(HtmlShortcutIcon.prototype, { attach: function (asset, position, adjacentRelation) { this.node = asset.parseTree.createElement('link'); this.node.setAttribute('rel', 'shortcut icon'); // Hmm, how to handle apple-touch-icon? - this.attachNodeBeforeOrAfter(position, adjacentRelation); + if (position) { + this.attachNodeBeforeOrAfter(position, adjacentRelation); + } else { + // TODO: Consider moving this to HtmlRelation.prototype.attachNodeBeforeOrAfter + var head = asset.parseTree.getElementsByTagName('head')[0]; + if (!head) { + head = asset.parseTree.createElement('head'); + asset.parseTree.documentElement.insertBefore(head, asset.parseTree.documentElement.firstChild); + } + head.appendChild(this.node); + } return HtmlRelation.prototype.attach.call(this, asset, position, adjacentRelation); } });
HtmlShortcutIcon.attach: Default to put put the <link> node at the end of <head> if no position/adjacentRelation is specified.
assetgraph_assetgraph
train
js
8c04db85c17c89da522c63d6a63eb3dc0a9bded1
diff --git a/vault/logical_passthrough.go b/vault/logical_passthrough.go index <HASH>..<HASH> 100644 --- a/vault/logical_passthrough.go +++ b/vault/logical_passthrough.go @@ -34,12 +34,6 @@ func LeaseSwitchedPassthroughBackend(conf *logical.BackendConfig, leases bool) ( Paths: []*framework.Path{ &framework.Path{ Pattern: ".*", - Fields: map[string]*framework.FieldSchema{ - "ttl": &framework.FieldSchema{ - Type: framework.TypeString, - Description: "TTL time for this key when read. Ex: 1h", - }, - }, Callbacks: map[logical.Operation]framework.OperationFunc{ logical.ReadOperation: b.handleRead,
Remove unneeded Fields in passthrough
hashicorp_vault
train
go
6c8edc4e6f93bdc0dd7f231998397e7da44d8961
diff --git a/lib/rack/utf8_sanitizer.rb b/lib/rack/utf8_sanitizer.rb index <HASH>..<HASH> 100644 --- a/lib/rack/utf8_sanitizer.rb +++ b/lib/rack/utf8_sanitizer.rb @@ -57,7 +57,7 @@ module Rack def decode_string(input) unescape_unreserved( sanitize_string(input). - force_encoding('ASCII-8BIT')) + force_encoding(Encoding::ASCII_8BIT)) end # This regexp matches all 'unreserved' characters from RFC3986 (2.3), @@ -97,14 +97,14 @@ module Rack def sanitize_string(input) if input.is_a? String - input = input.dup.force_encoding('UTF-8') + input = input.dup.force_encoding(Encoding::UTF_8) if input.valid_encoding? input else input. - force_encoding('ASCII-8BIT'). - encode!('UTF-8', + force_encoding(Encoding::ASCII_8BIT). + encode!(Encoding::UTF_8, invalid: :replace, undef: :replace) end
Use Encoding classes to represent encodings. When using strings to represent encodings, typos may be discovered while running the code. However, a typo in the Encoding constant raises an error at load.
whitequark_rack-utf8_sanitizer
train
rb
88242e74a4a7e6df11d992469c62aa58b24cc3d2
diff --git a/fitsio/fitslib.py b/fitsio/fitslib.py index <HASH>..<HASH> 100644 --- a/fitsio/fitslib.py +++ b/fitsio/fitslib.py @@ -180,12 +180,8 @@ def write(filename, data, extname=None, extver=None, units=None, compress=None, """ with FITS(filename, 'rw', clobber=clobber) as fits: - if data.dtype.fields == None: - fits.write_image(data, extname=extname, extver=extver, - compress=compress, header=header) - else: - fits.write_table(data, units=units, - extname=extname, extver=extver, header=header) + fits.write(data, units=units, extname=extname, extver=extver, + compress=compress, header=header) class FITS:
added generic write that wraps write_image and write_table. more docs
esheldon_fitsio
train
py
8282ba8e1368bb50576d3445c5a28c51f26a6fb5
diff --git a/client/html/templates/common/partials/attribute-standard.php b/client/html/templates/common/partials/attribute-standard.php index <HASH>..<HASH> 100644 --- a/client/html/templates/common/partials/attribute-standard.php +++ b/client/html/templates/common/partials/attribute-standard.php @@ -184,7 +184,7 @@ foreach( $this->get( 'attributeConfigItems', [] ) as $id => $attribute ) { <ul class="selection"> <?php foreach( $this->get( 'attributeCustomItems', [] ) as $id => $attribute ) : ?> <li class="select-item <?= $enc->attr( $attribute->getCode() ); ?>"> - <div class="select-name"><?= $enc->html( $this->translate( 'client/code', $attribute->getName() ) ); ?></div> + <div class="select-name"><?= $enc->html( $this->translate( 'client/code', $attribute->getCode() ) ); ?></div> <?php $hintcode = $attribute->getType() . '-hint'; $hint = $enc->html( $this->translate( 'client/code', $hintcode ) ); ?> <?php if( !empty( $hint ) && $hint !== $hintcode ) : ?>
Use code for custom attribute translation instead of name
aimeos_ai-client-html
train
php
1b515203908b8f140db2190f7f1d53559e142033
diff --git a/src/view/ThemeManager.js b/src/view/ThemeManager.js index <HASH>..<HASH> 100644 --- a/src/view/ThemeManager.js +++ b/src/view/ThemeManager.js @@ -363,7 +363,7 @@ define(function (require, exports, module) { // Monitor file changes. If the file that has changed is actually the currently loaded // theme, then we just reload the theme. This allows to live edit the theme FileSystem.on("change", function (evt, file) { - if (file.isDirectory) { + if (!file || file.isDirectory) { return; }
Fix bug #<I> (Themes code throws errors during wholesale file updates) - Don't assume FS "change" event's 'entry' arg is non-null
adobe_brackets
train
js
c6b259e8568ab03302545692f44ed1ad6d306b07
diff --git a/code/controllers/CMSPageHistoryController.php b/code/controllers/CMSPageHistoryController.php index <HASH>..<HASH> 100644 --- a/code/controllers/CMSPageHistoryController.php +++ b/code/controllers/CMSPageHistoryController.php @@ -337,20 +337,8 @@ class CMSPageHistoryController extends CMSMain { $record->Version ); } - - if($this->isAjax()) { - $this->response->addHeader('X-Status', $message); - $form = $this->getEditForm($record->ID); - - return $form->forTemplate(); - } - return array( - 'EditForm' => $this->customise(array( - 'Message' => $message, - 'Status' => 'success' - ))->renderWith('CMSMain_notice') - ); + return $this->redirect(Controller::join_links(singleton('CMSPageEditController')->Link('show'), $record->ID)); } /**
MINOR Redirect to page edit view after rolling back to a specific version in CMSPageHistoryController (fixes #<I>)
silverstripe_silverstripe-siteconfig
train
php
16995414867e01c1cda8581bedeee4b4836a828c
diff --git a/src/plone/app/mosaic/browser/static/js/mosaic.layout.js b/src/plone/app/mosaic/browser/static/js/mosaic.layout.js index <HASH>..<HASH> 100644 --- a/src/plone/app/mosaic/browser/static/js/mosaic.layout.js +++ b/src/plone/app/mosaic/browser/static/js/mosaic.layout.js @@ -108,8 +108,10 @@ define([ }); // Hide overlay - $.mosaic.overlay.app.hide(); - // $.mosaic.overlay.$el.trigger('destroy.modal.patterns');; + if ($.mosaic.overlay.app) { + $.mosaic.overlay.app.hide(); + // $.mosaic.overlay.$el.trigger('destroy.modal.patterns');; + } } }; @@ -1757,8 +1759,10 @@ define([ $.mosaic.addAppTile = function (type, url, id) { // Close overlay - $.mosaic.overlay.app.hide(); - // $.mosaic.overlay.trigger('destroy.modal.patterns'); + if ($.mosaic.overlay.app) { + $.mosaic.overlay.app.hide(); + // $.mosaic.overlay.trigger('destroy.modal.patterns'); + } // Get value $.ajax({
Fix issues where modal close was called without modal created
plone_plone.app.mosaic
train
js
9b2f3e3194ebf80afb423a140c3fb4a5d3c9e85b
diff --git a/lang/en_utf8/currencies.php b/lang/en_utf8/currencies.php index <HASH>..<HASH> 100644 --- a/lang/en_utf8/currencies.php +++ b/lang/en_utf8/currencies.php @@ -89,7 +89,7 @@ $string['MTL'] = 'Maltese Lira'; $string['MUR'] = 'Mauritius Rupee'; $string['MVR'] = 'Maldive Rufiyaa'; $string['MWK'] = 'Malawi Kwacha'; -$string['MXN'] = 'Mexican New Peso'; +$string['MXN'] = 'Mexican Peso'; $string['MYR'] = 'Malaysian Ringgit'; $string['MZM'] = 'Mozambique Metical'; $string['NGN'] = 'Nigerian Naira';
"new" is out of Mexican Peso since <I> MDL-<I>
moodle_moodle
train
php
f1c9cccecea5c482815d28fcd0e4c64db47f0663
diff --git a/src/i18n/pt-br.js b/src/i18n/pt-br.js index <HASH>..<HASH> 100644 --- a/src/i18n/pt-br.js +++ b/src/i18n/pt-br.js @@ -33,11 +33,11 @@ validators: { required: { message: "Campo obrigatório" }, - rangeLength: { message: "O valor esta fora do intervaldo definido" }, + rangeLength: { message: "O valor esta fora do intervalo definido" }, minLength: { message: "O comprimento do valor é muito curto" }, maxLength: { message: "O comprimento valor é muito longo" }, pattern: { message: "O valor informado não é compatível com o padrão" }, - range: { message: "O valor informado esta fora do limite definido" }, + range: { message: "O valor informado está fora do limite definido" }, min: { message: "O valor é muito curto" }, max: { message: "O valor é muito longo" } }
pt-br localization changes Correction of typos in pt-br localization.
tabalinas_jsgrid
train
js
f0de79f90fbc4fe0b34067d215c34172861ee2bb
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ except ImportError: long_description = 'Tool for parsing Variant Call Format (VCF) files. Works like a lightweight version of PyVCF.' setup(name='vcf_parser', - version='1.5.7', + version='1.5.8', description='Parsing vcf files', author = 'Mans Magnusson', author_email = '[email protected]',
Bumps version to <I>
moonso_vcf_parser
train
py
74f3b780e49b92d3e41e96924b6894ea7e202019
diff --git a/test/integration/helpers.go b/test/integration/helpers.go index <HASH>..<HASH> 100644 --- a/test/integration/helpers.go +++ b/test/integration/helpers.go @@ -170,7 +170,7 @@ func CleanupWithLogs(t *testing.T, profile string, cancel context.CancelFunc) { t.Helper() if t.Failed() && *postMortemLogs { t.Logf("%s failed, collecting logs ...", t.Name()) - rr, err := Run(t, exec.Command(Target(), "-p", profile, "logs", "-n", "5")) + rr, err := Run(t, exec.Command(Target(), "-p", profile, "logs", "-n", "100")) if err != nil { t.Logf("failed logs error: %v", err) }
CleanupWithLogs: Increase line count from 5 to <I>
kubernetes_minikube
train
go
5d1f93c294b8f6e2f70df2d7dd4c290c231fa081
diff --git a/src/main/java/nl/hsac/fitnesse/fixture/slim/web/BrowserTest.java b/src/main/java/nl/hsac/fitnesse/fixture/slim/web/BrowserTest.java index <HASH>..<HASH> 100644 --- a/src/main/java/nl/hsac/fitnesse/fixture/slim/web/BrowserTest.java +++ b/src/main/java/nl/hsac/fitnesse/fixture/slim/web/BrowserTest.java @@ -736,7 +736,7 @@ public class BrowserTest extends SlimFixture { @WaitUntil public boolean setSearchContextTo(String container) { boolean result = false; - WebElement containerElement = findContainer(container); + WebElement containerElement = getContainerElement(container); if (containerElement != null) { getSeleniumHelper().setCurrentContext(containerElement); result = true; @@ -765,7 +765,7 @@ public class BrowserTest extends SlimFixture { } } - private WebElement findContainer(String container) { + protected WebElement getContainerElement(String container) { WebElement containerElement = null; By by = getSeleniumHelper().placeToBy(container); if (by != null) {
Update name of method to get a container element to match similar methods, and allow it to be overriden is subclasses
fhoeben_hsac-fitnesse-fixtures
train
java
03a77bd8511bf59481524bd70c5d313ae863cfeb
diff --git a/docs/registry.go b/docs/registry.go index <HASH>..<HASH> 100644 --- a/docs/registry.go +++ b/docs/registry.go @@ -155,6 +155,9 @@ func (r *Registry) GetRemoteTags(registries []string, repository string, token [ } for _, host := range registries { endpoint := fmt.Sprintf("%s/v1/repositories/%s/tags", host, repository) + if !(strings.HasPrefix(endpoint, "http://") || strings.HasPrefix(endpoint, "https://")) { + endpoint = "https://" + endpoint + } req, err := r.opaqueRequest("GET", endpoint, nil) if err != nil { return nil, err
Fixed issue in registry.GetRemoteTags
docker_distribution
train
go
e5dcf655b0f69d8c21c80819a41f7ce1a955b3fc
diff --git a/src/js/methods.js b/src/js/methods.js index <HASH>..<HASH> 100644 --- a/src/js/methods.js +++ b/src/js/methods.js @@ -692,9 +692,9 @@ } } - // The canvas element will use `Math.floor` on a float number, so round first - canvasWidth = round(scaledWidth || originalWidth); - canvasHeight = round(scaledHeight || originalHeight); + // The canvas element will use `Math.floor` on a float number, so floor first + canvasWidth = floor(scaledWidth || originalWidth); + canvasHeight = floor(scaledHeight || originalHeight); canvas = createElement('canvas'); canvas.width = canvasWidth;
Floor canvas width/height instead of round
fengyuanchen_cropperjs
train
js
e6c340ad08196711a227984ce0e6e08f1f03f5b1
diff --git a/src/Stagehand/TestRunner/Collector/PHPSpecCollector.php b/src/Stagehand/TestRunner/Collector/PHPSpecCollector.php index <HASH>..<HASH> 100644 --- a/src/Stagehand/TestRunner/Collector/PHPSpecCollector.php +++ b/src/Stagehand/TestRunner/Collector/PHPSpecCollector.php @@ -59,9 +59,9 @@ class PHPSpecCollector extends Collector public function collectTestCase($testCase) { $specClass = new \ReflectionClass($testCase); - if (!$specClass->isAbstract()) { - $this->suite->addExampleGroup($specClass->newInstance()); - } + if ($specClass->isAbstract()) return; + + $this->suite->addExampleGroup($specClass->newInstance()); } /**
Improved the collectTestCase() method.
piece_stagehand-testrunner
train
php
8b1dc1ca85ee1a1cc3ab30643225bb2a92a8a9ec
diff --git a/cumulusci/core/sfdx.py b/cumulusci/core/sfdx.py index <HASH>..<HASH> 100644 --- a/cumulusci/core/sfdx.py +++ b/cumulusci/core/sfdx.py @@ -42,11 +42,13 @@ def sfdx( env=env, ) p.run() - if capture_output: + if capture_output or (check_return and p.returncode): p.stdout_text = io.TextIOWrapper(p.stdout, encoding=sys.stdout.encoding) p.stderr_text = io.TextIOWrapper(p.stderr, encoding=sys.stdout.encoding) if check_return and p.returncode: - raise Exception(f"Command exited with return code {p.returncode}") + raise Exception( + f"Command exited with return code {p.returncode}:\n{p.stderr_text}" + ) return p
pass through error output from sfdx
SFDO-Tooling_CumulusCI
train
py
2d33601726e2250c0f188f5ca2afdd9a508eafeb
diff --git a/app/components/marty/script_grid.rb b/app/components/marty/script_grid.rb index <HASH>..<HASH> 100644 --- a/app/components/marty/script_grid.rb +++ b/app/components/marty/script_grid.rb @@ -83,7 +83,7 @@ class Marty::ScriptGrid < Marty::CmGridPanel c.getter = lambda { |r| dscript = Marty::Dscript.find_by_script_id(r.id) # if we have a dscript, then it's checked out. - dscript ? dscript.user.to_s : "---" + dscript ? dscript.user.name.to_s : "---" } end end diff --git a/lib/marty/version.rb b/lib/marty/version.rb index <HASH>..<HASH> 100644 --- a/lib/marty/version.rb +++ b/lib/marty/version.rb @@ -1,3 +1,3 @@ module Marty - VERSION = "0.0.7" + VERSION = "0.0.8" end
Fixed bug with Checked Out By not showing user name properly
arman000_marty
train
rb,rb
a5978e92567194bcc6f1cf65a62ce6880b21884f
diff --git a/src/Testing/LevelsTestCase.php b/src/Testing/LevelsTestCase.php index <HASH>..<HASH> 100644 --- a/src/Testing/LevelsTestCase.php +++ b/src/Testing/LevelsTestCase.php @@ -31,7 +31,7 @@ abstract class LevelsTestCase extends \PHPUnit\Framework\TestCase foreach (range(0, 7) as $level) { unset($outputLines); - exec(sprintf('%s analyse --no-progress --errorFormat=prettyJson --level=%d %s --autoload-file %s %s', $command, $level, $configPath !== null ? '--configuration ' . escapeshellarg($configPath) : '', escapeshellarg($file), escapeshellarg($file)), $outputLines); + exec(sprintf('php %s analyse --no-progress --errorFormat=prettyJson --level=%d %s --autoload-file %s %s', $command, $level, $configPath !== null ? '--configuration ' . escapeshellarg($configPath) : '', escapeshellarg($file), escapeshellarg($file)), $outputLines); $output = implode("\n", $outputLines);
Attempt to fix LevelsTestCase on Windows
phpstan_phpstan
train
php
51cde3a6d45d4ca8d50c049c589938c92026801f
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/BufferOrEvent.java b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/BufferOrEvent.java index <HASH>..<HASH> 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/BufferOrEvent.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/BufferOrEvent.java @@ -102,7 +102,7 @@ public class BufferOrEvent { @Override public String toString() { - return String.format("BufferOrEvent [%s, channelInfo = %d, size = %d]", + return String.format("BufferOrEvent [%s, channelInfo = %s, size = %d]", isBuffer() ? buffer : event, channelInfo, size); }
[hotfix][network] Fix wrong string formatting for BufferOrEvent This previously assigned an object type to a %d argument, but should use a %s argument.
apache_flink
train
java
269b36b9db727909cf9daad59e0e43fba84a2424
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -36,7 +36,6 @@ task( "lint", () => gulp "**/.*rc.js", "bin/*.js", "lib/**/*.js", - "!lib/parser/index.js", "test/benchmark/**/*.js", "test/benchmark/run", "test/impact",
Remove redundant glob for linting
pegjs_pegjs
train
js
486d2891a4389a748ca70b06c2b80a35c47050ae
diff --git a/tests/test_orbits.py b/tests/test_orbits.py index <HASH>..<HASH> 100644 --- a/tests/test_orbits.py +++ b/tests/test_orbits.py @@ -1192,6 +1192,17 @@ def _check_energy_jacobi_angmom(os,list_os): assert numpy.all(numpy.fabs(os.Jacobi(pot=MWPotential2014+dp+sp,OmegaP=0.6)[ii]/list_os[ii].Jacobi(pot=MWPotential2014+dp+sp,OmegaP=0.6)-1.) < 10.**-10.), 'Evaluating Orbits Jacobi does not agree with Orbit' return None +# Test that L cannot be computed for (a) linearOrbits and (b) 5D orbits +def test_angmom_errors(): + from galpy.orbit import Orbits + o= Orbits([[1.,0.1]]) + with pytest.raises(AttributeError): + o.L() + o= Orbits([[1.,0.1,1.1,0.1,-0.2]]) + with pytest.raises(AttributeError): + o.L() + return None + # Test that we can still get outputs when there aren't enough points for an actual interpolation # Test whether Orbits evaluation methods sound warning when called with # unitless time when orbit is integrated with unitfull times
Tests of angular momentum errors
jobovy_galpy
train
py
19b8de555dcd6c22705faa8109d0345a94d0fecf
diff --git a/skflow/estimators/base.py b/skflow/estimators/base.py index <HASH>..<HASH> 100644 --- a/skflow/estimators/base.py +++ b/skflow/estimators/base.py @@ -365,8 +365,11 @@ class TensorFlowEstimator(BaseEstimator): custom_estimator._restore(path) return custom_estimator - # XXX(ilblackdragon): Using eval here is bad, should use lookup!!!! - estimator = eval(class_name)(**model_def) # pylint: disable=eval-used + # To avoid cyclical dependencies, import inside the function instead of + # the beginning of the file. + from skflow import estimators + # Estimator must be one of the defined estimators in the __init__ file. + estimator = getattr(estimators, class_name)(**model_def) estimator._restore(path) return estimator
Replace eval in the restore function to getattr from estimators.
tensorflow_skflow
train
py
567520b86e34047f8a66861ec9f72e25dd768f16
diff --git a/src/howler.core.js b/src/howler.core.js index <HASH>..<HASH> 100644 --- a/src/howler.core.js +++ b/src/howler.core.js @@ -314,14 +314,18 @@ // This must occur before WebAudio setup or the source.onended // event will not fire. for (var i=0; i<self.html5PoolSize; i++) { - var audioNode = new Audio(); + try { + var audioNode = new Audio(); - // Mark this Audio object as unlocked to ensure it can get returned - // to the unlocked pool when released. - audioNode._unlocked = true; + // Mark this Audio object as unlocked to ensure it can get returned + // to the unlocked pool when released. + audioNode._unlocked = true; - // Add the audio node to the pool. - self._releaseHtml5Audio(audioNode); + // Add the audio node to the pool. + self._releaseHtml5Audio(audioNode); + } catch (e) { + self.noAudio = true; + } } // Loop through any assigned audio nodes and unlock them.
Wrap unlock test in try/catch for Edge Fixes #<I>
goldfire_howler.js
train
js
e2582db1a6f8a01e8ad1685c461677fad116f65d
diff --git a/lib/DObject.rb b/lib/DObject.rb index <HASH>..<HASH> 100644 --- a/lib/DObject.rb +++ b/lib/DObject.rb @@ -890,7 +890,7 @@ module DICOM add_msg("Warning: Method set_value could not create data element, either because data element name was not recognized in the library, or data element tag is invalid (Expected format of tags is 'GGGG,EEEE').") else # As we wish to create a new data element, we need to find out where to insert it in the element arrays: - # We will do this by finding the last array position of the last element that will (alphabetically/numerically) stay in front of this element. + # We will do this by finding the array position of the last element that will (alphabetically/numerically) stay in front of this element. if @tags.size > 0 # Search the array: index = -1 @@ -898,7 +898,7 @@ module DICOM while quit != true do if index+1 >= @tags.length # We have reached end of array. quit = true - elsif tag < @tags[index+1] # We are past the correct position. + elsif tag < @tags[index+1] and @levels[index+1] == 0 # We are past the correct position (only match against top level tags). quit = true else # Increase index in anticipation of a 'hit'. index += 1
Fixed a bug where creating new tags in DICOM files with tag hierarchies failed.
dicom_ruby-dicom
train
rb
bc7741cd8abeaadc1ee4e1046d7c2e179e5198fe
diff --git a/upload/catalog/controller/checkout/shipping_address.php b/upload/catalog/controller/checkout/shipping_address.php index <HASH>..<HASH> 100644 --- a/upload/catalog/controller/checkout/shipping_address.php +++ b/upload/catalog/controller/checkout/shipping_address.php @@ -25,7 +25,7 @@ class ShippingAddress extends \Opencart\System\Engine\Controller { $data['addresses'] = $this->model_account_address->getAddresses(); - if (isset($this->session->data['shipping_address'])) { + if (!$this->customer->isLogged() && isset($this->session->data['shipping_address'])) { $data['firstname'] = $this->session->data['shipping_address']['firstname']; $data['lastname'] = $this->session->data['shipping_address']['lastname']; $data['company'] = $this->session->data['shipping_address']['company'];
Update shipping_address.php
opencart_opencart
train
php
c0f641be8a4348438c1bff1f56d4c9ea3dac9650
diff --git a/autofit/optimize/non_linear.py b/autofit/optimize/non_linear.py index <HASH>..<HASH> 100644 --- a/autofit/optimize/non_linear.py +++ b/autofit/optimize/non_linear.py @@ -267,8 +267,8 @@ class NonLinearOptimizer(object): if self.should_visualise(): self.analysis.visualize(instance, image_path=self.image_path, during_analysis=True) - if self.should_log(): - logger.info(self.analysis.describe(instance)) + # if self.should_log(): + # logger.info(self.analysis.describe(instance)) if self.should_backup(): self.nlo.backup()
Commented out should_log in optimizer to fix bug
rhayes777_PyAutoFit
train
py
d8f6ebbc2620ef2ff044f5eceff63ebbeaa979ef
diff --git a/tests/integration/components/stream-banner-test.js b/tests/integration/components/stream-banner-test.js index <HASH>..<HASH> 100644 --- a/tests/integration/components/stream-banner-test.js +++ b/tests/integration/components/stream-banner-test.js @@ -7,7 +7,7 @@ moduleForComponent('stream-banner', 'Integration | Component | stream banner', { test('it renders', function(assert) { this.render(hbs`{{stream-banner}}`); - assert.equal(this.$('.streambanner-on-air').text().trim(), 'On air now on', 'it should render'); + assert.equal(this.$('.stream-banner').length, 1, 'it should render'); }); skip('it renders a dropdown of the given stream options');
update dummy render test to look for classname
nypublicradio_nypr-ui
train
js
b3fdd82b0af9c8d7f5089eadd956d6c83c7123ce
diff --git a/Lib/fontbakery/reporters/terminal.py b/Lib/fontbakery/reporters/terminal.py index <HASH>..<HASH> 100644 --- a/Lib/fontbakery/reporters/terminal.py +++ b/Lib/fontbakery/reporters/terminal.py @@ -338,10 +338,12 @@ class TerminalReporter(TerminalProgress): if self.results_by: print('Collected results by', self.results_by) for index in self._collected_results: - if self.runner: + if index is not None and self.runner: val = self.runner.get_iterarg(self.results_by, index) - else: + elif index is not None: val = index + else: + val = '(not using "{}")'.format(self.results_by) print('{}: {}'.format(self.results_by, val)) print(_render_results_counter(self._collected_results[index], color=self._use_color))
[reporters/terminal] fix not using an iterarg in collected report.
googlefonts_fontbakery
train
py
059079e9458c7ec59f98a423da848ec5f9e2cca0
diff --git a/mod/lti/backup/moodle2/restore_lti_stepslib.php b/mod/lti/backup/moodle2/restore_lti_stepslib.php index <HASH>..<HASH> 100644 --- a/mod/lti/backup/moodle2/restore_lti_stepslib.php +++ b/mod/lti/backup/moodle2/restore_lti_stepslib.php @@ -87,6 +87,11 @@ class restore_lti_activity_structure_step extends restore_activity_structure_ste // TODO: MDL-34161 - Fix restore to support course/site tools & submissions. $data->typeid = 0; + // Try to decrypt resourcekey and password. Null if not possible (DB default). + // Note these fields were originally encrypted on backup using {link @encrypted_final_element}. + $data->resourcekey = $this->decrypt($data->resourcekey); + $data->password = $this->decrypt($data->password); + $newitemid = $DB->insert_record('lti', $data); // Immediately after inserting "activity" record, call this.
MDL-<I> backup: Apply the decrypt() method to lti "secrets"
moodle_moodle
train
php
b74afbc87bf0dd72009e33605bd21cab35396adf
diff --git a/ezp/Content/Tests/Service/TrashTest.php b/ezp/Content/Tests/Service/TrashTest.php index <HASH>..<HASH> 100644 --- a/ezp/Content/Tests/Service/TrashTest.php +++ b/ezp/Content/Tests/Service/TrashTest.php @@ -107,7 +107,7 @@ class TrashTest extends Base // Now creating location for content $this->topLocation = $this->locationService->load( 2 ); - $this->location = new ConcreteLocation( new ProxyContent( $this->content->id, $this->repository->getContentService() ) ); + $this->location = new ConcreteLocation( $this->content ); $this->location->setParent( $this->topLocation ); $this->location = $this->locationService->create( $this->location ); $this->locationToDelete[] = $this->location;
Change: TrashTest::setup() to use already fetched content object instead of creating Proxy for it
ezsystems_ezpublish-kernel
train
php
870e800f59bbcea88c7e445b3254ff78866e5713
diff --git a/integration-tests/test_s3.py b/integration-tests/test_s3.py index <HASH>..<HASH> 100644 --- a/integration-tests/test_s3.py +++ b/integration-tests/test_s3.py @@ -89,7 +89,7 @@ def test_s3_encrypted_file(benchmark): key = _S3_URL + '/sanity.txt' text = 'с гранатою в кармане, с чекою в руке' - actual = benchmark(write_read, key, text, 'w', 'r', 'utf-8', multipart_upload={ + actual = benchmark(write_read, key, text, 'w', 'r', 'utf-8', s3_upload={ 'ServerSideEncryption': 'AES256' }) assert actual == text
fix build from @eschwartz
RaRe-Technologies_smart_open
train
py
da2a326bb6dc4a236bdf032ecca0e6791d60060a
diff --git a/src/mg/Ding/Container/Impl/ContainerImpl.php b/src/mg/Ding/Container/Impl/ContainerImpl.php index <HASH>..<HASH> 100644 --- a/src/mg/Ding/Container/Impl/ContainerImpl.php +++ b/src/mg/Ding/Container/Impl/ContainerImpl.php @@ -111,7 +111,6 @@ class ContainerImpl implements IContainer */ private static $_options = array( 'bdef' => array(), - 'properties' => array(), 'drivers' => array() );
removed unnecesary default array for 'properties' in filters driver
marcelog_Ding
train
php
ec6e8d440ff168739c8dd9b07eb275c1a651a875
diff --git a/server.js b/server.js index <HASH>..<HASH> 100644 --- a/server.js +++ b/server.js @@ -1281,13 +1281,17 @@ cache(function(data, match, sendBadge) { return; } - var outdatedStr = "Outdated dependencies for " + repo + " "; - if (buffer.indexOf(outdatedStr) >= 0) { - badgeData.text[1] = 'outdated'; - badgeData.colorscheme = 'orange'; - } else { - badgeData.text[1] = 'up-to-date'; - badgeData.colorscheme = 'brightgreen'; + try { + var outdatedStr = "Outdated dependencies for " + repo + " "; + if (buffer.indexOf(outdatedStr) >= 0) { + badgeData.text[1] = 'outdated'; + badgeData.colorscheme = 'orange'; + } else { + badgeData.text[1] = 'up-to-date'; + badgeData.colorscheme = 'brightgreen'; + } + } catch(e) { + badgeData.text[1] = 'invalid'; } sendBadge(format, badgeData); });
catch errors in 'hackage-deps' shield
badges_shields
train
js
485b9edf966cc9f4acafb3428ad5b5ed17dda53c
diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Api/ApiJsonTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Api/ApiJsonTest.php index <HASH>..<HASH> 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Api/ApiJsonTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Api/ApiJsonTest.php @@ -561,7 +561,7 @@ class ApiJsonTest extends ApiTestCase $route = '/api/v1/records/1234567890/1/'; $this->evaluateNotFoundRoute($route, ['GET']); - $this->evaluateMethodNotAllowedRoute($route, ['POST', 'PUT', 'DELETE']); + $this->evaluateMethodNotAllowedRoute($route, ['POST', 'PUT']); $route = '/api/v1/records/kjslkz84spm/sfsd5qfsd5/'; $this->evaluateBadRequestRoute($route, ['GET']); $this->evaluateMethodNotAllowedRoute($route, ['POST', 'PUT', 'DELETE']);
PHRAS-<I>_delete-record-api - fix tests
alchemy-fr_Phraseanet
train
php
c6257280f18595c2abec2372002eac0aa436a38c
diff --git a/lib/friendly_id/active_record_adapter/relation.rb b/lib/friendly_id/active_record_adapter/relation.rb index <HASH>..<HASH> 100644 --- a/lib/friendly_id/active_record_adapter/relation.rb +++ b/lib/friendly_id/active_record_adapter/relation.rb @@ -101,7 +101,7 @@ module FriendlyId fragment = "(slugs.sluggable_type = %s AND slugs.name = %s AND slugs.sequence = %d)" conditions = ids.inject(nil) do |clause, id| name, seq = id.parse_friendly_id - string = fragment % [connection.quote(klass.base_class), connection.quote(name), seq] + string = fragment % [connection.quote(klass.base_class.name), connection.quote(name), seq] clause ? clause + " OR #{string}" : string end sql = "SELECT sluggable_id FROM slugs WHERE (%s)" % conditions
Fix tests for Rails <I>.rc1
norman_friendly_id
train
rb
dc76834fb8331f5dfadadbcc0bcef4a03bb04bca
diff --git a/src/CommandBus/BaseCommand.php b/src/CommandBus/BaseCommand.php index <HASH>..<HASH> 100644 --- a/src/CommandBus/BaseCommand.php +++ b/src/CommandBus/BaseCommand.php @@ -15,7 +15,7 @@ abstract class BaseCommand implements Command /** * @var string */ - public $commandId; + private $commandId; /** * Give the command a Uuid, Used to logging and auditing diff --git a/tests/CommandBus/CommandTest.php b/tests/CommandBus/CommandTest.php index <HASH>..<HASH> 100644 --- a/tests/CommandBus/CommandTest.php +++ b/tests/CommandBus/CommandTest.php @@ -15,6 +15,8 @@ class CommandTest extends \PHPUnit_Framework_TestCase $command = new TestCommand(); $this->assertContains('SmoothPhp\Test\CommandBus\TestCommand:', (string)$command); + + $this->assertRegExp("/^(\{)?[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}(?(1)\})$/i",$command->getCommandId()); } }
[Command] Check base command returns a UUID on creation
SmoothPhp_CQRS-ES-Framework
train
php,php
18d6d9ace5629333106732b4d4dccf07ea3bc90f
diff --git a/lib/moped/authenticatable.rb b/lib/moped/authenticatable.rb index <HASH>..<HASH> 100644 --- a/lib/moped/authenticatable.rb +++ b/lib/moped/authenticatable.rb @@ -74,8 +74,10 @@ module Moped unless result["ok"] == 1 # See if we had connectivity issues so we can retry e = Errors::PotentialReconfiguration.new(authenticate, document) - if e.reconfiguring_replica_set? || e.connection_failure? - raise e + if e.reconfiguring_replica_set? + raise Errors::ReplicaSetReconfigured.new(e.command, e.details) + elsif e.connection_failure? + raise Errors::ConnectionFailure.new(e.inspect) end raise Errors::AuthenticationFailure.new(authenticate, document)
Fix reconfiguration exception thrown so retry works.
mongoid_moped
train
rb
73107c0c40f29596c6addfa396c8053698de2efa
diff --git a/presto-main/src/test/java/com/facebook/presto/operator/aggregation/AbstractTestApproximateCountDistinct.java b/presto-main/src/test/java/com/facebook/presto/operator/aggregation/AbstractTestApproximateCountDistinct.java index <HASH>..<HASH> 100644 --- a/presto-main/src/test/java/com/facebook/presto/operator/aggregation/AbstractTestApproximateCountDistinct.java +++ b/presto-main/src/test/java/com/facebook/presto/operator/aggregation/AbstractTestApproximateCountDistinct.java @@ -108,7 +108,7 @@ public abstract class AbstractTestApproximateCountDistinct } assertLessThan(stats.getMean(), 1.0e-2); - assertLessThan(Math.abs(stats.getStandardDeviation() - maxStandardError), 1.0e-2); + assertLessThan(stats.getStandardDeviation(), 1.0e-2 + maxStandardError); } @Test(dataProvider = "provideStandardErrors")
Minor fix to standard error check in approx_distinct test For types with small value sets (e.g. TINYINT), standard deviation can be small or even zero. This will fail the current check since it asserts the standard deviation is within a range of maxStandardError.
prestodb_presto
train
java
d3a9db6c545b577fe3e1ff9396cd9ddd7af2060f
diff --git a/src/state.js b/src/state.js index <HASH>..<HASH> 100644 --- a/src/state.js +++ b/src/state.js @@ -36,7 +36,7 @@ export class Parser { // The current position of the tokenizer in the input. if (startPos) { this.pos = startPos - this.lineStart = Math.max(0, this.input.lastIndexOf("\n", startPos)) + this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1 this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length } else { this.pos = this.lineStart = 0
Fix determination of lineStart when parsing from middle of file Closes #<I>
acornjs_acorn
train
js
09399f6d62161e614d2a91788688d56beeeefd9e
diff --git a/master/buildbot/buildslave/local.py b/master/buildbot/buildslave/local.py index <HASH>..<HASH> 100644 --- a/master/buildbot/buildslave/local.py +++ b/master/buildbot/buildslave/local.py @@ -16,8 +16,8 @@ import os from buildbot.buildslave.base import BuildSlave -from twisted.internet import defer from buildbot.config import error +from twisted.internet import defer class LocalBuildSlave(BuildSlave): diff --git a/master/buildbot/test/fake/bslavemanager.py b/master/buildbot/test/fake/bslavemanager.py index <HASH>..<HASH> 100644 --- a/master/buildbot/test/fake/bslavemanager.py +++ b/master/buildbot/test/fake/bslavemanager.py @@ -52,6 +52,7 @@ class FakeBuildslaveManager(service.AsyncMultiService): assert buildslaveName not in self.connections self.connections[buildslaveName] = conn conn.info = {} + def remove(): del self.connections[buildslaveName] return defer.succeed(True)
remove usePTY option as it is marked deprecated - more docs
buildbot_buildbot
train
py,py
742ba0bf2a8f013a4065a6c25935dd7e912483f1
diff --git a/pygmsh/__init__.py b/pygmsh/__init__.py index <HASH>..<HASH> 100644 --- a/pygmsh/__init__.py +++ b/pygmsh/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -__version__ = '0.1.0' +__version__ = '0.2.0' __author__ = 'Nico Schlömer' __author_email__ = '[email protected]' __website__ = 'https://github.com/nschloe/pygmsh'
bump the version number to <I>
nschloe_pygmsh
train
py
6b4d1d4fd199f1f4b2c8c3ee363855522506782b
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -36,7 +36,7 @@ extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', ] -if os.environ.get('NOUML', '').lower() not in ('1', 'yes', 'y'): +if not on_rtd and os.environ.get('NOUML', '').lower() not in ('1', 'yes', 'y'): extensions.append('sphinx_pyreverse') # Add any paths that contain templates here, relative to this directory.
no UML on RTD, finally
pyroscope_pyrocore
train
py
1d70148ebd074ba453b1741783355ebb8031c3f4
diff --git a/salt/cloud/clouds/joyent.py b/salt/cloud/clouds/joyent.py index <HASH>..<HASH> 100644 --- a/salt/cloud/clouds/joyent.py +++ b/salt/cloud/clouds/joyent.py @@ -41,7 +41,7 @@ from __future__ import absolute_import # Import python libs import os import copy -import six.moves.http_client # pylint: disable=E0611 +import salt.utils.six.moves.http_client # pylint: disable=E0611 import requests import json import logging
Replaced module six in file /salt/cloud/clouds/joyent.py
saltstack_salt
train
py
d073b2e4c3332a8b5c688e73eee7b1da61f28954
diff --git a/newsletter-bundle/contao/Newsletter.php b/newsletter-bundle/contao/Newsletter.php index <HASH>..<HASH> 100644 --- a/newsletter-bundle/contao/Newsletter.php +++ b/newsletter-bundle/contao/Newsletter.php @@ -867,7 +867,7 @@ class Newsletter extends \Backend $arrProcessed[$objNewsletter->jumpTo] = false; // Get the target page - $objParent = $this->Database->prepare("SELECT id, alias FROM tl_page WHERE id=? AND (start='' OR start<$time) AND (stop='' OR stop>$time) AND published=1 AND noSearch!=1" . ($blnIsSitemap ? " AND sitemap!='map_never'" : "")) + $objParent = $this->Database->prepare("SELECT * FROM tl_page WHERE id=? AND (start='' OR start<$time) AND (stop='' OR stop>$time) AND published=1 AND noSearch!=1" . ($blnIsSitemap ? " AND sitemap!='map_never'" : "")) ->limit(1) ->execute($objNewsletter->jumpTo); @@ -875,7 +875,7 @@ class Newsletter extends \Backend if ($objParent->numRows) { $domain = $this->Environment->base; - $objParent = $this->getPageDetails($objParent->id); + $objParent = $this->getPageDetails($objParent); if ($objParent->domain != '') {
[Newsletter] Better Model implementation We will, however, not be able to switch to using models all throughout the system in version 3, because we want to preserve backwards compatibility.
contao_contao
train
php
75931d08b4247c7885a29baacc53426327d27a53
diff --git a/lib/github_urls/parser.rb b/lib/github_urls/parser.rb index <HASH>..<HASH> 100644 --- a/lib/github_urls/parser.rb +++ b/lib/github_urls/parser.rb @@ -13,8 +13,8 @@ module GithubUrls def parse return nil if url.nil? return nil unless url.include?('github') - if extract_github_io_name(url) - return extract_github_io_name(url) + if extract_github_io_name + return extract_github_io_name end remove_whitespace @@ -82,7 +82,7 @@ module GithubUrls url.gsub!(/(github.io|github.com|github.org|raw.githubusercontent.com)+?(:|\/)?/i, '') end - def extract_github_io_name(url) + def extract_github_io_name return nil if url.match(/www.github.(io|com|org)/i) match = url.match(/([\w\.@\:\-_~]+)\.github\.(io|com|org)\/([\w\.@\:\-\_\~]+)/i) return nil unless match && match.length == 4
Don't pass the url argument, use instance
librariesio_github_urls
train
rb
8c1b9bc4af71917bb68a4c2ad2ba234901a2d11e
diff --git a/plugins/ws.js b/plugins/ws.js index <HASH>..<HASH> 100644 --- a/plugins/ws.js +++ b/plugins/ws.js @@ -3,7 +3,7 @@ var URL = require('url') module.exports = function (opts) { opts = opts || {} - opts.binaryType = opts.binaryType: 'arraybuffer') + opts.binaryType = (opts.binaryType || 'arraybuffer') return { name: 'ws', server: function (onConnect) {
always use binary websockets
ssbc_multiserver
train
js
1c49f11563ba93b513f6a89fc17fa2ed69abf911
diff --git a/Router.php b/Router.php index <HASH>..<HASH> 100644 --- a/Router.php +++ b/Router.php @@ -31,7 +31,8 @@ class Router */ public function state($name, $url, callable $callback) { - $state = new State($callback); + $url = $this->fullUrl($url); + $state = new State($url, $callback); $url = '@^'.str_replace('@', '\@', $this->fullUrl($url)).'$@'; $this->routes[$url] = $state; $this->states[$name] = $state; @@ -163,7 +164,7 @@ class Router * @param array $arguments Additional arguments needed to build the URL. * @return void */ - public function goto($name, array $arguments = []) + public function redirect($name, array $arguments = []) { header("Location: ".$this->absolute($name, $arguments), true, 302); die(); @@ -176,7 +177,7 @@ class Router * @param array $arguments Additional arguments needed to build the URL. * @return void */ - public function moveto($name, array $arguments = []) + public function move($name, array $arguments = []) { header("Location: ".$this->absolute($name, $arguments), true, 301); die();
goto is reserved (ugh), and store url in states
monolyth-php_reroute
train
php
637968e7e81e7253e9f0bd17cc0765a1d310b7d5
diff --git a/code/libraries/joomlatools/library/event/subscriber/factory.php b/code/libraries/joomlatools/library/event/subscriber/factory.php index <HASH>..<HASH> 100644 --- a/code/libraries/joomlatools/library/event/subscriber/factory.php +++ b/code/libraries/joomlatools/library/event/subscriber/factory.php @@ -117,6 +117,8 @@ class KEventSubscriberFactory extends KObject implements KObjectSingleton $this->__listeners[$listener][] = $identifier; } } + + $this->__subscribers[(string)$identifier] = true; } return $result; @@ -135,8 +137,15 @@ class KEventSubscriberFactory extends KObject implements KObjectSingleton */ public function subscribeEvent($event, $event_publisher) { - foreach( $this->getSubscribers($event) as $subscriber) { - $this->getObject($subscriber)->subscribe($event_publisher); + foreach($this->getSubscribers($event) as $identifier) + { + if(!$this->__subscribers[(string)$identifier] instanceof KEventSubscriberInterface) + { + $subscriber = $this->getObject($identifier); + $subscriber->subscribe($event_publisher); + + $this->__subscribers[(string)$identifier] = $subscriber; + } } return $this;
#<I> - Do not allow subscribers to re-subscribe themselves.
joomlatools_joomlatools-framework
train
php
d2243b2934d364028aef2844680b0be96a69bedb
diff --git a/ELiDE/texturestack.py b/ELiDE/texturestack.py index <HASH>..<HASH> 100644 --- a/ELiDE/texturestack.py +++ b/ELiDE/texturestack.py @@ -165,7 +165,10 @@ class ImageStack(TextureStack): super().insert(i, v) def append(self, v): - self.paths.append(v) + if isinstance(v, str): + self.paths.append(v) + else: + super().append(v) def __delitem__(self, i): super().__delitem__(i)
make it possible to append either a path or a texture to an ImageStack
LogicalDash_LiSE
train
py
77f37849954a0a6926da4637448b526f4ddef095
diff --git a/falafel/mappers/rhn_server_xmlrpc.py b/falafel/mappers/rhn_server_xmlrpc.py index <HASH>..<HASH> 100644 --- a/falafel/mappers/rhn_server_xmlrpc.py +++ b/falafel/mappers/rhn_server_xmlrpc.py @@ -76,17 +76,16 @@ def server_xmlrpc_log(context): get: err_lines = log.get('Wrapper') for line in err_lines: - assert line.get('stat') == 'INFO' - assert line.get('log') .. - assert line.get('proc') .. - assert line.get('time') .. + assert line.get('pid') == 3064 + assert line.get('client_ip') == '10.20.30.40' + assert line.get('module') == 'rhnServer' + assert line.get('function') == 'server_certificate.valid' assert line.get('raw_log') .. ... last: - last_line_stat = log.last.get('time') + last_line_stat = log.last.get('timestamp') ----------- """ - print "got to server_xmlrpc_log" return LogLineList(context.content)
Remove extraneous debugging print, improve usage example
RedHatInsights_insights-core
train
py
54df1227f184b6be1ee7c0576f56e9bbed8ad29d
diff --git a/manifest.php b/manifest.php index <HASH>..<HASH> 100755 --- a/manifest.php +++ b/manifest.php @@ -35,7 +35,7 @@ return array( 'label' => 'LTI library', 'description' => 'TAO LTI library and helpers', 'license' => 'GPL-2.0', - 'version' => '3.2.2', + 'version' => '3.2.3', 'author' => 'Open Assessment Technologies SA', 'requires' => array( 'tao' => '>=10.8.0' diff --git a/scripts/update/class.Updater.php b/scripts/update/class.Updater.php index <HASH>..<HASH> 100755 --- a/scripts/update/class.Updater.php +++ b/scripts/update/class.Updater.php @@ -73,6 +73,7 @@ class taoLti_scripts_update_Updater extends \common_ext_ExtensionUpdater $this->setVersion('2.1.0'); } - $this->skip('2.1.0', '3.2.2'); + + $this->skip('2.1.0', '3.2.3'); } }
Bump patch version tao-<I>
oat-sa_extension-tao-lti
train
php,php
b8e2112c98ae41b6b692beb9e929f0419f944d5a
diff --git a/examples/manage_members.py b/examples/manage_members.py index <HASH>..<HASH> 100644 --- a/examples/manage_members.py +++ b/examples/manage_members.py @@ -52,7 +52,7 @@ if __name__ == '__main__': auth = AuthNonSSO(token) api = API(auth) api.community_url = community - #create_new_member(api) - #get_member_email(api) + create_new_member(api) + get_member_email(api) attach_avatar_member(api)
Uncommeted a couple of lines
joausaga_ideascaly
train
py
f31f3d1d55630d1ff28bedc5c7b6671032f11b2a
diff --git a/src/Joseki/Migration/DefaultMigration.php b/src/Joseki/Migration/DefaultMigration.php index <HASH>..<HASH> 100644 --- a/src/Joseki/Migration/DefaultMigration.php +++ b/src/Joseki/Migration/DefaultMigration.php @@ -2,18 +2,20 @@ namespace Joseki\Migration; +use Dibi\Connection; + class DefaultMigration extends AbstractMigration { - /** @var \DibiConnection */ + /** @var Connection */ private $dibiConnection; /** * DefaultMigration constructor. - * @param \DibiConnection $dibiConnection + * @param Connection $dibiConnection */ - public function __construct(\DibiConnection $dibiConnection) + public function __construct(Connection $dibiConnection) { $this->dibiConnection = $dibiConnection; }
DefaultMigration: fixed compatibility with dibi v3.x BC BREAK
Joseki_Migration
train
php
ec593bd4dcd7bd1246ffe0668726888d642f27a9
diff --git a/lib/MapReduce.js b/lib/MapReduce.js index <HASH>..<HASH> 100644 --- a/lib/MapReduce.js +++ b/lib/MapReduce.js @@ -47,7 +47,7 @@ $thing.agent('@singleton', { drainRefs = 0, pushes = [], self = this, - getMapReduce = this.mapReduce, + getMapReduce = this.getMapReduce, mapReduce = { write: function(key, value) { @@ -171,9 +171,11 @@ $thing.agent('@singleton', { } ; - $thing.searchMeta(this, 'push', 'string', function(selector) { - - pushes.push($thing.agent(selector)); + $thing.searchMeta(this, 'push', 'string', function() { + + pushes.push( + $thing.agent('@select ' + $thing.arrayDup(arguments).join(' ')) + ); });
Allow select expressions in push annotations
thingjs_agent
train
js
01011691e0dab08e199fa82d7dbbb6a1db82d7e8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ setup( 'Topic :: Software Development :: Testing', 'Topic :: Software Development :: Quality Assurance'], packages=['diff_cover', 'diff_cover/violationsreporters'], - package_data={'diff_cover': ['templates/*.txt', 'templates/*.html']}, + package_data={'diff_cover': ['templates/*.txt', 'templates/*.html', 'templates/*.css']}, install_requires=REQUIREMENTS, entry_points={ 'console_scripts': ['diff-cover = diff_cover.tool:main',
make sure css is installed
Bachmann1234_diff-cover
train
py
adfa04d396c299e74287aa855018bc63f0041c1b
diff --git a/web/src/test/java/uk/ac/ebi/atlas/model/differential/DifferentialProfilesListTest.java b/web/src/test/java/uk/ac/ebi/atlas/model/differential/DifferentialProfilesListTest.java index <HASH>..<HASH> 100644 --- a/web/src/test/java/uk/ac/ebi/atlas/model/differential/DifferentialProfilesListTest.java +++ b/web/src/test/java/uk/ac/ebi/atlas/model/differential/DifferentialProfilesListTest.java @@ -100,14 +100,14 @@ public class DifferentialProfilesListTest { } @Test - public void maxDownRegulatedExpressionLevelShouldBeNaNWhenAllProfilesHaveNoDownRegulatedExpressionLevel() throws Exception { + public void maxDownRegulatedExpressionLevelShouldBeZeroWhenAllProfilesHaveNoDownRegulatedExpressionLevel() throws Exception { //given given(differentialProfileMock1.getMaxDownRegulatedExpressionLevel()).willReturn(0D); given(differentialProfileMock2.getMaxDownRegulatedExpressionLevel()).willReturn(0D); given(differentialProfileMock3.getMaxDownRegulatedExpressionLevel()).willReturn(0D); // - assertThat(subject.getMaxDownRegulatedExpressionLevel(), is(Double.NaN)); + assertThat(subject.getMaxDownRegulatedExpressionLevel(), is(0D)); } @Test
Handle p-values of zero for single experiment gene query search (when download regulated) - fix test
ebi-gene-expression-group_atlas
train
java
da91e6e3afdbe391df22b9ce3265c23960a2e434
diff --git a/spec/support/lazy_enumerable.rb b/spec/support/lazy_enumerable.rb index <HASH>..<HASH> 100644 --- a/spec/support/lazy_enumerable.rb +++ b/spec/support/lazy_enumerable.rb @@ -2,6 +2,18 @@ require 'delegate' +# This is a work-around for a bug in rubinius 2.0.0-rc1 +# See: https://github.com/rubinius/rubinius/issues/2104 +SimpleDelegator.class_eval do + if instance_method(:dup).arity == 1 + def dup + new = super + new.__setobj__(__getobj__.dup) + new + end + end +end + class LazyEnumerable < SimpleDelegator def size nil
Fix specs to run under rbx <I>-rc1 in <I> mode
dkubb_axiom
train
rb
8c8b71b5a4c15ad65746244903e5feebe2ac8c79
diff --git a/spec/routine_spec.rb b/spec/routine_spec.rb index <HASH>..<HASH> 100644 --- a/spec/routine_spec.rb +++ b/spec/routine_spec.rb @@ -40,19 +40,29 @@ describe Lev::Routine do }.to raise_error(NameError) end - it 'raises an exception on fatal_error if configured' do - Lev.configure do |config| - config.raise_fatal_errors = true + context 'when raise_fatal_errors is configured true' do + before do + Lev.configure do |config| + config.raise_fatal_errors = true + end end - expect { - RaiseFatalError.call - }.to raise_error + after do + Lev.configure do |config| + config.raise_fatal_errors = false + end + end + + it 'raises an exception on fatal_error if configured' do + expect { + RaiseFatalError.call + }.to raise_error - begin - RaiseFatalError.call - rescue => e - expect(e.message).to eq('code broken - such disaster') + begin + RaiseFatalError.call + rescue => e + expect(e.message).to eq('code broken - such disaster') + end end end
Undo the configuration of raising fatal errors for future tests
lml_lev
train
rb
2a3df54858f9c6d8f7643bb90a10620c7df9dc55
diff --git a/src/wtf/data/variable.js b/src/wtf/data/variable.js index <HASH>..<HASH> 100644 --- a/src/wtf/data/variable.js +++ b/src/wtf/data/variable.js @@ -232,7 +232,7 @@ wtf.data.Variable.parseSignature = function(signature) { } if (invalid) { signatureParts = [ - null, 'invalid_' + wtf.data.Variable.invalidCount_++, null, null]; + null, 'invalid_' + wtf.data.Variable.invalidCount_++, null, null]; } var signatureName = signatureParts[1]; // entire name before ()
Fixing lint warning.
google_tracing-framework
train
js
9fec4b77ba2c621452124ed54bc0d92f5f604acb
diff --git a/spyderlib/widgets/projectexplorer.py b/spyderlib/widgets/projectexplorer.py index <HASH>..<HASH> 100644 --- a/spyderlib/widgets/projectexplorer.py +++ b/spyderlib/widgets/projectexplorer.py @@ -230,11 +230,19 @@ class Workspace(object): def _get_project_paths(self): """Return workspace projects root path list""" - return [proj.root_path for proj in self.projects] + # Convert project absolute paths to paths relative to Workspace root + offset = len(self.root_path)+len(os.pathsep) + return [proj.root_path[offset:] for proj in self.projects] def _set_project_paths(self, pathlist): """Set workspace projects root path list""" - for root_path in pathlist: + # Convert paths relative to Workspace root to project absolute paths + for path in pathlist: + if path.startswith(self.root_path): + # do nothing, this is the old Workspace format + root_path = path + else: + root_path = osp.join(self.root_path, path) self.add_project(root_path) project_paths = property(_get_project_paths, _set_project_paths) @@ -253,7 +261,7 @@ class Workspace(object): """Set workspace root path""" if self.name is None: self.name = osp.basename(root_path) - self.root_path = unicode(root_path) + self.root_path = unicode(osp.abspath(root_path)) config_path = self.__get_workspace_config_path() if osp.exists(config_path): self.load()
Project explorer: Workspace is now configured with relative paths, so it can be moved from a location to another and still be opened in Spyder
spyder-ide_spyder
train
py
d84d6cd894440e5e8f7af8d20ac3e11e35f7ba90
diff --git a/AlgorithmSearchBreadthFirst.php b/AlgorithmSearchBreadthFirst.php index <HASH>..<HASH> 100644 --- a/AlgorithmSearchBreadthFirst.php +++ b/AlgorithmSearchBreadthFirst.php @@ -11,22 +11,22 @@ class AlgorithmSearchBreadthFirst{ */ public function getVertices(){ $queue = array($this->vertex); - $mark = array($this->vertex->getId() => true); - $visited = array(); + $mark = array($this->vertex->getId() => true); //to not add vertices twice in array visited + $visited = array(); //visited vertices do{ - $t = array_shift($queue); // get first from queue - $visited[$t->getId()]= $t; + $t = array_shift($queue); // get first from queue + $visited[$t->getId()]= $t; //save as visited - $vertices = $t->getVerticesEdgeTo(); + $vertices = $t->getVerticesEdgeTo(); //get next vertices foreach($vertices as $id=>$vertex){ - if(!isset($mark[$id])){ - $queue[] = $vertex; - $mark[$id] = true; + if(!isset($mark[$id])){ //if not "toughed" before + $queue[] = $vertex; //add to queue + $mark[$id] = true; //and mark } } - }while($queue); + }while($queue); //untill queue is empty return $visited; }
add comments for the allgorithm description
graphp_graph
train
php
c01dcfc2b63e82bf8d94fbdd46518ceddf3d4b00
diff --git a/src/Console/Command/SeederCommand.php b/src/Console/Command/SeederCommand.php index <HASH>..<HASH> 100644 --- a/src/Console/Command/SeederCommand.php +++ b/src/Console/Command/SeederCommand.php @@ -97,6 +97,12 @@ class SeederCommand extends AbstractCommand try { foreach ($seed_collection as $table => $seed) { + if (class_exists($table, true)) { + $instance = app($table); + if ($instance instanceof \Bow\Database\Barry\Model) { + $table = $instance->getTable(); + } + } $n = Database::table($table)->insert($seed); echo Color::green("$n seed".($n > 1 ? 's' : '')." on $table table\n"); diff --git a/src/Support/helper.php b/src/Support/helper.php index <HASH>..<HASH> 100644 --- a/src/Support/helper.php +++ b/src/Support/helper.php @@ -1550,6 +1550,12 @@ if (!function_exists('seed')) { } foreach ($collection as $table => $seed) { + if (class_exists($table, true)) { + $instance = app($table); + if ($instance instanceof \Bow\Database\Barry\Model) { + $table = $instance->getTable(); + } + } DB::table($table)->insert($seed); } }
feat: add model reference to seeder
bowphp_framework
train
php,php
831f7c4253c24d9962a17a21ee18670e0d6e08ef
diff --git a/extensions/yii/apidoc/templates/html/views/constSummary.php b/extensions/yii/apidoc/templates/html/views/constSummary.php index <HASH>..<HASH> 100644 --- a/extensions/yii/apidoc/templates/html/views/constSummary.php +++ b/extensions/yii/apidoc/templates/html/views/constSummary.php @@ -26,7 +26,7 @@ if (empty($type->constants)) { </tr> <?php foreach($type->constants as $constant): ?> <tr<?= $constant->definedBy != $type->name ? ' class="inherited"' : '' ?> id="<?= $constant->name ?>"> - <td><?= $constant->name ?></td> + <td><?= $constant->name ?><a name="<?= $constant->name ?>-detail"></a></td> <td><?= $constant->value ?></td> <td><?= Markdown::process($constant->shortDescription . "\n" . $constant->description, $type) ?></td> <td><?= $this->context->typeLink($constant->definedBy) ?></td>
fixed broken link for contants in api doc
yiisoft_yii2-debug
train
php
29693cd063d44080bfed084945300721716303d6
diff --git a/lenstronomy/ImSim/image_sparse_solve.py b/lenstronomy/ImSim/image_sparse_solve.py index <HASH>..<HASH> 100644 --- a/lenstronomy/ImSim/image_sparse_solve.py +++ b/lenstronomy/ImSim/image_sparse_solve.py @@ -36,6 +36,10 @@ class ImageSparseFit(ImageFit): :param kwargs_sparse_solver: keyword arguments passed to `SparseSolverSource`/`SparseSolverSourceLens`/`SparseSolverSourcePS` module of SLITronomy being applied to the point sources. """ + if kwargs_numerics.get('supersampling_factor', 1) > 1 and kwargs_sparse_solver.get('source_interpolation', 'bilinear') == 'bilinear': + print("WARNING: sparse solver not yet compatible with supersampling of image plane (with bilinear interpolation in source plane). Set to 1 instead!") + kwargs_numerics['supersampling_factor'] = 1 + super(ImageSparseFit, self).__init__(data_class, psf_class, lens_model_class=lens_model_class, source_model_class=source_model_class, lens_light_model_class=lens_light_model_class,
Raises an error for unsupported numerics settings in sparse solver (temporary)
sibirrer_lenstronomy
train
py
da179cba9ef0b99bd45137a759b503f6c5da3bee
diff --git a/staff/views.py b/staff/views.py index <HASH>..<HASH> 100644 --- a/staff/views.py +++ b/staff/views.py @@ -4,7 +4,7 @@ from django.shortcuts import get_object_or_404, render_to_response from django.template import RequestContext from django.template.loader import render_to_string from django.views.decorators.cache import cache_page -from.django.utils import simplejson +from django.utils import simplejson from staff.models import StaffMember
Fixed a strange import bug/typo. how did this not happen before?
callowayproject_django-staff
train
py
1d5458dbb8f25692eed142e36c61acc74ab8718c
diff --git a/source/Setup/Utilities.php b/source/Setup/Utilities.php index <HASH>..<HASH> 100644 --- a/source/Setup/Utilities.php +++ b/source/Setup/Utilities.php @@ -612,7 +612,7 @@ class Utilities extends Core { $facts = new Facts(); - return $this->getUtilitiesInstance()->getVendorDirectory() + return $this->getVendorDirectory() . EditionRootPathProvider::EDITIONS_DIRECTORY . DIRECTORY_SEPARATOR . sprintf(self::DEMODATA_PACKAGE_NAME, strtolower($facts->getEdition()));
OXDEV-<I> Replace instance of Utilities to this No need to get instance of Utilities from Utilities.
OXID-eSales_oxideshop_ce
train
php
07e8166eaf1de4e6f04a0f5a6b66edc58b9e47f4
diff --git a/py3status/modules/vpn_status.py b/py3status/modules/vpn_status.py index <HASH>..<HASH> 100644 --- a/py3status/modules/vpn_status.py +++ b/py3status/modules/vpn_status.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python3 """ Drop-in replacement for i3status run_watch VPN module.
vpn_status: remove shebang because it should depends on OS setting, not to have harcoded usage of python3 via env.
ultrabug_py3status
train
py
8bf03b80e41cbbf2197c7602e4a8cd0c1139d7c1
diff --git a/config/environments/production.rb b/config/environments/production.rb index <HASH>..<HASH> 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -29,11 +29,13 @@ config.action_view.cache_template_loading = true HOST = "gemcutter.org" - -AWS::S3::Base.establish_connection!( - :access_key_id => ENV['S3_KEY'], - :secret_access_key => ENV['S3_SECRET'] -) +config.after_initialize do + require 'aws/s3' + AWS::S3::Base.establish_connection!( + :access_key_id => ENV['S3_KEY'], + :secret_access_key => ENV['S3_SECRET'] + ) +end class ::VaultObject < AWS::S3::S3Object set_current_bucket_to "gemcutter_production"
Trying this in an after initialize now
rubygems_rubygems.org
train
rb
18bb7ad19ff9afa69ce32ecbdfeb1b7202c43766
diff --git a/server/src/main/java/org/openqa/selenium/server/DefaultSeleneseCommand.java b/server/src/main/java/org/openqa/selenium/server/DefaultSeleneseCommand.java index <HASH>..<HASH> 100644 --- a/server/src/main/java/org/openqa/selenium/server/DefaultSeleneseCommand.java +++ b/server/src/main/java/org/openqa/selenium/server/DefaultSeleneseCommand.java @@ -47,7 +47,7 @@ public class DefaultSeleneseCommand implements SeleneseCommand { } public String toString() { - return "|" + command + "|" + field + "|" + value + "|"; + return getCommandURLString(); } /** Factory method to create a SeleneseCommand from a wiki-style input string */
Fixing SRC-<I>; now we don't use the wiki row format to transmit commands to SeleneseRunner, we just send the URI-encoded command which we decode on the client side r<I>
SeleniumHQ_selenium
train
java
715ab5873d5d0e4c13c806bad96daf32dace3119
diff --git a/lib/sauce/selenium.rb b/lib/sauce/selenium.rb index <HASH>..<HASH> 100644 --- a/lib/sauce/selenium.rb +++ b/lib/sauce/selenium.rb @@ -20,6 +20,10 @@ module Sauce @driver.send(meth, *args) end + def session_id + @driver.send(:bridge).session_id + end + def stop @driver.quit end
Session ID is useful when working with Sauce
saucelabs_sauce_ruby
train
rb
d38219a85cf50d65656efa499e2933d94670f2dd
diff --git a/src/main/java/org/jboss/netty/handler/codec/http/HttpClientCodec.java b/src/main/java/org/jboss/netty/handler/codec/http/HttpClientCodec.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jboss/netty/handler/codec/http/HttpClientCodec.java +++ b/src/main/java/org/jboss/netty/handler/codec/http/HttpClientCodec.java @@ -120,11 +120,16 @@ public class HttpClientCodec implements ChannelUpstreamHandler, // current response. HttpMethod method = queue.poll(); - // Successful HEAD and CONNECT result in empty body. + // According to 4.3, RFC2616: + // All responses to the HEAD request method MUST NOT include a + // message-body, even though the presence of entity-header fields + // might lead one to believe they do. + if (HttpMethod.HEAD.equals(method)) { + return true; + } + + // Successful CONNECT result in empty body. if (((HttpResponse) msg).getStatus().getCode() == 200) { - if (HttpMethod.HEAD.equals(method)) { - return true; - } if (HttpMethod.CONNECT.equals(method)) { // Proxy connection established - Not HTTP anymore. done = true;
Fixed a bug where non-successful HEAD response is assumed to have a message body
netty_netty
train
java
19a00a7b84645fc4625020ef2a641d0dc0eef00c
diff --git a/lib/rscons/environment.rb b/lib/rscons/environment.rb index <HASH>..<HASH> 100644 --- a/lib/rscons/environment.rb +++ b/lib/rscons/environment.rb @@ -517,7 +517,22 @@ module Rscons end end call_build_hooks[:pre] - rv = builder.run(target, sources, cache, self, vars) + use_new_run_method_signature = + begin + builder.method(:run).arity == 1 + rescue NameError + false + end + if use_new_run_method_signature + rv = builder.run( + target: target, + sources: sources, + cache: cache, + env: self, + vars: vars) + else + rv = builder.run(target, sources, cache, self, vars) + end call_build_hooks[:post] if rv rv end
prepare to call new Builder#run interface
holtrop_rscons
train
rb
fa90d4f2ff8553214b0e7df3dd64b104c2a55495
diff --git a/lib/discordrb/commands/parser.rb b/lib/discordrb/commands/parser.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/commands/parser.rb +++ b/lib/discordrb/commands/parser.rb @@ -178,7 +178,7 @@ module Discordrb::Commands arg.split ' ' end - chain.slice!(chain_args_index+1..-1) + chain = chain[chain_args_index+1..-1] end [chain_args, chain]
Apparently I misunderstood what slice! does exactly. Fixed
meew0_discordrb
train
rb
c78fffdbd860791ac2c3d54e0682d4cfa2b22289
diff --git a/lib/arpscanner.js b/lib/arpscanner.js index <HASH>..<HASH> 100644 --- a/lib/arpscanner.js +++ b/lib/arpscanner.js @@ -48,7 +48,9 @@ function scanner(cb, options){ var cmd = options.command + ' ' + options.args.join(' '); - if(options.verbose ) console.log(options.sudo ? 'sudo ' : '' + cmd); + if (options.verbose) { + console.log(options.sudo ? 'sudo ' : '' + cmd); + } if (options.sudo) { arp = suspawn(options.command, options.args); } else {
KQ: Use an execution block instead of an inline conditional.
goliatone_arpscan
train
js
9f3c85b484630d59c13c938d0dc65971d04edfa6
diff --git a/src/main/java/org/freecompany/redline/Builder.java b/src/main/java/org/freecompany/redline/Builder.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/freecompany/redline/Builder.java +++ b/src/main/java/org/freecompany/redline/Builder.java @@ -788,6 +788,7 @@ public class Builder { * @param path the absolute path at which this file will be installed. * @param source the file content to include in this rpm. * @param mode the mode of the target file in standard three octet notation + * @param directive directive indicating special handling for this file. * @param uname user owner for the given file * @param gname group owner for the given file @@ -806,6 +807,7 @@ public class Builder { * @param source the file content to include in this rpm. * @param mode the mode of the target file in standard three octet notation, or -1 for default. * @param dirmode the mode of the parent directories in standard three octet notation, or -1 for default. + * @param directive directive indicating special handling for this file. * @param uname user owner for the given file, or null for default user. * @param gname group owner for the given file, or null for default group. * @param addParents whether to create parent directories for the file, defaults to true for other methods.
Show missing 'directive' param in javadoc for relevant Builder.addFile methods
craigwblake_redline
train
java
64c69d0d3927e3af86735ce1513653d2ccf078e0
diff --git a/lib/review/book/base.rb b/lib/review/book/base.rb index <HASH>..<HASH> 100644 --- a/lib/review/book/base.rb +++ b/lib/review/book/base.rb @@ -83,6 +83,8 @@ module ReVIEW def page_metric if config["page_metric"].respond_to?(:downcase) && config["page_metric"].upcase =~ /^[A-Z0-9_]+$/ ReVIEW::Book::PageMetric.const_get(config["page_metric"].upcase) + elsif config["page_metric"].kind_of?(Array) && config["page_metric"].size == 5 + ReVIEW::Book::PageMetric.new(*config["page_metric"]) else config["page_metric"] end diff --git a/test/test_book.rb b/test/test_book.rb index <HASH>..<HASH> 100644 --- a/test/test_book.rb +++ b/test/test_book.rb @@ -571,4 +571,13 @@ EOC assert_equal ReVIEW::Book::PageMetric::B5, book.page_metric end end + + def test_page_metric_config_array + mktmpbookdir('config.yml'=>"bookname: book\npage_metric: [46, 80, 30, 74, 2]\n") do |dir, book, files| + book = Book::Base.new(dir) + config_file = File.join(dir,"config.yml") + book.load_config(config_file) + assert_equal ReVIEW::Book::PageMetric::B5, book.page_metric + end + end end
page_metric in config.yml allows Array as arguments of PageMetric.new
kmuto_review
train
rb,rb
7a4042f3977bb0cb60962bd2c9beb4b55d2e7acd
diff --git a/boilerplate.js b/boilerplate.js index <HASH>..<HASH> 100644 --- a/boilerplate.js +++ b/boilerplate.js @@ -184,7 +184,7 @@ async function install (context) { } if (parameters.options.lint !== 'false') { - await system.spawn(`ignite add standard@"~>0.0.1" ${debugFlag}`, { + await system.spawn(`ignite add standard@"~>1.0.0" ${debugFlag}`, { stdio: 'inherit' }) }
Bumps ignite-standard to <I>
infinitered_ignite-andross
train
js
1d06f6b830aab0f8fdc21e3fcadaee7dde86c2a9
diff --git a/resources/views/formfields/multiple_images.blade.php b/resources/views/formfields/multiple_images.blade.php index <HASH>..<HASH> 100644 --- a/resources/views/formfields/multiple_images.blade.php +++ b/resources/views/formfields/multiple_images.blade.php @@ -4,7 +4,11 @@ @if($images != null) @foreach($images as $image) <div class="image-tool-box" data-field-name="{{ $row->field }}" > - <img src="{{ Voyager::image( $image ) }}" data-image="{{ $image }}" data-id="{{ $dataTypeContent->id }}" /> + <img + src="{{ Voyager::image( $image ) }}" + data-image="{{ $image }}" + data-id="{{ $dataTypeContent->id }}" + /> <div class="image-tools"> <i class="glyphicon glyphicon-remove remove-multi-image" title="Remove image"></i> </div>
Broke img tag in multiple lines
the-control-group_voyager
train
php
dd955f6241c19fcff775cf16d31401c9abeb99d4
diff --git a/scripts/importer/Events.py b/scripts/importer/Events.py index <HASH>..<HASH> 100644 --- a/scripts/importer/Events.py +++ b/scripts/importer/Events.py @@ -72,8 +72,7 @@ class Entry(OrderedDict): break if load_path is None or not os.path.isfile(load_path): - warnings.warn("No path found for name: '{}', path: '{}'".format( - name, path)) + # FIX: is this warning worthy? return None # Create a new `EVENT` instance
MAINT: remove warning when 'path' not found during 'init_from_file'. Happens all the time.
astrocatalogs_astrocats
train
py
3c80b63e5044ca6a48e6f0a9c24e2954f7cc97f5
diff --git a/examples/lab_devices/scpi_devices.py b/examples/lab_devices/scpi_devices.py index <HASH>..<HASH> 100644 --- a/examples/lab_devices/scpi_devices.py +++ b/examples/lab_devices/scpi_devices.py @@ -40,5 +40,5 @@ print dut['Pulser'].get_voltage(0, unit='mV'), 'mV' # Example for device with multiple channels dut = Dut('ttiql335tp_pyvisa.yaml') dut.init() -dut['PowerSupply'].get_info() +dut['PowerSupply'].get_name() dut['PowerSupply'].get_voltage(channel=1) \ No newline at end of file
MAINT/API: get_info is get_name
SiLab-Bonn_basil
train
py
0fe6e48574d82aad5dde1863f3cc196bb88f2be0
diff --git a/lib/metadata.js b/lib/metadata.js index <HASH>..<HASH> 100644 --- a/lib/metadata.js +++ b/lib/metadata.js @@ -142,7 +142,7 @@ exports = module.exports = function Metadata(FfmpegCommand) { , video_stream = /Stream #([0-9\.]+)([a-z0-9\(\)\[\]]*)[:] Video/.exec(stderr) || none , video_codec = /Video: ([\w]+)/.exec(stderr) || none , duration = /Duration: (([0-9]+):([0-9]{2}):([0-9]{2}).([0-9]+))/.exec(stderr) || none - , resolution = /(([0-9]{2,5})x([0-9]{2,5}))/.exec(stderr) || none + , resolution = /Video: .+ (([0-9]{2,5})x([0-9]{2,5}))/.exec(stderr) || none , audio_bitrate = /Audio:(.)*, ([0-9]+) kb\/s/.exec(stderr) || none , sample_rate = /([0-9]+) Hz/i.exec(stderr) || none , audio_codec = /Audio: ([\w]+)/.exec(stderr) || none
Fix for video resolution detection RegEx For me it fails when filename contains a typo like video<I>x<I>.mp4, while video is actually <I>x<I>.
fluent-ffmpeg_node-fluent-ffmpeg
train
js
8aa900c91f2e034c1765fd1f03bf704c79b2dad6
diff --git a/aws/resource_aws_db_instance.go b/aws/resource_aws_db_instance.go index <HASH>..<HASH> 100644 --- a/aws/resource_aws_db_instance.go +++ b/aws/resource_aws_db_instance.go @@ -1398,7 +1398,7 @@ func resourceAwsDbInstanceRead(d *schema.ResourceData, meta interface{}) error { d.Set("availability_zone", v.AvailabilityZone) d.Set("backup_retention_period", v.BackupRetentionPeriod) d.Set("backup_window", v.PreferredBackupWindow) - d.Set("latest_restorable_time", v.LatestRestorableTime.Format(time.RFC3339)) + d.Set("latest_restorable_time", aws.TimeValue(v.LatestRestorableTime).Format(time.RFC3339)) d.Set("license_model", v.LicenseModel) d.Set("maintenance_window", v.PreferredMaintenanceWindow) d.Set("max_allocated_storage", v.MaxAllocatedStorage)
prevent panic from nil time value
terraform-providers_terraform-provider-aws
train
go
3a474346af4406c46d404fc41b7067e747c7ca29
diff --git a/LiSE/LiSE/character.py b/LiSE/LiSE/character.py index <HASH>..<HASH> 100644 --- a/LiSE/LiSE/character.py +++ b/LiSE/LiSE/character.py @@ -31,6 +31,7 @@ from collections import ( ) from operator import ge, gt, le, lt, eq from math import floor +from blinker import Signal import networkx as nx from allegedb.graph import ( @@ -1701,13 +1702,14 @@ class Character(AbstractCharacter, DiGraph, RuleFollower): d[k] = dict(self[k]) return repr(d) - class StatMapping(MutableMapping): + class StatMapping(MutableMapping, Signal): """Caching dict-alike for character stats""" engine = getatt('character.engine') _real = getatt('character.graph') def __init__(self, char): """Store character.""" + super().__init__() self.character = char def __iter__(self): @@ -1727,11 +1729,11 @@ class Character(AbstractCharacter, DiGraph, RuleFollower): def __setitem__(self, k, v): assert(v is not None) self._real[k] = v - self.dispatch(k, v) + self.send(self, key=k, val=v) def __delitem__(self, k): del self._real[k] - self.dispatch(k, None) + self.send(self, key=k, val=None) def facade(self): return Facade(self)
Turn character.StatMapping into a Signal
LogicalDash_LiSE
train
py
bcd8152adc1a463a061b7c7b6285cb0138f79fa6
diff --git a/lib/discordrb/data.rb b/lib/discordrb/data.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/data.rb +++ b/lib/discordrb/data.rb @@ -412,18 +412,11 @@ module Discordrb @server.owner == self end - # @param role [Role, Integer, String] the role to check, its id or name. + # @param role [Role, Integer, #resolve_id] the role to check or its ID. # @return [true, false] whether this member has the specified role. def role?(role) - if role.is_a? Discordrb::Role - @roles.include?(role) - elsif role.is_a? String - @roles.any? { |e| e.name == role } - elsif role.is_a? Integer - @roles.any? { |e| e.id == role } - else - raise ArgumentError - end + role = role.resolve_id + @roles.any? { |e| e.id == role } end # Adds one or more roles to this member.
Revert changes to Member#role?
meew0_discordrb
train
rb
fbcf8a095a57c5961c65da72d50282a42a46f6ab
diff --git a/Entityform/EntityFieldsSolverInterface.php b/Entityform/EntityFieldsSolverInterface.php index <HASH>..<HASH> 100644 --- a/Entityform/EntityFieldsSolverInterface.php +++ b/Entityform/EntityFieldsSolverInterface.php @@ -26,7 +26,7 @@ interface EntityFieldsSolverInterface { /** * Solve a property. * @param \Asgard\Entity\Property $property - * @return \Asgard\Form\Field + * @return \Asgard\Form\Field|\Asgard\Form\GroupInterface */ public function solve(\Asgard\Entity\Property $property);
Entityform: fix solve docblock
asgardphp_asgard
train
php
f4544b9ef85f54ca2285ee3f8b11ec11d7d71120
diff --git a/src/Illuminate/Validation/Validator.php b/src/Illuminate/Validation/Validator.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Validation/Validator.php +++ b/src/Illuminate/Validation/Validator.php @@ -316,6 +316,9 @@ class Validator implements ValidatorContract foreach ($this->rules as $attribute => $rules) { foreach ($rules as $rule) { $this->validate($attribute, $rule); + if ($this->shouldBreakOnFail($attribute)) { + break; + } } } @@ -527,6 +530,33 @@ class Validator implements ValidatorContract } /** + * "Break" on first validation fail. + * + * Always returns true, just lets us put failonfirst in rules. + * + * @return bool + */ + protected function validateFailOnFirst() + { + return true; + } + + /** + * Stop on error if failonfirst rule is given. + * + * @param string $attribute + * @return bool + */ + protected function shouldBreakOnFail($attribute) + { + if (! $this->hasRule($attribute, ['Failonfirst'])) { + return false; + } + + return $this->messages->has($attribute); + } + + /** * Validate that a required attribute exists. * * @param string $attribute
Added 'failonfirst' rule to skip other validation rules if one fails.
laravel_framework
train
php
7bd926f978dad22bd45295e3dabb7115a1218a11
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -41,7 +41,7 @@ var request = require('request'), Q = require('q'), path = require('path'), - conf = require(path.join(process.env.PWD, 'fogbugz.conf.json')), + conf = require(path.join(process.env.PWD || process.cwd(), 'fogbugz.conf.json')), format = require('util').format, extend = require('util')._extend, xml2js = require('xml2js'),
Fix pwd compatibility for Windows
boneskull_node-fogbugz
train
js
a81dfa2644c20183b24f278d890153c3862e93d2
diff --git a/lib/generators/thredded/install/templates/initializer.rb b/lib/generators/thredded/install/templates/initializer.rb index <HASH>..<HASH> 100644 --- a/lib/generators/thredded/install/templates/initializer.rb +++ b/lib/generators/thredded/install/templates/initializer.rb @@ -73,3 +73,17 @@ Thredded.layout = 'thredded' # Where carrierwave will be storing its files - on the cloud, or filesystem. # Configure :fog with your own carrierwave initializer. Thredded.file_storage = Rails.env.production? ? :fog : :file + +# ==> Theme Configuration +# Thredded can easily switch between different views and assets by changing +# the theme via `Thredded.theme`. If you set the theme to be `my_custom_theme` +# it will look for its view files in `app/themes/my_custom_theme/`. +# +# To copy the theme files from the gem to your parent application, run the +# rails generator that will copy the files over. EG: +# +# `rails g thredded:theme:install base` +# +# And set your theme in this initializer: +# +# Thredded.theme = 'base'
[JRO] Add configuration info for themes
thredded_thredded
train
rb
43c07c6d8b6767dcb7faedc4eb855bce085462df
diff --git a/lib/charged.js b/lib/charged.js index <HASH>..<HASH> 100644 --- a/lib/charged.js +++ b/lib/charged.js @@ -264,12 +264,12 @@ Charged.prototype.getStatement = function(name, callback) { return this.get(path, callback, 'statement'); }; -Charged.prototype.getStatementPDF = function(name) { +Charged.prototype.getStatementPDF = function(name, callback) { return this.request({ path: '/statements/' + escape(name), ext: '.pdf', - stream: true - }); + raw: true + }, callback); }; Charged.prototype.saveStatementPDF = function(name, path, callback) { @@ -1389,7 +1389,7 @@ Charged.prototype.request = function(options, callback) { , path = options.path , body = options.body , method = options.method - , stream = options.stream + , raw = options.raw , format = options.format , ext = options.ext || '.json' , cb = callback; @@ -1436,7 +1436,12 @@ Charged.prototype.request = function(options, callback) { if (method === 'GET') delete options.json; //if (method === 'DELETE') delete options.json; - if (stream) return request(options); + if (raw) { + options.encoding = null; + return cb + ? request(options, cb) + : request(options); + } return request(options, function(err, res, body) { if (err) {
allow buffering of statement pdfs.
chjj_charged
train
js
406a6081da0e5bf79f9b23e90b50e115f521f4e1
diff --git a/lib/uber/api/activities.rb b/lib/uber/api/activities.rb index <HASH>..<HASH> 100644 --- a/lib/uber/api/activities.rb +++ b/lib/uber/api/activities.rb @@ -7,7 +7,7 @@ module Uber module Activities def history(*args) arguments = Uber::Arguments.new(args) - perform_with_object(:get, "/v1.1/history", arguments.options, Activity) + perform_with_object(:get, "/v1.2/history", arguments.options, Activity) end end end diff --git a/lib/uber/models/activity.rb b/lib/uber/models/activity.rb index <HASH>..<HASH> 100644 --- a/lib/uber/models/activity.rb +++ b/lib/uber/models/activity.rb @@ -8,7 +8,7 @@ module Uber end class History < Base - attr_accessor :uuid, :request_time, :product_id, :status, :distance, :start_time, :end_time + attr_accessor :uuid, :request_time, :product_id, :status, :distance, :start_time, :end_time, :start_city def request_time=(value) @request_time = ::Time.at(value)
Changed api/activities.rb from <I> to <I> and added :start_city attr_accessor to models/activity.rb
sishen_uber-ruby
train
rb,rb
155bb666b915bb85664b5d42ea37e74d556ac512
diff --git a/src/Mainio/C5/Twig/Factory.php b/src/Mainio/C5/Twig/Factory.php index <HASH>..<HASH> 100644 --- a/src/Mainio/C5/Twig/Factory.php +++ b/src/Mainio/C5/Twig/Factory.php @@ -58,7 +58,7 @@ class Factory public static function createEnvironment($paths, \Symfony\Component\Translation\Translator $translator, $options = array()) { $viewPath = $paths['base'] . '/' . DIRNAME_VIEWS; - $twigBridgePath = $paths['lib'] . '/symfony/twig-bridge'; + $twigBridgePath = $paths['lib'] . '/symfony/twig-bridge/Symfony/Bridge/Twig'; $opts = array(); if (Config::get('app.twig_debug')) { @@ -92,4 +92,4 @@ class Factory return $twig; } -} \ No newline at end of file +}
Fixed twig bridge path Issue with mixmatch versions of twig libraries.
mainio_c5pkg_twig_templates
train
php
355520dae017daf74505702a842443ff297dad06
diff --git a/MySQLdb/connections.py b/MySQLdb/connections.py index <HASH>..<HASH> 100644 --- a/MySQLdb/connections.py +++ b/MySQLdb/connections.py @@ -195,13 +195,6 @@ class Connection(_mysql.connection): self.cursorclass = cursorclass self.encoders = {k: v for k, v in conv.items() if type(k) is not int} - # XXX THIS IS GARBAGE: While this is just a garbage and undocumented, - # Django 1.11 depends on it. And they don't fix it because - # they are in security-only fix mode. - # So keep this garbage for now. This will be removed in 1.5. - # See PyMySQL/mysqlclient-python#306 - self.encoders[bytes] = bytes - self._server_version = tuple( [numeric_part(n) for n in self.get_server_info().split(".")[:2]] )
Remove bytes encoder that was specifically for Django <I> (#<I>)
PyMySQL_mysqlclient-python
train
py
7aac02881ffb536c6ee3de4c78959a8f1e32e5d6
diff --git a/lib/dcell/node.rb b/lib/dcell/node.rb index <HASH>..<HASH> 100644 --- a/lib/dcell/node.rb +++ b/lib/dcell/node.rb @@ -13,7 +13,9 @@ module DCell state :disconnected, to: [:connected, :shutdown] state :connected do send_heartbeat - transition :partitioned, delay: @heartbeat_timeout + unless id == DCell.id + transition :partitioned, delay: @heartbeat_timeout + end Logger.info "Connected to #{id}" end state :partitioned do
do not disconnect from self as heartbeat is not used
celluloid_dcell
train
rb
e5d71831a19f9a59cf757b4e2bd25b2af32f1611
diff --git a/lib/services/api/messages.rb b/lib/services/api/messages.rb index <HASH>..<HASH> 100644 --- a/lib/services/api/messages.rb +++ b/lib/services/api/messages.rb @@ -26,6 +26,16 @@ module VCAP optional :description, String optional :info_url, URI::regexp(%w(http https)) optional :tags, [String] + optional :plan_details do + [ + { + "name" => String, + "free" => bool, + optional("description") => String, + optional("extra") => String, + } + ] + end optional :plans, [String] optional :plan_descriptions optional :cf_plan_id
Add plan_details key to the ServiceOfferingRequest [#<I>]
cloudfoundry_vcap-common
train
rb
52979662c577574adfabfa962067343104db1d2f
diff --git a/lib/express/server.js b/lib/express/server.js index <HASH>..<HASH> 100644 --- a/lib/express/server.js +++ b/lib/express/server.js @@ -118,8 +118,30 @@ Server.prototype.use = function(route, middleware){ return this; }; +/** + * Assign a callback `fn` which is called + * when this `Server` is passed to `Server#use()`. + * + * Examples: + * + * var app = express.createServer(), + * blog = express.createServer(); + * + * blog.mounted(function(parent){ + * // parent is app + * // "this" is blog + * }); + * + * app.use(blog); + * + * @param {Function} fn + * @return {Server} for chaining + * @api public + */ + Server.prototype.mounted = function(fn){ this.__mounted = fn; + return this; }; /**
Added docs for Server#mounted()
expressjs_express
train
js
457b66fb520a7f9360e5a528ac33780344aa498c
diff --git a/dist/lovefield.js b/dist/lovefield.js index <HASH>..<HASH> 100644 --- a/dist/lovefield.js +++ b/dist/lovefield.js @@ -5922,7 +5922,7 @@ goog.asserts.assertBoolean = function(value, opt_message, var_args) { * @param {...*} var_args The items to substitute into the failure message. * @return {!Element} The value, likely to be a DOM Element when asserts are * enabled. - * @throws {goog.asserts.AssertionError} When the value is not a boolean. + * @throws {goog.asserts.AssertionError} When the value is not an Element. */ goog.asserts.assertElement = function(value, opt_message, var_args) { if (goog.asserts.ENABLE_ASSERTS && (!goog.isObject(value) ||
Closure library change, affects lovefield.js only. ------------- Created by MOE: <URL>
google_lovefield
train
js
9f379bbf78fcc1af1714c4a6c6f2afe172e0ed05
diff --git a/setuptools/package_index.py b/setuptools/package_index.py index <HASH>..<HASH> 100755 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -30,7 +30,6 @@ __metaclass__ = type EGG_FRAGMENT = re.compile(r'^egg=([-A-Za-z0-9_.+!]+)$') HREF = re.compile(r"""href\s*=\s*['"]?([^'"> ]+)""", re.I) -# this is here to fix emacs' cruddy broken syntax highlighting PYPI_MD5 = re.compile( r'<a href="([^"#]+)">([^<]+)</a>\n\s+\(<a (?:title="MD5 hash"\n\s+)' r'href="[^?]+\?:action=show_md5&amp;digest=([0-9a-f]{32})">md5</a>\)'
Remove stale comment, added in 8cc0d5c2 and made meaningless in <I>eee<I>.
pypa_setuptools
train
py
b2e809ff8bbbb8001e32032792bf1d969b587dc9
diff --git a/Block/TreeBlockService.php b/Block/TreeBlockService.php index <HASH>..<HASH> 100644 --- a/Block/TreeBlockService.php +++ b/Block/TreeBlockService.php @@ -17,6 +17,7 @@ use Sonata\BlockBundle\Block\BlockContextInterface; use Sonata\BlockBundle\Model\BlockInterface; use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\OptionsResolver\Options; use Symfony\Component\OptionsResolver\OptionsResolver; class TreeBlockService extends BaseBlockService
add use statement for Options (#<I>)
sonata-project_SonataDoctrinePhpcrAdminBundle
train
php