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
1b7eb40d5f78e4e67658f835b194bbc619ede113
diff --git a/lib/active_scaffold/extensions/action_view_rendering.rb b/lib/active_scaffold/extensions/action_view_rendering.rb index <HASH>..<HASH> 100644 --- a/lib/active_scaffold/extensions/action_view_rendering.rb +++ b/lib/active_scaffold/extensions/action_view_rendering.rb @@ -66,8 +66,8 @@ module ActionView::Rendering #:nodoc: id = "as_#{eid}-content" url_options = {:controller => remote_controller.to_s, :action => 'index'}.merge(options[:params]) - if respond_to? :render_component - render_component url_options + if controller.respond_to?(:render_component_into_view) + controller.send(:render_component_into_view, url_options) else content_tag(:div, {:id => id}) do url = url_for(url_options)
render_component is sometimes not available in views (reason still unknown)
activescaffold_active_scaffold
train
rb
9bc9eeb7b951d4b9daa2a1c59c5ba953d3a924b3
diff --git a/insights/specs/insights_archive.py b/insights/specs/insights_archive.py index <HASH>..<HASH> 100644 --- a/insights/specs/insights_archive.py +++ b/insights/specs/insights_archive.py @@ -16,7 +16,7 @@ class InsightsArchiveSpecs(Specs): brctl_show = simple_file("insights_commands/brctl_show") ceph_df_detail = simple_file("insights_commands/ceph_df_detail_-f_json-pretty") ceph_health_detail = simple_file("insights_commands/ceph_health_detail_-f_json-pretty") - ceph_insights = simple_file("insights_commands/python_-m_insights.tools.cat_ceph_insights") + ceph_insights = simple_file("insights_commands/python_-m_insights.tools.cat_--no-header_ceph_insights") ceph_osd_df = simple_file("insights_commands/ceph_osd_df_-f_json-pretty") ceph_osd_dump = simple_file("insights_commands/ceph_osd_dump_-f_json-pretty") ceph_osd_ec_profile_ls = simple_file("insights_commands/ceph_osd_erasure-code-profile_ls")
Fix insights archive spec for ceph_insights (#<I>)
RedHatInsights_insights-core
train
py
557735c20555d6b23ed38c49586e13ecc5b999dd
diff --git a/lib/polisher/git/pkg.rb b/lib/polisher/git/pkg.rb index <HASH>..<HASH> 100644 --- a/lib/polisher/git/pkg.rb +++ b/lib/polisher/git/pkg.rb @@ -105,15 +105,10 @@ module Polisher end # Update the local spec to the specified gem version - # - # FIXME this should be removed and calls replaced with self.spec.update_to(gem) def update_spec_to(gem) in_repo do - replace_version = "s/Version.*/Version: #{gem.version}/" - replace_release = "s/Release:.*/Release: 1%{?dist}/" - [replace_version, replace_release].each do |replace| - AwesomeSpawn.run "#{sed_cmd} -i '#{replace}' #{spec_file}" - end + spec.update_to(gem) + File.write(spec_file, spec.to_string) end end
Use RPM::Spec#update to in git pkg update process Resolves a long standing FIXME in the Git::Pkg module and removes the dependency on the 'sed' cmd
ManageIQ_polisher
train
rb
9be90229b80bf4db200c7abdd21d8c3ee830ea95
diff --git a/PyFunceble/cli/continuous_integration/base.py b/PyFunceble/cli/continuous_integration/base.py index <HASH>..<HASH> 100644 --- a/PyFunceble/cli/continuous_integration/base.py +++ b/PyFunceble/cli/continuous_integration/base.py @@ -1065,8 +1065,10 @@ class ContinuousIntegrationBase: ("git config --local push.default simple", False), ("git config --local pull.rebase false", False), (f'git checkout "{self.git_branch}"', False), + ("git fetch origin", False), ( - f'git pull origin "{self.git_distribution_branch}"', + f"git merge --strategy-option theirs " + f"origin/{self.git_distribution_branch}", False, ), ] @@ -1117,7 +1119,8 @@ class ContinuousIntegrationBase: f'git checkout "{branch}"', True, ), - (f"git pull origin {branch}", True), + ("git fetch origin", True), + (f"git merge --strategy-option theirs origin/{branch}", True), (f"git push origin {branch}", True), ] )
Fix merging strategy. This patch fixes #<I>. Indeed, before this patch, the merging strategy was not explicit enough. From now on, we explicitly merge every incoming changes. Contributors: * @spirillen
funilrys_PyFunceble
train
py
51012a2e53c1ba344fa19d557383ac1bf6430417
diff --git a/test/edge_collection_test.go b/test/edge_collection_test.go index <HASH>..<HASH> 100644 --- a/test/edge_collection_test.go +++ b/test/edge_collection_test.go @@ -108,7 +108,7 @@ func TestRemoveEdgeCollection(t *testing.T) { // Now create an edge collection ec, err := g.CreateEdgeCollection(nil, "friends", []string{"person"}, []string{"person"}) if err != nil { - t.Errorf("CreateEdgeCollection failed: %s", describe(err)) + t.Fatalf("CreateEdgeCollection failed: %s", describe(err)) } else if ec.Name() != "friends" { t.Errorf("Invalid name, expected 'friends', got '%s'", ec.Name()) }
Prevent panic incase an earlier test fails
arangodb_go-driver
train
go
62deedd3fc59eec65f6758024afddf267cb0ae93
diff --git a/lib/ruote/storage/composite_storage.rb b/lib/ruote/storage/composite_storage.rb index <HASH>..<HASH> 100644 --- a/lib/ruote/storage/composite_storage.rb +++ b/lib/ruote/storage/composite_storage.rb @@ -62,16 +62,16 @@ module Ruote if type == nil define_method(method_name) do |*args| - storage(args.first['type']).send(method_name, *args) + storage_for(args.first['type']).send(method_name, *args) end elsif type.is_a?(Fixnum) define_method(method_name) do |*args| - storage(args[type]).send(method_name, *args) + storage_for(args[type]).send(method_name, *args) end else type = type.to_s define_method(method_name) do |*args| - storage(type).send(method_name, *args) + storage_for(type).send(method_name, *args) end end end @@ -102,7 +102,7 @@ module Ruote # def get_msgs(worker_name='worker') - sto = storage('msgs') + sto = storage_for('msgs') if sto.method(:get_msgs).arity == 0 sto.get_msgs @@ -129,7 +129,7 @@ module Ruote protected - def storage(type) + def storage_for(type) @storages[type] || @default_storage end
The composite storage didn't actually seem to work in real life - when passed into a Worker, the worker always called 'storage' on it (because respond_to? will return true for protected methods even though it won't dispatch to them) which was failing. I renamed the protected method in the CompositeStorage to storage_for to avoid the conflict.
jmettraux_ruote
train
rb
a4715eaa6cb82458d7ba229b6f1d3d6cb6d2bd07
diff --git a/Integration/ClientIntegration.php b/Integration/ClientIntegration.php index <HASH>..<HASH> 100644 --- a/Integration/ClientIntegration.php +++ b/Integration/ClientIntegration.php @@ -455,7 +455,7 @@ class ClientIntegration extends AbstractIntegration $properties['_token'] === $config['_token'] && $properties['campaignId'] === $config['campaignId'] ) { - $campaign = $leadEventLog->getCampaign(); + $this->campaign = $leadEventLog->getCampaign(); break; } }
[ENG-<I>] Correct campaign finder.
TheDMSGroup_mautic-contact-client
train
php
8fe6ceb663f17e8583b56ff908f3209bb9acfc61
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -37,6 +37,8 @@ release = '0.3.5' # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ + 'matplotlib.sphinxext.only_directives', + 'matplotlib.sphinxext.plot_directive' 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.doctest',
adding matplotlib to conf
wiheto_teneto
train
py
641bc0498bf05165f153f23637edd2c5cdf3fb79
diff --git a/examples/ebola.py b/examples/ebola.py index <HASH>..<HASH> 100644 --- a/examples/ebola.py +++ b/examples/ebola.py @@ -33,7 +33,7 @@ if __name__ == '__main__': aln = base_name+'.fasta', verbose = 4, dates = dates) # infer an ebola time tree while rerooting and resolving polytomies - ebola.run(root='best', relaxed_clock=False, max_iter=2, + ebola.run(root='best', relaxed_clock=False, max_iter=2, long_branch_mode=False, resolve_polytomies=True, Tc='skyline', time_marginal="assign") # scatter root to tip divergence vs sampling date diff --git a/treetime/gtr.py b/treetime/gtr.py index <HASH>..<HASH> 100644 --- a/treetime/gtr.py +++ b/treetime/gtr.py @@ -1,4 +1,3 @@ - #!/usr/local/bin/python # -*- coding: utf-8 -*- from __future__ import division, print_function
disable long branch mode for ebola
neherlab_treetime
train
py,py
36b441cc4759b1972320f459d2ca93a645748d5c
diff --git a/src/Codeception/Lib/Driver/MongoDb.php b/src/Codeception/Lib/Driver/MongoDb.php index <HASH>..<HASH> 100644 --- a/src/Codeception/Lib/Driver/MongoDb.php +++ b/src/Codeception/Lib/Driver/MongoDb.php @@ -95,7 +95,7 @@ class MongoDb */ public function __construct($dsn, $user, $password) { - $this->legacy = class_exists('\\MongoClient'); + $this->legacy = class_exists('\\MongoClient') && strpos(\MongoClient::VERSION, 'mongofill') === false; /* defining DB name */ $this->dbName = substr($dsn, strrpos($dsn, '/') + 1);
Mongofill support (#<I>)
Codeception_base
train
php
73cb1c26fe94d0ed23bd5d1ce8ae1e845971233d
diff --git a/lib/yard/registry.rb b/lib/yard/registry.rb index <HASH>..<HASH> 100644 --- a/lib/yard/registry.rb +++ b/lib/yard/registry.rb @@ -20,7 +20,7 @@ module YARD end end - def at(path) namespace[path] end + def at(path) path.to_s.empty? ? root : namespace[path] end def root; namespace[:root] end def delete(object) namespace.delete(object.path) end def clear; initialize end
If #at() receives empty string, it belongs to root
lsegal_yard
train
rb
32342bc2a8de65d15d9e4e80bd9a2c1f9befc6f7
diff --git a/a10_neutron_lbaas/etc/config.py b/a10_neutron_lbaas/etc/config.py index <HASH>..<HASH> 100644 --- a/a10_neutron_lbaas/etc/config.py +++ b/a10_neutron_lbaas/etc/config.py @@ -35,6 +35,17 @@ # database_connection = None +# Should only be set to true if projects have been created with +# parent-child relationships within openstack. + +# use_parent_project = False + +# +# Used to persist partitions upon deletion of lb objects +# + +# disable_partition_delete = False + # Sometimes we need things from neutron. We will look in the usual places, # but this is here if you need to override the location. @@ -50,7 +61,9 @@ # keystone_auth_url = None +# # Which version of the keystone protocol to use +# # keystone_version = 2
Added config choice summaries
a10networks_a10-neutron-lbaas
train
py
d48f848bb4aa018da6527b27abd093089d3e736a
diff --git a/lib/socket.js b/lib/socket.js index <HASH>..<HASH> 100644 --- a/lib/socket.js +++ b/lib/socket.js @@ -283,6 +283,8 @@ Socket.prototype.leaveAll = function(){ /** * Called by `Namespace` upon successful * middleware execution (ie: authorization). + * Socket is added to namespace array before + * call to join, so adapters can access it. * * @api private */
[docs] Comment connected socket availability for adapters (#<I>)
socketio_socket.io
train
js
47e529b2a18f40b066dcf32ab0724c6fd8c41f28
diff --git a/lib/jsduck/accessors.rb b/lib/jsduck/accessors.rb index <HASH>..<HASH> 100644 --- a/lib/jsduck/accessors.rb +++ b/lib/jsduck/accessors.rb @@ -42,6 +42,7 @@ module JsDuck :doc => "", }, :owner => cfg[:owner], + :files => cfg[:files], } end @@ -60,6 +61,7 @@ module JsDuck :doc => "", }, :owner => cfg[:owner], + :files => cfg[:files], } end
Fix files lists of @accessor created methods.
senchalabs_jsduck
train
rb
6abfd709bc08f765caace68b13b673737a9290f0
diff --git a/Command/ImportMappingDoctrineCommand.php b/Command/ImportMappingDoctrineCommand.php index <HASH>..<HASH> 100644 --- a/Command/ImportMappingDoctrineCommand.php +++ b/Command/ImportMappingDoctrineCommand.php @@ -38,7 +38,7 @@ from an existing database: Generate annotation mappings into the src/ directory using App as the namespace: <info>php %command.full_name% App\\\Entity annotation --path=src/Entity</info> -Generate annotation mappings into the config/doctrine/ directory using App as the namespace: +Generate xml mappings into the config/doctrine/ directory using App as the namespace: <info>php %command.full_name% App\\\Entity xml --path=config/doctrine</info> Generate XML mappings into a bundle:
Describe the actual command This is probably a copy/paste/adapt mistake.
doctrine_DoctrineBundle
train
php
836998181ceefea6f9d35cf7f6981ee848f85be9
diff --git a/lib/pairwise.rb b/lib/pairwise.rb index <HASH>..<HASH> 100644 --- a/lib/pairwise.rb +++ b/lib/pairwise.rb @@ -10,7 +10,9 @@ require 'pairwise/input_file' require 'pairwise/cli' require 'yaml' -YAML::ENGINE.yamler = 'syck' +if RUBY_VERSION != '1.8.7' + YAML::ENGINE.yamler = 'syck' +end module Pairwise class InvalidInputData < Exception; end
Exclude <I> from using the nicer yaml parser. Its breaks the build as it does not know what the parser is
josephwilk_pairwise
train
rb
75609a78f1348ca1d5973a39f9ef131631856148
diff --git a/app/models/devise_token_auth/concerns/user.rb b/app/models/devise_token_auth/concerns/user.rb index <HASH>..<HASH> 100644 --- a/app/models/devise_token_auth/concerns/user.rb +++ b/app/models/devise_token_auth/concerns/user.rb @@ -165,6 +165,6 @@ module DeviseTokenAuth::Concerns::User end def set_empty_token_hash - self.tokens ||= {} + self.tokens ||= {} if has_attribute?(:tokens) end end
guard against MissingAttributeError during common ActiveRecord operations
lynndylanhurley_devise_token_auth
train
rb
3af147ea949c877de2c884b2d801ef7e79937c36
diff --git a/src/streamlink/stream/ffmpegmux.py b/src/streamlink/stream/ffmpegmux.py index <HASH>..<HASH> 100644 --- a/src/streamlink/stream/ffmpegmux.py +++ b/src/streamlink/stream/ffmpegmux.py @@ -126,7 +126,7 @@ class FFMPEGMuxer(StreamIO): for t in self.pipe_threads: t.daemon = True t.start() - self.process = subprocess.Popen(self._cmd, stdout=subprocess.PIPE, stderr=self.errorlog) + self.process = subprocess.Popen(self._cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=self.errorlog) return self
[ffmpegmux] Fixed bug of an invisible terminal if a ffmpeg stream gets closed with ctrl + c the terminal will get invisible, this patch will fix it.
streamlink_streamlink
train
py
f3450e25b83f8bd57f19d934e2a169523164b14d
diff --git a/js/acx.js b/js/acx.js index <HASH>..<HASH> 100644 --- a/js/acx.js +++ b/js/acx.js @@ -302,6 +302,7 @@ module.exports = class acx extends Exchange { if (Object.keys (query).length) url += '?' + this.urlencode (query); } else { + this.checkRequiredCredentials (); let nonce = this.nonce ().toString (); let query = this.urlencode (this.keysort (this.extend ({ 'access_key': this.apiKey,
acx checkRequiredCredentials #<I>
ccxt_ccxt
train
js
6c35dd6b2da1acb1e593482be294880e4d747388
diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index <HASH>..<HASH> 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/src/Composer/Util/RemoteFilesystem.php @@ -158,7 +158,7 @@ class RemoteFilesystem $ctx = StreamContextFactory::getContext($fileUrl, $options, array('notification' => array($this, 'callbackGet'))); if ($this->progress) { - $this->io->writeError(" Downloading: <comment>connection...</comment>", !$this->io->isDecorated()); + $this->io->writeError(" Downloading: <comment>Connecting...</comment>", !$this->io->isDecorated()); } $errorMessage = '';
Improved wording All other verbs use are in the form of "doing something", ie Installing, Downloading. "connection" is the odd one out.
mothership-ec_composer
train
php
3ad58435841f8045ded300801b89960e950bb599
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,11 +2,7 @@ # -*- coding: utf-8 -*- # setup.py -try: - from setuptools import setup -except ImportError: - from distutils.core import setup - +from setuptools import setup # Use a consistent encoding from codecs import open
setup.py: Don't try to import `distutils`
wmayner_pyphi
train
py
9b2b1694a98ec7788de328b4b7aca4f7d768b50d
diff --git a/resources/lang/pt-br/menu.php b/resources/lang/pt-br/menu.php index <HASH>..<HASH> 100644 --- a/resources/lang/pt-br/menu.php +++ b/resources/lang/pt-br/menu.php @@ -16,4 +16,4 @@ return [ 'Important' => 'Importante', 'Warning' => 'Aviso', 'Information' => 'Informação', -] +];
; at te end of file
jeroennoten_Laravel-AdminLTE
train
php
df312c1e9e761e7903cea200f775e25b2180a15a
diff --git a/src/prebid.js b/src/prebid.js index <HASH>..<HASH> 100644 --- a/src/prebid.js +++ b/src/prebid.js @@ -467,6 +467,12 @@ $$PREBID_GLOBAL$$.requestBids = hook('async', function ({ bidsBackHandler, timeo } const auction = auctionManager.createAuction({adUnits, adUnitCodes, callback: bidsBackHandler, cbTimeout, labels}); + + let adUnitsLen = adUnits.length; + if (adUnitsLen > 15) { + utils.logInfo(`Current auction ${auction.getAuctionId()} contains ${adUnitsLen} adUnits.`, adUnits); + } + adUnitCodes.forEach(code => targeting.setLatestAuctionForAdUnit(code, auction.getAuctionId())); auction.callBids(); return auction;
add console message when number of adunits exceeds point (#<I>) * add console message when number of adunits exceeds point * include additional information in log message
prebid_Prebid.js
train
js
9c6ac160a4a0db882b6fb8ad00fcbf87bac1ee99
diff --git a/src/Behaviours/CamelCasing.php b/src/Behaviours/CamelCasing.php index <HASH>..<HASH> 100644 --- a/src/Behaviours/CamelCasing.php +++ b/src/Behaviours/CamelCasing.php @@ -14,6 +14,18 @@ trait CamelCasing public $enforceCamelCase = true; /** + * Overloads the eloquent isGuardableColumn method to ensure that we are checking for the existence of + * the snake_cased column name. + * + * @param string $key + * @return bool + */ + protected function isGuardableColumn($key) + { + return parent::isGuardableColumn($this->getSnakeKey($key)); + } + + /** * Overloads the eloquent setAttribute method to ensure that fields accessed * in any case are converted to snake_case, which is the defacto standard * for field names in databases.
allow mass assignment of camelCased fields
kirkbushell_eloquence
train
php
47f42b391e6e99e3122d32b8874279e78eb7e7f4
diff --git a/examples/clear-space.py b/examples/clear-space.py index <HASH>..<HASH> 100755 --- a/examples/clear-space.py +++ b/examples/clear-space.py @@ -26,6 +26,9 @@ import sys import gphoto2 as gp +# my Canon dSLR raises an error on every deletion, but still does it OK +gp.error_severity[gp.GP_ERROR] = logging.WARNING + def list_files(camera, context, path='/'): result = [] gp_list = gp.check_result(gp.gp_list_new())
Adjust error handling to work with my dSLR.
jim-easterbrook_python-gphoto2
train
py
3f891cc717e2aaada1e8e396b5ac123c66de75c1
diff --git a/lib/error/serviceError.js b/lib/error/serviceError.js index <HASH>..<HASH> 100644 --- a/lib/error/serviceError.js +++ b/lib/error/serviceError.js @@ -22,7 +22,7 @@ function ServiceError(context) { ServiceError.buildFrom = function(err) { var error = new ServiceError({ - info: err.message + message: err.message }); error.stack = err.stack;
rename ServiceError "info" context property to "message" to preserve consistent API
BohemiaInteractive_bi-service
train
js
5001acacf8b4dcee8976909c3a6b6df600464f82
diff --git a/wpull/version.py b/wpull/version.py index <HASH>..<HASH> 100644 --- a/wpull/version.py +++ b/wpull/version.py @@ -6,4 +6,4 @@ A string conforming to `Semantic Versioning Guidelines <http://semver.org/>`_ ''' -__version__ = '0.22.4' +__version__ = '0.22.5'
Bumps version to <I>.
ArchiveTeam_wpull
train
py
0430b579c89e483ff64bb997b9b9983461e00a27
diff --git a/openxc/src/com/openxc/DataPipeline.java b/openxc/src/com/openxc/DataPipeline.java index <HASH>..<HASH> 100644 --- a/openxc/src/com/openxc/DataPipeline.java +++ b/openxc/src/com/openxc/DataPipeline.java @@ -197,20 +197,30 @@ public class DataPipeline implements SourceCallback { return mMessagesReceived; } + public boolean isActive() { + return isActive(null); + } + + /** + * Return true if at least one source is active. + */ + public boolean isActive(VehicleDataSource skipSource) { + boolean connected = false; + for(VehicleDataSource s : mSources) { + if(s != skipSource) { + connected = connected || s.isConnected(); + } + } + return connected; + } + /** * At least one source is not active - if all sources are inactive, notify * the operator. */ public void sourceDisconnected(VehicleDataSource source) { if(mOperator != null) { - boolean connected = false; - for(VehicleDataSource s : mSources) { - if(s != source) { - connected = connected || s.isConnected(); - } - } - - if(!connected) { + if(!isActive(source)) { mOperator.onPipelineDeactivated(); } }
Pull pipeline activity check up to a function.
openxc_openxc-android
train
java
9f35429118cc2fd9691e37ec6a9f52b15863d564
diff --git a/src/hamster/widgets/activityentry.py b/src/hamster/widgets/activityentry.py index <HASH>..<HASH> 100644 --- a/src/hamster/widgets/activityentry.py +++ b/src/hamster/widgets/activityentry.py @@ -209,6 +209,7 @@ class CmdLineEntry(gtk.Entry): self.original_fact = None self.popup = gtk.Window(type = gtk.WindowType.POPUP) + self.popup.set_type_hint(gdk.WindowTypeHint.COMBO) self.popup.set_transient_for(self.get_ancestor(gtk.Window)) # position self.popup.set_attached_to(self) # attributes
set cmdline popup type_hint
projecthamster_hamster
train
py
df19c70c913cd0a8882670c5188042f13a605226
diff --git a/packages/orbit-components/src/InputStepper/InputStepperStateless/index.js b/packages/orbit-components/src/InputStepper/InputStepperStateless/index.js index <HASH>..<HASH> 100644 --- a/packages/orbit-components/src/InputStepper/InputStepperStateless/index.js +++ b/packages/orbit-components/src/InputStepper/InputStepperStateless/index.js @@ -14,6 +14,7 @@ import type { StateLessProps } from "./index.js.flow"; const StyledInputStepper = styled.div` width: 100%; margin-bottom: ${getSpacingToken}; + font-family: ${({ theme }) => theme.orbit.fontFamily}; ${Input} { text-align: center;
fix(InputStepper): missing font-family (#<I>)
kiwicom_orbit-components
train
js
429854f98e0d4c3b091942eb69522759c2522e1a
diff --git a/autoload.php b/autoload.php index <HASH>..<HASH> 100644 --- a/autoload.php +++ b/autoload.php @@ -7,10 +7,11 @@ */ function odata_query_autoload($class) { - $file = __DIR__.DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, str_replace('-', '_', $class)).'.php'; + $file = __DIR__.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR. + str_replace('\\', DIRECTORY_SEPARATOR, str_replace('-', '_', $class)).'.php'; if (file_exists($file)) { require_once $file; } } -# Enable if composer autoload isn't available -#spl_autoload_register('odata_query_autoload'); \ No newline at end of file + +spl_autoload_register('odata_query_autoload'); \ No newline at end of file
Updated autoload to use correct directory structure
curiosity26_ODataQuery-PHP
train
php
0c8d8c6de45e1587622a47007529d1e02595433f
diff --git a/lib/compiler/underscored.js b/lib/compiler/underscored.js index <HASH>..<HASH> 100644 --- a/lib/compiler/underscored.js +++ b/lib/compiler/underscored.js @@ -33,7 +33,7 @@ function run(options) { var streamliners = { node: function (module, filename, code) { var cachedTransform = require("streamline/lib/compiler/compile").cachedTransformSync; - streamlined = cachedTransform(code, filename, streamline, options); + streamlined = options.cache ? cachedTransform(code, filename, streamline, options) : streamline(code, options); module._compile(streamlined, filename) }, coffee: function (module, filename, code) {
introduced cache option to control caching of transformed files
Sage_streamlinejs
train
js
5504b5c7afaa2ca3e6bcb2b0950c3f373ca76880
diff --git a/DataTables.php b/DataTables.php index <HASH>..<HASH> 100644 --- a/DataTables.php +++ b/DataTables.php @@ -74,7 +74,9 @@ class DataTables extends \yii\grid\GridView } /** - * Initializes the datatables widget + * Initializes the datatables widget disabling some GridView options like + * search, sort and pagination and using DataTables JS functionalities + * instead. */ public function init() { @@ -83,12 +85,15 @@ class DataTables extends \yii\grid\GridView //disable filter model by grid view $this->filterModel = null; + //disable sort by grid view + $this->dataProvider->sort = false; + + //disable pagination by grid view + $this->dataProvider->pagination = false; + //layout showing only items $this->layout = "{items}"; - //no grid view sort - $this->dataProvider->sort = false; - //the table id must be set if (!isset($this->tableOptions['id'])) { $this->tableOptions['id'] = 'datatables_'.$this->getId();
Disabling GridView pagination by default
fedemotta_yii2-widget-datatables
train
php
c961e7d49c3d893ecfbdf0dfc04141c19474114d
diff --git a/generators/service/templates/hooks.js b/generators/service/templates/hooks.js index <HASH>..<HASH> 100644 --- a/generators/service/templates/hooks.js +++ b/generators/service/templates/hooks.js @@ -1,6 +1,7 @@ 'use strict'; const globalHooks = require('../../../hooks'); +const hooks = require('feathers-hooks').hooks; <% if (authentication) { %>const auth = require('feathers-authentication').hooks;<% } %> exports.before = { @@ -40,7 +41,7 @@ exports.before = { }; exports.after = { - all: [], + all: [<% if (name === 'user') { %>hooks.remove('password')<% } %>], find: [], get: [], create: [],
adding remove password hook by default to user service
feathersjs_generator-feathers
train
js
d4c54c773aeb70878f8ad4043cdaf412a06f7e2d
diff --git a/pnc_cli/makemead.py b/pnc_cli/makemead.py index <HASH>..<HASH> 100644 --- a/pnc_cli/makemead.py +++ b/pnc_cli/makemead.py @@ -6,7 +6,7 @@ import time from ConfigParser import Error from ConfigParser import NoSectionError -from argh import arg, aliases +from argh import arg import pnc_cli.utils as utils from pnc_cli import bpmbuildconfigurations
[NCL-<I>] cleanup
project-ncl_pnc-cli
train
py
17e5a42df83394c32b3b5c5243dffebe05d4bcde
diff --git a/anndata/tests/test_readwrite.py b/anndata/tests/test_readwrite.py index <HASH>..<HASH> 100644 --- a/anndata/tests/test_readwrite.py +++ b/anndata/tests/test_readwrite.py @@ -1,5 +1,6 @@ +import sys from importlib.util import find_spec -from pathlib import Path +from pathlib import Path, PurePath import numpy as np import pandas as pd @@ -11,6 +12,15 @@ import anndata as ad HERE = Path(__file__).parent +if sys.version_info < (3, 6): + from _pytest.tmpdir import _mk_tmp # noqa + + # On 3.5 this is pathlib2, which won’t work. + @pytest.fixture + def tmp_path(request, tmp_path_factory): + return Path(str(_mk_tmp(request, tmp_path_factory))) + + # ------------------------------------------------------------------------------- # Some test data # -------------------------------------------------------------------------------
Try fixing tests for <I>
theislab_anndata
train
py
80e6bef4f464d950199dcbdfa3be298913c83978
diff --git a/src/main/java/com/hp/autonomy/hod/client/api/resource/ResourceFlavour.java b/src/main/java/com/hp/autonomy/hod/client/api/resource/ResourceFlavour.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/hp/autonomy/hod/client/api/resource/ResourceFlavour.java +++ b/src/main/java/com/hp/autonomy/hod/client/api/resource/ResourceFlavour.java @@ -79,6 +79,7 @@ public class ResourceFlavour implements Serializable { CATEGORIZATION, CUSTOM_FIELDS, QUERY_MANIPULATION, + JUMBO, WEB_CLOUD, FILESYSTEM_ONSITE ));
[CCUK-<I>] Add Jumbo to set of all flavours
microfocus-idol_java-hod-client
train
java
e7d0cf6db61828b07f9b6e705503d53c82f97f6d
diff --git a/openquake/calculators/tests/gmf_ebrisk_test.py b/openquake/calculators/tests/gmf_ebrisk_test.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/tests/gmf_ebrisk_test.py +++ b/openquake/calculators/tests/gmf_ebrisk_test.py @@ -127,6 +127,6 @@ class GmfEbRiskTestCase(CalculatorTestCase): # compare the event loss table generated by an event_based_risk # case_master calculation with an equivalent gmf_ebrisk calculation f0 = writetmp(view('elt', calc0)) - self.assertEqualFiles('expected/elt.txt', f0) + self.assertEqualFiles('expected/elt.txt', f0, delta=1E-5) f2 = writetmp(view('elt', calc2)) - self.assertEqualFiles('expected/elt.txt', f2) + self.assertEqualFiles('expected/elt.txt', f2, delta=1E-5)
Added tolerance [skip hazardlib]
gem_oq-engine
train
py
78bc25823c2e33918e5a5f10fe8dae31728b8f1e
diff --git a/api/app/app.go b/api/app/app.go index <HASH>..<HASH> 100644 --- a/api/app/app.go +++ b/api/app/app.go @@ -48,6 +48,7 @@ type App struct { State string Units []Unit Teams []string + ec2Auth authorizer } type Log struct { @@ -270,8 +271,8 @@ func deployHookAbsPath(p string) (string, error) { } /* -* Returns app.conf located at app's git repository - */ + Returns app.conf located at app's git repository +*/ func (a *App) conf() (conf, error) { var c conf uRepo, err := repository.GetPath()
api/app: simplify doc Who is the java programmer responsible for that? :)
tsuru_tsuru
train
go
1249368fc23103203cdfb429efb6adc7d8fedfa2
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -12,10 +12,19 @@ fs.readdirSync(__dirname + '/middleware').forEach(function (filename) { }); exports.defaults = function (app, overrides) { + if (typeof app.use !== 'function') { + overrides = app; + try { // make sub-app, in likeliest framework(s) + app = require('express')(); + } catch (e) { + app = require('connect')(); + } + } overrides = overrides || {csp: false}; middleware.forEach(function _eachMiddleware(m) { if (overrides[m] !== false) { app.use(require('./middleware/' + m)()); } }); + return app; };
Support helmet.defaults() as middleware, fixes #<I> Here's a simple way to support both the old and more conventional middleware-like usage of `helmet.defaults()`. NOTE: there's one caveat in that the user *must* be using (i.e. have installed) either 'express' or 'connect' themselves but that seemed a reasonable enough assumption, eh?
venables_koa-helmet
train
js
f11751c42dd0050ee5803265ade04b92c7c1815a
diff --git a/dev/LogEmailWriter.php b/dev/LogEmailWriter.php index <HASH>..<HASH> 100644 --- a/dev/LogEmailWriter.php +++ b/dev/LogEmailWriter.php @@ -24,6 +24,10 @@ class SS_LogEmailWriter extends Zend_Log_Writer_Abstract { $this->emailAddress = $emailAddress; $this->customSmtpServer = $customSmtpServer; } + + static function factory($emailAddress, $customSmtpServer = false) { + return new SS_LogEmailWriter($emailAddress, $customSmtpServer); + } public static function set_send_from($address) { self::$send_from = $address; diff --git a/dev/LogFileWriter.php b/dev/LogFileWriter.php index <HASH>..<HASH> 100644 --- a/dev/LogFileWriter.php +++ b/dev/LogFileWriter.php @@ -43,6 +43,10 @@ class SS_LogFileWriter extends Zend_Log_Writer_Abstract { $this->messageType = $messageType; $this->extraHeaders = $extraHeaders; } + + static function factory($path, $messageType = 3, $extraHeaders = '') { + return new SS_LogFileWriter($path, $messageType, $extraHeaders); + } /** * Write the log message to the file path set
MINOR Fixed SS_LogEmailWriter and SS_LogFileWriter to adhere to new Zend interface
silverstripe_silverstripe-framework
train
php,php
5d8c570e8ce22b56d34b1cfd1b88f6439cbf4c5c
diff --git a/tests/test_networkmanager.py b/tests/test_networkmanager.py index <HASH>..<HASH> 100644 --- a/tests/test_networkmanager.py +++ b/tests/test_networkmanager.py @@ -538,7 +538,7 @@ class TestNetworkManager(dbusmock.DBusTestCase): self.assertEqual(self.settings.GetConnectionByUuid(uuid), connectionPath) fakeuuid = '123123123213213' - with self.assertRaisesRegexp(dbus.exceptions.DBusException, ".*uuid.*%s$" % fakeuuid): + with self.assertRaisesRegex(dbus.exceptions.DBusException, ".*uuid.*%s$" % fakeuuid): self.settings.GetConnectionByUuid(fakeuuid)
test: Fix deprecated assertRaisesRegexp() call
martinpitt_python-dbusmock
train
py
7235b85e8421000822cc4e84fb5f17891c7003d1
diff --git a/lib/SauceBrowser.js b/lib/SauceBrowser.js index <HASH>..<HASH> 100644 --- a/lib/SauceBrowser.js +++ b/lib/SauceBrowser.js @@ -10,6 +10,7 @@ function SauceBrowser(conf, opt) { }; var self = this; + self._retries = 0; self._conf = conf; self._opt = opt; self._opt.tunnel = true; @@ -122,9 +123,11 @@ SauceBrowser.prototype.shutdown = function(err) { if (err) { // if the environment can't be set up, we should retry since Zuul will // never try to initialize environments that don't exist - if (~err.message.indexOf('Error response status: 13') - || ~err.message.indexOf('The environment you requested was unavailable') - || (err.message == 'Not JSON response' && ~err.data.indexOf('not in progress'))) { + if (self._retries < 3 + && (~err.message.indexOf('Error response status: 13') + || ~err.message.indexOf('The environment you requested was unavailable') + || (err.message == 'Not JSON response' && ~err.data.indexOf('not in progress')))) { + self._retries++; return self.start(); } self.emit('error', err);
Added a retry threshold of three (3) to retrying on errors indicating that environments can't be instantiated so that we won't end up looping forever by mistake.
airtap_airtap
train
js
521718bf09b0518fe31e99eff45eafe497297185
diff --git a/src/Caouecs/Sirtrevorjs/Controller/SirTrevorJsController.php b/src/Caouecs/Sirtrevorjs/Controller/SirTrevorJsController.php index <HASH>..<HASH> 100644 --- a/src/Caouecs/Sirtrevorjs/Controller/SirTrevorJsController.php +++ b/src/Caouecs/Sirtrevorjs/Controller/SirTrevorJsController.php @@ -9,7 +9,7 @@ namespace Caouecs\Sirtrevorjs\Controller; use Config; -use Controller; +use App\Http\Controllers\Controller; use Input; use Thujohn\Twitter\TwitterFacade as Tweet;
feature: controller of Laravel 5
caouecs_Laravel-SirTrevorJS
train
php
60aa154e9c1061b980a624ec6f1faffb8fea11d7
diff --git a/spec/lib/stellar/key_pair_spec.rb b/spec/lib/stellar/key_pair_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/stellar/key_pair_spec.rb +++ b/spec/lib/stellar/key_pair_spec.rb @@ -1,3 +1,4 @@ +# encoding: utf-8 require "spec_helper" describe Stellar::KeyPair do
Fix specs for <I> by marking file encoding as utf-8
stellar_ruby-stellar-sdk
train
rb
51ffd502029d9a0579f1c06de39b56552fb3af62
diff --git a/symphony/lib/core/class.exceptionhandler.php b/symphony/lib/core/class.exceptionhandler.php index <HASH>..<HASH> 100644 --- a/symphony/lib/core/class.exceptionhandler.php +++ b/symphony/lib/core/class.exceptionhandler.php @@ -111,6 +111,8 @@ final class ExceptionHandler $exception_type = get_class($e); + // TODO: @deprecated @since Symphony 3.0.0 + // Use Renderer instead if (class_exists("{$exception_type}Handler") && method_exists("{$exception_type}Handler", 'render')) { $class = "{$exception_type}Handler"; } elseif (class_exists("{$exception_type}Renderer") && method_exists("{$exception_type}Renderer", 'render')) {
Deprecated {$exception_type}Handler Picked from <I>be<I>cda6 Picked from <I>a<I>fad
symphonycms_symphony-2
train
php
edaed5ef7ed98addb16c10aee909c684a035c9d3
diff --git a/dev/Backtrace.php b/dev/Backtrace.php index <HASH>..<HASH> 100644 --- a/dev/Backtrace.php +++ b/dev/Backtrace.php @@ -159,7 +159,7 @@ class SS_Backtrace { */ static function get_rendered_backtrace($bt, $plainText = false, $ignoredFunctions = null) { $bt = self::filter_backtrace($bt, $ignoredFunctions); - $result = "<ul>"; + $result = ($plainText) ? '' : '<ul>'; foreach($bt as $item) { if($plainText) { $result .= self::full_func_name($item,true) . "\n"; @@ -177,7 +177,7 @@ class SS_Backtrace { $result .= "</li>\n"; } } - $result .= "</ul>"; + if(!$plainText) $result .= '</ul>'; return $result; }
BUGFIX If SS_Backtrace::get_rendered_backtrace() has $plainText argument to TRUE, ensure there is no HTML in the output.
silverstripe_silverstripe-framework
train
php
dac0f30cfbc28023651d91756fd3095206bc9aa2
diff --git a/category_encoders/binary.py b/category_encoders/binary.py index <HASH>..<HASH> 100644 --- a/category_encoders/binary.py +++ b/category_encoders/binary.py @@ -118,6 +118,9 @@ class BinaryEncoder(BaseEstimator, TransformerMixin): ) self.ordinal_encoder = self.ordinal_encoder.fit(X) + for col in self.cols: + self.digits_per_col[col] = self.calc_required_digits(X, col) + # drop all output columns with 0 variance. if self.drop_invariant: self.drop_cols = [] @@ -125,8 +128,6 @@ class BinaryEncoder(BaseEstimator, TransformerMixin): self.drop_cols = [x for x in X_temp.columns.values if X_temp[x].var() <= 10e-5] - for col in self.cols: - self.digits_per_col[col] = self.calc_required_digits(X, col) return self
In binary.py fixed small. The number of required digits must be calculated before dropping invariant columns
scikit-learn-contrib_categorical-encoding
train
py
f19e56d24c685870ee411e16df285fd4fd28932a
diff --git a/tests/TestWireless.py b/tests/TestWireless.py index <HASH>..<HASH> 100644 --- a/tests/TestWireless.py +++ b/tests/TestWireless.py @@ -2,7 +2,7 @@ import unittest from wireless import Wireless -from wireless import cmd +from wireless.Wireless import cmd class TestWireless(unittest.TestCase):
I should run my own tests before commiting. This one testing cmd passes now
joshvillbrandt_wireless
train
py
252d33deb5866d70c9aebefde18b87fc1d0acfd0
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -682,7 +682,6 @@ function Device(atemIpAddress){ this.on('InPr', function(d) { const sourceID = d.readUInt16BE(0); - const sourceInfo = lookupSourceID(sourceID); const longName = parseString(d.slice(2,22)); const shortName = parseString(d.slice(22, 26)); @@ -696,13 +695,12 @@ function Device(atemIpAddress){ * @event Device#sourceConfiguration * @property {SourceID} sourceID the identifier of the source * @property {SourceConfiguration} sourceConfiguration the new configuration of the source - * @property {Object} sourceInfo */ atem.emit('sourceConfiguration', sourceID, { name: longName, abbreviation: shortName, 'videoInterface': videoInterface - }, sourceInfo); + }); }); this.on('TlIn', function(d) { @@ -1015,5 +1013,6 @@ Command.prototype.serialize = function() { Device.ConnectionState = ConnectionState; +Device.getSourceInfo = lookupSourceID; module.exports = Device; \ No newline at end of file
make lookupSourceID public lookupSourceID can now be used via Device.getSourceInfo().
Dev1an_Atem
train
js
fbec22e0c54c2371606d86cbe9961045a40fdab2
diff --git a/tests/TestCase/ORM/QueryTest.php b/tests/TestCase/ORM/QueryTest.php index <HASH>..<HASH> 100644 --- a/tests/TestCase/ORM/QueryTest.php +++ b/tests/TestCase/ORM/QueryTest.php @@ -552,7 +552,10 @@ class QueryTest extends TestCase TableRegistry::get('ArticlesTags', [ 'table' => 'articles_tags' ]); - $table->belongsToMany('Tags', ['strategy' => $strategy]); + $table->belongsToMany('Tags', [ + 'strategy' => $strategy, + 'sort' => 'tag_id' + ]); $query = new Query($this->connection, $table); $results = $query->select()->contain('Tags')->hydrate(false)->toArray(); @@ -3112,6 +3115,7 @@ class QueryTest extends TestCase $results = $table->find() ->hydrate(false) ->notMatching('articles') + ->order(['authors.id']) ->toArray(); $expected = [ @@ -3125,6 +3129,7 @@ class QueryTest extends TestCase ->notMatching('articles', function ($q) { return $q->where(['articles.author_id' => 1]); }) + ->order(['authors.id']) ->toArray(); $expected = [ ['id' => 2, 'name' => 'nate'],
Fixed undefined dataset ordering in tests.
cakephp_cakephp
train
php
24b7a61f6505ea0e9313348c5b3361111bc557ae
diff --git a/Neos.Flow/Classes/Cli/ConsoleOutput.php b/Neos.Flow/Classes/Cli/ConsoleOutput.php index <HASH>..<HASH> 100644 --- a/Neos.Flow/Classes/Cli/ConsoleOutput.php +++ b/Neos.Flow/Classes/Cli/ConsoleOutput.php @@ -138,13 +138,17 @@ class ConsoleOutput * * @param array $rows * @param array $headers + * @param string $headerTitle */ - public function outputTable(array $rows, array $headers = null): void + public function outputTable(array $rows, array $headers = null, string $headerTitle = null): void { $table = $this->getTable(); if ($headers !== null) { $table->setHeaders($headers); } + if ($headerTitle !== null) { + $table->setHeaderTitle($headerTitle); + } $table->setRows($rows); $table->render(); }
TASK: Support header title for table output in console
neos_flow-development-collection
train
php
9764033d591219fabde7bce6278d120af732310c
diff --git a/bcbio/srna/umis.py b/bcbio/srna/umis.py index <HASH>..<HASH> 100644 --- a/bcbio/srna/umis.py +++ b/bcbio/srna/umis.py @@ -47,8 +47,8 @@ def umi_transform(data): return data else: logger.error("No UMI transform was specified, but %s does not look " - "pre-transformed." % fq1) - sys.exit(1) + "pre-transformed. Assuming non-umi data." % fq1) + return data if file_exists(transform): transform_file = transform
sRNA:skip if non-umi assigned.
bcbio_bcbio-nextgen
train
py
37dcc6d6e4b655191fa5f1578d3d1994657787b7
diff --git a/lib/wwtd.rb b/lib/wwtd.rb index <HASH>..<HASH> 100644 --- a/lib/wwtd.rb +++ b/lib/wwtd.rb @@ -119,10 +119,9 @@ module WWTD rvm = "rvm #{config["rvm"]} do " if config["rvm"] if wants_bundle - lock.flock(File::LOCK_EX) do - default_bundler_args = (File.exist?("#{gemfile || DEFAULT_GEMFILE}.lock") ? "--deployment" : "") - bundle_command = "#{rvm}bundle install #{config["bundler_args"] || default_bundler_args}" - return false unless sh "#{bundle_command.strip} --quiet" + flock(lock) do + bundle_command = "#{rvm}bundle install #{config["bundler_args"] || "--deployment"}" + return false unless sh "#{bundle_command.strip} --quiet --path vendor/bundle" end end @@ -134,6 +133,13 @@ module WWTD end end + def flock(file) + file.flock(File::LOCK_EX) + yield + ensure + file.flock(File::LOCK_UN) + end + # http://grosser.it/2010/12/11/sh-without-rake/ def sh(cmd) puts cmd
proper locking + lock files will always be there since we are local
grosser_wwtd
train
rb
3035f354f3cd1e3d28b9cebc0c130650a31ad1d0
diff --git a/src/ai/backend/common/etcd.py b/src/ai/backend/common/etcd.py index <HASH>..<HASH> 100644 --- a/src/ai/backend/common/etcd.py +++ b/src/ai/backend/common/etcd.py @@ -31,7 +31,11 @@ quote = functools.partial(_quote, safe='') def make_dict_from_pairs(key_prefix, pairs, path_sep='/'): result = {} len_prefix = len(key_prefix) - for k, v in pairs: + if isinstance(pairs, dict): + iterator = pairs.items() + else: + iterator = pairs + for k, v in iterator: if not k.startswith(key_prefix): continue subkey = k[len_prefix:]
Support dict as input in make_dict_from_pairs
lablup_backend.ai-common
train
py
ed39dd01e0f255f577e68f2bac2db39299bd4622
diff --git a/models/Model.php b/models/Model.php index <HASH>..<HASH> 100644 --- a/models/Model.php +++ b/models/Model.php @@ -362,7 +362,7 @@ class Model implements ArrayAccess, Iterator foreach($this->belongsTo as $belongsTo) { $description["belongs_to"][] = $belongsTo; - $fieldName = strtolower(Ntentan::singular($belongsTo)) . "_id"; + $fieldName = strtolower(Ntentan::singular($this->getBelongsTo($belongsTo))) . "_id"; foreach($description["fields"] as $i => $field) { if($field["name"] == $fieldName) @@ -391,6 +391,7 @@ class Model implements ArrayAccess, Iterator } $this->_description = $description; } + return $this->_description; }
Fixed an issue with the belongsTo relationships
ntentan_ntentan
train
php
2fab6e16233b28450ea6b9c8391938af8cbdeb7a
diff --git a/media/boom/js/boom.chunk.js b/media/boom/js/boom.chunk.js index <HASH>..<HASH> 100755 --- a/media/boom/js/boom.chunk.js +++ b/media/boom/js/boom.chunk.js @@ -683,7 +683,7 @@ $.widget('ui.chunkAsset', $.ui.chunk, { $.boom.loader.show(); - var data = ( link.url && link.url != '' ) ? { asset_id : rid, link : link.url } : { asset_id : rid }; + var data = { asset_id : rid, link : link.url } ; self._preview( data ) .done( function( data ){
bugfix – asset chunk broke the chunk controller
boomcms_boom-core
train
js
a82bf18d96b4936dd2de67a27b3b382525c2e7f9
diff --git a/check.go b/check.go index <HASH>..<HASH> 100644 --- a/check.go +++ b/check.go @@ -91,6 +91,9 @@ func (c Check) String() string { // Finish ends the check, prints its output (to stdout), and exits with // the correct status. func (c *Check) Finish() { + if r := recover(); r != nil { + c.Exitf(CRITICAL, "check panicked: %v", r) + } if len(c.results) == 0 { c.AddResult(UNKNOWN, "no check result specified") }
recover() in Check.Finish()
olorin_nagiosplugin
train
go
65171f1f6580828581427995e6ac8b5d11e6fe3d
diff --git a/src/main/java/net/fortuna/ical4j/model/TimeZoneLoader.java b/src/main/java/net/fortuna/ical4j/model/TimeZoneLoader.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/fortuna/ical4j/model/TimeZoneLoader.java +++ b/src/main/java/net/fortuna/ical4j/model/TimeZoneLoader.java @@ -30,7 +30,8 @@ public class TimeZoneLoader { private static final String TZ_CACHE_IMPL = "net.fortuna.ical4j.timezone.cache.impl"; - private static final String DEFAULT_TZ_CACHE_IMPL = "net.fortuna.ical4j.util.JCacheTimeZoneCache"; + // Use the Map-based TimeZoneCache by default + private static final String DEFAULT_TZ_CACHE_IMPL = "net.fortuna.ical4j.util.MapTimeZoneCache"; private static final String MESSAGE_MISSING_DEFAULT_TZ_CACHE_IMPL = "Error loading default cache implementation. Please ensure the JCache API dependency is included in the classpath, or override the cache implementation (e.g. via configuration: net.fortuna.ical4j.timezone.cache.impl=net.fortuna.ical4j.util.MapTimeZoneCache)";
Change default implementation of TimeZoneCache The Map-based TimeZoneCache-Implementation will be used by default now. Set SystemProperty net.fortuna.ical4j.timezone.cache.impl to "net.fortuna.ical4j.util.JCacheTimeZoneCache" and provide a JCache-Implentation in the classpath to use JCache.
ical4j_ical4j
train
java
01411669871a09f9c9555cb37002b874f24d30f9
diff --git a/fuse.py b/fuse.py index <HASH>..<HASH> 100644 --- a/fuse.py +++ b/fuse.py @@ -17,7 +17,6 @@ try: except: pass -from string import join import sys import os from errno import * @@ -317,7 +316,6 @@ class FuseOptParse(SubbedOptParse): def print_help(self, file=sys.stderr): SubbedOptParse.print_help(self, file) - print(file=file) self.fuse_args.setmod('showhelp') def print_version(self, file=sys.stderr):
Remove some <I> incompatibilities
libfuse_python-fuse
train
py
d39cf40ff9d03e2004255aea59824b5f368d4677
diff --git a/userena/contrib/umessages/views.py b/userena/contrib/umessages/views.py index <HASH>..<HASH> 100644 --- a/userena/contrib/umessages/views.py +++ b/userena/contrib/umessages/views.py @@ -47,6 +47,7 @@ class MessageDetailListView(ListView): def get_context_data(self, **kwargs): context = super(MessageDetailListView, self).get_context_data(**kwargs) context['recipient'] = self.recipient + return context def get_queryset(self): username = self.kwargs['username']
Fixed small but deadly bug in new class-based views.
bread-and-pepper_django-userena
train
py
3f3d0ad596546d3c994ccbffaca8c520f9feae4a
diff --git a/classes/PodsInit.php b/classes/PodsInit.php index <HASH>..<HASH> 100644 --- a/classes/PodsInit.php +++ b/classes/PodsInit.php @@ -275,13 +275,16 @@ class PodsInit { ); // WP needs something, if this was empty and none were enabled, it would show title+editor :( - $cpt_supports = array( '_bug_fix_for_wp' ); + $cpt_supports = array(); foreach ( $cpt_supported as $cpt_support => $supported ) { if ( true === $supported ) $cpt_supports[] = $cpt_support; } + if ( empty( $cpt_supports ) ) + $cpt_supports = false; + // Rewrite $cpt_rewrite = pods_var( 'rewrite', $post_type, true ); $cpt_rewrite_array = array(
Update Post Type 'supports' to support the new false check I patched in WP <I> :) <URL>
pods-framework_pods
train
php
29a73cbbe9e0d96cfe40782da81bee1be6559ec8
diff --git a/FlowCytometryTools/GUI/gui.py b/FlowCytometryTools/GUI/gui.py index <HASH>..<HASH> 100755 --- a/FlowCytometryTools/GUI/gui.py +++ b/FlowCytometryTools/GUI/gui.py @@ -99,8 +99,9 @@ class FCGUI(object): if filepath is not None and measurement is not None: raise ValueError('You can only specify either filepath or measurement, but not both.') - self.app = wx.PySimpleApp(0) - wx.InitAllImageHandlers() + #self.app = wx.PySimpleApp(0) + self.app = wx.App(False) + #wx.InitAllImageHandlers() self.main = GUIEmbedded(None, -1, "") self.app.SetTopWindow(self.main) if filepath is not None:
Removing deprecated wx calls
eyurtsev_FlowCytometryTools
train
py
a5c2d9063bc77fb73a4393f7aa8e83b368f9505d
diff --git a/Changelog.md b/Changelog.md index <HASH>..<HASH> 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,4 +1,7 @@ -## master +## 0.5.2 +- Fix bug with query logging + +## 0.5.1 - Fix whitespace around operators - Add `Relation#from` method to redefine series - Handle nil values for tags in #where clause diff --git a/lib/influxer/rails/client.rb b/lib/influxer/rails/client.rb index <HASH>..<HASH> 100644 --- a/lib/influxer/rails/client.rb +++ b/lib/influxer/rails/client.rb @@ -3,7 +3,7 @@ module Influxer # - Add cache support for queries class Client def query(sql, options = {}) - log(sql) do + log_sql(sql) do if !options.fetch(:cache, true) || Influxer.config.cache == false super(sql, options) else @@ -12,7 +12,7 @@ module Influxer end end - def log(sql) + def log_sql(sql) return yield unless logger.debug? start_ts = Time.now diff --git a/lib/influxer/version.rb b/lib/influxer/version.rb index <HASH>..<HASH> 100644 --- a/lib/influxer/version.rb +++ b/lib/influxer/version.rb @@ -1,3 +1,3 @@ module Influxer # :nodoc: - VERSION = "0.5.1".freeze + VERSION = "0.5.2".freeze end
Fix query logging (use separate log function); use Rails.logger as InfluxDB logger
palkan_influxer
train
md,rb,rb
24846c09c73ef72f5b2f760424d9c6e434eb0f44
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,8 @@ info = textwrap.dedent( """ ) -IS_PYTHON2 = sys.version_info < (3, 0) +if sys.version_info < (3, 4): + sys.exit("Shoebot requires python 3.4 or higher.") # the following libraries will not be installed EXCLUDE_LIBS = ["lib/sbopencv", "lib/sbopencv/blobs"] @@ -119,12 +120,8 @@ datafiles.extend( ] ) -if IS_PYTHON2: - PYCAIRO = "pycairo>=1.17.0" - PYGOBJECT = "pygobject>=3.32" -else: - PYCAIRO = "pycairo>=1.18.1" - PYGOBJECT = "pygobject>=3.32.1" +PYCAIRO = "pycairo>=1.18.1" +PYGOBJECT = "pygobject>=3.32.1" # Also requires one of 'vext.gi' or 'pgi' to run in GUI BASE_REQUIREMENTS = [ "setuptools>=18.8",
Update setup.py (#<I>) Remove python 2 support from setup.py. Specify python <I> so that pathlib can be used.
shoebot_shoebot
train
py
d0c54503fa2575ec37dd0224166eed8bdc1fb24f
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -100,6 +100,7 @@ html_theme = 'nature-mod' # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] +sys.path.append(os.path.abspath('_themes')) html_theme_path = ['_themes'] # The name for this set of Sphinx documents. If None, it defaults to
Add _themes to path.
FSX_misaka
train
py
576d186351ddcf34c46bcb4732858e72b598413e
diff --git a/ryu/tests/unit/ofproto/test_parser_v10.py b/ryu/tests/unit/ofproto/test_parser_v10.py index <HASH>..<HASH> 100644 --- a/ryu/tests/unit/ofproto/test_parser_v10.py +++ b/ryu/tests/unit/ofproto/test_parser_v10.py @@ -46,7 +46,7 @@ class TestOFPPhyPort(unittest.TestCase): buf = port_no['buf'] \ + addrconv.mac.text_to_bin(hw_addr) \ - + str.encode(name, 'ascii') \ + + name \ + config['buf'] \ + state['buf'] \ + curr['buf'] \ @@ -2304,7 +2304,7 @@ class TestOFPTableStats(unittest.TestCase): buf = table_id['buf'] \ + zfill \ - + str.encode(name, 'ascii') \ + + name \ + wildcards['buf'] \ + max_entries['buf'] \ + active_count['buf'] \
python3: Don't use str.encode This commit partially reverts b<I>fedc<I>cb0c9c3fe<I>fc2d2f<I>b7fc<I>f8. This kind of change complicates assertion checks below.
osrg_ryu
train
py
3346ab459ebf64f33b1d0775719a70ebf91eef95
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/strategy/LazyFromSourcesSchedulingStrategy.java b/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/strategy/LazyFromSourcesSchedulingStrategy.java index <HASH>..<HASH> 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/strategy/LazyFromSourcesSchedulingStrategy.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/strategy/LazyFromSourcesSchedulingStrategy.java @@ -102,6 +102,7 @@ public class LazyFromSourcesSchedulingStrategy implements SchedulingStrategy { final Set<SchedulingExecutionVertex> verticesToSchedule = schedulingTopology.getVertexOrThrow(executionVertexId) .getProducedResultPartitions() .stream() + .filter(partition -> partition.getPartitionType().isBlocking()) .flatMap(partition -> inputConstraintChecker.markSchedulingResultPartitionFinished(partition).stream()) .flatMap(partition -> partition.getConsumers().stream()) .collect(Collectors.toSet());
[hotfix][runtime] Pipelined partition consumers should not be scheduled in LazyFromSourcesSchedulingStrategy#onExecutionStateChange The pipelined partition consumers should be already scheduled in LazyFromSourcesSchedulingStrategy#onPartitionConsumable.
apache_flink
train
java
aede1533101509684230ce04d301dbd9bb1cf383
diff --git a/cmd/kubeadm/app/cmd/phases/upgrade/node/controlplane.go b/cmd/kubeadm/app/cmd/phases/upgrade/node/controlplane.go index <HASH>..<HASH> 100644 --- a/cmd/kubeadm/app/cmd/phases/upgrade/node/controlplane.go +++ b/cmd/kubeadm/app/cmd/phases/upgrade/node/controlplane.go @@ -52,6 +52,7 @@ func runControlPlane() func(c workflow.RunData) error { // if this is not a control-plande node, this phase should not be executed if !data.IsControlPlaneNode() { fmt.Printf("[upgrade] Skipping phase. Not a control plane node") + return nil } // otherwise, retrieve all the info required for control plane upgrade
kubeadm: fix conditional control-plane upgrade When a node is not a control-plane properly skip "control-plane" upgrade phase.
kubernetes_kubernetes
train
go
108cfc21570c2ad394cc397d9e766f743f6e2c03
diff --git a/test/median_test.rb b/test/median_test.rb index <HASH>..<HASH> 100644 --- a/test/median_test.rb +++ b/test/median_test.rb @@ -55,6 +55,24 @@ class MedianTest < Minitest::Test assert_equal expected, User.group(:name).group(:visits_count).median(:rating) end + def test_order + skip if mongoid? + + User.create!(visits_count: 2) + assert 2, User.order(:created_at).average(:visits_count) + # assert 2, User.order(:created_at).median(:visits_count) + end + + def test_group_order + skip if mongoid? + + [1, 2, 3, 4, 5, 6].each { |n| User.create!(visits_count: n, name: n < 4 ? "A" : "B") } + assert_equal "A", User.group(:name).order(:name).average(:visits_count).keys.first + assert_equal "B", User.group(:name).order("average_visits_count desc").average(:visits_count).keys.first + # assert_equal "A", User.group(:name).order(:name).median(:visits_count).keys.first + # assert_equal "B", User.group(:name).order("median_visits_count desc").median(:visits_count).keys.first + end + def test_expression skip if mongoid?
Added order tests - #<I>
ankane_active_median
train
rb
a92066456b3b16f430675430236df58218c5f04f
diff --git a/plugins/init/Backdrop.civi-setup.php b/plugins/init/Backdrop.civi-setup.php index <HASH>..<HASH> 100644 --- a/plugins/init/Backdrop.civi-setup.php +++ b/plugins/init/Backdrop.civi-setup.php @@ -33,7 +33,7 @@ if (!defined('CIVI_SETUP')) { $cmsPath = $object->cmsRootPath(); // Compute settingsPath. - $model->settingsPath = $cmsPath . DIRECTORY_SEPARATOR . 'civicrm.settings.php'; + $model->settingsPath = $cmsPath . DIRECTORY_SEPARATOR . 'civicrm.settings.php'; $model->templateCompilePath = 'FIXME';
(NFC) Update to current style guidelines (plugins/init/Backdrop.civi-setup.php)
civicrm_civicrm-setup
train
php
1d4a880e0455854e748527c2194efe2576debd28
diff --git a/src/surface.js b/src/surface.js index <HASH>..<HASH> 100644 --- a/src/surface.js +++ b/src/surface.js @@ -112,6 +112,10 @@ Surface.Prototype = function() { return [pos, charPos]; }; + this.getCoordinateForPosition = function(range) { + return _mapDOMCoordinates.call(this, range.startContainer, range.startOffset); + }; + // Read out current DOM selection and update selection in the model // --------------- @@ -208,11 +212,21 @@ Surface.Prototype = function() { var _mapModelCoordinates = function(pos) { var container = this.docCtrl.container; var component = container.getComponent(pos[0]); + return this.getPositionFromComponent(component, offset); + }; + + this.getPositionFromCoordinate = function(path, offset) { + var container = this.docCtrl.container; + var component = container.lookup(path); + return this.getPositionFromComponent(component, offset); + }; + + this.getPositionFromComponent = function(component, offset) { // TODO rethink when it is a good time to attach the view to the node surface if (!component.surface.hasView()) { this._attachViewToNodeSurface(component); } - var wCoor = component.surface.getDOMPosition(pos[1]); + var wCoor = component.surface.getDOMPosition(offset); return wCoor; };
Added some helpers to map between screen coordinates to model coordinates.
substance_surface
train
js
a29249da0973a1f6a6d62afa738754d776e57659
diff --git a/Controller/SOAPController.php b/Controller/SOAPController.php index <HASH>..<HASH> 100644 --- a/Controller/SOAPController.php +++ b/Controller/SOAPController.php @@ -9,13 +9,6 @@ use Symfony\Component\HttpFoundation\Request; use Splash\Server\SplashServer; use Splash\Client\Splash; - - -use Doctrine\Common\Annotations\AnnotationReader; -use Splash\Bundle\Conversion\SplashFieldConverter; -//use Acme\DataBundle\Entity\Person; - - class SOAPController extends Controller { @@ -41,7 +34,7 @@ class SOAPController extends Controller { //====================================================================// // Detect NuSOAP requests send by Splash Server - if ( strpos( $request->headers->get('User-Agent') , "NuSOAP" ) === FALSE ) + if ( strpos( $request->headers->get('User-Agent') , "SOAP" ) === FALSE ) { //====================================================================// // Return Empty Response
Allow both SOAP & NuSOAP requests
SplashSync_Php-Bundle
train
php
97db7126003c9ed4e573c8ba503dad4e68cce20f
diff --git a/src/sap.m/src/sap/m/ObjectHeaderRenderer.js b/src/sap.m/src/sap/m/ObjectHeaderRenderer.js index <HASH>..<HASH> 100644 --- a/src/sap.m/src/sap/m/ObjectHeaderRenderer.js +++ b/src/sap.m/src/sap/m/ObjectHeaderRenderer.js @@ -1260,6 +1260,8 @@ sap.ui.define(['jquery.sap.global', 'sap/ui/core/IconPool'], oRM.write("<span"); // Start TitleArrow container oRM.writeAttribute("id", oOH.getId() + "-title-arrow"); + oRM.addStyle("display", "inline-block"); + oRM.writeStyles(); oRM.write(">"); this._renderResponsiveTitleAndArrow(oRM, oOH, nCutLen); oRM.write("</span>");
[FIX] sap.m.ObjectHeader: Title / arrow span focused correctly - the span should have a height/width to be focused correctly otherwise The element and all of its children are handled as "hidden" if the dimensions are <= 0. BCP: <I> Change-Id: I<I>ee<I>cb<I>c3d<I>dd<I>f<I>
SAP_openui5
train
js
7cb7b7b4ffa3bcd9907376c080e0c2696cea4c19
diff --git a/internal/graphics/command.go b/internal/graphics/command.go index <HASH>..<HASH> 100644 --- a/internal/graphics/command.go +++ b/internal/graphics/command.go @@ -211,6 +211,9 @@ func (c *fillCommand) Exec(indexOffsetInBytes int) error { // Flush is needed after filling (#419) opengl.GetContext().Flush() + // Mysterious, but binding texture is needed after filling + // on some mechines like Photon 2 (#492). + opengl.GetContext().BindTexture(c.dst.texture.native) return nil }
graphics: Bug fix: TestImageTooManyFill didin't pass on some machines Fixes #<I>
hajimehoshi_ebiten
train
go
3204c8b96d7f6ffacf1a64eaa71aa2354ca5e34a
diff --git a/byteplay3.py b/byteplay3.py index <HASH>..<HASH> 100644 --- a/byteplay3.py +++ b/byteplay3.py @@ -474,16 +474,14 @@ class Label(object): pass # This boolean function allows distinguishing real opcodes in a CodeList from -# the two non-opcode types. Note this assumes there only ever exists the one -# instance of SetLineno, although there may be multiple Label objects. -# -# TODO: would this not be safer using "not isinstance(obj,SetLinenoType)"? +# the two non-opcode types. Note there should only ever exist the one +# instance of SetLinenoType, the global SetLineno. But who knows? def isopcode(obj): """ Return whether obj is an opcode - not SetLineno or Label """ - return obj is not SetLineno and not isinstance(obj, Label) + return not isinstance(obj,SetLinenoType) and not isinstance(obj, Label) #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- #
Defensive programming in the isopcode() test
tallforasmurf_byteplay
train
py
0630cb1859e44b65893fdb3ef9c8002a784e2e7a
diff --git a/Bundle/MediaBundle/Entity/Folder.php b/Bundle/MediaBundle/Entity/Folder.php index <HASH>..<HASH> 100755 --- a/Bundle/MediaBundle/Entity/Folder.php +++ b/Bundle/MediaBundle/Entity/Folder.php @@ -2,7 +2,6 @@ namespace Victoire\Bundle\MediaBundle\Entity; - use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; use Gedmo\Mapping\Annotation as Gedmo; @@ -45,8 +44,8 @@ class Folder /** * @var Folder * - * @ORM\ManyToOne(targetEntity="Folder", inversedBy="children", fetch="EAGER") - * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", nullable=true) + * @ORM\ManyToOne(targetEntity="Folder", inversedBy="children", fetch="EAGER", cascade={"persist", "remove"}) + * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", nullable=true, onDelete="SET NULL") */ protected $parent;
[MediaBundle] Cascade persist/remove on folders
Victoire_victoire
train
php
20aab39374c4be430aba2b76af447b13c27a4eb3
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -10,7 +10,7 @@ require "net/https" require "uri" ## Uncomment to load in a .yml with your pin key -# ENV.update YAML.load(File.read(File.expand_path("../test_data.yml", __FILE__))) +ENV.update YAML.load(File.read(File.expand_path("../test_data.yml", __FILE__))) # gem require 'pin_up'
removed a vcr .yml
dNitza_pin_up
train
rb
45ed222b308255a91b4bb4929c41a23813616152
diff --git a/pytablereader/interface.py b/pytablereader/interface.py index <HASH>..<HASH> 100644 --- a/pytablereader/interface.py +++ b/pytablereader/interface.py @@ -62,10 +62,14 @@ class TableLoader(TableLoaderInterface): def source_type(self): return self._validator.source_type + @property + def quoting_flags(self): + return self.__quoting_flags + def __init__(self, source): self.table_name = tnt.DEFAULT self.source = source - self.quoting_flags = None + self.__quoting_flags = None self._validator = None self._logger = None
Change an attribute to a read-only property
thombashi_pytablereader
train
py
babfc4121d8a245618565d60d2adae673f803403
diff --git a/src/helpers.php b/src/helpers.php index <HASH>..<HASH> 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -429,8 +429,8 @@ CODE; } throw new \RuntimeException(\sprintf( - 'Cannot build argument constructor for %s, give a scalar type hint or a deriving like Enum, FromString, Uuid, FromScalar, FromArray', - $namespace !== '' ? $namespace . '\\' . $name : $name + 'First argument of %s will be used as an aggregateId. It should give a scalar type hint or a deriving like Enum, FromString, Uuid, FromScalar', + $definition->name() )); }
Changed text of error message to make it more clear that the argument is being used as an aggregateId.
prolic_fpp
train
php
1eebb9a5a10fabf3dd54c8b32a42576f6f0195dd
diff --git a/lib/html5lib/TreeBuilder.php b/lib/html5lib/TreeBuilder.php index <HASH>..<HASH> 100644 --- a/lib/html5lib/TreeBuilder.php +++ b/lib/html5lib/TreeBuilder.php @@ -2322,7 +2322,7 @@ class HTML5_TreeBuilder { } elseif ($token['type'] === HTML5_Tokenizer::COMMENT) { /* Append a Comment node to the current node with the data attribute set to the data given in the comment token. */ - $this->insertToken($token['data']); + $this->insertComment($token['data']); } elseif ($token['type'] === HTML5_Tokenizer::DOCTYPE) { // parse error } elseif ($token['type'] === HTML5_Tokenizer::STARTTAG && $token['name'] === 'html') {
#<I> | Fixed a bug of using undefined method insertToken Untested fix. But definitely a bug and the most likely correct method insertComment is used on a similar code block.
dompdf_dompdf
train
php
bf97bf5e2eb97c4f4a37817e2953df66a8a52367
diff --git a/lib/activerecord-multi-tenant/multi_tenant.rb b/lib/activerecord-multi-tenant/multi_tenant.rb index <HASH>..<HASH> 100644 --- a/lib/activerecord-multi-tenant/multi_tenant.rb +++ b/lib/activerecord-multi-tenant/multi_tenant.rb @@ -29,6 +29,7 @@ module MultiTenant @@multi_tenant_models[table_name.to_s] = model_klass end def self.multi_tenant_model_for_table(table_name) + @@multi_tenant_models ||= {} @@multi_tenant_models[table_name.to_s] end
Add init of @@multi_tenant_models This prevents raising an error if the first model referenced after application boot is not distributed.
citusdata_activerecord-multi-tenant
train
rb
78eb3016e54a230ba489ee73e37dbc73cd56bd56
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -2,12 +2,18 @@ import React, {PropTypes as T} from 'react'; import { soundManager } from 'soundmanager2'; const pendingCalls = []; +let initialized = false; function createSound(options, cb) { if (soundManager.ok()) { cb(soundManager.createSound(options)); return () => {}; } else { + if (!initialized) { + initialized = true; + soundManager.beginDelayedInit(); + } + const call = () => { cb(soundManager.createSound(options)); };
Initialize SoundManager when it’s lazy loaded
leoasis_react-sound
train
js
5fbf0d7f820c39f9ac210ef624647236b22a9cf7
diff --git a/flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/factories/TestValuesRuntimeFunctions.java b/flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/factories/TestValuesRuntimeFunctions.java index <HASH>..<HASH> 100644 --- a/flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/factories/TestValuesRuntimeFunctions.java +++ b/flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/factories/TestValuesRuntimeFunctions.java @@ -95,7 +95,13 @@ final class TestValuesRuntimeFunctions { } static List<Watermark> getWatermarks(String tableName) { - return watermarkHistory.getOrDefault(tableName, new ArrayList<>()); + synchronized (TestValuesTableFactory.class) { + if (watermarkHistory.containsKey(tableName)) { + return new ArrayList<>(watermarkHistory.get(tableName)); + } else { + return Collections.emptyList(); + } + } } static List<String> getResults(String tableName) { @@ -122,6 +128,7 @@ final class TestValuesRuntimeFunctions { globalRawResult.clear(); globalUpsertResult.clear(); globalRetractResult.clear(); + watermarkHistory.clear(); } }
[FLINK-<I>][table-planner] Clear watermark output when test finished for FromElementSourceFunctionWithWatermark This closes #<I>
apache_flink
train
java
1a461476effe82c93c9e16d3dd49ac666707d986
diff --git a/lib/fluent/supervisor.rb b/lib/fluent/supervisor.rb index <HASH>..<HASH> 100644 --- a/lib/fluent/supervisor.rb +++ b/lib/fluent/supervisor.rb @@ -321,6 +321,18 @@ module Fluent def supervisor_sigcont_handler if Fluent.windows? $log.info "dump file. [pid:#{Process.pid}]" + + # Sigdump outputs under `/tmp` dir without `SIGDUMP_PATH` specified + # but `/tmp` dir may not exist on Windows by default. + # Since this function is mainly for Windows, this case should be saved. + # (Don't want to couple tightly with the Sigdump library but want to save this case especially.) + unless ENV['SIGDUMP_PATH'] + dump_dir = '/tmp' + unless Dir.exist?(dump_dir) + FileUtils.mkdir_p(dump_dir, mode: Fluent::DEFAULT_DIR_PERMISSION) + end + end + require 'sigdump' Sigdump.dump else
Support the case where `/tmp` dir doesn't exist on Windows
fluent_fluentd
train
rb
f4eec6479fbb5a1bc03bbcfdddd4e9c688571391
diff --git a/src/DataSource/Database.php b/src/DataSource/Database.php index <HASH>..<HASH> 100644 --- a/src/DataSource/Database.php +++ b/src/DataSource/Database.php @@ -170,5 +170,29 @@ class Database extends \PDO // Since this function is only to return one row, only return the first row return $prepQuery->fetch(); } + + /** + * fetchClass() + * Returns an object of the specified type, created from the database + * + * @author Cory Gehr + * @access public + * @param string $query MySQL Query String + * @param mixed[] $data Parameters for the query + * @param string $class Class Name + * @return mixed Created object + */ + public function fetchClass($query, $data, $class) + { + // Prepare the query + $prepQuery = parent::prepare($query); + // Change the fetch mode to FETCH_CLASS + $prepQuery->setFetchMode(PDO::FETCH_CLASS, $class); + // Now execute + $prepQuery->execute($data); + + // Return the created class + return $prepQuery->fetch(); + } } ?>
Add fetchClass() Adds a function that will use a query to create an object based on the specified class
corygehr_corygehr-thinker-lib
train
php
0b60693f35922c273eb086ff2c0a2b08a6af3118
diff --git a/org.jenetics/src/main/java/org/jenetics/util/accumulators.java b/org.jenetics/src/main/java/org/jenetics/util/accumulators.java index <HASH>..<HASH> 100644 --- a/org.jenetics/src/main/java/org/jenetics/util/accumulators.java +++ b/org.jenetics/src/main/java/org/jenetics/util/accumulators.java @@ -39,12 +39,6 @@ import org.jscience.mathematics.structure.GroupAdditive; public final class accumulators extends StaticObject { private accumulators() {} - public static final Accumulator<Object> NULL = new Accumulator<Object>() { - @Override - public void accumulate(final Object value) { - } - }; - /** * Calculates the sum of the accumulated values. *
Remove unused 'NULL' instance.
jenetics_jenetics
train
java
44899372c044e83228eb88804fac22d2cba0ec7f
diff --git a/pysat/_instrument.py b/pysat/_instrument.py index <HASH>..<HASH> 100644 --- a/pysat/_instrument.py +++ b/pysat/_instrument.py @@ -1122,9 +1122,9 @@ class Instrument(object): if self._iter_type == 'date': if self.date is not None: idx, = np.where(self._iter_list == self.date) - if len(idx) == 0: - raise StopIteration('Outside the set date boundaries.') - if idx[-1]+1 >= len(self._iter_list): + if (len(idx) == 0): + raise StopIteration('File list is empty. Nothing to be done.') + elif idx[-1]+1 >= len(self._iter_list): raise StopIteration('Outside the set date boundaries.') else: idx += 1 @@ -1161,7 +1161,7 @@ class Instrument(object): if self.date is not None: idx, = np.where(self._iter_list == self.date) if len(idx) == 0: - raise StopIteration('Outside the set date boundaries.') + raise StopIteration('File list is empty. Nothing to be done.') elif idx[0] == 0: raise StopIteration('Outside the set date boundaries.') else:
Updated error feedback when iterating by file and the available file list is empty.
rstoneback_pysat
train
py
7e09155b31e74e4a40b8131422202772a7b0f31f
diff --git a/salt/output/highstate.py b/salt/output/highstate.py index <HASH>..<HASH> 100644 --- a/salt/output/highstate.py +++ b/salt/output/highstate.py @@ -198,9 +198,7 @@ def _format_host(host, data): state_lines.insert( 3, u' {tcolor} Name: {comps[2]}{colors[ENDC]}') try: - comment = ret['comment'].strip().replace( - u'\n', - u'\n' + u' ' * 14) + stripped_comment = ret['comment'].strip() except AttributeError: # Assume comment is a list try: comment = ret['comment'].join(' ').replace( @@ -212,6 +210,16 @@ def _format_host(host, data): comment = comment.strip().replace( u'\n', u'\n' + u' ' * 14) + else: + try: + comment = stripped_comment.replace( + u'\n', + u'\n' + u' ' * 14) + except UnicodeDecodeError: + comment = stripped_comment.replace( + '\n', + '\n' + ' ' * 14) + comment = comment.decode('UTF-8') for detail in ['start_time', 'duration']: ret.setdefault(detail, u'') if ret['duration'] != '':
Handle unicode in highstate outputter Refs #<I>
saltstack_salt
train
py
b8d173789b772c6a443c69376967f027c3bed916
diff --git a/lib/Schema.js b/lib/Schema.js index <HASH>..<HASH> 100644 --- a/lib/Schema.js +++ b/lib/Schema.js @@ -219,7 +219,7 @@ Schema.prototype.parseDynamo = async function (model, dynamoObj) { attrVal = await attr.parseDynamo(dynamoObj[name]); } if (attrVal !== undefined && attrVal !== null) { - model[name] = attrVal; + model[attr.name] = attrVal; } } else { debug('parseDynamo: received an attribute name (%s) that is not defined in the schema', name);
feat(schema): change the way attributes are set by parseDynamo function This does not change parseDynamo result <I>% of the time, because `name` and `attr.name` are usually identical, but makes it possible to manually add hidden attributes to a schema by calling Attribute.create() with `name` set to Symbol(), which can be useful to plugin authors.
dynamoosejs_dynamoose
train
js
0e5f11fedf66a38ed2786282a78ed511470f50e1
diff --git a/js/jasmine.js b/js/jasmine.js index <HASH>..<HASH> 100644 --- a/js/jasmine.js +++ b/js/jasmine.js @@ -12,7 +12,7 @@ jasmineStarted: function(suiteInfo) { }, suiteStarted: function(result) { -# suite object initialization +// suite object initialization this.suite_info[this.suite_count] = result; this.suite_info[this.suite_count]["started"] = new Date().toUTCString(); this.suite_count++; @@ -124,4 +124,4 @@ function status(current_status, status){ function remove(suite, position){ suite.splice(position, 1); return suite; -} \ No newline at end of file +}
Replaced ruby comment with jasmine
bbc_res
train
js
a3e0ed0d8744ac97f05cd4d7d1e492730e6e4b72
diff --git a/main.go b/main.go index <HASH>..<HASH> 100644 --- a/main.go +++ b/main.go @@ -271,6 +271,10 @@ func run() error { // Merge sharded artifacts. for env, mergeProgram := range shardableArtifacts { + if len(filesToMerge[env]) == 0 { + fmt.Printf("stress: skipping merge for artifact %s\n", env) + continue + } output, err := os.Create(os.Getenv(env)) if err != nil { return err
stress: skip merging when there are no artifacts to merge If no tests successfully complete then there will be nothing to merge and just calling into the merge program may therefore fail. In this case it's appropriate to skip the merge.
cockroachdb_stress
train
go
8b528337613e0f9d3498185479ab5c8cfbf335ba
diff --git a/lib/spreedly.rb b/lib/spreedly.rb index <HASH>..<HASH> 100644 --- a/lib/spreedly.rb +++ b/lib/spreedly.rb @@ -156,10 +156,10 @@ module Spreedly end # Activates a free trial on the subscriber. - # Requires subscription_id of the free trial plan - def activate_free_trial(subscription_id) + # Requires plan_id of the free trial plan + def activate_free_trial(plan_id) result = Spreedly.post("/subscribers/#{id}/subscribe_to_free_trial.xml", :body => - Spreedly.to_xml_params(:subscription_plan => {:id => subscription_id})) + Spreedly.to_xml_params(:subscription_plan => {:id => plan_id})) case result.code when /2../ when '404'
Change subscription_id to plan_id to match mock's usage. The plan_id makes is clearer than my subscription_id. Thanks Nathaniel.
spreedly_spreedly-gem
train
rb
9c294c3371f60e9beadd458a6d2807c0aec8ffa2
diff --git a/src/postmate.js b/src/postmate.js index <HASH>..<HASH> 100644 --- a/src/postmate.js +++ b/src/postmate.js @@ -297,6 +297,10 @@ class Postmate { this.parent.addEventListener('message', reply, false) const doSend = () => { + if (attempt === maxHandshakeRequests) { + clearInterval(responseInterval) + return + } attempt++ if (process.env.NODE_ENV !== 'production') { log(`Parent: Sending handshake attempt ${attempt}`, { childOrigin }) @@ -306,10 +310,6 @@ class Postmate { type: messsageType, model: this.model, }, childOrigin) - - if (attempt === maxHandshakeRequests) { - clearInterval(responseInterval) - } } const loaded = () => {
fix the issue where the max attempt is ignored because of postMessage exception (#<I>)
dollarshaveclub_postmate
train
js
4481ded3cf5cc5c3b55e9e72937e536276c44293
diff --git a/src/Lucid/Model/index.js b/src/Lucid/Model/index.js index <HASH>..<HASH> 100644 --- a/src/Lucid/Model/index.js +++ b/src/Lucid/Model/index.js @@ -1049,14 +1049,17 @@ class Model extends BaseModel { } /** - * Returns an array of ids. - * - * Note: this method doesn't allow eagerloading relations + * Returns an object of key/value pairs. + * This method will not eagerload relationships. + * The lhs field is the object key, and rhs is the value. * - * @method ids + * @method pair * @async * - * @return {Array} + * @param {String} lhs + * @param {String} rhs + * + * @return {Object} */ static pair (lhs, rhs) { return this.query().pair(lhs, rhs)
doc(docblock): update docblock
adonisjs_adonis-lucid
train
js
c3311744c52e040ca2e3d98107df827e0fda80bd
diff --git a/contrib/mesos/pkg/scheduler/plugin.go b/contrib/mesos/pkg/scheduler/plugin.go index <HASH>..<HASH> 100644 --- a/contrib/mesos/pkg/scheduler/plugin.go +++ b/contrib/mesos/pkg/scheduler/plugin.go @@ -306,7 +306,8 @@ func (k *kubeScheduler) Schedule(pod *api.Pod, unused algorithm.NodeLister) (str } } -// Call ScheduleFunc and subtract some resources, returning the name of the machine the task is scheduled on +// doSchedule schedules the given task and returns the machine the task is scheduled on +// or an error if the scheduling failed. func (k *kubeScheduler) doSchedule(task *podtask.T) (string, error) { var offer offers.Perishable var err error
scheduler: correct doc in doSchedule
kubernetes_kubernetes
train
go
0b589605c87f78f139653b7a783cbcdf84cfca47
diff --git a/openpnm/utils/_workspace.py b/openpnm/utils/_workspace.py index <HASH>..<HASH> 100644 --- a/openpnm/utils/_workspace.py +++ b/openpnm/utils/_workspace.py @@ -43,12 +43,10 @@ class WorkspaceSettings(SettingsAttr): @property def loglevel(self): - logger = logging.getLogger() return logger.level @loglevel.setter def loglevel(self, value): - logger = logging.getLogger() logger.setLevel(value)
prevent getting logger from root level This call was getting the logger from the root level and overwriting the app settings for logging level. I was having trouble in mak issue #<I>
PMEAL_OpenPNM
train
py
0e3f0eabe4ab727e52c7cf7ce52142de90d75d87
diff --git a/test/transports.htmlfile.test.js b/test/transports.htmlfile.test.js index <HASH>..<HASH> 100644 --- a/test/transports.htmlfile.test.js +++ b/test/transports.htmlfile.test.js @@ -146,7 +146,7 @@ module.exports = { var port = ++ports , cl = client(port) , io = create(cl) - , beat = false; + , heartbeats = 0; io.configure(function () { io.set('heartbeat interval', .05); @@ -156,7 +156,7 @@ module.exports = { io.sockets.on('connection', function (socket) { socket.on('disconnect', function (reason) { - beat.should.be.true; + heartbeats.should.eql(2); reason.should.eql('heartbeat timeout'); cl.end(); @@ -166,8 +166,6 @@ module.exports = { }); cl.handshake(function (sid) { - var heartbeats = 0; - cl.data('/socket.io/{protocol}/htmlfile/' + sid, function (msgs) { heartbeats++; @@ -176,10 +174,6 @@ module.exports = { type: 'heartbeat' })); } - - if (heartbeats == 2) { - beat = true; - } }); }); }
Simplified heartbeat htmlfile test, made consistent with websocket one.
socketio_socket.io
train
js
22ec6c3370d156295bc3069ab78cf7008d4ca7df
diff --git a/osuapi/enums.py b/osuapi/enums.py index <HASH>..<HASH> 100644 --- a/osuapi/enums.py +++ b/osuapi/enums.py @@ -149,6 +149,10 @@ class BeatmapGenre(Enum): novelty = 7 hip_hop = 9 electronic = 10 + metal = 11 + classical = 12 + folk = 13 + jazz = 14 class BeatmapLanguage(Enum):
Add various new song genre enums
khazhyk_osuapi
train
py
dd1bd8f3bcf3ae86cb95b8548678aed1638f3311
diff --git a/container.go b/container.go index <HASH>..<HASH> 100644 --- a/container.go +++ b/container.go @@ -161,6 +161,10 @@ func OpenContainer(id string) (Container, error) { container.handle = handle + if err := container.registerCallback(); err != nil { + return nil, makeContainerError(container, operation, "", err) + } + logrus.Debugf(title+" succeeded id=%s handle=%d", id, handle) runtime.SetFinalizer(container, closeContainer) return container, nil
Add a callback registration when opening a container
Microsoft_hcsshim
train
go