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
1c4233d271acce2dd366e6a49b4a65ed76525821
diff --git a/language/parser/parser.go b/language/parser/parser.go index <HASH>..<HASH> 100644 --- a/language/parser/parser.go +++ b/language/parser/parser.go @@ -683,7 +683,7 @@ func parseDirective(parser *Parser) (*ast.Directive, error) { func parseType(parser *Parser) (ast.Type, error) { start := parser.Token.Start var ttype ast.Type - if skip(parser, lexer.TokenKind[lexer.BRACE_L]) { + if skip(parser, lexer.TokenKind[lexer.BRACKET_L]) { t, err := parseType(parser) if err != nil { return t, err
Fix a bug in parser (expected BRACKET_L, got BRACE_L)
graphql-go_graphql
train
go
135442da7421636125eff4d02835fcfb325f0828
diff --git a/consul/client.go b/consul/client.go index <HASH>..<HASH> 100644 --- a/consul/client.go +++ b/consul/client.go @@ -20,7 +20,7 @@ const ( // eofError is also a substring returned by consul during EOF errors. eofError = "EOF" // connRefused connection refused - connRefused = "getsockopt: connection refused" + connRefused = "connection refused" // keyIndexMismatch indicates consul error for key index mismatch keyIndexMismatch = "Key Index mismatch" // nameResolutionError indicates no host found, can be temporary
fix connection refused error check (#<I>)
portworx_kvdb
train
go
4ceb28959d13d8b18f1a01589192117bedbb44c0
diff --git a/nfc/__init__.py b/nfc/__init__.py index <HASH>..<HASH> 100644 --- a/nfc/__init__.py +++ b/nfc/__init__.py @@ -19,7 +19,7 @@ # See the Licence for the specific language governing # permissions and limitations under the Licence. # ----------------------------------------------------------------------------- -__version__ = "0.9.1" +__version__ = "0.9.2" import logging logging.getLogger(__name__).addHandler(logging.NullHandler()) diff --git a/nfc/dev/acr122.py b/nfc/dev/acr122.py index <HASH>..<HASH> 100644 --- a/nfc/dev/acr122.py +++ b/nfc/dev/acr122.py @@ -78,7 +78,7 @@ class Chipset(pn53x.Chipset): if frame[0] != 0x80: log.error("expected a RDR_to_PC_DataBlock") raise IOError(errno.EIO, os.strerror(errno.EIO)) - if len(frame) != 10 + struct.unpack("<I", frame[1:5])[0]: + if len(frame) != 10 + struct.unpack("<I", buffer(frame, 1, 4))[0]: log.error("RDR_to_PC_DataBlock length mismatch") raise IOError(errno.EIO, os.strerror(errno.EIO)) return frame[10:]
merge fix from trunk: struct.unpack does not accept bytearray in Python <I> and earlier
nfcpy_nfcpy
train
py,py
1d3ca5d82a525b1b72cc015c1e447226ae9d5390
diff --git a/eventsourcing/tests/test_sqlite.py b/eventsourcing/tests/test_sqlite.py index <HASH>..<HASH> 100644 --- a/eventsourcing/tests/test_sqlite.py +++ b/eventsourcing/tests/test_sqlite.py @@ -71,17 +71,21 @@ class TestSQLiteApplicationRecorder(ApplicationRecorderTestCase): def test_raises_operational_error_when_inserting_fails(self): recorder = SQLiteApplicationRecorder(SQLiteDatastore(":memory:")) with self.assertRaises(OperationalError): + # Haven't created table. recorder.insert_events([]) def test_raises_operational_error_when_selecting_fails(self): recorder = SQLiteApplicationRecorder(SQLiteDatastore(":memory:")) with self.assertRaises(OperationalError): + # Haven't created table. recorder.select_events(uuid4()) with self.assertRaises(OperationalError): + # Haven't created table. recorder.select_notifications(start=1, limit=1) with self.assertRaises(OperationalError): + # Haven't created table. recorder.max_notification_id()
Added comments to explain why operational error is expected.
johnbywater_eventsourcing
train
py
ba60240330c6dfd05ff942e0938adc8dcf6e842e
diff --git a/indra/assemblers/graph_assembler.py b/indra/assemblers/graph_assembler.py index <HASH>..<HASH> 100644 --- a/indra/assemblers/graph_assembler.py +++ b/indra/assemblers/graph_assembler.py @@ -109,6 +109,7 @@ class GraphAssembler(): for stmt in self.statements: # Skip SelfModification (self loops) -- has one node if isinstance(stmt, SelfModification) or \ + isinstance(stmt, Translocation) or \ isinstance(stmt, ActiveForm): continue # Special handling for Complexes -- more than 1 node @@ -117,13 +118,17 @@ class GraphAssembler(): self._add_node(m) # All else should have exactly 2 nodes elif all([ag is not None for ag in stmt.agent_list()]): - assert len(stmt.agent_list()) == 2 + if not len(stmt.agent_list()) == 2: + logger.warning( + '%s has less/more than the expected 2 agents.' % stmt) + continue for ag in stmt.agent_list(): self._add_node(ag) # Second, create the edges of the graph for stmt in self.statements: # Skip SelfModification (self loops) -- has one node if isinstance(stmt, SelfModification) or \ + isinstance(stmt, Translocation) or \ isinstance(stmt, ActiveForm): continue elif isinstance(stmt, Complex):
Handle more one-agent statement types in GraphAssembler
sorgerlab_indra
train
py
f5aefba23cebc9ff1bb83544476292f3ba27ddcd
diff --git a/src/clusterpost-model/index.js b/src/clusterpost-model/index.js index <HASH>..<HASH> 100644 --- a/src/clusterpost-model/index.js +++ b/src/clusterpost-model/index.js @@ -15,7 +15,10 @@ exports.input = Joi.object().keys({ remote : Joi.object().keys({ serverCodename: Joi.string().optional(), uri: Joi.string() - }).optional() + }).optional(), + local : Joi.object().keys({ + uri: Joi.string() + }) }); exports.jobpost = Joi.object().keys({
ENH: Allow 'local' for different types of inputs
juanprietob_clusterpost
train
js
4aa47045eb2f81e8f84d611dcba5ac9f5a01eb99
diff --git a/lib/double_entry.rb b/lib/double_entry.rb index <HASH>..<HASH> 100644 --- a/lib/double_entry.rb +++ b/lib/double_entry.rb @@ -280,7 +280,6 @@ module DoubleEntry # and provided custom filters. # # @example Find the number of all $10 :save transfers in all :checking accounts per month for the entire year (Assume the year is 2014). - # time_range = DoubleEntry::TimeRange.make(2014, 1) # DoubleEntry.aggregate_array(:sum, :checking, :save, range_type: 'month', start: '2014-01-01', finish: '2014-12-31') # @param function [Symbol] The function to perform on the set of transfers. # Valid functions are :sum, :count, and :average
Don't need time_range for aggregate_array example
envato_double_entry
train
rb
f8e31d34ad6c9817156f2d135a9ef109ec231742
diff --git a/bootstrap/src/main/java/io/airlift/bootstrap/Bootstrap.java b/bootstrap/src/main/java/io/airlift/bootstrap/Bootstrap.java index <HASH>..<HASH> 100644 --- a/bootstrap/src/main/java/io/airlift/bootstrap/Bootstrap.java +++ b/bootstrap/src/main/java/io/airlift/bootstrap/Bootstrap.java @@ -71,10 +71,11 @@ public class Bootstrap private Map<String, String> requiredConfigurationProperties; private Map<String, String> optionalConfigurationProperties; private boolean initializeLogging = true; - private boolean strictConfig = false; + private boolean quiet; + private boolean strictConfig; private boolean requireExplicitBindings = true; - private boolean initialized = false; + private boolean initialized; public Bootstrap(Module... modules) { @@ -133,6 +134,12 @@ public class Bootstrap return this; } + public Bootstrap quiet() + { + this.quiet = true; + return this; + } + public Bootstrap strictConfig() { this.strictConfig = true; @@ -228,7 +235,9 @@ public class Bootstrap unusedProperties.keySet().removeAll(configurationFactory.getUsedProperties()); // Log effective configuration - logConfiguration(configurationFactory, unusedProperties); + if (!quiet) { + logConfiguration(configurationFactory, unusedProperties); + } // system modules Builder<Module> moduleList = ImmutableList.builder();
Add quiet method to Bootstrap to disable printing configuration properties
airlift_airlift
train
java
3ed943be9d4a3926453915923e0d173ebd92fce3
diff --git a/lib/fontello_rails_converter/railtie.rb b/lib/fontello_rails_converter/railtie.rb index <HASH>..<HASH> 100644 --- a/lib/fontello_rails_converter/railtie.rb +++ b/lib/fontello_rails_converter/railtie.rb @@ -1,7 +1,7 @@ module FontelloRailsConverter class Railtie < Rails::Railtie rake_tasks do - require File.join(File.dirname(__FILE__), '../tasks/fontello_rails_converter.rake') + load File.join(File.dirname(__FILE__), '../tasks/fontello_rails_converter.rake') end end end \ No newline at end of file
fix loading of the rake task. turns out require will try to add an .rb extension to the loaded file
railslove_fontello_rails_converter
train
rb
bb5cc50f72bf5413ca91136a57af4c6a35a59873
diff --git a/HTTPStreaming.rb b/HTTPStreaming.rb index <HASH>..<HASH> 100644 --- a/HTTPStreaming.rb +++ b/HTTPStreaming.rb @@ -14,6 +14,7 @@ # to the underlying lib this stuff will need updating. require 'net/http' +require 'delegate' module Net @@ -104,4 +105,4 @@ module S3sync @innerStream.close end end -end #module \ No newline at end of file +end #module
Fixes "uninitialized constant S3sync::SimpleDelegator" issue
clarete_s3sync
train
rb
e6c097761edc0f60169559c581e65fec7e543164
diff --git a/src/Hprose/HandlerManager.php b/src/Hprose/HandlerManager.php index <HASH>..<HASH> 100644 --- a/src/Hprose/HandlerManager.php +++ b/src/Hprose/HandlerManager.php @@ -69,7 +69,8 @@ abstract class HandlerManager { /*protected*/ abstract function afterFilterHandler(/*string*/ $request, stdClass $context); protected function getNextInvokeHandler(Closure $next, /*callable*/ $handler) { return Future\wrap(function(/*string*/ $name, array &$args, stdClass $context) use ($next, $handler) { - return call_user_func($handler, $name, $args, $context, $next); + $array = array($name, &$args, $context, $next); + return call_user_func_array($handler, $array); }); } protected function getNextFilterHandler(Closure $next, /*callable*/ $handler) {
Fixed a middleware bug of HandlerManager.
hprose_hprose-php
train
php
97e2e1fd884922971b1e36a58546f9e645047645
diff --git a/OpenPNM/Network/tools.py b/OpenPNM/Network/tools.py index <HASH>..<HASH> 100644 --- a/OpenPNM/Network/tools.py +++ b/OpenPNM/Network/tools.py @@ -1007,7 +1007,7 @@ def generate_base_points(num_points, domain_size, surface='reflected'): if len(domain_size) == 1: # Spherical domain_size = _sp.array(domain_size) spherical_coords = _sp.rand(num_points, 3) - r = spherical_coords[:, 0]*domain_size + r = (spherical_coords[:, 0]**0.5)*domain_size theta = spherical_coords[:, 1]*(2*_sp.pi) phi = spherical_coords[:, 2]*(2*_sp.pi) if surface == 'reflected': @@ -1022,7 +1022,7 @@ def generate_base_points(num_points, domain_size, surface='reflected'): elif len(domain_size) == 2: # Cylindrical domain_size = _sp.array(domain_size) cylindrical_coords = _sp.rand(num_points, 3) - r = cylindrical_coords[:, 0]*domain_size[0] + r = (cylindrical_coords[:, 0]**0.5)*domain_size[0] theta = cylindrical_coords[:, 1]*(2*_sp.pi) z = cylindrical_coords[:, 2] if surface == 'reflected':
Adjusted the random radius values by square rooting it so they are evenly spaced
PMEAL_OpenPNM
train
py
fa845e3514e545a587907c1df362e8a1218dc377
diff --git a/pypump/models/activity.py b/pypump/models/activity.py index <HASH>..<HASH> 100644 --- a/pypump/models/activity.py +++ b/pypump/models/activity.py @@ -95,7 +95,11 @@ class Activity(AbstractModel): self.id = id def __repr__(self): - return '<Activity: {content}>'.format(content=re.sub('<.*?>', '', self.content)) + return '<Activity: {webfinger} {verb}ed {model}>'.format( + webfinger=self.actor.id[5:], # [5:] to strip of acct: + verb=self.verb.rstrip("e"), # english: e + ed = ed + model=self.obj.objectType + ) def __str__(self): return str(self.__repr__())
Fix unicode by constructing repr as <Activity: {webfinger} {verb}ed {object_type}>
xray7224_PyPump
train
py
455409e693fc6664e66dce555e9df1e25efd28da
diff --git a/server/workers/rekall_adapter/rekall_adapter.py b/server/workers/rekall_adapter/rekall_adapter.py index <HASH>..<HASH> 100644 --- a/server/workers/rekall_adapter/rekall_adapter.py +++ b/server/workers/rekall_adapter/rekall_adapter.py @@ -202,5 +202,11 @@ def test(): output = renderer.render(session.plugins.dlllist()) pprint.pprint(output) + + # Code coverage: These calls are simply for code coverage + renderer.format('foo') + renderer.section() + renderer.format('foo') + if __name__ == "__main__": test()
just puttin in code coverage calls
SuperCowPowers_workbench
train
py
449f447c41357b160e4838b62de5c4ee0f40c75d
diff --git a/django_cas_ng/views.py b/django_cas_ng/views.py index <HASH>..<HASH> 100644 --- a/django_cas_ng/views.py +++ b/django_cas_ng/views.py @@ -221,8 +221,11 @@ class LogoutView(View): next_page = next_page or get_redirect_url(request) if settings.CAS_LOGOUT_COMPLETELY: - protocol = get_protocol(request) - host = request.get_host() + if hasattr(settings, 'CAS_ROOT_PROXIED_AS'): + protocol, host, _, _, _, _ = urllib_parse.urlparse(settings.CAS_ROOT_PROXIED_AS) + else: + protocol = get_protocol(request) + host = request.get_host() redirect_url = urllib_parse.urlunparse( (protocol, host, next_page, '', '', ''), )
Logout view now prioritizes the CAS_ROOT_PROXIED_AS setting when building urls
mingchen_django-cas-ng
train
py
96d1be32e05b9e0e66d5ba7cc84ae86af0cc1413
diff --git a/src/collectors/diskspace/diskspace.py b/src/collectors/diskspace/diskspace.py index <HASH>..<HASH> 100644 --- a/src/collectors/diskspace/diskspace.py +++ b/src/collectors/diskspace/diskspace.py @@ -142,7 +142,7 @@ class DiskSpaceCollector(diamond.collector.Collector): continue # Process the filters - if self.exclude_reg.match(mount_point): + if self.exclude_reg.search(mount_point): self.log.debug("Ignoring %s since it is in the " + "exclude_filter list.", mount_point) continue
Fixes #<I>, this fixes the regex search to actually not be anchored by default
python-diamond_Diamond
train
py
a060207b2428bdfbcb72d50d8284d694b12d43d7
diff --git a/gromacs/analysis/core.py b/gromacs/analysis/core.py index <HASH>..<HASH> 100755 --- a/gromacs/analysis/core.py +++ b/gromacs/analysis/core.py @@ -253,7 +253,7 @@ class Simulation(object): return p def plugindir(self, plugin_name, *args): - return self.select_plugin(plugin_name).plugindir(*args) + return self.get_plugin(plugin_name).plugindir(*args) def check_file(self,filetype,path): """Raise :exc:`ValueError` if path does not exist. Uses *filetype* in message.""" @@ -321,7 +321,7 @@ class Simulation(object): arguments for plugin plot function and possibly :func:`pylab.plot` """ kwargs['figure'] = figure - return self.select_plugin(plugin_name).plot(**kwargs) + return self.get_plugin(plugin_name).plot(**kwargs) def __str__(self): return 'Simulation(tpr=%(tpr)r,xtc=%(xtc)r,analysisdir=%(analysis_dir)r)' % vars(self)
fixed: forgot to change select_plugin --> get_plugin git-svn-id: svn+ssh://gonzo.med.jhmi.edu/scratch/svn/woolf_repository/users/oliver/Library/GromacsWrapper@<I> df5ba8eb-4b0b-<I>-8c<I>-c<I>f<I>b<I>c
Becksteinlab_GromacsWrapper
train
py
04268159b18143592702aa200141691b294658fb
diff --git a/lib/refresh.js b/lib/refresh.js index <HASH>..<HASH> 100644 --- a/lib/refresh.js +++ b/lib/refresh.js @@ -27,6 +27,12 @@ module.exports = function (Terminal) { row = y + this.ydisp; line = this.lines[row]; + if (!line) { + // simple solution in case we have more lines than rows + // could be improved to instead remove first line (and related html element) + return this.reset(); + } + out = ''; if (y === this.y && this.cursorState && this.ydisp === this.ybase && !this.cursorHidden) {
resetting terminal when we run out of rows
thlorenz_hypernal
train
js
6b4a61d862087dc95e4aa07beaaad31e4592a1d6
diff --git a/D/prototypes/Promise/index.js b/D/prototypes/Promise/index.js index <HASH>..<HASH> 100644 --- a/D/prototypes/Promise/index.js +++ b/D/prototypes/Promise/index.js @@ -138,18 +138,18 @@ export class Promise { toResolve++; - promise.then((value) => { - toResolve--; - array[i] = value; - - setTimeout(() => { - if (next.done && !toResolve) { - resolve(array); - } - }, 1); - }, reject); - - i++; + ((i) => { + promise.then((value) => { + toResolve--; + array[i] = value; + + setTimeout(() => { + if (next.done && !toResolve) { + resolve(array); + } + }, 1); + }, reject); + })(i++); } if (!i) { @@ -217,7 +217,7 @@ export class Promise { }); } - 'catch'(onReject) { + catch(onReject) { return resolveOrReject(this.$, null, onReject); } then(onResolve, onReject) {
Fix "no-closure" bug.
dwaynejs_dwayne
train
js
10cfa296d8de355e80bcfd4cde8b9e02df4d21fa
diff --git a/src/Configurator/RendererGenerators/PHP/XPathConvertor.php b/src/Configurator/RendererGenerators/PHP/XPathConvertor.php index <HASH>..<HASH> 100644 --- a/src/Configurator/RendererGenerators/PHP/XPathConvertor.php +++ b/src/Configurator/RendererGenerators/PHP/XPathConvertor.php @@ -304,7 +304,7 @@ class XPathConvertor $operators['='] = '=='; $operators['!='] = '!='; - $operands[] = ltrim($expr, '0'); + $operands[] = preg_replace('(^0(.+))', '$1', $expr); } else { diff --git a/tests/Configurator/RendererGenerators/PHP/XPathConvertorTest.php b/tests/Configurator/RendererGenerators/PHP/XPathConvertorTest.php index <HASH>..<HASH> 100644 --- a/tests/Configurator/RendererGenerators/PHP/XPathConvertorTest.php +++ b/tests/Configurator/RendererGenerators/PHP/XPathConvertorTest.php @@ -361,6 +361,10 @@ class XPathConvertorTest extends Test "\$node->textContent==3" ], [ + '.=0', + "\$node->textContent==0" + ], + [ '.=022', "\$node->textContent==22" ],
XPathConvertor: fixed comparison to 0
s9e_TextFormatter
train
php,php
b188d8e5ed836d5cf0a7bb3b3162d0c23bc24265
diff --git a/pippo-core/src/main/java/ro/fortsoft/pippo/core/Pippo.java b/pippo-core/src/main/java/ro/fortsoft/pippo/core/Pippo.java index <HASH>..<HASH> 100644 --- a/pippo-core/src/main/java/ro/fortsoft/pippo/core/Pippo.java +++ b/pippo-core/src/main/java/ro/fortsoft/pippo/core/Pippo.java @@ -15,9 +15,10 @@ */ package ro.fortsoft.pippo.core; +import ro.fortsoft.pippo.core.util.ServiceLocator; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import ro.fortsoft.pippo.core.util.ServiceLocator; /** * @author Decebal Suiu @@ -55,6 +56,15 @@ public class Pippo { WebServerSettings serverSettings = new WebServerSettings(application.getPippoSettings()); server.setSettings(serverSettings); + + Runtime.getRuntime().addShutdownHook(new Thread() { + + @Override + public void run() { + server.stop(); + } + + }); } return server;
Add a shutdown hook to gracefully terminate on ctrl+c
pippo-java_pippo
train
java
c686ddbe7a30b7f917e6db9138474566f0710a34
diff --git a/match.js b/match.js index <HASH>..<HASH> 100644 --- a/match.js +++ b/match.js @@ -7,12 +7,12 @@ match: '=' }, link: function(scope, elem, attrs, ctrl) { - scope.$watch(function() { - modelValue = ctrl.$modelValue || ctrl.$$invalidModelValue; - return (ctrl.$pristine && angular.isUndefined(modelValue)) || scope.match === modelValue; - }, function(currentValue) { - ctrl.$setValidity('match', currentValue); + scope.$watch('match', function(pass){ + ctrl.$validate(); }); + ctrl.$validators.match = function(modelValue){ + return (ctrl.$pristine && (angular.isUndefined(modelValue) || || modelValue === "")) || modelValue === scope.match; + }; } }; });
Fix: for AngularJS <I>.x Using the new `$validators` pipeline for validation.
TheSharpieOne_angular-validation-match
train
js
aa57de1791425515601d45f98599be763e72e468
diff --git a/config.js b/config.js index <HASH>..<HASH> 100644 --- a/config.js +++ b/config.js @@ -41,7 +41,7 @@ var defaults = { { path : "./views", url : "/", ext : "html" } ], - engines: { + pipelines: { html: "html", css: "css", js: "javascript" diff --git a/globals.js b/globals.js index <HASH>..<HASH> 100644 --- a/globals.js +++ b/globals.js @@ -40,7 +40,7 @@ module.exports = (function() { global.ports = { proxy : 27182 }; // Add engines in config - for (var ext in global.config.engines) - global.engines.addEngine(ext, global.config.engines[ext]); + for (var ext in global.config.pipelines) + global.engines.addEngine(ext, global.config.pipelines[ext]); });
Renames engines to pipelines While this is inconsistent with the Motors interface, it assumes the much more familiar language of “asset pipelines”
shippjs_shipp-server
train
js,js
6dab70b1832c89cd1dbe7fafbf8109fe3586c136
diff --git a/spec/doubles/stream_for_occurrence_double.rb b/spec/doubles/stream_for_occurrence_double.rb index <HASH>..<HASH> 100644 --- a/spec/doubles/stream_for_occurrence_double.rb +++ b/spec/doubles/stream_for_occurrence_double.rb @@ -6,6 +6,10 @@ class StreamForOccurrenceDouble < ConceptQL::Nodes::Node ds end + def evaluate(db) + query(db) + end + # Stole this from: # https://github.com/jeremyevans/sequel/blob/63397b787335d06de97dc89ddf49b7a3a93ffdc9/spec/core/expression_filters_spec.rb#L400 #
StreamForOccurrenceDouble#evaluate: add this
outcomesinsights_conceptql
train
rb
d807568af6dc36ff941ee27085ec9c018489f721
diff --git a/tests/test_kvstore.py b/tests/test_kvstore.py index <HASH>..<HASH> 100644 --- a/tests/test_kvstore.py +++ b/tests/test_kvstore.py @@ -176,15 +176,13 @@ class KVStoreBase(object): class TestBsddbStore(unittest.TestCase, KVStoreBase): DB = "tests.test_bsddb_store" - @classmethod - def setUpClass(cls): + def setUp(self): try: import bsddb bsddb # reference bsddb to satisfy pyflakes except ImportError: # pragma: no cover raise unittest.SkipTest("bsddb not installed") - def setUp(self): self.store = cobe.kvstore.BsddbStore(self.DB) def cleanup():
Move the TestBsddbStore Skip clause to setUp (from setUpClass) This matches the behavior of TestLevelDBStore and has the expected effect (skipping the test) when running in nosetests.
pteichman_cobe
train
py
3052d76eb03fe6f5bd20aa2550d2d4718a71ba5a
diff --git a/blueprints/ember-cli-blanket/files/tests/blanket-options.js b/blueprints/ember-cli-blanket/files/tests/blanket-options.js index <HASH>..<HASH> 100644 --- a/blueprints/ember-cli-blanket/files/tests/blanket-options.js +++ b/blueprints/ember-cli-blanket/files/tests/blanket-options.js @@ -1,9 +1,9 @@ -/*globals blanket, module */ +/* globals blanket, module */ var options = { - modulePrefix: "<%= dasherizedPackageName %>", - filter: "//.*<%= dasherizedPackageName %>/.*/", - antifilter: "//.*(tests|template).*/", + modulePrefix: '<%= dasherizedPackageName %>', + filter: '//.*<%= dasherizedPackageName %>/.*/', + antifilter: '//.*(tests|template).*/', loaderExclusions: [], enableCoverage: true, cliOptions: {
Cleanup blanket-options.js - [x] Add space in globals comment - [x] Consistent quotes
sglanzer_ember-cli-blanket
train
js
04b1ee8f75a699c1a3b9114cc686c445216bd30d
diff --git a/blockstack_client/actions.py b/blockstack_client/actions.py index <HASH>..<HASH> 100644 --- a/blockstack_client/actions.py +++ b/blockstack_client/actions.py @@ -3772,7 +3772,7 @@ def cli_set_zonefile_hash(args, config_path=CONFIG_PATH, password=None): help: Directly set the hash associated with the name in the blockchain. arg: name (str) 'The name to update' arg: zonefile_hash (str) 'The RIPEMD160(SHA256(zonefile)) hash' - arg: ownerkey (str) 'The key to be used if not the wallet's ownerkey' + arg: ownerkey (str) 'The key to be used if not the wallets ownerkey' """ password = get_default_password(password)
previous commit's comments cause argparsing failure in cli
blockstack_blockstack-core
train
py
4a6fa74b679da0f21fa90519b3b553642839dccb
diff --git a/examples/all.php b/examples/all.php index <HASH>..<HASH> 100644 --- a/examples/all.php +++ b/examples/all.php @@ -25,7 +25,7 @@ namespace Malenki; -include('../src/Malenki/Ansi.php'); +(@include_once __DIR__ . '/../vendor/autoload.php') || @include_once __DIR__ . '/../../../autoload.php'; foreach(array('black', 'red', 'green', 'yellow', 'blue', 'purple', 'cyan', 'white') as $color) { diff --git a/examples/colors.php b/examples/colors.php index <HASH>..<HASH> 100644 --- a/examples/colors.php +++ b/examples/colors.php @@ -25,7 +25,7 @@ namespace Malenki; -include('../src/Malenki/Ansi.php'); +(@include_once __DIR__ . '/../vendor/autoload.php') || @include_once __DIR__ . '/../../../autoload.php'; foreach(array('black', 'red', 'green', 'yellow', 'blue', 'purple', 'cyan', 'white') as $color) {
Use autoloader of composer for examples
malenkiki_ansi
train
php,php
a1039adb1fd27d4503a9a7b3f9349b470b1f4f9e
diff --git a/flask_assistant/response/base.py b/flask_assistant/response/base.py index <HASH>..<HASH> 100644 --- a/flask_assistant/response/base.py +++ b/flask_assistant/response/base.py @@ -143,8 +143,26 @@ class _Response(object): ) if "DIALOGFLOW_MESSENGER" in self._integrations: - chip_resp = df_messenger._build_suggestions(*replies) - self._platform_messages["DIALOGFLOW_MESSENGER"].append(chip_resp) + existing_chips = False + for m in self._platform_messages["DIALOGFLOW_MESSENGER"]: + # already has chips, need to add to same object + if m.get("type") == "chips": + existing_chips = True + break + + if not existing_chips: + chip_resp = df_messenger._build_suggestions(*replies) + self._platform_messages["DIALOGFLOW_MESSENGER"].append(chip_resp) + + else: + df_chips = [] + for i in replies: + chip = df_messenger._build_chip(i) + df_chips.append(chip) + + for m in self._platform_messages["DIALOGFLOW_MESSENGER"]: + if m.get("type") == "chips": + m["options"].append(df_chips) return self
fix adding suggestions to existing chips df-msgr response
treethought_flask-assistant
train
py
16c7e556e0c7b7a06902612669078fadac913568
diff --git a/nessie.go b/nessie.go index <HASH>..<HASH> 100644 --- a/nessie.go +++ b/nessie.go @@ -394,11 +394,11 @@ func (n *nessusImpl) PluginFamilies() ([]PluginFamily, error) { return nil, err } defer resp.Body.Close() - var reply []PluginFamily + var reply PluginFamilies if err = json.NewDecoder(resp.Body).Decode(&reply); err != nil { return nil, err } - return reply, nil + return reply.Families, nil } func (n *nessusImpl) FamilyDetails(ID int64) (*FamilyDetails, error) {
Parse PluginFamilies json response into the new PluginFamilies struct
attwad_nessie
train
go
53c9018d322e8ac4d2d396f5078d4a9b9adfba73
diff --git a/integration-tests/spec/cases/assets/simple.js b/integration-tests/spec/cases/assets/simple.js index <HASH>..<HASH> 100644 --- a/integration-tests/spec/cases/assets/simple.js +++ b/integration-tests/spec/cases/assets/simple.js @@ -70,7 +70,7 @@ module.exports = function simpleAssetTest() { job.waitForStatus('running'); return job; }) - .then(job => wait.forWorkersJoined(job.id(), workers, 10)) + .then(job => wait.forWorkersJoined(job.id(), workers, 20)) .then(r => expect(r).toEqual(workers)) .catch(fail) .finally(done); @@ -98,7 +98,7 @@ module.exports = function simpleAssetTest() { job.waitForStatus('running'); return job; }) - .then(job => wait.forWorkersJoined(job.id(), workers, 10)) + .then(job => wait.forWorkersJoined(job.id(), workers, 20)) .then(r => expect(r).toEqual(workers)) .catch(fail) .finally(done);
increasing the iterations on forWorkersJoined
terascope_teraslice
train
js
7c445305276ce30ddf4ee1d297c3bb60ad299794
diff --git a/symphony/lib/toolkit/class.entryquery.php b/symphony/lib/toolkit/class.entryquery.php index <HASH>..<HASH> 100644 --- a/symphony/lib/toolkit/class.entryquery.php +++ b/symphony/lib/toolkit/class.entryquery.php @@ -385,12 +385,7 @@ class EntryQuery extends DatabaseQuery if ($this->sectionId) { $section = (new SectionManager)->select()->section($this->sectionId)->execute()->next(); if ($section && $section->getSortingField()) { - $field = (new FieldManager)->select()->field($section->getSortingField())->execute()->next(); - if ($field && $field->isSortable()) { - $sort = $this->buildLegacySortingForField($field, $direction); - $sort = $this->replaceTablePrefix($sort); - $this->unsafe()->unsafeAppendSQLPart('order by', $sort); - } + $this->sort($section->getSortingField(), $section->getSortingOrder()); } } // No sort specified, so just sort on system id
Use sort() directly in default sort Picked from <I>f4fe7bd8 Picked from 7fd4aad<I>f Picked from fc5a<I>cdd2
symphonycms_symphony-2
train
php
ff231f08a259c02e70216b220e84207d422a4af3
diff --git a/tensor2tensor/layers/common_attention.py b/tensor2tensor/layers/common_attention.py index <HASH>..<HASH> 100644 --- a/tensor2tensor/layers/common_attention.py +++ b/tensor2tensor/layers/common_attention.py @@ -1080,6 +1080,7 @@ def multihead_attention_2d(query_antecedent, x = local_attention_2d( q, k, v, query_shape=query_shape, memory_flange=memory_flange) else: + assert attention_type == "masked_local_attention_2d" x = masked_local_attention_2d(q, k, v, query_shape=query_shape, memory_flange=memory_flange) x = combine_heads_2d(x)
Added an assert in common_attention. PiperOrigin-RevId: <I>
tensorflow_tensor2tensor
train
py
3886e75cdbc2dc3120575477a7a15e0e391cbffd
diff --git a/solvebio/test/test_shortcuts.py b/solvebio/test/test_shortcuts.py index <HASH>..<HASH> 100644 --- a/solvebio/test/test_shortcuts.py +++ b/solvebio/test/test_shortcuts.py @@ -22,8 +22,8 @@ class CLITests(SolveBioTestCase): user = User.retrieve() domain = user['account']['domain'] return \ - '{0}:test-client-{1}/1.0.0/test-{1}-{2}'.format( - domain, int(time.time()), random.randint(0, 10000)) + '{0}:test-client-{1}-{2}/1.0.0/test-{1}-{2}'.format( + domain, int(time.time()), random.randint(0, 100000)) def test_create_dataset(self): # TODO mock client responses or allow for hard
add random into depo as well
solvebio_solvebio-python
train
py
c1f19f031626ad9327f56f06b8171504a6622d5d
diff --git a/runtime/vm.js b/runtime/vm.js index <HASH>..<HASH> 100644 --- a/runtime/vm.js +++ b/runtime/vm.js @@ -97,6 +97,7 @@ VM.S = function(callee, self, args) { + " for " + self.$m.inspect(self, 'inspect')); } - return func.apply(self, args); + args.unshift(self); + return func.apply(null, args); };
Fix bug in super calls. Fixes 2 specs
opal_opal
train
js
ccf6f5d8c2b54414169f820b1b12ce24f4dedb8e
diff --git a/packages/build/postcss/postcss-css-var-selectors.js b/packages/build/postcss/postcss-css-var-selectors.js index <HASH>..<HASH> 100644 --- a/packages/build/postcss/postcss-css-var-selectors.js +++ b/packages/build/postcss/postcss-css-var-selectors.js @@ -11,7 +11,7 @@ const createSelectorsForVar = (decl, options) => { }).props .map((p, i, newProps) => postcss.parse(` -.${prop + (newProps.length > 1 ? `-${p}` : '')} { ${p}: ${value}; } +.${prop + (newProps.length > 1 ? `--${p}` : '')} { ${p}: ${value}; } `) ) }
refactor(build): a bit more bem in the multi-prop modifiers
pluralsight_design-system
train
js
026106e717a24ca4333cc9bfa42e85967d06c560
diff --git a/bem-views/404.blade.php b/bem-views/404.blade.php index <HASH>..<HASH> 100644 --- a/bem-views/404.blade.php +++ b/bem-views/404.blade.php @@ -9,4 +9,5 @@ @endif @stop -{{ /* THIS IS A SAMPLE VIEW */ }} + +{{-- THIS IS A SAMPLE VIEW --}}
Fix warning for call to Illuminate Support
helsingborg-stad_Municipio
train
php
7a1015522009281e5f06d03e999ab8c665f7e7e5
diff --git a/src/Kernel/Application.php b/src/Kernel/Application.php index <HASH>..<HASH> 100755 --- a/src/Kernel/Application.php +++ b/src/Kernel/Application.php @@ -94,6 +94,10 @@ class Application extends Container require $bootstrap; } + $this->quitting(function() { + exit(0); + }); + $this->booted = true; }
Last quitting callback is now an soft exit
encorephp_kernel
train
php
b9c6e5a91b6f05a5da4546383abea92a004a22e0
diff --git a/kernel/classes/ezcontentobject.php b/kernel/classes/ezcontentobject.php index <HASH>..<HASH> 100644 --- a/kernel/classes/ezcontentobject.php +++ b/kernel/classes/ezcontentobject.php @@ -2901,10 +2901,18 @@ class eZContentObject extends eZPersistentObject { $showInvisibleNodesCond = self::createFilterByVisibilitySQLString( $params['IgnoreVisibility'] ); } + + // related class identifier filter + $relatedClassIdentifiersSQL = ''; if ( isset( $params['RelatedClassIdentifiers'] ) && is_array( $params['RelatedClassIdentifiers'] ) ) { - $relatedClassIdentifiersString = implode( "', '", $params['RelatedClassIdentifiers'] ); - $relatedClassIdentifiersSQL = "ezcontentclass.identifier IN ('$relatedClassIdentifiersString') AND "; + $relatedClassIdentifiers = array(); + foreach( $params['RelatedClassIdentifiers'] as $classIdentifier ) + { + $relatedClassIdentifiers[] = "'" . $db->escapeString( $classIdentifier ) . "'"; + } + $relatedClassIdentifiersSQL = $db->generateSQLINStatement( $relatedClassIdentifiers, 'ezcontentclass.identifier', false, true, 'string' ). " AND"; + unset( $classIdentifier, $relatedClassIdentifiers ); } }
Improved related class filtering pull request code
ezsystems_ezpublish-legacy
train
php
c772029af923ddbebd2707b4e44e36a1cac89ede
diff --git a/php-packages/testing/tests/integration/TestCase.php b/php-packages/testing/tests/integration/TestCase.php index <HASH>..<HASH> 100644 --- a/php-packages/testing/tests/integration/TestCase.php +++ b/php-packages/testing/tests/integration/TestCase.php @@ -162,6 +162,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase function ($memo, $setCookieString) { $setCookie = SetCookie::fromSetCookieString($setCookieString); $memo[$setCookie->getName()] = $setCookie->getValue(); + return $memo; }, []
Apply fixes from StyleCI (#<I>) [ci skip] [skip ci]
flarum_core
train
php
844d384dcbb4a7df169cbe2d500ddbaf190a1920
diff --git a/ocf_writer.go b/ocf_writer.go index <HASH>..<HASH> 100644 --- a/ocf_writer.go +++ b/ocf_writer.go @@ -186,7 +186,7 @@ type Writer struct { // } func NewWriter(setters ...WriterSetter) (*Writer, error) { var err error - fw := &Writer{CompressionCodec: CompressionNull} + fw := &Writer{CompressionCodec: CompressionNull, blockSize: DefaultWriterBlockSize} for _, setter := range setters { err = setter(fw) if err != nil { @@ -270,7 +270,7 @@ func blocker(fw *Writer, toBlock <-chan interface{}, toEncode chan<- *writerBloc items = append(items, item) if int64(len(items)) == fw.blockSize { toEncode <- &writerBlock{items: items} - items = make([]interface{}, 0) + items = make([]interface{}, 0, fw.BlockSize) } } if len(items) > 0 {
Writer aggregates data items into blocks
linkedin_goavro
train
go
f68cb7904af6f5403fe086a06a22d3d92b70c130
diff --git a/src/directive/directive.js b/src/directive/directive.js index <HASH>..<HASH> 100644 --- a/src/directive/directive.js +++ b/src/directive/directive.js @@ -70,6 +70,11 @@ angular.module('jm.i18next').directive('ngI18next', ['$rootScope', '$i18next', ' if (attr === 'html') { element.empty().append(string); + /* + * Now compile the content of the element and bind the variables to + * the scope + */ + $compile(element.contents())(scope); } else if (attr === 'text') { @@ -80,11 +85,6 @@ angular.module('jm.i18next').directive('ngI18next', ['$rootScope', '$i18next', ' element.attr(attr, string); } - /* - * Now compile the content of the element and bind the variables to - * the scope - */ - $compile(element.contents())(scope); if (!$rootScope.$$phase) { $rootScope.$digest();
Compile only when necessary Compiling text makes angular create a useless "<span ng-scope/>" DOM node to enclose the text. This patch keeps the compilation behaviour for the only use case it is really needed for.
i18next_ng-i18next
train
js
73ef31b3464930b1c020bc016a97ac6f48e8e929
diff --git a/lib/foursquare/venue_proxy.rb b/lib/foursquare/venue_proxy.rb index <HASH>..<HASH> 100644 --- a/lib/foursquare/venue_proxy.rb +++ b/lib/foursquare/venue_proxy.rb @@ -12,7 +12,7 @@ module Foursquare raise ArgumentError, "You must include :ll" unless options[:ll] response = @foursquare.get('venues/search', options)["groups"].inject({}) do |venues, group| venues[group["type"]] ||= [] - venues[group["type"]] << group["items"].map do |json| + venues[group["type"]] += group["items"].map do |json| Foursquare::Venue.new(@foursquare, json) end venues
an array is better than two arrays
groupme_quimby
train
rb
5a2b6f79b1e57ef168e982c8a8ac1282ec852279
diff --git a/blimpy/filterbank.py b/blimpy/filterbank.py index <HASH>..<HASH> 100755 --- a/blimpy/filterbank.py +++ b/blimpy/filterbank.py @@ -33,10 +33,16 @@ from astropy.time import Time import scipy.stats from matplotlib.ticker import NullFormatter -from .utils import db, lin, rebin, closest, unpack_2to8 import logging as logger try: + from .utils import db, lin, rebin, closest, unpack_2to8 + from .sigproc import * +except: + from utils import db, lin, rebin, closest, unpack_2to8 + from sigproc import * + +try: import h5py HAS_HDF5 = True except ImportError: @@ -59,8 +65,6 @@ else: import pylab as plt -from .sigproc import * - ### # Config values ### diff --git a/blimpy/waterfall.py b/blimpy/waterfall.py index <HASH>..<HASH> 100755 --- a/blimpy/waterfall.py +++ b/blimpy/waterfall.py @@ -25,9 +25,14 @@ import os import sys import time -from .filterbank import Filterbank -from . import file_wrapper as fw -from .sigproc import * +try: + from .filterbank import Filterbank + from . import file_wrapper as fw + from .sigproc import * +except: + from filterbank import Filterbank + import file_wrapper as fw + from sigproc import * try: import h5py
Making it possible to use scripts when installation is not possible (although not the recommended way to use the code!!). Using the scripts directly would need to update your PYTHONPATH, the command line utilities are not available, and this only gives access to filterbank and waterfall. Former-commit-id: <I>cce<I>e<I>ed<I>e<I>dffe<I>ef<I>a5fe<I>
UCBerkeleySETI_blimpy
train
py,py
214c3930a91a3b5dab3a090381d7414eaf38ea8e
diff --git a/packages/qiskit-devs-anu/test/functional.js b/packages/qiskit-devs-anu/test/functional.js index <HASH>..<HASH> 100644 --- a/packages/qiskit-devs-anu/test/functional.js +++ b/packages/qiskit-devs-anu/test/functional.js @@ -34,6 +34,8 @@ describe('devs:anu:version', () => { describe('devs:anu:random', () => { it('should return a number between 0 and 1 without options', async () => { + this.retries(4); + const res = await qiskit.random(); dbg('Result', res); @@ -44,6 +46,8 @@ describe('devs:anu:random', () => { describe('devs:anu:genHex', () => { it('should return a hex string of the default length without options', async () => { + this.retries(4); + const res = await genHex(); dbg('Result', res); @@ -52,6 +56,8 @@ describe('devs:anu:genHex', () => { }); it('devs:anu:should return a hex string of the desired length if passed', async () => { + this.retries(4); + const len = 8; const res = await genHex(len); dbg('Result', res);
Mocha retries to some devs-anu tests due to API inconsistency
Qiskit_qiskit-js
train
js
08b9136110c6dc1ae4af56a7dcafe965f0780ffb
diff --git a/example_project/urls.py b/example_project/urls.py index <HASH>..<HASH> 100644 --- a/example_project/urls.py +++ b/example_project/urls.py @@ -20,6 +20,7 @@ from django.conf import settings urlpatterns = [ url(r'^admin/', admin.site.urls), + url(r'^auth/', include('django.contrib.auth.urls')), url(r'^', include('swiftwind.urls')), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/swiftwind/urls.py b/swiftwind/urls.py index <HASH>..<HASH> 100644 --- a/swiftwind/urls.py +++ b/swiftwind/urls.py @@ -40,6 +40,5 @@ urlpatterns = [ url(r'^', include('swiftwind.dashboard.urls', namespace='dashboard')), url(r'^', include(hordak_urls, namespace='hordak', app_name='hordak')), - url(r'^auth/', include('django.contrib.auth.urls')), ]
Moving auth urls include into example project
adamcharnock_swiftwind
train
py,py
21a282fabecbbb280e0b070ea84b4062c350a1f9
diff --git a/scrape/scrape.go b/scrape/scrape.go index <HASH>..<HASH> 100644 --- a/scrape/scrape.go +++ b/scrape/scrape.go @@ -1005,7 +1005,7 @@ func (sl *scrapeLoop) run(interval, timeout time.Duration, errc chan<- error) { var last time.Time - alignedScrapeTime := time.Now() + alignedScrapeTime := time.Now().Round(0) ticker := time.NewTicker(interval) defer ticker.Stop() @@ -1023,7 +1023,9 @@ mainLoop: // Temporary workaround for a jitter in go timers that causes disk space // increase in TSDB. // See https://github.com/prometheus/prometheus/issues/7846 - scrapeTime := time.Now() + // Calling Round ensures the time used is the wall clock, as otherwise .Sub + // and .Add on time.Time behave differently (see time package docs). + scrapeTime := time.Now().Round(0) if AlignScrapeTimestamps && interval > 100*scrapeTimestampTolerance { // For some reason, a tick might have been skipped, in which case we // would call alignedScrapeTime.Add(interval) multiple times.
Ensure that timestamp comparison uses wall clock time It's not possible to assume subtraction and addition of a time.Time will result in consistent values.
prometheus_prometheus
train
go
c2b1ef124935344f856fd880c584afabbcee05e5
diff --git a/hazelcast-sql/src/test/java/com/hazelcast/jet/sql/impl/expression/predicate/BetweenOperatorIntegrationTest.java b/hazelcast-sql/src/test/java/com/hazelcast/jet/sql/impl/expression/predicate/BetweenOperatorIntegrationTest.java index <HASH>..<HASH> 100644 --- a/hazelcast-sql/src/test/java/com/hazelcast/jet/sql/impl/expression/predicate/BetweenOperatorIntegrationTest.java +++ b/hazelcast-sql/src/test/java/com/hazelcast/jet/sql/impl/expression/predicate/BetweenOperatorIntegrationTest.java @@ -199,7 +199,7 @@ public class BetweenOperatorIntegrationTest extends ExpressionTestSupport { Tuple2<List<SqlRow>, HazelcastSqlException> comparisonEquivalentResult = executePossiblyFailingQuery( // the queries have extra spaces so that the errors are on the same positions - "SELECT this FROM map WHERE (this >= ? AND this <= ?) OR (this <= ? AND this >= ?) ORDER BY this", + "SELECT this FROM map WHERE (this >= ? AND this <= ?) OR (this >= ? AND this <= ?) ORDER BY this", fieldType.getFieldConverterType().getTypeFamily().getPublicType(), biValue.field1(), biValue.field2(),
Ensure SQL symmetric between test verifies correct behaviour (#<I>)
hazelcast_hazelcast
train
java
4f042c971e080533956e3ad27d71c8bad513fb9b
diff --git a/addon/services/current-user.js b/addon/services/current-user.js index <HASH>..<HASH> 100644 --- a/addon/services/current-user.js +++ b/addon/services/current-user.js @@ -100,9 +100,6 @@ export default Service.extend({ canCreateOrUpdateUserInAnySchool: computed('session.data.authenticated.jwt', function(){ return this.getBooleanAttributeFromToken('can_create_or_update_user_in_any_school'); }), - canCreateCIReportInAnySchool: computed('session.data.authenticated.jwt', function(){ - return this.getBooleanAttributeFromToken('can_create_curriculum_inventory_report_in_any_school'); - }), async isDirectingSchool(school) { const user = await this.get('model'); const ids = user.hasMany('directedSchools').ids();
Remove canCreateCIReportInAnySchool property This is no longer provided in the token.
ilios_common
train
js
992ce27c920da7752c07ac7a7c95f58cc00a5b7f
diff --git a/src/Valkyrja/Container/Managers/CacheableContainer.php b/src/Valkyrja/Container/Managers/CacheableContainer.php index <HASH>..<HASH> 100644 --- a/src/Valkyrja/Container/Managers/CacheableContainer.php +++ b/src/Valkyrja/Container/Managers/CacheableContainer.php @@ -68,7 +68,7 @@ class CacheableContainer extends Container /** * Before setup. * - * @param mixed $config + * @param ContainerConfig|array $config * * @return void */ @@ -179,7 +179,7 @@ class CacheableContainer extends Container /** * After setup. * - * @param mixed $config + * @param ContainerConfig|array $config * * @return void */
Update CacheableContainer.php
valkyrjaio_valkyrja
train
php
a50311e180422b11705af7b24c5cd5a791ab929b
diff --git a/src/embed/world-renderer.js b/src/embed/world-renderer.js index <HASH>..<HASH> 100644 --- a/src/embed/world-renderer.js +++ b/src/embed/world-renderer.js @@ -236,8 +236,9 @@ WorldRenderer.prototype.setDefaultYaw_ = function(angleRad) { // Rotate the camera parent to take into account the scene's rotation. // By default, it should be at the center of the image. var display = this.controls.getVRDisplay(); + // For desktop, we subtract the current display Y axis var theta = display.theta_ || 0; - + // For devices with orientation we make the current view center if (display.poseSensor_) { display.poseSensor_.resetPose(); }
comments added to setDefaultYaw_
googlearchive_vrview
train
js
abd14d79854457acb904492c0c4076c902b87f50
diff --git a/lib/environment.command.js b/lib/environment.command.js index <HASH>..<HASH> 100644 --- a/lib/environment.command.js +++ b/lib/environment.command.js @@ -61,7 +61,9 @@ module.exports = function (Aquifer) { command.action((name) => { let env = new Aquifer.api.environment(Aquifer, name); env.prompt() - .then(env.ping) + .then(() => { + return env.ping(); + }) .then(() => { Aquifer.console.log('The "' + name + '" environment exists and is accessible!', 'success'); })
Correctly chain prompt and ping.
aquifer_aquifer
train
js
c0db57b52aa0546fd6f7a2cf4fc0242cbcf76537
diff --git a/test_bot.py b/test_bot.py index <HASH>..<HASH> 100644 --- a/test_bot.py +++ b/test_bot.py @@ -5,7 +5,7 @@ from tpb import TPB t = TPB() # when using a proxy site -# t = TPB('http://uberproxy.net/thepiratebay.sx') +# t = TPB(domain='http://uberproxy.net/thepiratebay.sx') for to in t.get_recent_torrents():
Fix the test bot's TPB initialization
karan_TPB
train
py
b3d369dbe027fd82c47aa0c186ff40e03d8d55b0
diff --git a/lib/girffi/builder.rb b/lib/girffi/builder.rb index <HASH>..<HASH> 100644 --- a/lib/girffi/builder.rb +++ b/lib/girffi/builder.rb @@ -19,12 +19,11 @@ module GirFFI sym = info.symbol argnames = info.args.map {|a| a.name} - code = <<-CODE + return <<-CODE def #{info.name} #{argnames.join(', ')} Lib.#{sym} #{argnames.join(', ')} end CODE - return code.gsub(/(^\s*|\s*$)/, "") end def function_introspection_data namespace, function diff --git a/test/test_builder.rb b/test/test_builder.rb index <HASH>..<HASH> 100644 --- a/test/test_builder.rb +++ b/test/test_builder.rb @@ -43,7 +43,7 @@ class BuilderTest < Test::Unit::TestCase should "build correct definition of Gtk.main" do code = @builder.function_definition @go - assert_equal "def main\nLib.gtk_main\nend", code + assert_equal "def main\nLib.gtk_main\nend", code.gsub(/(^\s*|\s*$)/, "") end should "attach function to Whatever::Lib" do
Cleaning up whitespace is not functional.
mvz_gir_ffi
train
rb,rb
4aa67e29f47a41a530f843bf7bba0eda6e761745
diff --git a/src/extensions/cytoscape.renderer.canvas.js b/src/extensions/cytoscape.renderer.canvas.js index <HASH>..<HASH> 100644 --- a/src/extensions/cytoscape.renderer.canvas.js +++ b/src/extensions/cytoscape.renderer.canvas.js @@ -1231,6 +1231,27 @@ return imageContainer.image; } + // Attempt to replace the image object with a canvas buffer to solve zooming problem + CanvasRenderer.prototype.swapCachedImage = function(url) { + if (imageCache[url]) { + + if (image.complete) { + image = imageCache[url].image; + + var buffer = document.createElement("canvas"); + buffer.width = image.clientWidth; + buffer.height = image.clientHeight; + + + + } else { + return null; + } + } else { + return null; + } + } + CanvasRenderer.prototype.updateImageCaches = function() { for (var url in imageCache) {
Attempt to solve graphical glitch caused by zooming too far into a node custom image by replacing image object with a canvas buffer
cytoscape_cytoscape.js
train
js
85ff4a51d14438ae5911e796d2aec61864677595
diff --git a/logpush.go b/logpush.go index <HASH>..<HASH> 100644 --- a/logpush.go +++ b/logpush.go @@ -10,14 +10,15 @@ import ( // LogpushJob describes a Logpush job. type LogpushJob struct { - ID int `json:"id,omitempty"` - Enabled bool `json:"enabled"` - Name string `json:"name"` - LogpullOptions string `json:"logpull_options"` - DestinationConf string `json:"destination_conf"` - LastComplete *time.Time `json:"last_complete,omitempty"` - LastError *time.Time `json:"last_error,omitempty"` - ErrorMessage string `json:"error_message,omitempty"` + ID int `json:"id,omitempty"` + Enabled bool `json:"enabled"` + Name string `json:"name"` + LogpullOptions string `json:"logpull_options"` + DestinationConf string `json:"destination_conf"` + OwnershipChallenge string `json:"ownership_challenge"` + LastComplete *time.Time `json:"last_complete,omitempty"` + LastError *time.Time `json:"last_error,omitempty"` + ErrorMessage string `json:"error_message,omitempty"` } // LogpushJobsResponse is the API response, containing an array of Logpush Jobs.
Add OwnershipChallenge token field to LogpushJob struct
cloudflare_cloudflare-go
train
go
127494ff21bf48f6eb02eefefd76910859539204
diff --git a/presto-cli/src/main/java/com/facebook/presto/cli/Console.java b/presto-cli/src/main/java/com/facebook/presto/cli/Console.java index <HASH>..<HASH> 100644 --- a/presto-cli/src/main/java/com/facebook/presto/cli/Console.java +++ b/presto-cli/src/main/java/com/facebook/presto/cli/Console.java @@ -104,7 +104,7 @@ public class Console throw new RuntimeException("both --execute and --file specified"); } try { - query = Files.toString(new File(clientOptions.file), UTF_8); + query = Files.asCharSource(new File(clientOptions.file), UTF_8).read(); hasQuery = true; } catch (IOException e) {
Update deprecated use of Files.toString
prestodb_presto
train
java
1cee25c8868f68a3d3d6a9947c20714dfc0c36c1
diff --git a/lib/fog/bluebox/requests/blb/add_machine_to_lb_backend.rb b/lib/fog/bluebox/requests/blb/add_machine_to_lb_backend.rb index <HASH>..<HASH> 100644 --- a/lib/fog/bluebox/requests/blb/add_machine_to_lb_backend.rb +++ b/lib/fog/bluebox/requests/blb/add_machine_to_lb_backend.rb @@ -21,6 +21,7 @@ module Fog :path => "/api/lb_backends/#{lb_backend_id}/lb_machines.json", :body => body.map {|k,v| "#{CGI.escape(k)}=#{CGI.escape(v.to_s)}"}.join('&') ) + end end class Mock
[bluebox|blb] missing end
fog_fog
train
rb
71db652b83c4ee9caeb8c65c634f64dfb34a54fe
diff --git a/lib/lifx/client.js b/lib/lifx/client.js index <HASH>..<HASH> 100644 --- a/lib/lifx/client.js +++ b/lib/lifx/client.js @@ -253,6 +253,7 @@ Client.prototype.send = function(msg) { } } + msg.sequence = this.sequenceNumber; packet.data = Packet.toBuffer(msg); this.messagesQueue.unshift(packet);
Fix sequence number not set in header #<I>
MariusRumpf_node-lifx
train
js
d497f6f6716df40b74efe85a77034f1d22a41756
diff --git a/ui/src/utils/date.js b/ui/src/utils/date.js index <HASH>..<HASH> 100644 --- a/ui/src/utils/date.js +++ b/ui/src/utils/date.js @@ -308,7 +308,7 @@ export function extractDate (str, mask, dateLocale) { const date = new Date( d.year, d.month === null ? null : d.month - 1, - d.day, + d.day === null ? 1 : d.day, d.hour, d.minute, d.second,
fix(extractDate): default to first day of month instead of last day of prev month when day is missing in the mask #<I> (#<I>)
quasarframework_quasar
train
js
5bf24464b00257a9fa5f66047a2f7815c1e4f8fb
diff --git a/tweepy/utils.py b/tweepy/utils.py index <HASH>..<HASH> 100644 --- a/tweepy/utils.py +++ b/tweepy/utils.py @@ -12,5 +12,6 @@ def list_to_csv(item_list): def parse_datetime(datetime_string): return datetime.datetime.strptime( - datetime_string, "%Y-%m-%dT%H:%M:%S.%f%z" - ) + datetime_string, "%Y-%m-%dT%H:%M:%S.%fZ" + ).replace(tzinfo=datetime.timezone.utc) + # Use %z when support for Python 3.6 is dropped
Fix parse_datetime to parse API datetime string format with Python <I> The '%z' directive didn't accept 'Z' until Python <I>
tweepy_tweepy
train
py
96dce20eb1868e88c010390d5e836b703fa55802
diff --git a/test/http/mock.js b/test/http/mock.js index <HASH>..<HASH> 100644 --- a/test/http/mock.js +++ b/test/http/mock.js @@ -9,15 +9,15 @@ describe("gpf.http.mock", function () { }); it("exposes a method to mock requests", function () { - assert("function" === typeof gpf.http.mock); + assert(typeof gpf.http.mock === "function"); }); it("exposes a method to remove one specific mocking", function () { - assert("function" === typeof gpf.http.mock.remove); + assert(typeof gpf.http.mock.remove === "function"); }); it("exposes a method to reset all mocking", function () { - assert("function" === typeof gpf.http.mock.reset); + assert(typeof gpf.http.mock.reset === "function"); }); describe("Simple mocking example", function () { @@ -59,7 +59,7 @@ describe("gpf.http.mock", function () { })["catch"](done); }); - if (0 === config.httpPort) { + if (config.httpPort === 0) { return; }
!yoda style (#<I>)
ArnaudBuchholz_gpf-js
train
js
d56e1003eeb0bc4d767cb6a92c8ff6007e407c99
diff --git a/analysis/index.js b/analysis/index.js index <HASH>..<HASH> 100644 --- a/analysis/index.js +++ b/analysis/index.js @@ -1,7 +1,11 @@ 'use strict'; const Services = require('./../services/'); const Realtime = require('./../utils/realtime.js'); - + +function stringify_msg(msg) { + return (typeof msg === 'object' && !Array.isArray(msg) ? JSON.stringify(msg) : String(msg)); +} + class Analysis { constructor(analysis, token) { this._token = token; @@ -16,7 +20,7 @@ class Analysis { let tago_console = new Services(token).console; function log() { if (!process.env.TAGO_RUNTIME) console.log.apply(null, arguments); - return tago_console.log(arguments); + return tago_console.log(Object.keys(arguments).map(x => stringify_msg(arguments[x])).join(' ')); } let context = {
Added stringify to the console log
tago-io_tago-sdk-js
train
js
df2eec868c598c748822337c76d153619c3a161e
diff --git a/src/mixins/menuable.js b/src/mixins/menuable.js index <HASH>..<HASH> 100644 --- a/src/mixins/menuable.js +++ b/src/mixins/menuable.js @@ -283,10 +283,6 @@ export default { this.dimensions = Object.assign({}, dimensions) }, updateDimensions () { - // Ensure that overflow calculation - // can work properly every update - this.resetDimensions() - const dimensions = {} // Activator should already be shown
fix(menuable): removed position reset position reset was causing some browsers to recalc position before it could be reset causing a wobble fixes #<I>
vuetifyjs_vuetify
train
js
1dfebd4f0d25ecf50ba4e320234523d9ee3f7523
diff --git a/activesupport/lib/active_support/secure_random.rb b/activesupport/lib/active_support/secure_random.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/secure_random.rb +++ b/activesupport/lib/active_support/secure_random.rb @@ -164,13 +164,13 @@ module ActiveSupport hex = n.to_s(16) hex = '0' + hex if (hex.length & 1) == 1 bin = [hex].pack("H*") - mask = bin[0].ord + mask = bin[0] mask |= mask >> 1 mask |= mask >> 2 mask |= mask >> 4 begin rnd = SecureRandom.random_bytes(bin.length) - rnd[0] = (rnd[0].ord & mask).chr + rnd[0] = rnd[0] & mask end until rnd < bin rnd.unpack("H*")[0].hex else diff --git a/activesupport/test/secure_random_test.rb b/activesupport/test/secure_random_test.rb index <HASH>..<HASH> 100644 --- a/activesupport/test/secure_random_test.rb +++ b/activesupport/test/secure_random_test.rb @@ -12,4 +12,8 @@ class SecureRandomTest < Test::Unit::TestCase b2 = ActiveSupport::SecureRandom.hex(64) assert_not_equal b1, b2 end + + def test_random_number + assert ActiveSupport::SecureRandom.random_number(5000) < 5000 + end end
<I> compatibility for random_number method on SecureRandom. <I> has its own version.
rails_rails
train
rb,rb
1139e31c7ade930f272cb6d6f8bfb2bc46dc5974
diff --git a/sixpack/web.py b/sixpack/web.py index <HASH>..<HASH> 100644 --- a/sixpack/web.py +++ b/sixpack/web.py @@ -42,6 +42,7 @@ def status(): @app.route("/") def hello(): experiments = Experiment.all(db.REDIS) + experiments = [exp.name for exp in experiments] return render_template('dashboard.html', experiments=experiments)
fix broken dashboard, expects list of names
sixpack_sixpack
train
py
21743de7900723a0884cbbc8f77c889a5a1e18ba
diff --git a/test_maya.py b/test_maya.py index <HASH>..<HASH> 100644 --- a/test_maya.py +++ b/test_maya.py @@ -138,3 +138,17 @@ def test_comparison_operations(): assert (now >= now_copy) is True assert (now >= tomorrow) is False + + # Check Exceptions + with pytest.raises(TypeError): + now == 1 + with pytest.raises(TypeError): + now != 1 + with pytest.raises(TypeError): + now < 1 + with pytest.raises(TypeError): + now <= 1 + with pytest.raises(TypeError): + now > 1 + with pytest.raises(TypeError): + now >= 1
test for AttributeError in MayaDT comparison operators
kennethreitz_maya
train
py
5b1d0d4f1bbf9666dc5d439a733601f6cf2623a4
diff --git a/views/v3/templates/master.blade.php b/views/v3/templates/master.blade.php index <HASH>..<HASH> 100644 --- a/views/v3/templates/master.blade.php +++ b/views/v3/templates/master.blade.php @@ -26,8 +26,12 @@ <body class="{{ $bodyClass }}" js-page-id="{{$pageID}}"> <div class="site-wrapper"> - {{-- Site header --}} - @includeIf('partials.header') + {{-- Site header --}} + @section('site-header') + @if (!empty($headerLayout)) + @includeIf('partials.header.' . $headerLayout) + @endif + @show {{-- Notices Notice::add() --}}
Fix: Set header view based on headerLayout setting
helsingborg-stad_Municipio
train
php
b2c3658d92633d14967d1105ee5d85f89f522964
diff --git a/src/context/client-window.js b/src/context/client-window.js index <HASH>..<HASH> 100644 --- a/src/context/client-window.js +++ b/src/context/client-window.js @@ -1,5 +1,5 @@ /** - * @license ciao + * @license MIT <Gianluca Casati> http://g14n.info/flow-view */ var windowFunctions = require('../functions/window'),
Update client-window.js
fibo_dflow
train
js
0d7d42d1fcdabb6a984fb18d4b78e1418e3e9fd1
diff --git a/lib/discordrb/light/integrations.rb b/lib/discordrb/light/integrations.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/light/integrations.rb +++ b/lib/discordrb/light/integrations.rb @@ -14,6 +14,9 @@ module Discordrb::Light # @return [String] the ID of the connected account attr_reader :id + # @return [Array<Integration>] the integrations associated with this connection + attr_reader :integrations + # @!visibility private def initialize(data, bot) @bot = bot
Add a reader for a connection's integrations
meew0_discordrb
train
rb
82ab5c708d4d38f6ec8a236b1c589d15d38a3d0d
diff --git a/machinist/_fsm.py b/machinist/_fsm.py index <HASH>..<HASH> 100644 --- a/machinist/_fsm.py +++ b/machinist/_fsm.py @@ -1,5 +1,5 @@ # Copyright Hybrid Logic Ltd. See LICENSE file for details. -# -*- test-case-name: hybridcluster.tests.test_fsm -*- +# -*- test-case-name: machinist.test.test_fsm -*- """ Implementation details for machinist's public interface. diff --git a/machinist/test/test_fsm.py b/machinist/test/test_fsm.py index <HASH>..<HASH> 100644 --- a/machinist/test/test_fsm.py +++ b/machinist/test/test_fsm.py @@ -18,7 +18,7 @@ from twisted.python.util import FancyStrMixin from twisted.python.constants import Names, NamedConstant from twisted.trial.unittest import TestCase -from hybridcluster.fsm import ( +from machinist import ( ExtraTransitionState, MissingTransitionState, ExtraTransitionInput, MissingTransitionInput, ExtraTransitionOutput, MissingTransitionOutput,
Use better and/or correct names for modules in a couple places.
ScatterHQ_machinist
train
py,py
7f40ae7876988d3e5cf72e2715b71309edeaa822
diff --git a/cmd/puppeth/module_faucet.go b/cmd/puppeth/module_faucet.go index <HASH>..<HASH> 100644 --- a/cmd/puppeth/module_faucet.go +++ b/cmd/puppeth/module_faucet.go @@ -33,7 +33,7 @@ import ( // faucetDockerfile is the Dockerfile required to build an faucet container to // grant crypto tokens based on GitHub authentications. var faucetDockerfile = ` -FROM puppeth/faucet:latest +FROM ethereum/client-go:alltools-latest ADD genesis.json /genesis.json ADD account.json /account.json
cmd/puppeth: switch over to upstream alltools docker image
ethereum_go-ethereum
train
go
36c4d9da100452643c9cd21bddc7db9524892151
diff --git a/src/GitHub_Updater/Install.php b/src/GitHub_Updater/Install.php index <HASH>..<HASH> 100644 --- a/src/GitHub_Updater/Install.php +++ b/src/GitHub_Updater/Install.php @@ -99,6 +99,12 @@ class Install { */ public function add_settings_tabs() { $install_tabs = []; + if ( current_user_can( 'install_plugins' ) ) { + $install_tabs['github_updater_install_plugin'] = esc_html__( 'Install Plugin', 'github-updater' ); + } + if ( current_user_can( 'install_themes' ) ) { + $install_tabs['github_updater_install_theme'] = esc_html__( 'Install Theme', 'github-updater' ); + } add_filter( 'github_updater_add_settings_tabs', function ( $tabs ) use ( $install_tabs ) { return array_merge( $tabs, $install_tabs );
check specific privileges for setup of Install tabs
afragen_github-updater
train
php
4c7d254a8bc69b94e8de50d794aeccf4a4e21781
diff --git a/code/Debug/Helper/Data.php b/code/Debug/Helper/Data.php index <HASH>..<HASH> 100644 --- a/code/Debug/Helper/Data.php +++ b/code/Debug/Helper/Data.php @@ -123,11 +123,27 @@ class Sheep_Debug_Helper_Data extends Mage_Core_Helper_Data /** * Decides if we need to capture request information. * - * For now, we'll not capture anything if we don't need to show the toolbar + * We don't capture requests if: + * - requests belons to our module + * - we're not allowed to show toolbar (module disabled, dev mod is off) */ public function canCapture() { - return $this->canShowToolbar(); + return !$this->isSheepDebugRequest($this->_getRequest()) && $this->canShowToolbar(); + } + + + /** + * Checks if current request belongs to our module by verifying if its request path starts with our route name. + * + * We cannot verify controller module becuase request is not yet dispatched. + * + * @param Mage_Core_Controller_Request_Http $request + * @return bool + */ + public function isSheepDebugRequest(Mage_Core_Controller_Request_Http $request) + { + return strpos($request->getPathInfo(), '/sheep_debug/') === 0; }
Don't capture debug request (at least for now)
madalinoprea_magneto-debug
train
php
f23f6f7dbfb35e6315d26b05c037aa76b5326b68
diff --git a/www_src/lib/touchhandler.js b/www_src/lib/touchhandler.js index <HASH>..<HASH> 100644 --- a/www_src/lib/touchhandler.js +++ b/www_src/lib/touchhandler.js @@ -73,7 +73,9 @@ endmark: function(evt) { if (debug) { timedLog("endmark"); } if(evt.touches && evt.touches.length > 0) { - handlers.endSecondFinger(evt); + if (handlers.endSecondFinger(evt)) { + return; + } } if (debug) { timedLog("endmark - continued"); } mark = copy(positionable.state); @@ -150,10 +152,13 @@ if (debug) { timedLog("endSecondFinger"); } if (evt.touches.length > 1) { if (debug) { timedLog("endSecondFinger - capped"); } - return; + return true; } if (debug) { timedLog("endSecondFinger - continued"); } handlers.startmark(evt); + // If there are no fingers left on the screen, + // we have not finished the handling + return evt.touches.length !== 0; } };
put in a check to make sure we keep in mind whether zero or more fingers are on the screen after removing a finger
mozilla_webmaker-android
train
js
236e005c9f6e2a922377922a938e82f5bc07c5c6
diff --git a/wandb/sdk/wandb_init.py b/wandb/sdk/wandb_init.py index <HASH>..<HASH> 100644 --- a/wandb/sdk/wandb_init.py +++ b/wandb/sdk/wandb_init.py @@ -108,9 +108,15 @@ class _WandbInit(object): self.printer = get_printer(singleton._settings._jupyter) # check if environment variables have changed singleton_env = { - k: v for k, v in singleton._environ.items() if k.startswith("WANDB_") + k: v + for k, v in singleton._environ.items() + if k.startswith("WANDB_") and k != "WANDB_SERVICE" + } + os_env = { + k: v + for k, v in os.environ.items() + if k.startswith("WANDB_") and k != "WANDB_SERVICE" } - os_env = {k: v for k, v in os.environ.items() if k.startswith("WANDB_")} if set(singleton_env.keys()) != set(os_env.keys()) or set( singleton_env.values() ) != set(os_env.values()):
Ignore WANDB_SERVICE env var in env checks in wandb.init (#<I>)
wandb_client
train
py
188a691db70c26ffb33781de0dde257246f8f278
diff --git a/daemon/graphdriver/fuse-overlayfs/fuseoverlayfs.go b/daemon/graphdriver/fuse-overlayfs/fuseoverlayfs.go index <HASH>..<HASH> 100644 --- a/daemon/graphdriver/fuse-overlayfs/fuseoverlayfs.go +++ b/daemon/graphdriver/fuse-overlayfs/fuseoverlayfs.go @@ -76,11 +76,9 @@ func init() { graphdriver.Register(driverName, Init) } -// Init returns the native diff driver for overlay filesystem. -// If overlay filesystem is not supported on the host, the error +// Init returns the naive diff driver for fuse-overlayfs. +// If fuse-overlayfs is not supported on the host, the error // graphdriver.ErrNotSupported is returned. -// If an overlay filesystem is not supported over an existing filesystem then -// the error graphdriver.ErrIncompatibleFS is returned. func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (graphdriver.Driver, error) { if _, err := exec.LookPath(binary); err != nil { logger.Error(err) @@ -117,7 +115,6 @@ func (d *Driver) String() string { } // Status returns current driver information in a two dimensional string array. -// Output contains "Backing Filesystem" used in this implementation. func (d *Driver) Status() [][2]string { return [][2]string{} }
fuse-overlayfs: fix godoc "fuse-overlayfs" storage driver had wrong godoc comments that were copied from "overlay2".
moby_moby
train
go
25ce6b1a9060886332cdfff8e9954ea730a5cbdf
diff --git a/src/core.js b/src/core.js index <HASH>..<HASH> 100644 --- a/src/core.js +++ b/src/core.js @@ -84,6 +84,13 @@ $.fn.powerTip = function(opts, arg) { dataTarget = $this.data('powertiptarget'), title = $this.attr('title'); + // handle repeated powerTip calls on the same element by destroying + // the original instance hooked to it and replacing it with this call + if ($this.data('displayController')) { + apiDestroy($this); + title = $this.attr('title'); + } + // attempt to use title attribute text if there is no data-powertip, // data-powertipjq or data-powertiptarget. If we do use the title // attribute, delete the attribute so the browser will not show it
Added check for existing PowerTip instance. Resolves issue #<I>.
stevenbenner_jquery-powertip
train
js
b3d9239cad094c466e4ddf147c468b41fc545a9c
diff --git a/src/Models/Collections/AbstractCollection.php b/src/Models/Collections/AbstractCollection.php index <HASH>..<HASH> 100644 --- a/src/Models/Collections/AbstractCollection.php +++ b/src/Models/Collections/AbstractCollection.php @@ -388,8 +388,8 @@ abstract class AbstractCollection implements Iterator, Countable protected function evict($property, AbstractModel $model) { $key = $model->getCompositeKey(); - if (isset($this->$property)) { - unset($this->$property[$key]); + if (isset($this->{$property})) { + unset($this->{$property}[$key]); } if ('models' === $property) { @@ -425,10 +425,10 @@ abstract class AbstractCollection implements Iterator, Countable protected function set($property, AbstractModel $model) { $key = $model->getCompositeKey(); - $this->$property[$key] = $model; + $this->{$property}[$key] = $model; if ('models' === $property) { - $keys = array_flip($this->models); + $keys = array_flip($this->modelKeyMap); if (!isset($keys[$key])) { $this->modelKeyMap[] = $key; $this->totalCount++;
Esure dynamic properties are encapsulated
as3io_modlr
train
php
5ee30c7cb5a263951fcf880a7685fc00197ae68e
diff --git a/mailchimp3/baseapi.py b/mailchimp3/baseapi.py index <HASH>..<HASH> 100644 --- a/mailchimp3/baseapi.py +++ b/mailchimp3/baseapi.py @@ -51,16 +51,16 @@ class BaseApi(object): # Remove offset and count if provided in kwargs kwargs.pop("offset", None) kwargs.pop("count", None) - #Fetch results from mailchimp, up to first 100 - result = self._mc_client._get(url=url, offset=0, count=100, **kwargs) + #Fetch results from mailchimp, up to first 5000 + result = self._mc_client._get(url=url, offset=0, count=5000, **kwargs) total = result['total_items'] #Fetch further results if necessary - if total > 100: - for offset in range(1, int(total / 100) + 1): + if total > 5000: + for offset in range(1, int(total / 5000) + 1): result = merge_results(result, self._mc_client._get( url=url, - offset=int(offset*100), - count=100, + offset=int(offset*5000), + count=5000, **kwargs )) return result
Increase count for iteration For large datasets, it is faster to make less API calls with large results than lots of API calls with few results.
VingtCinq_python-mailchimp
train
py
45a354bd7d7970c14f6ac9dd1d034bb38eb67436
diff --git a/src/Middleware/SocialAuthMiddleware.php b/src/Middleware/SocialAuthMiddleware.php index <HASH>..<HASH> 100644 --- a/src/Middleware/SocialAuthMiddleware.php +++ b/src/Middleware/SocialAuthMiddleware.php @@ -314,6 +314,12 @@ class SocialAuthMiddleware implements MiddlewareInterface, EventDispatcherInterf $provider = $this->_getService($request)->getProvider($providerName); $accessToken = $provider->getAccessTokenByRequestParameters($request->getQueryParams()); $identity = $provider->getIdentity($accessToken); + + if (!$identity->id) { + throw new RuntimeException( + "`id` field is empty for the identity returned by `{$providerName}` provider." + ); + } } catch (SocialConnectException $e) { $this->_error = self::AUTH_STATUS_PROVIDER_FAILURE;
Throw exception if `id` is not available from the identity. Refs #<I>.
ADmad_cakephp-social-auth
train
php
90a7caa27fa4414f8a6814db6625815ccba0b206
diff --git a/chef/lib/chef/knife/cookbook_upload.rb b/chef/lib/chef/knife/cookbook_upload.rb index <HASH>..<HASH> 100644 --- a/chef/lib/chef/knife/cookbook_upload.rb +++ b/chef/lib/chef/knife/cookbook_upload.rb @@ -118,7 +118,10 @@ class Chef end ui.info "upload complete" - update_version_constraints(version_constraints_to_update) if config[:environment] + + unless version_constraints_to_update.empty? + update_version_constraints(version_constraints_to_update) if config[:environment] + end end def cookbook_repo
CHEF-<I>: Only update the environment when necessary.
chef_chef
train
rb
1bc853a2c164001fdfdb773f87b7fb263cedcf60
diff --git a/config/default.rb b/config/default.rb index <HASH>..<HASH> 100644 --- a/config/default.rb +++ b/config/default.rb @@ -4,7 +4,6 @@ Vagrant::Config.run do |config| config.vagrant.host = :detect config.ssh.username = "vagrant" - config.ssh.password = "vagrant" config.ssh.host = "127.0.0.1" config.ssh.guest_port = 22 config.ssh.max_tries = 100
Remove config.ssh.password, it hasn't been used in years
hashicorp_vagrant
train
rb
475ac0de2ad9d37710caba92abe15bf82d5a5512
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,8 @@ setup(name="untwisted", "untwisted.utils", "untwisted.plugins"], author="Iury O. G. Figueiredo", - author_email="[email protected]") + author_email="[email protected]", + description="A library for asynchronous programming in python.",)
Adding description. Adding `description` to `setup.py`
untwisted_untwisted
train
py
a427887c14e2f6d6bd6141ceae9798e4edaa00f3
diff --git a/asv_bench/benchmarks/gil.py b/asv_bench/benchmarks/gil.py index <HASH>..<HASH> 100644 --- a/asv_bench/benchmarks/gil.py +++ b/asv_bench/benchmarks/gil.py @@ -1,7 +1,7 @@ import numpy as np from pandas import DataFrame, Series, date_range, factorize, read_csv -from pandas.core.algorithms import take_1d +from pandas.core.algorithms import take_nd from .pandas_vb_common import tm @@ -110,7 +110,7 @@ class ParallelTake1D: @test_parallel(num_threads=2) def parallel_take1d(): - take_1d(df["col"].values, indexer) + take_nd(df["col"].values, indexer) self.parallel_take1d = parallel_take1d
CI: fix reference to take_1d() (#<I>) Removed in <URL>
pandas-dev_pandas
train
py
a4e7311cf5c9730898129fe6b102faa170a0ea76
diff --git a/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php b/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php +++ b/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php @@ -35,7 +35,7 @@ class VerifyCsrfToken protected $except = []; /** - * If you're client-side scripts need the XSRF-TOKEN cookie, enable this setting. + * If your client-side scripts need the XSRF-TOKEN cookie, enable this setting. * * @var bool */
Update VerifyCsrfToken.php
laravel_framework
train
php
a7690bd7d813fe6038c9a9e1c9160af27b99425b
diff --git a/SoftLayer/managers/load_balancer.py b/SoftLayer/managers/load_balancer.py index <HASH>..<HASH> 100644 --- a/SoftLayer/managers/load_balancer.py +++ b/SoftLayer/managers/load_balancer.py @@ -18,6 +18,11 @@ class LoadBalancerManager(utils.IdentifierMixin, object): :param SoftLayer.API.BaseClient client: the client instance """ + TYPE = { + 1: "Public to Private", + 0: "Private to Private", + 2: "Public to Public", + } def __init__(self, client): self.client = client
<I> add const type of load balancer as UI, and ibmcloud cli shows
softlayer_softlayer-python
train
py
295741fe2ec88c06a92ddcebb644a822f376ab2b
diff --git a/src/Models/Relation.php b/src/Models/Relation.php index <HASH>..<HASH> 100644 --- a/src/Models/Relation.php +++ b/src/Models/Relation.php @@ -7,9 +7,19 @@ use Illuminate\Database\Eloquent\Model; class Relation extends Model { /** + * OneToMany Relationship. + */ + const OneToMany = 'OneToMany'; + + /** + * ManyToMany Relationship. + */ + const ManyToMany = 'ManyToMany'; + + /** * The attributes that are mass assignable. * - * @var array + * @var array $fillable */ protected $fillable = ['scaffoldinterface_id', 'to', 'having']; }
Create OneToMany, ManyToMany constant
amranidev_scaffold-interface
train
php
24496a3a8c1d4d061555f1546668a44703582b3b
diff --git a/src/graceful/serializers.py b/src/graceful/serializers.py index <HASH>..<HASH> 100644 --- a/src/graceful/serializers.py +++ b/src/graceful/serializers.py @@ -196,8 +196,10 @@ class BaseSerializer(metaclass=MetaSerializer): for single_value in value ] else: - object_dict[source] = field.from_representation( - value) if not field.allow_null else None + if not field.allow_null: + object_dict[source] = field.from_representation(value) + else: + object_dict[source] = value except ValueError as err: failed[name] = str(err)
Returning always None of a nullable field is fixed
swistakm_graceful
train
py
4b206349a217b79325b80da75bae2d506bbac40e
diff --git a/striplog/utils.py b/striplog/utils.py index <HASH>..<HASH> 100644 --- a/striplog/utils.py +++ b/striplog/utils.py @@ -16,19 +16,22 @@ class CustomFormatter(Formatter): def __init__(self): super(CustomFormatter, self).__init__() - self.last_index = 0 - def get_value(self, key, args, kwargs): - if key == '': - key = self.last_index - self.last_index += 1 - return super(CustomFormatter, self).get_value(key, args, kwargs) - - def parse(self, format_string): - # We'll leave this alone. - return super(CustomFormatter, self).parse(format_string) + def get_field(self, field_name, args, kwargs): + """ + Return an underscore if the attribute is absent. + Not all components have the same attributes. + """ + try: + s = super(CustomFormatter, self) + return s.get_field(field_name, args, kwargs) + except KeyError: + return ("_", field_name) def convert_field(self, value, conversion): + """ + Define some extra field conversion functions. + """ try: # If the normal behaviour works, do it. s = super(CustomFormatter, self) return s.convert_field(value, conversion)
cope with missing fields in fmt
agile-geoscience_striplog
train
py
8c32a14b73bb83ae3470918fe10575ce84a3ea22
diff --git a/eventsourcing/examples/wiki/application.py b/eventsourcing/examples/wiki/application.py index <HASH>..<HASH> 100644 --- a/eventsourcing/examples/wiki/application.py +++ b/eventsourcing/examples/wiki/application.py @@ -106,7 +106,7 @@ class Log(Generic[TDomainEvent]): self.originator_id = originator_id self.logged_cls = logged_cls - def trigger_event(self, **kwargs: Any) -> AggregateEvent[Aggregate]: + def trigger_event(self, **kwargs: Any) -> TDomainEvent: last_logged = self._get_last_logged() if last_logged: next_originator_version = last_logged.originator_version + 1
Adjusted type annotation in wiki example Log class.
johnbywater_eventsourcing
train
py
d1ca19160689c910039ca7f752e6a8d0368d4786
diff --git a/lib/reporters/jshint/index.js b/lib/reporters/jshint/index.js index <HASH>..<HASH> 100644 --- a/lib/reporters/jshint/index.js +++ b/lib/reporters/jshint/index.js @@ -3,7 +3,7 @@ var JSHINT = require("jshint").JSHINT; exports.process = function (source, options/*, reportInfo */) { - var results = lint(source, options.jshint, options.globals); + var results = lint(source, options.options, options.globals); var report = generateReport(results); return report; };
fixed jshint option passing
es-analysis_plato
train
js
0c2e89c34065d482d001b2df4ec13d1aeef48f4f
diff --git a/flaskext/sqlalchemy.py b/flaskext/sqlalchemy.py index <HASH>..<HASH> 100644 --- a/flaskext/sqlalchemy.py +++ b/flaskext/sqlalchemy.py @@ -533,8 +533,6 @@ class SQLAlchemy(object): app.config.setdefault('SQLALCHEMY_POOL_TIMEOUT', None) app.config.setdefault('SQLALCHEMY_POOL_RECYCLE', None) - self.app = app - @app.after_request def shutdown_session(response): self.session.remove()
Don't assign app to self, that is not supported
pallets_flask-sqlalchemy
train
py
861d0b03ff0a54ff6c8e938d5333e69700c0e3ae
diff --git a/core/src/main/java/org/ocpsoft/prettytime/i18n/Resources_de.java b/core/src/main/java/org/ocpsoft/prettytime/i18n/Resources_de.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/ocpsoft/prettytime/i18n/Resources_de.java +++ b/core/src/main/java/org/ocpsoft/prettytime/i18n/Resources_de.java @@ -51,7 +51,7 @@ public class Resources_de extends ListResourceBundle { "JustNowPattern", "%u" }, { "JustNowFuturePrefix", "Jetzt" }, { "JustNowFutureSuffix", "" }, - { "JustNowPastPrefix", "vor einem Augenblick" }, + { "JustNowPastPrefix", "gerade eben" }, { "JustNowPastSuffix", "" }, { "JustNowSingularName", "" }, { "JustNowPluralName", "" }, @@ -120,4 +120,4 @@ public class Resources_de extends ListResourceBundle return OBJECTS; } -} \ No newline at end of file +}
Shorter German string for JustNowPast Probably more fitting for some projects to have a shorter string there.
ocpsoft_prettytime
train
java
f2de5a08b87c22067b9876204d0b2f8ec18b2ba6
diff --git a/examples/with-iron-session/components/Header.js b/examples/with-iron-session/components/Header.js index <HASH>..<HASH> 100644 --- a/examples/with-iron-session/components/Header.js +++ b/examples/with-iron-session/components/Header.js @@ -54,7 +54,7 @@ const Header = () => { )} <li> <a href="https://github.com/vvo/next-iron-session"> - <img src="/GitHub-Mark-Light-32px.png" widht="32" height="32" /> + <img src="/GitHub-Mark-Light-32px.png" width="32" height="32" /> </a> </li> </ul>
Fix typo in Header component of with-iron-session example (#<I>)
zeit_next.js
train
js
10115c84f728f4f33d4744b6a7d36dc8b80a4161
diff --git a/lib/capybara/selenium/node.rb b/lib/capybara/selenium/node.rb index <HASH>..<HASH> 100644 --- a/lib/capybara/selenium/node.rb +++ b/lib/capybara/selenium/node.rb @@ -53,6 +53,11 @@ class Capybara::Selenium::Node < Capybara::Driver::Node # :none => append the new value to the existing value <br/> # :backspace => send backspace keystrokes to clear the field <br/> # Array => an array of keys to send before the value being set, e.g. [[:command, 'a'], :backspace] + # @option options [Boolean] :rapid (nil) Whether setting text inputs should use a faster &quot;rapid&quot; mode<br/> + # nil => Text inputs with length greater than 30 characters will be set using a faster driver script mode<br/> + # true => Rapid mode will be used regardless of input length<br/> + # false => Sends keys via conventional mode. This may be required to avoid losing key-presses if you have certain + # Javascript interactions on form inputs<br/> def set(value, **options) if value.is_a?(Array) && !multiple? raise ArgumentError, "Value cannot be an Array when 'multiple' attribute is not present. Not a #{value.class}"
Document the text "rapid" mode in RubyDocs
teamcapybara_capybara
train
rb
bf38176d439d4920df3a8ee80d133680f7430e11
diff --git a/src/Stagehand/TestRunner/Core/Bootstrap.php b/src/Stagehand/TestRunner/Core/Bootstrap.php index <HASH>..<HASH> 100644 --- a/src/Stagehand/TestRunner/Core/Bootstrap.php +++ b/src/Stagehand/TestRunner/Core/Bootstrap.php @@ -69,7 +69,7 @@ class Bootstrap $this->prepareApplicationContext(); } - public function prepareClassLoader() + protected function prepareClassLoader() { if (!class_exists('Stagehand\TestRunner\Core\Environment')) { if (!class_exists('Symfony\Component\ClassLoader\UniversalClassLoader', false)) {
Changed the visibility of the prepareClassLoader() method to protected.
piece_stagehand-testrunner
train
php
885b59feddd866454a1f77d6dc38edd912fbcb8c
diff --git a/template.go b/template.go index <HASH>..<HASH> 100644 --- a/template.go +++ b/template.go @@ -8,6 +8,7 @@ import ( "os" "path/filepath" "strings" + "syscall" "text/template" ) @@ -108,7 +109,13 @@ func generateFile(config Config, containers Context) bool { if config.Dest != "" { contents := []byte{} - if _, err := os.Stat(config.Dest); err == nil { + if fi, err := os.Stat(config.Dest); err == nil { + if err := dest.Chmod(fi.Mode()); err != nil { + log.Fatalf("unable to chmod temp file: %s\n", err) + } + if err := dest.Chown(int(fi.Sys().(*syscall.Stat_t).Uid), int(fi.Sys().(*syscall.Stat_t).Gid)); err != nil { + log.Fatalf("unable to chown temp file: %s\n", err) + } contents, err = ioutil.ReadFile(config.Dest) if err != nil { log.Fatalf("unable to compare current file contents: %s: %s\n", config.Dest, err)
Update permissions of temp file to match that of original file.
jwilder_docker-gen
train
go
26d54d2c0bf396f87fb375fa49b605ff081ca0d4
diff --git a/lib/foreman_docker/engine.rb b/lib/foreman_docker/engine.rb index <HASH>..<HASH> 100644 --- a/lib/foreman_docker/engine.rb +++ b/lib/foreman_docker/engine.rb @@ -41,7 +41,7 @@ module ForemanDocker initializer 'foreman_docker.register_plugin', :after => :finisher_hook do Foreman::Plugin.register :foreman_docker do - requires_foreman '> 1.4' + requires_foreman '>= 1.11' compute_resource ForemanDocker::Docker sub_menu :top_menu, :containers_menu, :caption => N_('Containers'),
Fixes #<I> - Raise requires_foreman version to <I> Since now we use attr_accessible, and more changes are coming up to make this plugin Rails 4 compatible, the minimum version needs to be <I>.
theforeman_foreman_docker
train
rb
18bde78e8ad62d07b7d668aa5c325eec9fb87e97
diff --git a/test/test-utils.test.js b/test/test-utils.test.js index <HASH>..<HASH> 100644 --- a/test/test-utils.test.js +++ b/test/test-utils.test.js @@ -107,19 +107,20 @@ Child ${config2Name}: describe("appendFile functionality", () => { describe("positive test-cases", () => { const junkFile = resolve(__dirname, "junkFile.js"); + const initialJunkData = "initial junk data"; + const junkComment = "//junk comment"; beforeEach(() => { - writeFileSync(junkFile, ""); + writeFileSync(junkFile, initialJunkData); }); afterEach(() => { unlinkSync(junkFile); }); it("should append data to file if file exists", () => { - const expectedData = "//junk comment"; - appendDataIfFileExists(__dirname, junkFile, expectedData); + appendDataIfFileExists(__dirname, junkFile, junkComment); const actualData = readFileSync(junkFile).toString(); - expect(actualData).toBe(expectedData); + expect(actualData).toBe(initialJunkData + junkComment); }); });
tests: improve appendFile test-case
webpack_webpack-cli
train
js