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
8dbd565a390a2b2234bcd22f7ae46a67ec825f9d
diff --git a/lib/linux_admin/version.rb b/lib/linux_admin/version.rb index <HASH>..<HASH> 100644 --- a/lib/linux_admin/version.rb +++ b/lib/linux_admin/version.rb @@ -1,3 +1,3 @@ class LinuxAdmin - VERSION = "0.2.0" + VERSION = "0.2.1" end
Bumping version to <I>.
ManageIQ_linux_admin
train
rb
04261e66d88f9e5272d00e828e49896dbcf0d6f3
diff --git a/lib/boot_merb.rb b/lib/boot_merb.rb index <HASH>..<HASH> 100644 --- a/lib/boot_merb.rb +++ b/lib/boot_merb.rb @@ -43,6 +43,11 @@ class Merb::Test::RspecStory follow_redirect! while redirect? status end + def post_via_redirect(path, parameters = {}, headers = {}) + @controller=post path, parameters, headers + follow_redirect! while redirect? + status + end def delete_via_redirect(path, parameters = {}, headers = {}) @controller=delete path, parameters, headers follow_redirect! while redirect?
Added missing post_via_redirect
brynary_webrat
train
rb
55e195cdf2f19c3f36007b72c1a9093dd9b0ebdb
diff --git a/pymysql/_auth.py b/pymysql/_auth.py index <HASH>..<HASH> 100644 --- a/pymysql/_auth.py +++ b/pymysql/_auth.py @@ -4,6 +4,8 @@ Implements auth methods from ._compat import text_type, PY2 from .constants import CLIENT from .err import OperationalError +from .util import byte2int, int2byte + from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serialization, hashes @@ -11,6 +13,7 @@ from cryptography.hazmat.primitives.asymmetric import padding from functools import partial import hashlib +import io import struct
Fix old password support (#<I>)
PyMySQL_PyMySQL
train
py
bba67326f71dcf0768b5e76f01ba4292c7508018
diff --git a/test/misc.js b/test/misc.js index <HASH>..<HASH> 100644 --- a/test/misc.js +++ b/test/misc.js @@ -24,12 +24,4 @@ describe('ArrayBuffer', function () { it('Inflate ArrayBuffer', function () { assert.ok(cmp(sample, pako.inflate(deflated.buffer))); }); - - it('Simplified minified version test', function () { - // At some point minifier started to corrupt str2buf function - // https://github.com/nodeca/pako/issues/161#issuecomment-468420555 - var minified = require('../dist/pako.min.js'); - - assert.ok(cmp(minified.deflate('→'), pako.deflate('→'))); - }); });
Remove outdated test to cleanup coverage report - uglify-js not used anymore
nodeca_pako
train
js
0a1aa7502b83b2d51d7ee0231fb0155537b89ecd
diff --git a/lib/skiima/db/helpers/mysql.rb b/lib/skiima/db/helpers/mysql.rb index <HASH>..<HASH> 100644 --- a/lib/skiima/db/helpers/mysql.rb +++ b/lib/skiima/db/helpers/mysql.rb @@ -2,7 +2,7 @@ module Skiima module Db module Helpers module Mysql - #attr_accessor :local_tz, :version + #attr_accessor :version def supported_objects [:database, :table, :view, :index, :proc] diff --git a/lib/skiima/db/helpers/postgresql.rb b/lib/skiima/db/helpers/postgresql.rb index <HASH>..<HASH> 100644 --- a/lib/skiima/db/helpers/postgresql.rb +++ b/lib/skiima/db/helpers/postgresql.rb @@ -2,7 +2,8 @@ module Skiima module Db module Helpers module Postgresql - attr_accessor :local_tz, :version + attr_accessor :local_tz + #attr_accessor :version # skiima def supported_objects
removed #version accessor from mysql and postgresql helpers
dcunited001_skiima
train
rb,rb
ef23a3612536bd2656d96b730a979fea3988e92b
diff --git a/src/renderable/container.js b/src/renderable/container.js index <HASH>..<HASH> 100644 --- a/src/renderable/container.js +++ b/src/renderable/container.js @@ -112,6 +112,11 @@ } } + // specify a z property to infinity if not defined + if (typeof child.z === 'undefined') { + child.z = Infinity; + } + child.ancestor = this; this.children.push(child); diff --git a/src/vendors/tween.js b/src/vendors/tween.js index <HASH>..<HASH> 100644 --- a/src/vendors/tween.js +++ b/src/vendors/tween.js @@ -48,11 +48,6 @@ var _onUpdateCallback = null; var _onCompleteCallback = null; - /** - * fixed z value - * @ignore - */ - this.z = 999; // Set all starting values present on the target object for ( var field in object ) {
removed the `z` property from the Tween object definition this is now enforced through the `addChild` function that will set the property to `Infinity` if not defined. the Tween object is now almost the default one without any specific (melonJS) properties.
melonjs_melonJS
train
js,js
f83959e1595c8c1032960bb3338279b5ed7de16a
diff --git a/great_expectations/dataset/base.py b/great_expectations/dataset/base.py index <HASH>..<HASH> 100644 --- a/great_expectations/dataset/base.py +++ b/great_expectations/dataset/base.py @@ -74,11 +74,12 @@ class DataSet(object): del all_args["output_format"] all_args = ensure_json_serializable(all_args) + expectation_args = copy.deepcopy(all_args) #Construct the expectation_config object expectation_config = DotDict({ "expectation_type": method_name, - "kwargs": all_args + "kwargs": expectation_args }) #Add the expectation_method key @@ -89,7 +90,7 @@ class DataSet(object): #Finally, execute the expectation method itself try: - return_obj = func(self, **all_args) + return_obj = func(self, **expectation_args) except Exception as err: if catch_exceptions:
Make deep copy of all_args in expectation (#<I>)
great-expectations_great_expectations
train
py
529897a609cddf8f5d10070135cc454f507d9238
diff --git a/code/fields/AccountingField.php b/code/fields/AccountingField.php index <HASH>..<HASH> 100644 --- a/code/fields/AccountingField.php +++ b/code/fields/AccountingField.php @@ -118,6 +118,6 @@ class AccountingField extends TextField $removedThousendSeparator = preg_replace('/(\.|,)(?=[0-9]{3,}$)/', '', $stringWithCommaOrDot); - return (float) str_replace(',', '.', $removedThousendSeparator); + return str_replace(',', '.', $removedThousendSeparator); } } \ No newline at end of file
DO NOT CAST TO FLOAT (as it is subject to locale settings and you could end up with a comma)
lekoala_silverstripe-form-extras
train
php
2a0f04aaca4478a6b406c8aa2593920a3e86e6d0
diff --git a/mambustruct.py b/mambustruct.py index <HASH>..<HASH> 100644 --- a/mambustruct.py +++ b/mambustruct.py @@ -51,9 +51,9 @@ class MambuStruct(object): def __init__(self, urlfunc, entid='', *args, **kwargs): if urlfunc == None: return - self.urlfunc = urlfunc self.rc = RequestsCounter() + self.__urlfunc = urlfunc try: self.__formatoFecha=kwargs['dateFormat'] except KeyError: @@ -64,7 +64,7 @@ class MambuStruct(object): retries = 0 while retries < MambuStruct.RETRIES: try: - resp = urlopen(self.urlfunc(entid, *args, **kwargs)) + resp = urlopen(self.__urlfunc(entid, *args, **kwargs)) self.rc.requests += 1 break except Exception as ex:
Make urlfunc a 'private' attribute in MambuStruct.
jstitch_MambuPy
train
py
94f0cbe6ed2cc6b0f504a8203ca937fc1fe643fb
diff --git a/Entity/ContactSource.php b/Entity/ContactSource.php index <HASH>..<HASH> 100644 --- a/Entity/ContactSource.php +++ b/Entity/ContactSource.php @@ -29,7 +29,7 @@ class ContactSource extends FormEntity private $id; /** @var string */ - private $utm_source; + private $utmSource; /** @var string */ private $description; @@ -104,7 +104,7 @@ class ContactSource extends FormEntity $builder->addPublishDates(); - $builder->addNullableField('utm_source', 'string'); + $builder->addNamedField('utmSource', 'string', 'utm_source', true); $builder->addNullableField('description_public', 'string'); @@ -300,19 +300,19 @@ class ContactSource extends FormEntity */ public function getUtmSource() { - return $this->utm_source; + return $this->utmSource; } /** - * @param mixed $utm_source + * @param mixed $utmSource * * @return ContactSource */ - public function setUtmSource($utm_source) + public function setUtmSource($utmSource) { - $this->isChanged('utm_source', $utm_source); + $this->isChanged('utmSource', $utmSource); - $this->utm_source = $utm_source; + $this->utmSource = $utmSource; return $this; }
Correct the casing on the UTM Source field.
TheDMSGroup_mautic-contact-source
train
php
60b3c3e266d62a5432343c4b2a1373e34c3be4e9
diff --git a/lib/express_templates/components/tree_for.rb b/lib/express_templates/components/tree_for.rb index <HASH>..<HASH> 100644 --- a/lib/express_templates/components/tree_for.rb +++ b/lib/express_templates/components/tree_for.rb @@ -64,7 +64,7 @@ module ExpressTemplates return 'ExpressTemplates::Components::TreeFor.render_in(self) { node_renderer = '+node_renderer.gsub(/node/, member)+' ExpressTemplates::Indenter.for(:tree) do |ws, wsnl| - "#{ws}<ul id=\"roles\" class=\"roles tree\">" + + "#{ws}<ul id=\"'+@options[:id]+'\" class=\"'+@options[:id]+' tree\">" + '+collection+'.map do |'+member+'| node_renderer.call('+member+', node_renderer) end.join +
[#<I>] ensure correct classes and id
aelogica_express_templates
train
rb
06a5d4005b65ec325165add0e2f9502c12d3dce1
diff --git a/anonuuid.go b/anonuuid.go index <HASH>..<HASH> 100644 --- a/anonuuid.go +++ b/anonuuid.go @@ -176,7 +176,7 @@ func GenerateHexspeakUUID(i int) (string, error) { // GenerateLenUUID returns an UUID formatted string based on an index number func GenerateLenUUID(i int) (string, error) { if i < 0 { - i = 2147483649 + i + i = 2<<29 + i } return FormatUUID(fmt.Sprintf("%x", i)) }
Avoid int overflow on <I>bits platforms
moul_anonuuid
train
go
6ade77bbda6ffc74ed76c61624a80183e4153867
diff --git a/spyder/widgets/variableexplorer/utils.py b/spyder/widgets/variableexplorer/utils.py index <HASH>..<HASH> 100644 --- a/spyder/widgets/variableexplorer/utils.py +++ b/spyder/widgets/variableexplorer/utils.py @@ -481,7 +481,6 @@ def make_remote_view(data, settings, more_excluded_names=None): Make a remote view of dictionary *data* -> globals explorer """ - assert all([name in REMOTE_SETTINGS for name in settings]) data = get_remote_data(data, settings, mode='editable', more_excluded_names=more_excluded_names) remote = {}
Variable explorer: Remove assert which is no longer satisfied Commit da2aa<I> broke the assert.
spyder-ide_spyder-kernels
train
py
34eac41675d3fd375860f79f7967bda8446d5e78
diff --git a/lib/savon/client.rb b/lib/savon/client.rb index <HASH>..<HASH> 100644 --- a/lib/savon/client.rb +++ b/lib/savon/client.rb @@ -113,7 +113,7 @@ module Savon soap.namespace_identifier = options[0] soap.namespace = wsdl.namespace soap.element_form_default = wsdl.element_form_default if wsdl.present? - soap.body = options[2].delete(:body) if options[2][:body] + soap.body = options[2].delete(:body) set_soap_action options[1] set_soap_input *options
added a spec for the SOAP :body passed directly to Savon::Client#request
savonrb_savon
train
rb
ebc07407242366e1518158029a1e77cc940e07ea
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -31,5 +31,6 @@ if os.environ.get('READTHEDOCS') == 'True': 'https://media.readthedocs.org/css/sphinx_rtd_theme.css', 'https://media.readthedocs.org/css/readthedocs-doc-embed.css', '_static/theme.css', - ] + ], + 'theme_css': '_static/theme.css' }
Attempt to convince RTD to ignore their CSS override nonsense.
Fizzadar_pyinfra
train
py
96ad81fb07fd139ffcda9345125c193dc4e5270c
diff --git a/lib/model/application.js b/lib/model/application.js index <HASH>..<HASH> 100644 --- a/lib/model/application.js +++ b/lib/model/application.js @@ -22,12 +22,6 @@ var _ = require("underscore"), var Application = DatabankObject.subClass("application", ActivityObject); -Application.schema = { - pkey: ActivityObject.baseSchema.pkey, - indices: _.clone(ActivityObject.baseSchema.indices), - fields: _.without(ActivityObject.baseSchema.fields, - "attachments", - "inReplyTo") -}; +Application.schema = ActivityObject.subSchema(["attachments", "inReplyTo"]); exports.Application = Application; diff --git a/test/application-test.js b/test/application-test.js index <HASH>..<HASH> 100644 --- a/test/application-test.js +++ b/test/application-test.js @@ -28,21 +28,24 @@ var suite = vows.describe("application module interface"); var testSchema = { pkey: "id", - fields: ["attachments", + fields: ["_created", + "_uuid", "author", "content", "displayName", "downstreamDuplicates", "id", "image", + "likes", + "links", "objectType", "published", + "replies", + "shares", "summary", "updated", "upstreamDuplicates", - "url", - "_uuid" - ], + "url"], indices: ["_uuid"] };
Use subSchema() for application
pump-io_pump.io
train
js,js
ed577a50e65308322f7509327ae229ed388b4bb4
diff --git a/src/ASTPreprocessor.js b/src/ASTPreprocessor.js index <HASH>..<HASH> 100644 --- a/src/ASTPreprocessor.js +++ b/src/ASTPreprocessor.js @@ -80,9 +80,9 @@ class ASTPreprocessor { static *walker(ast, cbs, parent) { var me = (a) => ASTPreprocessor.walker(a, cbs, ast); + if ( parent && ast instanceof ASTNode ) ast.addHiddenProperty('parent', parent); invokeCB(cbs, 'enter', ast); invokeCB(cbs, 'enter' + ast.type, ast); - if ( parent && ast instanceof ASTNode ) ast.addHiddenProperty('parent', parent); switch ( ast.type ) { case 'Program': for ( let e of ast.body ) yield * me(e); @@ -218,6 +218,10 @@ class EsperASTInstructions { enterIdentifier(a) { let fn = this.funcStack[0]; + let parent = a.parent; + if ( parent.type == "MemberExpression" && !parent.computed && parent.property == a ) { + return; + } fn.refs[a.name] = true; }
An Identifier used as the property in a non-computed MemberExpression isn't an upvar.
codecombat_esper.js
train
js
b7860ea2ba69116706c4d50e440d89706d87f20e
diff --git a/spec/mail/message_spec.rb b/spec/mail/message_spec.rb index <HASH>..<HASH> 100644 --- a/spec/mail/message_spec.rb +++ b/spec/mail/message_spec.rb @@ -1235,6 +1235,12 @@ describe Mail::Message do describe "helper methods" do describe "==" do + before(:each) do + # Ensure specs don't randomly fail due to messages being generated 1 second apart + time = Time.now + Time.should_receive(:now).twice.and_return(time) + end + it "should be implemented" do doing { Mail.new == Mail.new }.should_not raise_error end
Fix random spec failure due to timing
mikel_mail
train
rb
3719a6f2f2677e9c5f2450c4dab309de4b65be9a
diff --git a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php @@ -264,6 +264,10 @@ class YamlDriver extends FileDriver $mapping['columnDefinition'] = $idElement['columnDefinition']; } + if (isset($idElement['options'])) { + $mapping['options'] = $idElement['options']; + } + $metadata->mapField($mapping); if (isset($idElement['generator'])) {
[DDC-<I>] Fix bug in YamlDriver not passing options from id to mapField()
doctrine_orm
train
php
ecce2888af2f7ae467d3816fa44dc3905fa340e4
diff --git a/src/kba/pipeline/_clean_visible.py b/src/kba/pipeline/_clean_visible.py index <HASH>..<HASH> 100644 --- a/src/kba/pipeline/_clean_visible.py +++ b/src/kba/pipeline/_clean_visible.py @@ -106,6 +106,9 @@ def clean_visible(config): returns a kba.pipeline "transform" function that attempts to generate stream_item.body.clean_visible from body.clean_html ''' + ## we only do clean_html today + assert config.get('require_clean_html', True) + ## make a closure around config def _make_clean_visible(stream_item): if stream_item.body and stream_item.body.clean_html:
insisting that config only specify using clean_html as input to clean_visible
trec-kba_streamcorpus-pipeline
train
py
441fd7ac023fc25ff84e0b3fafa5f9de52734216
diff --git a/generators/generator-constants.js b/generators/generator-constants.js index <HASH>..<HASH> 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -42,7 +42,7 @@ const DOCKER_JHIPSTER_LOGSTASH = 'jhipster/jhipster-logstash:v4.0.0'; const DOCKER_JHIPSTER_IMPORT_DASHBOARDS = 'jhipster/jhipster-import-dashboards:v4.0.0'; const DOCKER_JHIPSTER_ZIPKIN = 'jhipster/jhipster-zipkin:v4.0.0'; const DOCKER_TRAEFIK = 'traefik:1.7.4'; -const DOCKER_CONSUL = 'consul:1.3.0'; +const DOCKER_CONSUL = 'consul:1.4.0'; const DOCKER_CONSUL_CONFIG_LOADER = 'jhipster/consul-config-loader:v0.3.0'; const DOCKER_PROMETHEUS = 'prom/prometheus:v2.4.3'; const DOCKER_PROMETHEUS_ALERTMANAGER = 'prom/alertmanager:v0.15.2';
Upgrade to Consul to <I>
jhipster_generator-jhipster
train
js
a4ab9a5a0ba9ec590ebd6fd1a5c1f911eb4a0b5d
diff --git a/matplotlib2tikz.py b/matplotlib2tikz.py index <HASH>..<HASH> 100644 --- a/matplotlib2tikz.py +++ b/matplotlib2tikz.py @@ -719,7 +719,7 @@ def _transform_to_data_coordinates(obj, xdata, ydata): points = numpy.array(zip(xdata, ydata)) transform = matplotlib.transforms.composite_transform_factory( obj.get_transform(), - obj.get_axes().transData.inverted() + obj.axes.transData.inverted() ) points_data = transform.transform(points) xdata, ydata = zip(*points_data) @@ -1598,7 +1598,7 @@ def _draw_text(data, obj): if str(obj.get_weight()) in vals: style.append('\\bfseries') - if obj.get_axes(): + if obj.axes: # If the coordinates are relative to an axis, use `axis cs`. tikz_pos = '(axis cs:%.15g,%.15g)' % pos else:
remove usage of get_axes() It's being deprecated.
nschloe_matplotlib2tikz
train
py
b69b189986b74fb6a99878818d69ab9e8ff01aef
diff --git a/src/View/View.php b/src/View/View.php index <HASH>..<HASH> 100644 --- a/src/View/View.php +++ b/src/View/View.php @@ -998,18 +998,14 @@ class View implements EventDispatcherInterface * * @param string $viewFile Filename of the view * @param array $dataForView Data to include in rendered view. - * If empty the current View::$viewVars will be used. * @return string Rendered output */ protected function _evaluate($viewFile, $dataForView) { - $this->__viewFile = $viewFile; extract($dataForView); ob_start(); - include $this->__viewFile; - - unset($this->__viewFile); + include $viewFile; return ob_get_clean(); }
Get rid of unnecessary property assignment. It was only used for testing purposes earlier.
cakephp_cakephp
train
php
1fd52294c3fe6350807bce11e5251e9b0d5061d1
diff --git a/jsonAPI/JsonApiView.php b/jsonAPI/JsonApiView.php index <HASH>..<HASH> 100644 --- a/jsonAPI/JsonApiView.php +++ b/jsonAPI/JsonApiView.php @@ -39,7 +39,12 @@ class JsonApiView extends \Slim\View { $response['status'] = $status; //add flash messages - $response['flash'] = $this->data->flash->getMessages(); + $flash = $this->data->flash->getMessages(); + if (count($flash)) { + $response['flash'] = $flash; + } else { + unset($response['flash']); + } $app->response()->status($status); $app->response()->header('Content-Type', 'application/json');
Wrapped flash in conditional as requested. Also unset flash if there are no messages.
entomb_slim-json-api
train
php
932b0caba181c2eb8592db6b047ef96ce9de9aae
diff --git a/lib/tire/index.rb b/lib/tire/index.rb index <HASH>..<HASH> 100644 --- a/lib/tire/index.rb +++ b/lib/tire/index.rb @@ -77,7 +77,8 @@ module Tire params[:percolate] = "*" if params[:percolate] === true end - params[:parent] = options[:parent] if options[:parent] + params[:parent] = options[:parent] if options[:parent] + params[:routing] = options[:routing] if options[:routing] params_encoded = params.empty? ? '' : "?#{params.to_param}" diff --git a/test/unit/index_test.rb b/test/unit/index_test.rb index <HASH>..<HASH> 100644 --- a/test/unit/index_test.rb +++ b/test/unit/index_test.rb @@ -288,6 +288,14 @@ module Tire @index.store '{"foo" : "bar"}' end + should "extract the routing information from options" do + Configuration.client.expects(:post).with do |url, payload| + assert_match /routing=abc/, url + end.returns(mock_response('{"ok":true,"_id":"123"}')) + + @index.store( {:id => 123, :title => 'Test'}, {:routing => 'abc'} ) + end + context "document with ID" do should "store Hash it under its ID property" do
Added extracting the `routing` information in the `Index#store` method Tire.index('myindex').store( {:id => 1, :title => 'Test'}, {:routing => 'abc'} ) Closes #<I>
karmi_retire
train
rb,rb
7b5d2fbdf4b98bc0f013ff5eb4642240e5dd3b09
diff --git a/test/test_helper.rb b/test/test_helper.rb index <HASH>..<HASH> 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -41,7 +41,9 @@ module Minitest end def teardown - refute FakeFS.activated? + return if !FakeFS.activated? + FakeFs.deactivate! + flunk "always deactivate FakeFs after test run" end end end
make activation bugs obvious but also fix them so only 1 test fails
fakefs_fakefs
train
rb
f14b5fa047916e66b128379a82c8787799f615fe
diff --git a/src/Illuminate/Broadcasting/Broadcasters/AblyBroadcaster.php b/src/Illuminate/Broadcasting/Broadcasters/AblyBroadcaster.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Broadcasting/Broadcasters/AblyBroadcaster.php +++ b/src/Illuminate/Broadcasting/Broadcasters/AblyBroadcaster.php @@ -76,7 +76,7 @@ class AblyBroadcaster extends Broadcaster $request->channel_name, $request->socket_id, $userData = array_filter([ - 'user_id' => $this->retrieveUser($request, $channelName)->getAuthIdentifier(), + 'user_id' => (string) $this->retrieveUser($request, $channelName)->getAuthIdentifier(), 'user_info' => $result, ]) );
Ably expects clientId as string (#<I>) Ably uses the Pusher 'user_id' and maps it to 'clientId' which should be a string
laravel_framework
train
php
a524cf1880fbdfac0eb7c64c39b2c66f646b0170
diff --git a/zipline/utils/cli.py b/zipline/utils/cli.py index <HASH>..<HASH> 100644 --- a/zipline/utils/cli.py +++ b/zipline/utils/cli.py @@ -241,7 +241,6 @@ def run_pipeline(print_algo=True, **kwargs): capital_base=float(kwargs['capital_base']), algo_filename=kwargs.get('algofile'), equities_metadata=asset_metadata, - identifiers=symbols, start=start, end=end)
BUG: fix bug that caused symbols to be added to the asset finder twice
quantopian_zipline
train
py
21d5ba8d79d9f694e3bb32b5a2e9887e9ea9240a
diff --git a/src/Sulu/Bundle/AdminBundle/Admin/View/ToolbarAction.php b/src/Sulu/Bundle/AdminBundle/Admin/View/ToolbarAction.php index <HASH>..<HASH> 100644 --- a/src/Sulu/Bundle/AdminBundle/Admin/View/ToolbarAction.php +++ b/src/Sulu/Bundle/AdminBundle/Admin/View/ToolbarAction.php @@ -33,6 +33,11 @@ class ToolbarAction $this->options = $options; } + public function getType() + { + return $this->type; + } + public function getOptions() { return $this->options;
Add getter for type property of ToolbarAction class (#<I>)
sulu_sulu
train
php
53bc3c5a32be247fdfddc2c6033bccf44183f58f
diff --git a/src/SampleFactory.php b/src/SampleFactory.php index <HASH>..<HASH> 100644 --- a/src/SampleFactory.php +++ b/src/SampleFactory.php @@ -48,7 +48,7 @@ class SampleFactory implements Factory, DomainEventFactory return new ProductImportDomainEventHandler( $event, $this->getMasterFactory()->getProductBuilder(), - $this->getMasterFactory()->getEnvironmentBuilder(), + $this->getMasterFactory()->getEnvironmentSourceBuilder(), $this->getMasterFactory()->createProductProjector() ); }
Issue #<I>: Fix SampleFactory
lizards-and-pumpkins_catalog
train
php
c90280824aa1b6a99b373d99e04786c02f7f153a
diff --git a/helios-tools/src/main/java/com/spotify/helios/cli/command/JobWatchCommand.java b/helios-tools/src/main/java/com/spotify/helios/cli/command/JobWatchCommand.java index <HASH>..<HASH> 100644 --- a/helios-tools/src/main/java/com/spotify/helios/cli/command/JobWatchCommand.java +++ b/helios-tools/src/main/java/com/spotify/helios/cli/command/JobWatchCommand.java @@ -72,6 +72,7 @@ public class JobWatchCommand extends MultiTargetControlCommand { .help("Job reference"); intervalArg = parser.addArgument("--interval") + .type(Integer.class) .setDefault(1) .help("polling interval, default 1 second");
Fix arg parse for watch command
spotify_helios
train
java
b53fa44bbfb62dc284a052d828390b21f50d61f9
diff --git a/dlog.go b/dlog.go index <HASH>..<HASH> 100644 --- a/dlog.go +++ b/dlog.go @@ -187,7 +187,7 @@ func logf(severity Severity, format string, args ...interface{}) { if _globals.syslogger != nil { (*_globals.syslogger).WriteLevel(severityToSyslogPriority[severity], []byte(message)) } else { - line := fmt.Sprintf("[%d-%02d-%02d %02d:%02d:%02d] [%s] [%s] %s\n", year, int(month), day, hour, minute, second, _globals.appName, SeverityName[severity], message) + line := fmt.Sprintf("[%d-%02d-%02d %02d:%02d:%02d] [%s] %s\n", year, int(month), day, hour, minute, second, SeverityName[severity], message) if _globals.outFd != nil { _globals.outFd.WriteString(line) _globals.outFd.Sync()
Do not log the app name in !syslog -- This is lousy
jedisct1_dlog
train
go
58becce51795c4458a601e172b536ca01ae2d5cb
diff --git a/main/app/Controller/AbstractCrudController.php b/main/app/Controller/AbstractCrudController.php index <HASH>..<HASH> 100644 --- a/main/app/Controller/AbstractCrudController.php +++ b/main/app/Controller/AbstractCrudController.php @@ -278,6 +278,9 @@ abstract class AbstractCrudController extends AbstractApiController return new JsonResponse($object, 400); } + //just in case so we really returns the proper object + $this->om->refresh($object); + return new JsonResponse( $this->serializer->serialize($object, $options) );
[CoreBundle] Text properly refreshed in the ui on update. (#<I>)
claroline_Distribution
train
php
f7f335f83cbf4631bc468fca2cedb6dfc1492ead
diff --git a/classes/import.php b/classes/import.php index <HASH>..<HASH> 100644 --- a/classes/import.php +++ b/classes/import.php @@ -233,15 +233,7 @@ class Import $mptt = ORM::factory( 'tag_mptt' ); $mptt->id = $tag['rid']; - - //if ($parent == null) - // { - // $mptt->make_root(); - // } - // else - // { - $mptt->insert_as_last_child( $parent ); - // } + $mptt->insert_as_last_child( $parent ); self::child_tags( $db, $tag['rid'] ); }
Removed commented out code from tag import
boomcms_boom-core
train
php
af9777e1f29f7adaba94cd836aecf9679bd421e1
diff --git a/lib/attr_secure.rb b/lib/attr_secure.rb index <HASH>..<HASH> 100644 --- a/lib/attr_secure.rb +++ b/lib/attr_secure.rb @@ -15,8 +15,8 @@ module AttrSecure # The order in this list matters, as only the first valid adapter will be used # ADAPTERS = [ - AttrSecure::Adapters::ActiveRecord, AttrSecure::Adapters::Sequel, + AttrSecure::Adapters::ActiveRecord, AttrSecure::Adapters::Ruby ]
Prioritise Sequel over AR In a Rails app using Sequel-Rails the gem assumes that the app is trying to use AR as it's present in the gems. This change prioritises Sequel over AR so that AR is only used if the Sequel check fails.
neilmiddleton_attr_secure
train
rb
c56bfcc14b9a3d8ca76d06bb27f356fc47c7396d
diff --git a/pkg/apis/kops/validation/legacy.go b/pkg/apis/kops/validation/legacy.go index <HASH>..<HASH> 100644 --- a/pkg/apis/kops/validation/legacy.go +++ b/pkg/apis/kops/validation/legacy.go @@ -233,7 +233,7 @@ func ValidateCluster(c *kops.Cluster, strict bool) *field.Error { } // Check Canal Networking Spec if used - if c.Spec.Networking.Canal != nil { + if c.Spec.Networking != nil && c.Spec.Networking.Canal != nil { action := c.Spec.Networking.Canal.DefaultEndpointToHostAction switch action { case "", "ACCEPT", "DROP", "RETURN": @@ -730,7 +730,7 @@ func validateEtcdMemberSpec(spec *kops.EtcdMemberSpec, fieldPath *field.Path) *f } func validateCilium(c *kops.Cluster) *field.Error { - if c.Spec.Networking.Cilium != nil { + if c.Spec.Networking != nil && c.Spec.Networking.Cilium != nil { specPath := field.NewPath("Spec") minimalKubeVersion := semver.MustParse("1.7.0")
Protect against panic when networking is not set This is particularly likely to happen with `kops create -f -`
kubernetes_kops
train
go
655689a743d10f8c43b1f734dcbff4ad3a08e085
diff --git a/scheduler/context.go b/scheduler/context.go index <HASH>..<HASH> 100644 --- a/scheduler/context.go +++ b/scheduler/context.go @@ -123,6 +123,12 @@ func (e *EvalContext) ProposedAllocs(nodeID string) ([]*structs.Allocation, erro proposed = structs.RemoveAllocs(existingAlloc, update) } + // Remove any allocs that are being preempted + nodePreemptedAllocs := e.plan.NodePreemptions[nodeID] + if len(nodePreemptedAllocs) > 0 { + proposed = structs.RemoveAllocs(existingAlloc, nodePreemptedAllocs) + } + // We create an index of the existing allocations so that if an inplace // update occurs, we do not double count and we override the old allocation. proposedIDs := make(map[string]*structs.Allocation, len(proposed))
Preempted allocations should be removed from proposed allocations
hashicorp_nomad
train
go
3dec4535e354e8d98817bce31ad1764643a26ea2
diff --git a/src/notices.js b/src/notices.js index <HASH>..<HASH> 100644 --- a/src/notices.js +++ b/src/notices.js @@ -29,14 +29,16 @@ class Notices { return; } - const noticeListElement = noticeElement.firstChild; const screenPosition = RendererUtils.toScreenPosition(container, 'TL'); // Clear any old notices - while (noticeListElement.hasChildNodes()) { - noticeListElement.removeChild(noticeListElement.lastChild); + while (noticeElement.hasChildNodes()) { + noticeElement.removeChild(noticeElement.lastChild); } + // Create the notices list + const noticeListElement = document.createElement('ul'); + // Add new notices to the notice box _.each(notices, notice => { let noticeString = notice.title; @@ -55,6 +57,7 @@ class Notices { }); // Size and position the notices + noticeElement.appendChild(noticeListElement); noticeElement.style.display = 'block'; noticeElement.style.top = `${screenPosition.y - (noticeElement.offsetHeight || 0)}px`; noticeElement.style.left = `${screenPosition.x}px`;
Stop assuming there is a ul in the vizceral-notice element. Fixes #9
Netflix_vizceral
train
js
ed552b4abf6cbaa6a080fd9cbbffce7025f9f081
diff --git a/lib/commands/context.js b/lib/commands/context.js index <HASH>..<HASH> 100644 --- a/lib/commands/context.js +++ b/lib/commands/context.js @@ -68,8 +68,7 @@ extensions.getNewRemoteDebugger = async function () { pageLoadMs: this.pageLoadMs, platformVersion: this.opts.platformVersion, socketPath, - remoteDebugProxyPort: this.opts.remoteDebugProxyPort, - remoteDebugProxySocketPath: this.opts.remoteDebugProxySocketPath + remoteDebugProxy: this.opts.remoteDebugProxy, }); };
combine remoteDebugProxyPort and remoteDebugProxySocketPath into remoteDebugProxy (#<I>)
appium_appium-xcuitest-driver
train
js
2efd0119e229abd0f9afebdbad0fe5604c4c2fe5
diff --git a/examples/auth-flow/app.js b/examples/auth-flow/app.js index <HASH>..<HASH> 100644 --- a/examples/auth-flow/app.js +++ b/examples/auth-flow/app.js @@ -11,7 +11,7 @@ var App = React.createClass({ updateAuth(loggedIn) { this.setState({ - loggedIn: !!loggedIn + loggedIn: loggedIn }); },
took out the typecasting to dry up the code since the parameterr passed must be a booelan
taion_rrtr
train
js
167f926720c37f2567c84b98e22ef94c442a3146
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -11,6 +11,9 @@ var PLUGIN_NAME = 'gulp-wrap'; function compile(file, contents, template, data, options){ data = data !== undefined ? data : {}; + if (file.data) { + data = extend(true, {}, file.data, data); + } data.contents = contents; /* * Add `file` field to source obj used when interpolating @@ -57,4 +60,4 @@ module.exports = function(opts, data, options){ } return es.map(wrap); -}; \ No newline at end of file +};
gulp-wrap should look extend the template with file.data In alignment with gulp-data would be nice if file.data could be used as the data without having to specify file.data.your_variable.
adamayres_gulp-wrap
train
js
a2793a7f8e20df25ab0ab50d7aa7c3f2089d5d64
diff --git a/orianna/src/main/java/com/merakianalytics/orianna/datapipeline/transformers/dtodata/MatchTransformer.java b/orianna/src/main/java/com/merakianalytics/orianna/datapipeline/transformers/dtodata/MatchTransformer.java index <HASH>..<HASH> 100644 --- a/orianna/src/main/java/com/merakianalytics/orianna/datapipeline/transformers/dtodata/MatchTransformer.java +++ b/orianna/src/main/java/com/merakianalytics/orianna/datapipeline/transformers/dtodata/MatchTransformer.java @@ -321,6 +321,7 @@ public class MatchTransformer extends AbstractDataTransformer { stats.setPhysicalDamageTaken((int)item.getPhysicalDamageTaken()); stats.setPinkWardsPurchased(item.getVisionWardsBoughtInGame()); stats.setQuadraKills(item.getQuadraKills()); + stats.setPentaKills(item.getPentaKills()); stats.setScore(item.getTotalPlayerScore()); stats.setScoreRank(item.getTotalScoreRank()); stats.setTeamObjectives(item.getTeamObjective());
Set pentaKills in MatchTransformer (#<I>)
meraki-analytics_orianna
train
java
b33a9320a91c548bf7dc144b295bfd1d42a4ecd0
diff --git a/server/src/main/java/io/atomix/copycat/server/state/PassiveState.java b/server/src/main/java/io/atomix/copycat/server/state/PassiveState.java index <HASH>..<HASH> 100644 --- a/server/src/main/java/io/atomix/copycat/server/state/PassiveState.java +++ b/server/src/main/java/io/atomix/copycat/server/state/PassiveState.java @@ -74,7 +74,8 @@ class PassiveState extends ReserveState { context.checkThread(); logRequest(request); - if (context.getLeader() == null) { + Member leader = context.getLeader(); + if (leader == null) { return CompletableFuture.completedFuture(logResponse(ConnectResponse.builder() .withStatus(Response.Status.ERROR) .withError(CopycatError.Type.NO_LEADER_ERROR) @@ -85,7 +86,7 @@ class PassiveState extends ReserveState { return CompletableFuture.completedFuture(ConnectResponse.builder() .withStatus(Response.Status.OK) - .withLeader(context.getLeader().clientAddress()) + .withLeader(leader.clientAddress()) .withMembers(context.getCluster().members().stream() .map(Member::clientAddress) .filter(m -> m != null)
Store leader in local variable when responding to ConnectRequest in PassiveState.
atomix_copycat
train
java
68fafb0a4c12f4489baa90458ef2860d3ecbf9a5
diff --git a/time_heap.js b/time_heap.js index <HASH>..<HASH> 100644 --- a/time_heap.js +++ b/time_heap.js @@ -84,8 +84,8 @@ TimeHeap.prototype.clear = function clear() { self.timers.clearTimeout(self.timer); self.array = []; - self.lastTime = self.timers.now(); self.timer = null; + self.lastTime = self.timers.now(); }; TimeHeap.prototype.getNextTimeout = function getNextTimeout(now) {
TimeHeap: trivial cleanup in #clear
uber_tchannel-node
train
js
a4656926797e7c9717c44260fe4b1a4e1bfb7076
diff --git a/src/AccordionContainer/AccordionContainer.spec.js b/src/AccordionContainer/AccordionContainer.spec.js index <HASH>..<HASH> 100644 --- a/src/AccordionContainer/AccordionContainer.spec.js +++ b/src/AccordionContainer/AccordionContainer.spec.js @@ -184,6 +184,24 @@ describe('Accordion', () => { expect(container.state.items.length).toBe(2); }); + it('can remove multiple items at the same time', async () => { + await Promise.all([ + container.addItem({ + uuid: 'foo', + }), + container.addItem({ + uuid: 'bar', + }), + ]); + + await Promise.all([ + container.removeItem('foo'), + container.removeItem('bar'), + ]); + + expect(container.state.items.length).toBe(0); + }); + it('raises console error in case of duplicate uuid', async () => { const uuid = 'uniqueCustomID'; jest.spyOn(global.console, 'error');
Add failing test for concurrent removeItem calls in AccordionContainer
springload_react-accessible-accordion
train
js
901fe94a2a4c1b1852c46776d476513a705f8524
diff --git a/bl/__init__.py b/bl/__init__.py index <HASH>..<HASH> 100644 --- a/bl/__init__.py +++ b/bl/__init__.py @@ -1,2 +0,0 @@ -from __future__ import print_function -
python 2 support not needed
BlackEarth_bl
train
py
5b451f8a725b8245019101aeb2d69103f9c49ed9
diff --git a/bpm/src/main/java/org/jboss/pnc/bpm/RestConnector.java b/bpm/src/main/java/org/jboss/pnc/bpm/RestConnector.java index <HASH>..<HASH> 100644 --- a/bpm/src/main/java/org/jboss/pnc/bpm/RestConnector.java +++ b/bpm/src/main/java/org/jboss/pnc/bpm/RestConnector.java @@ -156,8 +156,10 @@ public class RestConnector implements Connector { log.debug("Querying process instance using http endpoint: {}", request.getURI()); Optional<RestProcessInstance> instance = doQueryProcessInstance(accessToken, request); if (instance.isPresent()) { + log.info("Found process instance id:{} invoking cancel.", instance.get().getId()); return doCancel(instance.get(), accessToken); } else { + log.debug("Did not found process instance for correlationKey: {} to invoke cancel.", correlationKey); return false; } } catch (RestConnectorException e) {
Add more logging to build cancel.
project-ncl_pnc
train
java
6815818b22adeaaf721f029975dbce34850c7af5
diff --git a/karma.conf.js b/karma.conf.js index <HASH>..<HASH> 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -3,6 +3,8 @@ var webpack = require('webpack'); module.exports = function (config) { config.set({ + browserNoActivityTimeout: 30000, + browsers: [ process.env.CONTINUOUS_INTEGRATION ? 'Firefox' : 'Chrome' ], singleRun: process.env.CONTINUOUS_INTEGRATION === 'true',
fix travis ci build, maybe? thanks @mtscout6
taion_rrtr
train
js
1330d2a88c9bd0608bdb9be27e143e2d624c116e
diff --git a/src/directives/update/directive.js b/src/directives/update/directive.js index <HASH>..<HASH> 100644 --- a/src/directives/update/directive.js +++ b/src/directives/update/directive.js @@ -8,7 +8,8 @@ export default () => { save: '&onSave', item: '=', module: '=', - listUrl: '=' + list: '=', + action: '=' } }; };
rename to list and pass action
monomelodies_monad
train
js
1c2f62385f3ae4a920ef02ac0b57e69c782c920f
diff --git a/salt/states/pkg.py b/salt/states/pkg.py index <HASH>..<HASH> 100644 --- a/salt/states/pkg.py +++ b/salt/states/pkg.py @@ -332,6 +332,10 @@ def installed( :mod:`yumpkg5 <salt.modules.yumpkg5>`, and :mod:`zypper <salt.modules.zypper>`. + refresh + Update the repo database of available packages prior to installing the + requested package. + Usage:: httpd:
Add note about refresh option to pkg state. Closes #<I>.
saltstack_salt
train
py
520dce898b705dcb5ffb1e455cb43d68d2f17bcf
diff --git a/lib/fibers/runtime.js b/lib/fibers/runtime.js index <HASH>..<HASH> 100644 --- a/lib/fibers/runtime.js +++ b/lib/fibers/runtime.js @@ -4,7 +4,7 @@ this.create = create; this.invoke = invoke; this.construct = construct; -require('../util/require')('fibers', module.parent.filename); +var Fiber = require('../util/require')('fibers', module.parent.filename); /** * container for the context that the runtime maintains across async calls @@ -33,7 +33,7 @@ function create(fn, idx) { // Start a new fiber var that = this, args = arguments; - new Fiber(function() { + Fiber(function() { var val; try { val = fn.apply(that, args);
fixed #<I> (fiber <I> was broken)
Sage_streamlinejs
train
js
6032a4b206bbc3172b1a1f844f2c602dc7f362a3
diff --git a/astrocats/catalog/catalog.py b/astrocats/catalog/catalog.py index <HASH>..<HASH> 100644 --- a/astrocats/catalog/catalog.py +++ b/astrocats/catalog/catalog.py @@ -317,7 +317,7 @@ class Catalog: # Find the first task that has "always_journal" set to True for key in tasks: - if tasks[key].always_journal: + if tasks[key].active and tasks[key].always_journal: self.min_journal_priority = tasks[key].priority break
MAINT: only consider always_journal tasks if active
astrocatalogs_astrocats
train
py
38c6d77a094232dff7512aadeaa553dbf8eaac8e
diff --git a/arcanist/lib/WatchmanLintEngine.php b/arcanist/lib/WatchmanLintEngine.php index <HASH>..<HASH> 100644 --- a/arcanist/lib/WatchmanLintEngine.php +++ b/arcanist/lib/WatchmanLintEngine.php @@ -4,6 +4,10 @@ class WatchmanLintEngine extends ArcanistLintEngine { + private static $IGNORED_PATH_PATTERNS = array( + '%^thirdparty/%', + ); + public function buildLinters() { $linters = array(); $paths = $this->getPaths(); @@ -13,6 +17,13 @@ class WatchmanLintEngine extends ArcanistLintEngine { foreach ($paths as $key => $path) { if (!Filesystem::pathExists($this->getFilePathOnDisk($path))) { unset($paths[$key]); + } else { + foreach (static::$IGNORED_PATH_PATTERNS as $pattern) { + if (preg_match($pattern, $path)) { + unset($paths[$key]); + break; + } + } } }
Don't run lint on thirdparty directories Summary: I'm going to import `wildmatch.c` into `thirdparty`, but `arc lint` complains about its style. This disables the lint engine on changes to `thirdparty`. Test Plan: `arc lint` with `wildmatch.c` in `thirdparty` Reviewers: wez Differential Revision: <URL>
facebook_watchman
train
php
b40372ff1181615d497c0c364f786c8e39b32ec3
diff --git a/multiqc/modules/pychopper/pychopper.py b/multiqc/modules/pychopper/pychopper.py index <HASH>..<HASH> 100644 --- a/multiqc/modules/pychopper/pychopper.py +++ b/multiqc/modules/pychopper/pychopper.py @@ -34,8 +34,12 @@ class MultiqcModule(BaseMultiqcModule): self.pychopper_data[sample][category] = {} self.pychopper_data[sample][category][name] = float(value) + # Raise user warning if no data found + if len(self.pychopper_data) == 0: + raise UserWarning + log.info("Found {} reports".format(len(self.pychopper_data))) - + # Add to general statistics table: # Percentage of full length transcripts data_general_stats={}
Raise user warning when no files are found
ewels_MultiQC
train
py
38bf428483355cbccdc3a67e1589df18637b0c50
diff --git a/src/examples/java/ExampleUtils.java b/src/examples/java/ExampleUtils.java index <HASH>..<HASH> 100644 --- a/src/examples/java/ExampleUtils.java +++ b/src/examples/java/ExampleUtils.java @@ -59,7 +59,7 @@ public class ExampleUtils case 1: object .put("proxyHost", "") - .put("proxyPort", "8080"); + .put("proxyPort", 8080); //Setting new version and writing object.put("version", 2); Files.write(Paths.get(config.getPath()), object.toString(4).getBytes());
ports should be ints, not strings.
DV8FromTheWorld_JDA
train
java
0870e0e579bcdd66a46e4f9526d7344c22e92f83
diff --git a/lib/active_admin/base_controller.rb b/lib/active_admin/base_controller.rb index <HASH>..<HASH> 100644 --- a/lib/active_admin/base_controller.rb +++ b/lib/active_admin/base_controller.rb @@ -1,5 +1,3 @@ -require 'inherited_resources' - require 'active_admin/base_controller/authorization' require 'active_admin/base_controller/menu' diff --git a/lib/active_admin/resource_controller.rb b/lib/active_admin/resource_controller.rb index <HASH>..<HASH> 100644 --- a/lib/active_admin/resource_controller.rb +++ b/lib/active_admin/resource_controller.rb @@ -1,4 +1,3 @@ -require 'inherited_resources' require 'active_admin/resource_controller/action_builder' require 'active_admin/resource_controller/data_access' require 'active_admin/resource_controller/decorators'
remove require inherited_resources
activeadmin_activeadmin
train
rb,rb
c783b2ef7f4f6e91c7f383762e383fce35f8ef25
diff --git a/torchtext/vocab.py b/torchtext/vocab.py index <HASH>..<HASH> 100644 --- a/torchtext/vocab.py +++ b/torchtext/vocab.py @@ -260,8 +260,10 @@ class CharNGram(Vectors): self.vector_cache(self.url, root, self.filename) def __getitem__(self, token): - chars = ['#BEGIN#'] + list(token) + ['#END#'] vector = torch.Tensor(1, self.dim).zero_() + if token == "<unk>": + return self.unk_init(vector) + chars = ['#BEGIN#'] + list(token) + ['#END#'] num_vectors = 0 for n in [2, 3, 4]: end = len(chars) - n + 1 @@ -270,6 +272,7 @@ class CharNGram(Vectors): gram_key = '{}gram-{}'.format(n, ''.join(gram)) if gram_key in self.stoi: vector += self.vectors[self.stoi[gram_key]] + num_vectors += 1 if num_vectors > 0: vector /= num_vectors else:
Fix charngram always returning unk vector
pytorch_text
train
py
eb86bc3a9f96e09dde2f103666e6ae427ce7683c
diff --git a/src/main/java/pl/jalokim/propertiestojson/util/PropertiesToJsonParser.java b/src/main/java/pl/jalokim/propertiestojson/util/PropertiesToJsonParser.java index <HASH>..<HASH> 100644 --- a/src/main/java/pl/jalokim/propertiestojson/util/PropertiesToJsonParser.java +++ b/src/main/java/pl/jalokim/propertiestojson/util/PropertiesToJsonParser.java @@ -6,8 +6,10 @@ import pl.jalokim.propertiestojson.helper.PropertyKeysPickup; import pl.jalokim.propertiestojson.object.ObjectJson; +import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Properties; import static pl.jalokim.propertiestojson.Constants.DOT; @@ -16,6 +18,12 @@ public class PropertiesToJsonParser { private static PropertyKeysPickup propertyKeysPickup = new PropertyKeysPickup(); + public static String parseToJson(Properties properties){ + Map<String, String> map = new HashMap<>(); + properties.stringPropertyNames().stream().forEach((name)->map.put(name,properties.getProperty(name))); + return parseToJson(map); + } + public static String parseToJson(Map<String, String> properties) { ObjectJson coreObjectJson = new ObjectJson(); for (String propertiesKey : getAllKeysFromProperties(properties)) {
#4 parse from java properties
mikolajmitura_java-properties-to-json
train
java
89755e710d131473dc680b495ed23ff83f997278
diff --git a/modules/uhttp/router.go b/modules/uhttp/router.go index <HASH>..<HASH> 100644 --- a/modules/uhttp/router.go +++ b/modules/uhttp/router.go @@ -28,10 +28,6 @@ import ( "go.uber.org/fx/service" ) -type route struct { - handler http.Handler -} - // Router is wrapper around gorila mux type Router struct { mux.Router
remove unused route struct (#<I>)
uber-go_fx
train
go
d9d2907c47bd693cc70b9fff1c897de591fb06b7
diff --git a/node-red-contrib-sensit/node-sensit.js b/node-red-contrib-sensit/node-sensit.js index <HASH>..<HASH> 100644 --- a/node-red-contrib-sensit/node-sensit.js +++ b/node-red-contrib-sensit/node-sensit.js @@ -44,6 +44,14 @@ if ( config.enddate == "") { const startdate = new Date(config.startdate); const enddate = new Date(config.enddate); +if (config.enddate.toString().substr(0,7) == "payload") { + config.enddate = helper.getByString(data,config.enddate); +} + +if (config.startdate.toString().substr(0,7) == "payload") { + config.startdate = helper.getByString(data,config.startdate); +} + let req = { url: baseUrl, method: 'GET',
Added usage of variable for dates from payload
NGRP_node-red-contrib-viseo
train
js
3aaad890caf7d43c555828c7ef6a2fccc1a295e1
diff --git a/salt/renderers/py.py b/salt/renderers/py.py index <HASH>..<HASH> 100644 --- a/salt/renderers/py.py +++ b/salt/renderers/py.py @@ -1,7 +1,7 @@ ''' Pure python state renderer -The sls file should contain a function called ``sls`` which returns high state +The sls file should contain a function called ``run`` which returns high state data '''
The function appears to be called run now, and not sls.
saltstack_salt
train
py
fdbb778e20db2c3533c5849089627e8186fff20d
diff --git a/tests/test_treepoem.py b/tests/test_treepoem.py index <HASH>..<HASH> 100644 --- a/tests/test_treepoem.py +++ b/tests/test_treepoem.py @@ -40,3 +40,5 @@ class TreepoemTestCase(unittest.TestCase): barcode_type=barcode_type ), ) + + actual.close()
Close the in-memory image as well.
adamchainz_treepoem
train
py
fb255449b5e1aa8358a5e968eecab57cd4fb74d6
diff --git a/CPTP/Module/Permalink.php b/CPTP/Module/Permalink.php index <HASH>..<HASH> 100644 --- a/CPTP/Module/Permalink.php +++ b/CPTP/Module/Permalink.php @@ -14,8 +14,8 @@ class CPTP_Module_Permalink extends CPTP_Module { public function add_hook() { - add_filter( 'post_type_link', array( $this, 'post_type_link' ), 10, 4 ); - add_filter( 'term_link', array( $this, 'term_link' ), 10, 3 ); + add_filter( 'post_type_link', array( $this, 'post_type_link' ), -10, 4 ); + add_filter( 'term_link', array( $this, 'term_link' ), -10, 3 ); add_filter( 'attachment_link', array( $this, 'attachment_link' ), 20, 2 ); }
Change priority of filters. WPML's filters are at: * post_type_link = 1 * term_link = <I> This patch puts CPTP's filters in a higher priority, so WPML's filters are triggered after these.
torounit_custom-post-type-permalinks
train
php
0dcc1d569c8fc28b88463c15a431d0efdc9f3347
diff --git a/tornado_http_auth.py b/tornado_http_auth.py index <HASH>..<HASH> 100644 --- a/tornado_http_auth.py +++ b/tornado_http_auth.py @@ -207,7 +207,7 @@ class BasicAuthMixin(object): auth_data = auth_header.split(None, 1)[-1] auth_data = base64.b64decode(auth_data).decode('ascii') - username, password = auth_data.split(':') + username, password = auth_data.split(':',maxsplit=1) challenge = check_credentials_func(username) if not challenge:
fix too many values to unpack (expected 2)
gvalkov_tornado-http-auth
train
py
cc5e77b9313b81530eaea27dc28534db5162e5c7
diff --git a/src/App.php b/src/App.php index <HASH>..<HASH> 100644 --- a/src/App.php +++ b/src/App.php @@ -15,7 +15,7 @@ class App // basic error setup error_reporting(E_ALL); ini_set('log_errors', 1); - ini_set('display_errors', 1); + ini_set('display_errors', 0); $this->run($this->loadConfig($DirectoryConfig)); } @@ -25,7 +25,7 @@ class App // basic error setup error_reporting(E_ALL); ini_set('log_errors', 1); - ini_set('display_errors', 1); + ini_set('display_errors', 0); try {
Checkpoint commit as of <I>-<I>-<I>-<I>-<I>-<I>.
MichaelMueller_Quick
train
php
7ab8e765a9e9f6c34a4d0be7e309020a5786157b
diff --git a/src/sap.ui.layout/src/sap/ui/layout/Splitter.js b/src/sap.ui.layout/src/sap/ui/layout/Splitter.js index <HASH>..<HASH> 100644 --- a/src/sap.ui.layout/src/sap/ui/layout/Splitter.js +++ b/src/sap.ui.layout/src/sap/ui/layout/Splitter.js @@ -636,7 +636,7 @@ sap.ui.define([ // If we are not rendered, we do not need to resize since resizing is done after rendering if (this.getDomRef()) { clearTimeout(this._resizeTimeout); - setTimeout(this["_resize"].bind(this), iDelay); + this._resizeTimeout = setTimeout(this._resize.bind(this), iDelay); } };
[FIX] sap.ui.layout.Splitter: The _resize function is called only once There was a performance issue where _resizeTimeout was never set which triggered the _resize function to be called multiple times Change-Id: I<I>f<I>b<I>d9f<I>d<I>c3f<I>cdd<I> BCP: <I>
SAP_openui5
train
js
c1c72f4b3dd3de51760f69645856392ffac8f17a
diff --git a/spyderlib/widgets/editor.py b/spyderlib/widgets/editor.py index <HASH>..<HASH> 100644 --- a/spyderlib/widgets/editor.py +++ b/spyderlib/widgets/editor.py @@ -1940,7 +1940,8 @@ class EditorStack(QWidget): def run_cell(self, focus_to_editor=False): """Run current cell""" text = self.get_current_editor().get_cell_as_executable_code() - if text: + finfo = self.get_current_finfo() + if finfo.editor.is_python() and text: self.emit(SIGNAL('exec_in_extconsole(QString,bool)'), text, focus_to_editor)
Run cells *only* if the currently focused file is a Python one Update Issue <I> Status: Started
spyder-ide_spyder
train
py
4bafb7c9c620f7b5b86185f47dcf5820744e9c51
diff --git a/treeherder/etl/perf_data_adapters.py b/treeherder/etl/perf_data_adapters.py index <HASH>..<HASH> 100644 --- a/treeherder/etl/perf_data_adapters.py +++ b/treeherder/etl/perf_data_adapters.py @@ -355,7 +355,7 @@ class TalosDataAdapter(PerformanceDataAdapter): # summary series summary_properties = { 'suite': _suite, - 'subtest_signatures': sorted(subtest_signatures) + 'subtest_signatures': json.dumps(sorted(subtest_signatures)) } summary_properties.update(reference_data) summary_signature = self.get_series_signature(
Bug <I> - Fix serious bug in previous patch
mozilla_treeherder
train
py
0600dda971334ef871ba2e7d6f1966dcefeceef0
diff --git a/m2s3/mongo.py b/m2s3/mongo.py index <HASH>..<HASH> 100644 --- a/m2s3/mongo.py +++ b/m2s3/mongo.py @@ -124,8 +124,9 @@ def _mongodump(mongodump, host, port, user, passwd, db, out_dir): """ # Log the call - log.msg_debug("mongodump [{mongodump}] - {db}@{host}:{port} > {output}" - .format(mongodump=mongodump, host=host, + log.msg("mongodump [{mongodump}] db={db} " + "mongodb://{user}@{host}:{port} > {output}" + .format(mongodump=mongodump, user=user, host=host, port=port, db=db, output=out_dir)) # Prepare the call
More detail in mongodump execution log message * Log level is set to normal * mongodump execution is shown with more detail and also shows it as an URL
axltxl_m2bk
train
py
9bab909be3a6c9eefb9b04da59af6dbb3e4ab010
diff --git a/src/Gica/Types/Enum.php b/src/Gica/Types/Enum.php index <HASH>..<HASH> 100644 --- a/src/Gica/Types/Enum.php +++ b/src/Gica/Types/Enum.php @@ -115,4 +115,9 @@ abstract class Enum { return is_integer($this->getAll()[0]); } + + public static function null() + { + return new static(null); + } } \ No newline at end of file
edded null()factory method to Enum
xprt64_types
train
php
73c4da0b233a9932842bf1a0113e4f148031e6c7
diff --git a/lib/webdriveragent.js b/lib/webdriveragent.js index <HASH>..<HASH> 100644 --- a/lib/webdriveragent.js +++ b/lib/webdriveragent.js @@ -75,6 +75,7 @@ class WebDriverAgent { this.iproxy = this.createiProxySubProcess(localport, this.url.port); await this.startiproxy(); this.url.hostname = `localhost`; + this.url.port = localport; } this.setupProxy(sessionId);
sending updated port to jwproxy
appium_appium-xcuitest-driver
train
js
68fae78d7e52f85d1e6315253d01b4a9e94e6572
diff --git a/src/SxBootstrap/View/Helper/Bootstrap/AbstractElementHelper.php b/src/SxBootstrap/View/Helper/Bootstrap/AbstractElementHelper.php index <HASH>..<HASH> 100644 --- a/src/SxBootstrap/View/Helper/Bootstrap/AbstractElementHelper.php +++ b/src/SxBootstrap/View/Helper/Bootstrap/AbstractElementHelper.php @@ -75,7 +75,7 @@ abstract class AbstractElementHelper extends AbstractHelper */ public final function __toString() { - return $this->render(); + return (string)$this->render(); } /**
Added string cast to __toString method This was suggested by @ronaldbaltus. The reasoning was that the render() method does not neccesarily return string, but could instead rely on __toString to do the final conversion.
SpoonX_SxBootstrap
train
php
f75e8d77ff7a1cafa24f458f4edd85d9397aa441
diff --git a/src/render/appendChild.js b/src/render/appendChild.js index <HASH>..<HASH> 100644 --- a/src/render/appendChild.js +++ b/src/render/appendChild.js @@ -7,6 +7,7 @@ import renderRect from './renderRect'; import renderText from './renderText'; const forEach = Array.prototype.forEach; +const isFirefox = /firefox/i.test(navigator.userAgent); function getTranslation(viewport) { let x; @@ -52,9 +53,9 @@ function transform(node, viewport) { // Let SVG natively transform the element node.setAttribute('transform', `scale(${viewport.scale}) rotate(${viewport.rotation}) translate(${trans.x}, ${trans.y})`); - + // Manually adjust x/y for nested SVG nodes - if (node.nodeName.toLowerCase() === 'svg') { + if (!isFirefox && node.nodeName.toLowerCase() === 'svg') { node.setAttribute('x', parseInt(node.getAttribute('x'), 10) * viewport.scale); node.setAttribute('y', parseInt(node.getAttribute('y'), 10) * viewport.scale);
Don't adjust nested SVG in Firefox
instructure_pdf-annotate.js
train
js
815d619013e3f8a997ec0b1aa7261f3f669546f0
diff --git a/code/solr/services/SolrService.php b/code/solr/services/SolrService.php index <HASH>..<HASH> 100644 --- a/code/solr/services/SolrService.php +++ b/code/solr/services/SolrService.php @@ -4,6 +4,7 @@ namespace SilverStripe\FullTextSearch\Solr\Services; use SilverStripe\Core\Config\Config; use SilverStripe\FullTextSearch\Solr\Solr; +use Silverstripe\Core\ClassInfo; Solr::include_client_api(); /** @@ -21,7 +22,8 @@ class SolrService extends SolrService_Core protected function coreCommand($command, $core, $params = array()) { $command = strtoupper($command); - + //get the non-namespaced name of the Solr core, since backslashes not valid characters + $core = ClassInfo::shortName($core); $params = array_merge($params, array('action' => $command, 'wt' => 'json')); $params[$command == 'CREATE' ? 'name' : 'core'] = $core;
SS <I> - Strip namespaces from core name since backslashes are not acceptable Solr core names
silverstripe_silverstripe-fulltextsearch
train
php
ff327f20e47ba4f89e99602bb692961636954db9
diff --git a/lib/key_tree/forest.rb b/lib/key_tree/forest.rb index <HASH>..<HASH> 100644 --- a/lib/key_tree/forest.rb +++ b/lib/key_tree/forest.rb @@ -39,11 +39,11 @@ module KeyTree end def key?(key) - any? { |tree_or_forest| tree_or_forest.key?(key) } + trees.any? { |tree| tree.key?(key) } end def prefix?(key) - any? { |tree_or_forest| tree_or_forest.prefix?(key) } + trees.any? { |tree_or_forest| tree_or_forest.prefix?(key) } end # Flattening a forest produces a tree with the equivalent view of key paths
Use tree enumarator for Forest#key? and #prefix? Update the `#key?` and `#prefix?` methods to use the tree enumerator.
notCalle_ruby-keytree
train
rb
16e0a5fbce7b5dbbe18ab5fee10f9361621164b5
diff --git a/txaws/testing/route53.py b/txaws/testing/route53.py index <HASH>..<HASH> 100644 --- a/txaws/testing/route53.py +++ b/txaws/testing/route53.py @@ -36,10 +36,10 @@ class _MemoryRoute53Client(MemoryClient): creds = attr.ib() endpoint = attr.ib() - def create_hosted_zone(self, reference, name): + def create_hosted_zone(self, caller_reference, name): self._state.zones = self._state.zones.append(HostedZone( name=name, - reference=reference, + reference=caller_reference, identifier=self._state.next_id(), # Hosted zones start with SOA and NS rrsets. rrset_count=2,
Match argument names with the real implementation.
twisted_txaws
train
py
4ba1c8be68c40b1a828bd2b2fff58b5678046a65
diff --git a/core/src/main/java/com/orientechnologies/orient/core/config/OGlobalConfiguration.java b/core/src/main/java/com/orientechnologies/orient/core/config/OGlobalConfiguration.java index <HASH>..<HASH> 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/config/OGlobalConfiguration.java +++ b/core/src/main/java/com/orientechnologies/orient/core/config/OGlobalConfiguration.java @@ -86,7 +86,7 @@ public enum OGlobalConfiguration { /** * Limit of amount of files which may be open simultaneously */ - OPEN_FILES_LIMIT("storage.openFiles.limit", "Limit of amount of files which may be open simultaneously", Integer.class, 1024), + OPEN_FILES_LIMIT("storage.openFiles.limit", "Limit of amount of files which may be open simultaneously", Integer.class, 512), /** * Amount of cached locks is used for component lock in atomic operation to avoid constant creation of new lock instances, default
Open files limit was changed to <I>
orientechnologies_orientdb
train
java
2aff0a310289b5d65516928dc3f0a32a1ea2ed49
diff --git a/html5lib/tests/test_encoding.py b/html5lib/tests/test_encoding.py index <HASH>..<HASH> 100644 --- a/html5lib/tests/test_encoding.py +++ b/html5lib/tests/test_encoding.py @@ -54,7 +54,7 @@ def test_encoding(): try: import chardet def test_chardet(): - data = open(os.path.join(test_dir, "encoding" , "chardet", "test_big5.txt")).read() + data = open(os.path.join(test_dir, "encoding" , "chardet", "test_big5.txt"), "rb").read() encoding = inputstream.HTMLInputStream(data).charEncoding assert encoding[0].lower() == "big5" except ImportError:
Fix chardet test under Python 3 to read file as bytes
html5lib_html5lib-python
train
py
dd5e3d391d0f80342b001cb80664cc8304b80c5a
diff --git a/lib/agent/providers/webcam/windows/index.js b/lib/agent/providers/webcam/windows/index.js index <HASH>..<HASH> 100644 --- a/lib/agent/providers/webcam/windows/index.js +++ b/lib/agent/providers/webcam/windows/index.js @@ -1,12 +1,13 @@ var exec = require('child_process').exec, - path = require('path'); + join = require('path').join; exports.get_picture = function(file, callback){ - exec('"' + path.join(__dirname, '/prey-webcam.exe'), function(err) { - if (err) - callback(err) - else - callback(null, 'image/jpeg'); + + var cmd = join(__dirname, '/prey-webcam.exe'); + cmd += ' -invalid youcam,cyberlink,google -frame 10 -outfile ' + file; + + exec(cmd, function(err) { + callback(err, 'image/jpeg'); // if err exists, content_type will not matter }) }
Added missing options to prey-webcam call in Windows.
prey_prey-node-client
train
js
38273047f02e0f015ffa218f18f86f9b162bc857
diff --git a/public/js/widgets/editors/slideshow.js b/public/js/widgets/editors/slideshow.js index <HASH>..<HASH> 100644 --- a/public/js/widgets/editors/slideshow.js +++ b/public/js/widgets/editors/slideshow.js @@ -193,7 +193,7 @@ function AposSlideshowWidgetEditor(options) return choice.name === self.data.orientation; }); - if (info && info.aspectRatio) { + if (info && info.hasOwnProperty('aspectRatio')) { aspectRatio = info.aspectRatio; } self.autocropIfNeeded();
Updating slideshow widget editor to allow orientation choices with no aspect ratio.
apostrophecms_apostrophe
train
js
186cc4fa14354f2527b3789f295aa1f751281190
diff --git a/test/test_stormpath.js b/test/test_stormpath.js index <HASH>..<HASH> 100644 --- a/test/test_stormpath.js +++ b/test/test_stormpath.js @@ -35,4 +35,13 @@ describe('.init', function() { }); }); }); + + it('should throw an error when an invalid configuration is supplied', function() { + var stormpath = require('../index'); + var app = express(); + + assert.throws(function() { + app.use(stormpath.init(app, { application: {}, client: {} })); + }, Error); + }); });
Adding a test to ensure invalid configs don't work!@
stormpath_express-stormpath
train
js
04e2372ab3e2c80d65b511b1b6c13d241edfc526
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb index <HASH>..<HASH> 100644 --- a/lib/chef/resource.rb +++ b/lib/chef/resource.rb @@ -459,6 +459,7 @@ class Chef # property :umask, String, desired_state: false, + introduced: "16.2", description: "Set a umask to be used for the duration of converging the resource. Defaults to `nil`, which means to use the system umask." # The time it took (in seconds) to run the most recently-run action. Not
Add introduced to umask.
chef_chef
train
rb
33fe2c0fffd20968aa27968ea1594d55a8ceaa16
diff --git a/src/PeskyORMLaravel/Db/Traits/InjectsDbObjects.php b/src/PeskyORMLaravel/Db/Traits/InjectsDbObjects.php index <HASH>..<HASH> 100644 --- a/src/PeskyORMLaravel/Db/Traits/InjectsDbObjects.php +++ b/src/PeskyORMLaravel/Db/Traits/InjectsDbObjects.php @@ -62,7 +62,7 @@ trait InjectsDbObjects { * Abort with HTTP code 404 */ protected function sendRecordNotFoundResponse() { - abort(404, 'Record not found in DB'); + abort(404, 'Record not found in DB.'); } /**
InjectsDbObjects - added '.' to error text
swayok_peskyorm-laravel
train
php
c1bf6f63b247437ae4243d98040d4a0f78ff4b70
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -23,15 +23,17 @@ module.exports = function (grunt) { }, karma: { options: { - configFile: 'test/karma.conf.js' + configFile: 'test/karma.conf.js', + browsers: ['Firefox', 'PhantomJS'] }, unit: { - singleRun: true, - browsers: ['Firefox', 'PhantomJS'] + singleRun: true + }, + watch: { + autoWatch: true }, server: { - background: true, - browsers: ['Firefox', 'PhantomJS'] + background: true } }, jshint: { @@ -48,6 +50,7 @@ module.exports = function (grunt) { // Register tasks grunt.registerTask('default', ['jshint', 'karma:unit']); + grunt.registerTask('watch', ['jshint', 'karma:watch']); grunt.initConfig(initConfig); };
Add a watch grunt task to use karma's autoWatch
angular-ui_ui-select2
train
js
e2772a8942a21354584f9ff6abbe1539a8a3dd74
diff --git a/pages/app/models/refinery/page_part.rb b/pages/app/models/refinery/page_part.rb index <HASH>..<HASH> 100644 --- a/pages/app/models/refinery/page_part.rb +++ b/pages/app/models/refinery/page_part.rb @@ -3,7 +3,7 @@ module Refinery attr_accessible :title, :content, :position, :body, :created_at, :updated_at, :refinery_page_id - belongs_to :page, :class_name => '::Refinery::Page', :foreign_key => :refinery_page_id + belongs_to :page, :foreign_key => :refinery_page_id validates :title, :presence => true alias_attribute :content, :body
No need to specify class_name for page association.
refinery_refinerycms
train
rb
98fc68b8958dc15756519e6028cbc1185db23a5d
diff --git a/lib/artifactory/resources/artifact.rb b/lib/artifactory/resources/artifact.rb index <HASH>..<HASH> 100644 --- a/lib/artifactory/resources/artifact.rb +++ b/lib/artifactory/resources/artifact.rb @@ -149,6 +149,36 @@ module Artifactory end end + # + # @example Get all versions of a given artifact + # Artifact.versions(name: 'artifact') + # @example Get all versions of a given artifact in a specific repo + # Artifact.versions(name: 'artifact', repos: 'libs-release-local') + # + # @param [Hash] options + # the list of options to search with + # + # @option options [String] :group + # the + # @option options [String] :sha1 + # the SHA1 checksum of the artifact to search for + # @option options [String, Array<String>] :repos + # the list of repos to search + # + def versions(options = {}) + options = Util.rename_keys(options, + :group => :g, + :name => :a, + :version => :v, + ) + params = Util.slice(options, :g, :a, :v, :repos) + format_repos!(params) + + _get('/api/search/versions', params).json['results'] + rescue Error::NotFound + [] + end + def from_url(url) from_hash(_get(url).json) end
Add the ability to search for all versions of an artifact
chef_artifactory-client
train
rb
79313ec7a9a762e89dc4b87bc8b25ce950085f2c
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -1038,14 +1038,16 @@ func resolveTCPAddrs(addr string, dualStack bool) ([]net.TCPAddr, error) { } n := len(ips) - addrs := make([]net.TCPAddr, n) + addrs := make([]net.TCPAddr, 0, n) for i := 0; i < n; i++ { ip := ips[i] if !dualStack && ip.To4() == nil { continue } - addrs[i].IP = ip - addrs[i].Port = port + addrs = append(addrs, net.TCPAddr{ + IP: ip, + Port: port, + }) } return addrs, nil }
Fixed a bug in ipv4 addresses resolution if the resolved ip addresses contain non-zero number of ipv6 addresses
valyala_fasthttp
train
go
a2640775dc50ce11ad283934e04cd661fb381d8b
diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index <HASH>..<HASH> 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -1122,7 +1122,7 @@ class Client: def forward_messages(self, chat_id: int or str, from_chat_id: int or str, - message_ids: list, + message_ids: list or int, disable_notification: bool = None): """Use this method to forward messages of any kind. @@ -1139,8 +1139,8 @@ class Client: For a contact that exists in your Telegram address book you can use his phone number (str). For a private channel/supergroup you can use its *t.me/joinchat/* link. - message_ids (``list``): - A list of Message identifiers in the chat specified in *from_chat_id*. + message_ids (``list`` | ``int``): + A list of Message identifiers in the chat specified in *from_chat_id* or a single message id. disable_notification (``bool``, optional): Sends the message silently. @@ -1152,6 +1152,12 @@ class Client: Raises: :class:`Error <pyrogram.Error>` """ + message_ids = ( + message_ids + if isinstance(message_ids, list) + else [message_ids] + ) + return self.send( functions.messages.ForwardMessages( to_peer=self.resolve_peer(chat_id),
Allow passing msg ids as int in forward_messages()
pyrogram_pyrogram
train
py
91804bd08258bfcad5b7813e624796dadb1bf12b
diff --git a/tilequeue/command.py b/tilequeue/command.py index <HASH>..<HASH> 100755 --- a/tilequeue/command.py +++ b/tilequeue/command.py @@ -932,6 +932,8 @@ def coord_pyramids(coords, zoom_start, zoom_stop): exclusive. """ for coord in coords: + if zoom_start <= coord.zoom: + yield coord for child_coord in coord_children_range(coord, zoom_stop): if zoom_start <= child_coord.zoom < zoom_stop: yield child_coord
Yield coord itself if applicable
tilezen_tilequeue
train
py
9448c0b987ccafb8236468e9f062aef873567685
diff --git a/src/hooks/use-mounted.js b/src/hooks/use-mounted.js index <HASH>..<HASH> 100644 --- a/src/hooks/use-mounted.js +++ b/src/hooks/use-mounted.js @@ -3,7 +3,7 @@ import { useRef, } from 'react'; -export default function useDidMount() { +export default function useMounted() { const mounted = useRef(false); useEffect(() => {
refactor(useDidMount): rename to `useMounted` for consistency with file name
juanca_react-aria-components
train
js
f5df4e5adcfa2d0bd6561b99661d8222335542d4
diff --git a/javase/src/com/google/zxing/client/j2se/BufferedImageLuminanceSource.java b/javase/src/com/google/zxing/client/j2se/BufferedImageLuminanceSource.java index <HASH>..<HASH> 100644 --- a/javase/src/com/google/zxing/client/j2se/BufferedImageLuminanceSource.java +++ b/javase/src/com/google/zxing/client/j2se/BufferedImageLuminanceSource.java @@ -47,6 +47,18 @@ public final class BufferedImageLuminanceSource extends LuminanceSource { if (left + width > sourceWidth || top + height > sourceHeight) { throw new IllegalArgumentException("Crop rectangle does not fit within image data."); } + + // The color of fully-transparent pixels is irrelevant. They are often, technically, fully-transparent + // black (0 alpha, and then 0 RGB). They are often used, of course as the "white" area in a + // barcode image. Force any such pixel to be white: + for (int i = top; i < top + height; i++) { + for (int j = left; j < left + width; j++) { + if ((image.getRGB(i, j) & 0xFF000000) == 0) { + image.setRGB(i, j, 0xFFFFFFFF); // = white + } + } + } + // Create a grayscale copy, no need to calculate the luminance manually this.image = new BufferedImage(sourceWidth, sourceHeight, BufferedImage.TYPE_BYTE_GRAY); this.image.getGraphics().drawImage(image, 0, 0, null);
Issue <I> treat transparent areas as white git-svn-id: <URL>
zxing_zxing
train
java
14f910f88da5476ed32892f889194daa58507707
diff --git a/addon/components/sl-grid-header-settings.js b/addon/components/sl-grid-header-settings.js index <HASH>..<HASH> 100755 --- a/addon/components/sl-grid-header-settings.js +++ b/addon/components/sl-grid-header-settings.js @@ -63,15 +63,32 @@ export default Ember.Component.extend({ * @param {event} event - The click event * @returns {false|void} */ - click: function( event ) { + click: function( event ){ if ( Ember.$( event.target ).closest( '.stay-open' ).length ) { return false; } }, + /** + * close the menu on mouseLeave if its open + * @param {Event} event + * @return {void} + */ + mouseLeave: function( event ){ + var toggleEl = Ember.$(event.target).closest( '.dropdown-toggle'); + + if( ! toggleEl.length ){ + toggleEl = Ember.$(event.target).closest( '.dropdown-menu').siblings( '.dropdown-toggle'); + } + + if ( toggleEl.length && $(toggleEl).parents('.sl-grid-header-settings').hasClass('open') ){ + toggleEl.dropdown( 'toggle' ); + } + }, + // ------------------------------------------------------------------------- // Properties - + /** * alias to the translation keys on the settings object * @type {alias}
close the menu on mouseLeave
softlayer_sl-ember-components
train
js
d8c5d3c9891120f830fa6466a0c9bbe5e2818967
diff --git a/flask_appbuilder/security/sqla/manager.py b/flask_appbuilder/security/sqla/manager.py index <HASH>..<HASH> 100644 --- a/flask_appbuilder/security/sqla/manager.py +++ b/flask_appbuilder/security/sqla/manager.py @@ -311,8 +311,8 @@ class SecurityManager(BaseSecurityManager): ) .exists() ) - # Special case for MSSQL (works on PG and MySQL > 8) - if self.appbuilder.get_session.bind.dialect.name == "mssql": + # Special case for MSSQL/Oracle (works on PG and MySQL > 8) + if self.appbuilder.get_session.bind.dialect.name in ("mssql", "oracle"): return self.appbuilder.get_session.query(literal(True)).filter(q).scalar() return self.appbuilder.get_session.query(q).scalar()
Fixes authentication error when using oracle (#<I>) This commit applies for oralce dialect the same query strategy already implemeted for MSSQL in security manager when checking for authentication/permissions, since a query like "SELECT EXISTS(1) FROM DUAL" in oracle databases would raise an ORA-<I>: missing expression error (observed from version <I>c on)
dpgaspar_Flask-AppBuilder
train
py
f2384343317df25877c8774d6a8c4e3b74908b3d
diff --git a/src/i18n.js b/src/i18n.js index <HASH>..<HASH> 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -9,7 +9,7 @@ import { load, preload } from './utils/cdn_utils'; import { format } from 'util'; export function str(m, keyPath, ...args) { - return format(get(m, ["strings"].concat(keyPath)), ...args); + return format(get(m, ["strings"].concat(keyPath), ""), ...args); } export function html(m, keyPath, ...args) {
Fix i<I>n.str, return "" when key is not found It was returing "undefined".
auth0_lock
train
js
129857ff8642d23ba67be25535820cb9cc29171f
diff --git a/tdiary/io/heroku.rb b/tdiary/io/heroku.rb index <HASH>..<HASH> 100644 --- a/tdiary/io/heroku.rb +++ b/tdiary/io/heroku.rb @@ -130,14 +130,14 @@ module TDiary end end - def clear_cache(target) - if target + def clear_cache(target = :all) + if target == :all + memcache.flush + else ym = target.to_s.scan(/\d{4}\d{2}/)[0] ['latest.rb', 'i.latest.rb', "#{ym}.rb", "i.#{ym}.rb"].each do |key| memcache.delete(key) end - else - memcache.flush end end
bugfix not worked cache clear when diaries updated.
tdiary_tdiary-core
train
rb
c4f64605765c41d5389f21385b537d869b7aa297
diff --git a/src/Routing/Router.php b/src/Routing/Router.php index <HASH>..<HASH> 100644 --- a/src/Routing/Router.php +++ b/src/Routing/Router.php @@ -341,19 +341,17 @@ class Router extends IlluminateRouter */ protected function findRoute($request) { + $collection = $this->getRoutes(); + if ($this->isApiRequest($request)) { - $routes = $this->api->getByVersion($this->currentVersion); - } else { - $routes = $this->routes; + $collection = $this->api->getByVersion($this->currentVersion); } - if (! $routes) { - throw new BadRequestHttpException("Requested API version is invalid."); + if (! $collection) { + throw new BadRequestHttpException('The requested API version is invalid.'); } - $route = $routes->match($request); - - return $this->current = $this->substituteBindings($route); + return $this->current = $this->substituteBindings($collection->match($request)); } /**
Just a bit of a tidy up.
laravie_api
train
php
b6c3ca9cd80fd00c80711f0330559abf663824c9
diff --git a/test/test_common.py b/test/test_common.py index <HASH>..<HASH> 100644 --- a/test/test_common.py +++ b/test/test_common.py @@ -91,9 +91,7 @@ class TestCommon(unittest.TestCase): currencies_from_pairs.add(c1) currencies_from_pairs.add(c2) - assert currencies_from_pairs == set(all_currencies) - assert set(all_pairs) == set(max_digits.keys()) - assert set(all_pairs) == set(min_orders.keys()) + self.assertEqual(currencies_from_pairs, set(all_currencies)) if __name__ == '__main__': unittest.main()
Removed duplicated tests, use assertEqual as it displays differences.
CodeReclaimers_btce-api
train
py
34ffb1f118de097e0ac798b93f2bef2dac9d670f
diff --git a/core/parser.js b/core/parser.js index <HASH>..<HASH> 100644 --- a/core/parser.js +++ b/core/parser.js @@ -342,7 +342,8 @@ module.exports = function (opts) { var openTags = []; var tag = '', lineLastLiteral = '', lastLiteral = ''; var block = newBlock(type.html, blocks); - let stop = false, inComments = false, inJs = false; + let stop = false, inComments = false; + let inJs = "script".equal(outerWaitTag, true); var lastCh = ''; for (var ch = this.pickChar(); ch; ch = this.pickChar()) { diff --git a/test/cases/code.js b/test/cases/code.js index <HASH>..<HASH> 100644 --- a/test/cases/code.js +++ b/test/cases/code.js @@ -536,6 +536,22 @@ els a++; } whil`, error: "'while' expected at line 8 pos 3." + }, + { + name: "Code 61", + template: ` +<div>JS</div> +@if (2 > 1) { + <script type="text/javascript"> + var longText = "<div>"; + </script> +}`, + expected: ` +<div>JS</div> + <script type="text/javascript"> + var longText = "<div>"; + </script> +` } ]; module.exports = cases;
* ! Fixed parsing qouted strings in JS-blocks wrapped in code-block.
DevelAx_RazorExpress
train
js,js
a5db8d90799d3fae369ba6b5cefadefb2361a535
diff --git a/spyder/preferences/languageserver.py b/spyder/preferences/languageserver.py index <HASH>..<HASH> 100644 --- a/spyder/preferences/languageserver.py +++ b/spyder/preferences/languageserver.py @@ -862,7 +862,7 @@ class LSPManagerConfigPage(GeneralConfigPage): word_wrap=False) advanced_port = self.create_spinbox( ":", "", 'advanced/port', min_=1, max_=65535, step=1) - advanced_external = self.create_checkbox( + external_server = self.create_checkbox( _("This is an external server"), 'advanced/external') @@ -882,7 +882,7 @@ class LSPManagerConfigPage(GeneralConfigPage): advanced_layout = QVBoxLayout() advanced_layout.addWidget(advanced_label) advanced_layout.addLayout(advanced_g_layout) - advanced_layout.addWidget(advanced_external) + advanced_layout.addWidget(external_server) advanced_widget.setLayout(advanced_layout) # --- Other servers tab ---
Preferences: Change variable name for advanced/external option
spyder-ide_spyder
train
py
1a3a792a7358273630cbf67264822eaf82f746a1
diff --git a/Kwf/Media/Output.php b/Kwf/Media/Output.php index <HASH>..<HASH> 100644 --- a/Kwf/Media/Output.php +++ b/Kwf/Media/Output.php @@ -217,8 +217,7 @@ class Kwf_Media_Output } // returns the partial content from a file - // parts of the function are taken https://github.com/pomle/php-serveFilePartial/blob/master/ServeFilePartial.inc.php - public static function getPartialFileContent($file, $range) + protected function getPartialFileContent($file, $range) { $length = $range[1]-$range[0]+1;
remove the comment and make the function private
koala-framework_koala-framework
train
php