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
25950757e1a14fb70daf9e748f419604a93619d0
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -173,6 +173,9 @@ class CITest(TestCommand): check_call(cmd, shell=True) +NEEDS_PYTEST = {'pytest', 'test', 'coverage'}.intersection(sys.argv) +PYTEST_RUNNER = ['pytest-runner'] if NEEDS_PYTEST else [] + setup(name='python-openflow', version=__version__, description='Library to parse and generate OpenFlow messages', @@ -183,7 +186,7 @@ setup(name='python-openflow', license='MIT', test_suite='tests', include_package_data=True, - setup_requires=['pytest-runner'], + setup_requires=PYTEST_RUNNER, tests_require=['pytest'], extras_require={'dev': ['pip-tools >= 2.0', 'coverage', 'pytest', 'yala', 'tox']},
Require pytest-runner only when testing (#<I>)
kytos_python-openflow
train
py
167bd7dcd0c967b5d37ee8c604586573767f2092
diff --git a/src/main/java/com/github/underscore/$.java b/src/main/java/com/github/underscore/$.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/underscore/$.java +++ b/src/main/java/com/github/underscore/$.java @@ -2614,9 +2614,15 @@ public class $<T> { return result; } - @SuppressWarnings("unchecked") public static <T> T[] reverse(final T ... array) { - return (T[]) reverse(Arrays.asList(array)).toArray(); + T temp; + final T[] newArray = array.clone(); + for (int index = 0; index < array.length / 2; index += 1) { + temp = newArray[index]; + newArray[index] = newArray[array.length - 1 - index]; + newArray[array.length - 1 - index] = temp; + } + return newArray; } public static List<Integer> reverse(final int[] array) {
Improve $.reverse() for array.
javadev_underscore-java
train
java
7c175e4ce5b4d7f3941429af97b01ac7f068d212
diff --git a/conductor/src/main/java/com/bluelinelabs/conductor/Controller.java b/conductor/src/main/java/com/bluelinelabs/conductor/Controller.java index <HASH>..<HASH> 100755 --- a/conductor/src/main/java/com/bluelinelabs/conductor/Controller.java +++ b/conductor/src/main/java/com/bluelinelabs/conductor/Controller.java @@ -637,7 +637,6 @@ public abstract class Controller { mAttached = true; mNeedsAttach = false; - mView = view; for (ChildControllerTransaction child : mChildControllers) { attachChildController(child, new SimpleSwapChangeHandler()); @@ -850,6 +849,8 @@ public abstract class Controller { lifecycleListener.preBindView(this, view); } + mView = view; + onBindView(view); view.addOnAttachStateChangeListener(new OnAttachStateChangeListener() {
Fixed where the Controller's view is set internally
bluelinelabs_Conductor
train
java
225f8cff1a03452b1df05b33d8c3b281bfd05909
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -50,7 +50,7 @@ class TextMetrics { const ctx = getContext2d(font); if (options.multiline) { - return this.lines(styledText, options).reduce((res, text) => { + return this.lines(styledText, options, overwrites).reduce((res, text) => { const w = ctx.measureText(text).width + addSpacing(text); return Math.max(res, w);
pass style overwrites to lines()
bezoerb_text-metrics
train
js
793b86e6040299778c245c525d7f4720a6998d0f
diff --git a/script/genassets.go b/script/genassets.go index <HASH>..<HASH> 100644 --- a/script/genassets.go +++ b/script/genassets.go @@ -23,7 +23,9 @@ import ( "time" ) -var tpl = template.Must(template.New("assets").Parse(`package auto +var tpl = template.Must(template.New("assets").Parse(`// Code generated by genassets.go - DO NOT EDIT. + +package auto const Generated int64 = {{.Generated}} @@ -70,7 +72,7 @@ func walkerFor(basePath string) filepath.WalkFunc { name, _ = filepath.Rel(basePath, name) assets = append(assets, asset{ Name: filepath.ToSlash(name), - Data: fmt.Sprintf("%#v", buf.Bytes()), // "[]byte{0x00, 0x01, ...}" + Data: fmt.Sprintf("[]byte(%q)", buf.String()), }) }
script: Use strings instead of byte slice literals in asset generation It compiles literally <I> times faster and generates the same code. Also add the little header that indicates auto generated code.
syncthing_syncthing
train
go
58609ec2ac82de6d6e98b005111e62f4dc450be1
diff --git a/lib/hipchat/capistrano.rb b/lib/hipchat/capistrano.rb index <HASH>..<HASH> 100644 --- a/lib/hipchat/capistrano.rb +++ b/lib/hipchat/capistrano.rb @@ -10,17 +10,27 @@ Capistrano::Configuration.instance(:must_exist).load do rails_env = fetch(:hipchat_env, fetch(:rails_env, "production")) hipchat_client[hipchat_room_name]. - send(deploy_user, "Started deploying #{application} (#{rails_env}).", hipchat_announce) + send(deploy_user, "#{human} is deploying #{application} to #{rails_env}.", hipchat_announce) end task :notify_deploy_finished do hipchat_client[hipchat_room_name]. - send(deploy_user, "Finished deploying #{application}.", hipchat_announce) + send(deploy_user, "#{human} finished deploying #{application}.", hipchat_announce) end def deploy_user fetch(:hipchat_deploy_user, "Deploy") end + + def human + user = ENV['HIPCHAT_USER'] || fetch(:hipchat_human, ENV['USER']) + + if user == :from_git + %x{git config user.name}.strip + else + user + end + end end before "hipchat:notify_deploy_started", "hipchat:set_client"
Announce the user that started the deploy [capistrano].
hipchat_hipchat-rb
train
rb
135de8d94e30aa3c91b002a60f8e1bd4fe843459
diff --git a/mythril/analysis/potential_issues.py b/mythril/analysis/potential_issues.py index <HASH>..<HASH> 100644 --- a/mythril/analysis/potential_issues.py +++ b/mythril/analysis/potential_issues.py @@ -81,15 +81,16 @@ def check_potential_issues(state: GlobalState) -> None: :return: """ annotation = get_potential_issues_annotation(state) + unsat_potential_issues = [] for potential_issue in annotation.potential_issues: try: transaction_sequence = get_transaction_sequence( state, state.world_state.constraints + potential_issue.constraints ) except UnsatError: + unsat_potential_issues.append(potential_issue) continue - annotation.potential_issues.remove(potential_issue) potential_issue.detector.cache.add(potential_issue.address) potential_issue.detector.issues.append( Issue( @@ -106,3 +107,4 @@ def check_potential_issues(state: GlobalState) -> None: transaction_sequence=transaction_sequence, ) ) + annotation.potential_issues = unsat_potential_issues
Fix bug during checking potential issues (#<I>) * Fix bug due to list.remove() in a loop
ConsenSys_mythril-classic
train
py
7540e3c30ab098f6d6062ab7d16c8c62710c75d7
diff --git a/polyjdbc-core/src/main/java/org/polyjdbc/core/dialect/OracleDialect.java b/polyjdbc-core/src/main/java/org/polyjdbc/core/dialect/OracleDialect.java index <HASH>..<HASH> 100644 --- a/polyjdbc-core/src/main/java/org/polyjdbc/core/dialect/OracleDialect.java +++ b/polyjdbc-core/src/main/java/org/polyjdbc/core/dialect/OracleDialect.java @@ -21,11 +21,13 @@ package org.polyjdbc.core.dialect; */ public class OracleDialect extends AbstractDialect { + @Override public String getCode() { return "ORACLE"; } + @Override public String nextFromSequence(String sequenceName) { - return "SELECT " + sequenceName + ".nextval"; + return "SELECT " + sequenceName + ".nextval FROM dual"; } }
fixed sequence fethcing for Oracle
polyjdbc_polyjdbc
train
java
9dc0dce4dfdcd585ebb38bd4ce2683b81efe8dd0
diff --git a/monty/json.py b/monty/json.py index <HASH>..<HASH> 100644 --- a/monty/json.py +++ b/monty/json.py @@ -145,7 +145,7 @@ class MSONable(object): parent_module = self.__class__.__module__.split('.')[0] module_version = import_module(parent_module).__version__ d["@version"] = u"{}".format(module_version) - except (AttributeError, ModuleNotFoundError, ImportError): + except (AttributeError, ImportError): d["@version"] = None args = getargspec(self.__class__.__init__).args @@ -285,7 +285,7 @@ class MontyEncoder(json.JSONEncoder): parent_module = o.__class__.__module__.split('.')[0] module_version = import_module(parent_module).__version__ d["@version"] = u"{}".format(module_version) - except (AttributeError, ModuleNotFoundError, ImportError): + except (AttributeError, ImportError): d["@version"] = None return d except AttributeError:
Remove ModuleNotFoundError since not available in Py<I>
materialsvirtuallab_monty
train
py
83e82825f812fa897d888e9a488c1b28d7802199
diff --git a/src/select.js b/src/select.js index <HASH>..<HASH> 100644 --- a/src/select.js +++ b/src/select.js @@ -431,9 +431,11 @@ ctrl.selected = item; } - ctrl.onSelectCallback($scope, { + $timeout(function(){ + ctrl.onSelectCallback($scope, { $item: item, $model: ctrl.parserResult.modelMapper($scope, locals) + }); }); if (!ctrl.multiple || ctrl.closeOnSelect) {
Fixed bug where on-select event fired before the selected array was updated.
angular-ui_ui-select
train
js
708f70ff0d1dbd7dadf30d65175198795477d8ad
diff --git a/app/models/neighborly/balanced/refund.rb b/app/models/neighborly/balanced/refund.rb index <HASH>..<HASH> 100644 --- a/app/models/neighborly/balanced/refund.rb +++ b/app/models/neighborly/balanced/refund.rb @@ -26,7 +26,7 @@ module Neighborly::Balanced end def debit - @debit ||= ::Balanced::Debit.find("/v1/marketplaces/#{Configuration[:balanced_marketplace_id]}/debits/#{paid_resource.payment_id}") + @debit ||= ::Balanced::Debit.find("/debits/#{paid_resource.payment_id}") end def refundable_fees(refund_amount) diff --git a/spec/models/neighborly/balanced/refund_spec.rb b/spec/models/neighborly/balanced/refund_spec.rb index <HASH>..<HASH> 100644 --- a/spec/models/neighborly/balanced/refund_spec.rb +++ b/spec/models/neighborly/balanced/refund_spec.rb @@ -22,7 +22,7 @@ describe Neighborly::Balanced::Refund do describe 'debit' do it 'gets the debit object through Balanced API' do Balanced::Debit.stub(:find). - with('/v1/marketplaces/qwe/debits/1234567890'). + with('/debits/1234567890'). and_return(debit) expect(subject.debit).to eql(debit) end
Use href to perform refunds
FromUte_dune-balanced
train
rb,rb
6901721595da86226bdc26be902c186889d9c852
diff --git a/lxd/networks_config.go b/lxd/networks_config.go index <HASH>..<HASH> 100644 --- a/lxd/networks_config.go +++ b/lxd/networks_config.go @@ -173,11 +173,6 @@ func networkValidateConfig(name string, config map[string]string) error { } } } - - tunnels := networkGetTunnels(config) - if len(tunnels) > 0 && mtu > 1400 { - return fmt.Errorf("Maximum MTU when using tunnels is 1400") - } } }
networks: Don't require a <I> MTU with tunnels There are cases where users actually do properly configure jumbo frames on their underlying devices to allow for a normal MTU of <I> on the bridge. Closes #<I>
lxc_lxd
train
go
ebdd63e6f7c5d6da7a32485c381c4d36c82d5553
diff --git a/lib/Pear_CHAP.php b/lib/Pear_CHAP.php index <HASH>..<HASH> 100644 --- a/lib/Pear_CHAP.php +++ b/lib/Pear_CHAP.php @@ -199,7 +199,8 @@ class Crypt_CHAP_MSv1 extends Crypt_CHAP //function ntPasswordHash($password = null) // removed for dapphp/radius public function ntPasswordHash($password = null) { - if (isset($password)) { + //if (isset($password)) { + if (!is_null($password)) { return pack('H*',hash('md4', $this->str2unicode($password))); } else { return pack('H*',hash('md4', $this->str2unicode($this->password))); @@ -270,7 +271,7 @@ class Crypt_CHAP_MSv1 extends Crypt_CHAP * @return string */ //function _challengeResponse($lm = false) // removed for dapphp/radius - private function _challengeResponse($lm = false) + protected function _challengeResponse($lm = false) { if ($lm) { $hash = $this->lmPasswordHash();
Bug fix for NT password hashing when set as property
dapphp_radius
train
php
134a9d5e356563d711f25ca69f4c66158fa0f602
diff --git a/c7n/resources/appelb.py b/c7n/resources/appelb.py index <HASH>..<HASH> 100644 --- a/c7n/resources/appelb.py +++ b/c7n/resources/appelb.py @@ -309,9 +309,10 @@ class SetS3Logging(BaseAction): key: Attributes."access_logs.s3.enabled" value: False actions: - - type: enable-s3-logging + - type: set-s3-logging bucket: elbv2logtest prefix: dahlogs + state: enabled """ schema = type_schema( 'set-s3-logging',
docs - fix app-elb logging example, correct action name and include the required state parameter (#<I>)
cloud-custodian_cloud-custodian
train
py
be15d3bbe41d65b1bf2a9430a761f6a963e1ccf1
diff --git a/rqalpha/portfolio/__init__.py b/rqalpha/portfolio/__init__.py index <HASH>..<HASH> 100644 --- a/rqalpha/portfolio/__init__.py +++ b/rqalpha/portfolio/__init__.py @@ -279,7 +279,7 @@ class MixedPositions(dict): def __repr__(self): keys = [] for account in six.itervalues(self._accounts): - keys += account.positions.keys() + keys += [order_book_id for order_book_id, position in account.positions.items() if position.quantity > 0] return str(sorted(keys)) def __len__(self):
don't display position if quantity is 0
ricequant_rqalpha
train
py
76dd7c6475e71fce142ce75c6acce61ce2ad1ea0
diff --git a/lib/codemirror.js b/lib/codemirror.js index <HASH>..<HASH> 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -2258,8 +2258,8 @@ var CodeMirror = (function() { options.value = textarea.value; if (!options.tabindex && textarea.tabindex) options.tabindex = textarea.tabindex; - if (options.autofocus == null && textarea.getAttribute("autofocus") != null) - options.autofocus = true; + if (options.autofocus == null) + try { if (document.activeElement == textarea) options.autofocus = true; } catch(e) {} function save() {textarea.value = instance.getValue();} if (textarea.form) {
Change autofocus rules in fromTextArea It now focuses the new editor only if the textarea argument currently has focus. Closes #<I>
codemirror_CodeMirror
train
js
392c8697c2f2ed0b28883357624926b3f658d51e
diff --git a/lib/nearley.js b/lib/nearley.js index <HASH>..<HASH> 100644 --- a/lib/nearley.js +++ b/lib/nearley.js @@ -227,7 +227,7 @@ return pad(this.line - lines.length + i + 1, lastLineDigits) + " " + line; }, this) .join("\n"); - message += "\n" + pad("", lastLineDigits + col) + "⬆︎\n"; + message += "\n" + pad("", lastLineDigits + col) + "^\n"; return message; } else { return message + " at index " + (this.index - 1); diff --git a/test/parser.test.js b/test/parser.test.js index <HASH>..<HASH> 100644 --- a/test/parser.test.js +++ b/test/parser.test.js @@ -46,7 +46,7 @@ describe('Parser: API', function() { "", "1 abc", "2 12!", - " ⬆︎", + " ^", "", "Unexpected \"!\". Instead, I was expecting to see one of the following:", "", @@ -74,7 +74,7 @@ describe('Parser: API', function() { "Syntax error at line 1 col 4:", "", "1 abcd", - " ⬆︎", + " ^", "", "Unexpected \"d\". I did not expect any more input. Here is the state of my parse table:", "",
removed use of non-ascii character
kach_nearley
train
js,js
f2d483719be829c182ef19c89197a66cb3e279ed
diff --git a/lib/twitter/base.rb b/lib/twitter/base.rb index <HASH>..<HASH> 100644 --- a/lib/twitter/base.rb +++ b/lib/twitter/base.rb @@ -85,7 +85,7 @@ module Twitter # @param key2 [Symbol] def define_attribute_method(key1, klass = nil, key2 = nil) define_method(key1) do || - if @attrs[key1].nil? || @attrs[key1].respond_to?(:empty?) && @attrs[key1].empty? + if attr_falsey_or_empty?(key1) NullObject.new else if klass.nil? @@ -114,7 +114,7 @@ module Twitter # @param key2 [Symbol] def define_predicate_method(key1, key2 = key1) define_method(:"#{key1}?") do || - !!@attrs[key2] && !(@attrs[key2].respond_to?(:empty?) && @attrs[key2].empty?) + !attr_falsey_or_empty?(key2) end memoize(:"#{key1}?") end @@ -140,6 +140,10 @@ module Twitter private + def attr_falsey_or_empty?(key) + !@attrs[key] || @attrs[key].respond_to?(:empty?) && @attrs[key].empty? + end + def attrs_for_object(key1, key2 = nil) if key2.nil? @attrs[key1]
Extract private method Twitter::Base#attr_falsey_or_empty?
sferik_twitter
train
rb
8a6224e8b4aaacbab4364a0716f577fe1ccc62f5
diff --git a/examples/js/exchange-capabilities.js b/examples/js/exchange-capabilities.js index <HASH>..<HASH> 100644 --- a/examples/js/exchange-capabilities.js +++ b/examples/js/exchange-capabilities.js @@ -33,6 +33,8 @@ const ccxt = require ('../../ccxt.js') 'createLimitOrder', 'editOrder', 'cancelOrder', + 'cancelOrders', + 'cancelAllOrders', 'fetchOrder', 'fetchOrders', 'fetchOpenOrders', @@ -41,7 +43,14 @@ const ccxt = require ('../../ccxt.js') 'fetchCurrencies', 'fetchDepositAddress', 'createDepositAddress', + 'fetchTransactions', + 'fetchDeposits', + 'fetchWithdrawals', 'withdraw', + 'fetchLedger', + 'fetchFundingFees', + 'fetchTradingFees', + 'fetchTradingLimits', ].forEach (key => {
more properties to examples/js/exchange-capabilities
ccxt_ccxt
train
js
a70b060d81c497e75ef079c1c792d3dcf4ffc959
diff --git a/client/components/line-chart/index.js b/client/components/line-chart/index.js index <HASH>..<HASH> 100644 --- a/client/components/line-chart/index.js +++ b/client/components/line-chart/index.js @@ -87,9 +87,16 @@ class LineChart extends Component { }; static getDerivedStateFromProps( nextProps, prevState ) { + if ( prevState.data !== nextProps.data ) { + return { data: nextProps.data }; + } + // force refresh D3Base if fillArea has changed - if ( prevState.data !== nextProps.data || prevState.fillArea !== nextProps.fillArea ) { - return { data: [ ...nextProps.data ], fillArea: nextProps.fillArea }; + if ( prevState.fillArea !== nextProps.fillArea ) { + return { + data: [ ...nextProps.data ], + fillArea: nextProps.fillArea, + }; } return null;
Prevent infinite loop (#<I>)
Automattic_wp-calypso
train
js
2e67666a150647e1193bab60c9b4bc001413ddb0
diff --git a/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/proxy/ProxyImpl.java b/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/proxy/ProxyImpl.java index <HASH>..<HASH> 100644 --- a/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/proxy/ProxyImpl.java +++ b/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/proxy/ProxyImpl.java @@ -222,7 +222,11 @@ public class ProxyImpl implements MobicentsProxy, Externalizable { public void cancelAllExcept(ProxyBranch except, String[] protocol, int[] reasonCode, String[] reasonText, boolean throwExceptionIfCannotCancel) { if(logger.isDebugEnabled()) { - logger.debug("Cancelling all Branches except " + except + " with outgoing resquest " + except.getRequest()); + if(except == null) { + logger.debug("Cancelling all Branches except"); + } else { + logger.debug("Cancelling all Branches except " + except + " with outgoing resquest " + except.getRequest()); + } } for(ProxyBranch proxyBranch : proxyBranches.values()) { if(!proxyBranch.equals(except)) {
adding more debug statements to find the root cause on regressions for proxy tests
RestComm_sip-servlets
train
java
a77df62bbfbf30266190431ba99b269c1b47a531
diff --git a/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationPackage.java b/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationPackage.java index <HASH>..<HASH> 100644 --- a/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationPackage.java +++ b/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationPackage.java @@ -26,7 +26,6 @@ public class NavigationPackage implements ReactPackage { ); } - @Override public List<Class<? extends JavaScriptModule>> createJSModules() { return Collections.emptyList(); }
fix for breaking change in React Native <I> (#<I>)
wix_react-native-navigation
train
java
832525402091562950b1d14ccca40a68be5f306d
diff --git a/tests/regression.py b/tests/regression.py index <HASH>..<HASH> 100644 --- a/tests/regression.py +++ b/tests/regression.py @@ -18,6 +18,7 @@ import unittest from transit.reader import Reader from transit.writer import Writer from transit.transit_types import Symbol, frozendict, true, false +from decimal import Decimal from StringIO import StringIO class RegressionBaseTest(unittest.TestCase): @@ -43,6 +44,7 @@ regression("cache_consistency", ({"Problem?":true}, regression("one_pair_frozendict", frozendict({"a":1})) regression("json_int_max", (2**53+100, 2**63+100)) regression("newline_in_string", "a\nb") +regression("big_decimal", Decimal("190234710272.2394720347203642836434")) class BooleanTest(unittest.TestCase): """Even though we're roundtripping transit_types.true and
test that large big decimal roundtrips
cognitect_transit-python
train
py
7d4ad7c19e4be2e10e039da075dfd9815c6341fc
diff --git a/lib/data_mapper/property.rb b/lib/data_mapper/property.rb index <HASH>..<HASH> 100644 --- a/lib/data_mapper/property.rb +++ b/lib/data_mapper/property.rb @@ -434,13 +434,13 @@ module DataMapper @custom = DataMapper::Type > @type @options = @custom ? @type.options.merge(options) : options @instance_variable_name = "@#{@name}" - @getter = TrueClass == @type ? "#{@name}?".to_sym : @name # TODO: This default should move to a DataMapper::Types::Text # Custom-Type and out of Property. @lazy = @options.fetch(:lazy, @type.respond_to?(:lazy) ? @type.lazy : false) @primitive = @options.fetch(:primitive, @type.respond_to?(:primitive) ? @type.primitive : @type) - + + @getter = TrueClass == @primitive ? "#{@name}?".to_sym : @name @lock = @options.fetch(:lock, false) @serial = @options.fetch(:serial, false) @key = @options.fetch(:key, @serial || false)
fixed getter for all TrueClass-primitives to #property?, instead of only TrueClass-type
datamapper_dm-core
train
rb
7e8b2f5ae06ddef97355b607ccf0fbeb94bac88f
diff --git a/lib/luban/cli/version.rb b/lib/luban/cli/version.rb index <HASH>..<HASH> 100644 --- a/lib/luban/cli/version.rb +++ b/lib/luban/cli/version.rb @@ -1,5 +1,5 @@ module Luban module CLI - VERSION = "0.2.0" + VERSION = "0.3.0" end end
bump up version to <I>
lubanrb_cli
train
rb
ea5429da0ef94a906556dd70ce9aa55fc2792173
diff --git a/src/main/java/org/dita/dost/invoker/Main.java b/src/main/java/org/dita/dost/invoker/Main.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/dita/dost/invoker/Main.java +++ b/src/main/java/org/dita/dost/invoker/Main.java @@ -442,7 +442,7 @@ public class Main extends org.apache.tools.ant.Main implements AntMain { final String msg = "You must specify a log file when " + "using the -log argument"; throw new BuildException(msg); } - } else if (arg.equals("-buildfile") || arg.equals("-file") || arg.equals("-f")) { + } else if (arg.equals("-buildfile") || arg.equals("-file")) { //|| arg.equals("-f") i = handleArgBuildFile(args, i); } else if (arg.equals("-listener")) { i = handleArgListener(args, i);
Fix dita command The -f option was mishandled as an Ant option.
dita-ot_dita-ot
train
java
6591a10b1f6eccc91bc01ab708050884058e9665
diff --git a/railties/lib/rails/console_app.rb b/railties/lib/rails/console_app.rb index <HASH>..<HASH> 100644 --- a/railties/lib/rails/console_app.rb +++ b/railties/lib/rails/console_app.rb @@ -1,4 +1,5 @@ require 'active_support/all' +require 'active_support/test_case' require 'action_controller' # work around the at_exit hook in test/unit, which kills IRB
Reinstate explicit active_support/test_case require since console_app interacts with a non-autoloaded constant
rails_rails
train
rb
7b7763142b9d39fe10334848b1c3d9c57758871f
diff --git a/genepattern/static/index.js b/genepattern/static/index.js index <HASH>..<HASH> 100644 --- a/genepattern/static/index.js +++ b/genepattern/static/index.js @@ -11,6 +11,19 @@ define([ // Load the dependencies "base/js/namespace", "base/js/events", "jquery", + // Bootstrap loading the nbtools requirejs modules + "nbextensions/nbtools/tool_manager", + "nbextensions/nbtools/metadata_manager", + "nbextensions/nbtools/variable_manager", + "nbextensions/nbtools/utils", + "nbextensions/nbtools/toolbox", + "nbextensions/nbtools/text", + "nbextensions/nbtools/choice", + "nbextensions/nbtools/file", + "nbextensions/nbtools/typeahead", + "nbextensions/nbtools/uibuilder", + "nbextensions/nbtools/uioutput", + // Bootstrap loading the GenePattern requirejs modules "nbextensions/genepattern/resources/genepattern", "nbextensions/genepattern/resources/genepattern.navigation",
Load nbtools from source in case GPNB is initialized before nbtools
genepattern_genepattern-notebook
train
js
7fa13d718fafdcc42640d676f9ddacfa0653722b
diff --git a/packages/reactotron-app/App/Stores/UiStore.js b/packages/reactotron-app/App/Stores/UiStore.js index <HASH>..<HASH> 100644 --- a/packages/reactotron-app/App/Stores/UiStore.js +++ b/packages/reactotron-app/App/Stores/UiStore.js @@ -26,7 +26,7 @@ class UI { @observable customMessage = "" @observable showSendCustomDialog = false @observable isTimelineSearchVisible = false - @observable isTimelineOrderReversed = false + @observable isTimelineOrderReversed = JSON.parse(localStorage.getItem("isTimelineOrderReversed")) || false @observable isSidebarVisible = true @observable isStorybookShown = false @observable searchPhrase = "" @@ -139,6 +139,7 @@ class UI { @action toggleTimelineOrder = () => { this.isTimelineOrderReversed = !this.isTimelineOrderReversed + localStorage.setItem("isTimelineOrderReversed", JSON.stringify(this.isTimelineOrderReversed)) } @action
:sparkles: save isTimelineOrderReversed in localstorage
infinitered_reactotron
train
js
7fcfbdf170be1a7dd05fecb9b4fa98daaf396690
diff --git a/tinyscript/helpers/text.py b/tinyscript/helpers/text.py index <HASH>..<HASH> 100644 --- a/tinyscript/helpers/text.py +++ b/tinyscript/helpers/text.py @@ -6,11 +6,12 @@ import mdv import re from gettext import gettext as gt from pypandoc import convert_text +from slugify import slugify from .data.types.network import is_email, is_url -__features__ = ["gt", "txt2blockquote", "txt2bold", "txt2email", "txt2italic", "txt2olist", "txt2paragraph", +__features__ = ["gt", "slugify", "txt2blockquote", "txt2bold", "txt2email", "txt2italic", "txt2olist", "txt2paragraph", "txt2title", "txt2ulist", "txt2underline", "txt2url", "txt_terminal_render"] __all__ = __features__ + ["DOCFORMAT_THEME"]
Added missing shortcut to slugify
dhondta_tinyscript
train
py
f1bb6f083942813147b459216cac4123f43f69b1
diff --git a/src/transformers/models/albert/modeling_albert.py b/src/transformers/models/albert/modeling_albert.py index <HASH>..<HASH> 100755 --- a/src/transformers/models/albert/modeling_albert.py +++ b/src/transformers/models/albert/modeling_albert.py @@ -494,6 +494,7 @@ class AlbertPreTrainedModel(PreTrainedModel): """ config_class = AlbertConfig + load_tf_weights = load_tf_weights_in_albert base_model_prefix = "albert" _keys_to_ignore_on_load_missing = [r"position_ids"] @@ -623,7 +624,6 @@ ALBERT_INPUTS_DOCSTRING = r""" class AlbertModel(AlbertPreTrainedModel): config_class = AlbertConfig - load_tf_weights = load_tf_weights_in_albert base_model_prefix = "albert" def __init__(self, config, add_pooling_layer=True):
Fix load tf alias in Albert. (#<I>)
huggingface_pytorch-pretrained-BERT
train
py
d6248a13f3a1f1b22829f220c238e6aaa4a04d74
diff --git a/cmd_prove.go b/cmd_prove.go index <HASH>..<HASH> 100644 --- a/cmd_prove.go +++ b/cmd_prove.go @@ -54,9 +54,7 @@ func (v *CmdProve) Run() (err error) { Force: v.force, ProveUI: ui, } - if err = eng.Run(); err == nil { - G.Log.Notice("Success!") - } + err = eng.Run() return }
don't double-info on success
keybase_client
train
go
45552a56b964c55bff820ac6aba74530533a8d30
diff --git a/NeutronStandard/SniffHelpers.php b/NeutronStandard/SniffHelpers.php index <HASH>..<HASH> 100644 --- a/NeutronStandard/SniffHelpers.php +++ b/NeutronStandard/SniffHelpers.php @@ -74,7 +74,7 @@ class SniffHelpers { public function getEndOfFunctionPtr(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); $openFunctionBracketPtr = $phpcsFile->findNext(T_OPEN_CURLY_BRACKET, $stackPtr + 1); - return $openFunctionBracketPtr + return $openFunctionBracketPtr && isset($tokens[$openFunctionBracketPtr]['bracket_closer']) ? $tokens[$openFunctionBracketPtr]['bracket_closer'] : $this->getNextSemicolonPtr($phpcsFile, $stackPtr); }
Add an isset to getEndOfFunctionPtr (#<I>)
Automattic_phpcs-neutron-standard
train
php
741e8b60511ca34728591e8f5b7531949f0995cd
diff --git a/go/vt/vtgate/planbuilder/expr.go b/go/vt/vtgate/planbuilder/expr.go index <HASH>..<HASH> 100644 --- a/go/vt/vtgate/planbuilder/expr.go +++ b/go/vt/vtgate/planbuilder/expr.go @@ -126,8 +126,6 @@ func (pb *primitiveBuilder) findOrigin(expr sqlparser.Expr) (origin builder, pus if rb, isRoute := pb.bldr.(*route); !isRoute || rb.ERoute.Keyspace.Sharded { return false, errors.New("unsupported: LAST_INSERT_ID is only allowed for unsharded keyspaces") } - case node.Name.EqualString("database"): - expr = sqlparser.ReplaceExpr(expr, node, sqlparser.NewStrVal([]byte(pb.vschema.TargetString()))) } return true, nil }
partially revert commit <I>fc9dffe which added handling of the database() function to vtgates. that commit was intended to fix a problem for Tirsen, but Sugu reports that it did not. in the process, it broke an invocation of that function by liquibase here, which was not expecting a full `...@master` target.
vitessio_vitess
train
go
a46858e5eab6625c726d058303e484930e0f1083
diff --git a/script/profile.rb b/script/profile.rb index <HASH>..<HASH> 100755 --- a/script/profile.rb +++ b/script/profile.rb @@ -18,6 +18,7 @@ SOCKET_FILE = Pathname.glob(%w[ /tmp/mysqld.sock /tmp/mysql.sock /var/mysql/mysql.sock + /var/run/mysqld/mysqld.sock ]).find { |path| path.socket? } DataMapper::Logger.new(DataMapper.root / 'log' / 'dm.log', :debug)
added mysql socket location common on ubuntu
datamapper_dm-core
train
rb
dc71045d941e59691f610df0fcee85dc0e543def
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 @@ -6,6 +6,7 @@ ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../spec/dummy/config/environment", __FILE__) require 'rspec/rails' require 'rspec/autorun' +require 'rspec/collection_matchers' require "factory_girl_rails" require "database_cleaner"
Require collection_matchers in spec_helper.rb to allow use of `have` expectation
continuum_espinita
train
rb
624deedc254235563be5ec668cef33fb2b139e72
diff --git a/src/remark/controller.js b/src/remark/controller.js index <HASH>..<HASH> 100644 --- a/src/remark/controller.js +++ b/src/remark/controller.js @@ -75,8 +75,8 @@ function addKeyboardEventListeners (events) { case 'c': events.emit('createClone'); break; - case 'n': - events.emit('toggleNotes'); + case 'p': + events.emit('togglePresenterMode'); break; case '?': events.emit('toggleHelp'); diff --git a/src/remark/views/slideshowView.js b/src/remark/views/slideshowView.js index <HASH>..<HASH> 100644 --- a/src/remark/views/slideshowView.js +++ b/src/remark/views/slideshowView.js @@ -39,7 +39,7 @@ function SlideshowView (events, containerElement, slideshow) { self.showSlide(slideIndex); }); - events.on('toggleNotes', function () { + events.on('togglePresenterMode', function () { toggleClass(self.containerElement, 'remark-presenter-mode'); self.presenterMode = !!!self.presenterMode;
Use p rather than n to toggle presenter mode.
gnab_remark
train
js,js
0890c33717a50f3abc56ee87247b0ac0b8b95135
diff --git a/src/Query/JoinRelTrait.php b/src/Query/JoinRelTrait.php index <HASH>..<HASH> 100644 --- a/src/Query/JoinRelTrait.php +++ b/src/Query/JoinRelTrait.php @@ -21,7 +21,7 @@ trait JoinRelTrait { return $this; } - public function joinNestedRels(AbstractDbRepo $repo, array $rels, $parent) + private function joinNestedRels(AbstractDbRepo $repo, array $rels, $parent) { foreach ($rels as $name => $childRels) {
:lipstick: This method is for internal use only
harp-orm_harp
train
php
509541285e4146cf7d5885bfae0685323c7596cc
diff --git a/dwm/dwmmain.py b/dwm/dwmmain.py index <HASH>..<HASH> 100644 --- a/dwm/dwmmain.py +++ b/dwm/dwmmain.py @@ -266,3 +266,30 @@ class Dwm(object): record[field] = field_val_new return record, hist, check_match + + def _derive(self, record, hist=None): + """ + + :param record: + :param hist: + :return: + """ + + if hist is None: + hist = {} + + for field in record: + + if record[field] != '' and record[field] is not None: + + if field in self.fields: + field_val_new, hist_obj_upd = DeriveDataLookupAll( + data=field, + configFields=record[field], + db=self.mongo, + histObj=hist + ) + + record[field] = field_val_new + + return record, hist_obj_upd \ No newline at end of file
add _derive method: performing derive rules for all fields, based on config
rh-marketingops_dwm
train
py
590e838ce4bf7d260f6e559c9ca5abb84de30818
diff --git a/lib/rails-footnotes/notes/session_note.rb b/lib/rails-footnotes/notes/session_note.rb index <HASH>..<HASH> 100644 --- a/lib/rails-footnotes/notes/session_note.rb +++ b/lib/rails-footnotes/notes/session_note.rb @@ -4,7 +4,7 @@ module Footnotes module Notes class SessionNote < AbstractNote def initialize(controller) - @session = (controller.session.data || {}).symbolize_keys + @session = (controller.session || {}).symbolize_keys end def title
session.dad is deprecated
josevalim_rails-footnotes
train
rb
b4490dfc32aa15b590690aa9434c1968f138509d
diff --git a/graphcommons.py b/graphcommons.py index <HASH>..<HASH> 100644 --- a/graphcommons.py +++ b/graphcommons.py @@ -180,13 +180,13 @@ class GraphCommons(object): def new_graph(self, signals=None, **kwargs): if signals is not None: - kwargs['signals'] = map(dict, signals) + kwargs['signals'] = list(map(dict, signals)) response = self.make_request('post', 'graphs', data=kwargs) return Graph(**response.json()['graph']) def update_graph(self, id, signals=None, **kwargs): if signals is not None: - kwargs['signals'] = map(dict, signals) + kwargs['signals'] = list(map(dict, signals)) endpoint = 'graphs/%s/add' % id response = self.make_request('put', endpoint, data=kwargs) return Graph(**response.json()['graph'])
#4: casting map() calls to lists
graphcommons_graphcommons-python
train
py
c458d820763c11dc868e1e379baa3555f8dd0b8a
diff --git a/sequence_prediction/mackey_glass/run.py b/sequence_prediction/mackey_glass/run.py index <HASH>..<HASH> 100755 --- a/sequence_prediction/mackey_glass/run.py +++ b/sequence_prediction/mackey_glass/run.py @@ -63,7 +63,7 @@ def createModel(modelParams): def runIoThroughNupic(inputData, model, dataName, plot): - inputFile = open(inputData, "rb") + inputFile = open(inputData, "rU") csvReader = csv.reader(inputFile) # skip header rows csvReader.next()
Better opening of files for csv
numenta_htmresearch
train
py
52b8e1903f742665336d6b440febf99589cde620
diff --git a/chain/chain.go b/chain/chain.go index <HASH>..<HASH> 100644 --- a/chain/chain.go +++ b/chain/chain.go @@ -224,7 +224,6 @@ func parseBlock(block *btcjson.BlockDetails) (*wtxmgr.BlockMeta, error) { } func (c *Client) onClientConnect() { - log.Info("Established websocket RPC connection to btcd") select { case c.enqueueNotification <- ClientConnected{}: case <-c.quit: diff --git a/log.go b/log.go index <HASH>..<HASH> 100644 --- a/log.go +++ b/log.go @@ -21,6 +21,7 @@ import ( "os" "github.com/btcsuite/btclog" + "github.com/btcsuite/btcrpcclient" "github.com/btcsuite/btcwallet/chain" "github.com/btcsuite/btcwallet/wallet" "github.com/btcsuite/btcwallet/wtxmgr" @@ -92,6 +93,7 @@ func useLogger(subsystemID string, logger btclog.Logger) { case "CHNS": chainLog = logger chain.UseLogger(logger) + btcrpcclient.UseLogger(logger) } }
Add the chain subsystem logger to btcrpcclient. Logging from btcrpcclient is currently not possible to set, and defaults to nothing. Letting it inherit chain's logger can greatly simplify debugging of connectivity issues. Also remove a now redundant log message upon connecting to btcd.
btcsuite_btcwallet
train
go,go
bb479ccad327860e0f8732698f3b428ba9858be3
diff --git a/start-control-server.js b/start-control-server.js index <HASH>..<HASH> 100644 --- a/start-control-server.js +++ b/start-control-server.js @@ -1,6 +1,6 @@ let http = require('http') -const MAX_VERSION = 0 +const MAX_VERSION = 1 const NO_PASSWORD = 'Set `controlPassword` option for Logux ' + 'to have access to this page.\n' + 'Run `npx nanoid-cli` to generate secure password.'
Upgrade max version for control http server (#<I>)
logux_server
train
js
0419713a1f0ad90be0121cf59b8c6b2af9dfa4e0
diff --git a/src/Mapper/AbstractMapper.php b/src/Mapper/AbstractMapper.php index <HASH>..<HASH> 100644 --- a/src/Mapper/AbstractMapper.php +++ b/src/Mapper/AbstractMapper.php @@ -109,6 +109,30 @@ abstract class AbstractMapper implements MapperInterface /** * + * Returns the Table read connection. + * + * @return ExtendedPdoInterface + * + */ + public function getReadConnection() : ExtendedPdoInterface + { + return $this->table->getReadConnection(); + } + + /** + * + * Returns the Table write connection. + * + * @return ExtendedPdoInterface + * + */ + public function getWriteConnection() : ExtendedPdoInterface + { + return $this->table->getWriteConnection(); + } + + /** + * * Returns the relationships to other Mapper objects. * * @return Relationships
put back mapper getRead/WriteConnection in the interest of maintaining the old API as much as possible
atlasphp_Atlas.Orm
train
php
a0b211cdc5728c2a9395c563acd569bb02d7ad57
diff --git a/cssbeautify.js b/cssbeautify.js index <HASH>..<HASH> 100644 --- a/cssbeautify.js +++ b/cssbeautify.js @@ -199,7 +199,7 @@ } // Selector or at-rule - if (isName(ch) || (ch === '@')) { + if (isName(ch) || (ch === '[') || (ch === '@')) { // Clear trailing whitespaces and linefeeds. str = trimRight(formatted); diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -208,6 +208,7 @@ var tests = { '* { border: 0px solid blue; }', 'div[class="{}"] { color: red; }', 'a[id=\\"foo"] { padding: 0; }', + '[id=\\"foo"] { margin: 0; }', '#menu, #nav, #footer { color: royalblue; }' ], expected: [ @@ -223,6 +224,10 @@ var tests = { ' padding: 0;', '}', '', + '[id=\\"foo"] {', + ' margin: 0;', + '}', + '', '#menu, #nav, #footer {', ' color: royalblue;', '}'
Fix issue #<I>: Handle attribute selector properly.
senchalabs_cssbeautify
train
js,js
c3ae6d416043ca528e9cf88c4789afa9df223c5b
diff --git a/tests/test_config_cmd.py b/tests/test_config_cmd.py index <HASH>..<HASH> 100644 --- a/tests/test_config_cmd.py +++ b/tests/test_config_cmd.py @@ -47,8 +47,7 @@ class ConfigTestCase(support.LoggingSilencer, cmd = config(dist) cmd._check_compiler() compiler = cmd.compiler - is_xlc = shutil.which(compiler.preprocessor[0]).startswith("/usr/vac") - if is_xlc: + if sys.platform[:3] == "aix" and "xlc" in compiler.preprocessor[0].lower(): self.skipTest('xlc: The -E option overrides the -P, -o, and -qsyntaxonly options') # simple pattern searches
bpo-<I>: distutils test_search_cpp: Fix logic to determine if C compiler is xlc on AIX (GH-<I>)
pypa_setuptools
train
py
5c6e1064950ae8dee4bef27ef0f05284230419b9
diff --git a/ucms_search/src/Lucene/AbstractFuzzyQuery.php b/ucms_search/src/Lucene/AbstractFuzzyQuery.php index <HASH>..<HASH> 100644 --- a/ucms_search/src/Lucene/AbstractFuzzyQuery.php +++ b/ucms_search/src/Lucene/AbstractFuzzyQuery.php @@ -51,7 +51,7 @@ abstract class AbstractFuzzyQuery extends AbstractQuery { $raw = trim($this->toRawString()); - if (empty($raw)) { + if (!isset($raw) || (''===$raw)) { return ''; } diff --git a/ucms_search/src/Lucene/AbstractQuery.php b/ucms_search/src/Lucene/AbstractQuery.php index <HASH>..<HASH> 100644 --- a/ucms_search/src/Lucene/AbstractQuery.php +++ b/ucms_search/src/Lucene/AbstractQuery.php @@ -119,7 +119,7 @@ abstract class AbstractQuery { $raw = trim($this->toRawString()); - if (empty($raw)) { + if (!isset($raw) || (''===$raw)) { return ''; }
BUG: filter on value 0 broke filtering, review please @Pierre Rineau Having a filter on value 0 would make this filter removed. Saw it on a AND condition with 2 filters where the first one was removed.
makinacorpus_drupal-ucms
train
php,php
2b8cf28f3be32903b79e5b5b579fab38105791dd
diff --git a/setuptools/tests/test_msvc.py b/setuptools/tests/test_msvc.py index <HASH>..<HASH> 100644 --- a/setuptools/tests/test_msvc.py +++ b/setuptools/tests/test_msvc.py @@ -83,10 +83,12 @@ class TestModulePatch: with mock_reg(): assert find_vcvarsall(9.0) is None - expected = distutils.errors.DistutilsPlatformError - with pytest.raises(expected) as exc: + try: query_vcvarsall(9.0) - assert 'aka.ms/vcpython27' in str(exc) + except Exception as exc: + expected = distutils.errors.DistutilsPlatformError + assert isinstance(expected, exc) + assert 'aka.ms/vcpython27' in str(exc) @pytest.yield_fixture def user_preferred_setting(self):
Exception will not raise because MSVC9 may be find by new behavior at setuptools/msvc.py line <I>.
pypa_setuptools
train
py
82931e8cadfe79bbc35bbfbc8d1f89fe69456525
diff --git a/test/test_pynml.py b/test/test_pynml.py index <HASH>..<HASH> 100644 --- a/test/test_pynml.py +++ b/test/test_pynml.py @@ -11,11 +11,16 @@ Author: Ankur Sinha <sanjay DOT ankur AT gmail DOT com> import unittest import os import shutil +import logging from pyneuroml.pynml import (extract_lems_definition_files, list_exposures, list_recording_paths) +logger = logging.getLogger(__name__) +logger.setLevel(logging.DEBUG) + + class TestJarUtils(unittest.TestCase): """Test jNeuroML jar related functions"""
improvement(tests): set default logging level for test
NeuroML_pyNeuroML
train
py
a85c499832cce90ec18b63cbb4398f6e006dbec2
diff --git a/tds/src/main/java/thredds/servlet/ThreddsDefaultServlet.java b/tds/src/main/java/thredds/servlet/ThreddsDefaultServlet.java index <HASH>..<HASH> 100644 --- a/tds/src/main/java/thredds/servlet/ThreddsDefaultServlet.java +++ b/tds/src/main/java/thredds/servlet/ThreddsDefaultServlet.java @@ -690,7 +690,8 @@ public class ThreddsDefaultServlet extends AbstractServlet { debugHandler = DebugHandler.get("catalogs"); act = new DebugHandler.Action("reinit", "Reinitialize") { public void doAction(DebugHandler.Event e) { - catHandler.reinit(); + // TODO The calls to reinit() and initCatalogs() are synchronized but should be atomic. + // TODO Should change this to build config data structure and synch only when replacing the old with the new structure. catHandler.reinit(); ThreddsConfig.readConfig(log); initCatalogs(); e.pw.println( "reinit ok");
Add ToDo comments to reinit action.
Unidata_thredds
train
java
5ac8ac0e6c7939ddd42fbaefd63c64f4ec2ee045
diff --git a/superset/views/redirects.py b/superset/views/redirects.py index <HASH>..<HASH> 100644 --- a/superset/views/redirects.py +++ b/superset/views/redirects.py @@ -66,7 +66,7 @@ class R(BaseSupersetView): # pylint: disable=invalid-name url = request.form.get("data") if not self._validate_url(url): logger.warning("Invalid URL: %s", url) - return Response(f"Invalid URL: {url}", 400) + return Response("Invalid URL", 400) obj = models.Url(url=url) db.session.add(obj) db.session.commit()
fix: don't send invalid URLs back to the user (#<I>) * fix: don't send bogus URLs back to the user * lint, remove f string
apache_incubator-superset
train
py
4d608dbb348c52b3f719f3631aae6008cafefcb5
diff --git a/dockertest.go b/dockertest.go index <HASH>..<HASH> 100644 --- a/dockertest.go +++ b/dockertest.go @@ -557,7 +557,7 @@ func (d *Pool) Retry(op func() error) error { bo.MaxElapsedTime = d.MaxWait if err := backoff.Retry(op, bo); err != nil { if bo.NextBackOff() == backoff.Stop { - return fmt.Errorf("reached retry deadline") + return fmt.Errorf("reached retry deadline: %w", err) } return err
fix: return original error from retry deadline (#<I>)
ory_dockertest
train
go
1ef9abb2e6b64e10c16294f7117f01efc7c83e6a
diff --git a/src/android/java/io/jxcore/node/ConnectionHelper.java b/src/android/java/io/jxcore/node/ConnectionHelper.java index <HASH>..<HASH> 100644 --- a/src/android/java/io/jxcore/node/ConnectionHelper.java +++ b/src/android/java/io/jxcore/node/ConnectionHelper.java @@ -256,9 +256,8 @@ public class ConnectionHelper String errorMessage = null; if (mConnectionModel.hasOutgoingConnection(bluetoothMacAddress)) { - errorMessage = "We already have an outgoing connection to peer with ID " - + bluetoothMacAddress; - Log.e(TAG, "connect: " + errorMessage); + Log.e(TAG, "connect: We already have an outgoing connection to peer with ID " + bluetoothMacAddress); + errorMessage = "Already connect(ing/ed)"; return errorMessage; }
Fixed unit test case, Get error when trying to double connect to a peer, failure.
thaliproject_Thali_CordovaPlugin
train
java
bea58adcf959305ab1b7481e6eecd18c766bcb0c
diff --git a/lib/rbgccxml/query_result.rb b/lib/rbgccxml/query_result.rb index <HASH>..<HASH> 100644 --- a/lib/rbgccxml/query_result.rb +++ b/lib/rbgccxml/query_result.rb @@ -72,7 +72,7 @@ module RbGCCXML if options[0] == :all node_type = self[0].class.to_s.split(/::/)[-1] - query_set = XMLParsing.find_all(:node_type => node_type) + query_set = NodeCache.all(node_type) options = options[1] else options = options[0]
Fixed query result to not use xmlparsing
jasonroelofs_rbgccxml
train
rb
23f3cc075629ae14a178fbc7c05caaf33995d938
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1006,9 +1006,7 @@ function makeModulesGetHostnameProto(module, version, instance) { } function createAppEngine() { - var ae = new AppEngine(); - ae.exportAll_(); - return ae; + return new AppEngine(); } module.exports = createAppEngine();
Update createAppEngine to avoid calling exportAll twice.
googlearchive_appengine-nodejs
train
js
91e2a8ad3aabeeffeda492cae5f2f44cefdc8ed5
diff --git a/smbclient/_os.py b/smbclient/_os.py index <HASH>..<HASH> 100644 --- a/smbclient/_os.py +++ b/smbclient/_os.py @@ -199,7 +199,7 @@ def copyfile(src, dst, **kwargs): def link(src, dst, follow_symlinks=True, **kwargs): """ - Create a hard link pointing to src named dst. The src argument must be an absolute path in the same share as + Create a hard link pointing to src named dst. The dst argument must be an absolute path in the same share as src. :param src: The full UNC path to used as the source of the hard link.
Fix comment to clarify requirement (#<I>)
jborean93_smbprotocol
train
py
35f1ca453103e208f409a6a7a79ceb92f51cc92f
diff --git a/reader_test.go b/reader_test.go index <HASH>..<HASH> 100644 --- a/reader_test.go +++ b/reader_test.go @@ -63,6 +63,7 @@ func TestQueuereader(t *testing.T) { addr, _ := net.ResolveTCPAddr("tcp", "127.0.0.1:4150") q, _ := NewReader("reader_test", "ch") + q.VerboseLogging = true q.DefaultRequeueDelay = 0 // so that the test can simulate reaching max requeues and a call to LogFailedMessage h := &MyTestHandler{
set a deadline on TCP writes to clients; atomically set client state
nsqio_go-nsq
train
go
172f6d95e14591dc43016448f17e7dc6873b41f7
diff --git a/question/format.php b/question/format.php index <HASH>..<HASH> 100644 --- a/question/format.php +++ b/question/format.php @@ -181,6 +181,7 @@ class qformat_default { $question->image = ""; $question->usecase = 0; $question->multiplier = array(); + $question->generalfeedback = ''; return $question; } diff --git a/question/format/gift/format.php b/question/format/gift/format.php index <HASH>..<HASH> 100755 --- a/question/format/gift/format.php +++ b/question/format/gift/format.php @@ -292,7 +292,10 @@ class qformat_gift extends qformat_default { } $question->fraction[$key] = $answer_weight; $question->feedback[$key] = $this->commentparser($answer); // commentparser also removes comment from $answer - $question->answer[$key] = addslashes($this->escapedchar_post($answer)); + $question->answer[$key] = addslashes($this->escapedchar_post($answer)); + $question->correctfeedback = ''; + $question->partiallycorrectfeedback = ''; + $question->incorrectfeedback = ''; } // end foreach answer //$question->defaultgrade = 1;
Fix bugs with GIFT import. Merged from MOODLE_<I>_STABLE.
moodle_moodle
train
php,php
2100cf6357825882f538e4457381204dd742bd8d
diff --git a/packages/views/src/lib/buildPugLocals.js b/packages/views/src/lib/buildPugLocals.js index <HASH>..<HASH> 100644 --- a/packages/views/src/lib/buildPugLocals.js +++ b/packages/views/src/lib/buildPugLocals.js @@ -32,7 +32,7 @@ export const buildPugLocals = ({packageJson, helmetContent, ...passedLocals}) => const locals = { environment: process.env.NODE_ENV || "local", assetUrl, - logger: config.has("logger") ? JSON.stringify(config.get("logger")) : null, + logger: config.has("logger") ? JSON.stringify(config.get("logger")) : JSON.stringify(null), sentryDsn: config.has("sentry.dsn") ? config.get("sentry.dsn") : null, gtmContainerId: config.has("gtm.container.id") ? config.get("gtm.container.id") : null, gaPropertyId: config.has("ga.property.id") ? config.get("ga.property.id") : null,
fix(views): Need to `JSON.stringify` this `null` Pug local value. Since Pug'll just burn in an empty string into the HTML, which is bad.
randytarampi_me
train
js
73664c5dd44021c353db373705e5a240eef704d5
diff --git a/gwpy/cli/qtransform.py b/gwpy/cli/qtransform.py index <HASH>..<HASH> 100644 --- a/gwpy/cli/qtransform.py +++ b/gwpy/cli/qtransform.py @@ -114,7 +114,7 @@ class Qtransform(Spectrogram): search = args.search # ensure we have enough data for filter settling max_plot = max(args.plot) - search = max(search, max_plot * 2 + 6) + search = max(search, max_plot * 2 + 8) args.search = search self.log(3, "Search window: {0:.0f} sec, max plot window {1:.0f}". format(search, max_plot))
Sync min read and filter pad for qxfrm
gwpy_gwpy
train
py
8e38804aef247c921edf946dc04c4c5e3ce0c60b
diff --git a/rah_backup.php b/rah_backup.php index <HASH>..<HASH> 100644 --- a/rah_backup.php +++ b/rah_backup.php @@ -745,13 +745,13 @@ EOF; foreach($selected as $file) { - $ext = pathinfo($file, PATHINFO_EXTENSION); + $ext = pathinfo((string) $file, PATHINFO_EXTENSION); if(!$file || !$ext || ($ext !== 'sql' && $ext !== 'gz' && $ext !== 'tar')) { continue; } - $file = $this->backup_dir.'/'.preg_replace('/[^A-Za-z0-9-._]/', '', $file); + $file = $this->backup_dir.'/'.preg_replace('/[^A-Za-z0-9-._]/', '', (string) $file); if(!file_exists($file) || !is_writeable($file) || !is_file($file)) { continue;
Cast the value as a string so that PHP doesn't have possibility to do its thing and provide incorrect results.
gocom_rah_backup
train
php
a19fcdf85e8ea60015663d613e51f4bc5178f697
diff --git a/shared/store/model_store.js b/shared/store/model_store.js index <HASH>..<HASH> 100644 --- a/shared/store/model_store.js +++ b/shared/store/model_store.js @@ -8,6 +8,8 @@ function ModelStore() { } _.extend(ModelStore.prototype, Super.prototype, { + expireSeconds: null, + set: function(model) { var key, modelName; @@ -21,7 +23,7 @@ _.extend(ModelStore.prototype, Super.prototype, { // Make sure we have a fully parsed model before we store the attributes model.parse(model.attributes); - return Super.prototype.set.call(this, key, model, null); + return Super.prototype.set.call(this, key, model, this.expireSeconds); }, get: function(modelName, id) { @@ -39,7 +41,7 @@ _.extend(ModelStore.prototype, Super.prototype, { var cachedItems = this._getCachedItemsByModel(modelName), self = this, modelStoreKey; - _.each(cachedItems, function (item) { + _.each(cachedItems, function (item) { modelStoreKey = self._getModelStoreKey(modelName, item.value.id); Super.prototype.clear.call(self, modelStoreKey); });
added an expires key that we can set on the model_store to clear the value in the model store
rendrjs_rendr
train
js
0d4b9db9b9611b6569b538349c4f90f055b8278c
diff --git a/tests/iarm/test_parsing.py b/tests/iarm/test_parsing.py index <HASH>..<HASH> 100644 --- a/tests/iarm/test_parsing.py +++ b/tests/iarm/test_parsing.py @@ -50,5 +50,9 @@ class TestArmValidation(TestArm): with self.assertRaises(iarm.exceptions.ValidationError): self.interp.evaluate(' BADINST') + def test_bad_formatting(self): + with self.assertRaises(iarm.exceptions.ValidationError): + self.interp.evaluate('B .') # `B .` used to pass because `.` is not letter, had to fix regex + if __name__ == '__main__': unittest.main()
Added regression test for `B .`
DeepHorizons_iarm
train
py
6720f61868067c1a3b8ede2f855e26dbad94c332
diff --git a/tests/test_context.py b/tests/test_context.py index <HASH>..<HASH> 100644 --- a/tests/test_context.py +++ b/tests/test_context.py @@ -107,6 +107,14 @@ class ContextTests(TestCase): self.assertIsInstance(ctx.TRIANGLE_STRIP_ADJACENCY, int) self.assertIsInstance(ctx.PATCHES, int) + # Texture filters + self.assertIsInstance(ctx.LINEAR, int) + self.assertIsInstance(ctx.NEAREST, int) + self.assertIsInstance(ctx.NEAREST_MIPMAP_NEAREST, int) + self.assertIsInstance(ctx.LINEAR_MIPMAP_LINEAR, int) + self.assertIsInstance(ctx.LINEAR_MIPMAP_NEAREST, int) + self.assertIsInstance(ctx.NEAREST_MIPMAP_LINEAR, int) + # Blend functions self.assertIsInstance(ctx.ZERO, int) self.assertIsInstance(ctx.ONE, int)
Test the presence of texture filters in context
moderngl_moderngl
train
py
7984b83c4ee04ec6be363c073b6e92f7029eb4a0
diff --git a/lxd/daemon.go b/lxd/daemon.go index <HASH>..<HASH> 100644 --- a/lxd/daemon.go +++ b/lxd/daemon.go @@ -326,7 +326,7 @@ func StartDaemon(listenAddr string) (*Daemon, error) { } else { shared.Log.Debug("Default uid/gid map:") for _, lxcmap := range d.IdmapSet.ToLxcString() { - shared.Log.Debug(" - " + lxcmap) + shared.Log.Debug(strings.TrimRight(" - "+lxcmap, "\n")) } }
Fix uid/gid logging at daemon startup
lxc_lxd
train
go
51df21ad20c4f38c53356f84618d0dd4139f47fc
diff --git a/lib/brcobranca/version.rb b/lib/brcobranca/version.rb index <HASH>..<HASH> 100644 --- a/lib/brcobranca/version.rb +++ b/lib/brcobranca/version.rb @@ -2,5 +2,5 @@ # module Brcobranca - VERSION = '7.2.0' + VERSION = '7.2.1' end
bump up version to <I>
kivanio_brcobranca
train
rb
b7b1e3208e1107967eccbf40412c86a1b87be177
diff --git a/lib/wml_action/cli.rb b/lib/wml_action/cli.rb index <HASH>..<HASH> 100644 --- a/lib/wml_action/cli.rb +++ b/lib/wml_action/cli.rb @@ -6,8 +6,13 @@ module WmlAction class CLI < Thor include Log + class_option :verbose, type: :boolean, aliases: '-v' + class_option :debug, type: :boolean, aliases: '-d' + desc "modify SRC DEST", "Modifies a wml" def modify(original,modlist) + log.level=Logger::INFO if options[:verbose] + log.level=Logger::DEBUG if options[:debug] target_name=original modlist_name=modlist @@ -31,14 +36,18 @@ module WmlAction desc "read FILE", "Reads and outputs a wml" def read(filename) + log.level=Logger::INFO if options[:verbose] + log.level=Logger::DEBUG if options[:debug] d=Document.from_file(filename) - print d.root.dumpSection() + print d.root.dumpSection end desc "action_read FILE", "Reads and outputs an action wml" def action_read(filename) + log.level=Logger::INFO if options[:verbose] + log.level=Logger::DEBUG if options[:debug] d=ActionDocument.from_file(filename) - print d.root.dumpSection() + print d.root.dumpSection end end
Added verbose and debug options to cli
pancho-bo_wml_action
train
rb
417501a31d475fb0adec4054b6be8793a2534f2e
diff --git a/src/DoctrineProxySubscriber.php b/src/DoctrineProxySubscriber.php index <HASH>..<HASH> 100644 --- a/src/DoctrineProxySubscriber.php +++ b/src/DoctrineProxySubscriber.php @@ -61,7 +61,7 @@ class DoctrineProxySubscriber extends BaseDoctrineProxySubscriber } if (!$virtualType) { - if ($this->enableLazyLoading) { + if ($this->enableLazyLoading || $object->__isInitialized()) { $event->setType(get_parent_class($object)); } else { $event->setType(SerializerProxyType::class, array(
Don't set SerializerProxyType as type if proxy is initialized
alcalyn_serializer-doctrine-proxies
train
php
fb58fe683a19cdfe8b165e16704089be71e19ff7
diff --git a/timezones/fields.py b/timezones/fields.py index <HASH>..<HASH> 100644 --- a/timezones/fields.py +++ b/timezones/fields.py @@ -38,7 +38,7 @@ class TimeZoneField(models.CharField): def formfield(self, **kwdargs): defaults = {"form_class": forms.TimeZoneField} defaults.update(kwdargs) - return super(TimeZoneField, self).formfield(**defaults) + return super(models.CharField, self).formfield(**defaults) class LocalizedDateTimeField(models.DateTimeField): """
Skip models.CharField in the super call in TimeZoneField formfield method since ultimately a forms.ChoiceField has no notion of max_length. git-svn-id: <URL>
brosner_django-timezones
train
py
c2b3e302526f7ff48b097be8a16dadc9d9bcdc8c
diff --git a/tests/test_hybrid.py b/tests/test_hybrid.py index <HASH>..<HASH> 100644 --- a/tests/test_hybrid.py +++ b/tests/test_hybrid.py @@ -17,6 +17,26 @@ import pyiso from common import * +def test_hybrid_nofiles(tmpdir): + # First set things up, and generate the ISO with genisoimage. + outfile = tmpdir.join("nofile-test.iso") + indir = tmpdir.mkdir("nofile") + with open(os.path.join(str(tmpdir), "nofile", "foo"), 'wb') as outfp: + outfp.write("foo\n") + subprocess.call(["genisoimage", "-v", "-v", "-iso-level", "1", "-no-pad", + "-o", str(outfile), str(indir)]) + + # Now open up the ISO with pyiso and check some things out. + iso = pyiso.PyIso() + iso.open(open(str(outfile), 'rb')) + + iso.rm_file("/FOO.;1") + + out = StringIO.StringIO() + iso.write(out) + + check_nofile(iso, len(out.getvalue())) + def test_hybrid_twofiles(tmpdir): # First set things up, and generate the ISO with genisoimage. outfile = tmpdir.join("twofile-test.iso")
Add in a new hybrid test.
clalancette_pycdlib
train
py
c8e71a577582feffd30c9d312ef30647328cba13
diff --git a/spec/assessments/complexWordsSpec.js b/spec/assessments/complexWordsSpec.js index <HASH>..<HASH> 100644 --- a/spec/assessments/complexWordsSpec.js +++ b/spec/assessments/complexWordsSpec.js @@ -14,8 +14,7 @@ describe( "an assessment returning complex words", function() { it( "runs a test with exactly 10% too many syllables", function(){ var mockPaper = new Paper( "" ); var result = wordComplexityAssessment.getResult( mockPaper, Factory.buildMockResearcher( [ 1, 2, 3, 1, 3, 3, 1, 2, 1, 10 ] ), i18n ); - //floating point bug - expect( result.getScore() ).toBe( 7.0200000000000005 ); + expect( result.getScore() ).toBe( 7.02 ); expect( result.getText() ).toBe( "10% of the words contain over 4 syllables, which is within the recommended range." ); } );
Updates spec after fixen floating point bug
Yoast_YoastSEO.js
train
js
d01ef68ce91312392d74076600bc6236ddd2c488
diff --git a/storops/lib/resource.py b/storops/lib/resource.py index <HASH>..<HASH> 100755 --- a/storops/lib/resource.py +++ b/storops/lib/resource.py @@ -218,7 +218,7 @@ class ResourceList(Resource): @classmethod def get_rsc_clz_list(cls, rsc_list_collection): - return [l.get_resource_class() for l in rsc_list_collection] + return [lst.get_resource_class() for lst in rsc_list_collection] @clear_instance_cache def update(self, data=None): diff --git a/storops/unity/resource/nfs_share.py b/storops/unity/resource/nfs_share.py index <HASH>..<HASH> 100644 --- a/storops/unity/resource/nfs_share.py +++ b/storops/unity/resource/nfs_share.py @@ -68,9 +68,9 @@ class UnityNfsHostConfig(object): ret = left else: ret = [] - for l in left: - if l not in right: - ret.append(l) + for lft in left: + if lft not in right: + ret.append(lft) return ret def allow_root(self, *hosts):
Fix flask8 variable name errors (#<I>) Variable cannot be named as `l`.
emc-openstack_storops
train
py,py
e1b08658de0625006442c249a383ffc4bc6494a7
diff --git a/src/LiveDevelopment/LiveDevelopment.js b/src/LiveDevelopment/LiveDevelopment.js index <HASH>..<HASH> 100644 --- a/src/LiveDevelopment/LiveDevelopment.js +++ b/src/LiveDevelopment/LiveDevelopment.js @@ -551,11 +551,6 @@ define(function LiveDevelopment(require, exports, module) { enableAgentsPromise, allAgentsPromise; - // Clear any existing related documents, in case this is a reload. - _.forOwn(_relatedDocuments, function (relatedDoc) { - _closeRelatedDocument(relatedDoc); - }); - _loadAgentsPromise = result.promise(); _setStatus(STATUS_LOADING_AGENTS); @@ -905,6 +900,15 @@ define(function LiveDevelopment(require, exports, module) { } unloadAgents(); + + // Clear any existing related documents before we reload the agents. + // We need to recreate them for the reloaded document due to some + // desirable side-effects (see #7606). Eventually, we should simplify + // the way we get that behavior. + _.forOwn(_relatedDocuments, function (relatedDoc) { + _closeRelatedDocument(relatedDoc); + }); + return loadAgents(); }
Move related doc cleanup into reconnect()
adobe_brackets
train
js
7365336995115daa561451e2a649c5a17ac3d299
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -28,28 +28,15 @@ def get_long_description(): try: import subprocess import pandoc - - process = subprocess.Popen( - ['which pandoc'], - shell=True, - stdout=subprocess.PIPE, - universal_newlines=True) - - pandoc_path = process.communicate()[0] - pandoc_path = pandoc_path.strip('\n') - - pandoc.core.PANDOC_PATH = pandoc_path - + print(pandoc.core.PANDOC_PATH) doc = pandoc.Document() - doc.markdown = long_description - long_description = doc.rst - open("README.rst", "w").write(doc.rst) + doc.markdown = long_description.encode('utf-8') + long_description = doc.rst.decode() + open("README.rst", "wb").write(doc.rst) + except: - if os.path.exists("README.rst"): - long_description = open("README.rst").read() - else: - print("Could not find pandoc or convert properly") - print(" make sure you have pandoc (system) and pyandoc (python module) installed") + print("Could not find pandoc or convert properly") + print(" make sure you have pandoc (system) and pyandoc (python module) installed") return long_description
Allow installation on Windows. Installation on Windows was failing because the which command doesn't exist. pyandoc now finds the pandoc executable internally anyways so this was redundant.
digidotcom_python-devicecloud
train
py
3a033f2d7a80724fd677584de04541fbaf245020
diff --git a/lib/installer/darwin.js b/lib/installer/darwin.js index <HASH>..<HASH> 100644 --- a/lib/installer/darwin.js +++ b/lib/installer/darwin.js @@ -68,6 +68,8 @@ module.exports = { console.info("Installing the extension must be done manually. Please install it from:\n" + "\t" + EXTENSION + "\n"); + console.info("If this is your first time installing, you may need to visit and trust the certificate at:\n" + + "\thttps://localhost:3131\n"); callback(); }, diff --git a/lib/installer/unknown.js b/lib/installer/unknown.js index <HASH>..<HASH> 100644 --- a/lib/installer/unknown.js +++ b/lib/installer/unknown.js @@ -25,6 +25,8 @@ module.exports = { "\t" + DAEMON + "\n"); console.info("Installing the extension must be done manually. Please install it from:\n" + "\t" + EXTENSION + "\n"); + console.info("If this is your first time installing, you may need to visit and trust the certificate at:\n" + + "\thttps://localhost:3131\n"); callback(); },
Add installation message about trusting the certificate.
tristandunn_dotjs-node
train
js,js
c7b8ac330b4b65027063a52aadbea6e0eef34655
diff --git a/admin/index.php b/admin/index.php index <HASH>..<HASH> 100644 --- a/admin/index.php +++ b/admin/index.php @@ -115,15 +115,13 @@ $CFG->debug = DEBUG_MINIMAL; error_reporting($CFG->debug); if (empty($agreelicence)) { - $strlicense = get_string("license"); + $strlicense = get_string('license'); print_header($strlicense, $strlicense, $strlicense, "", "", false, "&nbsp;", "&nbsp;"); print_heading("<a href=\"http://moodle.org\">Moodle</a> - Modular Object-Oriented Dynamic Learning Environment"); - print_heading(get_string("copyrightnotice")); - print_simple_box_start('center'); - echo text_to_html(get_string("gpl")); - print_simple_box_end(); + print_heading(get_string('copyrightnotice')); + print_box(text_to_html(get_string('gpl')), 'copyrightnotice'); echo "<br />"; - notice_yesno(get_string("doyouagree"), "index.php?agreelicence=true", + notice_yesno(get_string('doyouagree'), "index.php?agreelicence=true", "http://docs.moodle.org/en/License"); exit; }
Fixes for copyright notice during install MDL-<I>
moodle_moodle
train
php
539fdd71b831c8eb285754fe2382dc6db5856d56
diff --git a/lib/display_case/exhibit.rb b/lib/display_case/exhibit.rb index <HASH>..<HASH> 100644 --- a/lib/display_case/exhibit.rb +++ b/lib/display_case/exhibit.rb @@ -21,14 +21,17 @@ module DisplayCase def self.exhibit(object, context) return object if exhibited_object?(object) - Rails.logger.debug "Registered exhibits: #{@@exhibits}" - Rails.logger.debug "Exhibiting #{object.inspect}" - Rails.logger.debug "Exhibit context: #{context}" + if defined? Rails + Rails.logger.debug "Registered exhibits: #{@@exhibits}" + Rails.logger.debug "Exhibiting #{object.inspect}" + Rails.logger.debug "Exhibit context: #{context}" + end + object = Exhibited.new(object, context) exhibits.inject(object) do |object, exhibit_class| exhibit_class.exhibit_if_applicable(object, context) end.tap do |obj| - Rails.logger.debug "Exhibits applied: #{obj.inspect_exhibits}" + Rails.logger.debug "Exhibits applied: #{obj.inspect_exhibits}" if defined? Rails end end
ensure Rails exists before trying to use it
objects-on-rails_display-case
train
rb
3fa429e58e437b6b605b6b38c2b71eaf16a74972
diff --git a/robots/__init__.py b/robots/__init__.py index <HASH>..<HASH> 100644 --- a/robots/__init__.py +++ b/robots/__init__.py @@ -1,2 +1,2 @@ -VERSION = (0, 5, 4) +VERSION = (0, 6, 0) __version__ = '.'.join(map(str, VERSION)) \ No newline at end of file diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -from distutils.core import setup +from setuptools import setup, find_packages setup( name='django-robots', @@ -8,8 +8,15 @@ setup( author='Jannis Leidel', author_email='jannis@leidel.info', url='http://code.google.com/p/django-robots/', - packages=['robots'], - package_dir={'dbtemplates': 'dbtemplates'}, + packages=find_packages(), + zip_safe=False, + package_dir={'robots': 'robots'}, + package_data = { + 'robots': [ + 'locale/*/LC_MESSAGES/*', + 'templates/robots/*.html', + ], + }, classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment',
Moved to setuptools and bumped version to <I> git-svn-id: <URL>
jazzband_django-robots
train
py,py
402d7ba226d918e714ffa31e2b4a7250beb30309
diff --git a/packages/hoc-input/src/formInput.test.js b/packages/hoc-input/src/formInput.test.js index <HASH>..<HASH> 100644 --- a/packages/hoc-input/src/formInput.test.js +++ b/packages/hoc-input/src/formInput.test.js @@ -15,9 +15,12 @@ describe("formInput", function() { const value = "some value"; const component = shallow(<EnhancedInput value={value} />); + const setStateMock = jest.fn(); + component.instance().setState = setStateMock; + component.setProps({ value }); - expect(component.state().value).toEqual(value); + expect(setStateMock.mock.calls.length).toBe(0); }); test("changing the value property should update value state", function() {
test(formInput): mock setState so test can be more reliable affects: @crave/farmblocks-hoc-input ISSUES CLOSED: #<I>
CraveFood_farmblocks
train
js
79b4ec2da8f22990042a366ce75864ad48a53435
diff --git a/salt/modules/network.py b/salt/modules/network.py index <HASH>..<HASH> 100644 --- a/salt/modules/network.py +++ b/salt/modules/network.py @@ -1133,4 +1133,3 @@ def get_route(ip): return ret else: raise CommandExecutionError('Not yet supported on this platform') -
network module lint fix Remove empty lines at the end of file
saltstack_salt
train
py
1b7a7a715ecc8f7512a9980059322ce6c47b8e30
diff --git a/src/App.php b/src/App.php index <HASH>..<HASH> 100644 --- a/src/App.php +++ b/src/App.php @@ -65,10 +65,10 @@ class App { } // detect the root path for the router from the root URL - $rootPath = urldecode(parse_url($this->canonicalRootUrl, PHP_URL_PATH)); + $canonicalRootPath = urldecode(parse_url($this->canonicalRootUrl, PHP_URL_PATH)); // get a router instance for the detected root path - $this->router = new Router($rootPath); + $this->router = new Router($canonicalRootPath); // remember some relevant paths on the file system $this->appStoragePath = $appStoragePath;
Rename concept of 'root path' to 'canonical root path'
delight-im_PHP-Foundation-Core
train
php
674e720273808dffb225c358716a542104bf68e0
diff --git a/hazelcast-jet-core/src/main/java/com/hazelcast/jet/impl/connector/WriteJdbcP.java b/hazelcast-jet-core/src/main/java/com/hazelcast/jet/impl/connector/WriteJdbcP.java index <HASH>..<HASH> 100644 --- a/hazelcast-jet-core/src/main/java/com/hazelcast/jet/impl/connector/WriteJdbcP.java +++ b/hazelcast-jet-core/src/main/java/com/hazelcast/jet/impl/connector/WriteJdbcP.java @@ -20,6 +20,7 @@ import com.hazelcast.jet.core.Inbox; import com.hazelcast.jet.core.Outbox; import com.hazelcast.jet.core.Processor; import com.hazelcast.jet.core.ProcessorMetaSupplier; +import com.hazelcast.jet.core.Watermark; import com.hazelcast.jet.core.processor.SinkProcessors; import com.hazelcast.jet.function.BiConsumerEx; import com.hazelcast.jet.function.SupplierEx; @@ -120,6 +121,11 @@ public final class WriteJdbcP<T> implements Processor { } @Override + public boolean tryProcessWatermark(@Nonnull Watermark watermark) { + return true; + } + + @Override public boolean isCooperative() { return false; }
Fix WriteJdbcP in jobs with timestamps (#<I>) Fixes #<I>
hazelcast_hazelcast
train
java
21582a971d7295f1567e399f7adf5f68c6f30090
diff --git a/src/Syntax/SteamApi/Steam/User/Stats.php b/src/Syntax/SteamApi/Steam/User/Stats.php index <HASH>..<HASH> 100644 --- a/src/Syntax/SteamApi/Steam/User/Stats.php +++ b/src/Syntax/SteamApi/Steam/User/Stats.php @@ -83,9 +83,12 @@ class Stats extends Client // In these cases, try again with the name. if (is_int($appId)) { $app = $this->app()->appDetails($appId); - $appName = str_replace(' ', '', $app->first()->name); - return $this->GetPlayerAchievements($appName); + if (isset($app->first()->name)) { + $appName = str_replace(' ', '', $app->first()->name); + + return $this->GetPlayerAchievements($appName); + } } // If the name and ID fail, return null.
Adds fix for app name inside GetPlayerAchievements() $app->first()->name may cause an additional "Trying to get property of non-object" exception if the app is not available
syntaxerrors_Steam
train
php
67b369781e54139084ddd48d23366828f1c381ed
diff --git a/activerecord/test/cases/helper.rb b/activerecord/test/cases/helper.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/cases/helper.rb +++ b/activerecord/test/cases/helper.rb @@ -8,6 +8,7 @@ require "active_record" require "cases/test_case" require "active_support/dependencies" require "active_support/logger" +require "active_support/core_ext/kernel/singleton_class" require "support/config" require "support/connection"
Active Record uses singleton class eval in tests
rails_rails
train
rb
0428698ef850b93455c586395cd41bda039dde24
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -20,6 +20,7 @@ function S3StreamLogger(options){ this.bucket = options.bucket || process.env.BUCKET_NAME; this.folder = options.folder || ''; + this.tags = options.tags || {}; // no tags are assigned by default this.name_format = options.name_format; this.rotate_every = options.rotate_every || 60*60*1000; // default to 60 minutes this.max_file_size = options.max_file_size || 200000; // or 200k, whichever is sooner @@ -107,10 +108,14 @@ S3StreamLogger.prototype._upload = function(forceNewFile) { return this.emit('error', err); } + // constructc the tagging string according to AWS SDK specifications + var tagging = Object.keys(this.tags).map(function(key) {return key + '=' + this.tags[key];}, this).join('&'); + var param = { Bucket: this.bucket, Key: this.object_name, - Body: buffer + Body: buffer, + Tagging: tagging }; if(this.server_side_encryption){
Added provision for assigning tags to S3 file
Coggle_s3-streamlogger
train
js
fc9884b44474a752adfc8ea2bf7026db39ec6cdb
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py index <HASH>..<HASH> 100644 --- a/alot/commands/envelope.py +++ b/alot/commands/envelope.py @@ -505,8 +505,8 @@ class SignCommand(Command): return else: try: - acc = settings.get_account_by_address( - envelope.headers['From'][0]) + _, addr = email.utils.parseaddr(envelope.headers['From'][0]) + acc = settings.get_account_by_address(addr) except NoMatchingAccount: envelope.sign = False ui.notify('Unable to find a matching account', diff --git a/tests/commands/envelope_test.py b/tests/commands/envelope_test.py index <HASH>..<HASH> 100644 --- a/tests/commands/envelope_test.py +++ b/tests/commands/envelope_test.py @@ -337,7 +337,6 @@ class TestSignCommand(unittest.TestCase): self.assertTrue(env.sign) self.assertIs(env.sign_key, mock.sentinel.gpg_key) - @unittest.expectedFailure def test_apply_from_user_and_email(self): """This tests that a gpg key can be derived using a 'From' header that contains a realname-email combo.
envelope: Allow signing if address is in "name <email>" form Currently anything except "user@domain" (such as "User Name <user@domain>"), will not work with the sign command, because settings.get_account_by_address wants just the "user@domain" bit, and we don't split it. Fixes #<I>
pazz_alot
train
py,py
f72eed5004a7a955ac9a36c29152c93c0d532489
diff --git a/blueocean-admin/src/test/js/pipeline-spec.js b/blueocean-admin/src/test/js/pipeline-spec.js index <HASH>..<HASH> 100644 --- a/blueocean-admin/src/test/js/pipeline-spec.js +++ b/blueocean-admin/src/test/js/pipeline-spec.js @@ -57,7 +57,7 @@ describe("pipeline component simple rendering", () => { // simple element has no children assert.equal(children[2].type, 'td'); assert.isObject(children[2].props); - assert.isUndefined(children[2].props.children); + assert.equal(children[2].props.children, ' - '); }); });
[feature/UX-<I>] Fix tests, thank you Jenkins
jenkinsci_blueocean-plugin
train
js
9b141771d9f095e20a4e391dd4f648adc7b54e12
diff --git a/src/components/source.js b/src/components/source.js index <HASH>..<HASH> 100644 --- a/src/components/source.js +++ b/src/components/source.js @@ -136,11 +136,12 @@ module.exports = class ComponentSource extends Source { } let layoutContext = yield this.resolve(layout.context); let layoutContent = yield layout.getContent(); - layoutContext = _.defaults(layoutContext, context || {}); + layoutContext = _.defaults(layoutContext, context || {}); layoutContext[this.setting('yield')] = content; - return this.engine().render(layout.viewPath, layoutContent, layoutContext); + const renderMethod = (typeof this.engine().renderLayout === 'function') ? 'renderLayout' : 'render'; + return this.engine()[renderMethod](layout.viewPath, layoutContent, layoutContext); } - + statusInfo(handle) { const statuses = this.setting('statuses'); const defaultStatus = this.setting('default.status')
feat(components): Defer layout rendering to adapters if available
frctl_fractal
train
js
229cad2edcd1b3bc81138b4a154e7cfe5ade24d9
diff --git a/src/libs/_ajax.js b/src/libs/_ajax.js index <HASH>..<HASH> 100644 --- a/src/libs/_ajax.js +++ b/src/libs/_ajax.js @@ -60,7 +60,7 @@ $AjaxDict.send = function(self,params){ else if(isinstance(params,str)){ res = params }else if(isinstance(params,dict)){ - for(var i=0,len=params.$keys.length;i<len;i++){ + for(var i=0, _len_i = params.$keys.length; i < _len_i;i++){ res +=encodeURIComponent(str(params.$keys[i]))+'='+encodeURIComponent(str(params.$values[i]))+'&' } res = res.substr(0,res.length-1)
modifications to cache for loops to improve performance, see <URL>
brython-dev_brython
train
js
f8021c1bb7041db68dfb7284669373cf09d8a18d
diff --git a/src/scripts/utils/crn.js b/src/scripts/utils/crn.js index <HASH>..<HASH> 100644 --- a/src/scripts/utils/crn.js +++ b/src/scripts/utils/crn.js @@ -183,8 +183,18 @@ export default { request.post(config.crn.url + 'datasets/' + datasetId + '/validate', {}, callback); }, +// Logs ------------------------------------------------------------------------------ + getJobLogs(jobId, callback) { request.get(config.crn.url + 'jobs/' + jobId + '/logs', {}, callback); + }, + + getLogstream(streamName, callback) { + request.get(config.crn.url + 'logs/' + streamName, {}, callback); + }, + + downloadJobLogs(jobId, callback) { + request.get(config.crn.url + 'jobs/' + jobId + '/logs/download', {}, callback); } };
Add utils for new log endpoints.
OpenNeuroOrg_openneuro
train
js
56e82b71435bb82d6a5d7f3f3f080dcde8786281
diff --git a/test/helpers/cilium.go b/test/helpers/cilium.go index <HASH>..<HASH> 100644 --- a/test/helpers/cilium.go +++ b/test/helpers/cilium.go @@ -721,12 +721,14 @@ func (s *SSHMeta) ServiceGetFrontendAddress(id int) (string, error) { // ServiceGetIds returns an array with the IDs of all Cilium services. Returns // an error if the IDs cannot be retrieved func (s *SSHMeta) ServiceGetIds() ([]string, error) { - filter := `{range [*]}{@.ID}{end}` + filter := `{range [*]}{@.ID}{"\n"}{end}` res, err := s.ServiceList().Filter(filter) if err != nil { return nil, err } - return strings.Split(res.String(), "\n"), nil + // trim the trailing \n + trimmed := strings.Trim(res.String(), "\n") + return strings.Split(trimmed, "\n"), nil } // ServiceDel is a wrapper around `cilium service delete <id>`. It returns the
test: ServiceGetIds jsonpath is splittable We accidentally concatenated all the IDs into one unsplittable number.We introduce the \n needed to split the list.
cilium_cilium
train
go
c4440c4e074b86dfdbbb7b3990707d8ae8af1854
diff --git a/code/media/koowa/com_koowa/js/koowa.select2.js b/code/media/koowa/com_koowa/js/koowa.select2.js index <HASH>..<HASH> 100644 --- a/code/media/koowa/com_koowa/js/koowa.select2.js +++ b/code/media/koowa/com_koowa/js/koowa.select2.js @@ -54,14 +54,16 @@ } }, initSelection: function(element, callback) { - var id=$(element).val(); - if (id!=='') { + var selected= $.parseJSON($(element).val()); + if (selected!=='') { var data = {}; - data[options.value] = id; + data[options.value] = selected; + // Cleanup up selected. Values will be appended by select2. + $(element).val(''); $.ajax(options.url, { data: data }).done(function(data) { - callback(data.entities[0]); + callback(data.entities); }); } },
re #<I> Updated custom JS to work with JSON encoded pre-selected values as well as querying for them.
joomlatools_joomlatools-framework
train
js
d8e82f7975d995a7ae08531078c0cecdb29cc585
diff --git a/spec/omniauth/failure_endpoint_spec.rb b/spec/omniauth/failure_endpoint_spec.rb index <HASH>..<HASH> 100644 --- a/spec/omniauth/failure_endpoint_spec.rb +++ b/spec/omniauth/failure_endpoint_spec.rb @@ -10,8 +10,9 @@ describe OmniAuth::FailureEndpoint do end it 'should raise out the error' do - err = StandardError.new("Blah") - expect{ subject.call('omniauth.error' => err) }.to raise_error(err) + expect do + subject.call('omniauth.error' => StandardError.new("Blah")) + end.to raise_error(StandardError, "Blah") end it 'should raise out an OmniAuth::Error if no omniauth.error is set' do
Fixing build on <I>
omniauth_omniauth
train
rb
d21eec9f909766556ae959474b5bfa834cc64eb2
diff --git a/sdk/servicebus/azure-servicebus/setup.py b/sdk/servicebus/azure-servicebus/setup.py index <HASH>..<HASH> 100644 --- a/sdk/servicebus/azure-servicebus/setup.py +++ b/sdk/servicebus/azure-servicebus/setup.py @@ -67,6 +67,7 @@ setup( 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: MIT License', ], zip_safe=False,
Add python <I> to setup classifiers list (#<I>)
Azure_azure-sdk-for-python
train
py
3691570764ab27c9c47cb3423ce89c4ab1645038
diff --git a/src/Dumplie/Application/Command/Customer/CreateCartHandler.php b/src/Dumplie/Application/Command/Customer/CreateCartHandler.php index <HASH>..<HASH> 100644 --- a/src/Dumplie/Application/Command/Customer/CreateCartHandler.php +++ b/src/Dumplie/Application/Command/Customer/CreateCartHandler.php @@ -38,11 +38,10 @@ final class CreateCartHandler */ public function handle(CreateCart $command) { - $this->carts->add(new Cart(new CartId($command->uuid()), $command->currency())); - $transaction = $this->factory->open(); try { + $this->carts->add(new Cart(new CartId($command->uuid()), $command->currency())); $transaction->commit(); } catch (\Exception $e) { $transaction->rollback();
Fixed transaction order (#<I>)
dumplie_dumplie
train
php
f4338fb64bb86e1ea58e0863f03223e7650e8607
diff --git a/lib/raven/event.rb b/lib/raven/event.rb index <HASH>..<HASH> 100644 --- a/lib/raven/event.rb +++ b/lib/raven/event.rb @@ -130,9 +130,9 @@ module Raven end def to_hash - data = %i(platform sdk event_id logger transaction server_name timestamp - time_spent level release environment fingerprint modules extra - tags user checksum message).each_with_object({}) do |att, memo| + data = [:checksum, :environment, :event_id, :extra, :fingerprint, :level, + :logger, :message, :modules, :platform, :release, :sdk, :server_name, + :tags, :time_spent, :timestamp, :transaction, :user].each_with_object({}) do |att, memo| memo[att] = public_send(att) if public_send(att) end
Forgot I can't use array-of-string literal in Ruby <I>
getsentry_raven-ruby
train
rb
ac563f3cc59c346bd76ec038d2271850365a286a
diff --git a/src/form/FormBuilder.php b/src/form/FormBuilder.php index <HASH>..<HASH> 100644 --- a/src/form/FormBuilder.php +++ b/src/form/FormBuilder.php @@ -74,6 +74,15 @@ class FormBuilder { } /** + * @param \UWDOEM\Framework\Field\FieldInterface[] $fields + * @return FormBuilder + */ + public function addFields(array $fields) { + $this->_fieldBearerBuilder->addFields($fields); + return $this; + } + + /** * @param string $fieldName * @param callable $callable * @return FormBuilder
Add passthrough method to FormBuilder addFields.
AthensFramework_Core
train
php
7acc17cef93db184dd2f9c5473934fbe787af09f
diff --git a/app/controllers/blogr/application_controller.rb b/app/controllers/blogr/application_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/blogr/application_controller.rb +++ b/app/controllers/blogr/application_controller.rb @@ -1,7 +1,7 @@ module Blogr class ApplicationController < ActionController::Base - layout "blogr/application" + # layout "blogr/application" before_filter :authorize
commented out layout in app controller. sometimes it looks for routes in the main app layout when browsing /blogr
deanpcmad_blogr
train
rb
27a3db4f25dab7d5754f10751243ac11d5f51775
diff --git a/src/core.js b/src/core.js index <HASH>..<HASH> 100644 --- a/src/core.js +++ b/src/core.js @@ -113,7 +113,7 @@ async function preparePage ({ // and then re-use it for each page (to avoid extra work). // Only if later pages use a different viewport size do we need to // update it here. - let setViewportPromise = Promise.resolve + let setViewportPromise = Promise.resolve() const currentViewport = page.viewport() if (currentViewport.width !== width || currentViewport.height !== height) { setViewportPromise = page @@ -125,7 +125,7 @@ async function preparePage ({ .setUserAgent(userAgent) .then(() => debuglog('userAgent set')) - let setCustomPageHeadersPromise + let setCustomPageHeadersPromise = Promise.resolve() if (customPageHeaders) { try { setCustomPageHeadersPromise = page
core: align promise.resolve usage just for readability; functionally the Promise.all these variables end up in are treated the same anyway (undefined vs Promise.resolve())
pocketjoso_penthouse
train
js