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
d913b156f8d4aac0e2837b93443d0ee2004285a8
diff --git a/www/plugins.FileOpener2.js b/www/plugins.FileOpener2.js index <HASH>..<HASH> 100644 --- a/www/plugins.FileOpener2.js +++ b/www/plugins.FileOpener2.js @@ -27,9 +27,9 @@ var exec = require('cordova/exec'); function FileOpener2() {} FileOpener2.prototype.open = function (fileName, contentType, options) { - contentType = contentType || ''; + contentType = contentType || ''; options = options || {}; - exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType, false, options.position]); + exec(options.success || null, options.error || null, 'FileOpener2', 'open', [fileName, contentType, false, options.position]); }; FileOpener2.prototype.showOpenWithDialog = function (fileName, contentType, callbackContext) {
fix: fixed reference bug in open method
pwlin_cordova-plugin-file-opener2
train
js
41c38c52ed6c9edda5014f750b86781421e98e7e
diff --git a/tests/functional/test_scoping/test_metamodel_provider3.py b/tests/functional/test_scoping/test_metamodel_provider3.py index <HASH>..<HASH> 100644 --- a/tests/functional/test_scoping/test_metamodel_provider3.py +++ b/tests/functional/test_scoping/test_metamodel_provider3.py @@ -73,6 +73,15 @@ def test_metamodel_provider_advanced_test3_global(): for a in lst: assert a.ref + # check meta classes + from textx.scoping.tools import textx_isinstance + for a in lst: + assert textx_isinstance(a, a_mm["Obj"]) + assert textx_isinstance(a, b_mm["Obj"]) + assert textx_isinstance(a, c_mm["Obj"]) + #fails for some: + #assert isinstance(a, a_mm["Obj"]) + ################################# # END #################################
added instance_of tests (problem indentified; see commented code)
textX_textX
train
py
c71e715ed538e5efd6c97381c83d2824e1042bd6
diff --git a/app/xmpp/index.js b/app/xmpp/index.js index <HASH>..<HASH> 100644 --- a/app/xmpp/index.js +++ b/app/xmpp/index.js @@ -61,11 +61,40 @@ function xmppStart(core) { return processor.run(); }); - if (!handled && settings.xmpp.debug.unhandled) { + if (handled) { + return; + } + + if (settings.xmpp.debug.unhandled) { // Print unhandled request console.log(' '); console.log(stanza.root().toString().red); } + + if (stanza.name !== 'iq') { + return; + } + + var msg = new Stanza.Iq({ + type: 'error', + id: stanza.attrs.id, + to: stanza.attrs.from, + from: stanza.attrs.to + }); + + msg.c('not-implemented', { + code: 501, + type: 'CANCEL' + }).c('feature-not-implemented', { + xmlns: 'urn:ietf:params:xml:n:xmpp-stanzas' + }); + + + if (settings.xmpp.debug.unhandled) { + console.log(msg.root().toString().green); + } + + client.send(msg); }); // On Disconnect event. When a client disconnects
Reply to unimplemented XMPP query requests
sdelements_lets-chat
train
js
03ad9fb4f9ac280f092a66730e221214e3b6ee4c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ test_requirements=[ setup( name='couchdb-schematics', license='BSD', - version='0.2.1-alpha', + version='0.3.0', description='', author=u'', author_email='', @@ -45,10 +45,9 @@ setup( tests_require=test_requirements, install_requires=[ 'setuptools>=0.8', - 'schematics>=0.10-1', - 'CouchDB' + 'CouchDB', + 'schematics', ] + test_requirements, dependency_links = [ - 'https://github.com/ryanolson/schematics/tarball/master#egg=schematics-0.10-1' ] )
updated setup to use the main schematics distribution
ryanolson_couchdb-schematics
train
py
04e0ca08a6b4e3b302b795b57106a4ec7bace03c
diff --git a/version.go b/version.go index <HASH>..<HASH> 100644 --- a/version.go +++ b/version.go @@ -1,3 +1,3 @@ package nsq -const VERSION = "0.1.29" +const VERSION = "0.2.0"
update docs; bump to <I>
nsqio_go-nsq
train
go
0efc9d1cd211c4a515f07aba233921854babcde4
diff --git a/dependency-check-maven/src/main/java/org/owasp/dependencycheck/maven/slf4j/MavenLoggerAdapter.java b/dependency-check-maven/src/main/java/org/owasp/dependencycheck/maven/slf4j/MavenLoggerAdapter.java index <HASH>..<HASH> 100644 --- a/dependency-check-maven/src/main/java/org/owasp/dependencycheck/maven/slf4j/MavenLoggerAdapter.java +++ b/dependency-check-maven/src/main/java/org/owasp/dependencycheck/maven/slf4j/MavenLoggerAdapter.java @@ -29,6 +29,11 @@ import org.slf4j.helpers.MessageFormatter; public class MavenLoggerAdapter extends MarkerIgnoringBase { /** + * The serial version UID for serialization. + */ + private static final long serialVersionUID = 1L; + + /** * A reference to the Maven log. */ private final Log log;
Added missing serialVersionUID.
jeremylong_DependencyCheck
train
java
d679c1862ae0463d2be2c8e2161e20edc32e3de6
diff --git a/pysolr.py b/pysolr.py index <HASH>..<HASH> 100644 --- a/pysolr.py +++ b/pysolr.py @@ -864,11 +864,12 @@ class Solr(object): terms = result.get("terms", {}) res = {} - # in Solr 1.x the value of terms is a flat list: - # ["field_name", ["dance",23,"dancers",10,"dancing",8,"dancer",6]] + # in Solr 1.x the value of terms is list of elements with the field name + # and a flat list of value, count pairs: + # ["field_name", ["dance", 23, "dancers", 10, …]] # - # in Solr 3.x the value of terms is a dict: - # {"field_name": ["dance",23,"dancers",10,"dancing",8,"dancer",6]} + # in Solr 3+ the value of terms is a dict of field name and a flat list of + # value, count pairs: {"field_name": ["dance", 23, "dancers", 10, …]} if isinstance(terms, (list, tuple)): terms = dict(zip(terms[0::2], terms[1::2]))
Cleanup comment This suppresses a commented-code warning and also makes it easier to understand
django-haystack_pysolr
train
py
2952475d234b0b935fc1021804178246f518e271
diff --git a/pypot/_version.py b/pypot/_version.py index <HASH>..<HASH> 100644 --- a/pypot/_version.py +++ b/pypot/_version.py @@ -1 +1 @@ -__version__ = '2.1.0rc9' +__version__ = '2.1.0rc10'
Prepare for version <I>rc<I>. (hopefully the last one).
poppy-project_pypot
train
py
77915643d3eb454b0f8d23e6f1333b156a003d6c
diff --git a/authority/tests.py b/authority/tests.py index <HASH>..<HASH> 100644 --- a/authority/tests.py +++ b/authority/tests.py @@ -189,7 +189,7 @@ class PerformanceTest(TestCase): self.check.has_user_perms('foo', self.user, True, True) -class ExpectedBehaviourTestCase(TestCase): +class GroupPermissionCacheTestCase(TestCase): """ Tests that peg expected behaviour """
refs #3: changed the name of the test case
jazzband_django-authority
train
py
744ebddf4233089f4b4a81ca3047c744f58f0990
diff --git a/tests/Messages/RpcTest.php b/tests/Messages/RpcTest.php index <HASH>..<HASH> 100644 --- a/tests/Messages/RpcTest.php +++ b/tests/Messages/RpcTest.php @@ -120,7 +120,7 @@ class RpcTest extends \PHPUnit_Framework_TestCase Phake::when($messenger)->createLine($this->isInstanceOf(RpcNotify::class))->thenReturn(''); $callbackFired = false; Phake::when($messenger)->callRpc('foo', $payload, $this->isInstanceOf(Deferred::class))->thenGetReturnByLambda(function ($target, $payload, $deferred) use (&$callbackFired) { - $deferred->notify([ + $deferred->progress([ 'a', 'b', 'c',
Update RpcTest.php
WyriHaximus_reactphp-child-process-messenger
train
php
3d3897c6079fbef16982ad9ffb282c6c78ec6f69
diff --git a/lib/active_interaction/filter.rb b/lib/active_interaction/filter.rb index <HASH>..<HASH> 100644 --- a/lib/active_interaction/filter.rb +++ b/lib/active_interaction/filter.rb @@ -14,7 +14,7 @@ module ActiveInteraction # Describes an input filter for an interaction. class Filter # @return [Hash{Symbol => Class}] - CLASSES = {} + CLASSES = {} # rubocop:disable Style/MutableConstant private_constant :CLASSES # @return [Hash{Symbol => Filter}]
Use pragma to disable mutable constant
AaronLasseigne_active_interaction
train
rb
0d25a2e7a4f7b39d64751975d5c71141275d8ff0
diff --git a/src/Behat/Mink/Driver/SeleniumDriver.php b/src/Behat/Mink/Driver/SeleniumDriver.php index <HASH>..<HASH> 100644 --- a/src/Behat/Mink/Driver/SeleniumDriver.php +++ b/src/Behat/Mink/Driver/SeleniumDriver.php @@ -424,7 +424,8 @@ if (node.tagName == 'SELECT') { var i, l = nodes.length; for (i = 0; i < l; i++) { if (nodes[i].getAttribute('value') == "$valueEscaped") { - node.checked = true; + nodes[i].checked = true; + break; } } }
[Selenium Driver ] Check the radio/checkbox with the matching value when multiple nodes with the same name found
minkphp_Mink
train
php
d82702064f4f9438f959de72da183e7c6133ed3b
diff --git a/plugins/commands/serve/util/service_info.rb b/plugins/commands/serve/util/service_info.rb index <HASH>..<HASH> 100644 --- a/plugins/commands/serve/util/service_info.rb +++ b/plugins/commands/serve/util/service_info.rb @@ -14,6 +14,7 @@ module VagrantPlugins broker: broker ) if context.metadata["plugin_manager"] && info.broker + activated = true Service::ServiceInfo.manager_tracker.activate do client = Client::PluginManager.load( context.metadata["plugin_manager"], @@ -26,8 +27,10 @@ module VagrantPlugins return if !block_given? yield info ensure - Service::ServiceInfo.manager_tracker.deactivate do - Vagrant.plugin("2").disable_remote_manager + if activated + Service::ServiceInfo.manager_tracker.deactivate do + Vagrant.plugin("2").disable_remote_manager + end end Thread.current.thread_variable_set(:service_info, nil) end
Only deactivate remote plugin manager if activated
hashicorp_vagrant
train
rb
37d4c6f35ec6715d8cf80896305034ee51c82492
diff --git a/client/mic.py b/client/mic.py index <HASH>..<HASH> 100644 --- a/client/mic.py +++ b/client/mic.py @@ -2,7 +2,7 @@ """ The Mic class handles all interactions with the microphone and speaker. """ - +import logging import tempfile import wave import audioop @@ -26,10 +26,15 @@ class Mic: mode acive_stt_engine -- performs STT while Jasper is in active listen mode """ + self._logger = logging.getLogger(__name__) self.speaker = speaker self.passive_stt_engine = passive_stt_engine self.active_stt_engine = active_stt_engine + self._logger.info("Initializing PyAudio. ALSA/Jack error messages " + + "that pop up during this process are normal an " + + "can usually be safely ignored.") self._audio = pyaudio.PyAudio() + self._logger.info("Initialization of PyAudio completed.") def __del__(self): self._audio.terminate()
Added log message for PyAudio initialization
benhoff_vexbot
train
py
f0e6a2ea07ce6466967ffbdb5f1cf99bc1428729
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,6 @@ setup_params = dict( long_description=long_description, url="https://github.com/jaraco/" + name, packages=setuptools.find_packages(), - namespace_packages=['rst'], include_package_data=True, namespace_packages=name.split('.')[:-1], install_requires=[
Remove now superfluous namespace_packages declaration.
jaraco_rst.linker
train
py
1e1658c6e1aea3ae75470ac8529c83bdf65f1766
diff --git a/fundamentals/mysql/directory_script_runner.py b/fundamentals/mysql/directory_script_runner.py index <HASH>..<HASH> 100644 --- a/fundamentals/mysql/directory_script_runner.py +++ b/fundamentals/mysql/directory_script_runner.py @@ -119,11 +119,12 @@ def directory_script_runner( scriptList = {} for d in os.listdir(pathToScriptDirectory): filePath = os.path.join(pathToScriptDirectory, d) + filename = os.path.basename(filePath) extension = filePath.split(".")[-1] if os.path.isfile(filePath) and extension == "sql": modified = datetime.datetime.strptime(time.ctime( os.path.getmtime(filePath)), "%a %b %d %H:%M:%S %Y") - scriptList[modified] = filePath + scriptList[modified + filename] = filePath # ORDER THE DICTIONARY BY MODIFIED TIME - OLDEST FIRST scriptList = collections.OrderedDict(sorted(scriptList.items()))
updated file sorting for mysqlSucker
thespacedoctor_fundamentals
train
py
5d32824d7701ea2634e4bfbb263062e4d08488e0
diff --git a/modules_v2/tree/module.php b/modules_v2/tree/module.php index <HASH>..<HASH> 100644 --- a/modules_v2/tree/module.php +++ b/modules_v2/tree/module.php @@ -126,6 +126,7 @@ class tree_WT_Module extends WT_Module implements WT_Module_Tab { break; case 'getDetails': + header('Content-Type: text/html; charset=UTF-8'); $pid = safe_GET('pid'); $i = safe_GET('instance'); $tv = new TreeView($i);
#<I> - German Umlaut Problem in interactive tree
fisharebest_webtrees
train
php
08035482858a56963c7694bc7b92308f59272b28
diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/associations/collection_proxy.rb +++ b/activerecord/lib/active_record/associations/collection_proxy.rb @@ -42,6 +42,11 @@ module ActiveRecord @association.load_target end + # Returns +true+ if the association has been loaded, otherwise +false+. + # + # person.pets.loaded? # => false + # person.pets + # person.pets.loaded? # => true def loaded? @association.loaded? end @@ -889,7 +894,7 @@ module ActiveRecord end # Returns a new array of objects from the collection. If the collection - # hasn't been loaded, it fetches the records from the database. + # hasn't been loaded, it fetches the records from the database. # # class Person < ActiveRecord::Base # has_many :pets
update AR::Associations::CollectionProxy#loaded? documentation [ci skip]
rails_rails
train
rb
d8d15f678acd27ad88fdd98a4df4a4a41ca54692
diff --git a/fusesoc/section.py b/fusesoc/section.py index <HASH>..<HASH> 100644 --- a/fusesoc/section.py +++ b/fusesoc/section.py @@ -349,8 +349,8 @@ Testbench source type : {source_type} Verilog top module : {top_module} """ return s.format(verilator_options=' '.join(self.verilator_options), - src_files = ' '.join(self.src_files), - include_files=' '.join(self.include_files), + src_files = ' '.join([f.name for f in self.src_files]), + include_files=' '.join([f.name for f in self.include_files]), define_files=' '.join(self.define_files), libs=' '.join(self.libs), tb_toplevel=self.tb_toplevel,
Fix core-info for verilator sections
olofk_fusesoc
train
py
ec3df953b8a74888a067e005528ee2db0c95703c
diff --git a/lib/puppet/settings.rb b/lib/puppet/settings.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/settings.rb +++ b/lib/puppet/settings.rb @@ -1197,6 +1197,7 @@ Generated on #{Time.now}. # @return nil def clear_everything_for_tests() unsafe_clear(true, true) + @configuration_file = nil @global_defaults_initialized = false @app_defaults_initialized = false end
(PUP-<I>) Clear configuration_file for tests The new default_manifest integration spec is parsing actual configuration files and uncovered that our Settings do not clear the @configuration_file data when #unsafe_clear is called. This allows parsed settings to leak across specs. Specifically dropping the @configuration_file in the test helper Settings#clear_everything_for_tests, resolves this, without changing the behavior of the Settings#clear, and through it, the Puppet.clear methods.
puppetlabs_puppet
train
rb
773c03b4e2280bef160a9926d220d5d0a3d0cf2a
diff --git a/classes/phing/listener/XmlLogger.php b/classes/phing/listener/XmlLogger.php index <HASH>..<HASH> 100755 --- a/classes/phing/listener/XmlLogger.php +++ b/classes/phing/listener/XmlLogger.php @@ -142,8 +142,6 @@ class XmlLogger implements BuildLogger { $elapsedTime = Phing::currentTimeMillis() - $this->buildTimerStart; - print "The build has finished!\n"; - $this->buildElement->setAttribute(XmlLogger::TIME_ATTR, DefaultLogger::formatTime($elapsedTime)); if ($event->getException() != null) {
Merging branch fix [<I>]
phingofficial_phing
train
php
ed17078448282274e8f9c27981e33b30d5d85d0e
diff --git a/src/Kernel.php b/src/Kernel.php index <HASH>..<HASH> 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -453,7 +453,7 @@ class Kernel if ($this->debug) { $this->setContainer(new ContainerBuilder(new EnvPlaceholderParameterBag($this->getContainerParameters()))); $this->loadContainerConfiguration(); - $this->container->compile(); + $this->container->compile(true); } else { $filename = $this->getContainerCacheFilename(); @@ -463,7 +463,7 @@ class Kernel } else { $this->setContainer(new ContainerBuilder(new EnvPlaceholderParameterBag($this->getContainerParameters()))); $this->loadContainerConfiguration(); - $this->container->compile(); + $this->container->compile(true); if ($this->containerIsCacheable()) { $dumper = new PhpDumper($this->container); @@ -529,4 +529,4 @@ class Kernel { // Optional } -} \ No newline at end of file +}
resolve env placeholder parameter - env vars where not replaced when container has been compiled in debug mode - env vars where not replaced when compiling a container in non-debug mode but when loading the cached version on a second call
symlex_di-microkernel
train
php
2ee65622cad07b2524f4df1697176684a4b2b130
diff --git a/huey/tests/test_api.py b/huey/tests/test_api.py index <HASH>..<HASH> 100644 --- a/huey/tests/test_api.py +++ b/huey/tests/test_api.py @@ -479,7 +479,7 @@ class TestQueue(BaseTestCase): self.huey.execute(task, seconds(30)) self.assertEqual(state, [res.id, r2.id, r3.id, r4.id]) - state.clear() + state = [] def test_scheduling_expires(self): @self.huey.task()
Fix <I> incompatibility in test.
coleifer_huey
train
py
d83d5e078c83b68253674863297a75fecd683e59
diff --git a/spec/request_spec.rb b/spec/request_spec.rb index <HASH>..<HASH> 100644 --- a/spec/request_spec.rb +++ b/spec/request_spec.rb @@ -573,9 +573,9 @@ describe RestClient::Request do ) @net.should_receive(:ca_path=).with("Certificate Authority Path") @net.should_receive(:ssl_version=).with('SSLv3') - @http.stub!(:request) - @request.stub!(:process_result) - @request.stub!(:response_log) + @http.stub(:request) + @request.stub(:process_result) + @request.stub(:response_log) @request.transmit(@uri, 'req', 'payload') end @@ -588,9 +588,9 @@ describe RestClient::Request do ) @net.should_not_receive(:sa_path=).with("Certificate Authority File") @net.should_receive(:ssl_version=).with('TSLv1') - @http.stub!(:request) - @request.stub!(:process_result) - @request.stub!(:response_log) + @http.stub(:request) + @request.stub(:process_result) + @request.stub(:response_log) @request.transmit(@uri, 'req', 'payload') end end
Fix new specs that used deprecated "stub!" method
rest-client_rest-client
train
rb
69c7372e4e732567189800152ce9cd495d25f49f
diff --git a/test/test_task.rb b/test/test_task.rb index <HASH>..<HASH> 100644 --- a/test/test_task.rb +++ b/test/test_task.rb @@ -22,18 +22,18 @@ class TestTask < Minitest::Test FileUtils.mkdir_p File.dirname(@manifest_file) @manifest = Sprockets::Manifest.new(@assets, @dir, @manifest_file) - @environment_ran = false - # Stub Rails environment task - @rake.define_task Rake::Task, :environment do - @environment_ran = true - end - Sprockets::Rails::Task.new do |t| t.environment = @assets t.manifest = @manifest t.assets = ['foo.js', 'foo-modified.js'] t.log_level = :fatal end + + @environment_ran = false + # Stub Rails environment task + @rake.define_task Rake::Task, :environment do + @environment_ran = true + end end def teardown
Ensure environment task is defined after sprockets
rails_sprockets-rails
train
rb
343341b55a65091b404425d1b1b8c00493f4cf65
diff --git a/src/collectors/postgres/postgres.py b/src/collectors/postgres/postgres.py index <HASH>..<HASH> 100644 --- a/src/collectors/postgres/postgres.py +++ b/src/collectors/postgres/postgres.py @@ -112,6 +112,8 @@ class PostgresqlCollector(diamond.collector.Collector): if database: conn_args['database'] = database + else: + conn_args['database'] = 'postgres' conn = psycopg2.connect(**conn_args)
Enable default database for _connect() In the event you connect with a user that doesn't have it's own database, set the default to be 'postgres' to enable _get_db_names() to be able to collect the list of databases.
python-diamond_Diamond
train
py
6f65427d1fdab143b45e6d77fca75c5807a368c9
diff --git a/test/test-50-fs-runtime-layer-2/main.js b/test/test-50-fs-runtime-layer-2/main.js index <HASH>..<HASH> 100644 --- a/test/test-50-fs-runtime-layer-2/main.js +++ b/test/test-50-fs-runtime-layer-2/main.js @@ -29,7 +29,7 @@ function bitty (version) { (8 * (/^(node|v)?11/.test(version))) | (16 * (/^(node|v)?12/.test(version))) | (16 * (/^(node|v)?13/.test(version))) | - (16 * (/^(node|v)?14/.test(version))); + (32 * (/^(node|v)?14/.test(version))); } const version1 = process.version;
decouple node<I> from node<I> in test-<I>-fs-runtime-layer-2
zeit_pkg
train
js
01ebdb040e5fc57d4928cda1903e9463b4b14427
diff --git a/src/org/jgroups/protocols/COMPRESS.java b/src/org/jgroups/protocols/COMPRESS.java index <HASH>..<HASH> 100755 --- a/src/org/jgroups/protocols/COMPRESS.java +++ b/src/org/jgroups/protocols/COMPRESS.java @@ -4,6 +4,7 @@ import org.jgroups.Event; import org.jgroups.Global; import org.jgroups.Header; import org.jgroups.Message; +import org.jgroups.annotations.MBean; import org.jgroups.annotations.Property; import org.jgroups.stack.Protocol; @@ -21,6 +22,7 @@ import java.util.zip.Inflater; * * @author Bela Ban */ +@MBean(description="Compresses messages to send and uncompresses received messages") public class COMPRESS extends Protocol { /* ----------------------------------------- Properties -------------------------------------------------- */
added @MBean annotation to be able to expose ops and attrs via JMX
belaban_JGroups
train
java
cb47cd6639f458da9cc027d45c0f502fb6667558
diff --git a/samples/RecurringTask.py b/samples/RecurringTask.py index <HASH>..<HASH> 100755 --- a/samples/RecurringTask.py +++ b/samples/RecurringTask.py @@ -7,7 +7,7 @@ This application demonstrates doing something at a regular interval. import sys from bacpypes.debugging import bacpypes_debugging, ModuleLogger -from bacpypes.consolelogging import ConfigArgumentParser +from bacpypes.consolelogging import ArgumentParser from bacpypes.core import run from bacpypes.task import RecurringTask @@ -46,7 +46,7 @@ class PrairieDog(RecurringTask): try: # parse the command line arguments - parser = ConfigArgumentParser(description=__doc__) + parser = ArgumentParser(description=__doc__) # add an argument for seconds per dog parser.add_argument('seconds', metavar='N', type=int, nargs='+',
this example doesn't need a configuration file
JoelBender_bacpypes
train
py
e3afc4335c7e9bf0974b3696dd3263250ab03583
diff --git a/emirdrp/tools/continuum_flatfield.py b/emirdrp/tools/continuum_flatfield.py index <HASH>..<HASH> 100644 --- a/emirdrp/tools/continuum_flatfield.py +++ b/emirdrp/tools/continuum_flatfield.py @@ -120,6 +120,10 @@ def main(args=None): if args.echo: print('\033[1m\033[31m% ' + ' '.join(sys.argv) + '\033[0m\n') + # This code is obsolete + raise ValueError('This code is obsolete: use recipe in ' + 'emirdrp/recipes/spec/flatpix2pix.py') + # read calibration structure from JSON file rectwv_coeff = RectWaveCoeff._datatype_load(args.rectwv_coeff.name)
Declare continuum_flatfield.py as obsolete
guaix-ucm_pyemir
train
py
42d34a8d3777a822f662bfd24fe5da818f38a6cc
diff --git a/src/bundle/Controller/ContentViewController.php b/src/bundle/Controller/ContentViewController.php index <HASH>..<HASH> 100644 --- a/src/bundle/Controller/ContentViewController.php +++ b/src/bundle/Controller/ContentViewController.php @@ -165,10 +165,10 @@ class ContentViewController extends Controller if (!$view->getContent()->contentInfo->isTrashed()) { $this->supplyPathLocations($view); $this->subitemsContentViewParameterSupplier->supply($view); + $this->supplyContentActionForms($view); } $this->supplyContentType($view); - $this->supplyContentActionForms($view); $this->supplyDraftPagination($view, $request); $this->supplyCustomUrlPagination($view, $request);
EZP-<I>: Exception after sending item from Relation List to Trash
ezsystems_ezplatform-admin-ui
train
php
335ef41a21467b4d05e479fa46401db2e0d8cfcc
diff --git a/shared/login/signup/dumb.js b/shared/login/signup/dumb.js index <HASH>..<HASH> 100644 --- a/shared/login/signup/dumb.js +++ b/shared/login/signup/dumb.js @@ -1,9 +1,9 @@ // @flow import DeviceName from '../register/set-public-name' -import Error from './error' +import Error from './error/index.render' import HiddenString from '../../util/hidden-string' import InviteCode from './invite-code.render' -import Passphrase from './passphrase' +import Passphrase from './passphrase/index.render' import RequestInviteSuccess from './request-invite-success.render' import RequesteInvite from './request-invite.render' import Success from './success/index.render'
Fix broken visdiff using connected components
keybase_client
train
js
b4e83ee7516d4d43ebd90041e3ac2ffbb745c5fb
diff --git a/jax/lax.py b/jax/lax.py index <HASH>..<HASH> 100644 --- a/jax/lax.py +++ b/jax/lax.py @@ -556,10 +556,15 @@ def slice(operand, start_indices, limit_indices, strides=None): <https://www.tensorflow.org/xla/operation_semantics#slice>`_ operator. """ - return slice_p.bind(operand, start_indices=tuple(start_indices), - limit_indices=tuple(limit_indices), - strides=None if strides is None else tuple(strides), - operand_shape=operand.shape) + if (onp.all(onp.equal(start_indices, 0)) + and onp.all(onp.equal(limit_indices, operand.shape)) + and strides is None): + return operand + else: + return slice_p.bind(operand, start_indices=tuple(start_indices), + limit_indices=tuple(limit_indices), + strides=None if strides is None else tuple(strides), + operand_shape=operand.shape) def dynamic_slice(operand, start_indices, slice_sizes): """Wraps XLA's `DynamicSlice
avoid generating trivial lax.slice operations
tensorflow_probability
train
py
4c97d87d17c4ddfc9b3bfdf23a01462b77eba2d5
diff --git a/ipset/ipset.go b/ipset/ipset.go index <HASH>..<HASH> 100755 --- a/ipset/ipset.go +++ b/ipset/ipset.go @@ -118,12 +118,12 @@ func New(name string, hashtype string, p *Params) (*IPSet, error) { return nil, err } - s := &IPSet{name, hashtype, p.HashFamily, p.HashSize, p.MaxElem, p.Timeout} + s := IPSet{name, hashtype, p.HashFamily, p.HashSize, p.MaxElem, p.Timeout} err := s.createHashSet(name) if err != nil { return nil, err } - return s, nil + return &s, nil } // Refresh is used to to overwrite the set with the specified entries.
fixed: pointer passed to createHashSet
janeczku_go-ipset
train
go
f6ba363843ec99ae02f9a6cfff76740bf87c2ad6
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/packet/MUCItem.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/packet/MUCItem.java index <HASH>..<HASH> 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/packet/MUCItem.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/packet/MUCItem.java @@ -148,9 +148,7 @@ public class MUCItem implements NamedElement { xml.optAttribute("affiliation", getAffiliation()); xml.optAttribute("jid", getJid()); xml.optAttribute("nick", getNick()); - if (role != null && role != MUCRole.none) { - xml.attribute("role", getRole()); - } + xml.optAttribute("role", getRole()); xml.rightAngleBracket(); xml.optElement("reason", getReason()); if (getActor() != null) {
Always include role in MUCItem if it's set As not including "role='none'" when kicking a user will result in an XMPPErrorException. Also there appears to be nothing in XEP-<I> which says "if role is not set, then it defaults to 'none'".
igniterealtime_Smack
train
java
9eb01a6da15272770b60984ea6b2fa97b2992ae7
diff --git a/pkg/kubelet/metrics/metrics.go b/pkg/kubelet/metrics/metrics.go index <HASH>..<HASH> 100644 --- a/pkg/kubelet/metrics/metrics.go +++ b/pkg/kubelet/metrics/metrics.go @@ -77,9 +77,9 @@ func Register(containerCache kubecontainer.RuntimeCache) { type SyncPodType int const ( - SyncPodCreate SyncPodType = iota + SyncPodSync SyncPodType = iota SyncPodUpdate - SyncPodSync + SyncPodCreate ) func (sp SyncPodType) String() string {
Make SyncPodSync as the default SyncPodType. We would like the default to be sync instead of create to easily differentiate create operations in empty metrics map.
kubernetes_kubernetes
train
go
cc142e242e9049839ad62bcd50e8b93a9ebae617
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -624,7 +624,7 @@ enginemill.loadInitializers = function (args) { module = require(path); } catch (moduleError) { if (moduleError.code === 'MODULE_NOT_FOUND') { - if (moduleError.message.indexOf(module) !== -1) { + if (moduleError.message.indexOf('\'' + module + '\'') !== -1) { throw new Errors.NotFoundError('Initializer module not found: '+ path); } throw moduleError;
better yet reporting when loading initializers modified: index.js
kixxauth_enginemill
train
js
e18310ee73b05b5091d52310f2a30c8c88a26d2b
diff --git a/lib/objectcache.rb b/lib/objectcache.rb index <HASH>..<HASH> 100644 --- a/lib/objectcache.rb +++ b/lib/objectcache.rb @@ -39,5 +39,11 @@ module Ronin @store = Og.setup(:destroy => false, :evolve_schema => :full, :store => :sqlite, :name => @path) end + protected + + def method_missing(sym,*args) + @store.send(sym,*args) + end + end end
* Added a method missing to allow for more transparent access to the Og store.
ronin-ruby_ronin
train
rb
54163decaf831306a69a526bb46d6eafb510617a
diff --git a/lib/roar/representer/feature/hypermedia.rb b/lib/roar/representer/feature/hypermedia.rb index <HASH>..<HASH> 100644 --- a/lib/roar/representer/feature/hypermedia.rb +++ b/lib/roar/representer/feature/hypermedia.rb @@ -6,6 +6,8 @@ module Roar # Adds links methods to the model which can then be used for hypermedia links when # representing the model. module Hypermedia # TODO: test me. + extend ActiveSupport::Concern + def links=(links) @links = links.collect do |link| Roar::Representer::XML::Hyperlink.from_attributes(link) @@ -21,6 +23,22 @@ module Roar link = find { |l| l.rel.to_s == rel.to_s } and return link.href end end + + + module ClassMethods + # Defines an embedded hypermedia link. + def link(rel, &block) + unless links = representable_attrs.find { |d| d.is_a?(LinksDefinition)} + links = LinksDefinition.new(:links, links_definition_options) + representable_attrs << links + add_reader(links) # TODO: refactor in Roxml. + attr_writer(links.accessor) + end + + links.rel2block << {:rel => rel, :block => block} + end + end + end end end
moving hypermedia code to Hypermedia.
trailblazer_roar
train
rb
54e78f150f389caa7defb51cfc97d9b9b3ff54bd
diff --git a/sharding-core/src/main/java/io/shardingsphere/core/parsing/parser/sql/dql/select/AbstractSelectParser.java b/sharding-core/src/main/java/io/shardingsphere/core/parsing/parser/sql/dql/select/AbstractSelectParser.java index <HASH>..<HASH> 100755 --- a/sharding-core/src/main/java/io/shardingsphere/core/parsing/parser/sql/dql/select/AbstractSelectParser.java +++ b/sharding-core/src/main/java/io/shardingsphere/core/parsing/parser/sql/dql/select/AbstractSelectParser.java @@ -83,10 +83,6 @@ public abstract class AbstractSelectParser implements SQLParser { protected abstract void parseInternal(SelectStatement selectStatement); - protected final void parseDistinct() { - selectClauseParserFacade.getDistinctClauseParser().parse(); - } - protected final void parseSelectList(final SelectStatement selectStatement, final List<SelectItem> items) { selectClauseParserFacade.getSelectListClauseParser().parse(selectStatement, items); }
delete parseDistinct()
apache_incubator-shardingsphere
train
java
11ca120cac4bd5ffb270a91e9094b3e96bc24919
diff --git a/lib/core/thorinCore.js b/lib/core/thorinCore.js index <HASH>..<HASH> 100644 --- a/lib/core/thorinCore.js +++ b/lib/core/thorinCore.js @@ -1119,7 +1119,6 @@ var _exitSignal = null; function bindProcessEvents() { if (this.env === 'development') return; var self = this; - function onSignal(code) { if (_exitSignal) { return process.exit(0); diff --git a/lib/util/util.js b/lib/util/util.js index <HASH>..<HASH> 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -514,7 +514,6 @@ class ThorinUtils { let targetObj = targetMap[sid]; if (typeof targetObj !== 'object' || !targetObj) continue; itm[sourceField] = targetObj; - delete itm[sourceId]; } // next loop over targets targetMap = null; diff --git a/package.json b/package.json index <HASH>..<HASH> 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "thorin", "author": "UNLOQ Systems", - "version": "1.1.39", + "version": "1.1.40", "dependencies": { "async": "1.4.2", "camelcase": "2.1.1",
mergeItems no longer deletes the source id
Thorinjs_Thorin
train
js,js,json
314c75fffb4648ea0587754c2228c234d05b4885
diff --git a/forms_builder/forms/models.py b/forms_builder/forms/models.py index <HASH>..<HASH> 100644 --- a/forms_builder/forms/models.py +++ b/forms_builder/forms/models.py @@ -27,6 +27,8 @@ FIELD_CHOICES = ( ("CharField/django.forms.Textarea", _("Multi line text")), ("EmailField", _("Email")), ("BooleanField", _("Check box")), + ("MultipleChoiceField/django.forms.CheckboxSelectMultiple", + _("Check boxes")), ("ChoiceField", _("Drop down")), ("MultipleChoiceField", _("Multi select")), ("ChoiceField/django.forms.RadioSelect", _("Radio buttons")),
Add multiple check boxes as a field type.
stephenmcd_django-forms-builder
train
py
1bdb911e050de5084d4a9938cb3689cb5f485310
diff --git a/tests/TaxonomyArchiveGeneratorTest.php b/tests/TaxonomyArchiveGeneratorTest.php index <HASH>..<HASH> 100644 --- a/tests/TaxonomyArchiveGeneratorTest.php +++ b/tests/TaxonomyArchiveGeneratorTest.php @@ -18,13 +18,15 @@ class TaxonomyArchiveGeneratorTest extends CommandTestBase $this->copyDirectory('assets/build_test_23/src', '_tmp'); // <Bootstrap Tapestry> - $tapestry = new Tapestry(new ArrayInput([])); + $tapestry = new Tapestry(new ArrayInput([ + '--site-dir' => __DIR__ . DIRECTORY_SEPARATOR . '_tmp', + '--env' => 'testing' + ])); $generator = new Generator($tapestry->getContainer()->get('Compile.Steps'), $tapestry); - $project = new Project(__DIR__ . DIRECTORY_SEPARATOR . '_tmp', 'testing'); + /** @var Project $project */ + $project = $tapestry->getContainer()->get(Project::class); $project->set('cmd_options', []); - - $tapestry->getContainer()->add(Project::class, $project); $generator->generate($project, new NullOutput); // </Bootstrap Tapestry>
:fire: Bringing test in line with new method of constructing Project
tapestry-cloud_tapestry
train
php
2ab05326221310211ac7332146ab8988e942bdba
diff --git a/code/model/fieldtypes/Markdown.php b/code/model/fieldtypes/Markdown.php index <HASH>..<HASH> 100644 --- a/code/model/fieldtypes/Markdown.php +++ b/code/model/fieldtypes/Markdown.php @@ -56,7 +56,7 @@ class Markdown extends Text { $curl=curl_init('https://api.github.com/markdown'); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-type: application/json")); + curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-type: application/json", "User-Agent: curl")); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $content); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
Fix bug where github API call would fail because no User-Agent was set on the HTTP Request
UndefinedOffset_silverstripe-markdown
train
php
5a315e8be3b61006cab324457fc9d35c4f2bf98d
diff --git a/annis-gui/src/main/java/annis/gui/resultview/VisualizerPanel.java b/annis-gui/src/main/java/annis/gui/resultview/VisualizerPanel.java index <HASH>..<HASH> 100644 --- a/annis-gui/src/main/java/annis/gui/resultview/VisualizerPanel.java +++ b/annis-gui/src/main/java/annis/gui/resultview/VisualizerPanel.java @@ -138,10 +138,10 @@ public class VisualizerPanel extends Panel implements Button.ClickListener } compVis = (ComponentVisualizerPlugin) vis; - this.setWidth("100%"); - label = new Label("KWIC"); - this.setContent(this.visContainer); - this.visContainer.addComponent(label, "btEntry"); + + this.addStyleName(ChameleonTheme.PANEL_BORDERLESS); + this.setWidth("100%"); + this.setContent(this.visContainer); } public VisualizerPanel(final ResolverEntry entry, SDocument result,
Make the component visualizer borderless.
korpling_ANNIS
train
java
b50bea4a1b93dfa7ecd70bf1409a0b633a2c37b4
diff --git a/backup/controller/backup_controller.class.php b/backup/controller/backup_controller.class.php index <HASH>..<HASH> 100644 --- a/backup/controller/backup_controller.class.php +++ b/backup/controller/backup_controller.class.php @@ -65,6 +65,16 @@ class backup_controller extends backup implements loggable { protected $checksum; // Cache @checksumable results for lighter @is_checksum_correct() uses + /** + * Constructor for the backup controller class. + * + * @param int $type Type of the backup; One of backup::TYPE_1COURSE, TYPE_1SECTION, TYPE_1ACTIVITY + * @param int $id The ID of the item to backup; e.g the course id + * @param int $format The backup format to use; Most likely backup::FORMAT_MOODLE + * @param bool $interactive Whether this backup will require user interaction; backup::INTERACTIVE_YES or INTERACTIVE_NO + * @param int $mode One of backup::MODE_GENERAL, MODE_IMPORT, MODE_SAMESITE, MODE_HUB + * @param int $userid The id of the user making the backup + */ public function __construct($type, $id, $format, $interactive, $mode, $userid){ $this->type = $type; $this->id = $id; @@ -254,6 +264,10 @@ class backup_controller extends backup implements loggable { return $this->logger; } + /** + * Executes the backup + * @return void Throws and exception of completes + */ public function execute_plan() { return $this->plan->execute(); }
backup MDL-<I> Updating a couple of PHP docs
moodle_moodle
train
php
1ad7ec792ecec0bb384415068dbfcf39681e49a9
diff --git a/spec/unit/system_spec.rb b/spec/unit/system_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/system_spec.rb +++ b/spec/unit/system_spec.rb @@ -407,6 +407,8 @@ describe "Ohai::System" do E it "runs all the plugins" do + # disable a few slow running plugins + Ohai.config[:disabled_plugins] = %i{Packages Virtualbox Ruby} ohai.run_additional_plugins(@plugins_directory) expect(ohai.data[:canteloupe][:english][:version]).to eq(2014) expect(ohai.data[:canteloupe][:french][:version]).to eq(2012)
Speedup the slowest spec by running fewer plugins This spec runs the entire Ohai suite, which can take a bit of time. let's disable the slowest stuff to speed it up a bit.
chef_ohai
train
rb
0024cb308ce8d96876bbc229833d4c0181418608
diff --git a/lib/xcodeproj/project/xcproj_helper.rb b/lib/xcodeproj/project/xcproj_helper.rb index <HASH>..<HASH> 100644 --- a/lib/xcodeproj/project/xcproj_helper.rb +++ b/lib/xcodeproj/project/xcproj_helper.rb @@ -83,7 +83,7 @@ module Xcodeproj @objc_class ||= CoreFoundation.objc_getClass('PBXProject') end - XCODE_PATH = Pathname.new('/Applications/Xcode.app/Contents') + XCODE_PATH = Pathname.new(`xcode-select -p`).join('../..') def self.image Fiddle.dlopen(XCODE_PATH.join('SharedFrameworks/DVTFoundation.framework/DVTFoundation').to_s)
Use `xcode-select -p` to determine path.
CocoaPods_Xcodeproj
train
rb
d7851fffbf15c0423a7262014e899eb80a47486c
diff --git a/examples/v4/collections/create-a-collection.php b/examples/v4/collections/create-a-collection.php index <HASH>..<HASH> 100644 --- a/examples/v4/collections/create-a-collection.php +++ b/examples/v4/collections/create-a-collection.php @@ -8,7 +8,7 @@ use Billplz\API; use Billplz\Connect; $connect = (new Connect('<api-key-here>'))->detectMode(); -//$connect->setMode(true); // true: staging | false: production (default) +//$connect->setMode(true); // true: production | false: staging (default) $billplz = new API($connect);
Update setMode() description. Documented values seem to be opposite the actual API.
Billplz_Billplz-API-Class
train
php
11fca408fffdd1f2bc7ad50c7442a7fbfa66fd58
diff --git a/analyzers/EmlParser/parse.py b/analyzers/EmlParser/parse.py index <HASH>..<HASH> 100755 --- a/analyzers/EmlParser/parse.py +++ b/analyzers/EmlParser/parse.py @@ -68,7 +68,7 @@ def parseEml(filepath): #splited string because it was returning the body inside 'Content-Type' hParser = email.parser.HeaderParser() h = str(hParser.parsestr(raw_eml)) - result['headers'] = h[:h.index('Content-Type:')] + result['headers'] = h[:h.lower().index('content-type:')] parsed_eml = eml_parser.eml_parser.decode_email(filepath, include_raw_body=True, include_attachment_data=True) #parsed_eml['header'].keys() gives:
Fix bug emlparser when 'content-type' string in mail is in lower case Emlparser crashes when the string "Content-Type" is not found. In some cases it's available as "Content-type" or "content-type" , this fixes those cases
TheHive-Project_Cortex-Analyzers
train
py
603c6cd76e55f73e3f702dc70051768fc5bb94cf
diff --git a/src/Reporter/Verbose.php b/src/Reporter/Verbose.php index <HASH>..<HASH> 100644 --- a/src/Reporter/Verbose.php +++ b/src/Reporter/Verbose.php @@ -55,6 +55,14 @@ class Verbose extends Terminal */ public function end($summary) { + $this->write("\n"); + + foreach ($summary->logs() as $log) { + if (!$log->passed()) { + $this->_report($log); + } + } + $this->write("\n\n"); $this->_reportSummary($summary); }
Report all failures at the end of verbose reporting.
kahlan_kahlan
train
php
104fc8665ac8e8bf827ddf3a54e27c651dd0407f
diff --git a/django_mock_queries/query.py b/django_mock_queries/query.py index <HASH>..<HASH> 100644 --- a/django_mock_queries/query.py +++ b/django_mock_queries/query.py @@ -228,8 +228,8 @@ def MockSet(*initial_items, **kwargs): return mock_set -def MockModel(cls=None, mock_name=None, **attrs): - mock_attrs = dict(spec=cls, name=mock_name) +def MockModel(cls=None, mock_name=None, spec_set=None, **attrs): + mock_attrs = dict(spec=cls, name=mock_name, spec_set=spec_set) mock_model = MagicMock(**mock_attrs) if mock_name:
added spec_set to MockModel
stphivos_django-mock-queries
train
py
0bdb90d6c08f6726fee178ae5902b4a105bbd96a
diff --git a/pg13/__init__.py b/pg13/__init__.py index <HASH>..<HASH> 100644 --- a/pg13/__init__.py +++ b/pg13/__init__.py @@ -1,3 +1,3 @@ import misc,diff,pg,redismodel,syncschema # don't import pgmock and stubredis -- they're only useful for test mode or nonstandard env (i.e. stubredis on windows) -__version__ = '0.0.4' +__version__ = '0.0.5'
bumping version (joins didn't work in <I>)
abe-winter_pg13-py
train
py
f79784c256b117b6cbe9ad626693cb8542351d4d
diff --git a/_examples/sql/main.go b/_examples/sql/main.go index <HASH>..<HASH> 100644 --- a/_examples/sql/main.go +++ b/_examples/sql/main.go @@ -136,7 +136,7 @@ var sqlParser = participle.MustBuild(&Select{}, sqlLexer) func main() { kingpin.Parse() sql := &Select{} - err := sqlParser.ParseString(`SELECT u.name, age, date_of_birth AS dob FROM user AS u`, sql) + err := sqlParser.ParseString(`SELECT u.name, u.age, u.date_of_birth AS dob FROM user AS u`, sql) kingpin.FatalIfError(err, "") repr.Println(sql, repr.Indent(" "), repr.OmitEmpty()) }
Added "FROM" support to SQL parser.
alecthomas_participle
train
go
97dc3568f7bd7bf9e0f42f5fcb8a1ffe50da51a4
diff --git a/runtests/mpi/tester.py b/runtests/mpi/tester.py index <HASH>..<HASH> 100644 --- a/runtests/mpi/tester.py +++ b/runtests/mpi/tester.py @@ -373,6 +373,8 @@ class Tester(BaseTester): # see the faq: # https://www.open-mpi.org/faq/?category=running#oversubscribing os.environ['OMPI_MCA_rmaps_base_oversubscribe'] = '1' + os.environ['OMPI_MCA_rmaps_base_no_oversubscribe'] = '0' + os.environ['OMPI_MCA_mpi_yield_when_idle'] = '1' os.execvp(mpirun[0], mpirun + cmdargs + additional)
Set a few more OMPI parameters related to 'oversubscribe'.
bccp_runtests
train
py
250560caaf6ce2638ac1433770eb12ab960630c7
diff --git a/core/common/src/test/java/alluxio/worker/block/io/LocalFileBlockWriterTest.java b/core/common/src/test/java/alluxio/worker/block/io/LocalFileBlockWriterTest.java index <HASH>..<HASH> 100644 --- a/core/common/src/test/java/alluxio/worker/block/io/LocalFileBlockWriterTest.java +++ b/core/common/src/test/java/alluxio/worker/block/io/LocalFileBlockWriterTest.java @@ -56,7 +56,7 @@ public final class LocalFileBlockWriterTest { } @Test - public void transferFrom() throws Exception { + public void appendByteBuf() throws Exception { ByteBuf buffer = Unpooled.wrappedBuffer( BufferUtils.getIncreasingByteBuffer(TEST_BLOCK_SIZE)); buffer.markReaderIndex();
Update LocalFileBlockWriterTest.java
Alluxio_alluxio
train
java
f277b9bc7c387ccedba8e9b899d94c5ab0921578
diff --git a/tests/test_node_tracers.js b/tests/test_node_tracers.js index <HASH>..<HASH> 100644 --- a/tests/test_node_tracers.js +++ b/tests/test_node_tracers.js @@ -126,7 +126,7 @@ module.exports = { test_espresso: function(test) { var express = require('express'); var http = require('http'); - + var request = require('request'); var a = express(); var s = http.createServer(a); @@ -142,5 +142,6 @@ module.exports = { }); s.listen('8001'); + request.get('http://localhost:8001'); } };
Now with working example- need to call the .get method to trigger the close. Also, we can't call close too early in case the server hasn't had time to set up yet (async and all).
tryfer_node-tryfer
train
js
94e1d233f295973590993e2fe800f91864d2c59e
diff --git a/apps/Sandbox/bootstrap/contexts/api.php b/apps/Sandbox/bootstrap/contexts/api.php index <HASH>..<HASH> 100644 --- a/apps/Sandbox/bootstrap/contexts/api.php +++ b/apps/Sandbox/bootstrap/contexts/api.php @@ -80,6 +80,10 @@ OK: { } ERROR: { + if (PHP_SAPI === 'cli') { + $app->exceptionHandler->handle($e); + exit; + } http_response_code($code); echo $body; exit(1);
[#<I>] exception is handle by api.php in develop
bearsunday_BEAR.Package
train
php
3dc49ad2865ec22c28c65b0750464648a3362c8c
diff --git a/src/Picqer/Financials/Exact/Query/Findable.php b/src/Picqer/Financials/Exact/Query/Findable.php index <HASH>..<HASH> 100644 --- a/src/Picqer/Financials/Exact/Query/Findable.php +++ b/src/Picqer/Financials/Exact/Query/Findable.php @@ -138,6 +138,12 @@ trait Findable while ($this->connection()->nextUrl !== null) { $nextResult = $this->connection()->get($this->connection()->nextUrl); + + // If we have one result which is not an assoc array, make it the first element of an array for the array_merge function + if ((bool) count(array_filter(array_keys($nextResult), 'is_string'))) { + $nextResult = [ $nextResult ]; + } + $result = array_merge($result, $nextResult); } $collection = [ ];
Handle next pages single result as an element of array Handle next page single result from Exact API not delivered as an array of elements by making the single item the first element of an (new) array.
picqer_exact-php-client
train
php
8eaab3a81c06780f1889cdf79f6eaeb83b4e7de5
diff --git a/keep/utils.py b/keep/utils.py index <HASH>..<HASH> 100644 --- a/keep/utils.py +++ b/keep/utils.py @@ -105,6 +105,13 @@ def pull(ctx, overwrite): def register(): + + if not os.path.exists(dir_path): + click.secho("\n[CRITICAL] {0} does not exits.\nPlease run 'keep init'," + " and try registering again.\n".format(dir_path), + fg="red", err=True) + sys.exit(1) + # User may not choose to register and work locally. # Registration is required to push the commands to server if click.confirm('Proceed to register?', abort=True, default=True):
Add check for ~/.keep/ when registering
OrkoHunter_keep
train
py
478693a7f55d04a32add89d9b33741a2fb41818c
diff --git a/db/seeds.rb b/db/seeds.rb index <HASH>..<HASH> 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -17,6 +17,9 @@ INSERT INTO pilgrim_cities VALUES ; ' +ActiveRecord::Base.connection.execute('truncate table pilgrim_countries;') ActiveRecord::Base.connection.execute(countries) +ActiveRecord::Base.connection.execute('truncate table pilgrim_states;') ActiveRecord::Base.connection.execute(states) +ActiveRecord::Base.connection.execute('truncate table pilgrim_cities;') ActiveRecord::Base.connection.execute(cities) \ No newline at end of file diff --git a/lib/pilgrim/version.rb b/lib/pilgrim/version.rb index <HASH>..<HASH> 100644 --- a/lib/pilgrim/version.rb +++ b/lib/pilgrim/version.rb @@ -1,3 +1,3 @@ module Pilgrim - VERSION = "0.1.5" + VERSION = "0.1.6" end
Add truncates to pilgrim tables before inserts
pablomarti_Pilgrim
train
rb,rb
243584246f8bbc89a7ac537b2a65a85c88824c45
diff --git a/stdeb/util.py b/stdeb/util.py index <HASH>..<HASH> 100644 --- a/stdeb/util.py +++ b/stdeb/util.py @@ -349,7 +349,6 @@ class DebianInfo: if has_ext_modules: debinfo.architecture = 'any' depends.append('${shlibs:Depends}') - build_deps.extend(['gcc','libc6-dev']) else: debinfo.architecture = 'all'
revert last change -- anyone building from source should have 'build-essential' installed, which includes gcc and libc6-dev git-svn-id: <URL>
astraw_stdeb
train
py
61b8db90733d80212a2be0bce915437b132b362c
diff --git a/src/string/capitalize.js b/src/string/capitalize.js index <HASH>..<HASH> 100644 --- a/src/string/capitalize.js +++ b/src/string/capitalize.js @@ -4,6 +4,7 @@ */ /*#ifndef(UMD)*/ "use strict"; +/*global _GPF_START*/ // 0 /*exported _gpfStringCapitalize*/ // Capitalize the string /*#endif*/ @@ -15,7 +16,8 @@ * @since 0.1.5 */ function _gpfStringCapitalize (that) { - return that.charAt(0).toUpperCase() + that.substr(1); + var REMAINDER = 1; + return that.charAt(_GPF_START).toUpperCase() + that.substring(REMAINDER); } /*#ifndef(UMD)*/
no-magic-numbers (#<I>)
ArnaudBuchholz_gpf-js
train
js
94a5df75be5919f8dc95d32bc7f4c6c56ee51b5f
diff --git a/ewma/rate.go b/ewma/rate.go index <HASH>..<HASH> 100644 --- a/ewma/rate.go +++ b/ewma/rate.go @@ -62,7 +62,7 @@ func (r *EwmaRate) Current(now time.Time) float64 { return 0 } - if r.Ewma.lastTimestamp == now { + if r.Ewma.lastTimestamp == now || now.Before(r.Ewma.lastTimestamp) { return r.Ewma.Current }
ewma: handle a situation of time going back or race condition between code reading and updating rates
cloudflare_golibs
train
go
3e279eecb11ba303c418396480e8c07d68ee0882
diff --git a/lib/doorkeeper/config.rb b/lib/doorkeeper/config.rb index <HASH>..<HASH> 100644 --- a/lib/doorkeeper/config.rb +++ b/lib/doorkeeper/config.rb @@ -99,7 +99,7 @@ module Doorkeeper option :resource_owner_authenticator, :as => :authenticate_resource_owner option :admin_authenticator, :as => :authenticate_admin option :access_token_expires_in, :default => 7200 - option :authorization_scopes, :as => :scopes, :builder_class => ScopesBuilder + option :authorization_scopes, :as => :scopes, :builder_class => ScopesBuilder, :default => Scopes.new def refresh_token_enabled? !!@refresh_token_enabled diff --git a/spec/lib/config_spec.rb b/spec/lib/config_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/config_spec.rb +++ b/spec/lib/config_spec.rb @@ -48,6 +48,14 @@ describe Doorkeeper, "configuration" do subject.scopes[:public].description.should == "Public" subject.scopes[:public].default.should == true end + + it "returns empty Scopes collection if no scopes were defined" do + Doorkeeper.configure do + end + + subject.scopes.should be_a(Doorkeeper::Scopes) + subject.scopes.all.should == [] + end end describe "use_refresh_token" do
Handle situation when user did not specify any scopes If user did not specify any scopes in the initializer the application would by default have empty Scopes collection.
doorkeeper-gem_doorkeeper
train
rb,rb
fade921ac02a0088ec572449c635322f2e4a78d6
diff --git a/pyrogram/client/types/message.py b/pyrogram/client/types/message.py index <HASH>..<HASH> 100644 --- a/pyrogram/client/types/message.py +++ b/pyrogram/client/types/message.py @@ -26,9 +26,6 @@ class Message(Object): Args: message_id (``int``): Unique message identifier inside this chat. - - client (:obj:`Client <pyrogram.Client>`, *optional*): - The client instance this message is bound to. date (``int``, *optional*): Date the message was sent in Unix time.
Don't document client, is for internal purposes only
pyrogram_pyrogram
train
py
ee25fcfbdb8bf831c65295089ef1b5b853b36099
diff --git a/test/03list.js b/test/03list.js index <HASH>..<HASH> 100644 --- a/test/03list.js +++ b/test/03list.js @@ -53,4 +53,14 @@ describe('list() method tests', function () { let data = await sftp.list('.'); return expect(data).to.containSubset([{ type: 'd', name: 'testServer' }]); }); + + it('list with ".." path', async function () { + let data = await sftp.list('..'); + return expect(data).to.containSubset([{ type: 'd', name: 'tim' }]); + }); + + it('list with "../testServer" path', async function () { + let data = await sftp.list('../tim'); + return expect(data).to.containSubset([{ type: 'd', name: 'testServer' }]); + }); });
Add additional relative path tests to list() method
jyu213_ssh2-sftp-client
train
js
644b5629fff5d094d9f8cf3d28aacb65d8d4e498
diff --git a/mod/scorm/lib.php b/mod/scorm/lib.php index <HASH>..<HASH> 100755 --- a/mod/scorm/lib.php +++ b/mod/scorm/lib.php @@ -579,6 +579,9 @@ function scorm_startElement($parser, $name, $attrs) { function scorm_endElement($parser, $name) { global $scoes,$i,$level,$datacontent,$manifest,$organization,$version; + + $datacontent = trim($datacontent); + if ($name == 'ITEM') { $level--; } @@ -618,11 +621,12 @@ function scorm_endElement($parser, $name) { $version = 'SCORM_1.2'; } } -} + $datacontent = ''; +} function scorm_characterData($parser, $data) { global $datacontent; - $datacontent = utf8_decode($data); + $datacontent .= utf8_decode($data); } function scorm_parse($pkgdir,$pkgtype,$scormid){
Fixed a problem with altered chars in UTF-8
moodle_moodle
train
php
ab9f4b0e495022be6a23a5157a4d537e6a62e7d5
diff --git a/drools-api/src/main/java/org/drools/runtime/rule/PropagationContext.java b/drools-api/src/main/java/org/drools/runtime/rule/PropagationContext.java index <HASH>..<HASH> 100644 --- a/drools-api/src/main/java/org/drools/runtime/rule/PropagationContext.java +++ b/drools-api/src/main/java/org/drools/runtime/rule/PropagationContext.java @@ -9,6 +9,15 @@ public interface PropagationContext { public static final int RULE_ADDITION = 3; public static final int RULE_REMOVAL = 4; public static final int EXPIRATION = 5; + + public static final String[] typeDescr = new String[] { + "ASSERTION", + "RETRACTION", + "MODIFICATION", + "RULE_ADDITION", + "RULE_REMOVAL", + "EXPIRATION" + }; public long getPropagationNumber();
Improving support for idle and time to next job git-svn-id: <URL>
kiegroup_drools
train
java
f7b8393e2b80f14530369ecbe41043b2da453398
diff --git a/views/js/ui/modal.js b/views/js/ui/modal.js index <HASH>..<HASH> 100644 --- a/views/js/ui/modal.js +++ b/views/js/ui/modal.js @@ -224,11 +224,15 @@ define(['jquery', 'core/pluginifier', 'core/dataattrhandler'], function ($, Plug //Calculate the top offset topOffset = (options.vCenter || modalHeight > windowHeight) ? 40 : (windowHeight - modalHeight) / 2; // check scroll if element in the scrolled container - $element.parents().map(function () { - if (this.tagName !== 'BODY' && this.tagName !== 'HTML') { - topOffset += parseInt($(this).scrollTop(), 10); - } - }); + // added later: now offset will be increased only if container element doesn't has class no-scroll-offset + // as, sometimes, on screens with lesser height part of modal runs under the bottom browser edge + if (!$element.parent().hasClass('no-scroll-offset')) { + $element.parents().map(function () { + if (this.tagName !== 'BODY' && this.tagName !== 'HTML') { + topOffset += parseInt($(this).scrollTop(), 10); + } + }); + } to = { 'opacity': '1', 'top': topOffset + 'px'
Modal top offset will be now increased only if its direct container has no class 'no-scroll-offset' (added because sometimes modal bottom part runs under the lower edge of browser);
oat-sa_tao-core
train
js
23071a1b7de5729ade2fa50450c968c372c1937d
diff --git a/ansible_runner/runner_config.py b/ansible_runner/runner_config.py index <HASH>..<HASH> 100644 --- a/ansible_runner/runner_config.py +++ b/ansible_runner/runner_config.py @@ -624,13 +624,6 @@ class RunnerConfig(object): ) ]) - if self.cli_execenv_cmd == 'adhoc': - new_args.extend([ - "-v", "{}:/runner/project/".format( - os.path.dirname(self.private_data_dir), - ) - ]) - # volume mount inventory into the exec env container if provided at cli if '-i' in self.cmdline_args: inventory_file_path = self.cmdline_args[self.cmdline_args.index('-i') + 1]
don't mount private_data_dir in container twice (adhoc)
ansible_ansible-runner
train
py
02a2d79bde66feaf152ead4974da6a735a009a79
diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index <HASH>..<HASH> 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -1769,14 +1769,15 @@ func DumpAllNamespaceInfo(c clientset.Interface, namespace string) { // 2. there are so many of them that working with them are mostly impossible // So we dump them only if the cluster is relatively small. maxNodesForDump := TestContext.MaxNodesToGather - if nodes, err := c.CoreV1().Nodes().List(metav1.ListOptions{}); err == nil { - if len(nodes.Items) <= maxNodesForDump { - dumpAllNodeInfo(c) - } else { - e2elog.Logf("skipping dumping cluster info - cluster too large") - } - } else { + nodes, err := c.CoreV1().Nodes().List(metav1.ListOptions{}) + if err != nil { e2elog.Logf("unable to fetch node list: %v", err) + return + } + if len(nodes.Items) <= maxNodesForDump { + dumpAllNodeInfo(c) + } else { + e2elog.Logf("skipping dumping cluster info - cluster too large") } }
Reduce indents of DumpAllNamespaceInfo() During cleanup of DumpAllNamespaceInfo(), the code was a little unreadable. This reduces the indents for the code readability.
kubernetes_kubernetes
train
go
4bde12e6feb7f2f2e5ff14540ebb66d83f257747
diff --git a/lib/m4dbi/model.rb b/lib/m4dbi/model.rb index <HASH>..<HASH> 100644 --- a/lib/m4dbi/model.rb +++ b/lib/m4dbi/model.rb @@ -384,6 +384,9 @@ module M4DBI def save nil end + def save! + nil + end end # Define a new M4DBI::Model like this: diff --git a/spec/model.rb b/spec/model.rb index <HASH>..<HASH> 100644 --- a/spec/model.rb +++ b/spec/model.rb @@ -944,6 +944,13 @@ describe 'A found M4DBI::Model subclass instance' do end end + it 'does nothing on #save!' do + p = @m_post[ 1 ] + should.not.raise do + p.save! + end + end + end describe 'M4DBI::Model (relationships)' do
Added no-op Model#save! .
Pistos_m4dbi
train
rb,rb
61c17f67229ff1a1fe47b866aff741c06427513a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -4,6 +4,14 @@ from setuptools import find_packages, setup py_version = sys.version_info[:2] +py_version_dotted = '{0.major}.{0.minor}'.format(sys.version_info) +supported_py_versions = ('2.7', '3.3', '3.4', '3.5') + + +if py_version_dotted not in supported_py_versions: + sys.stderr.write('WARNING: django-local-settings does not officially support Python ') + sys.stderr.write(py_version_dotted) + sys.stderr.write('\n') with open('VERSION') as version_fp:
Warn when installing into an unsupported Python version
PSU-OIT-ARC_django-local-settings
train
py
28527aca0a7403d2c7e86e397f776c79048478ee
diff --git a/applications/default/public/js/controllers.js b/applications/default/public/js/controllers.js index <HASH>..<HASH> 100644 --- a/applications/default/public/js/controllers.js +++ b/applications/default/public/js/controllers.js @@ -277,7 +277,23 @@ function InlineReferenceElementController($scope, $location, applicationState, C function InlineReferenceElementItemController($scope, $filter, applicationState, Choko) { $scope.editItem = function() { - $scope.setSubForm($scope.element.reference.type, !!$scope.element.reference.subtypes, $scope.item, $scope.key); + $scope.setSubForm($scope.typeName(), !!$scope.element.reference.subtypes, $scope.item, $scope.key); + }; + + $scope.typeName = function() { + var typeName = $scope.element.reference.type; + + // If it has subtypes, i.e. it's a polymorphic type, get the actual type + // being added to load the correct form. + if ($scope.element.reference.subtypes) { + $scope.element.reference.subtypes.forEach(function(subtype) { + if (subtype.shortName == $scope.item.type) { + typeName = subtype.name; + } + }); + } + + return typeName; }; }
Loading proper form for editing inline referenced items for polymorphic referenced types.
recidive_choko
train
js
dca940a11fe68a2f713ee2366698939fd9821c60
diff --git a/wayback-core/src/main/java/org/archive/wayback/resourcestore/indexer/WarcIndexer.java b/wayback-core/src/main/java/org/archive/wayback/resourcestore/indexer/WarcIndexer.java index <HASH>..<HASH> 100644 --- a/wayback-core/src/main/java/org/archive/wayback/resourcestore/indexer/WarcIndexer.java +++ b/wayback-core/src/main/java/org/archive/wayback/resourcestore/indexer/WarcIndexer.java @@ -136,6 +136,8 @@ public class WarcIndexer { pw.println(lines.next()); } pw.close(); + System.exit(1); + } catch (Exception e) { e.printStackTrace(); }
BUGFIX(ACC-<I>): was not setting exit status to non-zero when exceptions were caught... Uhg. git-svn-id: <URL>
iipc_openwayback
train
java
5ad7c36bd4534fa30c2af51bd2097f41a4a764b3
diff --git a/runtime/kubernetes/kubernetes.go b/runtime/kubernetes/kubernetes.go index <HASH>..<HASH> 100644 --- a/runtime/kubernetes/kubernetes.go +++ b/runtime/kubernetes/kubernetes.go @@ -136,8 +136,12 @@ func (k *kubernetes) getService(labels map[string]string) ([]*service, error) { for _, item := range podList.Items { var status string - // inspect the - if item.Metadata.Name != name { + // check the name + if item.Metadata.Labels["name"] != name { + continue + } + // check the version + if item.Metadata.Labels["version"] != version { continue }
Fix labels for k8s (#<I>)
micro_go-micro
train
go
5e7ecc72866d46cb11dc00e2f4ab7e0bb15c9793
diff --git a/traverse.go b/traverse.go index <HASH>..<HASH> 100644 --- a/traverse.go +++ b/traverse.go @@ -43,8 +43,11 @@ func (r *Reader) Networks() *Networks { // in the database which are contained in a given network. // // Please note that a MaxMind DB may map IPv4 networks into several locations -// in an IPv6 database. This iterator will iterate over all of these -// locations separately. +// in an IPv6 database. This iterator will iterate over all of these locations +// separately. +// +// If the provided network is contained within a network in the database, the +// iterator will iterate over exactly one network, the containing network. func (r *Reader) NetworksWithin(network *net.IPNet) *Networks { ip := network.IP prefixLength, _ := network.Mask.Size()
Clarify behaviour of NetworksWithin() in the case where the network being searched is contained within another network.
oschwald_maxminddb-golang
train
go
b9025370b2b27995d73de6e0e1f02cee00122e0f
diff --git a/engine/src/test/java/com/stratio/streaming/utils/ZKUtilsTestIT.java b/engine/src/test/java/com/stratio/streaming/utils/ZKUtilsTestIT.java index <HASH>..<HASH> 100644 --- a/engine/src/test/java/com/stratio/streaming/utils/ZKUtilsTestIT.java +++ b/engine/src/test/java/com/stratio/streaming/utils/ZKUtilsTestIT.java @@ -5,9 +5,8 @@ import static org.junit.Assert.*; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import com.stratio.streaming.commons.constants.STREAM_OPERATIONS; import com.stratio.streaming.commons.messages.StratioStreamingMessage; import com.stratio.streaming.service.StreamsHelper; @@ -17,6 +16,7 @@ import com.typesafe.config.ConfigFactory; /** * Created by aitor on 9/30/15. */ +@RunWith(JUnit4.class) public class ZKUtilsTestIT { private static Config conf;
added RunWith to ZKUtilsTest
Stratio_Decision
train
java
d4eae329652092738387455483db3c8f01bb26b6
diff --git a/media/boom/js/boom/page/settings.js b/media/boom/js/boom/page/settings.js index <HASH>..<HASH> 100644 --- a/media/boom/js/boom/page/settings.js +++ b/media/boom/js/boom/page/settings.js @@ -612,11 +612,11 @@ $.widget('boom.page', $.boom.page, { $.boom.page.settings.save( '/cms/page/settings/children/' + $.boom.page.options.id, - $(this).find('form').serialize() + $("form.b-form-settings").serialize() ).done(function() { $.boom.page.settings.save( url, - {csrf: $("this").find('input[name=csrf]').val(), sequences: sequences}, + {csrf: $("form.b-form-settings").find('input[name=csrf]').val(), sequences: sequences}, "Child page ordering saved, reloading page." ).done(function(){ setTimeout(function() {
Fixed bug with manually re-ordering child pages
boomcms_boom-core
train
js
5cbf374529189f5078f7e1409643e8310531fad5
diff --git a/modules/Cockpit/Controller/Media.php b/modules/Cockpit/Controller/Media.php index <HASH>..<HASH> 100755 --- a/modules/Cockpit/Controller/Media.php +++ b/modules/Cockpit/Controller/Media.php @@ -19,7 +19,11 @@ class Media extends \Cockpit\AuthController { $cmd = $this->param('cmd', false); $mediapath = $this->module('cockpit')->getGroupVar('finder.path', ''); - $this->root = rtrim($this->app->path("site:{$mediapath}"), '/'); + if (!$mediapath && !$this->module('cockpit')->isSuperAdmin()) { + $this->root = rtrim($this->app->path("#uploads:"), '/'); + } else { + $this->root = rtrim($this->app->path("site:{$mediapath}"), '/'); + } if (file_exists($this->root) && in_array($cmd, get_class_methods($this))){
fallback media/finder path to uploads folder if not set via config and is not admin
agentejo_cockpit
train
php
5db5a6d00a3d689a41093e8f26b860bf461fee84
diff --git a/aws/resource_aws_budgets_budget.go b/aws/resource_aws_budgets_budget.go index <HASH>..<HASH> 100644 --- a/aws/resource_aws_budgets_budget.go +++ b/aws/resource_aws_budgets_budget.go @@ -371,10 +371,10 @@ func resourceAwsBudgetsBudgetNotificationRead(d *schema.ResourceData, meta inter for _, notificationOutput := range describeNotificationsForBudgetOutput.Notifications { setNotificationDefaults(notificationOutput) notification := make(map[string]interface{}) - notification["comparison_operator"] = *notificationOutput.ComparisonOperator - notification["threshold_type"] = *notificationOutput.ThresholdType - notification["threshold"] = *notificationOutput.Threshold - notification["notification_type"] = *notificationOutput.NotificationType + notification["comparison_operator"] = aws.StringValue(notificationOutput.ComparisonOperator) + notification["threshold_type"] = aws.StringValue(notificationOutput.ThresholdType) + notification["threshold"] = aws.Float64Value(notificationOutput.Threshold) + notification["notification_type"] = aws.StringValue(notificationOutput.NotificationType) subscribersOutput, err := conn.DescribeSubscribersForNotification(&budgets.DescribeSubscribersForNotificationInput{ BudgetName: aws.String(budgetName),
r/aws_budgets_budget: Make reading budget notifications safer
terraform-providers_terraform-provider-aws
train
go
414172706b3ce989a3906eee4d4305bcfc601e9f
diff --git a/droneapi/module/api.py b/droneapi/module/api.py index <HASH>..<HASH> 100644 --- a/droneapi/module/api.py +++ b/droneapi/module/api.py @@ -386,11 +386,11 @@ class APIModule(mp_module.MPModule): def fix_targets(self, message): """Set correct target IDs for our vehicle""" - status = self.mpstate.status + settings = self.mpstate.settings if hasattr(message, 'target_system'): - message.target_system = status.target_system + message.target_system = settings.target_system if hasattr(message, 'target_component'): - message.target_component = status.target_component + message.target_component = settings.target_component def __on_change(self, *args): for a in args:
Fixed the error "AttributeError: 'MPStatus' object has no attribute 'target_system'" when trying to send a mavlink message.
dronekit_dronekit-python
train
py
37570de30e71d34e6db94c39d2726b7383765ecb
diff --git a/intranet/apps/eighth/notifications.py b/intranet/apps/eighth/notifications.py index <HASH>..<HASH> 100644 --- a/intranet/apps/eighth/notifications.py +++ b/intranet/apps/eighth/notifications.py @@ -59,7 +59,7 @@ def signup_status_email(user, next_blocks): def absence_email(signup): user = signup.user - em = user.tj_email if user.tj_email else user.emails.first() if user.emails and user.emails.count() >= 1 else None + em = user.notification_email if em: emails = [em] else:
refactor(eighth): use user.notification_email for absence emails
tjcsl_ion
train
py
b7bb3e25cd48f8377430151cd37d6b5414f83e8f
diff --git a/frasco/request_params.py b/frasco/request_params.py index <HASH>..<HASH> 100644 --- a/frasco/request_params.py +++ b/frasco/request_params.py @@ -149,8 +149,7 @@ class RequestParam(object): return value.lower() not in ('False', 'false', 'no', '0') return bool(value) return type(value) - except Exception as e: - current_app.log_exception(e) + except: abort(400) def load(self, *values): diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup, find_packages setup( name='frasco', - version='1.0.12', + version='1.0.13', url='http://github.com/digicoop/frasco', license='MIT', author='Maxime Bouroumeau-Fuseau',
Remove exception logging when coercing value in request params
frascoweb_frasco
train
py,py
ff9208054a39c28bbd79cedb533f42c23be5b0a5
diff --git a/js/fcoin.js b/js/fcoin.js index <HASH>..<HASH> 100644 --- a/js/fcoin.js +++ b/js/fcoin.js @@ -209,7 +209,7 @@ module.exports = class fcoin extends Exchange { async fetchOrderBook (symbol = undefined, limit = undefined, params = {}) { await this.loadMarkets (); if (typeof limit !== 'undefined') { - if ((limit === 20) && (limit === 100)) { + if ((limit === 20) || (limit === 100)) { limit = 'L' + limit.toString (); } else { throw new ExchangeError (this.id + ' fetchOrderBook supports limit of 20, 100 or no limit. Other values are not accepted');
fcoin fetchOrderBook limit fix in the source js file
ccxt_ccxt
train
js
9d5a7c7c66a3a2b253cee68200e1f424f8a143cd
diff --git a/website/pages/en/index.js b/website/pages/en/index.js index <HASH>..<HASH> 100755 --- a/website/pages/en/index.js +++ b/website/pages/en/index.js @@ -400,7 +400,7 @@ const UsersSection = ({ language }) => { <img src="/images/npm_grey.svg" style={{ height: "100px" }} /> </a> <div style={{ marginLeft: ".7em", width: "260px" }}> - <p>More than 800 tools and integrations on npm</p> + <p>More than 900 tools and integrations on npm</p> <Button href="https://www.npmjs.com/browse/depended/prettier"> Install Them </Button> @@ -415,7 +415,7 @@ const UsersSection = ({ language }) => { <img src="/images/github_grey.svg" style={{ height: "100px" }} /> </a> <div style={{ marginLeft: ".7em", width: "260px" }}> - <p>More than 100,000 dependent repositories on GitHub</p> + <p>More than 130,000 dependent repositories on GitHub</p> <Button href="https://github.com/prettier/prettier/network/dependents"> Check Them Out </Button>
Edit metrics as seen at NPM/GitHub network (#<I>)
josephfrazier_prettier_d
train
js
615324fc7ce14b3a78024a5be180d7455e213024
diff --git a/Logger/PropelLogger.php b/Logger/PropelLogger.php index <HASH>..<HASH> 100644 --- a/Logger/PropelLogger.php +++ b/Logger/PropelLogger.php @@ -73,7 +73,7 @@ class PropelLogger public function crit($message) { if (null !== $this->logger) { - $this->logger->crit($message); + $this->logger->critical($message); } } @@ -85,7 +85,7 @@ class PropelLogger public function err($message) { if (null !== $this->logger) { - $this->logger->err($message); + $this->logger->error($message); } } @@ -97,7 +97,7 @@ class PropelLogger public function warning($message) { if (null !== $this->logger) { - $this->logger->warn($message); + $this->logger->warning($message); } }
[Monolog] Mark old non-PSR3 methods as deprecated
symfony_propel1-bridge
train
php
1170b28ab9c4c55f2d84e600a6a00dcdd1de6d6c
diff --git a/src/components/Table/head/__test__/header.spec.js b/src/components/Table/head/__test__/header.spec.js index <HASH>..<HASH> 100644 --- a/src/components/Table/head/__test__/header.spec.js +++ b/src/components/Table/head/__test__/header.spec.js @@ -10,7 +10,7 @@ document.addEventListener = jest.fn((event, cb) => { const preventDefault = jest.fn(); describe('<Header />', () => { - it('should set the right class names in th element when sortable, isSelected, and is resizable are passed', () => { + it('should set the right class names in th element when sortable and isSelected are passed and is resizable', () => { const component = mount( <Header sortable
fix: fix some typo (#<I>)
90milesbridge_react-rainbow
train
js
a60522daf8ff8475d670af28f6da3c95bb35773f
diff --git a/salt/minion.py b/salt/minion.py index <HASH>..<HASH> 100644 --- a/salt/minion.py +++ b/salt/minion.py @@ -422,6 +422,7 @@ class MinionBase(object): ' {0}'.format(opts['master'])) if opts['master_shuffle']: shuffle(opts['master']) + opts['auth_tries'] = 0 # if opts['master'] is a str and we have never created opts['master_list'] elif isinstance(opts['master'], str) and ('master_list' not in opts): # We have a string, but a list was what was intended. Convert.
Set auth retry count to 0 if multimaster mode is failover
saltstack_salt
train
py
a9b738f00c856dc939699e0fe1263945cca61b6c
diff --git a/builtin/providers/aws/resource_aws_cloudwatch_log_group.go b/builtin/providers/aws/resource_aws_cloudwatch_log_group.go index <HASH>..<HASH> 100644 --- a/builtin/providers/aws/resource_aws_cloudwatch_log_group.go +++ b/builtin/providers/aws/resource_aws_cloudwatch_log_group.go @@ -117,17 +117,15 @@ func resourceAwsCloudWatchLogGroupUpdate(d *schema.ResourceData, meta interface{ } log.Printf("[DEBUG] Setting retention for CloudWatch Log Group: %q: %s", name, input) _, err = conn.PutRetentionPolicy(&input) - if err != nil { - return err - } } else { log.Printf("[DEBUG] Deleting retention for CloudWatch Log Group: %q", name) _, err = conn.DeleteRetentionPolicy(&cloudwatchlogs.DeleteRetentionPolicyInput{ LogGroupName: aws.String(name), }) - if err != nil { - return err - } + } + + if err != nil { + return err } }
provider/aws: Removal of duplicate error handling code in cloudwatch_log_group cloudwatch_log_group
hashicorp_terraform
train
go
794c3cb99c9719780eadbedcd106476b5281e8cd
diff --git a/chassis/util/validators.py b/chassis/util/validators.py index <HASH>..<HASH> 100644 --- a/chassis/util/validators.py +++ b/chassis/util/validators.py @@ -1,7 +1,7 @@ """Parameter Parsing and Validation for Chassis Applications.""" import re - +import six class ValidationError(Exception): """Raised when validation fails.""" @@ -62,7 +62,7 @@ class Boolean(BaseValidator): message = "Valid boolean required" def validate(self, value): - if isinstance(value, basestring): + if isinstance(value, six.string_types): value = value.lower() if value in self.truthy: @@ -91,7 +91,7 @@ class String(BaseValidator): documentation=documentation) def validate(self, value): - if not isinstance(value, basestring): + if not isinstance(value, six.string_types): self.fail() length = len(value)
Use six to fix 2.x / 3.x compatibility issue
refinery29_chassis
train
py
0d853e22b4ca68d19b2ea71cacec7b581d06b8a5
diff --git a/platform/html5/html.js b/platform/html5/html.js index <HASH>..<HASH> 100644 --- a/platform/html5/html.js +++ b/platform/html5/html.js @@ -233,7 +233,8 @@ ElementPrototype.updateStyle = function() { 'padding-left': 'px', 'padding-top': 'px', 'padding-right': 'px', - 'padding-bottom': 'px' + 'padding-bottom': 'px', + 'padding': 'px' } var cache = this._context._styleCache
paddings added to CSSUnits map
pureqml_qmlcore
train
js
884483d27f7c0fac3975da17a7ef5c470ef9e3b4
diff --git a/fcm_django/apps.py b/fcm_django/apps.py index <HASH>..<HASH> 100644 --- a/fcm_django/apps.py +++ b/fcm_django/apps.py @@ -6,3 +6,4 @@ from fcm_django.settings import FCM_DJANGO_SETTINGS as SETTINGS class FcmDjangoConfig(AppConfig): name = "fcm_django" verbose_name = SETTINGS["APP_VERBOSE_NAME"] + default_auto_field = "django.db.models.BigAutoField"
Use BigAutoField as the default ID
xtrinch_fcm-django
train
py
3016525830de9b33723b73d379d528afb7a6e186
diff --git a/Library/Phalcon/Migrations.php b/Library/Phalcon/Migrations.php index <HASH>..<HASH> 100644 --- a/Library/Phalcon/Migrations.php +++ b/Library/Phalcon/Migrations.php @@ -800,9 +800,7 @@ class " . $className . " extends Migration\n" . $sqlInstructions = explode(';', $rawSql); foreach ($sqlInstructions as $instruction) { if ($instruction !== "" && strpos($instruction, '_pkey" ON') === false) { - if ($rawSql !== '') { - $sql[] = '$this->' . $dbAdapter . '->execute(\'' . $rawSql . '\');'; - } + $sql[] = '$this->' . $dbAdapter . '->execute(\'' . $instruction . '\');'; } } } else {
Create table - Duplicated SQL Create table SQL is duplicated as many times as $sqlInstructions array count. We should add $instruction not $rawSql to $sql array. Also remove unnecessary check " $rawSql !== '' " as we checked (above) that " $instruction !== '' " which is part of $rawSql
SachaMorard_phalcon-console-migration
train
php
d40179f882f00e8c8c992ebc5b0bed937090e90c
diff --git a/eth/backend.go b/eth/backend.go index <HASH>..<HASH> 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -200,10 +200,13 @@ func makeExtraData(extra []byte) []byte { // CreateDB creates the chain database. func CreateDB(ctx *node.ServiceContext, config *Config, name string) (ethdb.Database, error) { db, err := ctx.OpenDatabase(name, config.DatabaseCache, config.DatabaseHandles) + if err != nil { + return nil, err + } if db, ok := db.(*ethdb.LDBDatabase); ok { db.Meter("eth/db/chaindata/") } - return db, err + return db, nil } // CreateConsensusEngine creates the required type of consensus engine instance for an Ethereum service
eth: gracefully error if database cannot be opened
ethereum_go-ethereum
train
go
9beb5f83ed7be1019a2a092ac672ade5d3044a65
diff --git a/moban_handlebars/engine.py b/moban_handlebars/engine.py index <HASH>..<HASH> 100644 --- a/moban_handlebars/engine.py +++ b/moban_handlebars/engine.py @@ -1,6 +1,6 @@ import sys -from moban import utils, file_system +from moban import file_system from pybars import Compiler PY2 = sys.version_info[0] == 2 @@ -16,6 +16,7 @@ class EngineHandlebars(object): self.template_dirs = template_dirs def get_template(self, template_file): + template_file = file_system.to_unicode(template_file) fs = file_system.get_multi_fs(self.template_dirs) actual_file = fs.geturl(template_file, purpose='fs') content = file_system.read_unicode(actual_file)
:green_heart: python file system 2 hates str
moremoban_moban-handlebars
train
py
bf66042eb2aee6d95d5987b1704b52f1260382e6
diff --git a/java/server/src/org/openqa/grid/internal/utils/SelfRegisteringRemote.java b/java/server/src/org/openqa/grid/internal/utils/SelfRegisteringRemote.java index <HASH>..<HASH> 100644 --- a/java/server/src/org/openqa/grid/internal/utils/SelfRegisteringRemote.java +++ b/java/server/src/org/openqa/grid/internal/utils/SelfRegisteringRemote.java @@ -63,7 +63,7 @@ public class SelfRegisteringRemote { try { JsonObject hubParameters = getHubConfiguration(); if (hubParameters.has(RegistrationRequest.TIME_OUT)){ - int timeout = hubParameters.get(RegistrationRequest.TIME_OUT).getAsInt() / 1000; + int timeout = hubParameters.get(RegistrationRequest.TIME_OUT).getAsInt(); nodeConfig.getConfiguration().put(RegistrationRequest.TIME_OUT, timeout); } if (hubParameters.has(RegistrationRequest.BROWSER_TIME_OUT)) {
Grid: Fixing timeout issue again... Why isn't it covered by tests? A rhetorical question...
SeleniumHQ_selenium
train
java
8517cf35ed420770993066fba8ea07fded0f3849
diff --git a/test/bibtex/test_bibliography.rb b/test/bibtex/test_bibliography.rb index <HASH>..<HASH> 100644 --- a/test/bibtex/test_bibliography.rb +++ b/test/bibtex/test_bibliography.rb @@ -288,17 +288,21 @@ module BibTeX @book{b1, title = {FOO}, year = {2013}, - author = {Doe, John}} + author = {Doe, John}, + pages = {1-2}} @book{b2, title = {BAR}, year = {2013}, - author = {Doe, John}} + author = {Doe, John}, + pages = {1-3}, + } END @b = BibTeX.parse <<-END @book{b3, title = {FOO}, year = {2013}, - author = {Doe, Jane}} + author = {Doe, John}, + pages = {1-2}} END end @@ -311,6 +315,11 @@ module BibTeX assert @a.length > @a.uniq!(:author).length end + describe 'with block' do + it 'removes duplicate entries and returns the bibliography' do + assert @a.length > @a.uniq!(:author){|d,e| d+'|'+e.pages_from}.length + end + end end describe 'given a filter' do
Test Bibliography#uniq! with block
inukshuk_bibtex-ruby
train
rb
c3c85b8b15b1a930739fa0c50d4e64514153a204
diff --git a/spec/integration/environment_setup_spec.rb b/spec/integration/environment_setup_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration/environment_setup_spec.rb +++ b/spec/integration/environment_setup_spec.rb @@ -17,6 +17,6 @@ describe 'Setting up environment' do end end - expect(schema[:users]).to be_instance_of(Axiom::Relation::Variable) + expect(schema[:users]).to be_instance_of(Axiom::Relation::Variable::Materialized) end end diff --git a/spec/unit/rom/repository/element_writer_spec.rb b/spec/unit/rom/repository/element_writer_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/rom/repository/element_writer_spec.rb +++ b/spec/unit/rom/repository/element_writer_spec.rb @@ -14,5 +14,5 @@ describe Repository, '#[]=' do it { should eq(relation) } - it { should be_instance_of(Axiom::Relation::Variable) } + it { should be_instance_of(Axiom::Relation::Variable::Materialized) } end
Update tests to pass with latest memory adapter
rom-rb_rom
train
rb,rb