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
50214ec5d6be2b259b4f371dd994a55ef3291f27
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ tests_require = [ "Contexts", "fakeredis", "freezegun", - "HTTPretty", + "HTTPretty==0.8.10", ] extras = {
repin httpretty lost it after the merge
madedotcom_atomicpuppy
train
py
a03f691dd21d33bf897243bd4336b35d507211da
diff --git a/js/coinex.js b/js/coinex.js index <HASH>..<HASH> 100644 --- a/js/coinex.js +++ b/js/coinex.js @@ -3870,9 +3870,9 @@ module.exports = class coinex extends Exchange { path = this.implodeParams (path, params); let url = this.urls['api'][api] + '/' + this.version + '/' + path; let query = this.omit (params, this.extractParams (path)); - this.checkRequiredCredentials (); const nonce = this.nonce ().toString (); if (api === 'perpetualPrivate' || url === 'https://api.coinex.com/perpetual/v1/market/user_deals') { + this.checkRequiredCredentials (); query = this.extend ({ 'access_id': this.apiKey, 'timestamp': nonce, @@ -3895,6 +3895,7 @@ module.exports = class coinex extends Exchange { url += '?' + this.urlencode (query); } } else { + this.checkRequiredCredentials (); query = this.extend ({ 'access_id': this.apiKey, 'tonce': nonce,
check credentials only private #<I>
ccxt_ccxt
train
js
1a73d5932a3f8153a9d1440c931823720e7e6245
diff --git a/sos/plugins/rpm.py b/sos/plugins/rpm.py index <HASH>..<HASH> 100644 --- a/sos/plugins/rpm.py +++ b/sos/plugins/rpm.py @@ -23,7 +23,13 @@ class Rpm(Plugin, RedHatPlugin): option_list = [("rpmq", "queries for package information via rpm -q", "fast", True), ("rpmva", "runs a verify on all packages", "slow", False)] - verify_list = [ 'kernel', 'glibc', 'pam_.*' ] + verify_list = [ + 'kernel', 'glibc', 'initscripts', + 'pam_.*', + 'java.*', 'perl.*', + 'rpm', 'yum', + 'spacewalk.*', + ] def setup(self): self.add_copy_spec("/var/log/rpmpkgs")
Add new patterns to the RPM plug-in verify list
sosreport_sos
train
py
01788211fa3a2817eea3a3a1665e655448a631fb
diff --git a/src/Repository.php b/src/Repository.php index <HASH>..<HASH> 100644 --- a/src/Repository.php +++ b/src/Repository.php @@ -105,12 +105,10 @@ class Repository implements NamespacableInterface, \ArrayAccess */ protected function load($group, $namespace, $collection) { - $mode = $this->mode; - // Is it already loaded? If so, just return it. if (isset($this->items[$collection])) return $this->items[$collection]; - $items = $this->loader->load($mode, $group, $namespace); + $items = $this->loader->load($this->mode, $group, $namespace); return $this->items[$collection] = $items; }
No need to assign mode to a variable in as we only really use it once
encorephp_config
train
php
4e66d85ea9c6967d9336ae66bd74d1ad66923517
diff --git a/src/org/mozilla/javascript/ScriptRuntime.java b/src/org/mozilla/javascript/ScriptRuntime.java index <HASH>..<HASH> 100644 --- a/src/org/mozilla/javascript/ScriptRuntime.java +++ b/src/org/mozilla/javascript/ScriptRuntime.java @@ -640,19 +640,6 @@ public class ScriptRuntime { // A non-hexadecimal, non-infinity number: // just try a normal floating point conversion String sub = s.substring(start, end+1); - if (MSJVM_BUG_WORKAROUNDS) { - // The MS JVM will accept non-conformant strings - // rather than throwing a NumberFormatException - // as it should. - for (int i=sub.length()-1; i >= 0; i--) { - char c = sub.charAt(i); - if (('0' <= c && c <= '9') || c == '.' || - c == 'e' || c == 'E' || - c == '+' || c == '-') - continue; - return NaN; - } - } try { return Double.valueOf(sub).doubleValue(); } catch (NumberFormatException ex) { @@ -683,9 +670,6 @@ public class ScriptRuntime { return result; } - /* Work around Microsoft Java VM bugs. */ - private final static boolean MSJVM_BUG_WORKAROUNDS = true; - public static String escapeString(String s) { return escapeString(s, '"');
Remove ancient workaround for MS JVM bug
mozilla_rhino
train
java
f1bda8c597349e3002921a4db479c4ad5b67cc9c
diff --git a/pygal/test/test_graph.py b/pygal/test/test_graph.py index <HASH>..<HASH> 100644 --- a/pygal/test/test_graph.py +++ b/pygal/test/test_graph.py @@ -19,6 +19,7 @@ import os from pygal import Line import pygal +import uuid def test_multi_render(): @@ -35,7 +36,7 @@ def test_multi_render(): def test_render_to_file(): - file_name = '/tmp/test_graph.svg' + file_name = '/tmp/test_graph-%s.svg' % uuid.uuid4() if os.path.exists(file_name): os.remove(file_name) @@ -53,7 +54,7 @@ def test_render_to_png(): except ImportError: return - file_name = '/tmp/test_graph.png' + file_name = '/tmp/test_graph-%s.png' % uuid.uuid4() if os.path.exists(file_name): os.remove(file_name)
Add uuid to temp
Kozea_pygal
train
py
597f337adf6bff0fe6c85de38fdcac2fde8b583a
diff --git a/sdk/src/com/socialize/util/DefaultAppUtils.java b/sdk/src/com/socialize/util/DefaultAppUtils.java index <HASH>..<HASH> 100644 --- a/sdk/src/com/socialize/util/DefaultAppUtils.java +++ b/sdk/src/com/socialize/util/DefaultAppUtils.java @@ -32,7 +32,6 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.ResolveInfo; -import android.content.res.Resources; import android.telephony.TelephonyManager; import com.socialize.Socialize; import com.socialize.SocializeService; @@ -65,12 +64,11 @@ public class DefaultAppUtils implements AppUtils { // Try to get the app name try { - Resources appR = context.getResources(); - CharSequence txt = appR.getText(appR.getIdentifier("app_name", "string", packageName)); - appName = txt.toString(); - } + PackageManager pkgManager = context.getPackageManager(); + appName = pkgManager.getApplicationLabel(pkgManager.getApplicationInfo(packageName, 0)).toString(); + } catch (Exception e) { - String msg = "Failed to locate app_name String from resources. Make sure this is specified in your AndroidManifest.xml"; + String msg = "Failed to lookup application label. Make sure this is specified in your AndroidManifest.xml"; if(logger != null) { logger.error(msg, e);
Fixed lookup of application name so that it gets it from the PackageManager, instead of assuming it is stored in a String resource called "app_name"
socialize_socialize-sdk-android
train
java
c235b829df569602c303cc48972bcf33ad718a3f
diff --git a/lib/transforms/subsetGoogleFonts.js b/lib/transforms/subsetGoogleFonts.js index <HASH>..<HASH> 100644 --- a/lib/transforms/subsetGoogleFonts.js +++ b/lib/transforms/subsetGoogleFonts.js @@ -472,20 +472,16 @@ module.exports = function (options) { }); } - // Remove references to google font subset CSS files. Now replaced by local bundle - fontStyleSheetRelations.forEach(function (relation) { - if (relation.to.assetGraph) { - assetGraph.removeAsset(relation.to, true); - } - }); - }); - // assetGraph.findAssets({ type: 'Css', url: /subfont\/fonts-/ }).forEach(function (CssBundle) { - // CssBundle.outgoingRelations.forEach(function (fontFaceSrc) { - // fontFaceSrc.hrefType = 'relative'; - // }); - // }); + // Remove references to google font subset CSS files. Now replaced by local bundle + googleFontSubsetCssRelations.forEach(function (deprecatedRelation) { + deprecatedRelation.detach(); + + if (deprecatedRelation.to.assetGraph) { + assetGraph.removeAsset(deprecatedRelation.to); + } + }); }) .queue(function asyncLoadOriginalGoogleFontCss(assetGraph) { var googleFontStylesheets = assetGraph.findAssets({
Only remove relations to original google subset CSS once all work on them has been done
assetgraph_assetgraph
train
js
5a13d9cd26188234fac98ffcb1663dafc4ba5732
diff --git a/lib/acts_as_paranoid/validations.rb b/lib/acts_as_paranoid/validations.rb index <HASH>..<HASH> 100644 --- a/lib/acts_as_paranoid/validations.rb +++ b/lib/acts_as_paranoid/validations.rb @@ -18,7 +18,11 @@ module ActsAsParanoid end relation = build_relation(finder_class, table, attribute, value) - relation = relation.and(table[finder_class.primary_key.to_sym].not_eq(record.send(:id))) if record.persisted? + if record.persisted? + [Array(finder_class.primary_key),Array(record.send(:id))].transpose.each do |pk_key, pk_value| + relation = relation.and(table[pk_key.to_sym].not_eq(pk_value)) + end + end Array.wrap(options[:scope]).each do |scope_item| scope_value = record.send(scope_item)
corrected the uniqueness validation for models with composite primary keys
goncalossilva_acts_as_paranoid
train
rb
4ccd7e799f285dbcab02f27b3429f9de42285b49
diff --git a/lib/themes_for_rails/version.rb b/lib/themes_for_rails/version.rb index <HASH>..<HASH> 100644 --- a/lib/themes_for_rails/version.rb +++ b/lib/themes_for_rails/version.rb @@ -1,4 +1,4 @@ # encoding: utf-8 module ThemesForRails - VERSION = "0.4.3" + VERSION = "0.5.0.pre" end \ No newline at end of file
Bumping version to <I>.pre
lucasefe_themes_for_rails
train
rb
5cbbb91825e973291c0676eb77ea74973e17a541
diff --git a/Swat/SwatTableView.php b/Swat/SwatTableView.php index <HASH>..<HASH> 100644 --- a/Swat/SwatTableView.php +++ b/Swat/SwatTableView.php @@ -899,8 +899,22 @@ class SwatTableView extends SwatControl implements SwatUIParent $tr_tag->close(); // display the row columns - foreach ($this->row_columns as $column) - $column->display($row); + $tr_tag = new SwatHtmlTag('tr'); + $tr_tag->class = $this->getRowClass($row, $count); + + if ($has_message) + $tr_tag->class = $tr_tag->class.' swat-error'; + + $tr_tag->class = + $tr_tag->class.' swat-table-view-row-column'; + + foreach ($this->row_columns as $column) { + if ($column->visible && $column->hasVisibleRenderer($row)) { + $tr_tag->open(); + $column->display($row); + $tr_tag->close(); + } + } $this->displayRowMessages($row);
Table view is now responsible for displaying tr tags on table-view row columns. svn commit r<I>
silverorange_swat
train
php
caa02699d7088bb8df3f88d3507df211de0b64cc
diff --git a/tests/config_test.py b/tests/config_test.py index <HASH>..<HASH> 100644 --- a/tests/config_test.py +++ b/tests/config_test.py @@ -104,19 +104,25 @@ class TestConfigurationNamespace(object): def test_get_config_dict(self): self.namespace['one.two.three.four'] = 5 - self.namespace['a.b'] = 'c' + self.namespace['one.two.three.five'] = 'six' + self.namespace['one.b.cats'] = [1, 2, 3] + self.namespace['a.two'] = 'c' self.namespace['first'] = True d = self.namespace.get_config_dict() assert_equal(d, { 'one': { + 'b': { + 'cats': [1, 2, 3], + }, 'two': { 'three': { 'four': 5, + 'five': 'six', }, }, }, 'a': { - 'b': 'c', + 'two': 'c', }, 'first': True, })
Add overlapping keys to config_test.py::TestConfigurationNamespace::test_get_config_dict to ensure non-clobbery
dnephin_PyStaticConfiguration
train
py
893e00c468d5a9021726ed4cff05552422477a8e
diff --git a/jaraco/itertools.py b/jaraco/itertools.py index <HASH>..<HASH> 100644 --- a/jaraco/itertools.py +++ b/jaraco/itertools.py @@ -711,9 +711,12 @@ def takewhile_peek(predicate, iterable): [4] """ while True: - if not predicate(iterable.peek()): + try: + if not predicate(iterable.peek()): + break + yield next(iterable) + except StopIteration: break - yield next(iterable) def first(iterable, *args):
Fix error about StopIteration raised in generator.
jaraco_jaraco.itertools
train
py
e7d39b4ef8508062e0837b54c564e72a259f22b9
diff --git a/lib/slather/coverage_file.rb b/lib/slather/coverage_file.rb index <HASH>..<HASH> 100644 --- a/lib/slather/coverage_file.rb +++ b/lib/slather/coverage_file.rb @@ -31,7 +31,7 @@ module Slather def gcov_data @gcov_data ||= begin - gcov_output = `gcov #{source_file_pathname} --object-directory #{gcno_file_pathname.parent}` + gcov_output = `gcov "#{source_file_pathname}" --object-directory "#{gcno_file_pathname.parent}"` # Sometimes gcov makes gcov files for Cocoa Touch classes, like NSRange. Ignore and delete later. gcov_files_created = gcov_output.scan(/creating '(.+\..+\.gcov)'/)
Wrap paths in quotes incase they contain spaces
SlatherOrg_slather
train
rb
36a349a93ccfa5afa68b51214e1d6582cb1f5383
diff --git a/wkhtmltopdf/__init__.py b/wkhtmltopdf/__init__.py index <HASH>..<HASH> 100644 --- a/wkhtmltopdf/__init__.py +++ b/wkhtmltopdf/__init__.py @@ -3,5 +3,4 @@ if 'DJANGO_SETTINGS_MODULE' in os.environ: from .utils import * __author__ = 'Incuna Ltd' -__version__ = '0.3' - +__version__ = '1.0-rc1'
Update version to <I>-rc1.
incuna_django-wkhtmltopdf
train
py
22369507e948428a2cc0ca0a2f5d5a33b45a8762
diff --git a/packages/ember-routing/lib/system/route.js b/packages/ember-routing/lib/system/route.js index <HASH>..<HASH> 100644 --- a/packages/ember-routing/lib/system/route.js +++ b/packages/ember-routing/lib/system/route.js @@ -1878,7 +1878,8 @@ let Route = EmberObject.extend(ActionHandler, Evented, { The string values provided for the template name, and controller will eventually pass through to the resolver for lookup. See Ember.Resolver for how these are mapped to JavaScript objects in your - application. + application. The template to render into needs to be related to either the + current route or one of its ancestors. Not all options need to be passed to `render`. Default values will be used based on the name of the route specified in the router or the Route's
[DOC beta] Improve `Route#render` documentation This PR makes explicit that render only accepts a live template as its `into` option. Fix #<I>
emberjs_ember.js
train
js
947f5929fd18da616e6ee3301cca29011f82d434
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ setup( author='Blockstack.org', author_email='support@blockstack.org', description='Name registrations on the Bitcoin blockchain with external storage', - long_description=README, + # long_description=README, keywords='blockchain bitcoin btc cryptocurrency name key value store data', packages=find_packages(), scripts=['bin/blockstack-server', 'bin/blockstack-core', 'bin/blockstack-snapshots'],
disable long_description in setup.py since it inteferes with twine
blockstack_blockstack-core
train
py
c02cd52208d53cba0fb0498b6ecad50f78a4333d
diff --git a/plugin/kubernetes/kubernetes.go b/plugin/kubernetes/kubernetes.go index <HASH>..<HASH> 100644 --- a/plugin/kubernetes/kubernetes.go +++ b/plugin/kubernetes/kubernetes.go @@ -284,8 +284,6 @@ func (k *Kubernetes) InitKubeCache(ctx context.Context) (onStart func() error, o checkSyncTicker := time.NewTicker(100 * time.Millisecond) defer checkSyncTicker.Stop() for { - timeoutTicker.Reset(timeout) - logTicker.Reset(logDelay) select { case <-checkSyncTicker.C: if k.APIConn.HasSynced() {
fix k8s start up timeout ticker (#<I>)
coredns_coredns
train
go
fd475d1b3fa869a77cf3be7f506afabcf7138ee7
diff --git a/src/html/js/sg.js b/src/html/js/sg.js index <HASH>..<HASH> 100644 --- a/src/html/js/sg.js +++ b/src/html/js/sg.js @@ -39,20 +39,18 @@ * ==================================================== */ let toggleSgMenuBar = function() { - const navCookie = 'sgNavActive=false;path=/'; - if (sgNavActive) { this.classList.add('is-active'); sgNav.classList.add('is-hidden'); sgNavActive = false; - document.cookie = navCookie; + document.cookie = 'sgNavActive=false;path=/'; } else { this.classList.remove('is-active'); sgNav.classList.remove('is-hidden'); sgNavActive = true; - document.cookie = navCookie; + document.cookie = 'sgNavActive=true;path=/'; } for (let i = 0; i < sgNavBtn.length; i++) {
Constant for cookie name was a fail D:
pangolinjs_core
train
js
62f214b5355db1b0b3b6a0527c3b29b1f0a9314a
diff --git a/tests/unit/states/boto_elb_test.py b/tests/unit/states/boto_elb_test.py index <HASH>..<HASH> 100644 --- a/tests/unit/states/boto_elb_test.py +++ b/tests/unit/states/boto_elb_test.py @@ -97,21 +97,13 @@ class BotoElbTestCase(TestCase): self.assertDictEqual(boto_elb.present (name, listeners), ret) - with patch.object(boto_elb, '_cnames_present', + with patch.object(boto_elb, '_alarms_present', mock_elb_present): - comt = (' ') - ret.update({'comment': comt}) + ret.update({'result': True}) self.assertDictEqual(boto_elb.present (name, listeners, alarms=alarms), ret) - with patch.object(boto_elb, '_alarms_present', - mock_elb_present): - ret.update({'result': True}) - self.assertDictEqual(boto_elb.present - (name, listeners, - alarms=alarms), ret) - # 'absent' function tests: 1 def test_absent(self):
Remove cnames_present test
saltstack_salt
train
py
1ae244f75a383b3d9fc397dac95a9faede03484b
diff --git a/decl.go b/decl.go index <HASH>..<HASH> 100644 --- a/decl.go +++ b/decl.go @@ -441,6 +441,8 @@ func checkForBuiltinFuncs(typ *ast.Ident, c *ast.CallExpr, scope *Scope) (ast.Ex return e, scope case "make": return c.Args[0], scope + case "append": + return c.Args[0], scope case "cmplx": return ast.NewIdent("complex"), universeScope case "closed": @@ -1270,6 +1272,7 @@ func init() { u.addNamedDecl(NewDeclTyped("iota", DECL_CONST, t, u)) u.addNamedDecl(NewDeclTyped("nil", DECL_CONST, t, u)) + u.addNamedDecl(NewDeclTypedNamed("append", DECL_FUNC, "func([]type, ...type) []type", u)) u.addNamedDecl(NewDeclTypedNamed("cap", DECL_FUNC, "func(container) int", u)) u.addNamedDecl(NewDeclTypedNamed("close", DECL_FUNC, "func(channel)", u)) u.addNamedDecl(NewDeclTypedNamed("closed", DECL_FUNC, "func(channel) bool", u))
Add support for built-in 'append'.
nsf_gocode
train
go
1d2e8ae6f3865567e5c404840405f402477741d6
diff --git a/src/components/SurveyForm/SurveyForm.js b/src/components/SurveyForm/SurveyForm.js index <HASH>..<HASH> 100755 --- a/src/components/SurveyForm/SurveyForm.js +++ b/src/components/SurveyForm/SurveyForm.js @@ -29,7 +29,7 @@ function asyncValidate(data) { export default class SurveyForm extends Component { static propTypes = { - active: PropTypes.bool.isRequired, + active: PropTypes.string, asyncValidating: PropTypes.bool.isRequired, fields: PropTypes.object.isRequired, dirty: PropTypes.bool.isRequired,
Fix Survey Form (active prop type) The active propType should be a string a not required
bdefore_universal-redux
train
js
e856623189f04d7a989037f07d67c8118094ee55
diff --git a/src/main/java/org/graylog2/indexer/EmbeddedElasticSearchClient.java b/src/main/java/org/graylog2/indexer/EmbeddedElasticSearchClient.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/graylog2/indexer/EmbeddedElasticSearchClient.java +++ b/src/main/java/org/graylog2/indexer/EmbeddedElasticSearchClient.java @@ -340,6 +340,7 @@ public class EmbeddedElasticSearchClient { // Sorry if this should ever go mad. Delete the index! deleteIndex(indexName); + server.getMongoBridge().removeIndexDateRange(indexName); } }
Also update index ranges after retention cleaning
Graylog2_graylog2-server
train
java
ba319199c1fbe81f6846abca98b6989891a2a34f
diff --git a/apitools/gen/client_generation_test.py b/apitools/gen/client_generation_test.py index <HASH>..<HASH> 100644 --- a/apitools/gen/client_generation_test.py +++ b/apitools/gen/client_generation_test.py @@ -7,8 +7,7 @@ import shutil import subprocess import sys import tempfile - -from google.apputils import basetest as googletest +import unittest from apitools.gen import util @@ -31,7 +30,7 @@ def TempDir(): shutil.rmtree(path) -class ClientGenerationTest(googletest.TestCase): +class ClientGenerationTest(unittest.TestCase): def setUp(self): super(ClientGenerationTest, self).setUp() @@ -73,4 +72,4 @@ class ClientGenerationTest(googletest.TestCase): if __name__ == '__main__': - googletest.main() + unittest.main()
Update one test to use unittest. I'm likely to do this for all tests, but this one's a start.
google_apitools
train
py
7e5ad0ee0922796c2ce34ceb31b988bc28697360
diff --git a/gulpfile.babel.js b/gulpfile.babel.js index <HASH>..<HASH> 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -9,7 +9,7 @@ import WebpackDevServer from 'webpack-dev-server'; gulp.task('default', ['webpack']); gulp.task('babel', () => { - return gulp.src(['src/*.js','src/*/*.js','example/*.js']) + return gulp.src(['src/*.js','src/*/*.js']) .pipe(babel()) .pipe(gulp.dest('target')); }); diff --git a/webpack.config.babel.js b/webpack.config.babel.js index <HASH>..<HASH> 100644 --- a/webpack.config.babel.js +++ b/webpack.config.babel.js @@ -2,7 +2,7 @@ import path from 'path'; module.exports = { entry: { - index: './example/index.js' + index: './src/index.js' }, module: { loaders: [
Updated webpack and gulp config files
iotaledger_curl.lib.js
train
js,js
6bf613ca82b9e7e45f48ce40612a11af27c01a75
diff --git a/webpack.config.js b/webpack.config.js index <HASH>..<HASH> 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,6 +2,8 @@ const webpack = require("webpack"); const path = require("path"); const env = require("yargs").argv.env; // use --env with webpack 2 const ClosureCompilerPlugin = require("webpack-closure-compiler"); +const pkg = require('./package.json'); +const year = new Date().getFullYear(); let libraryName = "luminous"; @@ -45,7 +47,12 @@ function buildWithEnv(mode, outputFile) { }, test: /^(?!.*tests\.webpack).*$/, concurrency: 3 - }) + }), + new webpack.BannerPlugin({ + banner:`Luminous v${pkg.version} +Copyright 2015-${year}, Zebrafish Labs +Licensed under BSD-2 (https://github.com/imgix/luminous/blob/main/LICENSE.md)` + }), ] };
build(webpack): prepend license banner in minified JS files
imgix_luminous
train
js
622d31ca61ac514a3d9d83c72a3cb70a6a5b2643
diff --git a/intranet/settings/__init__.py b/intranet/settings/__init__.py index <HASH>..<HASH> 100644 --- a/intranet/settings/__init__.py +++ b/intranet/settings/__init__.py @@ -469,7 +469,7 @@ REST_FRAMEWORK = { "DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.PageNumberPagination", "PAGE_SIZE": 50, "DEFAULT_AUTHENTICATION_CLASSES": - ("intranet.apps.api.authentication.ApiBasicAuthentication", "rest_framework.authentication.SessionAuthentication", + ("intranet.apps.api.authentication.ApiBasicAuthentication", "oauth2_provider.ext.rest_framework.OAuth2Authentication"), "DEFAULT_PERMISSION_CLASSES": ("rest_framework.permissions.IsAuthenticated",) }
Temporary Fix: Disable Session Auth for API
tjcsl_ion
train
py
154244c3eeb949568572b5e08d8c0ac0a2039121
diff --git a/tests/test_websocket.py b/tests/test_websocket.py index <HASH>..<HASH> 100644 --- a/tests/test_websocket.py +++ b/tests/test_websocket.py @@ -127,7 +127,6 @@ class TestWebsocketClient(unittest.TestCase): self.assertEqual('Ontology Network ONT Token', response['Description']) hex_contract_address = '1ddbb682743e9d9e2b71ff419e97a9358c5c4ee9' response = await sdk.websocket.get_contract(hex_contract_address) - self.assertEqual(True, response['NeedStorage']) self.assertEqual('DINGXIN', response['Author']) self.assertEqual('A sample of OEP4', response['Description']) await sdk.websocket.close_connect()
remove unsed keyword (#<I>) * fix bug * remove unsed keyword
ontio_ontology-python-sdk
train
py
e46ef64067204f0e5209886fcffae2bb2353b9df
diff --git a/p2p/host/peerstore/addr_manager_ds.go b/p2p/host/peerstore/addr_manager_ds.go index <HASH>..<HASH> 100644 --- a/p2p/host/peerstore/addr_manager_ds.go +++ b/p2p/host/peerstore/addr_manager_ds.go @@ -272,8 +272,8 @@ func newTTLManager(parent context.Context, d ds.Datastore, tick time.Duration) * // To be called by TTL manager's coroutine only. func (mgr *ttlmanager) tick() { - mgr.RLock() - defer mgr.RUnlock() + mgr.Lock() + defer mgr.Unlock() now := time.Now() batch, err := mgr.ds.Batch()
Acquire full lock when ticking ttlmanager
libp2p_go-libp2p
train
go
85baeb7cb3cf43778c011e50ad3c3d40bdf882f4
diff --git a/mutagen/musepack.py b/mutagen/musepack.py index <HASH>..<HASH> 100644 --- a/mutagen/musepack.py +++ b/mutagen/musepack.py @@ -188,7 +188,7 @@ class MusepackInfo(StreamInfo): remaining_size -= l1 + l2 data = fileobj.read(remaining_size) - if len(data) != remaining_size: + if len(data) != remaining_size or len(data) < 2: raise MusepackHeaderError("SH packet ended unexpectedly.") self.sample_rate = RATES[bytearray(data)[0] >> 5] self.channels = (bytearray(data)[1] >> 4) + 1
musepack: handle truncated stream header
quodlibet_mutagen
train
py
90d9a6a51340094cdf17a8d80ed4952299929ea2
diff --git a/lib/ErrorHandler.js b/lib/ErrorHandler.js index <HASH>..<HASH> 100644 --- a/lib/ErrorHandler.js +++ b/lib/ErrorHandler.js @@ -1,7 +1,8 @@ module.exports = (error, req, res, next) => { const details = reason(error); + console.error(details); - if (error.code && error.code >= 300 && error.code <= 500) + if (error.code) return res.status(error.code).send(details); if (process.env.NODE_ENV !== 'production') {
fixed error handler where standard wasn't use properly
julien-sarazin_idylle
train
js
c4b20042cdfbfdfeee8b82d3d89fcc8f677c4c93
diff --git a/languagetool-office-extension/src/main/java/org/languagetool/openoffice/ResultCache.java b/languagetool-office-extension/src/main/java/org/languagetool/openoffice/ResultCache.java index <HASH>..<HASH> 100644 --- a/languagetool-office-extension/src/main/java/org/languagetool/openoffice/ResultCache.java +++ b/languagetool-office-extension/src/main/java/org/languagetool/openoffice/ResultCache.java @@ -82,11 +82,11 @@ class ResultCache { Map<Integer, CacheSentenceEntries> tmpEntries = entries; entries = new HashMap<>(); - for(int i : entries.keySet()) { + for(int i : tmpEntries.keySet()) { if(i > lastParagraph) { - entries.put(i + shift, entries.get(i)); + entries.put(i + shift, tmpEntries.get(i)); } else { - entries.put(i, entries.get(i)); + entries.put(i, tmpEntries.get(i)); } } }
[LO extension] fixed bug in cache management
languagetool-org_languagetool
train
java
f9fedaeba693a2be8cfa8e09dcfbf909ff8b18b9
diff --git a/examples/with-redux-saga/store.js b/examples/with-redux-saga/store.js index <HASH>..<HASH> 100644 --- a/examples/with-redux-saga/store.js +++ b/examples/with-redux-saga/store.js @@ -1,11 +1,9 @@ -import { createStore, applyMiddleware } from 'redux' +import { applyMiddleware, createStore } from 'redux' import createSagaMiddleware from 'redux-saga' import rootReducer, { exampleInitialState } from './reducer' import rootSaga from './saga' -const sagaMiddleware = createSagaMiddleware() - const bindMiddleware = middleware => { if (process.env.NODE_ENV !== 'production') { const { composeWithDevTools } = require('redux-devtools-extension') @@ -15,17 +13,15 @@ const bindMiddleware = middleware => { } function configureStore (initialState = exampleInitialState) { + const sagaMiddleware = createSagaMiddleware() const store = createStore( rootReducer, initialState, bindMiddleware([sagaMiddleware]) ) - store.runSagaTask = () => { - store.sagaTask = sagaMiddleware.run(rootSaga) - } + store.sagaTask = sagaMiddleware.run(rootSaga) - store.runSagaTask() return store }
recreate stdChannel (or saga middleware). (#<I>)
zeit_next.js
train
js
b3d98c4a369e50eddb0411af9174b232f8b6ad28
diff --git a/tornado/httpserver.py b/tornado/httpserver.py index <HASH>..<HASH> 100644 --- a/tornado/httpserver.py +++ b/tornado/httpserver.py @@ -113,6 +113,7 @@ class HTTPServer(object): self.xheaders = xheaders self.ssl_options = ssl_options self._socket = None + self._started = False def listen(self, port, address=""): """Binds to the given port and starts the server in a single process. @@ -156,6 +157,8 @@ class HTTPServer(object): Since we run use processes and not threads, there is no shared memory between any server code. """ + assert not self._started + self._started = True if num_processes is None: # Use sysconf to detect the number of CPUs (cores) try:
Add basic error checking so you can't add a server to the IOLoop twice
tornadoweb_tornado
train
py
0e951173a59a8006ba9ca9c8b74901bd8132903a
diff --git a/client/state/sites/actions.js b/client/state/sites/actions.js index <HASH>..<HASH> 100644 --- a/client/state/sites/actions.js +++ b/client/state/sites/actions.js @@ -15,6 +15,10 @@ import { SITES_REQUEST_SUCCESS, SITES_REQUEST_FAILURE } from 'state/action-types'; +import { + bumpStat, + recordTracksEvent, +} from 'state/analytics/actions'; import { omit } from 'lodash'; /** @@ -112,12 +116,18 @@ export function setFrontPage( siteId, pageId ) { }; return wpcom.undocumented().setSiteHomepageSettings( siteId, requestData ).then( () => { + dispatch( recordTracksEvent( 'calypso_front_page_set', { + siteId, + pageId, + } ) ); + dispatch( bumpStat( 'calypso_front_page_set', 'success' ) ); dispatch( { type: SITE_FRONT_PAGE_SET_SUCCESS, siteId, pageId } ); } ).catch( ( error ) => { + dispatch( bumpStat( 'calypso_front_page_set', 'failure' ) ); dispatch( { type: SITE_FRONT_PAGE_SET_FAILURE, siteId,
Pages: record Tracks and bump stat on homepage change (#<I>)
Automattic_wp-calypso
train
js
e7b7b77efc6e3e8ba99cd7028a7f51ce938a87ae
diff --git a/codec-stomp/src/main/java/io/netty/handler/codec/stomp/DefaultStompFrame.java b/codec-stomp/src/main/java/io/netty/handler/codec/stomp/DefaultStompFrame.java index <HASH>..<HASH> 100644 --- a/codec-stomp/src/main/java/io/netty/handler/codec/stomp/DefaultStompFrame.java +++ b/codec-stomp/src/main/java/io/netty/handler/codec/stomp/DefaultStompFrame.java @@ -94,7 +94,7 @@ public class DefaultStompFrame extends DefaultStompHeadersSubframe implements St @Override public String toString() { - return "DefaultFullStompFrame{" + + return "DefaultStompFrame{" + "command=" + command + ", headers=" + headers + ", content=" + content.toString(CharsetUtil.UTF_8) +
[#<I>] Fix typo in DefaultStompFrame.toString() method. Motivation: DefaultStompFrame.toString() implementations returned a String that contained DefaultFullStompFrame. Modifications: Replace DefaultFullStompFrame with DefaultStompFrame. Result: Less confusing and more correct return value of toString()
netty_netty
train
java
b3e821c4d2e4c61496a281438b8213c145d57a34
diff --git a/lnwallet/wallet.go b/lnwallet/wallet.go index <HASH>..<HASH> 100644 --- a/lnwallet/wallet.go +++ b/lnwallet/wallet.go @@ -189,7 +189,7 @@ type addCounterPartySigsMsg struct { type LightningWallet struct { // This mutex is to be held when generating external keys to be used // as multi-sig, and commitment keys within the channel. - keyGenMtx sync.RWMutex + KeyGenMtx sync.RWMutex // This mutex MUST be held when performing coin selection in order to // avoid inadvertently creating multiple funding transaction which @@ -940,8 +940,8 @@ func (l *LightningWallet) handleFundingCounterPartySigs(msg *addCounterPartySigs // transaction's outputs. // TODO(roasbeef): on shutdown, write state of pending keys, then read back? func (l *LightningWallet) getNextRawKey() (*btcec.PrivateKey, error) { - l.keyGenMtx.Lock() - defer l.keyGenMtx.Unlock() + l.KeyGenMtx.Lock() + defer l.KeyGenMtx.Unlock() nextAddr, err := l.Manager.NextExternalAddresses(waddrmgr.DefaultAccountNum, 1) if err != nil {
lnwallet: make KeyGenMtx public, roc server needs to synchronize
lightningnetwork_lnd
train
go
6b609aff5ebcda952dcee614b23a518cbe48de03
diff --git a/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ViewAssets.java b/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ViewAssets.java index <HASH>..<HASH> 100644 --- a/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ViewAssets.java +++ b/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ViewAssets.java @@ -39,7 +39,7 @@ public class ViewAssets { */ @GET @Path("common.css") - @Produces("text/css") + @Produces({"text/css", "*/*"}) public Response getViewCss() { return ok().entity(this.getClass().getResourceAsStream(StreamingBaseHtmlProvider.commonCssLocation)).build(); } @@ -50,7 +50,7 @@ public class ViewAssets { */ @GET @Path("common.js") - @Produces("text/javascript") + @Produces({"text/javascript", "*/*"}) public Response getViewJs() { return ok().entity(this.getClass().getResourceAsStream(StreamingBaseHtmlProvider.commonJsLocation)).build(); }
Added support for wildcard accept headers to accomodate deficiencies in HtmlUnit web client.
fcrepo4_fcrepo4
train
java
73f272f0f905a997356c46d23d1937cfc04d45e1
diff --git a/xchange-bitbay/src/main/java/org/knowm/xchange/bitbay/BitbayExchange.java b/xchange-bitbay/src/main/java/org/knowm/xchange/bitbay/BitbayExchange.java index <HASH>..<HASH> 100644 --- a/xchange-bitbay/src/main/java/org/knowm/xchange/bitbay/BitbayExchange.java +++ b/xchange-bitbay/src/main/java/org/knowm/xchange/bitbay/BitbayExchange.java @@ -16,8 +16,8 @@ public class BitbayExchange extends BaseExchange implements Exchange { public ExchangeSpecification getDefaultExchangeSpecification() { ExchangeSpecification exchangeSpecification = new ExchangeSpecification(this.getClass().getCanonicalName()); - exchangeSpecification.setSslUri("https://market.bitbay.pl/API/Public"); - exchangeSpecification.setHost("bitbay.pl"); + exchangeSpecification.setSslUri("https://bitbay.net/API/Public"); + exchangeSpecification.setHost("bitbay.net"); exchangeSpecification.setPort(80); exchangeSpecification.setExchangeName("Bitbay"); exchangeSpecification.setExchangeDescription("Bitbay is a Bitcoin exchange based in Katowice, Poland.");
BitBay API host name changed from <URL>
knowm_XChange
train
java
232049b04f79794c1fbd938228ba6750dff5ce3d
diff --git a/lib/rails_sortable/version.rb b/lib/rails_sortable/version.rb index <HASH>..<HASH> 100644 --- a/lib/rails_sortable/version.rb +++ b/lib/rails_sortable/version.rb @@ -1,3 +1,3 @@ module RailsSortable - VERSION = '1.1.1' + VERSION = '1.1.2' end
Bump up version to <I>
itmammoth_rails_sortable
train
rb
ee5e6c418d14c94a2b269a6dc159ed239bde85d0
diff --git a/src/network/index.js b/src/network/index.js index <HASH>..<HASH> 100644 --- a/src/network/index.js +++ b/src/network/index.js @@ -47,14 +47,12 @@ module.exports = class Network { } _onConnection (conn) { + log('connected') pull( conn, lp.decode(), - pull.collect((err, msgs) => msgs.forEach((data) => { + pull.through((data) => { log('raw message', data) - if (err) { - return this.bitswap._receiveError(err) - } let msg try { msg = Message.fromProto(data) @@ -67,7 +65,12 @@ module.exports = class Network { } this.bitswap._receiveMessage(peerInfo.id, msg) }) - })) + }), + pull.onEnd((err) => { + if (err) { + return this.bitswap._receiveError(err) + } + }) ) } @@ -105,6 +108,7 @@ module.exports = class Network { } this.libp2p.dialByPeerInfo(peerInfo, PROTOCOL_IDENTIFIER, (err, conn) => { + log('dialed %s', peerInfo.id.toB58String(), err) if (err) { return cb(err) }
fix(network): correct msg processing
ipfs_js-ipfs-bitswap
train
js
9cb6359de3f6a2a9889f86bd943d7641f585c75b
diff --git a/test/AbstractContextTest.php b/test/AbstractContextTest.php index <HASH>..<HASH> 100644 --- a/test/AbstractContextTest.php +++ b/test/AbstractContextTest.php @@ -39,7 +39,7 @@ abstract class AbstractContextTest extends TestCase { $context->start(); - $this->assertRunTimeLessThan([$context, 'kill'], 100); + $this->assertRunTimeLessThan([$context, 'kill'], 250); $this->assertFalse($context->isRunning()); } diff --git a/test/Worker/AbstractWorkerTest.php b/test/Worker/AbstractWorkerTest.php index <HASH>..<HASH> 100644 --- a/test/Worker/AbstractWorkerTest.php +++ b/test/Worker/AbstractWorkerTest.php @@ -81,7 +81,7 @@ abstract class AbstractWorkerTest extends TestCase { $worker = $this->createWorker(); $worker->start(); - $this->assertRunTimeLessThan([$worker, 'kill'], 200); + $this->assertRunTimeLessThan([$worker, 'kill'], 250); $this->assertFalse($worker->isRunning()); } }
Allow more time for kill Threads only check once every <I> ms.
amphp_parallel
train
php,php
17e445ada9f1822a26c8af149d49ddaaf3ad7f05
diff --git a/Eloquent/Builder.php b/Eloquent/Builder.php index <HASH>..<HASH> 100755 --- a/Eloquent/Builder.php +++ b/Eloquent/Builder.php @@ -1237,6 +1237,19 @@ class Builder } /** + * Set the relationships that should be eager loaded while removing any previously added eager loading specifications. + * + * @param mixed $relations + * @return $this + */ + public function withOnly($relations) + { + $this->eagerLoad = []; + + return $this->with($relations); + } + + /** * Create a new instance of the model being queried. * * @param array $attributes
[8.x] Add withOnly method (#<I>) * Added in new withOnly method + tests * Refactored function * Update Builder.php
illuminate_database
train
php
f9a92f6ccd88316720339808c27e2379d46ec48b
diff --git a/src/connection.js b/src/connection.js index <HASH>..<HASH> 100644 --- a/src/connection.js +++ b/src/connection.js @@ -1542,7 +1542,7 @@ export class Connection { const id = ++this._slotSubscriptionCounter; this._slotSubscriptions[id] = { callback, - subscriptionId: id, + subscriptionId: null, }; this._updateSubscriptions(); return id;
fix: broken rpc slot change subscription
solana-labs_solana-web3.js
train
js
8d6c42c15b760aaaf01834aab7f1b8f560a6d89c
diff --git a/spec/mongoid/criteria_spec.rb b/spec/mongoid/criteria_spec.rb index <HASH>..<HASH> 100644 --- a/spec/mongoid/criteria_spec.rb +++ b/spec/mongoid/criteria_spec.rb @@ -2222,7 +2222,7 @@ describe Mongoid::Criteria do context "when the criteria has limiting options" do let!(:criteria) do - Game.includes(:person).asc(:_id).limit(1).entries + Game.where(id: game_one.id).includes(:person).asc(:_id).limit(1).entries end it "returns the correct documents" do
Ensure we get back the exact game
mongodb_mongoid
train
rb
b670248677bd2732328dd4c3c1bab974a9195c63
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -33,6 +33,14 @@ setup( 'jinja2', 'arrow' ], + entry_points={ + 'cookiecutter_ext': [ + 'TimeExtension = jinja2_time:TimeExtension', + ], + 'cookiecutter_filter': [ + 'year = jinja2_time:year', + ], + }, classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers',
Set up entry_points for cookiecutter
hackebrot_jinja2-time
train
py
be61c6955c881457b4c6c67acd80508a50a0c98a
diff --git a/etc/config.php b/etc/config.php index <HASH>..<HASH> 100644 --- a/etc/config.php +++ b/etc/config.php @@ -14,7 +14,7 @@ $conf['db']['default']['charset'] = 'utf8'; $conf['db']['tests'] = $conf['db']['default']; $conf['db']['tests']['database'] = 'psc-cms_tests'; -if (\Psc\PSC::isTravis()) { +if (getenv('TRAVIS') === 'true') { $conf['db']['default']['user'] = $conf['db']['tests']['user'] = 'root'; $conf['db']['default']['password'] = $conf['db']['tests']['password'] = ''; }
make config loadable by webforge
webforge-labs_psc-cms
train
php
0127846b3825133b0280d4f246ac88a8c2327a73
diff --git a/mixins/sync.js b/mixins/sync.js index <HASH>..<HASH> 100644 --- a/mixins/sync.js +++ b/mixins/sync.js @@ -41,7 +41,7 @@ function sync(local, remote, ref, depth, callback) { if (typeof type !== "string") throw new TypeError("type must be string"); if (typeof hash !== "string") throw new TypeError("hash must be string"); if (hasCache[hash]) return callback(null, true); - local.hasHash(type, hash, function (err, has) { + local.hasHash(hash, function (err, has) { if (err) return callback(err); hasCache[hash] = has; callback(null, has);
hasHash no longer has type argument
creationix_js-git
train
js
5f4dbd2de56d242b831132ea16a0663b206ca9fd
diff --git a/embed_video/backends.py b/embed_video/backends.py index <HASH>..<HASH> 100644 --- a/embed_video/backends.py +++ b/embed_video/backends.py @@ -356,7 +356,7 @@ class VimeoBackend(VideoBackend): re_detect = re.compile(r"^((http(s)?:)?//)?(www\.)?(player\.)?vimeo\.com/.*", re.I) re_code = re.compile( - r"""vimeo\.com/(video/)?(channels/(.*/)?)?((.+)/review/?)?(?P<code>[0-9]+)""", re.I + r"""vimeo\.com/(video/)?(channels/(.*/)?)?((.+)/review/)?(?P<code>[0-9]+)""", re.I ) pattern_url = "{protocol}://player.vimeo.com/video/{code}" pattern_info = "{protocol}://vimeo.com/api/v2/video/{code}.json"
Make trailing slash after 'review' in Vimeo URL pattern required.
jazzband_django-embed-video
train
py
d51046339fae812ad300c4cf881a6db1f3039bc5
diff --git a/support/test-runner/public/javascript/runner.js b/support/test-runner/public/javascript/runner.js index <HASH>..<HASH> 100644 --- a/support/test-runner/public/javascript/runner.js +++ b/support/test-runner/public/javascript/runner.js @@ -1,6 +1,6 @@ // useful globals -var currentSuite, currentCase; +var currentSuite, currentCase, testsList; // loads common.js module function load (test, fn) { @@ -21,7 +21,8 @@ function run () { if (tests.length) { // load dom - $('body').append('<ul class="test-list">'); + testsList = $('<ul class="test-list">'); + $('body').append(testsList) // run suites suite(tests[i], function check (res) { @@ -64,7 +65,7 @@ function suite (file, fn) { $('<span class="name">').append( $('<a>').attr('href', '/test/' + file).text(file) ) - ).appendTo('.test-list'); + ).appendTo(testsList); // dynamically load module load(file, function (suite) {
Fixed test runner on IE6/7. Odd jquery bug
tsjing_socket.io-client
train
js
57143a9f78bab19e49fbf8aa691149f3adf2503d
diff --git a/test/macros/net.js b/test/macros/net.js index <HASH>..<HASH> 100644 --- a/test/macros/net.js +++ b/test/macros/net.js @@ -61,6 +61,9 @@ exports.shouldSendData = function (options, nested) { if (nested) { Object.keys(nested).forEach(function (vow) { + if(!context.hasOwnProperty('after data is sent')) { + context['after data is sent'] = {}; + } context['after data is sent'][vow] = nested[vow]; }); } @@ -201,4 +204,4 @@ exports.shouldDuplexBoth = function (options, nested) { producers: options.producers }, nested) }; -}; \ No newline at end of file +};
[fix] Ensure key exists before attempting to add methods to object in should send data macro
nodejitsu_godot
train
js
7120bb59d165103d8f2cffd0726709591b572174
diff --git a/src/OpenSSL/_util.py b/src/OpenSSL/_util.py index <HASH>..<HASH> 100644 --- a/src/OpenSSL/_util.py +++ b/src/OpenSSL/_util.py @@ -1,3 +1,4 @@ +import os import sys import warnings @@ -89,19 +90,19 @@ def native(s): def path_string(s): """ - Convert a Python string to a :py:class:`bytes` string identifying the same + Convert a Python path to a :py:class:`bytes` string identifying the same path and which can be passed into an OpenSSL API accepting a filename. - :param s: An instance of :py:class:`bytes` or :py:class:`unicode`. + :param s: A path (valid for os.fspath). :return: An instance of :py:class:`bytes`. """ - if isinstance(s, bytes): - return s - elif isinstance(s, str): - return s.encode(sys.getfilesystemencoding()) + strpath = os.fspath(s) # returns str or bytes + + if isinstance(strpath, str): + return strpath.encode(sys.getfilesystemencoding()) else: - raise TypeError("Path must be represented as bytes or unicode string") + return strpath def byte_string(s):
Accept pathlib.Path as a valid path (#<I>) And also whatever supports the protocol. Way more pythonic now!
pyca_pyopenssl
train
py
27ed16956b2469b6d74b8313f808912ea440667c
diff --git a/opal/action_pack/action_controller.rb b/opal/action_pack/action_controller.rb index <HASH>..<HASH> 100644 --- a/opal/action_pack/action_controller.rb +++ b/opal/action_pack/action_controller.rb @@ -82,6 +82,7 @@ class ActionController @__locals = name_or_options[:locals] @renderer.locals = name_or_options[:locals] build_render_path(top_level) + # Application.instance.render_is_done(false) else # puts "in render: is NOT top_level" build_render_path("dummy") @@ -121,7 +122,12 @@ class ActionController end def build_render_path(name) - @render_path = @application.view_root + "/" + view_path + "/" + name + if name =~ /^layouts\// + @render_path = @application.view_root + "/" + name + else + @render_path = @application.view_root + "/" + view_path + "/" + name + end + logger.debug "render path = #{@render_path}, #{@application.view_root} / #{view_path} / #{name}" end def view_path
handle views that start with layouts for non-relative paths
boberetezeke_opal-actionpack
train
rb
ef15845aa7833ed68ecb8133471b5243baa6f142
diff --git a/src/ArrowDirectionMixin.js b/src/ArrowDirectionMixin.js index <HASH>..<HASH> 100644 --- a/src/ArrowDirectionMixin.js +++ b/src/ArrowDirectionMixin.js @@ -198,8 +198,12 @@ function ArrowDirectionMixin(Base) { rightToLeft ? 'rotateZ(180deg)' : ''; - this[internal.ids].arrowIconPrevious.style.transform = transform; - this[internal.ids].arrowIconNext.style.transform = transform; + if (this[internal.ids].arrowIconPrevious) { + this[internal.ids].arrowIconPrevious.style.transform = transform; + } + if (this[internal.ids].arrowIconNext) { + this[internal.ids].arrowIconNext.style.transform = transform; + } } // Disable the previous/next buttons if we can't go in those directions.
Check to see if arrow icons are actually being used before trying to style them.
elix_elix
train
js
ce5cf29be307ab6039519b733b1861dde5f61c40
diff --git a/type_map.go b/type_map.go index <HASH>..<HASH> 100644 --- a/type_map.go +++ b/type_map.go @@ -1,3 +1,5 @@ +// +build !gccgo + package reflect2 import (
#6, #9: TypeByName/TypeByPackageName use a hack that only works with gcgo and doesn't work with gccgo. Disabling compilation of type_map.go for gccgo.
modern-go_reflect2
train
go
079799df28b6d0edbf118b78fd3173c0f80ed597
diff --git a/slave/setup.py b/slave/setup.py index <HASH>..<HASH> 100755 --- a/slave/setup.py +++ b/slave/setup.py @@ -133,9 +133,10 @@ else: 'pyflakes', ], } - setup_args['setup_requires'] = [ - 'setuptools_trial', - ] + if '--help-commands' in sys.argv or 'trial' in sys.argv or 'test' in sys.argv: + setup_args['setup_requires'] = [ + 'setuptools_trial', + ] if os.getenv('NO_INSTALL_REQS'): setup_args['install_requires'] = None
require setuptools_trial on slave only if tests/help command requested
buildbot_buildbot
train
py
720156b38c8879f54694b6a2f5d1856a6131c9d5
diff --git a/lspreader/flds.py b/lspreader/flds.py index <HASH>..<HASH> 100644 --- a/lspreader/flds.py +++ b/lspreader/flds.py @@ -9,7 +9,7 @@ def rect(d,s=None): if key not in dims ]; shape = [ len( np.unique(d[l]) ) for l in dims ]; - if not s: + if s is not None: s = np.lexsort((d['z'],d['y'],d['x'])); for l in labels: d[l] = d[l][s].reshape(shape);
flds.py fix, we need testing
noobermin_lspreader
train
py
1b44d14a047064bd91c406d9e2f12f19fc0ab0fb
diff --git a/safe/storage/test_io.py b/safe/storage/test_io.py index <HASH>..<HASH> 100644 --- a/safe/storage/test_io.py +++ b/safe/storage/test_io.py @@ -677,7 +677,7 @@ class Test_IO(unittest.TestCase): V_ref = V.get_topN('FLOOR_AREA', 5) geometry = V_ref.get_geometry() - data = V_ref.get_data() + #data = V_ref.get_data() projection = V_ref.get_projection() # Create new attributes with a range of types @@ -698,7 +698,6 @@ class Test_IO(unittest.TestCase): D[key] = values[j] else: D[key] = values[j] - data.append(D) # Create new object from test data @@ -710,9 +709,13 @@ class Test_IO(unittest.TestCase): V_tmp = read_layer(tmp_filename) - #print V_new.get_data() - #print V_tmp.get_data() + #print V_new.get_data()[1] + #print V_tmp.get_data()[1] + assert V_tmp.projection == V_new.projection + assert numpy.allclose(V_tmp.geometry, V_new.geometry) + assert V_tmp.data == V_new.data + assert V_tmp.get_data() == V_new.get_data() assert V_tmp == V_new assert not V_tmp != V_new
Debugging test that failed at GEM code sprint
inasafe_inasafe
train
py
e5a3a1e1d3e25238a173e28382ba7002472f5724
diff --git a/src/main/resources/META-INF/resources/primefaces/schedule/1-schedule.js b/src/main/resources/META-INF/resources/primefaces/schedule/1-schedule.js index <HASH>..<HASH> 100644 --- a/src/main/resources/META-INF/resources/primefaces/schedule/1-schedule.js +++ b/src/main/resources/META-INF/resources/primefaces/schedule/1-schedule.js @@ -78,7 +78,9 @@ PrimeFaces.widget.Schedule = PrimeFaces.widget.DeferredWidget.extend({ this.cfg.eventClick = function(calEvent, jsEvent, view) { if (calEvent.url) { - window.open(calEvent.url, $this.cfg.urlTarget); + var targetWindow = window.open('', $this.cfg.urlTarget); + targetWindow.opener = null; + targetWindow.location = calEvent.url; return false; }
fix: schedule: URL events enable phishing attacks (#<I>)
primefaces_primefaces
train
js
3fd6460fb1805eaaeb057fda1c30aa34313a19dd
diff --git a/state/testing/suite.go b/state/testing/suite.go index <HASH>..<HASH> 100644 --- a/state/testing/suite.go +++ b/state/testing/suite.go @@ -27,6 +27,7 @@ type StateSuite struct { NewPolicy state.NewPolicyFunc Controller *state.Controller State *state.State + StatePool *state.StatePool IAASModel *state.IAASModel Owner names.UserTag Factory *factory.Factory @@ -65,6 +66,10 @@ func (s *StateSuite) SetUpTest(c *gc.C) { s.State.Close() s.Controller.Close() }) + + s.StatePool = state.NewStatePool(s.State) + s.AddCleanup(func(*gc.C) { s.StatePool.Close() }) + im, err := s.State.IAASModel() c.Assert(err, jc.ErrorIsNil) s.IAASModel = im
state/testing: Add a StatePool to StateSuite This will be useful in a number of tests.
juju_juju
train
go
1baa3621585ade10fec59a5c13c2c56a9a2511c4
diff --git a/source/DatePicker.js b/source/DatePicker.js index <HASH>..<HASH> 100644 --- a/source/DatePicker.js +++ b/source/DatePicker.js @@ -167,9 +167,9 @@ enyo.kind({ this.refresh(); }, disabledChanged: function() { - this.yearPickerButton.setDisabled(this.disabled); - this.monthPickerButton.setDisabled(this.disabled); - this.dayPickerButton.setDisabled(this.disabled); + this.$.yearPickerButton.setDisabled(this.disabled); + this.$.monthPickerButton.setDisabled(this.disabled); + this.$.dayPickerButton.setDisabled(this.disabled); }, updateDay: function(inSender, inEvent){ var date = this.calcDate(this.value.getFullYear(),
Update source/DatePicker.js Fix problem where disabledChanged didn't use $ to find items in the hash, reported on forums at <URL>
enyojs_onyx
train
js
7d1c720b8422b4aaaa3bea7121e50561aeb9d27d
diff --git a/test/httpstress_test.go b/test/httpstress_test.go index <HASH>..<HASH> 100644 --- a/test/httpstress_test.go +++ b/test/httpstress_test.go @@ -51,7 +51,10 @@ func TestStressHTTP(t *testing.T) { tc := &tls.Config{InsecureSkipVerify: true} tr := &http.Transport{ - TLSClientConfig: tc, + TLSClientConfig: tc, + DisableKeepAlives: true, + ResponseHeaderTimeout: time.Second, + TLSHandshakeTimeout: time.Second, } client := &http.Client{ Transport: tr,
Slightly more robust HTTP stress test
syncthing_syncthing
train
go
17b53cf2f566f5ddfab2ea4347ff3a04a9cd6634
diff --git a/prow/plugins/cla/cla.go b/prow/plugins/cla/cla.go index <HASH>..<HASH> 100644 --- a/prow/plugins/cla/cla.go +++ b/prow/plugins/cla/cla.go @@ -43,7 +43,8 @@ It may take a couple minutes for the CLA signature to be fully registered; after - If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your [email is set on your git commits](https://help.github.com/articles/setting-your-email-in-git/). - If you signed the CLA as a corporation, please sign in with your organization's credentials at <https://identity.linuxfoundation.org/projects/cncf> to be authorized. -- If you have done the above and are still having issues with the CLA being reported as unsigned, please email the CNCF helpdesk: helpdesk@rt.linuxfoundation.org +- If you have done the above and are still having issues with the CLA being reported as unsigned, please log a ticket with the Linux Foundation Helpdesk: <https://support.linuxfoundation.org/> +- Should you encounter any issues with the Linux Foundation Helpdesk, send a message to the backup e-mail support address at: login-issues@jira.linuxfoundation.org <!-- need_sender_cla -->
Update CLA message with LF helpdesk information.
kubernetes_test-infra
train
go
8f9a0a9da2f39853a354ee63c78391145e206d4f
diff --git a/gitconsensus/repository.py b/gitconsensus/repository.py index <HASH>..<HASH> 100644 --- a/gitconsensus/repository.py +++ b/gitconsensus/repository.py @@ -228,7 +228,7 @@ class PullRequest: def shouldClose(self): if 'timeout' in self.repository.rules: - if self.hoursSinceLastCommit() >= self.repository.rules['timeout']: + if self.hoursSinceLastUpdate() >= self.repository.rules['timeout']: return True return False
Fix `shouldClose` to use time since last update, not last commit
gitconsensus_GitConsensusCLI
train
py
95fbdd53b24f5f714a9167a734392b87da856d3e
diff --git a/client/src/main/java/io/pravega/client/batch/impl/BatchClientImpl.java b/client/src/main/java/io/pravega/client/batch/impl/BatchClientImpl.java index <HASH>..<HASH> 100644 --- a/client/src/main/java/io/pravega/client/batch/impl/BatchClientImpl.java +++ b/client/src/main/java/io/pravega/client/batch/impl/BatchClientImpl.java @@ -113,12 +113,7 @@ public class BatchClientImpl implements BatchClient { private CompletableFuture<StreamCut> fetchHeadStreamCut(final Stream stream) { //Fetch segments pointing to the current HEAD of the stream. return controller.getSegmentsAtTime(new StreamImpl(stream.getScope(), stream.getStreamName()), 0L) - .thenApply( s -> { - //fetch the correct start offset from Segment store. - Map<Segment, Long> pos = s.keySet().stream().map(this::segmentToInfo) - .collect(Collectors.toMap(SegmentInfo::getSegment, SegmentInfo::getStartingOffset)); - return new StreamCutImpl(stream, pos); - }); + .thenApply( s -> new StreamCutImpl(stream, s)); } private CompletableFuture<StreamCut> fetchTailStreamCut(final Stream stream) {
Issue <I>: Remove duplicative logic of fetching offsets for a stream head. (#<I>) * Remove duplicate logic of fetching offsets for a Stream Head.
pravega_pravega
train
java
5b3b40c044a1871b2b6942fb28435c37561263a2
diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -757,12 +757,11 @@ class Request $clientIps = array_map('trim', explode(',', $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_IP]))); $clientIps[] = $ip; // Complete the IP chain with the IP the request actually came from - $trustedProxies = !self::$trustedProxies ? array($ip) : self::$trustedProxies; $ip = $clientIps[0]; // Fallback to this when the client IP falls into the range of trusted proxies // Eliminate all IPs from the forwarded IP chain which are trusted proxies foreach ($clientIps as $key => $clientIp) { - if (IpUtils::checkIp($clientIp, $trustedProxies)) { + if (IpUtils::checkIp($clientIp, self::$trustedProxies)) { unset($clientIps[$key]); } }
Removed useless check if self::$trustProxies is set In Request::getClientIps() on line <I> there is a check if self::$trustedProxies is not set. If this condition evaluates to true the method will return. Because of this the second identical check on line <I> will never evaluate to true, as when reaching this position self::$trustedProxies must be set.
symfony_symfony
train
php
9dee61a043d91da925840d8883bbb520804b8d65
diff --git a/pmxbot/storage.py b/pmxbot/storage.py index <HASH>..<HASH> 100644 --- a/pmxbot/storage.py +++ b/pmxbot/storage.py @@ -35,7 +35,7 @@ class SelectableStorage(object): @classmethod def from_URI(cls, URI): - candidates = itersubclasses(cls) + candidates = reversed(list(itersubclasses(cls))) if hasattr(cls, 'scheme'): candidates = itertools.chain([cls], candidates) matches = (cls for cls in candidates if cls.uri_matches(URI))
Prefer the most specialized implementation for which uri_matches passes.
yougov_pmxbot
train
py
542cffe5b03991662912c57b41b9f1a2aa60afb2
diff --git a/lib/fog/bin/aws.rb b/lib/fog/bin/aws.rb index <HASH>..<HASH> 100644 --- a/lib/fog/bin/aws.rb +++ b/lib/fog/bin/aws.rb @@ -29,6 +29,8 @@ class AWS < Fog::Bin Fog::Storage::AWS when :rds Fog::AWS::RDS + when :sns + Fog::AWS::SNS else # @todo Replace most instances of ArgumentError with NotImplementedError # @todo For a list of widely supported Exceptions, see: @@ -72,6 +74,8 @@ class AWS < Fog::Bin when :storage Formatador.display_line("[yellow][WARN] AWS[:storage] is deprecated, use Storage[:aws] instead[/]") Fog::Storage.new(:provider => 'AWS') + when :sns + Fog::AWS::SNS.new else raise ArgumentError, "Unrecognized service: #{key.inspect}" end
Add sns to fog bin.
fog_fog
train
rb
4b99f6d96deacb82097e6033aa45416af8682601
diff --git a/experiments/concurrency/stub.rb b/experiments/concurrency/stub.rb index <HASH>..<HASH> 100644 --- a/experiments/concurrency/stub.rb +++ b/experiments/concurrency/stub.rb @@ -10,13 +10,12 @@ class Listener @socket = socket @cache = cache @app = Rack::HelloWorld.new - @block = true - @observe = true + @options = David::AppConfig.new end def run loop do - if defined?(JRuby) || @mode == :prefork || @mode == :threaded + if defined?(JRuby) || defined?(Rubinius) || @mode == :prefork || @mode == :threaded data, sender = @socket.recvfrom(1152) port, _, host = sender[1..3] else @@ -73,15 +72,16 @@ case ARGV[0] socket.bind('::', 5683) 4.times { fork { Listener.new(:prefork, socket, cache).run } } when 'threaded' - # ~16000 + # ~17500 socket = UDPSocket.new(Socket::AF_INET6) socket.bind('::', 5683) Listener.send(:include, Celluloid) Listener.pool(size: 8, args: [:threaded, socket, cache]).run else - # ~14000 + # ~17000 socket = Celluloid::IO::UDPSocket.new(Socket::AF_INET6) socket.bind('::', 5683) + Listener.send(:include, Celluloid::IO) Listener.new(:sped, socket, cache).run end
Updated stub.rb to debug problem with benchmarking in Rubinius.
nning_david
train
rb
d22d5189179ecc3cdea6d4571de8483f49bc4b9a
diff --git a/src/Logging/MonologBase.php b/src/Logging/MonologBase.php index <HASH>..<HASH> 100755 --- a/src/Logging/MonologBase.php +++ b/src/Logging/MonologBase.php @@ -2,6 +2,7 @@ namespace Modulus\Hibernate\Logging; +use Monolog\Logger; use Modulus\Support\Config; use Modulus\Hibernate\Logging\Driver; use Modulus\Hibernate\Exceptions\InvalidLogDriverException; @@ -30,6 +31,7 @@ class MonologBase * Init monolog * * @param null|string $channel + * @throws InvalidLogDriverException * @return void */ public function __construct(string $channel = null) @@ -39,6 +41,9 @@ class MonologBase $this->driver = (new self::$supported[$this->getDriver($driver) ?? 'single']); + if (!$this->driver instanceof Driver) + throw new InvalidLogDriverException; + $this->driver = $channel ? $this->driver->setDefault($channel)->get() : $this->driver->get(); } @@ -67,13 +72,10 @@ class MonologBase /** * Get log * - * @throws InvalidLogDriverException - * @return Driver + * @return Logger */ - public function log() + public function log() : Logger { - if ($this->driver instanceof Driver) return $this->driver; - - throw new InvalidLogDriverException; + return $this->driver; } }
fix: throw exception on __construct if driver is not a valid driver also, expect a logger instance on log function
modulusphp_hibernate
train
php
b447562b1367d3e85455ad7356ad6892bc9e1d5f
diff --git a/tasks/nodemon.js b/tasks/nodemon.js index <HASH>..<HASH> 100644 --- a/tasks/nodemon.js +++ b/tasks/nodemon.js @@ -12,7 +12,7 @@ module.exports = function (grunt) { var options = this.options(); var done = this.async(); - var args = [__dirname + '/../node_modules/nodemon/nodemon']; + var args = [require.resolve('nodemon')]; var nodemonignoreMessage = '# Generated by grunt-nodemon'; if (options.nodeArgs) { @@ -101,13 +101,7 @@ module.exports = function (grunt) { }, function (error) { if (error) { - grunt.fail.fatal('nodemon must be installed as a local dependency of grunt-nodemon.\n\n' + - - 'Run the following command:\n' + - 'rm -rf node_modules/nodemon\n\n' + - - 'Then run:\n' + - 'npm install grunt-nodemon --save-dev'); + grunt.fail.fatal(error); } done(); });
Use require.resolve to determine nodemon location instead of hard-coding
ChrisWren_grunt-nodemon
train
js
0936f11498559112a910468f1dedc9a3f2c9648c
diff --git a/lib/parser.rb b/lib/parser.rb index <HASH>..<HASH> 100644 --- a/lib/parser.rb +++ b/lib/parser.rb @@ -1,8 +1,5 @@ module WebVTT - class MalformedFile < RuntimeError; end - class InputError < RuntimeError; end - def self.read(file) File.new(file) end diff --git a/lib/segmenter.rb b/lib/segmenter.rb index <HASH>..<HASH> 100644 --- a/lib/segmenter.rb +++ b/lib/segmenter.rb @@ -1,7 +1,5 @@ module WebVTT - class InputError < RuntimeError; end - def self.segment(input, options={}) if input.is_a?(String) input = File.new(input) diff --git a/lib/webvtt.rb b/lib/webvtt.rb index <HASH>..<HASH> 100644 --- a/lib/webvtt.rb +++ b/lib/webvtt.rb @@ -4,5 +4,10 @@ if defined?(Encoding) Encoding.default_internal = Encoding.default_external = "UTF-8" end +module WebVTT + class MalformedFile < RuntimeError; end + class InputError < RuntimeError; end +end + require "parser" require "segmenter" \ No newline at end of file
put exceptions class into webvtt.rb
opencoconut_webvtt-ruby
train
rb,rb,rb
059d0cc4e209675c2734a7bfb64eae8e6d579f89
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -32,7 +32,9 @@ module.exports = function(opts) { compiled = handlebars.precompile(ast, compilerOptions).toString(); } catch (err) { - this.emit('error', new gutil.PluginError(PLUGIN_NAME, err)); + this.emit('error', new gutil.PluginError(PLUGIN_NAME, err, { + fileName: file.path + })); return callback(); } diff --git a/test/main.js b/test/main.js index <HASH>..<HASH> 100644 --- a/test/main.js +++ b/test/main.js @@ -33,6 +33,7 @@ describe('gulp-handlebars', function() { var invalidTemplate = getFixture('Invalid.hbs'); stream.on('error', function(err) { + err.fileName.should.equal('test/fixtures/Invalid.hbs'), err.should.be.an.instanceOf(Error); err.message.should.equal(getExpectedString('Error.txt')); done();
Include fileName in options to PluginError, closes #<I>
lazd_gulp-handlebars
train
js,js
e5bf1473d631f928929e34c8079da76400834994
diff --git a/code/search/SearchUpdater.php b/code/search/SearchUpdater.php index <HASH>..<HASH> 100644 --- a/code/search/SearchUpdater.php +++ b/code/search/SearchUpdater.php @@ -232,13 +232,13 @@ class SearchUpdater extends Object { /** * Internal function. Process the passed list of dirty ids. Split from flush_dirty_indexes so it can be called both * directly and via messagequeue message. - * - * WARNING: Changes state (subsite, stage) and doesn't reset it. Should only be called after request has ended */ static function process_dirty_indexes($dirty) { $indexes = FullTextSearch::get_indexes(); $dirtyindexes = array(); + $originalState = SearchVariant::current_state(); + foreach ($dirty as $base => $statefulids) { if (!$statefulids) continue; @@ -263,6 +263,8 @@ class SearchUpdater extends Object { foreach ($dirtyindexes as $index) { $indexes[$index]->commit(); } + + SearchVariant::activate_state($originalState); } }
BUG Make process_dirty_indexes act cleanly process_dirty_indexes wasnt saving variant state or restoring or exit, because I thought it was only called at the end of a request and so didnt need to But tests call it regularly throughout a request. So now its clean and safe to call when-ever
silverstripe_silverstripe-fulltextsearch
train
php
08cff6e5e068294bb779287167394fbe9002f1c7
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -5,5 +5,5 @@ export default function(Vue) { } export function timer(name, time, options) { - return mixin.assign({ name: name, time: time }, options) + return Object.assign({ name: name, time: time }, options) } diff --git a/mixin.js b/mixin.js index <HASH>..<HASH> 100644 --- a/mixin.js +++ b/mixin.js @@ -1,4 +1,3 @@ -// jshint esversion: 6, asi: true import { set } from './utils' function generateData(timers) { @@ -141,7 +140,7 @@ export default { /** * Polyfill for Object.assign for IE11 support */ - assign: function (){ + assign: function (to){ var assign = Object.assign || function assign(to) { for (var s = 1; s < arguments.length; s += 1) { var from = arguments[s] diff --git a/utils.js b/utils.js index <HASH>..<HASH> 100644 --- a/utils.js +++ b/utils.js @@ -1,5 +1,7 @@ +import mixin from './mixin' + export function set(key, value, obj) { - const clone = Object.assign({}, obj) + const clone = mixin.assign({}, obj) clone[key] = value return clone }
Replaced yet another Object.assign (#2) utils.js also had a Object.assign
Kelin2025_vue-timers
train
js,js,js
e4216f19e6f9860c0546dcb62376b1436bdaf1af
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 @@ -209,7 +209,7 @@ class QueSpec < Minitest::Spec abort end - if ENV['CI'] && f = failure + if f = failure && !skipped? && ENV['CI'] e = f.exception puts "\n\n#{e.class}: #{e.message}\n#{e.backtrace.join("\n")}\n\n" end
Don't print skips on CircleCI.
chanks_que
train
rb
3cf5be225a9ae7475298d8cb1416455f8a4b5ee2
diff --git a/cumulusci/tasks/salesforce/tests/test_UpdateAdminProfile.py b/cumulusci/tasks/salesforce/tests/test_UpdateAdminProfile.py index <HASH>..<HASH> 100644 --- a/cumulusci/tasks/salesforce/tests/test_UpdateAdminProfile.py +++ b/cumulusci/tasks/salesforce/tests/test_UpdateAdminProfile.py @@ -143,7 +143,7 @@ def test_retrieve_unpackaged(ApiRetrieveUnpackaged): def test_deploy_metadata(tmpdir): task = create_task(UpdateAdminProfile) task.retrieve_dir = Path(tmpdir, "retrieve", "profiles") - task.deploy_dir = Path(tmpdir, "deploy", "profiles") + task.deploy_dir = Path(tmpdir, "deploy") task.retrieve_dir.mkdir(parents=True) task.deploy_dir.mkdir(parents=True) task.retrieve_dir = task.retrieve_dir.parent
Don't create dir in updateAdminProf deployment
SFDO-Tooling_CumulusCI
train
py
97bf24979529dec388c18632daf4bf403fbe5314
diff --git a/salt/minion.py b/salt/minion.py index <HASH>..<HASH> 100644 --- a/salt/minion.py +++ b/salt/minion.py @@ -19,6 +19,7 @@ import signal # Import third party libs import zmq +import yaml HAS_RANGE = False try: @@ -394,7 +395,7 @@ class Minion(object): ret = {} for ind in range(0, len(data['arg'])): try: - arg = eval(data['arg'][ind]) + arg = yaml.safe_load(data['arg'][ind]) if isinstance(arg, bool): data['arg'][ind] = str(data['arg'][ind]) elif isinstance(arg, (dict, int, list, string_types)): @@ -474,7 +475,7 @@ class Minion(object): for ind in range(0, len(data['fun'])): for index in range(0, len(data['arg'][ind])): try: - arg = eval(data['arg'][ind][index]) + arg = yaml.safe_load(data['arg'][ind][index]) if isinstance(arg, bool): data['arg'][ind][index] = str(data['arg'][ind][index]) elif isinstance(arg, (dict, int, list, string_types)):
Remove legacy eval and replace with safe yaml interp Fix #<I>
saltstack_salt
train
py
7876ab2f80475ead7eb239dda7f65348c5cb7bdb
diff --git a/src/com/google/javascript/jscomp/FieldCleanupPass.java b/src/com/google/javascript/jscomp/FieldCleanupPass.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/FieldCleanupPass.java +++ b/src/com/google/javascript/jscomp/FieldCleanupPass.java @@ -16,6 +16,7 @@ package com.google.javascript.jscomp; +import com.google.common.collect.ImmutableList; import com.google.javascript.jscomp.NodeTraversal.AbstractShallowCallback; import com.google.javascript.jscomp.NodeTraversal.Callback; import com.google.javascript.rhino.Node; @@ -92,8 +93,8 @@ public class FieldCleanupPass implements HotSwapCompilerPass { // We are a root GetProp if (NodeUtil.isGetProp(n) && !NodeUtil.isGetProp(p)) { String propName = getFieldName(n); - Iterable<ObjectType> types = - typeRegistry.getEachReferenceTypeWithProperty(propName); + Iterable<ObjectType> types = ImmutableList.copyOf( + typeRegistry.getEachReferenceTypeWithProperty(propName)); for (ObjectType type : types) { Node pNode = type.getPropertyNode(propName); if (srcName.equals(pNode.getSourceFileName())) {
Copy list to avoid ConcurrentModificationExceptions resulting from changing membership of the list during for-each loop (since JSTypeRegistry does not copy the list it returns). R=acleung DELTA=3 (1 added, 0 deleted, 2 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=<I> git-svn-id: <URL>
google_closure-compiler
train
java
c6c2eef32d88794fbd0659e210471e2c48e39d80
diff --git a/src/widget/geopoint/geopointpicker.js b/src/widget/geopoint/geopointpicker.js index <HASH>..<HASH> 100644 --- a/src/widget/geopoint/geopointpicker.js +++ b/src/widget/geopoint/geopointpicker.js @@ -367,6 +367,17 @@ define( [ 'jquery', 'enketo-js/Widget', 'text!enketo-config' ], this.$acc.val( Math.round( acc * 10 ) / 10 ).trigger( ev ); }; + Geopointpicker.prototype.disable = function() { + this.$map.hide(); + this.$widget.find( '.btn' ).addClass( 'disabled' ); + }; + + Geopointpicker.prototype.enable = function() { + this.$map.show(); + this.$widget.find( '.btn' ).removeClass( 'disabled' ); + }; + + $.fn[ pluginName ] = function( options, event ) { return this.each( function() {
properly disable map in irrelevant branches, closes #<I>
enketo_enketo-core
train
js
aec33ebefb346e3eba2dfee168b5385737af4432
diff --git a/spec/MessengerSpec.php b/spec/MessengerSpec.php index <HASH>..<HASH> 100644 --- a/spec/MessengerSpec.php +++ b/spec/MessengerSpec.php @@ -200,4 +200,24 @@ class MessengerSpec extends ObjectBehavior ->shouldHaveKeyWithValue('result', 'Successfully removed all new_thread\'s CTAs'); } + + function it_subscribe_the_app($client, ResponseInterface $response) + { + $options = [ + RequestOptions::QUERY => [ + 'access_token' => 'token', + ], + ]; + + $response->getBody()->willReturn(' + { + "success": true + } + '); + + $client->request('POST', '/me/subscribed_apps', $options) + ->willReturn($response); + + $this->subscribe()->shouldReturn(true); + } } diff --git a/src/Messenger.php b/src/Messenger.php index <HASH>..<HASH> 100644 --- a/src/Messenger.php +++ b/src/Messenger.php @@ -100,6 +100,18 @@ class Messenger } /** + * Subscribe the app to the page + * + * @return bool + */ + public function subscribe() + { + $response = $this->send('POST', '/me/subscribed_apps'); + + return $response['success']; + } + + /** * @param string $pageId * * @return array
Add Messenger::subscribe() method
tgallice_fb-messenger-sdk
train
php,php
d35bf7c25b9d280ce112dba418df9688eb1e45a1
diff --git a/views/helpers/clearance.php b/views/helpers/clearance.php index <HASH>..<HASH> 100644 --- a/views/helpers/clearance.php +++ b/views/helpers/clearance.php @@ -60,7 +60,7 @@ class ClearanceHelper extends AppHelper { * @access public * @author Jose Diaz-Gonzalez **/ - function __construct($config) { + function __construct($config = array()) { $this->settings = array_merge($this->settings, $config); }
Fixed merging of configuration for helper
josegonzalez_cakephp-sanction
train
php
62e7be1faa0e91f41af6c05710f29baf891b7483
diff --git a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php index <HASH>..<HASH> 100644 --- a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php +++ b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php @@ -31,7 +31,7 @@ use Webmozart\Assert\Assert; class Kernel extends HttpKernel { - public const VERSION = '1.9.0-DEV'; + public const VERSION = '1.9.0-RC.1'; public const VERSION_ID = '10900'; @@ -41,7 +41,7 @@ class Kernel extends HttpKernel public const RELEASE_VERSION = '0'; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = 'RC.1'; public function __construct(string $environment, bool $debug) {
Change application's version to <I>-RC<I>
Sylius_Sylius
train
php
86b685208de8cf2dc6f970e0c55201a334afcc3b
diff --git a/question/format/xml/format.php b/question/format/xml/format.php index <HASH>..<HASH> 100755 --- a/question/format/xml/format.php +++ b/question/format/xml/format.php @@ -498,7 +498,7 @@ class qformat_xml extends qformat_default { function import_category( $question ) { $qo = new stdClass; $qo->qtype = 'category'; - $qo->category = $question['#']['category'][0]['#']; + $qo->category = $this->import_text($question['#']['category'][0]['#']['text']); return $qo; }
MDL-<I>: Read xml structure correctly to get category path. Merged from STABLE_<I>
moodle_moodle
train
php
5948a102b0474b74192a229a64c89999f1b354a0
diff --git a/test/helper.rb b/test/helper.rb index <HASH>..<HASH> 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -137,7 +137,7 @@ module Juno def marshal_error # HACK: Marshalling structs in rubinius without class name throws # NoMethodError (to_sym). TODO: Create an issue for rubinius! - RUBY_ENGINE == 'rbx' ? NoMethodError : TypeError + Object.const_defined?(:RUBY_ENGINE) && RUBY_ENGINE == 'rbx' ? NoMethodError : TypeError end it "refuses to #[] from keys that cannot be marshalled" do
RUBY_ENGINE is not defined on <I>
moneta-rb_moneta
train
rb
05a787f14cb05c868f548615d3130727e845ca1e
diff --git a/modules_v3/lightbox/functions/lightbox_print_media.php b/modules_v3/lightbox/functions/lightbox_print_media.php index <HASH>..<HASH> 100644 --- a/modules_v3/lightbox/functions/lightbox_print_media.php +++ b/modules_v3/lightbox/functions/lightbox_print_media.php @@ -465,7 +465,7 @@ function lightbox_print_media_row($rtype, $rowm, $pid) { if (WT_USER_CAN_EDIT) { // Edit Media $submenu = new WT_Menu("&nbsp;&nbsp;" . WT_I18N::translate('Edit media') . "&nbsp;&nbsp;"); - $submenu->addOnclick("return window.open('addmedia.php?action=editmedia&amp;pid={$rowm['m_id']}}', '_blank', edit_window_specs);"); + $submenu->addOnclick("return window.open('addmedia.php?action=editmedia&amp;pid={$rowm['m_id']}', '_blank', edit_window_specs);"); $submenu->addClass("submenuitem"); $menu->addSubMenu($submenu); if (WT_USER_IS_ADMIN) {
Fix: edit-media link on album tab is broken
fisharebest_webtrees
train
php
bf59347d2260a209fea7ded586f5d0c9f739f581
diff --git a/spec/models/doorkeeper/access_token_spec.rb b/spec/models/doorkeeper/access_token_spec.rb index <HASH>..<HASH> 100644 --- a/spec/models/doorkeeper/access_token_spec.rb +++ b/spec/models/doorkeeper/access_token_spec.rb @@ -144,7 +144,7 @@ module Doorkeeper expect(subject).to be_valid end - it 'is valid without resource_owner_id' do + it 'is valid without application_id' do # For resource owner credentials flow subject.application_id = nil expect(subject).to be_valid
Fix application_id validation spec description
doorkeeper-gem_doorkeeper
train
rb
c66e888dc3203e8d9f4a0b02a6eb66b9badb5ce0
diff --git a/core/selection.js b/core/selection.js index <HASH>..<HASH> 100644 --- a/core/selection.js +++ b/core/selection.js @@ -113,11 +113,7 @@ class Selection { } var rect = range.getBoundingClientRect(); } else { - if (leaf instanceof BreakBlot) { - var rect = leaf.parent.domNode.getBoundingClientRect(); - } else { - var rect = leaf.domNode.getBoundingClientRect(); - } + var rect = leaf.domNode.getBoundingClientRect(); if (offset > 0) side = 'right'; } bounds = {
getBoundingClientRect actually works on BR nodes Fix #<I>
quilljs_quill
train
js
91ec95d29a6ccbaea64745fa77891c77acd79495
diff --git a/src/JSTACK.Murano.js b/src/JSTACK.Murano.js index <HASH>..<HASH> 100644 --- a/src/JSTACK.Murano.js +++ b/src/JSTACK.Murano.js @@ -144,7 +144,7 @@ JSTACK.Murano = (function (JS, undefined) { JS.Comm.get(url, JS.Keystone.params.token, onOK, onError); }; - createTemplate = function (name, callback, error, region) { + createTemplate = function (name, description, callback, error, region) { var url, onOk, onError, data; if (!check(region)) { return; @@ -153,7 +153,8 @@ JSTACK.Murano = (function (JS, undefined) { url = params.url + '/templates'; data = { - "name": name + "name": name, + "description_text": description }; onOk = function (result) {
Added description to Murano templates
ging_jstack
train
js
1096dc2085b4f340b455d0db2589a028db7c13f5
diff --git a/core/server/data/schema/commands.js b/core/server/data/schema/commands.js index <HASH>..<HASH> 100644 --- a/core/server/data/schema/commands.js +++ b/core/server/data/schema/commands.js @@ -5,9 +5,8 @@ var _ = require('lodash'), schema = require('./schema'), clients = require('./clients'); -function addTableColumn(tableName, table, columnName) { - var column, - columnSpec = schema[tableName][columnName]; +function addTableColumn(tableName, table, columnName, columnSpec = schema[tableName][columnName]) { + var column; // creation distinguishes between text with fieldtype, string with maxlength and all others if (columnSpec.type === 'text' && Object.prototype.hasOwnProperty.call(columnSpec, 'fieldtype')) { @@ -48,9 +47,9 @@ function addTableColumn(tableName, table, columnName) { } } -function addColumn(tableName, column, transaction) { +function addColumn(tableName, column, transaction, columnSpec) { return (transaction || db.knex).schema.table(tableName, function (table) { - addTableColumn(tableName, table, column); + addTableColumn(tableName, table, column, columnSpec); }); }
Added ability to pass columnSpec to addTableColumn refs #<I> This gives us the ability to add columns that have since been removed from the schema, for example in a down migration.
TryGhost_Ghost
train
js
0ae4aba4e2d774fcbe2691eb89789c298d3733d2
diff --git a/extensions-core/hdfs-storage/src/main/java/io/druid/storage/hdfs/HdfsDataSegmentPusher.java b/extensions-core/hdfs-storage/src/main/java/io/druid/storage/hdfs/HdfsDataSegmentPusher.java index <HASH>..<HASH> 100644 --- a/extensions-core/hdfs-storage/src/main/java/io/druid/storage/hdfs/HdfsDataSegmentPusher.java +++ b/extensions-core/hdfs-storage/src/main/java/io/druid/storage/hdfs/HdfsDataSegmentPusher.java @@ -125,8 +125,11 @@ public class HdfsDataSegmentPusher implements DataSegmentPusher final long size; final DataSegment dataSegment; - try (FSDataOutputStream out = fs.create(tmpIndexFile)) { - size = CompressionUtils.zip(inDir, out); + try { + try (FSDataOutputStream out = fs.create(tmpIndexFile)) { + size = CompressionUtils.zip(inDir, out); + } + final String uniquePrefix = useUniquePath ? DataSegmentPusher.generateUniquePath() + "_" : ""; final Path outIndexFile = new Path(StringUtils.format( "%s/%s/%d_%sindex.zip",
HdfsDataSegmentPusher: Close tmpIndexFile before copying it. (#<I>) It seems that copy-before-close works OK on HDFS, but it doesn't work on all filesystems. In particular, we observed this not working properly with Google Cloud Storage. And anyway, it's better hygiene to close files before attempting to copy them somewhere else.
apache_incubator-druid
train
java
2ea21e316f6a7bf31254caf34765985a0ea12cc8
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 @@ -20,6 +20,16 @@ import os import sys sys.path.insert(0, os.path.abspath('../..')) +from mock import Mock as MagicMock + +class Mock(MagicMock): + @classmethod + def __getattr__(cls, name): + return Mock() + +MOCK_MODULES = ['tables, numpy'] +sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES) + # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here.
Added mocking of dependencies so that read the docs can build the project.
ghcollin_multitables
train
py
48ae23a9459e574fd812dc660bd542464f400d53
diff --git a/navigation/libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/camera/NavigationCamera.java b/navigation/libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/camera/NavigationCamera.java index <HASH>..<HASH> 100644 --- a/navigation/libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/camera/NavigationCamera.java +++ b/navigation/libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/camera/NavigationCamera.java @@ -27,7 +27,7 @@ import static android.content.res.Configuration.ORIENTATION_PORTRAIT; public class NavigationCamera implements ProgressChangeListener { - private static final int CAMERA_TILT = 57; + private static final int CAMERA_TILT = 50; private static int CAMERA_ZOOM = 17; private MapboxMap mapboxMap;
Less camera tilt for NavigationCamera (#<I>)
mapbox_mapbox-navigation-android
train
java
743d3f4ae3a626e23c3a47815001a382dd2491c4
diff --git a/library/SimplePie/Misc.php b/library/SimplePie/Misc.php index <HASH>..<HASH> 100644 --- a/library/SimplePie/Misc.php +++ b/library/SimplePie/Misc.php @@ -124,7 +124,7 @@ class SimplePie_Misc { $attribs[$j][2] = $attribs[$j][1]; } - $return[$i]['attribs'][strtolower($attribs[$j][1])]['data'] = SimplePie_Misc::entities_decode(end($attribs[$j])); + $return[$i]['attribs'][strtolower($attribs[$j][1])]['data'] = SimplePie_Misc::entities_decode(end($attribs[$j]), 'UTF-8'); } } } @@ -138,7 +138,7 @@ class SimplePie_Misc foreach ($element['attribs'] as $key => $value) { $key = strtolower($key); - $full .= " $key=\"" . htmlspecialchars($value['data']) . '"'; + $full .= " $key=\"" . htmlspecialchars($value['data'], ENT_COMPAT, 'UTF-8') . '"'; } if ($element['self_closing']) {
[FreshRSS] Explicit UTF-8 Use explicit UTF-8 in functions in which the default encoding may change depending on PHP's version or setup. `htmlspecialchars` was used in the whole SimplePie code with the explicit parameters `(ENT_COMPAT, 'UTF-8')` except in one instance. <URL>
simplepie_simplepie
train
php
e2b81fa09024f475bb3b16aa0cafa0f937ef158e
diff --git a/lib/models/post.js b/lib/models/post.js index <HASH>..<HASH> 100644 --- a/lib/models/post.js +++ b/lib/models/post.js @@ -55,9 +55,9 @@ module.exports = function(ctx) { }); Post.virtual('permalink').get(function() { - var url_for = ctx.extend.helper.get('url_for'); + var self = _.assign({}, ctx.extend.helper.list(), ctx); var config = ctx.config; - var partial_url = url_for.call(ctx, this.path); + var partial_url = self.url_for(this.path); return config.url + _.replace(partial_url, config.root, '/'); });
Update post.js (#<I>)
hexojs_hexo
train
js
d09f9c89c6422e813a470485327efe2cbb8963ca
diff --git a/lib/oxidized/model/ironware.rb b/lib/oxidized/model/ironware.rb index <HASH>..<HASH> 100644 --- a/lib/oxidized/model/ironware.rb +++ b/lib/oxidized/model/ironware.rb @@ -2,14 +2,14 @@ class IronWare < Oxidized::Model prompt /^.*(telnet|ssh)\@.+[>#]\s?$/i comment '! ' - + #to handle pager without enable #expect /^((.*)--More--(.*))$/ do |data, re| # send ' ' # data.sub re, '' #end - + #to remove backspace (if handle pager without enable) #expect /^((.*)[\b](.*))$/ do |data, re| # data.sub re, '' @@ -44,14 +44,14 @@ class IronWare < Oxidized::Model out << sc.rest cfg = out end - + comment cfg end - + cmd 'show flash' do |cfg| comment cfg end - + cmd 'show module' do |cfg| cfg.gsub! /^((Invalid input)|(Type \?)).*$/, '' # some ironware devices are fixed config comment cfg @@ -74,7 +74,7 @@ class IronWare < Oxidized::Model if vars :enable post_login do send "enable\r\n" - send vars(:enable) + "\r\n" + cmd vars(:enable) end end post_login ''
prompt not captured after sending enabe PW fixes #<I>
ytti_oxidized
train
rb
e1112e83f5c3329c09502982c7f6f8786796ea47
diff --git a/lib/halite/gem.rb b/lib/halite/gem.rb index <HASH>..<HASH> 100644 --- a/lib/halite/gem.rb +++ b/lib/halite/gem.rb @@ -17,6 +17,7 @@ require 'chef/cookbook_version' require 'halite/dependencies' +require 'halite/error' module Halite @@ -32,7 +33,12 @@ module Halite # name can be either a string name, Gem::Dependency, or Gem::Specification # @param name [String, Gem::Dependency, Gem::Specification] def initialize(name, version=nil) - name = name.to_spec if name.is_a?(::Gem::Dependency) # Allow passing a Dependency by just grabbing its spec. + if name.is_a?(::Gem::Dependency) + # Allow passing a Dependency by just grabbing its spec. + dependency = name + name = dependency.to_spec || dependency.to_specs.last + raise Error.new("Cannot find a gem to satisfy #{dependency}") unless name + end if name.is_a?(::Gem::Specification) raise Error.new("Cannot pass version when using an explicit specficiation") if version @spec = name
Fix handling of prerelease gems with Halite.
poise_halite
train
rb
86bb99b0271c544622272758985d10acd6b02719
diff --git a/sprinter/formulas/ssh.py b/sprinter/formulas/ssh.py index <HASH>..<HASH> 100644 --- a/sprinter/formulas/ssh.py +++ b/sprinter/formulas/ssh.py @@ -37,6 +37,8 @@ class SSHFormula(FormulaBase): def update(self, feature_name, source_config, target_config): ssh_key_path = self.__generate_key(feature_name, target_config) self.__install_ssh_config(target_config, ssh_key_path) + if 'command' in config: + self.__call_command(config['command'], ssh_key_path) #super(SSHFormula, self).update(feature_name, source_config, target_config) def remove(self, feature_name, config):
update command works every time in ssh
toumorokoshi_sprinter
train
py
c52fba18f5ef3b6961c80879bdfdad1b6f5f7334
diff --git a/runtime/mux.go b/runtime/mux.go index <HASH>..<HASH> 100644 --- a/runtime/mux.go +++ b/runtime/mux.go @@ -254,7 +254,7 @@ func (s *ServeMux) HandlePath(meth string, pathPattern string, h HandlerFunc) er return nil } -// ServeHTTP dispatches the request to the first handler whose pattern matches to r.Method and r.Path. +// ServeHTTP dispatches the request to the first handler whose pattern matches to r.Method and r.URL.Path. func (s *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) { ctx := r.Context()
typo in mux.go (#<I>)
grpc-ecosystem_grpc-gateway
train
go
6191e7347cf4445f15cc2ec2d1e5564de8454403
diff --git a/flux_led/fluxled.py b/flux_led/fluxled.py index <HASH>..<HASH> 100644 --- a/flux_led/fluxled.py +++ b/flux_led/fluxled.py @@ -755,7 +755,9 @@ def main(): # noqa: C901 ) if options.color is not None: - print(f"Setting color RGB:{options.color}",) + print( + f"Setting color RGB:{options.color}", + ) name = utils.color_tuple_to_string(options.color) if name is None: print() diff --git a/flux_led/models_db.py b/flux_led/models_db.py index <HASH>..<HASH> 100755 --- a/flux_led/models_db.py +++ b/flux_led/models_db.py @@ -307,7 +307,7 @@ MODELS = [ always_writes_white_and_colors=False, # Formerly rgbwprotocol nine_byte_read_protocol=False, mode_to_color_mode={}, - color_modes={COLOR_MODE_RGBW}, # Formerly rgbwcapable + color_modes=COLOR_MODES_RGB_W, # Formerly rgbwcapable channel_map={}, ), LEDENETModel(
Update models database for 0x<I> (#<I>)
Danielhiversen_flux_led
train
py,py