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
13cf4d349e95ba2f7bb454cf94cbd164e10e5d17
diff --git a/lints/lint_ev_valid_time_too_long.go b/lints/lint_ev_valid_time_too_long.go index <HASH>..<HASH> 100644 --- a/lints/lint_ev_valid_time_too_long.go +++ b/lints/lint_ev_valid_time_too_long.go @@ -30,7 +30,7 @@ func (l *evValidTooLong) CheckApplies(c *x509.Certificate) bool { } func (l *evValidTooLong) Execute(c *x509.Certificate) *LintResult { - if c.NotBefore.AddDate(2, 3, 0).Before(c.NotAfter) { + if c.NotBefore.AddDate(0, 0, 825).Before(c.NotAfter) { return &LintResult{Status: Error} } return &LintResult{Status: Pass} @@ -39,7 +39,7 @@ func (l *evValidTooLong) Execute(c *x509.Certificate) *LintResult { func init() { RegisterLint(&Lint{ Name: "e_ev_valid_time_too_long", - Description: "EV certificates must be 27 months in validity or less", + Description: "EV certificates must be 825 days in validity or less", Citation: "BRs: 6.3.2", Source: CABFBaselineRequirements, EffectiveDate: util.ZeroDate,
Change EV max validity to <I> days (#<I>) This is very slightly greater than <I> months and came into effect on March <I>, <I>, so changing the existing lint instead of creating a new one. Reference EVGL: <I> / Ballot <I>
zmap_zlint
train
go
77cb1e3abc01ac333130068447a7333241c5adf7
diff --git a/Config/ParametersManager.php b/Config/ParametersManager.php index <HASH>..<HASH> 100644 --- a/Config/ParametersManager.php +++ b/Config/ParametersManager.php @@ -53,6 +53,12 @@ class ParametersManager return ($features !== null && in_array($feature, $features)); } + public function hasFeatureById($id, $feature) + { + list($repertoire, $chord, $name) = split('[.]', $id); + + return $this->hasFeature($repertoire, $chord, $feature); + } public function getParameters() { return $this->parameters;
added a helper method has feature by identifier
lexcast_fminor-core
train
php
1b881a9e403969eec882b3852796190c33b5d651
diff --git a/src/org/opencms/ade/configuration/CmsResourceTypeConfig.java b/src/org/opencms/ade/configuration/CmsResourceTypeConfig.java index <HASH>..<HASH> 100644 --- a/src/org/opencms/ade/configuration/CmsResourceTypeConfig.java +++ b/src/org/opencms/ade/configuration/CmsResourceTypeConfig.java @@ -361,7 +361,7 @@ public class CmsResourceTypeConfig implements I_CmsConfigurationObject<CmsResour */ public CmsResource createNewElement(CmsObject userCms, String pageFolderRootPath) throws CmsException { - return createNewElement(userCms, null); + return createNewElement(userCms, null, null); } /**
Fixed infinite recursion in createNewElement.
alkacon_opencms-core
train
java
0a46e0741887b188eb453a7545f7c4a704dc8db1
diff --git a/overpy/__init__.py b/overpy/__init__.py index <HASH>..<HASH> 100644 --- a/overpy/__init__.py +++ b/overpy/__init__.py @@ -1076,6 +1076,8 @@ class Relation(Element): tags = {} members = [] + center_lat = None + center_lon = None supported_members = [RelationNode, RelationWay, RelationRelation, RelationArea] for sub_child in child: @@ -1095,6 +1097,8 @@ class Relation(Element): result=result ) ) + if sub_child.tag.lower() == "center": + (center_lat, center_lon) = cls.get_center_from_xml_dom(sub_child=sub_child) rel_id = child.attrib.get("id") if rel_id is not None: @@ -1107,7 +1111,15 @@ class Relation(Element): continue attributes[n] = v - return cls(rel_id=rel_id, attributes=attributes, members=members, tags=tags, result=result) + return cls( + rel_id=rel_id, + attributes=attributes, + center_lat=center_lat, + center_lon=center_lon, + members=members, + tags=tags, + result=result + ) class RelationMember(object):
src - Add support to get center info for relation with dom parser
DinoTools_python-overpy
train
py
b051133a12612e73b0caed63178d233bcba746a5
diff --git a/openquake/hazardlib/gsim/can15/sinter.py b/openquake/hazardlib/gsim/can15/sinter.py index <HASH>..<HASH> 100644 --- a/openquake/hazardlib/gsim/can15/sinter.py +++ b/openquake/hazardlib/gsim/can15/sinter.py @@ -72,6 +72,7 @@ class SInterCan15Mid(ZhaoEtAl2006SInter): # # Abrahamson et al. (2015) - Rrup + vs30 + backarc gmpe = AbrahamsonEtAl2015SInter() + sites.backarc = False mean_ab15, stds3 = gmpe.get_mean_and_stddevs(sites, rup, dists, imt, stddev_types) #
setting backarc term to False for can<I> GMPE sinter.py Former-commit-id: <I>bc<I>d8ebe<I>e<I>b<I>e6cb1e<I>a
gem_oq-engine
train
py
195685dfe7fe413cedb3625ba71d031751d5806d
diff --git a/main.go b/main.go index <HASH>..<HASH> 100644 --- a/main.go +++ b/main.go @@ -9,7 +9,7 @@ import ( const ( // version of Convoy - VERSION = "0.2.1" + VERSION = "0.3-dev" ) func cleanup() {
Update version to "<I>-dev"
rancher_convoy
train
go
196ee4528c866f50690c8f2413fe3585a6eb8479
diff --git a/datatableview/columns.py b/datatableview/columns.py index <HASH>..<HASH> 100644 --- a/datatableview/columns.py +++ b/datatableview/columns.py @@ -354,7 +354,11 @@ class Column(six.with_metaclass(ColumnMetaclass)): for sub_source in self.expand_source(source): modelfield = resolve_orm_path(model, sub_source) if modelfield.choices: - for db_value, label in modelfield.get_flatchoices(): + if hasattr(modelfield, 'get_choices'): + choices = modelfield.get_choices() + else: + choices = modelfield.get_flatchoices() + for db_value, label in choices: if term.lower() in label.lower(): k = '%s__exact' % (sub_source,) column_queries.append(Q(**{k: str(db_value)}))
Merge #<I> I've altered this from the original PR to make sure we're still pulling in the blank choice. If the blank choice has a label, we want to make sure that we're still searching on it.
pivotal-energy-solutions_django-datatable-view
train
py
965793e883c5f9b1f441bd8c00d2a3be36d3d5ea
diff --git a/src/helpers/labels.js b/src/helpers/labels.js index <HASH>..<HASH> 100644 --- a/src/helpers/labels.js +++ b/src/helpers/labels.js @@ -293,8 +293,8 @@ var label = function(context) { diffY2 += Math.abs(diffY1 - diffY2) > textBBox.height * .5 ? deltaDiffY2 : (textBBox.height * .05); } - var longerSideCoeff = Math.abs(diffX1) > Math.abs(diffY1) ? Math.abs(diffX1) / viewWidth : Math.abs(diffY1) / viewHeight; - lineGroup.select("line").style("stroke-dasharray", "0 " + (cache.scaledS0) + " " + ~~(longerSideCoeff + 2) + "00%"); + var longerSideCoeff = Math.abs(diffX1) > Math.abs(diffY1) ? Math.abs(diffX1) : Math.abs(diffY1); + lineGroup.select("line").style("stroke-dasharray", "0 " + (cache.scaledS0) + " " + ~~(longerSideCoeff)*2); lineGroup.selectAll("line") .attr("x1", diffX1)
The label detached from the bubble when user zooms in so much #<I> (#<I>)
vizabi_vizabi
train
js
67ef417ac019da9db787617b6f19c2063550791b
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -32,7 +32,7 @@ class Auth { await blitz.use(new Core(blitz.config.auth.core)) // Hook auth listener manually before node is connected - if (!blitz.config.auth.api.disable) { + if (!blitz.config.auth.api.disable && !blitz.config.auth.disable) { preauth.validateWorker() } }
fix preauth getting triggered on non-auth nodes
cubic-js_cubic
train
js
f4c13ecfd7700dc07af76f94b9c0adf44ff79227
diff --git a/tests/test_parser.py b/tests/test_parser.py index <HASH>..<HASH> 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -243,7 +243,7 @@ def refund(): c.finalize(sender=t.k0) print('Passed escrow test with initializer') - print('Gas estimate', t.languages['viper'].gas_estimate(arbitration_code)['finalize'], 'actual', s.head_state.receipts[-1].gas_used - s.head_state.receipts[-2].gas_used - s.last_tx.intrinsic_gas_used) + print('Gas estimate', t.languages['viper'].gas_estimate(arbitration_code_with_init)['finalize'], 'actual', s.head_state.receipts[-1].gas_used - s.head_state.receipts[-2].gas_used - s.last_tx.intrinsic_gas_used) def test_decimal_test(): decimal_test = """ def foo() -> num:
Discovered the wrong code was referenced here
ethereum_vyper
train
py
ba9ee43e0199de8630ecba659d4da8b9beb4b7be
diff --git a/src/graceful/__init__.py b/src/graceful/__init__.py index <HASH>..<HASH> 100644 --- a/src/graceful/__init__.py +++ b/src/graceful/__init__.py @@ -4,5 +4,5 @@ It is inspired by Django REST Framework package. Mostly by how object serialization is done but more emphasis is put on API to be self-descriptive. """ -VERSION = (0, 1, 2) # PEP 386 # noqa +VERSION = (0, 2, 0) # PEP 386 # noqa __version__ = ".".join([str(x) for x in VERSION]) # noqa
chore: prepare new release (<I>)
swistakm_graceful
train
py
46e9bbb9c7052762195abc18a456cca5c1ad0004
diff --git a/raiden/network/rpc/client.py b/raiden/network/rpc/client.py index <HASH>..<HASH> 100644 --- a/raiden/network/rpc/client.py +++ b/raiden/network/rpc/client.py @@ -335,6 +335,15 @@ def monkey_patch_web3(web3: Web3, gas_price_strategy: Callable) -> None: class TransactionSlot: + """A poor's man linear type that will check at the runtime that a nonce is + used only once. + + This is necessary to avoid problems with nonce synchronization. If a nonce + is not used then all subsequent transactions won't be mined, or if a nonce + is used more than once, only one transaction will succeed while all others + will fail, which is currently not supported by the Raiden node. + """ + def __init__(self, client: "JSONRPCClient", nonce: Nonce): self._client = client self.nonce = nonce @@ -349,6 +358,12 @@ class TransactionSlot: locally sign the transaction. This requires an extended server implementation that accepts the variables v, r, and s. """ + if self._sent: + raise RaidenUnrecoverableError( + f"A transaction for this slot has been sent already! " + f"Reusing the nonce is a synchronization problem." + ) + if to == to_canonical_address(NULL_ADDRESS_HEX): warnings.warn("For contract creation the empty string must be used.")
The nonce can be used only once. Added a check to make sure the slot is used only once, i.e. send_transaction is called only once. And added a small docstring explaining what are the cases this is protecting against.
raiden-network_raiden
train
py
d583f06cf72e845a345965473eb891acdb60fe55
diff --git a/ruby/command-t/controller.rb b/ruby/command-t/controller.rb index <HASH>..<HASH> 100644 --- a/ruby/command-t/controller.rb +++ b/ruby/command-t/controller.rb @@ -264,16 +264,8 @@ module CommandT ":call CommandT#{function}(#{param})<CR>" end - def xterm? - !!(::VIM::evaluate('&term') =~ /\Axterm/) - end - - def vt100? - !!(::VIM::evaluate('&term') =~ /\Avt100/) - end - - def screen? - !!(::VIM::evaluate('&term') =~ /\Ascreen/) + def term + @term ||= ::VIM::evaluate('&term') end def register_for_key_presses @@ -308,8 +300,9 @@ module CommandT end else [value].flatten.each do |mapping| - map mapping, key unless mapping == '<Esc>' && (xterm? || vt100? || - screen?) + unless mapping == '<Esc>' && term =~ /\A(screen|xterm|vt100)/ + map mapping, key + end end end end
Avoid repeated evaluations of "term" And cut down on the number of custom term-related methods in the controller.
wincent_command-t
train
rb
d9243cddde050c9d1d65533b92011dc0b5ce7fd1
diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index <HASH>..<HASH> 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -783,7 +783,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr $record->HasBrokenLink = 0; $record->HasBrokenFile = 0; - $record->writeWithoutVersion(); + if (!$record->ObsoleteClassName) $record->writeWithoutVersion(); // Update the class instance if necessary if(isset($data['ClassName']) && $data['ClassName'] != $record->ClassName) {
FIX Pages with obsolete class shouldnt do first versionless write
silverstripe_silverstripe-siteconfig
train
php
33089914aa06389fd40679688c8b15ad2cde5fa8
diff --git a/ext_emconf.php b/ext_emconf.php index <HASH>..<HASH> 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -7,7 +7,7 @@ $EM_CONF[$_EXTKEY] = [ 'author' => 'Markus Sommer', 'author_email' => 'markussom@posteo.de', 'state' => 'alpha', - 'version' => '0.0.4', + 'version' => '0.0.5', 'constraints' => [ 'depends' => [ 'typo3' => '7.0.0-7.6.99',
[TASK] Set version to <I>
beardcoder_sitemap_generator
train
php
d41220d8ca5e301e24e78d29006806ffe0568967
diff --git a/gwpy/signal/window.py b/gwpy/signal/window.py index <HASH>..<HASH> 100644 --- a/gwpy/signal/window.py +++ b/gwpy/signal/window.py @@ -188,6 +188,6 @@ def planck(N, nleft=None, nright=None): if nright: w[N-1] *= 0 zright = numpy.array([-nright * (1./(k-nright) + 1./k) - for k in range(1, nright)]) + for k in range(1, nright)]) w[N-nright:N-1] *= expit(-zright) return w
Oops! Fixing a PEP8 compliance issue in the last commit.
gwpy_gwpy
train
py
ee95f1037716586feb52141a203c0d0fb62565f7
diff --git a/celeryconfig.py b/celeryconfig.py index <HASH>..<HASH> 100644 --- a/celeryconfig.py +++ b/celeryconfig.py @@ -42,6 +42,7 @@ BROKER_PASSWORD = amqp.get("password") BROKER_VHOST = amqp.get("vhost") CELERY_RESULT_BACKEND = "amqp" +CELERYD_PREFETCH_MULTIPLIER = 1 CELERY_IMPORTS = (
celeryconfig: Set CELERYD_PREFETCH_MULTIPLIER to 1, so that each worker process receives only 1 task at a time. Former-commit-id: c<I>a<I>c9fc<I>fd<I>c8b<I>ae9da<I>a2f<I>
gem_oq-engine
train
py
c56c655a5ca10f500854e9b5153709783e8c34e3
diff --git a/src/Support/Download/UrlDownloader.php b/src/Support/Download/UrlDownloader.php index <HASH>..<HASH> 100644 --- a/src/Support/Download/UrlDownloader.php +++ b/src/Support/Download/UrlDownloader.php @@ -172,7 +172,7 @@ class UrlDownloader implements UrlDownloaderInterface */ protected function normalizeUrl($url) { - return str_replace(' ', '+', $url); + return str_replace(' ', '%20', $url); } }
Fixed issue with space-url normalization in downloader %<I> has better support than +.
czim_file-handling
train
php
4c50e1e897222097aa58286d88db984688253311
diff --git a/Controller/QtiController.php b/Controller/QtiController.php index <HASH>..<HASH> 100755 --- a/Controller/QtiController.php +++ b/Controller/QtiController.php @@ -51,6 +51,7 @@ class QtiController extends Controller { if ($exoID == -1) { return $this->forward('UJMExoBundle:Question:index', array()); } else { + $qtiRepos->assocExerciseQuestion(false); return $this->redirect($this->generateUrl( 'ujm_exercise_questions', array( 'id' => $exoID, ))); } }
[ExoBundle] Import QTI in exercise
claroline_Distribution
train
php
5a48cc45406cb50dc398e63ffa8526fd2561fa12
diff --git a/lifxlan/light.py b/lifxlan/light.py index <HASH>..<HASH> 100644 --- a/lifxlan/light.py +++ b/lifxlan/light.py @@ -18,8 +18,8 @@ WARM_WHITE = [58275, 0, 65535, 3200] GOLD = [58275, 0, 65535, 2500] class Light(Device): - def __init__(self, mac_addr, service, port, source_id, ip_addr, verbose=False): - super(Light, self).__init__(mac_addr, service, port, source_id, ip_addr, verbose) + def __init__(self, mac_addr, ip_addr, service=1, port=56700, source_id=0, verbose=False): + super(Light, self).__init__(mac_addr, ip_addr, service, port, source_id, verbose) self.color = None ############################################################################
added defaults for the light constructor, so people can create standalone light objects without discovery
mclarkk_lifxlan
train
py
43472a240af79f70a54723a065a011b86ded4224
diff --git a/src/Libraries/Storage/FileSystem.php b/src/Libraries/Storage/FileSystem.php index <HASH>..<HASH> 100644 --- a/src/Libraries/Storage/FileSystem.php +++ b/src/Libraries/Storage/FileSystem.php @@ -100,7 +100,29 @@ class FileSystem } /** - * Exstension + * Base name + * + * @param string $file + * @return string + */ + public function baseName($file) + { + return pathinfo($file, PATHINFO_BASENAME); + } + + /** + * File name + * + * @param string $file + * @return string + */ + public function fileName($file) + { + return pathinfo($file, PATHINFO_FILENAME); + } + + /** + * Extension * * @param string $file * @return string|string[]
Adding new methods to FileSystem library
softberg_quantum-core
train
php
3b4c43885e536353a1ca0885c8382d0eb8f278c3
diff --git a/test/lib/pubsub.items.js b/test/lib/pubsub.items.js index <HASH>..<HASH> 100644 --- a/test/lib/pubsub.items.js +++ b/test/lib/pubsub.items.js @@ -476,6 +476,20 @@ describe('Publish-Subscribe', function() { }) socket.emit('xmpp.pubsub.retrieve', request, function() {}) }) + + it('Sends expected stanza with \'max_items\'', function(done) { + var request = { + to: 'pubsub.shakespeare.lit', + node: 'twelfth night', + maxItems: 3 + } + xmpp.once('stanza', function(stanza) { + stanza.getChild('pubsub', pubsub.NS_PUBSUB) + .getChild('items').attrs.max_items.should.equal(request.maxItems) + done() + }) + socket.emit('xmpp.pubsub.retrieve', request, function() {}) + }) it('Sends expected stanza when RSM applied', function(done) { var request = {
Test for 'maxItems'
xmpp-ftw_xmpp-ftw-pubsub
train
js
ebaa7f110cf3910be1e3ffc89b4118ca0adfbb49
diff --git a/lib/objectFactory.js b/lib/objectFactory.js index <HASH>..<HASH> 100644 --- a/lib/objectFactory.js +++ b/lib/objectFactory.js @@ -43,7 +43,7 @@ var create = function (params) { delete params.constructor; }; - var outp = function (data) { + var ObjectPrototype = function (data) { // Run the constructor this._constructor && this._constructor(data); @@ -54,20 +54,20 @@ var create = function (params) { }; }; - outp.prototype._implements = [] + ObjectPrototype.prototype._implements = [] // If extends other do first so they get overridden by those passed as params // Inehrited prototypes with lower index have precedence - common.extendPrototypeWithThese(outp, extendThese); + common.extendPrototypeWithThese(ObjectPrototype, extendThese); // The rest of the params are added as methods, overriding previous - common.addMembers(outp, params); + common.addMembers(ObjectPrototype, params); // Add the interfaces so they can be checked // TODO: Filer so we remove duplicates from existing list (order makes difference) - outp.prototype._implements = implementsInterfaces.concat(outp.prototype._implements); + ObjectPrototype.prototype._implements = implementsInterfaces.concat(ObjectPrototype.prototype._implements); - return outp; + return ObjectPrototype; } module.exports.create = create; \ No newline at end of file
Better name because it shows up in debugger
jhsware_component-registry
train
js
15e54fde9d57d883a0d479732d136edd2fb1032e
diff --git a/lib/ApiCLI.php b/lib/ApiCLI.php index <HASH>..<HASH> 100644 --- a/lib/ApiCLI.php +++ b/lib/ApiCLI.php @@ -488,7 +488,17 @@ class ApiCLI extends AbstractView $s = $separator[0]; $name = preg_replace('|[^a-z0-9\\'.$s.']|i', $s, $name); - $name = trim($name, $s); + /* + * This is evil. + * + * If I have a field name in Model as this: + * "_amount", then this trim removes trailing "_" and further + * set("_amount", "foo") would fail.. + * + * Reconsider this change. + * + * $name = trim($name, $s); + */ $name = preg_replace('|\\'.$s.'{2,}|', $s, $name); return $name;
Reverted triming of field names caused issues if field names in model were starting with "_" Author of this change should reconsider the implementation.
atk4_atk4
train
php
cc77f66cd51dd8829ace114ff971eecab0990fa8
diff --git a/packages/mdc-rtl/blueprints/ember-cli-mdc-rtl/index.js b/packages/mdc-rtl/blueprints/ember-cli-mdc-rtl/index.js index <HASH>..<HASH> 100644 --- a/packages/mdc-rtl/blueprints/ember-cli-mdc-rtl/index.js +++ b/packages/mdc-rtl/blueprints/ember-cli-mdc-rtl/index.js @@ -1,6 +1,6 @@ /* eslint-env node */ -const { installer: { installAddons, installPackages } } = require ('ember-cli-blueprint-helpers'); +const { installer: { installPackages } } = require ('ember-cli-blueprint-helpers'); module.exports = { description: '', @@ -12,12 +12,6 @@ module.exports = { afterInstall () { return installPackages (this, [ {name: '@material/rtl'} - ]).then (() => { - return installAddons (this, { - packages: [ - {name: 'ember-cli-mdc-sass'} - ] - }); - }); + ]); } };
No need to install mdc-theme
onehilltech_ember-cli-mdc
train
js
36e6a16f50d7ba5fb147e3da81180306b20685dc
diff --git a/client/src/main/java/io/pravega/client/stream/impl/StreamCutImpl.java b/client/src/main/java/io/pravega/client/stream/impl/StreamCutImpl.java index <HASH>..<HASH> 100644 --- a/client/src/main/java/io/pravega/client/stream/impl/StreamCutImpl.java +++ b/client/src/main/java/io/pravega/client/stream/impl/StreamCutImpl.java @@ -11,6 +11,7 @@ package io.pravega.client.stream.impl; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; import io.pravega.client.segment.impl.Segment; import io.pravega.client.stream.Stream; import io.pravega.common.Exceptions; @@ -60,7 +61,7 @@ public class StreamCutImpl extends StreamCutInternal { @Builder(builderClassName = "StreamCutBuilder") public StreamCutImpl(Stream stream, Map<Segment, Long> positions) { this.stream = stream; - this.positions = positions; + this.positions = ImmutableMap.copyOf(positions); } @Override
Issue <I>: Make a defensive copy of streamCut's position map (#<I>)
pravega_pravega
train
java
c5ddb8c2f7ac163bc40ee71f977c023d9daa792d
diff --git a/docs/app/js/app.js b/docs/app/js/app.js index <HASH>..<HASH> 100755 --- a/docs/app/js/app.js +++ b/docs/app/js/app.js @@ -5,6 +5,6 @@ import Docs from './_docs'; $(() => { new Maps(); - new Forum('https://geoforum.nl', 'applicaties-en-diensten/nl-maps'); + new Forum('https://geoforum.nl', 'nl-maps'); new Docs('kadaster/nlmaps/', 'docs/README-NL.md'); });
show only nlmaps topics in forum section
geo-frontend_nlmaps
train
js
23f620bf8940b975b43d3dd98d5c2e8192af1935
diff --git a/tests/test_fs.py b/tests/test_fs.py index <HASH>..<HASH> 100644 --- a/tests/test_fs.py +++ b/tests/test_fs.py @@ -945,7 +945,6 @@ class FSTestUtime(unittest2.TestCase): self.assertEqual(s.st_mtime, mtime) -@platform_skip(["linux"]) class FSEventTestBasic(unittest2.TestCase): def setUp(self):
Re-enabled no longer failing test on Linux
saghul_pyuv
train
py
55e50c6b362b0a7846cf73a800fe2047a9ea0c3c
diff --git a/elasticsearch-model/lib/elasticsearch/model/response/results.rb b/elasticsearch-model/lib/elasticsearch/model/response/results.rb index <HASH>..<HASH> 100644 --- a/elasticsearch-model/lib/elasticsearch/model/response/results.rb +++ b/elasticsearch-model/lib/elasticsearch/model/response/results.rb @@ -22,7 +22,7 @@ module Elasticsearch # def results # TODO: Configurable custom wrapper - @results = response.response['hits']['hits'].map { |hit| Result.new(hit) } + response.response['hits']['hits'].map { |hit| Result.new(hit) } end end
[MODEL] Removed useless variable assignment in Elasticsearch::Model::Response::Results#results Closes #<I>
elastic_elasticsearch-rails
train
rb
fb34fdfa7792a7a1038eda0e7f9d36d4c414c5c9
diff --git a/lib/binding/Entity.js b/lib/binding/Entity.js index <HASH>..<HASH> 100644 --- a/lib/binding/Entity.js +++ b/lib/binding/Entity.js @@ -83,6 +83,20 @@ Object.defineProperties(Entity.prototype, /** @lends binding.Entity.prototype */ }, /** + * Date of the creation of the object + * @name createdAt + * @memberOf binding.Entity.prototype + * @type Date + */ + + /** + * Last update date of the object + * @name updatedAt + * @memberOf binding.Entity.prototype + * @type Date + */ + + /** * Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled * @param {util.Lockable~callback=} doneCallback The callback which will be invoked when the previously * operations on this object is completed. @@ -290,5 +304,4 @@ module.exports = Entity; * @callback binding.Entity~failCallback * @param {error.PersistentError} error The error which reject the operation * @return {Promise<*>|*} A Promise, result or undefined - */ - + */ \ No newline at end of file
added createdAt and updatedAt to jsdoc and typings
Baqend_js-sdk
train
js
939a38d18fb68176ed263e4a23e5de86b1c84e08
diff --git a/autopep8.py b/autopep8.py index <HASH>..<HASH> 100755 --- a/autopep8.py +++ b/autopep8.py @@ -1825,7 +1825,7 @@ def main(): if sys.version_info[0] >= 3: output = sys.stdout else: - output = codecs.getwriter(locale.getpreferredencoding())(sys.stdout) + output = codecs.getwriter('utf-8')(sys.stdout) while filenames: name = filenames.pop(0)
Always output Unicode locale.getpreferredencoding() may not be Unicode, in which case there will be an encoding failure.
hhatto_autopep8
train
py
eaaab554b381c2a6a9783431f5092ecdb6f20b81
diff --git a/docs/gatsby-config.js b/docs/gatsby-config.js index <HASH>..<HASH> 100644 --- a/docs/gatsby-config.js +++ b/docs/gatsby-config.js @@ -39,6 +39,7 @@ module.exports = { 'federation/introduction', 'federation/implementing', 'federation/core-concepts', + 'federation/value-types', 'federation/advanced-features', 'federation/errors', 'federation/metrics',
Add Value Types article to left nav
apollographql_apollo-server
train
js
e19dc11e51e942e0eb65a3e18a011b5f339352be
diff --git a/lib/form/editor.php b/lib/form/editor.php index <HASH>..<HASH> 100644 --- a/lib/form/editor.php +++ b/lib/form/editor.php @@ -354,7 +354,7 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element { $editorrules = ' onblur="'.htmlspecialchars($this->getAttribute('onblur')).'" onchange="'.htmlspecialchars($this->getAttribute('onchange')).'"'; } $str .= '<div><textarea id="'.$id.'" name="'.$elname.'[text]" rows="'.$rows.'" cols="'.$cols.'"'.$editorrules.'>'; - $str .= s($text);if (count($formats)>1) { + $str .= s($text); $str .= '</textarea></div>'; $str .= '<div>'; @@ -408,4 +408,4 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element { return ''; } -} \ No newline at end of file +}
MDL-<I> editor: Fixed up out of place if
moodle_moodle
train
php
5fd9351da5c96d889b20af593b1e74ae8bfdd3a8
diff --git a/log/log.go b/log/log.go index <HASH>..<HASH> 100644 --- a/log/log.go +++ b/log/log.go @@ -10,15 +10,6 @@ import ( "github.com/deis/pkg/prettyprint" ) -// Stdout is the logging destination for normal messages. -var Stdout io.Writer = os.Stdout - -// Stderr is the logging destination for error messages. -var Stderr io.Writer = os.Stderr - -// IsDebugging toggles whether or not to enable debug output and behavior. -var IsDebugging = false - // Color is the representation of a color, to be used in Colorize type Color string @@ -60,7 +51,7 @@ func NewLogger(stdout, stderr io.Writer, debug bool) *Logger { } // DefaultLogger is the default logging implementation. It's used in all top level funcs inside the log package, and represents the equivalent of NewLogger(os.Stdout, os.Stderr) -var DefaultLogger *Logger +var DefaultLogger = &Logger{stdout: os.Stdout, stderr: os.Stderr, debug: false} func init() { DefaultLogger = &Logger{stdout: Stdout, stderr: Stderr, debug: IsDebugging}
fix(log.go): remove global stdout/debug vars the initialization order made it impossible to configure the default logger before it was created
deis_pkg
train
go
d048057249006227b57abe82d983ee8cf6503d0e
diff --git a/system/src/Grav/Common/GravTrait.php b/system/src/Grav/Common/GravTrait.php index <HASH>..<HASH> 100644 --- a/system/src/Grav/Common/GravTrait.php +++ b/system/src/Grav/Common/GravTrait.php @@ -9,12 +9,17 @@ namespace Grav\Common; */ trait GravTrait { + protected static $grav; + /** * @return Grav */ public static function getGrav() { - return Grav::instance(); + if (!self::$grav) { + self::$grav = Grav::instance(); + } + return self::$grav; } }
Added back `GravTrait::$grav` for compatibility for < <I> versions of admin plugin
getgrav_grav
train
php
57d4fb1bf87d95b8da3ce55345e1633a267c8cc6
diff --git a/src/Translator.php b/src/Translator.php index <HASH>..<HASH> 100644 --- a/src/Translator.php +++ b/src/Translator.php @@ -90,7 +90,8 @@ class Translator implements TranslatorInterface */ protected function getMessage($key) { - if ($message = ($this->package->getMessage($key))) { + $message = $this->package->getMessage($key); + if ($message) { return $message; }
Readability, separating assignment and if statement
auraphp_Aura.Intl
train
php
0fb86edcbbf0de7b6ef2c3298cc47d17844801df
diff --git a/test/ModelTest.php b/test/ModelTest.php index <HASH>..<HASH> 100644 --- a/test/ModelTest.php +++ b/test/ModelTest.php @@ -134,13 +134,22 @@ class UserbinModelTest extends Userbin_TestCase $this->assertEquals($found_user->email, $user['email']); } - public function testNestedFind($value='') + public function testNestedFind() { $user = new Userbin_User(1234); $user->challenges()->find(5678); $this->assertRequest('get', '/users/1234/challenges/5678'); } + public function testNestedInstanceMethod() + { + Userbin_RequestTransport::setResponse(200, array('id' => 1)); + $user = new Userbin_User(1234); + $challenge = $user->challenges()->find(1); + $challenge->verify('response'); + $this->assertRequest('post', '/users/1234/challenges/1/verify'); + } + public function testHasOne() { $userData = array(
Added test for nested model instance action
castle_castle-php
train
php
025a298388c45009338b602d2194b759f1eea450
diff --git a/requery-processor/src/main/java/io/requery/processor/AttributeMember.java b/requery-processor/src/main/java/io/requery/processor/AttributeMember.java index <HASH>..<HASH> 100644 --- a/requery-processor/src/main/java/io/requery/processor/AttributeMember.java +++ b/requery-processor/src/main/java/io/requery/processor/AttributeMember.java @@ -149,7 +149,7 @@ class AttributeMember extends BaseProcessableElement<Element> implements Attribu if (cardinality() != null && entity.isImmutable()) { validator.error("Immutable value type cannot contain relational references"); } - checkReserved(name, validator); + checkReserved(name(), validator); isEmbedded = annotationOf(Embedded.class).isPresent() || annotationOf(javax.persistence.Embedded.class).isPresent(); indexNames.forEach(name -> checkReserved(name, validator));
Resolve #<I> Check reserved name for basic fields
requery_requery
train
java
c6f72577a987be19cd2dc18acd9e7d3d2717f6f3
diff --git a/lib/koala/http_services/net_http_service.rb b/lib/koala/http_services/net_http_service.rb index <HASH>..<HASH> 100644 --- a/lib/koala/http_services/net_http_service.rb +++ b/lib/koala/http_services/net_http_service.rb @@ -72,7 +72,7 @@ module Koala # For HTTPS requests, set the proper CA certificates if private_request http.use_ssl = true - http.verify_mode = OpenSSL::SSL::VERIFY_PEER + http.verify_mode = options[:verify_mode] || OpenSSL::SSL::VERIFY_PEER options[:ca_file] ||= ca_file http.ca_file = options[:ca_file] if options[:ca_file] && File.exists?(options[:ca_file])
Added support for setting the http verify_mode
arsduo_koala
train
rb
6b4b47a882da74e19ee5e5c3916f998431b9aedd
diff --git a/tests/FluentDOM/CoreTest.php b/tests/FluentDOM/CoreTest.php index <HASH>..<HASH> 100644 --- a/tests/FluentDOM/CoreTest.php +++ b/tests/FluentDOM/CoreTest.php @@ -163,14 +163,29 @@ class FluentDOMCoreTest extends PHPUnit_Framework_TestCase { /** * @group Properties + * @covers FluentDOMCore::__isset + */ + public function testIssetPropertyXpath() { + $fd = $this->getFluentDOMCoreFixtureFromString(self::XML); + $this->assertTrue(isset($fd->xpath)); + } + + /** + * @group Properties * @covers FluentDOMCore::__get - * @covers FluentDOMCore::__set * @covers FluentDOMCore::_xpath */ - public function testPropertyXpath() { + public function testGetPropertyXpath() { $fd = $this->getFluentDOMCoreFixtureFromString(self::XML); - $this->assertTrue(isset($fd->xpath)); $this->assertTrue($fd->xpath instanceof DOMXPath); + } + + /** + * @group Properties + * @covers FluentDOMCore::__set + */ + public function testSetPropertyXpath() { + $fd = $this->getFluentDOMCoreFixtureFromString(self::XML); try { $fd->xpath = NULL; $this->fail('An expected exception has not been raised.');
- Tested: splitting FluentDOMCore::$xpath test in 3 separate tests
ThomasWeinert_FluentDOM
train
php
fafabbb4263f29b7313cae148e5450a16f8cac09
diff --git a/Kwc/Abstract/Image/DimensionField.js b/Kwc/Abstract/Image/DimensionField.js index <HASH>..<HASH> 100644 --- a/Kwc/Abstract/Image/DimensionField.js +++ b/Kwc/Abstract/Image/DimensionField.js @@ -15,6 +15,11 @@ Kwc.Abstract.Image.DimensionField = Ext.extend(Ext.form.Field, { }, setValue: function(v) { + if (v == '') { + var firstKey = Object.keys(this.dimensions)[0]; + v = this.dimensions[firstKey]; + v.dimension = firstKey; + } this.value = v; if (this.rendered) { if (v.dimension) {
Init dimension-value with first defined dimension if empty string set This is needed because it's not possible to create an image without dimension-value. So a default value is needed if the user doesn't explicitly defines a value or there is only a single dimension.
koala-framework_koala-framework
train
js
697995131c30897fe3a8611f680697866153ef80
diff --git a/jawr-core/src/main/java/net/jawr/web/resource/handler/reader/ServletContextResourceReaderHandler.java b/jawr-core/src/main/java/net/jawr/web/resource/handler/reader/ServletContextResourceReaderHandler.java index <HASH>..<HASH> 100644 --- a/jawr-core/src/main/java/net/jawr/web/resource/handler/reader/ServletContextResourceReaderHandler.java +++ b/jawr-core/src/main/java/net/jawr/web/resource/handler/reader/ServletContextResourceReaderHandler.java @@ -95,6 +95,10 @@ public class ServletContextResourceReaderHandler implements tempWorkingDirectory = jawrConfig.getJawrWorkingDirectory(); } + if(tempWorkingDirectory == null){ + throw new IllegalStateException("There is no temporary directory configured for this web application.\n" + + "The servlet context attribute '"+JawrConstant.SERVLET_CONTEXT_TEMPDIR+"' should contain the temporary directory attribute."); + } this.servletContext = servletContext; this.generatorRegistry = generatorRegistry; this.generatorRegistry.setResourceReaderHandler(this);
Fix issue JAWR-<I> JAWR should throw an exception on start up if javax.servlet.context.tempdir is null
j-a-w-r_jawr-main-repo
train
java
58bed0184fe12ab2252f5deadedda6f2440bcfca
diff --git a/lib/mixins/nestable.rb b/lib/mixins/nestable.rb index <HASH>..<HASH> 100644 --- a/lib/mixins/nestable.rb +++ b/lib/mixins/nestable.rb @@ -4,7 +4,7 @@ module Nestable # Setup an accessor for all nested instances. attr_accessor *mapping.keys # Create a nested instance automatically on initialize. - self.define_method(:initialize) do |arguments = nil| + define_method(:initialize) do |arguments = nil| mapping.each do |attribute, klass| self.instance_variable_set "@#{attribute}".to_sym, klass.new end
Call private method define_method correctly.
b4mboo_git-review
train
rb
04377b096e6fe2c318c51c59103345221d3a9b6b
diff --git a/code/dispatcher/response/transport/http.php b/code/dispatcher/response/transport/http.php index <HASH>..<HASH> 100644 --- a/code/dispatcher/response/transport/http.php +++ b/code/dispatcher/response/transport/http.php @@ -174,7 +174,7 @@ class KDispatcherResponseTransportHttp extends KDispatcherResponseTransportAbstr } //Add Content-Length if not present - if(!$response->headers->has('Content-Length')) { + if(!$response->headers->has('Content-Length') && $response->getStream()->getSize()) { $response->headers->set('Content-Length', $response->getStream()->getSize()); }
re #<I> : Do not set the content length if the stream is empty.
timble_kodekit
train
php
320858754f6bbdec2c0933c0fa69b5274265d8a0
diff --git a/shared/test/render-dumb-sheet.js b/shared/test/render-dumb-sheet.js index <HASH>..<HASH> 100644 --- a/shared/test/render-dumb-sheet.js +++ b/shared/test/render-dumb-sheet.js @@ -52,7 +52,8 @@ function onDisplay (ev, msg) { try { ReactDOM.render(displayTree, appEl, () => { // Remove pesky blinking cursors - if (document.activeElement.tagName === 'INPUT') { + if (document.activeElement.tagName === 'INPUT' || + document.activeElement.tagName === 'TEXTAREA') { document.activeElement.blur() }
visdiff: Blur textareas before screenshotting
keybase_client
train
js
833e0e5daf19fecb35a0b79f4b99866c03d14e53
diff --git a/spec/lib/guard/commander_spec.rb b/spec/lib/guard/commander_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/guard/commander_spec.rb +++ b/spec/lib/guard/commander_spec.rb @@ -95,6 +95,7 @@ describe Guard::Commander do subject { ::Guard.setup } before do + allow(::Guard::Notifier).to receive(:turn_on) allow(::Guard).to receive(:runner) { runner } allow(::Guard).to receive(:within_preserved_state).and_yield allow(::Guard::UI).to receive(:info) @@ -154,6 +155,7 @@ describe Guard::Commander do subject { ::Guard.setup } before do + allow(::Guard::Notifier).to receive(:turn_on) allow(::Guard).to receive(:runner) { runner } allow(::Guard).to receive(:within_preserved_state).and_yield allow(::Guard::UI).to receive(:action_with_scopes) @@ -190,6 +192,7 @@ describe Guard::Commander do describe '.within_preserved_state' do subject { ::Guard.setup } before do + allow(::Guard::Notifier).to receive(:turn_on) allow(subject).to receive(:interactor). and_return(double('interactor').as_null_object) end
add missing notifier stubs
guard_guard
train
rb
54b8a8619f1264bac2c148586083f83be33366e2
diff --git a/src/main/java/de/btobastian/javacord/ImplDiscordAPI.java b/src/main/java/de/btobastian/javacord/ImplDiscordAPI.java index <HASH>..<HASH> 100644 --- a/src/main/java/de/btobastian/javacord/ImplDiscordAPI.java +++ b/src/main/java/de/btobastian/javacord/ImplDiscordAPI.java @@ -447,7 +447,7 @@ public class ImplDiscordAPI implements DiscordAPI { params.put("icon", "data:image/jpg;base64," + Base64.encodeBytes(os.toByteArray())); } params.put("name", name); - params.put("region", region == null ? Region.US_WEST : region); + params.put("region", region == null ? Region.US_WEST.getKey() : region.getKey()); final SettableFuture<Server> settableFuture; synchronized (listenerLock) { HttpResponse<JsonNode> response = Unirest.post("https://discordapp.com/api/guilds")
Fixed bug when creating a new server
Javacord_Javacord
train
java
e65ea11f8f53a9270d2fa62d00d3337c6ab6145c
diff --git a/impala/_rpc/hiveserver2.py b/impala/_rpc/hiveserver2.py index <HASH>..<HASH> 100644 --- a/impala/_rpc/hiveserver2.py +++ b/impala/_rpc/hiveserver2.py @@ -362,7 +362,7 @@ def database_exists(service, session_handle, hs2_protocol_version, db_name): hs2_protocol_version=hs2_protocol_version) exists = False for result in results: - if result[0] == db_name: + if result[0].lower() == db_name.lower(): exists = True close_operation(service, operation_handle) return exists @@ -391,7 +391,7 @@ def table_exists(service, session_handle, hs2_protocol_version, table_name, hs2_protocol_version=hs2_protocol_version) exists = False for result in results: - if result[2] == table_name: + if result[2].lower() == table_name.lower(): exists = True close_operation(service, operation_handle) return exists
database_exists and table_exists would return False if passed names are not in lowercase
cloudera_impyla
train
py
648f6a3ebb8c3346a6ae14651bfec75c0c97f06d
diff --git a/controller/src/main/java/org/jboss/as/controller/remote/IdentityAddressProtocolUtil.java b/controller/src/main/java/org/jboss/as/controller/remote/IdentityAddressProtocolUtil.java index <HASH>..<HASH> 100644 --- a/controller/src/main/java/org/jboss/as/controller/remote/IdentityAddressProtocolUtil.java +++ b/controller/src/main/java/org/jboss/as/controller/remote/IdentityAddressProtocolUtil.java @@ -154,7 +154,7 @@ class IdentityAddressProtocolUtil { final int itemCount = input.readInt(); Principal principal = null; - Set<String> roles = new HashSet<>(itemCount - 2); + Set<String> roles = new HashSet<>(Math.max(itemCount - 2, 0)); InetAddress sourceAddress = null; for (int i = 0; i < itemCount; i++) { byte type = input.readByte();
[WFCORE-<I>] Don't assume itemCount is always at least 2
wildfly_wildfly-core
train
java
90d9aacadcf424aa5a3d1888a9634aaa1f30abfe
diff --git a/src/components/labels/labels.js b/src/components/labels/labels.js index <HASH>..<HASH> 100644 --- a/src/components/labels/labels.js +++ b/src/components/labels/labels.js @@ -495,7 +495,7 @@ var Labels = Component.extend({ .remove(); this.entityLines .enter().append('g') - .attr("class", _cssPrefix + "-entity") + .attr("class", function(d, index){return _cssPrefix + "-entity line-" + d[KEY]}) .each(function(d, index) { _this.label.line(d3.select(this)); });
Add same class solution to label leash too
vizabi_vizabi
train
js
8a1408b7b23fbf5f08e4c2bda94e222ba066db1e
diff --git a/app/assets/javascripts/lato_core/vendors/jquery.floatThead.js b/app/assets/javascripts/lato_core/vendors/jquery.floatThead.js index <HASH>..<HASH> 100755 --- a/app/assets/javascripts/lato_core/vendors/jquery.floatThead.js +++ b/app/assets/javascripts/lato_core/vendors/jquery.floatThead.js @@ -20,7 +20,7 @@ $.floatThead = $.floatThead || {}; $.floatThead.defaults = { headerCellSelector: 'tr:visible:first>*:visible', //thead cells are this. - zIndex: 1001, //zindex of the floating thead (actually a container div) + zIndex: 99, //zindex of the floating thead (actually a container div) position: 'auto', // 'fixed', 'absolute', 'auto'. auto picks the best for your table scrolling type. top: 0, //String or function($table) - offset from top of window where the header should not pass above bottom: 0, //String or function($table) - offset from the bottom of the table where the header should stop scrolling
update z-index of fixed head on table fixed
ideonetwork_lato-core
train
js
758b6c4e7e50f8c79ac1023bccb35f4c7dd0ce06
diff --git a/lib/specinfra/backend/docker.rb b/lib/specinfra/backend/docker.rb index <HASH>..<HASH> 100644 --- a/lib/specinfra/backend/docker.rb +++ b/lib/specinfra/backend/docker.rb @@ -11,7 +11,7 @@ module Specinfra::Backend if image = Specinfra.configuration.docker_image @images = [] - @base_image = ::Docker::Image.get(image) + @base_image = get_or_pull_image(image) create_and_start_container ObjectSpace.define_finalizer(self, proc { cleanup_container }) @@ -90,5 +90,13 @@ module Specinfra::Backend CommandResult.new :stdout => [stdout].join, :stderr => err.join, :exit_status => (status || 1) end + + def get_or_pull_image(name) + begin + ::Docker::Image.get(name) + rescue ::Docker::Error::NotFoundError + ::Docker::Image.create('fromImage' => name) + end + end end end
Pull a docker image if it is not found.
mizzy_specinfra
train
rb
4012f0ed9fc412680a56748dac8feba93336e495
diff --git a/src/internal/fragments/_helpers/Evaluator.js b/src/internal/fragments/_helpers/Evaluator.js index <HASH>..<HASH> 100644 --- a/src/internal/fragments/_helpers/Evaluator.js +++ b/src/internal/fragments/_helpers/Evaluator.js @@ -73,6 +73,7 @@ return this; }, + // TODO should evaluators ever get torn down? teardown: function () { while ( this.refs.length ) { this.refs.pop().teardown(); @@ -80,6 +81,15 @@ clearCache( this.root, this.keypath ); this.root._evaluators[ this.keypath ] = null; + }, + + // This method forces the evaluator to sync with the current model + // in the case of a smart update + refresh: function () { + var i = this.refs.length; + while ( i-- ) { + this.refs[i].update(); + } } };
added refresh method to evaluators
ractivejs_ractive
train
js
4b488b78c77e2c2f5d8fbb30c50296f382b214db
diff --git a/lib/transport.js b/lib/transport.js index <HASH>..<HASH> 100644 --- a/lib/transport.js +++ b/lib/transport.js @@ -25,8 +25,8 @@ Transport.doRequest = function(opts, body, fn) { // Define the request. var req = HTTPS.request(opts, function (response) { - // We accept only 200. - if (response.statusCode == 200) { + // We accept only status codes from 200-399. + if (response.statusCode > 199 && response.statusCode < 400) { var responseData = ''; response.on('data', function (bytes) { responseData += bytes; @@ -52,7 +52,9 @@ Transport.doRequest = function(opts, body, fn) { }); // Write the body and trigger the request. - req.write(body); + if (body) { + req.write(body); + } req.end(); }
Fixed status code checking. Now, any HTTP status code > <I> and < <I> is considered a non-failure. Not sure what to do about 1XX respones.
hpcloud_hpcloud-js
train
js
4d5ceebcd4aa88952abc390b32bcb2f47d7555a8
diff --git a/src/main/java/com/couchbase/cblite/CBLDatabase.java b/src/main/java/com/couchbase/cblite/CBLDatabase.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/couchbase/cblite/CBLDatabase.java +++ b/src/main/java/com/couchbase/cblite/CBLDatabase.java @@ -2257,7 +2257,10 @@ public class CBLDatabase { } // Notify the corresponding instantiated CBLDocument object (if any): - getCachedDocument(rev.getDocId()).revisionAdded(changeNotification); + CBLDocument cachedDocument = getCachedDocument(rev.getDocId()); + if (cachedDocument != null) { + cachedDocument.revisionAdded(changeNotification); + } notifyChangeListeners(changeNotification); }
this was causing exceptions, add a specific check for null
couchbase_couchbase-lite-java-core
train
java
5089d2990094e0a50684a2e42f1b01aa4c3c19b8
diff --git a/src/Codeception/Step.php b/src/Codeception/Step.php index <HASH>..<HASH> 100644 --- a/src/Codeception/Step.php +++ b/src/Codeception/Step.php @@ -245,7 +245,7 @@ abstract class Step $text = preg_replace('/([A-Z]+)([A-Z][a-z])/', '\\1 \\2', $text); $text = preg_replace('/([a-z\d])([A-Z])/', '\\1 \\2', $text); $text = preg_replace('~\bdont\b~', 'don\'t', $text); - return strtolower($text); + return mb_strtolower($text, 'UTF-8'); } public function run(ModuleContainer $container = null)
Fixed humanize for utf8 strings (#<I>) * Fixed humanize for utf8 strings * added encoding to case convertion and updated conversion to always be mb_
Codeception_base
train
php
87d32807abd5b55c81bb9a1ca2cc700c6bd828d8
diff --git a/abilian/services/security/service.py b/abilian/services/security/service.py index <HASH>..<HASH> 100644 --- a/abilian/services/security/service.py +++ b/abilian/services/security/service.py @@ -478,6 +478,9 @@ class SecurityService(Service): for r in roles: valid_roles.add(Role(r)) + if Anonymous in valid_roles: + return True + # implicit role-permission mapping if permission in (READ, WRITE,): valid_roles.add(Role('writer')) diff --git a/abilian/services/security/tests.py b/abilian/services/security/tests.py index <HASH>..<HASH> 100644 --- a/abilian/services/security/tests.py +++ b/abilian/services/security/tests.py @@ -254,6 +254,9 @@ class SecurityTestCase(IntegrationTestCase): assert not security.has_permission(user, permission) assert security.has_permission(user, permission, roles=role) + # Permission always granted if Anonymous role + assert security.has_permission(user, permission, roles=Anonymous) + # test convert legacy permission & implicit mapping security.grant_role(user, 'reader') assert security.has_permission(user, 'read')
fix has_permission when Anonymous is a valid role
abilian_abilian-core
train
py,py
2c6e998f4189b9abe9fc17797749204644dfb4fa
diff --git a/index.php b/index.php index <HASH>..<HASH> 100644 --- a/index.php +++ b/index.php @@ -78,7 +78,8 @@ } else { $currlang = current_language(); $langs = get_list_of_languages(); - $langmenu = popup_form ($CFG->wwwroot .'/index.php?lang=', $langs, 'chooselang', $currlang, '', '', '', true); + $langlabel = '<span class="accesshide">'.get_string('language').':</span>'; + $langmenu = popup_form($CFG->wwwroot .'/index.php?lang=', $langs, 'chooselang', $currlang, '', '', '', true, 'self', $langlabel); } $PAGE = page_create_object(PAGE_COURSE_VIEW, SITEID);
Added label to language menu for accessibility MDL-<I>
moodle_moodle
train
php
96bf2b13299ebdc2e579117261c64d957405a78c
diff --git a/gitlab.py b/gitlab.py index <HASH>..<HASH> 100644 --- a/gitlab.py +++ b/gitlab.py @@ -143,6 +143,8 @@ class Gitlab(object): l = [cls(self, item) for item in r.json] if kwargs: for k, v in kwargs.items(): + if k in ('page', 'per_page'): + continue for obj in l: obj.__dict__[k] = v return l
never add page and per_page attributes to the objects
python-gitlab_python-gitlab
train
py
2a535a934a82aa8987f477799997d8360629b4f4
diff --git a/spec/user_spec.rb b/spec/user_spec.rb index <HASH>..<HASH> 100644 --- a/spec/user_spec.rb +++ b/spec/user_spec.rb @@ -117,7 +117,7 @@ describe "empty db" do end it "supports siblings" do - User.closure_tree_options[:sort_order].should be_nil + User.order_option.should be_nil a = User.create(:email => "a") b1 = a.children.create(:email => "b1") b2 = a.children.create(:email => "b2")
use the helper method, rather than directly access the options hash
ClosureTree_closure_tree
train
rb
5510acbcbf60da57f19d24323b8b46bbf98f8f26
diff --git a/test/host/java.js b/test/host/java.js index <HASH>..<HASH> 100644 --- a/test/host/java.js +++ b/test/host/java.js @@ -7,11 +7,15 @@ function getEnv (name) { return String(java.lang.System.getProperty(name)); } -var safeFunc = Function, +var commandLineParameters, gpfPath = getEnv("user.dir"), pathSeparator = getEnv("file.separator"), readApi; +/* jshint ignore:start */ +commandLineParameters = arguments; +/* jshint ignore:end */ + if ("undefined" === typeof readFile) { // Nashorn readApi = function (path) { @@ -32,7 +36,7 @@ load([ /*global loadGpfAndTests*/ loadGpfAndTests({ - parameters: safeFunc("return this.arguments;")(), // 'Global' object + parameters: commandLineParameters, gpfPath: gpfPath, pathSeparator: pathSeparator, log: function (text) {
Simplification (#<I>)
ArnaudBuchholz_gpf-js
train
js
ddcd7d47b502f5f7931054dd4c39936f8e11d909
diff --git a/bakery_cli/bakery.py b/bakery_cli/bakery.py index <HASH>..<HASH> 100644 --- a/bakery_cli/bakery.py +++ b/bakery_cli/bakery.py @@ -87,13 +87,6 @@ class Bakery(object): def addLoggingToFile(self): if not os.path.exists(self.build_dir): os.makedirs(self.build_dir) - else: - index = 1 - b = self.build_dir - while os.path.exists(b + '.' + str(index)): - index += 1 - self.build_dir = b + '.' + str(index) - os.makedirs(self.build_dir) chf = logging.FileHandler(op.join(self.build_dir, 'buildlog.txt'))
auto-indexing build dirs is unecessary and has been breaking the compatibility between build/report scripts
googlefonts_fontbakery
train
py
9335f83930d89cd7cea10a2e5f537cd65bf7df06
diff --git a/packages/reftools/lib/jptr.js b/packages/reftools/lib/jptr.js index <HASH>..<HASH> 100644 --- a/packages/reftools/lib/jptr.js +++ b/packages/reftools/lib/jptr.js @@ -55,7 +55,7 @@ function jptr(obj, prop, newValue) { components[i] = (i > 0) ? components[i-1] : ''; // backtrack to indexed property name } - if ((index != -1) || obj.hasOwnProperty(components[i])) { + if ((index != -1) || (obj && obj.hasOwnProperty(components[i]))) { if (index >= 0) { if (setAndLast) { obj[index] = newValue;
fix: reftools/jptr protect against null input object
Mermade_oas-kit
train
js
e0bc8fafc5026463a2467c67dbb8355257fae201
diff --git a/driver-core/src/main/com/mongodb/MongoClientSettings.java b/driver-core/src/main/com/mongodb/MongoClientSettings.java index <HASH>..<HASH> 100644 --- a/driver-core/src/main/com/mongodb/MongoClientSettings.java +++ b/driver-core/src/main/com/mongodb/MongoClientSettings.java @@ -893,8 +893,6 @@ public final class MongoClientSettings { + ", uuidRepresentation=" + uuidRepresentation + ", serverApi=" + serverApi + ", autoEncryptionSettings=" + autoEncryptionSettings - + ", heartbeatSocketTimeoutSetExplicitly=" + heartbeatSocketTimeoutSetExplicitly - + ", heartbeatConnectTimeoutSetExplicitly=" + heartbeatConnectTimeoutSetExplicitly + ", contextProvider=" + contextProvider + '}'; }
Remove extraneous fields from MongoClientSettings#toString JAVA-<I>
mongodb_mongo-java-driver
train
java
810192b15137469f216ee9a33c70aceef15029f4
diff --git a/testsuite/validation_test.py b/testsuite/validation_test.py index <HASH>..<HASH> 100644 --- a/testsuite/validation_test.py +++ b/testsuite/validation_test.py @@ -54,8 +54,8 @@ class SubmissionFileValidationTest(unittest.TestCase): ) self.validator.print_errors(valid_sub_yaml) - def test_valid_v0_submission_yaml_against_v2(self): - print('___SUBMISSION_FILE_VALIDATION: Testing valid v0 yaml submission against v2 schema___') + def test_valid_v0_submission_yaml_against_v1(self): + print('___SUBMISSION_FILE_VALIDATION: Testing valid v0 yaml submission against v1 schema___') self.validator = None self.validator = SubmissionFileValidator()
Fixed remaining reference to v2 in test
HEPData_hepdata-validator
train
py
50b5f741d9ae4c13070af49a6844e212b5891959
diff --git a/lib/resque/worker.rb b/lib/resque/worker.rb index <HASH>..<HASH> 100644 --- a/lib/resque/worker.rb +++ b/lib/resque/worker.rb @@ -158,7 +158,7 @@ module Resque end def job - Resque.redis_get_object [ :worker, id.to_s ] + Resque.redis_get_object([ :worker, id.to_s ]) || {} end alias_method :procesing, :job
jobs should always return a hash
resque_resque
train
rb
0d528d9138249ea3e24a584c70add5e7d31d6e55
diff --git a/BeanShell/src/bsh/NameSpace.java b/BeanShell/src/bsh/NameSpace.java index <HASH>..<HASH> 100644 --- a/BeanShell/src/bsh/NameSpace.java +++ b/BeanShell/src/bsh/NameSpace.java @@ -1714,6 +1714,7 @@ public class NameSpace throws UtilEvalError { String accessorName = Reflect.accessorName( "set", propName ); + Class[] classArray = new Class[] {value==null ? null : value.getClass()}; BshMethod m = getMethod(accessorName, classArray);
Additional work on object property setters Remaining issues: - Wrapping and Unwrapping not being done correctly - Scoping tests still broken
beanshell_beanshell
train
java
1c1cfc263bc54e570cf1bedffd9647cf8c449496
diff --git a/src/api/integrations.js b/src/api/integrations.js index <HASH>..<HASH> 100644 --- a/src/api/integrations.js +++ b/src/api/integrations.js @@ -57,6 +57,7 @@ const integrations = { }]), messenger: new IntegrationType(['pageAccessToken', 'appId', 'appSecret']), twilio: new IntegrationType(['accountSid', 'authToken', 'phoneNumberSid']), + messagebird: new IntegrationType(['accessKey', 'originator']), telegram: new IntegrationType(['token']), line: new IntegrationType(['channelAccessToken', 'channelSecret']), viber: new IntegrationType(['token']),
Add messagebird to integrations (#<I>)
smooch_smooch-core-js
train
js
e0c080c79b298ad5d3319b7d41ccfed5bdab8e01
diff --git a/website/data/version.js b/website/data/version.js index <HASH>..<HASH> 100644 --- a/website/data/version.js +++ b/website/data/version.js @@ -1 +1 @@ -export default '1.1.2' +export default '1.1.3'
website: publish <I> release (#<I>)
hashicorp_nomad
train
js
a5ffbff4d1b92431670926fec608310ba3e5c94c
diff --git a/src/configure/webpack/plugins/base.js b/src/configure/webpack/plugins/base.js index <HASH>..<HASH> 100644 --- a/src/configure/webpack/plugins/base.js +++ b/src/configure/webpack/plugins/base.js @@ -27,7 +27,7 @@ function buildPlugins (buildTarget, projectPath) { let plugins = [ new CleanWebpackPlugin(['dist'], { root: projectPath, - verbose: true + verbose: false }) ] diff --git a/src/configure/webpack/plugins/base.spec.js b/src/configure/webpack/plugins/base.spec.js index <HASH>..<HASH> 100644 --- a/src/configure/webpack/plugins/base.spec.js +++ b/src/configure/webpack/plugins/base.spec.js @@ -17,6 +17,7 @@ describe('configure webpack base', function () { const cleanWebpackPlugin = commons[0] expect(cleanWebpackPlugin.paths).to.eql(['dist']) + expect(cleanWebpackPlugin.options.verbose).to.eql(false) expect(cleanWebpackPlugin.options.root).to.eql(projectPath) })
Disable verbosity of clean plugin
saguijs_sagui
train
js,js
f80e9e1aad6f00c8ed3f7a97661c4ed7158941fd
diff --git a/Model/Api/UpdateCart.php b/Model/Api/UpdateCart.php index <HASH>..<HASH> 100644 --- a/Model/Api/UpdateCart.php +++ b/Model/Api/UpdateCart.php @@ -66,7 +66,7 @@ class UpdateCart extends UpdateCartCommon implements UpdateCartInterface * @param CartDataInterfaceFactory $cartDataFactory * @param UpdateCartResultInterfaceFactory $updateCartResultFactory */ - final public function __construct( + public function __construct( UpdateCartContext $updateCartContext, CartDataInterfaceFactory $cartDataFactory, UpdateCartResultInterfaceFactory $updateCartResultFactory diff --git a/Model/Api/UpdateDiscountTrait.php b/Model/Api/UpdateDiscountTrait.php index <HASH>..<HASH> 100644 --- a/Model/Api/UpdateDiscountTrait.php +++ b/Model/Api/UpdateDiscountTrait.php @@ -99,7 +99,7 @@ trait UpdateDiscountTrait * * @param UpdateCartContext $updateCartContext */ - final public function __construct( + public function __construct( UpdateCartContext $updateCartContext ) { $this->ruleRepository = $updateCartContext->getRuleRepository();
Remove final key word (#<I>)
BoltApp_bolt-magento2
train
php,php
cf6f23fac7af5ea914f3a97d77295b1c08aa2ad7
diff --git a/tools/dashboard/src/lovefield_service.js b/tools/dashboard/src/lovefield_service.js index <HASH>..<HASH> 100644 --- a/tools/dashboard/src/lovefield_service.js +++ b/tools/dashboard/src/lovefield_service.js @@ -69,8 +69,13 @@ LovefieldService.prototype.getDbConnection = function() { return this.getDbConnection_; } + var isSafari = function() { + return navigator.userAgent.indexOf('Safari') != -1 && + navigator.userAgent.indexOf('Chrome') == -1; + }; + var connectOptions = { - storeType: navigator.userAgent.indexOf('Safari') != -1 ? + storeType: isSafari() ? lf.schema.DataStoreType.MEMORY : lf.schema.DataStoreType.INDEXED_DB };
Fix Safari browser detection in tools/dashboard. ------------- Created by MOE: <URL>
google_lovefield
train
js
575572035e141f6fefcab3372a5bc3f9d2f2bb6c
diff --git a/TYPO3.Flow/Classes/TYPO3/Flow/Command/ResourceCommandController.php b/TYPO3.Flow/Classes/TYPO3/Flow/Command/ResourceCommandController.php index <HASH>..<HASH> 100644 --- a/TYPO3.Flow/Classes/TYPO3/Flow/Command/ResourceCommandController.php +++ b/TYPO3.Flow/Classes/TYPO3/Flow/Command/ResourceCommandController.php @@ -155,11 +155,10 @@ class ResourceCommandController extends CommandController $this->quit(1); } - $sourceObjects = $sourceCollection->getObjects(); $this->outputLine('Copying resource objects from collection "%s" to collection "%s" ...', [$sourceCollectionName, $targetCollectionName]); $this->outputLine(); - $this->output->progressStart(count($sourceObjects)); + $this->output->progressStart(); foreach ($sourceCollection->getObjects() as $resource) { /** @var \TYPO3\Flow\Resource\Storage\Object $resource */ $this->output->progressAdvance();
BUGFIX: Don't try to count resources for copy command
neos_flow-development-collection
train
php
747cdada05fa6a0888f2e773cd4ea27a5b919474
diff --git a/generated/google/apis/servicecontrol_v1.rb b/generated/google/apis/servicecontrol_v1.rb index <HASH>..<HASH> 100644 --- a/generated/google/apis/servicecontrol_v1.rb +++ b/generated/google/apis/servicecontrol_v1.rb @@ -26,7 +26,7 @@ module Google # @see https://cloud.google.com/service-control/ module ServicecontrolV1 VERSION = 'V1' - REVISION = '20200911' + REVISION = '20200917' # View and manage your data across Google Cloud Platform services AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform' diff --git a/generated/google/apis/servicecontrol_v1/classes.rb b/generated/google/apis/servicecontrol_v1/classes.rb index <HASH>..<HASH> 100644 --- a/generated/google/apis/servicecontrol_v1/classes.rb +++ b/generated/google/apis/servicecontrol_v1/classes.rb @@ -400,8 +400,7 @@ module Google attr_accessor :principal_email # String representation of identity of requesting party. Populated for both - # first and third party identities. Only present for APIs that support third- - # party identities. + # first and third party identities. # Corresponds to the JSON property `principalSubject` # @return [String] attr_accessor :principal_subject
Autogenerated update (<I>-<I>-<I>) Update: - servicecontrol_v1
googleapis_google-api-ruby-client
train
rb,rb
699f9aff2913c94b2bac14e133f190ab73b30fef
diff --git a/napd/nap.py b/napd/nap.py index <HASH>..<HASH> 100644 --- a/napd/nap.py +++ b/napd/nap.py @@ -296,6 +296,20 @@ class Nap: self._logger.debug("add_pool called; spec: %s" % str(attr)) + # check that given schema exists and populate 'schema' with correct id + if 'schema_id' in attr: + schema = self.list_schema({ 'id': attr['schema_id'] }) + if schema == []: + raise NapInputError("non-existing schema specified") + attr['schema'] = schema[0]['id'] + del(attr['schema_id']) + elif 'schema_name' in attr: + schema = self.list_schema({ 'name': attr['schema_name'] }) + if schema == []: + raise NapInputError("non-existing schema specified") + attr['schema'] = schema[0]['id'] + del(attr['schema_name']) + # sanity check - do we have all attributes? req_attr = ['name', 'schema', 'description', 'default_type'] self._check_attr(attr, req_attr, req_attr)
Now able to reference schema by id and name It's now possible to reference the schema both by id and by name when adding a new pool.
SpriteLink_NIPAP
train
py
8a39e82219dce91b0fc4cc44e401b8fc8637193c
diff --git a/karma.conf.js b/karma.conf.js index <HASH>..<HASH> 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,10 +1,13 @@ -const {defaultResolvePlugins, defaultKarmaConfig} = require("@appnest/web-config"); +const {defaultResolvePlugins, defaultKarmaConfig, clean} = require("@appnest/web-config"); const path = require("path"); module.exports = (config) => { config.set({ ...defaultKarmaConfig({ - rollupPlugins: defaultResolvePlugins() + rollupPlugins: [ + clean({targets: ["dist"]}), + ...defaultResolvePlugins() + ] }), basePath: "src", logLevel: config.LOG_INFO
Added cleanup to karma.
andreasbm_web-router
train
js
f1bf914014295ccd106483c614cd085f823f7e03
diff --git a/lib/sensu/io.rb b/lib/sensu/io.rb index <HASH>..<HASH> 100644 --- a/lib/sensu/io.rb +++ b/lib/sensu/io.rb @@ -47,13 +47,12 @@ module Sensu def async_popen(command, data=nil, timeout=nil, &block) execute = Proc.new do begin - output, status = IO.popen(command, 'r+', timeout) do |child| + IO.popen(command, 'r+', timeout) do |child| unless data.nil? child.write(data.to_s) end child.close_write end - [output, status] rescue => error [error.to_s, 2] end diff --git a/spec/io_spec.rb b/spec/io_spec.rb index <HASH>..<HASH> 100644 --- a/spec/io_spec.rb +++ b/spec/io_spec.rb @@ -47,6 +47,16 @@ describe 'Sensu::IO' do File.delete(file_name) end + it 'can execute a command asynchronously' do + async_wrapper do + Sensu::IO.async_popen('echo fail && exit 2') do |output, status| + output.should eq("fail\n") + status.should eq(2) + async_done + end + end + end + it 'can execute a command asynchronously and write to stdin' do timestamp = epoch.to_s file_name = File.join('/tmp', timestamp)
[timeout] additional async_popen() test, popen() returns the output/status array
sensu_sensu
train
rb,rb
57130d07a2e2082b9d5d6229507fead9a600dfa5
diff --git a/spec/unit/locker_spec.rb b/spec/unit/locker_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/locker_spec.rb +++ b/spec/unit/locker_spec.rb @@ -285,6 +285,7 @@ describe Que::Locker do q1.pop locker.stop q2.push nil + t.join DB[:que_jobs].select_map(:job_id).should == [id] end
Fix a rare case wherein an advisory lock may be left open after a spec run.
chanks_que
train
rb
3f4e5ccea6b5a818b32d5062860dca839ddb8510
diff --git a/lib/octopress-deploy/rsync.rb b/lib/octopress-deploy/rsync.rb index <HASH>..<HASH> 100644 --- a/lib/octopress-deploy/rsync.rb +++ b/lib/octopress-deploy/rsync.rb @@ -13,8 +13,8 @@ module Octopress @exclude_from = @options[:exclude_from] @exclude_from = File.expand_path(@exclude_from) if @exclude_from @include = @options[:include] - @exclude_from = @options[:include_from] - @exclude_from = File.expand_path(@include_from) if @include_from + @include_from = @options[:include_from] + @include_from = File.expand_path(@include_from) if @include_from @delete = @options[:delete] || false @pull_dir = @options[:dir] end @@ -67,7 +67,7 @@ module Octopress #{"# include-from: ".ljust(40)} # Path to file containing list of files to include CONFIG end - + end end end
Set @include_from from @options[:include_from].
octopress_deploy
train
rb
b74dc20d07cdded54cec3c748a0a77813d4e83ca
diff --git a/karma.conf.js b/karma.conf.js index <HASH>..<HASH> 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -13,11 +13,6 @@ delete webpackConfig.entry; // Re-enable Buffer since Karma fails to work without it. webpackConfig.node.Buffer = true; -// Work around karma-webpack hanging under webpack 4: -// https://github.com/webpack-contrib/karma-webpack/issues/322 -webpackConfig.optimization.splitChunks = false; -webpackConfig.optimization.runtimeChunk = false; - module.exports = config => { config.set({ plugins: ['karma-webpack', 'karma-firefox-launcher', 'karma-jasmine'],
Remove no longer require karma-webpack config workaround Since the issue it worked around has now been fixed in karma-webpack.
mozilla_treeherder
train
js
2c0ececd7825c5dd5a00e47f1ba9256cb167e4f7
diff --git a/src/sentry_plugins/jira/client.py b/src/sentry_plugins/jira/client.py index <HASH>..<HASH> 100644 --- a/src/sentry_plugins/jira/client.py +++ b/src/sentry_plugins/jira/client.py @@ -1,6 +1,7 @@ from __future__ import absolute_import import logging +import re from hashlib import md5 as _md5 from requests.exceptions import ConnectionError, RequestException @@ -151,8 +152,13 @@ class JIRAClient(object): }) def search_issues(self, project, query): - query = 'project="%s" AND text ~ "%s"' % (project, query) - return self.make_request('get', self.SEARCH_URL, {'jql': query}) + # check if it looks like an issue id + if re.search(r'^[A-Za-z]+-\d+$', query) and project.lower() in query.lower(): + jql = 'id="%s"' % query.replace('"', '\\"') + else: + jql = 'text ~ "%s"' % query.replace('"', '\\"') + jql = 'project="%s" AND %s' % (project, jql) + return self.make_request('get', self.SEARCH_URL, {'jql': jql}) def make_request(self, method, url, payload=None): if url[:4] != "http":
support jira issue ids in search for linking issues (#<I>) * support jira issue ids in search for linking issues * improve regular expression * escape double quotes
getsentry_sentry-plugins
train
py
a4cbf097f20b2d588ffeeebc4bc6b57c22834d27
diff --git a/master/buildbot/db/logs.py b/master/buildbot/db/logs.py index <HASH>..<HASH> 100644 --- a/master/buildbot/db/logs.py +++ b/master/buildbot/db/logs.py @@ -356,11 +356,21 @@ class LogsConnectorComponent(base.DBConnectorComponent): # update log types older than timestamps # we do it first to avoid having UI discrepancy + + # SELECT steps.id from steps WHERE steps.started_at < older_than_timestamp ORDER BY steps.id DESC LIMIT 1; + res = conn.execute( + sa.select([model.steps.c.id]) + .where(model.steps.c.started_at < older_than_timestamp) + .order_by(model.steps.c.id.desc()) + .limit(1) + ) + stepid_max = res.fetchone()[0] + res.close() + + # UPDATE logs SET logs.type = 'd' WHERE logs.stepid <= stepid_max; res = conn.execute( model.logs.update() - .where(model.logs.c.stepid.in_( - sa.select([model.steps.c.id]) - .where(model.steps.c.started_at < older_than_timestamp))) + .where(model.logs.c.stepid <= stepid_max) .values(type='d') ) res.close()
optimize janitor by splitting an expensive SQL query (the list feeding the IN may contain millions of entries) into 2 quick queries, using the fact that steps.id is autoincremented.
buildbot_buildbot
train
py
e4f14c8b7368dae5dc15656febb850a79c01d253
diff --git a/core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/MCMPWebManager.java b/core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/MCMPWebManager.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/MCMPWebManager.java +++ b/core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/MCMPWebManager.java @@ -114,7 +114,7 @@ class MCMPWebManager extends MCMPHandler { String srange = params.get("Range").getFirst(); final RequestData data = buildRequestData(exchange, params); if (srange.equals("NODE")) { - processNodeCommand(exchange, data, MCMPAction.DISABLE); + processNodeCommand(exchange, data, MCMPAction.ENABLE); } if (srange.equals("DOMAIN")) { boolean domain = params.containsKey("Domain");
UNDERTOW-<I> MCMP ENABLE-APP targetting a node does not work
undertow-io_undertow
train
java
067308baa1330ccca97fe47333c52702099facf0
diff --git a/eth/vm/forks/constantinople/opcodes.py b/eth/vm/forks/constantinople/opcodes.py index <HASH>..<HASH> 100644 --- a/eth/vm/forks/constantinople/opcodes.py +++ b/eth/vm/forks/constantinople/opcodes.py @@ -11,7 +11,8 @@ from eth.vm import ( opcode_values, ) from eth.vm.forks.byzantium.opcodes import ( - BYZANTIUM_OPCODES + BYZANTIUM_OPCODES, + ensure_no_static ) from eth.vm.forks.constantinople.constants import ( GAS_EXTCODEHASH_EIP1052 @@ -56,7 +57,7 @@ UPDATED_OPCODES = { gas_cost=constants.GAS_CREATE, )(), opcode_values.SSTORE: as_opcode( - logic_fn=sstore_eip1283, + logic_fn=ensure_no_static(sstore_eip1283), mnemonic=mnemonics.SSTORE, gas_cost=constants.GAS_NULL, ),
eth/vm: fix accidental override of ensure_no_static() in Constantinople. This made the EVM no longer care that SSTORE within a STATICCALL is forbidden. <URL>
ethereum_py-evm
train
py
977ab7a1897c16105a6cff674de69357b8c88f44
diff --git a/qor_job.go b/qor_job.go index <HASH>..<HASH> 100644 --- a/qor_job.go +++ b/qor_job.go @@ -76,7 +76,13 @@ type QorJob struct { ResultsTable ResultsTable `sql:"size:65532"` mutex sync.Mutex `sql:"-"` - Job *Job `sql:"-"` + + // Add `valid:"-"`` to make the QorJob work well with qor/validations + // When the qor/validations auto exec the validate struct callback we get error + // runtime: goroutine stack exceeds 1000000000-byte limit + // fatal error: stack overflow + Job *Job `sql:"-" valid:"-"` + audited.AuditedModel serializable_meta.SerializableMeta }
fix stack overflow when work with import qor/validations
qor_worker
train
go
2ac245aba8f1bea59cc0bbfe10a1678ef91636d1
diff --git a/grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsApplication.java b/grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsApplication.java index <HASH>..<HASH> 100644 --- a/grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsApplication.java +++ b/grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsApplication.java @@ -685,7 +685,11 @@ public class DefaultGrailsApplication extends AbstractGrailsApplication implemen initialised = true; } - protected void initialiseGroovyExtensionModules() { + private static boolean extensionMethodsInitialized = false; + protected static void initialiseGroovyExtensionModules() { + if(extensionMethodsInitialized) return; + + extensionMethodsInitialized = true; Map<CachedClass, List<MetaMethod>> map = new HashMap<CachedClass, List<MetaMethod>>(); ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
Only initialise extension methods once.
grails_grails-core
train
java
611585ac05d1c3569a4263c6f1e4d34ed97d6c29
diff --git a/pytuya/__init__.py b/pytuya/__init__.py index <HASH>..<HASH> 100644 --- a/pytuya/__init__.py +++ b/pytuya/__init__.py @@ -32,7 +32,7 @@ version = version_string = __version__ = '%d.%d.%d' % version_tuple __author__ = 'clach04' log = logging.getLogger(__name__) -logging.basicConfig() # TODO include function name/line numbers in log +#logging.basicConfig() # TODO include function name/line numbers in log #log.setLevel(level=logging.DEBUG) # Debug hack! log.info('Python %s on %s', sys.version, sys.platform) diff --git a/tests.py b/tests.py index <HASH>..<HASH> 100755 --- a/tests.py +++ b/tests.py @@ -14,6 +14,7 @@ import struct # Enable info logging to see version information log = logging.getLogger('pytuya') +logging.basicConfig() # TODO include function name/line numbers in log log.setLevel(level=logging.INFO) #log.setLevel(level=logging.DEBUG) # Debug hack!
Remove logging basic config require caller to setup logging Resolve issue #<I>.
clach04_python-tuya
train
py,py
02d176f14b80862ef12896e734a4e06c0059a654
diff --git a/src/utils/normalizeCode.js b/src/utils/normalizeCode.js index <HASH>..<HASH> 100644 --- a/src/utils/normalizeCode.js +++ b/src/utils/normalizeCode.js @@ -1,6 +1,6 @@ const normalizeCode = code => code - .replace(/^(( )+)/mg, (_, p1) => ( - '\t'.repeat(p1.length / 2) + .replace(/^((\s\s)+)/mg, (_, indentation) => ( + ' '.repeat(indentation.length / 2) )) export default normalizeCode
Fix normalizeCode to use two spaces instead of tabs
FormidableLabs_react-live
train
js
8e44971b3da6eeeca75875340bacb5f5f0c22ea9
diff --git a/provisioner/puppet-masterless/provisioner.go b/provisioner/puppet-masterless/provisioner.go index <HASH>..<HASH> 100644 --- a/provisioner/puppet-masterless/provisioner.go +++ b/provisioner/puppet-masterless/provisioner.go @@ -249,7 +249,7 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error { return err } - if cmd.ExitStatus != 0 { + if cmd.ExitStatus != 0 && cmd.ExitStatus != 2 { return fmt.Errorf("Puppet exited with a non-zero exit status: %d", cmd.ExitStatus) }
provisioner/puppet-masterless: proper exit code check
hashicorp_packer
train
go
4aab8b736d8fef76259d0e3e102b8148ff7f9845
diff --git a/lib/Rails/Cache/Store/FileStore/Entry.php b/lib/Rails/Cache/Store/FileStore/Entry.php index <HASH>..<HASH> 100755 --- a/lib/Rails/Cache/Store/FileStore/Entry.php +++ b/lib/Rails/Cache/Store/FileStore/Entry.php @@ -153,8 +153,18 @@ class Entry private function _delete_file() { - if (is_file($this->_file_name())) - return unlink($this->_file_name()); + if (is_file($this->_file_name())) { + /** + * Even though this happens only if is_file is true, + * sometimes the file is already gone by the time unlink + * is executed. + */ + try { + unlink($this->_file_name()); + } catch (Rails\Exception\PHPError\Warning $e) { + return false; + } + } return true; }
Try-catched file cache store entry deletion. Sometimes the file that is going to be deleted is already deleted, and unlink would trigger an error.
railsphp_railsphp
train
php
6a730bff1977c3d74c5404d22b1b3c2403d3390a
diff --git a/zubbi/scraper/main.py b/zubbi/scraper/main.py index <HASH>..<HASH> 100644 --- a/zubbi/scraper/main.py +++ b/zubbi/scraper/main.py @@ -306,7 +306,7 @@ def scrape_outdated(config, connections, tenant_parser, repo_cache): # Check the repo cache for entries older than 24 hours for key, val in repo_cache.items(): # TODO We should clean up repos containing 'None' providers some time - if val["scrape_time"] < threshold and val["provider"] is not None: + if val["scrape_time"] < threshold and val.get("provider") is not None: repo_list.append(key) if repo_list:
Fix provider lookup in in repo cache
bmwcarit_zubbi
train
py
2337db59072d78401be11e344b2be3ff649cfc8f
diff --git a/isochrones/starmodel.py b/isochrones/starmodel.py index <HASH>..<HASH> 100644 --- a/isochrones/starmodel.py +++ b/isochrones/starmodel.py @@ -492,7 +492,8 @@ class StarModel(object): # Note: this is just assuming proper order. # Is this OK? Should keep eye out for bugs here. - masses = p[i:i+N[s]] + # Compute masses from eeps + masses = [self.ic.mass(eep, age, feh) for eep in p[i:i+N[s]]] # Mass prior for primary lnp += np.log(self.prior('mass', masses[0]))
compute masses from eeps
timothydmorton_isochrones
train
py
ffd9c0c222de60054cee7e040f53e63be029033a
diff --git a/api.go b/api.go index <HASH>..<HASH> 100644 --- a/api.go +++ b/api.go @@ -40,8 +40,8 @@ func GetBlockHeight() (int, error) { // GetDBlock gets a Directory Block by the Directory Block Hash. The Directory // Block should contain a series of Entry Block Hashes. -func GetDBlock(hash string) (DBlock, error) { - var dblock DBlock +func GetDBlock(hash string) (*DBlock, error) { + dblock := new(DBlock) api := fmt.Sprintf("http://%s/v1/dblock/%s", server, hash) resp, err := http.Get(api)
update to dblock typedef
FactomProject_factom
train
go
eb189e08f2e0f3bafa083754dabcddb1ff12b64a
diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index <HASH>..<HASH> 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -4097,9 +4097,9 @@ class assign { } if ($this->get_instance()->teamsubmission) { - $submission = $this->get_group_submission($USER->id, 0, false); + $submission = $this->get_group_submission($userid, 0, false); } else { - $submission = $this->get_user_submission($USER->id, false); + $submission = $this->get_user_submission($userid, false); } if (!$submission) {
MDL-<I>: Assignment revert to draft should user the selected user id, not the logged in user id.
moodle_moodle
train
php
9fe75ee4e98c5ca9808145d1546d27dbccfd881a
diff --git a/spec/unit/software_spec.rb b/spec/unit/software_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/software_spec.rb +++ b/spec/unit/software_spec.rb @@ -345,6 +345,7 @@ module Omnibus before do # sles identifies as suse stub_ohai(platform: "suse", version: "11.4") + allow(subject).to receive(:which).with("gcc-4.8").and_return(false) end it "sets the defaults" do expect(subject.with_standard_compiler_flags).to eq( @@ -384,6 +385,7 @@ module Omnibus before do # sles identifies as suse stub_ohai(platform: "suse", version: "12.2") + allow(subject).to receive(:which).with("gcc-4.8").and_return(false) end it "sets the defaults" do
Stub check for gcc-<I> Whether or not this exists changes based on where the tests are running.
chef_omnibus
train
rb
0f34de01822e739d44188f49f51234d27ca3c8a0
diff --git a/lib/pay/billable/sync_email.rb b/lib/pay/billable/sync_email.rb index <HASH>..<HASH> 100644 --- a/lib/pay/billable/sync_email.rb +++ b/lib/pay/billable/sync_email.rb @@ -15,7 +15,7 @@ module Pay extend ActiveSupport::Concern included do - after_update :enqeue_sync_email_job, + after_commit :enqeue_sync_email_job, if: :should_sync_email_with_processor? end @@ -32,7 +32,7 @@ module Pay def enqeue_sync_email_job # Only update if the processor id is the same # This prevents duplicate API hits if this is their first time - if processor_id? && !processor_id_changed? && saved_change_to_email? + if processor_id? && !saved_change_to_processor_id? && saved_change_to_email? EmailSyncJob.perform_later(id) end end
Only queue the sync if the change is committed. Otherwise you could queue up a job if the record isn't saved/created (#<I>)
jasoncharnes_pay
train
rb
99162d60f659b9155e5385b0aae04ed95ee88e1b
diff --git a/tests/unit/core/oxmodulelistTest.php b/tests/unit/core/oxmodulelistTest.php index <HASH>..<HASH> 100644 --- a/tests/unit/core/oxmodulelistTest.php +++ b/tests/unit/core/oxmodulelistTest.php @@ -755,7 +755,7 @@ class Unit_Core_oxmodulelistTest extends OxidTestCase ); $aModules = array( 'oxarticle' => 'mod/testModule&mod2/testModule2/', - 'oxorder' => 'oe/invoicepdf/myorder' + 'oxorder' => 'oe/invoicepdf/models/invoicepdfoxorder' ); $aDeletedExt = array( 'oxarticle' => array ('mod/testModule',
Updating module unit tests as invoicepdf metadata changed.
OXID-eSales_oxideshop_ce
train
php
39358d5f52676092d0b6e0cfac930a318a91099c
diff --git a/server/rpc/ConceptRPC.java b/server/rpc/ConceptRPC.java index <HASH>..<HASH> 100644 --- a/server/rpc/ConceptRPC.java +++ b/server/rpc/ConceptRPC.java @@ -119,6 +119,7 @@ class ConceptRPC { return; case RELATIONTYPE_ROLE_REQ: con.asRelationType().role(req.getRelationTypeRoleReq().getLabel()); + return; case RELATIONTYPE_RELATES_REQ: con.asRelationType().relates(req.getRelationTypeRelatesReq().getLabel()); return;
Fix error whenever a client puts any role (#<I>) ## What is the goal of this PR? To allow clients to put roles. ## What are the changes implemented in this PR? There was a missing `return` statement in the `switch` block that checked the request type when receiving an RPC message, causing the "put role" request to fail every time. We added a `return`.
graknlabs_grakn
train
java
e7756bdbc17311f4df8ef0924f4d4f31ed75fde8
diff --git a/app/models/artefact.rb b/app/models/artefact.rb index <HASH>..<HASH> 100644 --- a/app/models/artefact.rb +++ b/app/models/artefact.rb @@ -89,8 +89,7 @@ class Artefact "manual", "manual-change-history", "manual-section", - "medical_safety_alert", - "specialist-document"], # Deprecated: Leaving in place for legacy reasons. In future use explicit document_type + "medical_safety_alert"], "finder-api" => ["finder"], "whitehall" => ["announcement", "authored_article", diff --git a/test/validators/slug_validator_test.rb b/test/validators/slug_validator_test.rb index <HASH>..<HASH> 100644 --- a/test/validators/slug_validator_test.rb +++ b/test/validators/slug_validator_test.rb @@ -78,11 +78,11 @@ class SlugTest < ActiveSupport::TestCase context "Specialist documents" do should "all url nested one level deep" do - assert document_with_slug("some-finder/my-specialist-document", kind: "specialist-document").valid? + assert document_with_slug("some-finder/my-specialist-document", kind: "cma_case").valid?; end should "not allow deeper nesting" do - refute document_with_slug("some-finder/my-specialist-document/not-allowed", kind: "specialist-document").valid? + refute document_with_slug("some-finder/my-specialist-document/not-allowed", kind: "cma_case").valid? end end
Remove deprecated artefact kind This is no longer required as we now specify explicit SpecialistDocument kinds
alphagov_govuk_content_models
train
rb,rb
bbe426a5fbc3443928703bcc0e3b8576ed89f158
diff --git a/tool.py b/tool.py index <HASH>..<HASH> 100755 --- a/tool.py +++ b/tool.py @@ -254,7 +254,7 @@ class Install(object): if not _path.endswith(directory_separator): _path += directory_separator - self.path = _path + self.path = repr(_path) if file_to_install is None: self.file_to_install = 'PyFunceble.py' @@ -1105,7 +1105,7 @@ if __name__ == '__main__': '-v', '--version', action='version', - version='%(prog)s 0.6.0-beta' + version='%(prog)s 0.6.1-beta' ) ARGS = PARSER.parse_args()
Ensure that we don't print a new line to \n or other special strings
funilrys_PyFunceble
train
py