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
535de201f5e70c37cf86abcdc9dd47f9a9f0100d
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -115,11 +115,7 @@ setup( "external = bob.bio.spear.config.annotator.external:annotator", # external VAD ], "bob.bio.preprocessor": [ - "cqcc20p = bob.bio.spear.config.extractor.cqcc20:cqcc20", # Empty preprocessor for CQCC features - "energy-2gauss = bob.bio.spear.config.preprocessor.energy_2gauss:preprocessor", # two Gauss energy - "energy-thr = bob.bio.spear.config.preprocessor.energy_thr:preprocessor", # thresholded energy - "mod-4hz = bob.bio.spear.config.preprocessor.mod_4hz:preprocessor", # mod_4hz - "external = bob.bio.spear.config.preprocessor.external:preprocessor", # external VAD + "cqcc20p = bob.bio.spear.config.extractor.cqcc20:cqcc20", # Empty preprocessor for CQCC features ], "bob.bio.extractor": [ "cqcc20e = bob.bio.spear.config.extractor.cqcc20:cqcc20", # Extractor (reads Matlab files) for CQCC features
Remove annotators from preprocessor resources
bioidiap_bob.bio.spear
train
py
aca727b1570a9016bac77c078540eeedf90d5291
diff --git a/src/Providers/TelegramServiceProvider.php b/src/Providers/TelegramServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Providers/TelegramServiceProvider.php +++ b/src/Providers/TelegramServiceProvider.php @@ -32,7 +32,7 @@ class TelegramServiceProvider extends ServiceProvider $this->mergeConfigFrom(__DIR__.'/../../stubs/telegram.php', 'botman.telegram'); $this->commands([ - TelegramRegisterCommand::class + TelegramRegisterCommand::class, ]); } }
Apply fixes from StyleCI (#<I>)
botman_driver-telegram
train
php
1ca1142ffab8ce7aff857a54ac2264fb3a6641d4
diff --git a/ella/newman/media/js/generic.suggest.js b/ella/newman/media/js/generic.suggest.js index <HASH>..<HASH> 100644 --- a/ella/newman/media/js/generic.suggest.js +++ b/ella/newman/media/js/generic.suggest.js @@ -348,7 +348,7 @@ GenericSuggestLib = {}; var sug_url = $input.attr('rel'); // The rel attribute is a relative address. // If we're using the content-by-hash library, we want it to be relative to what's in the hash. - if (window.adr && $.isFunction(adr)) sug_url = adr(sug_url, { just_get: 1 }); + if (window.adr && $.isFunction(adr)) sug_url = adr(sug_url, { just_get: 'address' }); if (offset == null || offset < 0) offset = 0;
Reflected the change in adr() to generic.suggest.
ella_ella
train
js
0c858e9909d741b14cca1781e3cf06687fb55921
diff --git a/src/Argument/Argument.php b/src/Argument/Argument.php index <HASH>..<HASH> 100644 --- a/src/Argument/Argument.php +++ b/src/Argument/Argument.php @@ -354,6 +354,14 @@ class Argument } /** + * @deprecated use values() instead. + */ + public function valueArray() + { + return $this->values(); + } + + /** * Set an argument's value based on its command line entry. * * Argument values are type cast based on the value of $castTo.
Avoid breaking BC in version <I>
thephpleague_climate
train
php
8905ee36a8339b8e237d370fea790a994350a6d9
diff --git a/src/Application.php b/src/Application.php index <HASH>..<HASH> 100644 --- a/src/Application.php +++ b/src/Application.php @@ -30,7 +30,7 @@ class Application extends BaseApplication /** * @var string */ - const VERSION = '1.0.0-beta4'; + const VERSION = '1.0.0-beta5'; /** * @var string
[console] Tag <I>-beta5 version. (#<I>)
hechoendrupal_drupal-console
train
php
9d53d016a903a21195d43e7ef49d86fd0882cdca
diff --git a/python/thunder/rdds/data.py b/python/thunder/rdds/data.py index <HASH>..<HASH> 100644 --- a/python/thunder/rdds/data.py +++ b/python/thunder/rdds/data.py @@ -127,6 +127,7 @@ class Data(object): This calls the Spark cache() method on the underlying RDD. """ self.rdd.cache() + return self def filterOnKeys(self, func): """ Filter records by applying a function to keys """
Cache needs to return self for proper chaining
thunder-project_thunder
train
py
7592c07406f957cc4d6e7aecf223249e8ddfc8aa
diff --git a/src/Illuminate/Database/Eloquent/Relations/MorphTo.php b/src/Illuminate/Database/Eloquent/Relations/MorphTo.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Database/Eloquent/Relations/MorphTo.php +++ b/src/Illuminate/Database/Eloquent/Relations/MorphTo.php @@ -159,12 +159,14 @@ class MorphTo extends BelongsTo { $key = $instance->getKeyName(); - if ($this->withTrashed && $instance->newQuery()->getMacro('withTrashed') !== null) + $query = $instance->newQuery(); + + if ($this->withTrashed && $query->getMacro('withTrashed') !== null) { - $instance = $instance->withTrashed(); + $query = $query->withTrashed(); } - return $instance->whereIn($key, $this->gatherKeysByType($type)->all())->get(); + return $query->whereIn($key, $this->gatherKeysByType($type)->all())->get(); } /**
[<I>] Always operate with query builder to prevent possible bugs
laravel_framework
train
php
4ae75733224303276d3aacf0f11c8ed2319a7326
diff --git a/grimoire_elk/elastic_items.py b/grimoire_elk/elastic_items.py index <HASH>..<HASH> 100644 --- a/grimoire_elk/elastic_items.py +++ b/grimoire_elk/elastic_items.py @@ -81,11 +81,6 @@ class ElasticItems(): from .utils import get_connector_name return get_connector_name(type(self)) - def get_connector_backend_name(self): - """ Find the name for the current connector """ - from .utils import get_connector_backend_name - return get_connector_backend_name(type(self)) - # Items generator def fetch(self, _filter=None): """ Fetch the items from raw or enriched index. An optional _filter @@ -142,14 +137,6 @@ class ElasticItems(): filters = self.get_repository_filter_raw(term=True) filters = json.dumps(filters) - # Filter also using the backend_name to let a raw index with items - # from different backends (arthur common raw index) - filters += ''' - , {"term": - { "backend_name":"%s" } - } - ''' % (self.get_connector_backend_name()) - if self.filter_raw: filters += ''' , {"term":
[arthur] Remove filtering using the backend name The common arthur ES index with all raw items is not used anymore. GrimoireELK will read all items from redis and distribute them in different raw indexes.
chaoss_grimoirelab-elk
train
py
f4bc671f7ed27d7ef34596898c251bef319890fe
diff --git a/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java b/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java index <HASH>..<HASH> 100644 --- a/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java +++ b/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java @@ -93,7 +93,11 @@ public abstract class AbstractCassandraDaemon implements CassandraDaemon } }); - // check the system table for mismatched partitioner. + // check the system table to keep user from shooting self in foot by changing partitioner, cluster name, etc. + // we do a one-off scrub of the system table first; we can't load the list of the rest of the tables, + // until system table is opened. + for (CFMetaData cfm : DatabaseDescriptor.getTableMetaData(Table.SYSTEM_TABLE).values()) + ColumnFamilyStore.scrubDataDirectories(Table.SYSTEM_TABLE, cfm.cfName); try { SystemTable.checkHealth(); @@ -115,7 +119,7 @@ public abstract class AbstractCassandraDaemon implements CassandraDaemon System.exit(100); } - // clean up debris. + // clean up debris in the rest of the tables for (String table : DatabaseDescriptor.getTables()) { for (CFMetaData cfm : DatabaseDescriptor.getTableMetaData(table).values())
scrub System keyspace before opening it patch by jbellis; reviewed by gdusbabek for CASSANDRA-<I> git-svn-id: <URL>
Stratio_stratio-cassandra
train
java
f18af50962988a192fec2c551e3639e7bc7ae17d
diff --git a/gogdb_test.go b/gogdb_test.go index <HASH>..<HASH> 100644 --- a/gogdb_test.go +++ b/gogdb_test.go @@ -100,13 +100,32 @@ err2 cerr2 ResetIOs() prbgtest() So(ErrString(), ShouldEqual, - ` [prbgtest:111] (func.010:101) + ` [prbgtest:126] (func.010:101) prbgtest content `) }) + + Convey("Test pdbg print with custom instance", func() { + apdbg := NewPdbg(SetBuffers) + apdbg.Pdbgf("test2") + So(apdbg.ErrString(), ShouldEqual, + `[func.011:110] + test2 +`) + apdbg.ResetIOs() + prbgtestCustom(apdbg) + So(apdbg.ErrString(), ShouldEqual, + ` [prbgtestCustom:130] (func.011:116) + prbgtest content2 +`) + }) }) } func prbgtest() { Pdbgf("prbgtest content") } + +func prbgtestCustom(pdbg *Pdbg) { + pdbg.Pdbgf("prbgtest content2") +}
Test pdbg print with custom instance
VonC_godbg
train
go
d717d906e81780acda469077aaf7f4fb76235173
diff --git a/lib/Predis.php b/lib/Predis.php index <HASH>..<HASH> 100644 --- a/lib/Predis.php +++ b/lib/Predis.php @@ -448,9 +448,11 @@ abstract class Command implements ICommand { $key = $this->_arguments[0]; $start = strpos($key, '{'); - $end = strpos($key, '}'); - if ($start !== false && $end !== false) { - $key = substr($key, ++$start, $end - $start); + if ($start !== false) { + $end = strpos($key, '}'); + if ($end !== false) { + $key = substr($key, ++$start, $end - $start); + } } $this->_hash = $distributor->generateKey($key);
Optimize when a pair of curly brackets for key tagging is missing.
imcj_predis
train
php
c25d4f56996fb893c059fb1017855d25936d81b5
diff --git a/environs/cloudinit/cloudinit.go b/environs/cloudinit/cloudinit.go index <HASH>..<HASH> 100644 --- a/environs/cloudinit/cloudinit.go +++ b/environs/cloudinit/cloudinit.go @@ -400,6 +400,8 @@ func (cfg *MachineConfig) dataFile(name string) string { return path.Join(cfg.DataDir, name) } +// TargetRelease returns a string suitable for use with apt-get --target-release +// based on the machines series. func (cfg *MachineConfig) TargetRelease() string { targetRelease := "" if cfg.Tools.Version.Series == "precise" {
cloudinit: documented TargetRelease
juju_juju
train
go
cc12fe4a66b1d1de4d31dcb5b8e44a87c2986119
diff --git a/AI/toolbox/Toolbox.py b/AI/toolbox/Toolbox.py index <HASH>..<HASH> 100644 --- a/AI/toolbox/Toolbox.py +++ b/AI/toolbox/Toolbox.py @@ -74,9 +74,21 @@ class Toolbox(): txtImport = 'import ' + tool['file'] #exec txtImport - mod = map(__import__, [tool['file']]) + # mod = map(__import__, [tool['file']]) + mod = __import__( tool['file']) + #mod = __import__( os.path.basename(tool['file']).split('.')[0]) + print(tool['function']) + txtFunction = os.path.basename(tool['file']).split('.')[0] + '.' + tool['function'] + print(txtFunction) + + #exec txtFunction + func = getattr(mod, tool['function']) + func() + + + #import importlib #importlib.import_module(tool['file']) #importlib.import_module('solve_knapsack')
working on running external function dynamically - still buggy
acutesoftware_AIKIF
train
py
5476913fbaee5eedab4c1f56893e7164ad126d01
diff --git a/spanpropagator.go b/spanpropagator.go index <HASH>..<HASH> 100644 --- a/spanpropagator.go +++ b/spanpropagator.go @@ -46,7 +46,7 @@ func (s *tracerImpl) PropagateSpanAsBinary( sc := sp.(*spanImpl).raw.StandardContext var err error var sampledByte byte = 0 - if !sc.Sampled { + if sc.Sampled { sampledByte = 1 }
Fix the fix in #<I> namely setting Sampled on the child whenever it was not set on the parent. Caught by the test from #<I>. Much can be won by a simple one-liner setup on Travis/CircleCI, pre-stabilization or not. The current situation is frankly a little insane. Happy to set that up, just need the corresponding rights on the repository.
opentracing_basictracer-go
train
go
e78b8e818d65e6a614705984042745ad5bc21379
diff --git a/redisco/containers.py b/redisco/containers.py index <HASH>..<HASH> 100644 --- a/redisco/containers.py +++ b/redisco/containers.py @@ -166,9 +166,6 @@ class Set(Container): self.db.sdiffstore(self.key, [self.key, other.key]) return self - def __repr__(self): - return u"<redisco.containers.Set(key=%s)>" % self.key - def all(self): return self.db.smembers(self.key) members = property(all) @@ -346,7 +343,7 @@ class TypedList(object): if self._redisco_model: return filter(lambda o: o is not None, [self.klass.objects.get_by_id(v) for v in values]) else: - return [self.klass(value, *self._klass_args, **self._klass_kwargs) for v in values] + return [self.klass(v, *self._klass_args, **self._klass_kwargs) for v in values] def all(self): """Returns all items in the list.""" @@ -382,7 +379,7 @@ class TypedList(object): yield self[i] def __repr__(self): - return repr(self.typecast_iter(self.members)) + return repr(self.typecast_iter(self.list)) class SortedSet(Container):
Fixes pylint errors E:<I>:Set.__repr__: method already defined line <I> E:<I>:TypedList.typecast_iter: Undefined variable 'value' E:<I>:TypedList.__repr__: Instance of 'TypedList' has no 'members' member
iamteem_redisco
train
py
ccb3ad7cd5bd8469e3072cd204dbea13c7de5604
diff --git a/girder/events.py b/girder/events.py index <HASH>..<HASH> 100644 --- a/girder/events.py +++ b/girder/events.py @@ -321,6 +321,8 @@ daemon = ForegroundEventsDaemon() def setupDaemon(): global daemon + daemon.stop() + if config.getConfig()['server'].get('disable_event_daemon', False): daemon = ForegroundEventsDaemon() else:
Stop daemon before reassigning it
girder_girder
train
py
e26fac2400a82f8851cf0931f1363155b6ce6766
diff --git a/piazza_api/__init__.py b/piazza_api/__init__.py index <HASH>..<HASH> 100644 --- a/piazza_api/__init__.py +++ b/piazza_api/__init__.py @@ -1,3 +1,3 @@ from piazza_api.piazza import Piazza -__version__ = "0.3.0" +__version__ = "0.4.0" diff --git a/piazza_api/network.py b/piazza_api/network.py index <HASH>..<HASH> 100644 --- a/piazza_api/network.py +++ b/piazza_api/network.py @@ -1,3 +1,5 @@ +from collections import namedtuple + from .rpc import PiazzaRPC @@ -52,6 +54,19 @@ class Network(object): self._rpc = PiazzaRPC(network_id=self._nid) self._rpc.cookies = cookies + ff = namedtuple('FeedFilters', ['unread', 'following', 'folder']) + self._feed_filters = ff(UnreadFilter, FollowingFilter, FolderFilter) + + @property + def feed_filters(self): + """namedtuple instance containing FeedFilter classes for easy access + + :rtype: namedtuple + :returns: namedtuple with unread, following, and folder attributes + mapping to filters + """ + return self._feed_filters + ######### # Posts # #########
feat(user): Add feed_filters property to Network for easy access
hfaran_piazza-api
train
py,py
73ef991a82274c13adf0fc1140fe98eb0877ad2a
diff --git a/pyshtools/classes.py b/pyshtools/classes.py index <HASH>..<HASH> 100644 --- a/pyshtools/classes.py +++ b/pyshtools/classes.py @@ -31,10 +31,10 @@ from _SHTOOLS import * #=========== COEFFICIENT CLASSES =============================================== #=============================================================================== - class SHCoeffs(object): """ + EXPERIMENTAL: Spherical Harmonics Coefficient class. Coefficients can be initialized using one of the constructor methods: @@ -301,6 +301,7 @@ class SHComplexCoefficients(SHCoeffs): class SHGrid(object): """ + EXPERIMENTAL: Spherical Grid Class that can deal with spatial data on the sphere that is defined on different grids. Can be constructed from: @@ -440,6 +441,7 @@ class GLQGrid(SHGrid): #==== SPHERICAL HARMONICS WINDOW FUNCTION CLASS ==== class SHWindow(object): """ + EXPERIMENTAL: This class contains collections of spherical harmonics windows that provide spectral estimates about a specific region """
updated classes doc with EXPERIMENTAL
SHTOOLS_SHTOOLS
train
py
e37c9526196e6fe17ffa97999569f6567a7941aa
diff --git a/backends/repeater.js b/backends/repeater.js index <HASH>..<HASH> 100644 --- a/backends/repeater.js +++ b/backends/repeater.js @@ -4,7 +4,7 @@ var util = require('util'), function RepeaterBackend(startupTime, config, emitter){ var self = this; this.config = config.repeater || []; - this.sock = dgram.createSocket('udp6'); + this.sock = dgram.createSocket('udp4'); // attach emitter.on('packet', function(packet, rinfo) { self.process(packet, rinfo); });
making the repeater backend ipv4 only again some people reported problems with it, so we have to look into a better configurable solution for this.
statsd_statsd
train
js
f6eb9383a3cddbfe2913135d981353b971838c0a
diff --git a/model/qti/Service.php b/model/qti/Service.php index <HASH>..<HASH> 100755 --- a/model/qti/Service.php +++ b/model/qti/Service.php @@ -288,7 +288,7 @@ class Service extends ConfigurableService return $oldItemContentPropertyValues; } catch (Exception $e) { - common_Logger::e('Item content backup failed: ' . $e->getMessage()); + $this->logError('Item content backup failed: ' . $e->getMessage()); throw new common_Exception("QTI Item backup failed. Item uri - " . $item->getUri()); } } @@ -306,7 +306,7 @@ class Service extends ConfigurableService $item->editPropertyValueByLg($itemContentProperty, $itemContentPropertyValue, $language); } } catch (Exception $e) { - common_Logger::e('Rollback item error: ' . $e->getMessage()); + $this->logError('Rollback item error: ' . $e->getMessage()); throw new common_Exception(sprintf('Cannot rollback item. Item uri - %s :: Backup folders - %s ', $item->getUri(), json_encode($backUpNames))); } }
Use logger trait instead of static logger methods.
oat-sa_extension-tao-itemqti
train
php
e5384aaeb36498ecfbd7814be05c30911fd85545
diff --git a/lib/config.js b/lib/config.js index <HASH>..<HASH> 100644 --- a/lib/config.js +++ b/lib/config.js @@ -508,6 +508,17 @@ exports.extend = function(newConf) { variableProperties.forEach(function(name) { config[name] = newConf[name] || pkgConf[name]; }); + var extra = newConf.extra; + if (extra && typeof extra === 'string') { + extra = readFileText(extra); + try { + extra = extra && JSON.parse(extra); + if (extra && typeof extra === 'object') { + config.pluginsDataMap = extend({}, config.pluginsDataMap, extra); + } + } catch (e) {} + extra = null; + } var customHandler = newConf.customHandler || newConf.customHandle; if (typeof customHandler === 'function') { config.customHandler = customHandler;
refactor: read json from extra
avwo_whistle
train
js
c58d8bea5b8d1e8183e2423b93e435932955a73c
diff --git a/i18n-module.php b/i18n-module.php index <HASH>..<HASH> 100644 --- a/i18n-module.php +++ b/i18n-module.php @@ -252,7 +252,7 @@ class yoast_i18n { if ( $body ) { $body = json_decode( $body ); - if ( empty( $body->success ) ) { + if ( empty( $body->success ) || empty( $body->translation_sets ) ) { return null; } foreach ( $body->translation_sets as $set ) {
Tightened check for valid data in remote API response.
Yoast_i18n-module
train
php
45a0a24fa71fe7cd5e9b3baaaf9f7cfe57221cef
diff --git a/query.go b/query.go index <HASH>..<HASH> 100644 --- a/query.go +++ b/query.go @@ -3,8 +3,8 @@ package notifications import ( "encoding/json" - context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context" - peer "github.com/jbenet/go-ipfs/p2p/peer" + context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context" + peer "github.com/ipfs/go-ipfs/p2p/peer" ) const RoutingQueryKey = "RoutingQueryEvent"
Reorged imports from jbenet/go-ipfs to ipfs/go-ipfs - Modified Godeps/Godeps.json by hand - [TEST] Updated welcome docs hash to sharness - [TEST] Updated contact doc - [TEST] disabled breaking test (t<I>-repo refs local)
libp2p_go-libp2p-routing
train
go
ea65b0fab25bad85f3c3e1c2062b0e4fad211b91
diff --git a/abaaso.js b/abaaso.js index <HASH>..<HASH> 100644 --- a/abaaso.js +++ b/abaaso.js @@ -1453,8 +1453,8 @@ var abaaso = function(){ break; default: value = new String(value); - pattern = (pattern[args[i]]) ? pattern[args[i]] : args[i]; - if (!pattern.test(value)) { + var p = (pattern[args[i]]) ? pattern[args[i]] : args[i]; + if (!p.test(value)) { invalid.push(i); exception = true; }
Fixed an override mistake in validate.test()
avoidwork_abaaso
train
js
18c702e13205f1200bd65be5ba28e4110b32577e
diff --git a/great_expectations/dataset/pandas_dataset.py b/great_expectations/dataset/pandas_dataset.py index <HASH>..<HASH> 100644 --- a/great_expectations/dataset/pandas_dataset.py +++ b/great_expectations/dataset/pandas_dataset.py @@ -883,7 +883,10 @@ class PandasDataset(MetaPandasDataset, pd.DataFrame): if max_value: max_value = parse(max_value) - temp_column = column.map(parse) + try: + temp_column = column.map(parse) + except TypeError as e: + temp_column = column else: temp_column = column
Catch TypeError if column is already parsed
great-expectations_great_expectations
train
py
3e5fc9aa5290799b74efa71e5b5d723bc21eb1cd
diff --git a/features/support/paths.rb b/features/support/paths.rb index <HASH>..<HASH> 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -54,8 +54,6 @@ module NavigationHelpers admin_configuration_path(:format => format) when /extensions/i admin_extensions_path(:format => format) - when /export/i - export_path(:format => format) else raise "Can't find mapping from \"#{page_name}\" to a path.\n" + "Now, go and add a mapping in #{__FILE__}"
move cuke export_path to export extension
radiant_radiant
train
rb
0c369dfbf6df7509f88440f81eaa396baa938b84
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -37,8 +37,9 @@ def clean_build(dist): if os.path.isdir('src/feat'): feat_dist = setup(**feat_args) - clean_build(feat_dist) if os.path.isdir('src/flt'): - os.mkdir('build') + if os.path.isdir('src/feat'): + clean_build(feat_dist) + os.mkdir('build') setup(**flt_args)
Only clean the build directory when creating all packages
f3at_feat
train
py
277abf51dafb65229d2d15a273c0d04e13d7c7e4
diff --git a/worker/worker.go b/worker/worker.go index <HASH>..<HASH> 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -61,7 +61,7 @@ const ( // check will be anywhere in the range [0, monitor interval]; this is // randomized so that workers that start at the same time will not // contest the same locks. - defaultMonitorInterval = 120 * time.Second + defaultMonitorInterval = 15 * time.Second ) // Returns the name of the working queue based on the worker's processing
worker: lower defaultMonitorInterval to <I>sec
mixer_redutil
train
go
de670129138fd232847715f13873e7f6c74265ec
diff --git a/openquake/calculators/scenario_damage.py b/openquake/calculators/scenario_damage.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/scenario_damage.py +++ b/openquake/calculators/scenario_damage.py @@ -88,7 +88,6 @@ def scenario_damage(riskinputs, param, monitor): for ri in riskinputs: # here instead F32 floats are ok acc = [] # (aid, eid, lid, ds...) - ri.hazard_getter.init() for out in ri.gen_outputs(crmodel, monitor): r = out.rlzi ne = num_events[r] # total number of events
Removed unused line [skip CI]
gem_oq-engine
train
py
7f9e08f4e8acc972c09e630b58dc6149602b14ee
diff --git a/lib/searchkick/index.rb b/lib/searchkick/index.rb index <HASH>..<HASH> 100644 --- a/lib/searchkick/index.rb +++ b/lib/searchkick/index.rb @@ -177,7 +177,6 @@ module Searchkick client.search( index: name, body: { - fields: [], query: {match_all: {}}, size: 0 }
Fixed total_doc method for ES 5
ankane_searchkick
train
rb
590f1a9b12fb937492ae23c810c664966ee48ff6
diff --git a/provider/lxd/credentials.go b/provider/lxd/credentials.go index <HASH>..<HASH> 100644 --- a/provider/lxd/credentials.go +++ b/provider/lxd/credentials.go @@ -410,10 +410,11 @@ func (p environProviderCredentials) finalizeRemoteCredential( }); err != nil { return nil, errors.Trace(err) } + fmt.Fprintln(output, "Uploaded certificate to LXD server.") + } else { + fmt.Fprintln(output, "Reusing certificate from LXD server.") } - fmt.Fprintln(output, "Uploaded certificate to LXD server.") - lxdServer, _, err := server.GetServer() if err != nil { return nil, errors.Trace(err)
Be clear about output message We should be clear about if the cert is uploaded or not. This will help us debug the output in the future.
juju_juju
train
go
1640a17d6bf799e740ab23676a296e1406551f4f
diff --git a/usr/share/lib/img_proof/tests/SLES/test_sles_motd.py b/usr/share/lib/img_proof/tests/SLES/test_sles_motd.py index <HASH>..<HASH> 100644 --- a/usr/share/lib/img_proof/tests/SLES/test_sles_motd.py +++ b/usr/share/lib/img_proof/tests/SLES/test_sles_motd.py @@ -2,6 +2,8 @@ def test_sles_motd(host, get_release_value): motd = host.file('/etc/motd') version = get_release_value('VERSION') assert version + assert motd.exists + assert motd.is_file assert motd.contains( 'SUSE Linux Enterprise Server {0}'.format( version.replace('-', ' ')
Check if motd file exists and is a file Before checking the file contents. To make an error state more clear.
SUSE-Enceladus_ipa
train
py
ad6ef7c7dc40be68cf646339a7f98e2e5d9818bb
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ setup( author='Chris Kiehl', author_email='audionautic@gmail.com', package_data={ - '': ['*.txt', '*.png', '*.jpg', '*.json'] + '': ['*.txt', '*.png', '*.jpg', '*.json', '*.ico'] }, packages=find_packages(), url='http://pypi.python.org/pypi/Gooey/',
Fixing error of 'icon.ico' not being present in filesystem when running mockapplication
chriskiehl_Gooey
train
py
bd2e92b4e2b3fed6d503c7bc499453b1bbb47d33
diff --git a/pandas/core/frame.py b/pandas/core/frame.py index <HASH>..<HASH> 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -1074,7 +1074,7 @@ class DataFrame(NDFrame): indexer = self.columns.get_indexer(key) mask = indexer == -1 if mask.any(): - raise Exception("No column(s) named: %s" % str(key[mask])) + raise KeyError("No column(s) named: %s" % str(key[mask])) return self.reindex(columns=key) def _slice(self, slobj, axis=0): @@ -1215,6 +1215,13 @@ class DataFrame(NDFrame): """ return NDFrame.pop(self, item) + def get(self, column, default=None): + try: + return self[column] + except KeyError: + return default + + # to support old APIs @property def _series(self):
(1) add a get() method like dicts have, (2) throw KeyError, not Exception, when a column isn't found
pandas-dev_pandas
train
py
a479ea852fe361f1a0de121564591a7c28f4ebba
diff --git a/scripts/release_helper/go.py b/scripts/release_helper/go.py index <HASH>..<HASH> 100644 --- a/scripts/release_helper/go.py +++ b/scripts/release_helper/go.py @@ -6,7 +6,7 @@ import os _GO_OWNER = {'ArcturusZhang'} # 'github assignee': 'token' -_ASSIGNEE_TOKEN_GO = {'ArcturusZhang': os.getenv('PYTHON_ZED_TOKEN')} +_ASSIGNEE_TOKEN_GO = {'ArcturusZhang': os.getenv('GO_DAPENGZHANG_TOKEN')} class IssueProcessGo(IssueProcess):
update for Go (#<I>)
Azure_azure-sdk-for-python
train
py
4c7774a4b3e19563d4466e3694488c46a91174c5
diff --git a/lib/Layout.js b/lib/Layout.js index <HASH>..<HASH> 100644 --- a/lib/Layout.js +++ b/lib/Layout.js @@ -482,7 +482,7 @@ function Sequence (elt_layout, count, property) { /** The number of elements in the sequence. */ this.count = count; - Object.freeze(); + Object.freeze(this); } Sequence.prototype = Object.create(Layout.prototype); Sequence.prototype.constructor = Sequence; @@ -796,7 +796,7 @@ function VariantLayout (union, * VariantLayout#union|union}. */ this.layout = layout; - Object.freeze(); + Object.freeze(this); } VariantLayout.prototype = Object.create(Layout.prototype); VariantLayout.prototype.constructor = VariantLayout;
Layout: fix mis-application of Object.freeze This was freezing the constructor which was not intended and is not permitted in ES5.
pabigot_buffer-layout
train
js
bcf301db9c6f010587330df3ee4e17bb479c47fd
diff --git a/lib/phusion_passenger/platform_info/cxx_portability.rb b/lib/phusion_passenger/platform_info/cxx_portability.rb index <HASH>..<HASH> 100644 --- a/lib/phusion_passenger/platform_info/cxx_portability.rb +++ b/lib/phusion_passenger/platform_info/cxx_portability.rb @@ -165,6 +165,8 @@ private # http://groups.google.com/group/phusion-passenger/t/6b904a962ee28e5c # http://groups.google.com/group/phusion-passenger/browse_thread/thread/aad4bd9d8d200561 flags << '-DBOOST_SP_USE_PTHREADS' + elsif os_name == "linux" + flags << '-lrt' end flags << '-DHAS_ALLOCA_H' if has_alloca_h?
Link to librt on Linux because Boost now uses clock_gettime()
phusion_passenger
train
rb
110207cc784504cf56f953f58bfa837350d13be6
diff --git a/src/UnresolvedValueException.php b/src/UnresolvedValueException.php index <HASH>..<HASH> 100644 --- a/src/UnresolvedValueException.php +++ b/src/UnresolvedValueException.php @@ -44,28 +44,13 @@ class UnresolvedValueException extends \RuntimeException */ private static function getParameterName(\ReflectionParameter $parameter) : string { - return self::getTypeHint($parameter) . '$' . $parameter->getName(); - } + $parameterType = ''; - /** - * Helper class for getParameterName(). - * - * @param \ReflectionParameter $parameter - * - * @return string - */ - private static function getTypeHint(\ReflectionParameter $parameter) : string - { - if ($parameter->isArray()) { - return 'array '; + if (null !== $type = $parameter->getType()) { + $parameterType = (string) $type . ' '; } - $class = $parameter->getClass(); - if ($class) { - return $class->getName() . ' '; - } - - return ''; + return $parameterType . '$' . $parameter->getName(); } /**
Use ReflectionParameter::getType() for exception messages This correctly reports the scalar types as well.
brick_di
train
php
26b0779bc48337a0d15591872225fef6c3e7711a
diff --git a/src/main/java/com/lookfirst/wepay/WePayApi.java b/src/main/java/com/lookfirst/wepay/WePayApi.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/lookfirst/wepay/WePayApi.java +++ b/src/main/java/com/lookfirst/wepay/WePayApi.java @@ -114,7 +114,18 @@ public class WePayApi { @Override public InputStream getData(String uri, String postJson, String token) throws IOException { HttpURLConnection conn = getConnection(uri, postJson, token); - return conn.getInputStream(); + int responseCode = conn.getResponseCode(); + if (responseCode >= 200 && responseCode < 300) { + // everything's cool + return conn.getInputStream(); + } else if (responseCode >= 400 && responseCode < 600) { + // something's wrong - get the error stream instead + return conn.getErrorStream(); + } else { + // this will throw an IOException for all other HTTP codes but Java doesn't know that + // so make it think you're returning something + return conn.getInputStream(); + } } }
Added more robust response handling - return the inputStream for 2xx responses, errorStream for 4xx-5xx responses, and throw IOException for everything else
lookfirst_WePay-Java-SDK
train
java
c6db3427be574c08ea97a878be3687190876c1ff
diff --git a/annis-gui/src/main/java/annis/gui/admin/controller/UserController.java b/annis-gui/src/main/java/annis/gui/admin/controller/UserController.java index <HASH>..<HASH> 100644 --- a/annis-gui/src/main/java/annis/gui/admin/controller/UserController.java +++ b/annis-gui/src/main/java/annis/gui/admin/controller/UserController.java @@ -79,6 +79,7 @@ public class UserController public void passwordChanged(String userName, String newPassword) { model.setPassword(userName, newPassword); + view.setUserList(model.getUsers()); } @Override
set the user list after the password was changed to update the list model (fixes #<I>)
korpling_ANNIS
train
java
577f3501500e53a2df0eba3468df5373988a2aea
diff --git a/lib/rspec-puppet/support.rb b/lib/rspec-puppet/support.rb index <HASH>..<HASH> 100644 --- a/lib/rspec-puppet/support.rb +++ b/lib/rspec-puppet/support.rb @@ -9,7 +9,18 @@ module RSpec::Puppet end def environment - 'rp_env' + # unfreeze PUPPETVERSION because of https://github.com/bundler/bundler/issues/3187 + ver = Gem::Version.new("#{Puppet::PUPPETVERSION}") + # Since applying a fix for PUP-5522 (puppet 3.8.5 and 4.3.2) puppet symbolizes environment names + # internally. The catalog cache needs to assume that the facts and other args do not change between + # runs, so we have to mirror this here. Puppet versions before the change require a string as environment + # name, or they fail with "Unsupported data type: 'Symbol' on node xyz" + # See https://github.com/rodjek/rspec-puppet/pull/354 and PUP-5743 for discussion of this + if (Gem::Version.new('3.8.5') <= ver && ver < Gem::Version.new('4.0.0')) || Gem::Version.new('4.3.2') <= ver + :rp_env + else + 'rp_env' + end end def load_catalogue(type)
(PUP-<I>) adapt to new environment name semantics Since applying a fix for PUP-<I> (puppet <I> and <I>) puppet symbolizes environment names internally. The catalog cache needs to assume that the facts and other args do not change between runs, so we have to mirror this here. Puppet versions before the change require a string as environment name, or they fail with "Unsupported data type: 'Symbol' on node xyz" See <URL>
rodjek_rspec-puppet
train
rb
74d7dcaa28cf3dc1e682808dfc007349e284a45a
diff --git a/holoviews/core/util.py b/holoviews/core/util.py index <HASH>..<HASH> 100644 --- a/holoviews/core/util.py +++ b/holoviews/core/util.py @@ -787,7 +787,7 @@ def stream_parameters(streams, no_duplicates=True, exclude=['name']): If no_duplicates is enabled, a KeyError will be raised if there are parameter name clashes across the streams. """ - param_groups = [s.params().keys() for s in streams] + param_groups = [s.contents.keys() for s in streams] names = [name for group in param_groups for name in group] if no_duplicates:
stream_parameters utility looks at contents not params
pyviz_holoviews
train
py
33db859a5d6ae01ec2fc1aa0a8c01b0fc4b8bf91
diff --git a/core/objects.go b/core/objects.go index <HASH>..<HASH> 100644 --- a/core/objects.go +++ b/core/objects.go @@ -26,7 +26,7 @@ const ( ) const ( - ChallengeTypeSimpleHTTPS = "simpleHTTPS" + ChallengeTypeSimpleHTTPS = "simpleHttps" ChallengeTypeDVSNI = "dvsni" ChallengeTypeDNS = "dns" ChallengeTypeRecoveryToken = "recoveryToken"
Fix non-compliance issue stemming from PR #<I>. Caught by @kuba, thanks!
letsencrypt_boulder
train
go
80511a530a90a85ce18342142b1d750f4410f731
diff --git a/trustar/report_client.py b/trustar/report_client.py index <HASH>..<HASH> 100644 --- a/trustar/report_client.py +++ b/trustar/report_client.py @@ -63,8 +63,8 @@ class ReportClient(object): found by adjusting the ``from_time`` and ``to_time`` parameters. Note: This endpoint will only return reports from a time window of maximum size of 2 weeks. If you give a - time window larger than 2 weeks, it will pull reports starting at 2 weeks before the “to” date, through the - “to” date. + time window larger than 2 weeks, it will pull reports starting at 2 weeks before the "to" date, through the + "to" date. :param boolean is_enclave: restrict reports to specific distribution type (optional - by default all accessible reports are returned).
fix ascii in docstring character
trustar_trustar-python
train
py
1920dc60793dba34904c686b815ead0b8fbbd94c
diff --git a/salt/modules/git.py b/salt/modules/git.py index <HASH>..<HASH> 100644 --- a/salt/modules/git.py +++ b/salt/modules/git.py @@ -273,10 +273,10 @@ def _git_run(command, cwd=None, user=None, password=None, identity=None, if not salt.utils.is_windows() and 'GIT_SSH' in env: os.remove(env['GIT_SSH']) - # Cleanup the temporary identify file + # Cleanup the temporary identity file if tmp_identity_file and os.path.exists(tmp_identity_file): - log.debug('Removing identify file {0}'.format(tmp_identity_file)) - #__salt__['file.remove'](tmp_identity_file) + log.debug('Removing identity file {0}'.format(tmp_identity_file)) + __salt__['file.remove'](tmp_identity_file) # If the command was successful, no need to try additional IDs if result['retcode'] == 0:
Uncomment the line that removes the temporary identity file.
saltstack_salt
train
py
33c78c3787bbad534e08e8f3be53a6c971a8e339
diff --git a/activerecord/lib/active_record/connection_handling.rb b/activerecord/lib/active_record/connection_handling.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/connection_handling.rb +++ b/activerecord/lib/active_record/connection_handling.rb @@ -131,7 +131,7 @@ module ActiveRecord def remove_connection(name = nil) name ||= @connection_specification_name if defined?(@connection_specification_name) - # if removing a connection that have a pool, we reset the + # if removing a connection that has a pool, we reset the # connection_specification_name so it will use the parent # pool. if connection_handler.retrieve_connection_pool(name)
[ci skip] fix typo in ActiveRecord::ConnectionHandling
rails_rails
train
rb
599cc8d869ca7e37a3255a1d7b5527084fa29ff0
diff --git a/Jakefile.js b/Jakefile.js index <HASH>..<HASH> 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -7,8 +7,8 @@ var exec = require('child_process').exec, commands = { - test: './node_modules/.bin/mocha --ui tdd --reporter spec --colors ./test/complexityReport.js', - lint: './node_modules/.bin/jshint ./src --config config/jshint.json', + test: 'node node_modules/mocha/bin/mocha --ui tdd --reporter spec --colors ./test/complexityReport.js', + lint: 'node node_modules/jshint/bin/jshint src --config config/jshint.json', prepare: 'npm install' };
improved Windows support for 'jake test'
philbooth_complexity-report
train
js
6dc64d0e679a799e52a0c9fb7c56c4112572cf11
diff --git a/nephele/nephele-server/src/main/java/eu/stratosphere/nephele/checkpointing/CheckpointDecisionCoordinator.java b/nephele/nephele-server/src/main/java/eu/stratosphere/nephele/checkpointing/CheckpointDecisionCoordinator.java index <HASH>..<HASH> 100644 --- a/nephele/nephele-server/src/main/java/eu/stratosphere/nephele/checkpointing/CheckpointDecisionCoordinator.java +++ b/nephele/nephele-server/src/main/java/eu/stratosphere/nephele/checkpointing/CheckpointDecisionCoordinator.java @@ -102,7 +102,7 @@ public final class CheckpointDecisionCoordinator { final List<CheckpointDecision> checkpointDecisionList = new SerializableArrayList<CheckpointDecision>(); synchronized (graph) { - checkpointDecisionList.add(new CheckpointDecision(vertex.getID(), true)); + checkpointDecisionList.add(new CheckpointDecision(vertex.getID(), false)); // @CHECKPOINT DECISION checkpointDecisions.put(vertex.getAllocatedResource().getInstance(), checkpointDecisionList); }
Disabled Checkpointing by default.
apache_flink
train
java
40cf98e604e7dc09ccf1619cf12415a0b9f53226
diff --git a/js/gateio.js b/js/gateio.js index <HASH>..<HASH> 100755 --- a/js/gateio.js +++ b/js/gateio.js @@ -2858,6 +2858,7 @@ module.exports = class gateio extends Exchange { let filled = Precise.stringSub (amount, remaining); let cost = this.safeNumber (order, 'filled_total'); let rawStatus = undefined; + let average = undefined; if (put) { remaining = amount; filled = '0'; @@ -2868,6 +2869,7 @@ module.exports = class gateio extends Exchange { type = isMarketOrder ? 'market' : 'limit'; side = Precise.stringGt (amount, '0') ? 'buy' : 'sell'; rawStatus = this.safeString (order, 'finish_as', 'open'); + average = this.safeNumber(order, 'fill_price'); } else { rawStatus = this.safeString (order, 'status'); } @@ -2913,7 +2915,7 @@ module.exports = class gateio extends Exchange { 'side': side, 'price': this.parseNumber (price), 'stopPrice': this.safeNumber (trigger, 'price'), - 'average': this.safeNumber (order, 'price'), + 'average': average, 'amount': this.parseNumber (Precise.stringAbs (amount)), 'cost': cost, 'filled': this.parseNumber (filled),
Set average price conditinally based on endpoint
ccxt_ccxt
train
js
7f32d0d1e9cdb6c1a70b598c45a1ea01ac9b9593
diff --git a/src/lib/exceptionist.js b/src/lib/exceptionist.js index <HASH>..<HASH> 100644 --- a/src/lib/exceptionist.js +++ b/src/lib/exceptionist.js @@ -98,7 +98,7 @@ module.exports = { }, stacktrace: stacktrace, user: options.context.user || null, - timestamp: (new Date).getTime(), + timestamp: parseInt((new Date).getTime() / 1000, 10), level: null, logger: null, machine: null
Set correct Epoch timestamp in API payload
opbeat_opbeat-react
train
js
5bd9a4f923a851bee687d069808102ac0ceab4f3
diff --git a/pythonforandroid/recipes/kivy/__init__.py b/pythonforandroid/recipes/kivy/__init__.py index <HASH>..<HASH> 100644 --- a/pythonforandroid/recipes/kivy/__init__.py +++ b/pythonforandroid/recipes/kivy/__init__.py @@ -7,7 +7,8 @@ import glob class KivyRecipe(CythonRecipe): # version = 'stable' - version = 'master' + # version = 'master' + # version = '1.9.1' url = 'https://github.com/kivy/kivy/archive/{version}.zip' name = 'kivy'
Changed Kivy recipe to use <I> This is necessary for now, as the Android build has been broken by the opengl changes.
kivy_python-for-android
train
py
890dbd9f771cd7a1992505588e020f964ba06eed
diff --git a/gns3server/compute/docker/docker_vm.py b/gns3server/compute/docker/docker_vm.py index <HASH>..<HASH> 100644 --- a/gns3server/compute/docker/docker_vm.py +++ b/gns3server/compute/docker/docker_vm.py @@ -290,6 +290,7 @@ class DockerVM(BaseNode): os.makedirs(os.path.join(path, "if-down.d"), exist_ok=True) os.makedirs(os.path.join(path, "if-pre-up.d"), exist_ok=True) os.makedirs(os.path.join(path, "if-post-down.d"), exist_ok=True) + os.makedirs(os.path.join(path, "interfaces.d"), exist_ok=True) if not os.path.exists(os.path.join(path, "interfaces")): with open(os.path.join(path, "interfaces"), "w+") as f:
Create `/etc/network/interfaces.d` in Docker container. Fixes #<I>
GNS3_gns3-server
train
py
b2d47f29b677a5278d492d79164e8c1fb275cec9
diff --git a/subproviders/subprovider.js b/subproviders/subprovider.js index <HASH>..<HASH> 100644 --- a/subproviders/subprovider.js +++ b/subproviders/subprovider.js @@ -11,12 +11,11 @@ function SubProvider() { SubProvider.prototype.setEngine = function(engine) { const self = this - if (self._ranSetEngine) return + if (self.engine) return self.engine = engine engine.on('block', function(block) { self.currentBlock = block }) - self._ranSetEngine = true } SubProvider.prototype.handleRequest = function(payload, next, end) {
check self.engine instead of adding a new instance variable
MetaMask_web3-provider-engine
train
js
7978da21a625b00b2790ca580c4d015e8f32fd33
diff --git a/tensorflow_probability/python/bijectors/ordered.py b/tensorflow_probability/python/bijectors/ordered.py index <HASH>..<HASH> 100644 --- a/tensorflow_probability/python/bijectors/ordered.py +++ b/tensorflow_probability/python/bijectors/ordered.py @@ -22,6 +22,7 @@ import tensorflow.compat.v2 as tf from tensorflow_probability.python.bijectors import bijector from tensorflow_probability.python.internal import assert_util +from tensorflow.python.util import deprecation # pylint: disable=g-direct-tensorflow-import __all__ = [ @@ -29,10 +30,13 @@ __all__ = [ ] +@deprecation.deprecated( + '2020-10-09', + '`Ordered` bijector is deprecated; please use ' + '`tfb.Invert(tfb.Ascending())` instead.', + warn_once=True) class Ordered(bijector.Bijector): - """Deprecated. Use bijectors.Invert(bijectors.Ascending()) instead. - - Maps a vector of increasing elements to an unconstrained vector. + """Maps a vector of increasing elements to an unconstrained vector. Both the domain and the codomain of the mapping is [-inf, inf], however, the input of the forward mapping must be strictly increasing.
tensorflow style deprecation for Ordered
tensorflow_probability
train
py
4b8d69b6febc798e34fc961d459648a32a946edd
diff --git a/leonardo/module/media/models/foldermodels.py b/leonardo/module/media/models/foldermodels.py index <HASH>..<HASH> 100644 --- a/leonardo/module/media/models/foldermodels.py +++ b/leonardo/module/media/models/foldermodels.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals from django.contrib.auth import models as auth_models from django.core import urlresolvers from django.core.exceptions import ValidationError +from django.template.defaultfilters import slugify from django.db import models from django.db.models import Q from django.utils.http import urlquote @@ -159,7 +160,7 @@ class Folder(models.Model, mixins.IconsMixin): @property def pretty_logical_path(self): - return "/%s" % "/".join([f.name for f in self.logical_path + [self]]) + return "/%s" % "/".join([slugify(f.name) for f in self.logical_path + [self]]) @property def quoted_logical_path(self):
Slugify media folder logical path
django-leonardo_django-leonardo
train
py
1b3bc8f258e84188dad906e9f5cfb58d58edaf35
diff --git a/build/webpack.conf.js b/build/webpack.conf.js index <HASH>..<HASH> 100644 --- a/build/webpack.conf.js +++ b/build/webpack.conf.js @@ -45,7 +45,7 @@ const config = { { test: /\.vue$/, loader: 'vue-loader', - include: path.resolve(__dirname,"../example") + exclude: /node_modules/, } ] },
change include/exclude to include docs folder.
LinusBorg_portal-vue
train
js
430cd20de245250690dd5f5e3816251c91118bfb
diff --git a/openquake/calculators/event_based.py b/openquake/calculators/event_based.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/event_based.py +++ b/openquake/calculators/event_based.py @@ -45,11 +45,7 @@ TWO32 = 2 ** 32 def weight(src): # heuristic weight - try: - rate = sum(rate for mag, rate in src.get_annual_occurrence_rates()) - except AttributeError: - rate = 1 - return src.num_ruptures * src.ndists * rate * 1000 + return src.num_ruptures * src.ndists def get_events(ebruptures):
Changed the source weight for event based calculations [skip hazardlib][demos] Former-commit-id: baeef3ade1aeb<I>b7ca<I>a0b<I>f<I>cfd<I>
gem_oq-engine
train
py
0fbf42311a6dd12244bd3b78f8b6fa42aa6d3b82
diff --git a/js/bitfinex.js b/js/bitfinex.js index <HASH>..<HASH> 100644 --- a/js/bitfinex.js +++ b/js/bitfinex.js @@ -16,17 +16,9 @@ module.exports = class bitfinex extends Exchange { 'countries': 'VG', 'version': 'v1', 'rateLimit': 1500, - 'hasCORS': false, - // old metainfo interface - 'hasFetchOrder': true, - 'hasFetchTickers': true, - 'hasDeposit': true, - 'hasWithdraw': true, - 'hasFetchOHLCV': true, - 'hasFetchOpenOrders': true, - 'hasFetchClosedOrders': true, // new metainfo interface 'has': { + 'CORS': false, 'fetchOHLCV': true, 'fetchTickers': true, 'fetchOrder': true,
removed obsolete metainfo interface in bitfinex.js
ccxt_ccxt
train
js
ac95877f6ecd7394e27b42c743253067c43aca1a
diff --git a/spice_api/helpers.py b/spice_api/helpers.py index <HASH>..<HASH> 100644 --- a/spice_api/helpers.py +++ b/spice_api/helpers.py @@ -33,7 +33,7 @@ import requests def get_query_url(medium, query): query = query.strip() - terms = query.replace(' ', '+') + terms = query.replace("+", "_").replace(' ', '+') if medium == tokens.Medium.ANIME: return constants.ANIME_QUERY_BASE + terms elif medium == tokens.Medium.MANGA:
Error Querying when "+" found in title The query would return an empty list when there is a "+" in the query. With a little experimentation, I found that if you replace it with a _ it works. Ex <URL>
Utagai_spice
train
py
33f136bb1571d9d4dbba0642794e4e3280dc9ee3
diff --git a/sacn/receiving/receiver_thread.py b/sacn/receiving/receiver_thread.py index <HASH>..<HASH> 100644 --- a/sacn/receiving/receiver_thread.py +++ b/sacn/receiving/receiver_thread.py @@ -50,7 +50,6 @@ class receiverThread(threading.Thread): tmp_packet = DataPacket.make_data_packet(raw_data) except: # try to make a DataPacket. If it fails just go over it continue - self.logger.debug(f'Received sACN packet:\n{tmp_packet}') self.check_for_stream_terminated_and_refresh_timestamp(tmp_packet) self.refresh_priorities(tmp_packet) @@ -146,7 +145,6 @@ class receiverThread(threading.Thread): if packet.universe not in self.previousData.keys() or \ self.previousData[packet.universe] is None or \ self.previousData[packet.universe] != packet.dmxData: - self.logger.debug('') # set previous data and inherit callbacks self.previousData[packet.universe] = packet.dmxData for callback in self.callbacks[packet.universe]:
Removed debug actions from reciever_thread.py
Hundemeier_sacn
train
py
4b53a77c2a54baa1887e0edb80afaa048491328e
diff --git a/lib/codemirror.js b/lib/codemirror.js index <HASH>..<HASH> 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -4034,7 +4034,7 @@ window.CodeMirror = (function() { return builder.pre; } - var tokenSpecialChars = /[\t\u0000-\u0019\u200b\u2028\u2029\uFEFF]/g; + var tokenSpecialChars = /[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\uFEFF]/g; function buildToken(builder, text, style, startStyle, endStyle) { if (!text) return; if (!tokenSpecialChars.test(text)) {
Add the soft-hyphen character to the list of non-printing chars Closes #<I>
codemirror_CodeMirror
train
js
628773038943100619b6cfb2c24a91c0c9065168
diff --git a/output/html/block_editor.php b/output/html/block_editor.php index <HASH>..<HASH> 100644 --- a/output/html/block_editor.php +++ b/output/html/block_editor.php @@ -113,6 +113,7 @@ class QM_Output_Html_Block_Editor extends QM_Output_Html { $media_blocks = array( 'core/audio' => 'id', + 'core/cover' => 'id', 'core/cover-image' => 'id', 'core/file' => 'id', 'core/image' => 'id',
The `cover-image` block type is now called `cover`.
johnbillion_query-monitor
train
php
a6c6fb5e3e5476c173cee4cd6e3e2f2632d83f36
diff --git a/src/Providers/Html.php b/src/Providers/Html.php index <HASH>..<HASH> 100644 --- a/src/Providers/Html.php +++ b/src/Providers/Html.php @@ -110,6 +110,14 @@ class Html extends Provider implements ProviderInterface /** * {@inheritdoc} */ + public function getAuthorName() + { + return $this->bag->get('author') ?: $this->bag->get('contributors'); + } + + /** + * {@inheritdoc} + */ public function getProviderIconsUrls() { return (array) $this->bag->get('icons') ?: [];
use author and contributors meta tag to get the authorName
oscarotero_Embed
train
php
a9cab07405261fec3813fef6e8459ba539226fad
diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/WellKnownMutability.java b/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/WellKnownMutability.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/WellKnownMutability.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/WellKnownMutability.java @@ -104,6 +104,7 @@ final class WellKnownMutability { .add("com.google.protobuf.ByteString") .add("com.google.protobuf.Descriptors$Descriptor") .add("com.google.protobuf.Descriptors$EnumDescriptor") + .add("com.google.protobuf.Descriptors$EnumValueDescriptor") .add("com.google.protobuf.Descriptors$FieldDescriptor") .add("com.google.protobuf.Descriptors$FileDescriptor") .add("com.google.protobuf.Descriptors$ServiceDescriptor")
Marking EnumValueDescriptor as immutable in WellKnownMutability. RELNOTES: N/A ------------- Created by MOE: <URL>
google_error-prone
train
java
8f615db65992dff21069df908e7a50a0632b92d5
diff --git a/examples/cordova/app.js b/examples/cordova/app.js index <HASH>..<HASH> 100644 --- a/examples/cordova/app.js +++ b/examples/cordova/app.js @@ -1,4 +1,4 @@ -const {Button, Page, NavigationView, ScrollView, ui} = require('tabris'); +const {Button, Page, NavigationView, ScrollView, device, ui} = require('tabris'); const ToastPage = require('./ToastPage'); const SharingPage = require('./SharingPage'); const MotionPage = require('./MotionPage'); @@ -19,16 +19,21 @@ let contentContainer = new ScrollView({ left: 0, top: 0, right: 0, bottom: 0 }).appendTo(mainPage); -[ - SharingPage, - ToastPage, - MotionPage, - NetworkPage, - CameraPage, - BarcodeScannerPage, - MediaPage, - ActionSheetPage -].forEach(Page => { +( + device.platform === 'windows' ? [ + MotionPage, + NetworkPage + ] : [ + SharingPage, + ToastPage, + MotionPage, + NetworkPage, + CameraPage, + BarcodeScannerPage, + MediaPage, + ActionSheetPage + ] +).forEach(Page => { let page = new Page(); addPageSelector(page); });
Reduce cordova demo on windows It can later be investigated how to improve windows support for cordova plug-ins, but for now include only the two that acually work. Change-Id: I<I>ab<I>d<I>d5ed<I>e<I>d7e2f<I>a1d8bbb
eclipsesource_tabris-js
train
js
df8eed84fc2cb8a74468b801439429a953d9d336
diff --git a/py/selenium/webdriver/firefox/options.py b/py/selenium/webdriver/firefox/options.py index <HASH>..<HASH> 100644 --- a/py/selenium/webdriver/firefox/options.py +++ b/py/selenium/webdriver/firefox/options.py @@ -153,7 +153,7 @@ class Options(ArgOptions): if len(self._preferences) > 0: opts["prefs"] = self._preferences if self._proxy is not None: - self._proxy.add_to_capabilities(opts) + self._proxy.add_to_capabilities(caps) if self._profile is not None: opts["profile"] = self._profile.encoded if len(self._arguments) > 0:
[py] Pass capabilities rather than options to the proxy object (#<I>) The method add_to_capabilities from the Proxy class takes capabilities (self._caps) as argument instead of "opts"
SeleniumHQ_selenium
train
py
ea8b66611952e69dad60db3cb52823ef8713fd4f
diff --git a/lib/rolify/version.rb b/lib/rolify/version.rb index <HASH>..<HASH> 100644 --- a/lib/rolify/version.rb +++ b/lib/rolify/version.rb @@ -1,3 +1,3 @@ module Rolify - VERSION = "3.3.0.rc1" + VERSION = "3.3.0.rc2" end
releasing <I> RC2 [ci skip]
RolifyCommunity_rolify
train
rb
097d9b73d26fe9fa7cd07682897ed8ee72930bdc
diff --git a/lib/searchkick/index_options.rb b/lib/searchkick/index_options.rb index <HASH>..<HASH> 100644 --- a/lib/searchkick/index_options.rb +++ b/lib/searchkick/index_options.rb @@ -13,9 +13,6 @@ module Searchkick index_type = index_type.call if index_type.respond_to?(:call) end - ngram_type = below70 ? "nGram" : "ngram" - edge_ngram_type = below70 ? "edgeNGram" : "edge_ngram" - custom_mapping = options[:mappings] || {} if below70 && custom_mapping.keys.map(&:to_sym).include?(:properties) # add type @@ -129,12 +126,12 @@ module Searchkick max_shingle_size: 5 }, searchkick_edge_ngram: { - type: edge_ngram_type, + type: "edge_ngram", min_gram: 1, max_gram: 50 }, searchkick_ngram: { - type: ngram_type, + type: "ngram", min_gram: 1, max_gram: 50 },
New ngram names work in <I> as well
ankane_searchkick
train
rb
63a6f7e97444dc13f2eff87b957f81e127de157f
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -116,14 +116,6 @@ RTCDataConnection.prototype._createConnection = function() { this.peerConnection.addEventListener('icecandidate', function handleICECandidate(event) { var candidate = event.candidate; if (candidate) { - // firefox can't JSON.stringify mozRTCIceCandidate objects... - if (global.mozRTCPeerConnection) { - candidate = { - sdpMLineIndex: candidate.sdpMLineIndex, - sdpMid: candidate.sdpMid, - candidate: candidate.candidate - }; - } dataConnection.emit('candidate', candidate); } });
remove stuff about firefox not being able to json-stringify candidates
lakenen_rtc-data-connection
train
js
31362bc3318dcf893a944d010f48858b6607e02a
diff --git a/sync/task/broker/broker.go b/sync/task/broker/broker.go index <HASH>..<HASH> 100644 --- a/sync/task/broker/broker.go +++ b/sync/task/broker/broker.go @@ -99,14 +99,22 @@ func (t *Task) Run(c task.Command) error { // subscribe for the pool size for i := 0; i < t.Options.Pool; i++ { - // subscribe to work - subWork, err := t.Broker.Subscribe(topic, workFn, broker.Queue(fmt.Sprintf("work.%d", i))) + err := func() error { + // subscribe to work + subWork, err := t.Broker.Subscribe(topic, workFn, broker.Queue(fmt.Sprintf("work.%d", i))) + if err != nil { + return err + } + + // unsubscribe on completion + defer subWork.Unsubscribe() + + return nil + }() + if err != nil { return err } - - // unsubscribe on completion - defer subWork.Unsubscribe() } // subscribe to all status messages
prevent resource leak (#<I>)
micro_go-micro
train
go
166c3db2f987be9c11513c6998244960b52a3734
diff --git a/src/org/mozilla/javascript/Token.java b/src/org/mozilla/javascript/Token.java index <HASH>..<HASH> 100644 --- a/src/org/mozilla/javascript/Token.java +++ b/src/org/mozilla/javascript/Token.java @@ -418,6 +418,7 @@ public class Token case COMMENT: return "COMMENT"; case GENEXPR: return "GENEXPR"; case METHOD: return "METHOD"; + case ARROW: return "ARROW"; } // Token without name
Add name for Token.ARROW
mozilla_rhino
train
java
db7bb583828dc5baa55ff00cf010030751675175
diff --git a/stanza/models/classifier.py b/stanza/models/classifier.py index <HASH>..<HASH> 100644 --- a/stanza/models/classifier.py +++ b/stanza/models/classifier.py @@ -156,7 +156,11 @@ def read_dataset(dataset, wordvec_type, min_len): """ lines = [] for filename in dataset.split(","): - new_lines = open(filename).readlines() + try: + new_lines = open(filename, encoding="utf-8").readlines() + except UnicodeDecodeError: + logger.error("Could not read {}".format(filename)) + raise lines.extend(new_lines) lines = [x.strip() for x in lines] lines = [x.split(maxsplit=1) for x in lines if x]
Sometimes Windows won't have utf-8 as the default encoding
stanfordnlp_stanza
train
py
f3761d95deb3810f8feb0036dafc9e7e4c8fa324
diff --git a/web/concrete/config/base.php b/web/concrete/config/base.php index <HASH>..<HASH> 100644 --- a/web/concrete/config/base.php +++ b/web/concrete/config/base.php @@ -106,7 +106,7 @@ if (!defined('DB_CHARSET')) { } if (!defined("DB_COLLATE")) { - define('DB_COLLATE', ''); + define('DB_COLLATE', 'utf8_unicode_ci'); } define("LANGUAGE_DOMAIN_CORE", "messages"); diff --git a/web/concrete/core/controllers/single_pages/upgrade.php b/web/concrete/core/controllers/single_pages/upgrade.php index <HASH>..<HASH> 100644 --- a/web/concrete/core/controllers/single_pages/upgrade.php +++ b/web/concrete/core/controllers/single_pages/upgrade.php @@ -25,6 +25,7 @@ class Concrete5_Controller_Upgrade extends Controller { Cache::disableCache(); Cache::disableLocalCache(); $this->site_version = Config::get('SITE_APP_VERSION'); + Database::ensureEncoding(); } public function view() {
maintaining unicode on upgrade Former-commit-id: <I>ec4e5de7f<I>e<I>a<I>d<I>b<I>ceb<I>f
concrete5_concrete5
train
php,php
90d48af6f3b3f951e8a07b7a53948915478c3062
diff --git a/lib/appsignal/version.rb b/lib/appsignal/version.rb index <HASH>..<HASH> 100644 --- a/lib/appsignal/version.rb +++ b/lib/appsignal/version.rb @@ -1,3 +1,3 @@ module Appsignal - VERSION = '0.4.0' + VERSION = '0.4.1' end
Bump to <I> [ci skip]
appsignal_appsignal-ruby
train
rb
66ab720505c03161979f6bda02727228aca490e2
diff --git a/loom/master/analysis/task_manager/cloud.py b/loom/master/analysis/task_manager/cloud.py index <HASH>..<HASH> 100644 --- a/loom/master/analysis/task_manager/cloud.py +++ b/loom/master/analysis/task_manager/cloud.py @@ -25,10 +25,10 @@ class CloudTaskManager: def run(cls, task_run, task_run_location_id, requested_resources): # Don't want to block while waiting for VM to come up, so start another process to finish the rest of the steps. logger = loom.common.logger.get_logger('TaskManagerLogger', logfile='/tmp/loom_cloud_taskmanager.log') - logger.debug("task_run: %s, task_run_location_id: %s, requested_resources: %s" % (task_run, task_run_location_id, requested_resources)) + task_run_json = json.dumps(task_run) + logger.debug("task_run_json: %s, task_run_location_id: %s, requested_resources: %s" % (task_run_json, task_run_location_id, requested_resources)) logger.debug("Launching CloudTaskManager as a separate process.") - task_run_json = json.dumps(task_run) process = multiprocessing.Process(target=CloudTaskManager._run, args=(task_run_json, task_run_location_id, requested_resources)) process.start()
Debugging for passing a taskrun as a JSON object.
StanfordBioinformatics_loom
train
py
afbbc20b7439c398e5bab8259ddb599742a4ea4f
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,9 +3,9 @@ import sdist_upip setup(name='picoweb', - version='1.6.1', + version='1.7.1', description="A very lightweight, memory-efficient async web framework \ -for MicroPython/Pycopy and its uasyncio module.", +for Pycopy (https://github.com/pfalcon/pycopy) and its uasyncio module.", long_description=open('README.rst').read(), url='https://github.com/pfalcon/picoweb', author='Paul Sokolovsky', @@ -15,5 +15,5 @@ for MicroPython/Pycopy and its uasyncio module.", packages=['picoweb'], # Note: no explicit dependency on 'utemplate', if a specific app uses # templates, it must depend on it. Likewise, don't depend on - # micropython-ulogging as application might not use logging. - install_requires=['micropython-uasyncio', 'micropython-pkg_resources']) + # pycopy-ulogging as application might not use logging. + install_requires=['pycopy-uasyncio', 'pycopy-pkg_resources'])
setup.py: Release <I>, update for Pycopy infrastructure.
pfalcon_picoweb
train
py
cd9d0bd78e35d00347d4e47a829650dc995b6813
diff --git a/lib/rabbitmq/connection.rb b/lib/rabbitmq/connection.rb index <HASH>..<HASH> 100644 --- a/lib/rabbitmq/connection.rb +++ b/lib/rabbitmq/connection.rb @@ -44,11 +44,15 @@ module RabbitMQ connect_socket! login! open_channel! + + self end def close raise DestroyedError unless @ptr FFI.amqp_connection_close(@ptr, 200) + + self end private def create_socket! diff --git a/spec/connection_spec.rb b/spec/connection_spec.rb index <HASH>..<HASH> 100644 --- a/spec/connection_spec.rb +++ b/spec/connection_spec.rb @@ -33,6 +33,10 @@ describe RabbitMQ::Connection do subject.start subject.start end + + it "returns self" do + subject.start.should eq subject + end end describe "close" do @@ -51,6 +55,10 @@ describe RabbitMQ::Connection do it "can be called before connecting to no effect" do subject.close end + + it "returns self" do + subject.close.should eq subject + end end it "uses Util.connection_info to parse info from its creation arguments" do
Return self from Connection#start and #close.
jemc_ruby-rabbitmq
train
rb,rb
377c938f6ea0cb4769da113123227aa0a29cdb9f
diff --git a/src/ReactImageMagnify.js b/src/ReactImageMagnify.js index <HASH>..<HASH> 100644 --- a/src/ReactImageMagnify.js +++ b/src/ReactImageMagnify.js @@ -156,27 +156,27 @@ class ReactImageMagnify extends React.Component { const { smallImage, smallImage: { - isFluidWidth: isSmallImageFluidWidth + isFluidWidth }, } = this.props; + + if (!isFluidWidth) { + return smallImage; + } + const { - smallImageWidth, - smallImageHeight + smallImageWidth: fluidWidth, + smallImageHeight: fluidHeight } = this.state; - const fluidWidthSmallImage = objectAssign( + return objectAssign( {}, smallImage, { - width: smallImageWidth, - height: smallImageHeight + width: fluidWidth, + height: fluidHeight } ); - const fixedWidthSmallImage = smallImage; - - return isSmallImageFluidWidth - ? fluidWidthSmallImage - : fixedWidthSmallImage } get enlargedImagePlacement() {
Refactor: ReactImageMagnify - get smallImage
ethanselzer_react-image-magnify
train
js
375c441fb54570ad2393e003bceeeeddca9f75fb
diff --git a/routes-v1/subroutes/mobilizations.js b/routes-v1/subroutes/mobilizations.js index <HASH>..<HASH> 100644 --- a/routes-v1/subroutes/mobilizations.js +++ b/routes-v1/subroutes/mobilizations.js @@ -63,13 +63,15 @@ const InsideMobilization = connect(stateToProps, actionsToProps)(class extends R render () { const { - match: { path }, + match: { path, params: { mobilization_id: id } }, mobilization, blocksIsLoaded, widgetsIsLoaded } = this.props - return !mobilization || !blocksIsLoaded || !widgetsIsLoaded ? <Loading /> : ( + const hasId = id && !isNaN(id) + + return (!mobilization || !blocksIsLoaded || !widgetsIsLoaded) && hasId ? <Loading /> : ( <React.Fragment> <Route exact path={`${path}/blocks/create`} component={BlockCreate} /> <Route exact path={`${path}/edit`} component={MobilizationsEdit} />
fix(routes-v1): mobilization featch loading layer condition
nossas_bonde-client
train
js
835c500892f339403c4579dedc9b386e87b4c410
diff --git a/test/unit/plugins/providers/hyperv/provider_test.rb b/test/unit/plugins/providers/hyperv/provider_test.rb index <HASH>..<HASH> 100644 --- a/test/unit/plugins/providers/hyperv/provider_test.rb +++ b/test/unit/plugins/providers/hyperv/provider_test.rb @@ -14,6 +14,7 @@ describe VagrantPlugins::HyperV::Provider do stub_const("Vagrant::Util::PowerShell", powershell) allow(machine).to receive(:id).and_return("foo") allow(platform).to receive(:windows?).and_return(true) + allow(platform).to receive(:wsl?).and_return(false) allow(platform).to receive(:windows_admin?).and_return(true) allow(platform).to receive(:windows_hyperv_admin?).and_return(true) allow(powershell).to receive(:available?).and_return(true) @@ -27,6 +28,12 @@ describe VagrantPlugins::HyperV::Provider do expect(subject).to_not be_usable end + it "returns true if within WSL" do + expect(platform).to receive(:windows?).and_return(false) + expect(platform).to receive(:wsl?).and_return(true) + expect(subject).to be_usable + end + it "returns false if neither an admin nor a hyper-v admin" do allow(platform).to receive(:windows_admin?).and_return(false) allow(platform).to receive(:windows_hyperv_admin?).and_return(false)
Add WSL check on usable? test for provider
hashicorp_vagrant
train
rb
0a8b78b719b675a9ecbd16c381ddc54ebbf34e39
diff --git a/src/commands/isDescendent.js b/src/commands/isDescendent.js index <HASH>..<HASH> 100644 --- a/src/commands/isDescendent.js +++ b/src/commands/isDescendent.js @@ -37,11 +37,9 @@ export async function isDescendent ({ ancestor, depth = -1 }) { - console.log('isDescendent', oid, ancestor) try { const fs = new FileSystem(_fs) const shallows = await GitShallowManager.read({ fs, gitdir }) - console.log('shallows', shallows) if (!oid) { throw new GitError(E.MissingRequiredParameterError, { function: 'isDescendent', @@ -67,7 +65,6 @@ export async function isDescendent ({ throw new GitError(E.MaxSearchDepthExceeded, { depth }) } const oid = queue.shift() - console.log('oid', oid) const { type, object } = await readObject({ fs, gitdir,
fix: remove stray console.logs (#<I>)
isomorphic-git_isomorphic-git
train
js
79dd09e9da00dbba702ed4f806b268f6edb4cc0c
diff --git a/.gitignore b/.gitignore index <HASH>..<HASH> 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ # logs npm-debug.log + diff --git a/lib/system.js b/lib/system.js index <HASH>..<HASH> 100644 --- a/lib/system.js +++ b/lib/system.js @@ -13,6 +13,10 @@ export function abiToNodeRange (abi) { if (/^m?51/.test(abi)) return 'node7'; if (/^m?57/.test(abi)) return 'node8'; if (/^m?59/.test(abi)) return 'node9'; + if (/^m?64/.test(abi)) return 'node10'; + if (/^m?67/.test(abi)) return 'node11'; + if (/^m?72/.test(abi)) return 'node12'; + if (/^m?79/.test(abi)) return 'node13'; return abi; } diff --git a/lib/verify.js b/lib/verify.js index <HASH>..<HASH> 100644 --- a/lib/verify.js +++ b/lib/verify.js @@ -36,6 +36,7 @@ const script = ` if (modules === 64) { kCpuFeaturesOffset = 0x0c; } else + // what about 67 here? if (modules === 72) { // no cpu features anymore } else
missing abi entries (#<I>) * fix: cloned too much from node repo * chore: add missed bare * fix: issue #<I> nodeVersion on clone with less branches * fix: typo R removed * fix: remove and edited files as expected for the pull request * test: set test to new git pull command results * feat(build): knowing node <I> to <I>
zeit_pkg-fetch
train
gitignore,js,js
b83a61b41ec701f8bb45917c719dbc21179527ae
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 @@ -6,12 +6,6 @@ require 'rspec/rails' require 'database_cleaner' require 'genspec' -if RUBY_VERSION[0].to_i > 1 - require 'byebug' -else - require 'ruby-debug'; -end - namespace :dummy do load 'spec/dummyapp/Rakefile' end
Remove debugger require from spec_helper.
rollbar_rollbar-gem
train
rb
fcd0002692365da83d893077936093c4174c7186
diff --git a/common/src/com/thoughtworks/go/domain/Matcher.java b/common/src/com/thoughtworks/go/domain/Matcher.java index <HASH>..<HASH> 100644 --- a/common/src/com/thoughtworks/go/domain/Matcher.java +++ b/common/src/com/thoughtworks/go/domain/Matcher.java @@ -82,8 +82,8 @@ public class Matcher { public boolean matches(String comment) { for (String escapedMatcher : escapeMatchers()) { - Pattern pattern = Pattern.compile(".*\\B" + escapedMatcher + "\\B.*|.*\\b" + escapedMatcher + "\\b.*"); - if (pattern.matcher(comment).matches()) { + Pattern pattern = Pattern.compile("\\B" + escapedMatcher + "\\B|\\b" + escapedMatcher + "\\b"); + if (pattern.matcher(comment).find()) { return true; } }
#<I> - Reverts an earlier revert. CLA signed. This reverts commit d<I>c<I>c<I>c<I>abb7f<I>da1b<I>ed6.
gocd_gocd
train
java
163e0c7e4610f2b9fbad3c49eeda995a8a55106d
diff --git a/docs/pages/index.js b/docs/pages/index.js index <HASH>..<HASH> 100644 --- a/docs/pages/index.js +++ b/docs/pages/index.js @@ -117,10 +117,6 @@ export default function LandingPage(props) { const { sponsorsProps } = props; React.useEffect(() => { - if (window.location.hash !== '' && window.location.hash !== '#main=content') { - window.location.replace(`https://v0.material-ui.com/${window.location.hash}`); - } - loadDependencies(); }, []); const t = useSelector((state) => state.options.t);
[docs] Remove redirection to v0 (#<I>) (#<I>)
mui-org_material-ui
train
js
508c7049cc4d3f0d933907db289c8557c359b4d0
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setuptools.setup(name='pytest-cov', url='https://github.com/schlamar/pytest-cov', py_modules=['pytest_cov'], install_requires=['pytest>=2.5.2', - 'cov-core>=1.9'], + 'cov-core>=1.10'], entry_points={'pytest11': ['pytest_cov = pytest_cov']}, license='MIT License', zip_safe=False,
Set cov-core dependency to <I>
pytest-dev_pytest-cov
train
py
79c64ca63b0d9931dff8aa1415c68d8606f7dfe0
diff --git a/src/Makes/MakeModel.php b/src/Makes/MakeModel.php index <HASH>..<HASH> 100644 --- a/src/Makes/MakeModel.php +++ b/src/Makes/MakeModel.php @@ -32,11 +32,10 @@ class MakeModel { if (! $this->files->exists($modelPath)) { $this->scaffoldCommandObj->call('make:model', [ - 'name' => $name, - '--no-migration' => true + 'name' => $name ]); } } -} \ No newline at end of file +}
Update MakeModel.php to work with Laravel <I> Laravel <I> no longer supports the --no-migration flag. It's not even needed, as migrations aren't made by default not.
laraviet_l5scaffold
train
php
233e65f2829080aeac6d3d785a34c1ea73f92714
diff --git a/lib/rails_env_credentials/version.rb b/lib/rails_env_credentials/version.rb index <HASH>..<HASH> 100644 --- a/lib/rails_env_credentials/version.rb +++ b/lib/rails_env_credentials/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module RailsEnvCredentials - VERSION = "0.1.1" + VERSION = "0.1.2" end
:shipit: Bump to <I>
sinsoku_rails-env-credentials
train
rb
31ca3353f6375157f28d5f4996a5a498d49231fe
diff --git a/phoebe/frontend/bundle.py b/phoebe/frontend/bundle.py index <HASH>..<HASH> 100644 --- a/phoebe/frontend/bundle.py +++ b/phoebe/frontend/bundle.py @@ -1308,10 +1308,16 @@ class Bundle(ParameterSet): # TODO: make sure also removes and handles the percomponent parameters correctly (ie maxpoints@phoebe@compute) raise NotImplementedError - def add_spot(self, component, feature=None, **kwargs): + def add_spot(self, component=None, feature=None, **kwargs): """ Shortcut to :meth:`add_feature` but with kind='spot' """ + if component is None: + if len(self.hierarchy.get_stars())==1: + component = self.hierarchy.get_stars()[0] + else: + raise ValueError("must provide component for spot") + kwargs.setdefault('component', component) kwargs.setdefault('feature', feature) return self.add_feature('spot', **kwargs)
allow spot to be added for single stars without providing component
phoebe-project_phoebe2
train
py
1b170d7a851879d08a109d722392db2b1f1d7f6c
diff --git a/src/Symfony/Component/Finder/SplFileInfo.php b/src/Symfony/Component/Finder/SplFileInfo.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Finder/SplFileInfo.php +++ b/src/Symfony/Component/Finder/SplFileInfo.php @@ -38,6 +38,8 @@ class SplFileInfo extends \SplFileInfo /** * Returns the relative path. * + * This path does not contain the file name. + * * @return string the relative path */ public function getRelativePath() @@ -48,6 +50,8 @@ class SplFileInfo extends \SplFileInfo /** * Returns the relative path name. * + * This path contains the file name. + * * @return string the relative path name */ public function getRelativePathname()
Improve the phpdoc of SplFileInfo methods
symfony_symfony
train
php
0391feaf1f16c2dd74473d13545e8ac68d27b744
diff --git a/structr-core/src/main/java/org/structr/core/graph/Factory.java b/structr-core/src/main/java/org/structr/core/graph/Factory.java index <HASH>..<HASH> 100644 --- a/structr-core/src/main/java/org/structr/core/graph/Factory.java +++ b/structr-core/src/main/java/org/structr/core/graph/Factory.java @@ -348,6 +348,7 @@ public abstract class Factory<S, T extends GraphObject> implements Adapter<S, T> SecurityContext securityContext = factoryProfile.getSecurityContext(); // In case of superuser or in public context, don't check the overall result count + // (SearchCommand adds visibleToPublicUsers: true in case of an anonymous user) boolean dontCheckCount = securityContext.isSuperUser() || securityContext.getUser(false) == null; if(dontCheckCount){
Added comment in Factory.java.
structr_structr
train
java
a7315e6dccb904d5a61811faf1ab3a2513d728c1
diff --git a/src/dom.js b/src/dom.js index <HASH>..<HASH> 100644 --- a/src/dom.js +++ b/src/dom.js @@ -81,12 +81,19 @@ export const BlobProvider = ({ document: doc, children }) => { return <InternalBlobProvider document={doc}>{children}</InternalBlobProvider>; }; -export const PDFViewer = ({ className, style, children, ...props }) => { +export const PDFViewer = ({ + className, + style, + children, + innerRef, + ...props +}) => { return ( <InternalBlobProvider document={children}> {({ url }) => ( <iframe className={className} + ref={innerRef} src={url} style={Array.isArray(style) ? flatStyles(style) : style} {...props}
Add innerRef prop to PDFViewer (#<I>)
diegomura_react-pdf
train
js
76a2bfe1581508c01d3144e28866e3cf54254f1a
diff --git a/tasks/angular-service.js b/tasks/angular-service.js index <HASH>..<HASH> 100644 --- a/tasks/angular-service.js +++ b/tasks/angular-service.js @@ -260,7 +260,7 @@ module.exports = function(grunt) { var deps = data.inject || []; // Service dependencies. var name = data.name; // Name of service. var choose = data.choose; - var pretty = data.pretty || true; + var pretty = (data.pretty !== undefined) ? data.pretty : true; // If pretty is `true`, set it to default beautifier settings. if (pretty === true) {
fix `pretty = false` option you'll never get a falsy value out of "result = thing || true".
obibring_grunt-angular-service
train
js
894966071ec2c6f3e29f390ae920532834658fb5
diff --git a/server.js b/server.js index <HASH>..<HASH> 100644 --- a/server.js +++ b/server.js @@ -89,7 +89,7 @@ function Server (opts) { delete this.peers[peerStr]; break; case 'error': - this.emit('error', data.toString(), string2peer(peerStr)); + this.emit('error', new Error(data.toString()), string2peer(peerStr)); } }; @@ -137,8 +137,11 @@ function Server (opts) { // Forward incoming packages to openSSL socket.on('message', (packet, peer) => this.backend.handlePacket(peer2string(peer), packet)); - // Listen on given port - socket.bind(opts.port); + // Expose bind method + this.bind = function () { + const args = Array.prototype.slice.call(arguments); + socket.bind.apply(socket, args); + }; } util.inherits(Server, events.EventEmitter);
Expose bind method instead of directly callig it
jue89_node-openssl-dtls
train
js
b2942f2df7ef42753caf9f550abb5c58c7f22b27
diff --git a/lib/lanes/concerns/code_identifier.rb b/lib/lanes/concerns/code_identifier.rb index <HASH>..<HASH> 100644 --- a/lib/lanes/concerns/code_identifier.rb +++ b/lib/lanes/concerns/code_identifier.rb @@ -26,7 +26,7 @@ module Lanes before_validation(:on=>:create) do source = self[from] unless source.blank? - self.code ||= Lanes::Strings.code_identifier( source, length:max_length ) + self.code ||= Lanes::Strings.code_identifier( source, length:max_length, padding: '' ) end end end
Don't pad code ids when template string is short
argosity_hippo
train
rb
398adbbc7a100d39e406fe92f009584c5e1707d7
diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index <HASH>..<HASH> 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -241,7 +241,7 @@ class Debugger { return; } - $_this =& Debugger::getInstance(); + $_this = Debugger::getInstance(); if (empty($file)) { $file = '[internal]'; @@ -327,7 +327,7 @@ class Debugger { * @link http://book.cakephp.org/view/1191/Using-the-Debugger-Class */ public static function trace($options = array()) { - $_this =& Debugger::getInstance(); + $_this = Debugger::getInstance(); $defaults = array( 'depth' => 999, 'format' => $_this->_outputFormat, @@ -551,7 +551,7 @@ class Debugger { * @param array $strings Template strings to be used for the output format. */ public function output($format = null, $strings = array()) { - $_this =& Debugger::getInstance(); + $_this = Debugger::getInstance(); $data = null; if (is_null($format)) {
Removing E_STRICT errors from debugger
cakephp_cakephp
train
php
6af3bfc5a4de123db2c44c99030c832d71b148d7
diff --git a/tasks.py b/tasks.py index <HASH>..<HASH> 100644 --- a/tasks.py +++ b/tasks.py @@ -81,7 +81,7 @@ def tests_prepare_config(ctx, version, source, target): if line.startswith('db_name'): config_content[idx] = 'db_name = {}\n'.format(dbname(version)) - with open(target, 'w+') as config_file: + with open(target, 'w') as config_file: for line in config_content: config_file.write(line)
No need to open in w+
camptocamp_anthem
train
py
b195a5b33157efabe3cecaddb1666528d0c6eb36
diff --git a/lib/filelib.php b/lib/filelib.php index <HASH>..<HASH> 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -4182,6 +4182,14 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null) { require_login(); } + // Check if user can view this category. + if (!has_capability('moodle/category:viewhiddencategories', $context)) { + $coursecatvisible = $DB->get_field('course_categories', 'visible', array('id' => $context->instanceid)); + if (!$coursecatvisible) { + send_file_not_found(); + } + } + $filename = array_pop($args); $filepath = $args ? '/'.implode('/', $args).'/' : '/'; if (!$file = $fs->get_file($context->id, 'coursecat', 'description', 0, $filepath, $filename) or $file->is_directory()) {
MDL-<I> file_info: check capability when serving file in coursecat description
moodle_moodle
train
php
dd669f49a78cadc70fa9219c2ddbad3115f9975d
diff --git a/channel.go b/channel.go index <HASH>..<HASH> 100644 --- a/channel.go +++ b/channel.go @@ -323,7 +323,7 @@ func (ch *Channel) serve() { netConn.Close() continue } - c.onCloseStateChange = ch.ConnectionCloseStateChange + c.onCloseStateChange = ch.connectionCloseStateChange } } @@ -362,7 +362,7 @@ func (ch *Channel) Connect(ctx context.Context, hostPort string, connectionOptio if err != nil { return nil, err } - c.onCloseStateChange = ch.ConnectionCloseStateChange + c.onCloseStateChange = ch.connectionCloseStateChange if err := c.sendInit(ctx); err != nil { return nil, err @@ -384,7 +384,8 @@ func (ch *Channel) Connect(ctx context.Context, hostPort string, connectionOptio return c, err } -func (ch *Channel) ConnectionCloseStateChange(c *Connection) { +// connectionCloseStateChange is called when a connection's close state changes. +func (ch *Channel) connectionCloseStateChange(c *Connection) { switch chState := ch.State(); chState { case ChannelStartClose, ChannelInboundClosed: ch.mutable.mut.RLock()
Unexport function that should not be exported
uber_tchannel-go
train
go
cbe16dd10d4df39487bbc2bf38cb7600aff22dc4
diff --git a/salt/matchers/confirm_top.py b/salt/matchers/confirm_top.py index <HASH>..<HASH> 100644 --- a/salt/matchers/confirm_top.py +++ b/salt/matchers/confirm_top.py @@ -1,11 +1,8 @@ -# -*- coding: utf-8 -*- """ The matcher subsystem needs a function called "confirm_top", which takes the data passed to a top file environment and determines if that data matches this minion. """ -from __future__ import absolute_import - import logging import salt.loader diff --git a/tests/unit/matchers/test_confirm_top.py b/tests/unit/matchers/test_confirm_top.py index <HASH>..<HASH> 100644 --- a/tests/unit/matchers/test_confirm_top.py +++ b/tests/unit/matchers/test_confirm_top.py @@ -1,12 +1,5 @@ -# -*- coding: utf-8 -*- - -# Import python libs -from __future__ import absolute_import, print_function, unicode_literals - import salt.config import salt.loader - -# Import Salt Testing libs from tests.support.unit import TestCase
Fix pre-commit black and isort
saltstack_salt
train
py,py