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
3060a3576f2a671f71868bcd5c8d6cd8fc7987dd
diff --git a/lib/gollum/public/gollum/javascript/editor/gollum.editor.js b/lib/gollum/public/gollum/javascript/editor/gollum.editor.js index <HASH>..<HASH> 100755 --- a/lib/gollum/public/gollum/javascript/editor/gollum.editor.js +++ b/lib/gollum/public/gollum/javascript/editor/gollum.editor.js @@ -217,7 +217,15 @@ type: 'POST', success: function(){ $editorBody.removeClass('uploading'); - var text = '[[/' + uploadDest + '/' + file.name + ']]'; + var ext = file.name.split('.').pop().toLowerCase() + var image_ext = ['jpg', 'jpeg', 'tif', 'tiff', 'png', 'gif', 'svg', 'bmp'] + // Link directly to image files + if ((image_ext.indexOf(ext) > -1)) { + var text = '[[/' + uploadDest + '/' + file.name + ']]'; + } else { + // Add file name to tag for non-image files, to avoid broken image thumbnail + var text = '[[' + file.name + '|/' + uploadDest + '/' + file.name + ']]'; + } window.ace_editor.insert(text); }, error: function(r, textStatus) {
Handle non-image uploads correctly
gollum_gollum
train
js
e0f4d66aeb0c5a5488691e87bc1814c7179bfe35
diff --git a/src/DataSource.js b/src/DataSource.js index <HASH>..<HASH> 100644 --- a/src/DataSource.js +++ b/src/DataSource.js @@ -167,6 +167,10 @@ function DataSourceInput(ds) { ds._data = ds._data.concat(delta.add); } + if (delta.sort) { + ds._data.sort(delta.sort); + } + // if reflowing, add any other tuples not currently in changeset if (input.reflow) { delta.mod = delta.mod.concat(
DataSourceInput should apply sort function. For example, if the delta is populated by DataSourceListener.
vega_vega-dataflow
train
js
ed4cc4d8561c63b86950313ee4d553f6958223ef
diff --git a/go/vt/vtgate/planbuilder/route.go b/go/vt/vtgate/planbuilder/route.go index <HASH>..<HASH> 100644 --- a/go/vt/vtgate/planbuilder/route.go +++ b/go/vt/vtgate/planbuilder/route.go @@ -37,11 +37,6 @@ var _ logicalPlan = (*route)(nil) type route struct { gen4Plan - // Redirect may point to another route if this route - // was merged with it. The Resolve function chases - // this pointer till the last un-redirected route. - Redirect *route - // Select is the AST for the query fragment that will be // executed by this route. Select sqlparser.SelectStatement
refactor: remove unused field
vitessio_vitess
train
go
356e5e02dc931d1fc48656c20582b1dc92918e4a
diff --git a/test/test_server.rb b/test/test_server.rb index <HASH>..<HASH> 100644 --- a/test/test_server.rb +++ b/test/test_server.rb @@ -1,7 +1,7 @@ require 'helper' class TestServer < Test::Unit::TestCase - should "probably rename this file and start testing for real" do - flunk "hey buddy, you should probably rename this file and start testing for real" + should "run the test suite successfully" do + assert_equal 4, 2*2 end end
Fixed unit test to assert true until I can start writing actual unit tests
rex_server-gem
train
rb
53482c2cf26dac4b5c1c4fa79e506f0224634357
diff --git a/mapillary_tools/uploader.py b/mapillary_tools/uploader.py index <HASH>..<HASH> 100644 --- a/mapillary_tools/uploader.py +++ b/mapillary_tools/uploader.py @@ -512,7 +512,7 @@ def upload_file(filepath, root, url, permission, signature, key=None): else: s3_key = key + s3_filename - parameters = {"key": s3_key, "AWSAccessKeyId": "AKIAI2X3BJAT2W75HILA", "acl": "private", + parameters = {"key": s3_key, "AWSAccessKeyId": "AKIAILU27ZWSOZX2FZ7Q", "acl": "private", "policy": permission, "signature": signature, "Content-Type": "image/jpeg"} with open(filepath, "rb") as f:
fix: update key for s3 upload
mapillary_mapillary_tools
train
py
92ccbfeb67d251cf9134b921460d6800346f4c50
diff --git a/Service/Import/ImportManager.php b/Service/Import/ImportManager.php index <HASH>..<HASH> 100644 --- a/Service/Import/ImportManager.php +++ b/Service/Import/ImportManager.php @@ -14,6 +14,7 @@ namespace ONGR\TranslationsBundle\Service\Import; use Elasticsearch\Common\Exceptions\BadRequest400Exception; use ONGR\ElasticsearchBundle\Service\Manager; use ONGR\ElasticsearchBundle\Service\Repository; +use ONGR\ElasticsearchDSL\Query\MatchQuery; use ONGR\TranslationsBundle\Document\Message; use ONGR\TranslationsBundle\Document\Translation; use Symfony\Component\Finder\Finder; @@ -126,9 +127,10 @@ class ImportManager { foreach ($this->translations as $domain => $keys) { foreach ($keys as $key => $transMeta) { - $document = $this->translationsRepo->findOneBy(['key' => $key]); - - if ($document) { + $search = $this->translationsRepo->createSearch(); + $search->addQuery(new MatchQuery('key', $key)); + $results = $this->translationsRepo->findDocuments($search); + if (count($results)) { continue; }
use search with match instead of query string
ongr-io_TranslationsBundle
train
php
81144395ba14d6b38ad86ce07a299527374fabc2
diff --git a/cmd/minikube/cmd/config/config.go b/cmd/minikube/cmd/config/config.go index <HASH>..<HASH> 100644 --- a/cmd/minikube/cmd/config/config.go +++ b/cmd/minikube/cmd/config/config.go @@ -176,6 +176,12 @@ var settings = []Setting{ callbacks: []setFn{EnableOrDisableAddon}, }, { + name: "insecure-registry", + set: SetBool, + validations: []setFn{IsValidAddon}, + callbacks: []setFn{EnableOrDisableAddon}, + }, + { name: "registry", set: SetBool, validations: []setFn{IsValidAddon},
[FEATURE] allow to set container-runtime via config
kubernetes_minikube
train
go
8e6a53229cfacd7b67824a6ebf994a011db86a3b
diff --git a/lib/httpServer/transports/http/index.js b/lib/httpServer/transports/http/index.js index <HASH>..<HASH> 100644 --- a/lib/httpServer/transports/http/index.js +++ b/lib/httpServer/transports/http/index.js @@ -626,7 +626,7 @@ function requestHandler(req, res) { if (isAsterisk) { path = '*'; } else { - urlInfo = url.parse(req.url, true, true); + urlInfo = url.parse(req.url, true); path = safeDecodePath(urlInfo.pathname); route = routers.http.get(path);
url.parse: slashesDenoteHost should be false URL paths should never include a host; therefore, this option is not needed. Solves an issue where double-slashes prefixed calls would return <I> instead of being properly routed.
mage_mage
train
js
7aff0dd2694146d437bbc9a269713ae70d35ae4f
diff --git a/cirq/circuits/circuit.py b/cirq/circuits/circuit.py index <HASH>..<HASH> 100644 --- a/cirq/circuits/circuit.py +++ b/cirq/circuits/circuit.py @@ -2004,8 +2004,8 @@ class Circuit(AbstractCircuit): """Inserts operations inline at frontier. Args: - operations: the operations to insert - start: the moment at which to start inserting the operations + operations: The operations to insert. + start: The moment at which to start inserting the operations. frontier: frontier[q] is the earliest moment in which an operation acting on qubit q can be placed. """ diff --git a/cirq/circuits/qasm_output.py b/cirq/circuits/qasm_output.py index <HASH>..<HASH> 100644 --- a/cirq/circuits/qasm_output.py +++ b/cirq/circuits/qasm_output.py @@ -167,6 +167,18 @@ class QasmOutput: precision: int = 10, version: str = '2.0', ) -> None: + """Representation of a circuit in QASM format. + + Args: + operations: Tree of operations to insert. + qubits: The qubits used in the operations. + header: A multi-line string that is placed in a comment at the top + of the QASM. + precision: The number of digits after the decimal to show for + numbers in the QASM code. + version: The QASM version to target. Objects may return different + QASM depending on version. + """ self.operations = tuple(ops.flatten_to_ops(operations)) self.qubits = qubits self.header = header
Add docstring for cirq.QasmOutput (#<I>) Adds docstring for `cirq.QasmOutput` and fixes formatting. Fixes #<I>.
quantumlib_Cirq
train
py,py
1c3b0cdaf3ee7190b34b0107462928456103371b
diff --git a/lib/command/CommandClient.js b/lib/command/CommandClient.js index <HASH>..<HASH> 100644 --- a/lib/command/CommandClient.js +++ b/lib/command/CommandClient.js @@ -237,7 +237,8 @@ class CommandClient extends Client { } catch(err) {} // eslint-disable-line no-empty break; } - case "edit": { + case "edit": + default: { try { const resp = await action.execute(msg, activeMessage.args, userID); if(resp != null) {
Handle un-typed reaction buttons
abalabahaha_eris
train
js
5afd1c3dcfac3ea6f9995ad1d89af179039f0b62
diff --git a/src/main/java/org/opensextant/solrtexttagger/TermPrefixCursor.java b/src/main/java/org/opensextant/solrtexttagger/TermPrefixCursor.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/opensextant/solrtexttagger/TermPrefixCursor.java +++ b/src/main/java/org/opensextant/solrtexttagger/TermPrefixCursor.java @@ -77,7 +77,7 @@ class TermPrefixCursor { } else { // subsequent advance //append to existing assert !bufNeedsToBeCopied; - prefixBuf.grow(1 + word.length); + prefixBuf.grow(prefixBuf.length + 1 + word.length); prefixBuf.bytes[prefixBuf.length++] = SEPARATOR_CHAR; prefixBuf.append(word); if (seekPrefix()) {
Fixed ArrayIndexOutOfBoundsException reported by @mubaldino due to the prefixBuf array not growing sufficiently large.
OpenSextant_SolrTextTagger
train
java
1bc8b702ca40ec9f912539cecdb00b61a3109c78
diff --git a/src/Composer/Repository/Vcs/GitDriver.php b/src/Composer/Repository/Vcs/GitDriver.php index <HASH>..<HASH> 100644 --- a/src/Composer/Repository/Vcs/GitDriver.php +++ b/src/Composer/Repository/Vcs/GitDriver.php @@ -154,9 +154,9 @@ class GitDriver extends VcsDriver if (null === $this->tags) { $this->tags = array(); - $this->process->execute('git show-ref --tags', $output, $this->repoDir); + $this->process->execute('git show-ref --tags --dereference', $output, $this->repoDir); foreach ($output = $this->process->splitLines($output) as $tag) { - if ($tag && preg_match('{^([a-f0-9]{40}) refs/tags/(\S+)$}', $tag, $match)) { + if ($tag && preg_match('{^([a-f0-9]{40}) refs/tags/(\S+?)(\^\{\})?$}', $tag, $match)) { $this->tags[$match[2]] = $match[1]; } }
Fix handling of annotated tags and prefer them over lightweight tags, fixes #<I>
composer_composer
train
php
9e6a3530cbc5439bc80afb647071cdda001ea4c5
diff --git a/src/Asserts/EloquentAsserts.php b/src/Asserts/EloquentAsserts.php index <HASH>..<HASH> 100644 --- a/src/Asserts/EloquentAsserts.php +++ b/src/Asserts/EloquentAsserts.php @@ -92,7 +92,7 @@ trait EloquentAsserts $this->assertInstanceOf(BelongsTo::class, $belongsToRelation); $parentModel = $belongsToRelation->getRelated(); - $parentKey = $belongsToRelation->getOwnerKey(); + $parentKey = $parentModel->getKeyName(); $childForeignKey = $belongsToRelation->getForeignKey(); $parent = factory(get_class($parentModel))->create();
ITT: `assertEloquentBelongsTo` minor refactorings.
dmitry-ivanov_laravel-testing-tools
train
php
0400660264c26e7f36c9c87a3d2c769c396bc668
diff --git a/src/HTML5DOMDocument.php b/src/HTML5DOMDocument.php index <HASH>..<HASH> 100644 --- a/src/HTML5DOMDocument.php +++ b/src/HTML5DOMDocument.php @@ -107,7 +107,7 @@ class HTML5DOMDocument extends \DOMDocument $source = preg_replace('/&([a-zA-Z]*);/', 'html5-dom-document-internal-entity1-$1-end', $source); $source = preg_replace('/&#([0-9]*);/', 'html5-dom-document-internal-entity2-$1-end', $source); - $result = parent::loadHTML('<?xml encoding="utf-8" ?>' . $source, $options | LIBXML_NOENT); + $result = parent::loadHTML('<?xml encoding="utf-8" ?>' . $source, $options); if ($internalErrorsOptionValue === false) { libxml_use_internal_errors(false); }
LIBXML_NOENT is now not added by default.
ivopetkov_html5-dom-document-php
train
php
57ef70191c88bb09f5c1ad8610db9226f855c638
diff --git a/js/browser.js b/js/browser.js index <HASH>..<HASH> 100644 --- a/js/browser.js +++ b/js/browser.js @@ -1807,6 +1807,11 @@ Browser.prototype.xfrmTier = function(tier, x , xs) { // Browser.prototype.spaceCheck = function(dontRefresh) { + if (!this.knownSpace || this.knownSpace.chr !== this.chr) { + this.refresh(); + return; + } + var width = ((this.viewEnd - this.viewStart)|0) + 1; var minExtraW = (width * this.minExtra) | 0; var maxExtraW = (width * this.maxExtra) | 0; @@ -1922,7 +1927,7 @@ Browser.prototype.setLocation = function(newMin, newMax, newChr) { this.updateRegion(); this.karyo.update(this.chr, this.viewStart, this.viewEnd); - this.refresh(); + this.spaceCheck(); this.xfrmTiers(this.tabMargin - ((1.0 * (this.viewStart - this.origin)) * this.scale), 1); // FIXME currently needed to set the highlight (!) this.storeStatus(); }
setLocation now does a spaceCheck instead of a refresh.
dasmoth_dalliance
train
js
92ba3048e66fd60974393f92e3c2f8bbf61c9b95
diff --git a/tilequeue/query/rawr.py b/tilequeue/query/rawr.py index <HASH>..<HASH> 100644 --- a/tilequeue/query/rawr.py +++ b/tilequeue/query/rawr.py @@ -1,5 +1,6 @@ from collections import namedtuple, defaultdict from shapely.geometry import box +from shapely.geometry import MultiLineString from shapely.geometry.polygon import orient from shapely.wkb import loads as wkb_loads from tilequeue.query.common import layer_properties @@ -603,7 +604,6 @@ def _lines_only(shape): between a line and a polygon. The main idea is to remove points, and any other geometry which might throw a wrench in the works. """ - from shapely.geometry import MultiLineString lines = _explode_lines(shape) if len(lines) == 1:
Move MultiLineString import to top.
tilezen_tilequeue
train
py
3a73f39a2d181356b5df7def4085b0d15f8ad9c6
diff --git a/lib/weechat/utilities.rb b/lib/weechat/utilities.rb index <HASH>..<HASH> 100644 --- a/lib/weechat/utilities.rb +++ b/lib/weechat/utilities.rb @@ -14,8 +14,17 @@ module Weechat return Weechat::WEECHAT_RC_OK end def self.apply_transformation(property, value, transformations) - transformation = transformations.find {|properties, transformation| - properties.include?(property.to_sym) + transformation = transformations.find {|properties, transformations| + properties.any? {|prop| + case prop + when Regexp + prop =~ property.to_s + when String, Symbol + prop.to_sym == property.to_sym + else + false + end + } } if transformation
refactored transformations to also support regexps
dominikh_weechat-ruby
train
rb
ed8e89a60c827f807bbd9caecd08662a25f4776d
diff --git a/cmd/torrent/main.go b/cmd/torrent/main.go index <HASH>..<HASH> 100644 --- a/cmd/torrent/main.go +++ b/cmd/torrent/main.go @@ -27,8 +27,16 @@ var ( upload = flag.Bool("upload", true, "upload data to peers") ) +func usage() { + fmt.Fprintf(os.Stderr, "Usage: %s [flags] (magnet URI or .torrent file path)...\n", os.Args[0]) + os.Stderr.WriteString("Download using the BitTorrent network.\n") + + flag.PrintDefaults() +} + func main() { log.SetFlags(log.LstdFlags | log.Lshortfile) + flag.Usage = usage flag.Parse() client, err := torrent.NewClient(&torrent.Config{ DataDir: *downloadDir,
cmd/torrent: Nicer usage
anacrolix_torrent
train
go
c766217dd58db51b29338367773ac9f84d605d16
diff --git a/debugtools/templatetags/debug_tags.py b/debugtools/templatetags/debug_tags.py index <HASH>..<HASH> 100644 --- a/debugtools/templatetags/debug_tags.py +++ b/debugtools/templatetags/debug_tags.py @@ -6,6 +6,7 @@ __author__ = "Diederik van der Boor" __license__ = "Apache License, Version 2" from django.core import context_processors +from django.core.exceptions import ObjectDoesNotExist from django.core.serializers import serialize from django.db.models.query import QuerySet from django.forms.forms import BoundField @@ -123,13 +124,13 @@ def _dump_var(object): if isinstance(value, property): try: attrs[name] = getattr(object, name) - except (TypeError, AttributeError) as e: + except (TypeError, AttributeError, ObjectDoesNotExist) as e: attrs[name] = e # Include representations which are relevant in template context. try: attrs['__str__'] = smart_str(object) # smart_str() avoids crashes because of unicode chars. - except (TypeError, AttributeError) as e: + except (TypeError, AttributeError, ObjectDoesNotExist) as e: attrs['__str__'] = e if hasattr(object, '__iter__'):
Trap ObjectDoesNotExist as well, to print inherited models properly.
edoburu_django-debugtools
train
py
691005f19de763457443cdf09afcb430c78f18b7
diff --git a/pymatgen/io/cif.py b/pymatgen/io/cif.py index <HASH>..<HASH> 100644 --- a/pymatgen/io/cif.py +++ b/pymatgen/io/cif.py @@ -31,10 +31,6 @@ from pymatgen.electronic_structure.core import Magmom from pymatgen.core.operations import MagSymmOp from pymatgen.symmetry.maggroups import MagneticSpaceGroup -try: - from pybtex.database import BibliographyData, Entry -except ImportError: - BibliographyData, Entry = None, None """ Wrapper classes for Cif input and output from Structures. @@ -1111,7 +1107,6 @@ class CifParser: raise ValueError("Invalid cif file with no structures!") return structures - @requires(BibliographyData, "Bibliographic data extraction requires pybtex.") def get_bibtex_string(self): """ Get BibTeX reference from CIF file. @@ -1119,6 +1114,11 @@ class CifParser: :return: BibTeX string """ + try: + from pybtex.database import BibliographyData, Entry + except ImportError: + raise RuntimeError("Bibliographic data extraction requires pybtex.") + bibtex_keys = {'author': ('_publ_author_name', '_citation_author_name'), 'title': ('_publ_section_title', '_citation_title'), 'journal': ('_journal_name_full', '_journal_name_abbrev',
Move pybtex import into get_bibtex_string and simply fail instead of having a warning. Fixes #<I>
materialsproject_pymatgen
train
py
e4116b32c5878aca536553516c66acbb15d4e706
diff --git a/galpy/df/quasiisothermaldf.py b/galpy/df/quasiisothermaldf.py index <HASH>..<HASH> 100644 --- a/galpy/df/quasiisothermaldf.py +++ b/galpy/df/quasiisothermaldf.py @@ -1757,7 +1757,7 @@ class quasiisothermaldf(df): if self._voSet: out[:,2:5]= units.Quantity(out[:,2:5]*self._vo,unit=units.km/units.s) if self._roSet: - out[:,0:2]= units.Quantity(out[:,0:2]*self._ro,unit=units.km) + out[:,0:2]= units.Quantity(out[:,0:2]*self._ro,unit=units.kpc) return out @actionAngle_physical_input
fixed an error with R in unit of kpc
jobovy_galpy
train
py
7dc7911f7f53e862d55002c23bbf01293a28c581
diff --git a/lib/middleware.js b/lib/middleware.js index <HASH>..<HASH> 100644 --- a/lib/middleware.js +++ b/lib/middleware.js @@ -110,7 +110,7 @@ module.exports = function(options){ fs.writeFile(cssPath, css, 'utf8', next); }); }, { - include_paths: [ sassDir ].concat(options.include_paths || []), + include_paths: [ sassDir ].concat(options.include_paths || options.includePaths || []), output_style: options.output_style || options.outputStyle }); });
added support for includePaths as well as include_paths to middleware.js
sass_node-sass
train
js
94ca15767d05ffdd084b3451ded0930b80f47fc5
diff --git a/lib/jss.rb b/lib/jss.rb index <HASH>..<HASH> 100644 --- a/lib/jss.rb +++ b/lib/jss.rb @@ -52,7 +52,7 @@ module JSS require 'digest' require 'yaml' require 'open3' - require 'english' + require 'English' ################### ### Gems
Update jss.rb for immediate release
PixarAnimationStudios_ruby-jss
train
rb
fc8b246109760714a838f4be163cca1dbb998163
diff --git a/rlp/encode.go b/rlp/encode.go index <HASH>..<HASH> 100644 --- a/rlp/encode.go +++ b/rlp/encode.go @@ -45,12 +45,6 @@ type Encoder interface { EncodeRLP(io.Writer) error } -// ListSize returns the encoded size of an RLP list with the given -// content size. -func ListSize(contentSize uint64) uint64 { - return uint64(headsize(contentSize)) + contentSize -} - // Encode writes the RLP encoding of val to w. Note that Encode may // perform many small writes in some cases. Consider making w // buffered. diff --git a/rlp/raw.go b/rlp/raw.go index <HASH>..<HASH> 100644 --- a/rlp/raw.go +++ b/rlp/raw.go @@ -28,6 +28,12 @@ type RawValue []byte var rawValueType = reflect.TypeOf(RawValue{}) +// ListSize returns the encoded size of an RLP list with the given +// content size. +func ListSize(contentSize uint64) uint64 { + return uint64(headsize(contentSize)) + contentSize +} + // Split returns the content of first RLP value and any // bytes after the value as subslices of b. func Split(b []byte) (k Kind, content, rest []byte, err error) {
rlp: move ListSize to raw.go
ethereum_go-ethereum
train
go,go
bf64f59c60b2fcdf6f113e4bcebe563b96ee79d0
diff --git a/build/transpile.js b/build/transpile.js index <HASH>..<HASH> 100644 --- a/build/transpile.js +++ b/build/transpile.js @@ -33,12 +33,14 @@ const commonRegexes = [ [ /\.deepExtend\s/g, '.deep_extend'], [ /\.safeFloat2\s/g, '.safe_float_2'], [ /\.safeInteger2\s/g, '.safe_integer_2'], + [ /\.safeIntegerProduct2\s/g, '.safe_integer_product_2'], [ /\.safeString2\s/g, '.safe_string_2'], [ /\.safeStringLower2\s/g, '.safe_string_lower_2'], [ /\.safeStringUpper2\s/g, '.safe_string_upper_2'], [ /\.safeValue2\s/g, '.safe_value_2'], [ /\.safeFloat\s/g, '.safe_float'], [ /\.safeInteger\s/g, '.safe_integer'], + [ /\.safeIntegerProduct\s/g, '.safe_integer_product'], [ /\.safeString\s/g, '.safe_string'], [ /\.safeStringLower\s/g, '.safe_string_lower'], [ /\.safeStringUpper\s/g, '.safe_string_upper'],
added safeIntegerProduct, safeIntegerProduct2 to build/transpile.js
ccxt_ccxt
train
js
1af3ee14f8fc77c754d6a787026dddd73de19ce7
diff --git a/girder/models/item.py b/girder/models/item.py index <HASH>..<HASH> 100644 --- a/girder/models/item.py +++ b/girder/models/item.py @@ -319,7 +319,8 @@ class Item(acl_mixin.AccessControlMixin, Model): item['meta'] = {} for field in fields: - del item['meta'][field] + if field in item['meta']: + del item['meta'][field] item['updated'] = datetime.datetime.utcnow()
Ignore deletion fields that are not present in the metadata
girder_girder
train
py
ae247b0e35752951a87986a58fad2500147409b7
diff --git a/src/Traits/HasTranslations.php b/src/Traits/HasTranslations.php index <HASH>..<HASH> 100644 --- a/src/Traits/HasTranslations.php +++ b/src/Traits/HasTranslations.php @@ -70,4 +70,15 @@ trait HasTranslations return array_replace(parent::attributesToArray(), array_combine($keys, $values)); } + + /** + * Merge new translatable with existing translatable on the model. + * + * @param array $translatable + * @return void + */ + public function mergeTranslatable($translatable) + { + $this->translatable = array_merge($this->translatable, $translatable); + } }
Update HasTranslations.php (#<I>) This method allow merge translatable from extend class. It works like mergeCasts or mergeFillable methods.
rinvex_laravel-support
train
php
de2305439f10fdae8262310c4a0d3986d8bb3605
diff --git a/lap/tests/test_arr_loop.py b/lap/tests/test_arr_loop.py index <HASH>..<HASH> 100755 --- a/lap/tests/test_arr_loop.py +++ b/lap/tests/test_arr_loop.py @@ -34,6 +34,7 @@ def prepare_sparse_cost(shape, cc, ii, jj, cost_limit): order = np.lexsort((jj_, ii_)) cc_ = cc_[order] kk_ = jj_[order] + ii_ = ii_.astype(np.intp) ii_ = np.bincount(ii_, minlength=shape[0]-1) ii_ = np.r_[[0], np.cumsum(ii_)] ii_ = ii_.astype(np.uint32)
Patch test failure on <I> bits.
gatagat_lap
train
py
5db9ac051324f0fb6ede5813f3bb53c9cd36cc33
diff --git a/test/index.js b/test/index.js index <HASH>..<HASH> 100644 --- a/test/index.js +++ b/test/index.js @@ -385,7 +385,7 @@ describe('sendEmail', function(){ }); it('should callback an error', function(done){ - this.timeout(5000); + this.timeout(10000); var calledTimes = 0; email.send(function (err) { calledTimes++; @@ -404,6 +404,7 @@ describe('sendEmail', function(){ key: process.env.NODE_SES_KEY , secret: process.env.NODE_SES_SECRET }); + this.timeout(10000); client.sendemail({ from: 'noreply@learnboost.com' @@ -565,7 +566,7 @@ describe('sendRawEmail', function(){ }); it('should callback an error', function(done){ - this.timeout(5000); + this.timeout(10000); var calledTimes = 0; email.send(function (err) { calledTimes++;
Increase remote AWS timeouts to allow tests to run on slower connections.
aheckmann_node-ses
train
js
783d5998914e5abedfcb952f751c60e1cc0c3bae
diff --git a/gems/aws-sdk-core/spec/aws/plugins/region_endpoint_spec.rb b/gems/aws-sdk-core/spec/aws/plugins/region_endpoint_spec.rb index <HASH>..<HASH> 100644 --- a/gems/aws-sdk-core/spec/aws/plugins/region_endpoint_spec.rb +++ b/gems/aws-sdk-core/spec/aws/plugins/region_endpoint_spec.rb @@ -35,7 +35,7 @@ module Aws expect(client_class.new.config.region).to eq('region-fallback2') end - it 'prefers AWS_DEFAULT_REGION to AWS_REGION or AMAZON_REGION' do + it 'prefers AWS_REGION to AMAZON_REGION or AWS_DEFAULT_REGION' do env['AWS_REGION'] = 'aws-region' env['AMAZON_REGION'] = 'amazon-region' env['AWS_DEFAULT_REGION'] = 'aws-default-region'
Fix the wrong description in spec test (#<I>)
aws_aws-sdk-ruby
train
rb
e3b4f387d2fe47324b839a4f45b4ce85aa119885
diff --git a/pyqode/core/modes/outline.py b/pyqode/core/modes/outline.py index <HASH>..<HASH> 100644 --- a/pyqode/core/modes/outline.py +++ b/pyqode/core/modes/outline.py @@ -53,8 +53,12 @@ class OutlineMode(Mode, QtCore.QObject): self._jobRunner.request_job(self._run_analysis) def _run_analysis(self): - if self.enabled and self.editor and self.editor.toPlainText() and \ - self.editor.file: + try: + self.editor.toPlainText() + except RuntimeError: + # called by the timer after the editor got deleted + return + if self.enabled and self.editor.file: request_data = { 'code': self.editor.toPlainText(), 'path': self.editor.file.path,
Fix runtime error if editor got deleted before running the analysis This happen in OpenCobolIDE if user quickly open and close the preferences dialog.
pyQode_pyqode.core
train
py
a6dbea1e25351bc60298bf40b2edaaad1276259e
diff --git a/glances/static_list.py b/glances/static_list.py index <HASH>..<HASH> 100644 --- a/glances/static_list.py +++ b/glances/static_list.py @@ -54,7 +54,7 @@ class GlancesStaticServer(object): for s in ['name', 'port', 'alias']: new_server[s] = config.get_value(self._section, '%s%s' % (postfix, s)) if new_server['name'] is not None: - # Manage optionnal information + # Manage optional information if new_server['port'] is None: new_server['port'] = '61209' new_server['username'] = 'glances'
docs: fix simple typo, optionnal -> optional There is a small typo in glances/static_list.py. Should read `optional` rather than `optionnal`.
nicolargo_glances
train
py
659cd0bf61b1dbd59a243f0b2ae76fdc3fc0d17b
diff --git a/GCR.py b/GCR.py index <HASH>..<HASH> 100644 --- a/GCR.py +++ b/GCR.py @@ -261,8 +261,10 @@ class BaseGenericCatalog(object): Return the first available quantity in the input arguments. Raise an error if none of them is available. """ - for q in quantities: + for i, q in enumerate(quantities): if self.has_quantity(q): + if i: + warnings.warn('{} not available; using {} instead'.format(quantities[0], q)) return q raise ValueError('None of these quantities exists')
warn if first choice is not available
yymao_generic-catalog-reader
train
py
8e2cf6e0ce75c2e56129909eb03c9862d0ff14d0
diff --git a/examples/src/main/java/boofcv/examples/sfm/ExampleMultiviewSceneReconstruction.java b/examples/src/main/java/boofcv/examples/sfm/ExampleMultiviewSceneReconstruction.java index <HASH>..<HASH> 100644 --- a/examples/src/main/java/boofcv/examples/sfm/ExampleMultiviewSceneReconstruction.java +++ b/examples/src/main/java/boofcv/examples/sfm/ExampleMultiviewSceneReconstruction.java @@ -97,13 +97,11 @@ public class ExampleMultiviewSceneReconstruction { // Configure bundle adjustment ConfigTrustRegion configTR = new ConfigTrustRegion(); configTR.regionInitial = 1; - configTR.scalingMinimum=1e-5; - configTR.scalingMaximum=1e5; + configTR.hessianScaling = true; ConfigLevenbergMarquardt configLM = new ConfigLevenbergMarquardt(); configLM.dampeningInitial = 1e-12; - configLM.scalingMinimum=1e-5; - configLM.scalingMaximum=1e5; + configLM.hessianScaling = true; BundleAdjustmentSchur_DSCC sba = new BundleAdjustmentSchur_DSCC(configTR); // BundleAdjustmentShur_DSCC sba = new BundleAdjustmentShur_DSCC(configLM);
updated for change in ddogleg
lessthanoptimal_BoofCV
train
java
7ca7e25afe2704f072b38f8e464bc4e7d4d7d0d7
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -5,19 +5,19 @@ try: import pypandoc long_description = pypandoc.convert('README.md', 'rst') except(IOError, ImportError): - long_description = open('README.md').read() + long_description = '' setup( name='julian', packages=['julian'], - version='0.13', + version='0.14', description='Simple library for converting between Julian calendar dates and datetime objects', long_description=long_description, author='Daniel Zawada', author_email='zawadadaniel@gmail.com', url='https://github.com/dannyzed/julian', - download_url='https://github.com/dannyzed/julian/tarball/0.13', + download_url='https://github.com/dannyzed/julian/tarball/0.14', keywords=['julian', 'calendar', 'datetime'], classifiers=[], ) \ No newline at end of file
Update to not use description if pandoc is not available
dannyzed_julian
train
py
64b11dd5ab5190e771da8bed3261adfc1d943e1a
diff --git a/lib/service/service.go b/lib/service/service.go index <HASH>..<HASH> 100644 --- a/lib/service/service.go +++ b/lib/service/service.go @@ -1588,12 +1588,14 @@ func (process *TeleportProcess) initSSH() error { warnOnErr(s.Shutdown(payloadContext(payload))) } } - if conn.UseTunnel() { + if conn != nil && conn.UseTunnel() { agentPool.Stop() } - // Close BPF service. - warnOnErr(ebpf.Close()) + if ebpf != nil { + // Close BPF service. + warnOnErr(ebpf.Close()) + } log.Infof("Exited.") })
Prevent nil pointer panic on node shutdown If node hasn't fully initialized before getting stopped (such as when join token isn't valid), most pointer vars in `initSSH` will be nil. Handle that cleanly.
gravitational_teleport
train
go
4d46af3dbb4a3b602e8cf30acacb52b36c842ada
diff --git a/org/xbill/DNS/Record.java b/org/xbill/DNS/Record.java index <HASH>..<HASH> 100644 --- a/org/xbill/DNS/Record.java +++ b/org/xbill/DNS/Record.java @@ -523,25 +523,41 @@ hashCode() { return array.hashCode(); } +private Record +cloneRecord() { + try { + return (Record) clone(); + } + catch (CloneNotSupportedException e) { + throw new IllegalStateException(); + } +} + /** * Creates a new record identical to the current record, but with a different * name. This is most useful for replacing the name of a wildcard record. */ public Record withName(Name name) { - Record rec = null; if (!name.isAbsolute()) throw new RelativeNameException(name); - try { - rec = (Record) clone(); - } - catch (CloneNotSupportedException e) { - } + Record rec = cloneRecord(); rec.name = name; return rec; } /** + * Creates a new record identical to the current record, but with a different + * class. This is most useful for dynamic update. + */ +Record +withDClass(short dclass) { + Record rec = cloneRecord(); + rec.dclass = dclass; + return rec; +} + +/** * Compares this Record to another Object. * @param o The Object to be compared. * @return The value 0 if the argument is a record equivalent to this record;
Add a method to create a clone of a record with a different class. git-svn-id: <URL>
dnsjava_dnsjava
train
java
37e5fa2e9cd982228aee4f5ade0c8480bf8d84d5
diff --git a/colo.js b/colo.js index <HASH>..<HASH> 100644 --- a/colo.js +++ b/colo.js @@ -38,7 +38,7 @@ } console.log.apply(console, args); }; - if (typeof define === 'undefined' && define.amd) { + if (typeof define !== 'undefined' && define.amd) { // amd define(function() { return {
Fixes check for AMD support.
yosuke-furukawa_colo
train
js
6687f91f7df358f4409af1ca1f35dd7359719812
diff --git a/check50.py b/check50.py index <HASH>..<HASH> 100755 --- a/check50.py +++ b/check50.py @@ -346,8 +346,12 @@ class TestCase(unittest.TestCase): def hash(self, filename): """Hashes a file using SHA-256.""" + + # Assert that file exists. if type(filename) == File: filename = filename.filename + self.exists(filename) + # https://stackoverflow.com/a/22058673 sha256 = hashlib.sha256() with open(filename, "rb") as f:
Add assertion that file to be hashed exists
cs50_check50
train
py
cd2b668193b3bdbfd4073f21c327ef538941d79f
diff --git a/siggen/cmd_fetch_data.py b/siggen/cmd_fetch_data.py index <HASH>..<HASH> 100644 --- a/siggen/cmd_fetch_data.py +++ b/siggen/cmd_fetch_data.py @@ -192,6 +192,9 @@ def cmdline(): # list of text; e.g. ["browser"] 'additional_minidumps': glom(raw_crash, 'additional_minisumps', default=[]), + + # pull out the original signature if there was one + 'original_signature': glom(processed_crash, 'signature', default='') } print(json.dumps(crash_data, indent=2))
Add original_signature to crash_data This will get ignored by signify and signature generation, but it'll make it easier for us to compare one set of signatures to another set of signatures.
willkg_socorro-siggen
train
py
be11fcdf25cf112c2b390fda38995da22f64ec1b
diff --git a/rake-tasks/gecko_sdks.rb b/rake-tasks/gecko_sdks.rb index <HASH>..<HASH> 100644 --- a/rake-tasks/gecko_sdks.rb +++ b/rake-tasks/gecko_sdks.rb @@ -40,7 +40,7 @@ class GeckoSDKs next ensure - rm_rf path if path && File.exist?(path) + rm_rf sdk if sdk && File.exist?(sdk) end end end @@ -74,7 +74,7 @@ class GeckoSDKs end end else - puts "Unpacking: #{File.basename path}" + puts "Unpacking: #{File.basename path} to #{destination}" sh "tar", "jxf", path, "-C", destination end end
EranMes: Delete the temporary SDK file, not the one we just extracted. r<I>
SeleniumHQ_selenium
train
rb
b8d3ea18ff9a23187204a22cca035518f1d7642c
diff --git a/Twig/SyliusResourceExtension.php b/Twig/SyliusResourceExtension.php index <HASH>..<HASH> 100644 --- a/Twig/SyliusResourceExtension.php +++ b/Twig/SyliusResourceExtension.php @@ -63,7 +63,7 @@ class SyliusResourceExtension extends Twig_Extension { $label = null === $label ? $property : $label; $route = null === $route ? $this->request->attributes->get('_route') : $route; - $routeParameters = empty($routeParameters) ? $this->request->attributes->get('_route_parameters') : $routeParameters; + $routeParameters = empty($routeParameters) ? $this->request->attributes->get('_route_parameters', array()) : $routeParameters; $sorting = $this->request->get('sorting'); @@ -76,7 +76,7 @@ class SyliusResourceExtension extends Twig_Extension $order = null === $order ? 'asc' : $order; $url = $this->router->generate($route, array_merge( - array('sorting' => array($property => $order), $routeParameters) + array('sorting' => array($property => $order)), $routeParameters )); return sprintf('<a href="%s">%s</a>', $url, $label);
Fixed failed to build the route parameters in Twig extension
Sylius_SyliusResourceBundle
train
php
22f92f91607bd7c4b9754b233fca83e5fe170d7c
diff --git a/lib/active_scaffold/actions/mark.rb b/lib/active_scaffold/actions/mark.rb index <HASH>..<HASH> 100644 --- a/lib/active_scaffold/actions/mark.rb +++ b/lib/active_scaffold/actions/mark.rb @@ -13,10 +13,19 @@ module ActiveScaffold::Actions else do_demark_all end - do_list - respond_to_action(:list) + respond_to_action(:mark_all) end protected + + def mark_all_respond_to_html + do_list + list_respond_to_html + end + + def mark_all_respond_to_js + do_list + render :action => 'list.js' + end # We need to give the ActiveRecord classes a handle to currently marked records. We don't want to just pass the object, # because the object may change. So we give ActiveRecord a proc that ties to the @@ -46,5 +55,9 @@ module ActiveScaffold::Actions def mark_authorized? authorized_for?(:action => :read) end + + def mark_all_formats + (default_formats + active_scaffold_config.formats).uniq + end end end \ No newline at end of file
mark_all action get s its own respond methods
activescaffold_active_scaffold
train
rb
d5df3cca8cf958150e449f8d1a6530432fc32044
diff --git a/event.go b/event.go index <HASH>..<HASH> 100644 --- a/event.go +++ b/event.go @@ -10,10 +10,10 @@ import ( const maxEventPayloadSize = 10240 type Event struct { - Channel string `json:"channel"` - Name string `json:"name"` - Data string `json:"data"` - SocketId *string `json:"socket_id,omitempty"` + Channel string `json:"channel"` + Name string `json:"name"` + Data interface{} `json:"data"` + SocketId *string `json:"socket_id,omitempty"` } type eventPayload struct { @@ -60,7 +60,7 @@ func createTriggerBatchPayload(batch []Event, encryptionKey string) ([]byte, err } else { batch[idx].Data = string(dataBytes) } - if len(batch[idx].Data) > maxEventPayloadSize { + if len(batch[idx].Data.(string)) > maxEventPayloadSize { return nil, fmt.Errorf("Data of the event #%d in batch, must be smaller than 10kb", idx) } }
refactor TriggerBatch's Event.Data str->interface (#<I>) - it refactors TriggerBatch's API regarding Event.Data to be consistent with the Trigger's API , moving from a `string` type to a `interface{}` type. This allows any matching type to be passed in as a Payload.
pusher_pusher-http-go
train
go
92dabac17efc3333318bd56a3cdc4403009c9603
diff --git a/lib/Doctrine/ODM/PHPCR/Translation/LocaleChooser/LocaleChooser.php b/lib/Doctrine/ODM/PHPCR/Translation/LocaleChooser/LocaleChooser.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ODM/PHPCR/Translation/LocaleChooser/LocaleChooser.php +++ b/lib/Doctrine/ODM/PHPCR/Translation/LocaleChooser/LocaleChooser.php @@ -113,6 +113,11 @@ class LocaleChooser implements LocaleChooserInterface */ public function setLocale($locale) { + // Strip region from locale if not configured + if (! array_key_exists($locale, $this->localePreference) && strlen($locale) > 2) { + $locale = substr($locale, 0, 2); + } + if (! array_key_exists($locale, $this->localePreference)) { throw new \InvalidArgumentException("The locale '$locale' is not present in the list of available locales"); }
Avoid exception when locale contains region Strips the region from the locale code if only the country code has been configured
doctrine_phpcr-odm
train
php
55e168e3a38ee1bad68ec2e21a499ebd05fa55bc
diff --git a/lib/externallib.php b/lib/externallib.php index <HASH>..<HASH> 100644 --- a/lib/externallib.php +++ b/lib/externallib.php @@ -644,7 +644,7 @@ class external_format_value extends external_value { . FORMAT_PLAIN . ' = PLAIN or ' . FORMAT_MARKDOWN . ' = MARKDOWN)'; - parent::__construct($type, $desc='', $required, $default); + parent::__construct(PARAM_INT, $desc, $required, $default); } }
MDL-<I> Web services : should force type of external_format_value structure
moodle_moodle
train
php
f836e157b5a74541127a429036e6b53ccd63ec55
diff --git a/razorpay/utility/utility.py b/razorpay/utility/utility.py index <HASH>..<HASH> 100644 --- a/razorpay/utility/utility.py +++ b/razorpay/utility/utility.py @@ -6,7 +6,10 @@ class Utility(object): def __init__(self, client=None): self.client = client - def validate_signature(self, order_id, payment_id, razorpay_signature): + def validate_signature(self, parameters): + order_id = parameters['order_id'] + payment_id = parameters['payment_id'] + razorpay_signature = parameters['razorpay_signature'] msg = "{}|{}".format(order_id, payment_id) dig = hmac.new(key=self.client.auth[1], msg=msg,
[python-sdk] take params instead of individual ids
razorpay_razorpay-python
train
py
d1051f6c8406e2a25467c8dc20b8b86adfa045d8
diff --git a/manticore/platforms/evm.py b/manticore/platforms/evm.py index <HASH>..<HASH> 100644 --- a/manticore/platforms/evm.py +++ b/manticore/platforms/evm.py @@ -2493,6 +2493,7 @@ class EVMWorld(Platform): raise TerminateState("REVERT", testcase=True) self.current.last_exception = None + self.current._push(0) # we are still on the CALL/CREATE self.current.pc += self.current.instruction.size
Push 0 on internal revert (#<I>)
trailofbits_manticore
train
py
64795110dc03fd977f7fe95b193db59f9436b582
diff --git a/packages/vaex-core/vaex/core/_version.py b/packages/vaex-core/vaex/core/_version.py index <HASH>..<HASH> 100644 --- a/packages/vaex-core/vaex/core/_version.py +++ b/packages/vaex-core/vaex/core/_version.py @@ -1,2 +1,2 @@ -__version_tuple__ = (0, 4, 4) -__version__ = '0.4.4' +__version_tuple__ = (0, 5, 0) +__version__ = '0.5.0'
Release <I> of vaex-core
vaexio_vaex
train
py
7728124b5ee1a448916ff598b8acb1ebe7cfdad7
diff --git a/diagnostics/diag.go b/diagnostics/diag.go index <HASH>..<HASH> 100644 --- a/diagnostics/diag.go +++ b/diagnostics/diag.go @@ -191,7 +191,11 @@ func (d *Diagnostics) getDiagnosticFromPeers(ctx context.Context, peers map[peer return } for d := range out { - respdata <- d + select { + case respdata <- d: + case <-ctx.Done(): + return + } } }(p) }
respect contexts when returning diagnostics responses License: MIT
ipfs_go-ipfs
train
go
6fe86aba2e04b80907a74e23e35499101333be2c
diff --git a/qtmodern/windows.py b/qtmodern/windows.py index <HASH>..<HASH> 100644 --- a/qtmodern/windows.py +++ b/qtmodern/windows.py @@ -67,8 +67,6 @@ class ModernWindow(QWidget): self.setWindowTitle(w.windowTitle()) self.setGeometry(w.geometry()) - self.installEventFilter(self) - # Adding attribute to clean up the parent window when the child is closed self._w.setAttribute(Qt.WA_DeleteOnClose, True) self._w.destroyed.connect(self.__child_was_closed) @@ -146,13 +144,10 @@ class ModernWindow(QWidget): self._w = None # The child was deleted, remove the reference to it and close the parent window self.close() - def eventFilter(self, source, event): - if event.type() == QEvent.Close: - if not self._w: - return True - return self._w.close() - - return QWidget.eventFilter(self, source, event) + def closeEvent(self, event): + if not self._w: + return True + event.setAccepted(self._w.close()) def setWindowTitle(self, title): """ Set window title.
Set ModernWindow to set the event state equal to the child state
gmarull_qtmodern
train
py
263c039db94c72f144229f39d66b21e604e6ada7
diff --git a/tests/unit/utils/network_test.py b/tests/unit/utils/network_test.py index <HASH>..<HASH> 100644 --- a/tests/unit/utils/network_test.py +++ b/tests/unit/utils/network_test.py @@ -251,8 +251,7 @@ class NetworkTestCase(TestCase): :return: ''' self.assertEqual(network._generate_minion_id(), - ['nodename', 'hostname', 'hostname.domainname.blank', - 'attrname', '1.2.3.4', '5.6.7.8']) + ['nodename', 'hostname', 'hostname.domainname.blank', '1.2.3.4', '5.6.7.8']) @patch('platform.node', MagicMock(return_value='hostname')) @patch('socket.gethostname', MagicMock(return_value='hostname'))
Test fix: look for attribute name only when other socket checks had failed
saltstack_salt
train
py
e63a3e99c2713cb7367093e1d7eb116f0d8bb28b
diff --git a/config/common.php b/config/common.php index <HASH>..<HASH> 100644 --- a/config/common.php +++ b/config/common.php @@ -16,6 +16,7 @@ return [ '@vendor/bower' => '@vendor/bower-asset', '@vendor/npm' => '@vendor/npm-asset', '@file' => '/file', + '@HIAM_SITE' => 'https://' . $params['hiam.site'], ], 'components' => [ 'cache' => [
Added `@HIAM_SITE` alias for better links to HIAM
hiqdev_hipanel-core
train
php
213bd1c3fbf3a4b25e91869e84f4da64719e2120
diff --git a/vault/token_store.go b/vault/token_store.go index <HASH>..<HASH> 100644 --- a/vault/token_store.go +++ b/vault/token_store.go @@ -1308,9 +1308,7 @@ func (ts *TokenStore) handleCreateCommon( sysView := ts.System() - if role != nil && role.Period > 0 { - te.TTL = role.Period - } else if te.Period > 0 { + if te.Period > 0 { te.TTL = te.Period } else { // Set the default lease if not provided, root tokens are exempt
Don't check the role period again as we've checked it earlier and it may be greater than the te Period
hashicorp_vault
train
go
54e857513195779243ad71137793745d9539f54c
diff --git a/js/bam/bamUtils.js b/js/bam/bamUtils.js index <HASH>..<HASH> 100644 --- a/js/bam/bamUtils.js +++ b/js/bam/bamUtils.js @@ -215,9 +215,11 @@ const BamUtils = { } if (refID < 0) { offset = blockEnd; - continue; // unmapped read + continue; // unmapped read, skip } else if (chrIdx !== undefined && (refID > chrIdx || pos > max)) { - return true; // off right edge, we're done + offset = blockEnd; + continue; + // return true; // off right edge, we're done } else if (chrIdx !== undefined && (refID < chrIdx)) { offset = blockEnd; continue; // ref ID to left of start, not sure this is possible
Possible workaround for issue #<I>
igvteam_igv.js
train
js
5d49216cd3c927f34d58f0f24377d4805f651de8
diff --git a/cerberus/cerberus.py b/cerberus/cerberus.py index <HASH>..<HASH> 100644 --- a/cerberus/cerberus.py +++ b/cerberus/cerberus.py @@ -285,10 +285,7 @@ class Validator(object): error = errors.ValidationError(document_path, schema_path, code, rule, constraint, value, info) - self._errors.append(error) - self._errors.sort() - self.document_error_tree += error - self.schema_error_tree += error + self._error([error]) def __get_child_validator(self, document_crumb=None, schema_crumb=None, **kwargs):
Reduces boilerplate for submitting errors
pyeve_cerberus
train
py
93e161a16ad5da5a3bfe9b43e6209dd583bfa6bd
diff --git a/src/ChrisKonnertz/BBCode/BBCode.php b/src/ChrisKonnertz/BBCode/BBCode.php index <HASH>..<HASH> 100644 --- a/src/ChrisKonnertz/BBCode/BBCode.php +++ b/src/ChrisKonnertz/BBCode/BBCode.php @@ -67,9 +67,10 @@ class BBCode { * * @param string $text The BBCode string * @param bool $escape Escape HTML entities? (Only "<" and ">"!) + * @param bool $keepLines Replace line breaks? * @return string */ - public function render($text = null, $escape = true) + public function render($text = null, $escape = true, $keepLines = true) { if ($this->text !== null and $text === null) { $text = $this->text; @@ -89,6 +90,15 @@ class BBCode { for ($i = 0; $i < $len; $i++) { $char = $text[$i]; + if ($keepLines) { + if ($char == "\n") { + $html .= '<br/>'; + } + if ($char == "\r") { + continue; + } + } + if (! $escape or ($char != '<' and $char != '>')) { /* * $inTag == true means the current position is inside a tag
Can now convert line breaks "n\r\" to HTML breaks "<br/>"
chriskonnertz_bbcode
train
php
1106aa68320265eca54ca1345339f71772d6398d
diff --git a/commands/WebhookCommands.js b/commands/WebhookCommands.js index <HASH>..<HASH> 100644 --- a/commands/WebhookCommands.js +++ b/commands/WebhookCommands.js @@ -162,7 +162,7 @@ WebhookCommand.prototype = extend(BaseCommand.prototype, { data.event = eventName; data.url = url; data.deviceid = deviceID; - data.access_token = api._access_token; + //data.access_token = api._access_token; data.requestType = requestType || data.requestType; if (data.mydevices == undefined) { data.mydevices = true; diff --git a/lib/ApiClient.js b/lib/ApiClient.js index <HASH>..<HASH> 100644 --- a/lib/ApiClient.js +++ b/lib/ApiClient.js @@ -688,8 +688,10 @@ ApiClient.prototype = { var obj = { uri: this.baseUrl + "/v1/webhooks", method: "POST", - json: true, - form: obj + json: obj, + headers: { + "Authorization": "Bearer " + this._access_token + } }; console.log("Sending webhook request ", obj);
use a bearer token header so we can send this request as a JSON request, so we won't 'stringify' native types in the request body. Fixes <URL>
particle-iot_particle-cli
train
js,js
ca614be6c0a82be9211683ca9524a78e518a01aa
diff --git a/base62_test.go b/base62_test.go index <HASH>..<HASH> 100644 --- a/base62_test.go +++ b/base62_test.go @@ -127,7 +127,9 @@ func BenchmarkAppendDecodeBase62(b *testing.B) { id := []byte(New().String()) for i := 0; i != b.N; i++ { - appendDecodeBase62(a[:0], id) + b := [stringEncodedLength]byte{} + copy(b[:], id) + appendDecodeBase62(a[:0], b[:]) } }
fix appendDecodeBase<I> benchmark so it doesn't cause a memory allocation
segmentio_ksuid
train
go
8a1de9b2522b0c270d5f59bfba524638ebd2ca76
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -379,7 +379,7 @@ module ActiveRecord if options[:finder_sql] reflection.klass.find_by_sql(custom_finder_sql) else - find(:all) + scoped.all end records = options[:uniq] ? uniq(records) : records
Instead of doing find(:all) which does scoped.find(:all) which does scoped.all, just do scoped.all.
rails_rails
train
rb
2644240bdac8a78e1345b0db3276e101f3d12f4a
diff --git a/themes/pry-tepid-8.prytheme.rb b/themes/pry-tepid-8.prytheme.rb index <HASH>..<HASH> 100644 --- a/themes/pry-tepid-8.prytheme.rb +++ b/themes/pry-tepid-8.prytheme.rb @@ -0,0 +1,48 @@ +t = PryTheme.create name: 'pry-tepid-8', color_model: 8 do + author name: 'Kyrylo Silin', email: 'kyrylosilin@gmail.com' + description 'Warm colors with warm soul' + + define_theme do + class_ 'magenta' + class_variable 'magenta' + comment 'green' + constant 'magenta' + error 'black', 'magenta' + float 'green' + global_variable 'green' + inline_delimiter 'yellow' + instance_variable 'magenta' + integer 'green' + keyword 'yellow' + method 'yellow' + predefined_constant 'yellow' + symbol 'yellow' + + regexp do + self_ 'magenta' + char 'yellow' + content 'magenta' + delimiter 'magenta' + modifier 'yellow' + escape 'yellow' + end + + shell do + self_ 'magenta' + char 'yellow' + content 'magenta' + delimiter 'yellow' + escape 'yellow' + end + + string do + self_ 'magenta' + char 'yellow' + content 'magenta' + delimiter 'yellow' + escape 'yellow' + end + end +end + +PryTheme::ThemeList.add_theme(t)
Add "pry-tepid-8" theme
kyrylo_pry-theme
train
rb
36b1fd2d8c4961582f8ee63e01164b4057350c09
diff --git a/js/x-api.js b/js/x-api.js index <HASH>..<HASH> 100644 --- a/js/x-api.js +++ b/js/x-api.js @@ -62,6 +62,16 @@ H5P.XAPIEvent.prototype.setVerb = function(verb) { // Else: Fail silently... }; +H5P.XAPIEvent.prototype.getShortVerb = function() { + var statement = this.data.statement; + if ('verb' in statement) { + return statement.verb.id.slice(31); + } + else { + return null; + } +} + H5P.XAPIEvent.prototype.setObject = function(instance) { this.data.statement.object = { // TODO: Correct this. contentId might be vid
Add helper function to get verbs
h5p_h5p-php-library
train
js
d69605739cf794682e17b91f1aecd295ba32cabf
diff --git a/components/popup/popup.js b/components/popup/popup.js index <HASH>..<HASH> 100644 --- a/components/popup/popup.js +++ b/components/popup/popup.js @@ -102,6 +102,7 @@ export default class Popup extends RingComponentWithShortcuts { }; static defaultProps = { + ['data-test']: 'ring-popup', shortcuts: true, hidden: false, onOutsideClick() {}, @@ -248,7 +249,7 @@ export default class Popup extends RingComponentWithShortcuts { }} > <div - data-test={this.props['data-test'] || 'ring-popup'} + data-test={this.props['data-test']} style={this.position()} ref={el => { this.popup = el;
RG-<I> Query assist popup always present in DOM with data-test='ring-popup' review fix Former-commit-id: <I>d<I>c<I>d<I>e1dfe<I>afcf7fcd<I>f<I>
JetBrains_ring-ui
train
js
bdf20d26fdfa355eba794f64a108ed00e39a880c
diff --git a/src/view/helpers/contextMethods.js b/src/view/helpers/contextMethods.js index <HASH>..<HASH> 100644 --- a/src/view/helpers/contextMethods.js +++ b/src/view/helpers/contextMethods.js @@ -89,7 +89,7 @@ function getBinding () { } function setBinding ( value ) { - this.ractive.set( this.getBindingPath(), value ); + return this.ractive.set( this.getBindingPath(), value ); } // deprecated getters
return promise when setting bound value from context helper
ractivejs_ractive
train
js
27dfaafe93cd39e156b0c1f869a9811345b04127
diff --git a/third_party/forked/golang/reflect/deep_equal.go b/third_party/forked/golang/reflect/deep_equal.go index <HASH>..<HASH> 100644 --- a/third_party/forked/golang/reflect/deep_equal.go +++ b/third_party/forked/golang/reflect/deep_equal.go @@ -16,7 +16,7 @@ import ( // that type. type Equalities map[reflect.Type]reflect.Value -// For convenience, panics on errrors +// For convenience, panics on errors func EqualitiesOrDie(funcs ...interface{}) Equalities { e := Equalities{} if err := e.AddFuncs(funcs...); err != nil {
Fix Spelling error about [errrors]
kubernetes_kubernetes
train
go
a6114348f9a78d5217e9b172cbfabd46bc9532a2
diff --git a/rollbar-java/src/main/java/com/rollbar/notifier/util/ObjectsUtils.java b/rollbar-java/src/main/java/com/rollbar/notifier/util/ObjectsUtils.java index <HASH>..<HASH> 100644 --- a/rollbar-java/src/main/java/com/rollbar/notifier/util/ObjectsUtils.java +++ b/rollbar-java/src/main/java/com/rollbar/notifier/util/ObjectsUtils.java @@ -1,5 +1,8 @@ package com.rollbar.notifier.util; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.Closeable; import java.io.IOException; import java.util.Arrays; @@ -9,6 +12,8 @@ import java.util.Arrays; */ public class ObjectsUtils { + private static Logger logger = LoggerFactory.getLogger(ObjectsUtils.class); + public static boolean equals(Object object1, Object object2) { return object1 == object2 || object1 != null && object1.equals(object2); } @@ -31,7 +36,7 @@ public class ObjectsUtils { closeable.close(); } } catch (IOException e) { - e.printStackTrace(); + logger.error("Unable to close stream.", e); } } -} +} \ No newline at end of file
use a Logger for exceptions logging
rollbar_rollbar-java
train
java
3fc3ad3b91461849ad233fe0cc7e692d9adac18c
diff --git a/spec/scheduler_spec.rb b/spec/scheduler_spec.rb index <HASH>..<HASH> 100644 --- a/spec/scheduler_spec.rb +++ b/spec/scheduler_spec.rb @@ -373,10 +373,10 @@ describe Rufus::Scheduler do it 'lists all the work threads in the pool' do @scheduler.in '0s' do - # nada + sleep(0.1) end @scheduler.in '0s' do - sleep(2) + sleep(2.0) end sleep 0.6 @@ -395,13 +395,13 @@ describe Rufus::Scheduler do it 'lists all the work threads in the pool' do @scheduler.in '0s' do - # nada + sleep(0.1) end @scheduler.in '0s' do - sleep(2) + sleep(2.0) end - sleep 0.4 + sleep 0.6 @scheduler.work_threads(:vacant).size.should == 1 end
fix scheduler_spec for Ruby <I>
jmettraux_rufus-scheduler
train
rb
da87ea11e62bc9129088bee23ad4e544b085c92b
diff --git a/session_security/urls.py b/session_security/urls.py index <HASH>..<HASH> 100644 --- a/session_security/urls.py +++ b/session_security/urls.py @@ -15,9 +15,12 @@ ie:: """ try: - from django.conf.urls import url + from django.urls import re_path as url except ImportError: - from django.conf.urls.defaults import url + try: + from django.conf.urls import url + except ImportError: + from django.conf.urls.defaults import url from .views import PingView
django.conf.urls.url() deprecated in Django <I> Results in the following warning: RemovedInDjango<I>Warning: django.conf.urls.url() is deprecated in favor of django.urls.re_path().
yourlabs_django-session-security
train
py
2671a546801ceb25a327078858ff50b8f771fc4a
diff --git a/modules/custom/activity_creator/src/ActivityNotifications.php b/modules/custom/activity_creator/src/ActivityNotifications.php index <HASH>..<HASH> 100644 --- a/modules/custom/activity_creator/src/ActivityNotifications.php +++ b/modules/custom/activity_creator/src/ActivityNotifications.php @@ -106,7 +106,12 @@ class ActivityNotifications extends ControllerBase { elseif ($entity instanceof GroupContentInterface) { $linked_entity = $entity->getEntity(); $group = $entity->getGroup(); - if ($linked_entity->getEntityTypeId() === 'node' && $group->id()) { + // Contrary to what PHPStan says `getEntity` can return NULL within Open + // Social. This is because we're violating the group module's contract + // somewhere else. The maintainer of the group module has indicated the + // types are correct. + // See https://github.com/goalgorilla/open_social/pull/2948#issuecomment-1137102029 + if ($linked_entity !== NULL && $linked_entity->getEntityTypeId() === 'node' && $group->id()) { $entity_query = $this->entityTypeManager()->getStorage('activity')->getQuery(); $entity_query->condition('field_activity_entity.target_id', $linked_entity->id(), '='); $entity_query->condition('field_activity_entity.target_type', $linked_entity->getEntityTypeId(), '=');
Re-introduce an unneeded is NULL check It appears there's something in Open Social (our our tests) that makes `getEntity` return NULL even though it's not supposed to. This breaks all of our tests so we re-introduce the check with a comment for now and look at finding the root cause later.
goalgorilla_open_social
train
php
cfb96b3f2f4000b2c108963971f63ebcbb581045
diff --git a/sdk/resourcemanager/azure-resourcemanager-redis/src/test/java/com/azure/resourcemanager/redis/RedisCacheOperationsTests.java b/sdk/resourcemanager/azure-resourcemanager-redis/src/test/java/com/azure/resourcemanager/redis/RedisCacheOperationsTests.java index <HASH>..<HASH> 100644 --- a/sdk/resourcemanager/azure-resourcemanager-redis/src/test/java/com/azure/resourcemanager/redis/RedisCacheOperationsTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-redis/src/test/java/com/azure/resourcemanager/redis/RedisCacheOperationsTests.java @@ -203,6 +203,9 @@ public class RedisCacheOperationsTests extends RedisManagementTest { @Test public void canCRUDLinkedServers() throws Exception { + if (isPlaybackMode()) { + return; // TODO: fix playback random fail + } RedisCache rgg = redisManager
suppress random fail (#<I>)
Azure_azure-sdk-for-java
train
java
ba907fbc1ebdf4f1ffa61ddd13f148b6933a1c04
diff --git a/sramongo/sra2mongo.py b/sramongo/sra2mongo.py index <HASH>..<HASH> 100644 --- a/sramongo/sra2mongo.py +++ b/sramongo/sra2mongo.py @@ -140,8 +140,7 @@ def fetch_sra(records, cache, runinfo_retmode='text', **kwargs): cache_runinfo = cache.get_cache(start, 'runinfo') if (cache_xml is not None) & (cache_runinfo is not None): - logger.info('Using cached {} to {} instead of downloading. ' - 'To force download please remove: {}'.format(start+1, end, cache.cachedir)) + logger.info('Using cached version for: {} to {}.'.format(start+1, end)) else: logger.info("Downloading record %i to %i" % (start+1, end)) attempt = 0 @@ -240,6 +239,7 @@ def main(): sra_query = query_sra(args.query) logger.info('Downloading documents') + logger.info('Saving to cache: {}'.format(cache.cachedir)) fetch_sra(sra_query, cache) logger.info('Adding documents to database')
Changes logging a little.
jfear_sramongo
train
py
4d811daf52e8c0786fc9c5b9e22836bfa085441f
diff --git a/tools/buildgen/generate_projects.py b/tools/buildgen/generate_projects.py index <HASH>..<HASH> 100755 --- a/tools/buildgen/generate_projects.py +++ b/tools/buildgen/generate_projects.py @@ -50,7 +50,10 @@ jobs = [] for root, dirs, files in os.walk('templates'): for f in files: if os.path.splitext(f)[1] == '.template': - out = '.' + root[len('templates'):] + '/' + os.path.splitext(f)[0] + out_dir = '.' + root[len('templates'):] + out = out_dir + '/' + os.path.splitext(f)[0] + if not os.path.exists(out_dir): + os.makedirs(out_dir) cmd = ['tools/buildgen/mako_renderer.py'] for plugin in plugins: cmd.append('-p')
generate_projects.py should make directories. That's necessary for generating Visual Studio project files that are in separate empty directories otherwise.
grpc_grpc
train
py
6e203ea6924b196cdcb93aff82416c48dd0978d6
diff --git a/modules/prebidServerBidAdapter/index.js b/modules/prebidServerBidAdapter/index.js index <HASH>..<HASH> 100644 --- a/modules/prebidServerBidAdapter/index.js +++ b/modules/prebidServerBidAdapter/index.js @@ -594,7 +594,7 @@ const OPEN_RTB_PROTOCOL = { } if (!utils.isEmpty(videoParams)) { - if (videoParams.context === 'outstream' && !adUnit.renderer) { + if (videoParams.context === 'outstream' && (!videoParams.renderer || !adUnit.renderer)) { // Don't push oustream w/o renderer to request object. utils.logError('Outstream bid without renderer cannot be sent to Prebid Server.'); } else {
Accept outstream renderers defined in mediatype for PBS (#<I>)
prebid_Prebid.js
train
js
bc5aa0bb2e09b1fa4d6f7ffa42c3a897413a5ec1
diff --git a/src/Shell/Task/ImportTask.php b/src/Shell/Task/ImportTask.php index <HASH>..<HASH> 100644 --- a/src/Shell/Task/ImportTask.php +++ b/src/Shell/Task/ImportTask.php @@ -59,10 +59,8 @@ class ImportTask extends Shell $entity = $table->patchEntity($entity, $group); $result = $table->save($entity); if (!$result) { - $this->abort("Failed to create group [" . $group['name'] . "]"); $this->err("Errors: \n" . implode("\n", $this->getImportErrors($entity))); - - return false; + $this->abort("Failed to create group [" . $group['name'] . "]"); } }
Show errors before aborting the ImportTask
QoboLtd_cakephp-groups
train
php
59bdf8f495ea26a3a31f7b48ad10a767b0ca8ef7
diff --git a/lib/components/viewers/route-viewer.js b/lib/components/viewers/route-viewer.js index <HASH>..<HASH> 100644 --- a/lib/components/viewers/route-viewer.js +++ b/lib/components/viewers/route-viewer.js @@ -15,9 +15,9 @@ import { } from '../../actions/ui' import { findRoutes, findRoute } from '../../actions/api' import { - getSortedFilteredRoutes, + getAgenciesFromRoutes, getModesForActiveAgencyFilter, - getAgenciesFromRoutes + getSortedFilteredRoutes } from '../../util/state' import { ComponentContext } from '../../util/contexts' import { getModeFromRoute } from '../../util/viewer' @@ -255,7 +255,7 @@ const RouteDetails = styled.div` ` class RouteRow extends PureComponent { - static contextType = ComponentContext; + static contextType = ComponentContext _onClick = () => { const { findRoute, isActive, route, setViewedRoute } = this.props
refactor(route-viewer): address pr comments
opentripplanner_otp-react-redux
train
js
9855a122153311bb6963b16cfb0c919cd2c18b53
diff --git a/lib/swag_dev-project.rb b/lib/swag_dev-project.rb index <HASH>..<HASH> 100644 --- a/lib/swag_dev-project.rb +++ b/lib/swag_dev-project.rb @@ -27,7 +27,7 @@ if lock require 'bootsnap' Bootsnap.setup( - cache_dir: 'cache', + cache_dir: "#{__dir__}/../cache", development_mode: true, load_path_cache: true, autoload_paths_cache: true,
bootstrapping set bootsnap cache_dir as absolute path
SwagDevOps_kamaze-project
train
rb
6a42756612ba02afdb36fea2d92a8d8a622131ba
diff --git a/src/main/java/water/Key.java b/src/main/java/water/Key.java index <HASH>..<HASH> 100644 --- a/src/main/java/water/Key.java +++ b/src/main/java/water/Key.java @@ -57,7 +57,7 @@ public final class Key extends Iced implements Comparable { public static final byte USER_KEY = 32; /** List of illegal characters which are not allowed in user keys. */ - public static final CharSequence ILLEGAL_USER_KEY_CHARS = "!@#$%^&*()+={}[]|\\;:\"'<>,/?"; + public static final CharSequence ILLEGAL_USER_KEY_CHARS = " !@#$%^&*()+={}[]|\\;:\"'<>,/?"; // 64 bits of Cloud-specific cached stuff. It is changed atomically by any // thread that visits it and has the wrong Cloud. It has to be read *in the
Added ' ' into illegal user characters.
h2oai_h2o-2
train
java
dd18299951fc4023c6eb1c650b9a0ee3937af870
diff --git a/lib-dempsyimpl/src/test/java/com/nokia/dempsy/TestDempsy.java b/lib-dempsyimpl/src/test/java/com/nokia/dempsy/TestDempsy.java index <HASH>..<HASH> 100644 --- a/lib-dempsyimpl/src/test/java/com/nokia/dempsy/TestDempsy.java +++ b/lib-dempsyimpl/src/test/java/com/nokia/dempsy/TestDempsy.java @@ -1117,6 +1117,7 @@ public class TestDempsy TestAdaptor adaptor = (TestAdaptor)context.getBean("adaptor"); adaptor.pushMessage(new TestMessage("test1")); // this causes the container to clone the Mp + assertTrue(poll(baseTimeoutMillis,mp,new Condition<TestMp>() { @Override public boolean conditionMet(TestMp mp) { return mp.cloneCalls.get()==1; } })); Thread.sleep(100); assertEquals(0,statsCollector.getMessageProcessorsCreated());
Minor test timing bug fix. Uncovered with the delay calulcation correction in the batching code.
Dempsy_dempsy
train
java
31601eb1c3d55e2f9118aa6367d967afc56dce27
diff --git a/Form/Type/DurationType.php b/Form/Type/DurationType.php index <HASH>..<HASH> 100755 --- a/Form/Type/DurationType.php +++ b/Form/Type/DurationType.php @@ -40,6 +40,8 @@ class DurationType extends HookType public function buildForm(FormBuilderInterface $builder, array $options) { + $this->setOptions($options); + if ('rest' == $this->view) { $builder->add('startDate', 'datetime', array( 'widget' => 'single_text',
CampaignChain/campaignchain#<I> Upgrade to Symfony 3.x
CampaignChain_hook-duration
train
php
3571439300f74403c5a39d84da38cea3d909b6ea
diff --git a/networkzero/discovery.py b/networkzero/discovery.py index <HASH>..<HASH> 100644 --- a/networkzero/discovery.py +++ b/networkzero/discovery.py @@ -216,6 +216,7 @@ class _Beacon(threading.Thread): _logger.debug("Advertise %s on %s %s TTL=%s", name, address, fail_if_exists, ttl_s) canonical_address = core.address(address) + superseded_services = set() for service in self._services_to_advertise: if service.name == name: if fail_if_exists: @@ -223,7 +224,10 @@ class _Beacon(threading.Thread): return None else: _logger.warn("Superseding service %s which already exists on %s", name, service.address) - self._services_to_advertise.remove(service) + superseded_services.add(service) + + for s in superseded_services: + self._services_to_advertise.remove(s) service = _Service(name, canonical_address, ttl_s) self._services_to_advertise.append(service)
Slight rework of superseded services
tjguk_networkzero
train
py
c382f0937ca0ebb0447e447bff6f89faa1caf6bc
diff --git a/spaceship/lib/spaceship/version.rb b/spaceship/lib/spaceship/version.rb index <HASH>..<HASH> 100644 --- a/spaceship/lib/spaceship/version.rb +++ b/spaceship/lib/spaceship/version.rb @@ -1,4 +1,4 @@ module Spaceship - VERSION = "0.29.1".freeze + VERSION = "0.30.0".freeze DESCRIPTION = "Ruby library to access the Apple Dev Center and iTunes Connect".freeze end
[spaceship] Version bump (#<I>) Update spaceship to work with the new iTunes Connect screenshot API
fastlane_fastlane
train
rb
ed6ac6fb456a87a4501d857951fcc635b43765c2
diff --git a/kernel/src/main/java/org/efaps/importer/DataImport.java b/kernel/src/main/java/org/efaps/importer/DataImport.java index <HASH>..<HASH> 100644 --- a/kernel/src/main/java/org/efaps/importer/DataImport.java +++ b/kernel/src/main/java/org/efaps/importer/DataImport.java @@ -52,12 +52,30 @@ public class DataImport { */ private RootObject root = null; + /** + * contains the Path of the Base for the Context + */ private String baseName = null; + /** + * DefaultConstructor used by Shell -create + */ + public DataImport() { + + } + + /** + * Constructor setting the BaseName + * + * @param _basename + */ public DataImport(final String _basename) { this.baseName = _basename; } + /** + * initialises the Context for the VFS + */ public void initialise() { System.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "org.efaps.importer.InitialContextFactory"); @@ -197,6 +215,11 @@ public class DataImport { this.root.dbAddChilds(); } + /** + * has the root recieved Data from the digester that must be inserted + * + * @return true, if there is Data + */ public boolean hasData() { return this.root != null; }
- added Constructor, to be started from shell -create git-svn-id: <URL>
eFaps_eFaps-Kernel
train
java
cbd4bdcb2c79eb77ea7c2b74a53ea9dea6a4982b
diff --git a/spec/services/hyrax/workflow/permission_query_spec.rb b/spec/services/hyrax/workflow/permission_query_spec.rb index <HASH>..<HASH> 100644 --- a/spec/services/hyrax/workflow/permission_query_spec.rb +++ b/spec/services/hyrax/workflow/permission_query_spec.rb @@ -164,12 +164,18 @@ module Hyrax subject { described_class.scope_processing_agents_for(user: nil) } it { is_expected.to eq([]) } end + context 'when user is persisted' do let(:user) { create(:user) } + before do + allow(user).to receive(:groups).and_return(['librarians']) + end + subject { described_class.scope_processing_agents_for(user: user) } + it 'will equal [kind_of(Sipity::Agent)]' do is_expected.to contain_exactly(PowerConverter.convert_to_sipity_agent(user), - PowerConverter.convert_to_sipity_agent(Group.new('registered'))) + PowerConverter.convert_to_sipity_agent(Group.new('librarians'))) end end end
Fix tests that was depending on User.groups returning a 'registered' pseudo-group
samvera_hyrax
train
rb
4eb78d9828eed490c912e8ea51a04dad5b0ecddf
diff --git a/ineffassign.go b/ineffassign.go index <HASH>..<HASH> 100644 --- a/ineffassign.go +++ b/ineffassign.go @@ -12,7 +12,7 @@ import ( ) func main() { - if len(os.Args) < 1 { + if len(os.Args) != 2 { fmt.Println("missing argument: filepath") return }
Fix index panic if no argument supplied Check that there are exactly two values in argv, the program name and the package.
gordonklaus_ineffassign
train
go
421a2116be49e9b6218278cf460ca05469a7923b
diff --git a/lib/Cake/Error/ExceptionRenderer.php b/lib/Cake/Error/ExceptionRenderer.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Error/ExceptionRenderer.php +++ b/lib/Cake/Error/ExceptionRenderer.php @@ -179,7 +179,7 @@ class ExceptionRenderer { */ protected function _cakeError(CakeException $error) { $url = $this->controller->request->here(); - $code = $error->getCode(); + $code = ($error->getCode() >= 400 && $error->getCode() < 506) ? $error->getCode() : 500; $this->controller->response->statusCode($code); $this->controller->set(array( 'code' => $code,
Adding error code checking around CakeException handling SocketExceptions can have error codes outside of the HTTP values.
cakephp_cakephp
train
php
f62931002f2e2000d781bacf245bfcd70b18f834
diff --git a/testing/constants.go b/testing/constants.go index <HASH>..<HASH> 100644 --- a/testing/constants.go +++ b/testing/constants.go @@ -27,4 +27,4 @@ var LongAttempt = &utils.AttemptStrategy{ } // SupportedSeries lists the series known to Juju. -var SupportedSeries = []string{"precise", "quantal", "raring", "saucy", "trusty"} +var SupportedSeries = []string{"precise", "quantal", "raring", "saucy", "trusty", "utopic"}
utopic is now available from distro-info, so needs to be updated
juju_juju
train
go
8513e013f4a2f67b62dc14a65d2bc320fb817438
diff --git a/framework/core/js/src/forum/components/Search.js b/framework/core/js/src/forum/components/Search.js index <HASH>..<HASH> 100644 --- a/framework/core/js/src/forum/components/Search.js +++ b/framework/core/js/src/forum/components/Search.js @@ -12,13 +12,13 @@ import UsersSearchSource from './UsersSearchSource'; * The `Search` component displays a menu of as-you-type results from a variety * of sources. * - * The search box will be 'activated' if the app's seach state's + * The search box will be 'activated' if the app's search state's * getInitialSearch() value is a truthy value. If this is the case, an 'x' * button will be shown next to the search field, and clicking it will clear the search. * * PROPS: * - * - state: AlertState instance. + * - state: SearchState instance. */ export default class Search extends Component { init() {
Fix typo and update outdated doc block
flarum_core
train
js
d4ec5fa095338dc397f584c336f19fe4a0977a80
diff --git a/lib/rules/no-wrap-func.js b/lib/rules/no-wrap-func.js index <HASH>..<HASH> 100644 --- a/lib/rules/no-wrap-func.js +++ b/lib/rules/no-wrap-func.js @@ -1,5 +1,5 @@ /** - * @fileoverview Rule to flag wrapping none-iffe in parens + * @fileoverview Rule to flag wrapping non-iife in parens * @author Ilya Volodin */
Fix: typo: iffe to iife, none to non
eslint_eslint
train
js
9190095e11e7690206a5a78b3fbe9551da07f719
diff --git a/agon/models.py b/agon/models.py index <HASH>..<HASH> 100644 --- a/agon/models.py +++ b/agon/models.py @@ -67,7 +67,7 @@ def award_points(target, key): points_given = lookup_point_value(key) updated = TargetStat.objects.filter(**lookup_params).update( - total = models.F("total") + points_given, + points = models.F("points") + points_given, ) if not updated: try:
fixed incorrect field name after TargetStat addition
pinax_pinax-points
train
py
0825a49282573c0f7ba968e5852d0ed376fac7f8
diff --git a/spec/ethon/easy/http/put_spec.rb b/spec/ethon/easy/http/put_spec.rb index <HASH>..<HASH> 100644 --- a/spec/ethon/easy/http/put_spec.rb +++ b/spec/ethon/easy/http/put_spec.rb @@ -103,7 +103,7 @@ describe Ethon::Easy::Http::Put do let(:easy) do e = Ethon::Easy.new(:url => url, :upload => true) e.set_read_callback(file) - e.infilesize = file.size + e.infilesize = File.size(file.path) e end
Fix again <I> file api issues.
typhoeus_ethon
train
rb
a10040acd009ef8e5e1a5131097ce0836be0ee25
diff --git a/lib/graphql/query/context.rb b/lib/graphql/query/context.rb index <HASH>..<HASH> 100644 --- a/lib/graphql/query/context.rb +++ b/lib/graphql/query/context.rb @@ -221,7 +221,7 @@ module GraphQL def_delegators :@context, :[], :[]=, :key?, :fetch, :to_h, :namespace, - :spawn, :schema, :warden, :errors, + :spawn, :warden, :errors, :execution_strategy, :strategy # @return [GraphQL::Language::Nodes::Field] The AST node for the currently-executing field
Remove delegate for `FieldResolutionContext#schema` It's already cached via an ivar in the initializer.
rmosolgo_graphql-ruby
train
rb
2c33fd615b549a479ec55c2bb682ac2fedad2786
diff --git a/packages/mjml-parser-xml/src/index.js b/packages/mjml-parser-xml/src/index.js index <HASH>..<HASH> 100644 --- a/packages/mjml-parser-xml/src/index.js +++ b/packages/mjml-parser-xml/src/index.js @@ -76,7 +76,6 @@ export default function MJMLParser(xml, options = {}, includedIn = []) { children: [], } cur.children.push(newNode) - cur = newNode return }
fix #<I> cur when failed include
mjmlio_mjml
train
js
cdacb2fa6c02d6933e942a133b44fd28ed90d815
diff --git a/cloudplatform/service/camera/src/main/java/io/rhiot/cloudplatform/service/camera/spring/CameraServiceConfiguration.java b/cloudplatform/service/camera/src/main/java/io/rhiot/cloudplatform/service/camera/spring/CameraServiceConfiguration.java index <HASH>..<HASH> 100644 --- a/cloudplatform/service/camera/src/main/java/io/rhiot/cloudplatform/service/camera/spring/CameraServiceConfiguration.java +++ b/cloudplatform/service/camera/src/main/java/io/rhiot/cloudplatform/service/camera/spring/CameraServiceConfiguration.java @@ -33,7 +33,7 @@ public class CameraServiceConfiguration { @Bean(name = "camera") CameraService cameraService(IoTConnector connector, ProducerTemplate producerTemplate, - @Value("camera.imagesDirectory:/tmp/rhiot/camera") File imagesDirectory) { + @Value("${camera.imagesDirectory:/tmp/rhiot/camera}") File imagesDirectory) { return new DefaultCameraService(connector, producerTemplate, imagesDirectory); }
Create CameraService#process operation #<I>
rhiot_rhiot
train
java
0f8e6c8440f96f5bb5b1da960f290b0c0ac7dcc8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ setup( packages=find_packages(), license="MIT", keywords="wagtail cms model utility", - download_url="https://github.com/rkhleics/wagailmenus/tarball/0.1", + download_url="https://github.com/rkhleics/wagailmenus/tarball/1.0.0", url="https://github.com/rkhleics/wagailmenus", include_package_data=True, zip_safe=False,
Use tarball to match current version
rkhleics_wagtailmenus
train
py
a443b243dd332ff61ed7c89094914de6beac17cc
diff --git a/tornado/simple_httpclient.py b/tornado/simple_httpclient.py index <HASH>..<HASH> 100644 --- a/tornado/simple_httpclient.py +++ b/tornado/simple_httpclient.py @@ -634,11 +634,12 @@ class _HTTPConnection(httputil.HTTPMessageDelegate): # redirect, the request method should be preserved. # However, browsers implemented this by changing the # method to GET, and the behavior stuck. 303 redirects - # always specified this POST-to-GET behavior (arguably 303 - # redirects should change *all* requests to GET, but - # libcurl only does this for POST so we follow their - # example). - if self.code in (301, 302, 303) and self.request.method == "POST": + # always specified this POST-to-GET behavior, arguably + # for *all* methods, but libcurl < 7.70 only does this + # for POST, while libcurl >= 7.70 does it for other methods. + if (self.code == 303 and self.request.method != "HEAD") or ( + self.code in (301, 302) and self.request.method == "POST" + ): new_request.method = "GET" new_request.body = None for h in [
simple_httpclient: after <I> redirect, turn all methods into GET not just POST (but still not HEAD) following the behavior of libcurl > <I>
tornadoweb_tornado
train
py
9252e2306655d83b2f128085bbb3ebfcb02e63f2
diff --git a/src/main/java/com/couchbase/cblite/support/CBLMultipartReader.java b/src/main/java/com/couchbase/cblite/support/CBLMultipartReader.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/couchbase/cblite/support/CBLMultipartReader.java +++ b/src/main/java/com/couchbase/cblite/support/CBLMultipartReader.java @@ -145,7 +145,8 @@ public class CBLMultipartReader { // The entire message might start with a boundary without a leading CRLF. byte[] boundaryWithoutLeadingCRLF = getBoundaryWithoutLeadingCRLF(); if (bufLen >= boundaryWithoutLeadingCRLF.length) { - if (Arrays.equals(buffer.toByteArray(), boundaryWithoutLeadingCRLF)) { + // if (Arrays.equals(buffer.toByteArray(), boundaryWithoutLeadingCRLF)) { + if (memcmp(buffer.toByteArray(), boundaryWithoutLeadingCRLF, boundaryWithoutLeadingCRLF.length)) { deleteUpThrough(boundaryWithoutLeadingCRLF.length); nextState = CBLMultipartReaderState.kInHeaders; }
passes all tests! issue #<I>.
couchbase_couchbase-lite-java-core
train
java
9aa83ad423e9b531c1eef52239ee2d9348f26b6d
diff --git a/integration/rpctest/node.go b/integration/rpctest/node.go index <HASH>..<HASH> 100644 --- a/integration/rpctest/node.go +++ b/integration/rpctest/node.go @@ -115,10 +115,6 @@ func (n *nodeConfig) arguments() []string { args = append(args, fmt.Sprintf("--rpccert=%s", n.certFile)) // --rpckey args = append(args, fmt.Sprintf("--rpckey=%s", n.keyFile)) - // --txindex - args = append(args, "--txindex") - // --addrindex - args = append(args, "--addrindex") if n.dataDir != "" { // --datadir args = append(args, fmt.Sprintf("--datadir=%s", n.dataDir))
integration/rpctest: disable the txindex by default In this commit, we disable the txindex by default as the flag cannot be overwritten by btcd once set.
btcsuite_btcd
train
go
88735d4237736d0a36ee82ba3dc0e13c52c0d465
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/defaults.rb +++ b/lib/puppet/defaults.rb @@ -1085,9 +1085,14 @@ EOT }, :dynamicfacts => { :default => "memorysize,memoryfree,swapsize,swapfree", - :desc => "Facts that are dynamic; these facts will be ignored when deciding whether + :desc => "(Deprecated) Facts that are dynamic; these facts will be ignored when deciding whether changed facts should result in a recompile. Multiple facts should be comma-separated.", + :hook => proc { |value| + if value + Puppet.deprecation_warning "The dynamicfacts setting is deprecated and will be ignored." + end + } }, :splaylimit => { :default => "$runinterval",
Maint: Deprecate dynamicfacts setting The dynamicfacts setting was used to avoid recompiling catalogs when only transient related facts were modified, e.g. free memory. According to Luke, this optimization was removed when "we disabled staleness checking for catalogs, which was early in the <I> release cycle", see ticket #<I>. This commit deprecates the setting rather than removing it, because it the setting was actually used at one time, unlike `ca_md`.
puppetlabs_puppet
train
rb
678f0be930e047f6493292d8d2effe0e712c7243
diff --git a/lib/app/assets/scripts/alchemy.js b/lib/app/assets/scripts/alchemy.js index <HASH>..<HASH> 100644 --- a/lib/app/assets/scripts/alchemy.js +++ b/lib/app/assets/scripts/alchemy.js @@ -377,5 +377,32 @@ if (hawkejs.scene.exposed.enable_websockets) { }); } +/** + * Fetch date from the server + * + * @author Jelle De Loecker <jelle@develry.be> + * @since 0.4.0 + * @version 0.4.0 + */ +alchemy.fetch = function fetch(href, options, callback) { + + var temp; + + if (typeof href == 'object' && !(href instanceof Blast.Classes.URL)) { + callback = options; + options = href; + href = options.href; + } + + // The href could be a resource name, try getting the url + temp = hawkejs.scene.helpers.Router.routeUrl(href); + + if (temp) { + href = temp; + } + + return hawkejs.scene.fetch(href, options, callback); +}; + __Protoblast.emit('alchemy-loaded'); }()); \ No newline at end of file
Add client-side alchemy.fetch method
skerit_alchemy
train
js
3543435966b848d2e42275ee5bf0d4140a899960
diff --git a/molgenis-data/src/main/java/org/molgenis/data/meta/AttributeMetaDataRepositoryDecorator.java b/molgenis-data/src/main/java/org/molgenis/data/meta/AttributeMetaDataRepositoryDecorator.java index <HASH>..<HASH> 100644 --- a/molgenis-data/src/main/java/org/molgenis/data/meta/AttributeMetaDataRepositoryDecorator.java +++ b/molgenis-data/src/main/java/org/molgenis/data/meta/AttributeMetaDataRepositoryDecorator.java @@ -298,7 +298,7 @@ public class AttributeMetaDataRepositoryDecorator implements Repository<Attribut @Override public void deleteAll(Stream<Object> ids) { - decoratedRepo.deleteById(ids.filter(id -> + decoratedRepo.deleteAll(ids.filter(id -> { validateAndDelete(findOneById(id)); return true;
FIX deleteAll calls wrong method on delegate
molgenis_molgenis
train
java