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
0fc0967462da0f020a7675a79818df0a65bf6b42
diff --git a/internal/service/autoscaling/group.go b/internal/service/autoscaling/group.go index <HASH>..<HASH> 100644 --- a/internal/service/autoscaling/group.go +++ b/internal/service/autoscaling/group.go @@ -1,6 +1,6 @@ package autoscaling -import ( // nosemgrep: aws-sdk-go-multiple-service-imports +import ( "bytes" "context" "fmt" diff --git a/internal/service/autoscaling/group_waiting.go b/internal/service/autoscaling/group_waiting.go index <HASH>..<HASH> 100644 --- a/internal/service/autoscaling/group_waiting.go +++ b/internal/service/autoscaling/group_waiting.go @@ -1,6 +1,6 @@ package autoscaling -import ( +import ( // nosemgrep: aws-sdk-go-multiple-service-imports "fmt" "log" "strconv"
Fix semgrep 'aws-sdk-go-multiple-service-imports' errors.
terraform-providers_terraform-provider-aws
train
go,go
98269d681752b9e03d72a94c01d5a9fcd7f39b65
diff --git a/controller/Results.php b/controller/Results.php index <HASH>..<HASH> 100644 --- a/controller/Results.php +++ b/controller/Results.php @@ -357,9 +357,9 @@ class Results extends \tao_actions_CommonModule // quick hack to gain performance: caching the entire result page if it is cacheable // "gzencode" is used to reduce the size of the string to be cached ob_start(function($buffer) use($resultId, $cacheKey) { - if ($this->isCacheable($resultId)) { + if ($this->isCacheable($resultId) + && $this->getResultsService()->setCacheValue($resultId, $cacheKey, gzencode($buffer, 9))) { \common_Logger::d('Result page cache set for "'. $cacheKey .'"'); - $this->getResultsService()->setCacheValue($resultId, $cacheKey, gzencode($buffer, 9)); } return $buffer;
TAO-<I> Check if cache has been created before log message filed
oat-sa_extension-tao-outcomeui
train
php
66bc1e9501c7ca5daac6e899a53e3d14b726b760
diff --git a/mozilla/gcli/ui/tooltip.js b/mozilla/gcli/ui/tooltip.js index <HASH>..<HASH> 100644 --- a/mozilla/gcli/ui/tooltip.js +++ b/mozilla/gcli/ui/tooltip.js @@ -21,7 +21,7 @@ var domtemplate = require('../util/domtemplate'); var host = require('../util/host'); var CommandAssignment = require('../cli').CommandAssignment; -var fields = require('../fields/fields''); +var fields = require('../fields/fields'); var tooltipCssPromise = host.staticRequire(module, './tooltip.css'); var tooltipHtmlPromise = host.staticRequire(module, './tooltip.html');
refactor-<I>: Fix nasty typo Some automatic search and replace left us with an extra '
joewalker_gcli
train
js
1277bd2ba53c1a4736fd1e980368a09553ccffce
diff --git a/src/render.js b/src/render.js index <HASH>..<HASH> 100644 --- a/src/render.js +++ b/src/render.js @@ -324,5 +324,12 @@ function _render(callback) { graphvizInstance._dispatch.call('renderEnd', graphvizInstance); + if (transitionInstance == null) { + this._dispatch.call('end', this); + if (callback) { + callback.call(this); + } + } + return this; };
Fire callback and end event even when transition is not used Fixes <URL>
magjac_d3-graphviz
train
js
73b9fd166cb2d876235b291d157a78df1484a754
diff --git a/tests/_processors/test_when.py b/tests/_processors/test_when.py index <HASH>..<HASH> 100644 --- a/tests/_processors/test_when.py +++ b/tests/_processors/test_when.py @@ -156,7 +156,7 @@ def test_item_many_eggs(testapp): [r"item.author == 'yoda'", "item.source.suffix == '.md'"], id="two-conditions", ), - pytest.param([r"item.source | match('.*\.md')"], id="match-md"), + pytest.param([r"item.source | match('.*\\.md')"], id="match-md"), pytest.param([r"item.source | match('^about.*')"], id="match-about"), ], ) @@ -202,7 +202,7 @@ def test_args_condition(testapp, cond): [r"item.author == 'yoda'", "item.source.suffix == '.md'"], id="two-conditions", ), - pytest.param([r"item.source | match('.*\.md')"], id="match-md"), + pytest.param([r"item.source | match('.*\\.md')"], id="match-md"), pytest.param([r"item.source | match('^about.*')"], id="match-about"), ], )
Fix deprecation warnings in tests
ikalnytskyi_holocron
train
py
8ab9188bdb1f2755db255404b2fd8a86ac4e092d
diff --git a/lib/polyfill/fullscreen.js b/lib/polyfill/fullscreen.js index <HASH>..<HASH> 100644 --- a/lib/polyfill/fullscreen.js +++ b/lib/polyfill/fullscreen.js @@ -59,6 +59,13 @@ shaka.polyfill.Fullscreen.install = function() { document.webkitFullscreenElement; } }); + Object.defineProperty(document, 'fullscreenEnabled', { + get: function() { + return document.mozFullScreenEnabled || + document.msFullscreenEnabled || + document.webkitFullscreenEnabled; + } + }); } var proxy = shaka.polyfill.Fullscreen.proxyEvent_;
Expanded the fullscreen polyfill. Now it includes fullscreenEnabled. Closes #<I> Change-Id: I7df3c<I>ecc<I>a<I>ba<I>ac<I>aae2bc9b<I>d5
google_shaka-player
train
js
e5d87757f58746625088bf0b59477e0129da2d23
diff --git a/bean-validation/src/test/java/com/kumuluz/ee/beanvalidation/test/HibernateValidatorTest.java b/bean-validation/src/test/java/com/kumuluz/ee/beanvalidation/test/HibernateValidatorTest.java index <HASH>..<HASH> 100644 --- a/bean-validation/src/test/java/com/kumuluz/ee/beanvalidation/test/HibernateValidatorTest.java +++ b/bean-validation/src/test/java/com/kumuluz/ee/beanvalidation/test/HibernateValidatorTest.java @@ -52,6 +52,7 @@ public class HibernateValidatorTest { Set<ConstraintViolation<User>> constraintViolations = validator.validate(u1); + Assert.assertNotNull(constraintViolations); Assert.assertEquals(0, constraintViolations.size()); } @@ -77,6 +78,7 @@ public class HibernateValidatorTest { Set<ConstraintViolation<User>> constraintViolations = validator.validate(u1); + Assert.assertNotNull(constraintViolations); Assert.assertEquals(3, constraintViolations.size()); } }
Added additional tests to bean-validation
kumuluz_kumuluzee
train
java
41f2af20c152d563e60c0af504a64df7b33b38e3
diff --git a/lib/lockup.rb b/lib/lockup.rb index <HASH>..<HASH> 100644 --- a/lib/lockup.rb +++ b/lib/lockup.rb @@ -9,10 +9,10 @@ module Lockup if cookies[:lockup] == ENV["LOCKUP_CODEWORD"].to_s.downcase return else - redirect_to :controller => 'lockup', :action => 'unlock', :return_to => request.fullpath.split('?lockup_codeword')[0], :lockup_codeword => params[:lockup_codeword] + redirect_to :controller => '/lockup', :action => 'unlock', :return_to => request.fullpath.split('?lockup_codeword')[0], :lockup_codeword => params[:lockup_codeword] end else - redirect_to :controller => 'lockup', :action => 'unlock', :return_to => request.fullpath.split('?lockup_codeword')[0], :lockup_codeword => params[:lockup_codeword] + redirect_to :controller => '/lockup', :action => 'unlock', :return_to => request.fullpath.split('?lockup_codeword')[0], :lockup_codeword => params[:lockup_codeword] end end end
routing - force lockup at root
gblakeman_lockup
train
rb
09ebe90c403574d9383619743670e1eaae273fe6
diff --git a/examples/tprattribute/sleeper_event_handler.go b/examples/tprattribute/sleeper_event_handler.go index <HASH>..<HASH> 100644 --- a/examples/tprattribute/sleeper_event_handler.go +++ b/examples/tprattribute/sleeper_event_handler.go @@ -49,6 +49,7 @@ func (h *SleeperEventHandler) handle(obj interface{}) { Into(in) if err != nil { log.Printf("[Sleeper] Status update for %s/%s failed: %v", in.Namespace, in.Name, err) + return } go func() { select {
Do not start sleeping if failed to update status
atlassian_smith
train
go
56151a3abd5fb0eb2da33d84dbc2ad0cea42d95f
diff --git a/_example/main.go b/_example/main.go index <HASH>..<HASH> 100644 --- a/_example/main.go +++ b/_example/main.go @@ -1,5 +1,6 @@ // Example application that uses all of the available API options. package main + import ( "log" "time" diff --git a/spinner.go b/spinner.go index <HASH>..<HASH> 100644 --- a/spinner.go +++ b/spinner.go @@ -14,6 +14,7 @@ package spinner import ( + "encoding/hex" "errors" "fmt" "io" @@ -21,7 +22,6 @@ import ( "sync" "time" "unicode/utf8" - "encoding/hex" "github.com/fatih/color" ) @@ -299,7 +299,12 @@ func (s *Spinner) UpdateCharSet(cs []string) { func (s *Spinner) erase() { n := utf8.RuneCountInString(s.lastOutput) del, _ := hex.DecodeString("7f") - for _, c := range []string{"\b", string(del), "\b"} { + for _, c := range []string{ + "\b", + string(del), + "\b", + "\033[K", // for macOS Terminal + } { for i := 0; i < n; i++ { fmt.Fprintf(s.Writer, c) }
properly remove previous line for macOS Terminal
briandowns_spinner
train
go,go
bdec8b942c1c35c67d34f84a99b6c05d250fcd2f
diff --git a/src/ConfigCommand/CreateConfigEvent.php b/src/ConfigCommand/CreateConfigEvent.php index <HASH>..<HASH> 100644 --- a/src/ConfigCommand/CreateConfigEvent.php +++ b/src/ConfigCommand/CreateConfigEvent.php @@ -19,6 +19,8 @@ class CreateConfigEvent implements IOInterface, StoppableEventInterface { + use IOTrait; + /** @var null|string */ private $customChangelog;
fixup: compose IOTrait into CreateConfigEvent
phly_keep-a-changelog
train
php
f32a865abd5c99d26cbe9ac531d5da8acf776180
diff --git a/lib/vagrant/util/platform.rb b/lib/vagrant/util/platform.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant/util/platform.rb +++ b/lib/vagrant/util/platform.rb @@ -1,4 +1,5 @@ require 'rbconfig' +require 'shellwords' require 'tmpdir' require "vagrant/util/subprocess" @@ -67,7 +68,7 @@ module Vagrant "bash", "--noprofile", "--norc", - "-c", "cd #{path} && pwd") + "-c", "cd #{Shellwords.escape(path)} && pwd") return process.stdout.chomp end end
Properly escape path in cygwin bash check Quick attempt at properly fixing #<I>
hashicorp_vagrant
train
rb
55bea6fd0a2b3ea8baaa2a3d2ff220d111f3bc00
diff --git a/gcs/bucket.go b/gcs/bucket.go index <HASH>..<HASH> 100644 --- a/gcs/bucket.go +++ b/gcs/bucket.go @@ -97,7 +97,32 @@ func toRawAcls(in []storage.ACLRule) []*storagev1.ObjectAccessControl { return out } -func fromRawObject(*storagev1.Object) *storage.Object +func fromRawAcls(in []*storagev1.ObjectAccessControl) []storage.ACLRule + +func fromRawObject(bucketName string, in *storagev1.Object) *storage.Object { + out := &storage.Object{ + Bucket: bucketName, + Name: in.Name, + ContentType: in.ContentType, + ContentLanguage: in.ContentLanguage, + CacheControl: in.CacheControl, + ACL: fromRawAcls(in.Acl), + Owner: in.Owner, + ContentEncoding: in.ContentEncoding, + Size: in.Size, + MD5: in.MD5, + CRC32C: in.CRC32C, + MediaLink: in.MediaLink, + Metadata: in.Metadata, + Generation: in.Generation, + MetaGeneration: in.MetaGeneration, + StorageClass: in.StorageClass, + Deleted: in.TimeDeleted, + Updated: in.Updated, + } + + return out +} func getRawService(authContext context.Context) *storagev1.Service @@ -139,7 +164,7 @@ func (b *bucket) CreateObject( } // Convert the returned object. - o = fromRawObject(rawObject) + o = fromRawObject(b.Name(), rawObject) return }
Partially implemented fromRawObject.
jacobsa_gcloud
train
go
8ab0aacf5f37da231403606c6389150286c7c7eb
diff --git a/docs/src/ComponentsPage.js b/docs/src/ComponentsPage.js index <HASH>..<HASH> 100644 --- a/docs/src/ComponentsPage.js +++ b/docs/src/ComponentsPage.js @@ -317,8 +317,6 @@ const ComponentsPage = React.createClass({ <h4><Anchor id='modals-props-modal-footer'>Modal.Footer</Anchor></h4> <PropTable component='ModalFooter'/> - - <h4>ModalTrigger <strong className='text-danger'>Deprecated: use the Modal directly to manage it's visibility</strong></h4> </div>
Remove leftover for 'ModalTrigger' from docs.
react-bootstrap_react-bootstrap
train
js
120e0b5b8ea7b2a4ddcc802ca08a5a5cccf3d97e
diff --git a/tests/django_settings.py b/tests/django_settings.py index <HASH>..<HASH> 100644 --- a/tests/django_settings.py +++ b/tests/django_settings.py @@ -4,7 +4,8 @@ import warnings from django.utils import deprecation # NOQA warnings.filterwarnings('error', category=deprecation.RemovedInNextVersionWarning) # NOQA -warnings.filterwarnings('always', category=deprecation.RemovedInDjango30Warning) # NOQA +if hasattr(deprecation, 'RemovedInDjango30Warning'): + warnings.filterwarnings('always', category=deprecation.RemovedInDjango30Warning) # NOQA DEBUG = True SECRET_KEY = 'dummy'
only add RemovedInDjango<I>Warning if present)
mathiasertl_xmpp-backends
train
py
5003b2fb3a41405894a5c06a6646d759d2d509b4
diff --git a/spec/features/renalware/set_default_days_pd_regime_bag_spec.rb b/spec/features/renalware/set_default_days_pd_regime_bag_spec.rb index <HASH>..<HASH> 100644 --- a/spec/features/renalware/set_default_days_pd_regime_bag_spec.rb +++ b/spec/features/renalware/set_default_days_pd_regime_bag_spec.rb @@ -41,7 +41,7 @@ module Renalware select 'Star Brand, Lucky Brand Green–2.34', from: 'Bag Type' - fill_in 'Volume', with: '230' + select '2500', from: 'Volume (ml)' uncheck 'Tuesday'
Updated feature spec tests for 'set_default_days_pd_regime_bag' to work with changed pd regime bag volume input - now fixed options.
airslie_renalware-core
train
rb
805cae04b575d8ef5cb7b6d13d109ee29dae5e3a
diff --git a/py_linq/py_linq.py b/py_linq/py_linq.py index <HASH>..<HASH> 100644 --- a/py_linq/py_linq.py +++ b/py_linq/py_linq.py @@ -1106,11 +1106,11 @@ class SortedEnumerable(Enumerable): def __iter__(self): for o in reversed(self._key_funcs): self._data = sorted(self._data, key=o.key, reverse=o.descending) - cache=[] + cache = [] for d in self._data: cache.append(d) yield d - self._data=cache + self._data = cache def then_by(self, func): """ diff --git a/tests/test_functions.py b/tests/test_functions.py index <HASH>..<HASH> 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -797,4 +797,3 @@ class TestFunctions(TestCase): ], u"then_by_descending ordering is not correct" ) -
PEP8 failures fixed from previous commit
viralogic_py-enumerable
train
py,py
89b30738044bf478cc79208cca9a9a86572b335d
diff --git a/tests/test_qrcode.py b/tests/test_qrcode.py index <HASH>..<HASH> 100644 --- a/tests/test_qrcode.py +++ b/tests/test_qrcode.py @@ -64,7 +64,7 @@ def test_invalid_mode_provided(): def test_binary_data(): - qr = pyqrcode.create('Märchenbuch'.encode('utf-8')) + qr = pyqrcode.create('Märchenbuch'.encode('utf-8'), encoding='utf-8') eq_('Märchenbuch', qr.data) eq_('binary', qr.mode)
Fixed binary data test to use utf-8 encoding
mnooner256_pyqrcode
train
py
48470b483949b66254b1ed9d0f1789e63573ad0f
diff --git a/src/de/lmu/ifi/dbs/elki/visualization/visualizers/VisualizerContext.java b/src/de/lmu/ifi/dbs/elki/visualization/visualizers/VisualizerContext.java index <HASH>..<HASH> 100644 --- a/src/de/lmu/ifi/dbs/elki/visualization/visualizers/VisualizerContext.java +++ b/src/de/lmu/ifi/dbs/elki/visualization/visualizers/VisualizerContext.java @@ -156,7 +156,7 @@ public class VisualizerContext extends AnyMap<String> { */ public Clustering<Model> getOrCreateDefaultClustering() { Clustering<Model> c = getGenerics(CLUSTERING, Clustering.class); - if(c == null) { + if(c == null || c.getAllClusters().size() <= 0) { c = getGenerics(CLUSTERING_FALLBACK, Clustering.class); } if(c == null) {
Make more robust by doing more fallback to label clustering...
elki-project_elki
train
java
331e4015d293bc8844289b11e982d85d4bc8432f
diff --git a/core/src/playn/core/Layer.java b/core/src/playn/core/Layer.java index <HASH>..<HASH> 100644 --- a/core/src/playn/core/Layer.java +++ b/core/src/playn/core/Layer.java @@ -178,13 +178,14 @@ public interface Layer { Layer setOrigin(float x, float y); /** - * Sets the depth of this layer. Within a single {@link GroupLayer}, layers are rendered from - * lowest depth to highest depth. + * Returns this layer's current depth. */ float depth(); /** - * Updates this layer's depth. + * Sets the depth of this layer. + * <p> + * Within a single {@link GroupLayer}, layers are rendered from lowest depth to highest depth. * * @return a reference to this layer for call chaining. */
Fixed the Javadoc for Layer's depth() and setDepth() methods.
threerings_playn
train
java
693dc94526509a97247cb9aacea02d6aa2060f8e
diff --git a/cmd/gmq-cli/command_conn.go b/cmd/gmq-cli/command_conn.go index <HASH>..<HASH> 100644 --- a/cmd/gmq-cli/command_conn.go +++ b/cmd/gmq-cli/command_conn.go @@ -135,7 +135,7 @@ func newCommandConn(args []string, ctx *context) (*commandConn, error) { host := flg.String("h", defaultHost, "host name of the Server to connect to") port := flg.Uint("p", defaultPort, "port number of the Server to connect to") connackTimeout := flg.Uint( - "act", + "ackt", defaultCONNACKTimeout, "Timeout in seconds for the Client to wait receiving the CONNACK Packet after sending the CONNECT Packet", ) diff --git a/cmd/gmq-cli/main.go b/cmd/gmq-cli/main.go index <HASH>..<HASH> 100644 --- a/cmd/gmq-cli/main.go +++ b/cmd/gmq-cli/main.go @@ -38,6 +38,15 @@ func main() { // Create a context. ctx := newContext() + // Launch a goroutine which handles an error. + go func() { + for err := range ctx.errc { + os.Stderr.WriteString("\n") + printError(err) + printHeader() + } + }() + // Create a scanner which reads lines from standard input. scanner := bufio.NewScanner(stdin)
Update cmd/gmq-cli/command_conn.go
yosssi_gmq
train
go,go
ecc598bd03fb80309d63ebc20295ec76f0c2eb10
diff --git a/linkcheck/gui/options.py b/linkcheck/gui/options.py index <HASH>..<HASH> 100644 --- a/linkcheck/gui/options.py +++ b/linkcheck/gui/options.py @@ -37,19 +37,16 @@ class LinkCheckerOptions (QtGui.QDialog, Ui_Options): def reset (self): """Reset GUI and config options.""" - config = configuration.Configuration() files = configuration.get_standard_config_files() self.sys_config, self.user_config = files - config.read(files) - self.reset_gui_options(config) + self.reset_gui_options() self.reset_config_options() - def reset_gui_options (self, config): - """Reset GUI options to default values from config.""" - self.recursionlevel.setValue(config["recursionlevel"]) - self.verbose.setChecked(config["verbose"]) + def reset_gui_options (self): + """Reset GUI options to default values.""" + self.recursionlevel.setValue(-1) + self.verbose.setChecked(False) self.debug.setChecked(False) - del config def reset_config_options (self): """Reset configuration file edit buttons."""
Do not use configuration file options for GUI defaults.
wummel_linkchecker
train
py
8e23e81c574f00490df77795697a67633a565837
diff --git a/src/test/java/org/scribe/examples/FacebookExample.java b/src/test/java/org/scribe/examples/FacebookExample.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/scribe/examples/FacebookExample.java +++ b/src/test/java/org/scribe/examples/FacebookExample.java @@ -16,10 +16,13 @@ public class FacebookExample public static void main(String[] args) { + // Replace these with your own api key and secret + String apiKey = "your_api_key"; + String apiSecret = "your_api_secret"; OAuthService service = new ServiceBuilder() .provider(FacebookApi.class) - .apiKey("anonymous") - .apiSecret("anonymous") + .apiKey(apiKey) + .apiSecret(apiSecret) .callback("http://www.example.com/oauth_callback/") .build(); Scanner in = new Scanner(System.in);
Explicited that you need a personal pair of keys to use Facebook's example
scribejava_scribejava
train
java
b515d5393bf8cf91990f5e2071a7a070a5b34338
diff --git a/lib/geminabox_client.rb b/lib/geminabox_client.rb index <HASH>..<HASH> 100644 --- a/lib/geminabox_client.rb +++ b/lib/geminabox_client.rb @@ -10,6 +10,7 @@ class GeminaboxClient @http_client.set_auth(url_for(:upload), @username, @password) if @username or @password @http_client.www_auth.basic_auth.challenge(url_for(:upload)) # Workaround: https://github.com/nahi/httpclient/issues/63 @http_client.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE + @http_client.send_timeout = 600 end def extract_username_and_password_from_url!(url)
Establish a larger send timeout. resolves #<I>
geminabox_geminabox
train
rb
2aedaff4826d6b2baabf87e6db35be40e7863ec0
diff --git a/aiohue/config.py b/aiohue/config.py index <HASH>..<HASH> 100644 --- a/aiohue/config.py +++ b/aiohue/config.py @@ -14,6 +14,16 @@ class Config: return self.raw['name'] @property + def swversion(self): + """Software version of the bridge.""" + return self.raw['swversion'] + + @property + def modelid(self): + """Model ID of the bridge.""" + return self.raw['modelid'] + + @property def bridgeid(self): """ID of the bridge.""" return self.raw['bridgeid'] diff --git a/aiohue/lights.py b/aiohue/lights.py index <HASH>..<HASH> 100644 --- a/aiohue/lights.py +++ b/aiohue/lights.py @@ -47,6 +47,11 @@ class Light: def type(self): return self.raw['type'] + @property + def swversion(self): + """Software version of the light.""" + return self.raw['swversion'] + async def set_state(self, on=None, bri=None, hue=None, sat=None, xy=None, ct=None, alert=None, effect=None, transitiontime=None, bri_inc=None, sat_inc=None, hue_inc=None, ct_inc=None,
Add swversion, modelid bridge (#<I>)
balloob_aiohue
train
py,py
f59499dadb5554671db30f087a2f1075a3a8f573
diff --git a/tests/unit/router-test.js b/tests/unit/router-test.js index <HASH>..<HASH> 100644 --- a/tests/unit/router-test.js +++ b/tests/unit/router-test.js @@ -6,8 +6,13 @@ var container, registry, router, originalTitle; module('router:main', { beforeEach: function() { originalTitle = document.title; - container = new Ember.Container(); - registry = container._registry || container; + + if (Ember.Registry) { + registry = new Ember.Registry(); + container = registry.container(); + } else { + registry = container = new Ember.Container(); + } registry.register('location:none', Ember.NoneLocation);
Fix tests using `container._registry`. `container._registry` has been removed in <I>.
kimroen_ember-cli-document-title
train
js
8eefc21b881d6b749e57c3bb0e3012370f93dfc8
diff --git a/test/common/base/index.js b/test/common/base/index.js index <HASH>..<HASH> 100755 --- a/test/common/base/index.js +++ b/test/common/base/index.js @@ -274,6 +274,12 @@ describe('base', function () { }) }) + it('should be able to differentiate an empty array from an empty object', function () { + var one = new Base({}) + var two = new Base([]) + expect(one).not.deep.equal(two) + }) + require('./output.js') require('./property.js') })
Added test to demonstrate issue #<I>
vigour-io_vjs
train
js
c6e4e29cd0a39c126a93dbfc519cc10ad4e91750
diff --git a/src/nls/zh-cn/strings.js b/src/nls/zh-cn/strings.js index <HASH>..<HASH> 100644 --- a/src/nls/zh-cn/strings.js +++ b/src/nls/zh-cn/strings.js @@ -327,7 +327,7 @@ define({ "CMD_PREV_DOC" : "上一个文件", "CMD_SHOW_IN_TREE" : "在侧边栏显示", "CMD_SHOW_IN_EXPLORER" : "在资源管理器中显示", - "CMD_SHOW_IN_FINDER" : "在查找中显示", + "CMD_SHOW_IN_FINDER" : "在 Finder 中显示", "CMD_SHOW_IN_OS" : "打开文件所在目录", // Help menu commands @@ -361,7 +361,7 @@ define({ "UPDATE_AVAILABLE_TITLE" : "可用的更新", "UPDATE_MESSAGE" : "有一个新版本的 {APP_NAME}. 增加了一些功能:", "GET_IT_NOW" : "马上获取!", - "PROJECT_SETTINGS_TITLE" : "Project Settings for: {0}", + "PROJECT_SETTINGS_TITLE" : "项目设置: {0}", "PROJECT_SETTING_BASE_URL" : "实时预览的根目录地址", "PROJECT_SETTING_BASE_URL_HINT" : "使用本地服务器, 并指定一个URL. 例如: http://localhost:8000/", "BASEURL_ERROR_INVALID_PROTOCOL" : "实时预览不支持此协议 {0} &mdash;请使用 http: 或 https: .",
Update zh-cn translation. 1. No translation for 'Finder'. 2. Translate also 'Project Setting for...'.
adobe_brackets
train
js
02d5e91bd4579826747990c403df26c2b4456b78
diff --git a/lib/rest_pki/rest_pki_client.rb b/lib/rest_pki/rest_pki_client.rb index <HASH>..<HASH> 100644 --- a/lib/rest_pki/rest_pki_client.rb +++ b/lib/rest_pki/rest_pki_client.rb @@ -31,7 +31,7 @@ module RestPki response = nil begin - response = RestPki::Request.execute params + response = RestClient::Request.execute params rescue RestClient::Exception => ex raise RestUnreachableError.new(verb, url, ex.message) end
Fixed request method call on post request;
LacunaSoftware_RestPkiRubyClient
train
rb
ef4f501169078aec63076c6c303289ff9859d397
diff --git a/wafer/talks/models.py b/wafer/talks/models.py index <HASH>..<HASH> 100644 --- a/wafer/talks/models.py +++ b/wafer/talks/models.py @@ -113,9 +113,9 @@ class Talk(models.Model): talk_id = models.AutoField(primary_key=True) talk_type = models.ForeignKey( - TalkType, null=True, blank=True, on_delete=models.CASCADE) + TalkType, null=True, blank=True, on_delete=models.SET_NULL) track = models.ForeignKey( - Track, null=True, blank=True, on_delete=models.CASCADE) + Track, null=True, blank=True, on_delete=models.SET_NULL) title = models.CharField(max_length=1024)
Use SET_NULL for Talk.talk_type and Talk.track so that talks are retained when these are deleted.
CTPUG_wafer
train
py
7a0007b1a217f832d90c2f156734c9491a65ec89
diff --git a/Tank/stepper/missile.py b/Tank/stepper/missile.py index <HASH>..<HASH> 100644 --- a/Tank/stepper/missile.py +++ b/Tank/stepper/missile.py @@ -127,7 +127,8 @@ class AmmoFileReader(object): fields = chunk_header.split() chunk_size = int(fields[0]) if chunk_size == 0: - self.log.info('Zero-sized chunk in ammo file at %s. Starting over.' % ammo_file.tell()) + if info.status.loop_count == 0: + self.log.info('Zero-sized chunk in ammo file at %s. Starting over.' % ammo_file.tell()) ammo_file.seek(0) info.status.inc_loop_count() chunk_header = read_chunk_header(ammo_file)
inform about zero-sized chunk only once
yandex_yandex-tank
train
py
bb9607cda8f3344138c5e5a1193fec4639a750ab
diff --git a/jones/web.py b/jones/web.py index <HASH>..<HASH> 100644 --- a/jones/web.py +++ b/jones/web.py @@ -94,7 +94,7 @@ def service_create(env, jones): env = None return redirect(url_for( - 'service', service=jones.service, env=env)) + 'services', service=jones.service, env=env)) def service_update(env, jones): @@ -127,7 +127,7 @@ def service_get(env, jones): try: version, config = jones.get_config_by_env(env) except NoNodeException: - return redirect(url_for('service', service=jones.service)) + return redirect(url_for('services', service=jones.service)) childs = imap(dict, izip( izip(repeat('env'), imap(Env, children)),
update "url_for" references.
mwhooker_jones
train
py
6bdffdbf8d7d8909bb030e19fad9c50b40d72dc8
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -30,7 +30,11 @@ function parsePath (filePath) { function attachReporter (reporterFilePath) { // Assign the reporter if it's directly passed as an argument try { - reporter = require(reporterFilePath || defaultReporter)(runner); + if (reporterFilePath && typeof reporterFilePath !== 'string') { + reporter = reporterFilePath(runner); + } else { + reporter = require(reporterFilePath || defaultReporter)(runner); + } } catch (err) { console.log(chalk.bgRed.bold.white(' No reporter ! ') + ' [' + chalk.dim.red(err) + ']');
feat: accept reporters not only as filepath but as objects also
damonjs_damon
train
js
c00df6bf2d1b5d9b80b2bb4758d821fe11631cb9
diff --git a/lib/airbrake-ruby/truncator.rb b/lib/airbrake-ruby/truncator.rb index <HASH>..<HASH> 100644 --- a/lib/airbrake-ruby/truncator.rb +++ b/lib/airbrake-ruby/truncator.rb @@ -25,11 +25,9 @@ module Airbrake # Performs deep truncation of arrays, hashes and sets. Uses a # placeholder for recursive objects (`[Circular]`). # - # @param [Hash,Array] object The object to truncate + # @param [Hash,Array,Set] object The object to truncate # @param [Hash] seen The hash that helps to detect recursion # @return [void] - # @note This method is public to simplify testing. You probably want to use - # {truncate_notice} instead def truncate_object(object, seen = {}) return seen[object] if seen[object]
truncator: update comments for #truncate_object As pointed out by <URL>
airbrake_airbrake-ruby
train
rb
24bccad18ac118de193aec0a2fdce99e716c8bdd
diff --git a/pydle/utils/irccat.py b/pydle/utils/irccat.py index <HASH>..<HASH> 100644 --- a/pydle/utils/irccat.py +++ b/pydle/utils/irccat.py @@ -5,14 +5,11 @@ import sys import threading import logging -from .. import features -from .. import protocol - -from .. import featurize, __version__ +from .. import Client, __version__ from . import _args -class IRCCat(featurize(*features.ALL)): +class IRCCat(Client): """ irccat. Takes raw messages on stdin, dumps raw messages to stdout. Life has never been easier. """ def _get_message(self, types=None): """ Get message and print it to stdout. """ @@ -41,6 +38,7 @@ class IRCCat(featurize(*features.ALL)): def main(): + # Setup logging. logging.basicConfig(format='!! %(levelname)s: %(message)s') # Create client.
Clean up irccat code a bit.
Shizmob_pydle
train
py
44fb2e48f71747014c7b0e836ef0a69334b760df
diff --git a/bin/whistle.js b/bin/whistle.js index <HASH>..<HASH> 100755 --- a/bin/whistle.js +++ b/bin/whistle.js @@ -105,7 +105,7 @@ program.setConfig({ program .option('-d, --debug', 'debug mode') - .option('-A, --ATS', 'generate iOS ATS Root CA') + .option('-A, --ATS', 'generate Root CA for iOS ATS (Node >= 6 is required)') .option('-z, --certDir [directory]', 'custom certificate path', String, undefined) .option('-l, --localUIHost [hostname]', 'local ui host(' + config.localUIHost + ' by default)', String, undefined) .option('-n, --username [username]', 'login username', String, undefined)
refactor: Refine cmd tips
avwo_whistle
train
js
628031254d799941599507856691a130b154fb19
diff --git a/modules/backend/database/migrations/2016_10_01_000009_Db_Backend_Timestamp_Fix.php b/modules/backend/database/migrations/2016_10_01_000009_Db_Backend_Timestamp_Fix.php index <HASH>..<HASH> 100644 --- a/modules/backend/database/migrations/2016_10_01_000009_Db_Backend_Timestamp_Fix.php +++ b/modules/backend/database/migrations/2016_10_01_000009_Db_Backend_Timestamp_Fix.php @@ -1,6 +1,8 @@ <?php use October\Rain\Database\Updates\Migration; +use Backend\Models\Preference as PreferenceModel; +use Backend\Models\BrandSetting as BrandSettingModel; /** * This migration addresses a MySQL specific issue around STRICT MODE. @@ -23,6 +25,10 @@ class DbBackendTimestampFix extends Migration foreach ($this->backendTables as $table) { DbDongle::convertTimestamps($table); } + + // Use this opportunity to reset backend preferences and styles for stable + PreferenceModel::instance()->resetDefault(); + BrandSettingModel::instance()->resetDefault(); } public function down()
Stable prep: Reset the brand settings and backend prefs These have been restructured since RC version and so should be reset to avoid common bugs
octobercms_october
train
php
c76b7580bf834df4d89c4789939393f3b64ad958
diff --git a/config/application.php b/config/application.php index <HASH>..<HASH> 100644 --- a/config/application.php +++ b/config/application.php @@ -15,11 +15,7 @@ return array( * Session component */ 'session' => array( - 'handler' => 'sql', - 'options' => array( - 'connection' => 'mysql', - 'table' => 'sessions' - ), + 'handler' => 'native', 'cookie_params' => array( // Session cookie parameters can be set set )
Replaced handler db to native one
krystal-framework_krystal.framework
train
php
55b8f3486ff718f6383dc6f42e1bf06635baf453
diff --git a/xlog_examples_test.go b/xlog_examples_test.go index <HASH>..<HASH> 100644 --- a/xlog_examples_test.go +++ b/xlog_examples_test.go @@ -1,3 +1,5 @@ +// +build go1.7 + package xlog_test import (
Make example compile with go <I> only
rs_xlog
train
go
84f8cc40554c9f1734dec1801a017bef6edbbb98
diff --git a/jre_emul/android/libcore/luni/src/main/java/java/lang/ClassLoader.java b/jre_emul/android/libcore/luni/src/main/java/java/lang/ClassLoader.java index <HASH>..<HASH> 100644 --- a/jre_emul/android/libcore/luni/src/main/java/java/lang/ClassLoader.java +++ b/jre_emul/android/libcore/luni/src/main/java/java/lang/ClassLoader.java @@ -717,6 +717,12 @@ class SystemClassLoader extends ClassLoader { [urls addWithId:JavaNetNetFactory_newURLWithNSString_([nativeURL description])]; } } + for (NSBundle *bundle in [NSBundle allFrameworks]) { + NSURL *nativeURL = [bundle URLForResource:name withExtension:nil]; + if (nativeURL) { + [urls addWithId:JavaNetNetFactory_newURLWithNSString_([nativeURL description])]; + } + } return JavaUtilCollections_enumerationWithJavaUtilCollection_(urls); ]-*/;
Search for resource in [NSBundle allFrameworks] Previously ClassLoader.findResources finds resource in [NSBundle allBundles], which are non-framework bundles. With -allFrameworks we enable the use of dynamic frameworks.
google_j2objc
train
java
af3350bfbe4cae6d2146fccdf756377c2e6e9e56
diff --git a/tests/test_corpus.py b/tests/test_corpus.py index <HASH>..<HASH> 100644 --- a/tests/test_corpus.py +++ b/tests/test_corpus.py @@ -1349,7 +1349,7 @@ def test_dtm(corpora_en_serial_and_parallel_module, select, as_table, dtype, ret assert dtm.iloc[expected_labels.index('small1'), expected_vocab.index('the')] == 1 else: assert isinstance(dtm, csr_matrix) - assert dtm.dtype is np.dtype(dtype or 'int32') + assert dtm.dtype == np.dtype(dtype or 'int32') if len(corp) > 0 and select is None: assert np.sum(dtm[expected_labels.index('empty'), :]) == 0
fixed problem in test_dtm
WZBSocialScienceCenter_tmtoolkit
train
py
00ac0e72560f0776c9bc5c65976dcce986aac891
diff --git a/astroid/scoped_nodes.py b/astroid/scoped_nodes.py index <HASH>..<HASH> 100644 --- a/astroid/scoped_nodes.py +++ b/astroid/scoped_nodes.py @@ -452,19 +452,6 @@ class Module(LocalsDictNodeNG): It doesn't include the '__builtins__' name which is added by the current CPython implementation of wildcard imports. """ - # take advantage of a living module if it exists - try: - living = sys.modules[self.name] - except KeyError: - pass - else: - try: - return living.__all__ - except AttributeError: - return [name for name in living.__dict__.keys() - if not name.startswith('_')] - # else lookup the astroid - # # We separate the different steps of lookup in try/excepts # to avoid catching too many Exceptions default = [name for name in self.keys() if not name.startswith('_')]
Drop code that inspects sys.modules unconditionally, since it breaks the expectancy of a static analysis tool.
PyCQA_astroid
train
py
59ec251812b19674184643c55fa4d4cab7ba1d73
diff --git a/etcdserver/api/v2store/store.go b/etcdserver/api/v2store/store.go index <HASH>..<HASH> 100644 --- a/etcdserver/api/v2store/store.go +++ b/etcdserver/api/v2store/store.go @@ -747,7 +747,7 @@ func (s *store) SaveNoCopy() ([]byte, error) { } func (s *store) Clone() Store { - s.worldLock.Lock() + s.worldLock.RLock() clonedStore := newStore() clonedStore.CurrentIndex = s.CurrentIndex @@ -756,7 +756,7 @@ func (s *store) Clone() Store { clonedStore.Stats = s.Stats.clone() clonedStore.CurrentVersion = s.CurrentVersion - s.worldLock.Unlock() + s.worldLock.RUnlock() return clonedStore }
etcdserver: take read lock when cloning store
etcd-io_etcd
train
go
1909c0be819177bb99d1f8e6d66a98defc5a45ff
diff --git a/cutil/signals/signals.go b/cutil/signals/signals.go index <HASH>..<HASH> 100644 --- a/cutil/signals/signals.go +++ b/cutil/signals/signals.go @@ -70,9 +70,7 @@ func (h *Handler) GetState() int { } func (h *Handler) Reset() { - if !h.timer.Stop() { - <-h.timer.C - } + h.timer.Stop() } // Register starts handling signals.
Bugfix - Remove not needed channel drain
kubicorn_kubicorn
train
go
8dd28c732da3dc9a8f7da8fd65730caa8a3e503d
diff --git a/lib/helper.js b/lib/helper.js index <HASH>..<HASH> 100644 --- a/lib/helper.js +++ b/lib/helper.js @@ -16,7 +16,7 @@ var delegate = require('dom-delegate'); */ module.exports = function(view) { - view.on('initialize', function() { + view.on('before initialize', function() { this.delegate = delegate(); });
Hook into `before initialize` event so that the delegate is available during `initialize` callback
ftlabs_fruitmachine-ftdomdelegate
train
js
58efea7b18dab5b67d36a06f3f7964d8c1d3a772
diff --git a/django_afip/apps.py b/django_afip/apps.py index <HASH>..<HASH> 100644 --- a/django_afip/apps.py +++ b/django_afip/apps.py @@ -5,6 +5,7 @@ class AfipConfig(AppConfig): name = "django_afip" label = "afip" verbose_name = "AFIP" + default_auto_field = "django.db.models.AutoField" def ready(self): # Register app signals:
Avoid primary key issues in future Djangos
WhyNotHugo_django-afip
train
py
41278d463fdecde231cec2ca6cbc99f6f4909a2e
diff --git a/doc.go b/doc.go index <HASH>..<HASH> 100644 --- a/doc.go +++ b/doc.go @@ -27,15 +27,15 @@ Thus, to get a User with id 2: Key Specifications -src must be a S or *S for some struct type S. The key is extracted based on -various fields of S. If a field of type int64 or string has a struct tag -named goon with value "id", it is used as the key's id. If a field of type -*datastore.Key has a struct tag named goon with value "parent", it is used -as the key's parent. If a field of type string has a struct tag named goon -with value "kind", it is used as the key's kind. The "kind" field supports -an optional second parameter which is the default kind name. If no kind -field exists, the struct's name is used. These fields should all have -their datastore field marked as "-". +For both the Key and KeyError functions, src must be a S or *S for some +struct type S. The key is extracted based on various fields of S. If a field +of type int64 or string has a struct tag named goon with value "id", it is +used as the key's id. If a field of type *datastore.Key has a struct tag +named goon with value "parent", it is used as the key's parent. If a field +of type string has a struct tag named goon with value "kind", it is used +as the key's kind. The "kind" field supports an optional second parameter +which is the default kind name. If no kind field exists, the struct's name +is used. These fields should all have their datastore field marked as "-". Example, with kind User: type User struct {
Describe where keys are used since it's no longer clear
mjibson_goon
train
go
c2e3855f3b88bbf233772a1b7b1203e9b90233a4
diff --git a/prometheus/registry.go b/prometheus/registry.go index <HASH>..<HASH> 100644 --- a/prometheus/registry.go +++ b/prometheus/registry.go @@ -266,7 +266,7 @@ func (r *Registry) Register(c Collector) error { descChan = make(chan *Desc, capDescChan) newDescIDs = map[uint64]struct{}{} newDimHashesByName = map[string]uint64{} - collectorID uint64 // Just a sum of all desc IDs. + collectorID uint64 // All desc IDs XOR'd together. duplicateDescErr error ) go func() { @@ -293,12 +293,12 @@ func (r *Registry) Register(c Collector) error { if _, exists := r.descIDs[desc.id]; exists { duplicateDescErr = fmt.Errorf("descriptor %s already exists with the same fully-qualified name and const label values", desc) } - // If it is not a duplicate desc in this collector, add it to + // If it is not a duplicate desc in this collector, XOR it to // the collectorID. (We allow duplicate descs within the same // collector, but their existence must be a no-op.) if _, exists := newDescIDs[desc.id]; !exists { newDescIDs[desc.id] = struct{}{} - collectorID += desc.id + collectorID ^= desc.id } // Are all the label names and the help string consistent with
Minimal “fix” for hash collisions This makes the collisions a bit less likely by XOR'ing descIDs rather than adding them up for the collectorID.
prometheus_client_golang
train
go
46ac6cd429e4926206612ce793f7dab40cc93ef8
diff --git a/contrib/mergeBenchmarkSets.py b/contrib/mergeBenchmarkSets.py index <HASH>..<HASH> 100755 --- a/contrib/mergeBenchmarkSets.py +++ b/contrib/mergeBenchmarkSets.py @@ -142,12 +142,13 @@ def main(argv=None): result.append(newColumn) witnessSet.pop(run) statusWitNew, categoryWitNew = getWitnessResult(witness, expected_result) - if expected_result == False: - if statusWitNew.startswith('false(') or statusWit is None: - statusWit, categoryWit = (statusWitNew, categoryWitNew) - if expected_result == True: - if statusWitNew.startswith('true') or statusWit is None: - statusWit, categoryWit = (statusWitNew, categoryWitNew) + if ( + (expected_result == False and statusWitNew.startswith('false(')) or + (expected_result == True and statusWitNew.startswith('true')) or + (categoryWit == 'error' and categoryWitNew == 'unknown') or + (statusWit is None) + ): + statusWit, categoryWit = (statusWitNew, categoryWitNew) # Overwrite status with status from witness if isOverwrite and statusWit is not None and categoryWit is not None: result.findall('column[@title="status"]')[0].set('value', statusWit)
Refactor control flow for setting new status according to witness; prefer unknown result over error result
sosy-lab_benchexec
train
py
6d63fb5c55c5c84a8878e84755e8ee19108b9d6b
diff --git a/notes/edit.php b/notes/edit.php index <HASH>..<HASH> 100644 --- a/notes/edit.php +++ b/notes/edit.php @@ -22,7 +22,7 @@ if ($noteid) { $userid = required_param('userid', PARAM_INT); $state = optional_param('publishstate', NOTES_STATE_PUBLIC, PARAM_ALPHA); - $note = new object(); + $note = new stdClass(); $note->courseid = $courseid; $note->userid = $userid; $note->publishstate = $state; diff --git a/notes/lib.php b/notes/lib.php index <HASH>..<HASH> 100644 --- a/notes/lib.php +++ b/notes/lib.php @@ -173,7 +173,7 @@ function note_print($note, $detail = NOTES_SHOW_FULL) { $context = get_context_instance(CONTEXT_COURSE, $note->courseid); $systemcontext = get_context_instance(CONTEXT_SYSTEM); - $authoring = new object(); + $authoring = new stdClass(); $authoring->name = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$author->id.'&amp;course='.$note->courseid.'">'.fullname($author).'</a>'; $authoring->date = userdate($note->lastmodified);
MDL-<I> switching to stdClass in /notes/
moodle_moodle
train
php,php
236dfd1e1837552a9dd85915f0b1348e6d1444c2
diff --git a/peer/peer.go b/peer/peer.go index <HASH>..<HASH> 100644 --- a/peer/peer.go +++ b/peer/peer.go @@ -5,6 +5,7 @@ import ( "encoding/hex" "encoding/json" "fmt" + "strings" b58 "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-base58" ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr" @@ -38,12 +39,18 @@ func (id ID) Loggable() map[string]interface{} { // codebase is known to be correct. func (id ID) String() string { pid := id.Pretty() + + //All sha256 nodes start with Qm + //We can skip the Qm to make the peer.ID more useful + if strings.HasPrefix(pid, "Qm") { + pid = pid[2:] + } + maxRunes := 6 - skip := 2 //Added to skip past Qm which is identical for all SHA256 nodes - if len(pid) < maxRunes + skip { - maxRunes = len(pid) - skip + if len(pid) < maxRunes { + maxRunes = len(pid) } - return fmt.Sprintf("<peer.ID %s>", pid[skip:maxRunes + skip]) + return fmt.Sprintf("<peer.ID %s>", pid[:maxRunes]) } // MatchesPrivateKey tests whether this ID was derived from sk
Implemented @jbenet's suggestion to avoid panics if peerID is of length 0.
libp2p_go-libp2p
train
go
7b02384fb22667cd961606b19829b19df0b916ff
diff --git a/vendors.php b/vendors.php index <HASH>..<HASH> 100755 --- a/vendors.php +++ b/vendors.php @@ -40,8 +40,8 @@ foreach ($deps as $dep) { $installDir = $vendorDir.'/'.$name; if (!is_dir($installDir)) { - system(sprintf('git clone %s "%s"', $url, $installDir)); + system(sprintf('git clone %s %s', $url, escapeshellarg($installDir))); } - system(sprintf('cd "%s" && git fetch origin && git reset --hard %s', $installDir, $rev)); + system(sprintf('cd %s && git fetch origin && git reset --hard %s', escapeshellarg($installDir), $rev)); }
Using escapeshellarg() instead of quotes
symfony_symfony
train
php
09351ae7292c19898afa829044c73f43ea5949ea
diff --git a/src/main/java/org/jfrog/hudson/release/scm/perforce/PerforceCoordinator.java b/src/main/java/org/jfrog/hudson/release/scm/perforce/PerforceCoordinator.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jfrog/hudson/release/scm/perforce/PerforceCoordinator.java +++ b/src/main/java/org/jfrog/hudson/release/scm/perforce/PerforceCoordinator.java @@ -57,10 +57,9 @@ public class PerforceCoordinator extends AbstractScmCoordinator { } public void afterSuccessfulReleaseVersionBuild() throws InterruptedException, IOException { - String labelChangeListId = ExtractorUtils.getVcsRevision(build.getEnvironment(listener)); if (modifiedFilesForReleaseVersion) { log("Submitting release version changes"); - labelChangeListId = currentChangeListId + ""; + String labelChangeListId = currentChangeListId + ""; if (releaseAction.isCreateVcsTag()) { log("Creating label: '" + releaseAction.getTagUrl() + "' with change list id: " + labelChangeListId); perforce.createTag(releaseAction.getTagUrl(), releaseAction.getTagComment(), labelChangeListId);
HAP-<I> - Support Perforce in release management
jenkinsci_artifactory-plugin
train
java
759dbf2e9583d192145000330f618d8a55480843
diff --git a/src/js/components/Select/Select.js b/src/js/components/Select/Select.js index <HASH>..<HASH> 100644 --- a/src/js/components/Select/Select.js +++ b/src/js/components/Select/Select.js @@ -83,7 +83,7 @@ const Select = forwardRef( const inputRef = useRef(); const formContext = useContext(FormContext); - const [value] = formContext.useFormContext(name, valueProp); + const [value, setValue] = formContext.useFormContext(name, valueProp); const [open, setOpen] = useState(propOpen); useEffect(() => { @@ -106,6 +106,7 @@ const Select = forwardRef( const onSelectChange = (event, ...args) => { if (closeOnChange) onRequestClose(); + setValue(event.value); if (onChange) onChange({ ...event, target: inputRef.current }, ...args); };
Changed Select to fix an issue with setting value with FormContext (#<I>)
grommet_grommet
train
js
d5f314582d64e5d7f44a3a639da7a374349c13b6
diff --git a/lib/bud/viz.rb b/lib/bud/viz.rb index <HASH>..<HASH> 100644 --- a/lib/bud/viz.rb +++ b/lib/bud/viz.rb @@ -6,7 +6,7 @@ require 'set' class VizOnline #:nodoc: all attr_reader :logtab - META_TABLES = %w[t_cycle t_depends t_provides t_rules + META_TABLES = %w[t_cycle t_depends t_depends_tc t_provides t_rules t_stratum t_table_info t_table_schema].to_set def initialize(bud_instance)
On second thought, reinstitute depends_tc. When the dependency analysis code is loaded, it is effectively a builtin table.
bloom-lang_bud
train
rb
6eeeabfa2cab96726685186156e0b3fa26dac8e3
diff --git a/gyp/pylib/gyp/generator/make.py b/gyp/pylib/gyp/generator/make.py index <HASH>..<HASH> 100644 --- a/gyp/pylib/gyp/generator/make.py +++ b/gyp/pylib/gyp/generator/make.py @@ -1883,11 +1883,13 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD """Returns the location of the final output for an installable target.""" # Xcode puts shared_library results into PRODUCT_DIR, and some gyp files # rely on this. Emulate this behavior for mac. - if (self.type == 'shared_library' and - (self.flavor != 'mac' or self.toolset != 'target')): - # Install all shared libs into a common directory (per toolset) for - # convenient access with LD_LIBRARY_PATH. - return '$(builddir)/lib.%s/%s' % (self.toolset, self.alias) + + # XXX(TooTallNate): disabling this code since we don't want this behavior... + #if (self.type == 'shared_library' and + # (self.flavor != 'mac' or self.toolset != 'target')): + # # Install all shared libs into a common directory (per toolset) for + # # convenient access with LD_LIBRARY_PATH. + # return '$(builddir)/lib.%s/%s' % (self.toolset, self.alias) return '$(builddir)/' + self.alias
gyp: always install into $PRODUCT_DIR
CodeJockey_node-ninja
train
py
81eb166eeba9d9799f5c5ccc40cec845751ad183
diff --git a/lib/bud/rewrite.rb b/lib/bud/rewrite.rb index <HASH>..<HASH> 100644 --- a/lib/bud/rewrite.rb +++ b/lib/bud/rewrite.rb @@ -647,7 +647,7 @@ module ModuleRewriter # :nodoc: all def self.get_raw_parse_tree(klass) pt = RawParseTree.new(false) klassname = klass.name - klassname = klass.to_s if klassname.empty? #("anon_" + Process.pid.to_s + "_" + klass.object_id.to_s) if klassname.empty + klassname = klass.to_s if klassname.empty? klassname = klassname.to_sym code = if Class === klass then
Tweak comment. Commented-out code should generally be avoided.
bloom-lang_bud
train
rb
96a22aa2ccfe50beeba713e8bec5f6694473134a
diff --git a/testing/test_git.py b/testing/test_git.py index <HASH>..<HASH> 100644 --- a/testing/test_git.py +++ b/testing/test_git.py @@ -414,7 +414,8 @@ def signed_commit_wd(tmp_path, monkeypatch, wd): """\ %no-protection %transient-key -Key-Type: default +Key-Type: RSA +Key-Length: 2048 Name-Real: a test Name-Email: [email protected] Expire-Date: 0
Pick and configure an explicit `Key-Type` If the default `Key-Type` happens to be an ECC, then `Key-Curve` would be a required parameter, so let's just pick RSA<I> and be done with it.
pypa_setuptools_scm
train
py
38e6a36b31030b62f84292639e7943efd6c4f812
diff --git a/Reminders/PasswordBroker.php b/Reminders/PasswordBroker.php index <HASH>..<HASH> 100755 --- a/Reminders/PasswordBroker.php +++ b/Reminders/PasswordBroker.php @@ -259,4 +259,14 @@ class PasswordBroker { return $this->getRequest()->input('password_confirmation'); } + /** + * Get the password reminder repository implementation. + * + * @return \Illuminate\Auth\Reminders\ReminderRepositoryInterface + */ + protected function getRepository() + { + return $this->reminders; + } + }
Added getRepository method to password broker.
illuminate_auth
train
php
b65f18e2c4e12a799cc1cd92dd8e6aec58b045ce
diff --git a/UI/src/components/widgets/codeanalysis/view.js b/UI/src/components/widgets/codeanalysis/view.js index <HASH>..<HASH> 100644 --- a/UI/src/components/widgets/codeanalysis/view.js +++ b/UI/src/components/widgets/codeanalysis/view.js @@ -87,7 +87,7 @@ ctrl.securityIssues = [ getMetric(saData.metrics, 'blocker', 'Blocker'), - getMetric(saData.metrics, 'crtical', 'Critical'), + getMetric(saData.metrics, 'critical', 'Critical'), getMetric(saData.metrics, 'major', 'Major'), getMetric(saData.metrics, 'minor', 'Minor') ];
String spelling correction - "critcal" vs "critical"
Hygieia_Hygieia
train
js
9cde05c45de4a1c7c5421b2958151aee35542881
diff --git a/chickpea/static/chickpea/js/leaflet.chickpea.features.js b/chickpea/static/chickpea/js/leaflet.chickpea.features.js index <HASH>..<HASH> 100644 --- a/chickpea/static/chickpea/js/leaflet.chickpea.features.js +++ b/chickpea/static/chickpea/js/leaflet.chickpea.features.js @@ -153,7 +153,7 @@ L.ChickpeaMarker = L.Marker.extend({ }, changeOverlay: function(layer) { - L.Mixin.ChickpeaFeature.prototype.changeOverlay.call(this, layer); + L.Mixin.ChickpeaFeature.changeOverlay.call(this, layer); // Icon look depends on overlay this._redrawIcon(); },
ChickpeaFeature has no prototype...
umap-project_django-leaflet-storage
train
js
e4cd9c721a9181e51e2ed9037d5c8bb5ee3c6e38
diff --git a/Entity/Translation.php b/Entity/Translation.php index <HASH>..<HASH> 100644 --- a/Entity/Translation.php +++ b/Entity/Translation.php @@ -6,9 +6,15 @@ namespace Bundle\DoctrineExtensionsBundle\Entity; * Bundle\DoctrineExtensionsBundle\Entity\Translation * * @orm:Entity(repositoryClass="Gedmo\Translatable\Repository\TranslationRepository") - * @orm:Table(name="ext_translation", indexes={ - * @orm:index(name="lookup_idx", columns={"locale", "entity", "foreign_key", "field"}) - * }) + * @orm:Table( + * name="ext_translations", + * indexes={@orm:index(name="translations_lookup_idx", columns={ + * "locale", "entity", "foreign_key" + * })}, + * uniqueConstraints={@orm:UniqueConstraint(name="lookup_unique_idx", columns={ + * "locale", "entity", "foreign_key", "field" + * })} + * ) */ class Translation extends AbstractTranslation {
Updated indexes to match the latest update of the vendor
stof_StofDoctrineExtensionsBundle
train
php
3f44785aa518a4393e3be8e8979d9733e283dd9f
diff --git a/lib/src/main/java/com/github/kevinsawicki/http/HttpRequest.java b/lib/src/main/java/com/github/kevinsawicki/http/HttpRequest.java index <HASH>..<HASH> 100644 --- a/lib/src/main/java/com/github/kevinsawicki/http/HttpRequest.java +++ b/lib/src/main/java/com/github/kevinsawicki/http/HttpRequest.java @@ -710,6 +710,10 @@ public class HttpRequest { } } + public String toString() { + return connection.getRequestMethod() + " " + connection.getURL(); + } + /** * Get underlying connection *
Add toString implementation that includes URL and method
kevinsawicki_http-request
train
java
0a8ef335522f0e824985272d0dcbe46ce7b10327
diff --git a/eZ/Publish/API/Repository/Values/Content/URLWildcard.php b/eZ/Publish/API/Repository/Values/Content/URLWildcard.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/API/Repository/Values/Content/URLWildcard.php +++ b/eZ/Publish/API/Repository/Values/Content/URLWildcard.php @@ -22,7 +22,7 @@ use eZ\Publish\API\Repository\Values\ValueObject; class URLWildcard extends ValueObject { - /** + /** * * The unique id * @@ -38,11 +38,11 @@ class URLWildcard extends ValueObject protected $sourceUrl; /** - * The destiantion url containing placeholders e.g. /destination/{1} + * The destination url containing placeholders e.g. /destination/{1} * * @var string */ - protected $destiantionUrl; + protected $destinationUrl; /** * indicates if the url is redirected or not
Fixed: Typo in property name.
ezsystems_ezpublish-kernel
train
php
29ae402a6b1a71ef7aaa0fedd4de7d793cce8724
diff --git a/app/controllers/neighborly/balanced/bankaccount/accounts_controller.rb b/app/controllers/neighborly/balanced/bankaccount/accounts_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/neighborly/balanced/bankaccount/accounts_controller.rb +++ b/app/controllers/neighborly/balanced/bankaccount/accounts_controller.rb @@ -1,7 +1,8 @@ module Neighborly::Balanced::Bankaccount class AccountsController < ActionController::Base def new - prepare_new_view + @balanced_marketplace_id = ::Configuration.fetch(:balanced_marketplace_id) + @bank_account = customer.bank_accounts.try(:last) end def create @@ -28,11 +29,6 @@ module Neighborly::Balanced::Bankaccount user: {}) end - def prepare_new_view - @balanced_marketplace_id = ::Configuration.fetch(:balanced_marketplace_id) - @bank_account = customer.bank_accounts.try(:last) - end - def customer @customer ||= Neighborly::Balanced::Customer.new(current_user, params).fetch end
Move prepare_new_view to new method
FromUte_dune-balanced-bankaccount
train
rb
d13ced3936c42903bbf75bf035867e51185ccb50
diff --git a/nameko/testing/services.py b/nameko/testing/services.py index <HASH>..<HASH> 100644 --- a/nameko/testing/services.py +++ b/nameko/testing/services.py @@ -7,7 +7,7 @@ from contextlib import contextmanager import inspect from eventlet import event -from mock import Mock +from mock import MagicMock from nameko.dependencies import ( DependencyFactory, InjectionProvider, EntrypointProvider, entrypoint) @@ -115,7 +115,7 @@ def instance_factory(service_cls, **injections): try: injection = injections[name] except KeyError: - injection = Mock() + injection = MagicMock() setattr(service, name, injection) return service @@ -123,7 +123,7 @@ def instance_factory(service_cls, **injections): class MockInjection(InjectionProvider): def __init__(self, name): self.name = name - self.injection = Mock() + self.injection = MagicMock() def acquire_injection(self, worker_ctx): return self.injection
use magicmocks for replacement injections
nameko_nameko
train
py
a32c7b51979d11b28aa94898200a2623f4d112e9
diff --git a/src/CustomElements.php b/src/CustomElements.php index <HASH>..<HASH> 100644 --- a/src/CustomElements.php +++ b/src/CustomElements.php @@ -642,6 +642,12 @@ class CustomElements } } + if ($fieldConfig['inputType'] === 'pageTree' || $fieldConfig['inputType'] === 'fileTree') { + if (!isset($fieldConfig['eval']['fieldType'])) { + $fieldConfig['eval']['fieldType'] = 'radio'; + } + } + $GLOBALS['TL_DCA'][$dc->table]['fields'][$fieldPrefix . $fieldName] = $fieldConfig; $GLOBALS['TL_DCA'][$dc->table]['fields'][$fieldPrefix . $fieldName]['eval']['alwaysSave'] = true; $GLOBALS['TL_DCA'][$dc->table]['fields'][$fieldPrefix . $fieldName]['eval']['doNotSaveEmpty'] = true;
Fixed bug with missing fieldType for pageTree
madeyourday_contao-rocksolid-custom-elements
train
php
08fcf72bb2cd1420d31c48e294e3dbab3145de9d
diff --git a/docs/source/conf.py b/docs/source/conf.py index <HASH>..<HASH> 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -14,16 +14,12 @@ import os import sys -import unittest.mock - -MOCK_MODULES = ['lxml'] -for mod_name in MOCK_MODULES: - sys.modules[mod_name] = unittest.mock.Mock() - # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) +sys.path.insert(0, os.path.abspath('../..')) + +autodoc_mock_imports = ['colorlog', 'lxml', 'pandas'] # -- General configuration -----------------------------------------------------
Reworked doc generation to fix newly occurring autodoc problem.
ajenhl_tacl
train
py
a1a6a77d2d6c1ed0bae32a46536a6885ced3fb40
diff --git a/converters/toZigbee.js b/converters/toZigbee.js index <HASH>..<HASH> 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -859,6 +859,7 @@ const converters = { state = meta.message.state = brightness === 0 ? 'off' : 'on'; } + let publishBrightness = brightness !== undefined; const targetState = state === 'toggle' ? (meta.state.state === 'ON' ? 'off' : 'on') : state; if (targetState === 'off') { // Simulate 'Off' with transition via 'MoveToLevelWithOnOff', otherwise just use 'Off'. @@ -896,6 +897,8 @@ const converters = { } catch (e) { // OnLevel not supported } + // Published state might have gotten clobbered by reporting. + publishBrightness = true; } } @@ -927,7 +930,7 @@ const converters = { ); const result = {state: {}, readAfterWriteTime: transition.time * 100}; - if (brightness !== 0) { + if (publishBrightness) { result.state.brightness = Number(brightness); } if (state !== null) {
Publish brightness 0 when explicitly requested (#<I>) Not sure this is even technically a valid value but whatever. Koenkk/zigbee2mqtt#<I>
Koenkk_zigbee-shepherd-converters
train
js
4b8b6ba7e9185b7c0c74199161bb88afcfb81020
diff --git a/tools/docker/phd_base_tf_cpu/tests/tf_test.py b/tools/docker/phd_base_tf_cpu/tests/tf_test.py index <HASH>..<HASH> 100644 --- a/tools/docker/phd_base_tf_cpu/tests/tf_test.py +++ b/tools/docker/phd_base_tf_cpu/tests/tf_test.py @@ -1,4 +1,5 @@ """Test that Tensorflow works.""" +import site import sys from labm8.py import test @@ -9,6 +10,7 @@ FLAGS = test.FLAGS def test_import_tensorflow(): print("Python executable:", sys.executable) print("Python version:", sys.version) + print("Python site packages:", site.getsitepackages()) from third_party.py.tensorflow import tf as tensorflow
Fix Tensorflow support in docker images. Signed-off-by: format <I> <github.com/ChrisCummins/format>
ChrisCummins_labm8
train
py
9ecb03399ae50b4146a06a506d856bdd38809f7d
diff --git a/lib/rapns.rb b/lib/rapns.rb index <HASH>..<HASH> 100644 --- a/lib/rapns.rb +++ b/lib/rapns.rb @@ -17,7 +17,6 @@ require 'rapns/upgraded' require 'rapns/apns/binary_notification_validator' require 'rapns/apns/device_token_format_validator' -require 'rapns/apns/required_fields_validator' require 'rapns/apns/notification' require 'rapns/apns/feedback' require 'rapns/apns/app'
don't require a deleted file (ileitch/rapns#<I>)
rpush_rpush
train
rb
2a02162869586be784e48d66246d893369e6aba3
diff --git a/upload/admin/controller/openbay/amazon.php b/upload/admin/controller/openbay/amazon.php index <HASH>..<HASH> 100644 --- a/upload/admin/controller/openbay/amazon.php +++ b/upload/admin/controller/openbay/amazon.php @@ -164,7 +164,7 @@ class ControllerOpenbayAmazon extends Controller { $response = simplexml_load_string($this->openbay->amazon->callWithResponse('plans/getPlans')); - $data['plans'][] = array(); + $data['plans'] = array(); if ($response) { foreach ($response->Plan as $plan) { diff --git a/upload/admin/controller/openbay/amazonus.php b/upload/admin/controller/openbay/amazonus.php index <HASH>..<HASH> 100644 --- a/upload/admin/controller/openbay/amazonus.php +++ b/upload/admin/controller/openbay/amazonus.php @@ -161,7 +161,7 @@ class ControllerOpenbayAmazonus extends Controller { $response = simplexml_load_string($this->openbay->amazonus->callWithResponse('plans/getPlans')); - $data['plans'][] = array(); + $data['plans'] = array(); if ($response) { foreach ($response->Plan as $plan) {
Removed empty array element from plan array.
opencart_opencart
train
php,php
863d1a334dc629c5d4064e8c7564d9e399d6bb5b
diff --git a/internal/config/cgmgr/systemd.go b/internal/config/cgmgr/systemd.go index <HASH>..<HASH> 100644 --- a/internal/config/cgmgr/systemd.go +++ b/internal/config/cgmgr/systemd.go @@ -156,12 +156,9 @@ func (m *SystemdManager) SandboxCgroupPath(sbParent, sbID string) (cgParent, cgP if !strings.HasSuffix(filepath.Base(sbParent), ".slice") { return "", "", fmt.Errorf("cri-o configured with systemd cgroup manager, but did not receive slice as parent: %s", sbParent) } - cgParent, slicePath, err := sandboxCgroupAbsolutePath(sbParent) - if err != nil { - return "", "", err - } - if err := verifyCgroupHasEnoughMemory(slicePath, m.memoryPath, m.memoryMaxFile); err != nil { + cgParent = convertCgroupFsNameToSystemd(sbParent) + if err := verifyCgroupHasEnoughMemory(sbParent, m.memoryPath, m.memoryMaxFile); err != nil { return "", "", err }
cgmgr/systemd: don't recalculate cgroup path from the looks of it, we were expanding the slice unnecessarily, as we're already passed a path
cri-o_cri-o
train
go
92747dc6971738d533b7ab6a521e7116f589f539
diff --git a/quickplots/charts.py b/quickplots/charts.py index <HASH>..<HASH> 100644 --- a/quickplots/charts.py +++ b/quickplots/charts.py @@ -494,7 +494,9 @@ class AxisChart(Chart): line_width=0, name="block-s" ) - canvas._graphics.append(canvas._graphics.pop(0)) # Dirty hack + title = canvas.graphics()[0] + while canvas.graphics().index(title) != len(canvas.graphics()) - 1: + canvas.move_graphic_forward(title) canvas.graphics()[-1].y(self.vertical_padding() * canvas.height() * 0.5) canvas.graphics()[-1].vertical_align("center")
Make use of new omnicanvas graphic reordering to bring title forwards
samirelanduk_quickplots
train
py
ccde29dd0626d870bf61fc9c04c845017060711d
diff --git a/formats.js b/formats.js index <HASH>..<HASH> 100644 --- a/formats.js +++ b/formats.js @@ -28,7 +28,7 @@ exports['hostname'] = function (input) { } exports['alpha'] = /^[a-zA-Z]+$/ exports['alphanumeric'] = /^[a-zA-Z0-9]+$/ -exports['style'] = /\s*(.+?):\s*([^;]+);?/g +exports['style'] = /.:\s*[^;]/g exports['phone'] = function (input) { if (!(rePhoneFirstPass.test(input))) return false if (rePhoneDoubleSpace.test(input)) return false
Fix a ReDoS in 'style' format As there are no `^` or `$` anchors in the regex, this should be equivalent. Patch deliberately does not change the behavior.
mafintosh_is-my-json-valid
train
js
5661c92fcc85f2bcba94defc272ecb63a2264275
diff --git a/Core.php b/Core.php index <HASH>..<HASH> 100644 --- a/Core.php +++ b/Core.php @@ -812,12 +812,15 @@ class Core implements iCore if($requirement != 'samsonos/php_core') { // Try developer relative path - $path = '../../vendor'.$requirement; + $path = '../../vendor/'; if (!file_exists($path)) { // Build path to module - $path = __SAMSON_VENDOR_PATH.$requirement; + $path = __SAMSON_VENDOR_PATH; } + // Build path to module + $path .= $requirement; + // If path with underscores does not exists if (!file_exists($path)) { // Try path without underscore
Added patch for local developer module development by trying to find relative ../../vendor path
samsonos_php_core
train
php
99ecf82fbd199c43153ffb96e0bb16f1f4700d34
diff --git a/src/wyil/transforms/TypePropagation.java b/src/wyil/transforms/TypePropagation.java index <HASH>..<HASH> 100755 --- a/src/wyil/transforms/TypePropagation.java +++ b/src/wyil/transforms/TypePropagation.java @@ -1027,7 +1027,7 @@ public class TypePropagation extends ForwardFlowAnalysis<TypePropagation.Env> { do { // iterate until a fixed point reached oldEnv = newEnv != null ? newEnv : environment; - newEnv = propagate(body, oldEnv); + newEnv = propagate(index+1,body, oldEnv); } while (!newEnv.equals(oldEnv)); environment = join(environment, newEnv);
Another bug fix for forward flow analysis and type propagation.
Whiley_WhileyCompiler
train
java
f0c86cda6932771b3c8dcfdccb7d32890b7bc59e
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -36,7 +36,7 @@ MongoDOWN.prototype._open = function (options, callback) { if (!options.createIfMissing) dbExists(self.location, function (err, exists) { if (err) return callback(err); - if (!exists) return callback(new Error('Database ' + self.location + ' doesn\'t exist')); + if (!exists) return callback(new Error('Database ' + self.location + ' does not exist')); connect(); }); else if (options.errorIfExists)
Use common error messages This error message is expected by abstract-down
watson_mongodown
train
js
892f7ef05284155ee0c9e763e50b1d4dc346a5fb
diff --git a/src/ossos-pipeline/ossos/astrom.py b/src/ossos-pipeline/ossos/astrom.py index <HASH>..<HASH> 100644 --- a/src/ossos-pipeline/ossos/astrom.py +++ b/src/ossos-pipeline/ossos/astrom.py @@ -902,6 +902,9 @@ class Observation(object): # TODO Remove get_image_uri from here, use the storage methods. def get_image_uri(self): + if self.ftype == 'p' and self.fk is None or self.fk=='': + return storage.dbimages_uri(self.expnum) + return storage.dbimages_uri(self.expnum, ccd=self.ccdnum, version=self.ftype, @@ -909,7 +912,8 @@ class Observation(object): ext='.fits') def get_object_planted_uri(self): - return os.path.dirname(self.get_image_uri())+"/Object.planted" + dir = os.path.dirname(storage.dbimages_uri(self.expnum, ccd=self.ccdnum)) + return dir+"/Object.planted" def get_apcor_uri(self): return storage.dbimages_uri(self.expnum,
Hardcoded that p images are not in a CCD directory: TODO Fix this better
OSSOS_MOP
train
py
4c9b5137798f47066e9dda87fce47e91fb6b70b1
diff --git a/test/assert.js b/test/assert.js index <HASH>..<HASH> 100644 --- a/test/assert.js +++ b/test/assert.js @@ -256,10 +256,10 @@ suite('assert', function () { test('doesNotThrow', function() { assert.doesNotThrow(function() { }); + assert.doesNotThrow(function() { }, 'foo'); err(function () { assert.doesNotThrow(function() { throw new Error('foo'); }); - assert.doesNotThrow(function() { throw new Error('bar'); }, 'foo'); }, 'expected [Function] to not throw an error'); });
Update `assert.doesNotThrow` test in order to check the use case when type is a string.
chaijs_chai
train
js
3d552307efc29923c327c52d42d380bab24b1ed8
diff --git a/slither/solc_parsing/expressions/expression_parsing.py b/slither/solc_parsing/expressions/expression_parsing.py index <HASH>..<HASH> 100644 --- a/slither/solc_parsing/expressions/expression_parsing.py +++ b/slither/solc_parsing/expressions/expression_parsing.py @@ -241,7 +241,10 @@ def convert_subdenomination(value, sub): if sub is None: return value # to allow 0.1 ether conversion - value = float(value) + if value[0:2] == "0x": + value = float(int(value, 16)) + else: + value = float(value) if sub == 'wei': return int(value) if sub == 'szabo':
Added hexadecimal support for subdenominations
crytic_slither
train
py
5f60fd15e2a8995a47bf36d65bc8ce066a7af3c4
diff --git a/RAPIDpy/helper_functions.py b/RAPIDpy/helper_functions.py index <HASH>..<HASH> 100644 --- a/RAPIDpy/helper_functions.py +++ b/RAPIDpy/helper_functions.py @@ -58,7 +58,7 @@ def get_rivid_list_from_file(in_rapid_connect): """ rapid_connect_rivid_list = [] with open(in_rapid_connect, "rb") as csvfile: - reader = csv.reader(csvfile) + reader = csv.reader(csvfile, delimiter=",") for row in reader: rapid_connect_rivid_list.append(row[0]) return np_array(rapid_connect_rivid_list, dtype=int)
Added delimiter for rivid function
erdc_RAPIDpy
train
py
db593e383c2ba90d75c009ca54cf6417c7fecedf
diff --git a/library/src/main/java/com/github/ksoichiro/android/observablescrollview/ObservableRecyclerView.java b/library/src/main/java/com/github/ksoichiro/android/observablescrollview/ObservableRecyclerView.java index <HASH>..<HASH> 100644 --- a/library/src/main/java/com/github/ksoichiro/android/observablescrollview/ObservableRecyclerView.java +++ b/library/src/main/java/com/github/ksoichiro/android/observablescrollview/ObservableRecyclerView.java @@ -103,8 +103,10 @@ public class ObservableRecyclerView extends RecyclerView implements Scrollable { for (int i = firstVisiblePosition, j = 0; i <= lastVisiblePosition; i++, j++) { int childHeight = 0; View child = getChildAt(j); - if (mChildrenHeights.indexOfKey(i) < 0 || (child != null && child.getHeight() != mChildrenHeights.get(i))) { - childHeight = child.getHeight(); + if (child != null) { + if (mChildrenHeights.indexOfKey(i) < 0 || (child.getHeight() != mChildrenHeights.get(i))) { + childHeight = child.getHeight(); + } } mChildrenHeights.put(i, childHeight); }
Fixed NPE when mChildrenHeights.indexOfKey(i) < 0 in ObservableRecyclerView.
ksoichiro_Android-ObservableScrollView
train
java
8cc9ff4e77a3893a602e175491ee9350ce0768ee
diff --git a/liberty-starter-application/src/main/java/com/ibm/liberty/starter/client/BxCodegenClient.java b/liberty-starter-application/src/main/java/com/ibm/liberty/starter/client/BxCodegenClient.java index <HASH>..<HASH> 100644 --- a/liberty-starter-application/src/main/java/com/ibm/liberty/starter/client/BxCodegenClient.java +++ b/liberty-starter-application/src/main/java/com/ibm/liberty/starter/client/BxCodegenClient.java @@ -44,7 +44,7 @@ public class BxCodegenClient { public final String URL = System.getenv("bxCodegenEndpoint"); public final String STARTERKIT_URL = System.getenv("appAccelStarterkit"); - private final int retriesAllowed = 9; + private final int retriesAllowed = 18; public Map<String, byte[]> getFileMap(ProjectConstructionInputData inputData) throws ProjectGenerationException { checkConfig();
Increase number of retries to bx codegen.
WASdev_tool.accelerate.core
train
java
bcdef8099a47f2405c1885311a0f838239ac8d1a
diff --git a/blueprints/ember-cli-lazy-load/files/config/bundles.js b/blueprints/ember-cli-lazy-load/files/config/bundles.js index <HASH>..<HASH> 100644 --- a/blueprints/ember-cli-lazy-load/files/config/bundles.js +++ b/blueprints/ember-cli-lazy-load/files/config/bundles.js @@ -10,13 +10,15 @@ module.exports = function(environment) { //index: { - // files: [ // You can specify pattern you want, this options is directly used in a broccoli-funnel + // //Minisearch file patterns for the content of the bundle + // files: [ // "**/templates/index.js", // "**/controllers/index.js", // "**/components/my-item/**.js" // ], // - // routes: ["index", "..."] //If the user will translate to one of this route names the bundle gets loaded, this is optional + // //The name of the routes if you are using the lazy-route mixin, no minisearch expressions are allowed here. + // routes: ["index", "..."] //}, //about: { // files: [ @@ -24,7 +26,8 @@ module.exports = function(environment) { // "**/controllers/about.js", // "**/components/my-cat/**.js" // ], - // dependencies: ["index"], //If the content of your bundle depend on something from an other bundle you can specify this here + // //The dependencies for this bundle. They will loaded in the same batch as the actual bundle + // dependencies: ["index"], // routes: ["about", "more routes for this bundle "] //} }
- replace doc with doc from readme
duizendnegen_ember-cli-lazy-load
train
js
6f1c89a6208804be3bb16a497cb3332583078b2e
diff --git a/openquake/calculators/event_based_risk.py b/openquake/calculators/event_based_risk.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/event_based_risk.py +++ b/openquake/calculators/event_based_risk.py @@ -231,7 +231,8 @@ class EventBasedStats(object): [(ltype, (F32, cbuilder.curve_resolution)) for ltype, cbuilder in zip( ltypes, self.riskmodel.curve_builders)]) - rcurves = numpy.zeros((N, R, I), multi_lr_dt) + # TODO: change 2 -> I, then change the exporter + rcurves = numpy.zeros((N, R, 2), multi_lr_dt) if self.oqparam.loss_ratios: self.save_rcurves(rcurves, I) @@ -880,3 +881,6 @@ class EbriskCalculator(base.RiskCalculator): logging.info('Saved %d event losses', num_events) self.datastore.set_nbytes('agg_loss_table') self.datastore.set_nbytes('events') + + ebstats = EventBasedStats(self.datastore, self.monitor) + ebstats.build()
Computing the stats also for the ebrisk calculator Former-commit-id: <I>d<I>b<I>a<I>a<I>ba<I>ad<I>a9d<I>
gem_oq-engine
train
py
d507dd28f6ae6d949be93c45ffe4a0c887b0090d
diff --git a/spec/unit/type_factory/factory/test_tuple_type.rb b/spec/unit/type_factory/factory/test_tuple_type.rb index <HASH>..<HASH> 100644 --- a/spec/unit/type_factory/factory/test_tuple_type.rb +++ b/spec/unit/type_factory/factory/test_tuple_type.rb @@ -22,5 +22,22 @@ module Qrb end end + context 'when use with {r: 0..255} and a name' do + subject{ factory.type({r: 0..255}, "MyTuple") } + + it{ should be_a(TupleType) } + + it 'should have the correct constraint on r' do + subject.up(r: 36) + ->{ + subject.up(r: 543) + }.should raise_error(UpError) + end + + it 'should have the correct name' do + subject.name.should eq("MyTuple") + end + end + end end
Make sure Range can be used for tuple attribute types.
blambeau_finitio-rb
train
rb
bc4503e6901719c8867efb1851b3baedfb42410a
diff --git a/src/directives/array.js b/src/directives/array.js index <HASH>..<HASH> 100644 --- a/src/directives/array.js +++ b/src/directives/array.js @@ -130,7 +130,11 @@ angular.module('schemaForm').directive('sfArray', ['sfSelect', 'schemaForm', 'sf if (scope.validateArray) { scope.validateArray(); } - ngModel.$setDirty(); + + // Angular 1.2 lacks setDirty + if (ngModel.$setDirty) { + ngModel.$setDirty(); + } return list; };
Surround with a check since its not available in <I>
json-schema-form_angular-schema-form
train
js
c891053bd0b03b7ce21c5c234f815b89228e5e3e
diff --git a/www/browser/push.js b/www/browser/push.js index <HASH>..<HASH> 100644 --- a/www/browser/push.js +++ b/www/browser/push.js @@ -367,7 +367,10 @@ module.exports = { }, hasPermission: function(successCallback, errorCallback) { - successCallback(true); + const granted = Notification && Notification.permission === 'granted'; + successCallback({ + isEnabled: granted + }); }, unregister: function(successCallback, errorCallback, options) {
:sparkles: PushNotification.hasPermission() is now supported in the browser (#<I>)
phonegap_phonegap-plugin-push
train
js
76002f94f564a53fe9ebe2d68928798337719ee6
diff --git a/theme/afterburner/config.php b/theme/afterburner/config.php index <HASH>..<HASH> 100644 --- a/theme/afterburner/config.php +++ b/theme/afterburner/config.php @@ -59,6 +59,7 @@ $THEME->layouts = array( 'file' => 'default.php', 'regions' => array('side-pre', 'side-post'), 'defaultregion' => 'side-post', + 'options' => array('langmenu'=>true), ), // Server administration scripts. 'admin' => array(
MDL-<I> theme_afterburner: added lang menu to frontpage layout in config.php
moodle_moodle
train
php
e5e4fc4ad538951c4cd5cc02524e139eb06c0310
diff --git a/nomad/resources_endpoint.go b/nomad/resources_endpoint.go index <HASH>..<HASH> 100644 --- a/nomad/resources_endpoint.go +++ b/nomad/resources_endpoint.go @@ -114,19 +114,16 @@ func (r *Resources) List(args *structs.ResourceListRequest, } // Set the index for the context. If the context has been specified, it - // is the only non-empty match set, and the index is set for it. - // If the context was not specified, we set the index to be the max index - // from available matches. + // will be used as the index of the response. Otherwise, the + // maximum index from all resources will be used. reply.Index = 0 - for k, v := range reply.Matches { - if len(v) != 0 { // make sure matches exist for this context - index, err := state.Index(k) - if err != nil { - return err - } - if index > reply.Index { - reply.Index = index - } + for _, e := range contexts { + index, err := state.Index(e) + if err != nil { + return err + } + if index > reply.Index { + reply.Index = index } }
max index for any resource, if context is unspecified
hashicorp_nomad
train
go
aa5d0abf25661d651ef331abb222652cf4e65a86
diff --git a/mongo_connector/doc_managers/solr_doc_manager.py b/mongo_connector/doc_managers/solr_doc_manager.py index <HASH>..<HASH> 100755 --- a/mongo_connector/doc_managers/solr_doc_manager.py +++ b/mongo_connector/doc_managers/solr_doc_manager.py @@ -79,10 +79,10 @@ class DocManager(): for wc_pattern in self._parse_fields(result, 'dynamicFields'): if wc_pattern[0] == "*": self._dynamic_field_regexes.append( - re.compile("\w%s\Z" % wc_pattern)) + re.compile(".*%s\Z" % wc_pattern[1:])) elif wc_pattern[-1] == "*": self._dynamic_field_regexes.append( - re.compile("\A%s\w*" % wc_pattern[:-1])) + re.compile("\A%s.*" % wc_pattern[:-1])) def _clean_doc(self, doc): """Reformats the given document before insertion into Solr.
fix: dynamicFields should match nested field names
yougov_mongo-connector
train
py
7d301b59fa22fbb605e6890de4e3e6e19535f1a7
diff --git a/src/main/java/com/apruve/models/SubscriptionAdjustment.java b/src/main/java/com/apruve/models/SubscriptionAdjustment.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/apruve/models/SubscriptionAdjustment.java +++ b/src/main/java/com/apruve/models/SubscriptionAdjustment.java @@ -53,6 +53,8 @@ public class SubscriptionAdjustment { @XmlElement(name = "price_ea_cents") private Integer priceEachCents; private Integer quantity; + @XmlElement(name = "merchant_notes") + private String merchantNotes; private String description; @XmlElement(name = "variant_info") private String variantInfo; @@ -182,6 +184,14 @@ public class SubscriptionAdjustment { public void setQuantity(Integer quantity) { this.quantity = quantity; } + + public String getMerchantNotes() { + return merchantNotes; + } + + public void setMerchantNotes(String merchantNotes) { + this.merchantNotes = merchantNotes; + } public String getDescription() { return description;
Implemented merchant_notes in subscription_adjustment
apruve_apruve-java
train
java
cd6457ba6a0d44cd4d7a86b4089717e8dc98945a
diff --git a/azurerm/provider.go b/azurerm/provider.go index <HASH>..<HASH> 100644 --- a/azurerm/provider.go +++ b/azurerm/provider.go @@ -257,15 +257,19 @@ func (c *Config) LoadTokensFromAzureCLI() error { return fmt.Errorf("Azure CLI Authorization Profile was not found. Please ensure the Azure CLI is installed and then log-in with `az login`.") } - // pull out the TenantID and Subscription ID from the Azure Profile, if not set - if c.SubscriptionID == "" && c.TenantID == "" { - for _, subscription := range profile.Subscriptions { - if subscription.IsDefault { + // pull out the Subscription ID / Tenant ID / Environment from the Azure Profile, if not set + for _, subscription := range profile.Subscriptions { + if subscription.IsDefault { + if c.SubscriptionID == "" { c.SubscriptionID = subscription.ID + } + if c.TenantID == "" { c.TenantID = subscription.TenantID + } + if c.Environment == "" { c.Environment = normalizeEnvironmentName(subscription.EnvironmentName) - break } + break } }
Conditional loading of the Subscription ID / Tenant ID / Environment
terraform-providers_terraform-provider-azurerm
train
go
6abde4112aba298682b676b5388596a2bc260880
diff --git a/lib/dry/initializer/plugins/type_constraint.rb b/lib/dry/initializer/plugins/type_constraint.rb index <HASH>..<HASH> 100644 --- a/lib/dry/initializer/plugins/type_constraint.rb +++ b/lib/dry/initializer/plugins/type_constraint.rb @@ -11,8 +11,10 @@ module Dry::Initializer::Plugins ivar = :"@#{rename}" lambda do |*| value = instance_variable_get(ivar) - return if value == Dry::Initializer::UNDEFINED - instance_variable_set ivar, type.call(value) + + if value != Dry::Initializer::UNDEFINED + instance_variable_set ivar, type.call(value) + end end end end
Do not return from lambda So that MRI won't fail
dry-rb_dry-initializer
train
rb
0113a1a768eb5049ae2fa3fd6bfac2771a5fa317
diff --git a/src/Command/ApiCompare.php b/src/Command/ApiCompare.php index <HASH>..<HASH> 100644 --- a/src/Command/ApiCompare.php +++ b/src/Command/ApiCompare.php @@ -146,9 +146,10 @@ final class ApiCompare extends Command */ private function determineFromRevisionFromRepository(CheckedOutRepository $repository) : Revision { - $tags = $this->grabListOfTagsFromRepository($repository); return $this->parseRevision->fromStringForRepository( - $this->pickFromVersion->forVersions($tags)->getVersionString(), + $this->pickFromVersion->forVersions( + $this->grabListOfTagsFromRepository($repository) + )->getVersionString(), $repository ); }
Don't need that variable lying around there like a waste of bytes
Roave_BackwardCompatibilityCheck
train
php
28e5f3de98b96cfb3283b828fcc0db84f2a53941
diff --git a/test/read.js b/test/read.js index <HASH>..<HASH> 100644 --- a/test/read.js +++ b/test/read.js @@ -66,7 +66,7 @@ tape('read pixels', function (t) { throws('throws if attempt use object to null fbo', [{data: {}}]) // now do it for an uint8 fbo - let fbo = regl.framebuffer({ + var fbo = regl.framebuffer({ width: W, height: H, colorFormat: 'rgba',
test/read.js: Fix to ES6.
regl-project_regl
train
js
4aa1422144462453e91fe2653d5aedc0d6b4e466
diff --git a/soco/services.py b/soco/services.py index <HASH>..<HASH> 100644 --- a/soco/services.py +++ b/soco/services.py @@ -428,7 +428,7 @@ class Service: return (headers, body) def send_command( - self, action, args=None, cache=None, cache_timeout=None, timeout=5, **kwargs + self, action, args=None, cache=None, cache_timeout=None, timeout=20, **kwargs ): # pylint: disable=too-many-arguments """Send a command to a Sonos device. diff --git a/tests/test_services.py b/tests/test_services.py index <HASH>..<HASH> 100644 --- a/tests/test_services.py +++ b/tests/test_services.py @@ -243,7 +243,7 @@ def test_send_command(service): "http://192.168.1.101:1400/Service/Control", headers=mock.ANY, data=DUMMY_VALID_ACTION.encode("utf-8"), - timeout=5, + timeout=20, ) # Now the cache should be primed, so try it again fake_post.reset_mock()
Revert service call timeout reduction (#<I>)
SoCo_SoCo
train
py,py
51af8822385faf03f8e8ed5b30967ccb12196681
diff --git a/core/src/main/java/com/orientechnologies/orient/core/metadata/security/OSecurityShared.java b/core/src/main/java/com/orientechnologies/orient/core/metadata/security/OSecurityShared.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/orientechnologies/orient/core/metadata/security/OSecurityShared.java +++ b/core/src/main/java/com/orientechnologies/orient/core/metadata/security/OSecurityShared.java @@ -37,7 +37,7 @@ import com.orientechnologies.orient.core.storage.OStorageEmbedded; * @author Luca Garulli (l.garulli--at--orientechnologies.com) * */ -public class OSecurityShared { +public class OSecurityShared implements OSecurity { private OSharedResourceExternal lock = new OSharedResourceExternal(); public OUser authenticate(final String iUserName, final String iUserPassword) {
OSecurityShared class now implements OSecurity interface
orientechnologies_orientdb
train
java
46eee806108c39f73115a77da998cf7343e46723
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ setup(name='rhaptos.cnxmlutils', zip_safe=False, install_requires=[ 'setuptools', - 'lxml', + #'lxml', #'argparse', # -*- Extra requirements: -*- ],
revert lxml depend: do it as a system package
openstax_rhaptos.cnxmlutils
train
py