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
d5c6dfd0e07efaca2b5692307d5286465a7199dc
diff --git a/lib/sgf/parser.rb b/lib/sgf/parser.rb index <HASH>..<HASH> 100644 --- a/lib/sgf/parser.rb +++ b/lib/sgf/parser.rb @@ -77,7 +77,7 @@ module SGF def parse_node_data @node_properties = {} while still_inside_node? - identity = parse_identity + identity = read_token IdentityToken.new property_format = property_token_type identity property = read_token property_format @node_properties[identity] = property @@ -92,14 +92,6 @@ module SGF @current_node.add_properties @node_properties end - def parse_identity - identity = "" - while char = @sgf_stream.next_character and char != "[" - identity << char - end - identity.gsub "\n", "" - end - def read_token format property = "" while char = @sgf_stream.next_character and format.still_inside? char, property, @sgf_stream @@ -125,7 +117,7 @@ class IdentityToken end def transform token - token + token.gsub "\n", "" end end
Replaced parse_identity with new Token class.
Trevoke_SGFParser
train
rb
6160c6f6bd59802fa3145a944cac55d962faa3e6
diff --git a/bcbio/bam/trim.py b/bcbio/bam/trim.py index <HASH>..<HASH> 100644 --- a/bcbio/bam/trim.py +++ b/bcbio/bam/trim.py @@ -67,9 +67,6 @@ def trim_read_through(fastq_files, dirs, lane_config): cores = lane_config["algorithm"].get("num_cores", 1) out_files = _cutadapt_trim(fastq_files, quality_format, to_trim, out_files, cores) - # with file_transaction(out_files) as tmp_out_files: - # tmp_out_files = _cutadapt_trim(fastq_files, quality_format, - # to_trim, tmp_out_files, cores) fixed_files = remove_short_reads(out_files, dirs, lane_config) return fixed_files @@ -206,6 +203,8 @@ def _cutadapt_trim(fastq_files, quality_format, adapters, out_files, cores): if all(map(file_exists, out_files)): return out_files with file_transaction(out_files) as tmp_out_files: + if isinstance(tmp_out_files, basestring): + tmp_out_files = [tmp_out_files] map(_run_cutadapt_on_single_file, izip(repeat(base_cmd), fastq_files, tmp_out_files)) return out_files
Fix for trimming single-end reads.
bcbio_bcbio-nextgen
train
py
858b70c680466ec39e76f159c3b85fc3c3ef8e83
diff --git a/lib/connector/Message.js b/lib/connector/Message.js index <HASH>..<HASH> 100644 --- a/lib/connector/Message.js +++ b/lib/connector/Message.js @@ -524,7 +524,7 @@ Object.assign(Message, { LinkedInOAuth: Message.createExternal({ method: 'OAUTH', - path: 'https://www.linkedin.com/uas/oauth2/authorization?response_type=code&access_type=online', + path: 'https://www.linkedin.com/oauth/v2/authorization?response_type=code', query: ['client_id', 'scope', 'state'], status: [200], }, {
[BAQ-<I>] fix(oauth) Change LinkedIn OAuth API endpoint to their new one.
Baqend_js-sdk
train
js
eb279f55024ec44f22e8f4e82b4352cfb22af1b6
diff --git a/src/Http/Controllers/BasicController.php b/src/Http/Controllers/BasicController.php index <HASH>..<HASH> 100644 --- a/src/Http/Controllers/BasicController.php +++ b/src/Http/Controllers/BasicController.php @@ -9,15 +9,13 @@ class BasicController extends RestManagerController public function __construct() { $this->middleware(function ($request, $next) { - try { - $className = app('amethyst')->findManagerByName($request->route('name')); - } catch (\Amethyst\Core\Exceptions\DataNotFoundException $e) { - abort(404); - } + try { + $this->manager = app('amethyst')->newManagerByName($request->route('name')); + } catch (\Amethyst\Core\Exceptions\DataNotFoundException $e) { + abort(404); + } - $this->manager = new $className(); - - return $next($request); - }); + return $next($request); + }); } }
use newManagerByName instead of findManagerByName
railken_amethyst-common
train
php
148ca5bc813a5419df0945998679a88d7aae42d6
diff --git a/bika/lims/content/analysisservice.py b/bika/lims/content/analysisservice.py index <HASH>..<HASH> 100644 --- a/bika/lims/content/analysisservice.py +++ b/bika/lims/content/analysisservice.py @@ -955,6 +955,19 @@ schema = BikaSchema.copy() + Schema(( "Profile and/or Analysis Request"), ), ), + BooleanField( + 'SelfVerification', + schemata="Analysis", + default=False, + widget=BooleanWidget( + label=_("Allow self-verification of results"), + description=_( + "If enabled, the same user who submitted a result " + "for this analysis will be able to verify it. Note " + "only Lab Managers can verify results. Disabled by " + "default. "), + ), + ), StringField('CommercialID', searchable=1, schemata='Description',
Added SelfVerification field in AnalysisService
senaite_senaite.core
train
py
35ff36d37d2069be8b86d001a2e22b082e839b7b
diff --git a/test/example/example.js b/test/example/example.js index <HASH>..<HASH> 100644 --- a/test/example/example.js +++ b/test/example/example.js @@ -4,6 +4,8 @@ var cp = require('child_process'), describe('example', function () { + this.timeout(60000); + it('subscribers should connect, receive then disconnect', function (done) { var count = 0,
Increase example timeout for Travis CI
davedoesdev_mqlobber
train
js
7e4816a9503e938efcc65bebcdef03b3b32e4582
diff --git a/chessboard/benchmark.py b/chessboard/benchmark.py index <HASH>..<HASH> 100644 --- a/chessboard/benchmark.py +++ b/chessboard/benchmark.py @@ -136,7 +136,8 @@ class Benchmark(object): # Gotcha: integers seems to be promoted to float64 because of # reindexation. See: http://pandas.pydata.org/pandas-docs/stable # /gotchas.html#na-type-promotions - self.results.to_csv(self.csv_filepath, index=False) + self.results.reindex(columns=self.column_ids).to_csv( + self.csv_filepath, index=False) def nqueen_graph(self): """ Graph n-queens problem for the current version and context. """
Fix sorting of CSV columns.
kdeldycke_chessboard
train
py
b012d82458d4c7d7b673714be20decad2e744445
diff --git a/lib/ovirt/vm.rb b/lib/ovirt/vm.rb index <HASH>..<HASH> 100644 --- a/lib/ovirt/vm.rb +++ b/lib/ovirt/vm.rb @@ -32,7 +32,7 @@ module OVIRT Nokogiri::XML(builder.to_xml).root.to_s end - def self.to_xml( opts={}) + def self.to_xml(opts={}) builder = Nokogiri::XML::Builder.new do vm{ name_ opts[:name] || "i-#{Time.now.to_i}" @@ -64,7 +64,7 @@ module OVIRT custom_properties { custom_property({ :name => "floppyinject", - :value => "#{OVIRT::FILEINJECT_PATH}:#{opts[:user_data]}", + :value => "#{opts[:fileinject_path] || OVIRT::FILEINJECT_PATH}:#{opts[:user_data]}", :regexp => "^([^:]+):(.*)$"}) } end
Added possibility to change the FILEINJECT_PATH
abenari_rbovirt
train
rb
ff9916addbda763965403e34107bf06378f5b554
diff --git a/lib/serf/util/with_error_handling.rb b/lib/serf/util/with_error_handling.rb index <HASH>..<HASH> 100644 --- a/lib/serf/util/with_error_handling.rb +++ b/lib/serf/util/with_error_handling.rb @@ -1,3 +1,5 @@ +require 'active_support/core_ext/string/inflections' + require 'serf/messages/caught_exception_event' require 'serf/util/null_object' @@ -27,7 +29,7 @@ module Util error_channel = @error_channel || ::Serf::Util::NullObject.new error_event = eec.new( context: context, - error: e.class.to_s, + error: e.class.to_s.tableize, message: e.message, backtrace: e.backtrace.join("\n"))
Tableizes WithErrorHandling's CaughtErrorEvent's error field. Details: * Felt that the tableized version looks more asthetically pleasing and easier to filter '/' than '::'.
byu_serf
train
rb
1f224763f444f586eb6b01f47e279223c818fa7d
diff --git a/src/Symfony/Component/DependencyInjection/Dumper/Preloader.php b/src/Symfony/Component/DependencyInjection/Dumper/Preloader.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/Preloader.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/Preloader.php @@ -85,7 +85,7 @@ class Preloader self::preloadType($p->getType(), $preloaded); } - self::preloadType($p->getReturnType(), $preloaded); + self::preloadType($m->getReturnType(), $preloaded); } } catch (\ReflectionException $e) { // ignore missing classes
[DI] fix typo in Preloader
symfony_symfony
train
php
a2e985fcf4b0ffdd4cb25d3f3223004a87a23832
diff --git a/beets/mediafile.py b/beets/mediafile.py index <HASH>..<HASH> 100644 --- a/beets/mediafile.py +++ b/beets/mediafile.py @@ -1237,6 +1237,9 @@ class MediaFile(object): # Isolate bugs in Mutagen. try: self.mgfile.save(**kwargs) + except (IOError, OSError): + # Propagate these through: they don't represent Mutagen bugs. + raise except Exception as exc: log.debug(traceback.format_exc()) log.error('uncaught Mutagen exception in save: {0}'.format(exc))
don't wrap standard errors during Mutagen save() Original: beetbox/beets@d<I>
beetbox_mediafile
train
py
a804f9ad414a4b1c0c451c4d0ba751fd2396fd52
diff --git a/spec/runner.rb b/spec/runner.rb index <HASH>..<HASH> 100755 --- a/spec/runner.rb +++ b/spec/runner.rb @@ -29,10 +29,10 @@ cap['browserstack.tunnelIdentifier'] = ENV['TRAVIS_JOB_ID'] cap['browserstack.tunnel'] = 'true' cap['browserstack.debug'] = 'false' -cap['databaseEnabled'] = true -cap['browserConnectionEnabled'] = true -cap['locationContextEnabled'] = true -cap['webStorageEnabled'] = true +cap['databaseEnabled'] = 'true' +cap['browserConnectionEnabled'] = 'true' +cap['locationContextEnabled'] = 'true' +cap['webStorageEnabled'] = 'true' print 'Loading...'
spec/runner: use strings for capabilities
opal_opal-browser
train
rb
5f10a38d9b8fed69c120b0dcf3f7dcd3fa4ad2bb
diff --git a/gwpy/frequencyseries/hist.py b/gwpy/frequencyseries/hist.py index <HASH>..<HASH> 100644 --- a/gwpy/frequencyseries/hist.py +++ b/gwpy/frequencyseries/hist.py @@ -332,6 +332,24 @@ class SpectralVariance(Array2D): def plot(self, **kwargs): """Plot this `SpectralVariance` + + All arguments are passed to `~gwpy.plotter.FrequencySeriesPlot` + + Returns + ------- + plot : `~gwpy.plotter.FrequencySeriesPlot` + a new `FrequencySeriesPlot` rendering of this `FrequencySeries` + + See Also + -------- + matplotlib.pyplot.figure + for documentation of keyword arguments used to create the + figure + matplotlib.figure.Figure.add_subplot + for documentation of keyword arguments used to create the + axes + gwpy.plotter.FrequencySeriesAxes.plot_variance + for documentation of keyword arguments used in rendering the data """ from ..plotter import FrequencySeriesPlot return FrequencySeriesPlot(self, **kwargs)
SpectralVariance.hist: improved docstring
gwpy_gwpy
train
py
e8cdf01d6a468c4ca990e0ca7bb7077342e55887
diff --git a/src/main/java/javascalautils/ThrowableFunction1.java b/src/main/java/javascalautils/ThrowableFunction1.java index <HASH>..<HASH> 100644 --- a/src/main/java/javascalautils/ThrowableFunction1.java +++ b/src/main/java/javascalautils/ThrowableFunction1.java @@ -15,14 +15,11 @@ */ package javascalautils; -import javascalautils.concurrent.Future; - -import java.util.function.Function; /** * A function that takes a single argument of type <i>R</i> and returns a value of type <i>T</i>. <br> - * The difference with this interface and {@link Function} is that it allows for raising checked exceptions. <br> - * Primary use case is to create concise lambda expressions such as the {@link Try#map(ThrowableFunction1)} and {@link Future#map(ThrowableFunction1)} where the function could throw an exception. + * The difference with this interface and {@link java.util.function.Function} is that it allows for raising checked exceptions. <br> + * Primary use case is to create concise lambda expressions such as the {@link Try#map(ThrowableFunction1)} and {@link javascalautils.concurrent.Future#map(ThrowableFunction1)} where the function could throw an exception. * * * @author Peter Nerg
#<I> further cleanup of the javadoc in ThrowableFunction1
pnerg_java-scala-util
train
java
f1741843df5036df069731beec8cf7cdb4cf1d33
diff --git a/client/extensions/zoninator/state/data-layer/locks/test/utils.js b/client/extensions/zoninator/state/data-layer/locks/test/utils.js index <HASH>..<HASH> 100644 --- a/client/extensions/zoninator/state/data-layer/locks/test/utils.js +++ b/client/extensions/zoninator/state/data-layer/locks/test/utils.js @@ -21,8 +21,8 @@ describe( 'utils', () => { const lock = fromApi( response ); expect( lock ).to.have.keys( [ 'expires', 'maxLockPeriod' ] ); - expect( lock.maxLockPeriod ).to.deep.equal( 600000 ), - expect( lock.expires ).to.be.within( now + 30000, now + 31000 ); + expect( lock.maxLockPeriod ).to.deep.equal( 600000 ); + expect( lock.expires ).to.be.within( now + 30000, now + 31000 ); } ); } ); } );
Fix code formatting in zone locks data-layer tests
Automattic_wp-calypso
train
js
6fc00ce567fd93e61b1b03a75c3c11b9d76821ac
diff --git a/pymatgen/ext/matproj.py b/pymatgen/ext/matproj.py index <HASH>..<HASH> 100644 --- a/pymatgen/ext/matproj.py +++ b/pymatgen/ext/matproj.py @@ -75,7 +75,7 @@ class MPRester: their setups and MPRester can then be called without any arguments. endpoint (str): Url of endpoint to access the MaterialsProject REST interface. Defaults to the standard Materials Project REST - address at "https://www.materialsproject.org/rest/v2", but + address at "https://materialsproject.org/rest/v2", but can be changed to other urls implementing a similar interface. """ @@ -106,7 +106,7 @@ class MPRester: self.preamble = endpoint else: self.preamble = SETTINGS.get("PMG_MAPI_ENDPOINT", - "https://www.materialsproject.org/rest/v2") + "https://materialsproject.org/rest/v2") import requests if sys.version_info[0] < 3: try:
Change default MPRester endpoint at request of dwinston materialsproject.org without the www will be the preferred endpoint going forwards
materialsproject_pymatgen
train
py
120064d8a132a66d579509fe97f69fdb0518543a
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/App.java b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/App.java index <HASH>..<HASH> 100644 --- a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/App.java +++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/App.java @@ -37,6 +37,7 @@ public class App { } finally { service.close(); logger.info("Service closed and resources released"); + System.exit(0); } } } \ No newline at end of file
TINKERPOP-<I> Needed to exit(0) for maven executor to kill properly
apache_tinkerpop
train
java
92811f19ec91f120ef55c461f1b68ae11effc188
diff --git a/raiden/api/rest.py b/raiden/api/rest.py index <HASH>..<HASH> 100644 --- a/raiden/api/rest.py +++ b/raiden/api/rest.py @@ -1217,6 +1217,21 @@ class RestAPI: # pragma: no unittest status_code=HTTPStatus.CONFLICT, ) + if total_withdraw is not None and state is not None: + return api_error( + errors="Can not update a channel's total withdraw and state at the same time", + status_code=HTTPStatus.CONFLICT, + ) + + if total_withdraw is not None and total_deposit is not None: + return api_error( + errors=( + "Can not update a channel's total withdraw " + "and total deposit at the same time" + ), + status_code=HTTPStatus.CONFLICT, + ) + if total_deposit is None and state is None and total_withdraw is None: return api_error( errors=( @@ -1225,10 +1240,12 @@ class RestAPI: # pragma: no unittest ), status_code=HTTPStatus.BAD_REQUEST, ) + if total_deposit and total_deposit < 0: return api_error( errors="Amount to deposit must not be negative.", status_code=HTTPStatus.CONFLICT ) + if total_withdraw and total_withdraw < 0: return api_error( errors="Amount to withdraw must not be negative.", status_code=HTTPStatus.CONFLICT
Reject patch channel to withdraw/deposit/state in the same request
raiden-network_raiden
train
py
1159769418771a169498880d23773849dbbc30fa
diff --git a/lib/zk/threaded_callback.rb b/lib/zk/threaded_callback.rb index <HASH>..<HASH> 100644 --- a/lib/zk/threaded_callback.rb +++ b/lib/zk/threaded_callback.rb @@ -133,7 +133,7 @@ module ZK @cond.wait(@mutex) while @array.empty? and @state == :running if @state != :running - logger.warn { "ThreadedCallback, state is #{@state.inspect}, returning" } + logger.debug { "ThreadedCallback, state is #{@state.inspect}, returning" } return end
quiet, threaded_callback
zk-ruby_zk
train
rb
2f7c373d5c15fc0399e52c5d8cced69cc0fcb07b
diff --git a/lib/libBuilder.js b/lib/libBuilder.js index <HASH>..<HASH> 100644 --- a/lib/libBuilder.js +++ b/lib/libBuilder.js @@ -44,7 +44,7 @@ builder.validate = function ( options ) // --- // Check for inputs or paths // --- - var inputs = options.inputs; + var inputs = options.inputs || []; var namespaces = options.namespaces; if (0 === inputs.length && !namespaces) { cHelpers.log.error('src'.red + ' or ' + 'namespaces'.red +
fixed bug where task broke if no inputs are defined
thanpolas_grunt-closure-tools
train
js
ca3a5ad4af32adb7efdbe991026a8da6f68008db
diff --git a/test/commands/thread_test.rb b/test/commands/thread_test.rb index <HASH>..<HASH> 100644 --- a/test/commands/thread_test.rb +++ b/test/commands/thread_test.rb @@ -82,9 +82,9 @@ module Byebug debug_code(program) check_output_includes( - /(\+)?\d+ #<Thread:0x\h+(@.+:\d+)? (sleep|sleep_forever|run)>/, - /(\+)?\d+ #<Thread:0x\h+(@.+:\d+)? (sleep|sleep_forever|run)>/, - /(\+)?\d+ #<Thread:0x\h+(@.+:\d+)? (sleep|sleep_forever|run)>/ + /(\+)?\d+ #<Thread:0x\h+(.+:\d+)? (sleep|sleep_forever|run)>/, + /(\+)?\d+ #<Thread:0x\h+(.+:\d+)? (sleep|sleep_forever|run)>/, + /(\+)?\d+ #<Thread:0x\h+(.+:\d+)? (sleep|sleep_forever|run)>/ ) end
Fix test_thread_list_shows_all_available_threads on ruby <I>rc2 (#<I>) Format of `Thread#to_s` was changed by <URL>
deivid-rodriguez_byebug
train
rb
74ff83bb3c8b465e7d5289f67ab3a768950825e6
diff --git a/src/admin/class-papi-admin-taxonomy.php b/src/admin/class-papi-admin-taxonomy.php index <HASH>..<HASH> 100644 --- a/src/admin/class-papi-admin-taxonomy.php +++ b/src/admin/class-papi-admin-taxonomy.php @@ -31,6 +31,7 @@ final class Papi_Admin_Taxonomy { $taxonomy_types = array_filter( $this->taxonomy_types, function ( $taxonomy_type ) use( $taxonomy ) { return in_array( $taxonomy, $taxonomy_type->taxonomy ) && $taxonomy_type->display( $taxonomy ); } ); + $taxonomy_types = array_values( $taxonomy_types ); // Do not display empty select if no taxonomy types. if ( empty( $taxonomy_types ) ) {
Fix positions error for taxonomy types array
wp-papi_papi
train
php
8a61c3c15bbadb3e73e5bb91522150355489e46b
diff --git a/languagetool-language-modules/fr/src/main/java/org/languagetool/rules/fr/QuestionWhitespaceStrictRule.java b/languagetool-language-modules/fr/src/main/java/org/languagetool/rules/fr/QuestionWhitespaceStrictRule.java index <HASH>..<HASH> 100644 --- a/languagetool-language-modules/fr/src/main/java/org/languagetool/rules/fr/QuestionWhitespaceStrictRule.java +++ b/languagetool-language-modules/fr/src/main/java/org/languagetool/rules/fr/QuestionWhitespaceStrictRule.java @@ -39,7 +39,7 @@ public class QuestionWhitespaceStrictRule extends QuestionWhitespaceRule { public QuestionWhitespaceStrictRule(ResourceBundle messages, Language language) { super(messages, language); setTags(Arrays.asList(Tag.picky)); - super.setDefaultOff(); + this.setDefaultOff(); } @Override
[fr] FRENCH_WHITESPACE_STRICT off by default
languagetool-org_languagetool
train
java
84e74dfde3316687cb0567e41d01c6ee89e91e34
diff --git a/graphwalker-java/src/main/java/org/graphwalker/java/source/CodeGenerator.java b/graphwalker-java/src/main/java/org/graphwalker/java/source/CodeGenerator.java index <HASH>..<HASH> 100644 --- a/graphwalker-java/src/main/java/org/graphwalker/java/source/CodeGenerator.java +++ b/graphwalker-java/src/main/java/org/graphwalker/java/source/CodeGenerator.java @@ -75,13 +75,15 @@ public final class CodeGenerator extends VoidVisitorAdapter<ChangeContext> { try { ContextFactory factory = ContextFactoryScanner.get(file); List<Context> contexts = factory.create(file); + logger.info("Source generated from: " + file.toString() + " -> "); for (Context context : contexts) { SourceFile sourceFile = new SourceFile(context.getModel().getName(), file, input, output); write(context, sourceFile); cache.add(file, new CacheEntry(file.toFile().lastModified(), true)); + logger.info(" " + sourceFile.getOutputPath()); } } catch (Throwable t) { - logger.error(t.getMessage()); + logger.info(t.getMessage()); cache.add(file, new CacheEntry(file.toFile().lastModified(), false)); } }
Issue #<I> Use INFO instead of ERROR when parsing model files
GraphWalker_graphwalker-project
train
java
2dc71a5f6b3689c72d69163eaf8d7d5cb8f27dd2
diff --git a/src/Illuminate/Database/Eloquent/Relations/Concerns/AsPivot.php b/src/Illuminate/Database/Eloquent/Relations/Concerns/AsPivot.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Database/Eloquent/Relations/Concerns/AsPivot.php +++ b/src/Illuminate/Database/Eloquent/Relations/Concerns/AsPivot.php @@ -121,6 +121,8 @@ trait AsPivot $this->touchOwners(); return tap($this->getDeleteQuery()->delete(), function () { + $this->exists = false; + $this->fireModelEvent('deleted', false); }); }
[7.x] $this->exists is not updated after pivot delete (#<I>) * Update AsPivot.php $this->exists = false is not set, if no primary key is defined * Update AsPivot.php * Update AsPivot.php
laravel_framework
train
php
1911fe145970dafda196198836433ad9847e1067
diff --git a/lib/grit/git-ruby.rb b/lib/grit/git-ruby.rb index <HASH>..<HASH> 100644 --- a/lib/grit/git-ruby.rb +++ b/lib/grit/git-ruby.rb @@ -39,7 +39,7 @@ module Grit end # git diff --full-index 'ec037431382e83c3e95d4f2b3d145afbac8ea55d' 'f1ec1aea10986159456846b8a05615b87828d6c6' - def diff(options, sha1, sha2) + def diff(options, sha1, sha2 = nil) try_run { ruby_git.diff(sha1, sha2, options) } end
allow diff to only take one sha
mojombo_grit
train
rb
286ffd11fc2e2942f166d6ff53f1077fa14cbb2f
diff --git a/salt/modules/dockerng.py b/salt/modules/dockerng.py index <HASH>..<HASH> 100644 --- a/salt/modules/dockerng.py +++ b/salt/modules/dockerng.py @@ -5694,7 +5694,7 @@ def sls(name, mods=None, saltenv='base', **kwargs): grains = __salt__['dockerng.call'](name, function='grains.items') # compile pillar with container grains - pillar = _gather_pillar(saltenv, {}, grains) + pillar = _gather_pillar(saltenv, {}, **grains) trans_tar = _prepare_trans_tar(mods=mods, saltenv=saltenv, pillar=pillar) ret = None
pylint: E<I>(too-many-function-args)
saltstack_salt
train
py
6adbbbd5df1c068a1edee2bb13b0b1eafef77b46
diff --git a/Nameless/Core/Kernel.php b/Nameless/Core/Kernel.php index <HASH>..<HASH> 100644 --- a/Nameless/Core/Kernel.php +++ b/Nameless/Core/Kernel.php @@ -227,7 +227,6 @@ class Kernel extends HttpKernel ExceptionHandler::register($this->container['templates_error_path'], $this->container['templates_extension'], $this->container['environment'], 'UTF-8', $this->container['logger.logger']); } - //TODO: boot -> initializeModules public function boot() { if (!$this->booted)
Deleted: todo out of date
corpsee_nameless-source
train
php
68ba1ee204869e0d7a1554a8b467c8714bb3c874
diff --git a/driver/src/main/com/mongodb/client/gridfs/GridFSBucketImpl.java b/driver/src/main/com/mongodb/client/gridfs/GridFSBucketImpl.java index <HASH>..<HASH> 100644 --- a/driver/src/main/com/mongodb/client/gridfs/GridFSBucketImpl.java +++ b/driver/src/main/com/mongodb/client/gridfs/GridFSBucketImpl.java @@ -133,9 +133,8 @@ final class GridFSBucketImpl implements GridFSBucket { @Override public GridFSUploadStream openUploadStream(final String filename, final GridFSUploadOptions options) { int chunkSize = options.getChunkSizeBytes() == null ? chunkSizeBytes : options.getChunkSizeBytes(); - Document metadata = options.getMetadata() == null ? null : options.getMetadata(); checkCreateIndex(); - return new GridFSUploadStreamImpl(filesCollection, chunksCollection, new ObjectId(), filename, chunkSize, metadata); + return new GridFSUploadStreamImpl(filesCollection, chunksCollection, new ObjectId(), filename, chunkSize, options.getMetadata()); } @Override
GridFS no need to assign metadata to a variable
mongodb_mongo-java-driver
train
java
0469efec162a705b3c5f64f0b756dddf7c037db2
diff --git a/environs/jujutest/livetests.go b/environs/jujutest/livetests.go index <HASH>..<HASH> 100644 --- a/environs/jujutest/livetests.go +++ b/environs/jujutest/livetests.go @@ -288,7 +288,7 @@ func (w *toolsWaiter) NextTools(c *C) *state.Tools { } tools, err := w.AgentTools() c.Assert(err, IsNil) - changed := w.lastTools == nil || *tools == *w.lastTools + changed := w.lastTools == nil || *tools != *w.lastTools w.lastTools = tools if changed { return tools
environs/jujutest: fix
juju_juju
train
go
36c8679695e82e159616650b562712e8c322f91e
diff --git a/addict/addict.py b/addict/addict.py index <HASH>..<HASH> 100644 --- a/addict/addict.py +++ b/addict/addict.py @@ -41,11 +41,11 @@ class Dict(dict): elif isinstance(arg, dict): for key, val in arg.items(): self[key] = val - elif isinstance(arg, list) or isgenerator(arg): + elif isinstance(arg, tuple) and (not isinstance(arg[0], tuple)): + self[arg[0]] = arg[1] + elif isinstance(arg, (list, tuple)) or isgenerator(arg): for key, val in arg: self[key] = val - elif isinstance(arg, tuple): - self[arg[0]] = arg[1] else: raise TypeError("Dict does not understand " "{0} types".format(type(arg)))
init with tuple change Dict's initializing with tuple to dict initializing style
mewwts_addict
train
py
0eb43e4af445cb0595ecd3c8d315541e5d6b6425
diff --git a/eventsourcing/domain.py b/eventsourcing/domain.py index <HASH>..<HASH> 100644 --- a/eventsourcing/domain.py +++ b/eventsourcing/domain.py @@ -191,7 +191,9 @@ class BaseAggregate(metaclass=MetaAggregate): kwargs["id"] = kwargs.pop("originator_id") kwargs["version"] = kwargs.pop("originator_version") - aggregate = cast(TAggregate, object.__new__(aggregate_class)) + # Call __new__ and __init__ (avoid calling class + # because might trigger event if @aggregate in use). + aggregate: TAggregate = aggregate_class.__new__(aggregate_class, **kwargs) aggregate.__init__(**kwargs) # type: ignore return aggregate
Changed Created.mutate() to call aggregate_cls.__new__.
johnbywater_eventsourcing
train
py
b45db539d297f57b4d8bb39de0554fc25064a7fc
diff --git a/timeside/server/models.py b/timeside/server/models.py index <HASH>..<HASH> 100644 --- a/timeside/server/models.py +++ b/timeside/server/models.py @@ -240,8 +240,8 @@ class Item(Titled, UUID, Dated, Shareable): path = self.source_url elif self.source_file: path = self.source_file.path - mime_type = get_mime_type(path) - self.mime_type_setter(mime_type=mime_type) + if os.path.exists(path): + self.mime_type = get_mime_type(path) super(Item, self).save() def get_single_selection(self):
fix Item.mime_type with no file
Parisson_TimeSide
train
py
6b1de2ef030ccdcbb55202b74e11e4f6d1290a5f
diff --git a/tests/Unit/Suites/HttpsUrlTest.php b/tests/Unit/Suites/HttpsUrlTest.php index <HASH>..<HASH> 100644 --- a/tests/Unit/Suites/HttpsUrlTest.php +++ b/tests/Unit/Suites/HttpsUrlTest.php @@ -4,6 +4,7 @@ namespace Brera\PoC\Http; /** * @covers \Brera\PoC\Http\HttpsUrl + * @covers \Brera\PoC\Http\HttpUrl * @uses \Brera\PoC\Http\HttpUrl */ class HttpsUrlTest extends \PHPUnit_Framework_TestCase
Issue #1: Add add second coverage line to HttpsUrl test
lizards-and-pumpkins_catalog
train
php
8c88f26b7a996ebccb20d26b0ffb1a873ea1e8c4
diff --git a/tests/external-tests.js b/tests/external-tests.js index <HASH>..<HASH> 100755 --- a/tests/external-tests.js +++ b/tests/external-tests.js @@ -31,8 +31,8 @@ var repositories = [ 'test/index.html' ], expected_results: { - tests: 534, - passed: 534, + tests: 133, + passed: 130, failed: 0 } },
Testing: update QUnit expected results from assertions to tests.
browserstack_browserstack-runner
train
js
6feeaa8db8786a529dcabb3191c1c6370061639e
diff --git a/django_productline/settings.py b/django_productline/settings.py index <HASH>..<HASH> 100644 --- a/django_productline/settings.py +++ b/django_productline/settings.py @@ -84,10 +84,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', - # Uncomment the next line to enable the admin: - # 'django.contrib.admin', - # Uncomment the next line to enable admin documentation: - # 'django.contrib.admindocs', + 'overextends', ] # A sample logging configuration. The only tangible logging diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -33,5 +33,8 @@ setup( 'Intended Audience :: Developers', 'Operating System :: OS Independent' ], - install_requires=['decorator'] + install_requires=[ + 'decorator', + 'django-overextends', + ] )
added django-overextends to base feature
henzk_django-productline
train
py,py
361d5b0927c641acc9741b9fb7aaa2191dbb132b
diff --git a/K2fov/K2onSilicon.py b/K2fov/K2onSilicon.py index <HASH>..<HASH> 100644 --- a/K2fov/K2onSilicon.py +++ b/K2fov/K2onSilicon.py @@ -107,8 +107,8 @@ def nearSiliconCheck(ra_deg,dec_deg,FovObj,max_sep=8.2): def getRaDecRollFromFieldnum(fieldnum): - if fieldnum not in [0,1,2,3,4]: - raise ValueError('Only Fields 0-4 are defined in this version of the code') + if fieldnum not in [0,1,2,3,4,5]: + raise ValueError('Only Fields 0-5 are defined in this version of the code') elif fieldnum == 0: #ra_deg = 98.15766666666666 #dec_deg = 21.594944444444444 @@ -129,10 +129,13 @@ def getRaDecRollFromFieldnum(fieldnum): dec_deg = -11.096663792 scRoll_deg = -153.494818181 elif fieldnum == 4: - print('Warning, Field 4 position will change') - ra_deg = 56.496 + ra_deg = 59.0759116 + dec_deg = 18.6605794 + scRoll_deg = -167.6992793 + elif fieldnum == 5: + ra_deg = 130.1576478 dec_deg = 18.130472222222224 - scRoll_deg = 177.4810830 + scRoll_deg = 166.0591297 else: raise NotImplementedError
added Campaigns 4 and 5 fov
KeplerGO_K2fov
train
py
bc286c8aad1325bff6f28b21a886dc5f162ca374
diff --git a/AcceleratorCacheClearer.php b/AcceleratorCacheClearer.php index <HASH>..<HASH> 100644 --- a/AcceleratorCacheClearer.php +++ b/AcceleratorCacheClearer.php @@ -60,6 +60,15 @@ class AcceleratorCacheClearer return 'APC User Cache: success.'; } + if (function_exists('xcache_clear_cache')) { + $cnt = xcache_count(XC_TYPE_VAR); + for ($i=0; $i < $cnt; $i++) { + xcache_clear_cache(XC_TYPE_VAR, $i); + } + + return 'XCache User Cache: success.'; + } + if (function_exists('wincache_ucache_clear') && wincache_ucache_clear()) { return 'Wincache User Cache: success.'; } @@ -80,6 +89,15 @@ class AcceleratorCacheClearer return 'APC Opcode Cache: success.'; } + if (function_exists('xcache_clear_cache')) { + $cnt = xcache_count(XC_TYPE_PHP); + for ($i=0; $i < $cnt; $i++) { + xcache_clear_cache(XC_TYPE_PHP, $i); + } + + return 'XCache Opcode Cache: success.'; + } + throw new \RuntimeException('Opcode Cache: failure.'); } }
Added support for XCache.
Smart-Core_AcceleratorCacheBundle
train
php
ff478c8386fa2eb8452b6855d8141b2800101be2
diff --git a/Field.js b/Field.js index <HASH>..<HASH> 100644 --- a/Field.js +++ b/Field.js @@ -1,5 +1,5 @@ var configureField = require('./utils/configureField.js') -module.exports = function (formData, fieldData) { - return configureField(formData, fieldData) +module.exports = function (fieldData) { + return configureField({}, fieldData) }
fix: Field should not be initialized with formData
cerebral-legacy_cerebral-module-forms
train
js
dd90d5e7febc8be64b761edb3132a3944f0eb000
diff --git a/lib/escobar/client.rb b/lib/escobar/client.rb index <HASH>..<HASH> 100644 --- a/lib/escobar/client.rb +++ b/lib/escobar/client.rb @@ -7,9 +7,15 @@ module Escobar def self.from_response(err, response) error = new("Error from Heroku API") - error.body = response.body - error.status = response.status - error.headers = response.headers + if response.respond_to?(:body) + error.body = response.body + end + if response.respond_to?(:status) + error.status = response.status + end + if response.respond_to?(:headers) + error.headers = response.headers + end error.set_backtrace(err.backtrace) error
Ensure the response in errors has the methods.
atmos_escobar
train
rb
449c97df2907f141b5ff8ff865131d2054e5a02f
diff --git a/mbus/https_dispatcher_test.go b/mbus/https_dispatcher_test.go index <HASH>..<HASH> 100644 --- a/mbus/https_dispatcher_test.go +++ b/mbus/https_dispatcher_test.go @@ -101,19 +101,15 @@ var _ = Describe("HTTPSDispatcher", func() { } }() - Eventually(func() int { + Eventually(func() *http.Response { client := getHTTPClient() response, _ := client.Get(targetURL + "/example") - if err != nil { - return 0 - } - return response.StatusCode - }, 5*time.Second).Should(BeNumerically("==", 404)) + return response + }, 5*time.Second).ShouldNot(BeNil()) }) AfterEach(func() { dispatcher.Stop() - time.Sleep(1 * time.Second) }) It("calls the handler function for the route", func() {
Fix flaky test - There was a nil pointer dereference on response when request to dispatcher failed. The panic caused the AfterEach to run and led to a data race. <URL>
cloudfoundry_bosh-agent
train
go
c93b3ddabe07cd930d32c5c94a55b3451ffc9b21
diff --git a/Test/Asserters/Response.php b/Test/Asserters/Response.php index <HASH>..<HASH> 100644 --- a/Test/Asserters/Response.php +++ b/Test/Asserters/Response.php @@ -138,12 +138,12 @@ class Response extends asserters\object return $this; } - public function hasText($text) + public function contains($text, $failMessage = null) { if (false !== strpos($this->getValue()->getContent(), $text)) { $this->pass(); } else { - $this->fail("text : '".$text. "' wasn't found in the response"); + $this->fail($failMessage !== null ? $failMessage : sprintf($this->getLocale()->_("text : '%s' wasn't found in the response"), $text)); } } }
fail message using the std method. renaming the method too
atoum_AtoumBundle
train
php
53181558eed26e3ab6a1765bbcc9310f17975e93
diff --git a/.storybook/Flash.js b/.storybook/Flash.js index <HASH>..<HASH> 100644 --- a/.storybook/Flash.js +++ b/.storybook/Flash.js @@ -30,3 +30,20 @@ storiesOf('Flash alerts', module) </div> </div> )) +.add('flash with action button', () => ( + <div className='p-4'> + <div className="flash"> + <button type="submit" className="btn btn-sm primary flash-action">Complete action</button> + Flash message with action here. + </div> + </div> +)) +.add('flash-full', () => ( + <div className='p-4'> + <div className="container-lg"> + <div className="flash flash-full"> + Full width flash message. + </div> + </div> + </div> +))
add flash with action button and flash-full
primer_css
train
js
72d25ebefcd79c356a7a950059985a9005613831
diff --git a/lib/daemon_runner/semaphore.rb b/lib/daemon_runner/semaphore.rb index <HASH>..<HASH> 100644 --- a/lib/daemon_runner/semaphore.rb +++ b/lib/daemon_runner/semaphore.rb @@ -19,17 +19,19 @@ module DaemonRunner semaphore = Semaphore.new(options) semaphore.lock if block_given? - lock_thr = semaphore.renew - yield + begin + lock_thr = semaphore.renew + yield + ensure + lock_thr.kill + semaphore.release + end end semaphore rescue Exception => e logger.error e logger.debug e.backtrace.join("\n") raise - ensure - lock_thr.kill unless lock_thr.nil? - semaphore.release end end
Only release the semaphore if a block's provided.
rapid7_daemon_runner
train
rb
1327ea985e30952c6a0170a061434f6367d2ba3b
diff --git a/app/Console/Commands/DemoSeederCommand.php b/app/Console/Commands/DemoSeederCommand.php index <HASH>..<HASH> 100644 --- a/app/Console/Commands/DemoSeederCommand.php +++ b/app/Console/Commands/DemoSeederCommand.php @@ -222,6 +222,7 @@ EINCIDENT; ]; Incident::truncate(); + IncidentUpdate::truncate(); foreach ($defaultIncidents as $defaultIncident) { $incident = Incident::create($defaultIncident);
Truncate incident updates before seeding
CachetHQ_Cachet
train
php
37a2ee1586c2f85239f6c612c5013e983bd6f866
diff --git a/simplefs/simplefs.go b/simplefs/simplefs.go index <HASH>..<HASH> 100644 --- a/simplefs/simplefs.go +++ b/simplefs/simplefs.go @@ -672,7 +672,7 @@ func (k *SimpleFS) doCopyFromSource( defer src.Close() dst, err := dstFS.OpenFile( - finalDstElem, os.O_RDWR|os.O_CREATE|os.O_TRUNC, srcFI.Mode()) + finalDstElem, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600) if err != nil { return err }
use <I> rather than original mode for copied files (#<I>)
keybase_client
train
go
45f3934d87780b6161dbf0de92f47b42de5f8864
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( long_description_content_type="text/markdown", keywords=["Redis", "key-value store", "database"], license="MIT", - version="4.1.1", + version="4.1.2", packages=find_packages( include=[ "redis",
<I> (#<I>)
andymccurdy_redis-py
train
py
d008101822b7d388c27af2e7e804b63fc0068614
diff --git a/lib/schema/schema.rb b/lib/schema/schema.rb index <HASH>..<HASH> 100644 --- a/lib/schema/schema.rb +++ b/lib/schema/schema.rb @@ -158,22 +158,17 @@ module Schema alias :to_h :attributes ## TODO Implement in terms of Compare, Scott Mon Jul 6 2020 -## attribute_names, rather than attributes - def ==(other, attributes=nil, ignore_class: nil) - attributes ||= self.class.attribute_names - attributes = Array(attributes) - -## Why is class ignored by default -## It's not a terribly accurate form of equality -## Maybe the == operator should not have been overwritten? -## There's no way to do object equality with schemas otherwise + def ==(other, attributes_names=nil, ignore_class: nil) + attributes_names ||= self.class.attribute_names + attributes_names = Array(attributes_names) + ignore_class = false if ignore_class.nil? if !ignore_class return false if self.class != other.class end - attributes.each do |attribute| + attributes_names.each do |attribute| if attribute.is_a? Hash this_attribute, other_attribute = attribute.keys.first, attribute.values.first else
attribute_names, rather than attributes
eventide-project_schema
train
rb
3117bbbe79476bc72c3e3a1f1b2940fcb3dadf61
diff --git a/tests/primer/primer_tool.py b/tests/primer/primer_tool.py index <HASH>..<HASH> 100644 --- a/tests/primer/primer_tool.py +++ b/tests/primer/primer_tool.py @@ -292,8 +292,6 @@ class Primer: # TODO: Find a way to allow cyclic-import and compare output correctly disables = ["--disable=duplicate-code,cyclic-import"] arguments = data.pylint_args + enables + disables - if data.pylintrc_relpath: - arguments += [f"--rcfile={data.pylintrc_relpath}"] output = StringIO() reporter = JSONReporter(output) Run(arguments, reporter=reporter, exit=False)
don't duplicate --rcfile arg
PyCQA_pylint
train
py
321f55126e1fc2e21218afa4e33633c9f48f1f43
diff --git a/lib/flor/core/executor.rb b/lib/flor/core/executor.rb index <HASH>..<HASH> 100644 --- a/lib/flor/core/executor.rb +++ b/lib/flor/core/executor.rb @@ -453,7 +453,7 @@ end ms = [] ms += @unit.notify(self, message) # pre - ms += self.send(message['point'], message) + ms += send(message['point'], message) message['payload'] = message.delete('pld') if message.has_key?('pld') message['consumed'] = Flor.tstamp @@ -483,11 +483,6 @@ end [] end - def entered(message); []; end - def left(message); []; end - - def ceased(message); []; end - def terminated(message) message['vars'] = @execution['nodes']['0']['vars'] @@ -523,6 +518,13 @@ end end def signal(message); []; end + def entered(message); []; end + def left(message); []; end + def ceased(message); []; end + # + # Return an empty array of new messages. No direct effect. + # + # Some trap, hook, and/or waiter might lie in wait though. def lookup_on_error_parent(message)
Add note about Executor #ceased, #entered, ... Add a note about the emtpy core Executor #ceased, #entered, #left, #signal implementations
floraison_flor
train
rb
0528f3365d1fed01adde6d344dcea7fd1ef69aa7
diff --git a/riak/transports/feature_detect.py b/riak/transports/feature_detect.py index <HASH>..<HASH> 100644 --- a/riak/transports/feature_detect.py +++ b/riak/transports/feature_detect.py @@ -24,7 +24,8 @@ versions = { 1: LooseVersion("1.0.0"), 1.1: LooseVersion("1.1.0"), 1.2: LooseVersion("1.2.0"), - 1.4: LooseVersion("1.4.0") + 1.4: LooseVersion("1.4.0"), + 2.0: LooseVersion("2.0.0") } @@ -71,7 +72,7 @@ class FeatureDetection(object): :rtype: bool """ - return self.server_version >= versions[1.4] + return self.server_version >= versions[2.0] def pb_search(self): """
Add version <I> and detect for yz admin
basho_riak-python-client
train
py
f5fbfafd68afe6e1c5a0b07e5df0973dca53820d
diff --git a/gremlin-core/src/main/java/com/tinkerpop/gremlin/structure/io/graphml/GraphMLWriter.java b/gremlin-core/src/main/java/com/tinkerpop/gremlin/structure/io/graphml/GraphMLWriter.java index <HASH>..<HASH> 100644 --- a/gremlin-core/src/main/java/com/tinkerpop/gremlin/structure/io/graphml/GraphMLWriter.java +++ b/gremlin-core/src/main/java/com/tinkerpop/gremlin/structure/io/graphml/GraphMLWriter.java @@ -340,10 +340,7 @@ public class GraphMLWriter implements GraphWriter { * @param g The Graph instance to write out. */ public Builder(final Graph g) { - if (null == g) - throw new IllegalArgumentException("Graph argument cannot be null"); - - this.g = g; + this.g = Optional.ofNullable(g).orElseThrow(() -> new IllegalArgumentException("Graph argument cannot be null")); } /**
Throw exception if Graph is empty.
apache_tinkerpop
train
java
fdc7327a0c788b41bd2266f2e638421d65dd4528
diff --git a/nonebot/natural_language.py b/nonebot/natural_language.py index <HASH>..<HASH> 100644 --- a/nonebot/natural_language.py +++ b/nonebot/natural_language.py @@ -115,7 +115,7 @@ async def handle_natural_language(bot: NoneBot, ctx: Context_T) -> bool: else: nicknames = filter(lambda n: n, bot.config.NICKNAME) nickname_regex = '|'.join(nicknames) - m = re.search(rf'^({nickname_regex})([\s,,]|$)', msg, re.IGNORECASE) + m = re.search(rf'^({nickname_regex})([\s,,]*|$)', msg, re.IGNORECASE) if m: nickname = m.group(1) logger.debug(f'User is calling me {nickname}')
Allow no space nor comma between nickname and message body
richardchien_nonebot
train
py
f7aeb60b658545fb36f0c8e3871a3a4dbe122a99
diff --git a/lib/BaseWasmMainTemplatePlugin.js b/lib/BaseWasmMainTemplatePlugin.js index <HASH>..<HASH> 100644 --- a/lib/BaseWasmMainTemplatePlugin.js +++ b/lib/BaseWasmMainTemplatePlugin.js @@ -86,8 +86,7 @@ class BaseWasmMainTemplatePlugin { } applyNode(mainTemplate) { - const generateLoadBinaryCode = path => ` - new Promise(function (resolve, reject) { + const generateLoadBinaryCode = path => `new Promise(function (resolve, reject) { var {readFile} = require("fs"); var {join} = require("path"); @@ -178,7 +177,7 @@ class BaseWasmMainTemplatePlugin { Template.indent([ `var importObject = importObjects[wasmModuleId]`, `var req = ${generateLoadBinaryCode(wasmModuleSrcPath)}`, - "if(typeof WebAssembly.instantiateStreaming !== 'function') {", + "if(typeof WebAssembly.instantiateStreaming === 'function') {", Template.indent([ "promises.push(WebAssembly.instantiateStreaming(req, importObject)", ".then(function(res) {",
fix(wasm): incorrect instantiateStreaming support check
webpack_webpack
train
js
6f53f1fa6185677f53ad6d2bc89d07e901b4dd4b
diff --git a/src/Transformers/Adminarea/TenantTransformer.php b/src/Transformers/Adminarea/TenantTransformer.php index <HASH>..<HASH> 100644 --- a/src/Transformers/Adminarea/TenantTransformer.php +++ b/src/Transformers/Adminarea/TenantTransformer.php @@ -22,6 +22,7 @@ class TenantTransformer extends TransformerAbstract return $this->escape([ 'id' => (string) $tenant->getRouteKey(), + 'DT_RowId' => 'row_'.$tenant->getRouteKey(), 'name' => (string) $tenant->name, 'email' => (string) $tenant->email, 'phone' => (string) $tenant->phone,
Add DT_RowId field to datatables
rinvex_cortex-tenants
train
php
627045d127f9e40460e19a7c6cc52d38933a2331
diff --git a/tests/test_helpers.py b/tests/test_helpers.py index <HASH>..<HASH> 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -476,7 +476,7 @@ def test_ceil_call_later_no_timeout(): @asyncio.coroutine def test_ceil_timeout(loop): - with helpers.CeilTimeout(0, loop=loop) as timeout: + with helpers.CeilTimeout(None, loop=loop) as timeout: assert timeout._timeout is None assert timeout._cancel_handler is None
Fix tests according to changes in async-timeout==<I>
aio-libs_aiohttp
train
py
827d5e9c329623edd406e330670f2121bf3e9384
diff --git a/version/version.go b/version/version.go index <HASH>..<HASH> 100644 --- a/version/version.go +++ b/version/version.go @@ -125,11 +125,8 @@ func (version *VersionIdentifier) MatchesMinorVersion( } //------------------------------------------------------------------------------ -// Version number for DOCKER/build.sh - -// NOTE [ben]: deprecate public const version string -const TENDERMINT_VERSION = "0.5.0" +// Version number for tests/build_tool.sh // IMPORTANT: Eris-DB version must be on the last line of this file for -// the deployment script DOCKER/build.sh to pick up the right label. -const VERSION = "0.12.0-rc2" +// the deployment script tests/build_tool.sh to pick up the right label. +const VERSION = "0.12.0-rc3" \ No newline at end of file
version: correct develop to <I>-rc3; deprecate TENDERMINT_VERSION
hyperledger_burrow
train
go
46975c8c7892b492681894120fa10466ec253629
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,16 @@ var transformTools = require( 'browserify-transform-tools' ); var path = require( 'path' ); -var options = {}; +var options = { + excludeExtensions: [ + '.json' + ], + includeExtensions: [ + '.jsx', + '.js', + '.es6' + ] +}; var expand = require( 'glob-expand' ); module.exports = transformTools.makeFalafelTransform( 'require-arr', options, function ( node, transformOptions, done ) {
ENH: Limit the extensions over which transform is applied
royriojas_require-arr
train
js
2101a2177dc8aca2950f1ec936af6fd1b08d98ff
diff --git a/src/TicketitServiceProvider.php b/src/TicketitServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/TicketitServiceProvider.php +++ b/src/TicketitServiceProvider.php @@ -95,7 +95,7 @@ class TicketitServiceProvider extends ServiceProvider { $this->publishes([__DIR__ . '/Public' => public_path('vendor/ticketit')], 'public'); // Check public assets are present, publish them if not - $installer->publicAssets(); +// $installer->publicAssets(); $main_route = Setting::grab('main_route'); $admin_route = Setting::grab('admin_route'); diff --git a/src/Views/admin/index.blade.php b/src/Views/admin/index.blade.php index <HASH>..<HASH> 100644 --- a/src/Views/admin/index.blade.php +++ b/src/Views/admin/index.blade.php @@ -152,7 +152,7 @@ </div> @stop @section('footer') - @include('ticketit::shared.footer') + {{--@include('ticketit::shared.footer')--}} <script type="text/javascript" src="https://www.google.com/jsapi?autoload={ 'modules':[{
Public assets distribution (CSS file)
thekordy_ticketit
train
php,php
404d901fde7ea6a80068a3c227eb6d44277b1ca5
diff --git a/Response.php b/Response.php index <HASH>..<HASH> 100644 --- a/Response.php +++ b/Response.php @@ -27,7 +27,7 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://github.com/seagoj/Devtools/Response.php **/ -class Response implements IService, \Serializable +class Response implements IService// , \Serializable { public $status; public $request;
no longer implement from Serializable
seagoj_devtools
train
php
939b407e16001dc6d1a2b986cdc7f2a7939ef873
diff --git a/build_tools/aws-sdk-code-generator/lib/aws-sdk-code-generator/views/client_api_module.rb b/build_tools/aws-sdk-code-generator/lib/aws-sdk-code-generator/views/client_api_module.rb index <HASH>..<HASH> 100644 --- a/build_tools/aws-sdk-code-generator/lib/aws-sdk-code-generator/views/client_api_module.rb +++ b/build_tools/aws-sdk-code-generator/lib/aws-sdk-code-generator/views/client_api_module.rb @@ -60,7 +60,8 @@ module AwsSdkCodeGenerator 'max' => false, 'wrapper' => false, 'xmlOrder' => false, - 'retryable' => false + 'retryable' => false, + 'union' => false } METADATA_KEYS = {
Add union trait to ignore list to fix builds.
aws_aws-sdk-ruby
train
rb
39f8b4d397c116daee5559c77cd170add4ec35a6
diff --git a/js/load-image-scale.js b/js/load-image-scale.js index <HASH>..<HASH> 100644 --- a/js/load-image-scale.js +++ b/js/load-image-scale.js @@ -235,8 +235,12 @@ pixelRatio = options.pixelRatio if ( pixelRatio > 1 && - // Check if image has not yet device pixel ratio applied: - parseFloat(img.style.width, 10) !== width / pixelRatio + // Check if the image has not yet had the device pixel ratio applied: + !( + img.style.width && + Math.floor(parseFloat(img.style.width, 10)) === + Math.floor(width / pixelRatio) + ) ) { destWidth *= pixelRatio destHeight *= pixelRatio
Account for rounding errors in pixel ratio style.
blueimp_JavaScript-Load-Image
train
js
641800cd2d5eb597c241745f0aa0c74204200ab7
diff --git a/packages/shipit-deploy/src/tasks/deploy/update.js b/packages/shipit-deploy/src/tasks/deploy/update.js index <HASH>..<HASH> 100644 --- a/packages/shipit-deploy/src/tasks/deploy/update.js +++ b/packages/shipit-deploy/src/tasks/deploy/update.js @@ -1,5 +1,6 @@ import utils from 'shipit-utils' import path from 'path2/posix' +import p from 'path'; import moment from 'moment' import chalk from 'chalk' import util from 'util' @@ -62,10 +63,7 @@ const updateTask = shipit => { rsync: '--del', } const rsyncFrom = shipit.config.rsyncFrom || shipit.workspace - const uploadDirPath = path.resolve( - rsyncFrom, - shipit.config.dirToCopy || '', - ) + const uploadDirPath = p.resolve(rsyncFrom, shipit.config.dirToCopy || ''); shipit.log('Copy project to remote servers.')
fix: enable Git Bash shells on Windows to successfully deploy (#<I>)
shipitjs_shipit
train
js
96a96838db554ba8658f9540899ff1054afeab33
diff --git a/Entity/User.php b/Entity/User.php index <HASH>..<HASH> 100644 --- a/Entity/User.php +++ b/Entity/User.php @@ -97,4 +97,17 @@ class User extends BaseUser $this->organizations[] = $organization; } + + /** + * Get default Organization + * + * @author Tom Haskins-Vaughan <tom@harvestcloud.com> + * @since 2014-10-23 + * + * @return Organization + */ + public function getDefaultOrganization() + { + return $this->getOrganizations()->first(); + } }
Added User::getDefaultOrganization()
phospr_CoreBundle
train
php
63bea16b603fc506e685cb5f1356e1a04833488e
diff --git a/tweepy/api.py b/tweepy/api.py index <HASH>..<HASH> 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -1382,10 +1382,11 @@ class API(object): fp = f # image must be gif, jpeg, or png - file_type = mimetypes.guess_type(filename) + file_type, _ = mimetypes.guess_type(filename) + if file_type is None: raise TweepError('Could not determine file type') - file_type = file_type[0] + if file_type not in IMAGE_MIMETYPES: raise TweepError('Invalid file type for image: %s' % file_type) @@ -1442,10 +1443,11 @@ class API(object): raise TweepError('File input for APPEND is mandatory.') # video must be mp4 - file_type = mimetypes.guess_type(filename) + file_type, _ = mimetypes.guess_type(filename) + if file_type is None: raise TweepError('Could not determine file type') - file_type = file_type[0] + if file_type not in ['video/mp4']: raise TweepError('Invalid file type for video: %s' % file_type)
fix file type sanity check in upload
tweepy_tweepy
train
py
37f0fe06db1c508bb91f322e619b74c56e6fb484
diff --git a/test/index.js b/test/index.js index <HASH>..<HASH> 100644 --- a/test/index.js +++ b/test/index.js @@ -1,3 +1,10 @@ import from 'es5-shim'; + +describe('Process environment for tests', function () { + it('Should be development for React console warnings', function () { + assert.equal(process.env.NODE_ENV, 'development'); + }); +}); + const testsContext = require.context('.', true, /Spec$/); testsContext.keys().forEach(testsContext); diff --git a/webpack/webpack.config.js b/webpack/webpack.config.js index <HASH>..<HASH> 100644 --- a/webpack/webpack.config.js +++ b/webpack/webpack.config.js @@ -17,7 +17,8 @@ const defaultOptions = { export default (options) => { options = _.merge({}, defaultOptions, options); - const environment = options.development ? 'development' : 'production'; + const environment = options.test || options.development ? + 'development' : 'production'; const config = { entry: {
[fix] Enable `development` mode for tests. Test is included. When mode is `production` webpack strips out code for development mode. React `console warnings` also are removed in `production`. In that case tests don't `see` any console warnings from React. Consequently code like this (in tests) console.warn.called.should.be.false; is useless.
react-bootstrap_react-bootstrap
train
js,js
7f8a050e96abfb5b2d0b75f1cd03933eae62a2d3
diff --git a/lib/pseudohiki/treestack.rb b/lib/pseudohiki/treestack.rb index <HASH>..<HASH> 100644 --- a/lib/pseudohiki/treestack.rb +++ b/lib/pseudohiki/treestack.rb @@ -11,8 +11,8 @@ class TreeStack module TreeElement attr_accessor :depth - def accept(visitor) - visitor.visit(self) + def accept(visitor, memo=nil) + visitor.visit(self, memo) end end @@ -107,7 +107,7 @@ class TreeStack removed_node end - def accept(visitor) - visitor.visit(tree) + def accept(visitor, memo=nil) + visitor.visit(tree, memo) end end
add memo as the second argument of TreeStack#accept()
nico-hn_PseudoHikiParser
train
rb
4764fc555502237fc7f423af4200520a975a69fd
diff --git a/sources/scalac/transformer/matching/PatternMatcher.java b/sources/scalac/transformer/matching/PatternMatcher.java index <HASH>..<HASH> 100644 --- a/sources/scalac/transformer/matching/PatternMatcher.java +++ b/sources/scalac/transformer/matching/PatternMatcher.java @@ -325,9 +325,11 @@ public class PatternMatcher extends PatternTool { case Ident(Name name): // pattern without args or variable if (tree.symbol() == defs.PATTERN_WILDCARD) return mk.DefaultPat(tree.pos, header.type); - else if (tree.symbol().isPrimaryConstructor()) - return mk.ConstrPat(tree.pos, tree.type); - else if (name.isVariable()) { + else if (tree.symbol().isPrimaryConstructor()) { + assert false; // this may not happen ?? ----------------- Burak + return mk.ConstrPat(tree.pos, tree.type); + } else if (name.isVariable()) {// should be Bind ------------ Burak + assert false; if (env != null) env.newBoundVar( tree.symbol(), @@ -359,7 +361,7 @@ public class PatternMatcher extends PatternTool { return res; default: new scalac.ast.printer.TextTreePrinter().print(tree).flush(); - throw new ApplicationError(tree); + throw new ApplicationError("unit "+unit+" tree"+tree); } }
Typed patterns x:T and variable patterns x are ... Typed patterns x:T and variable patterns x are desugarized to x@ _ : T resp x @ _. thus some cases here become unnecessary
scala_scala
train
java
4a243db412cfbbd8a0ba8d13fd22f44a6a7b3cf6
diff --git a/dimod/sampleset.py b/dimod/sampleset.py index <HASH>..<HASH> 100644 --- a/dimod/sampleset.py +++ b/dimod/sampleset.py @@ -174,8 +174,7 @@ class SampleSet(Iterable, Sized): >>> import dimod >>> import numpy as np ... - >>> dimod.SampleSet.from_samples(dimod.as_samples(np.ones(5, dtype='int8')), - ... 'BINARY', 0) # doctest: +SKIP + >>> dimod.SampleSet.from_samples(np.ones(5, dtype='int8'), 'BINARY', 0) # doctest: +SKIP SampleSet(rec.array([([1, 1, 1, 1, 1], 0, 1)], ... dtype=[('sample', 'i1', (5,)), ('energy', '<i4'), ('num_occurrences', '<i4')]), ... [0, 1, 2, 3, 4], {}, 'BINARY')
Simplify example in SampleSet docstring
dwavesystems_dimod
train
py
24aec61b77e9cea9d7529d1ba3ed59319a2d4fe5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -173,16 +173,18 @@ class BuildSupport(object): ) git_version = git_version.strip() m_rel = re.match("^\d+(?:\.\d+){2,3}$", git_version) - m_dev = re.match("(\d+(?:\.\d+){2,3})-(\d+)-g[0-9a-f]+", git_version) + m_dev = re.match("(\d+(?:\.\d+){2,3})(?:-(\d+)-g[0-9a-f]+)?(?:-dirty)?", git_version) if m_rel: # release build -> return as is return git_version if m_dev: # development build - return "%s.dev%s" % (m_dev.group(1), m_dev.group(2)) + return "%s.dev%s" % (m_dev.group(1), m_dev.group(2) or 0) + + warning("failed to parse git version '%s'", git_version) raise OSError - except (OSError, subprocess.CalledProcessError): - warning("GIT not found or invalid tag found.") + except (OSError, subprocess.CalledProcessError) as e: + warning("git not found or invalid tag found.") warning("-> Building version from date!") now = datetime.datetime.now() midnight = datetime.datetime(now.year, now.month, now.day)
Fix git describe parsing if we are on a tagged commit but the working dir is dirty git describe --tags --dirty outputs something like <I>-dirty which now results in a pypylon version <I>.dev0
basler_pypylon
train
py
8206e40ef1e4a50b50cae7978efcecc9083fa4e1
diff --git a/lib/ydim/debitor.rb b/lib/ydim/debitor.rb index <HASH>..<HASH> 100644 --- a/lib/ydim/debitor.rb +++ b/lib/ydim/debitor.rb @@ -36,6 +36,7 @@ module YDIM lns.push(@contact_title) lns.concat(@address_lines) lns.push(@location, @email) + lns.push @country lns.compact! lns end
Include Country in Debitor#address
zdavatz_ydim
train
rb
bc207bd9f6f3bd0f5c0ca85ff73621d8baf0c02b
diff --git a/lib/rufus/sc/jobs.rb b/lib/rufus/sc/jobs.rb index <HASH>..<HASH> 100644 --- a/lib/rufus/sc/jobs.rb +++ b/lib/rufus/sc/jobs.rb @@ -135,7 +135,9 @@ module Scheduler # (Only jobs know about this method of the scheduler) job_thread = Thread.current - job_thread['rufus_scheduler__trigger_thread'] = true + job_thread[ + "rufus_scheduler__trigger_thread__#{@scheduler.object_id}" + ] = true @last_job_thread = job_thread begin diff --git a/lib/rufus/sc/scheduler.rb b/lib/rufus/sc/scheduler.rb index <HASH>..<HASH> 100644 --- a/lib/rufus/sc/scheduler.rb +++ b/lib/rufus/sc/scheduler.rb @@ -246,7 +246,9 @@ module Rufus::Scheduler # def trigger_threads - Thread.list.select { |t| t['rufus_scheduler__trigger_thread'] == true } + Thread.list.select { |t| + t["rufus_scheduler__trigger_thread__#{self.object_id}"] == true + } end protected
Scheduler#trigger_threads, specific to scheduler Scheduler#trigger_threads will now only return the threads for that scheduler (2 schedulers in the same ruby runtime ? OK)
jmettraux_rufus-scheduler
train
rb,rb
cf063489750c55b9e3c277881c2aed48fdd23565
diff --git a/payu/experiment.py b/payu/experiment.py index <HASH>..<HASH> 100644 --- a/payu/experiment.py +++ b/payu/experiment.py @@ -367,12 +367,13 @@ class Experiment(object): # Confirm that no output path already exists if os.path.exists(self.output_path): sys.exit('payu: error: Output path already exists: ' - '{path}.'.format(self.output_path)) + '{path}.'.format(path=self.output_path)) # Confirm that no work path already exists if os.path.exists(self.work_path): - sys.exit('payu: error: work path already exists: ' - '{path}'.format(self.work_path)) + sys.exit('payu: error: work path already exists: {path}.\n' + ' payu sweep and then payu run'\ + .format(path=self.work_path)) mkdir_p(self.work_path)
Fixed typo in check for existing work path added in previous commit
payu-org_payu
train
py
29b101f3859cb464f6d8fad19cf19e5d5293a710
diff --git a/library/PHPIMS/Client/Response.php b/library/PHPIMS/Client/Response.php index <HASH>..<HASH> 100644 --- a/library/PHPIMS/Client/Response.php +++ b/library/PHPIMS/Client/Response.php @@ -182,4 +182,22 @@ class PHPIMS_Client_Response { return $response; } + + /** + * Return the body as an array + * + * @return array + */ + public function asArray() { + return json_decode($this->getBody(), true); + } + + /** + * Return the body as an object + * + * @return stdClass + */ + public function asObject() { + return json_decode($this->getBody()); + } } \ No newline at end of file
Added methods to return the body as an array or as an instance of stdClass
imbo_imboclient-php
train
php
d6d3aecb60d2507493a1189fdd03a4d4d11aba33
diff --git a/src/sap.ui.core/src/sap/ui/base/ManagedObject.js b/src/sap.ui.core/src/sap/ui/base/ManagedObject.js index <HASH>..<HASH> 100644 --- a/src/sap.ui.core/src/sap/ui/base/ManagedObject.js +++ b/src/sap.ui.core/src/sap/ui/base/ManagedObject.js @@ -4184,7 +4184,7 @@ sap.ui.define([ ManagedObject.prototype.findAggregatedObjects = function(bRecursive, fnCondition) { var aAggregatedObjects = []; - if (fnCondition && !typeof fnCondition === "function") { + if (fnCondition && typeof fnCondition !== "function") { fnCondition = null; } function fFindObjects(oObject) {
[INTERNAL][FIX] sap.ui.base.ManagedObject: typeof check was always false Change-Id: I<I>b<I>c8d<I>a2ff<I>a2afe<I>bdd
SAP_openui5
train
js
d1bdf48ad43f23c95e883fbeff57278588da44e6
diff --git a/src/models/hook.js b/src/models/hook.js index <HASH>..<HASH> 100644 --- a/src/models/hook.js +++ b/src/models/hook.js @@ -57,15 +57,8 @@ const Hook = DataConnected.extend({ const newDataSource = this.getClosestModel(obj.data || this.data); const conceptProps = newDataSource.getConceptprops(newValue.concept); - if (newValue.which === "_default") { - obj.use = "constant"; - } else { - if (newValue.use) obj.use = newValue.use; - } - - if (conceptProps.scales) { - obj.scaleType = conceptProps.scales[0]; - } + if (newValue.use) obj.use = newValue.use; + if (conceptProps.scales) obj.scaleType = conceptProps.scales[0]; if (this.getType() === "axis" || this.getType() === "size") { obj.domainMin = null;
Simplify hook.setWhich
vizabi_vizabi
train
js
ced1eab7b2bf0d6f122b8308b95d86e125ea1214
diff --git a/pkg/util/ratelimiter/ratelimiter.go b/pkg/util/ratelimiter/ratelimiter.go index <HASH>..<HASH> 100644 --- a/pkg/util/ratelimiter/ratelimiter.go +++ b/pkg/util/ratelimiter/ratelimiter.go @@ -54,6 +54,8 @@ func (rlf *RateLimitedFunction) pop() { } // Invoke adds a request if its not already present and returns immediately +// unless the rate limited function is actually running, in which case it will +// block until the current run completes func (rlf *RateLimitedFunction) Invoke(resource interface{}) { rlf.queue.AddIfNotPresent(resource) }
Clean up a misleading comment in the ratelimiter code (take 2) The ratelimiter Invoke() function had a comment that implied the Invoke() would block until the function called was run. This clearly does not match the behavior of the function. Instead, Invoke() queues the request and the background thread will pick it up when the ratelimiter next allows it and handle the function. BUT if the background process is running, the Invoke() will be blocked until it completes. I tested the behavior and the test code and results are at <URL>
openshift_origin
train
go
a68ade784bc76a03bc25d70bccae50eff1ecd7f3
diff --git a/mapchete/config_utils.py b/mapchete/config_utils.py index <HASH>..<HASH> 100644 --- a/mapchete/config_utils.py +++ b/mapchete/config_utils.py @@ -59,6 +59,9 @@ class MapcheteConfig(): self.input_files = self._get_input_files() self.process_bounds = self._get_process_bounds(bounds) self.output_name = self._raw_config["output_name"] + # TODO add checks & proper dtype + self.output_bands = self._raw_config["output_bands"] + self.output_dtype = self._raw_config["output_dtype"] # Validate configuration for zoom in self.zoom_levels: try: diff --git a/mapchete/mapchete.py b/mapchete/mapchete.py index <HASH>..<HASH> 100644 --- a/mapchete/mapchete.py +++ b/mapchete/mapchete.py @@ -45,6 +45,10 @@ class Mapchete(object): base_tile_pyramid, self.config.metatiling ) + self.tile_pyramid.format.profile.update( + count=self.config.output_bands, + dtype=self.config.output_dtype + ) self.format = self.tile_pyramid.format except: raise
adding output bands and output type to mapchete config
ungarj_mapchete
train
py,py
0e45eea4c3aac9b8cbcbac9fc443cc46cf718589
diff --git a/datadog_checks_dev/datadog_checks/dev/plugin/tox.py b/datadog_checks_dev/datadog_checks/dev/plugin/tox.py index <HASH>..<HASH> 100644 --- a/datadog_checks_dev/datadog_checks/dev/plugin/tox.py +++ b/datadog_checks_dev/datadog_checks/dev/plugin/tox.py @@ -20,6 +20,8 @@ FIX_DEFAULT_ENVDIR_FLAG = 'ensure_default_envdir' # We pin deps in order to make CI more stable/reliable. ISORT_DEP = 'isort==5.8.0' BLACK_DEP = 'black==20.8b1' +# Until this is fixed https://bitbucket.org/mrabarnett/mrab-regex/issues/421/2021827-results-in-fatal-python-error +REGEX_DEP = 'regex==2021.8.21' FLAKE8_DEP = 'flake8==3.9.1' FLAKE8_BUGBEAR_DEP = 'flake8-bugbear==21.4.3' FLAKE8_LOGGING_FORMAT_DEP = 'flake8-logging-format==0.6.0' @@ -127,6 +129,7 @@ def add_style_checker(config, sections, make_envconfig, reader): FLAKE8_BUGBEAR_DEP, FLAKE8_LOGGING_FORMAT_DEP, BLACK_DEP, + REGEX_DEP, ISORT_DEP, PYDANTIC_DEP, ]
Pin regex (#<I>)
DataDog_integrations-core
train
py
525bee5a0752dda4beec46a172ae2db05fbb0b9e
diff --git a/addons/knobs/src/components/__tests__/RadioButtons.js b/addons/knobs/src/components/__tests__/RadioButtons.js index <HASH>..<HASH> 100644 --- a/addons/knobs/src/components/__tests__/RadioButtons.js +++ b/addons/knobs/src/components/__tests__/RadioButtons.js @@ -16,7 +16,7 @@ describe('RadioButtons', () => { }; }); - describe('displays value', () => { + describe('displays value of button input', () => { it('correctly renders labels', () => { const wrapper = shallow(<RadioButtonType knob={knob} />);
fixing more errors and cleaning up code.
storybooks_storybook
train
js
0912b9214872383c167e61b77011a74db18d07f5
diff --git a/random-browser.js b/random-browser.js index <HASH>..<HASH> 100644 --- a/random-browser.js +++ b/random-browser.js @@ -1,4 +1,4 @@ -var crypto = window.crypto || window.msCrypto +var crypto = self.crypto || self.msCrypto module.exports = function (bytes) { return crypto.getRandomValues(new Uint8Array(bytes))
fix: use self when referencing the global scope (#<I>)
ai_nanoid
train
js
3b570c469cf2f1896ebb0b3ed3724bd378a766d3
diff --git a/src/main/java/tachyon/client/FileOutStream.java b/src/main/java/tachyon/client/FileOutStream.java index <HASH>..<HASH> 100644 --- a/src/main/java/tachyon/client/FileOutStream.java +++ b/src/main/java/tachyon/client/FileOutStream.java @@ -97,8 +97,8 @@ public class FileOutStream extends OutStream { } // TODO Cache the exception here. mCurrentBlockOutStream.write(b); - mCurrentBlockLeftByte--; - mWrittenBytes++; + mCurrentBlockLeftByte --; + mWrittenBytes ++; } catch (IOException ioe) { if (WRITE_TYPE.isMustCache()) { LOG.error(ioe.getMessage());
Reformat lines according to code conventions
Alluxio_alluxio
train
java
01df01024313fa262066ecede6bc04fb89affd7c
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -256,7 +256,7 @@ var FirefoxDriver = { default: 'firefox', darwin: '/Applications/Firefox.app/Contents/MacOS/firefox-bin', win32: process.env.ProgramFiles + '\\Mozilla Firefox\\firefox.exe' - win64: process.env.ProgramFiles + ' (x86)\\Mozilla Firefox\\firefox.exe' + win64: process.env["ProgramFiles(x86)"] + '\\Mozilla Firefox\\firefox.exe' }, /**
Changed from hardcoded "(x<I>)" string to using the proper process.env entry for the path.
dalekjs_dalek-browser-firefox
train
js
0c84dcb569c0d8d65aec117a1d336e0e732a82ed
diff --git a/pyontutils/utils.py b/pyontutils/utils.py index <HASH>..<HASH> 100644 --- a/pyontutils/utils.py +++ b/pyontutils/utils.py @@ -54,8 +54,13 @@ def utcnowtz(): return datetime.now(tz=timezone.utc) def isoformat(datetime_instance, timespec='auto'): + kwargs = {} + if isinstance(datetime_instance, datetime): + # don't pass timespec if type is not date not datetime + kwargs['timespec'] = timespec + return (datetime_instance - .isoformat(timespec=timespec) + .isoformat(**kwargs) .replace('.', ',') .replace('+00:00', 'Z'))
utils.isoformat updated to handle dates in addition to datetimes sigh non-homogenous argspecs
tgbugs_pyontutils
train
py
1ce90d255a5b1afc32773a245d1b4e5f8938b584
diff --git a/client/state/purchases/reducer.js b/client/state/purchases/reducer.js index <HASH>..<HASH> 100644 --- a/client/state/purchases/reducer.js +++ b/client/state/purchases/reducer.js @@ -61,20 +61,9 @@ function overwriteExistingPurchases( existingPurchases, newPurchases ) { * @return {array} An array of purchases */ function removeMissingPurchasesByPredicate( existingPurchases, newPurchases, predicate ) { - return existingPurchases.filter( purchase => { - if ( matches( predicate )( purchase ) && find( newPurchases, { ID: purchase.ID } ) ) { - // this purchase is present in the new array - return true; - } - - if ( ! matches( predicate )( purchase ) ) { - // only overwrite remove purchases that match the predicate - return true; - } - - // the purchase doesn't match the predicate or is missing from the array of new purchases - return false; - } ); + return existingPurchases.filter( + purchase => ! matches( predicate )( purchase ) || find( newPurchases, { ID: purchase.ID } ) + ); } function updatePurchases( existingPurchases, action ) {
Simplify the reducer helper function `removeMissingPurchasesByPredicate` (#<I>)
Automattic_wp-calypso
train
js
9e3db5df0c618288db5c303ed793530e66527632
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,7 @@ +require 'coveralls' +Coveralls.wear! + require 'rspec' require 'webmock/rspec' require 'random_yiff' -require 'coveralls' -Coveralls.wear!
Corrected order for coveralls in spec_helper
JamesAwesome_random_yiff
train
rb
bd97141255407a421bd6cfccdde5e8cb7df28c30
diff --git a/Demo_Tabbed_Form.py b/Demo_Tabbed_Form.py index <HASH>..<HASH> 100644 --- a/Demo_Tabbed_Form.py +++ b/Demo_Tabbed_Form.py @@ -76,8 +76,8 @@ layout_tab_2.append([sg.InputText(size=(100,1), default_text='gruen -sara -quarz layout_tab_2.append([sg.Text('_' * 100, size=(75, 1))]) layout_tab_2.append([sg.ReadButton('Submit', button_color=('red', 'yellow')), sg.Cancel(button_color=('white', 'blue'))]) -results = sg.ShowTabbedForm('eBay Super Searcher', (form,layout_tab_1,'Where To Save'), (form2, layout_tab_2, 'Categories & Search String')) +results = sg.ShowTabbedForm('eBay Super Searcher', (form2, layout_tab_1,'Where To Save'), (form2, layout_tab_2, 'Categories & Search String')) -sg.Popup('Results', results) \ No newline at end of file +sg.Popup('Results', results)
Form2 call fix Corrected the 'ShowTabbedForm() argument which was referencing a 'form' variable which should be 'form2' as it's the declared Window variable for this script.
PySimpleGUI_PySimpleGUI
train
py
17638f4e75758ca9fe5472bcbfb791c5957b0a0d
diff --git a/tests/various.js b/tests/various.js index <HASH>..<HASH> 100644 --- a/tests/various.js +++ b/tests/various.js @@ -70,3 +70,31 @@ test('large message', function (assert) { client.write(largeMsg) client.end() }) + +// choppa seems to slow this one immensely +test('very large message (slow)', function (assert) { + assert.plan(1) + var t = transport() + + var client = peer(t.a, true) + var server = peer(t.b, false) + + var body = [] + server.on('data', function (ch) { + body.push(ch) + }) + + var largeMsg = Buffer.alloc(512000, 'hello world') + + server.on('end', function () { + assert.same(Buffer.concat(body), largeMsg, 'Should be same string') + assert.end() + }) + + client.write(largeMsg.slice(0, 256000)) + + process.nextTick(function () { + client.write(largeMsg.slice(256000)) + client.end() + }) +})
Add very large test (covers other branches)
emilbayes_noise-peer
train
js
74f569769425063a657811e808ce4a799c164604
diff --git a/src/core/util.js b/src/core/util.js index <HASH>..<HASH> 100644 --- a/src/core/util.js +++ b/src/core/util.js @@ -10,7 +10,9 @@ define(function(require) { '[object Date]': 1, '[object Error]': 1, '[object CanvasGradient]': 1, - '[object CanvasPattern]': 1 + '[object CanvasPattern]': 1, + // In node-canvas Image can be Canvas.Image + '[object Image]': 1 }; var objToString = Object.prototype.toString;
Builtin object consider Canvas.Image of node-canvas
ecomfe_zrender
train
js
eb97440f06d6de8a99dddbdfc4aa4e3f5945e959
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -10,6 +10,28 @@ from os.path import splitext from distutils.core import Extension +import distutils.sysconfig + + +distutils.sysconfig.get_config_vars() + + +def install_headers(): + dest_dir = path.join(sys.prefix, 'include', 'murmurhash') + if not path.exists(dest_dir): + shutil.copytree('murmurhash/headers/murmurhash', dest_dir) + +def rm_cflag(text): + cflags = distutils.sysconfig._config_vars['CFLAGS'] + cflags = cflags.replace(text, '') + distutils.sysconfig._config_vars['CFLAGS'] = cflags + +install_headers() +includes = ['.', path.join(sys.prefix, 'include')] + +rm_cflag('-fno-strict-aliasing') +rm_cflag('-Wstrict-prototypes') +rm_cflag('-NDEBUG') def clean(ext):
* Try removing some compiler flags
explosion_preshed
train
py
e30c9bf5d565f61f19b07ef58fece78b41c77040
diff --git a/Model/Behavior/UploadBehavior.php b/Model/Behavior/UploadBehavior.php index <HASH>..<HASH> 100644 --- a/Model/Behavior/UploadBehavior.php +++ b/Model/Behavior/UploadBehavior.php @@ -1740,7 +1740,7 @@ class UploadBehavior extends ModelBehavior { )); $file = $socket->get($uri, array(), array('redirect' => true)); $headers = $socket->response['header']; - $fileName = basename($socket->request['uri']['path']); + $fileName = urldecode(basename($socket->request['uri']['path'])); $tmpFile = sys_get_temp_dir() . '/' . $fileName; if ($socket->response['status']['code'] != 200) {
Update UploadBehavior.php This prevents saving file names url encoded (eg. The%<I>Attachment.txt i.o. The Attachment.txt)
FriendsOfCake_cakephp-upload
train
php
7ec9a955d7e8e516a8b397fcd8afd1a598eb1042
diff --git a/test/letter-sidc.js b/test/letter-sidc.js index <HASH>..<HASH> 100644 --- a/test/letter-sidc.js +++ b/test/letter-sidc.js @@ -1,6 +1,7 @@ export default function(ms, name, sidc) { let result = {}; for (let i = 0; i < sidc.mainIcon.length; i++) { + if (sidc.mainIcon[i].remarks == "N/A") continue; let icon = sidc.mainIcon[i].codingscheme + "F" +
Do not try to render symbol not available
spatialillusions_milsymbol
train
js
88383d09984037f9feface90ed97eef17535b51d
diff --git a/core/toolbox.js b/core/toolbox.js index <HASH>..<HASH> 100644 --- a/core/toolbox.js +++ b/core/toolbox.js @@ -161,7 +161,8 @@ Blockly.Toolbox.prototype.createFlyout_ = function() { RTL: workspace.RTL, oneBasedIndex: workspace.options.oneBasedIndex, horizontalLayout: workspace.horizontalLayout, - toolboxPosition: workspace.options.toolboxPosition + toolboxPosition: workspace.options.toolboxPosition, + stackGlowFilterId: workspace.options.stackGlowFilterId }; if (workspace.horizontalLayout) { diff --git a/core/workspace_svg.js b/core/workspace_svg.js index <HASH>..<HASH> 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -589,7 +589,8 @@ Blockly.WorkspaceSvg.prototype.addFlyout_ = function(tagName) { RTL: this.RTL, oneBasedIndex: this.options.oneBasedIndex, horizontalLayout: this.horizontalLayout, - toolboxPosition: this.options.toolboxPosition + toolboxPosition: this.options.toolboxPosition, + stackGlowFilterId: this.options.stackGlowFilterId }; if (this.horizontalLayout) { this.flyout_ = new Blockly.HorizontalFlyout(workspaceOptions);
Use the main workspaces stack glow filter for both flyout and toolbox This fixes the stack glow filter not existing for both the "simple" and "category" modes of the workspace.
LLK_scratch-blocks
train
js,js
eea28b07cf25d5c79f8edeb8bef5e0483b489425
diff --git a/railties/lib/rails/backtrace_cleaner.rb b/railties/lib/rails/backtrace_cleaner.rb index <HASH>..<HASH> 100644 --- a/railties/lib/rails/backtrace_cleaner.rb +++ b/railties/lib/rails/backtrace_cleaner.rb @@ -12,7 +12,6 @@ module Rails add_filter { |line| line.sub('./', '/') } # for tests add_gem_filters - add_bundler_filters add_silencer { |line| !APP_DIRS.any? { |dir| line =~ /^#{dir}/ } } end @@ -27,16 +26,6 @@ module Rails } end end - - def add_bundler_filters - return unless defined? Bundler - add_filter { |line| - line.sub(%r{vendor/gems/[^/]+/[^/]+/gems/([^/]+)-([0-9.]+)/(.*)}, '\1 (\2) \3') - } - add_filter { |line| - line.sub(%r{vendor/gems/[^/]+/[^/]+/dirs/([^/]+)/(.*)}, '\1 \2') - } - end end # For installing the BacktraceCleaner in the test/unit
Remove backtrace cleaner specific to Bundler. Bundler just uses Gem.dir and Gem.path now.
rails_rails
train
rb
3ead9414041b3bc1314e775bdbed746b4143340b
diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -61,12 +61,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $errorReportingLevel; - const VERSION = '2.2.8'; - const VERSION_ID = '20208'; + const VERSION = '2.2.9-DEV'; + const VERSION_ID = '20209'; const MAJOR_VERSION = '2'; const MINOR_VERSION = '2'; - const RELEASE_VERSION = '8'; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = '9'; + const EXTRA_VERSION = 'DEV'; /** * Constructor.
bumped Symfony version to <I>
symfony_symfony
train
php
2c398c7b39a678fb06a00ad5bc3e15ed7da8b4a5
diff --git a/test/common/torchtext_test_case.py b/test/common/torchtext_test_case.py index <HASH>..<HASH> 100644 --- a/test/common/torchtext_test_case.py +++ b/test/common/torchtext_test_case.py @@ -47,8 +47,8 @@ class TorchtextTestCase(TestCase): if data_format == "json": test_ppid_dataset_file.write(json.dumps(example) + "\n") elif data_format == "csv" or data_format == "tsv": - test_ppid_dataset_file.write("{}{}{}{}{}{}{}\n".format( - example["id"], delim, example["question1"], delim, - example["question2"], delim, example["label"])) + test_ppid_dataset_file.write("{}\n".format( + delim.join([example["id"], example["question1"], + example["question2"], example["label"]]))) else: raise ValueError("Invalid format {}".format(data_format))
Make synthetic dataset construction more pythonic
pytorch_text
train
py
c18145b04a64c945a2090dbb0649c17cb7179d0d
diff --git a/eventhubsprocessor/eh_partition_pump.py b/eventhubsprocessor/eh_partition_pump.py index <HASH>..<HASH> 100644 --- a/eventhubsprocessor/eh_partition_pump.py +++ b/eventhubsprocessor/eh_partition_pump.py @@ -111,9 +111,9 @@ class PartitionReceiver: logging.info("No events received, queue size %d, delivered %d", self.eh_partition_pump.partition_receive_handler.messages.qsize(), self.eh_partition_pump.partition_receive_handler.delivered) - await self.process_error_async(err) - # Handle close - + if self.eh_partition_pump.host.eh_options.release_pump_on_timeout: + await self.process_error_async(err) + async def process_events_async(self, events): """ # This method is called on the thread that the EH client uses to run the pump. diff --git a/eventhubsprocessor/eph.py b/eventhubsprocessor/eph.py index <HASH>..<HASH> 100644 --- a/eventhubsprocessor/eph.py +++ b/eventhubsprocessor/eph.py @@ -49,4 +49,5 @@ class EPHOptions: self.max_batch_size = 10 self.prefetch_count = 300 self.receive_timeout = 60 + self.release_pump_on_timeout = True self.initial_offset_provider = "-1"
added ability to toggle pump shutdown when all messages on a pump are processed.
Azure_azure-event-hubs-python
train
py,py
cc1e60e9bb6a8dc384ccb3814932f4a067f04e3a
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -75,7 +75,7 @@ function getLinuxDistro(cb) { * release file, it is reasonably safe to assume they will have the * distribution name stored in their release file. */ - async.each(candidates, function(candidate, cb) { + async.each(candidates, function(candidate, done) { /** * We only care about the first word. I.E. for Arch Linux it is safe * to simply search for "arch". Also note, we force lower case to @@ -86,8 +86,11 @@ function getLinuxDistro(cb) { os.dist = candidate return customLogic(os,file,function(e,os) { cachedDistro = os - return cb(null,os) + cb(null,os) + return done(); }) + } else { + return done(); } }, function() { cachedDistro = os
renamed cb to done.
retrohacker_getos
train
js
24b5133c1a943abcd6bed5d316fc4fb53e8b9c41
diff --git a/custodian/vasp/handlers.py b/custodian/vasp/handlers.py index <HASH>..<HASH> 100644 --- a/custodian/vasp/handlers.py +++ b/custodian/vasp/handlers.py @@ -457,9 +457,12 @@ class NonConvergingErrorHandler(ErrorHandler, MSONable): @classmethod def from_dict(cls, d): - return cls(output_filename=d["output_filename"], - nionic_steps=d.get("nionic_steps", 10), - change_algo=d.get("change_algo", False)) + if "nionic_steps" in d: + return cls(output_filename=d["output_filename"], + nionic_steps=d.get("nionic_steps", 10), + change_algo=d.get("change_algo", False)) + else: + return cls(output_filename=d["output_filename"]) def backup(outfile="vasp.out"):
Added backward compatibility in NonConvergingHandler
materialsproject_custodian
train
py
7eae9332f18d111633e151344cedef5c15c0b154
diff --git a/tests/ntfy_test/cli.py b/tests/ntfy_test/cli.py index <HASH>..<HASH> 100644 --- a/tests/ntfy_test/cli.py +++ b/tests/ntfy_test/cli.py @@ -62,13 +62,11 @@ class ShellIntegrationTestCase(TestCase): class TestWatchPID(TestCase): - @patch('ntfy.cli.strftime') @patch('psutil.Process') - def test_watch_pid(self, mock_process, mock_strftime): + def test_watch_pid(self, mock_process): mock_process.return_value.pid = 1 mock_process.return_value.create_time.return_value = time() mock_process.return_value.cmdline.return_value = ['cmd'] - mock_strftime.return_value = 'now' args = MagicMock() args.pid = 1 self.assertEqual('PID[1]: "cmd" finished in 0:00 minutes',
:white_check_mark::green_heart: forgot to remove mock
dschep_ntfy
train
py