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
976363514be29b578b5148b94a1fd7751d409536
diff --git a/src/main/java/com/greatmancode/craftconomy3/converter/ConverterList.java b/src/main/java/com/greatmancode/craftconomy3/converter/ConverterList.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/greatmancode/craftconomy3/converter/ConverterList.java +++ b/src/main/java/com/greatmancode/craftconomy3/converter/ConverterList.java @@ -24,6 +24,7 @@ public class ConverterList { public static HashMap<String,Converter> converterList = new HashMap<String,Converter>(); public ConverterList() { - converterList.put("iconomy", new Iconomy6()); + converterList.put("iconomy6", new Iconomy6()); + converterList.put("craftconomy2", new Craftconomy2()); } }
Load the converter for Craftconomy. Renamed iconomy to iconomy6.
greatman_craftconomy3
train
java
82538df41638c3eded3c7c39bb19530c36530ced
diff --git a/asammdf/gui/widgets/list.py b/asammdf/gui/widgets/list.py index <HASH>..<HASH> 100644 --- a/asammdf/gui/widgets/list.py +++ b/asammdf/gui/widgets/list.py @@ -405,7 +405,7 @@ class MinimalListWidget(QtWidgets.QListWidget): super().__init__(*args, **kwargs) - self.setDragDropMode(QtWidgets.QAbstractItemView.DragDrop) + self.setDragDropMode(QtWidgets.QAbstractItemView.InternalMove) self.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection) self.setAlternatingRowColors(True) diff --git a/requirements.txt b/requirements.txt index <HASH>..<HASH> 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ numexpr numpy>=1.21 pandas typing_extensions +isal diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -108,7 +108,7 @@ setup( "natsort", "psutil", "PyQt5>=5.15.0", - "pyqtgraph>=0.12.1", + "pyqtgraph>=0.12.3", "pyqtlet", "PyQtWebEngine", ],
fix drag and drop in the minimal list needs pyqtgraph <I>
danielhrisca_asammdf
train
py,txt,py
9cf16382a0df8388a3baf1667df5a9c3fea98c58
diff --git a/spec/guard/listeners/linux_spec.rb b/spec/guard/listeners/linux_spec.rb index <HASH>..<HASH> 100644 --- a/spec/guard/listeners/linux_spec.rb +++ b/spec/guard/listeners/linux_spec.rb @@ -24,6 +24,7 @@ describe Guard::Linux do describe "#start", :long_running => true do before(:each) do @listener = Guard::Linux.new + @listener.instance_variable_get(:@inotify).stub(:process) end it "calls watch_change on the first start" do @@ -40,7 +41,6 @@ describe Guard::Linux do start @listener.unstub!(:stop) stop - sleep 1 @listener.should_not be_watch_change end end
Stub inotify.process for control flow test. This is necessary, since JRuby doesn't exit process until an event is received.
guard_guard
train
rb
cc3ec6af72d981377f0b1b257677cd2100c9db00
diff --git a/src/FM/Keystone/Client/Factory.php b/src/FM/Keystone/Client/Factory.php index <HASH>..<HASH> 100644 --- a/src/FM/Keystone/Client/Factory.php +++ b/src/FM/Keystone/Client/Factory.php @@ -93,6 +93,11 @@ class Factory implements EventSubscriberInterface /** @var \Guzzle\Http\Message\Request $request */ $request = $event['request']; + // if this is the token-url, stop now because we won't be able to fetch a token + if ($request->getUrl() === $request->getClient()->getTokenUrl()) { + return; + } + // see if we have retries left if ($request->hasHeader('X-Auth-Retries')) { $headerValues = $request->getHeader('X-Auth-Retries')->toArray();
Fixed a bug which could cause infinite recursion when obtaining a token
financialmedia_keystone-client
train
php
12e0d2468f09ed107d240cd49b7b3f2b0e3d5dbe
diff --git a/lib/chef/http/validate_content_length.rb b/lib/chef/http/validate_content_length.rb index <HASH>..<HASH> 100644 --- a/lib/chef/http/validate_content_length.rb +++ b/lib/chef/http/validate_content_length.rb @@ -61,6 +61,7 @@ class Chef else validate(http_response, @content_length_counter.content_length) end + @content_length_counter = nil # XXX: quickfix to CHEF-5100 return [http_response, rest_request, return_value] end
CHEF-<I>: reset state for streamed downloads quick fix to "free" our state from one streamed download request so that we don't pollute the state of the next streamed request.
chef_chef
train
rb
8713f859a44b5d91b49b81f8ad4a87cd867a21cf
diff --git a/selene/core/match.py b/selene/core/match.py index <HASH>..<HASH> 100644 --- a/selene/core/match.py +++ b/selene/core/match.py @@ -22,15 +22,15 @@ import warnings from typing import List, Any -from selene.core import query from selene.common import predicate +from selene.core import query from selene.core.condition import Condition -from selene.core.entity import Collection, Element, Browser from selene.core.conditions import ( ElementCondition, CollectionCondition, BrowserCondition, ) +from selene.core.entity import Collection, Element, Browser # todo: consider moving to selene.match.element.is_visible, etc... element_is_visible: Condition[Element] = ElementCondition.raise_if_not( @@ -464,7 +464,8 @@ def browser_has_tabs_number_less_than_or_equal( def browser_has_js_returned( - expected: Any, script: str, *args) -> Condition[Browser]: + expected: Any, script: str, *args +) -> Condition[Browser]: def script_result(browser: Browser): return browser.driver.execute_script(script, *args)
fix selene/core/match.py:<I>:5: E<I> continuation line with same indent as next logical line
yashaka_selene
train
py
9e8ad9c3c5a3ec2cdd5715ab81b8cd87cb9f1eb2
diff --git a/src/main/java/org/psjava/ds/geometry/PointByXYComparator.java b/src/main/java/org/psjava/ds/geometry/PointByXYComparator.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/psjava/ds/geometry/PointByXYComparator.java +++ b/src/main/java/org/psjava/ds/geometry/PointByXYComparator.java @@ -6,15 +6,9 @@ import org.psjava.util.SeriesComparator; public class PointByXYComparator { + @SuppressWarnings("unchecked") public static <T> Comparator<Point2D<T>> create(Comparator<T> comp) { - @SuppressWarnings("unchecked") - final Comparator<Point2D<T>> series = SeriesComparator.create(PointByXComparator.create(comp), PointByYComparator.create(comp)); - return new Comparator<Point2D<T>>() { - @Override - public int compare(Point2D<T> o1, Point2D<T> o2) { - return series.compare(o1, o2); - } - }; + return SeriesComparator.create(PointByXComparator.create(comp), PointByYComparator.create(comp)); } private PointByXYComparator() {
refactoring - make code simpler PointByXYComparator
psjava_psjava
train
java
5decc9448e90c119f20e8b945b64fc7fca28590c
diff --git a/packages/cli/src/util.js b/packages/cli/src/util.js index <HASH>..<HASH> 100644 --- a/packages/cli/src/util.js +++ b/packages/cli/src/util.js @@ -62,9 +62,5 @@ export function formatExportName(name) { return `Svg${name}` } - if (/[-]/g.test(name)) { - return camelcase(name, { pascalCase: true }) - } - - return name + return camelcase(name, { pascalCase: true }) } diff --git a/packages/cli/src/util.test.js b/packages/cli/src/util.test.js index <HASH>..<HASH> 100644 --- a/packages/cli/src/util.test.js +++ b/packages/cli/src/util.test.js @@ -34,6 +34,7 @@ describe('util', () => { describe('#formatExportName', () => { it('should ensure a valid export name', () => { + expect(formatExportName('foo')).toBe('Foo') expect(formatExportName('foo-bar')).toBe('FooBar') expect(formatExportName('2foo')).toBe('Svg2foo') expect(formatExportName('2foo-bar')).toBe('Svg2FooBar')
fix: formatExportName for single names (#<I>)
smooth-code_svgr
train
js,js
c9d46545925f6e0ce946d3de660944cff481a7cb
diff --git a/pkg/services/notifications/notifications.go b/pkg/services/notifications/notifications.go index <HASH>..<HASH> 100644 --- a/pkg/services/notifications/notifications.go +++ b/pkg/services/notifications/notifications.go @@ -48,7 +48,7 @@ func Init() error { } if !util.IsEmail(setting.Smtp.FromAddress) { - return errors.New("Invalid email address for smpt from_adress config") + return errors.New("Invalid email address for smpt from_address config") } if setting.EmailCodeValidMinutes == 0 {
s/from_adress/from_address
grafana_grafana
train
go
bedf142f7ffea556883fde1255c1c4a4d66485aa
diff --git a/cdrouter/configs.py b/cdrouter/configs.py index <HASH>..<HASH> 100644 --- a/cdrouter/configs.py +++ b/cdrouter/configs.py @@ -248,7 +248,7 @@ class ConfigsService(object): :rtype: string """ - return self.service.get(self.base, params={'template': 'default'}).text + return self.service.get(self.base, params={'template': 'default'}).json()['data'] def get(self, id): # pylint: disable=invalid-name,redefined-builtin """Get a config.
Fix ConfigsService.get_new method Fix the ConfigsService.get_new method such that it returns just the plain-text contents of a new config file and not the full JSON object response as a string.
qacafe_cdrouter.py
train
py
86e751acb35ebe618d33f7c7caecf61f087298f8
diff --git a/geth/wrapper.py b/geth/wrapper.py index <HASH>..<HASH> 100644 --- a/geth/wrapper.py +++ b/geth/wrapper.py @@ -89,7 +89,8 @@ def construct_test_chain_kwargs(**overrides): overrides.setdefault('ipc_api', ALL_APIS) overrides.setdefault('verbosity', '5') - overrides.setdefault('shh', True) + if 'shh' in overrides: + overrides.setdefault('shh', overrides['shh']) return overrides
Shh is enabled only when it is passed in overrides
ethereum_py-geth
train
py
f8dc187599e755124130e0c2c31bad1ed5175df6
diff --git a/dfs/snapshot.go b/dfs/snapshot.go index <HASH>..<HASH> 100644 --- a/dfs/snapshot.go +++ b/dfs/snapshot.go @@ -40,6 +40,13 @@ func (dfs *DistributedFilesystem) Snapshot(data SnapshotInfo) (string, error) { glog.Errorf("Could not find image %s for snapshot: %s", image, err) return "", err } + + // make sure we actually have the image locally before changing the tag and triggering a push + if _, err := dfs.reg.FindImage(rImage); err != nil { + glog.Errorf("Could not find image %s locally for snapshot: %s", rImage.String(), err) + return "", err + } + rImage.Tag = label if err := dfs.index.PushImage(rImage.String(), rImage.UUID, rImage.Hash); err != nil { glog.Errorf("Could not retag image %s for snapshot: %s", image, err)
When performing a snapshot, make sure we have the images locally before tagging them in the registry and triggering a push
control-center_serviced
train
go
ca08d0b2e14404d14bba9a544efd96055faee734
diff --git a/bookstore/publish.py b/bookstore/publish.py index <HASH>..<HASH> 100644 --- a/bookstore/publish.py +++ b/bookstore/publish.py @@ -2,7 +2,7 @@ import json import aiobotocore - +from botocore.exceptions import ClientError from nbformat import ValidationError, validate as validate_nb from notebook.base.handlers import APIHandler, path_regex from notebook.services.contents.handlers import validate_model @@ -90,11 +90,15 @@ class BookstorePublishAPIHandler(APIHandler): region_name=self.bookstore_settings.s3_region_name, ) as client: self.log.info("Processing published write of %s", path) - obj = await client.put_object( - Bucket=self.bookstore_settings.s3_bucket, - Key=s3_object_key, - Body=json.dumps(content), - ) + try: + obj = await client.put_object( + Bucket=self.bookstore_settings.s3_bucket, + Key=s3_object_key, + Body=json.dumps(content), + ) + except ClientError as e: + status_code = e.response['ResponseMetadata'].get('HTTPStatusCode') + raise web.HTTPError(status_code, e.args[0]) self.log.info("Done with published write of %s", path) resp_content = self.prepare_response(path, obj)
Add error handling we use in clone for catching & converting s3 errors
nteract_bookstore
train
py
a849ce608e02a74a726920f402ef39de2f8a7279
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -9,9 +9,9 @@ if __name__ == '__main__': setup( version='0.1.dev4', name='pyinfra', - description='Stateful deploy with Python.', - author='Nick @ Oxygem', - author_email='nick@oxygem.com', + description='Deploy stuff by diff-ing the state you want against the remote server.', + author='Nick / Fizzadar', + author_email='pointlessrambler@gmail.com', url='http://github.com/Fizzadar/pyinfra', packages=[ 'pyinfra',
Updated author/name/desc.
Fizzadar_pyinfra
train
py
7ed6d35f2cbd21ee5b6ec019787a664003097ced
diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - const VERSION = '4.4.0-RC1'; + const VERSION = '4.4.0-DEV'; const VERSION_ID = 40400; const MAJOR_VERSION = 4; const MINOR_VERSION = 4; const RELEASE_VERSION = 0; - const EXTRA_VERSION = 'RC1'; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '11/2022'; const END_OF_LIFE = '11/2023';
bumped Symfony version to <I>
symfony_symfony
train
php
46f034051cf597e4b0c501ae6ea7855b7ffe6a36
diff --git a/lib/ruote/engine.rb b/lib/ruote/engine.rb index <HASH>..<HASH> 100644 --- a/lib/ruote/engine.rb +++ b/lib/ruote/engine.rb @@ -331,12 +331,12 @@ module Ruote # This operation is substantially less costly than Engine#processes (though # the 'how substantially' depends on the storage chosen). # - def process_wfids + def process_ids @context.storage.expression_wfids({}) end - alias process_ids process_wfids + alias process_wfids process_ids # Shuts down the engine, mostly passes the shutdown message to the other # services and hope they'll shut down properly.
prefer Engine#process_ids over #process_wfids
jmettraux_ruote
train
rb
18e76edc95c4dad12bbca6e5c1b7c8931a22ed5b
diff --git a/src/test/php/ParseTest.php b/src/test/php/ParseTest.php index <HASH>..<HASH> 100644 --- a/src/test/php/ParseTest.php +++ b/src/test/php/ParseTest.php @@ -643,7 +643,7 @@ class ParseTest extends \PHPUnit_Framework_TestCase [['foo', 'bar', 'baz'], '[foo|bar|baz]'], [[1, 2, 3, 4, 5], '1..5'], [['a', 'b', 'c', 'd', 'e'], 'a..e'], - [new \ReflectionClass($this), __CLASS__ . '.class'], + [new \ReflectionClass(__CLASS__), __CLASS__ . '.class'], [MyClass::TEST_CONSTANT, MyClass::class . '::TEST_CONSTANT'], ['just a string', 'just a string'] ];
don't use instance, will yield another result on HHVM
stubbles_stubbles-values
train
php
be056d4b4574e107b7483788ec3389fb166baed1
diff --git a/src/Text.php b/src/Text.php index <HASH>..<HASH> 100644 --- a/src/Text.php +++ b/src/Text.php @@ -25,13 +25,9 @@ class Text extends Element } /** The maximum length of the field. */ - public function maxLength($length, $size = null) + public function maxLength($length) { - if (!isset($size)) { - $size = min(32, $length); - } $this->attributes['maxlength'] = (int)$length; - $this->attributes['size'] = (int)$size; return $this->addTest('maxlength', function($value) use ($length) { return mb_strlen(trim($value), 'UTF-8') <= (int)$length; });
we have a separate method for size, so this is bollocks
monolyth-php_formulaic
train
php
eccfa9dedf6845134f376efd9ff95979ca375c93
diff --git a/lib/atomo/ast/global.rb b/lib/atomo/ast/global.rb index <HASH>..<HASH> 100644 --- a/lib/atomo/ast/global.rb +++ b/lib/atomo/ast/global.rb @@ -4,7 +4,7 @@ module Atomo g.sp = g.kleene g.any(" ", "\n", :comment) g.sig_sp = g.many g.any(" ", "\n", :comment) - ident_start = /(?![&@#$~`:])[\p{L}\p{S}_!@#%&*\-.\/\?]/u + ident_start = /(?![&@#\$~`:])[\p{L}\p{S}_!@#%&*\-.\/\?]/u ident_letters = /((?!`)[\p{L}\p{S}_!@#%&*\-.\/\?])*/u g.identifier = @@ -16,7 +16,7 @@ module Atomo c + cs end - op_start = /(?![@#$~`])[\p{S}!@#%&*\-.\/\?:]/u + op_start = /(?![@#\$~`])[\p{S}!@#%&*\-.\/\?:]/u op_letters = /((?!`)[\p{S}!@#%&*\-.\/\?:])*/u g.operator =
corrected $ being allowed at the start of identifier/operator names
vito_atomy
train
rb
f41728c2f9853655f3d888f10c2e2c19c069a00c
diff --git a/FML/Script/Builder.php b/FML/Script/Builder.php index <HASH>..<HASH> 100644 --- a/FML/Script/Builder.php +++ b/FML/Script/Builder.php @@ -49,10 +49,10 @@ abstract class Builder { if (!fmod($value, 1)) $stringVal .= '.'; return $stringVal; } - + /** * Get the Boolean String-Representation of the given Value - * + * * @param bool $value The Value to convert to a ManiaScript Boolean * @return string */ @@ -63,4 +63,31 @@ abstract class Builder { } return "False"; } + + /** + * Get the Include Command for the given File and Namespace + * + * @param string $file Include File + * @param string $namespace Include Namespace + * @return string + */ + public static function getInclude($file, $namespace) { + $includeText = "#Include \"{$file}\" as {$namespace}" . PHP_EOL; + return $includeText; + } + + /** + * Get the Constant Command for the given Name and Value + * + * @param string $name Constant Name + * @param string $value Constant Value + * @return string + */ + public static function getConstant($name, $value) { + if (is_string($value)) { + $value = '"' . $value . '"'; + } + $constantText = "#Const {$name} {$value}" . PHP_EOL; + return $constantText; + } }
added methods for include & constant commands
steeffeen_FancyManiaLinks
train
php
a92d83a53295827a314498f5e7a63b46fe782db7
diff --git a/modules/citrus-ftp/src/main/java/com/consol/citrus/ftp/client/ScpClientBuilder.java b/modules/citrus-ftp/src/main/java/com/consol/citrus/ftp/client/ScpClientBuilder.java index <HASH>..<HASH> 100644 --- a/modules/citrus-ftp/src/main/java/com/consol/citrus/ftp/client/ScpClientBuilder.java +++ b/modules/citrus-ftp/src/main/java/com/consol/citrus/ftp/client/ScpClientBuilder.java @@ -65,6 +65,19 @@ public class ScpClientBuilder extends AbstractEndpointBuilder<ScpClient> { } /** + * Sets the auto read files property. + * + * @param autoReadFiles + * @return + * @deprecated received files are always read automatically making this flag obsolete + */ + @Deprecated + public ScpClientBuilder autoReadFiles(boolean autoReadFiles) { + endpoint.getEndpointConfiguration().setAutoReadFiles(autoReadFiles); + return this; + } + + /** * Sets the client username. * @param username * @return
(#<I>) reverted removal of autoReadFiles method to prevent breaking change
citrusframework_citrus
train
java
7ccf4279664d8afcbef5b7437764770a86769d37
diff --git a/ui/src/shared/functions.js b/ui/src/shared/functions.js index <HASH>..<HASH> 100644 --- a/ui/src/shared/functions.js +++ b/ui/src/shared/functions.js @@ -1,7 +1,6 @@ module.exports = { remCalc: function(values) { - values = values.replace('px', ''); - values = values.split(' '); + values = values.replace('px', '').split(' '); let outputRems = ''; const base = 16;
refactoring rem function
yldio_joyent-portal
train
js
09e25c5882a83f87a3daabb82105e54509ed7580
diff --git a/safe/definitions/fields.py b/safe/definitions/fields.py index <HASH>..<HASH> 100644 --- a/safe/definitions/fields.py +++ b/safe/definitions/fields.py @@ -1161,6 +1161,8 @@ from safe.definitions.minimum_needs import minimum_needs_fields # noqa count_fields = [ feature_value_field, population_count_field, + displaced_field, + fatalities_field, female_count_field, male_count_field, youth_count_field,
add displaced and fatalities to count_fields
inasafe_inasafe
train
py
6b96a155c08393a212c34f32780400fcfcfdced7
diff --git a/core/model/src/main/java/it/unibz/inf/ontop/iq/node/normalization/impl/LeftJoinNormalizerImpl.java b/core/model/src/main/java/it/unibz/inf/ontop/iq/node/normalization/impl/LeftJoinNormalizerImpl.java index <HASH>..<HASH> 100644 --- a/core/model/src/main/java/it/unibz/inf/ontop/iq/node/normalization/impl/LeftJoinNormalizerImpl.java +++ b/core/model/src/main/java/it/unibz/inf/ontop/iq/node/normalization/impl/LeftJoinNormalizerImpl.java @@ -638,6 +638,7 @@ public class LeftJoinNormalizerImpl implements LeftJoinNormalizer { ImmutableSubstitution<Constant> nullSubstitution = substitutionFactory.getSubstitution( immutableTerm.getVariableStream() .filter(v -> !leftVariables.contains(v)) + .distinct() .collect(ImmutableCollectors.toMap( v -> v, v -> termFactory.getNullConstant())));
Minor bugfix in LeftJoinNormalizerImpl.
ontop_ontop
train
java
59cbbfb682380d1150c474d05d57892e8868070b
diff --git a/pynes/tests/clc_test.py b/pynes/tests/clc_test.py index <HASH>..<HASH> 100644 --- a/pynes/tests/clc_test.py +++ b/pynes/tests/clc_test.py @@ -10,13 +10,12 @@ from pynes.compiler import lexical, syntax, semantic class ClcTest(unittest.TestCase): - def test_clc_sngl(self): tokens = lexical('CLC') - self.assertEquals(1 , len(tokens)) + self.assertEquals(1, len(tokens)) self.assertEquals('T_INSTRUCTION', tokens[0]['type']) ast = syntax(tokens) - self.assertEquals(1 , len(ast)) + self.assertEquals(1, len(ast)) self.assertEquals('S_IMPLIED', ast[0]['type']) code = semantic(ast) - self.assertEquals(code, [0x18]) \ No newline at end of file + self.assertEquals(code, [0x18])
PEP8 fixes on tests/clc_test.py
gutomaia_nesasm_py
train
py
634f8ada1a8c10781672bba6e8fe8a5164f303af
diff --git a/src/Layers/BasemapLayer.js b/src/Layers/BasemapLayer.js index <HASH>..<HASH> 100644 --- a/src/Layers/BasemapLayer.js +++ b/src/Layers/BasemapLayer.js @@ -156,6 +156,10 @@ bounds: null, zoom: null, onAdd: function(map){ + if(!map.attributionControl && console){ + console.warn("L.esri.BasemapLayer requires attribution. Please set attributionControl to true on your map"); + return; + } L.TileLayer.prototype.onAdd.call(this, map); if(this._dynamicAttribution){ this.on("load", this._handleTileUpdates, this);
fail with a console.warn to fix #<I>
Esri_esri-leaflet
train
js
954861466015beda64a85963b96939b3b8cf2836
diff --git a/resources/api/src/main/java/org/jboss/forge/addon/resource/AbstractFileResource.java b/resources/api/src/main/java/org/jboss/forge/addon/resource/AbstractFileResource.java index <HASH>..<HASH> 100644 --- a/resources/api/src/main/java/org/jboss/forge/addon/resource/AbstractFileResource.java +++ b/resources/api/src/main/java/org/jboss/forge/addon/resource/AbstractFileResource.java @@ -435,7 +435,15 @@ public abstract class AbstractFileResource<T extends FileResource<T>> extends Ab protected FileResourceOperations getFileOperations() { - ResourceTransaction transaction = resourceFactory.getTransaction(); + ResourceTransaction transaction; + try + { + transaction = resourceFactory.getTransaction(); + } + catch (UnsupportedOperationException uoe) + { + return DefaultFileOperations.INSTANCE; + } if (transaction.isStarted()) { // TODO: how will other resource types participate in a transaction? XA?
Returning default FileOperations if ResourceFactory impl does not support transactions
forge_core
train
java
1fc4ea49939d9f446393360e1280172511478c1b
diff --git a/tests/Imbo/IntegrationTest/Cache/APCTest.php b/tests/Imbo/IntegrationTest/Cache/APCTest.php index <HASH>..<HASH> 100644 --- a/tests/Imbo/IntegrationTest/Cache/APCTest.php +++ b/tests/Imbo/IntegrationTest/Cache/APCTest.php @@ -18,8 +18,8 @@ use Imbo\Cache\APC; */ class APCTest extends CacheTests { protected function getDriver() { - if (!extension_loaded('apc')) { - $this->markTestSkipped('APC is not installed'); + if (!extension_loaded('apc') && !extension_loaded('apcu')) { + $this->markTestSkipped('APC(u) is not installed'); } if (!ini_get('apc.enable_cli')) {
Allow the usage of pecl/apcu as well
imbo_imbo
train
php
7a55f1dd941a3362c028cc8710c0d0e166366859
diff --git a/src/edeposit/amqp/storage/settings.py b/src/edeposit/amqp/storage/settings.py index <HASH>..<HASH> 100755 --- a/src/edeposit/amqp/storage/settings.py +++ b/src/edeposit/amqp/storage/settings.py @@ -45,7 +45,12 @@ PRIVATE_INDEX_PASSWORD = "" #: Password for private index. You HAVE TO set it. PUBLIC_DIR = "" #: Path to the directory for public publications. PRIVATE_DIR = "" #: Path to the private directory, for non-downloadabe pubs. -ARCHIVE_DIR = "" #: Path to the directory, where the archives will be stored +ARCHIVE_DIR = "" #: Path to the directory, where the archives will be stored. + +#: Path to the file saved on HNAS, which is used to indicate that HNAS is +#: mounted. +HNAS_INDICATOR = "" +HNAS_IND_ALLOWED = True #: Should the HNAS indicator be used or not? WEB_ADDR = "localhost" #: Address where the webserver should listen. WEB_PORT = 8080 #: Port for the webserver.
#<I>: Added two new options HNAS_INDICATOR and HNAS_IND_ALLOWED.
edeposit_edeposit.amqp.storage
train
py
ca5104a7592c0772fd88289423fa4343742aff6b
diff --git a/raven/base.py b/raven/base.py index <HASH>..<HASH> 100644 --- a/raven/base.py +++ b/raven/base.py @@ -443,7 +443,8 @@ class Client(object): interfaces. Any key which contains a '.' will be assumed to be a data interface. :param date: the datetime of this event - :param time_spent: a float value representing the duration of the event + :param time_spent: a integer value representing the duration of the + event (in milliseconds) :param event_id: a 32-length unique string identifying this event :param extra: a dictionary of additional standard metadata :param culprit: a string representing the cause of this event
clarify time_spent, and note that it should be an integer
getsentry_raven-python
train
py
297349d8ed473e4b63890cddb09d939fa2ee3551
diff --git a/skorch/exceptions.py b/skorch/exceptions.py index <HASH>..<HASH> 100644 --- a/skorch/exceptions.py +++ b/skorch/exceptions.py @@ -1,11 +1,13 @@ """Contains skorch-specific exceptions and warnings.""" +from sklearn.exceptions import NotFittedError + class SkorchException(BaseException): """Base skorch exception.""" -class NotInitializedError(SkorchException): +class NotInitializedError(SkorchException, NotFittedError): """Module is not initialized, please call the ``.initialize`` method or train the model by calling ``.fit(...)``.
NotInitializedError inherits from NotFittedError (#<I>) This ensures that a user can catch the sklearn `NotFittedError`, just as they can with regular sklearn estimators. As discussed in [1]. [1] <URL>
skorch-dev_skorch
train
py
9ea54597dc28034c9e6ba916aa83bb9d73c43c83
diff --git a/dramatiq/results/backends/redis.py b/dramatiq/results/backends/redis.py index <HASH>..<HASH> 100644 --- a/dramatiq/results/backends/redis.py +++ b/dramatiq/results/backends/redis.py @@ -31,7 +31,7 @@ class RedisBackend(ResultBackend): client(Redis): An optional client. If this is passed, then all other parameters are ignored. url(str): An optional connection URL. If both a URL and - connection paramters are provided, the URL is used. + connection parameters are provided, the URL is used. **parameters(dict): Connection parameters are passed directly to :class:`redis.Redis`.
doc: added missing character in docstring (#<I>)
Bogdanp_dramatiq
train
py
8a62d542769fb26dcdec895570a49ffcebeca9a4
diff --git a/test/test_transforms.py b/test/test_transforms.py index <HASH>..<HASH> 100644 --- a/test/test_transforms.py +++ b/test/test_transforms.py @@ -1852,8 +1852,10 @@ def test_randomperspective(): ) +@pytest.mark.parametrize("seed", range(10)) @pytest.mark.parametrize("mode", ["L", "RGB", "F"]) -def test_randomperspective_fill(mode): +def test_randomperspective_fill(mode, seed): + torch.random.manual_seed(seed) # assert fill being either a Sequence or a Number with pytest.raises(TypeError):
Set seed of test_randomperspective_fill (#<I>) * setting <I> seeds, let's see if it fails * Passed with <I>, so setting <I>
pytorch_vision
train
py
070322215af84e5b7dccdf462d172de6eaa53d80
diff --git a/bpc8583/transaction.py b/bpc8583/transaction.py index <HASH>..<HASH> 100644 --- a/bpc8583/transaction.py +++ b/bpc8583/transaction.py @@ -55,7 +55,8 @@ class Transaction(): self.IsoMessage.FieldData(35, self.card.get_track2()) else: - return + print('Unknown transaction type: {}'.format(_type)) + return None # Common message fields: self.IsoMessage.FieldData(7, get_datetime())
Showing 'Unknown transaction type:'
timgabets_bpc8583
train
py
d7947f37ca9b6e1c3af73c2c5b969fe0d3a037de
diff --git a/spyder/plugins/explorer/widgets/explorer.py b/spyder/plugins/explorer/widgets/explorer.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/explorer/widgets/explorer.py +++ b/spyder/plugins/explorer/widgets/explorer.py @@ -433,7 +433,24 @@ class DirView(QTreeView): def create_file_new_actions(self, fnames): """Return actions for submenu 'New...'""" - root_path = self.fsmodel.rootPath() + if not fnames: + root_path = self.fsmodel.rootPath() + else: + # Verify if the user is trying to add something new inside a folder + # so it can be added in that folder and not in the rootpath + # See spyder-ide/spyder#13444 + level_list = [] + current_index = self.currentIndex() + if current_index.isValid(): + level_list.append(current_index.data()) + + while current_index.isValid(): + current_index = current_index.parent() + if current_index.data() is not None: + level_list.insert(0, current_index.data()) + + root_path = osp.join(*level_list) + new_file_act = create_action(self, _("File..."), icon=ima.icon('TextFileIcon'), triggered=lambda:
Add support for adding new files/folders/etc in the selected directory on the explorer tree
spyder-ide_spyder
train
py
5e1503698ee24fef0657bf9984d10c56cac38842
diff --git a/hvac/v1/__init__.py b/hvac/v1/__init__.py index <HASH>..<HASH> 100644 --- a/hvac/v1/__init__.py +++ b/hvac/v1/__init__.py @@ -44,7 +44,7 @@ class Client(object): """ return self._get('/v1/sys/init').json()['initialized'] - def initialize(self, secret_shares=5, secret_threshold=3): + def initialize(self, secret_shares=5, secret_threshold=3, pgp_keys=None): """ PUT /sys/init """ @@ -53,6 +53,12 @@ class Client(object): 'secret_threshold': secret_threshold, } + if pgp_keys: + if len(pgp_keys) != secret_shares: + raise ValueError('Length of pgp_keys must equal secret shares') + + params['pgp_keys'] = pgp_keys + return self._put('/v1/sys/init', json=params).json() @property
Add support for PGP encryption for unseal keys Added in Vault <I>
hvac_hvac
train
py
ca9acf186f9c54c930b2184492dce50832bcf21e
diff --git a/tests/FontAwesomeTest.php b/tests/FontAwesomeTest.php index <HASH>..<HASH> 100755 --- a/tests/FontAwesomeTest.php +++ b/tests/FontAwesomeTest.php @@ -11,7 +11,7 @@ class FontAwesomeTest extends \PHPUnit_Framework_TestCase { public function testCdnLinkOutput() { - $this->expectOutputString('<link href="//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">'); + $this->expectOutputString('<link href="//netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">'); echo FontAwesome::css(); }
Update FontAwesomeTest.php Fixing the test for the CDN output verification.
kevinkhill_FontAwesomePHP
train
php
08b993c7da72cf99bf036624885fcfb476660a5e
diff --git a/lib/init/build.js b/lib/init/build.js index <HASH>..<HASH> 100644 --- a/lib/init/build.js +++ b/lib/init/build.js @@ -3,6 +3,10 @@ var utils = require('utilities') , fs = require('fs'); var init = function (app, callback) { + + if (app.config.disableBuild) { + return; + } setupModels(app); setupSharedHelpers(app);
Allow to disable build The build triggers node supervisor on OpenShift, so if you don' need it, it would be nice if it could be turned off.
mde_ejs
train
js
d9bc394bf0367f08cf9d1412e1dbd2d442e18e2b
diff --git a/lib/validates_formatting_of/version.rb b/lib/validates_formatting_of/version.rb index <HASH>..<HASH> 100644 --- a/lib/validates_formatting_of/version.rb +++ b/lib/validates_formatting_of/version.rb @@ -1,3 +1,3 @@ module ValidatesFormattingOf - VERSION = "0.4.1" + VERSION = "0.5.0" end
Bumped to <I> As support for MRI <I> and Ruby Enterprise Edition has been dropped, a minor version bump was in order [ci skip]
mdespuits_validates_formatting_of
train
rb
975d2705f8fa41a81686f78abaf99b68671567c3
diff --git a/lib/messaging/write.rb b/lib/messaging/write.rb index <HASH>..<HASH> 100644 --- a/lib/messaging/write.rb +++ b/lib/messaging/write.rb @@ -6,7 +6,7 @@ module Messaging cls.class_exec do include Log::Dependency - dependency :message_data_writer + dependency :message_writer dependency :telemetry, ::Telemetry cls.extend Build @@ -52,7 +52,7 @@ module Messaging message_batch = Array(message_or_batch) message_data_batch = message_data_batch(message_batch, reply_stream_name) - last_position = message_data_writer.(message_data_batch, stream_name, expected_version: expected_version) + last_position = message_writer.(message_data_batch, stream_name, expected_version: expected_version) unless message_or_batch.is_a? Array logger.info(tag: :write) { "Wrote message (Position: #{last_position}, Stream Name: #{stream_name}, Type: #{message_or_batch.class.message_type}, Expected Version: #{expected_version.inspect}, Reply Stream Name: #{reply_stream_name.inspect})" }
message_writer, not message_data_writer
eventide-project_messaging
train
rb
0b2f71ec9b43a77911ef4a1a3812750895041a65
diff --git a/eg/color.py b/eg/color.py index <HASH>..<HASH> 100644 --- a/eg/color.py +++ b/eg/color.py @@ -86,7 +86,7 @@ class EgColorizer(): def _color_helper(self, text, pattern, repl): # < 2.7 didn't have the flags named argument. - if sys.version_info[1] < 7: + if sys.version_info < (2, 7): compiled_pattern = re.compile(pattern, re.MULTILINE) return re.sub( compiled_pattern,
Change from minor- to major/minor- aware version check
srsudar_eg
train
py
2293f54df3cbd12c1f29d854d3c4ca8e0c01f3c6
diff --git a/lib/Model.js b/lib/Model.js index <HASH>..<HASH> 100644 --- a/lib/Model.js +++ b/lib/Model.js @@ -210,6 +210,7 @@ Model.compile = function compile (name, schema, options, base) { return async function () { let args = [...arguments]; if (typeof args[args.length - 1] === "function") { + console.warning("Dynamoose Warning: Passing callback function into transaction method not allowed. Removing callback function from list of arguments."); // Callback function passed in which is not allowed, removing that from arguments list args.pop(); }
Adding warning when passing in callback function to transaction method
dynamoosejs_dynamoose
train
js
a3bf40e852244fa9892e9b7a210dfc8c4c73d8b2
diff --git a/js/api.js b/js/api.js index <HASH>..<HASH> 100644 --- a/js/api.js +++ b/js/api.js @@ -353,7 +353,7 @@ window.textsecure.api = function() { } self.getMessageWebsocket = function() { - return getWebsocket(URL_CALLS['push'], true, 60000); + return getWebsocket(URL_CALLS['push'], true, 1000); } self.getTempWebsocket = function() {
Shorten websocket time out. Fixes #<I>
ForstaLabs_librelay-node
train
js
3da2f1c02828ed58f7e3a7b5a35c5414e8131f28
diff --git a/lib/arithmetic/nodes.rb b/lib/arithmetic/nodes.rb index <HASH>..<HASH> 100644 --- a/lib/arithmetic/nodes.rb +++ b/lib/arithmetic/nodes.rb @@ -11,7 +11,17 @@ module Arithmetic end def eval - BigDecimal.new(@operand) + if has_dangling_decimal_point? + BigDecimal.new(@operand + "0") + else + BigDecimal.new(@operand) + end + end + + private + + def has_dangling_decimal_point? + @operand.is_a?(String) && @operand.end_with?(".") end end diff --git a/spec/arithmetic_spec.rb b/spec/arithmetic_spec.rb index <HASH>..<HASH> 100644 --- a/spec/arithmetic_spec.rb +++ b/spec/arithmetic_spec.rb @@ -69,6 +69,10 @@ describe Arithmetic do test_eval(2).should == 2 end + it "handles dangling decimal points" do + test_eval("0.").should == 0 + end + context "invalid expressions" do it "handles blank expressions" do exp_should_error nil
handle issue with dangling decimal point
nulogy_arithmetic
train
rb,rb
2e572c4135c3f5ad3061c1f58cdb8a70bed0a9d3
diff --git a/python/pyspark/context.py b/python/pyspark/context.py index <HASH>..<HASH> 100644 --- a/python/pyspark/context.py +++ b/python/pyspark/context.py @@ -19,6 +19,7 @@ from __future__ import print_function import os import shutil +import signal import sys from threading import Lock from tempfile import NamedTemporaryFile @@ -217,6 +218,12 @@ class SparkContext(object): else: self.profiler_collector = None + # create a signal handler which would be invoked on receiving SIGINT + def signal_handler(signal, frame): + self.cancelAllJobs() + + signal.signal(signal.SIGINT, signal_handler) + def _initialize_context(self, jconf): """ Initialize SparkContext in function to allow subclass specific initialization
[SPARK-<I>] [PYTHON] Add signal handler to trap Ctrl-C in pyspark and cancel all running jobs This patch adds a signal handler to trap Ctrl-C and cancels running job.
apache_spark
train
py
d46396479932162672d5eccb19861ca24ef73908
diff --git a/lib/bosh/gen/generators/package_generator.rb b/lib/bosh/gen/generators/package_generator.rb index <HASH>..<HASH> 100644 --- a/lib/bosh/gen/generators/package_generator.rb +++ b/lib/bosh/gen/generators/package_generator.rb @@ -61,6 +61,8 @@ module Bosh::Gen ./configure --prefix=${BOSH_INSTALL_TARGET} make make install + # Alternatively, to copy archive contents: + # cp -a #{unpack_base_path}/* $BOSH_INSTALL_TARGET SHELL end
comments to aide simple copying of pkg contents
cloudfoundry-community_bosh-gen
train
rb
0038ff743145a317ac98996fc5bf01fe6b883838
diff --git a/poco/pocofw.py b/poco/pocofw.py index <HASH>..<HASH> 100644 --- a/poco/pocofw.py +++ b/poco/pocofw.py @@ -78,7 +78,7 @@ class Poco(PocoAccelerationMixin): expression pattern ``UI.xx`` In keyword args, you can only use `xx` or `xxMatches` at the same time. Using both with the same attribute does - not make sence. Besides, `xx` should not start with ``_`` (underscore) as attributes start with ``_`` are + not make sense. Besides, `xx` should not start with ``_`` (underscore) as attributes start with ``_`` are private attributes that used by sdk implementation. ::
Fix a typo in pocofw.py
AirtestProject_Poco
train
py
4b3e6dbbe869aaf6e49fd104c464e2f4f41ed1ba
diff --git a/moskito-webui/src/main/java/net/anotheria/moskito/webui/gauges/api/GaugeAPIImpl.java b/moskito-webui/src/main/java/net/anotheria/moskito/webui/gauges/api/GaugeAPIImpl.java index <HASH>..<HASH> 100644 --- a/moskito-webui/src/main/java/net/anotheria/moskito/webui/gauges/api/GaugeAPIImpl.java +++ b/moskito-webui/src/main/java/net/anotheria/moskito/webui/gauges/api/GaugeAPIImpl.java @@ -72,6 +72,8 @@ public class GaugeAPIImpl extends AbstractMoskitoAPIImpl implements GaugeAPI { public List<GaugeAO> getGauges(){ GaugesConfig gg = MoskitoConfigurationHolder.getConfiguration().getGaugesConfig(); List<GaugeAO> gaugeAOList = new LinkedList<GaugeAO>(); + if (gg == null || gg.getGauges() == null || gg.getGauges().length == 0) + return gaugeAOList; for (GaugeConfig g : gg.getGauges()){ GaugeAO ao = createGaugeAO(g); gaugeAOList.add(ao);
fixed exception on gauges page if there are no configured gauges.
anotheria_moskito
train
java
2209e64905bc57d93ae6eb619edc61afef1ea289
diff --git a/src/scripts/postinstall.js b/src/scripts/postinstall.js index <HASH>..<HASH> 100644 --- a/src/scripts/postinstall.js +++ b/src/scripts/postinstall.js @@ -5121,7 +5121,7 @@ module.exports = function($logger, hookArgs) { for which environment {development|prod} the project was prepared. If needed, we delete the NS .nsprepareinfo file so we force a new prepare */ - var platform = (hookArgs.checkForChangesOpts || hookArgs.platformData).platform.toLowerCase(); + var platform = (hookArgs.checkForChangesOpts || hookArgs.prepareData).platform.toLowerCase(); var projectData = (hookArgs.checkForChangesOpts && hookArgs.checkForChangesOpts.projectData) || hookArgs.projectData; var platformsDir = projectData.platformsDir; var appResourcesDirectoryPath = projectData.appResourcesDirectoryPath;
fix: fix cannot read .toLowerCase() of undefined NativeScript CLI throws `cannot read .toLowerCase() of undefined` error as there isn't platform property in platformData object. We should use prepareData instead.
EddyVerbruggen_nativescript-plugin-firebase
train
js
5ecbfba369e8b2faac65e9b3a645ba36e3a14b88
diff --git a/mockupdb/__init__.py b/mockupdb/__init__.py index <HASH>..<HASH> 100755 --- a/mockupdb/__init__.py +++ b/mockupdb/__init__.py @@ -676,7 +676,7 @@ class OpGetMore(Request): namespace, pos = _get_c_string(msg, 4) num_to_return, = _UNPACK_INT(msg[pos:pos + 4]) pos += 4 - cursor_id = _UNPACK_LONG(msg[pos:pos + 8]) + cursor_id, = _UNPACK_LONG(msg[pos:pos + 8]) return OpGetMore(namespace=namespace, flags=flags, client=client, num_to_return=num_to_return, cursor_id=cursor_id, request_id=request_id, server=server) @@ -691,6 +691,11 @@ class OpGetMore(Request): """The client message's numToReturn field.""" return self._num_to_return + @property + def cursor_id(self): + """The client message's cursorId field.""" + return self._cursor_id + class OpKillCursors(Request): """An OP_KILL_CURSORS the client executes on the server."""
Add cursor_id property.
ajdavis_mongo-mockup-db
train
py
5361e380560fda66d4720ee21c3eafc9716867db
diff --git a/packages/ra-ui-materialui/src/layout/UserMenu.js b/packages/ra-ui-materialui/src/layout/UserMenu.js index <HASH>..<HASH> 100644 --- a/packages/ra-ui-materialui/src/layout/UserMenu.js +++ b/packages/ra-ui-materialui/src/layout/UserMenu.js @@ -53,7 +53,7 @@ class UserMenu extends React.Component { color="inherit" onClick={this.handleMenu} > - {icon && cloneElement(icon)} + {icon} </IconButton> </Tooltip> <Menu
Don't extra clone icon
marmelab_react-admin
train
js
bdb8663d14bef156f6c3a2b35b542e903e34d05f
diff --git a/espresso-server/app/src/androidTest/java/io/appium/espressoserver/lib/helpers/w3c/state/InputStateTable.java b/espresso-server/app/src/androidTest/java/io/appium/espressoserver/lib/helpers/w3c/state/InputStateTable.java index <HASH>..<HASH> 100644 --- a/espresso-server/app/src/androidTest/java/io/appium/espressoserver/lib/helpers/w3c/state/InputStateTable.java +++ b/espresso-server/app/src/androidTest/java/io/appium/espressoserver/lib/helpers/w3c/state/InputStateTable.java @@ -6,9 +6,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import io.appium.espressoserver.lib.helpers.w3c.models.ActionObject; + import io.appium.espressoserver.lib.handlers.exceptions.AppiumException; import io.appium.espressoserver.lib.helpers.w3c.adapter.W3CActionAdapter; -import io.appium.espressoserver.lib.helpers.w3c.models.ActionObject; /** * Keep the state of all active input sources
Make inputs cancellable (#<I>) * Add 'cancel list' to InputStateTable * Add a KeyUp action object to cancel list when KeyDown is called * Created a copy constructor to create ActionObject * Other * Moved 'active input sources' to 'state' package * Make 'pointerDown' cancellable
appium_appium-espresso-driver
train
java
a4f0811f11cd9555c519bdfb4fe986cee23948b9
diff --git a/clustering/ee/infinispan/src/main/java/org/wildfly/clustering/ee/infinispan/InfinispanBatcher.java b/clustering/ee/infinispan/src/main/java/org/wildfly/clustering/ee/infinispan/InfinispanBatcher.java index <HASH>..<HASH> 100644 --- a/clustering/ee/infinispan/src/main/java/org/wildfly/clustering/ee/infinispan/InfinispanBatcher.java +++ b/clustering/ee/infinispan/src/main/java/org/wildfly/clustering/ee/infinispan/InfinispanBatcher.java @@ -159,7 +159,7 @@ public class InfinispanBatcher implements Batcher<TransactionBatch> { @Override public TransactionBatch suspendBatch() { - if (this.tm == null) return null; + if (this.tm == null) return NON_TX_BATCH; TransactionBatch batch = CURRENT_BATCH.get(); if (batch != null) { try {
WFLY-<I> NPE during Session.requestDone(...) when using <transaction mode="NONE"/>
wildfly_wildfly
train
java
be014ca61b495eb4dc0c252a98a6e6b00234cbff
diff --git a/Task/Generate.php b/Task/Generate.php index <HASH>..<HASH> 100644 --- a/Task/Generate.php +++ b/Task/Generate.php @@ -293,6 +293,8 @@ class Generate extends Base { foreach ($components as $name => $component) { $parent_name = $component->containingComponent(); if (!empty($parent_name)) { + assert(isset($components[$parent_name]), "Containing component '$parent_name' given by '$name' is not a component ID."); + $tree[$parent_name][] = $name; } }
Added assertion to check containing component is a valid ID.
drupal-code-builder_drupal-code-builder
train
php
ef3acab8d5cb0d842a3995b1b0e7e6bfd27f2292
diff --git a/core/src/main/java/org/bitcoinj/core/Peer.java b/core/src/main/java/org/bitcoinj/core/Peer.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/bitcoinj/core/Peer.java +++ b/core/src/main/java/org/bitcoinj/core/Peer.java @@ -519,12 +519,10 @@ public class Peer extends PeerSocketHandler { throw new ProtocolException("Got two version messages from peer"); vPeerVersionMessage = m; // Switch to the new protocol version. - int peerVersion = vPeerVersionMessage.clientVersion; - PeerAddress peerAddress = getAddress(); long peerTime = vPeerVersionMessage.time * 1000; - log.info("Connected to {}: version={}, subVer='{}', services=0x{}, time={}, blocks={}", - peerAddress == null ? "Peer" : (peerAddress.getAddr() == null ? peerAddress.getHostname() : peerAddress.getAddr().getHostAddress()), - peerVersion, + log.info("{}: Got version={}, subVer='{}', services=0x{}, time={}, blocks={}", + this, + vPeerVersionMessage.clientVersion, vPeerVersionMessage.subVer, vPeerVersionMessage.localServices, String.format(Locale.US, "%tF %tT", peerTime, peerTime),
Again reword a happy connect log message. Receiving the remote version message doesn't mean we're connected.
bitcoinj_bitcoinj
train
java
5a8642a95e0e5dafe2cc39515f51c48e9b29325b
diff --git a/test/teststop.js b/test/teststop.js index <HASH>..<HASH> 100644 --- a/test/teststop.js +++ b/test/teststop.js @@ -43,6 +43,7 @@ module.exports.test_stop_callback_and_event = function(test) { test.ok(this === client); test.equals(arguments.length, 0); test.equals(client.state, 'stopped'); + test.equals(client.service, null); if (++count == 2) { test.done(); }
update mqlight.stop unittest to check that service returns null
mqlight_nodejs-mqlight
train
js
4b7f0f2e0dcb6abd784976febb1beaf95167eb49
diff --git a/edxval/admin.py b/edxval/admin.py index <HASH>..<HASH> 100644 --- a/edxval/admin.py +++ b/edxval/admin.py @@ -81,6 +81,8 @@ class TranscriptPreferenceAdmin(admin.ModelAdmin): class ThirdPartyTranscriptCredentialsStateAdmin(admin.ModelAdmin): + list_display = ('org', 'provider', 'exists', 'created', 'modified') + model = ThirdPartyTranscriptCredentialsState verbose_name = 'Organization Transcript Credential State' verbose_name_plural = 'Organization Transcript Credentials State'
Update admin class for org transcript credentials. EDU-<I>
edx_edx-val
train
py
80c8ad3779bf7b7967d2623d6be77cf86b88cddd
diff --git a/tests/unit/algorithms/metrics/MercuryIntrusionTest.py b/tests/unit/algorithms/metrics/MercuryIntrusionTest.py index <HASH>..<HASH> 100644 --- a/tests/unit/algorithms/metrics/MercuryIntrusionTest.py +++ b/tests/unit/algorithms/metrics/MercuryIntrusionTest.py @@ -13,11 +13,13 @@ class MercuryIntrusionTest: def test_run(self): mip = op.algorithms.metrics.MercuryIntrusion(network=self.net) + mip.run() assert mip['pore.invasion_sequence'].max() > 2 assert mip['throat.invasion_sequence'].max() > 2 def test_pcsnwp_data(self): mip = op.algorithms.metrics.MercuryIntrusion(network=self.net) + mip.run() mip.pc_data = [1e1, 1e3, 1e5, 1e6] mip.snwp_data = [0.0, 0.1, 0.5, 0.9] assert sp.all(mip.pc_data == [1e1, 1e3, 1e5, 1e6]) @@ -25,6 +27,7 @@ class MercuryIntrusionTest: def test_plot_data(self): mip = op.algorithms.metrics.MercuryIntrusion(network=self.net) + mip.run() mip.pc_data = [1e1, 1e3, 1e5, 1e6] mip.snwp_data = [0.0, 0.1, 0.5, 0.9] fig = mip.plot_intrusion_curve()
Updated MIP test to call run
PMEAL_OpenPNM
train
py
addad1566403dfe64d1268da971dfae7bbfbd81e
diff --git a/lib/gitkeeper/version.rb b/lib/gitkeeper/version.rb index <HASH>..<HASH> 100644 --- a/lib/gitkeeper/version.rb +++ b/lib/gitkeeper/version.rb @@ -1,3 +1,3 @@ module Gitkeeper - VERSION = "0.0.1" + VERSION = "0.0.7" end
Eureka: really works out of the box now, with VERSION <I> & following the README
lgs_gitkeeper
train
rb
655452cf17c0e01b1c9399dc3b04e15878e8953e
diff --git a/logger.go b/logger.go index <HASH>..<HASH> 100644 --- a/logger.go +++ b/logger.go @@ -34,14 +34,14 @@ type Logger struct { } func (l *Logger) Output(depth int, level string, message string, data ...Map) { - // get this as soon as possible - now := formattedDate.String() - buf := bufPool.Get() defer bufPool.Put(buf) flags := FlagSet(atomic.LoadUint64(&l.flags)) + + // if time is being logged, handle time as soon as possible if flags&Ltimestamp != 0 { + now := formattedDate.String() buf.WriteString(`time="`) buf.WriteString(now) buf.Write(i_QUOTE_SPACE)
slightly delay getting time (sloppy anyway), to avoid getting it at all if not used
cactus_mlog
train
go
f4029dfab5ab37f4a8f510c8b82a418e235ef66f
diff --git a/aslack/__init__.py b/aslack/__init__.py index <HASH>..<HASH> 100644 --- a/aslack/__init__.py +++ b/aslack/__init__.py @@ -5,4 +5,4 @@ import logging logging.getLogger(__name__).addHandler(logging.NullHandler()) __author__ = 'Jonathan Sharpe' -__version__ = '0.0.8' +__version__ = '0.1.0'
Increment minor version number I reckon I've done enough for that
textbook_aslack
train
py
ac2023ef618b9d0428447beedc3c9986d3051ee1
diff --git a/lib/revenant.rb b/lib/revenant.rb index <HASH>..<HASH> 100644 --- a/lib/revenant.rb +++ b/lib/revenant.rb @@ -3,7 +3,7 @@ module Revenant # Register a new type of lock. # User code specifies which by setting lock_type = :something - # while configuring a Revenant::Process + # while configuring a Revenant::Task def self.register(lock_type, klass) @lock_types ||= {} if klass.respond_to?(:lock_function)
Correct a typo in rdoc
wilson_revenant
train
rb
f5e7707953aed78def2c2ff015a489419ac18f0a
diff --git a/lib/chars/char_set.rb b/lib/chars/char_set.rb index <HASH>..<HASH> 100644 --- a/lib/chars/char_set.rb +++ b/lib/chars/char_set.rb @@ -120,9 +120,9 @@ module Chars def random_distinct_bytes(length) if (length.kind_of?(Array) || length.kind_of?(Range)) #return Array.new(length.sort_by { rand }.first) { random_byte } - self.entries.sort_by { rand }.slice(0..(length.sort_by { rand }.first)) + self.entries.sort_by { rand }.slice(0...(length.sort_by { rand }.first)) else - self.entries.sort_by { rand }.slice(0..length) + self.entries.sort_by { rand }.slice(0...length) end end
fixed fencepost error in random_distinct_bytes
postmodern_chars
train
rb
860677e3ae7fed7872f7be13a01b8812d55c4fc3
diff --git a/test/babelish/commands/test_command_csv2android.rb b/test/babelish/commands/test_command_csv2android.rb index <HASH>..<HASH> 100644 --- a/test/babelish/commands/test_command_csv2android.rb +++ b/test/babelish/commands/test_command_csv2android.rb @@ -16,6 +16,21 @@ class TestCSV2AndroidCommand < Test::Unit::TestCase system("rm -rf ./values-fr/") end + def test_csv2android_with_multiple_2_languages_with_region + options = { + :filename => "test/data/test_data_multiple_langs.csv", + :langs => {"English" => "en-US", "French" => "fr"} + } + Commandline.new([], options).csv2android + + assert File.exist?("./values-en-rUS/strings.xml") + assert File.exist?("./values-fr/strings.xml") + + # clean up + system("rm -rf ./values-en-rUS/") + system("rm -rf ./values-fr/") + end + def test_csv2android_with_output_dir options = { :filename => "test/data/test_data_multiple_langs.csv",
Added test for csv2android with region
netbe_Babelish
train
rb
3294a18453c46ece218dd71d9b41329a70410838
diff --git a/km3pipe/logger.py b/km3pipe/logger.py index <HASH>..<HASH> 100644 --- a/km3pipe/logger.py +++ b/km3pipe/logger.py @@ -49,9 +49,21 @@ class LogIO(object): port=28777): self.node = node self.stream = stream + self.url = url + self.port = port self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.sock.connect((url, port)) + self.connect() def send(self, message, level='info'): - self.sock.send("+log|{0}|{1}|{2}|{3}\r\n" - .format(self.stream, self.node, level, message)) + message_string = "+log|{0}|{1}|{2}|{3}\r\n" \ + .format(self.stream, self.node, level, message) + try: + self.sock.send(message_string) + except socket.error: + print("Lost connection, reconnecting...") + self.connect() + self.sock.send(message_string) + + def connect(self): + self.sock.connect((self.url, self.port)) +
Retry once if socket connection is closed
tamasgal_km3pipe
train
py
fa4b0295b62c1ff60d28f267435bfa7d90db5b95
diff --git a/actionpack/lib/action_dispatch/middleware/public_exceptions.rb b/actionpack/lib/action_dispatch/middleware/public_exceptions.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/middleware/public_exceptions.rb +++ b/actionpack/lib/action_dispatch/middleware/public_exceptions.rb @@ -12,7 +12,7 @@ module ActionDispatch status = env["PATH_INFO"][1..-1] request = ActionDispatch::Request.new(env) content_type = request.formats.first - format = (mime = Mime[content_type]) && "to_#{mime.to_sym}" + format = content_type && "to_#{content_type.to_sym}" body = { :status => status, :error => exception.message } render(status, body, :format => format, :content_type => content_type)
content_type is already a Mime::Type object
rails_rails
train
rb
ea6b37202544925ef7f76898a64e2d4198205017
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,9 @@ if sys.version_info >= (3,): install_requires = ['numpy', 'pyserial>2.6', 'scipy'] +if sys.version_info < (2, 7): + print("python version < 2.7 is not supported") + sys.exit(1) if sys.version_info < (3, 4): install_requires.append('enum34') @@ -45,7 +48,7 @@ setup(name='pypot', ], }, - setup_requires=['setuptools_git >= 0.3', ], + # setup_requires=['setuptools_git >= 0.3', ], include_package_data=True, exclude_package_data={'': ['README', '.gitignore']},
remove unnecessary dependency of setuptools_git and prevent usage of python<I>
poppy-project_pypot
train
py
d4155703a99e83f39eb952865854ae9c9790e56e
diff --git a/flask_mwoauth/__init__.py b/flask_mwoauth/__init__.py index <HASH>..<HASH> 100644 --- a/flask_mwoauth/__init__.py +++ b/flask_mwoauth/__init__.py @@ -24,7 +24,8 @@ class MWOAuth(object): default_return_to='index', consumer_key=None, consumer_secret=None, return_json=False, - name="Deprecated"): + name="Deprecated", + user_agent=None): if consumer_key is None: raise TypeError( "MWOAuth() missing 1 required argument: 'consumer_key'") @@ -37,7 +38,7 @@ class MWOAuth(object): self.script_url = base_url + "/index.php" self.api_url = base_url + "/api.php" - self.handshaker = mwoauth.Handshaker(self.script_url, consumer_token) + self.handshaker = mwoauth.Handshaker(self.script_url, consumer_token, user_agent=user_agent) self.bp = Blueprint('mwoauth', __name__)
Pass user_agent to mwoauth.handshaker Each tool running with this wrapper will yield "Sending requests with default User-Agent. Set 'user_agent' on mwoauth.flask.MWOAuth to quiet this message.". This commit should prevent that.
valhallasw_flask-mwoauth
train
py
a145c1b4afb880f077a1811c3aec29d40bbcad81
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index <HASH>..<HASH> 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -334,8 +334,8 @@ module ActionMailer # and starts to use it. # * <tt>:openssl_verify_mode</tt> - When using TLS, you can set how OpenSSL checks the certificate. This is # really useful if you need to validate a self-signed and/or a wildcard certificate. You can use the name - # of an OpenSSL verify constant ('none', 'peer', 'client_once','fail_if_no_peer_cert') or directly the - # constant (OpenSSL::SSL::VERIFY_NONE, OpenSSL::SSL::VERIFY_PEER,...). + # of an OpenSSL verify constant ('none', 'peer', 'client_once', 'fail_if_no_peer_cert') or directly the + # constant (OpenSSL::SSL::VERIFY_NONE, OpenSSL::SSL::VERIFY_PEER, ...). # # * <tt>sendmail_settings</tt> - Allows you to override options for the <tt>:sendmail</tt> delivery method. # * <tt>:location</tt> - The location of the sendmail executable. Defaults to <tt>/usr/sbin/sendmail</tt>.
Cosmetic fixes in AM::Base docs. Missed spaces in OpenSSL constants enumerations. Injected at a<I>ad.
rails_rails
train
rb
38dcc42d53eb7ce1f0bb2b50e115e1a66d75f2c7
diff --git a/app/libraries/Jentil.php b/app/libraries/Jentil.php index <HASH>..<HASH> 100644 --- a/app/libraries/Jentil.php +++ b/app/libraries/Jentil.php @@ -82,7 +82,7 @@ final class Jentil protected function __construct() { $this->setup['loader'] = new Setup\Loader($this); - $this->setup['updater'] = new Setup\Updater($this); + // $this->setup['updater'] = new Setup\Updater($this); $this->setup['language'] = new Setup\Language($this); $this->setup['styles'] = new Setup\Styles($this); $this->setup['scripts'] = new Setup\Scripts($this);
disabled auto updater setup until this theme reaches stable release (ie <I> and up)
GrottoPress_jentil
train
php
c2f6dd93bb3291763605a4c88ab46b25bec83149
diff --git a/gems/aws-eventstream/spec/decoder_spec.rb b/gems/aws-eventstream/spec/decoder_spec.rb index <HASH>..<HASH> 100644 --- a/gems/aws-eventstream/spec/decoder_spec.rb +++ b/gems/aws-eventstream/spec/decoder_spec.rb @@ -72,7 +72,7 @@ module Aws it '#decode_chunk buffers partial prelude message' do file = Dir.glob(File.expand_path('../fixtures/encoded/positive/*', __FILE__)).first - data = File.read(file) + data = File.open(file, "r:UTF-8", &:read) first_part = data[0..3] second_part = data[4..-1] decoder = Decoder.new(format: false)
Update flakey test to read utf8
aws_aws-sdk-ruby
train
rb
d4cd7eed5b5792f630cceed976cc274172dbcc81
diff --git a/src/SetupCommand.php b/src/SetupCommand.php index <HASH>..<HASH> 100644 --- a/src/SetupCommand.php +++ b/src/SetupCommand.php @@ -69,7 +69,7 @@ class SetupCommand extends Command // DOMAIN PATH $this->_print('------------------------------'); $this->_lineBreak(); - $this->_print('Enter your project\'s domain (example: my-app), this will be used for localization and builds:'); + $this->_print('Enter your project\'s text domain (example: my-app), this will be used for localization and builds:'); $this->_lineBreak(); $domain = $this->listener->getInput(); $domain = empty($domain) ? 'my-app' : $domain; @@ -82,9 +82,9 @@ class SetupCommand extends Command // End $this->_print('------------------------------'); $this->_lineBreak(); - $this->_print('Your project namespace is "%s"', $namespace); + $this->_print('Your project\'s namespace is "%s"', $namespace); $this->_lineBreak(); - $this->_print('Your project domain is "%s"', $domain); + $this->_print('Your project\'s text domain is "%s"', $domain); $this->_lineBreak(); $this->_print('Setup completed!'); $this->_lineBreak();
Clarify domain to be text domain Also updated project to project's for grammar
10quality_wpmvc-commands
train
php
e99add1490ae5df90b8d44f284b8be1bbeb698a9
diff --git a/src/Exscript/workqueue/WorkQueue.py b/src/Exscript/workqueue/WorkQueue.py index <HASH>..<HASH> 100644 --- a/src/Exscript/workqueue/WorkQueue.py +++ b/src/Exscript/workqueue/WorkQueue.py @@ -20,12 +20,14 @@ class WorkQueue(object): This class implements the asynchronous workqueue and is the main API for using the workqueue module. """ - def __init__(self, **kwargs): + def __init__(self, debug = 0, max_threads = 1): """ Constructor. - @keyword debug: The debug level (default is 0) - @keyword max_threads: Number of concurrent connections (default is 1). + @type debug: int + @param debug: The debug level. + @type max_threads: int + @param max_threads: The maximum number of concurrent threads. """ self.job_init_event = Event() self.job_started_event = Event() @@ -33,8 +35,8 @@ class WorkQueue(object): self.job_succeeded_event = Event() self.job_aborted_event = Event() self.queue_empty_event = Event() - self.debug = kwargs.get('debug', 0) - self.max_threads = kwargs.get('max_threads', 1) + self.debug = debug + self.max_threads = max_threads self.main_loop = None self._init()
Exscript.workqueue: replace **kwargs by explicit keywords.
knipknap_exscript
train
py
3027f5ca85c63023a310a03141015bfe4a607d19
diff --git a/prow/kube/types.go b/prow/kube/types.go index <HASH>..<HASH> 100644 --- a/prow/kube/types.go +++ b/prow/kube/types.go @@ -133,6 +133,27 @@ type Container struct { Resources Resources `json:"resources,omitempty"` SecurityContext *SecurityContext `json:"securityContext,omitempty"` VolumeMounts []VolumeMount `json:"volumeMounts,omitempty"` + Lifecycle *Lifecycle `json:"lifecycle,omitempty"` +} + +// Lifecycle describes actions that the management system should take in response to container lifecycle +// events. For the PostStart and PreStop lifecycle handlers, management of the container blocks +// until the action is complete, unless the container process fails, in which case the handler is aborted. +type Lifecycle struct { + PostStart *Handler `json:"postStart,omitempty"` + PreStop *Handler `json:"preStop,omitempty"` +} + +// Handler defines a specific action that should be taken +// TODO: pass structured data to these actions, and document that data here. +type Handler struct { + // Exec specifies the action to take. + Exec *ExecAction `json:"exec,omitempty"` +} + +// ExecAction describes a "run in container" action. +type ExecAction struct { + Command []string `json:"command,omitempty"` } type Port struct {
Add support for ProwJob lifecycle hooks
kubernetes_test-infra
train
go
8dcd197436f3620ef63a8e25eaba38530e828f12
diff --git a/GPy/models/GP.py b/GPy/models/GP.py index <HASH>..<HASH> 100644 --- a/GPy/models/GP.py +++ b/GPy/models/GP.py @@ -253,8 +253,9 @@ class GP(model): Xnew, xmin, xmax = x_frame1D(Xu, plot_limits=plot_limits) m, var, lower, upper = self.predict(Xnew, which_parts=which_parts) - gpplot(Xnew, m, lower, upper) - pb.plot(Xu[which_data], self.likelihood.data[which_data], 'kx', mew=1.5) + for d in range(m.shape[1]): + gpplot(Xnew, m[:,d], lower[:,d], upper[:,d]) + pb.plot(Xu[which_data], self.likelihood.data[which_data,d], 'kx', mew=1.5) if self.has_uncertain_inputs: pb.errorbar(Xu[which_data, 0], self.likelihood.data[which_data, 0], xerr=2 * np.sqrt(self.X_variance[which_data, 0]),
allowed GP models to plot multiple outputs (in 1D at least)
SheffieldML_GPy
train
py
ca5c6e31609897885514c231ca9e18fcac4e0968
diff --git a/cmd/erasure-metadata.go b/cmd/erasure-metadata.go index <HASH>..<HASH> 100644 --- a/cmd/erasure-metadata.go +++ b/cmd/erasure-metadata.go @@ -102,7 +102,7 @@ func (fi FileInfo) IsValid() bool { func (fi FileInfo) ToObjectInfo(bucket, object string) ObjectInfo { object = decodeDirObject(object) versionID := fi.VersionID - if globalBucketVersioningSys.Enabled(bucket) && versionID == "" { + if (globalBucketVersioningSys.Enabled(bucket) || globalBucketVersioningSys.Suspended(bucket)) && versionID == "" { versionID = nullVersionID }
fix: translate empty versionID string to null version where appropriate (#<I>) We store the null version as empty string. We should translate it to null version for bucket with version suspended too.
minio_minio
train
go
02d67b65c85afabcd77c59090ac6ed9afa31b3dc
diff --git a/bypy.py b/bypy.py index <HASH>..<HASH> 100755 --- a/bypy.py +++ b/bypy.py @@ -44,7 +44,7 @@ from __future__ import print_function from __future__ import division ### special variables that say about this module -__version__ = '1.2.15' +__version__ = '1.2.16' ### return (error) codes # they are put at the top because:
Version bumped to <I>
houtianze_bypy
train
py
3ba65ee094086e7c8bad9d1dfcc14b7a7fe0b3f6
diff --git a/src/GitElephant/Command/Caller/Caller.php b/src/GitElephant/Command/Caller/Caller.php index <HASH>..<HASH> 100755 --- a/src/GitElephant/Command/Caller/Caller.php +++ b/src/GitElephant/Command/Caller/Caller.php @@ -92,7 +92,13 @@ class Caller extends AbstractCaller if (is_null($cwd) || !is_dir($cwd)) { $cwd = $this->repositoryPath; } - $process = Process::fromShellCommandline($cmd, $cwd); + + if (method_exists(Process::class, 'fromShellCommandline')) { + $process = Process::fromShellCommandline($cmd, $cwd); + } else { + // compatibility fix required for Symfony/Process < 4. + $process = new Process($cmd, $cwd); + } $process->setTimeout(15000); $process->run(); if (!in_array($process->getExitCode(), $acceptedExitCodes)) {
Fix #<I> by introducing a case distinction between Symfony Process versions
matteosister_GitElephant
train
php
ff53df96875de84ee02895772b59448f35a5a0c2
diff --git a/lib/arel/nodes/delete_statement.rb b/lib/arel/nodes/delete_statement.rb index <HASH>..<HASH> 100644 --- a/lib/arel/nodes/delete_statement.rb +++ b/lib/arel/nodes/delete_statement.rb @@ -1,7 +1,8 @@ # frozen_string_literal: true module Arel module Nodes - class DeleteStatement < Arel::Nodes::Binary + class DeleteStatement < Arel::Nodes::Node + attr_accessor :left, :right attr_accessor :limit alias :relation :left @@ -10,13 +11,27 @@ module Arel alias :wheres= :right= def initialize relation = nil, wheres = [] - super + super() + @left = relation + @right = wheres end def initialize_copy other super - @right = @right.clone + @left = @left.clone if @left + @right = @right.clone if @right + end + + def hash + [self.class, @left, @right].hash + end + + def eql? other + self.class == other.class && + self.left == other.left && + self.right == other.right end + alias :== :eql? end end end
Delete is not a NodeExpression, change parent This requires a little cut and paste from the Binary node, but it is used in different parts of sql
rails_rails
train
rb
e00ed0efe23868dcb5d3b585832b0c241c73f925
diff --git a/lib/models/make.js b/lib/models/make.js index <HASH>..<HASH> 100644 --- a/lib/models/make.js +++ b/lib/models/make.js @@ -53,9 +53,7 @@ module.exports = function( environment, mongoInstance ) { }, thumbnail: { type: String, - es_indexed: true, - required: true, - validate: validate( "isUrl" ) + es_indexed: true }, author: { type: String,
[#<I>] Thumbnail no longer required.
mozilla_MakeAPI
train
js
fe3a6c820990fd8f809d91fbc7437fb4232d3b2b
diff --git a/openid.php b/openid.php index <HASH>..<HASH> 100644 --- a/openid.php +++ b/openid.php @@ -293,7 +293,9 @@ class LightOpenID protected function request($url, $method='GET', $params=array()) { - if(function_exists('curl_init') && !ini_get('safe_mode') && !ini_get('open_basedir')) { + if (function_exists('curl_init') + && (!in_array('https', stream_get_wrappers()) || !ini_get('safe_mode') && !ini_get('open_basedir')) + ) { return $this->request_curl($url, $method, $params); } return $this->request_streams($url, $method, $params);
A compatibility fix for certain php configurations.
Mewp_lightopenid
train
php
c048a019f69d8e7b44f50576c7d1d35765b0aa58
diff --git a/security/Member.php b/security/Member.php index <HASH>..<HASH> 100644 --- a/security/Member.php +++ b/security/Member.php @@ -421,9 +421,12 @@ class Member extends DataObject implements TemplateGlobalProvider { $this->extend('memberLoggedOut'); $this->RememberLoginToken = null; - Cookie::set('alc_enc', null); + Cookie::set('alc_enc', null); // // Clear the Remember Me cookie Cookie::forceExpiry('alc_enc'); + // Switch back to live in order to avoid infinite loops when redirecting to the login screen (if this login screen is versioned) + Session::clear('readingMode'); + $this->write(); // Audit logging hook diff --git a/security/Security.php b/security/Security.php index <HASH>..<HASH> 100644 --- a/security/Security.php +++ b/security/Security.php @@ -951,7 +951,7 @@ class Security extends Controller { */ public static function set_login_url($loginUrl) { self::$login_url = $loginUrl; - } +} /** * Get the URL of the log-in page. * Defaults to Security/login but can be re-set with {@link set_login_url()}
BUGFIX Avoid infinite redirection when logging out and when showing a custom login page after displaying the draft version of a page.
silverstripe_silverstripe-framework
train
php,php
ad83f87b1fe2c9745bba159ae1bd1fa684e492ab
diff --git a/src/Config.php b/src/Config.php index <HASH>..<HASH> 100644 --- a/src/Config.php +++ b/src/Config.php @@ -563,7 +563,7 @@ class Config $contentType['slug'] = Slugify::create()->slugify($contentType['name']); } if (!isset($contentType['name'])) { - $contentType['name'] = ucwords(preg_replace('/[^a-z0-9]/', ' ', $contentType['slug'])); + $contentType['name'] = ucwords(preg_replace('/[^a-z0-9]/i', ' ', $contentType['slug'])); } if (!isset($contentType['singular_slug'])) { $contentType['singular_slug'] = Slugify::create()->slugify($contentType['singular_name']);
Should be case insensitive, too.
bolt_bolt
train
php
b4920526128aff056f0a136acf189456031024eb
diff --git a/activeweb/src/main/java/org/javalite/activeweb/RequestDispatcher.java b/activeweb/src/main/java/org/javalite/activeweb/RequestDispatcher.java index <HASH>..<HASH> 100644 --- a/activeweb/src/main/java/org/javalite/activeweb/RequestDispatcher.java +++ b/activeweb/src/main/java/org/javalite/activeweb/RequestDispatcher.java @@ -15,6 +15,7 @@ limitations under the License. */ package org.javalite.activeweb; +import com.google.inject.Injector; import org.javalite.activejdbc.DB; import org.javalite.common.Util; import org.slf4j.Logger; @@ -132,9 +133,7 @@ public class RequestDispatcher implements Filter { if(appConfig instanceof Bootstrap){ appBootstrap = (Bootstrap) appConfig; if(!Configuration.isTesting() ){ - if(appBootstrap.getInjector() != null){ - Context.getControllerRegistry().setInjector(appBootstrap.getInjector()); - } + Context.getControllerRegistry().setInjector(appBootstrap.getInjector()); } } appConfig.completeInit();
#<I> Injector should not be set in case of testing
javalite_activejdbc
train
java
dd11e4eee6eaaa5cd049f287162cc6f6252481f3
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -256,7 +256,7 @@ gulp.task('build-externs', repeatTaskForAllLocales( 'build-firebaseui-js-$', ['build-externs', 'build-ts', 'build-soy'], - buildFirebaseUiJs, + buildFirebaseUiJs ); // Bundles the FirebaseUI JS with its dependencies as a NPM module. This builds
remove extra comma in gulp
firebase_firebaseui-web
train
js
397bc6c0aff9037fd74eb7839b1e72ef0c6713cb
diff --git a/src/Annotation/Link.php b/src/Annotation/Link.php index <HASH>..<HASH> 100644 --- a/src/Annotation/Link.php +++ b/src/Annotation/Link.php @@ -12,16 +12,6 @@ namespace BEAR\Resource\Annotation; */ final class Link { - const REL = 'rel'; - - const SRC = 'src'; - - const HREF = 'href'; - - const TITLE = 'title'; - - const TEMPLATED = 'templated'; - /** * @var string */ @@ -47,11 +37,4 @@ final class Link * @var string */ public $method = 'get'; - - /** - * Embed resource uri - * - * @var string - */ - public $src; }
remove Link constants and src prop
bearsunday_BEAR.Resource
train
php
f50369fc6646d3d6f0e988a7de19c7c37948c06f
diff --git a/src/Product/CatalogImportApiRequestHandler.php b/src/Product/CatalogImportApiRequestHandler.php index <HASH>..<HASH> 100644 --- a/src/Product/CatalogImportApiRequestHandler.php +++ b/src/Product/CatalogImportApiRequestHandler.php @@ -92,7 +92,7 @@ class CatalogImportApiRequestHandler extends ApiRequestHandler if (!is_array($requestArguments) || !isset($requestArguments['fileName']) || !$requestArguments['fileName']) { throw new CatalogImportFileNameNotFoundInRequestBodyException( - 'Import file name is not fount in request body.' + 'Import file name is not found in request body.' ); }
Issue #<I>: Fix typo in error message
lizards-and-pumpkins_catalog
train
php
beaf0af084c1514b6c4269f110aedb9c3b2ccd73
diff --git a/js/util.go b/js/util.go index <HASH>..<HASH> 100644 --- a/js/util.go +++ b/js/util.go @@ -41,3 +41,19 @@ func throw(vm *otto.Otto, v interface{}) { } panic(v) } + +func newSnippetRunner(src string) (*Runner, error) { + rt, err := New() + if err != nil { + return nil, err + } + rt.VM.Set("require", rt.require) + defer rt.VM.Set("require", nil) + + exp, err := rt.load("__snippet__", []byte(src)) + if err != nil { + return nil, err + } + + return NewRunner(rt, exp) +}
[dev] Test util: func to make a snippet runner
loadimpact_k6
train
go
4b560a1a8d9a76f6f27b5bcb1c076c9fd3783c02
diff --git a/paging_result.go b/paging_result.go index <HASH>..<HASH> 100644 --- a/paging_result.go +++ b/paging_result.go @@ -115,6 +115,10 @@ func (pr *PagingResult) navigate(url *string) (noMore bool, err error) { return } + if pr.paging.Paging != nil { + pr.paging.Paging.Next = "" + pr.paging.Paging.Previous = "" + } paging := &pr.paging err = res.Decode(paging)
fix infinite loop in paging by clearing Next/Previous fields from previous query
huandu_facebook
train
go
55ec438581c5da28354fe4c5d00050903a2831f2
diff --git a/isso/js/tests/unit/isso.test.js b/isso/js/tests/unit/isso.test.js index <HASH>..<HASH> 100644 --- a/isso/js/tests/unit/isso.test.js +++ b/isso/js/tests/unit/isso.test.js @@ -18,7 +18,7 @@ * Also, untangle Postbox functions from DOM element */ -test('Editorify text area', () => { +test.skip('Editorify text area', () => { // Set up our document body document.body.innerHTML = '<div id=isso-thread></div>' +
js: tests: Skip outdated Postbox editorify() test
posativ_isso
train
js
2e7c56dacc863ee2c0d604bc748a2799ecd4be52
diff --git a/internal/qtls/go118.go b/internal/qtls/go118.go index <HASH>..<HASH> 100644 --- a/internal/qtls/go118.go +++ b/internal/qtls/go118.go @@ -1,3 +1,5 @@ // +build go1.18 -"quic-go doesn't build on Go 1.18 yet." +package qtls + +var _ int = "quic-go doesn't build on Go 1.18 yet."
prevent go mod vendor from stumbling over the Go <I> file
lucas-clemente_quic-go
train
go
8734b749e9f4a75f4ed9f39cc98c4323558e5407
diff --git a/src/lib/mocha/mocha-wrapper.js b/src/lib/mocha/mocha-wrapper.js index <HASH>..<HASH> 100644 --- a/src/lib/mocha/mocha-wrapper.js +++ b/src/lib/mocha/mocha-wrapper.js @@ -3,7 +3,8 @@ var Mocha = require('mocha'), path = require('path'), exit = require('exit'), glob = require('glob'), - ui = require('./mocha-fiberized-ui'); + ui = require('./mocha-fiberized-ui'), + booleanHelper = require('../boolean-helper'); var mochaOptions = { ui: 'fiberized-bdd-ui', @@ -12,7 +13,7 @@ var mochaOptions = { reporter: process.env['chimp.mochaReporter'] }; -if (process.env['chimp.watch']) { +if (booleanHelper.isTruthy(process.env['chimp.watch'])) { mochaOptions.grep = new RegExp(process.env['chimp.watchTags'].replace(/,/g, '|')); }
Fixes mocha watchTags being always added
TheBrainFamily_chimpy
train
js
88ed5d349958b69898496414ee115634864dd98b
diff --git a/modules/social_features/social_event/modules/social_event_addtocal/src/Form/SocialAddToCalendarSettingsForm.php b/modules/social_features/social_event/modules/social_event_addtocal/src/Form/SocialAddToCalendarSettingsForm.php index <HASH>..<HASH> 100644 --- a/modules/social_features/social_event/modules/social_event_addtocal/src/Form/SocialAddToCalendarSettingsForm.php +++ b/modules/social_features/social_event/modules/social_event_addtocal/src/Form/SocialAddToCalendarSettingsForm.php @@ -92,7 +92,7 @@ class SocialAddToCalendarSettingsForm extends ConfigFormBase { ':input[name="enable_add_to_calendar"]' => ['checked' => TRUE], ], ], - '#default_value' => $config->get('allowed_calendars'), + '#default_value' => $config->get('allowed_calendars') ?: [], ]; return parent::buildForm($form, $form_state);
Issue #<I> by tBKoT: Fix warning when confing not exist
goalgorilla_open_social
train
php
56e4d581483786532c45b079a0bc8050a686a7ee
diff --git a/vraptor-core/src/main/java/br/com/caelum/vraptor4/extensions/ControllersExtension.java b/vraptor-core/src/main/java/br/com/caelum/vraptor4/extensions/ControllersExtension.java index <HASH>..<HASH> 100644 --- a/vraptor-core/src/main/java/br/com/caelum/vraptor4/extensions/ControllersExtension.java +++ b/vraptor-core/src/main/java/br/com/caelum/vraptor4/extensions/ControllersExtension.java @@ -21,7 +21,7 @@ public class ControllersExtension implements Extension{ if (Modifier.isAbstract(clazz.getModifiers())) return; for (Annotation annotation : clazz.getAnnotations()) { - if (annotation.annotationType() == Controller.class + if (annotation.annotationType().equals(Controller.class) || annotation.annotationType().isAnnotationPresent(Controller.class)) { controllers.add(clazz); }
Using equals instead == operator
caelum_vraptor4
train
java
014d22f74225106d86cfdc1bcdfcda79493b6e7b
diff --git a/src/SimpleThings/EntityAudit/AuditReader.php b/src/SimpleThings/EntityAudit/AuditReader.php index <HASH>..<HASH> 100755 --- a/src/SimpleThings/EntityAudit/AuditReader.php +++ b/src/SimpleThings/EntityAudit/AuditReader.php @@ -457,7 +457,7 @@ class AuditReader $id = array($class->identifier[0] => $id); } - $whereId = []; + $whereId = array(); foreach ($class->identifier AS $idField) { if (isset($class->fieldMappings[$idField])) { $columnName = $class->fieldMappings[$idField]['columnName'];
Replaced `[]` with `array()` for php <I> compatibility
simplethings_EntityAuditBundle
train
php
6bf201f92030fee677218c64faa7628170319e9f
diff --git a/build/build.py b/build/build.py index <HASH>..<HASH> 100755 --- a/build/build.py +++ b/build/build.py @@ -49,7 +49,7 @@ import shakaBuildHelpers common_closure_opts = [ - '--language_in', 'ECMASCRIPT5', + '--language_in', 'ECMASCRIPT6', '--language_out', 'ECMASCRIPT3', '--jscomp_error=*',
[ES6] Allow ES6 input in the Closure Compiler Note that until we replace gjslint, the linter will still not accept ES6 syntax. So we cannot yet merge any commits which use ES6. But this should allow us to start experimenting with ES6 locally by bypassing the old linter. Issue #<I> Change-Id: Ic<I>f<I>a<I>f<I>b0a<I>c3e<I>cee6e<I>f
google_shaka-player
train
py
57c3b26765450fcaee883624990eb4dc05c18d94
diff --git a/codespell_lib/_codespell.py b/codespell_lib/_codespell.py index <HASH>..<HASH> 100755 --- a/codespell_lib/_codespell.py +++ b/codespell_lib/_codespell.py @@ -631,9 +631,11 @@ def main(*args): del dirs[:] continue for file_ in files: - if glob_match.match(file_): + if glob_match.match(file_): # skip files continue fname = os.path.join(root, file_) + if glob_match.match(fname): # skip paths + continue if not os.path.isfile(fname) or not os.path.getsize(fname): continue bad_count += parse_file(fname, colors, summary) diff --git a/codespell_lib/tests/test_basic.py b/codespell_lib/tests/test_basic.py index <HASH>..<HASH> 100644 --- a/codespell_lib/tests/test_basic.py +++ b/codespell_lib/tests/test_basic.py @@ -276,6 +276,7 @@ def test_ignore(): assert cs.main('--skip=bad*', d) == 0 assert cs.main('--skip=*ignoredir*', d) == 1 assert cs.main('--skip=ignoredir', d) == 1 + assert cs.main('--skip=*ignoredir/bad*', d) == 1 def test_check_filename():
Extend --skip to match globs across full paths. Closes #<I> (#<I>) * Add a test for skipping globs with directory and filename in * Forcing a Travis build * Tidy the Travis force * Skip paths with the glob mathing too
codespell-project_codespell
train
py,py
ccf06f2216d8da578546ea9e0f7305b1bd637fe2
diff --git a/src/crypto/verification/request/ToDeviceChannel.js b/src/crypto/verification/request/ToDeviceChannel.js index <HASH>..<HASH> 100644 --- a/src/crypto/verification/request/ToDeviceChannel.js +++ b/src/crypto/verification/request/ToDeviceChannel.js @@ -179,7 +179,9 @@ export class ToDeviceChannel { const isAcceptingEvent = type === START_TYPE || type === READY_TYPE; // the request has picked a ready or start event, tell the other devices about it if (isAcceptingEvent && !wasStarted && isStarted && this._deviceId) { - const nonChosenDevices = this._devices.filter(d => d !== this._deviceId); + const nonChosenDevices = this._devices.filter( + d => d !== this._deviceId && d !== this._client.getDeviceId(), + ); if (nonChosenDevices.length) { const message = this.completeContent({ code: "m.accepted",
don't cancel ourselves when selecting a self-verification partner
matrix-org_matrix-js-sdk
train
js
fd37e44854b9d27a75cd99217be2804c939201ef
diff --git a/telethon/utils.py b/telethon/utils.py index <HASH>..<HASH> 100644 --- a/telethon/utils.py +++ b/telethon/utils.py @@ -678,7 +678,8 @@ def _get_extension(file): # Note: ``file.name`` works for :tl:`InputFile` and some `IOBase` return _get_extension(file.name) else: - return '' + # Maybe it's a Telegram media + return get_extension(file) def is_image(file):
Fix is_image not considering MessageMedia objects This was causing albums with MessageMedia objects to fail.
LonamiWebs_Telethon
train
py
a80375dfbb46d66164c9a6050d032a55bd6b4d11
diff --git a/src/main/java/net/magik6k/jwwf/core/JwwfServer.java b/src/main/java/net/magik6k/jwwf/core/JwwfServer.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/magik6k/jwwf/core/JwwfServer.java +++ b/src/main/java/net/magik6k/jwwf/core/JwwfServer.java @@ -1,6 +1,7 @@ package net.magik6k.jwwf.core; import java.util.LinkedList; +import java.util.List; import javax.servlet.Servlet; @@ -173,6 +174,16 @@ public class JwwfServer { } /** + * This method returns list containing instances of all plugins + * attached to this server. + * @return List containing instances of attached plugins. + */ + @SuppressWarnings("unchecked") + public List<JwwfPlugin> getPlugins(){ + return (List<JwwfPlugin>) plugins.clone(); + } + + /** * <p> * Sometimes you have to release your application and you can't set proxy for * websocket connections, you need to set url of api here.
Added ability to get plugins contained in server instance
magik6k_JWWF
train
java