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
e46537fca2d1afa8a22f2649533255ba6daba60f
diff --git a/core-bundle/src/Resources/contao/modules/ModuleSearch.php b/core-bundle/src/Resources/contao/modules/ModuleSearch.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/modules/ModuleSearch.php +++ b/core-bundle/src/Resources/contao/modules/ModuleSearch.php @@ -126,7 +126,7 @@ class ModuleSearch extends \Module foreach ($GLOBALS['TL_HOOKS']['customizeSearch'] as $callback) { $this->import($callback[0]); - $this->{$callback[0]}->{$callback[1]}($arrPages, $strKeywords, $strQueryType, $blnFuzzy); + $this->{$callback[0]}->{$callback[1]}($arrPages, $strKeywords, $strQueryType, $blnFuzzy, $this); } }
[Core] Also pass $this in the "customizeSearch" hook (see contao/core#<I>).
contao_contao
train
php
2ba7d653eeb029644c75598bcb241ef2b2328283
diff --git a/src/elements/chips/Chips.spec.js b/src/elements/chips/Chips.spec.js index <HASH>..<HASH> 100644 --- a/src/elements/chips/Chips.spec.js +++ b/src/elements/chips/Chips.spec.js @@ -64,20 +64,6 @@ describe('Element: NovoChipsElement', () => { expect(component.blur).toBeDefined(); expect(component.items.length).toBe(0); }); - - it('should add keydown listeners', () => { - spyOn(window.document, 'addEventListener'); - component.ngOnInit(); - expect(window.document.addEventListener).toHaveBeenCalled(); - }); - }); - - describe('Function: ngOnDestroy(event)', () => { - it('should remove keydown listeners', () => { - spyOn(window.document, 'removeEventListener'); - component.ngOnDestroy(); - expect(window.document.removeEventListener).toHaveBeenCalled(); - }); }); describe('Function: deselectAll()', () => {
chore(tests): Fixing test
bullhorn_novo-elements
train
js
88b70e37a3ec0bd08caea53aa8a51f2b48e679b5
diff --git a/spec/integration/session_spec.rb b/spec/integration/session_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration/session_spec.rb +++ b/spec/integration/session_spec.rb @@ -79,6 +79,31 @@ describe Capybara::Session do subject.click_button('ボタン') end end + context "status code" do + before(:all) do + @app = lambda do |env| + params = ::Rack::Utils.parse_query(env['QUERY_STRING']) + if params["img"] == "true" + return [404, { 'Content-Type' => 'image/gif', 'Content-Length' => '0' }, ['not found']] + end + body = <<-HTML + <html> + <body> + <img src="?img=true"> + </body> + </html> + HTML + [200, + { 'Content-Type' => 'text/html', 'Content-Length' => body.length.to_s }, + [body]] + end + end + + it "should get status code" do + subject.visit '/' + subject.status_code.should == 200 + end + end end describe Capybara::Session, "with TestApp" do
add spec for status code with image
niklasb_webkit-server
train
rb
6af7dcc6481b4f149de7a4395ab27f29e6e35f5a
diff --git a/lib/dynamic_scaffold/config.rb b/lib/dynamic_scaffold/config.rb index <HASH>..<HASH> 100644 --- a/lib/dynamic_scaffold/config.rb +++ b/lib/dynamic_scaffold/config.rb @@ -105,14 +105,14 @@ module DynamicScaffold end class Vars - def initialize(controller) - @controller = controller + def initialize(config) + @config = config @values = {} end def _register(name, block) define_singleton_method(name) do - @values[name] ||= @controller.instance_exec(&block) + @values[name] ||= @config.controller.instance_exec(&block) @values[name] end end @@ -126,8 +126,7 @@ module DynamicScaffold @form = FormBuilder.new(self) @list = ListBuilder.new(self) @title = Title.new(self) - # TODO: change to pass self - @vars = Vars.new(controller) + @vars = Vars.new(self) end def vars(name = nil, &block)
Refactor: pass config to Vars initilizer.
gomo_dynamic_scaffold
train
rb
caed92ccd2b93030a0c03aa255ceba13e84415f9
diff --git a/src/conbo/utils/AttributeBindings.js b/src/conbo/utils/AttributeBindings.js index <HASH>..<HASH> 100644 --- a/src/conbo/utils/AttributeBindings.js +++ b/src/conbo/utils/AttributeBindings.js @@ -251,22 +251,30 @@ conbo.AttributeBindings = conbo.Class.extend */ cbRestrict: function(value, el) { - if (!conbo.isRegExp(value)) + // TODO Restrict to text input fields? + + if (el.cbRestrict) { - value = new RegExp('['+value+']', 'g'); + el.removeEventListener('keypress', el.cbRestrict); } - // TODO Restrict to text input fields? - - el.addEventListener('keypress', function(event) + el.cbRestrict = function(event) { var code = event.keyCode || event.which; var char = String.fromCharCode(code); + var r = value; - if (!char.match(value)) + if (!conbo.isRegExp(r)) + { + r = new RegExp('['+r+']', 'g'); + } + + if (!char.match(r)) { event.preventDefault(); } - }); + }; + + el.addEventListener('keypress', el.cbRestrict); } }); \ No newline at end of file
Tidied up cb-restrict
mesmotronic_conbo
train
js
d36d9153f7ce9431e8056b275579f217897579ea
diff --git a/ruby_event_store/lib/ruby_event_store/mappers/protobuf.rb b/ruby_event_store/lib/ruby_event_store/mappers/protobuf.rb index <HASH>..<HASH> 100644 --- a/ruby_event_store/lib/ruby_event_store/mappers/protobuf.rb +++ b/ruby_event_store/lib/ruby_event_store/mappers/protobuf.rb @@ -2,7 +2,6 @@ module RubyEventStore module Mappers class Protobuf def initialize(event_id_getter: :event_id, events_class_remapping: {}) - require 'google/protobuf' @event_id_getter = event_id_getter @events_class_remapping = events_class_remapping end
Remove require Let's assume protobuf definitions are loaded separately and they require google-protobuf.
RailsEventStore_rails_event_store
train
rb
f1765472dddcbbe319da2d376ec2001e6776d51b
diff --git a/salt/utils/process.py b/salt/utils/process.py index <HASH>..<HASH> 100644 --- a/salt/utils/process.py +++ b/salt/utils/process.py @@ -15,6 +15,7 @@ import contextlib import subprocess import multiprocessing import multiprocessing.util +import socket # Import salt libs @@ -55,7 +56,17 @@ def notify_systemd(): import systemd.daemon except ImportError: if salt.utils.which('systemd-notify') and systemd_notify_call('--booted'): - return systemd_notify_call('--ready') + # Notify systemd synchronously + notify_socket = os.getenv('NOTIFY_SOCKET') + if notify_socket: + # Handle abstract namespace socket + if notify_socket.startswith('@'): + notify_socket = '\0{0}'.format(notify_socket[1:]) + sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM) + sock.connect(notify_socket) + sock.sendall('READY=1'.encode()) + sock.close() + return True return False if systemd.daemon.booted():
Notify systemd synchronously (via NOTIFY_SOCKET) Forking the systemd-notify command is known to be unreliable at least with older versions of the kernel and/or systemd. When systemd receives the notification the systemd-notify process may have already exited causing an error in the logs while waiting for a (<I> seconds) timeout. This patch instead notifies the systemd NOTIFY_SOCKET synchronously in case the systemd.daemon python library is not available.
saltstack_salt
train
py
177c9c0de017c2454b29e6159a148579e39e0987
diff --git a/src/core/script_iterator.py b/src/core/script_iterator.py index <HASH>..<HASH> 100644 --- a/src/core/script_iterator.py +++ b/src/core/script_iterator.py @@ -555,9 +555,17 @@ Script. if isinstance(script_information, dict): for sub_script_name, sub_script_class in script_sub_scripts.iteritems(): + print(sub_script_class) if isinstance(sub_script_class, Script): print('JG: script name ', Script.name) # script already exists + + # To implement: add a function to scripts that outputs a script_information dict corresponding + # to the current settings. This can then be fed into Script.get_script_information and things + # can proceed as below. We may also need to add an additional tracker to the dialogue window + # to differentiate between the case of wanting a new script from scratch when there is an + # identically named one already loaded, vs using that loaded script + raise NotImplementedError elif script_sub_scripts[sub_script_name]['class'] == 'ScriptIterator': subscript_class_name = ScriptIterator.create_dynamic_script_class(script_sub_scripts[sub_script_name])['class']
Removed legacy versions of ni_daq and galvoscan, and merged everything into one current file for each
LISE-B26_pylabcontrol
train
py
0a070a435167d3dd9c8f2ddf140924052b4ec992
diff --git a/lib/rugged/diff/patch.rb b/lib/rugged/diff/patch.rb index <HASH>..<HASH> 100644 --- a/lib/rugged/diff/patch.rb +++ b/lib/rugged/diff/patch.rb @@ -13,8 +13,6 @@ module Rugged delta.new_file_full_path end - private - def lines map(&:lines).flatten.compact end
Make #lines method on Rugged::Diff::Patch public
prontolabs_pronto
train
rb
15dda94c7d1e117273928f094b46a81b3f842c1f
diff --git a/lib/puppet/application/inspect.rb b/lib/puppet/application/inspect.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/application/inspect.rb +++ b/lib/puppet/application/inspect.rb @@ -51,10 +51,8 @@ class Puppet::Application::Inspect < Puppet::Application @report.configuration_version = catalog.version - retrieval_time = Time.now - retrieval_starttime - @report.add_times("config_retrieval", retrieval_time) - - starttime = Time.now + inspect_starttime = Time.now + @report.add_times("config_retrieval", inspect_starttime - retrieval_starttime) catalog.to_ral.resources.each do |ral_resource| audited_attributes = ral_resource[:audit] @@ -70,7 +68,9 @@ class Puppet::Application::Inspect < Puppet::Application @report.add_resource_status(status) end - @report.add_metric(:time, {"config_retrieval" => retrieval_time, "inspect" => Time.now - starttime}) + finishtime = Time.now + @report.add_times("inspect", finishtime - inspect_starttime) + @report.calculate_metrics begin @report.save
(#<I>) Added total time to inspect reports and made inspect metrics more consistent. Inspect reports now contain all the metrics that apply reports do, and use the same code path for creating them.
puppetlabs_puppet
train
rb
c919116d83562e528df58833162494fd9fe0b9b2
diff --git a/lib/guard/interactors/helpers/terminal.rb b/lib/guard/interactors/helpers/terminal.rb index <HASH>..<HASH> 100644 --- a/lib/guard/interactors/helpers/terminal.rb +++ b/lib/guard/interactors/helpers/terminal.rb @@ -39,8 +39,8 @@ module Guard # Restore terminal settings # def restore_terminal_settings - system('stty', @stty_save, '2>/dev/null') if @stty_save + system("stty #{ @stty_save } 2>/dev/null") if @stty_save end - + end -end \ No newline at end of file +end
Do not pass STDERR redirect as option to Kernel#system. If we pass the redirect `2>/dev/null` as option to Kernel#system, the option will be wrapped by quotes and the redirect will have no effect on the command exectuion. See Guard Issue #<I>.
guard_guard
train
rb
d1edad81b896c6ca68146dc319eed00ccbd6baa0
diff --git a/examples/writing.php b/examples/writing.php index <HASH>..<HASH> 100755 --- a/examples/writing.php +++ b/examples/writing.php @@ -9,6 +9,7 @@ require '../vendor/autoload.php'; $writer = Writer::createFromFileObject(new SplTempFileObject()); //the CSV file will be created into a temporary File $writer->setDelimiter("\t"); //the delimiter will be the tab character +$writer->setLineEnding("\r\n"); //use windows line endings for compatibility with some csv libraries $writer->setEncodingFrom("utf-8"); $headers = ["position" , "team", "played", "goals difference", "points"];
Updated the writing example to include a line ending setter
thephpleague_csv
train
php
6da36865987a063e68ec8debd970c5cbd246449a
diff --git a/src/functions.js b/src/functions.js index <HASH>..<HASH> 100644 --- a/src/functions.js +++ b/src/functions.js @@ -13,7 +13,7 @@ module.exports.resolve_function = function(path_prefix) { return { 'jspm_resolve($exp)': function(exp, done) { jspm.normalize(exp.getValue()).then(function(respath) { - respath = path.resolve(fromFileURL(respath).replace(/\.js$/, '')); + respath = path.resolve(fromFileURL(respath).replace(/\.js$|\.ts$/, '')); var res = path.join(path_prefix, path.relative(jspm_config.pjson.packages, respath)) done(new sass.types.String(res)); }, function(e) {
Resolve .ts extension also.
idcware_node-sass-jspm-importer
train
js
d3a82531a91484f416da83df1679b1d77ad0984a
diff --git a/src/mixin/index.js b/src/mixin/index.js index <HASH>..<HASH> 100644 --- a/src/mixin/index.js +++ b/src/mixin/index.js @@ -53,10 +53,6 @@ export const MIXIN_FEATURE_TESTS = new Set([ export { Set }; -// Prevent errors when loading component via native ES6 module support. -window.process = window.process || {}; -window.process.env = window.process.env || {}; - // ## Drawer Mixin export const drawerMixin = C => class extends setupObservablesMixin(rxjsMixin(componentMixin(C))) {
remove process.env stub (no in hy-comp)
qwtel_hy-drawer
train
js
6913f305b5e978b8a7fb03df7f983ca6ebd5e28b
diff --git a/lib/less-browser/index.js b/lib/less-browser/index.js index <HASH>..<HASH> 100644 --- a/lib/less-browser/index.js +++ b/lib/less-browser/index.js @@ -14,9 +14,17 @@ var less; var isFileProtocol = /^(file|chrome(-extension)?|resource|qrc|app):/.test(window.location.protocol), options = window.less || {}; +console.warn("about to apply polyfill " + window.Promise); + // shim Promise if required require('promise/polyfill.js'); +console.warn("polyfill applied" + window.Promise); + +(function() { + console.log("am I in strict mode? "+this); +})(); + window.less = less = require('../less')(); var environment = less.environment, FileManager = require("./file-manager")(options, isFileProtocol, less.logger),
Test why travis CI is failing
less_less.js
train
js
f71372106466c38524c6247e2127990909187a84
diff --git a/src/PatternLab/Migrator.php b/src/PatternLab/Migrator.php index <HASH>..<HASH> 100644 --- a/src/PatternLab/Migrator.php +++ b/src/PatternLab/Migrator.php @@ -121,7 +121,7 @@ class Migrator { $sourcePath = str_replace(__DIR__."/../../../","",rtrim($sourcePath,"/")); $f = new Fetch(); - $f->fetch("s",$sourcePath); + $f->fetch("starterkit",$sourcePath); } else {
being explicit with the long command in the migration
pattern-lab_patternlab-php-core
train
php
b5a8fe2c2698d80bdd75c5bc3965f236b764bcdb
diff --git a/lib/media/streaming_engine.js b/lib/media/streaming_engine.js index <HASH>..<HASH> 100644 --- a/lib/media/streaming_engine.js +++ b/lib/media/streaming_engine.js @@ -417,7 +417,7 @@ shaka.media.StreamingEngine.prototype.switch = function( if (!mediaState && contentType == 'text' && this.config_.ignoreTextStreamFailures) { this.notifyNewStream('text', stream); - mediaState = this.mediaStates_['text']; + return; } goog.asserts.assert(mediaState, 'switch: expected mediaState to exist'); if (!mediaState) return;
Enable switching from unavailable to available text stream: part 2. When switching from an unavailable to an available text stream we are adding a text media state. This happens after switch method checks for it and the assertion fails. This is a change to return from the switch method before the assertion gets checked. Issue #<I> Change-Id: I<I>fd4cfc7b<I>ea0acb2a<I>cc5afaba4e<I>e
google_shaka-player
train
js
b752766d6cb454e9115355013ed8aa18b745bd4b
diff --git a/cake/libs/router.php b/cake/libs/router.php index <HASH>..<HASH> 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -741,7 +741,11 @@ class Router { $extension = $output = $mapped = $q = $frag = null; if (empty($url)) { - return isset($path['here']) ? $path['here'] : '/'; + $output = isset($path['here']) ? $path['here'] : '/'; + if ($full && defined('FULL_BASE_URL')) { + $output = FULL_BASE_URL . $output; + } + return $output; } elseif (is_array($url)) { if (isset($url['base']) && $url['base'] === false) { $base = null;
Using full base when $url is empty.
cakephp_cakephp
train
php
49f853ed0a7ca99f71bd8a99718b9e50b0545de8
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -14,7 +14,7 @@ function getColorObj(text) { } /* Get a ready-to-use Style object of the Material color of a string */ -export default function toMaterialStyle(text, shade) { +function toMaterialStyle(text, shade) { let shadeStr = `${shade}`; // convert shade to string if (!availableShades.includes(shadeStr)) { shadeStr = '500'; @@ -28,3 +28,5 @@ export default function toMaterialStyle(text, shade) { materialColorName: colorObj.name }; } + +export default toMaterialStyle;
Attempting a fix for issue #2 ("can't use in nuxt using import")
BelkaLab_material-color-hash
train
js
3c55cf0e57c1b6afaf54bbbb52dd99642f26f27e
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -109,6 +109,7 @@ function ConkieStats() { return this; }; + var pollHandle; this.setPollFreq = function(timeout) { clearTimeout(pollHandle); // Cancel scheduled polls if (!_.isUndefined(timeout)) self._pollFreq = timeout; @@ -116,7 +117,6 @@ function ConkieStats() { return this; }; - var pollHandle; this.poll = function(finish) { clearTimeout(pollHandle); // Cancel scheduled polls
BUGFIX: Syntax error where the pollHandle trampolines in the scope
hash-bang_conkie-stats
train
js
7b57a55cda2f59dea49758294f5d6c4671242f3b
diff --git a/classes/PodsInit.php b/classes/PodsInit.php index <HASH>..<HASH> 100644 --- a/classes/PodsInit.php +++ b/classes/PodsInit.php @@ -1105,8 +1105,6 @@ class PodsInit { // Restore DB table prefix (if switched) if ( null !== $_blog_id ) { restore_current_blog(); - } else { - $this->run(); } }
Take out run() which runs it out of order of priorities
pods-framework_pods
train
php
7a879c0e56c2ef91db9fcb36c7423ac82e489288
diff --git a/src/ossos-pipeline/ossos/ssos.py b/src/ossos-pipeline/ossos/ssos.py index <HASH>..<HASH> 100644 --- a/src/ossos-pipeline/ossos/ssos.py +++ b/src/ossos-pipeline/ossos/ssos.py @@ -287,8 +287,8 @@ class SSOSParser(object): # ADDING THIS TEMPORARILY TO GET THE NON-OSSOS and wallpaper DATA OUT OF THE WAY # note: 'Telescope_Insturment' is a typo in SSOIS's return format - if (row['Telescope_Insturment'] != 'CFHT/MegaCam') or (row['Filter'] != 'r.MP9601') or row[ - 'Image_target'].startswith('WP'): + if (row['Telescope_Insturment'] != 'CFHT/MegaCam') or (row['Filter'] != 'r.MP9601') \ + or (row['Filter'] != 'u.MP9301') or row['Image_target'].startswith('WP'): continue # Build astrom.SourceReading
Return u' band data from SSOIS in image stacks.
OSSOS_MOP
train
py
865f8c1e6ac0ad47ace873a0126bae267081b4bf
diff --git a/tests/Unit/Query/IndicesQueryTest.php b/tests/Unit/Query/IndicesQueryTest.php index <HASH>..<HASH> 100644 --- a/tests/Unit/Query/IndicesQueryTest.php +++ b/tests/Unit/Query/IndicesQueryTest.php @@ -21,7 +21,8 @@ class IndicesQueryTest extends \PHPUnit_Framework_TestCase */ private function getQueryMock() { - $mock = $this->getMockBuilder('ONGR\ElasticsearchDSL\BuilderInterface')->setMethods(['toArray', 'getType'])->getMock(); + $mock = $this->getMockBuilder('ONGR\ElasticsearchDSL\BuilderInterface') + ->setMethods(['toArray', 'getType'])->getMock(); $mock ->expects($this->any()) ->method('toArray')
fixed psr2 style issues
ongr-io_ElasticsearchDSL
train
php
5d78635e40ff413b997d05eaddca2aa2487c4d6e
diff --git a/mod/forum/classes/message/inbound/reply_handler.php b/mod/forum/classes/message/inbound/reply_handler.php index <HASH>..<HASH> 100644 --- a/mod/forum/classes/message/inbound/reply_handler.php +++ b/mod/forum/classes/message/inbound/reply_handler.php @@ -117,7 +117,7 @@ class reply_handler extends \core\message\inbound\handler { } // And check the availability. - if (!\core_availability\info_module::is_user_visible($cm, $USER, true)) { + if (!\core_availability\info_module::is_user_visible($cm)) { $data = new \stdClass(); $data->forum = $forum; throw new \core\message\inbound\processing_failed_exception('messageinboundforumhidden', 'mod_forum', $data);
MDL-<I> inbound: Fix notices in pickup task
moodle_moodle
train
php
767e28a7b749d888f9e153e9b2e61a64617bdcf6
diff --git a/lib/phoenx/use_cases/generate_target.rb b/lib/phoenx/use_cases/generate_target.rb index <HASH>..<HASH> 100755 --- a/lib/phoenx/use_cases/generate_target.rb +++ b/lib/phoenx/use_cases/generate_target.rb @@ -21,6 +21,7 @@ module Phoenx end def add_frameworks_and_libraries + self.target.frameworks_build_phases.clear # Add Framework dependencies frameworks_group = @project.main_group.find_subpath(FRAMEWORKS_ROOT, true) Phoenx.add_groups_for_files(@project,@target_spec.frameworks)
Avoided Foundation being added to libraries by default
jensmeder_Phoenx
train
rb
8c70e3e88c178f1cc36e195b164cbfdc371b5796
diff --git a/packages/node_modules/@webex/plugin-meetings/src/constants.js b/packages/node_modules/@webex/plugin-meetings/src/constants.js index <HASH>..<HASH> 100644 --- a/packages/node_modules/@webex/plugin-meetings/src/constants.js +++ b/packages/node_modules/@webex/plugin-meetings/src/constants.js @@ -332,8 +332,8 @@ export const EVENTS = { LOCUS_INFO_UPDATE_SELF: 'LOCUS_INFO_UPDATE_SELF', LOCUS_INFO_UPDATE_URL: 'LOCUS_INFO_UPDATE_URL', STATS_UPDATE: 'STATS_UPDATE', - ANALYSIS_FAILURE: 'ANALYSIS:FAILURE', - ANALYSIS_GRAPH: 'ANALYSIS:GRAPH' + ANALYSIS_FAILURE: 'ANALYSIS_FAILURE', + ANALYSIS_GRAPH: 'ANALYSIS_GRAPH' }; export const EVENT_STATS_MAP = {
fix(meeting): constants
webex_spark-js-sdk
train
js
329fd27adf4e3e3bb344bd97416806fcc6392df4
diff --git a/templates/admin/export.php b/templates/admin/export.php index <HASH>..<HASH> 100644 --- a/templates/admin/export.php +++ b/templates/admin/export.php @@ -191,7 +191,7 @@ $formats = apply_filters( 'pb_export_formats', [ </fieldset> <fieldset class="exotic"> - <legend><?php _e( 'Exotic formats', 'pressbooks' ); ?>:</legend> + <legend><?php _e( 'Other formats', 'pressbooks' ); ?>:</legend> <?php foreach ( $formats['exotic'] as $key => $value ) { printf( '<input type="checkbox" id="%1$s" name="export_formats[%1$s]" value="1" %2$s/><label for="%1$s"> %3$s</label><br />',
Change the word Exotic to Other (#<I>)
pressbooks_pressbooks
train
php
1d926b467eee699fbf2796b9bc4b2b52ee3a036b
diff --git a/upload/catalog/language/en-gb/common/footer.php b/upload/catalog/language/en-gb/common/footer.php index <HASH>..<HASH> 100644 --- a/upload/catalog/language/en-gb/common/footer.php +++ b/upload/catalog/language/en-gb/common/footer.php @@ -16,10 +16,3 @@ $_['text_order'] = 'Order History'; $_['text_wishlist'] = 'Wish List'; $_['text_newsletter'] = 'Newsletter'; $_['text_powered'] = 'Powered By <a href="https://www.opencart.com">OpenCart</a><br /> %s &copy; %s'; - -$_['text_address'] = 'Address'; -$_['text_open'] = 'Opening Time'; -$_['text_telephone'] = 'Telephone'; -$_['text_fax'] = 'Fax'; -$_['text_email'] = 'Email'; -$_['button_email'] = 'Contact us by email';
Remove unused language strings from footer
opencart_opencart
train
php
2b19cf39e1c5d26e7041d31a066e50e7fa062399
diff --git a/framework/core/js/lib/App.js b/framework/core/js/lib/App.js index <HASH>..<HASH> 100644 --- a/framework/core/js/lib/App.js +++ b/framework/core/js/lib/App.js @@ -6,6 +6,7 @@ import Translator from 'flarum/Translator'; import extract from 'flarum/utils/extract'; import patchMithril from 'flarum/utils/patchMithril'; import RequestError from 'flarum/utils/RequestError'; +import { extend } from 'flarum/extend'; /** * The `App` class provides a container for an application, as well as various @@ -189,6 +190,15 @@ export default class App { options.config = options.config || this.session.authorize.bind(this.session); options.background = options.background || true; + // If the method is something like PATCH or DELETE, which not all servers + // support, then we'll send it as a POST request with a the intended method + // specified in the X-Fake-Http-Method header. + if (options.method !== 'GET' && options.method !== 'POST') { + const method = options.method; + extend(options, 'config', (result, xhr) => xhr.setRequestHeader('X-Fake-Http-Method', method)); + options.method = 'POST'; + } + // When we deserialize JSON data, if for some reason the server has provided // a dud response, we don't want the application to crash. We'll show an // error message to the user instead.
Fake PATCH/PUT/DELETE requests closes #<I>
flarum_core
train
js
30b0c943a07059cdf8bed7eb4f2426100ef5d108
diff --git a/lib/cassandra_migrations/migration/table_operations.rb b/lib/cassandra_migrations/migration/table_operations.rb index <HASH>..<HASH> 100644 --- a/lib/cassandra_migrations/migration/table_operations.rb +++ b/lib/cassandra_migrations/migration/table_operations.rb @@ -11,6 +11,12 @@ module CassandraMigrations # - renaming tables module TableOperations + # Creates a new table in the keyspace + # + # options: + # - :primary_keys: single value or array (for compound primary keys). If + # not defined, some column must be chosen as primary key in the table definition. + def create_table(table_name, options = {}) create_table_helper = CreateTableHelper.new create_table_helper.define_primary_keys(options[:primary_keys]) if options[:primary_keys] @@ -27,7 +33,14 @@ module CassandraMigrations execute create_cql end + + def drop_table(table_name) + announce_operation "drop_table(#{table_name})" + drop_cql = "DROP TABLE #{table_name}" + announce_suboperation drop_cql + execute drop_cql + end end end end
Added operations 'drop_table' to migrations.
hsgubert_cassandra_migrations
train
rb
9201db4ff77c69d011b1d1393b953678f732eafe
diff --git a/core/src/main/java/com/capitalone/dashboard/model/CodeQualityType.java b/core/src/main/java/com/capitalone/dashboard/model/CodeQualityType.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/capitalone/dashboard/model/CodeQualityType.java +++ b/core/src/main/java/com/capitalone/dashboard/model/CodeQualityType.java @@ -5,7 +5,7 @@ package com.capitalone.dashboard.model; */ public enum CodeQualityType { StaticAnalysis, - Security; + SecurityAnalysis; public static CodeQualityType fromString(String value) { for (CodeQualityType qualityType : values()) { diff --git a/core/src/main/java/com/capitalone/dashboard/model/CollectorType.java b/core/src/main/java/com/capitalone/dashboard/model/CollectorType.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/capitalone/dashboard/model/CollectorType.java +++ b/core/src/main/java/com/capitalone/dashboard/model/CollectorType.java @@ -12,7 +12,9 @@ public enum CollectorType { ScopeOwner, Scope, CodeQuality, - Test; + Test, + StaticSecurityScan, + Cloud; public static CollectorType fromString(String value) { for (CollectorType collectorType : values()) {
Core support to handle fortify security scan.
Hygieia_Hygieia
train
java,java
23c3f75e8e7c826f8fc46e238fcad4df617ecf43
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from distutils.core import setup setup( name = 'mapped_config', packages = ['mapped_config'], - version = '1.1', + version = '1.11', description = 'Mapped config loader for python for secure, easy and modular configuration management', author = 'Alvaro Garcia Gomez', author_email = '[email protected]',
Updated pypi version
maxpowel_mapped_config
train
py
53bbfe841c76d2cd909ebf6a20c82a97962a6824
diff --git a/src/Slick/Mvc/Command/Task/GenerateScaffoldController.php b/src/Slick/Mvc/Command/Task/GenerateScaffoldController.php index <HASH>..<HASH> 100644 --- a/src/Slick/Mvc/Command/Task/GenerateScaffoldController.php +++ b/src/Slick/Mvc/Command/Task/GenerateScaffoldController.php @@ -73,7 +73,7 @@ class GenerateScaffoldController extends Base implements TaskInterface { parent::__construct($options); Template::addPath(dirname(dirname(__DIR__)) .'/Views'); - Configuration::addPath(dirname($this->_path) .'/Configuration'); + Configuration::addPath(getcwd() .'/Configuration'); } /**
Fix path tho current application configuration
slickframework_slick
train
php
bed566f08ac180a94949b244eda05f40dcea1694
diff --git a/scripts/build/5.3.convert.php b/scripts/build/5.3.convert.php index <HASH>..<HASH> 100644 --- a/scripts/build/5.3.convert.php +++ b/scripts/build/5.3.convert.php @@ -205,12 +205,8 @@ function convertCustom($filepath, &$file) '$php .= 0x7fffffe;' ), array( - "\$php .= '[';", - "\$php .= 'array(';" - ), - array( - "\$php .= ']';", - "\$php .= ')';" + "\$php .= '[' . implode(',', \$elements) . ']';", + "\$php .= 'array(' . implode(',', \$elements) . ')';" ) ), 'PHP/XPathConvertorTest.php' => array(
Updated build script [ci skip]
s9e_TextFormatter
train
php
b3503812fce734aebbc931e960ffd01637685dfa
diff --git a/utils/MutationUtils.js b/utils/MutationUtils.js index <HASH>..<HASH> 100644 --- a/utils/MutationUtils.js +++ b/utils/MutationUtils.js @@ -12,8 +12,7 @@ var createMutation = function (astNode, endOffset, parentMutationId, replacement col: astNode.loc.start.column, parentMutationId: parentMutationId, mutationId: _.uniqueId(), - replacement: replacement, - type: "value" + replacement: replacement }; }; @@ -32,8 +31,7 @@ var createOperatorMutation = function (astNode, parentMutationId, replacement) { col: astNode.left.loc.end.column, mutationId: _.uniqueId(), parentMutationId: parentMutationId, - replacement: replacement, - type: "operator" + replacement: replacement }; }; var createUnaryOperatorMutation = function (astNode, parentMutationId, replacement) { @@ -44,8 +42,7 @@ var createUnaryOperatorMutation = function (astNode, parentMutationId, replaceme col: astNode.loc.end.column, mutationId: _.uniqueId(), parentMutationId: parentMutationId, - replacement: replacement, - type: "unary" + replacement: replacement }; };
removed 'type' from the mutation object
jimivdw_grunt-mutation-testing
train
js
59a2932a8a31f3b6d186e8d9bd6b8b4abc096eae
diff --git a/src/Requirement.php b/src/Requirement.php index <HASH>..<HASH> 100644 --- a/src/Requirement.php +++ b/src/Requirement.php @@ -9,4 +9,8 @@ class Requirement { $this->name = $name; $this->version = $version; } + + public function check():bool { + // TODO: Check if the requirement is installed on the developer's system. + } } \ No newline at end of file
Add todo for another day...
PhpGt_Build
train
php
db63db1a56250ebe4fd21917f4f1aeeb42493229
diff --git a/base.php b/base.php index <HASH>..<HASH> 100644 --- a/base.php +++ b/base.php @@ -444,7 +444,7 @@ final class Base { switch (gettype($arg)) { case 'object': $str=''; - if (get_class($arg)!='Closure' && $detail) + if (!preg_match('/Base|Closure/',get_class($arg)) && $detail) foreach ((array)$arg as $key=>$val) $str.=($str?',':'').$this->stringify( preg_replace('/[\x00].+?[\x00]/','',$key)).'=>'.
Bug fix: Regression of issue #<I>
bcosca_fatfree-core
train
php
ba54e1b4af814df9d7fe18d0b768a9dee4914626
diff --git a/handlers/leave.js b/handlers/leave.js index <HASH>..<HASH> 100644 --- a/handlers/leave.js +++ b/handlers/leave.js @@ -12,18 +12,6 @@ a peer that we are managing state information for and if we are then the peer state is removed. - ##### Events triggered in response to `/leave` messages - - The following event(s) are triggered when a `/leave` action is received - from a peer signaller: - - - `peer:leave` - - The `peer:leave` event is emitted once a `/leave` message is captured - from a peer. Prior to the event being dispatched, the internal peers - data in the signaller is removed but can be accessed in 2nd argument - of the event handler. - **/ module.exports = function(signaller) { return function(args) { @@ -36,6 +24,6 @@ module.exports = function(signaller) { } // emit the event - signaller.emit('peer:leave', data.id, peer); + signaller.emit('peer:disconnected', data.id, peer); }; }; \ No newline at end of file
Generate a peer:disconnected event rather than peer:leave for /leave messages sent by the signaller
rtc-io_rtc-signaller
train
js
de6cb1086e94e43b26afa726b8730920755b5876
diff --git a/src/Bono/Middleware/ContentNegotiatorMiddleware.php b/src/Bono/Middleware/ContentNegotiatorMiddleware.php index <HASH>..<HASH> 100644 --- a/src/Bono/Middleware/ContentNegotiatorMiddleware.php +++ b/src/Bono/Middleware/ContentNegotiatorMiddleware.php @@ -113,11 +113,6 @@ class ContentNegotiatorMiddleware extends \Slim\Middleware { $app = $this->app; - $include = $app->request->get('!include'); - if (!empty($include)) { - \Norm\Norm::options('include', true); - } - $app->response->setBody(''); $app->view($this->handler); $app->response->headers['content-type'] = $this->mediaType;
moved !include qs to norm provider (you can find it there)
xinix-technology_bono
train
php
f8b864dd9323811deaa5bda94ac57ddfe3e4118e
diff --git a/cmd/jujud/agent/machine_test.go b/cmd/jujud/agent/machine_test.go index <HASH>..<HASH> 100644 --- a/cmd/jujud/agent/machine_test.go +++ b/cmd/jujud/agent/machine_test.go @@ -734,6 +734,9 @@ func (s *MachineSuite) TestManageEnvironRunsPeergrouper(c *gc.C) { } func (s *MachineSuite) testAddresserNewWorkerResult(c *gc.C, expectFinished bool) { + // TODO(dimitern): Fix this in a follow-up. + c.Skip("Test temporarily disabled as flaky - see bug lp:1488576") + started := make(chan struct{}) s.PatchValue(&newAddresser, func(api *apiaddresser.API) (worker.Worker, error) { close(started)
Disabled a flaky test until we can fix it properly
juju_juju
train
go
2257583bc41b1cf2624907f0b3934cf3f12a3895
diff --git a/src/Form/Element/Select.php b/src/Form/Element/Select.php index <HASH>..<HASH> 100644 --- a/src/Form/Element/Select.php +++ b/src/Form/Element/Select.php @@ -114,13 +114,13 @@ class Select extends NamedFormElement } /** - * @param bool $nullable + * @param bool|true $nullable * * @return $this */ - public function setNullable($nullable) + public function nullable() { - $this->nullable = (bool) $nullable; + $this->nullable = true; return $this; }
Renamed method Select::setNullable to nullable
LaravelRUS_SleepingOwlAdmin
train
php
a1a35a54c020257020567c7f0abbba45340d623e
diff --git a/zappa/utilities.py b/zappa/utilities.py index <HASH>..<HASH> 100644 --- a/zappa/utilities.py +++ b/zappa/utilities.py @@ -1,3 +1,4 @@ +import botocore import calendar import datetime import durationpy
import botocore for line <I> Line <I> uses __botocore.exceptions.ClientError__ but botocore is never imported which has the potential of raising NameError instead of botocore.exceptions.ClientError.
Miserlou_Zappa
train
py
df150f09b7b00644b1d513a47ccae806b27101db
diff --git a/bundles/org.eclipse.orion.client.editor/web/examples/editor/demoSetup.js b/bundles/org.eclipse.orion.client.editor/web/examples/editor/demoSetup.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.editor/web/examples/editor/demoSetup.js +++ b/bundles/org.eclipse.orion.client.editor/web/examples/editor/demoSetup.js @@ -99,7 +99,6 @@ define(["require", vi = new mVI.VIMode(view); emacs = new mEmacs.EmacsMode(view); updateKeyMode(view, options); - updateMarginRuler(view, options); /* Undo stack */ var undoStack = exports.undoStack = new mUndoStack.UndoStack(view, 200); @@ -222,6 +221,7 @@ define(["require", view.addRuler(foldingRuler); } view.addRuler(overviewRuler); + updateMarginRuler(view, options); return view; } exports.checkView = checkView;
fix exception in editor demo (when showMarginRuler is true at the start)
eclipse_orion.client
train
js
f1dc1f3a84e8c1704baba5bf9dec42dd2a55eb22
diff --git a/lib/rack/jsonp.rb b/lib/rack/jsonp.rb index <HASH>..<HASH> 100644 --- a/lib/rack/jsonp.rb +++ b/lib/rack/jsonp.rb @@ -11,6 +11,7 @@ module Rack @app = app @carriage_return = options[:carriage_return] || false @callback_param = options[:callback_param] || 'callback' + @timestamp_param = options[:timestamp_param] || '_' end # Proxies the request to the application, stripping out the JSON-P @@ -25,10 +26,12 @@ module Rack # callback parameter request = Rack::Request.new(env) callback = request.params.delete(@callback_param) + timestamp = request.params.delete(@timestamp_param) env['QUERY_STRING'] = env['QUERY_STRING'].split("&").delete_if{|param| - param =~ /^(_|#{@callback_param})=/ + param =~ /^(#{@timestamp_param}|#{@callback_param})=/ }.join("&") env['rack.jsonp.callback'] = callback + env['rack.jsonp.timestamp'] = timestamp status, headers, response = @app.call(env)
Save JSONP-timestamp in env['rack.jsonp.timestamp'] for access from other middleware and/or app.
crohr_rack-jsonp
train
rb
e77faf7187e880bf5f0201d6ed4a11ea5892d361
diff --git a/src/Stripe.php b/src/Stripe.php index <HASH>..<HASH> 100644 --- a/src/Stripe.php +++ b/src/Stripe.php @@ -20,6 +20,8 @@ namespace Cartalyst\Stripe; +use ReflectionClass; + class Stripe { /** @@ -264,7 +266,7 @@ class Stripe { $class = "\\Cartalyst\\Stripe\\Api\\".ucwords($method); - if (class_exists($class)) { + if (class_exists($class) && ! (new ReflectionClass($class))->isAbstract()) { return new $class($this->config); }
chore: Make sure that abstract classes are not being instantiated.
cartalyst_stripe
train
php
0140e556cbb42bb879089fb82aad184aabd3a794
diff --git a/core/src/main/java/jlibs/core/lang/StringUtil.java b/core/src/main/java/jlibs/core/lang/StringUtil.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/jlibs/core/lang/StringUtil.java +++ b/core/src/main/java/jlibs/core/lang/StringUtil.java @@ -240,6 +240,15 @@ public class StringUtil{ /*-------------------------------------------------[ Literal ]---------------------------------------------------*/ + public static String toLiteral(char ch, boolean useRaw){ + if(ch=='\'') + return "\\'"; + else if(ch=='"') + return "\""; + else + return StringUtil.toLiteral(String.valueOf(ch), useRaw); + } + public static String toLiteral(CharSequence str, boolean useRaw){ StringBuffer buf = new StringBuffer(str.length()+25); for(int i=0,len=str.length(); i<len; i++){
added toLiteral(ch, useRaw)
santhosh-tekuri_jlibs
train
java
2251da82d61e55c05514ba0aa33a7783fb97640a
diff --git a/Includes/Page.php b/Includes/Page.php index <HASH>..<HASH> 100644 --- a/Includes/Page.php +++ b/Includes/Page.php @@ -1155,7 +1155,9 @@ class Page { $tokens = $this->wiki->get_tokens(); - if( !$pgNotag ) $summary .= $pgTag; + if( !$pgNotag ) { + $summary = substr( $summary . $pgTag, 0, 255 ); + } if( $tokens['edit'] == '' ) { pecho( "User is not allowed to edit {$this->title}\n\n", PECHO_FATAL );
Stop version tagging creating an edit summary > <I> chars Edit summaries > <I> chars cause edits to fail.
MW-Peachy_Peachy
train
php
709a7e7c2ebb9c80f48a247521d7458eba7e2986
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -47,7 +47,7 @@ setup( keywords='push notification', - packages=['ntfy'], + packages=['ntfy', 'ntfy.backends'], install_requires=[ 'requests',
whoops, forgot backends package in setup.py
dschep_ntfy
train
py
52f955a718d57c7e6e082ff7994fa6ae34e9ff33
diff --git a/src/test/java/com/cloudant/tests/DatabaseTest.java b/src/test/java/com/cloudant/tests/DatabaseTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/cloudant/tests/DatabaseTest.java +++ b/src/test/java/com/cloudant/tests/DatabaseTest.java @@ -62,7 +62,7 @@ public class DatabaseTest { //replicate animaldb for tests com.cloudant.client.api.Replication r = account.replication(); - r.source("https://clientlibs-test.cloudant.com/animaldb"); + r.source("http://clientlibs-test.cloudant.com/animaldb"); r.createTarget(true); r.target(dbResource.getDbURIWithUserInfo()); r.trigger();
Made replication URL http Cloudant https now uses SHA-2, the Erlang level for travis CouchDB service is R<I>, but SHA-2 is not supported until Erlang <I>. Workaround by using http instead of https for replication, we are only reading from the example animaldb to the travis couch instance anyway.
cloudant_java-cloudant
train
java
3c2f2af10d06090e864197ecb839ea0f0d32d6e8
diff --git a/DataGrid/ReviewDataGrid.php b/DataGrid/ReviewDataGrid.php index <HASH>..<HASH> 100644 --- a/DataGrid/ReviewDataGrid.php +++ b/DataGrid/ReviewDataGrid.php @@ -11,7 +11,7 @@ */ namespace WellCommerce\Bundle\ReviewBundle\DataGrid; -use WellCommerce\Bundle\CoreBundle\DataGrid\AbstractDataGrid; +use WellCommerce\Bundle\DataGridBundle\DataGrid\AbstractDataGrid; use WellCommerce\Component\DataGrid\Column\Column; use WellCommerce\Component\DataGrid\Column\ColumnCollection; use WellCommerce\Component\DataGrid\Column\Options\Appearance;
Introduced DataGridBundle
WellCommerce_WishlistBundle
train
php
5fa69abff5263544d2b7fd68e21ab36a3a381a1b
diff --git a/writer.go b/writer.go index <HASH>..<HASH> 100644 --- a/writer.go +++ b/writer.go @@ -103,12 +103,9 @@ func (w *Writer) Listen() { for { select { case <-w.ticker.C: - w.mtx.Lock() if w.ticker != nil { w.Flush() } - - w.mtx.Unlock() case <-w.tdone: w.mtx.Lock() w.ticker.Stop()
Removing wrong lock (it locks inside flush).
gosuri_uilive
train
go
605f4015b6fa57d2cef2d0b26cfd068f806e42f2
diff --git a/src/View.php b/src/View.php index <HASH>..<HASH> 100644 --- a/src/View.php +++ b/src/View.php @@ -885,11 +885,7 @@ class View implements jsExpressionable */ public function js($when = null, $action = null, $selector = null) { - if ($selector) { - $chain = new jQuery($selector); - } else { - $chain = new jQuery($this); - } + $chain = new jQuery($selector ?: $this); // Substitute $when to make it better work as a array key if ($when === true) {
use one liner for jQuery selector (#<I>)
atk4_ui
train
php
504c9b4a5b72c230a1898e2839e400f3a2abd55d
diff --git a/src/org/opencms/search/galleries/CmsGalleryNameMacroResolver.java b/src/org/opencms/search/galleries/CmsGalleryNameMacroResolver.java index <HASH>..<HASH> 100644 --- a/src/org/opencms/search/galleries/CmsGalleryNameMacroResolver.java +++ b/src/org/opencms/search/galleries/CmsGalleryNameMacroResolver.java @@ -261,7 +261,7 @@ public class CmsGalleryNameMacroResolver extends CmsMacroResolver { Collection<CmsResource> pages = getContainerPages(); if (pages.isEmpty()) { - return null; + return ""; } try { Map<Locale, String> pagePropsByLocale = Maps.newHashMap(); @@ -289,7 +289,7 @@ public class CmsGalleryNameMacroResolver extends CmsMacroResolver { return result; } catch (CmsException e) { LOG.warn(e.getLocalizedMessage(), e); - return null; + return ""; } }
Fixed issue with unresolved page_title macros in gallery titles.
alkacon_opencms-core
train
java
91583008cb64f2a4a42981f53b926495ab05829a
diff --git a/input/tangy-eftouch.js b/input/tangy-eftouch.js index <HASH>..<HASH> 100644 --- a/input/tangy-eftouch.js +++ b/input/tangy-eftouch.js @@ -187,7 +187,7 @@ export class TangyEftouch extends PolymerElement { if (this.timeLimit) { this.timeLimitTimeout = setTimeout(() => { this.disabled = true - this.transition(this.hasAttribute('go-next-on-time-limit')) + if (this.hasAttribute('go-next-on-time-limit')) this.transition(true) }, this.timeLimit) } this.fitItInterval = setInterval(this.fitIt.bind(this), Math.floor(1000/30))
Fix transition logic for go-next-on-time-limit
Tangerine-Community_tangy-form
train
js
294477e146c0fbad27949997286b44759e1c1e9d
diff --git a/lib/mspec/opal/runner.rb b/lib/mspec/opal/runner.rb index <HASH>..<HASH> 100644 --- a/lib/mspec/opal/runner.rb +++ b/lib/mspec/opal/runner.rb @@ -175,12 +175,8 @@ class NodeJSFormatter < BrowserFormatter `global.OPAL_SPEC_CODE = code;` end - def finish - super - puts "\n\n" - end - def finish_with_code(code) + puts "\n\n" exit(code) end end
Re-add missing newlines in NodeJS mspec runner
opal_opal
train
rb
e9f3bd38172473447fdc9923697d4f88684ff176
diff --git a/pygal/graph/graph.py b/pygal/graph/graph.py index <HASH>..<HASH> 100644 --- a/pygal/graph/graph.py +++ b/pygal/graph/graph.py @@ -47,8 +47,8 @@ class Graph(BaseGraph): def _axes(self): """Draw axes""" - self._x_axis() self._y_axis() + self._x_axis() def _set_view(self): """Assign a view to current graph"""
Reorders axes in SVG output. Fix #<I> Currently pygal renders the x-axis before the y-axis, but this means that because of the painters algorithm, the horizontal guide lines of the y-axis are above the y-axis line (which is actually an x-axis guide). If you have custom css that changes the colours of horizontal guide lines, for example to hide them until hovered over, they create visual gaps in the y-axis.
Kozea_pygal
train
py
cc2d87301308d6811591cfbd26755695e607df5d
diff --git a/source/Internal/Review/Service/UserRatingServiceInterface.php b/source/Internal/Review/Service/UserRatingServiceInterface.php index <HASH>..<HASH> 100644 --- a/source/Internal/Review/Service/UserRatingServiceInterface.php +++ b/source/Internal/Review/Service/UserRatingServiceInterface.php @@ -4,7 +4,7 @@ * See LICENSE file for license details. */ -namespace OxidEsales\EshopCommunity\Internal\Service; +namespace OxidEsales\EshopCommunity\Internal\Review\Service; use Doctrine\Common\Collections\ArrayCollection;
OXDEV-<I> Fix namespace in UserRatingServiceInterface
OXID-eSales_oxideshop_ce
train
php
c59e9cb12cdd587093e456e9efeb0be894bb54a1
diff --git a/java/client/src/org/openqa/selenium/logging/LogEntry.java b/java/client/src/org/openqa/selenium/logging/LogEntry.java index <HASH>..<HASH> 100644 --- a/java/client/src/org/openqa/selenium/logging/LogEntry.java +++ b/java/client/src/org/openqa/selenium/logging/LogEntry.java @@ -60,7 +60,7 @@ public class LogEntry { } /** - * Gets the timestamp of the log statement in seconds since UNIX Epoch. + * Gets the timestamp of the log statement in milliseconds since UNIX Epoch. * * @return timestamp as UNIX Epoch */ @@ -80,7 +80,7 @@ public class LogEntry { @Override public String toString() { return String.format("[%s] [%s] %s", - DATE_FORMAT.format(new Date(timestamp * 1000L)), level, message); + DATE_FORMAT.format(new Date(timestamp)), level, message); } @SuppressWarnings("unused")
AlexeiBarantsev: Timestamps are to be in milliseconds. So they are in Firefox driver already. r<I>
SeleniumHQ_selenium
train
java
f30ee9a1746ba07903e5e89ebfae18338bd2ba04
diff --git a/parsers/EN/GeneralDateParser.js b/parsers/EN/GeneralDateParser.js index <HASH>..<HASH> 100644 --- a/parsers/EN/GeneralDateParser.js +++ b/parsers/EN/GeneralDateParser.js @@ -8,7 +8,7 @@ if(typeof chrono == 'undefined') throw 'Cannot find the chrono main module'; - var PATTERN = /(today|tonight|tomorrow|yesterday|last\s*night|([1-9]+)\s*day(s)\s*ago|([0-9]{1,2})(\.|\:|\:)([0-9]{2})|([0-9]{1,2}\s*\W?\s*)?([0-9]{1,2})\s*(AM|PM)|at\s*([0-9]{1,2}|noon|midnight)|(noon|midnight))(\W|$)/i; + var PATTERN = /(today|tonight|tomorrow|yesterday|last\s*night|([0-9]+)\s*day(s)\s*ago|([0-9]{1,2})(\.|\:|\:)([0-9]{2})|([0-9]{1,2}\s*\W?\s*)?([0-9]{1,2})\s*(AM|PM)|at\s*([0-9]{1,2}|noon|midnight)|(noon|midnight))(\W|$)/i; /** * GeneralDateParser - Create a parser object
Fix ".. days ago" with zeros
wanasit_chrono
train
js
58f6e3205942b1a13ca41a7b90ccaba051f1c599
diff --git a/spec/mvcli/cortex.rb b/spec/mvcli/cortex.rb index <HASH>..<HASH> 100644 --- a/spec/mvcli/cortex.rb +++ b/spec/mvcli/cortex.rb @@ -2,16 +2,23 @@ require "mvcli/core" module MVCLI class Cortex + include Enumerable + def initialize @cores = [] + yield self if block_given? end def <<(core) - core.tap do + tap do @cores << core end end + def each(&block) + @cores.each &block + end + def exists?(extension_point, extension_name) @cores.detect {|core| core.exists? extension_point, extension_name } end diff --git a/spec/mvcli/cortex_spec.rb b/spec/mvcli/cortex_spec.rb index <HASH>..<HASH> 100644 --- a/spec/mvcli/cortex_spec.rb +++ b/spec/mvcli/cortex_spec.rb @@ -11,8 +11,8 @@ describe "A Cortex" do end describe "with a few cores" do - Given(:core1) { cortex << double(:Core1) } - Given(:core2) { cortex << double(:Core2) } + Given(:core1) { add_core :Core1 } + Given(:core2) { add_core :Core2 } context "when we access an object" do When(:extension) { cortex.read :controller, "admin/users" } @@ -41,4 +41,10 @@ describe "A Cortex" do end end end + + def add_core(name) + core = double name + cortex << core + return core + end end
Cortex is Enumerable and Cortex#<< is chainable
cowboyd_mvcli
train
rb,rb
69e0051aa5cb6c330931d5f9e4be94e8f0c265fa
diff --git a/src/main/java/com/github/noraui/service/impl/CryptoServiceImpl.java b/src/main/java/com/github/noraui/service/impl/CryptoServiceImpl.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/noraui/service/impl/CryptoServiceImpl.java +++ b/src/main/java/com/github/noraui/service/impl/CryptoServiceImpl.java @@ -76,7 +76,7 @@ public class CryptoServiceImpl implements CryptoService { cipher.init(Cipher.ENCRYPT_MODE, aesKey); return getPrefix() + Base64.encodeBase64String(cipher.doFinal(text.getBytes())); } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) { - LOGGER.error(Messages.getMessage(TechnicalException.TECHNICAL_ERROR_MESSAGE_ENCRYPT_EXCEPTION), e); + LOGGER.error(Messages.getMessage(TechnicalException.TECHNICAL_ERROR_MESSAGE_ENCRYPT_EXCEPTION)); throw new TechnicalException(Messages.getMessage(TechnicalException.TECHNICAL_ERROR_MESSAGE_ENCRYPT_EXCEPTION), e); } }
Sonar: Either log this exception and handle it, or rethrow it with some contextual information.
NoraUi_NoraUi
train
java
3ccc1c5c9df7538fea88d303735d7b2bfef29d79
diff --git a/lib/CoreBot.js b/lib/CoreBot.js index <HASH>..<HASH> 100755 --- a/lib/CoreBot.js +++ b/lib/CoreBot.js @@ -324,6 +324,10 @@ function Botkit(configuration) { if (condition.execute) { var script = condition.execute.script; var thread = condition.execute.thread; + + // this will stop the conversation from automatically ending while the transition takes place + that.status = 'transitioning'; + botkit.studio.get(that.context.bot, script, that.source_message.user, that.source_message.channel, that.source_message).then(function(new_convo) { that.context.transition_to = new_convo.context.script_name || null;
attempt to stop convo from ended during an execute script transition
howdyai_botkit
train
js
8fde6672437e2c67413855ef6029daa96079f4bb
diff --git a/test/test_parsing.rb b/test/test_parsing.rb index <HASH>..<HASH> 100644 --- a/test/test_parsing.rb +++ b/test/test_parsing.rb @@ -294,6 +294,12 @@ class TestParsing < TestCase time = parse_now("05/06", :endian_precedence => [:little, :medium]) assert_equal Time.local(2006, 6, 5, 12), time + time = parse_now("05/06 6:05:57 PM") + assert_equal Time.local(2006, 5, 6, 18, 05, 57), time + + time = parse_now("05/06 6:05:57 PM", :endian_precedence => [:little, :medium]) + assert_equal Time.local(2006, 6, 5, 18, 05, 57), time + time = parse_now("13/01") assert_nil time end
Introduce failing test for sm/sd with time
mojombo_chronic
train
rb
1bb1f76c4ab6248859345bb27c56e025a3d77b16
diff --git a/python/src/nnabla/utils/data_source_implements.py b/python/src/nnabla/utils/data_source_implements.py index <HASH>..<HASH> 100644 --- a/python/src/nnabla/utils/data_source_implements.py +++ b/python/src/nnabla/utils/data_source_implements.py @@ -44,6 +44,8 @@ class SimpleDataSource(DataSource): return self._load_func(self._order[position]) def reset(self): + self._indexes = self._rng.permutation( + self._size) if self._shuffle else numpy.arange(self._size) super(SimpleDataSource, self).reset() def __init__(self, load_func, num_examples, shuffle=False, rng=None):
Enable Shuffling During Training
sony_nnabla
train
py
6b042da2d8f9a7267dbe76e59b830cf248c063e2
diff --git a/tsdb/head.go b/tsdb/head.go index <HASH>..<HASH> 100644 --- a/tsdb/head.go +++ b/tsdb/head.go @@ -1115,6 +1115,10 @@ func (h *Head) Delete(mint, maxt int64, ms ...*labels.Matcher) error { var stones []tombstones.Stone for p.Next() { series := h.series.getByID(chunks.HeadSeriesRef(p.At())) + if series == nil { + level.Debug(h.logger).Log("msg", "Series not found in Head.Delete") + continue + } series.RLock() t0, t1 := series.minTime(), series.maxTime()
Fix panic if series is not found when deleting series
prometheus_prometheus
train
go
f58a362b1e20993c95bac1f49da345fb56abbf36
diff --git a/molecule/command/init/scenario.py b/molecule/command/init/scenario.py index <HASH>..<HASH> 100644 --- a/molecule/command/init/scenario.py +++ b/molecule/command/init/scenario.py @@ -155,7 +155,7 @@ def _default_scenario_exists(ctx, param, value): # pragma: no cover @click.option( '--driver-name', '-d', - type=click.Choice(api.drivers()), + type=click.Choice([str(s) for s in api.drivers()]), default='docker', help='Name of driver to initialize. (docker)', )
Fixed molecule init scenario (#<I>) Avoid error like below: File ".../site-packages/click/types.py", line <I>, in get_metavar return '[%s]' % '|'.join(self.choices) TypeError: sequence item 0: expected str instance, <DriverClass> found This adopts the same code from init-role which was working correctly.
ansible_molecule
train
py
2e052902062f6ddd5be49a02c9fbabac09a75d65
diff --git a/gns3server/modules/vmware/vmware_vm.py b/gns3server/modules/vmware/vmware_vm.py index <HASH>..<HASH> 100644 --- a/gns3server/modules/vmware/vmware_vm.py +++ b/gns3server/modules/vmware/vmware_vm.py @@ -375,6 +375,8 @@ class VMwareVM(BaseVM): vnet = "ethernet{}.vnet".format(adapter_number) if vnet not in self._vmx_pairs: raise VMwareError("vnet {} not in VMX file".format(vnet)) + if not self._ubridge_hypervisor: + raise VMwareError("Cannot start the packet capture: uBridge is not running") yield from self._ubridge_hypervisor.send('bridge start_capture {name} "{output_file}"'.format(name=vnet, output_file=output_file)) @@ -389,6 +391,8 @@ class VMwareVM(BaseVM): vnet = "ethernet{}.vnet".format(adapter_number) if vnet not in self._vmx_pairs: raise VMwareError("vnet {} not in VMX file".format(vnet)) + if not self._ubridge_hypervisor: + raise VMwareError("Cannot stop the packet capture: uBridge is not running") yield from self._ubridge_hypervisor.send("bridge stop_capture {name}".format(name=vnet)) def check_hw_virtualization(self):
Fixes issue with packet capture on VMware VMs. Fixes #<I>.
GNS3_gns3-server
train
py
bc0083df44080c55ecca807f637189d32f31bea6
diff --git a/lib/popcorntime_search/link.rb b/lib/popcorntime_search/link.rb index <HASH>..<HASH> 100644 --- a/lib/popcorntime_search/link.rb +++ b/lib/popcorntime_search/link.rb @@ -19,9 +19,9 @@ module PopcorntimeSearch end def to_s - string = "#{@filename || @title} [#{@quality}][#{@language.upcase}][#{@provider}]" - string << " (#{@size})" if @size - string << " - [#{@seeders.to_s.green}/#{@leechers.to_s.red}]" + string = "#{filename || title} [#{quality}][#{language.upcase}][#{provider}]" + string << " (#{size})" if size + string << " - [#{seeders.to_s.green}/#{leechers.to_s.red}]" string end
Cleaned up Link.to_s
iovis9_popcorntime_search
train
rb
a45ba7ca4a544c634f0a4ffbab7fff0586050e90
diff --git a/src/search/FileFilters.js b/src/search/FileFilters.js index <HASH>..<HASH> 100644 --- a/src/search/FileFilters.js +++ b/src/search/FileFilters.js @@ -355,7 +355,7 @@ define(function (require, exports, module) { dialog.done(function (buttonId) { if (buttonId === Dialogs.DIALOG_BTN_OK) { // Update saved filter preference - setActiveFilter({ name: $nameField.val(), patterns: getValue() }, index); + setActiveFilter({ name: $nameField.val().substr(0, 10), patterns: getValue() }, index); _updatePicker(); _doPopulate(); }
Limits the length of the name to the specific number of characters
adobe_brackets
train
js
3ad6ebf3b8d1e4835e4bb62be9dbc08fc48518ac
diff --git a/alot/commands/globals.py b/alot/commands/globals.py index <HASH>..<HASH> 100644 --- a/alot/commands/globals.py +++ b/alot/commands/globals.py @@ -267,24 +267,17 @@ class ExternalCommand(Command): def thread_code(*_): try: - if stdin is None: - proc = subprocess.Popen(self.cmdlist, shell=self.shell, - stderr=subprocess.PIPE) - ret = proc.wait() - err = proc.stderr.read() - else: - proc = subprocess.Popen(self.cmdlist, shell=self.shell, - stdin=subprocess.PIPE, - stderr=subprocess.PIPE) - _, err = proc.communicate(stdin.read()) - ret = proc.wait() - if ret == 0: - return 'success' - else: - return err.strip() + proc = subprocess.Popen(self.cmdlist, shell=self.shell, + stdin=subprocess.PIPE, + stderr=subprocess.PIPE) except OSError as e: return str(e) + _, err = proc.communicate(stdin.read() if stdin else None) + if proc.returncode == 0: + return 'success' + return err.strip() + if self.in_thread: d = threads.deferToThread(thread_code) d.addCallback(afterwards)
commands/globals: Simplify ExternalCommand thread_Code This simplifies the code but not using an if/else, but to just use a ternary to set the input to Popen.communicate. This also pulls some code out of the try/except block that isn't being tried.
pazz_alot
train
py
9bbd8aad6b6c1de4ee24bbf2dcbb1be5831ddb72
diff --git a/tower_cli/models/base.py b/tower_cli/models/base.py index <HASH>..<HASH> 100644 --- a/tower_cli/models/base.py +++ b/tower_cli/models/base.py @@ -976,7 +976,7 @@ class MonitorableResource(ResourceMethods): # In the first moments of running the job, the standard out # may not be available yet - if not content.startswith("Waiting for results"): + if not content.startswith(b"Waiting for results"): line_count = len(content.splitlines()) start_line += line_count click.echo(content, nl=0)
Enhance startswith argument usage for python <I> compatibility.
ansible_tower-cli
train
py
17a88352abd07b0b3f59a221f2c1ed5c88d97e8c
diff --git a/core/src/main/java/hudson/model/Descriptor.java b/core/src/main/java/hudson/model/Descriptor.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/model/Descriptor.java +++ b/core/src/main/java/hudson/model/Descriptor.java @@ -921,14 +921,18 @@ public abstract class Descriptor<T extends Describable<T>> implements Saveable { d = findById(descriptors, kind); } if (d == null) { - kind = jo.getString("$class"); - d = findByDescribableClassName(descriptors, kind); - if (d == null) d = findByClassName(descriptors, kind); + kind = jo.optString("$class"); + if (kind != null) { + d = findByDescribableClassName(descriptors, kind); + if (d == null) { + d = findByClassName(descriptors, kind); + } + } } if (d != null) { items.add(d.newInstance(req, jo)); } else { - LOGGER.warning("Received unexpected formData for descriptor " + kind); + LOGGER.log(Level.WARNING, "Received unexpected formData: {0}", jo); } } }
newInstancesFromHeteroList should recover gracefully from the case that both kind and $class are missing.
jenkinsci_jenkins
train
java
ba2183be46091a783b66c00d541dd650f57b4089
diff --git a/src/DiffSniffer/Application.php b/src/DiffSniffer/Application.php index <HASH>..<HASH> 100644 --- a/src/DiffSniffer/Application.php +++ b/src/DiffSniffer/Application.php @@ -3,6 +3,7 @@ namespace DiffSniffer; use function basename; +use function count; use DiffSniffer\Command\BadUsage; use PackageVersions\Versions; use PHP_CodeSniffer\Config; @@ -53,6 +54,12 @@ final class Application define('PHP_CODESNIFFER_CBF', false); + // workaround for an issue in Config: when $args are empty, + // it takes values from the environment + if (!count($args)) { + $args = ['-d', 'error_reporting=' . error_reporting()]; + } + $config = new Config($args); $runner = new Runner($config);
Workaround for an issue in Config
diff-sniffer_core
train
php
24cab7f9dfa8aeacd5ba5f510c48a369907b1ec0
diff --git a/cmd/erasure-metadata.go b/cmd/erasure-metadata.go index <HASH>..<HASH> 100644 --- a/cmd/erasure-metadata.go +++ b/cmd/erasure-metadata.go @@ -103,11 +103,17 @@ func (fi FileInfo) ToObjectInfo(bucket, object string) ObjectInfo { IsDir: true, } } + + versionID := fi.VersionID + if globalBucketVersioningSys.Enabled(bucket) && versionID == "" { + versionID = nullVersionID + } + objInfo := ObjectInfo{ IsDir: false, Bucket: bucket, Name: object, - VersionID: fi.VersionID, + VersionID: versionID, IsLatest: fi.IsLatest, DeleteMarker: fi.Deleted, Size: fi.Size,
ilm: Remove a 'null' version if not latest (#<I>) If the ILM document requires removing noncurrent versions, the the server should be able to remove 'null' versions as well. 'null' versions are created when versioning is not enabled or suspended.
minio_minio
train
go
91368805bd99a49e35426181016b1a919833e56f
diff --git a/zendesk/endpoints_v2.py b/zendesk/endpoints_v2.py index <HASH>..<HASH> 100644 --- a/zendesk/endpoints_v2.py +++ b/zendesk/endpoints_v2.py @@ -317,28 +317,28 @@ mapping_table = { }, # Organizations - 'list_organzations': { + 'list_organizations': { 'path': '/organizations.json', 'method': 'GET', }, - 'autocomplete_organzations': { + 'autocomplete_organizations': { 'path': '/organizations/autocomplete.json', 'valid_params': ['name'], 'method': 'GET', }, - 'show_organzation': { + 'show_organization': { 'path': '/organizations/{{organization_id}}.json', 'method': 'GET', }, - 'create_organzation': { + 'create_organization': { 'path': '/organizations.json', 'method': 'POST', }, - 'update_organzation': { + 'update_organization': { 'path': '/organizations/{{organization_id}}.json', 'method': 'PUT', }, - 'delete_organzation': { + 'delete_organization': { 'path': '/organizations/{{organization_id}}.json', 'method': 'DELETE', },
Fixed spelling for organization methods in v2 API.
fprimex_zdesk
train
py
0d82048c3943d208d3f67c402f61241fd209f5fb
diff --git a/polysquare_setuptools_lint/__init__.py b/polysquare_setuptools_lint/__init__.py index <HASH>..<HASH> 100644 --- a/polysquare_setuptools_lint/__init__.py +++ b/polysquare_setuptools_lint/__init__.py @@ -324,6 +324,10 @@ class PolysquareLintCommand(setuptools.Command): # suppress(unused-function) if len(lines) == 0: return False + # Handle errors which appear after the end of the document. + while line > len(lines) - 1: + line = line - 1 + relevant_line = lines[line - 1] try:
polysquarelint: Handle messages appearing after end of document
polysquare_polysquare-setuptools-lint
train
py
149219bacf171521216b33fbe7b7e2ce27f6e53c
diff --git a/lib/bundle_views/index.js b/lib/bundle_views/index.js index <HASH>..<HASH> 100644 --- a/lib/bundle_views/index.js +++ b/lib/bundle_views/index.js @@ -50,7 +50,7 @@ app.get('/viewsetup.js', function(req, res) { }); app.get('/view/:bundle_name*', function(req, res, next) { - var bundleName = req.query.bundle_name; + var bundleName = req.params.bundle_name; var bundle = Bundles.find(bundleName); // We start out assuming the user is trying to reach the index page
it's req.params not req.query mate
nodecg_nodecg
train
js
6274bcd03c8ccd12123901a43075f675e694e524
diff --git a/tests/test_uflash.py b/tests/test_uflash.py index <HASH>..<HASH> 100644 --- a/tests/test_uflash.py +++ b/tests/test_uflash.py @@ -660,29 +660,6 @@ def test_main_named_args(): keepname=False) -def test_main_keepname_args(): - """ - Ensure that keepname is passed properly. - """ - with mock.patch('uflash.flash') as mock_flash: - uflash.main(argv=['tests/example.py', '--keepname']) - mock_flash.assert_called_once_with(path_to_python='tests/example.py', - paths_to_microbits=[], - path_to_runtime=None, - minify=False, - keepname=True) - - -def test_main_keepname_message(capsys): - """ - Ensure that the correct filename appears in output message. - """ - uflash.main(argv=['tests/example.py', '--keepname']) - stdout, stderr = capsys.readouterr() - expected = 'example.hex' - assert (expected in stdout) or (expected in stderr) - - def test_main_watch_flag(): """ The watch flag cause a call the correct function.
Removed keepname test for main() Removed tests invoking main with the keepname argument.
ntoll_uflash
train
py
73488d3916238cedc9c65a251a1b44a844b3fc89
diff --git a/pyvips/voperation.py b/pyvips/voperation.py index <HASH>..<HASH> 100644 --- a/pyvips/voperation.py +++ b/pyvips/voperation.py @@ -280,8 +280,8 @@ class Operation(pyvips.VipsObject): details = intro.details[name] if (details['flags'] & _DEPRECATED) != 0: - logger.info('{0} argument {1} is deprecated', - operation_name, name) + logger.info('{0} argument {1} is deprecated' + .format(operation_name, name)) _find_inside(add_reference, value) op.set(name, details['flags'], match_image, value)
Fix logging deprecated arguments. When a deprecated argument is used, an exception was being thrown because a format string was being used but the logger as expecting percent placeholders. The current code would throw an exception.
libvips_pyvips
train
py
0205340b2d8587106d8c48a8bdd38120260b377e
diff --git a/category_encoders/ordinal.py b/category_encoders/ordinal.py index <HASH>..<HASH> 100644 --- a/category_encoders/ordinal.py +++ b/category_encoders/ordinal.py @@ -319,8 +319,8 @@ class OrdinalEncoder(BaseEstimator, TransformerMixin): for col in cols: nan_identity = np.nan - - categories = X[col].unique().tolist() + + categories = list(X[col].unique()) if util.is_category(X[col].dtype): # Avoid using pandas category dtype meta-data if possible, see #235, #238. if X[col].dtype.ordered:
Adjusted method ordinal_encoding when it get's a dataframe with dtype='string' (#<I>) The problem occurs because the dataframe contains `dtype='string'` parameter. With this, the `unique()` method returns `StringArray` object, no np array. Instead of using `tolist` method, it was included the `list` call outside.
scikit-learn-contrib_categorical-encoding
train
py
56452d6f33b53f84b05ffa8bfb7d88b1de3a0126
diff --git a/angr/analyses/cfg/cfg_fast.py b/angr/analyses/cfg/cfg_fast.py index <HASH>..<HASH> 100644 --- a/angr/analyses/cfg/cfg_fast.py +++ b/angr/analyses/cfg/cfg_fast.py @@ -2532,7 +2532,7 @@ class CFGFast(ForwardAnalysis, CFGBase): # pylint: disable=abstract-method jump.resolved_targets = targets all_targets = set(targets) for addr in all_targets: - to_outside = addr in self.functions or not self._addrs_belong_to_same_section(jump.addr, addr) + to_outside = jump.jumpkind == 'Ijk_Call' or addr in self.functions or not self._addrs_belong_to_same_section(jump.addr, addr) # TODO: get a better estimate of the function address target_func_addr = jump.func_addr if not to_outside else addr
Fixed indirect_jump_resolvers reusing func_addr for ijk_calls to outside functions (#<I>) When updating targets for a resolved indirect_jump in cfg_fast, to_outside does not consider that an ijk_call is naturally a jump to an outside function and should be set to True for any ijk_call jumpkind.
angr_angr
train
py
79de265060be821d7e6b35df9eb4741aeb088739
diff --git a/go/mysql/server.go b/go/mysql/server.go index <HASH>..<HASH> 100644 --- a/go/mysql/server.go +++ b/go/mysql/server.go @@ -296,7 +296,7 @@ func (l *Listener) handle(conn net.Conn, connectionID uint32, acceptTime time.Ti if err != nil { // Don't log EOF errors. They cause too much spam, same as main read loop. if err != io.EOF { - log.Infof("Cannot read client handshake response from %s: %v, it may not be a valid MySQL client", c, err) + log.Infof("Cannot read client handshake response from %s: %v, it may not be a valid MySQL client", c, err) } return }
fixing formatting so s/spaces/tabs/. go lang newbie here!
vitessio_vitess
train
go
cda1840dc5f2818b4b56ddab676104106f0c5a55
diff --git a/pyqode/core/modes/checker.py b/pyqode/core/modes/checker.py index <HASH>..<HASH> 100644 --- a/pyqode/core/modes/checker.py +++ b/pyqode/core/modes/checker.py @@ -53,7 +53,7 @@ class CheckerMessage(object): MSG_STATUS_ERROR: "#DD4040"} def __init__(self, description, status, line, col=None, icon=None, - color=None): + color=None, filename=None): """ :param description: The message description (used as a tooltip) :param status: @@ -75,6 +75,7 @@ class CheckerMessage(object): self.icon = self.ICONS[status] self._marker = None self._decoration = None + self.filename = filename class CheckerMode(Mode, QtCore.QObject):
Add filename to checker (usefull when working with multiple editors)
pyQode_pyqode.core
train
py
26e9baa4e6915cb1954f883563e99171f2a53afc
diff --git a/src/ActivityLog/ActivityLogger.php b/src/ActivityLog/ActivityLogger.php index <HASH>..<HASH> 100644 --- a/src/ActivityLog/ActivityLogger.php +++ b/src/ActivityLog/ActivityLogger.php @@ -156,7 +156,7 @@ class ActivityLogger throw new Exception("Could not determine a user with identifier '{$modelOrId}''."); } - protected function replacePlaceholders($message, Activity $activity) + public function replacePlaceholders($message, Activity $activity) { return preg_replace_callback('/:[a-z0-9._-]+/i', function ($match) use ($activity) { $match = $match[0]; diff --git a/src/ActivityLog/Traits/LogsActivity.php b/src/ActivityLog/Traits/LogsActivity.php index <HASH>..<HASH> 100644 --- a/src/ActivityLog/Traits/LogsActivity.php +++ b/src/ActivityLog/Traits/LogsActivity.php @@ -155,6 +155,10 @@ trait LogsActivity protected function shouldLogEvent($eventName) { + if (!$this->enableLoggingModelsEvents) { + return FALSE; + } + if (!in_array($eventName, ['created', 'updated'])) { return TRUE; }
Fixed issue where LogsActivity disableLogging() and enableLogging() methods has no effect
tastyigniter_flame
train
php,php
fd8a6775f57c4fae1d7cc99560f4efe30e1ac9dd
diff --git a/pkg/namesgenerator/names-generator.go b/pkg/namesgenerator/names-generator.go index <HASH>..<HASH> 100644 --- a/pkg/namesgenerator/names-generator.go +++ b/pkg/namesgenerator/names-generator.go @@ -159,6 +159,9 @@ var ( // Subrahmanyan Chandrasekhar - Astrophysicist known for his mathematical theory on different stages and evolution in structures of the stars. He has won nobel prize for physics - https://en.wikipedia.org/wiki/Subrahmanyan_Chandrasekhar "chandrasekhar", + //Claude Shannon - The father of information theory and founder of digital circuit design theory. (https://en.wikipedia.org/wiki/Claude_Shannon) + "shannon", + // Jane Colden - American botanist widely considered the first female American botanist - https://en.wikipedia.org/wiki/Jane_Colden "colden", @@ -422,6 +425,9 @@ var ( // Sally Kristen Ride was an American physicist and astronaut. She was the first American woman in space, and the youngest American astronaut. https://en.wikipedia.org/wiki/Sally_Ride "ride", + // Rita Levi-Montalcini - Won Nobel Prize in Physiology or Medicine jointly with colleague Stanley Cohen for the discovery of nerve growth factor (https://en.wikipedia.org/wiki/Rita_Levi-Montalcini) + "montalcini", + // Dennis Ritchie - co-creator of UNIX and the C programming language. - https://en.wikipedia.org/wiki/Dennis_Ritchie "ritchie",
Adding Rita Levi-Montalcini and Claude Shannon to name generator
moby_moby
train
go
5cc8876719b597e327eeefab761b1be462ad6a99
diff --git a/lib/mini_aether.rb b/lib/mini_aether.rb index <HASH>..<HASH> 100644 --- a/lib/mini_aether.rb +++ b/lib/mini_aether.rb @@ -14,6 +14,9 @@ module MiniAether scope = Java::OrgJrubyEmbed::LocalContextScope::SINGLETHREAD c = Java::OrgJrubyEmbed::ScriptingContainer.new(scope) begin + # short-lived container of mostly java calls may be a bit + # faster without spending time to JIT + c.setCompileMode Java::OrgJruby::RubyInstanceConfig::CompileMode::OFF yield c ensure c.terminate
Set compile mode to 'OFF' in sub JRuby instance.
pmahoney_mini_aether
train
rb
ac06779f5634514c8b41d4e4b1651b50f8c32629
diff --git a/connector/src/yang/connector/netconf.py b/connector/src/yang/connector/netconf.py index <HASH>..<HASH> 100644 --- a/connector/src/yang/connector/netconf.py +++ b/connector/src/yang/connector/netconf.py @@ -10,9 +10,13 @@ from ncclient import transport from ncclient.devices.default import DefaultDeviceHandler from ncclient.operations.errors import TimeoutExpiredError -from pyats.log.utils import banner -from pyats.connections import BaseConnection -from pyats.utils.secret_strings import to_plaintext +try: + from pyats.log.utils import banner + from pyats.connections import BaseConnection + from pyats.utils.secret_strings import to_plaintext +except ImportError: + class BaseConnection: + pass # try to record usage statistics # - only internal cisco users will have stats.CesMonitor module
Making Gnmi class available for subclassing without pyATS installed.
CiscoTestAutomation_yang
train
py
39182f22f6a8cc25a87c5dc4d2b193133902c3a8
diff --git a/spec/lib/lapine/consumer/runner_spec.rb b/spec/lib/lapine/consumer/runner_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/lapine/consumer/runner_spec.rb +++ b/spec/lib/lapine/consumer/runner_spec.rb @@ -16,7 +16,7 @@ RSpec.describe Lapine::Consumer::Runner do let(:queues) do [ { - 'q' => 'testing.test', + 'q' => '', 'topic' => 'testing.topic', 'routing_key' => 'testing.update', 'handlers' => @@ -50,10 +50,12 @@ RSpec.describe Lapine::Consumer::Runner do expect(FakerHandler).to receive(:handle_lapine_payload).twice em do subject.run - conn = Lapine::Consumer::Connection.new(config, 'testing.topic') - conn.exchange.publish(message, routing_key: 'testing.update') - conn.exchange.publish(message, routing_key: 'testing.update') - EventMachine.add_timer(2.0) { done } + EventMachine.add_timer(0.5) { + conn = Lapine::Consumer::Connection.new(config, 'testing.topic') + conn.exchange.publish(message, routing_key: 'testing.update') + conn.exchange.publish(message, routing_key: 'testing.update') + } + EventMachine.add_timer(1.0) { done } end end end
runner spec needs to run in event machine to avoid race condition When publishing synchronously, messages may be published before queues have been bound in the runner’s event machine loop.
messagebus_lapine
train
rb
9ab00cc457155811e4d368968de9108e11a8b894
diff --git a/iprestrict/__init__.py b/iprestrict/__init__.py index <HASH>..<HASH> 100644 --- a/iprestrict/__init__.py +++ b/iprestrict/__init__.py @@ -2,4 +2,4 @@ from .restrictor import IPRestrictor __all__ = ["IPRestrictor"] -__version__ = "0.4.2" +__version__ = "0.4.3"
Bumped version to <I>
muccg_django-iprestrict
train
py
6dca8ac460203dde8bcf94fc9d116132544ddc45
diff --git a/.eslintrc.js b/.eslintrc.js index <HASH>..<HASH> 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,7 +2,9 @@ module.exports = { plugins: [ "matrix-org", ], - extends: ["plugin:matrix-org/babel"], + extends: [ + "plugin:matrix-org/babel", + ], env: { browser: true, node: true, @@ -31,14 +33,26 @@ module.exports = { "no-console": "error", }, overrides: [{ - "files": ["src/**/*.ts"], - "extends": ["plugin:matrix-org/typescript"], - "rules": { + files: [ + "**/*.ts", + ], + extends: [ + "plugin:matrix-org/typescript", + ], + rules: { + // TypeScript has its own version of this + "@babel/no-invalid-this": "off", + // We're okay being explicit at the moment "@typescript-eslint/no-empty-interface": "off", - // While we're converting to ts we make heavy use of this + // We disable this while we're transitioning "@typescript-eslint/no-explicit-any": "off", + // We'd rather not do this but we do + "@typescript-eslint/ban-ts-comment": "off", + "quotes": "off", + // We use a `logger` intermediary module + "no-console": "error", }, }], };
Switch to new Babel lint config This also adjusts the TypeScript project lint config to cover *.ts test files too.
matrix-org_matrix-js-sdk
train
js
9b53b4ab7efc5868b3cbedcc65d528b7d416c10c
diff --git a/tests/Stripe/SubscriptionTest.php b/tests/Stripe/SubscriptionTest.php index <HASH>..<HASH> 100644 --- a/tests/Stripe/SubscriptionTest.php +++ b/tests/Stripe/SubscriptionTest.php @@ -34,8 +34,7 @@ class SubscriptionTest extends TestCase '/v1/subscriptions' ); $resource = Subscription::create([ - "customer" => "cus_123", - "plan" => "plan" + "customer" => "cus_123" ]); $this->assertInstanceOf("Stripe\\Subscription", $resource); }
Fix some parameters being sent in tests Fixes one parameter being sent so that the suite is compliant with a version of stripe-mock that's checking for extra parameters. See <URL>
stripe_stripe-php
train
php
f82170a2ac2df8b9ed48c87f0b8ef5ada10e0b12
diff --git a/api/server/services/services.go b/api/server/services/services.go index <HASH>..<HASH> 100644 --- a/api/server/services/services.go +++ b/api/server/services/services.go @@ -101,7 +101,7 @@ func (sc *serviceContainer) initStorageServices() error { log.WithField("service", serviceName).Debug("processing service config") - scope := fmt.Sprintf("libstorage.server.types.%s", serviceName) + scope := fmt.Sprintf("libstorage.server.driver.%s", serviceName) log.WithField("scope", scope).Debug("getting scoped config for service") config := sc.config.Scope(scope) diff --git a/client/client.go b/client/client.go index <HASH>..<HASH> 100644 --- a/client/client.go +++ b/client/client.go @@ -98,9 +98,9 @@ func New(config gofig.Config) (Client, error) { } const ( - osDriverKey = "libstorage.client.types.os" - storageDriverKey = "libstorage.client.types.storage" - integrationDriverKey = "libstorage.client.types.integration" + osDriverKey = "libstorage.client.driver.os" + storageDriverKey = "libstorage.client.driver.storage" + integrationDriverKey = "libstorage.client.driver.integration" ) func registerConfig() {
Config Key Fix This patch updates the config keys that were in error. Former-commit-id: <I>b<I>b<I>bddbb<I>afbf<I>cfd<I>cc<I>b6
thecodeteam_libstorage
train
go,go
057054f250d419baf6ac48dd353935d7d1f4254a
diff --git a/importer/indico_importer/plugin.py b/importer/indico_importer/plugin.py index <HASH>..<HASH> 100644 --- a/importer/indico_importer/plugin.py +++ b/importer/indico_importer/plugin.py @@ -19,6 +19,7 @@ from __future__ import unicode_literals from indico.core import signals from indico.core.plugins import IndicoPlugin, IndicoPluginBlueprint, plugin_url_rule_to_js from MaKaC.webinterface.pages.conferences import WPConfModifScheduleGraphic +from indico.util.i18n import _ from .controllers import RHGetImporters, RHImportData @@ -43,7 +44,7 @@ class ImporterPlugin(IndicoPlugin): return blueprint def get_timetable_buttons(self, *args, **kwargs): - yield ('Importer', 'createImporterDialog') + yield (_('Importer'), 'createImporterDialog') def get_vars_js(self): return {'urls': {'import_data': plugin_url_rule_to_js('importer.import_data'),
Add missing i<I>n to timetable buttons
indico_indico-plugins
train
py
16f3bf239a7d3d7907d30e9fbb09aeafec154592
diff --git a/comments.go b/comments.go index <HASH>..<HASH> 100644 --- a/comments.go +++ b/comments.go @@ -177,15 +177,17 @@ func (comments *Comments) Add(text string) (err error) { item := comments.item insta := item.media.instagram() + var query map[string]string + switch item.media.(type) { case *StoryMedia: // TODO: story causes error url = urlReplyStory - data, err = insta.prepareData( + query = insta.prepareDataQuery( map[string]interface{}{ "recipient_users": fmt.Sprintf("[[%d]]", item.User.ID), "action": "send_item", - "client_context": insta.dID, "media_id": item.ID, + "client_context": generateUUID(), "text": text, "entry": "reel", "reel_id": item.User.ID, @@ -198,6 +200,7 @@ func (comments *Comments) Add(text string) (err error) { "comment_text": text, }, ) + query = generateSignature(data) } if err != nil { return err @@ -207,7 +210,7 @@ func (comments *Comments) Add(text string) (err error) { _, err = insta.sendRequest( &reqOptions{ Endpoint: url, - Query: generateSignature(data), + Query: query, IsPost: true, }, )
Added Commends.Add support for Stories (incomplete)
ahmdrz_goinsta
train
go
e476b099db95a60deac402ea713102e54b756770
diff --git a/lib/mumble-ruby/client.rb b/lib/mumble-ruby/client.rb index <HASH>..<HASH> 100644 --- a/lib/mumble-ruby/client.rb +++ b/lib/mumble-ruby/client.rb @@ -106,6 +106,7 @@ module Mumble private def spawn_thread(sym) + Thread.abort_on_exception = true Thread.new { loop { send sym } } end
Readd Thread.abort_on_exception = true to enable better troubleshooting in the future.
mattvperry_mumble-ruby
train
rb
46136004df484a95a6fbf3c8f306684a5304e1eb
diff --git a/system/modules/DocumentManagementSystem/classes/DmsConfig.php b/system/modules/DocumentManagementSystem/classes/DmsConfig.php index <HASH>..<HASH> 100644 --- a/system/modules/DocumentManagementSystem/classes/DmsConfig.php +++ b/system/modules/DocumentManagementSystem/classes/DmsConfig.php @@ -86,7 +86,8 @@ class DmsConfig */ public static function getTempDirectory($blnAppendTrailingSlash) { - $path = self::getBaseDirectory(true) . self::DIRECTORY_NAME_TEMP; + //$path = self::getBaseDirectory(true) . self::DIRECTORY_NAME_TEMP; + $path = "system/tmp"; if ($blnAppendTrailingSlash) {
Upload to `system/tmp` (see #<I> )
ContaoDMS_dms
train
php
c4a69b006d90513004da456b0c11fd8e3ea5b0e8
diff --git a/lib/tty/commands/new.rb b/lib/tty/commands/new.rb index <HASH>..<HASH> 100644 --- a/lib/tty/commands/new.rb +++ b/lib/tty/commands/new.rb @@ -143,7 +143,13 @@ module TTY puts out add_tty_libs_to_gemspec + process_templates + end + # Process templates by injecting vars and moving to location + # + # @api private + def process_templates() templates.each do |src, dst| source = ::File.join(template_source_path, src) destination = app_path.join(dst).to_s
Change to extract method for future cutomisations
piotrmurach_tty
train
rb
4bd5048d50c5bba020a6e0e5fb3729984bf76a41
diff --git a/metrics/metrics.go b/metrics/metrics.go index <HASH>..<HASH> 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -45,16 +45,20 @@ func recordLatency(start time.Time) { latency.Insert(time.Now().Sub(start).Seconds() * 1000.0) } +func resetLatency() { + latencyMutex.Lock() + defer latencyMutex.Unlock() + + latency.Reset() +} + func init() { latency = quantile.NewTargeted(0.50, 0.75, 0.90, 0.95, 0.99, 0.999) go func() { reset := time.NewTicker(1 * time.Minute) for _ = range reset.C { - latencyMutex.Lock() - defer latencyMutex.Unlock() - - latency.Reset() + resetLatency() } }()
Fix locking. Not sure why I thought defer was lexically scoped. It's not.
codahale_http-handlers
train
go
eccf6668df2abc34718da65f0e74ee324a453f6e
diff --git a/django_extensions/management/commands/shell_plus.py b/django_extensions/management/commands/shell_plus.py index <HASH>..<HASH> 100644 --- a/django_extensions/management/commands/shell_plus.py +++ b/django_extensions/management/commands/shell_plus.py @@ -1,4 +1,5 @@ import os +import six import time from optparse import make_option @@ -95,7 +96,7 @@ class Command(NoArgsCommand): if pythonrc and os.path.isfile(pythonrc): with open(pythonrc) as rcfile: try: - exec(compile(rcfile.read(), pythonrc, 'exec')) + six.exec_(compile(rcfile.read(), pythonrc, 'exec')) except NameError: pass # This will import .pythonrc.py as a side-effect
fix python 2.x compatibility by using six.exec_
django-extensions_django-extensions
train
py
4e5eee1892e1aa6af709443b617b9578c553362c
diff --git a/src/test/com/mongodb/DBCollectionTest.java b/src/test/com/mongodb/DBCollectionTest.java index <HASH>..<HASH> 100644 --- a/src/test/com/mongodb/DBCollectionTest.java +++ b/src/test/com/mongodb/DBCollectionTest.java @@ -250,12 +250,11 @@ public class DBCollectionTest extends TestCase { } - /*@Test(enabled=false) public void mongodIsVersion20Plus() { String version = (String) _db.command("serverStatus").get("version"); System.err.println("Connected to MongoDB Version '" + version + "'"); assert(Double.parseDouble(version.substring(0, 3)) >= 2.0); - }*/ + } @Test/*(dependsOnMethods = { "mongodIsVersion20Plus" })*/ public void testMultiInsertWithContinue() {
I need to wake up clearly, I was calling that method. It needed to be de-annotated as a Test, not commented out.
mongodb_mongo-java-driver
train
java