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
6999fb7797d49d1e403980ffa4ffa39b9bd02c69
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -38,9 +38,12 @@ function manifest(options) { if (file.isNull()) return; if (file.isStream()) return this.emit('error', new gutil.PluginError('gulp-manifest', 'Streaming not supported')); - if (exclude.indexOf(file.relative) >= 0) { - return; - } + for (var i = 0; i < exclude.length; i++) { + if(minimatch(file.relative, exclude[i])){ + //console.log(exclude[i] + ":" + file.relative); //print the path of excluded file + return; + } + } contents.push(encodeURI(slash(file.relative)));
Let "exclude" configuration can support regular expressions,extended glob matching,"Globstar" ** Use minimatch to let "exclude" configuration can support regular expressions,extended glob matching,"Globstar" ** exam: exclude: ['app.manifest','**/*.json',"*.appcache"]
hillmanov_gulp-manifest
train
js
f1d2dd9c552bb2abf7275cf791c1cb242a22dcdb
diff --git a/deltas/__init__.py b/deltas/__init__.py index <HASH>..<HASH> 100644 --- a/deltas/__init__.py +++ b/deltas/__init__.py @@ -6,4 +6,4 @@ from .algorithms import sequence_matcher, SequenceMatcher from .tokenizers import Tokenizer, RegexTokenizer, text_split, wikitext_split from .segmenters import Segmenter, Segment, MatchableSegment -__version__ = "0.3.1" +__version__ = "0.3.2" diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ def requirements(fname): setup( name = "deltas", - version = "0.3.1", + version = "0.3.2", author = "Aaron Halfaker", author_email = "[email protected]", description = "An experimental diff library for generating " + \
Increments version to <I>
halfak_deltas
train
py,py
2b88f650611c11712d0e2940de5964afa023b211
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index <HASH>..<HASH> 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -129,22 +129,6 @@ class RoutedRackApp end end -class BasicController - attr_accessor :request - - def config - @config ||= ActiveSupport::InheritableOptions.new(ActionController::Base.config).tap do |config| - # VIEW TODO: View tests should not require a controller - public_dir = File.expand_path("../fixtures/public", __FILE__) - config.assets_dir = public_dir - config.javascripts_dir = "#{public_dir}/javascripts" - config.stylesheets_dir = "#{public_dir}/stylesheets" - config.assets = ActiveSupport::InheritableOptions.new({ :prefix => "assets" }) - config - end - end -end - class ActionDispatch::IntegrationTest < ActiveSupport::TestCase include ActionDispatch::SharedRoutes
Removing unused controller from abstract_unit
rails_rails
train
rb
7c6e07702bd8697aad38b1f1566a3f9ecf2e435a
diff --git a/src/python/pants/base/deprecated.py b/src/python/pants/base/deprecated.py index <HASH>..<HASH> 100644 --- a/src/python/pants/base/deprecated.py +++ b/src/python/pants/base/deprecated.py @@ -11,6 +11,7 @@ from functools import wraps import six from packaging.version import InvalidVersion, Version +from pants.util.memo import memoized_method from pants.version import PANTS_SEMVER @@ -50,6 +51,7 @@ def get_deprecated_tense(removal_version, future_tense='will be', past_tense='wa return future_tense if (Version(removal_version) >= PANTS_SEMVER) else past_tense +@memoized_method def validate_removal_semver(removal_version): """Validates that removal_version is a valid semver.
Memoize validation of deprecated versions (#<I>) ### Problem 7% of the runtime for `./pants list` in our repo was being taken up in version validation (all for a relatively small set of deprecation versions used in pantsbuild/pants). ### Solution Memoize validation of versions.
pantsbuild_pants
train
py
b4c2e8aab73f419d9c33254f9d1c238f31301dc9
diff --git a/skorch/tests/callbacks/test_scoring.py b/skorch/tests/callbacks/test_scoring.py index <HASH>..<HASH> 100644 --- a/skorch/tests/callbacks/test_scoring.py +++ b/skorch/tests/callbacks/test_scoring.py @@ -965,7 +965,10 @@ class TestPassthrougScoring: n = 75 # n=75 with a 4/5 train/valid split -> 60/15 samples; with a # batch size of 10, that leads to train batch sizes of - # [10,10,10,10] and valid batich sizes of [10,5] + # [10,10,10,10] and valid batch sizes of [10,5]; all labels + # are set to 0 to ensure that the stratified split is exactly + # equal to the desired split + y = np.zeros_like(y) return net.fit(X[:n], y[:n]) @pytest.fixture
Fix a failing test with sklearn <I> The test relied upon <I> samples being split into <I>/<I> for the internal train/valid split. However, with certain sklearn versions, the split would be <I>/<I> because of stratification. As a solution, the target values are all set to 0. Since they are not important for the tests, this solution works.
skorch-dev_skorch
train
py
0d1be4e7a6f1774a220e13a0528f82b99d3f7c97
diff --git a/base-sync.js b/base-sync.js index <HASH>..<HASH> 100644 --- a/base-sync.js +++ b/base-sync.js @@ -462,10 +462,9 @@ BaseSync.prototype = { }, this.options.ping) }, - syncSince: function syncSince (lastSynced) { + syncSinceQuery: function syncSinceQuery (lastSynced) { var data = [] - var sync = this - this.log.each({ order: 'added' }, function (action, meta) { + return this.log.each({ order: 'added' }, function (action, meta) { if (meta.added <= lastSynced) { return false } else { @@ -473,6 +472,13 @@ BaseSync.prototype = { return true } }).then(function () { + return data + }) + }, + + syncSince: function syncSince (lastSynced) { + var sync = this + this.syncSinceQuery(lastSynced).then(function (data) { if (!sync.connected) return if (data.length > 0) { sync.sendSync.apply(sync, data)
Split syncSinceQuery to separated method to be redefined in Logux Server
logux_core
train
js
829bf0cd6b64778dcbc15e31a359797529ba4e9f
diff --git a/Factory.php b/Factory.php index <HASH>..<HASH> 100644 --- a/Factory.php +++ b/Factory.php @@ -14,8 +14,8 @@ class Factory public function createClient($socksHost, $socksPort) { -// $connector = new ConnectionManager($this->loop, $this->resolver); - $connector = new ConnectionManagerFsockopen($this->loop); + $connector = new ConnectionManager($this->loop, $this->resolver); +// $connector = new ConnectionManagerFsockopen($this->loop); return new Client($this->loop, $connector, $this->resolver, $socksHost, $socksPort); } }
Use async connection manager from react/http-client
clue_php-socks
train
php
84f08cfa9d713a1905284479d6cad8e26de2f369
diff --git a/lib/phpunit/classes/util.php b/lib/phpunit/classes/util.php index <HASH>..<HASH> 100644 --- a/lib/phpunit/classes/util.php +++ b/lib/phpunit/classes/util.php @@ -112,6 +112,9 @@ class phpunit_util extends testing_util { // Stop any message redirection. phpunit_util::stop_event_redirection(); + // We used to call gc_collect_cycles here to ensure desctructors were called between tests. + // This accounted for 25% of the total time running phpunit - so we removed it. + // Show any unhandled debugging messages, the runbare() could already reset it. self::display_debugging_messages(); self::reset_debugging(); diff --git a/question/engine/tests/questionusage_autosave_test.php b/question/engine/tests/questionusage_autosave_test.php index <HASH>..<HASH> 100644 --- a/question/engine/tests/questionusage_autosave_test.php +++ b/question/engine/tests/questionusage_autosave_test.php @@ -685,4 +685,10 @@ class question_usage_autosave_test extends qbehaviour_walkthrough_test_base { $this->delete_quba(); } + + protected function tearDown() { + // This test relies on the destructor for the second DB connection being called before running the next test. + // Without this change - there will be unit test failures on "some" DBs (MySQL). + gc_collect_cycles(); + } }
MDL-<I> Unit test fix for MySQL and added a comment about the removed code.
moodle_moodle
train
php,php
b72ef7c9ca9d1bae0b2a8cd9f5bc9bc1f7532c14
diff --git a/src/components/menuBar/js/menuBarDirective.js b/src/components/menuBar/js/menuBarDirective.js index <HASH>..<HASH> 100644 --- a/src/components/menuBar/js/menuBarDirective.js +++ b/src/components/menuBar/js/menuBarDirective.js @@ -92,10 +92,7 @@ angular .module('material.components.menuBar') .directive('mdMenuBar', MenuBarDirective); -/** - * - * @ngInjdect - */ +/* @ngInject */ function MenuBarDirective($mdUtil, $mdTheming) { return { restrict: 'E', diff --git a/src/components/menuBar/js/menuItemDirective.js b/src/components/menuBar/js/menuItemDirective.js index <HASH>..<HASH> 100644 --- a/src/components/menuBar/js/menuItemDirective.js +++ b/src/components/menuBar/js/menuItemDirective.js @@ -3,10 +3,7 @@ angular .module('material.components.menuBar') .directive('mdMenuItem', MenuItemDirective); - /** - * - * @ngInjdect - */ + /* @ngInject */ function MenuItemDirective() { return { require: ['mdMenuItem', '?ngModel'],
fix(build): closure build needs @ngInject annotation It was labeled as "@ngInjdect" instead of "@ngInject". Refs #<I>. Closes #<I>
angular_material
train
js,js
aa3e999fcc69e6b53dd0e9152081f6523eba462c
diff --git a/eZ/Publish/Core/FieldType/Page/Type.php b/eZ/Publish/Core/FieldType/Page/Type.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/Core/FieldType/Page/Type.php +++ b/eZ/Publish/Core/FieldType/Page/Type.php @@ -77,7 +77,7 @@ class Type extends FieldType switch ( $name ) { case 'defaultLayout': - if ( !in_array( $value, $this->pageService->getAvailableZoneLayouts() ) ) + if ( $value !== "" && !in_array( $value, $this->pageService->getAvailableZoneLayouts() ) ) { $validationErrors[] = new ValidationError( "Layout '{$value}' for setting '%setting%' is not available",
Fix EZP-<I>: Implement FieldDefinition form mapper for ezpage Need to allow empty value, when the field type is first added to the content type.
ezsystems_ezpublish-kernel
train
php
30aa109e9a740ac2634d685f4ccb63a261a0614b
diff --git a/Feed.php b/Feed.php index <HASH>..<HASH> 100644 --- a/Feed.php +++ b/Feed.php @@ -307,7 +307,7 @@ abstract class Feed else if (is_string($date)) $date = date($format, strtotime($date)); else - die('The given date was not an instance of DateTime, a UNIX timestamp or a parsable date string.'); + die('The given date was not an instance of DateTime, a UNIX timestamp or a date string.'); if ($this->version == Feed::ATOM) $this->setChannelElement('updated', $date); diff --git a/Item.php b/Item.php index <HASH>..<HASH> 100644 --- a/Item.php +++ b/Item.php @@ -182,7 +182,12 @@ class Item if ($date instanceof DateTime) $date = $date->getTimestamp(); else + { $date = strtotime($date); + + if ($date === FALSE) + die('The given date string was not parseable.'); + } } else if ($date < 0) die('The given date is not an UNIX timestamp.');
Trap unparseable date strings.
mibe_FeedWriter
train
php,php
bc3fe5ddaeb298cc494180ab9f7571bd6c4f9af9
diff --git a/terraform/provider_mock.go b/terraform/provider_mock.go index <HASH>..<HASH> 100644 --- a/terraform/provider_mock.go +++ b/terraform/provider_mock.go @@ -308,7 +308,7 @@ func (p *MockProvider) PlanResourceChange(r providers.PlanResourceChangeRequest) Type: r.TypeName, } priorState := NewInstanceStateShimmedFromValue(r.PriorState, 0) - cfg := NewResourceConfigShimmed(r.Config, schema) + cfg := NewResourceConfigShimmed(r.ProposedNewState, schema) legacyDiff, err := p.DiffFn(info, priorState, cfg)
diff should be from proposed, not config This ensures the mock provider behaves like the shimmed legacy SDK providers.
hashicorp_terraform
train
go
d340c628fb92be354dd65463654d08ce85432785
diff --git a/topdown/topdown.go b/topdown/topdown.go index <HASH>..<HASH> 100644 --- a/topdown/topdown.go +++ b/topdown/topdown.go @@ -34,6 +34,11 @@ type Context struct { redos *redoStack } +// ResetQueryIDs resets the query ID generator. This is only for test purposes. +func ResetQueryIDs() { + qidFactory.Reset() +} + type queryIDFactory struct { next uint64 mtx sync.Mutex
Add test helper to reset query IDs
open-policy-agent_opa
train
go
9215b1829f98ca2c924777a290bb2e26bff2b8be
diff --git a/lib/elastic_searcher.rb b/lib/elastic_searcher.rb index <HASH>..<HASH> 100644 --- a/lib/elastic_searcher.rb +++ b/lib/elastic_searcher.rb @@ -29,11 +29,18 @@ class ElasticSearcher should do query_string do query query_str - fields ["name^5", "summary^3", "description"] + fields ["name^5", "summary^2", "description"] default_operator "and" end end + should do + prefix "name.unanalyzed" do + value query_str + boost 7 + end + end + minimum_should_match 1 # only return gems that are not yanked filter { term yanked: false } diff --git a/test/unit/rubygem_searchable_test.rb b/test/unit/rubygem_searchable_test.rb index <HASH>..<HASH> 100644 --- a/test/unit/rubygem_searchable_test.rb +++ b/test/unit/rubygem_searchable_test.rb @@ -292,4 +292,20 @@ class RubygemSearchableTest < ActiveSupport::TestCase end end end + + context "query matches gem name prefix" do + setup do + %w[term-ansicolor term-an].each do |gem_name| + create(:rubygem, name: gem_name, number: "0.0.1", downloads: 10) + end + import_and_refresh + end + + should "return results" do + _, response = ElasticSearcher.new("term-ans").search + + assert_equal 1, response.size + assert_equal "term-ansicolor", response.first.name + end + end end
Add unanalyzed field to prefix query and reduce boost of summary docs with multiple field match (name, summary and description) had better score than docs with prefix name match. To illustrate, <URL>
rubygems_rubygems.org
train
rb,rb
efadecf44cef965d3f8321d27ae5a27afc8dda54
diff --git a/src/Raekke/Connection.php b/src/Raekke/Connection.php index <HASH>..<HASH> 100644 --- a/src/Raekke/Connection.php +++ b/src/Raekke/Connection.php @@ -65,13 +65,16 @@ class Connection public function info() { - $info = array_change_key_case($this->client->info()); + // Temporarily change the command use to get info as earlier and newer redis + // versions breaks it into sections. + $commandClass = $this->client->getProfile()->getCommandClass('info'); + $this->client->getProfile()->defineCommand('info', 'Predis\Command\ServerInfo'); - if (!isset($info['server'])) { - return $info; - } + $info = $this->client->info(); - return new \RecursiveIteratorIterator(new \RecursiveArrayIterator($info)); + $this->client->getProfile()->defineCommand('info', $commandClass); + + return $info; } public function getClient()
Change flatten strategy to temporarily use a different ServerInfoCommand
bernardphp_bernard
train
php
3d9be7a344381320868628c1b80b8f1f922f2059
diff --git a/spec/integration/drain_spec.rb b/spec/integration/drain_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration/drain_spec.rb +++ b/spec/integration/drain_spec.rb @@ -143,8 +143,8 @@ describe 'drain', type: :integration do it 'runs drain for job templates that have drain script' do deploy_from_scratch(manifest_hash: manifest_with_colocated_drainable_release_jobs) - foobar_drain_log = director.vm('colocated/0').file_path('drain-test.log') - second_drain_log = director.vm('colocated/0').file_path('has_drain_script_drain.log') + foobar_drain_log = director.vm('colocated', '0').file_path('drain-test.log') + second_drain_log = director.vm('colocated', '0').file_path('has_drain_script_drain.log') deploy_simple_manifest(manifest_hash: manifest_with_colocated_drainable_release_jobs, recreate: true)
Fix invocation to director.vms in drain spec after merge
cloudfoundry_bosh
train
rb
85373c65be41176b167222167e940b984d3aaf8b
diff --git a/pmagpy/controlled_vocabularies3.py b/pmagpy/controlled_vocabularies3.py index <HASH>..<HASH> 100755 --- a/pmagpy/controlled_vocabularies3.py +++ b/pmagpy/controlled_vocabularies3.py @@ -40,13 +40,13 @@ class Vocabulary(object): ## Get method codes def get_meth_codes(self): - try: - raw_codes = pd.io.json.read_json('https://www2.earthref.org/MagIC/method-codes.json') - print '-I- Getting method codes from earthref.org' - except Exception as ex: - print ex, type(ex) - raw_codes = pd.io.json.read_json(os.path.join(data_model_dir, "method_codes.json")) - print "-I- Couldn't connect to earthref.org, using cached method codes" + #try: + # raw_codes = pd.io.json.read_json('https://www2.earthref.org/MagIC/method-codes.json') + # print '-I- Getting method codes from earthref.org' + #except Exception as ex: + # print ex, type(ex) + raw_codes = pd.io.json.read_json(os.path.join(data_model_dir, "method_codes.json")) + #print "-I- Couldn't connect to earthref.org, using cached method codes" code_types = raw_codes.ix['label'] all_codes = [] for code_name in code_types.index:
in controlled_vocabularies3 use cached method codes for now — something is weird with the earthref ones. addresses #<I> (but doesn’t actually fix it permanently)
PmagPy_PmagPy
train
py
aa71e8eafb8331ffbc059de6d26fb2890024d1e7
diff --git a/peerset.go b/peerset.go index <HASH>..<HASH> 100644 --- a/peerset.go +++ b/peerset.go @@ -1,7 +1,7 @@ package peerset import ( - peer "gx/ipfs/QmccGfZs3rzku8Bv6sTPH3bMUKD1EVod8srgRjt5csdmva/go-libp2p/p2p/peer" + peer "gx/ipfs/QmYgaiNVVL7f2nydijAwpDRunRkmxfu3PoK87Y3pH84uAW/go-libp2p/p2p/peer" "sync" )
Update go-libp2p License: MIT
libp2p_go-libp2p-peer
train
go
94417948e2be9e4b00acfe6c598c897c92153e6a
diff --git a/h2o-algos/src/main/java/hex/deeplearning/DeepLearningModel.java b/h2o-algos/src/main/java/hex/deeplearning/DeepLearningModel.java index <HASH>..<HASH> 100755 --- a/h2o-algos/src/main/java/hex/deeplearning/DeepLearningModel.java +++ b/h2o-algos/src/main/java/hex/deeplearning/DeepLearningModel.java @@ -421,7 +421,7 @@ public class DeepLearningModel extends Model<DeepLearningModel,DeepLearningParam fail = true; } if (byte_size > Value.MAX || fail) - throw new IllegalArgumentException("Model is too large: PUBDEV-941"); + throw new IllegalArgumentException(technote(5, "Model is too large")); } public long _timeLastScoreEnter; //not transient: needed for HTML display page
Add reference to TN-5 for PUBDEV-<I>.
h2oai_h2o-3
train
java
8b3a0c04388b3735be439aef488f7e5d4036f9ac
diff --git a/bundle/DependencyInjection/Configuration/Parser/ContentView.php b/bundle/DependencyInjection/Configuration/Parser/ContentView.php index <HASH>..<HASH> 100644 --- a/bundle/DependencyInjection/Configuration/Parser/ContentView.php +++ b/bundle/DependencyInjection/Configuration/Parser/ContentView.php @@ -54,11 +54,11 @@ EOT ->info('Name of the QueryType implementation') ->isRequired() ->end() - ->scalarNode('max_per_page') + ->integerNode('max_per_page') ->info('Number of results per page when using pager') ->defaultValue(25) ->end() - ->scalarNode('page') + ->integerNode('page') ->info('Current page when using pager') ->defaultValue(1) ->end()
Page and max per page should be integers
netgen_ezplatform-site-api
train
php
0488c377c173259314594c981be5094ad4747020
diff --git a/colab/settings.py b/colab/settings.py index <HASH>..<HASH> 100644 --- a/colab/settings.py +++ b/colab/settings.py @@ -312,5 +312,6 @@ if locals().get('RAVEN_DSN', False): } INSTALLED_APPS += ('raven.contrib.django.raven_compat',) -for app_label in locals().get('PROXIED_APPS', {}).keys(): +proxied_apps = locals().get('PROXIED_APPS') or {} +for app_label in proxied_apps.keys(): INSTALLED_APPS += ('colab.proxy.{}'.format(app_label),)
Fixed bug caused by PROXIED_APPS set to None
colab_colab
train
py
cd8455debae31e7bd06e2fc31535464affe33613
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -164,11 +164,9 @@ function getDirection(gradient) { 'IE filter doesn\'t support side corner gradient, ' + 'we use the first side of the side corner as fallback.'; } - } else if (gradient.angle.value !== undefined) { + } else { angle = normalizeAngle(gradient.angle.value, gradient.angle.unit); result = angleToDirection(angle); - } else { - result.direction = 'bottom'; } return result; diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -27,6 +27,11 @@ var test = function (inputFile, opts, done, warnings) { }; describe('postcss-filter-gradient', function () { + it('should not throw errors when `options` is undefined', function (done) { + expect(plugin).to.not.throw(); + done(); + }); + it('should do nothing if linear-gradient not exists', function (done) { test('none', {}, done); });
<I>% test coverage 🍸
yuezk_postcss-filter-gradient
train
js,js
2a84b591b06470ad2063e2f2f03516eca2e4b42c
diff --git a/mode/haml/haml.js b/mode/haml/haml.js index <HASH>..<HASH> 100644 --- a/mode/haml/haml.js +++ b/mode/haml/haml.js @@ -85,8 +85,10 @@ state.tokenize = rubyInQuote(")"); return state.tokenize(stream, state); } else if (ch == "{") { - state.tokenize = rubyInQuote("}"); - return state.tokenize(stream, state); + if (!stream.match(/^\{%.*/)) { + state.tokenize = rubyInQuote("}"); + return state.tokenize(stream, state); + } } }
[haml mode] Ignore {% liquid tags The old behavior sees the closing %} as a haml tag begin. The result is that the rest of the file after the %} doesnt highlight correctly. Dont go into quote mode when stream is '{%'.
codemirror_CodeMirror
train
js
4c526cabb4e9e884e6c310fe5c434c3c21d13bd8
diff --git a/plugins/function_strings.py b/plugins/function_strings.py index <HASH>..<HASH> 100644 --- a/plugins/function_strings.py +++ b/plugins/function_strings.py @@ -19,7 +19,7 @@ class FunctionStrings(idaapi.plugin_t): def run(self, arg): function = sark.Function(idc.here()) - idaapi.msg("String References in {}:0x{:08X}\n".format(function.name, function.startEA)) + idaapi.msg("\n\nString References in {}:0x{:08X}\n".format(function.name, function.startEA)) idaapi.msg("From To String\n") for xref in function.xrefs_from:
Improved the formatting of the function-strings plugin output.
tmr232_Sark
train
py
52979110114100e5933f2241e9858c1efc4d615f
diff --git a/core/src/main/java/jlibs/core/lang/model/ModelUtil.java b/core/src/main/java/jlibs/core/lang/model/ModelUtil.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/jlibs/core/lang/model/ModelUtil.java +++ b/core/src/main/java/jlibs/core/lang/model/ModelUtil.java @@ -26,7 +26,6 @@ import javax.lang.model.type.ArrayType; import javax.lang.model.type.DeclaredType; import javax.lang.model.type.TypeMirror; import javax.tools.StandardLocation; -import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.util.Map; @@ -51,8 +50,10 @@ public class ModelUtil{ return null; } - public static String getPackage(TypeElement clazz){ - return ((PackageElement)clazz.getEnclosingElement()).getQualifiedName().toString(); + public static String getPackage(Element elem){ + while(!(elem instanceof PackageElement)) + elem = elem.getEnclosingElement(); + return ((PackageElement)elem).getQualifiedName().toString(); } public static String toString(TypeMirror mirror, boolean usePrimitiveWrappers){
getPackage(...) is changed to accept Element
santhosh-tekuri_jlibs
train
java
1d570737deb3783555b7784e50a9e837260c2b65
diff --git a/guacamole/src/main/java/net/sourceforge/guacamole/net/basic/crud/connections/List.java b/guacamole/src/main/java/net/sourceforge/guacamole/net/basic/crud/connections/List.java index <HASH>..<HASH> 100644 --- a/guacamole/src/main/java/net/sourceforge/guacamole/net/basic/crud/connections/List.java +++ b/guacamole/src/main/java/net/sourceforge/guacamole/net/basic/crud/connections/List.java @@ -155,7 +155,7 @@ public class List extends AuthenticatingHttpServlet { Long.toString(record.getEndDate().getTime())); // User involved - xml.writeCharacters(record.getUser().getUsername()); + xml.writeCharacters(record.getUsername()); xml.writeEndElement(); }
Use username in connection record, not full-blown user.
glyptodon_guacamole-client
train
java
a9e2bb67bb1f634cebcb64f6d0e7019834a6cedd
diff --git a/converters/toZigbee.js b/converters/toZigbee.js index <HASH>..<HASH> 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -503,6 +503,10 @@ const converters = { if (meta.state.hasOwnProperty('brightness')) { let brightness = onOff || meta.state.state === 'ON' ? meta.state.brightness + value : meta.state.brightness; + if (value === 0) { + brightness = (await entity.read('genLevelCtrl', ['currentLevel'])).currentLevel; + } + brightness = Math.min(254, brightness); brightness = Math.max(onOff || meta.state.state === 'OFF' ? 0 : 1, brightness);
Fix brightness state incorrect when brightness_step with transition is stopped with brightness_step 0. <URL>
Koenkk_zigbee-shepherd-converters
train
js
11c4c012f853b7e20190f40cbafe9a595fe45519
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,8 @@ def recursively_include(results, directory, patterns): recursively_include(package_data, 'pythonforandroid/recipes', ['*.patch', 'Setup']) recursively_include(package_data, 'pythonforandroid/bootstraps', - ['*.properties', '*.xml', '*.java', '*.tmpl', '*.txt', '*.png']) + ['*.properties', '*.xml', '*.java', '*.tmpl', '*.txt', '*.png', + '*.mk', ]) setup(name='python-for-android', version='0.2',
Added *.mk to packages
kivy_python-for-android
train
py
ac3f8db1abc7e9d7273919307e4fe252476a1c16
diff --git a/test/test_evaluator.rb b/test/test_evaluator.rb index <HASH>..<HASH> 100644 --- a/test/test_evaluator.rb +++ b/test/test_evaluator.rb @@ -15,7 +15,7 @@ class TestEvaluator < Test::Unit::TestCase end end - should "not send anything to the handler when the expr does not conform to the standard" do + def test_does_not_send_anything_when_the_expression_passed_does_not_match_pattern stack = e("ShouldNotBeInstantiated") e = Tickly::Evaluator.new e.add_node_handler_class(ShouldNotBeInstantiated) @@ -56,5 +56,15 @@ class TestEvaluator < Test::Unit::TestCase end end end + + def test_will_capture + e = Tickly::Evaluator.new + e.add_node_handler_class(SomeNode) + + valid = e("SomeNode", le(e("foo", "bar"), e("baz", "bad"))) + assert e.will_capture?(valid) + assert !e.will_capture?([]) + assert !e.will_capture?(e("SomeNode")) + end end
Tests for Evaluator#will_capture?
julik_tickly
train
rb
4aa9aaeceea787aa6347d9b6d6b2dc234382f0a4
diff --git a/inferno/net.py b/inferno/net.py index <HASH>..<HASH> 100644 --- a/inferno/net.py +++ b/inferno/net.py @@ -414,7 +414,7 @@ def accuracy_pred_extractor(y): class NeuralNetClassifier(NeuralNet): default_callbacks = [ - ('epoch_timer', EpochTimer), + ('epoch_timer', EpochTimer()), ('average_loss', AverageLoss([ ('train_loss', 'train_batch_size'), ('valid_loss', 'valid_batch_size'),
For consistencey, EpochTimer is now initialized by default in default_callbacks.
skorch-dev_skorch
train
py
84c851c221e28d2bc3b99f681058c1b2d2a4a120
diff --git a/lib/ruboto/commands/base.rb b/lib/ruboto/commands/base.rb index <HASH>..<HASH> 100644 --- a/lib/ruboto/commands/base.rb +++ b/lib/ruboto/commands/base.rb @@ -65,6 +65,7 @@ module Ruboto description 'Using what version of Ruby? (e.g., 1.8, 1.9, 2.0)' argument :required cast :float + validate {|rv| [1.8, 1.9, 2.0].include?(rv)} } option('force') { description 'Force creation of project even if the path exists' @@ -112,7 +113,7 @@ module Ruboto if ruby_version source = File.read('ruboto.yml') - pattern = %r{^# ruby_version: 1.9$} + pattern = %r{^#? ?ruby_version: 1.9$} File.open('ruboto.yml', 'w') { |f| f << source.sub(pattern, "ruby_version: #{ruby_version}") } end
Add check for versions and change pattern for ruby_version
ruboto_ruboto
train
rb
26aaa8d1174cb1d52ee2f5c189aaff9a4aa284cc
diff --git a/packages/material-ui/src/TextField/TextField.js b/packages/material-ui/src/TextField/TextField.js index <HASH>..<HASH> 100644 --- a/packages/material-ui/src/TextField/TextField.js +++ b/packages/material-ui/src/TextField/TextField.js @@ -44,7 +44,6 @@ function TextField(props) { children, className, defaultValue, - disabled, error, FormHelperTextProps, fullWidth, @@ -82,7 +81,6 @@ function TextField(props) { autoComplete={autoComplete} autoFocus={autoFocus} defaultValue={defaultValue} - disabled={disabled} fullWidth={fullWidth} multiline={multiline} name={name}
[TextField] Fix disabled prop only affecting the Input component (#<I>) * Fix TextField's disabled prop only affecting the Input component. * let's merge
mui-org_material-ui
train
js
371b655292a0ba99aed853909c7937ee753b2748
diff --git a/app/controllers/red_base/application_controller.rb b/app/controllers/red_base/application_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/red_base/application_controller.rb +++ b/app/controllers/red_base/application_controller.rb @@ -21,7 +21,7 @@ class RedBase::ApplicationController < ActionController::Base before_filter :set_locale def set_locale - FastGettext.set_locale(params[:locale] || session[:locale] || request.env['HTTP_ACCEPT_LANGUAGE']) + FastGettext.set_locale(params[:locale] || session[:locale] || I18n.default_locale) session[:locale] = I18n.locale = FastGettext.locale end end
Very small change in order of i<I>n
Yellowen_Faalis
train
rb
c36a739eb2b205a5da337daa93ad6d5bf784395c
diff --git a/src/node.js b/src/node.js index <HASH>..<HASH> 100644 --- a/src/node.js +++ b/src/node.js @@ -23,12 +23,13 @@ function add(fn) { return fn().then(() => process.exit()); }); // catches uncaught exceptions - process.on('uncaughtException', () => { + process.on('uncaughtException', err => { DEBUG && console.log('node: uncaughtException'); - return fn().then(() => process.exit()); + return fn() + .then(() => Promise.reject(err)); }); } export default { add -}; \ No newline at end of file +}; diff --git a/test/nodejs.test.js b/test/nodejs.test.js index <HASH>..<HASH> 100644 --- a/test/nodejs.test.js +++ b/test/nodejs.test.js @@ -60,6 +60,7 @@ describe('nodejs.test.js', function () { }); describe('basic', function () { it('exception', function (done) { + this.timeout(10000); exec('node ./test/helper/node.js exception', function () { pingCount().then(function (c) { assert.equal(startCounter + 1, c);
FIX muting of uncaught errors
pubkey_unload
train
js,js
6b717bd86f00095f19fb113ab30015518cf3e616
diff --git a/prey.js b/prey.js index <HASH>..<HASH> 100755 --- a/prey.js +++ b/prey.js @@ -64,12 +64,12 @@ process.on('SIGINT', function() { process.on('SIGUSR1', function() { logger.notice('Got SIGUSR1 signal!'); - Prey.agent.engage('SIGUSR1'); + Prey.agent.engage('interval'); }); process.on('SIGUSR2', function() { logger.notice('Got SIGUSR2 signal!'); - Prey.agent.engage('SIGUSR2'); + Prey.agent.engage('network'); }); /*
More helpful trigger names for engage() -- interval & network.
prey_prey-node-client
train
js
f8ed99ab57fefaec8e8384b78ae8f0e41ce803b1
diff --git a/components/button/__tests__/index.test.js b/components/button/__tests__/index.test.js index <HASH>..<HASH> 100644 --- a/components/button/__tests__/index.test.js +++ b/components/button/__tests__/index.test.js @@ -7,6 +7,7 @@ import mountTest from '../../../tests/shared/mountTest'; describe('Button', () => { mountTest(Button); + mountTest(Button.Group); it('renders correctly', () => { const wrapper = render(<Button>Follow</Button>); diff --git a/components/input/__tests__/index.test.js b/components/input/__tests__/index.test.js index <HASH>..<HASH> 100644 --- a/components/input/__tests__/index.test.js +++ b/components/input/__tests__/index.test.js @@ -22,6 +22,7 @@ describe('Input', () => { focusTest(Input); mountTest(Input); + mountTest(Input.Group); it('should support maxLength', () => { const wrapper = mount(<Input maxLength={3} />);
:white_check_mark: missing components
ant-design_ant-design
train
js,js
c143391b34f2aab9804bb69d1a7bc4bc599621a9
diff --git a/python/ray/util/accelerators/__init__.py b/python/ray/util/accelerators/__init__.py index <HASH>..<HASH> 100644 --- a/python/ray/util/accelerators/__init__.py +++ b/python/ray/util/accelerators/__init__.py @@ -4,6 +4,7 @@ from ray.util.accelerators.accelerators import ( NVIDIA_TESLA_T4, NVIDIA_TESLA_P4, NVIDIA_TESLA_K80, + NVIDIA_TESLA_A100, ) __all__ = [ @@ -12,4 +13,5 @@ __all__ = [ "NVIDIA_TESLA_T4", "NVIDIA_TESLA_P4", "NVIDIA_TESLA_K80", + "NVIDIA_TESLA_A100", ]
Expose A<I> in accelerators module (#<I>) NVIDIA_TESLA_A<I> is added here but it's not exposed in accelerators module's __init__ file.
ray-project_ray
train
py
16c89eff1170ff582463955f4889d5623e98727d
diff --git a/src/Algebra/Division.php b/src/Algebra/Division.php index <HASH>..<HASH> 100644 --- a/src/Algebra/Division.php +++ b/src/Algebra/Division.php @@ -22,6 +22,16 @@ final class Division $this->divisor = $divisor; } + public function dividend(): NumberInterface + { + return $this->dividend; + } + + public function divisor(): NumberInterface + { + return $this->divisor; + } + public function result(): NumberInterface { return new Number($this->dividend->value() / $this->divisor->value()); diff --git a/tests/Algebra/DivisionTest.php b/tests/Algebra/DivisionTest.php index <HASH>..<HASH> 100644 --- a/tests/Algebra/DivisionTest.php +++ b/tests/Algebra/DivisionTest.php @@ -11,6 +11,17 @@ use PHPUnit\Framework\TestCase; class DivisionTest extends TestCase { + public function testInterface() + { + $division = new Division( + $dividend = new Number(4), + $divisor = new Number(2) + ); + + $this->assertSame($dividend, $division->dividend()); + $this->assertSame($divisor, $division->divisor()); + } + public function testResult() { $division = new Division(new Number(4), new Number(2));
add getters to access dividend and divisor
Innmind_Math
train
php,php
f869d57862a1a2a1899f329920ed25160ded2ab7
diff --git a/OpenPNM/Base/__Tools__.py b/OpenPNM/Base/__Tools__.py index <HASH>..<HASH> 100644 --- a/OpenPNM/Base/__Tools__.py +++ b/OpenPNM/Base/__Tools__.py @@ -19,9 +19,11 @@ class PrintableList(list): class PrintableDict(_odict): - def __init__(self, header='value', **kwargs): - super().__init__(**kwargs) - self._header = header + def __init__(self, *args, **kwargs): + self._header = 'value' + if 'header' in kwargs: + self._header = kwargs.pop('header') + super().__init__(*args, **kwargs) def __repr__(self): text = dict(self).__str__()
Fixed a glitch in the 'header' option added to dict in last commit
PMEAL_OpenPNM
train
py
79fdefd519f0dd7ef2ca0cb59fd644911efc13be
diff --git a/nested_inline/admin.py b/nested_inline/admin.py index <HASH>..<HASH> 100644 --- a/nested_inline/admin.py +++ b/nested_inline/admin.py @@ -144,7 +144,7 @@ class NestedModelAdmin(admin.ModelAdmin): return True @csrf_protect_m - @transaction.commit_on_success + @transaction.atomic def add_view(self, request, form_url='', extra_context=None): "The 'add' admin view for this model." model = self.model @@ -238,7 +238,7 @@ class NestedModelAdmin(admin.ModelAdmin): return self.render_change_form(request, context, form_url=form_url, add=True) @csrf_protect_m - @transaction.commit_on_success + @transaction.atomic def change_view(self, request, object_id, form_url='', extra_context=None): "The 'change' admin view for this model." model = self.model
Remove commit_on_success decorator and replace with atomic per Django deprication policy.
s-block_django-nested-inline
train
py
716ca43c1034b2249394a29e66191d321e1e5292
diff --git a/test/base_test.py b/test/base_test.py index <HASH>..<HASH> 100644 --- a/test/base_test.py +++ b/test/base_test.py @@ -1,4 +1,5 @@ import downhill +import numpy as np import util @@ -70,3 +71,14 @@ class TestOptimizer: for _ in opt.iteropt(data, max_gradient_elem=3): assert opt.max_gradient_elem == 3 break + + def test_set_params(self): + opt, _ = util.build_rosen('tester') + opt.set_params([[1, 2]]) + assert np.allclose(opt._params[0].get_value(), [1, 2]) + + def test_set_best_params(self): + opt, _ = util.build_rosen('tester') + opt._best_params = [[1, 2]] + opt.set_params('best') + assert np.allclose(opt._params[0].get_value(), [1, 2])
Add tests for set_params.
lmjohns3_downhill
train
py
778dc42bcc259b8ceff713f5a5db9ec331f2a368
diff --git a/test/cases/coerced_tests.rb b/test/cases/coerced_tests.rb index <HASH>..<HASH> 100644 --- a/test/cases/coerced_tests.rb +++ b/test/cases/coerced_tests.rb @@ -1270,6 +1270,16 @@ module ActiveRecord query = Post.optimizer_hints("OMGHINT").merge(Post.optimizer_hints("OMGHINT")).to_sql assert_equal expected, query end + + # Original Rails test fails on Windows CI because the dump file was not being binary read. + coerce_tests! :test_marshal_load_legacy_relation + def test_marshal_load_legacy_relation_coerced + path = File.expand_path( + "support/marshal_compatibility_fixtures/legacy_relation.dump", + ARTest::SQLServer.root_activerecord_test + ) + assert_equal 11, Marshal.load(File.binread(path)).size + end end end
Original Rails test fails on Windows CI because the dump file was not being binary read (#<I>)
rails-sqlserver_activerecord-sqlserver-adapter
train
rb
dce608c58f8d16d6ef934c63a6ea13dd8be90f3f
diff --git a/test/autocomplete_for_test.rb b/test/autocomplete_for_test.rb index <HASH>..<HASH> 100644 --- a/test/autocomplete_for_test.rb +++ b/test/autocomplete_for_test.rb @@ -1,4 +1,4 @@ -require_relative 'test_helper' +require 'test_helper' class AutocompleteForTest < ActiveSupport::TestCase load_schema
Change back require_relative to require
nulogy_autocomplete_for
train
rb
0ae113893097b51232f25e20e1a75f7434aa1a0d
diff --git a/lib/svgeez/sprite_builder.rb b/lib/svgeez/sprite_builder.rb index <HASH>..<HASH> 100644 --- a/lib/svgeez/sprite_builder.rb +++ b/lib/svgeez/sprite_builder.rb @@ -37,9 +37,13 @@ module Svgeez %{<svg id="#{destination_file_id}" style="display: none;" version="1.1">}.tap do |destination_file_contents| # Loop over all source files, grabbing their content, and appending to `destination_file_contents` source_file_paths.each do |file_path| - file_contents = use_svgo? ? `svgo -i #{file_path.gsub(/['"\s]/, '\\\\\0')} -o -` : IO.read(file_path) + file_contents = IO.read(file_path) pattern = /^<svg.*?(?<viewbox>viewBox=".*?").*?>(?<content>.*?)<\/svg>/m + if use_svgo? + file_contents = `cat <<EOF | svgo -i - -o -\n#{file_contents}\nEOF` + end + file_contents.match(pattern) do |matches| destination_file_contents << %{<symbol id="#{destination_file_id}-#{File.basename(file_path, '.svg').downcase}" #{matches[:viewbox]}>#{matches[:content]}</symbol>} end
cat multi-line file_contents to STDIN and pipe to SVGO command. A better solution that fixes #<I>.
jgarber623_svgeez
train
rb
3d0d036ae21fdbc2d08b56709100da135c0d1122
diff --git a/lib/constants.js b/lib/constants.js index <HASH>..<HASH> 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -359,6 +359,9 @@ Object.assign(exports, { TOMBSTONE_DECAY_POWER_CREEP: 500, RUIN_DECAY: 500, + RUIN_DECAY_STRUCTURES: { + 'powerBank': 10 + }, PORTAL_DECAY: 30000,
refact: add RUIN_DECAY_STRUCTURES
screeps_common
train
js
fc44605fbc05f54af0cd5c378b5941b16d28e326
diff --git a/lib/node-static.js b/lib/node-static.js index <HASH>..<HASH> 100644 --- a/lib/node-static.js +++ b/lib/node-static.js @@ -6,8 +6,8 @@ const fs = require('fs') , http = require('http') , path = require('path') , mime = require('mime') - , util = require('./node-static/util') , minimatch = require('minimatch') + , util = require('./node-static/util') , pkg = require('../package.json'); const version = pkg.version.split('.');
refactor: list 3rd party deps. together
cloudhead_node-static
train
js
9060a192915d93a321bdc00bd81e9f9a407a2657
diff --git a/src/helpers.php b/src/helpers.php index <HASH>..<HASH> 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -37,14 +37,15 @@ if ( ! function_exists('basset_javascripts')) if ( ! function_exists('basset_assets')) { /** - * Output a given group for an array of collections. + * Output the assets for a collection as defined by the extension. * - * @param array $collections * @return string */ - function basset_assets(array $collections) + function basset_assets() { - $responses = array(); + $collections = array(); $args = func_get_args(); + + array_walk_recursive($args, function($v, $k) use (&$collections) { is_numeric($k) ? ($collections[$v] = null) : ($collections[$k] = $v); }); foreach ($collections as $collection => $format) $responses[] = app('basset.server')->collection($collection, $format);
Allow an array or string of collections to be given to basset_assets.
Marwelln_basset
train
php
9cb490f54515223ecfa85e07409ec62fee3c4f6d
diff --git a/lib/billy/cache.rb b/lib/billy/cache.rb index <HASH>..<HASH> 100644 --- a/lib/billy/cache.rb +++ b/lib/billy/cache.rb @@ -79,7 +79,10 @@ module Billy url = URI(no_params) end - key = method+'_'+url.host+'_'+Digest::SHA1.hexdigest(url.to_s) + # Unique key based on anchor path instead of full url + anchor_split = URI(url).to_s.split('#') + anchor_path = anchor_split.length > 1 ? anchor_split[1] : nil + key = method+'_'+url.host+'_'+Digest::SHA1.hexdigest(anchor_path ? anchor_path : url.to_s) if method == 'post' and !Billy.config.ignore_params.include?(no_params) key += '_'+Digest::SHA1.hexdigest(body.to_s)
Unique key based on anchor path instead of full url
oesmith_puffing-billy
train
rb
90151846ad75373e1537e8164ff0c6e75dd6ccdc
diff --git a/blueprints/ember-cli-visual-acceptance/files/vendor/VisualAcceptance.js b/blueprints/ember-cli-visual-acceptance/files/vendor/VisualAcceptance.js index <HASH>..<HASH> 100644 --- a/blueprints/ember-cli-visual-acceptance/files/vendor/VisualAcceptance.js +++ b/blueprints/ember-cli-visual-acceptance/files/vendor/VisualAcceptance.js @@ -6,7 +6,7 @@ function httpGet (theUrl) { return xmlHttp.responseText } -function visualAcceptance (imageName, height = null, width = null, misMatchPercentageMargin = 0.00, imageDirectory = 'visual-acceptance') { +function capture (imageName, height = null, width = null, misMatchPercentageMargin = 0.00, imageDirectory = 'visual-acceptance') { $(document.getElementById('ember-testing')).css('zoom', 'normal') $(document.getElementById('ember-testing')).css('width', '100%') $(document.getElementById('ember-testing')).css('height', '100%') diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -86,7 +86,6 @@ module.exports = { }) app.post('/image', function (req, res) { - console.log('Hello') saveImage(req, res) })
Change from visualAcceptance function call to capture
ciena-blueplanet_ember-cli-visual-acceptance
train
js,js
441c3802afc9bc4203c019382d249ac88d62ea82
diff --git a/schema/cli.py b/schema/cli.py index <HASH>..<HASH> 100644 --- a/schema/cli.py +++ b/schema/cli.py @@ -49,7 +49,7 @@ def run(args): def serve(args): # TODO: This currently relies on Flask + Juggernaut, but Juggernaut is # abandoned. Switch to something actively maintained. - app.run(debug=True) + app.run(debug=True, host=args.host, port=args.port) def cli(): @@ -120,8 +120,15 @@ def cli(): parser_serve = subparsers.add_parser( 'serve', help='run a web server for websocket clients' ) + parser_serve.add_argument( + '-H', '--host', type=str, default=None, + help='the hostname to use' + ) + parser_serve.add_argument( + '-p', '--port', type=str, default=5000, + help='the port to listen on' + ) parser_serve.set_defaults(func=serve) - # TODO: host, port args = parser.parse_args() args.func(args)
add host and port support to schema serve
vreon_figment
train
py
59b6f9ef5a36db6f06623181c18047ea8d2dc1ed
diff --git a/src/Css/Style.php b/src/Css/Style.php index <HASH>..<HASH> 100644 --- a/src/Css/Style.php +++ b/src/Css/Style.php @@ -944,7 +944,7 @@ class Style if (isset($this->_props_computed[$prop])) { $computed_value = $this->_props_computed[$prop]; } - if (empty($this->_props[$prop])) { + if (empty($this->_props[$prop]) || $this->_props[$prop] === "inherit") { $this->__set($prop, self::$_defaults[$prop]); } if (empty($this->_props_computed[$prop])) {
Use the default in the generic style getter when the property value is inherit If the computed value does not exist and the specified value is "inherit" then we have not yet parsed inheritence for the style instance. Normal processing of a document will resolve the inherited case through update of dependent properties.
dompdf_dompdf
train
php
809c58045e9a760fcc6dfa1d8621ded6aab31191
diff --git a/playback/cinder.py b/playback/cinder.py index <HASH>..<HASH> 100644 --- a/playback/cinder.py +++ b/playback/cinder.py @@ -74,7 +74,7 @@ class Cinder(common.Common): print red(env.host_string + ' | Enable Consistency groups') with open('tmp_policy_json_' + env.host_string, 'w') as f: - f.write(conf_cinder_conf) + f.write(conf_policy_json) files.upload_template(filename='tmp_policy_json_' + env.host_string, destination='/etc/cinder/policy.json', use_sudo=True,
Fix no JSON object could be decoded
jiasir_playback
train
py
02b663b651aacb310cea5bc8c65104c9dff69a7a
diff --git a/tsdb/index/tsi1/index.go b/tsdb/index/tsi1/index.go index <HASH>..<HASH> 100644 --- a/tsdb/index/tsi1/index.go +++ b/tsdb/index/tsi1/index.go @@ -447,20 +447,15 @@ func (i *Index) CreateSeriesListIfNotExists(_, names [][]byte, tagsSlice []model } // Ensure fileset cannot change during insert. - i.mu.Lock() - defer i.mu.Unlock() - + i.mu.RLock() // Insert series into log file. if err := i.activeLogFile.AddSeriesList(names, tagsSlice); err != nil { + i.mu.RUnlock() return err } + i.mu.RUnlock() - // Switch log file if necessary. - if err := i.checkLogFile(); err != nil { - return err - } - - return nil + return i.CheckLogFile() } // InitializeSeries is a no-op. This only applies to the in-memory index.
Fix lock contention in Index.CreateSeriesListIfNotExists There was contention on the write lock which only needs to be acquired when checking to see if the log file should be rolled over.
influxdata_influxdb
train
go
454696b7aa0c968d974b153ad96b96cc1b70e4d8
diff --git a/integration-tests/bin/install-integ-gems.rb b/integration-tests/bin/install-integ-gems.rb index <HASH>..<HASH> 100755 --- a/integration-tests/bin/install-integ-gems.rb +++ b/integration-tests/bin/install-integ-gems.rb @@ -50,8 +50,7 @@ versions = { :jbuilder => '1.4.2', :sdoc => '0.3.20', - :arjdbc11 => '1.1.3', - :arjdbc12 => '1.2.9.1', + :arjdbc => '1.2.9.1', :jdbc_h2 => '1.3.170.1', :jdbc_sqlite3 => '3.7.2.1', @@ -101,8 +100,7 @@ GemInstaller.with( versions ) do |installer| installer.install( 'jbuilder', versions[:jbuilder] ) installer.install( 'sdoc', versions[:sdoc] ) - installer.install( 'activerecord-jdbc-adapter', versions[:arjdbc11] ) - installer.install( 'activerecord-jdbc-adapter', versions[:arjdbc12] ) + installer.install( 'activerecord-jdbc-adapter', versions[:arjdbc] ) installer.install( 'jdbc-h2' ) installer.install( 'jdbc-sqlite3' )
Don't use activerecord-jdbc <I>.x in integs since it can't work with newer jdbc-* gems
torquebox_torquebox
train
rb
41e4f7823450fa1fe7288eaceea1f7d79ca0f14c
diff --git a/stats/sink.go b/stats/sink.go index <HASH>..<HASH> 100644 --- a/stats/sink.go +++ b/stats/sink.go @@ -22,6 +22,7 @@ package stats import ( "errors" + "math" "sort" "time" ) @@ -109,20 +110,22 @@ func (t *TrendSink) Add(s Sample) { } } +// P calculates the given percentile from sink values. func (t *TrendSink) P(pct float64) float64 { switch t.Count { case 0: return 0 case 1: return t.Values[0] - case 2: - if pct < 0.5 { - return t.Values[0] - } else { - return t.Values[1] - } default: - return t.Values[int(float64(t.Count)*pct)] + // If percentile falls on a value in Values slice, we return that value. + // If percentile does not fall on a value in Values slice, we calculate (linear interpolation) + // the value that would fall at percentile, given the values above and below that percentile. + i := pct * (float64(t.Count) - 1.0) + j := t.Values[int(math.Floor(i))] + k := t.Values[int(math.Ceil(i))] + f := i - math.Floor(i) + return j + (k-j)*f } }
Change percentile calculation to use linear interpolation
loadimpact_k6
train
go
0814658223d21d5a1a92b7ad228965bf64311806
diff --git a/lib/policies/service_bus_policy.js b/lib/policies/service_bus_policy.js index <HASH>..<HASH> 100644 --- a/lib/policies/service_bus_policy.js +++ b/lib/policies/service_bus_policy.js @@ -10,6 +10,7 @@ module.exports = new Policy({ maxMessageSize: 10000, // Arbitrary choice }, encoder: function(body) { + if (body instanceof Buffer) return body; var bodyStr = body; if (typeof body !== 'string') { bodyStr = JSON.stringify(body);
fix(ServiceBusPolicy): Avoid jsonifying Buffers
noodlefrenzy_node-amqp10
train
js
6d400143aa5877ecd3aaac8e370b966bc622a741
diff --git a/grimoire_elk/utils.py b/grimoire_elk/utils.py index <HASH>..<HASH> 100755 --- a/grimoire_elk/utils.py +++ b/grimoire_elk/utils.py @@ -52,6 +52,7 @@ from perceval.backends.core.meetup import Meetup, MeetupCommand from perceval.backends.core.nntp import NNTP, NNTPCommand from perceval.backends.core.phabricator import Phabricator, PhabricatorCommand from perceval.backends.core.pipermail import Pipermail, PipermailCommand +from perceval.backends.core.twitter import Twitter, TwitterCommand from perceval.backends.puppet.puppetforge import PuppetForge, PuppetForgeCommand from perceval.backends.core.redmine import Redmine, RedmineCommand from perceval.backends.core.rss import RSS, RSSCommand @@ -215,7 +216,7 @@ def get_connectors(): StackExchangeEnrich, StackExchangeCommand], "supybot": [Supybot, SupybotOcean, SupybotEnrich, SupybotCommand], "telegram": [Telegram, TelegramOcean, TelegramEnrich, TelegramCommand], - "twitter": [None, TwitterOcean, TwitterEnrich, None] + "twitter": [Twitter, TwitterOcean, TwitterEnrich, TwitterCommand] } # Will come from Registry
[utils] Modify connector information for twitter This code modifies the connector information for Twitter. Now, the Twitter connector behaves as the other Perceval connectors.
chaoss_grimoirelab-elk
train
py
2c450ca412e96354705cc5f54a1f6e909cbfb722
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,26 @@ setup( long_description=long_description, packages=find_packages(), zip_safe=False, + license='MIT', + keywords=['openvpn', 'status', 'log'], classifiers=[ + 'Development Status :: 3 - Alpha', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: MIT License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: Implementation :: CPython', + 'Programming Language :: Python :: Implementation :: PyPy', + 'Topic :: Internet :: Log Analysis', + 'Topic :: Software Development :: Libraries :: Python Modules', + 'Topic :: System :: Logging', + 'Topic :: Text Processing', + 'Topic :: Utilities', ], install_requires=[ 'six', @@ -26,4 +45,5 @@ setup( 'ipaddress', ], }, + platforms=['Any'], )
add classifiters and license to setup.py
tonyseek_openvpn-status
train
py
40edb65ee751dfe4cf6e04ee59891266d8b14f30
diff --git a/spacy/tests/regression/test_issue1380.py b/spacy/tests/regression/test_issue1380.py index <HASH>..<HASH> 100644 --- a/spacy/tests/regression/test_issue1380.py +++ b/spacy/tests/regression/test_issue1380.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import pytest from ...language import Language
Make test work for Python <I>
explosion_spaCy
train
py
f9d22d18f885a207f57265fe96afcca9b68c4577
diff --git a/lib/attributor/types/uri.rb b/lib/attributor/types/uri.rb index <HASH>..<HASH> 100644 --- a/lib/attributor/types/uri.rb +++ b/lib/attributor/types/uri.rb @@ -38,6 +38,10 @@ module Attributor end end + def self.dump(value, **opts) + value.to_s + end + def self.validate(value,context=Attributor::DEFAULT_ROOT_CONTEXT,attribute) errors = [] diff --git a/spec/types/uri_spec.rb b/spec/types/uri_spec.rb index <HASH>..<HASH> 100644 --- a/spec/types/uri_spec.rb +++ b/spec/types/uri_spec.rb @@ -12,6 +12,12 @@ describe Attributor::URI do end end + context '.dump' do + let(:example){ type.example } + it 'uses the underlying URI to_s' do + expect(type.dump(example)).to eq(example.to_s) + end + end context '.load' do subject(:load) { type.load(value) }
Make Attributor::URI properly dump the :URI::Generic with `.to_s`
praxis_attributor
train
rb,rb
730de285c85f71b2e0ce5dee0fc6027ca0bd7626
diff --git a/Form/Type/OperationType.php b/Form/Type/OperationType.php index <HASH>..<HASH> 100755 --- a/Form/Type/OperationType.php +++ b/Form/Type/OperationType.php @@ -17,6 +17,7 @@ namespace CampaignChain\CoreBundle\Form\Type; +use CampaignChain\CoreBundle\Entity\Location; use Symfony\Component\Form\AbstractType; use Symfony\Component\DependencyInjection\ContainerInterface; use Doctrine\ORM\EntityManager; @@ -46,7 +47,7 @@ abstract class OperationType extends AbstractType $this->view = $view; } - public function setLocation($location){ + public function setLocation(Location $location){ $this->location = $location; }
CampaignChain/campaignchain#<I> Auto-complete for social media channels
CampaignChain_core
train
php
37711cac344028a7f87f44eed0964572ae8ef0f4
diff --git a/src/main/org/owasp/html/HtmlSanitizer.java b/src/main/org/owasp/html/HtmlSanitizer.java index <HASH>..<HASH> 100644 --- a/src/main/org/owasp/html/HtmlSanitizer.java +++ b/src/main/org/owasp/html/HtmlSanitizer.java @@ -101,12 +101,14 @@ public final class HtmlSanitizer { * {@link HtmlPolicyBuilder} provides an easy way to create policies. */ public static void sanitize(@Nullable String html, final Policy policy) { + if (html == null) { html = ""; } + HtmlStreamEventReceiver balancer = new TagBalancingHtmlStreamEventReceiver( policy); balancer.openDocument(); - HtmlLexer lexer = new HtmlLexer(html != null ? html : ""); + HtmlLexer lexer = new HtmlLexer(html); // Use a linked list so that policies can use Iterator.remove() in an O(1) // way. LinkedList<String> attrs = Lists.newLinkedList();
Simplified null parameter handling in HtmlSanitizer.sanitize to present a consistently non-null html parameter to the whole function body. If html is null, the loop will be entered but there's no need to confuse the JIT with calls to substring on a value that's been checked for null earlier in the method.
OWASP_java-html-sanitizer
train
java
efb6b541373d92d014cbbe220c69ca6caf9713cf
diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/RestrictedApiCheckerTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/RestrictedApiCheckerTest.java index <HASH>..<HASH> 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/RestrictedApiCheckerTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/RestrictedApiCheckerTest.java @@ -37,6 +37,7 @@ public class RestrictedApiCheckerTest { protected RestrictedApiCheckerTest(Class<? extends BugChecker> checker) { helper = CompilationTestHelper.newInstance(checker, RestrictedApiCheckerTest.class) + .addSourceFile("Allowlist.java") .addSourceFile("RestrictedApiMethods.java") .matchAllDiagnostics(); refactoringTest =
Explicitly add a test source that was previously being discovered on the sourcepath. PiperOrigin-RevId: <I>
google_error-prone
train
java
f86dc64c8b95ad2621f0d7f05878872f79341382
diff --git a/sick/tests/test_inference.py b/sick/tests/test_inference.py index <HASH>..<HASH> 100644 --- a/sick/tests/test_inference.py +++ b/sick/tests/test_inference.py @@ -12,6 +12,9 @@ import unittest import urllib import numpy as np +import matplotlib +matplotlib.use("Agg") + import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator
Allow for plotting on Travis CI
andycasey_sick
train
py
5a200006007ce39da5d5a5c1019c9aaf56a64a46
diff --git a/lib/url/analyzers/index-of.js b/lib/url/analyzers/index-of.js index <HASH>..<HASH> 100644 --- a/lib/url/analyzers/index-of.js +++ b/lib/url/analyzers/index-of.js @@ -47,10 +47,17 @@ async function extractLinks(token, options) { baseUrl = attributes.href } - if (isIndexOf && tag === 'a' && attributes.href && !attributes.href.startsWith('.')) { - const fullUrl = attributes.href.startsWith('/') ? - `${rootUrl}${attributes.href}` : - `${baseUrl}${attributes.href}` + if (isIndexOf && tag === 'a' && attributes.href) { + const parsedUrl = url.parse(attributes.href) + + let fullUrl + if (parsedUrl.protocol) { + fullUrl = attributes.href + } else if (parsedUrl.pathname.startsWith('/')) { + fullUrl = `${rootUrl}${attributes.href}` + } else { + fullUrl = `${baseUrl}${attributes.href}` + } if (fullUrl.startsWith(baseUrl) && fullUrl !== baseUrl) { links.push(fullUrl)
Handle full urls in index-of analyzer
geodatagouv_plunger
train
js
4fd6d01c8627bcf2b1a8e4c70e651f6ecbf431a0
diff --git a/src/Merge/ExtraPackage.php b/src/Merge/ExtraPackage.php index <HASH>..<HASH> 100644 --- a/src/Merge/ExtraPackage.php +++ b/src/Merge/ExtraPackage.php @@ -235,7 +235,7 @@ class ExtraPackage * * @param array $origin Primary collection * @param array $merge Additional collection - * @param bool $replace Replace exising links? + * @param bool $replace Replace existing links? * @param array &dups Duplicate storage * @return array Merged collection */
Fix typo in ExtraPackage::mergeLinks docs
wikimedia_composer-merge-plugin
train
php
61dd3637fdaedc9ef68727878d0a7e924b6c5142
diff --git a/src/AutosizeInput.js b/src/AutosizeInput.js index <HASH>..<HASH> 100644 --- a/src/AutosizeInput.js +++ b/src/AutosizeInput.js @@ -96,14 +96,14 @@ const AutosizeInput = React.createClass({ const inputStyle = Object.assign({}, this.props.inputStyle); inputStyle.width = this.state.inputWidth + 'px'; inputStyle.boxSizing = 'content-box'; - const { defaultValue, onChange, value } = this.props; - const inputProps = { defaultValue, onChange, value, placeholder: this.props.placeholder }; - const placeholder = this.props.placeholder ? <div ref="placeholderSizer" style={sizerStyle}>{this.props.placeholder}</div> : null; + const { defaultValue, onChange, placeholder, value } = this.props; + const inputProps = { defaultValue, onChange, value, placeholder }; + const placeholderElement = placeholder ? <div ref="placeholderSizer" style={sizerStyle}>{placeholder}</div> : null; return ( <div className={this.props.className} style={wrapperStyle}> <input {...inputProps} ref="input" className={this.props.inputClassName} style={inputStyle} /> <div ref="sizer" style={sizerStyle}>{sizerValue}</div> - {placeholder} + {placeholderElement} </div> ); },
more consistent approach to inputProps creation
JedWatson_react-input-autosize
train
js
7c8dd29107b7f175b4b3ecd70e0c1acf205af2b3
diff --git a/src/PHPStan/Faker/Reflection/FakerPropertiesClassReflectionExtension.php b/src/PHPStan/Faker/Reflection/FakerPropertiesClassReflectionExtension.php index <HASH>..<HASH> 100644 --- a/src/PHPStan/Faker/Reflection/FakerPropertiesClassReflectionExtension.php +++ b/src/PHPStan/Faker/Reflection/FakerPropertiesClassReflectionExtension.php @@ -106,6 +106,7 @@ class FakerPropertiesClassReflectionExtension implements PropertiesClassReflecti 'macProcessor' => [new StringType(), false, false, true], 'md5' => [new StringType(), false, false, true], 'mimeType' => [new StringType(), false, false, true], + 'mobileNumber' => [new StringType(), false, false, true], 'opera' => [new StringType(), false, false, true], 'paragraph' => [new StringType(), false, false, true], 'password' => [new StringType(), false, false, true],
Fix missing mobileNumber property "Access to an undefined property Faker\Generator::$mobileNumber."
finwe_phpstan-faker
train
php
f1e77e7ae7e76c9190d83d3c4fe73b56d438a46a
diff --git a/test/functional/ft_20_storage_participant.rb b/test/functional/ft_20_storage_participant.rb index <HASH>..<HASH> 100644 --- a/test/functional/ft_20_storage_participant.rb +++ b/test/functional/ft_20_storage_participant.rb @@ -188,6 +188,9 @@ class FtStorageParticipantTest < Test::Unit::TestCase #p page0, page1 assert_equal 4, (page0 + page1).sort.uniq.size + + assert_equal( + 2, @part.query('place' => 'heiankyou', :participant => 'alpha').size) end def test_initialize_engine_then_opts
added test for StorageParticipant#query(:participant => x)
jmettraux_ruote
train
rb
3ddc7e4ffafd9fcee5be8d0d42cb92578561a6ee
diff --git a/build/fruitmachine.js b/build/fruitmachine.js index <HASH>..<HASH> 100644 --- a/build/fruitmachine.js +++ b/build/fruitmachine.js @@ -641,6 +641,9 @@ module.exports = function(fm) { this._configure(options); this._add(options.children); + // Fire before initialize event hook + this.fireStatic('before initialize', options); + // Run initialize hooks if (this.initialize) this.initialize(options);
rebuild javascript - we have to find a better way to do this
ftlabs_fruitmachine
train
js
812894bd063100ca8ab710392605844a4f3e9f68
diff --git a/server/integration/infinispan/src/main/java/org/jboss/as/clustering/infinispan/subsystem/CacheAdd.java b/server/integration/infinispan/src/main/java/org/jboss/as/clustering/infinispan/subsystem/CacheAdd.java index <HASH>..<HASH> 100644 --- a/server/integration/infinispan/src/main/java/org/jboss/as/clustering/infinispan/subsystem/CacheAdd.java +++ b/server/integration/infinispan/src/main/java/org/jboss/as/clustering/infinispan/subsystem/CacheAdd.java @@ -483,7 +483,7 @@ public abstract class CacheAdd extends AbstractAddStepHandler { .wakeUpInterval(interval) ; // Only enable the reaper thread if we need it - if ((maxIdle > 0) || (lifespan > 0)) { + if (interval > 0) { builder.expiration().enableReaper(); } else { builder.expiration().disableReaper();
ISPN-<I> enable expiration reaper with the interval attribute only to purge entities in any case
infinispan_infinispan
train
java
07538c06238cdc41a7970564a83c8202e1d8bccc
diff --git a/test/test_process.rb b/test/test_process.rb index <HASH>..<HASH> 100644 --- a/test/test_process.rb +++ b/test/test_process.rb @@ -6,16 +6,16 @@ class TestProcess < Test::Unit::TestCase end # These actually excercise call_action in the back at this point - Kev - def test_start_bang_with_string_should_fork_exec + def test_call_action_with_string_should_fork_exec @p.start = "do something" @p.expects(:fork) - @p.start! + @p.call_action(:start) end - def test_start_bang_with_lambda_should_call + def test_call_action_with_lambda_should_call cmd = lambda { puts "Hi" } cmd.expects(:call) @p.start = cmd - @p.start! + @p.call_action(:start) end end \ No newline at end of file
Use call_action rather than helpers in tests
mojombo_god
train
rb
22d887a67d24ff7beba5e0fbd07fa50cbabecc4d
diff --git a/lib/swig.js b/lib/swig.js index <HASH>..<HASH> 100644 --- a/lib/swig.js +++ b/lib/swig.js @@ -636,7 +636,17 @@ exports.Swig = function (opts) { cb(err); return; } - cb(err, self.compile(src, options)); + + var compiled; + + try { + compiled = self.compile(src, options); + } catch (err2) { + cb(err2); + return; + } + + cb(err, compiled); }); return; }
When a callback is passed into compileFile, catch all errors thrown by compile and pass the error to callback
Thunf_swiger
train
js
5087d70a48de9823878e5dc3a860a803ec5a823a
diff --git a/lib/robohydra.js b/lib/robohydra.js index <HASH>..<HASH> 100644 --- a/lib/robohydra.js +++ b/lib/robohydra.js @@ -154,18 +154,18 @@ var exceptions = require('./exceptions.js'), throw new RoboHydraPluginNotFoundException(pluginName); }; RoboHydra.prototype.headForPath = function(url, afterHead) { - var canMatch = !afterHead; + var canMatchYet = !afterHead; for (var i = 0, len = this._plugins.length; i < len; i++) { var plugin = this._plugins[i].plugin; for (var j = 0, len2 = plugin.heads.length; j < len2; j++) { - if (canMatch && plugin.heads[j].canHandle(url)) { + if (canMatchYet && plugin.heads[j].canHandle(url)) { return {plugin: plugin, head: plugin.heads[j]}; } if (typeof afterHead === 'object' && this._plugins[i].plugin.name === afterHead.plugin.name && plugin.heads[j].name === afterHead.head.name) { - canMatch = true; + canMatchYet = true; } } }
Trivial refactoring: rename variable
robohydra_robohydra
train
js
39cf38dd90a0df130ecf6846468f6256ad9d4ac9
diff --git a/plyfile.py b/plyfile.py index <HASH>..<HASH> 100644 --- a/plyfile.py +++ b/plyfile.py @@ -21,6 +21,12 @@ import numpy as _np from sys import byteorder as _byteorder +try: + range = xrange +except: + pass + + _data_types = { 'int8': 'i1', 'char': 'i1',
Use xrange in favor of range when available The definition of `range' changed between Python 2 and Python 3: Python 3's `range' is closer to Python 2's `xrange', which is normally preferred on Python 2. This commit should use the right one on both Python versions.
dranjan_python-plyfile
train
py
fc827cc58de7380767a2ddf946d5869098f0ea0a
diff --git a/go/chat/server_test.go b/go/chat/server_test.go index <HASH>..<HASH> 100644 --- a/go/chat/server_test.go +++ b/go/chat/server_test.go @@ -3871,6 +3871,7 @@ func TestChatSrvRetentionSweepTeam(t *testing.T) { } func TestChatSrvSetConvMinWriterRole(t *testing.T) { + t.Skip("not passing locally") runWithMemberTypes(t, func(mt chat1.ConversationMembersType) { // Only run this test for teams switch mt {
Skip TestChatSrvSetConvMinWriterRole
keybase_client
train
go
2ad753c08ccdb26296588f8270aa19d8d1f6a3e4
diff --git a/core/interpreter/src/main/java/org/overture/interpreter/runtime/LatexSourceFile.java b/core/interpreter/src/main/java/org/overture/interpreter/runtime/LatexSourceFile.java index <HASH>..<HASH> 100644 --- a/core/interpreter/src/main/java/org/overture/interpreter/runtime/LatexSourceFile.java +++ b/core/interpreter/src/main/java/org/overture/interpreter/runtime/LatexSourceFile.java @@ -160,7 +160,7 @@ public class LatexSourceFile extends SourceFile spaced = utfIncludeCheck(spaced, false); spaced = spaced.replace(docFont, sectionFont); } - out.println(spaced); + out.println(utfIncludeCheck(spaced, true)); } } else {
add markup strings for outside of vdmpp
overturetool_overture
train
java
89c0fad405e83545db0f4e30b937656bcd5e3297
diff --git a/app/controllers/confirmations_controller.rb b/app/controllers/confirmations_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/confirmations_controller.rb +++ b/app/controllers/confirmations_controller.rb @@ -2,7 +2,7 @@ module Milia class ConfirmationsController < Devise::ConfirmationsController - skip_before_action :authenticate_tenant!, :only => [:show, :new, :create] + skip_before_action :authenticate_tenant! #, :only => [:show, :new, :create] end # class end # module
milia control expanded with app ctlr basics - 6c
jekuno_milia
train
rb
448925fd52a3285b43f7f53adbb1e81129511b80
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -10,16 +10,18 @@ def read(fname): setup( name=package.__name__, + version=package.__version__, + description=package.__description__, + long_description=package.__doc__, author='Joe Esposito', author_email='[email protected]', url='http://github.com/joeyespo/gitpress', license='MIT', - version=package.__version__, - description=package.__description__, - long_description=package.__doc__, platforms='any', packages=find_packages(), package_data={package.__name__: ['LICENSE']}, - entry_points={'console_scripts': ['gitpress = gitpress.command:main']}, + include_package_data=True, install_requires=read('requirements.txt'), + zip_safe=False, + entry_points={'console_scripts': ['gitpress = gitpress.command:main']}, )
Add and reorganize arguments in setup.py.
joeyespo_gitpress
train
py
23e0f904989521075aee1e4120d6fac79b739ca4
diff --git a/rebulk/__version__.py b/rebulk/__version__.py index <HASH>..<HASH> 100644 --- a/rebulk/__version__.py +++ b/rebulk/__version__.py @@ -4,4 +4,4 @@ Version module """ # pragma: no cover -__version__ = '0.7.1.dev0' +__version__ = '0.7.1'
Preparing release <I>
Toilal_rebulk
train
py
efd7165ca41ab993f1ce89afde7a7b4212c306b1
diff --git a/views/js/controller/Delivery/monitoring.js b/views/js/controller/Delivery/monitoring.js index <HASH>..<HASH> 100644 --- a/views/js/controller/Delivery/monitoring.js +++ b/views/js/controller/Delivery/monitoring.js @@ -318,7 +318,7 @@ define([ id: 'reactivate', type: 'error', label: __('Reactivate session'), - icon: 'stop', + icon: 'play', close: true, action: function() {reactivate(selection);} });
- replace icon with play actions for Reactivate button
oat-sa_extension-tao-proctoring
train
js
390a08a3ecf4e158cbc2363c15ead9d274cb6a4a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ setup(name='pyxtuml', description='Library for parsing, manipulating, and generating BridgePoint xtUML models', author='John Törnblom', author_email='[email protected]', - url='https://github.com/john-tornblom/pyxtuml', + url='https://github.com/xtuml/pyxtuml', license='GPLv3', classifiers=[ 'Development Status :: 4 - Beta',
set the url listed on pypi.python.org to point at the xtuml organisation repo
xtuml_pyxtuml
train
py
451d8fe359cbacaa16fbb24bf6137d71f5d4365d
diff --git a/test/validators.js b/test/validators.js index <HASH>..<HASH> 100644 --- a/test/validators.js +++ b/test/validators.js @@ -443,6 +443,10 @@ describe('Validators', function () { , '256.0.0.0' , '0.0.0.256' , '26.0.0.256' + , '0200.200.200.200' + , '200.0200.200.200' + , '200.200.0200.200' + , '200.200.200.0200' , '::banana' , 'banana::' , '::1banana' diff --git a/validator.js b/validator.js index <HASH>..<HASH> 100644 --- a/validator.js +++ b/validator.js @@ -54,7 +54,7 @@ var macAddress = /^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/; - var ipv4Maybe = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/ + var ipv4Maybe = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ , ipv6Block = /^[0-9A-F]{1,4}$/i; var uuid = {
fixed wrongly approved zero padded ip 4
chriso_validator.js
train
js,js
561a0c73cec0d5aa9df97946eb97780a018381b5
diff --git a/config.js b/config.js index <HASH>..<HASH> 100644 --- a/config.js +++ b/config.js @@ -76,7 +76,7 @@ module.exports = function() { var config; - // Load config if available + // Load config if available, fall back to defaults try { config = JSON.parse(fs.readFileSync(Utils.makePathAbsolute("sneakers.json"), "utf8")); } catch (err) {
config: improved explanation of how config works
shippjs_shipp-server
train
js
594e0e311090746376857d7234631c3e5bb276de
diff --git a/test_path.py b/test_path.py index <HASH>..<HASH> 100644 --- a/test_path.py +++ b/test_path.py @@ -79,12 +79,8 @@ class TestBasics: def test_construction_from_none(self): """""" - try: + with pytest.raises(TypeError): Path(None) - except TypeError: - pass - else: - raise Exception("DID NOT RAISE") def test_construction_from_int(self): """
Prefer pytest.raises
jaraco_path.py
train
py
1f30454292c775f7c45e5f154b9ce32d0d5d081e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -5,14 +5,32 @@ use_setuptools(version='0.6c9') import os from setuptools import setup, find_packages +def read(fname): + return open(os.path.join(os.path.dirname(__file__), fname)).read() + setup( name = 'fabulous', version = __import__('fabulous').__version__, description = 'Makes your terminal output totally fabulous', - long_description = open('README').read(), + long_description = read('README'), license = 'BSD', install_requires = ['grapefruit'], packages = find_packages(), setup_requires = ["setuptools_hg"], - zip_safe = True, + zip_safe = False, + # http://wiki.python.org/moin/CheeseShopTutorial + # http://pypi.python.org/pypi?:action=list_classifiers + classifiers=[ + "Development Status :: 2 - Pre-Alpha", + "License :: OSI Approved :: BSD License", + "Environment :: Console", + "Intended Audience :: Developers", + "Programming Language :: C", + "Programming Language :: Python", + "Topic :: Utilities", + "Topic :: Artistic Software", + "Topic :: System :: Logging", + "Topic :: Multimedia :: Graphics" + "Topic :: Terminals :: Terminal Emulators/X Terminals", + ], )
classify setup.py for eventual cheeseshop submission
jart_fabulous
train
py
ceeb44fc5a23177b5137d243b2cd3714d6c53633
diff --git a/buffer.js b/buffer.js index <HASH>..<HASH> 100644 --- a/buffer.js +++ b/buffer.js @@ -146,7 +146,7 @@ function createBuffer(gl, type, data, usage) { var tmp = pool.malloc(data.shape[0], dtype) var ndt = ndarray(tmp) ops.assign(ndt, data) - this.gl.bufferData(this.type, tmp, usage) + gl.bufferData(type, tmp, usage) pool.free(tmp) } } else {
Fix variables in createBuffer for ndarrays
stackgl_gl-buffer
train
js
56020a35a04d1578ae64ed21ab87c6a6cacc80a3
diff --git a/lib/weechat/window.rb b/lib/weechat/window.rb index <HASH>..<HASH> 100644 --- a/lib/weechat/window.rb +++ b/lib/weechat/window.rb @@ -1,5 +1,26 @@ module Weechat + # == Gettable properties + # + # [x] X position of the window in the terminal + # [y] Y position of the window in the terminal + # [width] Width of the window + # [height] Height of the window + # [width_pct] Width relative to the one of the parent window (0..100%) + # [height_pct] Height relative to the one of the parent window (0..100%) + # [first_line_displayed?] True if the first line of the displayed buffer is displayed on the screen + # [scrolling?] True if the window is currently being scrolled + # [scrolling_lines] Number of lines that are not being displayed (in the bottom direction) + # + # == The chat area + # + # See {Window::Chat} class Window + # == Gettable properties + # + # [x] X position of the chat area + # [y] Y position of the chat area + # [width] Width of the chat area + # [height] Height of the chat area class Chat %w(x y width height).each do |prop| define_method(prop) do
added documentation to Window and Window::Chat
dominikh_weechat-ruby
train
rb
6747a12ce1cfd3b3f0ee4e1df9a1015d41b2e7d8
diff --git a/test/tests/tokenParsing.js b/test/tests/tokenParsing.js index <HASH>..<HASH> 100644 --- a/test/tests/tokenParsing.js +++ b/test/tests/tokenParsing.js @@ -43,7 +43,7 @@ define(function(require, exports, module) { var template = combyne("'{{ hello }} world'"); var output = template.render({ hello: 'hello' }); - assert.equal(output, "hello world"); + assert.equal(output, "'hello world'"); }); }); });
Forgot the single quotes around hello world for the test
tbranyen_combyne
train
js
b7293fa00f327e18471a90e657b19567ae90d994
diff --git a/src/map/Map.Camera.js b/src/map/Map.Camera.js index <HASH>..<HASH> 100644 --- a/src/map/Map.Camera.js +++ b/src/map/Map.Camera.js @@ -383,12 +383,19 @@ Map.include(/** @lends Map.prototype */{ const cameraCenterDistance = this.cameraCenterDistance = distance(this.cameraPosition, this.cameraLookAt); let farZ = cameraCenterDistance; if (pitch > 0) { - const tanB = Math.tan(fov / 2); - const tanP = Math.tan(pitch * Math.PI / 180); - farZ += (cameraCenterDistance * tanB) / (1 / tanP - tanB); + pitch = pitch * Math.PI / 180; + let y; + if (2 / Math.PI - pitch <= fov / 2) { + y = 4 * cameraCenterDistance; + } else { + const tanFov = Math.tan(fov / 2); + const tanP = Math.tan(pitch); + y = (cameraCenterDistance * tanFov) / (1 / tanP - tanFov); + } + farZ += y; } //TODO 地下的图形无法显示 - return farZ + 0.01; + return farZ + 1.0; }, _calcCascadeMatrixes: function () {
fix camera far when pitch > fov / 2
maptalks_maptalks.js
train
js
05916ed32ec9206baff2dd917440569bbae8c106
diff --git a/tutorials/future/tf2/cifar10_tutorial.py b/tutorials/future/tf2/cifar10_tutorial.py index <HASH>..<HASH> 100644 --- a/tutorials/future/tf2/cifar10_tutorial.py +++ b/tutorials/future/tf2/cifar10_tutorial.py @@ -50,7 +50,17 @@ def ld_cifar10(): dataset, info = tfds.load('cifar10', with_info=True, as_supervised=True) - mnist_train, mnist_test = dataset['train'], dataset['test'] + + def augment_mirror(x): + return tf.image.random_flip_left_right(x) + + def augment_shift(x, w=4): + y = tf.pad(x, [[w] * 2, [w] * 2, [0] * 2], mode='REFLECT') + return tf.random_crop(y, tf.shape(x)) + + mnist_train, mnist_test = dataset['train'], dataset['test'] + # Augmentation helps a lot in CIFAR10 + mnist_train = mnist_train.map(lambda x, y: (augment_mirror(augment_shift(x)), y)) mnist_train = mnist_train.map(convert_types).shuffle(10000).batch(128) mnist_test = mnist_test.map(convert_types).batch(128) return EasyDict(train=mnist_train, test=mnist_test)
Update tutorials/future/tf2/cifar<I>_tutorial.py
tensorflow_cleverhans
train
py
c7060ae19f40f37bf38c4dd13d09baab15179ee5
diff --git a/bookstore/clone.py b/bookstore/clone.py index <HASH>..<HASH> 100644 --- a/bookstore/clone.py +++ b/bookstore/clone.py @@ -84,7 +84,7 @@ class BookstoreCloneHandler(IPythonHandler): class BookstoreCloneAPIHandler(APIHandler): """Handle notebook clone from storage. - Provides API handling for ``POST`` when cloning a notebook + Provides API handling for ``POST`` and clones a notebook from storage (S3). Methods
Update bookstore/clone.py
nteract_bookstore
train
py
4d44de9d1278d0f2f1e45a2bbc9fd098b334fa5e
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -67,6 +67,29 @@ function createError(file, src, paths) { } /** + * Create bad import rule error + * + * @param {String} rule + * @api private + */ + +function createImportError(rule) { + var url = rule.import ? rule.import.replace(/\r?\n/g, ' ') : '<no url>'; + var err = ['Bad import url: @import ' + url]; + + if (rule.position) { + err.push(' starting at line ' + rule.position.start.line + ' column ' + rule.position.start.column); + err.push(' ending at line ' + rule.position.end.line + ' column ' + rule.position.end.column); + + if (rule.position.source) { + err.push(' in ' + rule.position.source); + } + } + + return err.join('\n'); + } + +/** * Check if a file exists * * @param {String} file @@ -127,6 +150,10 @@ function run(style, opts) { var data = parse(importRule)[0]; var pos = rule.position ? rule.position.source : null; + if (!data) { + throw Error(createImportError(rule)); + } + if (urlRegex({ exact: true }).test(data.path)) { ret.push(rule); return;
create meaningful exception for: Cannot read property 'path' of undefined
reworkcss_rework-import
train
js
c7002d03ab74d5d17f70ad58008d7ba76355842f
diff --git a/tio/files.go b/tio/files.go index <HASH>..<HASH> 100644 --- a/tio/files.go +++ b/tio/files.go @@ -90,7 +90,7 @@ func SplitPath(filePath string) (dir string, base string, ext string) { // FileExists does a proper check on wether a file exists or not. func FileExists(filePath string) bool { - _, err := os.Stat(filePath) + _, err := os.Lstat(filePath) return !os.IsNotExist(err) }
Fixed FileExists for symlinks
trivago_tgo
train
go
c84332863f250905cbb8a55adf0ac29666ce60d7
diff --git a/twitter/statuses.go b/twitter/statuses.go index <HASH>..<HASH> 100644 --- a/twitter/statuses.go +++ b/twitter/statuses.go @@ -9,7 +9,6 @@ import ( // Tweet represents a Twitter Tweet, previously called a status. // https://dev.twitter.com/overview/api/tweets -// Deprecated fields: Contributors, Geo, Annotations type Tweet struct { Coordinates *Coordinates `json:"coordinates"` CreatedAt string `json:"created_at"`
Removed comment about Deprecated fields * Comment caused some IDEs, such as Gogland <I>, to mark the entire Tweet struct type as deprecated, causing warnings on commit
dghubble_go-twitter
train
go
decfce4e7243a0435de597b50507520bfb680014
diff --git a/src/bundle/Resources/public/js/OnlineEditor/toolbars/config/base.js b/src/bundle/Resources/public/js/OnlineEditor/toolbars/config/base.js index <HASH>..<HASH> 100644 --- a/src/bundle/Resources/public/js/OnlineEditor/toolbars/config/base.js +++ b/src/bundle/Resources/public/js/OnlineEditor/toolbars/config/base.js @@ -42,7 +42,7 @@ export default class EzConfigBase extends EzConfigButtonsBase { const scrollLeft = parseInt(block.$.scrollLeft, 10); const blockLeftMargin = block.$.offsetLeft; const blockWidth = block.$.offsetWidth; - const toolbarWidth = document.querySelector('.ae-toolbar-floating').offsetWidth; + const toolbarWidth = document.querySelector('.ae-toolbar-styles').offsetWidth; const maxLeft = blockWidth - toolbarWidth; range.selectNodeContents(positionReference.$);
IBX-<I>: Fixed wrong class taken to calculate toolbar's width (#<I>)
ezsystems_ezplatform-richtext
train
js
cdcd78c95e45ac29e4431ae40860117ef1718432
diff --git a/includes/admin/pb-laf.php b/includes/admin/pb-laf.php index <HASH>..<HASH> 100644 --- a/includes/admin/pb-laf.php +++ b/includes/admin/pb-laf.php @@ -900,6 +900,8 @@ function admin_notices() { foreach ( $_SESSION['pb_errors'] as $msg ) { echo '<div class="error"><p>' . $msg . '</p></div>'; } + // Destroy + unset( $_SESSION['pb_errors'] ); } if ( ! empty( $_SESSION['pb_notices'] ) ) { @@ -911,9 +913,7 @@ function admin_notices() { foreach ( $_SESSION['pb_notices'] as $msg ) { echo '<div class="updated"><p>' . $msg . '</p></div>'; } + // Destroy + unset( $_SESSION['pb_notices'] ); } - - // Destroy - unset( $_SESSION['pb_errors'] ); - unset( $_SESSION['pb_notices'] ); }
Only unset $_SESSION vars if they are set (#<I>).
pressbooks_pressbooks
train
php
e0cd41e7e5ec61f30e0c1d8b283ebffe04ebce15
diff --git a/lib/spring/application.rb b/lib/spring/application.rb index <HASH>..<HASH> 100644 --- a/lib/spring/application.rb +++ b/lib/spring/application.rb @@ -73,11 +73,20 @@ module Spring } manager.puts pid - _, status = Process.wait2 pid - ensure + + # Wait in a separate thread so we can run multiple commands at once + Thread.new { + _, status = Process.wait2 pid + streams.each(&:close) + client.puts(status.exitstatus) + client.close + } + + rescue => e streams.each(&:close) if streams - client.puts(status ? status.exitstatus : 1) + client.puts(1) client.close + raise end # The command might need to require some files in the
Allow multiple commands to run at once E.g. if you have several terminals open and are running two test commands at once. Closes #<I>
rails_spring
train
rb
844374601b4fe4427aff2d129b5654585fe30c91
diff --git a/test/spec/index.js b/test/spec/index.js index <HASH>..<HASH> 100644 --- a/test/spec/index.js +++ b/test/spec/index.js @@ -1,8 +1,11 @@ module.exports = { + // core functionality exports: require('./exports'), core: require('./core'), - create: require('./create'), get: require('./get'), plugin: require('./plugin'), + + // plugin tests append: require('./append'), + create: require('./create'), }
Update test order. Test core functionality first followed by plugins.
socialally_air
train
js
24943d856c687774b58a32e4131e54c3bd16baa0
diff --git a/src/Friday/Helper/PHPParser.php b/src/Friday/Helper/PHPParser.php index <HASH>..<HASH> 100644 --- a/src/Friday/Helper/PHPParser.php +++ b/src/Friday/Helper/PHPParser.php @@ -81,7 +81,7 @@ class PHPParser public function __construct($code) { $this->string = $code; - $this->removeComment(); + $this->addComment(); } /** @@ -317,9 +317,9 @@ class PHPParser * * @return void */ - public function removeComment() + public function addComment() { - $this->string = str_replace('{{--', '', $this->string); - $this->string = str_replace('--}}', '', $this->string); + $this->string = str_replace('{{--', '<!--', $this->string); + $this->string = str_replace('--}}', '-->', $this->string); } }
removeComment renamed to addComment
ironphp_ironphp
train
php