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
7360abb0fe7c2194817572766028bfa812f8b810
diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Model/Datasource/DboSource.php +++ b/lib/Cake/Model/Datasource/DboSource.php @@ -2917,6 +2917,10 @@ class DboSource extends DataSource { } $statement->execute(); $statement->closeCursor(); + + if ($this->fullDebug) { + $this->logQuery($sql, $value); + } } return $this->commit(); }
Added query logging to DboSource::insertMulti(). Closes #<I>
cakephp_cakephp
train
php
2fbf26340fc9dcc537da7ec3aa89daac8875caca
diff --git a/autoit/win.py b/autoit/win.py index <HASH>..<HASH> 100644 --- a/autoit/win.py +++ b/autoit/win.py @@ -381,7 +381,7 @@ def win_menu_select_item(title, *items, **kwargs): if not (0 < len(items) < 8): raise ValueError("accepted none item or number of items exceed eight") f_items = [LPCWSTR(item) for item in items] - for i in xrange(8 - len(f_items)): + for i in range(8 - len(f_items)): f_items.append(LPCWSTR("")) ret = AUTO_IT.AU3_WinMenuSelectItem(LPCWSTR(title), LPCWSTR(text), @@ -400,7 +400,7 @@ def win_menu_select_item_by_handle(handle, *items): if not (0 < len(items) < 8): raise ValueError("accepted none item or number of items exceed eight") f_items = [LPCWSTR(item) for item in items] - for i in xrange(8 - len(f_items)): + for i in range(8 - len(f_items)): f_items.append(LPCWSTR("")) ret = AUTO_IT.AU3_WinMenuSelectItemByHandle(HWND(handle), *f_items)
change use of xrange to range to be python3 compatible
jacexh_pyautoit
train
py
baa1abad2a6fb2858fe41f22a0eef8f4f9617870
diff --git a/padatious/__init__.py b/padatious/__init__.py index <HASH>..<HASH> 100644 --- a/padatious/__init__.py +++ b/padatious/__init__.py @@ -15,4 +15,4 @@ from .intent_container import IntentContainer from .match_data import MatchData -__version__ = '0.4.3' # Also change in setup.py +__version__ = '0.4.4' # Also change in setup.py diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open(join(dirname(abspath(__file__)), 'requirements.txt')) as f: setup( name='padatious', - version='0.4.3', # Also change in padatious/__init__.py + version='0.4.4', # Also change in padatious/__init__.py description='A neural network intent parser', url='http://github.com/MycroftAI/padatious', author='Matthew Scholefield',
Increment version to <I>
MycroftAI_padatious
train
py,py
d23d4413ac6a89880812e679e78e1a352f4d4f96
diff --git a/src/main/java/gwt/material/design/addins/client/masonry/MaterialMasonry.java b/src/main/java/gwt/material/design/addins/client/masonry/MaterialMasonry.java index <HASH>..<HASH> 100644 --- a/src/main/java/gwt/material/design/addins/client/masonry/MaterialMasonry.java +++ b/src/main/java/gwt/material/design/addins/client/masonry/MaterialMasonry.java @@ -55,7 +55,7 @@ import gwt.material.design.client.ui.MaterialRow; * @author kevzlou7979 */ //@formatter:on -public class MaterialMasonry extends MaterialWidget { +public class MaterialMasonry extends MaterialRow { static { if(MaterialAddins.isDebug()) {
Use MaterialRow for MaterialMasonry.
GwtMaterialDesign_gwt-material-addins
train
java
ecd29943d9e1cc85051062bbf2a3ebdd7bb5b052
diff --git a/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java b/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java index <HASH>..<HASH> 100644 --- a/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java +++ b/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java @@ -1680,7 +1680,8 @@ public abstract class PreferenceActivity extends AppCompatActivity @Override public final void onNavigationAdapterCreated() { - if (isSplitScreen() && navigationFragment.getNavigationPreferenceCount() > 0) { + if (navigationFragment.getNavigationPreferenceCount() > 0 && + (isSplitScreen() || isButtonBarShown())) { navigationFragment.selectNavigationPreference(0, null); } }
The first navigation preference is now selected by default, when using the activity as a wizard.
michael-rapp_AndroidPreferenceActivity
train
java
4298168905b73538a25a3d2b80391595a90e0e1c
diff --git a/lib/specinfra/version.rb b/lib/specinfra/version.rb index <HASH>..<HASH> 100644 --- a/lib/specinfra/version.rb +++ b/lib/specinfra/version.rb @@ -1,3 +1,3 @@ module Specinfra - VERSION = "2.57.0" + VERSION = "2.57.1" end
Bump up version [skip ci]
mizzy_specinfra
train
rb
f6ddbbc0eda3c8de3e60448ba5ea75441ee8a4de
diff --git a/redis/client.py b/redis/client.py index <HASH>..<HASH> 100644 --- a/redis/client.py +++ b/redis/client.py @@ -1670,8 +1670,8 @@ class Redis(StrictRedis): RESPONSE_CALLBACKS = dict_merge( StrictRedis.RESPONSE_CALLBACKS, { - 'TTL': lambda r: r != -1 and r or None, - 'PTTL': lambda r: r != -1 and r or None, + 'TTL': lambda r: r >= 0 and r or None, + 'PTTL': lambda r: r >= 0 and r or None, } )
Adjust to changed TTL, PTTL semantics Redis >= <I> might return -2, this ensures that redis-py just returns None.
andymccurdy_redis-py
train
py
c2dab29eae25e040d18fcd1a416826bedf4a5418
diff --git a/extensions/get-the-image.php b/extensions/get-the-image.php index <HASH>..<HASH> 100644 --- a/extensions/get-the-image.php +++ b/extensions/get-the-image.php @@ -16,7 +16,7 @@ * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * @package GetTheImage - * @version 0.8.0 + * @version 0.8.1 - Alpha * @author Justin Tadlock <justin@justintadlock.com> * @copyright Copyright (c) 2008 - 2012, Justin Tadlock * @link http://justintadlock.com/archives/2008/05/27/get-the-image-wordpress-plugin
Bump to <I> alpha.
justintadlock_hybrid-core
train
php
7320870ff3e82176c5b92cb0b0e9c4d9c0d35b77
diff --git a/lib/mbtiles.js b/lib/mbtiles.js index <HASH>..<HASH> 100644 --- a/lib/mbtiles.js +++ b/lib/mbtiles.js @@ -105,7 +105,6 @@ MBTiles.prototype._exists = function(table, callback) { if (this._schema) { return callback(null, _(this._schema).include(table)); } else { - this._schema = []; this._db.all( 'SELECT name FROM sqlite_master WHERE type IN (?, ?)', 'table',
Fix early initialization of _schema attribute.
mapbox_node-mbtiles
train
js
65778ef39ee14b0c8557282bb9e2e3f3fa53d191
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -74,6 +74,7 @@ setup( packages=["draco"], entry_points={"console_scripts": ["draco=draco.cli:main"]}, install_requires=["clyngor"], + include_package_data=True, extras_require={ "test": ["coverage", "pytest", "pytest-cov", "black", "ansunit", "mypy"] },
Copy asp and js files during installation. Fixes #<I>
uwdata_draco
train
py
3f0c23c9f8b0469754ff83a8beb8f2e93f810a17
diff --git a/src/Gossamer/Pesedget/Database/DatasourceFactory.php b/src/Gossamer/Pesedget/Database/DatasourceFactory.php index <HASH>..<HASH> 100644 --- a/src/Gossamer/Pesedget/Database/DatasourceFactory.php +++ b/src/Gossamer/Pesedget/Database/DatasourceFactory.php @@ -35,15 +35,15 @@ class DatasourceFactory { public function getDatasource($sourceName, Logger $logger) { $datasources = $this->getDatasources(); - if (!array_key_exists($sourceName, $datasources)) { - // try { + if (!array_key_exists($sourceName, $datasources) || !is_object($datasources[$sourceName])) { + try { $ds = $this->buildDatasourceInstance($sourceName, $logger); $datasources[$sourceName] = $ds; -// } catch (\Exception $e) { -// echo $e->getMessage(); -// $logger->addError($sourceName . ' is not a valid datasource'); -// throw new \Exception($sourceName . ' is not a valid datasource', 580); -// } + } catch (\Exception $e) { + echo $e->getMessage(); + $logger->addError($sourceName . ' is not a valid datasource'); + throw new \Exception($sourceName . ' is not a valid datasource', 580); + } } return $datasources[$sourceName];
added check for instance exists on getConnection
dmeikle_pesedget
train
php
b310df571b2e9d6fd729217f7a124c7984f91512
diff --git a/src/de/mrapp/android/dialog/MaterialDialogBuilder.java b/src/de/mrapp/android/dialog/MaterialDialogBuilder.java index <HASH>..<HASH> 100644 --- a/src/de/mrapp/android/dialog/MaterialDialogBuilder.java +++ b/src/de/mrapp/android/dialog/MaterialDialogBuilder.java @@ -387,8 +387,8 @@ public class MaterialDialogBuilder extends AlertDialog.Builder { public MaterialDialogBuilder setItems(final int resourceId, OnClickListener listener) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { - listAdapter = new ArrayAdapter<CharSequence>(context, resourceId); - listViewClickListener = listener; + this.setItems(context.getResources().getTextArray(resourceId), + listener); } else { super.setItems(resourceId, listener); }
Fixed the functionality to load list items from an array resource.
michael-rapp_AndroidMaterialDialog
train
java
483781e0d64208828747043996961c7a121b0a84
diff --git a/phabricator/__init__.py b/phabricator/__init__.py index <HASH>..<HASH> 100644 --- a/phabricator/__init__.py +++ b/phabricator/__init__.py @@ -370,7 +370,7 @@ class Phabricator(Resource): self.clientDescription = socket.gethostname() + ':python-phabricator' self._conduit = None - super(Phabricator, self).__init__(self) + super(Phabricator, self).__init__(self, **kwargs) def _request(self, **kwargs): raise SyntaxError('You cannot call the Conduit API without a resource.')
Forward kwargs (#<I>)
disqus_python-phabricator
train
py
559cb5399daa69d332cc996c4d073898d9943e72
diff --git a/lib/slimmer/skin.rb b/lib/slimmer/skin.rb index <HASH>..<HASH> 100644 --- a/lib/slimmer/skin.rb +++ b/lib/slimmer/skin.rb @@ -93,6 +93,7 @@ module Slimmer if defined?(Airbrake) Airbrake.notify_or_ignore(e, rack_env: rack_env) end + raise if strict end processor_end_time = Time.now process_time = processor_end_time - processor_start_time
Don't swallow exceptions when running in test Previously, exceptions from processors were always swallowed, and there are several tests which trigger such exceptions but don't report them. We want these exceptions to be reported in test and dev environments so that we can fix them; continuing to swallow the exceptions in production is probably a good thing. Exceptions in production/preview are reported to errbit, as before.
alphagov_slimmer
train
rb
6946cc1a7bad87de721f41db6e6919660bcf77df
diff --git a/lib/BodyParser.php b/lib/BodyParser.php index <HASH>..<HASH> 100644 --- a/lib/BodyParser.php +++ b/lib/BodyParser.php @@ -55,7 +55,9 @@ class BodyParser implements Observable { \Amp\defer(function() { if ($this->parsing === true) { - new Coroutine($this->initIncremental()); + $awaitable = new Coroutine($this->initIncremental()); + } else { + $awaitable = null; } $this->body->when(function ($e, $data) { $this->req = null; @@ -88,6 +90,7 @@ class BodyParser implements Observable { $this->subscribers = []; } }); + return $awaitable; }); } @@ -279,7 +282,7 @@ class BodyParser implements Observable { $this->fail($e); } - // this should be inside a defer (not direct Coroutine) to give user a chance to install watch() handlers + // this should be inside a defer (not direct Coroutine) to give user a chance to install subscribe() handlers private function initIncremental() { if ($this->parsing !== true) { return;
Return awaitable from defer callback
amphp_http-server
train
php
8dc076952d75f4c8153ff55a82d44c6a59360512
diff --git a/internal/provider/resource_password_test.go b/internal/provider/resource_password_test.go index <HASH>..<HASH> 100644 --- a/internal/provider/resource_password_test.go +++ b/internal/provider/resource_password_test.go @@ -508,10 +508,11 @@ func TestAccResourcePassword_Min(t *testing.T) { // TestAccResourcePassword_UpgradeFromVersion2_2_1 requires that you are running an amd64 Terraform binary // if you are running this test locally on arm64 architecture otherwise you will see the following error: -// Error: Incompatible provider version // -// Provider registry.terraform.io/hashicorp/random v2.2.1 does not have a -// package available for your current platform ... +// Error: Incompatible provider version +// +// Provider registry.terraform.io/hashicorp/random v2.2.1 does not have a +// package available for your current platform ... // // TestAccResourcePassword_UpgradeFromVersion2_2_1 verifies behaviour when upgrading state from schema V0 to V2. func TestAccResourcePassword_UpgradeFromVersion2_2_1(t *testing.T) {
Linting (#<I>)
terraform-providers_terraform-provider-random
train
go
ca6addfb596daefb47dac544d6566e06bf179cb1
diff --git a/chance.js b/chance.js index <HASH>..<HASH> 100644 --- a/chance.js +++ b/chance.js @@ -59,6 +59,27 @@ return num; }; + + Chance.prototype.normal = function(options) { + // The Marsaglia Polar method + var s, u, v, norm, + mean = options.mean || 0, + dev = (typeof options.dev !== 'undefined') ? options.dev : 1; + + do { + // U and V are from the uniform distribution on (-1, 1) + u = this.random() * 2 - 1; + v = this.random() * 2 - 1; + + s = u * u + v * v; + } while (s < 1); + + // Compute the standard normal variate + norm = u * Math.sqrt(-2 * Math.log(s) / s); + + // Shape and scale + return dev * norm + mean; + }; Chance.prototype.character = function (options) { options = options || {};
Adding ability to generate from normal distribution
chancejs_chancejs
train
js
9c46a7e6f91400705d1935338898da7ea759ff1f
diff --git a/lib/xmldb/classes/generators/mysql/mysql.class.php b/lib/xmldb/classes/generators/mysql/mysql.class.php index <HASH>..<HASH> 100644 --- a/lib/xmldb/classes/generators/mysql/mysql.class.php +++ b/lib/xmldb/classes/generators/mysql/mysql.class.php @@ -62,7 +62,7 @@ class XMLDBmysql extends XMLDBGenerator { var $alter_column_sql = 'ALTER TABLE TABLENAME MODIFY COLUMN COLUMNSPECS'; //The SQL template to alter columns - var $drop_index_sql = 'DROP INDEX INDEXNAME ON TABLENAME'; //SQL sentence to drop one index + var $drop_index_sql = 'ALTER TABLE TABLENAME DROP INDEX INDEXNAME'; //SQL sentence to drop one index //TABLENAME, INDEXNAME are dinamically replaced /**
changed mysql drop index syntax. Nothing relevant.
moodle_moodle
train
php
79460f61229efe76218195b7fb366348d428a1d2
diff --git a/lib/vagrant/util/subprocess.rb b/lib/vagrant/util/subprocess.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant/util/subprocess.rb +++ b/lib/vagrant/util/subprocess.rb @@ -105,10 +105,15 @@ module Vagrant # amount of text between the time we last read data and when the # process exited. [stdout, stderr].each do |io| + # Read the extra data, ignoring if there isn't any extra_data = read_io(io) + next if extra_data == "" + + # Log it out and accumulate @logger.debug(extra_data) io_data[io] += extra_data + # Yield to any listeners any remaining data io_name = io == stdout ? :stdout : :stderr yield io_name, extra_data if block_given? end
Subprocess: Check if data is empty after the process exits as well
hashicorp_vagrant
train
rb
daea9d129ed7999c9c2d5d985c5a7c646333df14
diff --git a/lib/task-data/base-tasks/obm.js b/lib/task-data/base-tasks/obm.js index <HASH>..<HASH> 100644 --- a/lib/task-data/base-tasks/obm.js +++ b/lib/task-data/base-tasks/obm.js @@ -7,8 +7,7 @@ module.exports = { injectableName: 'Task.Base.Obm.Node', runJob: 'Job.Obm.Node', requiredOptions: [ - 'action', - 'obmServiceName' + 'action' ], requiredProperties: {}, properties: {
fix CI tests, remove required obm settings from base task (#<I>)
RackHD_on-tasks
train
js
4eff1dc80696feb8c06b66fcba59a6c7965efd2f
diff --git a/chef/spec/unit/chef_fs/diff_spec.rb b/chef/spec/unit/chef_fs/diff_spec.rb index <HASH>..<HASH> 100644 --- a/chef/spec/unit/chef_fs/diff_spec.rb +++ b/chef/spec/unit/chef_fs/diff_spec.rb @@ -82,7 +82,9 @@ describe 'diff' do it 'Chef::ChefFS::CommandLine.diff(/)' do results = [] Chef::ChefFS::CommandLine.diff(pattern('/'), a, b, nil, nil) do |diff| - results << diff.gsub(/\s+\d\d\d\d-\d\d-\d\d\s\d?\d:\d\d:\d\d\.\d{9} -\d\d\d\d/, ' DATE') + # Removes the date stamp from the diff and replaces it with ' DATE' + # example match: "/dev/null\t2012-10-16 16:15:54.000000000 +0000" + results << diff.gsub(/\s+\d\d\d\d-\d\d-\d\d\s\d?\d:\d\d:\d\d\.\d{9} [+-]\d\d\d\d/, ' DATE') end results.should =~ [ 'diff --knife a/both_dirs/sub_both_files_different b/both_dirs/sub_both_files_different
Handle GMT and postive time zones in spec test
chef_chef
train
rb
e024dbd20af96cce8476e350fa68839ba528c0f9
diff --git a/lib/passive_record/version.rb b/lib/passive_record/version.rb index <HASH>..<HASH> 100644 --- a/lib/passive_record/version.rb +++ b/lib/passive_record/version.rb @@ -1,4 +1,4 @@ module PassiveRecord # passive_record version - VERSION = "0.3.22" + VERSION = "0.4.0" end
version bump to minor version <I> - compatibility with ruby <I>
deepcerulean_passive_record
train
rb
8e0f4b02594349fcad6312a5c7aaed2a0767aa43
diff --git a/Firestore/synth.py b/Firestore/synth.py index <HASH>..<HASH> 100644 --- a/Firestore/synth.py +++ b/Firestore/synth.py @@ -23,7 +23,7 @@ logging.basicConfig(level=logging.DEBUG) gapic = gcp.GAPICBazel() common = gcp.CommonTemplates() -for ver in ['V1', 'V1beta1']: +for ver in ['V1']: lower_version = ver.lower() library = gapic.php_library(
chore: disable updating v1beta1 client (#<I>)
googleapis_google-cloud-php
train
py
3024413f8d32bca669351b8570b0206294b36677
diff --git a/src/Paystack/Http/RequestBuilder.php b/src/Paystack/Http/RequestBuilder.php index <HASH>..<HASH> 100644 --- a/src/Paystack/Http/RequestBuilder.php +++ b/src/Paystack/Http/RequestBuilder.php @@ -4,6 +4,7 @@ namespace Yabacon\Paystack\Http; use \Yabacon\Paystack\Contracts\RouteInterface; use \Yabacon\Paystack\Helpers\Router; +use \Yabacon\Paystack; class RequestBuilder { @@ -26,6 +27,7 @@ class RequestBuilder public function build() { $this->request->headers["Authorization"] = "Bearer " . $this->paystackObj->secret_key; + $this->request->headers["User-Agent"] = "Paystack/v1 PhpBindings/" . Paystack::VERSION; $this->request->endpoint = Router::PAYSTACK_API_ROOT . $this->interface[RouteInterface::ENDPOINT_KEY]; $this->request->method = $this->interface[RouteInterface::METHOD_KEY]; $this->moveArgsToSentargs();
[chore] Add User-Agent header to requests
yabacon_paystack-php
train
php
b31332b6cb49173ca4dee35f11ab4889b39a8502
diff --git a/src/Api/Repositories/Workspaces/PipelinesConfig.php b/src/Api/Repositories/Workspaces/PipelinesConfig.php index <HASH>..<HASH> 100644 --- a/src/Api/Repositories/Workspaces/PipelinesConfig.php +++ b/src/Api/Repositories/Workspaces/PipelinesConfig.php @@ -13,6 +13,7 @@ declare(strict_types=1); namespace Bitbucket\Api\Repositories\Workspaces; +use Bitbucket\Api\Repositories\Workspaces\PipelinesConfig\Variables; use Bitbucket\HttpClient\Util\UriBuilder; /** @@ -23,6 +24,14 @@ use Bitbucket\HttpClient\Util\UriBuilder; class PipelinesConfig extends AbstractWorkspacesApi { /** + * @return \Bitbucket\Api\Repositories\Workspaces\PipelinesConfig\Variables + */ + public function variables() + { + return new Variables($this->getClient(), $this->workspace, $this->repo); + } + + /** * @param array $params * * @throws \Http\Client\Exception
[<I>] Added missing `PipelinesConfig::variables()` method to point to existing implementation (#<I>)
BitbucketAPI_Client
train
php
7db10e2caed909a349fc5453097c73c02f51f763
diff --git a/mutagen/id3/_specs.py b/mutagen/id3/_specs.py index <HASH>..<HASH> 100644 --- a/mutagen/id3/_specs.py +++ b/mutagen/id3/_specs.py @@ -463,7 +463,7 @@ class ID3TimeStamp(object): return repr(self.text) def __eq__(self, other): - return self.text == other.text + return isinstance(other, ID3TimeStamp) and self.text == other.text def __lt__(self, other): return self.text < other.text
id3.ID3TimeStamp comparator: check type (#<I>) pyyaml's yaml.dump() failed because it apparently compares instances of ID3TimeStamp with None and empty tuples
quodlibet_mutagen
train
py
6929855f675a3c016fc5b87a1d70aa44a9016349
diff --git a/lib/active_record/id_regions.rb b/lib/active_record/id_regions.rb index <HASH>..<HASH> 100644 --- a/lib/active_record/id_regions.rb +++ b/lib/active_record/id_regions.rb @@ -37,6 +37,10 @@ module ArRegion @@rails_sequence_end ||= rails_sequence_start + rails_sequence_factor - 1 end + def rails_sequence_range + rails_sequence_start..rails_sequence_end + end + def clear_region_cache @@my_region_number = @@rails_sequence_start = @@rails_sequence_end = nil end @@ -164,4 +168,4 @@ module ArRegion end end -ActiveRecord::Base.include ArRegion +ApplicationRecord.include ArRegion
Move ArRegion to ApplicationRecord In the process, instead of maintaining a direct dependency on our method, pass the sequence range to rubyrep via config. (transferred from ManageIQ/manageiq@f<I>a<I>da<I>cb<I>cee9e<I>e<I>ce9)
ManageIQ_activerecord-id_regions
train
rb
cad612990f2676f3189ee5546710f89f20ec8418
diff --git a/Command/ActivateUserCommand.php b/Command/ActivateUserCommand.php index <HASH>..<HASH> 100644 --- a/Command/ActivateUserCommand.php +++ b/Command/ActivateUserCommand.php @@ -72,7 +72,7 @@ EOT } $this->eventDispatcher->dispatch(AdminSecurityEvents::ACTIVATION, new ActivationEvent($user)); - $output->writeln(sprintf('User <comment>%s</comment> has been deactivated', $email)); + $output->writeln(sprintf('User <comment>%s</comment> has been activated', $email)); } protected function interact(InputInterface $input, OutputInterface $output): void diff --git a/Command/DeactivateUserCommand.php b/Command/DeactivateUserCommand.php index <HASH>..<HASH> 100644 --- a/Command/DeactivateUserCommand.php +++ b/Command/DeactivateUserCommand.php @@ -73,7 +73,7 @@ EOT } $this->eventDispatcher->dispatch(AdminSecurityEvents::DEACTIVATION, new ActivationEvent($user)); - $output->writeln(sprintf('User <comment>%s</comment> has been activated', $email)); + $output->writeln(sprintf('User <comment>%s</comment> has been deactivated', $email)); } protected function interact(InputInterface $input, OutputInterface $output): void
Fixed activate/deactive user command success messages
fsi-open_admin-security-bundle
train
php,php
f1d002ff8b31e0f6ddd0793428764bdf69849630
diff --git a/mode/rust/rust.js b/mode/rust/rust.js index <HASH>..<HASH> 100644 --- a/mode/rust/rust.js +++ b/mode/rust/rust.js @@ -68,4 +68,5 @@ CodeMirror.defineSimpleMode("rust",{ CodeMirror.defineMIME("text/x-rustsrc", "rust"); +CodeMirror.defineMIME("text/rust", "rust"); });
[rust mode] Add proper MIME type leave the old one for now
codemirror_CodeMirror
train
js
98b50b28d9fe468713cece7984fdb0bfbe5e2ef2
diff --git a/rbac/AuthorizerBehavior.php b/rbac/AuthorizerBehavior.php index <HASH>..<HASH> 100644 --- a/rbac/AuthorizerBehavior.php +++ b/rbac/AuthorizerBehavior.php @@ -73,7 +73,7 @@ class AuthorizerBehavior extends Behavior $schema = $owner->getDb()->getSchema(); $t = $schema->quoteSimpleTableName('t'); - $pks = $owner->getTableSchema()->primaryKey; + $pks = $owner->primaryKey(); $pkConditions = []; $pkParams = [];
fix fetching pk in AuthorizerBehavior
netis-pl_yii2-crud
train
php
874e18c8cfe0baab7e8668ade34d16d4ef01cf4a
diff --git a/lib/para/components_configuration.rb b/lib/para/components_configuration.rb index <HASH>..<HASH> 100644 --- a/lib/para/components_configuration.rb +++ b/lib/para/components_configuration.rb @@ -51,18 +51,18 @@ module Para end def components_installed? - non_existant_table = %w(components component_sections).any? do |name| - !ActiveRecord::Base.table_exists?("para_#{ name }") + tables_exist = %w(components component_sections).all? do |name| + ActiveRecord::Base.table_exists?("para_#{ name }") end - if non_existant_table + unless tables_exist Rails.logger.warn( "Para migrations are not installed.\n" \ "Skipping components definition until next app reload." ) end - non_existant_table + tables_exist end def eager_load_components!
invert Components_configuration#components_installed? logic to make it work
para-cms_para
train
rb
84e398be84cf363603493330f9ee7890e5dab810
diff --git a/gala/coordinates/gd1.py b/gala/coordinates/gd1.py index <HASH>..<HASH> 100644 --- a/gala/coordinates/gd1.py +++ b/gala/coordinates/gd1.py @@ -60,6 +60,11 @@ class GD1Koposov10(coord.BaseCoordinateFrame): coord.SphericalRepresentation)): self._data.lon.wrap_angle = self._default_wrap_angle +<<<<<<< HEAD +======= + def represent_as(): + pass +>>>>>>> skip whatsnew doctests and link to scf heading # Rotation matrix as defined in the Appendix of Koposov et al. (2010) R = np.array([[-0.4776303088, -0.1738432154, 0.8611897727],
skip whatsnew doctests and link to scf heading
adrn_gala
train
py
51d2a1534c8880a89f8b2bd7906772627f4bec70
diff --git a/satpy/readers/abi_l1b.py b/satpy/readers/abi_l1b.py index <HASH>..<HASH> 100644 --- a/satpy/readers/abi_l1b.py +++ b/satpy/readers/abi_l1b.py @@ -86,6 +86,9 @@ class NC_ABI_L1B(BaseFileHandler): # handle coordinates (and recursive fun) new_coords = {} + # 'time' dimension causes issues in other processing + if 'time' in data.coords: + del data.coords['time'] if item in data.coords: self.coords[item] = data for coord_name in data.coords.keys(): @@ -93,6 +96,7 @@ class NC_ABI_L1B(BaseFileHandler): self.coords[coord_name] = self[coord_name] new_coords[coord_name] = self.coords[coord_name] data.coords.update(new_coords) + print(data.coords.keys()) return data def get_shape(self, key, info):
Remove time coordinate for ABI data It causes issues when making composites
pytroll_satpy
train
py
f486fcd0572c0fd070739eb12b2269373120c974
diff --git a/addon/comment/comment.js b/addon/comment/comment.js index <HASH>..<HASH> 100644 --- a/addon/comment/comment.js +++ b/addon/comment/comment.js @@ -44,9 +44,17 @@ } }); + // Rough heuristic to try and detect lines that are part of multi-line string + function probablyInsideString(cm, pos, line) { + return /\bstring\b/.test(cm.getTokenTypeAt(Pos(pos.line, 0))) && !/^[\'\"`]/.test(line) + } + CodeMirror.defineExtension("lineComment", function(from, to, options) { if (!options) options = noOptions; var self = this, mode = self.getModeAt(from); + var firstLine = self.getLine(from.line); + if (firstLine == null || probablyInsideString(self, from, firstLine)) return; + var commentString = options.lineComment || mode.lineComment; if (!commentString) { if (options.blockCommentStart || mode.blockCommentStart) { @@ -55,8 +63,7 @@ } return; } - var firstLine = self.getLine(from.line); - if (firstLine == null) return; + var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1); var pad = options.padding == null ? " " : options.padding; var blankLines = options.commentBlankLines || from.line == to.line;
[comment addon] Don't toggle comments inside multi-line strings Issue #<I>
codemirror_CodeMirror
train
js
835be80ff8011b1555363b4a58b17da8de546583
diff --git a/trunk/mlcp/src/main/java/com/marklogic/contentpump/AggregateXMLReader.java b/trunk/mlcp/src/main/java/com/marklogic/contentpump/AggregateXMLReader.java index <HASH>..<HASH> 100644 --- a/trunk/mlcp/src/main/java/com/marklogic/contentpump/AggregateXMLReader.java +++ b/trunk/mlcp/src/main/java/com/marklogic/contentpump/AggregateXMLReader.java @@ -276,7 +276,7 @@ public class AggregateXMLReader<VALUEIN> extends ImportRecordReader<VALUEIN> { sb.append(name); } // add namespaces declared into the new root element - if (isNewRootStart && namespace != null) { + if (isNewRootStart) { Set<String> keys = nameSpaces.keySet(); for (String k : keys) { String v = nameSpaces.get(k).peek();
Bug:<I> add known namespace declarations into root element no matter root has namespace or not
marklogic_marklogic-contentpump
train
java
45a6dd34d407bc24734ea40e4d9ef10e412ca544
diff --git a/index.js b/index.js index <HASH>..<HASH> 100755 --- a/index.js +++ b/index.js @@ -17,7 +17,7 @@ module.exports = function (FAT_REMOTE, SKIM_REMOTE, port, pouchPort, urlBase, lo var startingTimeout = 1000; logger.silly('\nWelcome!'); logger.info('To start using local-npm, just run: '); - logger.code('\n $ npm set registry http://127.0.0.1:' + port); + logger.code('\n $ npm set registry ' + urlBase); logger.info('\nTo switch back, you can run: '); logger.code('\n $ npm set registry ' + FAT_REMOTE); logger.info('\nA simple npm-like UI is available here: http://127.0.0.1:' + port + '/_browse'); @@ -131,9 +131,6 @@ module.exports = function (FAT_REMOTE, SKIM_REMOTE, port, pouchPort, urlBase, lo }); return doc; } - app.all('/*', function (req, res) { - res.send(500); - }); var sync; function replicateSkim() { skimRemote.info().then(function (info) {
suggest they point it to urlbase
local-npm_local-npm
train
js
60347606dfa979075b811e7def84d72784cc24a6
diff --git a/Controller/ConnectController.php b/Controller/ConnectController.php index <HASH>..<HASH> 100644 --- a/Controller/ConnectController.php +++ b/Controller/ConnectController.php @@ -342,6 +342,10 @@ final class ConnectController extends AbstractController $event = new FilterUserResponseEvent($currentUser, $request, $response); $this->dispatch($event, HWIOAuthEvents::CONNECT_COMPLETED); + if (null !== $event->getResponse()) { + return $event->getResponse(); + } + return $response; }
Customizing the CONNECT_COMPLETED response Accepting the response from the event listener associated with HWIOAuthEvents::CONNECT_COMPLETED whenever it's set instead of always using the @HWIOAuth/Connect/connect_success.html.twig template rendering
hwi_HWIOAuthBundle
train
php
6bf9a5c6141474f91beca2054261e6d0519365e8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ setup( platforms='any', install_requires=[ 'Flask>=0.10.1', - 'pyldap' + 'python-ldap' ], classifiers=[ 'Environment :: Web Environment',
Replace pyldap with python-ldap in setup.py pyldap is deprecated in favor of python-ldap
admiralobvious_flask-simpleldap
train
py
07b23a99c7088a7c740f23051f3f755f091519b0
diff --git a/packages/discord.js/src/structures/InteractionCollector.js b/packages/discord.js/src/structures/InteractionCollector.js index <HASH>..<HASH> 100644 --- a/packages/discord.js/src/structures/InteractionCollector.js +++ b/packages/discord.js/src/structures/InteractionCollector.js @@ -45,16 +45,14 @@ class InteractionCollector extends Collector { * @type {?Snowflake} */ this.channelId = - this.client.channels.resolveId(options.message?.channel) ?? - options.message?.channel_id ?? - this.client.channels.resolveId(options.channel); + options.message?.channelId ?? options.message?.channel_id ?? this.client.channels.resolveId(options.channel); /** * The guild from which to collect interactions, if provided * @type {?Snowflake} */ this.guildId = - this.client.guilds.resolveId(options.message?.guild) ?? + options.message?.guildId ?? options.message?.guild_id ?? this.client.guilds.resolveId(options.channel?.guild) ?? this.client.guilds.resolveId(options.guild); @@ -83,7 +81,6 @@ class InteractionCollector extends Collector { */ this.total = 0; - this.empty = this.empty.bind(this); this.client.incrementMaxListeners(); const bulkDeleteListener = messages => {
refactor(InteractionCollector): simplify constructor logic (#<I>) * refactor(InteractionCollector): simplify constructor logic * fix: oversight
discordjs_discord.js
train
js
17b5187e65afd3153bde06b8e9faaaf104f3b8d1
diff --git a/libraries/joomla/access/access.php b/libraries/joomla/access/access.php index <HASH>..<HASH> 100644 --- a/libraries/joomla/access/access.php +++ b/libraries/joomla/access/access.php @@ -464,7 +464,7 @@ class JAccess JLog::add(__METHOD__ . ' is deprecated. Use JAccess::getActionsFromFile or JAcces::getActionsFromData instead.', JLog::WARNING, 'deprecated'); $actions = self::getActionsFromFile( JPATH_ADMINISTRATOR . '/components/' . $component . '/access.xml', - "/access/section[@name='" . $section . "']" + "/access/section[@name='" . $section . "']/" ); if (empty($actions)) {
Fix a wrong xpath expression in JAccess.
joomla_joomla-framework
train
php
1732c727892157bcd31a068372033e013c9c0443
diff --git a/lib/jboss-cloud/rpm-utils.rb b/lib/jboss-cloud/rpm-utils.rb index <HASH>..<HASH> 100644 --- a/lib/jboss-cloud/rpm-utils.rb +++ b/lib/jboss-cloud/rpm-utils.rb @@ -99,6 +99,8 @@ module JBossCloud compare_file_and_upload( sftp, srpm_file, "#{srpms_package_dir}/#{File.basename( srpm_file )}" ) end + puts "Refreshing repository information in #{srpms_package_dir}..." + ssh.exec!( "createrepo #{srpms_package_dir}" ) end puts "Disconnecting from remote server..." @@ -115,7 +117,6 @@ module JBossCloud rescue Net::SFTP::StatusException => e raise unless e.code == 2 upload_file( sftp, file, remote_file ) - next end if File.stat(file).mtime > Time.at(rstat.mtime) or File.size(file) != rstat.size
refreshing SRPMs repo directory
boxgrinder_boxgrinder-build
train
rb
a1254ca1c63276adab09d03d12413972da7ac837
diff --git a/lib/cancan/controller_resource.rb b/lib/cancan/controller_resource.rb index <HASH>..<HASH> 100644 --- a/lib/cancan/controller_resource.rb +++ b/lib/cancan/controller_resource.rb @@ -83,6 +83,10 @@ module CanCan def build_resource resource = resource_base.new(resource_params || {}) + assign_attributes(resource) + end + + def assign_attributes(resource) resource.send("#{parent_name}=", parent_resource) if @options[:singleton] && parent_resource initial_attributes.each do |attr_name, value| resource.send("#{attr_name}=", value)
Fix pull request <I>. For some reason github didn't allow a clean merge althought there weren't any conflicts. Fix it so that it's easier to just merge via the UI.
ryanb_cancan
train
rb
3e71bfda9311dc61d3976cf050051c4f21af7137
diff --git a/pytuya/__init__.py b/pytuya/__init__.py index <HASH>..<HASH> 100644 --- a/pytuya/__init__.py +++ b/pytuya/__init__.py @@ -125,7 +125,7 @@ payload_dict = { } class XenonDevice(object): - def __init__(self, dev_id, address, local_key=None, dev_type=None): + def __init__(self, dev_id, address, local_key=None, dev_type=None, connection_timeout=10): """ Represents a Tuya device. @@ -145,6 +145,7 @@ class XenonDevice(object): self.local_key = local_key self.local_key = local_key.encode('latin1') self.dev_type = dev_type + self.connection_timeout = connection_timeout self.port = 6668 # default - do not expect caller to pass in @@ -159,6 +160,7 @@ class XenonDevice(object): payload(bytes): Data to send. """ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.settimeout(self.connection_timeout) s.connect((self.address, self.port)) s.send(payload) data = s.recv(1024)
Add configurable timeout so connection won't block if something gets stuck
clach04_python-tuya
train
py
9463787746bfaed8146292800c4a21bc610892b6
diff --git a/shared/reporting-core/src/main/java/com/base2/kagura/core/report/connectors/FreemarkerSQLDataReportConnector.java b/shared/reporting-core/src/main/java/com/base2/kagura/core/report/connectors/FreemarkerSQLDataReportConnector.java index <HASH>..<HASH> 100644 --- a/shared/reporting-core/src/main/java/com/base2/kagura/core/report/connectors/FreemarkerSQLDataReportConnector.java +++ b/shared/reporting-core/src/main/java/com/base2/kagura/core/report/connectors/FreemarkerSQLDataReportConnector.java @@ -57,7 +57,7 @@ public abstract class FreemarkerSQLDataReportConnector extends ReportConnector { statement.setObject(i + 1, prefreemarkerSQLResult.getParams().get(i)); } statement.setQueryTimeout(queryTimeout); - statement.executeBatch(); + statement.execute(); } FreemarkerSQLResult freemarkerSQLResult = freemakerParams(extra, true, freemarkerSql); statement = connection.prepareStatement(freemarkerSQLResult.getSql()); @@ -74,7 +74,7 @@ public abstract class FreemarkerSQLDataReportConnector extends ReportConnector { statement.setObject(i + 1, postfreemarkerSQLResult.getParams().get(i)); } statement.setQueryTimeout(queryTimeout); - statement.executeBatch(); + statement.execute(); } } catch (Exception ex) { errors.add(ex.getMessage());
Switched from batchExecute to normal execute.
base2Services_kagura
train
java
1d04f5c26c052dbc0be86b0c5ce32d92d8f55e89
diff --git a/lib/spatial_features/importers/shapefile.rb b/lib/spatial_features/importers/shapefile.rb index <HASH>..<HASH> 100644 --- a/lib/spatial_features/importers/shapefile.rb +++ b/lib/spatial_features/importers/shapefile.rb @@ -4,6 +4,11 @@ require 'digest/md5' module SpatialFeatures module Importers class Shapefile < Base + def initialize(data, *args, proj4: nil) + super(data, *args) + @proj4 = proj4 + end + def cache_key @cache_key ||= Digest::MD5.hexdigest(features.to_json) end @@ -12,10 +17,14 @@ module SpatialFeatures def each_record(&block) file = Download.open(@data, unzip: '.shp') - proj4 = proj4_from_file(file) + + if !@proj4 + @proj4 = proj4_from_file(file) + end + RGeo::Shapefile::Reader.open(file.path) do |records| records.each do |record| - yield OpenStruct.new data_from_wkt(record.geometry.as_text, proj4).merge(:metadata => record.attributes) if record.geometry.present? + yield OpenStruct.new data_from_wkt(record.geometry.as_text, @proj4).merge(:metadata => record.attributes) if record.geometry.present? end end end
Allow shapefile import to specify projection If a shapefile doesn’t come with a projection file, it is now possible to specify it manually instead.
culturecode_spatial_features
train
rb
7bbaa82cf86503cfd07e0aab0c746629674b0e79
diff --git a/src/languages/Estonian.php b/src/languages/Estonian.php index <HASH>..<HASH> 100644 --- a/src/languages/Estonian.php +++ b/src/languages/Estonian.php @@ -4,7 +4,7 @@ namespace js\tools\numbers2words\languages; use js\tools\numbers2words\exceptions\InvalidArgumentException; use js\tools\numbers2words\Speller; -class Estonian extends Speller +final class Estonian extends Speller { protected $minus = 'miinus'; protected $decimalSeparator = ' ja ';
This should be final, like all other language classes.
jurchiks_numbers2words
train
php
8e5183321e8b1efae89be2012021cee03cb12538
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -82,6 +82,8 @@ install_requires = [ 'mistune>=0.7.2', 'six>=1.10.0', 'uritemplate.py>=0.2.0,<2.0', + 'urllib3<1.25,>=1.21.1', # from "invenio-search" + 'idna>=2.5,<2.8', # from "invenio-search" ] packages = find_packages()
setup: fix package conflicts with invenio-search
inveniosoftware_invenio-github
train
py
f22d3bad9ad0536aa4185237abf6f680e4a4c6c6
diff --git a/app/controllers/deep_unrest/application_controller.rb b/app/controllers/deep_unrest/application_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/deep_unrest/application_controller.rb +++ b/app/controllers/deep_unrest/application_controller.rb @@ -9,6 +9,7 @@ module DeepUnrest # rails can't deal with array indices in params (converts them to hashes) # see https://gist.github.com/bloudermilk/2884947 def repair_nested_params(obj) + return unless obj.respond_to?(:each) obj.each do |key, value| if value.is_a?(ActionController::Parameters) || value.is_a?(Hash) # If any non-integer keys
[bugfix] only try to recurse through nested params if param is iterable
graveflex_deep_unrest
train
rb
96cb339c1c6c008fcc14daea50a23c8b269e3b38
diff --git a/lib/commands/run.js b/lib/commands/run.js index <HASH>..<HASH> 100644 --- a/lib/commands/run.js +++ b/lib/commands/run.js @@ -159,7 +159,9 @@ function run(scriptPath, options) { ee.once('done', function(report) { - cli.spinner('', true); + if (tty.isatty(process.stdout)) { + cli.spinner('', true); + } console.log('all scenarios completed'); console.log('Complete report @ %s', report.aggregate.timestamp);
Fix for when stdout is not a tty
artilleryio_artillery
train
js
6545945ba6e84279b5bb34dd86a344b693b0bf6a
diff --git a/src/MemoryState.js b/src/MemoryState.js index <HASH>..<HASH> 100644 --- a/src/MemoryState.js +++ b/src/MemoryState.js @@ -35,13 +35,11 @@ class LockOperations { (retry, n) => { if (this.locks.has(key)) { let err = new ChatServiceError('timeout') - return retry(err) + retry(err) } else { this.locks.set(key, val) - return Promise.resolve() } - } - ) + }) } unlock (key, val) { diff --git a/src/RedisState.js b/src/RedisState.js index <HASH>..<HASH> 100644 --- a/src/RedisState.js +++ b/src/RedisState.js @@ -67,9 +67,7 @@ class LockOperations { return this.redis.set(key, val, 'NX', 'PX', ttl).then(res => { if (!res) { let error = new ChatServiceError('timeout') - return retry(error) - } else { - return null + retry(error) } }).catch(retry) })
refactor: retry cleanup
an-sh_chat-service
train
js,js
0bfacc0e3be327e08e376d5ad6c0315972a1ea73
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -44,10 +44,10 @@ function configureAxe (defaultOptions = {}) { } /** - * Custom jest expect matcher, that can check aXe results for violations. + * Custom Jest expect matcher, that can check aXe results for violations. * @param {results} object requires an instance of aXe's results object * (https://github.com/dequelabs/axe-core/blob/develop-2x/doc/API.md#results-object) - * @returns {object} returns jest matcher object + * @returns {object} returns Jest matcher object */ const toHaveNoViolations = { toHaveNoViolations (results) {
Nit: fix capitalization in comment blocks
nickcolley_jest-axe
train
js
5b737e6d1646c2de951e3081a3f610be3f861ae7
diff --git a/currencies/__init__.py b/currencies/__init__.py index <HASH>..<HASH> 100644 --- a/currencies/__init__.py +++ b/currencies/__init__.py @@ -1 +1 @@ -VERSION = '0.1' +VERSION = '0.2.1'
Forgot to bumb the version number...
bashu_django-simple-currencies
train
py
cafdfc5d0c12e5d85f66b476bb0e55404b407c15
diff --git a/woven/utils.py b/woven/utils.py index <HASH>..<HASH> 100644 --- a/woven/utils.py +++ b/woven/utils.py @@ -1,7 +1,7 @@ #!/usr/bin/env python from __future__ import with_statement -import os, sys, tempfile +import os, shutil, sys, tempfile from functools import wraps from pkg_resources import parse_version @@ -185,6 +185,10 @@ def parse_project_version(version=''): return project_version +def rmtmpdirs(): + for path in env.woventempdirs: + shutil.rmtree(path,ignore_errors=True) + def root_domain(): """ Deduce the root domain name, usually a 'naked' domain but not necessarily.
added in a local /tmp dir cleanup function
bretth_woven
train
py
faa7c7ebede50afdcc5ffd74ff1de0dc60d4049d
diff --git a/main.js b/main.js index <HASH>..<HASH> 100644 --- a/main.js +++ b/main.js @@ -82,7 +82,11 @@ manager.prototype.connect = function(options) { var result = q.defer(); var self = this; if (!this.cb) { - this.cb = new cb.Connection(options || {}, function(err) { + var builder = cb.Connection; + if (options.mock) { + builder = cb.Mock.Connection; + } + this.cb = new builder(options || {}, function(err) { if (err) { result.reject(err); self.emit('error', err); @@ -92,6 +96,10 @@ manager.prototype.connect = function(options) { self.emit('connect', self); } }); + if (options.mock) { + result.resolve(this); + self.emit('connect', this); + } } else { result.resolve(self); }
implement a mock option on connection to pass tests
ichiriac_sofa-odm
train
js
2e6cb4492d55f47ea0582f52f56371a7d2261a15
diff --git a/app/models/blog_sweeper.rb b/app/models/blog_sweeper.rb index <HASH>..<HASH> 100644 --- a/app/models/blog_sweeper.rb +++ b/app/models/blog_sweeper.rb @@ -33,7 +33,7 @@ class BlogSweeper < ActionController::Caching::Sweeper end def after_save(record) - expire_for(record) + expire_for(record) unless (record.is_a?(Article) and record.state.downcase == 'draft') end def after_destroy(record)
Don't sweep the cache if we're saving a draft. Without this change, having the article editor open to write a new article will cause the cache to be continuously sweeped without reason.
publify_publify
train
rb
8251adf6091062d911a0eeb10793cbd16710ea87
diff --git a/blueprints/route/index.js b/blueprints/route/index.js index <HASH>..<HASH> 100644 --- a/blueprints/route/index.js +++ b/blueprints/route/index.js @@ -19,8 +19,7 @@ function addRouteToRouter(name, options) { var type = options.type || 'route'; var routerPath = path.join(process.cwd(), 'app', 'router.coffee'); var oldContent = fs.readFileSync(routerPath, 'utf-8'); - // This probably won't work with coffeescript-files yet. I'll look at it later. - var existence = new RegExp("(route|resource)\\(['\"]" + name + "'"); + var existence = new RegExp("(?:route|resource)\\s?\\(?\\s?(['\"])" + name + "\\1"); var plural; var newContent;
Fix not detecting duplicates in route generation Also improved the regex a bit in general. Fixes #4
kristianmandrup_ember-cli-emberscript
train
js
c21ca0d2d22c1f8354bbca2c48e3eebb47b18b85
diff --git a/devices/insta.js b/devices/insta.js index <HASH>..<HASH> 100644 --- a/devices/insta.js +++ b/devices/insta.js @@ -21,7 +21,7 @@ module.exports = [ ota: ota.zigbeeOTA, }, { - zigbeeModel: ['Generic UP Device'], + zigbeeModel: ['NEXENTRO Blinds Actuator', 'Generic UP Device'], model: '57008000', vendor: 'Insta', description: 'Blinds actor with lift/tilt calibration & with with inputs for wall switches',
Add NEXENTRO Blinds Actuator to <I> (#<I>) add new Zigbee model for Insta <I>
Koenkk_zigbee-shepherd-converters
train
js
1c941b575163e7ec840f7529d3dcccb6d670dd1a
diff --git a/js/coss.js b/js/coss.js index <HASH>..<HASH> 100644 --- a/js/coss.js +++ b/js/coss.js @@ -57,6 +57,9 @@ module.exports = class coss extends Exchange { 'get': [ 'coins/getinfo/all', 'order/symbols', + 'getmarketsummaries', // broken on COSS's end + 'market-price', + 'exchange-info', ], }, 'engine': { @@ -70,9 +73,6 @@ module.exports = class coss extends Exchange { 'get': [ 'account/balances', 'account/details', - 'getmarketsummaries', // fetchTicker (broken on COSS's end) - 'market-price', - 'exchange-info', ], 'post': [ 'order/add',
coss public endpoints moved to `public`
ccxt_ccxt
train
js
1a178326b1e9f8fc3f9abc46c38bb652e5d19464
diff --git a/org/postgresql/test/jdbc2/UpdateableResultTest.java b/org/postgresql/test/jdbc2/UpdateableResultTest.java index <HASH>..<HASH> 100644 --- a/org/postgresql/test/jdbc2/UpdateableResultTest.java +++ b/org/postgresql/test/jdbc2/UpdateableResultTest.java @@ -256,21 +256,21 @@ public class UpdateableResultTest extends TestCase assertEquals(2, rs.getInt(1)); assertEquals(string, rs.getString(2)); assertEquals(string, rs.getString(3)); - assertEquals(bytes, rs.getBytes(4)); + assertTrue(Arrays.equals(bytes, rs.getBytes(4))); rs.refreshRow(); assertEquals(2, rs.getInt(1)); assertEquals(string, rs.getString(2)); assertEquals(string, rs.getString(3)); - assertEquals(bytes, rs.getBytes(4)); + assertTrue(Arrays.equals(bytes, rs.getBytes(4))); rs.next(); assertEquals(3, rs.getInt(1)); assertEquals(string, rs.getString(2)); assertEquals(string, rs.getString(3)); - assertEquals(bytes, rs.getBytes(4)); + assertTrue(Arrays.equals(bytes, rs.getBytes(4))); rs.close(); stmt.close();
Ugggh, compiling is not the same as working. Junit's assertEquals converts things to strings which doesn't work for arrays. Use Arrays.equals instead.
pgjdbc_pgjdbc
train
java
604b033065b4609a335ed97b69b335cf722a2678
diff --git a/go/chat/flip/replay.go b/go/chat/flip/replay.go index <HASH>..<HASH> 100644 --- a/go/chat/flip/replay.go +++ b/go/chat/flip/replay.go @@ -89,6 +89,14 @@ func extractUserDevices(v []UserDeviceCommitment) []UserDevice { } func Replay(ctx context.Context, rh ReplayHelper, gh GameHistory) (*GameSummary, error) { + ret, err := replay(ctx, rh, gh) + if err != nil { + rh.CLogf(ctx, "Replay failure (%s); game dump: %+v", err, gh) + } + return ret, err +} + +func replay(ctx context.Context, rh ReplayHelper, gh GameHistory) (*GameSummary, error) { var game *Game var err error
debug the replay (#<I>)
keybase_client
train
go
1ecf22b094baef5a36e4484eac0f6df107157aff
diff --git a/src/Adr/src/Input.php b/src/Adr/src/Input.php index <HASH>..<HASH> 100644 --- a/src/Adr/src/Input.php +++ b/src/Adr/src/Input.php @@ -10,7 +10,7 @@ use Venta\Contracts\Adr\Input as InputContract; * * @package Venta\Adr */ -class Input implements InputContract +final class Input implements InputContract { /** * @inheritDoc
Adr Input class marked final.
venta_framework
train
php
b033dcb257aba054f8e7f00ee4b9656173b0e38e
diff --git a/linux_proc_extras/check.py b/linux_proc_extras/check.py index <HASH>..<HASH> 100644 --- a/linux_proc_extras/check.py +++ b/linux_proc_extras/check.py @@ -69,9 +69,7 @@ class MoreUnixCheck(AgentCheck): ctxt_count = float(line.split(' ')[1]) self.monotonic_count('system.linux.context_switches', ctxt_count, tags=self.tags) elif line.startswith('processes'): - self.log.info(line) process_count = int(line.split(' ')[1]) - self.log.info(process_count) self.monotonic_count('system.linux.processes_created', process_count, tags=self.tags) elif line.startswith('intr'): interrupts = int(line.split(' ')[1])
removes info logging (other diffs are purposeful)
DataDog_integrations-core
train
py
4243c5cd6aae60838f49cf228bc079fe8d1ec427
diff --git a/pyxid/internal.py b/pyxid/internal.py index <HASH>..<HASH> 100644 --- a/pyxid/internal.py +++ b/pyxid/internal.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- from struct import unpack -import time +import sys, time from .constants import NO_KEY_DETECTED, FOUND_KEY_DOWN, FOUND_KEY_UP, \ KEY_RELEASE_BITMASK, INVALID_PORT_BITS @@ -107,12 +107,20 @@ class XidConnection(object): def write(self, command): bytes_written = 0 + cmd_bytes = [] + + for i in command: + if (sys.version_info >= (3, 0)): + cmd_bytes += i.encode('latin1') + else: + cmd_bytes += i + if self.__needs_interbyte_delay: - for char in command: - bytes_written += self.serial_port.write(char.encode('ASCII')) + for char in cmd_bytes: + bytes_written += self.serial_port.write([char]) time.sleep(0.001) else: - bytes_written = self.serial_port.write(command.encode('ASCII')) + bytes_written = self.serial_port.write(cmd_bytes) return bytes_written
Making the set_pulse_duration function work more reliably.
cedrus-opensource_pyxid
train
py
0dad095c079d689c829f7d71a3cb62ec90debedb
diff --git a/i3pystatus/cpu_usage.py b/i3pystatus/cpu_usage.py index <HASH>..<HASH> 100644 --- a/i3pystatus/cpu_usage.py +++ b/i3pystatus/cpu_usage.py @@ -85,7 +85,7 @@ class CpuUsage(IntervalModule): continue core = core.replace('usage_', '') - string = self.formatter.format(format_string=self.format_all, + string = self.formatter.format(self.format_all, core=core, usage=usage) core_strings.append(string)
Python <I> compatibility fix (format_string is now positional only)
enkore_i3pystatus
train
py
4fa963dd647f01f8b5701a9a18ab657d88361e09
diff --git a/lib/ronin/sessions/esmtp.rb b/lib/ronin/sessions/esmtp.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/sessions/esmtp.rb +++ b/lib/ronin/sessions/esmtp.rb @@ -41,6 +41,12 @@ module Ronin options[:user] ||= @esmtp_user options[:password] ||= @esmtp_password + if @port + print_info "Connecting to #{@host}:#{@port} ..." + else + print_info "Connecting to #{@host} ..." + end + return ::Net.esmtp_connect(@host,options,&block) end
Added info output to Sessions::ESMTP.
ronin-ruby_ronin
train
rb
c3bec1acde4bbdeb17ead3b02c57ea63ec9da7ae
diff --git a/agent/tcs/client/client.go b/agent/tcs/client/client.go index <HASH>..<HASH> 100644 --- a/agent/tcs/client/client.go +++ b/agent/tcs/client/client.go @@ -15,7 +15,7 @@ package tcsclient import ( "bytes" - "errors" + "fmt" "net/http" "time" @@ -69,15 +69,17 @@ func New(url string, region string, credentialProvider credentials.AWSCredential func (cs *clientServer) Serve() error { log.Debug("Starting websocket poll loop") if cs.Conn == nil { - return errors.New("nil connection") + return fmt.Errorf("nil connection") } - // Start the timer function to publish metrics to the backend. - if cs.statsEngine != nil { - cs.publishTicker = time.NewTicker(cs.publishMetricsInterval) - go cs.publishMetrics() + if cs.statsEngine == nil { + return fmt.Errorf("uninitialized stats engine") } + // Start the timer function to publish metrics to the backend. + cs.publishTicker = time.NewTicker(cs.publishMetricsInterval) + go cs.publishMetrics() + return cs.ConsumeMessages() }
Don't consume messages in tcs if statsengine is empty
aws_amazon-ecs-agent
train
go
8e38c6072c742c11bbcb15611384fdec934ca2de
diff --git a/src/tweenjs/MotionGuidePlugin.js b/src/tweenjs/MotionGuidePlugin.js index <HASH>..<HASH> 100644 --- a/src/tweenjs/MotionGuidePlugin.js +++ b/src/tweenjs/MotionGuidePlugin.js @@ -286,7 +286,7 @@ this.createjs = this.createjs||{}; * @static */ MotionGuidePlugin.calc = function(data, ratio, target) { - if(data._segments == undefined){ MotionGuidePlugin.validate(data); } + if(data._segments == undefined){ throw("Missing critical pre-calculated information, please file a bug"); } if(target == undefined){ target = {x:0, y:0, rotation:0}; } var seg = data._segments; var path = data.path;
Removed unstubbed function call, replaced with throw.
CreateJS_TweenJS
train
js
a17d87070378786bbb138e1c9712ecad9aacf38e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ setup( license = 'MIT', packages = find_packages(exclude=['test-*']), install_requires = ['requests>=2.7.0'], - classifiers = ( + classifiers = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Science/Research', 'Intended Audience :: Developers', @@ -44,5 +44,5 @@ setup( 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7' - ) + ] )
classifiers needs to be a list, not a tuple
sckott_habanero
train
py
7b48c6a8cdd2bf3e239dc65f50eb3cbfed196fa7
diff --git a/src/com/google/javascript/jscomp/Result.java b/src/com/google/javascript/jscomp/Result.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/Result.java +++ b/src/com/google/javascript/jscomp/Result.java @@ -18,6 +18,7 @@ package com.google.javascript.jscomp; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; import java.util.Map; import java.util.Set; @@ -66,6 +67,7 @@ public class Result { } @VisibleForTesting + @Deprecated public Result( ImmutableList<JSError> errors, ImmutableList<JSError> warnings, @@ -87,4 +89,26 @@ public class Result { null, null); } + + /** + * Returns an almost empty result that is used for multistage compilation. + * + * <p>For multistage compilations, Result for stage1 only cares about errors and warnings. It is + * unnecessary to write all of other results in the disk. + */ + public static Result createResultForStage1(Result result) { + VariableMap emptyVariableMap = new VariableMap(ImmutableMap.of()); + return new Result( + result.errors, + result.warnings, + emptyVariableMap, + emptyVariableMap, + emptyVariableMap, + null, + null, + "", + null, + null, + null); + } }
Add a static method for stage1 compilation. This removes an annoying ErrorProne warning about unnecessary @VisibleForTesting. ------------- Created by MOE: <URL>
google_closure-compiler
train
java
c205551e7ff5993bb80ef6150ef3920c020e69b6
diff --git a/lib/sonos/topology_node.rb b/lib/sonos/topology_node.rb index <HASH>..<HASH> 100644 --- a/lib/sonos/topology_node.rb +++ b/lib/sonos/topology_node.rb @@ -15,7 +15,7 @@ module Sonos end def device - @device || Device::Base.detect(ip) + @device ||= Device::Base.detect(ip) end end end
Reuse devices created from topology nodes
gotwalt_sonos
train
rb
45c1679c52d23fbcd57a374624bf83ba4e55777e
diff --git a/src/Google/Service/Licensing/LicenseAssignmentList.php b/src/Google/Service/Licensing/LicenseAssignmentList.php index <HASH>..<HASH> 100644 --- a/src/Google/Service/Licensing/LicenseAssignmentList.php +++ b/src/Google/Service/Licensing/LicenseAssignmentList.php @@ -32,10 +32,16 @@ class Google_Service_Licensing_LicenseAssignmentList extends Google_Collection { return $this->etag; } + /** + * @param Google_Service_Licensing_LicenseAssignment + */ public function setItems($items) { $this->items = $items; } + /** + * @return Google_Service_Licensing_LicenseAssignment + */ public function getItems() { return $this->items;
Autogenerated update for licensing version v1 (<I>-<I>-<I>)
googleapis_google-api-php-client-services
train
php
2bd282d335e3b90ff8ae6261e89f381eab4d4649
diff --git a/src/classes/document.php b/src/classes/document.php index <HASH>..<HASH> 100644 --- a/src/classes/document.php +++ b/src/classes/document.php @@ -597,9 +597,37 @@ abstract class phpillowDocument public function attachFile( $fileName, $name = false, $mimeType = false ) { $name = ( $name === false ? basename( $fileName ) : $name ); + + $this->attachMemoryFile( + file_get_contents( $fileName ), + $name, + $mimeType + ); + } + + /** + * Attach file from memory to document + * + * The data passed to the method will be attached to the document and + * stored in the database. + * + * You need to specify a name to be used for storing the attachment data. + * + * You may optionally specify a custom mime type as third parameter. If set + * it will be used, but not verified, that it matches the actual file + * contents. If left empty the mime type defaults to + * 'application/octet-stream'. + * + * @param string $data + * @param string $name + * @param string $mimeType + * @return void + */ + public function attachMemoryFile( $data, $name, $mimeType = false ) + { $this->storage->_attachments[$name] = array( 'type' => 'base64', - 'data' => base64_encode( file_get_contents( $fileName ) ), + 'data' => base64_encode( $data ), 'content_type' => $mimeType === false ? 'application/octet-stream' : $mimeType, ); $this->modified = true;
- Implemented: Storage of attachments from memory instead of file git-svn-id: svn://arbitracker.org/phpillow/trunk@<I> c<I>fd1-f2a0-<I>e-a8e5-<I>dc<I>
Arbitracker_PHPillow
train
php
9a5194ca47a306df82a4bbf8203f75fc3ffa5258
diff --git a/js/chrome/esc.js b/js/chrome/esc.js index <HASH>..<HASH> 100644 --- a/js/chrome/esc.js +++ b/js/chrome/esc.js @@ -1,4 +1,7 @@ -$(document).keydown(function (event) { +var loginVisible = false, + dropdownOpen = false, + keyboardHelpVisible = false; +$document.keydown(function (event) { if (event.which == 27 || (keyboardHelpVisible && event.which == 191 && event.shiftKey && event.metaKey)) { if (keyboardHelpVisible) { $body.toggleClass('keyboardHelp'); @@ -12,6 +15,8 @@ $(document).keydown(function (event) { } else if (loginVisible) { $('#login').hide(); loginVisible = false; + } else if ($('#history').length && !$body.hasClass('panelsVisible')) { + $('#history').toggle(100); } } }); \ No newline at end of file
Little fun to show off jsbin logo (once it's all designed)
jsbin_jsbin
train
js
fe4a9ba6e9679c22e725e7eeef27772fcfd82e5c
diff --git a/auto_ml/predictor.py b/auto_ml/predictor.py index <HASH>..<HASH> 100644 --- a/auto_ml/predictor.py +++ b/auto_ml/predictor.py @@ -620,8 +620,8 @@ class Predictor(object): probas = uncertainty_calibration_predictions.uncertainty_prediction num_buckets = self.uncertainty_calibration_settings['num_buckets'] - bucket_labels = range(1, num_buckets + 1) - bucket_results = pd.qcut(probas, q=num_buckets, labels=bucket_labels, duplicates='drop') + # bucket_labels = range(1, num_buckets + 1) + bucket_results = pd.qcut(probas, q=num_buckets, duplicates='drop') uncertainty_calibration_predictions['bucket_num'] = bucket_results
removes bucket_labels from qcut entirely
ClimbsRocks_auto_ml
train
py
4939de35329628c5c6bb5ae95ae4e937d0d6e43d
diff --git a/src/Caffeinated/Shinobi/Models/Role.php b/src/Caffeinated/Shinobi/Models/Role.php index <HASH>..<HASH> 100644 --- a/src/Caffeinated/Shinobi/Models/Role.php +++ b/src/Caffeinated/Shinobi/Models/Role.php @@ -114,23 +114,4 @@ class Role extends Model { return $this->permissions()->detach(); } - - /** - * Magic __call method to handle dynamic methods. - * - * @param string $method - * @param array $arguments - * @return mixed - */ - public function __call($method, $arguments = array()) - { - // Handle canPermissionSlug() methods - if (starts_with($method, 'can') and $method !== 'can') { - $permission = substr($method, 3); - - return $this->can($permission); - } - - return parent::__call($method, $arguments); - } }
Remove magic __call method from Role model
caffeinated_shinobi
train
php
d766b3b72de59fab9cdff088f9cdc980765c5785
diff --git a/anndata/tests/test_io_warnings.py b/anndata/tests/test_io_warnings.py index <HASH>..<HASH> 100644 --- a/anndata/tests/test_io_warnings.py +++ b/anndata/tests/test_io_warnings.py @@ -1,4 +1,5 @@ from importlib.util import find_spec +from pathlib import Path import warnings import pytest @@ -12,7 +13,8 @@ def test_old_format_warning_thrown(): import scanpy as sc with pytest.warns(ad._warnings.OldFormatWarning): - sc.datasets.pbmc68k_reduced() + pth = Path(sc.datasets.__file__).parent / "10x_pbmc68k_reduced.h5ad" + ad.read_h5ad(pth) def test_old_format_warning_not_thrown(tmp_path):
Fix test now that scanpy does not throw OldFormatWarning when sc.datasets functions are called (#<I>)
theislab_anndata
train
py
161448cb11497a154353be476463aa8de61526b6
diff --git a/helpers/rubygem.rb b/helpers/rubygem.rb index <HASH>..<HASH> 100644 --- a/helpers/rubygem.rb +++ b/helpers/rubygem.rb @@ -26,8 +26,8 @@ module Helpers "#{@pkg_prefix}#{@version}.gem" end - def curl_enabled? - `which curl`.strip != "" + def logged_in? + File.exists?(File.expand_path('~/.gem/credentials')) end def build! @@ -35,11 +35,11 @@ module Helpers end def deploy! - raise "CURL needs to be enabled to push built gems!" if !curl_enabled? - puts "Uploading gem v#{@version} [#{pkg_path}]".red - `curl --data-binary @#{pkg_path} \ - -H 'Authorization:#{@api_key}' \ - https://rubygems.org/api/v1/gems` + if logged_in? + puts "Uploading gem v#{@version} [#{pkg_path}]".green + `gem push #{@pkg_path}` + else + puts "Not logged into RubyGems.org, skipping deploy!" end end end \ No newline at end of file
Relented. Fucking worthless RubyGems API
rex_server-gem
train
rb
b0a3cfa978d095c19e8703a8ad5d796bfef7c2c1
diff --git a/plugins/commands/plugin/action/repair_plugins.rb b/plugins/commands/plugin/action/repair_plugins.rb index <HASH>..<HASH> 100644 --- a/plugins/commands/plugin/action/repair_plugins.rb +++ b/plugins/commands/plugin/action/repair_plugins.rb @@ -14,14 +14,22 @@ module VagrantPlugins class RepairPlugins def initialize(app, env) @app = app + @logger = Log4r::Logger.new("vagrant::plugins::plugincommand::repair") end def call(env) env[:ui].info(I18n.t("vagrant.commands.plugin.repairing")) plugins = Vagrant::Plugin::Manager.instance.installed_plugins - Vagrant::Bundler.instance.init!(plugins, :repair) - env[:ui].info(I18n.t("vagrant.commands.plugin.repair_complete")) - + begin + Vagrant::Bundler.instance.init!(plugins, :repair) + env[:ui].info(I18n.t("vagrant.commands.plugin.repair_complete")) + rescue Exception => e + @logger.error("Failed to repair user installed plugins: #{e.class} - #{e}") + e.backtrace.each do |backtrace_line| + @logger.debug(backtrace_line) + end + env[:ui].error(I18n.t("vagrant.commands.plugin.repair_failed", message: e.message)) + end # Continue @app.call(env) end
Provide error information on plugin repair error. Also includes original exception information within logger output.
hashicorp_vagrant
train
rb
aac15accd72e3d0052be51819940864509b46dec
diff --git a/src/Processor/DatabaseProcessor/CriterionProcessor.php b/src/Processor/DatabaseProcessor/CriterionProcessor.php index <HASH>..<HASH> 100644 --- a/src/Processor/DatabaseProcessor/CriterionProcessor.php +++ b/src/Processor/DatabaseProcessor/CriterionProcessor.php @@ -85,7 +85,7 @@ abstract class CriterionProcessor implements DatabaseCriterionProcessor { $prefix = $field ? $field->getName() : 'value'; - return \snake_case($prefix . self::$parameterId++); + return \preg_replace('/\W+/u', '_', $prefix . self::$parameterId++); } /**
Fix queries pattern on deep field selections
rambler-digital-solutions_hydrogen
train
php
8c6c8e3876c3968f5794a29a540ce27924d49bc1
diff --git a/addon/components/object-list-view.js b/addon/components/object-list-view.js index <HASH>..<HASH> 100644 --- a/addon/components/object-list-view.js +++ b/addon/components/object-list-view.js @@ -264,7 +264,7 @@ export default FlexberryBaseComponent.extend({ _addRow: function(componentName) { if (componentName === this.get('componentName')) { var modelName = this.get('modelProjection').modelName; - var modelToAdd = this.store.createRecord(modelName, {}); + var modelToAdd = this.get('store').createRecord(modelName, {}); this.get('content').addObject(modelToAdd); this._addModel(modelToAdd); this.get('groupEditEventsService').rowAddedTrigger(componentName, modelToAdd);
Fixed wrong using of store property after injection store as service in 'object-list-view' component
Flexberry_ember-flexberry
train
js
105920867950cc0301f6e9c01f04b55dceb017e2
diff --git a/CalendarFXView/src/main/java/impl/com/calendarfx/view/CalendarViewSkin.java b/CalendarFXView/src/main/java/impl/com/calendarfx/view/CalendarViewSkin.java index <HASH>..<HASH> 100644 --- a/CalendarFXView/src/main/java/impl/com/calendarfx/view/CalendarViewSkin.java +++ b/CalendarFXView/src/main/java/impl/com/calendarfx/view/CalendarViewSkin.java @@ -503,6 +503,10 @@ public class CalendarViewSkin extends SkinBase<CalendarView> { PageBase selectedPage = view.getSelectedPage(); + if (!stackPane.getChildren().contains(selectedPage)) { + stackPane.getChildren().add(selectedPage); + } + selectedPage.setManaged(true); selectedPage.setVisible(true);
Also add the page to the StackPane if no animation is enabled
dlemmermann_CalendarFX
train
java
0cd68f6491433da0a6d46f94ffc9303c368d2b6d
diff --git a/frontend/dockerfile/dockerfile2llb/convert_runmount.go b/frontend/dockerfile/dockerfile2llb/convert_runmount.go index <HASH>..<HASH> 100644 --- a/frontend/dockerfile/dockerfile2llb/convert_runmount.go +++ b/frontend/dockerfile/dockerfile2llb/convert_runmount.go @@ -144,7 +144,9 @@ func dispatchRunMounts(d *dispatchState, c *instructions.RunCommand, sources []* out = append(out, llb.AddMount(target, st, mountOpts...)) - d.ctxPaths[path.Join("/", filepath.ToSlash(mount.Source))] = struct{}{} + if mount.From == "" { + d.ctxPaths[path.Join("/", filepath.ToSlash(mount.Source))] = struct{}{} + } } return out, nil }
dockerfile: do not add linked and cache paths to context sources
moby_buildkit
train
go
6d30835867e2a58ae3658d8605aff1964c3d2c31
diff --git a/src/vistir/path.py b/src/vistir/path.py index <HASH>..<HASH> 100644 --- a/src/vistir/path.py +++ b/src/vistir/path.py @@ -52,6 +52,8 @@ def _encode_path(path): path = getattr(path, "as_posix") except AttributeError: raise RuntimeError("Failed encoding path, unknown object type: %r" % path) + else: + path() else: path = path() path = Path(_decode_path(path))
right, we should actually create the path after we getattr for it
sarugaku_vistir
train
py
d5dc9ebdcd35252fbeeadcdd683e9a8310ca2604
diff --git a/agent/functional_tests/generators/simpletests.go b/agent/functional_tests/generators/simpletests.go index <HASH>..<HASH> 100644 --- a/agent/functional_tests/generators/simpletests.go +++ b/agent/functional_tests/generators/simpletests.go @@ -29,6 +29,7 @@ import ( "golang.org/x/tools/imports" ) +// TODO: add more awsvpc functional tests using simple test template var simpleTestPattern = ` // +build functional,%s
add a note to add awsvpc mode tests to existing functional tests
aws_amazon-ecs-agent
train
go
955844d949faaf7c052f7600d6f833fc346856ba
diff --git a/src/runway/util.py b/src/runway/util.py index <HASH>..<HASH> 100644 --- a/src/runway/util.py +++ b/src/runway/util.py @@ -246,10 +246,7 @@ def use_embedded_pkgs(embedded_lib_path=None): def which(program): - """Mimic 'which' command behavior. - - Adapted from https://stackoverflow.com/a/377028 - """ + """Mimic 'which' command behavior.""" def is_exe(fpath): """Determine if program exists and is executable.""" return os.path.isfile(fpath) and os.access(fpath, os.X_OK) @@ -277,7 +274,7 @@ def which(program): if is_exe(exe_file): return exe_file else: - for path in os.environ['PATH'].split(os.pathsep): + for path in os.environ.get('PATH').split(os.pathsep) if 'PATH' in os.environ else [os.getcwd()]: # noqa pylint: disable=line-too-long exe_file = os.path.join(path, i) if is_exe(exe_file): return exe_file
remove requirement for PATH environment variable This will probably never come up, but will stop an exception if the PATH environment variable isn't defined
onicagroup_runway
train
py
273828a1e3b6b9f9863cef2455c55c9b92560e08
diff --git a/lib/engine.py b/lib/engine.py index <HASH>..<HASH> 100644 --- a/lib/engine.py +++ b/lib/engine.py @@ -152,7 +152,11 @@ class Engine(object): for weight in plugin_list.GetWeightList(self.config.os): for plugin in plugin_list.GetWeight(self.config.os, weight): - plugin.Run() + try: + plugin.Run() + except errors.PreProcessFail as e: + logging.warning('Unable to run preprocessor: %s, reason: %s', + plugin.__class__.__name__, e) # Set the timezone. if hasattr(pre_obj, 'time_zone_str'):
Code review: <I>: These files are missing unit tes
log2timeline_plaso
train
py
4286fd2417c5eb55fb312e56c86f89264de56747
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -17,7 +17,13 @@ setup( 'Intended Audience :: Developers', 'Programming Language :: Python', 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Topic :: Software Development :: Libraries :: Python Modules'
pypi: added specific python versions supported
randomir_plucky
train
py
65b85e264b4233757338a4547193dc931657c1de
diff --git a/test/promised-read.js b/test/promised-read.js index <HASH>..<HASH> 100644 --- a/test/promised-read.js +++ b/test/promised-read.js @@ -389,7 +389,6 @@ function describePromisedReadWith(PassThrough) { var readData = []; function readAll(readable) { return read(input, 2).then(function(data) { - console.log('read', data); if (data) { readData.push(data); return readAll(readable); @@ -401,7 +400,6 @@ function describePromisedReadWith(PassThrough) { assert.deepEqual(result, Buffer.concat(inputData)); }); inputData.forEach(function(data) { - console.log('write', data); input.emit('data', data); }); input.emit('end');
Remove console.log These snuck in during some debugging. Remove them.
kevinoid_promised-read
train
js
b7a1e38e36c0c65486f4ff4809f3045b495360ca
diff --git a/src/Kafka/Consumer/Process.php b/src/Kafka/Consumer/Process.php index <HASH>..<HASH> 100644 --- a/src/Kafka/Consumer/Process.php +++ b/src/Kafka/Consumer/Process.php @@ -554,7 +554,7 @@ class Process break 2; } - $offsets[$topic['topicName']][$part['partition']] = $part['offset']; + $offsets[$topic['topicName']][$part['partition']] = $part['offset'] - 1; } } $assign->setFetchOffsets($offsets);
fix lost one message when consumer restart when consumer restart will lost first message in partisions i have send 5 messages ,but get only get 4 message my kafka version is <I>
weiboad_kafka-php
train
php
8172f59659fb2e8a47eca9f7dd17203fdb6701f0
diff --git a/src/test/java/integration/CustomWebDriverProviderTest.java b/src/test/java/integration/CustomWebDriverProviderTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/integration/CustomWebDriverProviderTest.java +++ b/src/test/java/integration/CustomWebDriverProviderTest.java @@ -8,6 +8,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; +import org.openqa.selenium.chrome.ChromeOptions; import org.openqa.selenium.remote.DesiredCapabilities; import static org.junit.jupiter.api.Assumptions.assumeTrue; @@ -33,12 +34,17 @@ class CustomWebDriverProviderTest extends BaseIntegrationTest { } private static class CustomChromeDriver extends ChromeDriver { + protected CustomChromeDriver(ChromeOptions options) { + super(options); + } } private static class CustomWebDriverProvider implements WebDriverProvider { @Override public WebDriver createDriver(DesiredCapabilities desiredCapabilities) { - return new CustomChromeDriver(); + ChromeOptions options = new ChromeOptions(); + options.setHeadless(true); + return new CustomChromeDriver(options); } } }
custom browser -> headless to avoid problems with other headless tests...
selenide_selenide
train
java
44a9e48af0f2ff381daf96cabffa009c08225ffa
diff --git a/ipyvolume/datasets.py b/ipyvolume/datasets.py index <HASH>..<HASH> 100644 --- a/ipyvolume/datasets.py +++ b/ipyvolume/datasets.py @@ -44,13 +44,20 @@ class Dataset(object): return self def download_command(self): - if os == "osx": - return "cd %s; curl -O -L %s" % (data_dir, self.url) - else: + use_wget = True # we prefer wget... + if osname in ["linux", "osx"]: # for linux + if os.system("wget --version > /dev/null") != 0: + use_wget = False + + if use_wget: return "wget --progress=bar:force -c -P %s %s" % (data_dir, self.url) + else: + return "cd %s; curl -O -L %s" % (data_dir, self.url) hdz2000 = Dataset("hdz2000") aquariusA2 = Dataset("aquarius-A2") egpbosLCDM = Dataset("egpbos-LCDM") zeldovich = Dataset("zeldovich", density=False) + +# low poly cat from: https://sketchfab.com/models/1e7143dfafd04ff4891efcb06949a0b4# \ No newline at end of file
fix: check if wget exists, if not use curl (rtd seems to miss wget)
maartenbreddels_ipyvolume
train
py
4b481c06567ddabb8620052da5fbb53af22551aa
diff --git a/openquake/calculators/ebrisk.py b/openquake/calculators/ebrisk.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/ebrisk.py +++ b/openquake/calculators/ebrisk.py @@ -334,7 +334,8 @@ class EventBasedRiskCalculator(event_based.EventBasedCalculator): """ :yields: pairs (gmf_df, param) """ - recs = self.datastore['gmf_data/by_task'][:] - recs.sort(order='task_no') - for task_no, start, stop in recs: - yield slice(start, stop), self.param + nrows = len(self.datastore['gmf_data/sid']) + ct = self.oqparam.concurrent_tasks or 1 + for slc in general.split_in_slices(nrows, ct): + print(slc) + yield slc, self.param
Changed event_based_risk to honor concurrent_tasks
gem_oq-engine
train
py
6ce055aa9758f024c8c5787229759186ff266bb5
diff --git a/src/Guzzle/Service/Command/AbstractCommand.php b/src/Guzzle/Service/Command/AbstractCommand.php index <HASH>..<HASH> 100644 --- a/src/Guzzle/Service/Command/AbstractCommand.php +++ b/src/Guzzle/Service/Command/AbstractCommand.php @@ -29,7 +29,7 @@ abstract class AbstractCommand extends Collection implements CommandInterface const RESPONSE_BODY = 'command.response_body'; // Option used to add request options to the request created by a command - const REQUEST_OPTIONS = 'command.options'; + const REQUEST_OPTIONS = 'command.request_options'; // command values to not count as additionalParameters const HIDDEN_PARAMS = 'command.hidden_params'; // Option used to disable any pre-sending command validation
Changing command.options to command.request_options
guzzle_guzzle3
train
php
e5d7f6b2644f4a8f061e06a999c642dba2db747c
diff --git a/lib/npolar/api/client.rb b/lib/npolar/api/client.rb index <HASH>..<HASH> 100644 --- a/lib/npolar/api/client.rb +++ b/lib/npolar/api/client.rb @@ -1,3 +1,6 @@ +require "rubygems" +require "bundler/setup" + require "yajl/json_gem" require "hashie" require "typhoeus"
require rubygems and bundler/setup
npolar_npolar-api-client-ruby
train
rb
5cdb90fb3220fc42e4efa14b77d594f924557ec5
diff --git a/src/components/DocumentApiComponent.php b/src/components/DocumentApiComponent.php index <HASH>..<HASH> 100644 --- a/src/components/DocumentApiComponent.php +++ b/src/components/DocumentApiComponent.php @@ -23,7 +23,7 @@ class DocumentApiComponent extends CachableBaseComponent const GET_PARAMETER_PATH = 'path'; const GET_PARAMETER_Q = 'q'; /** - * @var Response + * @var Response|string */ protected $response; @@ -142,7 +142,7 @@ class DocumentApiComponent extends CachableBaseComponent $path = substr($path, 1); } $folderDocument = $this->storage->getDocuments()->getDocumentFolderBySlug($path); - if ($folderDocument !== false && $folderDocument->type === 'folder') { + if ($folderDocument instanceof Document && $folderDocument->type === 'folder') { return $this->getFolderResponse($folderDocument); }
Fixed var type of response, did type check for folderDocument, because getFolderResponse only expects parameter of type Document
jenskooij_cloudcontrol
train
php
eb78344934e8feb0808883bbd99d9d4ad790a1db
diff --git a/lib/yap/shell/version.rb b/lib/yap/shell/version.rb index <HASH>..<HASH> 100644 --- a/lib/yap/shell/version.rb +++ b/lib/yap/shell/version.rb @@ -1,5 +1,5 @@ module Yap module Shell - VERSION = "0.1.1" + VERSION = "0.2.0" end end
Bumping version to <I>
zdennis_yap-shell-core
train
rb
4d38d736de85df9d77a6c1a8ad43eea80f7e9da9
diff --git a/lib/db/file.js b/lib/db/file.js index <HASH>..<HASH> 100644 --- a/lib/db/file.js +++ b/lib/db/file.js @@ -188,5 +188,8 @@ module.exports = utils.inherit(Object, { }, getUserBinCount: function (id, cb) { cb(null, { total: 0 }); // TODO read directory for count + }, + setProAccount: function(cb) { + cb(null, null); } });
Adding setProAccount method to file db
jsbin_jsbin
train
js
bfeb037957497fee8d8a64edcfe54ffb514affb4
diff --git a/easyaudit/signals/request_signals.py b/easyaudit/signals/request_signals.py index <HASH>..<HASH> 100644 --- a/easyaudit/signals/request_signals.py +++ b/easyaudit/signals/request_signals.py @@ -1,13 +1,20 @@ from Cookie import SimpleCookie +from django.contrib.auth import get_user_model from django.contrib.sessions.models import Session from django.core.signals import request_started from django.utils import timezone from easyaudit.models import RequestEvent -from easyaudit.settings import WATCH_REQUEST_EVENTS +from easyaudit.settings import UNREGISTERED_URLS, WATCH_REQUEST_EVENTS +import re def should_log_url(url): + # check if current url is blacklisted + for unregistered_url in UNREGISTERED_URLS: + pattern = re.compile(unregistered_url) + if pattern.match(url): + return False return True
Compares the current URL against a list of blacklisted URL regex.
soynatan_django-easy-audit
train
py
7d649442977942beb6b4fbc13577b9a95875c2ff
diff --git a/src/Leevel/Router/Proxy/Request.php b/src/Leevel/Router/Proxy/Request.php index <HASH>..<HASH> 100644 --- a/src/Leevel/Router/Proxy/Request.php +++ b/src/Leevel/Router/Proxy/Request.php @@ -218,7 +218,7 @@ class Request * @param array $server The SERVER parameters * @param null|resource|string $content The raw body data */ - public static function initialize(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null) + public static function initialize(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null): void { self::proxy()->initialize($query, $request, $attributes, $cookies, $files, $server, $content); }
fix(router): fix for phpstan level 5
hunzhiwange_framework
train
php
42dce23946ced3077a6c7b1cff01f805edc2c907
diff --git a/lib/natto/option_parse.rb b/lib/natto/option_parse.rb index <HASH>..<HASH> 100644 --- a/lib/natto/option_parse.rb +++ b/lib/natto/option_parse.rb @@ -104,7 +104,7 @@ module Natto SUPPORTED_OPTS.values.each do |k| if options.has_key? k key = k.to_s.gsub('_', '-') - if %w( all-morphs allocate-sentence ).include? key + if %w( all-morphs allocate-sentence partial ).include? key opt << "--#{key}" if options[k]==true else opt << "--#{key}=#{options[k]}"
Adding partial to options string builder. Issue <I>.
buruzaemon_natto
train
rb