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
27b2eab3db57029d59d817afe71276f302498ea9
diff --git a/flag.go b/flag.go index <HASH>..<HASH> 100644 --- a/flag.go +++ b/flag.go @@ -974,7 +974,7 @@ func (f *FlagSet) parseArgs(args []string) error { // The return value will be ErrHelp if -help was set but not defined. func (f *FlagSet) Parse(arguments []string) error { f.parsed = true - f.args = make([]string, len(arguments)) + f.args = make([]string, 0, len(arguments)) err := f.parseArgs(arguments) if err != nil { switch f.errorHandling {
Oops, allocate memory for arguments, don't set them to ""
ogier_pflag
train
go
c8664319edde80645bccca8f38fcc6872c9154ae
diff --git a/lib/Browser.js b/lib/Browser.js index <HASH>..<HASH> 100644 --- a/lib/Browser.js +++ b/lib/Browser.js @@ -63,6 +63,7 @@ class Browser { this._chromeArguments.push(...options.args); this._terminated = false; this._chromeProcess = null; + this._launchPromise = null; } /** @@ -96,8 +97,12 @@ class Browser { } async _ensureChromeIsRunning() { - if (this._chromeProcess) - return; + if (!this._launchPromise) + this._launchPromise = this._launchChrome(); + return this._launchPromise; + } + + async _launchChrome() { this._chromeProcess = childProcess.spawn(this._chromeExecutable, this._chromeArguments, {}); let stderr = ''; this._chromeProcess.stderr.on('data', data => stderr += data.toString('utf8'));
Make browser._ensureChromeIsRunning idempotent The _ensureChromeIsRunning should launch chrome only once and return the same promise for all its clients.
GoogleChrome_puppeteer
train
js
d44fe8b94d2c8f10b72e39e9d55919e2210eb486
diff --git a/cmd/jujud/unit.go b/cmd/jujud/unit.go index <HASH>..<HASH> 100644 --- a/cmd/jujud/unit.go +++ b/cmd/jujud/unit.go @@ -48,7 +48,7 @@ func (a *UnitAgent) Stop() error { // Run runs a unit agent. func (a *UnitAgent) Run(ctx *cmd.Context) error { - defer log.Printf("unit agent exiting") + defer log.Printf("uniter: unit agent exiting") defer a.tomb.Done() for a.tomb.Err() == tomb.ErrStillAlive { err := a.runOnce() @@ -71,7 +71,7 @@ func (a *UnitAgent) Run(ctx *cmd.Context) error { case <-a.tomb.Dying(): a.tomb.Kill(err) case <-time.After(retryDelay): - log.Printf("rerunning uniter") + log.Printf("uniter: rerunning uniter") } } return a.tomb.Err()
cmd/jujud: make log msgs more consistent
juju_juju
train
go
f8efc812b886825492d247a25a912791858ab2d2
diff --git a/nptdms/tdms.py b/nptdms/tdms.py index <HASH>..<HASH> 100644 --- a/nptdms/tdms.py +++ b/nptdms/tdms.py @@ -625,10 +625,14 @@ class TdmsObject(object): "Object does not have property '%s'" % property_name) def time_track(self, absolute_time=False, accuracy='ns'): - """Return an array of time for this channel + """Return an array of time or the independent variable for this channel This depends on the object having the wf_increment and wf_start_offset properties defined. + Note that wf_start_offset is usually zero for time-series data. + If you have time-series data channels with different start times, + you should use the absolute time or calculate the time offsets using + the wf_start_time property. For larger timespans, the accuracy setting should be set lower. The default setting is 'ns', which has a timespan of
Add note about wf_start_offset with time-series data to documentation Fixes #<I>
adamreeve_npTDMS
train
py
37af81432d72050da4c1f22f9bc13e1843d449e4
diff --git a/src/geo/map.js b/src/geo/map.js index <HASH>..<HASH> 100644 --- a/src/geo/map.js +++ b/src/geo/map.js @@ -59,7 +59,7 @@ cdb.geo.Map = Backbone.Model.extend({ defaults: { center: [0, 0], - zoom: 9, + zoom: 3, bounding_box_sw: [0, 0], bounding_box_ne: [0, 0], provider: 'leaflet'
changed default map view to zoom 9 in order to see the complete world when map is created
CartoDB_carto.js
train
js
112ef4682a06197a61c9fd5a21d9f0b0450f8a50
diff --git a/Repository/AttributeRepository.php b/Repository/AttributeRepository.php index <HASH>..<HASH> 100644 --- a/Repository/AttributeRepository.php +++ b/Repository/AttributeRepository.php @@ -14,7 +14,7 @@ use MsgPhp\Eav\AttributeId; interface AttributeRepository { /** - * @return DomainCollection<Attribute> + * @return DomainCollection<array-key, Attribute> */ public function findAll(int $offset = 0, int $limit = 0): DomainCollection;
generic collections/repositories (ref #<I>)
msgphp_eav
train
php
36d00a38497f0da000b49810c134cf0e239ba108
diff --git a/CHANGES.txt b/CHANGES.txt index <HASH>..<HASH> 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,13 @@ CHANGES ======= +--- +1.0 +--- + +This backward-incompatible release attempts to remove some cruft from the +codebase that's accumulated over the versions. + ---- 0.10 ---- diff --git a/release.py b/release.py index <HASH>..<HASH> 100644 --- a/release.py +++ b/release.py @@ -20,7 +20,7 @@ try: except Exception: pass -VERSION = '0.11' +VERSION = '1.0' def get_next_version(): digits = map(int, VERSION.split('.')) diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,7 @@ if sys.version_info < (2, 7) or ( setup_params = dict( name = 'keyring', - version = "0.11", + version = "1.0", description = "Store and access your passwords safely.", url = "http://bitbucket.org/kang/python-keyring-lib", keywords = "keyring Keychain GnomeKeyring Kwallet password storage",
Begin work on <I> release
jaraco_keyring
train
txt,py,py
9885fa3716514c6d3fb2b4c48da7ef7c724776a8
diff --git a/src/main/java/org/asteriskjava/live/internal/AsteriskServerImpl.java b/src/main/java/org/asteriskjava/live/internal/AsteriskServerImpl.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/asteriskjava/live/internal/AsteriskServerImpl.java +++ b/src/main/java/org/asteriskjava/live/internal/AsteriskServerImpl.java @@ -24,6 +24,7 @@ import org.asteriskjava.manager.response.*; import org.asteriskjava.util.DateUtil; import org.asteriskjava.util.Log; import org.asteriskjava.util.LogFactory; +import org.asteriskjava.util.AstUtil; import org.asteriskjava.config.ConfigFile; import org.asteriskjava.AsteriskVersion; @@ -1044,7 +1045,7 @@ public class AsteriskServerImpl implements AsteriskServer, ManagerEventListener } cb = callbackData.getCallback(); - if (originateEvent.getUniqueId() != null) + if (! AstUtil.isNull(originateEvent.getUniqueId())) { channel = channelManager.getChannelImplById(originateEvent.getUniqueId()); }
[AJ-<I>] Now using AstUtil.isNull() to check uniqueId in originate response events (string was "<null>")
asterisk-java_asterisk-java
train
java
1aa527c67bf447bf6d0d1c58b7c5094cb4e4d6bd
diff --git a/tests/system/Database/Live/ModelTest.php b/tests/system/Database/Live/ModelTest.php index <HASH>..<HASH> 100644 --- a/tests/system/Database/Live/ModelTest.php +++ b/tests/system/Database/Live/ModelTest.php @@ -360,13 +360,14 @@ class ModelTest extends CIDatabaseTestCase $this->db->table('secondary') ->insert([ - 'id' => 1, + 'key' => 'foo', 'value' => 'bar', ]); + $this->db->table('secondary') ->insert([ - 'id' => 2, + 'key' => 'bar', 'value' => 'baz', ]);
Remove id from insert into an autoid field.
codeigniter4_CodeIgniter4
train
php
be370e6a291f7692afbe850d56414b343cbbee84
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -59,7 +59,8 @@ setup(name='cwltool', 'prov == 1.5.1', 'pathlib2 == 2.3.0', 'graphviz == 0.8.2', - 'bagit >= 1.6.4' + 'bagit >= 1.6.4', + 'future' ], extras_require={ ':python_version<"3" and platform_system=="Linux"':
add missing 'future' dependency
common-workflow-language_cwltool
train
py
4605ab066d4b9ecd6e27091e9fd92bb0e2a3511b
diff --git a/src/utils/props.js b/src/utils/props.js index <HASH>..<HASH> 100644 --- a/src/utils/props.js +++ b/src/utils/props.js @@ -11,7 +11,10 @@ export const CommonPropTypes = { PropTypes.array, PropTypes.object, ]), - style: PropTypes.object, + style: PropTypes.oneOfType([ + PropTypes.object, // e.g., inline styles + PropTypes.func, // function to be passed some datum, required to return an object + ]), width: PropTypes.oneOfType([ PropTypes.string, PropTypes.number,
style, as a common prop, should be able to accept a function that returns an object
ihmeuw_ihme-ui
train
js
57b6a704b75886dca1b9a0f6c8cbe704521edfc9
diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index <HASH>..<HASH> 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -153,7 +153,7 @@ class assignment_base { navmenu($this->course, $this->cm)); $groupmode = groups_get_activity_groupmode($this->cm); - $currentgroup = groups_get_activity_group($this->cm); + $this->currentgroup = groups_get_activity_group($this->cm); groups_print_activity_menu($this->cm, 'view.php?id=' . $this->cm->id); echo '<div class="reportlink">'.$this->submittedlink().'</div>'; @@ -309,7 +309,7 @@ class assignment_base { if (!has_capability('moodle/course:managegroups', $context) and (groups_get_activity_groupmode($this->cm) == SEPARATEGROUPS)) { $count = $this->count_real_submissions($this->currentgroup); // Only their groups } else { - $count = $this->count_real_submissions(); // Everyone + $count = $this->count_real_submissions($this->currentgroup); // Everyone } $submitted = '<a href="submissions.php?id='.$this->cm->id.'">'. get_string('viewsubmissions', 'assignment', $count).'</a>';
MDL-<I> Added code to check for selected group as well, so that privileged users get correct count when changing groups.
moodle_moodle
train
php
0956c47c24bd6ea14ad4e9ad6b3ab45dd2a558e3
diff --git a/lib/spanish/syllable.rb b/lib/spanish/syllable.rb index <HASH>..<HASH> 100644 --- a/lib/spanish/syllable.rb +++ b/lib/spanish/syllable.rb @@ -26,6 +26,8 @@ module Spanish def coda_wants?(sound) if nucleus.empty? false + elsif !coda.empty? + false if coda.last.approximant? else # Codas don't want a rising dipthong but will accept one at the end of words. sound.consonantal? && !(sound.approximant? && sound.palatal?) @@ -129,4 +131,4 @@ module Spanish end end -end \ No newline at end of file +end
Don't allow multiple approximants in codas
norman_spanish
train
rb
b930c4a92c3b6ad6d5deb37d55f817631b022eff
diff --git a/lib/image.js b/lib/image.js index <HASH>..<HASH> 100644 --- a/lib/image.js +++ b/lib/image.js @@ -154,6 +154,8 @@ Image.prototype = { callback.call( self, error ) }) + this.fd = null + return this },
fix(image): Null file descriptor in .close()
jhermsmeier_node-udif
train
js
d278e7305d91f5e51c012322a488bb9a0e85d828
diff --git a/javers-core/src/main/java/org/javers/core/metamodel/object/GlobalId.java b/javers-core/src/main/java/org/javers/core/metamodel/object/GlobalId.java index <HASH>..<HASH> 100644 --- a/javers-core/src/main/java/org/javers/core/metamodel/object/GlobalId.java +++ b/javers-core/src/main/java/org/javers/core/metamodel/object/GlobalId.java @@ -1,5 +1,6 @@ package org.javers.core.metamodel.object; +import java.util.Comparator; import org.javers.common.validation.Validate; import org.javers.core.metamodel.type.ManagedType; import org.javers.repository.jql.GlobalIdDTO; @@ -9,7 +10,7 @@ import java.io.Serializable; /** * Global ID of Client's domain object (CDO) */ -public abstract class GlobalId implements Serializable { +public abstract class GlobalId implements Serializable, Comparable<GlobalId> { private final String typeName; @@ -75,4 +76,9 @@ public abstract class GlobalId implements Serializable { } return getTypeName(); } + + @Override + public int compareTo(GlobalId o) { + return Comparator.comparing(GlobalId::value).compare(this, o); + } }
Implementing `Comparable` on `GlobalId`.
javers_javers
train
java
15702303e1fcb7fe5966bdb4da37fe1a5fad2e1d
diff --git a/src/TwigBridge/TwigServiceProvider.php b/src/TwigBridge/TwigServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/TwigBridge/TwigServiceProvider.php +++ b/src/TwigBridge/TwigServiceProvider.php @@ -20,15 +20,19 @@ use Twig_Lexer; class TwigServiceProvider extends ViewServiceProvider { /** - * Register the service provider. - * - * @return void + * {@inheritdoc} */ public function register() { // Register the package configuration with the loader. $this->app['config']->package('rcrowe/twigbridge', __DIR__.'/../config'); + } + /** + * {@inheritdoc} + */ + public function boot() + { // Override Environment // We need to do this in order to set the name of the generated/compiled twig templates // Laravel by default only passes the full path to the requested view, we also need the view name
Moved registering Twig engine to boot method.
rcrowe_TwigBridge
train
php
c492d1bf3215a83311417c216609edd208a05598
diff --git a/nonebot/typing.py b/nonebot/typing.py index <HASH>..<HASH> 100644 --- a/nonebot/typing.py +++ b/nonebot/typing.py @@ -38,6 +38,10 @@ __all__ = [ 'State_T', 'Filter_T', 'PermChecker_T', + 'NLPHandler_T', + 'NoticeHandler_T', + 'RequestHandler_T', + 'MessagePreprocessor_T', 'PermissionPolicy_T', 'PluginLifetimeHook_T', ]
fix: typing __all__ missing entires
richardchien_nonebot
train
py
2827c4a045d11233b55371b762114bf42c3270a9
diff --git a/transport/http/handler.go b/transport/http/handler.go index <HASH>..<HASH> 100644 --- a/transport/http/handler.go +++ b/transport/http/handler.go @@ -36,13 +36,12 @@ type handler struct { } func (h handler) ServeHTTP(w http.ResponseWriter, req *http.Request) { + defer req.Body.Close() if req.Method != "POST" { http.NotFound(w, req) return } - defer req.Body.Close() - caller := req.Header.Get(CallerHeader) if len(caller) == 0 { http.Error(w, "caller name is required", http.StatusBadRequest)
http/inbound: always close request body
yarpc_yarpc-go
train
go
1da7f869a8aa746224ab3fff4a23710a5f2b13cf
diff --git a/Source/labeled_modules/View.js b/Source/labeled_modules/View.js index <HASH>..<HASH> 100644 --- a/Source/labeled_modules/View.js +++ b/Source/labeled_modules/View.js @@ -90,9 +90,11 @@ exports: View }, destroy: function(){ + var element = this.element; + this.detachEvents(); - this.element = (this.element.destroy(), undefined); + this.element = (element && element.destroy(), undefined); return this; }
Correcting destroy method to destroy element if it exists.
GCheung55_Neuro
train
js
6ef2e587bcf6b02a9b197b6b50dc96b232f32ab3
diff --git a/choix/utils.py b/choix/utils.py index <HASH>..<HASH> 100644 --- a/choix/utils.py +++ b/choix/utils.py @@ -183,7 +183,7 @@ def log_likelihood_network( for i in range(len(traffic_in)): loglik += traffic_in[i] * params[i] if digraph.out_degree(i) > 0: - neighbors = digraph.successors(i) + neighbors = list(digraph.successors(i)) if weight is None: loglik -= traffic_out[i] * logsumexp(params.take(neighbors)) else:
Fix bug that appeared with NetworkX <I>. Starting with the <I> release of NetworkX, `DiGraph.successors` returns an iterator instead of a list. This caused `log_likelihood_network` to crash.
lucasmaystre_choix
train
py
8d4632772ae901e7afca5f857dbedd5b6aef7087
diff --git a/mod/hotpot/db/mysql.php b/mod/hotpot/db/mysql.php index <HASH>..<HASH> 100644 --- a/mod/hotpot/db/mysql.php +++ b/mod/hotpot/db/mysql.php @@ -21,11 +21,6 @@ function hotpot_upgrade($oldversion) { $ok = $ok && hotpot_get_update_to_v2(); $ok = $ok && hotpot_update_to_v2_1_2(); } - // update to HotPot v2.1.6 - if ($oldversion < 2005090706) { - $ok = $ok && hotpot_get_update_to_v2(); - $ok = $ok && hotpot_update_to_v2_1_6(); - } return $ok; } function hotpot_get_update_to_v2() {
mysql does not need to call "hotpot_update_to_v2_1_6()" or "hotpot_update_to_v2_1_8()" functions
moodle_moodle
train
php
7d60f01b9a56dfd152796877d009b1a0578d6ef4
diff --git a/SensioLabs/Security/Crawler/BaseCrawler.php b/SensioLabs/Security/Crawler/BaseCrawler.php index <HASH>..<HASH> 100644 --- a/SensioLabs/Security/Crawler/BaseCrawler.php +++ b/SensioLabs/Security/Crawler/BaseCrawler.php @@ -71,6 +71,9 @@ abstract class BaseCrawler implements CrawlerInterface $contents = json_decode(file_get_contents($lock), true); $packages = array('packages' => array(), 'packages-dev' => array()); foreach (array('packages', 'packages-dev') as $key) { + if (!is_array($contents[$key])) { + continue; + } foreach ($contents[$key] as $package) { $data = array( 'name' => $package['name'],
fixed support for older composer.lock format
sensiolabs_security-checker
train
php
83215f2ac84ae46149d97c065198cb3a0933394f
diff --git a/packages/react-server/core/ClientController.js b/packages/react-server/core/ClientController.js index <HASH>..<HASH> 100644 --- a/packages/react-server/core/ClientController.js +++ b/packages/react-server/core/ClientController.js @@ -36,7 +36,7 @@ Q.onerror = (err) => { var SESSION_START_PREFIX = (new Date()).getTime() + '_'; var NEXT_STATE_FRAME = 0; -var CURRENT_STATE_FRAME = SESSION_START_PREFIX + NEXT_STATE_FRAME; +var CURRENT_STATE_FRAME; function pushFrame() { CURRENT_STATE_FRAME = SESSION_START_PREFIX + ++NEXT_STATE_FRAME;
Removed double initialization of CURRENT_STATE_FRAME variable.
redfin_react-server
train
js
bf0271cfd3078caa4f41b4ed04dc2f8f80420044
diff --git a/prow/cmd/deck/main.go b/prow/cmd/deck/main.go index <HASH>..<HASH> 100644 --- a/prow/cmd/deck/main.go +++ b/prow/cmd/deck/main.go @@ -612,6 +612,10 @@ func renderSpyglass(sg *spyglass.Spyglass, cfg config.Getter, src string, o opti runPath, err := sg.RunPath(src) if err == nil { artifactsLink = gcswebPrefix + runPath + // gcsweb wants us to end URLs with a trailing slash + if !strings.HasSuffix(artifactsLink, "/") { + artifactsLink += "/" + } } }
gcsweb links should end in slashes, apparently.
kubernetes_test-infra
train
go
0fd64eb43040ea79a2cfcc94aef2b8ffa18f0a99
diff --git a/uptick/info.py b/uptick/info.py index <HASH>..<HASH> 100644 --- a/uptick/info.py +++ b/uptick/info.py @@ -64,7 +64,7 @@ def info(ctx, objects): click.echo("Object %s unknown" % obj) # Asset - elif obj.upper() == obj: + elif obj.upper() == obj and re.match("^[A-Z\.]*$", obj): data = Asset(obj) t = PrettyTable(["Key", "Value"]) t.align = "l" @@ -100,5 +100,20 @@ def info(ctx, objects): click.echo(t) else: click.echo("Account %s unknown" % obj) + + elif ":" in obj: + vote = ctx.bitshares.rpc.lookup_vote_ids([obj])[0] + if vote: + t = PrettyTable(["Key", "Value"]) + t.align = "l" + for key in sorted(vote): + value = vote[key] + if isinstance(value, dict) or isinstance(value, list): + value = json.dumps(value, indent=4) + t.add_row([key, value]) + click.echo(t) + else: + click.echo("voteid %s unknown" % obj) + else: click.echo("Couldn't identify object to read")
[info] allow to query for a voteid
bitshares_uptick
train
py
498512bc7bd37e56a8df3c06d404946ccbd9965a
diff --git a/src/jasmine.terminal_reporter.js b/src/jasmine.terminal_reporter.js index <HASH>..<HASH> 100644 --- a/src/jasmine.terminal_reporter.js +++ b/src/jasmine.terminal_reporter.js @@ -70,6 +70,10 @@ reportSpecResults: function(spec) { var color = "red"; + if (spec.results().skipped) { + return; + } + if (spec.results().passed()) { this.passed_specs++; color = "green";
Don't count skipped spec what filtered by specFilter.
larrymyers_jasmine-reporters
train
js
c3341ac9f884d153369c8bd90877cfef77cc88d6
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,13 +2,17 @@ require "bundler/setup" require "rspec_overview" RSpec.configure do |config| - # Enable flags like --only-failures and --next-failure config.example_status_persistence_file_path = ".rspec_status" - - # Disable RSpec exposing methods globally on `Module` and `main` config.disable_monkey_patching! config.expect_with :rspec do |c| c.syntax = :expect end + + config.mock_with :rspec do |mocks| + mocks.verify_partial_doubles = true + end + + config.order = :random + Kernel.srand config.seed end
Verify doubles & run specs in random order
odlp_rspec_overview
train
rb
159f587ee6e1cf54409932d7bce516105d41dd69
diff --git a/dom/events/enter/enter-test.js b/dom/events/enter/enter-test.js index <HASH>..<HASH> 100644 --- a/dom/events/enter/enter-test.js +++ b/dom/events/enter/enter-test.js @@ -3,7 +3,7 @@ var domEvents = require("../events"); require('./enter'); -QUnit = require('steal-qunit'); +var QUnit = require('../../../test/qunit'); QUnit.module("can-util/dom/events/enter"); diff --git a/js/single-reference/single-reference.js b/js/single-reference/single-reference.js index <HASH>..<HASH> 100644 --- a/js/single-reference/single-reference.js +++ b/js/single-reference/single-reference.js @@ -29,8 +29,6 @@ var singleReference; // check if it has a single reference map var keyName = CID(key); obj[keyName] = value; - console.log(keyName + 'keyName'); - console.log(obj + '\n'); }, getAndDelete: function(obj, key){
reference qunit relationally and remove console logs
canjs_can-util
train
js,js
52f55903f03e3910c74ecc1bb8bbeec1c47de909
diff --git a/spec/codelog/cli_spec.rb b/spec/codelog/cli_spec.rb index <HASH>..<HASH> 100644 --- a/spec/codelog/cli_spec.rb +++ b/spec/codelog/cli_spec.rb @@ -45,4 +45,12 @@ describe Codelog::CLI do end end end + + describe '#bump' do + it 'calls the bump command' do + allow(Codelog::Command::Bump).to receive(:run) + subject.bump 'major', '2012-12-12' + expect(Codelog::Command::Bump).to have_received(:run).with 'major', '2012-12-12' + end + end end
Added test spec to the bump command
codus_codelog
train
rb
4bbfdfc63cdfa0a6f54b09683033f23a71115547
diff --git a/src/pyws/protocols/rest.py b/src/pyws/protocols/rest.py index <HASH>..<HASH> 100644 --- a/src/pyws/protocols/rest.py +++ b/src/pyws/protocols/rest.py @@ -5,6 +5,13 @@ from pyws.functions.args.types.complex import List from pyws.response import Response from pyws.utils import json +class encoder( json.JSONEncoder ): + # JSON Serializer with datetime support + def default(self,obj): + if isinstance(obj, datetime.datetime): + return obj.isoformat() + return json.JSONEncoder.default( self,obj) + from pyws.protocols.base import Protocol __all__ = ('RestProtocol', 'JsonProtocol', ) @@ -31,7 +38,7 @@ class RestProtocol(Protocol): return result def get_response(self, result, name, return_type): - return create_response(json.dumps({'result': result})) + return create_response(json.dumps({'result': result},cls=encoder)) def get_error_response(self, error): return create_error_response(
Add custom JSON serialize for Python datetime This adds a custom JSON serializer class which stringifies Python datetime objects in to ISO <I>. JSON does not specify a date/time format, and many parsers break trying to parse a Date() javascript object. <I> seems a resonable compromise.
stepank_pyws
train
py
d541501870d04c9fe788b3e980d875a6d70c0030
diff --git a/salt/modules/win_file.py b/salt/modules/win_file.py index <HASH>..<HASH> 100644 --- a/salt/modules/win_file.py +++ b/salt/modules/win_file.py @@ -296,7 +296,7 @@ def chgrp(path, group): return None -def stats(path, hash_type='md5', follow_symlink=False): +def stats(path, hash_type='md5', follow_symlinks=False): ''' Return a dict containing the stats for a given file @@ -309,7 +309,7 @@ def stats(path, hash_type='md5', follow_symlink=False): ret = {} if not os.path.exists(path): return ret - if follow_symlink: + if follow_symlinks: pstat = os.stat(path) else: pstat = os.lstat(path)
Addresses the issue: Unable to manage file: stats() got an unexpected keyword argument 'follow_symlinks’
saltstack_salt
train
py
b3ed383daa6326ae595287adf146b1da44826d71
diff --git a/views/js/core/store/indexeddb.js b/views/js/core/store/indexeddb.js index <HASH>..<HASH> 100644 --- a/views/js/core/store/indexeddb.js +++ b/views/js/core/store/indexeddb.js @@ -55,6 +55,12 @@ define([ var idStoreName = 'id'; /** + * Check if we're using the v2 of IndexedDB + * @type {Boolean} + */ + var isIndexedDB2 = 'getAll' in IDBObjectStore.prototype; + + /** * Opens a store * @returns {Promise} with store instance in resolve */ @@ -209,7 +215,13 @@ define([ }) .catch(reject); }; - store.deleteDatabase(success, reject); + //with old implementation, deleting a store is + //either unsupported or buggy + if(isIndexedDB2){ + store.deleteDatabase(success, reject); + } else { + store.clear(success, reject); + } }); };
fallback to clear instead of delete for old indexeddb implementations
oat-sa_tao-core
train
js
4ae3eb2afaa19d69ec62e4b171f5c04e97c75a84
diff --git a/gcs/gcstesting/bucket_tests.go b/gcs/gcstesting/bucket_tests.go index <HASH>..<HASH> 100644 --- a/gcs/gcstesting/bucket_tests.go +++ b/gcs/gcstesting/bucket_tests.go @@ -523,7 +523,7 @@ func (t *updateTest) Successful() { // for calls to UpdateAttr but not calls to ListObjects. // // TODO(jacobsa): Send a changelist to fix this. - o.ACL = nil + o.ACL = []storage.ACLRule{} // Make sure it matches what is in a listing. listing, err := t.bucket.ListObjects(t.ctx, nil)
Fixed a bug in the ACL workaround.
jacobsa_gcloud
train
go
96e953e6e07f5c894ece6d4b8b93920552a1efe2
diff --git a/handler.go b/handler.go index <HASH>..<HASH> 100644 --- a/handler.go +++ b/handler.go @@ -289,13 +289,13 @@ func (h *Handler) handleGetSchema(w http.ResponseWriter, r *http.Request) { // handleGetStatus handles GET /status requests. func (h *Handler) handleGetStatus(w http.ResponseWriter, r *http.Request) { - status, err := h.API.Status(r.Context()) + pb, err := h.API.Status(r.Context()) if err != nil { h.Logger.Printf("cluster status error: %s", err) return } - cs, ok := status.(*internal.ClusterStatus) + cs, ok := pb.(*internal.ClusterStatus) if !ok { panic("status is not a status") }
rename var to be more descriptive
pilosa_pilosa
train
go
3174b2b587a8f33fa5c3f6c566476869c093aac5
diff --git a/Collection.php b/Collection.php index <HASH>..<HASH> 100644 --- a/Collection.php +++ b/Collection.php @@ -33,8 +33,9 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate * @var array */ protected static $proxies = [ - 'average', 'avg', 'contains', 'each', 'every', 'filter', 'first', 'flatMap', 'keyBy', - 'map', 'max', 'min', 'partition', 'reject', 'sortBy', 'sortByDesc', 'sum', 'unique', + 'average', 'avg', 'contains', 'each', 'every', 'filter', 'first', + 'flatMap', 'groupBy', 'keyBy', 'map', 'max', 'min', 'partition', + 'reject', 'sortBy', 'sortByDesc', 'sum', 'unique', ]; /**
Allow higher order groupBy (#<I>) collect()->groupBy->computed() instead of relying on a Closure value retriever.
illuminate_support
train
php
3e420313a2874730f9fe8ec8c7013fcc4231c73f
diff --git a/bin/generate-exports.py b/bin/generate-exports.py index <HASH>..<HASH> 100755 --- a/bin/generate-exports.py +++ b/bin/generate-exports.py @@ -203,7 +203,11 @@ def main(argv): symbol = Symbol(name, True, export_as) objects[name] = symbol if not export_as: - requires.add(name) + components = m.group('name').split('.') + if re.match(r'[A-Z]', components[-1]): + requires.add(name) + else: + requires.add('.'.join(components[:-1])) continue raise RuntimeError(line)
Only require things that start with a capital letter
openlayers_openlayers
train
py
da15822244c7691a88aa9d0063418226f4f194f5
diff --git a/knowledge_base/__init__.py b/knowledge_base/__init__.py index <HASH>..<HASH> 100755 --- a/knowledge_base/__init__.py +++ b/knowledge_base/__init__.py @@ -596,11 +596,19 @@ class KnowledgeBase(object): identifier.remove() for work in author.get_works(): + for title in work.efrbroo_P102_has_title: removed_resources.append(title.subject) title.remove() + for identifier in work.ecrm_P1_is_identified_by: removed_resources.append(identifier.subject) identifier.remove() + removed_resources.append(work.subject) + work.remove() + + removed_resources.append(author.subject) + author.remove() + return removed_resources
added to KnowledgeBase a method to remove deeply an author
mromanello_hucitlib
train
py
5263cc6688c7c7ed350da01db28d7456c8973e1c
diff --git a/taxi_zebra/backend.py b/taxi_zebra/backend.py index <HASH>..<HASH> 100755 --- a/taxi_zebra/backend.py +++ b/taxi_zebra/backend.py @@ -305,16 +305,16 @@ class ZebraBackend(BaseBackend): "credentials" % response.content ) projects_list = [] - date_attrs = (('start_date', 'startdate'), ('end_date', 'enddate')) + date_attrs = ('start_date', 'end_date') for project in projects['data']: p = Project(int(project['id']), project['name'], Project.STATUS_ACTIVE, project['description'], project['budget']) - for date_attr, proj_date in date_attrs: + for date_attr in date_attrs: try: - date = datetime.strptime(project[proj_date], + date = datetime.strptime(project[date_attr], '%Y-%m-%d').date() except (ValueError, TypeError): date = None
Rename startdate and enddate fields to start_date and end_date (fixes #<I>)
sephii_taxi-zebra
train
py
9da5a3d0ebc2f4889c56d52656a24926f5a5c84f
diff --git a/lib/atomo/ast/quasi_quote.rb b/lib/atomo/ast/quasi_quote.rb index <HASH>..<HASH> 100644 --- a/lib/atomo/ast/quasi_quote.rb +++ b/lib/atomo/ast/quasi_quote.rb @@ -42,7 +42,7 @@ module Atomo def bytecode(g) pos(g) - @expression.construct(g, 0) + @expression.construct(g, 1) end end end diff --git a/lib/atomo/ast/unquote.rb b/lib/atomo/ast/unquote.rb index <HASH>..<HASH> 100644 --- a/lib/atomo/ast/unquote.rb +++ b/lib/atomo/ast/unquote.rb @@ -28,7 +28,8 @@ module Atomo end def construct(g, d) - if d == 0 + # TODO: fail if depth == 0 + if d == 1 @expression.bytecode(g) g.send :to_node, 0 else
quasiquotes start constructing at depth 1
vito_atomy
train
rb,rb
865a19f8a5a770a5e0bd3af13d5111792a4a202f
diff --git a/knife/spec/unit/knife/ssh_spec.rb b/knife/spec/unit/knife/ssh_spec.rb index <HASH>..<HASH> 100644 --- a/knife/spec/unit/knife/ssh_spec.rb +++ b/knife/spec/unit/knife/ssh_spec.rb @@ -289,7 +289,7 @@ describe Chef::Knife::Ssh do let(:execution_channel2) { double(:execution_channel, on_data: nil, on_extended_data: nil) } let(:session_channel2) { double(:session_channel, request_pty: nil) } - let(:session) { double(:session, loop: nil) } + let(:session) { double(:session, loop: nil, close: nil) } let(:command) { "false" }
Fix busted ssh unit specs
chef_chef
train
rb
72c7222e86054b3bf6fcb740e71f28d70386eb01
diff --git a/pharen.php b/pharen.php index <HASH>..<HASH> 100644 --- a/pharen.php +++ b/pharen.php @@ -96,9 +96,10 @@ class Lexer{ $this->state = "new-expression"; }else if($this->char == "\\" && !$this->escaping){ $this->escaping = True; - }else if($this->escaping){ - $this->escaping = False; }else{ + if($this->escaping){ + $this->escaping = False; + } $this->tok->append($this->char); } }else if($this->state == "append"){
Fix bug where escaped double-quote didn't show up.
Scriptor_pharen
train
php
d159a58675af062b5da4c434cdcfae364ea64611
diff --git a/modin/experimental/engines/pyarrow_on_ray/io.py b/modin/experimental/engines/pyarrow_on_ray/io.py index <HASH>..<HASH> 100644 --- a/modin/experimental/engines/pyarrow_on_ray/io.py +++ b/modin/experimental/engines/pyarrow_on_ray/io.py @@ -1,8 +1,6 @@ from io import BytesIO import pandas -import pyarrow as pa -import pyarrow.csv as csv from modin.backends.pyarrow.query_compiler import PyarrowQueryCompiler from modin.data_management.utils import get_default_chunksize @@ -15,6 +13,8 @@ from modin import __execution_engine__ if __execution_engine__ == "Ray": import ray + import pyarrow as pa + import pyarrow.csv as csv @ray.remote def _read_csv_with_offset_pyarrow_on_ray(
Move pyarrow import after Ray (#<I>) * Resolves #<I> * Moves the pyarrow import after ray to use the pyarrow ray ships
modin-project_modin
train
py
de6e3f4e1c04d0ff28e1500c1c9dc03ca895b291
diff --git a/src/Creiwork.php b/src/Creiwork.php index <HASH>..<HASH> 100644 --- a/src/Creiwork.php +++ b/src/Creiwork.php @@ -13,6 +13,7 @@ use Creios\Creiwork\Framework\Middleware\ExceptionHandlingMiddleware; use Creios\Creiwork\Framework\Middleware\ExceptionHandlingMiddlewareInterface; use Creios\Creiwork\Framework\Router\PostProcessor; use Creios\Creiwork\Framework\Router\PreProcessor; +use Creios\Creiwork\Framework\Util\JsonValidator; use DI\Container; use DI\ContainerBuilder; use DI\Definition\Source\DefinitionSource; @@ -24,7 +25,6 @@ use JMS\Serializer\Naming\IdenticalPropertyNamingStrategy; use JMS\Serializer\SerializationContext; use JMS\Serializer\Serializer; use JMS\Serializer\SerializerBuilder; -use JsonSchema\Validator as JsonValidator; use League\Plates; use Middlewares\ContentType; use Middlewares\Whoops as WhoopsMiddleware; @@ -259,6 +259,14 @@ class Creiwork ->build(); }, + JsonValidator::class => function(Config $config){ + return new JsonValidator($config); + }, + + Validator::class => function() { + return new Validator(); + }, + ExceptionHandlingMiddlewareInterface::class => object(ExceptionHandlingMiddleware::class),
added standard DI config for JsonValidator and Opis\JsonSchema\Validator
creios_creiwork-framework
train
php
96c2b141025f88508186fa7a5390bf2074047fc6
diff --git a/src/browser/rollbar.js b/src/browser/rollbar.js index <HASH>..<HASH> 100644 --- a/src/browser/rollbar.js +++ b/src/browser/rollbar.js @@ -306,7 +306,7 @@ Rollbar.prototype.wrap = function(f, context, _before) { if (f.hasOwnProperty) { for (var prop in f) { - if (f.hasOwnProperty(prop)) { + if (f.hasOwnProperty(prop) && prop !== '_rollbar_wrapped') { f._rollbar_wrapped[prop] = f[prop]; } }
also don't copy our prop over
rollbar_rollbar.js
train
js
1d620004b613c1cd5c8a084fa0af1327ee61cb8f
diff --git a/src/interactableComponents/drawer/newDrawer.js b/src/interactableComponents/drawer/newDrawer.js index <HASH>..<HASH> 100644 --- a/src/interactableComponents/drawer/newDrawer.js +++ b/src/interactableComponents/drawer/newDrawer.js @@ -20,6 +20,7 @@ const ITEM_PROP_TYPES = { onPress: PropTypes.func, keepOpen: PropTypes.bool, style: ViewPropTypes.style, + testID: PropTypes.string, }; export default class NewDrawer extends BaseComponent { @@ -137,6 +138,7 @@ export default class NewDrawer extends BaseComponent { return ( <RectButton key={index} + testID={item.testID} style={[styles.action, item.style, {backgroundColor: item.background || DEFAULT_BG}, {width: item.width}]} onPress={() => this.onPress(item)} >
added testID to drawer items (#<I>)
wix_react-native-ui-lib
train
js
0f1fdae4aeb34c46849a415091cbb422e41a358e
diff --git a/src/processors/OrderByProcessor.php b/src/processors/OrderByProcessor.php index <HASH>..<HASH> 100644 --- a/src/processors/OrderByProcessor.php +++ b/src/processors/OrderByProcessor.php @@ -31,7 +31,7 @@ */ require_once(dirname(__FILE__) . '/AbstractProcessor.php'); -require_once(dirname(__FILE__) . '/SelectChunkProcessor.php'); +require_once(dirname(__FILE__) . '/SelectExpressionProcessor.php'); require_once(dirname(__FILE__) . '/../utils/ExpressionType.php'); /**
CHG: wrong path reference in require_once has been fixed git-svn-id: <URL>
greenlion_PHP-SQL-Parser
train
php
83bc35e3241585f78bc14ffb8743c136c2c84fcf
diff --git a/src/util/default-engines.js b/src/util/default-engines.js index <HASH>..<HASH> 100644 --- a/src/util/default-engines.js +++ b/src/util/default-engines.js @@ -14,11 +14,11 @@ module.exports = function(project_dir){ 'cordova-blackberry10': { 'platform':'blackberry10', 'scriptSrc': path.join(project_dir,'cordova','version') }, 'cordova-wp7': - { 'platform':'wp7', 'scriptSrc': path.join(project_dir,'cordova','version') }, + { 'platform':'wp7', 'scriptSrc': path.join(project_dir,'cordova','version.bat') }, 'cordova-wp8': - { 'platform':'wp8', 'scriptSrc': path.join(project_dir,'cordova','version') }, + { 'platform':'wp8', 'scriptSrc': path.join(project_dir,'cordova','version.bat') }, 'cordova-windows8': - { 'platform':'windows8', 'scriptSrc': path.join(project_dir,'cordova','version') }, + { 'platform':'windows8', 'scriptSrc': path.join(project_dir,'cordova','version.bat') }, // TODO: these scripts have not been made! 'apple-xcode' :
[CB-<I>] - forgot to add .bat to windows version paths
apache_cordova-plugman
train
js
456026e5b2017f441ad7fda266ffcdd1f6b51f6b
diff --git a/src/HPCloud/Storage/ObjectStorage/Container.php b/src/HPCloud/Storage/ObjectStorage/Container.php index <HASH>..<HASH> 100644 --- a/src/HPCloud/Storage/ObjectStorage/Container.php +++ b/src/HPCloud/Storage/ObjectStorage/Container.php @@ -266,10 +266,6 @@ class Container implements \Countable { catch (\HPCloud\Transport\FileNotFoundException $fnfe) { return FALSE; } - catch (\HPCloud\Transport\MethodNotAllowedException $e) { - $e->setMessage('DELETE ' . $url); - throw $e; - } if ($response->status() != 204) { throw new \HPCloud\Exception("An unknown exception occured while deleting $name.");
Backed out debugging code.
hpcloud_HPCloud-PHP
train
php
dcb43287551390ebd1320a702a8e5a57d33a4585
diff --git a/http-netty/src/main/java/io/micronaut/http/netty/reactive/HandlerPublisher.java b/http-netty/src/main/java/io/micronaut/http/netty/reactive/HandlerPublisher.java index <HASH>..<HASH> 100644 --- a/http-netty/src/main/java/io/micronaut/http/netty/reactive/HandlerPublisher.java +++ b/http-netty/src/main/java/io/micronaut/http/netty/reactive/HandlerPublisher.java @@ -453,6 +453,9 @@ public class HandlerPublisher<T> extends ChannelDuplexHandler implements Publish state = BUFFERING; } } + else if (outstandingDemand > 0 && state == DEMANDING) { + requestDemand(); + } } } }
If demanding, request more demand after publish
micronaut-projects_micronaut-core
train
java
b3fa62995b5b46baf0ac6b6a3255f03f0c35110d
diff --git a/Classes/Netlogix/JsonApiOrg/Resource/Information/ResourceInformation.php b/Classes/Netlogix/JsonApiOrg/Resource/Information/ResourceInformation.php index <HASH>..<HASH> 100644 --- a/Classes/Netlogix/JsonApiOrg/Resource/Information/ResourceInformation.php +++ b/Classes/Netlogix/JsonApiOrg/Resource/Information/ResourceInformation.php @@ -111,7 +111,13 @@ abstract class ResourceInformation { * @return boolean TRUE if this DtoConverter can handle the $source, FALSE otherwise. */ public function canHandle($payload) { - return is_object($payload) && is_a($payload, $this->payloadClassName); + if (is_object($payload) && is_a($payload, $this->payloadClassName)) { + return true; + } elseif (is_string($payload) && is_subclass_of($payload, $this->payloadClassName)) { + return true; + } else { + return false; + } } /**
[TASK] Accept strings as source in resource information as well
netlogix_jsonapiorg
train
php
f2aded71ca5a76e595f010df27ae869e71e9d075
diff --git a/src/utility/processRules.js b/src/utility/processRules.js index <HASH>..<HASH> 100644 --- a/src/utility/processRules.js +++ b/src/utility/processRules.js @@ -30,18 +30,6 @@ module.exports = function processRules(engine, program, goals, currentTime) { }; const fireRule = function fireRule(consequent) { - for (let i = 0; i < goals.length; i += 1) { - if (goals[i].isSameRootConjunction(consequent)) { - // a same root conjunction exists, don't refire - return; - } - } - for (let i = 0; i < newGoals.length; i += 1) { - if (newGoals[i].isSameRootConjunction(consequent)) { - // a same root conjunction exists, don't refire - return; - } - } newGoals.push(new GoalTree(engine, program, consequent)); };
removing isSameRootConjunction check from processRules
lps-js_lps.js
train
js
b9a7ec6db50722e892145110c8527bca81c08041
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -434,7 +434,7 @@ end # Any fixture labeled "DEFAULTS" is safely ignored. class Fixtures < (RUBY_VERSION < '1.9' ? YAML::Omap : Hash) - MAX_ID = 2 ** 31 - 1 + MAX_ID = 2 ** 30 - 1 DEFAULT_FILTER_RE = /\.ya?ml$/ @@all_cached_fixtures = {} diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/cases/fixtures_test.rb +++ b/activerecord/test/cases/fixtures_test.rb @@ -519,8 +519,8 @@ class FoxyFixturesTest < ActiveRecord::TestCase end def test_identifies_consistently - assert_equal 1281023246, Fixtures.identify(:ruby) - assert_equal 2140105598, Fixtures.identify(:sapphire_2) + assert_equal 207281424, Fixtures.identify(:ruby) + assert_equal 1066363776, Fixtures.identify(:sapphire_2) end TIMESTAMP_COLUMNS = %w(created_at created_on updated_at updated_on)
reduce max size of fixture IDs to fix sqlite2 tests, because sqlite2 was getting negative and changing values for ID field. See <URL>
rails_rails
train
rb,rb
5b00f8c362a479ecbadb03ddea4546851ea88f31
diff --git a/lib/ezimage/classes/ezimagemanager.php b/lib/ezimage/classes/ezimagemanager.php index <HASH>..<HASH> 100644 --- a/lib/ezimage/classes/ezimagemanager.php +++ b/lib/ezimage/classes/ezimagemanager.php @@ -785,8 +785,6 @@ class eZImageManager */ function createImageAlias( $aliasName, &$existingAliasList, $parameters = array() ) { - $fname = "createImageAlias( $aliasName )"; - // check for $aliasName validity $aliasList = $this->aliasList(); if ( !isset( $aliasList[$aliasName] ) )
Removed unneeded var definition as the var is not used anymore
ezsystems_ezpublish-legacy
train
php
8219e177633e3c3a77a50c2342b8fe6c4956914b
diff --git a/activerecord/test/cases/adapter_test.rb b/activerecord/test/cases/adapter_test.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/cases/adapter_test.rb +++ b/activerecord/test/cases/adapter_test.rb @@ -230,7 +230,7 @@ module ActiveRecord end assert_instance_of ActiveRecord::StatementInvalid, error - assert_instance_of syntax_error_exception_class, error.cause + assert_kind_of Exception, error.cause end def test_select_all_always_return_activerecord_result @@ -283,14 +283,6 @@ module ActiveRecord assert_not_nil error.message end end - - private - - def syntax_error_exception_class - return Mysql2::Error if defined?(Mysql2) - return PG::SyntaxError if defined?(PG) - return SQLite3::SQLException if defined?(SQLite3) - end end class AdapterForeignKeyTest < ActiveRecord::TestCase
Remove driver-specific hard-coding in the tests.
rails_rails
train
rb
50ebb8ab42b97bb40c1c57b00e12b8d4ba6ee720
diff --git a/test/once.js b/test/once.js index <HASH>..<HASH> 100644 --- a/test/once.js +++ b/test/once.js @@ -49,4 +49,35 @@ function once_api_delayed(done) { }) }, +{'timeout_coefficient':5}, +function many_waiters(done) { + var o = new Once + , waiters = 5000 + , delay = 200 + + var found = {}; + for(var a = 0; a < waiters; a++) + o.on_done(waiter(a)); + + o.on_done(function() { + setTimeout(function() { + for(var a = 0; a < waiters; a++) + assert.ok(found[a], 'Waiter number ' + a + ' fired') + done(); + }, 500) + }) + + o.job(function(callback) { + setTimeout(function() { callback('ok') }, delay); + }) + + function waiter(label) { + return function(result) { + assert.equal(result, 'ok', 'Got the correct result') + //console.error(label + ' hit'); + found[label] = true; + } + } +}, + ] // TESTS
Lots of waiters passes the test but prints an error
jhs_cqs
train
js
a709b54a2b2b35a81f35381b4e546dd20dfae301
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -171,7 +171,7 @@ else: 'numpy >= 1.11.3', 'numexpr >= 2.6.1', 'python-casacore >= 2.1.2', - "{} >= 1.1.0".format(tensorflow_package), + "{} >= 1.2.0".format(tensorflow_package), ] from install.tensorflow_ops_ext import (BuildCommand,
Upgrade to tensorflow <I> (#<I>)
ska-sa_montblanc
train
py
9a0826ad54e131bb88298caec21b2e319ebe122c
diff --git a/inject/src/main/java/io/micronaut/context/exceptions/ApplicationStoppingException.java b/inject/src/main/java/io/micronaut/context/exceptions/ApplicationStoppingException.java index <HASH>..<HASH> 100644 --- a/inject/src/main/java/io/micronaut/context/exceptions/ApplicationStoppingException.java +++ b/inject/src/main/java/io/micronaut/context/exceptions/ApplicationStoppingException.java @@ -16,20 +16,25 @@ package io.micronaut.context.exceptions; /** - * An exception that occurs loading the context. + * thrown if service is in the processing of shutting down * - * @author Graeme Rocher + * @author Ryan Vanderwerf * @since 1.0 */ public class ApplicationStoppingException extends RuntimeException { /** + * thrown if service is in the processing of shutting down + * * @param cause The throwable */ public ApplicationStoppingException(Throwable cause) { super("Application is not running or is shutting down.", cause); } + /** + * thrown if service is in the processing of shutting down + */ public ApplicationStoppingException() { super("Application is not running or is shutting down."); }
issue-<I> detecting app shutting down and throwing error
micronaut-projects_micronaut-core
train
java
48ca2bfccef49c4711027f6aecbb6b810baa797e
diff --git a/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview/RequestBuilder.php b/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview/RequestBuilder.php index <HASH>..<HASH> 100644 --- a/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview/RequestBuilder.php +++ b/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview/RequestBuilder.php @@ -130,7 +130,6 @@ class RequestBuilder $requestParams = [ 'name' => $containerConfig->getName(), 'indexName' => $containerConfig->getIndexName(), - 'type' => $containerConfig->getTypeName(), 'from' => 0, 'size' => $size, 'dimensions' => [],
Remove index type in Optimizer preview request.
Smile-SA_elasticsuite
train
php
2168c95ee411f1f622ffbba3723c5e4782590007
diff --git a/adminrestrict/tests.py b/adminrestrict/tests.py index <HASH>..<HASH> 100755 --- a/adminrestrict/tests.py +++ b/adminrestrict/tests.py @@ -23,13 +23,13 @@ class ModelTests(TestCase): def test_allowed_ip(self): a = AllowedIP.objects.create(ip_address="127.0.0.1") - resp = self.client.post("/admin/", data={'username':"foo", 'password':"bar"}) + resp = self.client.post("/admin/", data={'username':"foo", 'password':"bar"}, follow=True) self.assertEqual(resp.status_code, 200) a.delete() def test_allow_all(self): a = AllowedIP.objects.create(ip_address="*") - resp = self.client.post("/admin/", data={'username':"foo", 'password':"bar"}) + resp = self.client.post("/admin/", data={'username':"foo", 'password':"bar"}, follow=True) self.assertEqual(resp.status_code, 200) a.delete()
Fix for Django <I> so that <I> is followed to the end and test for <I> after following the redirect.
robromano_django-adminrestrict
train
py
455c2bb64b43f6b3afa3d8e9081dabfed55a69b5
diff --git a/lib/webcomment_webinterface.py b/lib/webcomment_webinterface.py index <HASH>..<HASH> 100644 --- a/lib/webcomment_webinterface.py +++ b/lib/webcomment_webinterface.py @@ -257,7 +257,7 @@ class WebInterfaceCommentsPages(WebInterfaceDirectory): return redirect_to_url(req, target) elif (auth_code_1 or auth_code_2): return page_not_authorized(req, "../", \ - text = auth_msg) + text = auth_msg_1 + auth_msg_2) can_attach_files = False (auth_code, auth_msg) = check_user_can_attach_file_to_comments(user_info, self.recid)
WebComment: fixed undefined variable cases
inveniosoftware-attic_invenio-comments
train
py
a88170512495a10bf94846648a77385b954795a7
diff --git a/lib/danger_plugin.rb b/lib/danger_plugin.rb index <HASH>..<HASH> 100755 --- a/lib/danger_plugin.rb +++ b/lib/danger_plugin.rb @@ -111,7 +111,7 @@ module Danger # Fail Danger on errors if fail_on_error && errors.count > 0 - raise 'Failed due to SwiftLint errors' + fail 'Failed due to SwiftLint errors' end end end
change `raise` to `fail`. Fixes #<I>
ashfurrow_danger-ruby-swiftlint
train
rb
103b0923a139c41f39fb288e3f1c5173916e0af9
diff --git a/Classes/Domain/Repository/SitemapRepository.php b/Classes/Domain/Repository/SitemapRepository.php index <HASH>..<HASH> 100644 --- a/Classes/Domain/Repository/SitemapRepository.php +++ b/Classes/Domain/Repository/SitemapRepository.php @@ -92,7 +92,7 @@ class SitemapRepository { if ($this->findAllEntries()) { $sitemap = GeneralUtility::makeInstance(Sitemap::class); - $sitemap->setEntries($this->entryStorage); + $sitemap->setUrlEntries($this->entryStorage); return $sitemap; } return null;
[BUGFIX] Resolve set url entries problem
beardcoder_sitemap_generator
train
php
109aeb7bc06831667020aba62997816b849a1434
diff --git a/core-bundle/contao/library/Contao/RequestToken.php b/core-bundle/contao/library/Contao/RequestToken.php index <HASH>..<HASH> 100644 --- a/core-bundle/contao/library/Contao/RequestToken.php +++ b/core-bundle/contao/library/Contao/RequestToken.php @@ -134,7 +134,7 @@ class RequestToken */ protected function __construct() { - static::setup(); + static::initialize(); }
[Core] Use `initialize()` method instead of missing `setup()` in `RequestToken` constructor method
contao_contao
train
php
20e5815c6373916e296b60a554c85a0c850b02bc
diff --git a/generators/server/prompts.js b/generators/server/prompts.js index <HASH>..<HASH> 100644 --- a/generators/server/prompts.js +++ b/generators/server/prompts.js @@ -150,7 +150,7 @@ function askForServerSideOpts() { }); */ opts.push({ value: 'neo4j', - name: 'Neo4j', + name: '[BETA] Neo4j', }); opts.push({ value: 'no',
Re-add Beta tag to Neo4j
jhipster_generator-jhipster
train
js
0dd77ca21564339a836af4dd274bb96a0fe159ea
diff --git a/marrow/mailer/message.py b/marrow/mailer/message.py index <HASH>..<HASH> 100644 --- a/marrow/mailer/message.py +++ b/marrow/mailer/message.py @@ -192,7 +192,7 @@ class Message(object): headers.extend(self.headers) if 'message-id' not in (header[0].lower() for header in headers): - headers.append('Message-Id', self.id) + headers.append(('Message-Id', self.id)) return headers
Need sleep. Work on #<I>.
marrow_mailer
train
py
69f4acd5ac2c339915a03792649659c825682ab1
diff --git a/builtin/providers/aws/resource_aws_route53_zone.go b/builtin/providers/aws/resource_aws_route53_zone.go index <HASH>..<HASH> 100644 --- a/builtin/providers/aws/resource_aws_route53_zone.go +++ b/builtin/providers/aws/resource_aws_route53_zone.go @@ -29,15 +29,15 @@ func resourceAwsRoute53Zone() *schema.Resource { ForceNew: true, }, - "vpc_id": &schema.Schema{ + "comment": &schema.Schema{ Type: schema.TypeString, Optional: true, - ForceNew: true, }, - "comment": &schema.Schema{ + "vpc_id": &schema.Schema{ Type: schema.TypeString, Optional: true, + ForceNew: true, }, "vpc_region": &schema.Schema{
Moved 'comment' DSL definition to be alphabetically sorted.
hashicorp_terraform
train
go
f7f2700c20260bd5a84d254f54bf330301d1e7b6
diff --git a/src/main/java/ar/com/fdvs/dj/core/DJJRDesignHelper.java b/src/main/java/ar/com/fdvs/dj/core/DJJRDesignHelper.java index <HASH>..<HASH> 100644 --- a/src/main/java/ar/com/fdvs/dj/core/DJJRDesignHelper.java +++ b/src/main/java/ar/com/fdvs/dj/core/DJJRDesignHelper.java @@ -99,7 +99,7 @@ public class DJJRDesignHelper { des.setProperty(name, (String) dr.getProperties().get(name)); } - des.setName(dr.getReportName() != null ? dr.getReportName() : "DynamicReport"); + des.setName(dr.getReportName() != null ? dr.getReportName() : "DJR"); return des; }
change the default report name to DJR
intive-FDV_DynamicJasper
train
java
983cfc244c7567ad6a59e366e55a8037e0497fe6
diff --git a/lib/XMLHttpRequest.js b/lib/XMLHttpRequest.js index <HASH>..<HASH> 100644 --- a/lib/XMLHttpRequest.js +++ b/lib/XMLHttpRequest.js @@ -477,7 +477,7 @@ exports.XMLHttpRequest = function() { + "fs.writeFileSync('" + contentFile + "', 'NODE-XMLHTTPREQUEST-ERROR:' + JSON.stringify(error), 'utf8');" + "fs.unlinkSync('" + syncFile + "');" + "});" - + (data ? "req.write('" + data.replace(/'/g, "\\'") + "');":"") + + (data ? "req.write('" + JSON.stringify(data).slice(1,-1).replace(/'/g, "\\'") + "');":"") + "req.end();"; // Start the other Node Process, executing this string var syncProc = spawn(process.argv[0], ["-e", execString]);
fix for backslashes in data not encoding correctly
driverdan_node-XMLHttpRequest
train
js
0f080683ef3bec469b7eb9cc4f43d70041427663
diff --git a/packages/ember-handlebars/lib/helpers/binding.js b/packages/ember-handlebars/lib/helpers/binding.js index <HASH>..<HASH> 100644 --- a/packages/ember-handlebars/lib/helpers/binding.js +++ b/packages/ember-handlebars/lib/helpers/binding.js @@ -184,7 +184,7 @@ EmberHandlebars.registerHelper('bind', function(property, options) { @private Use the `boundIf` helper to create a conditional that re-evaluates - whenever the bound value changes. + whenever the truthiness of the bound value changes. ``` handlebars {{#boundIf "content.shouldDisplayTitle"}} @@ -258,6 +258,8 @@ EmberHandlebars.registerHelper('with', function(context, options) { /** + See `boundIf` + @method if @for Ember.Handlebars.helpers @param {Function} context
Corrected docs on boundIf
emberjs_ember.js
train
js
afa9ed401b8549855666cc4ecee67f78c9f36773
diff --git a/src/Sylius/Bundle/CartBundle/EventListener/SessionCartSubscriber.php b/src/Sylius/Bundle/CartBundle/EventListener/SessionCartSubscriber.php index <HASH>..<HASH> 100644 --- a/src/Sylius/Bundle/CartBundle/EventListener/SessionCartSubscriber.php +++ b/src/Sylius/Bundle/CartBundle/EventListener/SessionCartSubscriber.php @@ -82,10 +82,6 @@ final class SessionCartSubscriber implements EventSubscriberInterface sprintf('%s.%s', $this->sessionKeyName, $cart->getChannel()->getCode()), $cart->getId() ); - $session->set( - sprintf('_order_%s_checkout_state', $cart->getIdentifier()), - $cart->getCheckoutState() - ); } }
[Cart] Remove unused checkout state from session
Sylius_Sylius
train
php
3ab6af29db4f181f12b260e0a77c4b24a83b8821
diff --git a/shinken/webui/plugins/problems/problems.py b/shinken/webui/plugins/problems/problems.py index <HASH>..<HASH> 100644 --- a/shinken/webui/plugins/problems/problems.py +++ b/shinken/webui/plugins/problems/problems.py @@ -84,6 +84,12 @@ def get_view(page): app.set_user_preference(user, 'bookmarks', '[]') bookmarks_r = '[]' bookmarks = json.loads(bookmarks_r) + bookmarks_ro = app.get_common_preference('bookmarks') + if not bookmarks_ro: + bookmarks_ro = '[]' + + bookmarksro = json.loads(bookmarks_ro) + bookmarks = json.loads(bookmarks_r) items = [] if page == 'problems': @@ -212,7 +218,7 @@ def get_view(page): ## for pb in pbs: ## print pb.get_name() print 'Give filters', filters - return {'app': app, 'pbs': items, 'user': user, 'navi': navi, 'search': search_str, 'page': page, 'filters': filters, 'bookmarks': bookmarks} + return {'app': app, 'pbs': items, 'user': user, 'navi': navi, 'search': search_str, 'page': page, 'filters': filters, 'bookmarks': bookmarks, 'bookmarksro': bookmarksro } # Our page
Call the function to get the common bookmarks and send them to the page.
Alignak-monitoring_alignak
train
py
dfd84c95150f5e917078f93cbb5e857868380ec0
diff --git a/Translate/Method/Detector.php b/Translate/Method/Detector.php index <HASH>..<HASH> 100644 --- a/Translate/Method/Detector.php +++ b/Translate/Method/Detector.php @@ -43,8 +43,8 @@ class Detector extends Method implements MethodInterface { public function detect($query) { $options = array( - 'key' => $this->apiKey, - 'q' => $query + 'key' => $this->apiKey, + 'q' => $query ); return $this->process($options); diff --git a/Translate/Method/Languages.php b/Translate/Method/Languages.php index <HASH>..<HASH> 100644 --- a/Translate/Method/Languages.php +++ b/Translate/Method/Languages.php @@ -58,7 +58,7 @@ class Languages extends Method implements MethodInterface { { $event = $this->startProfiling($this->getName(), 'get'); - $json = $this->getClient()->get($this->url, $options)->json(); + $json = $this->getClient()->get($this->url, array('query' => $options))->json(); $result = isset($json['data']['languages']) ? $json['data']['languages'] : array();
Fix #6 by fixing the Languages API method query call
eko_GoogleTranslateBundle
train
php,php
d85de2fd2cd8f3bbde08b7c8a72c16c8bc723a31
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -284,12 +284,17 @@ module.exports = function (grunt) { 'uglify', 'micro', 'clean:tmp']); + grunt.registerTask('default', ['dist', 'test', 'notify:js']); + grunt.registerTask('fast', ['dist', 'test-fast', 'notify:js']); + grunt.registerTask('serve', ['dist', 'connect:server']); grunt.registerTask('server', ['serve']); grunt.registerTask('test', ['jasmine', 'karma', 'notify:test']); + grunt.registerTask('test-fast', ['jasmine', 'notify:test']); + grunt.registerTask('docs', ['clean:docs', 'jsdoc:docstrap', 'connect:docs']); grunt.registerTask('coverage', ['coveralls']);
added grunt task "fast" for faster local development
vissense_vissense
train
js
cbe8e6dd95be1c50b5c97b55812c457f30b72141
diff --git a/actions/class.CommonModule.php b/actions/class.CommonModule.php index <HASH>..<HASH> 100644 --- a/actions/class.CommonModule.php +++ b/actions/class.CommonModule.php @@ -106,9 +106,9 @@ abstract class tao_actions_CommonModule extends LegacyController implements Serv return AclProxy::hasAccess($user, $controllerClass, $action, $parameters); } - protected function hasWriteAccessToAction(string $action, ?User $user = null): bool + protected function hasWriteAccessToAction(string $action, ?string $controller = null, ?User $user = null): bool { - return $this->getActionAccessControl()->hasWriteAccess(static::class, $action, $user); + return $this->getActionAccessControl()->hasWriteAccess($controller ?? static::class, $action, $user); } protected function getUserRoles(): array
refactor: allow to provide controller to check write permissions to action
oat-sa_tao-core
train
php
ec63c213f8222c3c52e45f18773dd1f71f8bf2d8
diff --git a/src/Composer/Command/ConfigCommand.php b/src/Composer/Command/ConfigCommand.php index <HASH>..<HASH> 100644 --- a/src/Composer/Command/ConfigCommand.php +++ b/src/Composer/Command/ConfigCommand.php @@ -576,6 +576,9 @@ EOT return $this->configSource->addConfigSetting($settingKey, $values[0]); } + if ($settingKey === 'platform' && $input->getOption('unset')) { + return $this->configSource->removeConfigSetting($settingKey); + } // handle auth if (preg_match('/^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|http-basic)\.(.+)/', $settingKey, $matches)) {
Allow unsetting the whole platform config key
composer_composer
train
php
fecfa84c4e9825d106c882ca21206a61b2caada1
diff --git a/tests/PhpFpmTest.php b/tests/PhpFpmTest.php index <HASH>..<HASH> 100644 --- a/tests/PhpFpmTest.php +++ b/tests/PhpFpmTest.php @@ -29,7 +29,7 @@ class PhpFpmTest extends PHPUnit_Framework_TestCase $contents = file_get_contents(__DIR__.'/output/fpm.conf'); $this->assertContains(sprintf("\nuser = %s", user()), $contents); $this->assertContains("\ngroup = staff", $contents); - $this->assertContains("\nlisten = /Users/".user()."/.valet/valet.sock", $contents); + $this->assertContains("\nlisten = ".VALET_HOME_PATH."/valet.sock", $contents); } }
Fix test to run under Linux CI
laravel_valet
train
php
8cddd5f23330211dd52b182ed3d407f71e74a89a
diff --git a/src/Api/HttpApi.php b/src/Api/HttpApi.php index <HASH>..<HASH> 100644 --- a/src/Api/HttpApi.php +++ b/src/Api/HttpApi.php @@ -127,9 +127,10 @@ abstract class HttpApi */ protected function handleErrors(ResponseInterface $response) { + $body = $response->getBody()->__toString(); switch ($response->getStatusCode()) { case 400: - throw new DomainExceptions\BadRequestException(); + throw new DomainExceptions\BadRequestException($body); break; case 403:
Added body to <I> errors
FriendsOfApi_fortnox
train
php
e91e24c69118505999e6f7e9e051b03c85f634b4
diff --git a/src/Writer.php b/src/Writer.php index <HASH>..<HASH> 100644 --- a/src/Writer.php +++ b/src/Writer.php @@ -17,7 +17,7 @@ final class Writer { private ?string $root; private bool $relativeAutoloadRoot = true; private ?string $failureHandler; - private ?bool $isDev; + private bool $isDev = true; public function setIsDev(bool $is_dev): this { $this->isDev = $is_dev;
Default is_dev to true When upgrading, composer uses a mix of old and new
hhvm_hhvm-autoload
train
php
5a42b7d6a155bfff1201f2be63d7dfcc6a1daba8
diff --git a/screengrab/screengrab-lib/src/main/java/tools.fastlane.screengrab/Screengrab.java b/screengrab/screengrab-lib/src/main/java/tools.fastlane.screengrab/Screengrab.java index <HASH>..<HASH> 100644 --- a/screengrab/screengrab-lib/src/main/java/tools.fastlane.screengrab/Screengrab.java +++ b/screengrab/screengrab-lib/src/main/java/tools.fastlane.screengrab/Screengrab.java @@ -17,7 +17,7 @@ */ // This file contains significant modifications from the original work -// Modifications Copyright 2015, Twitter Inc +// Modifications Copyright 2017, Google package tools.fastlane.screengrab;
Upgrade copyright (#<I>)
fastlane_fastlane
train
java
86bee04e0f7ac39dae3ab8a415acabe101cacaaf
diff --git a/service_broker/gorm_db_wrappper.go b/service_broker/gorm_db_wrappper.go index <HASH>..<HASH> 100644 --- a/service_broker/gorm_db_wrappper.go +++ b/service_broker/gorm_db_wrappper.go @@ -1,6 +1,12 @@ package chaospeddler +import "database/sql" + //Where - wraps where to return the interface type func (s *GormDBWrapper) Where(query interface{}, args ...interface{}) GormDB { return s.Where(query, args...) } + +func (s *GormDBWrapper) DB() *sql.DB { + return s.DBWrapper.DB.DB() +} diff --git a/service_broker/types.go b/service_broker/types.go index <HASH>..<HASH> 100644 --- a/service_broker/types.go +++ b/service_broker/types.go @@ -63,7 +63,11 @@ type ServiceBinding struct { //GormDBWrapper - wraps a gorm db so we can implement a cleaner interface type GormDBWrapper struct { - gorm.DB + DBWrapper +} + +type DBWrapper struct { + *gorm.DB } //BindingProvisioner - interface defining a object which can provision and
cleaning up wrapper types for gorm
xchapter7x_chaospeddler
train
go,go
1f5595dd48b0348aed4ccb119695b420ced878d1
diff --git a/packages/dai/test/eth/TransactionManager.spec.js b/packages/dai/test/eth/TransactionManager.spec.js index <HASH>..<HASH> 100644 --- a/packages/dai/test/eth/TransactionManager.spec.js +++ b/packages/dai/test/eth/TransactionManager.spec.js @@ -111,21 +111,7 @@ describe('lifecycle hooks', () => { }); beforeAll(async () => { - // This test will fail if unlimited approval for WETH and PETH is already set - // for the current account. so we pick an account near the end of all the test - // accounts to make it unlikely that some other test in the suite will use it. - TestAccountProvider.setIndex(900); - - service = buildTestEthereumCdpService({ - accounts: { - default: { - type: 'privateKey', - privateKey: TestAccountProvider.nextAccount().key - } - }, - log: true - }); - + service = buildTestEthereumCdpService(); await service.manager().authenticate(); txMgr = service.get('smartContract').get('transactionManager'); priceService = service.get('price');
fix TransactionManager spec remove some code that was supposed to do something, but actually wasn't doing anything, but the test was passing anyway, until i changed the test helpers, so the code started doing what it was supposed to, causing the test to fail 😅
makerdao_dai.js
train
js
4dd55ba5dd5560c42968cf2210ce9aa956e3840d
diff --git a/can-view-scope.js b/can-view-scope.js index <HASH>..<HASH> 100644 --- a/can-view-scope.js +++ b/can-view-scope.js @@ -183,6 +183,16 @@ assign(Scope.prototype, { return this._read(keyReads, options, currentScopeOnly); }, + + // ## Scope.prototype.getFromSpecialContext + getFromSpecialContext: function(key) { + var res = this._read( + [{key: key, at: false }], + { special: true } + ); + return res.value; + }, + // ## Scope.prototype._read // _read: function(keyReads, options, currentScopeOnly) { @@ -586,18 +596,13 @@ var specialKeywords = [ 'event', 'viewModel','arguments' ]; -var readFromSpecialContexts = function(key) { - return function() { - return this._read( - [{ key: key, at: false }], - { special: true } - ).value; - }; -}; - +// create getters for "special" keys +// scope.index -> scope.getFromSpecialContext("index") specialKeywords.forEach(function(key) { Object.defineProperty(Scope.prototype, key, { - get: readFromSpecialContexts(key) + get: function() { + return this.getFromSpecialContext(key); + } }); });
making formal API for getFromSpecialContext
canjs_can-view-scope
train
js
f298bdab3480902b0416834af722543092eb7f94
diff --git a/lib/cfml/project.rb b/lib/cfml/project.rb index <HASH>..<HASH> 100644 --- a/lib/cfml/project.rb +++ b/lib/cfml/project.rb @@ -1,3 +1,5 @@ +require 'yaml' + module Cfml class Project def initialize(project_root)
Added require Failing to run because we didn't require 'yaml'
drrb_cfoo
train
rb
80e64cb395ffd559cfecb204ee0c286913b6d3f9
diff --git a/db/keyval/redis/plugin_impl_redis.go b/db/keyval/redis/plugin_impl_redis.go index <HASH>..<HASH> 100644 --- a/db/keyval/redis/plugin_impl_redis.go +++ b/db/keyval/redis/plugin_impl_redis.go @@ -55,23 +55,13 @@ func (p *Plugin) Init() error { return err } - if p.Skeleton == nil { - con, err := NewBytesConnection(client, p.Log) - if err != nil { - return err - } - - p.Skeleton = plugin.NewSkeleton(p.String(), - p.ServiceLabel, - con, - ) - } - err = p.Skeleton.Init() + connection, err := NewBytesConnection(client, p.Log) if err != nil { return err } - return nil + p.Skeleton = plugin.NewSkeleton(p.String(), p.ServiceLabel, connection) + return p.Skeleton.Init() } // AfterInit is called by the Agent Core after all plugins have been initialized.
SPOPT-<I>, <I> - health status for cassandra and redis
ligato_cn-infra
train
go
21287b6e015b536ccb4ca9bf06605613eda0dc4e
diff --git a/Tests/YandexTest.php b/Tests/YandexTest.php index <HASH>..<HASH> 100644 --- a/Tests/YandexTest.php +++ b/Tests/YandexTest.php @@ -18,7 +18,6 @@ use Geocoder\Location; use Geocoder\Provider\Yandex\Model\YandexAddress; use Geocoder\Query\GeocodeQuery; use Geocoder\Query\ReverseQuery; -use Geocoder\Tests\TestCase; use Geocoder\Provider\Yandex\Yandex; /**
Apply fixes from StyleCI (#<I>)
geocoder-php_yandex-provider
train
php
be885fc5c4e768cef993f6bbd2484ad437fee5ea
diff --git a/src/Foundation/TenantAwareApplication.php b/src/Foundation/TenantAwareApplication.php index <HASH>..<HASH> 100644 --- a/src/Foundation/TenantAwareApplication.php +++ b/src/Foundation/TenantAwareApplication.php @@ -84,14 +84,4 @@ class TenantAwareApplication extends Application { return $this->basePath() . '/bootstrap/cache/' . $this->getTenantCacheName('compiled') . '.php'; } - - /** - * Get the path to the cached services.json file. - * - * @return string - */ - public function getCachedServicesPath() - { - return $this->basePath() . '/bootstrap/cache/' . $this->getTenantCacheName('services') . '.json'; - } } \ No newline at end of file
Fix - dont override cached services path
dave-redfern_laravel-doctrine-tenancy
train
php
73ef0ff94a9ef464bf9fa7de403e0a3617f7be8b
diff --git a/lib/models/user.js b/lib/models/user.js index <HASH>..<HASH> 100644 --- a/lib/models/user.js +++ b/lib/models/user.js @@ -125,7 +125,7 @@ UserSchema.static('registerWithInvite', function(inviteCode, email, password, cb var user = new User() user.email = email user.set('password', password) - user.projects = {} + user.projects = [] // For each collaboration in the invite, add permissions to the repo_config if (invite.collaborations !== undefined && invite.collaborations.length > 0) { _.each(invite.collaborations, function(item) {
set initial projects to empty array, not empty object
Strider-CD_strider
train
js
04ff58c079d9f6b6cb61593c9a5bac8570541ea8
diff --git a/lib/cxxproject/buildingblocks/has_sources_mixin.rb b/lib/cxxproject/buildingblocks/has_sources_mixin.rb index <HASH>..<HASH> 100644 --- a/lib/cxxproject/buildingblocks/has_sources_mixin.rb +++ b/lib/cxxproject/buildingblocks/has_sources_mixin.rb @@ -242,6 +242,7 @@ module Cxxproject dirs_with_files = calc_dirs_with_files(sources_to_build) obj_tasks = [] + @objects = [] dirs_with_files.each do |dir, files| files.reverse.each do |f| obj_task = create_object_file_task(f, sources_to_build[f])
It must reset the @objects before recalculating the linking commands again
marcmo_cxxproject
train
rb
bb6d84c3a56560871dab26aa1731fb59fb83107a
diff --git a/ember-cli-build.js b/ember-cli-build.js index <HASH>..<HASH> 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -88,6 +88,10 @@ module.exports = function (defaults) { 'ember-cli-barcode': { include: 'code128' }, + autoImport: { + // `pouchdb` is shimmed with some extra required plugins by `ember-pouch` + exclude: ['pouchdb'] + }, trees: { vendor: new MergeTrees([ vendorTree,
Add pouchdb to ember-auto-import excludes This ensures that the PouchDB module used is the one shimmed by ember-pouch which includes additional required pouchdb plugins.
HospitalRun_hospitalrun-frontend
train
js
610aebab5964968f1dc38efc9fb8519e3e381faa
diff --git a/remoto/lib/execnet/gateway_base.py b/remoto/lib/execnet/gateway_base.py index <HASH>..<HASH> 100644 --- a/remoto/lib/execnet/gateway_base.py +++ b/remoto/lib/execnet/gateway_base.py @@ -242,14 +242,17 @@ class WorkerPool(object): reply = Reply((func, args, kwargs), self.execmodel) def run_and_release(): reply.run() - with self._running_lock: - self._running.remove(reply) - self._sem.release() - if not self._running: - try: - self._waitall_event.set() - except AttributeError: - pass + try: + with self._running_lock: + self._running.remove(reply) + self._sem.release() + if not self._running: + try: + self._waitall_event.set() + except AttributeError: + pass + except TypeError: + pass self._sem.acquire() with self._running_lock: self._running.add(reply)
[execnet] eat typeerror when closing the connection
alfredodeza_remoto
train
py
e975ffa6d434fb756b506e95632756eff5b553e6
diff --git a/Services/Twilio/Resource.php b/Services/Twilio/Resource.php index <HASH>..<HASH> 100644 --- a/Services/Twilio/Resource.php +++ b/Services/Twilio/Resource.php @@ -71,9 +71,12 @@ abstract class Services_Twilio_Resource { public static function decamelize($word) { - return preg_replace( + $callback = create_function('$matches', + 'return strtolower(strlen("$matches[1]") ? "$matches[1]_$matches[2]" : "$matches[2]");'); + + return preg_replace_callback( '/(^|[a-z])([A-Z])/e', - 'strtolower(strlen("\\1") ? "\\1_\\2" : "\\2")', + $callback, $word ); } @@ -87,7 +90,11 @@ abstract class Services_Twilio_Resource { * @return string */ public static function camelize($word) { - return preg_replace('/(^|_)([a-z])/e', 'strtoupper("\\2")', $word); + $callback = create_function('$matches', 'return strtoupper("$matches[2]");'); + + return preg_replace_callback('/(^|_)([a-z])/', + $callback, + $word); } /**
removed preg_replace with /e modifier switched from using preg_replace with /e as it's deprecated in <I> and not supported in some environments; while an anonymous function would work, by using create_function we can stay <I> compatible
twilio_twilio-php
train
php
4bb740801467898e819e4d3ea74b81631f3d0888
diff --git a/pan/panc/src/main/java/org/quattor/pan/dml/operators/SetValue.java b/pan/panc/src/main/java/org/quattor/pan/dml/operators/SetValue.java index <HASH>..<HASH> 100644 --- a/pan/panc/src/main/java/org/quattor/pan/dml/operators/SetValue.java +++ b/pan/panc/src/main/java/org/quattor/pan/dml/operators/SetValue.java @@ -51,7 +51,7 @@ public class SetValue extends AbstractOperation { * Note, a couple of values can be set, like ARGV and ARGC. SELF is handled * separately because the rules are more complicated. */ - private static final String[] automaticVariables = new String[] { "object", + private static final String[] automaticVariables = new String[] { "OBJECT", "FUNCTION", "TEMPLATE" }; protected String identifier;
remove support for lowercase automatic variables from code as well as grammar
quattor_pan
train
java
fbbee93e87ca44192d03286336c3dad552d888a0
diff --git a/tests/Support/ApplicationFactory.php b/tests/Support/ApplicationFactory.php index <HASH>..<HASH> 100644 --- a/tests/Support/ApplicationFactory.php +++ b/tests/Support/ApplicationFactory.php @@ -104,14 +104,14 @@ class ApplicationFactory { $app = new \Illuminate\Foundation\Application(self::APP_PATH); + $app->config = new ConfigRepository(); + $app->register(new BroadcastServiceProvider($app)); $app->register(new CacheServiceProvider($app)); $app->register(new QueueServiceProvider($app)); $app->register(new SessionServiceProvider($app)); $app->register(new RedisServiceProvider($app)); - $app->config = new ConfigRepository(); - Facade::setFacadeApplication($app); return $app;
Fix ApplicationFactory for tests in Laravel <I> and <I>
monospice_laravel-redis-sentinel-drivers
train
php
d9810206cb4d56825ed4de98b6ae636461d59bbd
diff --git a/sos/plugins/openstack_nova.py b/sos/plugins/openstack_nova.py index <HASH>..<HASH> 100644 --- a/sos/plugins/openstack_nova.py +++ b/sos/plugins/openstack_nova.py @@ -246,5 +246,15 @@ class RedHatNova(OpenStackNova, RedHatPlugin): "/etc/security/limits.d/91-nova.conf", "/etc/sysconfig/openstack-nova-novncproxy" ]) + if self.get_option("all_logs"): + self.add_copy_spec([ + "/var/log/httpd/nova_api*", + "/var/log/httpd/placement*", + ]) + else: + self.add_copy_spec([ + "/var/log/httpd/nova_api*.log", + "/var/log/httpd/placement*.log", + ]) # vim: set et ts=4 sw=4 :
[openstack-nova] Add missing placement api wsgi logs Resolves: #<I>
sosreport_sos
train
py
80e32594e25d1bb1d1918aa26f79af718b307ea5
diff --git a/extensions/tags/js/src/forum/addTagFilter.js b/extensions/tags/js/src/forum/addTagFilter.js index <HASH>..<HASH> 100644 --- a/extensions/tags/js/src/forum/addTagFilter.js +++ b/extensions/tags/js/src/forum/addTagFilter.js @@ -35,16 +35,21 @@ export default function() { }); // If currently viewing a tag, restyle the 'new discussion' button to use - // the tag's color. + // the tag's color, and disable if the user isn't allowed to edit. extend(IndexPage.prototype, 'sidebarItems', function(items) { const tag = this.currentTag(); if (tag) { const color = tag.color(); + const canStartDiscussion = tag.canStartDiscussion(); if (color) { items.get('newDiscussion').props.style = {backgroundColor: color}; } + + items.get('newDiscussion').props.disabled = !canStartDiscussion; + items.get('newDiscussion').props.children = app.translator.trans(canStartDiscussion ? 'core.forum.index.start_discussion_button' : 'core.forum.index.cannot_start_discussion_button'); + } });
Disable "Start Discussion" button for restricted tags (#<I>) Also, change the label when the button is disabled.
flarum_core
train
js
a680d3f2065867e1c35d39938a125bbe2fa658c4
diff --git a/lib/watchbuild/runner.rb b/lib/watchbuild/runner.rb index <HASH>..<HASH> 100644 --- a/lib/watchbuild/runner.rb +++ b/lib/watchbuild/runner.rb @@ -48,8 +48,10 @@ module WatchBuild execute: "open '#{url}'") Helper.log.info "Successfully finished processing the build".green - Helper.log.info "You can now tweet: " - Helper.log.info "iTunes Connect #iosprocessingtime #{minutes} minutes".yellow + if minutes > 0 # it's 0 minutes if there was no new build uploaded + Helper.log.info "You can now tweet: " + Helper.log.info "iTunes Connect #iosprocessingtime #{minutes} minutes".yellow + end Helper.log.info url end
Improved handling when there is no build processing
fastlane_fastlane
train
rb
2719df9289bbb79737904805026a612b9853de77
diff --git a/asks/request_object.py b/asks/request_object.py index <HASH>..<HASH> 100644 --- a/asks/request_object.py +++ b/asks/request_object.py @@ -240,12 +240,12 @@ class RequestProcessor: self.scheme == self.initial_scheme and self.host == self.initial_netloc ): self.sock._active = False + await self.sock.close() if self.streaming: return None, response_obj - if 'connection' in asks_headers and asks_headers['connection'] == 'close' and self.sock._active: - self.sock._active = False + if asks_headers.get('connection', '') == 'close' and self.sock._active: await self.sock.close() return None, response_obj
implemented rnovatorov's review suggestions
theelous3_asks
train
py
7f6cabe0df29755114d0aa7ff025a2ab79755fea
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -65,11 +65,12 @@ setup_requires = [ install_requires = [ 'blinker>=1.4', 'flask-celeryext>=0.2.2', - 'Flask>=1.0', + 'flask>=0.11.1', 'jsonpatch>=1.15', 'jsonresolver>=0.1.0', 'jsonref>=0.1', 'jsonschema>=2.5.1', + 'werkzeug>=0.14.1', ] packages = find_packages()
installation: relax Flask version to <I> * Specifies "werkzeug><I>" in "install_required" in order for "requirements-builder" to install the correct version. (closes #<I>)
inveniosoftware_invenio-records
train
py
9ac08bcdaa0d330c125c975b35ef8a04947d7321
diff --git a/landsat/__init__.py b/landsat/__init__.py index <HASH>..<HASH> 100644 --- a/landsat/__init__.py +++ b/landsat/__init__.py @@ -4,4 +4,4 @@ import sys if not settings.DEBUG: sys.tracebacklimit = 0 -__version__ = '0.5.5' +__version__ = '0.6.0'
bump up version to <I>
developmentseed_landsat-util
train
py
5c6699942e128767c6ed463d68cbedc8108d3af8
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -43,7 +43,7 @@ function getRoot(node) { } function isShadowRoot(node) { - return typeof ShadowRoot === 'function' && node instanceof ShadowRoot; + return node.nodeName === '#document-fragment' && node.constructor.name === 'ShadowRoot'; }
fix: Make shadow root detection work cross-realmn
foobarhq_get-root-node-polyfill
train
js