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
ce2ef416f2aa48e3cca880318270deca84b27de2
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -131,7 +131,7 @@ DittoHbs.prototype.renderHtml = function(files, Ditto, templates, callback) { if(file.path.name != 'index') { - name = path.join(file.path.name, 'index'); + file.path.name = path.join(file.path.name, 'index'); } //if this isn't the base index
forgot to assign indexed filename to the actual file
pimbrouwers_ditto-hbs
train
js
7063e32400dc1f1fb105cebf2594e7fff9d9ea1f
diff --git a/test/test_helper.rb b/test/test_helper.rb index <HASH>..<HASH> 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -42,9 +42,7 @@ class Minitest::Test # Delete all collections from the database. def dump_database - Mongoid.session(:default).collections.each do |collection| - collection.drop unless collection.name.include?('system.') - end + Mongoid.default_session.drop() end end
fixing db dump issue. Based off of this PR: <URL>
projectcypress_health-data-standards
train
rb
c640f6a3f6334dbd4150158da4c78db50ed3a1cf
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -13,8 +13,6 @@ try: except ImportError: from distutils.core import setup -import justext - with open("README.rst") as readme: with open("CHANGELOG.rst") as changelog: @@ -26,7 +24,7 @@ with open("LICENSE.rst") as file: setup( name="jusText", - version=justext.__version__, + version="1.2.0", description="Heuristic based boilerplate removal tool", long_description=long_description, author="Michal Belica",
Don't import justext in setup.py file Script ends with error if lxml is not already installed. More info at <URL>
miso-belica_jusText
train
py
4c34d47dccdb5ae1a2889ea70de7fe316fd3b496
diff --git a/consullock/cli.py b/consullock/cli.py index <HASH>..<HASH> 100644 --- a/consullock/cli.py +++ b/consullock/cli.py @@ -217,7 +217,7 @@ def main(cli_arguments: List[str]): except PermissionDeniedConsulError as e: error_message = f"Invalid credentials - are you sure you have set {CONSUL_TOKEN_ENVIRONMENT_VARIABLE} " \ - f"correctly (currently set to \"{consul_configuration.token}\")?" + f"correctly?" logger.debug(e) logger.error(error_message) exit(PERMISSION_DENIED_EXIT_CODE)
Stops leaking token if seemingly incorrect!
wtsi-hgi_consul-lock
train
py
a6d4f25a56ed8be7135cd2f5d8864c9800b72b11
diff --git a/numina/array/wavecalib/__main__.py b/numina/array/wavecalib/__main__.py index <HASH>..<HASH> 100644 --- a/numina/array/wavecalib/__main__.py +++ b/numina/array/wavecalib/__main__.py @@ -214,6 +214,9 @@ def wvcal_spectrum(filename, ns1, ns2, print("Reading master table: " + wv_master_file) print("wv_master:\n", wv_master) + wv_master_range = wv_master[-1] - wv_master[0] + delta_wv_master_range = 0.10 * wv_master_range + # wavelength calibration xchannel = fxpeaks + 1.0 list_of_wvfeatures = arccalibration( @@ -221,8 +224,8 @@ def wvcal_spectrum(filename, ns1, ns2, xpos_arc=xchannel, naxis1_arc=naxis1, crpix1=1.0, - wv_ini_search=wv_master[0] - 1000.0, - wv_end_search=wv_master[-1] + 1000.0, + wv_ini_search=wv_master[0] - delta_wv_master_range, + wv_end_search=wv_master[-1] + delta_wv_master_range, error_xpos_arc=3, times_sigma_r=3.0, frac_triplets_for_sum=0.50,
Enlarge the expected wavelength range by a fixed fraction.
guaix-ucm_numina
train
py
e236bc1d54bd3b87d5dba38d9b3cf35402065610
diff --git a/spec/semipublic/shared/resource_shared_spec.rb b/spec/semipublic/shared/resource_shared_spec.rb index <HASH>..<HASH> 100644 --- a/spec/semipublic/shared/resource_shared_spec.rb +++ b/spec/semipublic/shared/resource_shared_spec.rb @@ -107,7 +107,7 @@ share_examples_for 'A semipublic Resource' do statistic = Statistic.create(:name => "visits", :value => 2) statistic.repository.should == @alternate_repository Statistic.new.repository.should == @alternate_repository - Statistic.get(1).repository.should == @alternate_repository + Statistic.get(statistic.id).repository.should == @alternate_repository end it "should return the repository defined by the current context" do
removed resource_shared_spec dependency on assumption that created resource will have ID = 1
datamapper_dm-core
train
rb
1c775d131bbd93ee888f34030b0e2a89e60ebe46
diff --git a/lnwallet/transactions_test.go b/lnwallet/transactions_test.go index <HASH>..<HASH> 100644 --- a/lnwallet/transactions_test.go +++ b/lnwallet/transactions_test.go @@ -986,6 +986,9 @@ func createTestChannelsForVectors(tc *testContext, chanType channeldb.ChannelTyp // Return a clean up function that stops goroutines and removes the test // databases. cleanUpFunc := func() { + dbLocal.Close() + dbRemote.Close() + os.RemoveAll(localPath) os.RemoveAll(remotePath)
lnwallet/test: close database after test
lightningnetwork_lnd
train
go
25fd19c74a3ad80f6cb0bd0f31a0b6cc8ed7c91f
diff --git a/test/asyncio_tests/test_asyncio_collection.py b/test/asyncio_tests/test_asyncio_collection.py index <HASH>..<HASH> 100644 --- a/test/asyncio_tests/test_asyncio_collection.py +++ b/test/asyncio_tests/test_asyncio_collection.py @@ -272,6 +272,7 @@ class TestAsyncIOCollection(AsyncIOTestCase): def test_nested_callbacks(self): results = [0] future = asyncio.Future(loop=self.loop) + yield from self.collection.remove() yield from self.collection.insert({'_id': 1}) def callback(result, error): diff --git a/test/tornado_tests/test_motor_collection.py b/test/tornado_tests/test_motor_collection.py index <HASH>..<HASH> 100644 --- a/test/tornado_tests/test_motor_collection.py +++ b/test/tornado_tests/test_motor_collection.py @@ -285,6 +285,7 @@ class MotorCollectionTest(MotorTest): def test_nested_callbacks(self): results = [0] future = Future() + yield self.collection.remove() yield self.collection.insert({'_id': 1}) def callback(result, error):
Clean up before running test_nested_callbacks.
mongodb_motor
train
py,py
553996ad9eb32957ee0d8c9e8dca1545582f83cb
diff --git a/src/http/Uri.php b/src/http/Uri.php index <HASH>..<HASH> 100644 --- a/src/http/Uri.php +++ b/src/http/Uri.php @@ -179,16 +179,9 @@ class Uri { $path = '/' . trim($path, '/'); - if ($path === '/') - { - $this->path = '/'; - } - else - { - self::validatePath($path); - - $this->path = $path; - } + self::validatePath($path); + + $this->path = $path; return $this; }
Reducing cyclomatic complexity.
jurchiks_commons
train
php
af2792465b55627284000d2093f2c5689d3b7aff
diff --git a/src/Mailer/AppEmail.php b/src/Mailer/AppEmail.php index <HASH>..<HASH> 100644 --- a/src/Mailer/AppEmail.php +++ b/src/Mailer/AppEmail.php @@ -79,10 +79,13 @@ class AppEmail extends Email return $email; } catch (Exception $e) { if (Configure::check('app.EmailTransport.fallback')) { - Log::error('The email could not be sent but was resent with the fallback configuration.<br /><br />' . $e->__toString()); - TransportFactory::setConfig('fallback', Configure::read('app.EmailTransport.fallback')); - $this->setTransport('fallback'); - return $this->send($content); + // only try to send once with fallback config + if (is_null(TransportFactory::getConfig('fallback'))) { + Log::error('The email could not be sent but was resent with the fallback configuration.<br /><br />' . $e->__toString()); + TransportFactory::setConfig('fallback', Configure::read('app.EmailTransport.fallback')); + $this->setTransport('fallback'); + return $this->send($content); + } } else { throw $e; }
only try to send email once with fallback config
foodcoopshop_foodcoopshop
train
php
ed1967f72f44174ce91144a522a6f09c5ffff6b1
diff --git a/tools/suds_devel/requirements.py b/tools/suds_devel/requirements.py index <HASH>..<HASH> 100644 --- a/tools/suds_devel/requirements.py +++ b/tools/suds_devel/requirements.py @@ -182,9 +182,17 @@ def pytest_requirements(version_info=None, ctypes_version=_Unspecified): # requires, even though it does not list it explicitly among its # requirements. Python 3.x series introduced the argparse module in its 3.2 # release so it needs to be installed manually in 3.0.x & 3.1.x releases. - # Tested that pytest 2.5.2 requires py 1.4.20 which in turn requires the + # Tested that pytest 2.5.2+ requires py 1.4.20+ which in turn requires the # argparse module but does not specify this dependency explicitly. elif (3,) <= version_info < (3, 2): + # pytest versions prior to 2.6.0 are not compatible with Python 3.1, + # mostly due to accidental incompatibilities introduced because that is + # not one of the officially supported platforms for pytest and so does + # not get regular testing. Development version 2.6.0 has been tested + # with this project and found to work correctly. + #TODO: Once pytest 2.6.0 has been officially released change the pytest + # requirement to ("==", "2.6.0"). + pytest_version = (">=", lowest_version_string_with_prefix("2.6.0")), missing_argparse = True if current_environment: try:
require pytest <I> under Python <I> pytest <I> restores Python <I> compatibility that has been causing our project testing to fail in that environment. Note that pytest <I> has not yet been officially released but our project's testing has been tried out and found to be working with the current pytest development tip. Tested using both the 'setup.py test' command and the 'tools/setup_basic_environments.py' script.
ovnicraft_suds2
train
py
80a60914d55b09ac48dad723fd9e6a4de081a5f7
diff --git a/src/TwigExtension.php b/src/TwigExtension.php index <HASH>..<HASH> 100644 --- a/src/TwigExtension.php +++ b/src/TwigExtension.php @@ -702,7 +702,7 @@ class TwigExtension extends \Twig_Extension $results = $this->app['storage']->getContent($contenttype, $options); // Loop the array, set records in 'current' to have a 'selected' flag. - if (!empty($current)) { + if (!empty($current) && !empty($results)) { foreach ($results as $key => $result) { if (in_array($result->id, $current)) { $results[$key]['selected'] = true;
Don't throw an error after removing contenttypes.
bolt_bolt
train
php
399b11e82e3fb8c116adbdbdaddb90ef2df48440
diff --git a/lib/sprockets/base.rb b/lib/sprockets/base.rb index <HASH>..<HASH> 100644 --- a/lib/sprockets/base.rb +++ b/lib/sprockets/base.rb @@ -5,7 +5,6 @@ require 'sprockets/errors' require 'sprockets/processed_asset' require 'sprockets/server' require 'sprockets/static_asset' -require 'json' require 'pathname' require 'securerandom'
json require is unused in base
rails_sprockets
train
rb
35140463a7e8ebd4cf9f9957f2db4f738444fae9
diff --git a/lib/backup/version.rb b/lib/backup/version.rb index <HASH>..<HASH> 100644 --- a/lib/backup/version.rb +++ b/lib/backup/version.rb @@ -13,7 +13,7 @@ module Backup # Defines the minor version # PATCH: # Defines the patch version - MAJOR, MINOR, PATCH = 3, 0, 17 + MAJOR, MINOR, PATCH = 3, 0, 18 ## # Returns the major version ( big release based off of multiple minor releases )
Bumping to version <I>! Fixes a crucial CLI issue.
backup_backup
train
rb
668a596d5a39060535a13a1b254e41e769c60aea
diff --git a/pycbc/strain.py b/pycbc/strain.py index <HASH>..<HASH> 100644 --- a/pycbc/strain.py +++ b/pycbc/strain.py @@ -138,7 +138,7 @@ def from_cli(opt): logging.info("Converting to float32") strain = (DYN_RANGE_FAC * strain).astype(float32) strain._epoch = lal.LIGOTimeGPS(opt.gps_start_time) - return strain + return strain def insert_strain_option_group(parser): """
Fixing serious typo bug in strain.py
gwastro_pycbc
train
py
7ad4dd233f544708eecb934ed339118a072f9361
diff --git a/lib/flash_gordon/version.rb b/lib/flash_gordon/version.rb index <HASH>..<HASH> 100644 --- a/lib/flash_gordon/version.rb +++ b/lib/flash_gordon/version.rb @@ -1,3 +1,3 @@ module FlashGordon - VERSION = "0.0.3" + VERSION = "0.0.4" end
Version Bump to <I>
methodnow_flash_gordon
train
rb
96925570a14dc909daebeae8241fdf2bd2ab786f
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -206,7 +206,7 @@ module ActiveRecord end def table_name - @table_name ||= klass.table_name + klass.table_name end def quoted_table_name
table name is cached on the class, so stop caching twice
rails_rails
train
rb
73f5b3e8d3518cf42ce17969e3e08da81a99966b
diff --git a/glances/core/glances_processes.py b/glances/core/glances_processes.py index <HASH>..<HASH> 100644 --- a/glances/core/glances_processes.py +++ b/glances/core/glances_processes.py @@ -83,7 +83,7 @@ class GlancesProcesses(object): except (KeyError, psutil.AccessDenied): try: self.username_cache[procstat['pid']] = proc.uids().real - except (KeyError, psutil.AccessDenied): + except (KeyError, AttributeError, psutil.AccessDenied): self.username_cache[procstat['pid']] = "?" procstat['username'] = self.username_cache[procstat['pid']]
Missing attributeerror catch on Windows...
nicolargo_glances
train
py
a08ac88682fcbd8ea562a5f94bba3473c6037c93
diff --git a/lib/chanko/function.rb b/lib/chanko/function.rb index <HASH>..<HASH> 100644 --- a/lib/chanko/function.rb +++ b/lib/chanko/function.rb @@ -66,6 +66,7 @@ module Chanko end def view_result(result, type) + return result if self.unit.default? case type when :plain result diff --git a/spec/lib/function_spec.rb b/spec/lib/function_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/function_spec.rb +++ b/spec/lib/function_spec.rb @@ -105,7 +105,7 @@ describe "Chanko" do end it 'should escape' do - default_function.invoke!(view, :capture => true).should == '<div class="unit unit__ unit______default__">' + ERB::Util.html_escape('<div>hoge</div>') + '</div>' + default_function.invoke!(view, :capture => true).should == ERB::Util.html_escape('<div>hoge</div>') end end
default block doesn't be surrounded by unit div/span
cookpad_chanko
train
rb,rb
5ab472aebd7c3c6b2d28fb9c19792609896185ae
diff --git a/framework/js/notification.js b/framework/js/notification.js index <HASH>..<HASH> 100644 --- a/framework/js/notification.js +++ b/framework/js/notification.js @@ -166,6 +166,15 @@ limitations under the License. * @param {String} [options.title] * [en]Dialog title. Default is "Alert".[/en] * [ja]ダイアログのタイトルを指定します。デフォルトは "Alert" です。[/ja] + * @param {String} [options.placeholder] + * [en]Placeholder for the text input.[/en] + * [ja][/ja] + * @param {String} [options.defaultValue] + * [en]Default value for the text input.[/en] + * [ja][/ja] + * @param {Boolean} [options.autofocus] + * [en]Autofocus the input element. Default is true.[/en] + * [ja][/ja] * @param {String} [options.modifier] * [en]Modifier for the dialog.[/en] * [ja]ダイアログのmodifier属性の値を指定します。[/ja]
docs(ons.notification): missing docs for few prompt options
OnsenUI_OnsenUI
train
js
d9aa33dde49281757f9dc150f0fca3393b1b5ee3
diff --git a/dingo/core/network/grids.py b/dingo/core/network/grids.py index <HASH>..<HASH> 100644 --- a/dingo/core/network/grids.py +++ b/dingo/core/network/grids.py @@ -212,9 +212,28 @@ class MVGridDingo(GridDingo): """ # do the routing - self._graph = mv_routing.solve(self._graph, debug, anim) - self._graph = mv_connect.mv_connect_satellites(self, self._graph, debug) - self._graph = mv_connect.mv_connect_stations(self.grid_district, self._graph, debug) + self._graph = mv_routing.solve(graph=self._graph, + debug=debug, + anim=anim) + + # connect satellites (step 1, with restrictions like max. string length, max peak load per string) + self._graph = mv_connect.mv_connect_satellites(mv_grid=self, + graph=self._graph, + mode='normal', + debug=debug) + + # connect satellites to closest line/station on a MV ring that have not been connected in step 1 + self._graph = mv_connect.mv_connect_satellites(mv_grid=self, + graph=self._graph, + mode='isolated', + debug=debug) + + # connect stations + self._graph = mv_connect.mv_connect_stations(mv_grid_district=self.grid_district, + graph=self._graph, + debug=debug) + + # create MV Branch objects from graph edges (lines) and link these objects back to graph edges # TODO:
call conn. of isolated satellites in MVGridDingo.routing() and pimp it up
openego_ding0
train
py
0d6bbbd61c95e9055c05a36df89f9660732dca9f
diff --git a/package.js b/package.js index <HASH>..<HASH> 100644 --- a/package.js +++ b/package.js @@ -7,7 +7,7 @@ Package.describe({ Package.on_use(function (api) { api.versionsFrom('METEOR@0.9.0.1'); // Exports the ngMeteor package scope - api.export('urigo:ngmeteor', 'client'); + api.export('ngMeteor', 'client'); api.use('jquery', 'client');
New version for Meteor packaging system
Urigo_angular-meteor
train
js
b7a7c461f1b89c9615ee94701e5526c7b1db753e
diff --git a/trunk/JLanguageTool/src/java/org/languagetool/gui/ConfigurationDialog.java b/trunk/JLanguageTool/src/java/org/languagetool/gui/ConfigurationDialog.java index <HASH>..<HASH> 100644 --- a/trunk/JLanguageTool/src/java/org/languagetool/gui/ConfigurationDialog.java +++ b/trunk/JLanguageTool/src/java/org/languagetool/gui/ConfigurationDialog.java @@ -147,8 +147,12 @@ private JCheckBox serverSettingsCheckbox; checkBox.setSelected(true); } - if (rule.isDefaultOff() && !enabledRuleIds.contains(rule.getId())) { - checkBox.setSelected(false); + if (rule.isDefaultOff()) { + if (enabledRuleIds.contains(rule.getId())) { + checkBox.setSelected(true); + } else { + checkBox.setSelected(false); + } } if (rule.isDefaultOff()) {
bugfix: enabling rules which were disabled by default didn't work
languagetool-org_languagetool
train
java
4b8ea5883aa83e318d4c5a80391f16867d769e31
diff --git a/views/js/core/polling.js b/views/js/core/polling.js index <HASH>..<HASH> 100644 --- a/views/js/core/polling.js +++ b/views/js/core/polling.js @@ -69,9 +69,8 @@ define([ /** * Notifies the action is about to be called * @event polling#call - * @param {polling} polling */ - polling.trigger('call', polling); + polling.trigger('call'); action.call(context, polling);
polling.js: missed remove context on event
oat-sa_tao-core
train
js
5c4fa342f1059fc8e8c1c070496a3689da14c163
diff --git a/protocol/v2.go b/protocol/v2.go index <HASH>..<HASH> 100644 --- a/protocol/v2.go +++ b/protocol/v2.go @@ -485,7 +485,7 @@ func (p *V2) addDevice(dev *device.Device) { } if vendor == device.VendorLifx { switch product { - case device.ProductLifxOriginal, device.ProductLifxColor650, device.ProductLifxWhite800LowVoltage, device.ProductLifxWhite800HighVoltage: + case device.ProductLifxOriginal1000, device.ProductLifxColor650, device.ProductLifxWhite800LowVoltage, device.ProductLifxWhite800HighVoltage: p.Lock() // Need to figure if there's a way to do this without being racey on the // lock inside the dev diff --git a/protocol/v2/device/device.go b/protocol/v2/device/device.go index <HASH>..<HASH> 100644 --- a/protocol/v2/device/device.go +++ b/protocol/v2/device/device.go @@ -46,7 +46,7 @@ const ( VendorLifx = 1 - ProductLifxOriginal uint32 = 1 + ProductLifxOriginal1000 uint32 = 1 ProductLifxColor650 uint32 = 3 ProductLifxWhite800LowVoltage uint32 = 10 ProductLifxWhite800HighVoltage uint32 = 11
Update internal protocol v2 product const to match documented naming
pdf_golifx
train
go,go
5103f52e4d4039ff191679d171863ce750f8661f
diff --git a/tests.py b/tests.py index <HASH>..<HASH> 100755 --- a/tests.py +++ b/tests.py @@ -180,9 +180,9 @@ class TestBoardMessages(BoardBaseTest): def test_send_sysex_string(self): self.board.send_sysex(0x79, bytearray("test", 'ascii')) - sysex = [chr(0xF0), chr(0x79)] + sysex = [0xF0, 0x79] sysex.extend(bytearray('test', 'ascii')) - sysex.append(chr(0xF7)) + sysex.append(0xF7) self.assert_serial(*sysex) def test_send_sysex_too_big_data(self):
Fix earlier failing test also in py3
tino_pyFirmata
train
py
71f83b3475b8016ed9a7893c74d0080f4b86da1f
diff --git a/phonopy/phonon/band_structure.py b/phonopy/phonon/band_structure.py index <HASH>..<HASH> 100644 --- a/phonopy/phonon/band_structure.py +++ b/phonopy/phonon/band_structure.py @@ -80,7 +80,7 @@ def get_band_qpoints(band_paths, npoints): nd = len(band_path) for i in range(nd - 1): diff = np.subtract(band_path[i + 1], band_path[i]) / (npoints - 1) - qpoints = np.array(band_path[i]) + qpoints = [np.array(band_path[i]), ] q = np.zeros(3) for j in range(npoints - 1): q += diff
Fix that list object doesn't support .copy() in ptyhon <I>
atztogo_phonopy
train
py
0a0f7d5816fa7e42fd787d4923265adc965e1360
diff --git a/setuptools/command/install_scripts.py b/setuptools/command/install_scripts.py index <HASH>..<HASH> 100755 --- a/setuptools/command/install_scripts.py +++ b/setuptools/command/install_scripts.py @@ -31,13 +31,13 @@ class install_scripts(orig.install_scripts): ) bs_cmd = self.get_finalized_command('build_scripts') exec_param = getattr(bs_cmd, 'executable', None) - cmd = ei.CommandSpec.from_param(exec_param) bw_cmd = self.get_finalized_command("bdist_wininst") is_wininst = getattr(bw_cmd, '_is_running', False) writer = ei.ScriptWriter if is_wininst: - cmd = ei.CommandSpec.from_string("python.exe") + exec_param = "python.exe" writer = ei.WindowsScriptWriter + cmd = ei.CommandSpec.from_param(exec_param) for args in writer.best().get_args(dist, cmd.as_header()): self.write_script(*args)
Defer resolution of the CommandSpec and do it exactly once.
pypa_setuptools
train
py
18ef94db91d7a5370062161e4a8a5cfc9e05781a
diff --git a/icon-runtime-generator.js b/icon-runtime-generator.js index <HASH>..<HASH> 100644 --- a/icon-runtime-generator.js +++ b/icon-runtime-generator.js @@ -15,7 +15,7 @@ module.exports = ({symbol, config, context}) => { import sprite from ${spriteRequest}; import {iconHOC} from '@jetbrains/ring-ui/components/icon/icon'; - const symbol = new SpriteSymbol(${stringifySymbol(symbol)}); + var symbol = new SpriteSymbol(${stringifySymbol(symbol)}); sprite.add(symbol); export default iconHOC('${glyph}', '${displayName}');
fix: use `var` instead `const` because `const` does not work in Phantomjs RING-UI-CR-<I> refers
JetBrains_ring-ui
train
js
f21cdbc690193f4dc4c9beab0b402f7a4a5f9490
diff --git a/src/store/index.js b/src/store/index.js index <HASH>..<HASH> 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -24,3 +24,39 @@ const createStore = (reducer) => { return {getState, dispatch, subscribe}; }; +export const connect = (stateToProps, dispatchToProps) => WrappedComponent => { + return class Connect extends Component { + static contextTypes = { + store: PropTypes.shape({ + subscribe: PropTypes.func, + dispatch: PropTypes.func, + getState: PropTypes.func, + }), + }; + + constructor(props, {store}) { + super(props); + + this.unsubscribe = store.subscribe(() => this.forceUpdate()); + this.store = store; + } + + componentWillUnmount() { + this.unsubscribe(); + } + + mapStateToProps = () => (stateToProps ? stateToProps(this.store.getState(), this.props) : {}); + + mapDispatchToProps = () => + dispatchToProps + ? Object.keys(dispatchToProps).reduce((obj, f) => { + obj[f] = (...args) => dispatchToProps[f](...args)(this.store.dispatch); + return obj; + }, {}) + : {}; + + render() { + return <WrappedComponent {...this.props} {...this.mapStateToProps()} {...this.mapDispatchToProps()} />; + } + }; +};
Add connect function, a HOC to access the local store
darrikonn_react-chloroform
train
js
059073228b34949d4552980e75205aca8273fc9a
diff --git a/nginx/datadog_checks/nginx/nginx.py b/nginx/datadog_checks/nginx/nginx.py index <HASH>..<HASH> 100644 --- a/nginx/datadog_checks/nginx/nginx.py +++ b/nginx/datadog_checks/nginx/nginx.py @@ -10,6 +10,7 @@ from six import PY3, iteritems, text_type from six.moves.urllib.parse import urlparse from datadog_checks.base import AgentCheck, ConfigurationError, to_native_string +from datadog_checks.base.utils.time import get_timestamp from .metrics import METRICS_SEND_AS_COUNT, VTS_METRIC_MAP @@ -332,8 +333,7 @@ class Nginx(AgentCheck): except ValueError: pass else: - output.append((metric_base, int((timestamp - EPOCH).total_seconds()), tags, 'gauge')) - + output.append((metric_base, int(get_timestamp(timestamp)), tags, 'gauge')) return output # override
Use base package timestamp function (#<I>) * Use checks base time utility
DataDog_integrations-core
train
py
a4f3004a70c8e6e3681b9a89ae2e524bd54a90a8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,16 @@ import os +import re from carbonate import __version__ from setuptools import setup, find_packages +from setuptools.command.install_scripts import install_scripts + + +class my_install_scripts(install_scripts): + def write_script(self, script_name, contents, mode="t", *ignored): + contents = re.sub("import sys", + "import sys\nsys.path.append('/opt/graphite/lib')", + contents) + install_scripts.write_script(self, script_name, contents, mode="t", *ignored) def read(fname): @@ -22,6 +32,7 @@ setup( "carbon", "whisper", ], + cmdclass={'install_scripts': my_install_scripts}, entry_points = { 'console_scripts': [ 'carbon-lookup = carbonate.cli:carbon_lookup',
Try to set /opt/graphite/lib in the console_scripts binstubs
graphite-project_carbonate
train
py
70bb839de9fde351cb2a1379fe8b89788204fe36
diff --git a/lib/Cake/Console/Command/Task/ModelTask.php b/lib/Cake/Console/Command/Task/ModelTask.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Console/Command/Task/ModelTask.php +++ b/lib/Cake/Console/Command/Task/ModelTask.php @@ -426,6 +426,8 @@ class ModelTask extends BakeTask { $guess = $methods['uuid']; } elseif ($metaData['type'] == 'string') { $guess = $methods['notempty']; + } elseif ($metaData['type'] == 'text') { + $guess = $methods['notempty']; } elseif ($metaData['type'] == 'integer') { $guess = $methods['numeric']; } elseif ($metaData['type'] == 'boolean') {
Add validation guess for not null + text types. Fixes #<I>
cakephp_cakephp
train
php
ce5e5ec714c30be0b7e299c3b0d486196d2cad56
diff --git a/src/fi/tkk/ics/hadoop/bam/cli/plugins/View.java b/src/fi/tkk/ics/hadoop/bam/cli/plugins/View.java index <HASH>..<HASH> 100644 --- a/src/fi/tkk/ics/hadoop/bam/cli/plugins/View.java +++ b/src/fi/tkk/ics/hadoop/bam/cli/plugins/View.java @@ -109,9 +109,7 @@ public final class View extends CLIPlugin { return 4; } - // We'd rather get an exception than have Picard barf all the errors it - // finds without us knowing about it. - reader.setValidationStringency(ValidationStringency.STRICT); + reader.setValidationStringency(ValidationStringency.SILENT); final SAMTextWriter writer = new SAMTextWriter(System.out); final SAMFileHeader header;
CLI view: be user-friendly and silence errors.
HadoopGenomics_Hadoop-BAM
train
java
30e5ab18df471638be65adc07a1cffa198c49e5a
diff --git a/ledgerautosync/converter.py b/ledgerautosync/converter.py index <HASH>..<HASH> 100644 --- a/ledgerautosync/converter.py +++ b/ledgerautosync/converter.py @@ -224,7 +224,8 @@ class Converter(object): replace('+', '_').\ replace('&', '_').\ replace('[', '_').\ - replace(']', '_') + replace(']', '_').\ + replace('|', '_') def __init__( self,
Add vertical bar to characters to be cleaned when found in id
egh_ledger-autosync
train
py
e0f090c63bbdd49f554776a8c3ec3c1a590e3e02
diff --git a/src/main/java/com/constantcontact/ConstantContact.java b/src/main/java/com/constantcontact/ConstantContact.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/constantcontact/ConstantContact.java +++ b/src/main/java/com/constantcontact/ConstantContact.java @@ -2620,32 +2620,4 @@ public class ConstantContact { return; } - - public void getLibraryFiles(){ - - } - - public void addLibraryFile(){ - - } - - public void getLibraryFilesInFolder(){ - - } - - public void getLibraryFile(){ - - } - - public void updateLibraryFile(){ - - } - - public void deleteLibraryFile(){ - - } - - public void getLibraryFilesUploadStatus(){ - - } }
Removing unused endpoints for now
constantcontact_java-sdk
train
java
db766d8d3c08bc8965be72e6be5747c2a3ebfe1e
diff --git a/lib/active_record/postgresql_cursors/cursors.rb b/lib/active_record/postgresql_cursors/cursors.rb index <HASH>..<HASH> 100644 --- a/lib/active_record/postgresql_cursors/cursors.rb +++ b/lib/active_record/postgresql_cursors/cursors.rb @@ -41,7 +41,12 @@ module ActiveRecord raise CursorsNotSupported, "#{connection.class} doesn't support cursors" end - relation = apply_finder_options(options) + relation = if ActiveRecord::VERSION::MAJOR >= 4 + apply_finder_options(options, silence_deprecation = true) + else + apply_finder_options(options) + end + including = (relation.eager_load_values + relation.includes_values).uniq if including.present?
Silence some deprecation warnings. We'll have to worry about this when Rails <I> comes out.
dark-panda_activerecord-postgresql-cursors
train
rb
c9e4fa36668dfd8a752cd3ed744bb3b6a1bbb42f
diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index <HASH>..<HASH> 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -60,3 +60,7 @@ module Dummy end end +require 'fabrication' +Fabrication.configure do |config| + config.fabricator_dir = '../../spec/fabricators' +end
Use Fabricator in dummy app
crowdint_crowdblog
train
rb
a77f4613d85093df83195051315bfad73816fe68
diff --git a/librosa/display.py b/librosa/display.py index <HASH>..<HASH> 100644 --- a/librosa/display.py +++ b/librosa/display.py @@ -545,6 +545,11 @@ def specshow(data, x_coords=None, y_coords=None, kwargs : additional keyword arguments Arguments passed through to `matplotlib.pyplot.pcolormesh`. + By default, the following options are set: + + - `rasterized=True` + - `shading='flat'` + - `edgecolors='None'` Returns ------- @@ -648,14 +653,15 @@ def specshow(data, x_coords=None, y_coords=None, >>> plt.tight_layout() ''' - kwargs.setdefault('shading', 'flat') - if np.issubdtype(data.dtype, np.complex): warnings.warn('Trying to display complex-valued input. ' 'Showing magnitude instead.') data = np.abs(data) kwargs.setdefault('cmap', cmap(data)) + kwargs.setdefault('rasterized', True) + kwargs.setdefault('edgecolors', 'None') + kwargs.setdefault('shading', 'flat') all_params = dict(kwargs=kwargs, sr=sr,
rasterized specshow by default. fixes #<I>
librosa_librosa
train
py
ad96a584d5eb0a6c29e2a2506e582673ad83bfb7
diff --git a/lib/functions.php b/lib/functions.php index <HASH>..<HASH> 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -550,6 +550,7 @@ function resolve(\Generator $generator, Reactor $reactor = null) { $cs->generator = $generator; $cs->returnValue = null; $cs->currentPromise = null; + $cs->nestingLevel = 0; __coroutineAdvance($cs); @@ -573,8 +574,14 @@ function __coroutineAdvance($cs) { $cs->returnValue = $yielded; __coroutineSend(null, null, $cs); } elseif ($yielded instanceof Promise) { - $cs->currentPromise = $yielded; - $cs->reactor->immediately("Amp\__coroutineNextTick", ["cb_data" => $cs]); + if ($cs->nestingLevel < 3) { + $cs->nestingLevel++; + $yielded->when("Amp\__coroutineSend", $cs); + $cs->nestingLevel--; + } else { + $cs->currentPromise = $yielded; + $cs->reactor->immediately("Amp\__coroutineNextTick", ["cb_data" => $cs]); + } } else { $error = new \DomainException(makeGeneratorError($cs->generator, sprintf( 'Unexpected yield (Promise|null|"return" expected); %s yielded at key %s',
Check coroutine nesting level before incurring "next tick" overhead
amphp_amp
train
php
ad457de89546cd71bd62a2f1d180413c3c9fbf18
diff --git a/src/plugin/plugin.test.js b/src/plugin/plugin.test.js index <HASH>..<HASH> 100644 --- a/src/plugin/plugin.test.js +++ b/src/plugin/plugin.test.js @@ -29,11 +29,16 @@ describe('Plugin class decorator', () => { it('decorates class methods', () => { class MyClass {} - MyClass.prototype.testF = FunctionDecorator('TestF')(() => {}); - MyClass.prototype.testC = Command('TestCommand')(() => {}); - MyClass.prototype.testA = Autocmd('TestAutocmd', { + MyClass.prototype.testF = () => {}; + MyClass.prototype.testC = () => {}; + MyClass.prototype.testA = () => {}; + + // This is how (closeish) babel applies decorators + FunctionDecorator('TestF')(MyClass.prototype, 'testF'); + Command('TestCommand')(MyClass.prototype, 'testC'); + Autocmd('TestAutocmd', { pattern: '*.js', - })(() => {}); + })(MyClass.prototype, 'testA'); expect(MyClass.prototype.testF[NVIM_METHOD_NAME]).toBe('function:TestF'); expect(MyClass.prototype.testC[NVIM_METHOD_NAME]).toBe(
Change the way decorators are applied in tests to be similar to babel
neovim_node-client
train
js
2f14a8e79218b4bcd202e88b5005781ce626280a
diff --git a/src/OneSheet/CtrlCharater.php b/src/OneSheet/CtrlCharater.php index <HASH>..<HASH> 100644 --- a/src/OneSheet/CtrlCharater.php +++ b/src/OneSheet/CtrlCharater.php @@ -21,7 +21,7 @@ class CtrlCharater public static function getMap() { $map = array(); - foreach (range(0,255) as $int) { + foreach (range(0, 255) as $int) { if (ctype_cntrl(chr($int))) { $map['from'][] = chr($int); $map['to'][] = sprintf('_x%04s_', strtoupper(dechex($int)));
Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on <URL>
nimmneun_onesheet
train
php
1b1be43d6551c2da31a631051136cd0f860cc447
diff --git a/contrib/raftexample/raft.go b/contrib/raftexample/raft.go index <HASH>..<HASH> 100644 --- a/contrib/raftexample/raft.go +++ b/contrib/raftexample/raft.go @@ -298,14 +298,10 @@ func (rc *raftNode) startRaft() { MaxUncommittedEntriesSize: 1 << 30, } - if oldwal { + if oldwal || rc.join { rc.node = raft.RestartNode(c) } else { - startPeers := rpeers - if rc.join { - startPeers = nil - } - rc.node = raft.StartNode(c, startPeers) + rc.node = raft.StartNode(c, rpeers) } rc.transport = &rafthttp.Transport{
raftexample: New joined node have to start with RestartNode
etcd-io_etcd
train
go
25828768d7bc2d76438244e69d6eeb69c36227e6
diff --git a/build/jslint-check.js b/build/jslint-check.js index <HASH>..<HASH> 100644 --- a/build/jslint-check.js +++ b/build/jslint-check.js @@ -12,8 +12,8 @@ var ok = { "Use '===' to compare with 'null'.": true, "Use '!==' to compare with 'null'.": true, "Expected an assignment or function call and instead saw an expression.": true, - "Expected a 'break' statement before 'case'.": true - + "Expected a 'break' statement before 'case'.": true, + "'e' is already defined.": true }; var e = JSLINT.errors, found = 0, w;
Handle the case where JSLint complains about arguments in try/catch already being defined (we use the name 'e' consistently for catch(e) - will work to standardize on that now).
jquery_jquery
train
js
448e15bed1db8be053be5f92ad9ba3b03c4c7970
diff --git a/logging/src/main/java/org/jboss/as/logging/CommonAttributes.java b/logging/src/main/java/org/jboss/as/logging/CommonAttributes.java index <HASH>..<HASH> 100644 --- a/logging/src/main/java/org/jboss/as/logging/CommonAttributes.java +++ b/logging/src/main/java/org/jboss/as/logging/CommonAttributes.java @@ -170,7 +170,7 @@ public interface CommonAttributes { setAllowNull(true). build(); - SimpleAttributeDefinition SUFFIX = SimpleAttributeDefinitionBuilder.create("suffix", ModelType.STRING, true).build(); + SimpleAttributeDefinition SUFFIX = SimpleAttributeDefinitionBuilder.create("suffix", ModelType.STRING).build(); SimpleAttributeDefinition TARGET = SimpleAttributeDefinitionBuilder.create("target", ModelType.STRING, true). setDefaultValue(new ModelNode().set(Target.SYSTEM_OUT.toString())).
[AS7-<I>] Suffix should be a required attribute. was: <I>a9c<I>b<I>f<I>d1a<I>f<I>fe<I>d
wildfly_wildfly-core
train
java
fb0ec4da9254729d39ab72264b30ecfbf5119e3a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ setup( ] }, - long_description=open('docs/manual.rst').read(), + long_description=open('README.rst').read(), install_requires=[ "argparse", #any version will do
Fixes to the main docx
bioidiap_gridtk
train
py
e908f97687b9b0683b4d87f46b1641b298b0e296
diff --git a/services/transaction/get_receipt.js b/services/transaction/get_receipt.js index <HASH>..<HASH> 100644 --- a/services/transaction/get_receipt.js +++ b/services/transaction/get_receipt.js @@ -19,6 +19,7 @@ const rootPrefix = '../..' * @param {object} params - * @param {string} params.chain - Chain on which transaction was executed * @param {string} params.transaction_hash - Transaction hash for lookup + * @param {object} params.address_to_name_map - hash of contract address to contract name * * @constructor */
name to map handle in receipt service.
OpenSTFoundation_openst-platform
train
js
f6ceb1f07d28c36567fe666c19013717b699cbf9
diff --git a/lib/http-server.js b/lib/http-server.js index <HASH>..<HASH> 100644 --- a/lib/http-server.js +++ b/lib/http-server.js @@ -88,7 +88,7 @@ function onCommand(req, res, question, accessKey) { }].concat(args.slice(1)); if (!cservice.locals.events[args[0]]) { - cservice.error("Command " + args[0].cyan + " not found".error); + cservice.error("Command " + (args[0] + "").cyan + " not found".error); res.writeHead(404); res.end("Not found. Try /help"); return;
Fix crash if no command provided in REST call
godaddy_node-cluster-service
train
js
27b3993bc7af58fa0ddca6d66334f21ae853125a
diff --git a/lib/errors/record_invalid.rb b/lib/errors/record_invalid.rb index <HASH>..<HASH> 100644 --- a/lib/errors/record_invalid.rb +++ b/lib/errors/record_invalid.rb @@ -6,7 +6,7 @@ module Likeno def initialize(record = nil) if record @record = record - errors = @record.kalibro_errors.join(', ') + errors = @record.likeno_errors.join(', ') message = "Record invalid: #{errors}" else message = 'Record invalid'
Remove references to kalibro_client on record invalid error
mezuro_likeno
train
rb
5eb16895cd436d1581f41328f01df5c65abd5776
diff --git a/packer/rpc/muxconn.go b/packer/rpc/muxconn.go index <HASH>..<HASH> 100644 --- a/packer/rpc/muxconn.go +++ b/packer/rpc/muxconn.go @@ -200,11 +200,11 @@ func (m *MuxConn) NextId() uint32 { func (m *MuxConn) cleaner() { checks := []struct { - Map map[uint32]*Stream + Map *map[uint32]*Stream Lock *sync.RWMutex }{ - {m.streamsAccept, &m.muAccept}, - {m.streamsDial, &m.muDial}, + {&m.streamsAccept, &m.muAccept}, + {&m.streamsDial, &m.muDial}, } for { @@ -217,7 +217,7 @@ func (m *MuxConn) cleaner() { for _, check := range checks { check.Lock.Lock() - for id, s := range check.Map { + for id, s := range *check.Map { s.mu.Lock() if done && s.state != streamStateClosed { @@ -229,7 +229,7 @@ func (m *MuxConn) cleaner() { // for a certain amount of time. since := time.Now().UTC().Sub(s.stateUpdated) if since > 2*time.Second { - delete(check.Map, id) + delete(*check.Map, id) } }
packer/rpc: use a pointer for maps to avoid race
hashicorp_packer
train
go
2aa9a32cec631aab149f082fa1e24cdeeffc225e
diff --git a/py3status/module.py b/py3status/module.py index <HASH>..<HASH> 100644 --- a/py3status/module.py +++ b/py3status/module.py @@ -254,13 +254,15 @@ class Module(Thread): obj['cached_until'] = time() group_module.run() + if not cache_time: + cache_time = self.config['cache_timeout'] + # don't be hasty mate # set timer to do update next time one is needed - if cache_time: - delay = max(cache_time - time(), - self.config['minimum_interval']) - self.timer = Timer(delay, self.run) - self.timer.start() + delay = max(cache_time - time(), + self.config['minimum_interval']) + self.timer = Timer(delay, self.run) + self.timer.start() def kill(self): # stop timer if exists
trigger timer if item fails or doesn't set timeout
ultrabug_py3status
train
py
493a8c82eed1ec7b9cea180c2e62771e5a02a4a3
diff --git a/lib/puppet/parser/compiler.rb b/lib/puppet/parser/compiler.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/parser/compiler.rb +++ b/lib/puppet/parser/compiler.rb @@ -431,7 +431,7 @@ class Puppet::Parser::Compiler # Make sure there are no remaining collections that are waiting for # resources that have not yet been instantiated. If this occurs it - # is an error (missing resourcei - it could not be realized). + # is an error (missing resource - it could not be realized). # def fail_on_unevaluated_resource_collections remaining = @collections.collect(&:unresolved_resources).flatten.compact
(PUP-<I>) Fix typo in comment
puppetlabs_puppet
train
rb
4540b18b12e5b257ef0466b0994637bce3e727bc
diff --git a/lib/jdbc_adapter/jdbc_oracle.rb b/lib/jdbc_adapter/jdbc_oracle.rb index <HASH>..<HASH> 100644 --- a/lib/jdbc_adapter/jdbc_oracle.rb +++ b/lib/jdbc_adapter/jdbc_oracle.rb @@ -64,7 +64,7 @@ module ::JdbcSpec end def self.guess_date_or_time(value) - (value.hour == 0 && value.min == 0 && value.sec == 0) ? + (value && value.hour == 0 && value.min == 0 && value.sec == 0) ? Date.new(value.year, value.month, value.day) : value end diff --git a/test/oracle_simple_test.rb b/test/oracle_simple_test.rb index <HASH>..<HASH> 100644 --- a/test/oracle_simple_test.rb +++ b/test/oracle_simple_test.rb @@ -31,4 +31,10 @@ class OracleSpecificTest < Test::Unit::TestCase obj = @klass.find(:first) assert_not_nil obj.datum, "no date" end + + def test_load_null_date + @java_con.createStatement.execute "UPDATE DEFAULT_NUMBER SET DATUM = NULL" + obj = @klass.find(:first) + assert obj.datum.nil? + end end if defined?(JRUBY_VERSION)
ACTIVERECORD_JDBC-<I>: Ensure we don't deference nil.hour
jruby_activerecord-jdbc-adapter
train
rb,rb
c4f1a8b800cabf60c660fe0f307e834f9c90fb68
diff --git a/subproviders/rpc.js b/subproviders/rpc.js index <HASH>..<HASH> 100644 --- a/subproviders/rpc.js +++ b/subproviders/rpc.js @@ -38,6 +38,10 @@ RpcSource.prototype.handleRequest = function(payload, next, end){ rejectUnauthorized: false, }, function(err, res, body) { if (err) return end(err) + if (res.statusCode != 200) + { + return end(new Error("HTTP Error: " + res.statusCode + " on "+ method)); + } // parse response into raw account var data
Fail on non <I> response
MetaMask_web3-provider-engine
train
js
4ae1f63a97829706fb50aa15703d9021f60c294d
diff --git a/src/structures/Message.js b/src/structures/Message.js index <HASH>..<HASH> 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -296,7 +296,9 @@ class Message { * @readonly */ get edits() { - return this._edits.slice().unshift(this); + const copy = this._edits.slice(); + copy.unshift(this); + return copy; } /**
fix message.edits (#<I>)
discordjs_discord.js
train
js
afe5eac403148cac38052411c603f4b5f0b565c0
diff --git a/src/Eloquent/Typhax/Comparator/TypeEquivalenceComparator.php b/src/Eloquent/Typhax/Comparator/TypeEquivalenceComparator.php index <HASH>..<HASH> 100644 --- a/src/Eloquent/Typhax/Comparator/TypeEquivalenceComparator.php +++ b/src/Eloquent/Typhax/Comparator/TypeEquivalenceComparator.php @@ -372,13 +372,13 @@ class TypeEquivalenceComparator implements Visitor null === $leftType && null !== $rightType ) { - return -100; + return -1; } if ( null !== $leftType && null === $rightType ) { - return 100; + return 1; } $difference = static::compare($leftType, $rightType); @@ -402,14 +402,14 @@ class TypeEquivalenceComparator implements Visitor null === $left && null !== $right ) { - return -100; + return -1; } if ( null !== $left && null === $right ) { - return 100; + return 1; } return strcmp(
No need to use arbitrary numbers here. Relates to #<I>.
eloquent_typhax
train
php
41fe126611c80462b0a1ad4a7a6695382c9d2662
diff --git a/src/java/com/threerings/parlor/game/GameWatcher.java b/src/java/com/threerings/parlor/game/GameWatcher.java index <HASH>..<HASH> 100644 --- a/src/java/com/threerings/parlor/game/GameWatcher.java +++ b/src/java/com/threerings/parlor/game/GameWatcher.java @@ -1,5 +1,5 @@ // -// $Id: GameWatcher.java,v 1.1 2002/12/16 05:06:58 shaper Exp $ +// $Id: GameWatcher.java,v 1.2 2002/12/16 05:31:00 mdb Exp $ package com.threerings.parlor.game; @@ -35,10 +35,12 @@ public abstract class GameWatcher // if we transitioned to a non-in-play state, the game has // completed if (!_gameobj.isInPlay()) { - gameDidEnd(_gameobj); - // clean up - _gameobj.removeListener(this); - _gameobj = null; + try { + gameDidEnd(_gameobj); + } finally { + _gameobj.removeListener(this); + _gameobj = null; + } } } }
Make sure that we remove ourselves as a listener even if our unknown and untrustable derived class freaks out in gameDidEnd(). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1
threerings_narya
train
java
a690ee5ab6e29e43e01976f414d7d2f8808a26ce
diff --git a/bin/generate-flow.js b/bin/generate-flow.js index <HASH>..<HASH> 100755 --- a/bin/generate-flow.js +++ b/bin/generate-flow.js @@ -25,7 +25,7 @@ for (let i = 0; i < icons.length; i += 1) { import type { Icon } from './index'; -type ${icon}Glyphs = '${names}'; +export type ${icon}Glyphs = '${names}'; declare export default Class<Icon<${icon}Glyphs>>; `;
Export generated flow type enum for iconsets (#<I>) In my case, I have some wrappers for `Icon`; it'd be really nice to be able to re-use the available icon names there.
oblador_react-native-vector-icons
train
js
034cef6029457e298e4d28617ec846ea7ac7c67d
diff --git a/lib/queue/worker.js b/lib/queue/worker.js index <HASH>..<HASH> 100644 --- a/lib/queue/worker.js +++ b/lib/queue/worker.js @@ -98,6 +98,7 @@ Worker.prototype.error = function(err, job){ Worker.prototype.failed = function(job, err, fn){ var self = this; + self.emit('job failed', job); events.emit(job.id, 'failed'); job.failed().error(err); self.error(err, job); @@ -195,14 +196,17 @@ Worker.prototype.getJob = function(fn){ Worker.prototype.shutdown = function(fn, timeout) { var self = this; + // Wrap `fn` so we don't pass `job` to it + var _fn = function(job){ fn(); }; + if (!this.running) return fn(); this.running = false; // As soon as we're free, signal that we're done if (!this.job) return fn(); - // Wrap `fn` so we don't pass `job` to it - this.once('job complete', function(job){ fn(); }); + this.once('job complete', _fn); + this.once('job failed', _fn); if (timeout) { setTimeout(function() {
Emit 'job failed' so worker can shut down properly
Automattic_kue
train
js
a7cf6005c3384017746c30d7c55a808391dade31
diff --git a/src/fi/tkk/ics/hadoop/bam/cli/plugins/Sort.java b/src/fi/tkk/ics/hadoop/bam/cli/plugins/Sort.java index <HASH>..<HASH> 100644 --- a/src/fi/tkk/ics/hadoop/bam/cli/plugins/Sort.java +++ b/src/fi/tkk/ics/hadoop/bam/cli/plugins/Sort.java @@ -310,6 +310,9 @@ final class SortReducer } } +// Because we want a total order and we may change the key when merging +// headers, we can't use a mapper here: the InputSampler reads directly from +// the InputFormat. final class SortInputFormat extends BAMInputFormat { @Override public RecordReader<LongWritable,SAMRecordWritable> createRecordReader(InputSplit split, TaskAttemptContext ctx)
CLI sort: comment on why we don't use a mapper
HadoopGenomics_Hadoop-BAM
train
java
85e3ce720f45f7217d09664292bce70e4e707426
diff --git a/tprs.go b/tprs.go index <HASH>..<HASH> 100644 --- a/tprs.go +++ b/tprs.go @@ -41,7 +41,7 @@ import ( // Name: k8s.String("metric.metrics.example.com"), // }, // Description: k8s.String("A custom third party resource"), -// Versions: []*v1beta1.APIVersions{ +// Versions: []*v1beta1.APIVersion{ // {Name: k8s.String("v1")}, // }, // }
godoc: Fix typo in APIVersion struct usage
ericchiang_k8s
train
go
008797f0dfe22dbf1bb6faee1d6b9f1974b665ab
diff --git a/lib/asker.js b/lib/asker.js index <HASH>..<HASH> 100644 --- a/lib/asker.js +++ b/lib/asker.js @@ -98,8 +98,8 @@ function Request(options, callback) { this.options.path = url.format(parsedPath); } - // lets build request body for POST, PUT and PATCH methods - if (['POST','PUT','PATCH'].indexOf(this.options.method) > -1 && typeof this.options.body !== 'undefined') { + // build request body for some methods + if (['POST', 'PUT', 'PATCH', 'DELETE'].indexOf(this.options.method) > -1 && typeof this.options.body !== 'undefined') { this.options.body = (typeof this.options.body === 'object') ? JSON.stringify(this.options.body) : String(this.options.body); @@ -108,6 +108,8 @@ function Request(options, callback) { if ( ! this.options.headers['content-length']) { this.options.headers['content-length'] = Buffer.byteLength(this.options.body, 'utf8'); } + } else { + delete this.options.body; } if (this.options.allowGzip) {
fix request body compilation for DELETE method
nodules_asker
train
js
452da613fd25133b77f94b6b8be27cc7c60701d9
diff --git a/test/test_motor_tail.py b/test/test_motor_tail.py index <HASH>..<HASH> 100644 --- a/test/test_motor_tail.py +++ b/test/test_motor_tail.py @@ -127,7 +127,7 @@ class MotorTailTest(MotorTest): yield gen.Task(self.wait_for_cursors) done() - drop_collection_pauses = (0, 0, 5, 'drop', 1, 0, 0) + drop_collection_pauses = (0, 0, 15, 'drop', 1, 0, 0) @async_test_engine(timeout_sec=30) def test_tail_drop_collection(self, done):
Try to avoid test_tail_drop_collection timeouts
mongodb_motor
train
py
be3a6b5512750a99f79e370ad026f973c131331f
diff --git a/src/pip_shims/__init__.py b/src/pip_shims/__init__.py index <HASH>..<HASH> 100644 --- a/src/pip_shims/__init__.py +++ b/src/pip_shims/__init__.py @@ -3,7 +3,7 @@ from __future__ import absolute_import import sys -__version__ = '0.3.1' +__version__ = '0.3.2.dev0' from . import shims
Prebump to <I>.dev0
sarugaku_pip-shims
train
py
94a3123e99f113c35f9597c1d8fb688cf2ccc5a8
diff --git a/io/eolearn/tests/test_sentinelhub_process.py b/io/eolearn/tests/test_sentinelhub_process.py index <HASH>..<HASH> 100644 --- a/io/eolearn/tests/test_sentinelhub_process.py +++ b/io/eolearn/tests/test_sentinelhub_process.py @@ -539,8 +539,8 @@ class TestSentinelHubInputTaskDataCollections: bbox=bbox, time_interval=('2021-02-10', '2021-02-15'), data_size=3, - timestamp_length=14, - stats=[0.4236, 0.6353, 0.5117] + timestamp_length=13, + stats=[0.4236, 0.6339, 0.5117] ), IoTestCase( name='Sentinel-5P',
fixed SH integration test with S3 SLSTR
sentinel-hub_eo-learn
train
py
285873a4f753822a88d475a1b030ab622bf4c72e
diff --git a/sos/policies/__init__.py b/sos/policies/__init__.py index <HASH>..<HASH> 100644 --- a/sos/policies/__init__.py +++ b/sos/policies/__init__.py @@ -842,7 +842,8 @@ class LinuxPolicy(Policy): def __init__(self, sysroot=None): super(LinuxPolicy, self).__init__(sysroot=sysroot) self.init_kernel_modules() - if self.init == 'systemd': + + if os.path.isdir("/run/systemd/system/"): self.init_system = SystemdInit() else: self.init_system = InitSystem() diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py index <HASH>..<HASH> 100644 --- a/sos/policies/redhat.py +++ b/sos/policies/redhat.py @@ -36,7 +36,6 @@ class RedHatPolicy(LinuxPolicy): _host_sysroot = '/' default_scl_prefix = '/opt/rh' name_pattern = 'friendly' - init = 'systemd' def __init__(self, sysroot=None): super(RedHatPolicy, self).__init__(sysroot=sysroot)
[policies] Detect systemd use instead of hardcoding it This just has us the builtin option to determine if we are on systemd or not. <URL>
sosreport_sos
train
py,py
25fc01cdc4c0fbbe5367a0325e1790975ee00aaa
diff --git a/lib/axlsx/util/module.rb b/lib/axlsx/util/module.rb index <HASH>..<HASH> 100644 --- a/lib/axlsx/util/module.rb +++ b/lib/axlsx/util/module.rb @@ -7,8 +7,6 @@ class Module validated_attr_accessor(symbols, 'validate_boolean') end - private - SETTER = "def %s=(value) Axlsx::%s(value); @%s = value; end" def validated_attr_accessor(symbols, validator) symbols.each do |symbol|
altered scope for generic validated_attr_accessor Seems to cause some problems with <I> not willing to spend the effort time to find out why ;?
randym_axlsx
train
rb
5380411c46bcc0cf47be65105a691fd46ae9b633
diff --git a/api/models/CustomModel.js b/api/models/CustomModel.js index <HASH>..<HASH> 100644 --- a/api/models/CustomModel.js +++ b/api/models/CustomModel.js @@ -22,7 +22,7 @@ function _instantiate(idOrValues) { this[propertyName] = value } else { var Model = fin._propertyModels[valueType] || fin._customModels[valueType] - this[propertyName] = new Model(value, propertyDescription) + this[propertyName] = new Model(value, propertyDescription.of) this[propertyName]._propertyID = propertyDescription.id } this[propertyName]._parent = this diff --git a/api/models/propertyModels.js b/api/models/propertyModels.js index <HASH>..<HASH> 100644 --- a/api/models/propertyModels.js +++ b/api/models/propertyModels.js @@ -9,10 +9,9 @@ var fin = require('../client'), /* Property model types (Text/Number, List/Set) **********************************************/ -function PropertyModel(value, propertyDescription) { +function PropertyModel(value, of) { this._value = value - if (!propertyDescription) { propertyDescription = {} } - this._of = propertyDescription.of + this._of = of } PropertyModel.prototype = { observe: _modelObserve,
Just pass in the of descriptor directly
marcuswestin_fin
train
js,js
744c2a04cad65f20f10ebe5ac746909d8b98ff9d
diff --git a/Classes/Controller/WizardContentController.php b/Classes/Controller/WizardContentController.php index <HASH>..<HASH> 100755 --- a/Classes/Controller/WizardContentController.php +++ b/Classes/Controller/WizardContentController.php @@ -224,6 +224,7 @@ class WizardContentController extends WizardController protected function createHtmlAction($key): void { $html = $this->htmlCodeGenerator->generateHtml($key, 'tt_content'); + $this->addFlashMessage('Datei wurde angelegt'); $this->saveHtml($key, $html); $this->redirect('list', 'Wizard'); }
[TASK] add message when new html is created
Gernott_mask
train
php
b4ee89eca20cf9c37f0c898e8e358ca292085c63
diff --git a/php5/HproseFgcHttpClient.php b/php5/HproseFgcHttpClient.php index <HASH>..<HASH> 100644 --- a/php5/HproseFgcHttpClient.php +++ b/php5/HproseFgcHttpClient.php @@ -14,7 +14,7 @@ * * * hprose fgc http client class for php5. * * * - * LastModified: Feb 27, 2015 * + * LastModified: Mar 5, 2015 * * Author: Ma Bingyao <andot@hprose.com> * * * \**********************************************************/ @@ -32,6 +32,8 @@ class HproseHttpClient extends HproseBaseHttpClient { throw new Exception($errstr, $errno); } protected function sendAndReceive($request) { + // file_get_contents can't work with keepAlive. + $this->keepAlive = false; $opts = array ( 'http' => array ( 'method' => 'POST',
Forced to close keepalive in file_get_contents client.
hprose_hprose-php
train
php
d23343e2ab1bcb07b62a7ceee0a263a556ae162e
diff --git a/Framework/ClientSideCompiler.php b/Framework/ClientSideCompiler.php index <HASH>..<HASH> 100644 --- a/Framework/ClientSideCompiler.php +++ b/Framework/ClientSideCompiler.php @@ -68,7 +68,10 @@ public function combine($domHead) { $elementArray = $domHead[$tagName]; } - unlink("$wwwDir/{$tagDetails["combinedFile"]}"); + $fileName = "$wwwDir/{$tagDetails["combinedFile"]}"; + if(file_exists($fileName)) { + unlink($fileName); + } foreach ($elementArray as $element) { if(!$element->hasAttribute($tagDetails["sourceAttribute"])) {
Updated tests for csc
PhpGt_WebEngine
train
php
c8923df0cbf863e6c1f19cd11e1fbb5b858a8c1f
diff --git a/tools/pkg_files_tester.js b/tools/pkg_files_tester.js index <HASH>..<HASH> 100644 --- a/tools/pkg_files_tester.js +++ b/tools/pkg_files_tester.js @@ -7,19 +7,17 @@ const path = require('path'); async function* getAllDescendantFiles(subrootDir) { const children = await fs.readdir(subrootDir, { encoding: 'utf8', - withFileTypes: false, + withFileTypes: true, }); - for (const item of children) { - const fullpath = path.resolve(subrootDir, item); - // eslint-disable-next-line no-await-in-loop - const stat = await fs.stat(fullpath); - if (stat.isFile()) { + for (const dirent of children) { + const fullpath = path.resolve(subrootDir, dirent.name); + if (dirent.isFile()) { yield fullpath; continue; } - if (stat.isDirectory()) { + if (dirent.isDirectory()) { yield* getAllDescendantFiles(fullpath); continue; }
Reduce the number to call fs.stat()
karen-irc_option-t
train
js
2ccef9b28a218b28d10ebac7dd3ad15cd4f1748a
diff --git a/src/PagekitLogger.php b/src/PagekitLogger.php index <HASH>..<HASH> 100644 --- a/src/PagekitLogger.php +++ b/src/PagekitLogger.php @@ -112,15 +112,18 @@ class PagekitLogger /** * @param \Exception $e - * @param \int $level + * @param boolean $trace + * @param int $level * @throws App\Exception */ - public function logException($e, $level = null) { + public function logException($e, $trace = false, $level = null) { $message = 'MESSAGE: ' . $e->getMessage() . ' FILE: ' . $e->getFile() . - ' LINE: ' . $e->getLine() . - ' TRACE: ' . $e->getTraceAsString(); + ' LINE: ' . $e->getLine(); + if ($trace == true) { + $message .= ' TRACE: ' . $e->getTraceAsString(); + } if ($level != null) { if (!array_key_exists($level, $this->levels)) {
Added optional trace to exception logging.
crwgregory_pagekit-logger
train
php
eae14d7bc96db22645c71684ef5fb847fabb00e0
diff --git a/goatools/obo_parser.py b/goatools/obo_parser.py index <HASH>..<HASH> 100755 --- a/goatools/obo_parser.py +++ b/goatools/obo_parser.py @@ -266,7 +266,7 @@ class GODag(dict): print >>sys.stderr, "try `easy_install pygraphviz`" return - G = pgv.AGraph() + G = pgv.AGraph(name="GO tree") edgeset = set() for rec in recs: if draw_parents: @@ -304,7 +304,6 @@ class GODag(dict): if gml: import networkx as nx # use networkx to do the conversion pf = lineage_img.rsplit(".", 1)[0] - G.name = "GO tree" NG = nx.from_agraph(G) del NG.graph['node'] diff --git a/goatools/version.py b/goatools/version.py index <HASH>..<HASH> 100644 --- a/goatools/version.py +++ b/goatools/version.py @@ -1 +1 @@ -__version__ = "0.4.11" +__version__ = "0.4.12"
fix issue #<I> (thanks trgibbons)
tanghaibao_goatools
train
py,py
872d173769fd16f566cd059c61d67dec9d823cba
diff --git a/salt/states/boto_iam.py b/salt/states/boto_iam.py index <HASH>..<HASH> 100644 --- a/salt/states/boto_iam.py +++ b/salt/states/boto_iam.py @@ -164,7 +164,7 @@ if six.PY2: return dict([(_byteify(k), _byteify(v)) for k, v in six.iteritems(thing)]) elif isinstance(thing, list): return [_byteify(m) for m in thing] - elif isinstance(thing, unicode): # pylint: disable=W1699 + elif isinstance(thing, six.text_type): # pylint: disable=W1699 return thing.encode('utf-8') else: return thing
The `unicode` type does not exist on Py3
saltstack_salt
train
py
38f150040b4822bf8cfd5c44470613201ff9a8b4
diff --git a/tkColorPicker.py b/tkColorPicker.py index <HASH>..<HASH> 100644 --- a/tkColorPicker.py +++ b/tkColorPicker.py @@ -355,7 +355,6 @@ class ColorPicker(tk.Toplevel): self.title(title) self.transient(self.master) - self.grab_set() self.resizable(False, False) self.lift() @@ -518,6 +517,9 @@ class ColorPicker(tk.Toplevel): s_v.bind('<Return>', self._update_color_hsv) self.html.bind("<FocusOut>", self._update_color_html) self.html.bind("<Return>", self._update_color_html) + + self.wait_visibility(self) + self.grab_set() def get_color(self): return self.color
added `wait_visibility` before `grab_set` make sure the window is visible to avoid errors
j4321_tkColorPicker
train
py
9252dadbd4375cb3028cb941635f61192a15988e
diff --git a/src/Api/Route/Info.php b/src/Api/Route/Info.php index <HASH>..<HASH> 100644 --- a/src/Api/Route/Info.php +++ b/src/Api/Route/Info.php @@ -19,9 +19,9 @@ $urlElements = explode("/", $this->parseUrl()); - $this->controller = isset($urlElements[0]) ? $urlElements[0] : null; - $this->id = isset($urlElements[1]) ? $urlElements[1] : null; - $this->action = isset($urlElements[2]) ? $urlElements[2] : null; + $this->controller = isset($urlElements[0]) ? rawurldecode($urlElements[0]) : null; + $this->id = isset($urlElements[1]) ? rawurldecode($urlElements[1]) : null; + $this->action = isset($urlElements[2]) ? rawurldecode($urlElements[2]) : null; } }
Process url encoded characters in route
irwtdvoys_bolt-api
train
php
42aec8d2db899a5c8132a5a696c6b6cc5bd3ce9b
diff --git a/shinken/external_command.py b/shinken/external_command.py index <HASH>..<HASH> 100644 --- a/shinken/external_command.py +++ b/shinken/external_command.py @@ -1060,6 +1060,7 @@ class ExternalCommandManager: c.exit_status = status_code c.get_outputs(plugin_output, host.max_plugins_output_length) c.status = 'waitconsume' + c.check_time = now self.sched.nb_check_received += 1 #Ok now this result will be reap by scheduler the next loop @@ -1082,6 +1083,7 @@ class ExternalCommandManager: c.exit_status = return_code c.get_outputs(plugin_output, service.max_plugins_output_length) c.status = 'waitconsume' + c.check_time = now self.sched.nb_check_received += 1 #Ok now this result will be reap by scheduler the next loop
*Fix a bug in external command processing. Passive checkresults need last_chk too
Alignak-monitoring_alignak
train
py
f73167760d0b257e9f2bd33df9cb9e20859719a3
diff --git a/core-bundle/src/Resources/contao/forms/Form.php b/core-bundle/src/Resources/contao/forms/Form.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/forms/Form.php +++ b/core-bundle/src/Resources/contao/forms/Form.php @@ -478,7 +478,6 @@ class Form extends \Hybrid } $arrFiles = $_SESSION['FILES']; - $arrData = $_SESSION['FORM_DATA']; // HOOK: process form data callback if (isset($GLOBALS['TL_HOOKS']['processFormData']) && is_array($GLOBALS['TL_HOOKS']['processFormData'])) @@ -486,12 +485,10 @@ class Form extends \Hybrid foreach ($GLOBALS['TL_HOOKS']['processFormData'] as $callback) { $this->import($callback[0]); - $this->$callback[0]->$callback[1]($arrData, $this->arrData, $arrFiles, $arrLabels, $this); + $this->$callback[0]->$callback[1]($arrSubmitted, $this->arrData, $arrFiles, $arrLabels, $this); } } - // Reset form data in case it has been modified in a callback function - $_SESSION['FORM_DATA'] = $arrData; $_SESSION['FILES'] = array(); // DO NOT CHANGE // Add a log entry
[Core] Only pass the current form data to the "processFormData" hook (see #<I>)
contao_contao
train
php
9a3f53e204366b276890355caf8fd0f9c5aeac4e
diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureTreemap.js b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureTreemap.js index <HASH>..<HASH> 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureTreemap.js +++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureTreemap.js @@ -57,7 +57,6 @@ export default class MeasureTreemap extends React.Component { fetchComponents (componentKey) { const { metric } = this.props; - const shouldUseLeak = metric.key.indexOf('new_') === 0; const metrics = ['ncloc', metric.key]; const options = { s: 'metric', @@ -71,6 +70,7 @@ export default class MeasureTreemap extends React.Component { const key = component.refKey || component.key; component.measures.forEach(measure => { + const shouldUseLeak = measure.metric.indexOf('new_') === 0; measures[measure.metric] = shouldUseLeak ? getLeakValue(measure) : measure.value; }); return { ...component, measures, key };
fix drilldown on measure treemap when displaying on "new_" measures
SonarSource_sonarqube
train
js
a15dfec080d46a46604fe60d87474bfcdbd9a274
diff --git a/org/postgresql/jdbc2/DatabaseMetaData.java b/org/postgresql/jdbc2/DatabaseMetaData.java index <HASH>..<HASH> 100644 --- a/org/postgresql/jdbc2/DatabaseMetaData.java +++ b/org/postgresql/jdbc2/DatabaseMetaData.java @@ -2500,7 +2500,7 @@ WHERE f[13] = new Field(connection, "DEFERRABILITY", iInt2Oid, 2); java.sql.ResultSet rs = connection.ExecSQL( - "SELECT " + "SELECT distinct " + "c.relname as prelname, " + "c2.relname as frelname, " + "t.tgconstrname, " @@ -2676,8 +2676,8 @@ WHERE tuple[7] = fkeyColumns.toString().getBytes(); //FKCOLUMN_NAME tuple[8] = rs.getBytes(4); //KEY_SEQ - tuple[11] = rs.getBytes(5); //FK_NAME - tuple[12] = rs.getBytes(3); //PK_NAME + tuple[11] = rs.getBytes(3); //FK_NAME + tuple[12] = rs.getBytes(5); //PK_NAME // DEFERRABILITY int deferrability = importedKeyNotDeferrable;
fixed retrieval of foreign/primary keys in imported/exported keys
pgjdbc_pgjdbc
train
java
8d9c21f0cf5f73718ee86bb3a8e6432b88e9291d
diff --git a/prometheus/example_clustermanager_test.go b/prometheus/example_clustermanager_test.go index <HASH>..<HASH> 100644 --- a/prometheus/example_clustermanager_test.go +++ b/prometheus/example_clustermanager_test.go @@ -131,7 +131,7 @@ func ExampleCollector() { NewClusterManager("db", reg) NewClusterManager("ca", reg) - // Add the built in process and golang metrics to this registry + // Add the standard process and Go metrics to the custom registry. reg.MustRegister( prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}), prometheus.NewGoCollector(),
Nitpicking a doc comment
prometheus_client_golang
train
go
ca38778054d47ae4afafbdd49fe54f462ff8dad8
diff --git a/health_check/views.py b/health_check/views.py index <HASH>..<HASH> 100644 --- a/health_check/views.py +++ b/health_check/views.py @@ -24,7 +24,7 @@ class MainView(TemplateView): plugin.run_check() return plugin.errors - with ThreadPoolExecutor() as executor: + with ThreadPoolExecutor(max_workers=len(plugins) or 1) as executor: for ers in executor.map(_run, plugins): errors.extend(ers)
Fix #<I> -- Limit threads to number of active plugins (#<I>)
KristianOellegaard_django-health-check
train
py
c97ac3aea499df072d2cfad4d95ccb22684a9913
diff --git a/viscm/gui.py b/viscm/gui.py index <HASH>..<HASH> 100644 --- a/viscm/gui.py +++ b/viscm/gui.py @@ -845,7 +845,7 @@ class GamutViewer2D(object): low, high = self.bgcolor_ranges[self.bg] if not (low <= Jp <= high): self.bg = self.bg_opposites[self.bg] - self.ax.set_axis_bgcolor(self.bgcolors[self.bg]) + self.ax.set_facecolor(self.bgcolors[self.bg]) sRGB = sRGB_gamut_Jp_slice(Jp, self.uniform_space, self.ap_lim, self.bp_lim) self.image.set_data(sRGB)
Update gui.py More of the same
matplotlib_viscm
train
py
5832b6580202df75b7dfd5e47e231a41eb81b4ee
diff --git a/src/Yandex/Common/AbstractServiceClient.php b/src/Yandex/Common/AbstractServiceClient.php index <HASH>..<HASH> 100644 --- a/src/Yandex/Common/AbstractServiceClient.php +++ b/src/Yandex/Common/AbstractServiceClient.php @@ -199,9 +199,10 @@ abstract class AbstractServiceClient extends AbstractPackage } /** + * @param null $headers * @return ClientInterface */ - protected function getClient() + protected function getClient($headers = null) { if ($this->client === null) { $defaultOptions = [ @@ -213,6 +214,9 @@ abstract class AbstractServiceClient extends AbstractPackage 'Accept' => '*/*', ], ]; + if ($headers && is_array($headers)) { + $defaultOptions["headers"] += $headers; + } if ($this->getProxy()) { $defaultOptions['proxy'] = $this->getProxy(); }
Created adding headers for getClient
yandex-market_yandex-market-php-common
train
php
7a188e9c1ac25477de0f3ab3015495d12d27fc13
diff --git a/app/models/block.rb b/app/models/block.rb index <HASH>..<HASH> 100644 --- a/app/models/block.rb +++ b/app/models/block.rb @@ -17,6 +17,13 @@ class Block < ActiveRecord::Base .gsub('Ave','Avenue') .gsub('St','Street') .gsub('Ctrl','Central') + .gsub('Jln','Jalan') + .gsub('Lor ','Lorong ') + .gsub('Upp ','Upper ') + .gsub('Hts','Heights') + .gsub('Gdn','Garden') + .gsub('Bt','Bukit') + .gsub("C'Wealth","Commonwealth") end class << self
fixed expansion of various street name abbreviations to work with OneMap
prusswan_sbf
train
rb
e4edeb4bee048cd2267152004d32ddd972638ab2
diff --git a/src/livestreamer/packages/pbs.py b/src/livestreamer/packages/pbs.py index <HASH>..<HASH> 100644 --- a/src/livestreamer/packages/pbs.py +++ b/src/livestreamer/packages/pbs.py @@ -170,6 +170,7 @@ class RunningCommand(object): def __eq__(self, other): return unicode(self) == unicode(other) + __hash__ = None # Avoid DeprecationWarning in Python < 3 def __contains__(self, item): return item in str(self) @@ -351,6 +352,7 @@ If you're using glob.glob(), please use pbs.glob() instead." % self.path, stackl def __eq__(self, other): try: return str(self) == str(other) except: return False + __hash__ = None # Avoid DeprecationWarning in Python < 3 def __enter__(self):
packages.pbs: Stop hash() from working in Python 2, to match Python 3 behaviour. This avoids DeprecationWarning warnings when running with “python2 -3”.
streamlink_streamlink
train
py
0a67f25298c80aaeb3633342c36d6e00e91d7bd1
diff --git a/git/test/test_index.py b/git/test/test_index.py index <HASH>..<HASH> 100644 --- a/git/test/test_index.py +++ b/git/test/test_index.py @@ -54,9 +54,7 @@ from gitdb.base import IStream import os.path as osp from git.cmd import Git -HOOKS_SHEBANG = \ - "!C:/Program\ Files/Git/usr/bin/sh.exe\n" if is_win \ - else "#!/usr/bin/env sh\n" +HOOKS_SHEBANG = "#!/usr/bin/env sh\n" def _make_hook(git_dir, name, content, make_exec=True):
RF: no "need" for custom shebang on windows since just does not work
gitpython-developers_GitPython
train
py
f4202d5e66adf7b83307ea219c6c004c8586d505
diff --git a/libkbfs/dirty_bcache.go b/libkbfs/dirty_bcache.go index <HASH>..<HASH> 100644 --- a/libkbfs/dirty_bcache.go +++ b/libkbfs/dirty_bcache.go @@ -112,6 +112,7 @@ type DirtyBlockCacheStandard struct { makeLog func(string) logger.Logger log logger.Logger reqWg sync.WaitGroup + name string // requestsChan is a queue for channels that should be closed when // permission is granted to dirty new data. @@ -294,7 +295,7 @@ func (d *DirtyBlockCacheStandard) calcBackpressure(start time.Time, func (d *DirtyBlockCacheStandard) logLocked(fmt string, arg ...interface{}) { if d.log == nil { - log := d.makeLog("") + log := d.makeLog(d.name) if log != nil { d.log = log.CloneWithAddedDepth(1) }
dirty_bcache: a way to distinguish log entries between instances Issue: KBFS-<I>
keybase_client
train
go
09b2a64eb28491ab1b7e868b38140d97fe2d5840
diff --git a/yubico/__init__.py b/yubico/__init__.py index <HASH>..<HASH> 100644 --- a/yubico/__init__.py +++ b/yubico/__init__.py @@ -1 +1 @@ -__version__ = (1, 6, 2) +__version__ = (1, 6, 3, 'dev')
Now working on <I>.
Kami_python-yubico-client
train
py
2d8eb61203cd6d41a4520b981e5b6a0734c4dc95
diff --git a/src/main/java/skadistats/clarity/processor/runner/RealtimeRunner.java b/src/main/java/skadistats/clarity/processor/runner/RealtimeRunner.java index <HASH>..<HASH> 100644 --- a/src/main/java/skadistats/clarity/processor/runner/RealtimeRunner.java +++ b/src/main/java/skadistats/clarity/processor/runner/RealtimeRunner.java @@ -28,9 +28,13 @@ public class RealtimeRunner extends SimpleRunner { } public RealtimeRunner(Source s, Duration delay) throws IOException { + this(s, delay, now()); + } + + public RealtimeRunner(Source s, Duration delay, Instant startTime) throws IOException { super(s); setDelay(delay); - startTime = now(); + this.startTime = startTime; } private boolean canDelay() {
add constructor to RealtimeRunner which allows to set start time
skadistats_clarity
train
java
98912ed81debfd918c1efdead44c620d689a819d
diff --git a/source/PickerButton.js b/source/PickerButton.js index <HASH>..<HASH> 100644 --- a/source/PickerButton.js +++ b/source/PickerButton.js @@ -15,6 +15,8 @@ enyo.kind({ onChange: "change" }, change: function(inSender, inEvent) { - this.setContent(inEvent.content); + if (inEvent.content !== undefined){ + this.setContent(inEvent.content); + } } }); \ No newline at end of file
Checking for undefined content when setting the PickerButtons. Enyo-DCO-<I>-
enyojs_onyx
train
js
8b7569b1303b33b37c35792ea868b721673571f1
diff --git a/plexapi/client.py b/plexapi/client.py index <HASH>..<HASH> 100644 --- a/plexapi/client.py +++ b/plexapi/client.py @@ -490,7 +490,7 @@ class PlexClient(PlexObject): 'port': server_port, 'offset': offset, 'key': media.key, - 'token': media._server._token, + 'token': media._server.createToken(), 'type': mediatype, 'containerKey': '/playQueues/%s?window=100&own=1' % playqueue.playQueueID, }, **params))
lets not give on the master toke if we dont need to.
pkkid_python-plexapi
train
py
fc01c4bf8aa96b51ae92faad6366eee77f7f396f
diff --git a/DBUtils/Examples/DBUtilsExample.py b/DBUtils/Examples/DBUtilsExample.py index <HASH>..<HASH> 100644 --- a/DBUtils/Examples/DBUtilsExample.py +++ b/DBUtils/Examples/DBUtilsExample.py @@ -46,10 +46,10 @@ class DBUtilsExample(ExamplePage): dbapi_name = config.pop('dbapi', 'pg') if dbapi_name == 'pg': # use the PyGreSQL classic DB API dbmod_name += 'Pg' - if config.has_key('database'): + if 'datanbase' in config: config['dbname'] = config['database'] del config['database'] - if config.has_key('password'): + if 'password' in config: config['passwd'] = config['password'] del config['password'] else: # use a DB-API 2 compliant module @@ -231,7 +231,7 @@ class DBUtilsExample(ExamplePage): places = {} for i in id: i = i[:4].rstrip() - if places.has_key(i): + if i in places: places[i] += 1 else: places[i] = 1
Use more new except syntax in Webware example
Cito_DBUtils
train
py
b3743d1a555e51f480f381eb1f97761fff75467b
diff --git a/DataCollector/GuzzleDataCollector.php b/DataCollector/GuzzleDataCollector.php index <HASH>..<HASH> 100644 --- a/DataCollector/GuzzleDataCollector.php +++ b/DataCollector/GuzzleDataCollector.php @@ -43,7 +43,7 @@ class GuzzleDataCollector extends DataCollector $requestContent = null; if ($request instanceof EntityEnclosingRequestInterface) { - $requestContent = $request->getBody(); + $requestContent = (string) $request->getBody(); } $responseContent = $response->getBody(true);
we need to store string instead of object EntityBody contain a stream object which is not available inside the profiler
ludofleury_GuzzleBundle
train
php
d458f9dc4bb0e2624a0cc4846eaa0793ecd64580
diff --git a/lib/cinchize.rb b/lib/cinchize.rb index <HASH>..<HASH> 100644 --- a/lib/cinchize.rb +++ b/lib/cinchize.rb @@ -93,7 +93,7 @@ module Cinchize loop do bot = Cinch::Bot.new do configure do |c| - network.keys.each { |key| c.send("#{key}=".to_sym, network[key]) } + network.each_pair { |key, value| c.send("#{key}=".to_sym, value) } c.plugins.plugins = plugins c.plugins.options = plugin_options
too used to not having each_pair and to just having a key. java does bad things to you
netfeed_cinchize
train
rb
0f70600f8ad3e89ec8ee5818e552f87a8ef07d39
diff --git a/director/lib/director/jobs/update_release.rb b/director/lib/director/jobs/update_release.rb index <HASH>..<HASH> 100644 --- a/director/lib/director/jobs/update_release.rb +++ b/director/lib/director/jobs/update_release.rb @@ -36,7 +36,11 @@ module Bosh::Director rescue Exception => e # cleanup if @release_version_entry && !@release_version_entry.new? - @release_version_entry.destroy if @release_version_entry + if @release_version_entry + @release_version_entry.remove_all_packages + @release_version_entry.remove_all_templates + @release_version_entry.destroy + end end raise e ensure
cleanup all associations before trying to delete the release version
cloudfoundry_bosh
train
rb
da33f940a42aa72d27ca1af6b84290c74ea9a9c1
diff --git a/flink-connectors/flink-connector-elasticsearch6/src/main/java/org/apache/flink/streaming/connectors/elasticsearch/table/Elasticsearch6DynamicSink.java b/flink-connectors/flink-connector-elasticsearch6/src/main/java/org/apache/flink/streaming/connectors/elasticsearch/table/Elasticsearch6DynamicSink.java index <HASH>..<HASH> 100644 --- a/flink-connectors/flink-connector-elasticsearch6/src/main/java/org/apache/flink/streaming/connectors/elasticsearch/table/Elasticsearch6DynamicSink.java +++ b/flink-connectors/flink-connector-elasticsearch6/src/main/java/org/apache/flink/streaming/connectors/elasticsearch/table/Elasticsearch6DynamicSink.java @@ -157,7 +157,7 @@ final class Elasticsearch6DynamicSink implements DynamicTableSink { @Override public String asSummaryString() { - return "Elasticsearch7"; + return "Elasticsearch6"; } /**
[FLINK-<I>][elasticsearch] Fix the returned value of Elasticsearch6DynamicSink#asSummaryString() This closes #<I>
apache_flink
train
java
3746b203487976e6961b60dac149635a00419051
diff --git a/import_export/admin.py b/import_export/admin.py index <HASH>..<HASH> 100644 --- a/import_export/admin.py +++ b/import_export/admin.py @@ -22,6 +22,7 @@ except ImportError: # Django<2.0 from django.conf import settings from django.template.defaultfilters import pluralize from django.utils.decorators import method_decorator +from django.utils.module_loading import import_string from django.views.decorators.http import require_POST from .forms import ( @@ -49,15 +50,7 @@ TMP_STORAGE_CLASS = getattr(settings, 'IMPORT_EXPORT_TMP_STORAGE_CLASS', if isinstance(TMP_STORAGE_CLASS, six.string_types): - try: - # Nod to tastypie's use of importlib. - parts = TMP_STORAGE_CLASS.split('.') - module_path, class_name = '.'.join(parts[:-1]), parts[-1] - module = importlib.import_module(module_path) - TMP_STORAGE_CLASS = getattr(module, class_name) - except ImportError as e: - msg = "Could not import '%s' for import_export setting 'IMPORT_EXPORT_TMP_STORAGE_CLASS'" % TMP_STORAGE_CLASS - raise ImportError(msg) + TMP_STORAGE_CLASS = import_string(TMP_STORAGE_CLASS) class ImportExportMixinBase(object):
Simplify TMP_STORAGE_CLASS importing Reuse Django's import_string(); avoid reimplementing it.
django-import-export_django-import-export
train
py
7fb985f3a1e944c897cb1b2f96347989cbc7dc73
diff --git a/ryu/ofproto/ofproto_v1_4_parser.py b/ryu/ofproto/ofproto_v1_4_parser.py index <HASH>..<HASH> 100644 --- a/ryu/ofproto/ofproto_v1_4_parser.py +++ b/ryu/ofproto/ofproto_v1_4_parser.py @@ -4269,7 +4269,7 @@ class OFPFlowMod(MsgBase): entries to include this as an output port out_group For ``OFPFC_DELETE*`` commands, require matching entries to include this as an output group - flags One of the following values. + flags Bitmap of the following flags. OFPFF_SEND_FLOW_REM OFPFF_CHECK_OVERLAP OFPFF_RESET_COUNTS
of<I>: Correct documentation of flow mod flags * Flags is a bitmap of OFPFF_* values rather than a single OFPFF_* value
osrg_ryu
train
py