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
b62962eb287b480fc19dd78a5f46266c6dac42b4
diff --git a/pyemma/coordinates/data/util/traj_info_backends.py b/pyemma/coordinates/data/util/traj_info_backends.py index <HASH>..<HASH> 100644 --- a/pyemma/coordinates/data/util/traj_info_backends.py +++ b/pyemma/coordinates/data/util/traj_info_backends.py @@ -206,7 +206,7 @@ class SqliteDB(AbstractDB): with self._database as c: c.execute(*statement) except sqlite3.IntegrityError as ie: - logger.exception("insert failed: %s " % ie) + logger.debug("insert failed: %s ", ie, exc_info=True) return self._update_time_stamp(hash_value=traj_info.hash_value)
[trajinfo] turned a verbose exception into debug.
markovmodel_PyEMMA
train
py
eb9c107a0d3c2d1e8961e2fae19cf6f92a3fa65c
diff --git a/ctypeslib/codegen/clangparser.py b/ctypeslib/codegen/clangparser.py index <HASH>..<HASH> 100644 --- a/ctypeslib/codegen/clangparser.py +++ b/ctypeslib/codegen/clangparser.py @@ -177,8 +177,9 @@ class Clang_Parser(object): if name in self.all: log.debug('register: %s already existed: %s', name, obj.name) # code.interact(local=locals()) - raise DuplicateDefinitionException( - 'register: %s already existed: %s' % (name, obj.name)) + #raise DuplicateDefinitionException( + # 'register: %s already existed: %s' % (name, obj.name)) + return self.all[name] log.debug('register: %s ', name) self.all[name] = obj return obj
On duplicate definition, return definition instead of raising exception
trolldbois_ctypeslib
train
py
1daeaaddbcd98622b4a968b2912dd477c6e1cb2c
diff --git a/spec/travis/github/services/fetch_config_spec.rb b/spec/travis/github/services/fetch_config_spec.rb index <HASH>..<HASH> 100644 --- a/spec/travis/github/services/fetch_config_spec.rb +++ b/spec/travis/github/services/fetch_config_spec.rb @@ -38,7 +38,7 @@ describe Travis::Github::Services::FetchConfig do end it "returns { '.result' => 'parse_error' } if the .travis.yml is invalid" do - GH.stubs(:[]).returns("\tfoo: Foo") + GH.stubs(:[]).returns({ "content" => ["\tfoo: Foo"].pack("m") }) result['.result'].should == 'parse_error' end
fetch_config: Fix parse_error spec The error raised wasn't a parse error, so the spec wasn't testing what it was claiming to test.
travis-ci_travis-core
train
rb
1571f9d15733f0cb2bf1a30cb9117a9c8ec295f1
diff --git a/src/util.js b/src/util.js index <HASH>..<HASH> 100644 --- a/src/util.js +++ b/src/util.js @@ -135,8 +135,11 @@ exports = module.exports = { }; function addModuleProperty(module, symbol, modulePath, opt_obj) { + var val = null; Object.defineProperty(opt_obj || module.exports, symbol, { - get : function() { return module.require(modulePath); }}); + get : function() { return val = val || module.require(modulePath); }, + set : function(v) { val = v; } + }); } addModuleProperty(module, 'config_parser', './config_parser');
Fix broken tests due to lazy requiring change.
apache_cordova-cli
train
js
164b28f60030a91c0bc99cb36b668efc7edfcf22
diff --git a/sos/report/plugins/sapnw.py b/sos/report/plugins/sapnw.py index <HASH>..<HASH> 100644 --- a/sos/report/plugins/sapnw.py +++ b/sos/report/plugins/sapnw.py @@ -129,6 +129,12 @@ class sapnw(Plugin, RedHatPlugin): self.collect_list_dbs() # run sapconf in check mode - self.add_cmd_output("sapconf -n", suggest_filename="sapconf_checkmode") + # + # since the command creates a limits.d file on its own, + # we must predicate it by presence of the file + if os.path.exists('/etc/security/limits.d/99-sap-limits.conf') \ + or self.get_option('allow_system_changes'): + self.add_cmd_output("sapconf -n", + suggest_filename="sapconf_checkmode") # vim: et ts=4 sw=4
[sapnw] call sapconf only when a limits.d file exists sapconf command creates /etc/security/limits.d/<I>-sap-limits.conf on its own when missing, so calling the command must be gated by a predicate testing the file presence. Resolves: #<I>
sosreport_sos
train
py
17b52b90141f05bb48ed7db79ac89dfaa7d3a334
diff --git a/src/main/java/org/opensky/libadsb/msgs/SurfaceOperationalStatusV1Msg.java b/src/main/java/org/opensky/libadsb/msgs/SurfaceOperationalStatusV1Msg.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/opensky/libadsb/msgs/SurfaceOperationalStatusV1Msg.java +++ b/src/main/java/org/opensky/libadsb/msgs/SurfaceOperationalStatusV1Msg.java @@ -183,8 +183,8 @@ public class SurfaceOperationalStatusV1Msg extends ExtendedSquitter implements S } /** - * FIXME check compatibility when decoding V2 - * @return the airplane's length in meters; -1 for unkown + * According to DO-260B Table 2-74. Compatible with ADS-B version 1 and 2 + * @return the airplane's length in meters; -1 for unknown */ public int getAirplaneLength() { switch (airplane_len_width) { @@ -217,7 +217,7 @@ public class SurfaceOperationalStatusV1Msg extends ExtendedSquitter implements S } /** - * FIXME check compatibility when decoding V2 + * According to DO-260B Table 2-74. Compatible with ADS-B version 1 and 2. * @return the airplane's width in meters */ public double getAirplaneWidth() {
Checked airplane width/length fields compatibility
openskynetwork_java-adsb
train
java
413d8509ff0a1ebb993e1fd6a5cdd45d301998c1
diff --git a/modules/jooby-hibernate/src/main/java/io/jooby/hibernate/SessionRequest.java b/modules/jooby-hibernate/src/main/java/io/jooby/hibernate/SessionRequest.java index <HASH>..<HASH> 100644 --- a/modules/jooby-hibernate/src/main/java/io/jooby/hibernate/SessionRequest.java +++ b/modules/jooby-hibernate/src/main/java/io/jooby/hibernate/SessionRequest.java @@ -94,7 +94,7 @@ public class SessionRequest implements Route.Decorator { } finally { Session session = ManagedSessionContext.unbind(sessionFactory); if (session != null) { - sessionFactory.close(); + session.close(); } } };
[hibernate]: EntityManagerFactory is closed fix #<I>
jooby-project_jooby
train
java
d0cb1275d1ec3049551cbbc5fc257c9a6ab28856
diff --git a/src/search/FindInFiles.js b/src/search/FindInFiles.js index <HASH>..<HASH> 100644 --- a/src/search/FindInFiles.js +++ b/src/search/FindInFiles.js @@ -773,6 +773,18 @@ define(function (require, exports, module) { _resolve(err ? null : contents); }); } + /* TODO: FileSystem Figure out why this code is significantly slower + DocumentManager.getDocumentForPath(file.fullPath) + .done(function (doc) { + _addSearchMatches(file.fullPath, doc.getText(), currentQueryExpr); + result.resolve(); + }) + .fail(function (error) { + // Always resolve. If there is an error, this file + // is skipped and we move on to the next file. + result.resolve(); + }); + */ } return result.promise(); })
Use DocumentManager.getDocumentForPath() for find in files. Commented out for now since it is 3x slower.
adobe_brackets
train
js
459a5f9d9659482ba0eb2d6a2e2b4b04c0fc6f1c
diff --git a/views/widget/header-logo.blade.php b/views/widget/header-logo.blade.php index <HASH>..<HASH> 100644 --- a/views/widget/header-logo.blade.php +++ b/views/widget/header-logo.blade.php @@ -1,11 +1,12 @@ @extends('widget.header-widget') @section('widget') + <style scoped> + .c-header__logo.t-municipio a img, + .c-header__logo.t-municipio a svg { + width: {{ $maxWidth }}px; + } + </style> <div class="c-header__logo {{$themeClass}}" data-tooltip="{{ $language['logoLabel'] }}"> - <style scoped><!-- Logotype settings --> - a { - max-width: {{ $maxWidth }}px; - } - </style> <a href="{{$home}}" title="{{ $language['logoLabel'] }}"> {!! $logotype !!} </a>
Fixes rendering issue with logotype width settings
helsingborg-stad_Municipio
train
php
fca897f63b5e0bc3f436fc3241a1e43dcfb7c913
diff --git a/TheCannon/apogee.py b/TheCannon/apogee.py index <HASH>..<HASH> 100644 --- a/TheCannon/apogee.py +++ b/TheCannon/apogee.py @@ -32,7 +32,7 @@ class ApogeeDataset(Dataset): self.ranges = [[371,3192], [3697,5997], [6461,8255]] def _get_pixmask(self, fluxes, flux_errs): - """ Return a mask array of bad pixels + """ Return a mask array of bad pixels for one object's spectrum Bad pixels are defined as follows: fluxes or errors are not finite, or reported errors are negative, or the standard deviation of the fluxes @@ -52,7 +52,7 @@ class ApogeeDataset(Dataset): mask: ndarray, dtype=bool array giving bad pixels as True values """ - bad_flux = (~np.isfinite(fluxes)) | (np.std(fluxes, axis=0) == 0) + bad_flux = (~np.isfinite(fluxes)) | (fluxes == 0) bad_err = (~np.isfinite(flux_errs)) | (flux_errs <= 0) bad_pix = bad_err | bad_flux
get_pixmask is only for one object
annayqho_TheCannon
train
py
01be573253a14a71283a498a98a56b0d6f826922
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -282,3 +282,28 @@ function syncNetwork (a, b, cb) { }) }) } + +test('channel membership', function (t) { + var cabal = Cabal(ram) + + cabal.ready(function () { + cabal.getLocalKey((err, lkey) => { + cabal.memberships.getMemberships(lkey, (err, channels) => { + t.same(channels.length, 0, "haven't joined any channels yet") + cabal.publish({ + type: 'channel/join', + content: { + channel: 'new-channel' + } + }, function published () { + cabal.getLocalKey((err, lkey) => { + cabal.memberships.getMemberships(lkey, (err, channels) => { + t.same(channels.length, 1, "we've joined 'new-channel'") + t.same(channels[0], "new-channel", "we've joined 'new-channel'") + }) + }) + }) + }) + }) + }) +})
wip: add test for simple membership
cabal-club_cabal-core
train
js
ac1a363c6ed889d11e8fabd6dd69a8a6df9e3cfd
diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb index <HASH>..<HASH> 100644 --- a/actionpack/test/controller/resources_test.rb +++ b/actionpack/test/controller/resources_test.rb @@ -532,7 +532,7 @@ class ResourcesTest < ActionController::TestCase routes.each do |route| routes.each do |r| next if route === r # skip the comparison instance - assert distinct_routes?(route, r), "Duplicate Route: #{route}" + assert_not_equal route.conditions, r.conditions end end end @@ -1351,8 +1351,4 @@ class ResourcesTest < ActionController::TestCase assert_recognizes(expected_options, path) end end - - def distinct_routes? (r1, r2) - assert_not_equal r1.conditions, r2.conditions - end end
Pull up a method we only use once.
rails_rails
train
rb
8d61d1deeee182e85e760e25e35ff34be3a9932f
diff --git a/lib/views/consult-edit-view.js b/lib/views/consult-edit-view.js index <HASH>..<HASH> 100755 --- a/lib/views/consult-edit-view.js +++ b/lib/views/consult-edit-view.js @@ -192,7 +192,9 @@ this.getModelSvc(idValue) .then(function success(jsonModel) { view.opts.isReadyModelData = true; - view.model.set(jsonModel); + view.model.set(jsonModel,{silent:true}); + //manually trigger the change event in the case of empty object returned. + view.model.trigger('change',view.model); //view.model.savePrevious(); }).then(null, function error(errorResponse) { ErrorHelper.manageResponseErrors(errorResponse, {
issue #<I> manual change event consult edit view
KleeGroup_focus-core
train
js
b4976610eb3c927a42702b4516fffc9ee5cc00be
diff --git a/code/libraries/koowa/libraries/model/behavior/paginatable.php b/code/libraries/koowa/libraries/model/behavior/paginatable.php index <HASH>..<HASH> 100644 --- a/code/libraries/koowa/libraries/model/behavior/paginatable.php +++ b/code/libraries/koowa/libraries/model/behavior/paginatable.php @@ -65,14 +65,19 @@ class KModelBehaviorPaginatable extends KModelBehaviorAbstract $offset = $state->offset; $total = $this->count(); - // Recalculate the offset if it is higher than the total or set to the middle of a page. if ($offset !== 0 && $total !== 0) { - if (($offset >= $total) || ($offset % $limit !== 0)) - { + // Recalculate the offset if it is set to the middle of a page. + if ($offset % $limit !== 0) { + $offset -= ($offset % $limit); + } + + // Recalculate the offset if it is higher than the total + if ($offset >= $total) { $offset = floor(($total - 1) / $limit) * $limit; - $state->offset = $offset; } + + $state->offset = $offset; } $context->query->limit($limit, $offset);
re #<I>: Recalculate the offset if it's set to the middle of a page.
joomlatools_joomlatools-framework
train
php
4c061c8ed67849df1b6156e39a3c416bfb94cf6e
diff --git a/src/Collections/RouteCollection.php b/src/Collections/RouteCollection.php index <HASH>..<HASH> 100644 --- a/src/Collections/RouteCollection.php +++ b/src/Collections/RouteCollection.php @@ -50,7 +50,7 @@ class RouteCollection extends RouteProperties $options = []; } - $child = new self($options); + $child = $this->createRouteCollection($options); $child->setParent($this); $this->children[] = $child; @@ -150,7 +150,7 @@ class RouteCollection extends RouteProperties */ public function action($method, $path, $action, array $options = []) { - $route = new Route($this, $method, $path, $action, $options); + $route = $this->createRoute($method, $path, $action, $options); $this->routes[] = $route; return $route; @@ -378,4 +378,25 @@ class RouteCollection extends RouteProperties return $out; } + + /** + * @param $method + * @param $path + * @param $action + * @param $options + * @return Route + */ + protected function createRoute($method, $path, $action, $options) + { + return new Route($this, $method, $path, $action, $options); + } + + /** + * @param $options + * @return $this + */ + protected function createRouteCollection($options) + { + return new static($options); + } }
Make it possible to extend the RouteCollection.php
CatLabInteractive_charon
train
php
bcd156b4632503aa7f7c9ad6a69aef4a2f5c0c53
diff --git a/rapidoid-u/src/main/java/org/rapidoid/util/U.java b/rapidoid-u/src/main/java/org/rapidoid/util/U.java index <HASH>..<HASH> 100644 --- a/rapidoid-u/src/main/java/org/rapidoid/util/U.java +++ b/rapidoid-u/src/main/java/org/rapidoid/util/U.java @@ -819,6 +819,37 @@ public class U { }); } + public static <K1, K2, V> Map<K1, Map<K2, V>> mapOfMaps() { + return autoExpandingMap(new Mapper<K1, Map<K2, V>>() { + + @Override + public Map<K2, V> map(K1 src) throws Exception { + return synchronizedMap(); + } + + }); + } + + public static <K, V> Map<K, List<V>> mapOfLists() { + return autoExpandingMap(new Mapper<K, List<V>>() { + + @Override + public List<V> map(K src) throws Exception { + return Collections.synchronizedList(U.<V> list()); + } + + }); + } + + public static <K, V> Map<K, Set<V>> mapOfSets() { + return autoExpandingMap(new Mapper<K, Set<V>>() { + + @Override + public Set<V> map(K src) throws Exception { + return Collections.synchronizedSet(U.<V> set()); + } + + }); } }
Added more auto-expanding map factory utils.
rapidoid_rapidoid
train
java
319b74af755c5f1f644f71541a128e1447117103
diff --git a/release.js b/release.js index <HASH>..<HASH> 100644 --- a/release.js +++ b/release.js @@ -19,11 +19,19 @@ exports.register = function(commander){ return function (path) { if(safePathReg.test(path)){ var file = fis.file.wrap(path); + var exclude = fis.config.get('project.watch.exclude'); if (type == 'add' || type == 'change') { if (!opt.srcCache[file.subpath]) { var file = fis.file(path); - if (file.release) - opt.srcCache[file.subpath] = file; + if (file.release) { + if (exclude) { + if (!fis.util.filter(path, exclude)) { + opt.srcCache[file.subpath] = file; + } + } else { + opt.srcCache[file.subpath] = file; + } + } } } else if (type == 'unlink') { if (opt.srcCache[file.subpath]) {
bugfix fex-team/fis#<I>
fex-team_fis-command-release
train
js
baa5a64da453d8cd063ac9f54b3704c64920dd99
diff --git a/cache.go b/cache.go index <HASH>..<HASH> 100644 --- a/cache.go +++ b/cache.go @@ -876,12 +876,11 @@ func (c *cache) Save(w io.Writer) (err error) { } }() c.RLock() - items := c.items - for _, v := range items { + defer c.RUnlock() + for _, v := range c.items { gob.Register(v.Object) } - c.RUnlock() - err = enc.Encode(&items) + err = enc.Encode(&c.items) return }
Revert <I>bff for now
patrickmn_go-cache
train
go
7760cc4bef3083c4f403f48f3ee5126890f2f3ea
diff --git a/comments-bundle/contao/models/CommentsModel.php b/comments-bundle/contao/models/CommentsModel.php index <HASH>..<HASH> 100644 --- a/comments-bundle/contao/models/CommentsModel.php +++ b/comments-bundle/contao/models/CommentsModel.php @@ -20,7 +20,7 @@ namespace Contao; /** * Reads and writes comments * - * @package Comments + * @package Models * @author Leo Feyer <https://github.com/leofeyer> * @copyright Leo Feyer 2011-2012 */ diff --git a/comments-bundle/contao/models/CommentsNotifyModel.php b/comments-bundle/contao/models/CommentsNotifyModel.php index <HASH>..<HASH> 100644 --- a/comments-bundle/contao/models/CommentsNotifyModel.php +++ b/comments-bundle/contao/models/CommentsNotifyModel.php @@ -20,7 +20,7 @@ namespace Contao; /** * Reads and writes comments subscriptions * - * @package Comments + * @package Models * @author Leo Feyer <https://github.com/leofeyer> * @copyright Leo Feyer 2011-2012 */
[Comments] Corrected the phpDoc package of the comments models
contao_contao
train
php,php
7bcfd9bba8e43de62cc0cba9bccf04e8061dd27c
diff --git a/raven/base.py b/raven/base.py index <HASH>..<HASH> 100644 --- a/raven/base.py +++ b/raven/base.py @@ -287,8 +287,13 @@ class Client(object): if not data.get('level'): data['level'] = kwargs.get('level') or logging.ERROR - data['modules'] = get_versions(self.include_paths) - data['server_name'] = self.name + + if not data.get('server_name'): + data['server_name'] = self.name + + if not data.get('modules'): + data['modules'] = get_versions(self.include_paths) + data['tags'] = tags data.setdefault('extra', {}) data.setdefault('level', logging.ERROR)
Client can now take explicit server_name and modules
getsentry_raven-python
train
py
a975027bc3a3a7c7f40f7e214ddcaeeb07e218aa
diff --git a/ui/js/controllers/logviewer.js b/ui/js/controllers/logviewer.js index <HASH>..<HASH> 100644 --- a/ui/js/controllers/logviewer.js +++ b/ui/js/controllers/logviewer.js @@ -160,7 +160,7 @@ logViewer.controller('LogviewerCtrl', [ var revision = $scope.artifact.header.revision.substr(0,12); $scope.logRevisionFilterUrl = $scope.urlBasePath - + "index.html#/jobs?repo=" + + "#/jobs?repo=" + $scope.repoName + "&revision=" + revision; // Store the artifact epoch date string in a real date object for use
Bug <I> - Treeherder log view's link to pushlog is broken
mozilla_treeherder
train
js
8aa076a92e5afddaa5db292a39135d9cd5490a7f
diff --git a/lib/bullet/detector/n_plus_one_query.rb b/lib/bullet/detector/n_plus_one_query.rb index <HASH>..<HASH> 100644 --- a/lib/bullet/detector/n_plus_one_query.rb +++ b/lib/bullet/detector/n_plus_one_query.rb @@ -10,6 +10,7 @@ module Bullet # if it is, keeps this unpreload associations and caller. def call_association(object, associations) return unless Bullet.start? + return unless Bullet.n_plus_one_query_enable? return unless object.primary_key_value return if inversed_objects.include?(object.bullet_key, associations) add_call_object_associations(object, associations)
Fix NPlusOneQuery call even if disabled
flyerhzm_bullet
train
rb
78bb73fa8774cb5fed7e7f97afe3b693c0bbbe56
diff --git a/src/main/java/org/jmxtrans/embedded/spring/EmbeddedJmxTransFactory.java b/src/main/java/org/jmxtrans/embedded/spring/EmbeddedJmxTransFactory.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jmxtrans/embedded/spring/EmbeddedJmxTransFactory.java +++ b/src/main/java/org/jmxtrans/embedded/spring/EmbeddedJmxTransFactory.java @@ -107,7 +107,7 @@ public class EmbeddedJmxTransFactory implements FactoryBean<EmbeddedJmxTrans>, D } embeddedJmxTrans = newJmxTrans; logger.info("Created EmbeddedJmxTrans with configuration {})", configurationUrls); - // embeddedJmxTrans.start(); + embeddedJmxTrans.start(); } return embeddedJmxTrans; } @@ -143,9 +143,9 @@ public class EmbeddedJmxTransFactory implements FactoryBean<EmbeddedJmxTrans>, D @Override public void destroy() throws Exception { logger.info("EmbeddedJmxFactory.destroy"); - // if (embeddedJmxTrans != null) { - // embeddedJmxTrans.stop(); - //} + if (embeddedJmxTrans != null) { + embeddedJmxTrans.stop(); + } } public void setIgnoreConfigurationNotFound(boolean ignoreConfigurationNotFound) {
Keep lifecycle in BeanFactory
jmxtrans_embedded-jmxtrans
train
java
dd6f810ccba7de99161e5bf5bdb78b28576afc01
diff --git a/bundles/org.eclipse.orion.client.ui/web/plugins/site/selfHostingRules.js b/bundles/org.eclipse.orion.client.ui/web/plugins/site/selfHostingRules.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.ui/web/plugins/site/selfHostingRules.js +++ b/bundles/org.eclipse.orion.client.ui/web/plugins/site/selfHostingRules.js @@ -1,3 +1,4 @@ + /******************************************************************************* * @license * Copyright (c) 2013 IBM Corporation and others. @@ -46,7 +47,8 @@ define([], function() { { type: API, source: "/logout", targetPattern: "${0}logout" }, { type: API, source: "/task", targetPattern: "${0}task" }, { type: API, source: "/cfapi", targetPattern: "${0}cfapi" }, - { type: API, source: "/docker", targetPattern: "${0}docker" } + { type: API, source: "/docker", targetPattern: "${0}docker" }, + { type: API, source: "/metrics", targetPattern: "${0}metrics" }, ]; return {
Add /metrics to self hosting config
eclipse_orion.client
train
js
e7e6c73ba7a376bd5c0d7375cb489455e9d41956
diff --git a/node_modules_build/kwf-webpack/config/webpack.kwf.config.js b/node_modules_build/kwf-webpack/config/webpack.kwf.config.js index <HASH>..<HASH> 100644 --- a/node_modules_build/kwf-webpack/config/webpack.kwf.config.js +++ b/node_modules_build/kwf-webpack/config/webpack.kwf.config.js @@ -137,7 +137,7 @@ module.exports = { }, resolve: { modules: ["node_modules", "vendor/bower_components"], - descriptionFiles: ['bower.json', 'package.json'], + descriptionFiles: ['package.json', 'bower.json'], mainFields: ['browser', 'module', 'main'], plugins: [new BowerResolvePlugin()], alias: lookupAliasPaths(),
resolve package.json before bower.json on webpack build because mostly npm is used for packages
koala-framework_koala-framework
train
js
5eaf884cda951fbb7facf95360c0aae003238e95
diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -174,13 +174,13 @@ class Process $this->status = proc_get_status($process); } - $exitCode = proc_close($process); + $exitcode = proc_close($process); if ($this->status['signaled']) { throw new \RuntimeException(sprintf('The process stopped because of a "%s" signal.', $this->status['stopsig'])); } - - return $this->exitcode = ($this->status["running"] ? $exitCode : $this->status["exitcode"]); + + return $this->exitcode = $this->status['running'] ? $exitcode : $this->status['exitcode']; } /**
[Process] fixed CS
symfony_symfony
train
php
21170c7365cd6d8a98a9942003ace2dc62222428
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -123,7 +123,12 @@ PostHTML.prototype.process = function (tree, options) { // async mode var i = 0 + Api.context = tree + var next = function (result, cb) { + // (re)extend the object + Api.call(result) + // all plugins called if (this.plugins.length <= i) { cb(null, result) @@ -135,11 +140,6 @@ PostHTML.prototype.process = function (tree, options) { return next(res || result, cb) } - // (re)extend the object - if (result.extendApi === undefined) { - Api.call(result) - } - // call next var plugin = this.plugins[i++]
perf(index): set the previous tree as the context value for api
posthtml_posthtml
train
js
d9239dfeeaa4ca91d20af20682c9a003c1dc3899
diff --git a/cloudwatchmon/cli/put_instance_stats.py b/cloudwatchmon/cli/put_instance_stats.py index <HASH>..<HASH> 100755 --- a/cloudwatchmon/cli/put_instance_stats.py +++ b/cloudwatchmon/cli/put_instance_stats.py @@ -365,7 +365,7 @@ def add_loadavg_metrics(args, metrics): def get_disk_info(paths): df_out = [s.split() for s in - os.popen('/bin/df -k -l -P ' + + os.popen('/bin/df -k -P ' + ' '.join(paths)).read().splitlines()] disks = [] for line in df_out[1:]:
Removed unnecessary df -l switch - closes #<I>
osiegmar_cloudwatch-mon-scripts-python
train
py
acc35e8afbf5916f2b2f4c3daaae4833c4848a47
diff --git a/dial_sync.go b/dial_sync.go index <HASH>..<HASH> 100644 --- a/dial_sync.go +++ b/dial_sync.go @@ -97,13 +97,14 @@ func (ds *DialSync) getActiveDial(p peer.ID) (*activeDial, error) { reqch: make(chan DialRequest), ds: ds, } - ds.dials[p] = actd err := ds.dialWorker(adctx, p, actd.reqch) if err != nil { cancel() return nil, err } + + ds.dials[p] = actd } // increase ref count before dropping dialsLk
don't store the active dial if it errors while starting the worker
libp2p_go-libp2p-swarm
train
go
0646ca5a8ec5ea9a7615fc8a986c861939391728
diff --git a/amibaker/provisioner.py b/amibaker/provisioner.py index <HASH>..<HASH> 100644 --- a/amibaker/provisioner.py +++ b/amibaker/provisioner.py @@ -49,7 +49,7 @@ class Provisioner: self.__run(script) def __run(self, script): - run(script) + run(script, warn_only=True) def __copy(self, copy): for f in copy:
Script runs won't fail on non-zero exit codes
hamidnazari_amibaker
train
py
f033f259b4dda91679be0221933a49c011db1f50
diff --git a/lib/renderer/init.js b/lib/renderer/init.js index <HASH>..<HASH> 100644 --- a/lib/renderer/init.js +++ b/lib/renderer/init.js @@ -84,7 +84,7 @@ if (location.protocol === 'chrome-devtools:') { } } -if (nodeIntegration === 'true' || nodeIntegration === 'all' || nodeIntegration === 'except-iframe' || nodeIntegration === 'manual-enable-iframe') { +if (nodeIntegration === 'true') { // Export node bindings to global. global.require = require; global.module = module;
Only check for nodeIntegration being true
electron_electron
train
js
dcff494755e9b9f2f2af078e436b0c0fd32e6100
diff --git a/usb1.py b/usb1.py index <HASH>..<HASH> 100644 --- a/usb1.py +++ b/usb1.py @@ -1205,9 +1205,15 @@ class LibUSBContext(object): instances. """ device_p_p = libusb1.libusb_device_p_p() + libusb_device_p = libusb1.libusb_device_p device_list_len = libusb1.libusb_get_device_list(self.__context_p, byref(device_p_p)) - result = [USBDevice(self, x) for x in device_p_p[:device_list_len]] + # Instanciate our own libusb_device_p object so we can free + # libusb-provided device list. Is this a bug in ctypes that it doesn't + # copy pointer value (=pointed memory address) ? At least, it's not so + # convenient and forces using such weird code. + result = [USBDevice(self, libusb_device_p(x.contents)) + for x in device_p_p[:device_list_len]] libusb1.libusb_free_device_list(device_p_p, 0) return result
Copy libusb-provided pointers. Otherwise, they might change between the time libusb_free_device_list is called and pointer is used again (ex: opening device).
vpelletier_python-libusb1
train
py
4890deff280d36df40feb0851f65b34b992bcc2b
diff --git a/lib/githubstats.rb b/lib/githubstats.rb index <HASH>..<HASH> 100644 --- a/lib/githubstats.rb +++ b/lib/githubstats.rb @@ -2,7 +2,7 @@ require 'json' require 'nokogiri' -require 'net/http' +require 'httparty' require 'date' require 'basiccache' @@ -142,7 +142,7 @@ module GithubStats def download(to_date = nil) url = to_date ? @url + "?to=#{to_date.strftime('%Y-%m-%d')}" : @url - res = Net::HTTP.get_response(url, '/') + res = HTTParty.get(url) code = res.code raise("Failed loading data from GitHub: #{url} #{code}") if code != 200 html = Nokogiri::HTML(res.body)
Switched library The other one was having TCP socket issues with HTTPS, so I'm hoping this lib has built-in SSL support. If not I'll just try another one.
akerl_githubstats
train
rb
0ff13c05356e9d34f2c8f9c0045e2d11af6e3aea
diff --git a/app/models/spree/adyen/presenters/communication.rb b/app/models/spree/adyen/presenters/communication.rb index <HASH>..<HASH> 100644 --- a/app/models/spree/adyen/presenters/communication.rb +++ b/app/models/spree/adyen/presenters/communication.rb @@ -1,5 +1,3 @@ -require_relative "./communications" - module Spree module Adyen module Presenters @@ -7,9 +5,9 @@ module Spree # source. class Communication < SimpleDelegator PRESENTERS = [ - Communications::AdyenNotification, - Communications::HppSource, - Communications::LogEntry + ::Spree::Adyen::Presenters::Communications::AdyenNotification, + ::Spree::Adyen::Presenters::Communications::HppSource, + ::Spree::Adyen::Presenters::Communications::LogEntry ].freeze def self.from_source source
Fix issue with autoloading commmunications This was breaking on changes in developement. Fully qualifying the names fixes it.
StemboltHQ_solidus-adyen
train
rb
a4a491611174be8cfb37e816f06f32e32b3b4414
diff --git a/guava-tests/test/com/google/common/hash/HashingTest.java b/guava-tests/test/com/google/common/hash/HashingTest.java index <HASH>..<HASH> 100644 --- a/guava-tests/test/com/google/common/hash/HashingTest.java +++ b/guava-tests/test/com/google/common/hash/HashingTest.java @@ -441,7 +441,7 @@ public class HashingTest extends TestCase { public void testNullPointers() { NullPointerTester tester = new NullPointerTester() - .setDefault(HashCode.class, HashCode.fromInt(0)); + .setDefault(HashCode.class, HashCode.fromLong(0)); tester.testAllPublicStaticMethods(Hashing.class); }
Shuffling from internal-only changes. ------------- Created by MOE: <URL>
google_guava
train
java
39893ce3859212ffa39907004af63bbbcbd8d134
diff --git a/lib/Http1Driver.php b/lib/Http1Driver.php index <HASH>..<HASH> 100644 --- a/lib/Http1Driver.php +++ b/lib/Http1Driver.php @@ -342,6 +342,7 @@ class Http1Driver implements HttpDriver { // Handle HTTP/2 upgrade request. if ($protocol === "1.1" && isset($headers["upgrade"][0], $headers["http2-settings"][0], $headers["connection"][0]) + && !$this->client->isEncrypted() && $this->options->isHttp2Enabled() && false !== stripos($headers["connection"][0], "upgrade") && strtolower($headers["upgrade"][0]) === "h2c" @@ -651,9 +652,15 @@ class Http1Driver implements HttpDriver { } public function pendingRequestCount(): int { - return $this->http2 - ? $this->http2->pendingRequestCount() - : ($this->bodyEmitter !== null ? 1 : 0); + if ($this->bodyEmitter) { + return 1; + } + + if ($this->http2) { + return $this->http2->pendingRequestCount(); + } + + return 0; } /**
Fix pending request count for upgraded connections Also check that a client is not encrypted for upgrade connections.
amphp_http-server
train
php
46fd7dd7d794eb5fe6406198880d06a1b33d85e7
diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -798,7 +798,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab // If the type value is null it is probably safe to assume we're eager loading // the relationship. When that is the case we will pass in a dummy query as // there are multiple types in the morph and we can't use single queries. - if (is_null($class = $this->$type)) { + if (empty($class = $this->$type)) { return new MorphTo( $this->newQuery(), $this, $id, null, $type, $name );
Fix Issue #<I> (#<I>)
laravel_framework
train
php
3b18c9e35a017f6650d97da960eab6f71a090dfc
diff --git a/src/Caouecs/Sirtrevorjs/Converter/SocialConverter.php b/src/Caouecs/Sirtrevorjs/Converter/SocialConverter.php index <HASH>..<HASH> 100644 --- a/src/Caouecs/Sirtrevorjs/Converter/SocialConverter.php +++ b/src/Caouecs/Sirtrevorjs/Converter/SocialConverter.php @@ -38,6 +38,7 @@ class SocialConverter extends BaseConverter implements ConverterInterface .'d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.' .'facebook.net/en_GB/all.js#xfbml=1";fjs.parentNode.insertBefore(js, fjs);}(document,' .'\'script\',\'facebook-jssdk\'));</script>', + 'tweet' => '<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>', ], 'amp' => [ 'tweet' => '<script async custom-element="amp-twitter" src="https://cdn.ampproject.org/v0/'
fix: tweet - html - include js
caouecs_Laravel-SirTrevorJS
train
php
1a52fecf89db177d11574571456114a4e2057a88
diff --git a/src/Contracts/Connections/ProviderInterface.php b/src/Contracts/Connections/ProviderInterface.php index <HASH>..<HASH> 100644 --- a/src/Contracts/Connections/ProviderInterface.php +++ b/src/Contracts/Connections/ProviderInterface.php @@ -93,6 +93,8 @@ interface ProviderInterface /** * Returns the root DSE entry on the currently connected server. * + * @deprecated since v6.0.9 + * * @return \Adldap\Models\Entry|bool */ public function getRootDse();
Depreciate getRootDse method in provider interface
Adldap2_Adldap2
train
php
cb1ce6be47248679f1b18c20370a12b5304367da
diff --git a/clients/customer_report.py b/clients/customer_report.py index <HASH>..<HASH> 100644 --- a/clients/customer_report.py +++ b/clients/customer_report.py @@ -8,7 +8,7 @@ def main(): c.connect("tcp://127.0.0.1:4242") results = c.batch_work_request('view_customer', {}) - pprint.pprint(results) + pprint.pprint(list(results)) def test(): ''' customer_report test '''
fix customer report client Former-commit-id: <I>dc4ad<I>ae<I>ad<I>ccfcd9e
SuperCowPowers_workbench
train
py
8c7cce678c473cf5264867335791bd410aa17e56
diff --git a/assets/relations/relations.js b/assets/relations/relations.js index <HASH>..<HASH> 100644 --- a/assets/relations/relations.js +++ b/assets/relations/relations.js @@ -59,7 +59,8 @@ container = _settings.modalId + ' .modal-body', options = { 'push': false, - 'replace': false + 'replace': false, + 'scrollTo': false }, target, title, relation, url; if (clicked.is('a')) {
fix scrolling to top after saving relation
netis-pl_yii2-crud
train
js
a3a2c3d286b6643eb57b9565d8c66382eb4c4c9a
diff --git a/code/Control/UserDefinedFormController.php b/code/Control/UserDefinedFormController.php index <HASH>..<HASH> 100644 --- a/code/Control/UserDefinedFormController.php +++ b/code/Control/UserDefinedFormController.php @@ -104,12 +104,12 @@ class UserDefinedFormController extends PageController * where the form should be rendered into. If it does not exist * then default back to $Form. * - * @return array + * @return array|Object */ public function index(HTTPRequest $request = null) { if ($this->config()->disable_form_content_interpolation) { - return []; + return $this; } if ($this->Content && $form = $this->Form()) { $hasLocation = stristr($this->Content, '$UserDefinedForm');
Fix(UserDefinedFormController) change return type of index() when not using shortcode
silverstripe_silverstripe-userforms
train
php
8de76d42000691df3104e55412ab3370d7c8cac2
diff --git a/mktmain/client_cli.py b/mktmain/client_cli.py index <HASH>..<HASH> 100644 --- a/mktmain/client_cli.py +++ b/mktmain/client_cli.py @@ -1302,8 +1302,8 @@ def parse_script_file(filename): def verify_key(creator, key): - keyAddr = pybitcointools.pubtoaddr(pybitcointools.privtopub(key)) - if keyAddr != creator['address']: + key_addr = pybitcointools.pubtoaddr(pybitcointools.privtopub(key)) + if key_addr != creator['address']: print "Participant signing key mismatch." print "The key loaded does not match the key the participant was " \ "created with." @@ -1374,8 +1374,11 @@ def local_main(config): script = config.get("ScriptFile", []) if script: + echo = config["Echo"] cmdlines = parse_script_file(script) for cmdline in cmdlines: + if echo: + print cmdline if controller.onecmd(cmdline): return
enable echo cmd line option to echo script commands.
hyperledger_sawtooth-core
train
py
11999eb5ff36a43fc14bef69ae294158181c2a68
diff --git a/angr/analyses/cfg_arch_options.py b/angr/analyses/cfg_arch_options.py index <HASH>..<HASH> 100644 --- a/angr/analyses/cfg_arch_options.py +++ b/angr/analyses/cfg_arch_options.py @@ -43,7 +43,7 @@ class CFGArchOptions(object): for k, (_, value) in self.OPTIONS[self.arch.name].iteritems(): self._options[k] = value - for k, v in options: + for k, v in options.iteritems(): self.__setattr__(k, v) def __getattr__(self, option_name):
CFGArchOptions: missing "iteritems".
angr_angr
train
py
04463622ce6d353edb2762ab55b469dbddf50398
diff --git a/tests/test_regex.py b/tests/test_regex.py index <HASH>..<HASH> 100644 --- a/tests/test_regex.py +++ b/tests/test_regex.py @@ -136,6 +136,12 @@ def test_incompatible_uris(): assert not err.failed() assert not any(err.compat_summary.values()) + err = _do_test_raw(""" + var foo = { data: "LOL NOT THE CASE" }; + """, versions=fx6) + assert not err.failed() + assert not any(err.compat_summary.values()) + def test_chrome_usage(): err = _do_test_raw("""var foo = require("bar");""") diff --git a/validator/testcases/regex.py b/validator/testcases/regex.py index <HASH>..<HASH> 100644 --- a/validator/testcases/regex.py +++ b/validator/testcases/regex.py @@ -207,7 +207,7 @@ def run_regex_tests(document, err, filename, context=None, is_js=False): if is_js: # javascript/data: URI usage in the address bar _compat_test( - re.compile(r"\b(javascript|data):"), + re.compile(r"['\"](javascript|data):"), "javascript:/data: URIs may be incompatible with Firefox " "6.", ("Loading 'javascript:' and 'data:' URIs through the "
Bug <I>: Only flag data:/javascript: URLs in strings to reduce noise. Would that they could disappear entirely.
mozilla_amo-validator
train
py,py
7a069dc6f8438b6f635d33dabf3e303c5a113243
diff --git a/activejob/test/support/integration/adapters/sidekiq.rb b/activejob/test/support/integration/adapters/sidekiq.rb index <HASH>..<HASH> 100644 --- a/activejob/test/support/integration/adapters/sidekiq.rb +++ b/activejob/test/support/integration/adapters/sidekiq.rb @@ -53,11 +53,20 @@ module SidekiqJobsManager require "sidekiq/cli" require "sidekiq/launcher" - config = Sidekiq - config[:queues] = ["integration_tests"] - config[:environment] = "test" - config[:concurrency] = 1 - config[:timeout] = 1 + if Sidekiq.respond_to?(:[]=) + config = Sidekiq + config[:queues] = ["integration_tests"] + config[:environment] = "test" + config[:concurrency] = 1 + config[:timeout] = 1 + else + config = { + queues: ["integration_tests"], + environment: "test", + concurrency: 1, + timeout: 1 + } + end sidekiq = Sidekiq::Launcher.new(config) Sidekiq.average_scheduled_poll_interval = 0.5 Sidekiq.options[:poll_interval_average] = 1
Work around Sidekiq <I> and <I> API difference
rails_rails
train
rb
41f6a80578824b72f356072b212d4852da1b4836
diff --git a/pkg/policy/rule.go b/pkg/policy/rule.go index <HASH>..<HASH> 100644 --- a/pkg/policy/rule.go +++ b/pkg/policy/rule.go @@ -94,8 +94,10 @@ func (policy *L4Filter) addFromEndpoints(fromEndpoints []api.EndpointSelector) b } if len(policy.FromEndpoints) > 0 && len(fromEndpoints) == 0 { - // new policy is more permissive than the existing policy - // use a more permissive one + log.WithFields(logrus.Fields{ + logfields.EndpointSelector: fromEndpoints, + "policy": policy, + }).Debug("new L4 filter applies to all endpoints, making the policy more permissive.") policy.FromEndpoints = nil }
policy: Convert comment to debug message This comment could be just as well served as a debug message, which would allow devs to notice this occurring at runtime. Switch it over.
cilium_cilium
train
go
6159219616834e7e8ee2d23780de27493f86903a
diff --git a/internal/handles.go b/internal/handles.go index <HASH>..<HASH> 100644 --- a/internal/handles.go +++ b/internal/handles.go @@ -695,7 +695,9 @@ func (fh *FileHandle) readAhead(fs *Goofys, offset uint64, needAtLeast int) (err func (fh *FileHandle) ReadFile(fs *Goofys, offset int64, buf []byte) (bytesRead int, err error) { fh.inode.logFuse("ReadFile", offset, len(buf)) - defer fh.inode.logFuse("< ReadFile", bytesRead, err) + defer func() { + fh.inode.logFuse("< ReadFile", bytesRead, err) + }() fh.mu.Lock() defer fh.mu.Unlock()
late bind bytesRead and err and they are correctly logged
kahing_goofys
train
go
227e14fe41935e8ad7e22f5a950884589e0b2fc0
diff --git a/src/ORM/Query.php b/src/ORM/Query.php index <HASH>..<HASH> 100644 --- a/src/ORM/Query.php +++ b/src/ORM/Query.php @@ -737,7 +737,6 @@ class Query extends DatabaseQuery implements JsonSerializable, QueryInterface if (!$complex && $this->_valueBinder !== null) { $order = $this->clause('order'); $complex = $order === null ? false : $order->hasNestedExpression(); - var_dump($order); } $count = ['count' => $query->func()->count('*')]; diff --git a/tests/TestCase/Controller/Component/PaginatorComponentTest.php b/tests/TestCase/Controller/Component/PaginatorComponentTest.php index <HASH>..<HASH> 100644 --- a/tests/TestCase/Controller/Component/PaginatorComponentTest.php +++ b/tests/TestCase/Controller/Component/PaginatorComponentTest.php @@ -964,6 +964,8 @@ class PaginatorComponentTest extends TestCase */ public function testPaginateQueryWithBindValue() { + $config = ConnectionManager::config('test'); + $this->skipIf(strpos($config['driver'], 'Sqlserver') !== false, 'Test temporarily broken in SQLServer'); $this->loadFixtures('Posts'); $table = TableRegistry::get('PaginatorPosts'); $query = $table->find()
Skipping test in SQLServer while we find an appropriate fix This test is at least an obscure feature of the ORM, and fixing it properly requires a fair bit of changes. Skipping for now
cakephp_cakephp
train
php,php
12d91c1d67aa4c05ecead7ff16041fb2b9ca366d
diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py index <HASH>..<HASH> 100644 --- a/searx/engines/__init__.py +++ b/searx/engines/__init__.py @@ -218,4 +218,5 @@ def get_engines_stats(): def initialize_engines(engine_list): for engine_data in engine_list: engine = load_engine(engine_data) - engines[engine.name] = engine + if engine is not None: + engines[engine.name] = engine
[mod] searx doesn't crash at startup when an engine can't be loaded (see #<I>)
asciimoo_searx
train
py
507115a94f8e176b6df8956d1abc9577eff8c49d
diff --git a/app.py b/app.py index <HASH>..<HASH> 100644 --- a/app.py +++ b/app.py @@ -33,13 +33,13 @@ def bind_sensor(sensors, index): if gpio_loaded: - GPIO.Setmode(GPIO.BOARD) - GPIO.Setup(11, GPIO.OUTPUT) + GPIO.setmode(GPIO.BOARD) + GPIO.setup(11, GPIO.OUTPUT) def led_control(value=None): - GPIO.Output(11, value) - return GPIO.Input(11) + GPIO.output(11, value) + return GPIO.input(11) # Put required variable declaration here
GPIO method calls to lower case
cloud4rpi_cloud4rpi
train
py
869b007172af30fdaac012467424750cde65da23
diff --git a/actionpack/lib/action_controller/metal.rb b/actionpack/lib/action_controller/metal.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_controller/metal.rb +++ b/actionpack/lib/action_controller/metal.rb @@ -116,8 +116,6 @@ module ActionController class Metal < AbstractController::Base abstract! - attr_internal_writer :env - def env @_request.env end
the request object manages `env` remove the setter. The request object manages the env hash, so any mutations need to go through it
rails_rails
train
rb
52eb87567bb17c4914fa4016d9eb005123702f05
diff --git a/src/App/App.php b/src/App/App.php index <HASH>..<HASH> 100644 --- a/src/App/App.php +++ b/src/App/App.php @@ -65,7 +65,21 @@ class App */ public function httpResponse($code = '200') { - // Nothing to do + $jaxon = jaxon(); + // Only if the response is not yet sent + if(!$jaxon->getOption('core.response.send')) + { + // Set the HTTP response code + http_response_code(intval($code)); + + // Send the response + $jaxon->di()->getResponseManager()->sendOutput(); + + if(($jaxon->getOption('core.process.exit'))) + { + exit(); + } + } } /** diff --git a/src/Request/Handler.php b/src/Request/Handler.php index <HASH>..<HASH> 100644 --- a/src/Request/Handler.php +++ b/src/Request/Handler.php @@ -317,11 +317,11 @@ class Handler if(($this->getOption('core.response.send'))) { $this->xResponseManager->sendOutput(); - } - if(($this->getOption('core.process.exit'))) - { - exit(); + if(($this->getOption('core.process.exit'))) + { + exit(); + } } } }
Implemented the httpResponse() method in class App.
jaxon-php_jaxon-core
train
php,php
c010e06f975b8580bd30b1ea30be2e538a67f41b
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 @@ -30,11 +30,13 @@ Dir[root.join('shared/*.rb').to_s].each do |f| require f end -DB_URI = if defined? JRUBY_VERSION - 'jdbc:postgresql://localhost/rom_factory' - else - 'postgres://localhost/rom_factory' - end +DB_URI = ENV.fetch('DATABASE_URL') do + if defined? JRUBY_VERSION + 'jdbc:postgresql://localhost/rom_factory' + else + 'postgres://localhost/rom_factory' + end +end warning_api_available = RUBY_VERSION >= '2.4.0'
Allow DATABASE_URL from env
rom-rb_rom-factory
train
rb
8f10e871919d3561b892c7ced9537f0f9a824f3e
diff --git a/pymatgen/io/vasp/inputs.py b/pymatgen/io/vasp/inputs.py index <HASH>..<HASH> 100644 --- a/pymatgen/io/vasp/inputs.py +++ b/pymatgen/io/vasp/inputs.py @@ -1183,7 +1183,13 @@ class Kpoints(MSONable): gap_distance (float): auto-detection threshold for non-periodicity (in slabs, nanowires, etc.) remove_symmetry (string): optional flag to control - symmetry options. + symmetry options, can be none, structural, + time_reversal, or all + include_gamma (string or bool): whether to include + gamma point + header (string): "verbose" or "simple", denotes + the verbosity of the header + incar (Incar): incar object to upload """ config = locals() config.pop("structure", "incar")
more docs for JHU kpoint server
materialsproject_pymatgen
train
py
a493b2c10b2aabc97ba1a80501c4794d564ef2e9
diff --git a/test/specs/route.js b/test/specs/route.js index <HASH>..<HASH> 100644 --- a/test/specs/route.js +++ b/test/specs/route.js @@ -43,7 +43,8 @@ describe("Routing", function () { expect(Route.options).toEqual({ trigger: true, history: false, - shim: false + shim: false, + replace: false }); }); @@ -174,6 +175,7 @@ describe("Routing", function () { trigger: true, history: false, shim: true, + replace: false, match: ["/users/1/2", "1", "2"], id: "1", id2: "2" }])); }); @@ -188,6 +190,7 @@ describe("Routing", function () { trigger: true, history: false, shim: true, + replace: false, match: ["/page/gah", "gah"], stuff: "gah" }])); });
fixing tests expect statements that broke with new replace option for history
spine_spine
train
js
c120ed9d61584c3f52742f9d188214ebc4f02d86
diff --git a/Query/Builder.php b/Query/Builder.php index <HASH>..<HASH> 100755 --- a/Query/Builder.php +++ b/Query/Builder.php @@ -2310,7 +2310,13 @@ class Builder */ protected function stripTableForPluck($column) { - return is_null($column) ? $column : last(preg_split('~\.| ~', $column)); + if (is_null($column)) { + return $column; + } + + $seperator = strpos(strtolower($column), ' as ') !== false ? ' as ' : '\.'; + + return last(preg_split('~'.$seperator.'~i', $column)); } /**
[6.x] Fix plucking column name containing a space (#<I>) * [6.x] Fix plucking column name containing a space * [6.x] Make the splitting on the "as" keyword case insensitive
illuminate_database
train
php
33a8d80a422411d7f0226cf98fd95d4ee0523097
diff --git a/util/db/repository_legacy.go b/util/db/repository_legacy.go index <HASH>..<HASH> 100644 --- a/util/db/repository_legacy.go +++ b/util/db/repository_legacy.go @@ -332,8 +332,7 @@ func (l *legacyRepositoryBackend) upsertSecret(name string, data map[string][]by } } if len(secret.Data) == 0 { - isManagedByArgo := (secret.Annotations != nil && secret.Annotations[common.AnnotationKeyManagedBy] == common.AnnotationValueManagedByArgoCD) || - (secret.Labels != nil && secret.Labels[common.LabelKeySecretType] == "repository") + isManagedByArgo := secret.Annotations != nil && secret.Annotations[common.AnnotationKeyManagedBy] == common.AnnotationValueManagedByArgoCD if isManagedByArgo { return l.db.kubeclientset.CoreV1().Secrets(l.db.ns).Delete(context.Background(), name, metav1.DeleteOptions{}) }
chore: Remove unneeded secret type check (#<I>)
argoproj_argo-cd
train
go
c295570ef5ff87a6a36ffbaace2b6d35cd9d267e
diff --git a/config/bootstrap.php b/config/bootstrap.php index <HASH>..<HASH> 100644 --- a/config/bootstrap.php +++ b/config/bootstrap.php @@ -15,7 +15,10 @@ use Cake\Routing\Router; -define('TIME_START', microtime(true)); +/** + * @var float + */ +define('TIME_START', (float)microtime(true)); require CAKE . 'basics.php';
Added float type annotation to TIME_START define
cakephp_cakephp
train
php
2bcebfda555a18fc8d73b41fb7b6eb14e591d3c2
diff --git a/lib/synapse.rb b/lib/synapse.rb index <HASH>..<HASH> 100644 --- a/lib/synapse.rb +++ b/lib/synapse.rb @@ -68,10 +68,16 @@ module Synapse if @config_updated @config_updated = false - statsd_increment('synapse.config.update') @config_generators.each do |config_generator| log.info "synapse: configuring #{config_generator.name}" - config_generator.update_config(@service_watchers) + begin + config_generator.update_config(@service_watchers) + rescue StandardError => e + statsd_increment("synapse.config.update", ['result:fail', "config_name:#{config_generator.name}"]) + log.error "synapse: update config failed for config #{config_generator.name} with exception #{e}" + raise e + end + statsd_increment("synapse.config.update", ['result:success', "config_name:#{config_generator.name}"]) end end
Add success & failure counters for updating config
airbnb_synapse
train
rb
cc413b49ce9dd63fcbe9396a5ac1c8c68872a6c1
diff --git a/astroid/__pkginfo__.py b/astroid/__pkginfo__.py index <HASH>..<HASH> 100644 --- a/astroid/__pkginfo__.py +++ b/astroid/__pkginfo__.py @@ -20,7 +20,7 @@ distname = 'astroid' modname = 'astroid' -numversion = (1, 2, 1) +numversion = (1, 3, 0) version = '.'.join([str(num) for num in numversion]) install_requires = ['logilab-common >= 0.60.0', 'six'] @@ -28,11 +28,11 @@ install_requires = ['logilab-common >= 0.60.0', 'six'] license = 'LGPL' author = 'Logilab' -author_email = 'python-projects@lists.logilab.org' +author_email = 'pylint-dev@lists.logilab.org' mailinglist = "mailto://%s" % author_email web = 'http://bitbucket.org/logilab/astroid' -description = "rebuild a new abstract syntax tree from Python's ast" +description = "A abstract syntax tree for Python with inference support." classifiers = ["Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Quality Assurance",
Update information in pkginfo, including the version information.
PyCQA_astroid
train
py
a3240bd8501b7b6168851c84fe0066f73b258ba0
diff --git a/ipyrad/assemble/rawedit.py b/ipyrad/assemble/rawedit.py index <HASH>..<HASH> 100644 --- a/ipyrad/assemble/rawedit.py +++ b/ipyrad/assemble/rawedit.py @@ -197,6 +197,8 @@ def cutadaptit_single(data, sample): fullcomp(data.paramsdict["restriction_overhang"][1])[::-1] \ + data._hackersonly["p3_adapter"]) else: + LOGGER.warning("No barcode information present, and is therefore not "+\ + "being used for adapter trimming of SE gbs data.") ## else no search for barcodes on 3' adapter = \ fullcomp(data.paramsdict["restriction_overhang"][1])[::-1] \
bugfix; error was raised in no barcodes during step2 filtering for gbs data. Now just a warning is printed
dereneaton_ipyrad
train
py
c9cf23a7422c1bd75336941a9d9c5b99eb04d9ad
diff --git a/src/java/voldemort/store/socket/clientrequest/ClientRequestExecutorFactory.java b/src/java/voldemort/store/socket/clientrequest/ClientRequestExecutorFactory.java index <HASH>..<HASH> 100644 --- a/src/java/voldemort/store/socket/clientrequest/ClientRequestExecutorFactory.java +++ b/src/java/voldemort/store/socket/clientrequest/ClientRequestExecutorFactory.java @@ -109,8 +109,8 @@ public class ClientRequestExecutorFactory implements // Since we're non-blocking and it takes a non-zero amount of time to // connect, invoke finishConnect and loop. while(!socketChannel.finishConnect()) { - if(logger.isEnabledFor(Level.WARN)) - logger.warn("Still connecting to " + dest); + if(logger.isTraceEnabled()) + logger.trace("Still connecting to " + dest); } int numCreated = created.incrementAndGet();
Reduced verbosity in ClientRequestExecutorFactory
voldemort_voldemort
train
java
f0d0fe2176fb071d8d3399f6150975320ccfd2ab
diff --git a/timeago.js b/timeago.js index <HASH>..<HASH> 100644 --- a/timeago.js +++ b/timeago.js @@ -1,7 +1,7 @@ 'use strict' var React = require('react') -Object.assign = require('react/lib/Object.assign') +var assign = require('react/lib/Object.assign') module.exports = React.createClass( { displayName: 'Time-Ago' @@ -83,7 +83,7 @@ module.exports = React.createClass( unit = 'year' } - var props = Object.assign({}, this.props) + var props = assign({}, this.props) delete props.date delete props.formatter
Don't overwrite native Object.assign
nmn_react-timeago
train
js
78d4979c2dfc51a0551b7d763bd8130599f1c57f
diff --git a/molecule/utilities.py b/molecule/utilities.py index <HASH>..<HASH> 100644 --- a/molecule/utilities.py +++ b/molecule/utilities.py @@ -40,7 +40,8 @@ class LogFilter(object): class TrailingNewlineFormatter(logging.Formatter): def format(self, record): - record.msg = record.msg.rstrip() + if record.msg: + record.msg = record.msg.rstrip() return super(TrailingNewlineFormatter, self).format(record)
defend against "AttributeError: NoneType object has no attribute rstrip"
ansible_molecule
train
py
52ddcc2d7c4ff22fb0bb8c69eee54fc890aa290d
diff --git a/borax/__init__.py b/borax/__init__.py index <HASH>..<HASH> 100644 --- a/borax/__init__.py +++ b/borax/__init__.py @@ -1,4 +1,4 @@ # coding=utf8 -__version__ = '3.3.1' +__version__ = '3.3.2' __author__ = 'kinegratii'
:bookmark: release <I>
kinegratii_borax
train
py
23a17ae9a4367ff0bb93711aa13b87d6b28922de
diff --git a/lib/prime_number_generator.rb b/lib/prime_number_generator.rb index <HASH>..<HASH> 100644 --- a/lib/prime_number_generator.rb +++ b/lib/prime_number_generator.rb @@ -1,3 +1,5 @@ class PrimeNumberGenerator - + def generate + + end end \ No newline at end of file
added generate method to PrimeNumberGenerator
andreiursan_prime-numbers
train
rb
8a6417c31edb5488984496c26f429718a04bd0e6
diff --git a/db/db.go b/db/db.go index <HASH>..<HASH> 100644 --- a/db/db.go +++ b/db/db.go @@ -291,6 +291,8 @@ func (db *DB) Dump(dest string) error { if err != nil { return err } + _ = destFile.Close() + _ = src.Close() tdlog.Noticef("Dump: copied file %s, size is %d", destPath, written) } return nil
Close relative files during db.Dump
HouzuoGuo_tiedot
train
go
dff9e0d64908ca676cd13731b6ddc565e4cecb1d
diff --git a/actors/lib/instance_setup.rb b/actors/lib/instance_setup.rb index <HASH>..<HASH> 100644 --- a/actors/lib/instance_setup.rb +++ b/actors/lib/instance_setup.rb @@ -119,7 +119,7 @@ class InstanceSetup def configure_repositories(repositories) repositories.each do |repo| begin - klass = constantize(repo.name) + klass = repo.name.to_const unless klass.nil? fz = nil if repo.frozen_date
Fixed a lingering call to the no-longer-present method constantize()
rightscale_right_link
train
rb
49d5cf435d07c91dbcb23d239dd2742f846b4a8b
diff --git a/hellocharts-library/src/lecho/lib/hellocharts/model/Axis.java b/hellocharts-library/src/lecho/lib/hellocharts/model/Axis.java index <HASH>..<HASH> 100644 --- a/hellocharts-library/src/lecho/lib/hellocharts/model/Axis.java +++ b/hellocharts-library/src/lecho/lib/hellocharts/model/Axis.java @@ -3,6 +3,7 @@ package lecho.lib.hellocharts.model; import java.util.ArrayList; import java.util.List; +import android.graphics.Color; import android.graphics.Typeface; import lecho.lib.hellocharts.util.Utils; @@ -24,8 +25,8 @@ public class Axis { private String name; private boolean isAutoGenerated = true; private boolean hasLines = false; - private int textColor = Utils.DEFAULT_DARKEN_COLOR; - private int lineColor = Utils.DEFAULT_COLOR; + private int textColor = Color.LTGRAY; + private int lineColor = Utils.DEFAULT_DARKEN_COLOR; private int textSize = DEFAULT_TEXT_SIZE_SP; private int maxLabelChars = DEFAULT_MAX_AXIS_LABEL_CHARS; private Typeface typeface;
Hanged default Axis text color to make it more visible
lecho_hellocharts-android
train
java
ecc173fa749a6b68a8c695f47f1fe19294021640
diff --git a/classes/QueryMonitor.php b/classes/QueryMonitor.php index <HASH>..<HASH> 100644 --- a/classes/QueryMonitor.php +++ b/classes/QueryMonitor.php @@ -26,7 +26,7 @@ class QueryMonitor extends QM_Plugin { parent::__construct( $file ); # Load and register built-in collectors: - foreach ( glob( $this->plugin_path( 'collectors/*.php' ) ) as $file ) { + foreach ( apply_filters( 'qm/built-in-collectors', glob( $this->plugin_path( 'collectors/*.php' ) ) ) as $file ) { include $file; }
Add filter on built-in collectors files before including them
johnbillion_query-monitor
train
php
b209ccb3600d79533df7f8ef4289e38bf1f99adf
diff --git a/lib/right_agent/serialize/serializable.rb b/lib/right_agent/serialize/serializable.rb index <HASH>..<HASH> 100644 --- a/lib/right_agent/serialize/serializable.rb +++ b/lib/right_agent/serialize/serializable.rb @@ -26,7 +26,18 @@ module RightScale # MessagePack and JSON serializable types that are sent to and from agents module Serializable + @check_active_support = true + def self.included(base) + if @check_active_support + if require_succeeds?("active_support") && (v = Gem.loaded_specs['activesupport'].version.to_s) != "2.3.5" + raise Exception.new("Some versions of the activesupport gem modify json in ways that are incompatible with this " + + "RightScale::Serializable module. Version #{v} used here is not allowed, use 2.3.5 instead.") + else + @check_active_support = false + end + end + base.extend ClassMethods base.send(:include, InstanceMethods) end
acu<I> - Ensure that incompatible version of active_support is not loaded
rightscale_right_agent
train
rb
712a74ddd329e397019413b1cfa0f72901fc5b09
diff --git a/aegea/build_ami.py b/aegea/build_ami.py index <HASH>..<HASH> 100644 --- a/aegea/build_ami.py +++ b/aegea/build_ami.py @@ -53,6 +53,9 @@ def build_ami(args): raise Exception("cloud-init encountered errors") sys.stderr.write(GREEN("OK") + "\n") description = "Built by {} for {}".format(__name__, ARN.get_iam_username()) + for existing_ami in resources.ec2.images.filter(Owners=["self"], Filters=[{"Name": "name", "Values": [args.name]}]): + logger.info("Deleting existing image {}".format(existing_ami)) + existing_ami.deregister() image = instance.create_image(Name=args.name, Description=description, BlockDeviceMappings=get_bdm()) tags = dict(tag.split("=", 1) for tag in args.tags) base_ami = resources.ec2.Image(args.ami)
Remove existing AMI by the same name
kislyuk_aegea
train
py
81b6faf7878409a6c297a3cb3bd671642ea2bf62
diff --git a/commands/command_filter_process.go b/commands/command_filter_process.go index <HASH>..<HASH> 100644 --- a/commands/command_filter_process.go +++ b/commands/command_filter_process.go @@ -207,7 +207,7 @@ func filterCommand(cmd *cobra.Command, args []string) { if len(malformed) > 0 { fmt.Fprintln(os.Stderr, tr.Tr.GetN( - "Encountered %d file that should have been pointers, but wasn't:", + "Encountered %d file that should have been a pointer, but wasn't:", "Encountered %d files that should have been pointers, but weren't:", len(malformed), len(malformed),
commands/command_filter_process.go: fix message Now that we have quantity-sensitive text messages for translation purposes, we can correct one message to use the singular form. h/t bk<I> on PR review.
git-lfs_git-lfs
train
go
84dd0a358a41131cf886996185a6500de7ec1566
diff --git a/jbpm-designer-client/src/main/resources/org/jbpm/designer/public/js/Plugins/saveplugin.js b/jbpm-designer-client/src/main/resources/org/jbpm/designer/public/js/Plugins/saveplugin.js index <HASH>..<HASH> 100644 --- a/jbpm-designer-client/src/main/resources/org/jbpm/designer/public/js/Plugins/saveplugin.js +++ b/jbpm-designer-client/src/main/resources/org/jbpm/designer/public/js/Plugins/saveplugin.js @@ -369,7 +369,7 @@ ORYX.Plugins.SavePlugin = Clazz.extend({ if(ORYX.CONFIG.STORESVGONSAVE && ORYX.CONFIG.STORESVGONSAVE == "true") { // svg save - var formattedSvgDOM = DataManager.serialize(ORYX.EDITOR.getCanvas().getSVGRepresentation(false)); + var formattedSvgDOM = DataManager.serialize(ORYX.EDITOR.getCanvas().getSVGRepresentation(true)); var rawSvgDOM = DataManager.serialize(ORYX.EDITOR.getCanvas().getRootNode().cloneNode(true)); var processJSON = ORYX.EDITOR.getSerializedJSON(); var processId = jsonPath(processJSON.evalJSON(), "$.properties.id");
JBPM-<I> - Non escaped characters (&, <, >) in CDATA section in BPMN2 result in invalid SVG file being generated (#<I>)
kiegroup_jbpm-designer
train
js
bde001f89b06b139fe5f03c8ba155337856d4439
diff --git a/packages/theme-data/src/__stories__/stories.js b/packages/theme-data/src/__stories__/stories.js index <HASH>..<HASH> 100644 --- a/packages/theme-data/src/__stories__/stories.js +++ b/packages/theme-data/src/__stories__/stories.js @@ -74,6 +74,11 @@ export default [ readme: undefined }, { + description: "Component - Accordion", + schema: filterMatchByKey(baseTheme.unresolvedRoles, /^accordion./), + readme: undefined + }, + { description: "Component - Avatar", schema: filterMatchByKey(baseTheme.unresolvedRoles, /^avatar./), readme: undefined
docs: update theme-data stories for Accordion
Autodesk_hig
train
js
fbbac308d21af2202057bb6d7f8c9f1619c75b80
diff --git a/bcbio/variation/genotype.py b/bcbio/variation/genotype.py index <HASH>..<HASH> 100644 --- a/bcbio/variation/genotype.py +++ b/bcbio/variation/genotype.py @@ -45,6 +45,8 @@ def _shared_gatk_call_prep(align_bams, ref_file, config, dbsnp, region, out_file params = ["-R", ref_file, "--standard_min_confidence_threshold_for_calling", confidence, "--standard_min_confidence_threshold_for_emitting", confidence, + "--downsample_to_coverage", "250", + "--downsampling_type", "BY_SAMPLE", ] for a in annotation.get_gatk_annotations(config): params += ["--annotation", a]
Provide standard downsampling during GATK variant calling to match <I> defaults on older versions: <I>bp per sample downsampling
bcbio_bcbio-nextgen
train
py
690b6f49abd01cbb0fdc52e68830268ff072baf6
diff --git a/src/ThrottleServiceProvider.php b/src/ThrottleServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/ThrottleServiceProvider.php +++ b/src/ThrottleServiceProvider.php @@ -46,7 +46,7 @@ class ThrottleServiceProvider extends ServiceProvider */ protected function setupConfig() { - $source = realpath(__DIR__.'/../config/throttle.php'); + $source = realpath($raw = __DIR__.'/../config/throttle.php') ?: $raw; if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) { $this->publishes([$source => config_path('throttle.php')]);
Fixed config in phars
GrahamCampbell_Laravel-Throttle
train
php
d5e36d2c960fc9c8cae096a952350154ba400e3a
diff --git a/src/encoding/json/jsonschema/schemaDocument.go b/src/encoding/json/jsonschema/schemaDocument.go index <HASH>..<HASH> 100644 --- a/src/encoding/json/jsonschema/schemaDocument.go +++ b/src/encoding/json/jsonschema/schemaDocument.go @@ -192,6 +192,7 @@ func (d *JsonSchemaDocument) parseSchema(documentNode interface{}, currentSchema return errors.New(fmt.Sprintf(ERROR_MESSAGE_X_MUST_BE_OF_TYPE_Y, KEY_ITEMS, STRING_OBJECT)) } newSchema := &jsonSchema{parent: currentSchema, property: k} + newSchema.ref = currentSchema.ref currentSchema.SetItemsChild(newSchema) err := d.parseSchema(m[k], newSchema) if err != nil {
bugfix : schema inherited from items had nil reference
xeipuuv_gojsonschema
train
go
26f6c62ce4c44bcdc5ad4f02f20d66d6f4924932
diff --git a/telethon/_client/telegrambaseclient.py b/telethon/_client/telegrambaseclient.py index <HASH>..<HASH> 100644 --- a/telethon/_client/telegrambaseclient.py +++ b/telethon/_client/telegrambaseclient.py @@ -146,6 +146,7 @@ def init( # Cache session data for convenient access self._session_state = None self._all_dcs = None + self._state_cache = statecache.StateCache(None, self._log) self._entity_cache = entitycache.EntityCache() self.api_id = int(api_id)
Init update state cache to empty in init
LonamiWebs_Telethon
train
py
19cafe30893a71117b086ae3769ddd41462dd3de
diff --git a/poetry/installation/pip_installer.py b/poetry/installation/pip_installer.py index <HASH>..<HASH> 100644 --- a/poetry/installation/pip_installer.py +++ b/poetry/installation/pip_installer.py @@ -229,7 +229,7 @@ class PipInstaller(BaseInstaller): args.append(req) - return self.run_pip(*args) + return self.run(*args) if package.develop: args.append("-e")
pip installer: fix incorrect method call Resolves: #<I>
sdispater_poetry
train
py
e77acc6aaf19c854665a8f6289c5647e29cda6d8
diff --git a/qiskit/visualization/utils.py b/qiskit/visualization/utils.py index <HASH>..<HASH> 100644 --- a/qiskit/visualization/utils.py +++ b/qiskit/visualization/utils.py @@ -25,6 +25,7 @@ from qiskit.circuit import ( Gate, Instruction, Measure, + ControlFlowOp, ) from qiskit.circuit.library import PauliEvolutionGate from qiskit.circuit.tools import pi_check @@ -129,6 +130,9 @@ def get_param_str(op, drawer, ndigits=3): if not hasattr(op, "params") or any(isinstance(param, np.ndarray) for param in op.params): return "" + if isinstance(op, ControlFlowOp): + return "" + if isinstance(op, Delay): param_list = [f"{op.params[0]}[{op.unit}]"] else:
Omit QuantumCircuit as a parameter when drawing ControlFlowOps. (#<I>) Most ControlFlowOps have at least one param of type QuantumCircuit which qiskit.visualization.utils.get_param_str will attempt to stringify and display as an instruction parameter. This largely doesn't work, since the circuit's string will contain newlines, so instead draw ControlFlowOps with only their name.
Qiskit_qiskit-terra
train
py
0f04f9071033f174a6d4168756debc0110b7ea96
diff --git a/test/index_test.rb b/test/index_test.rb index <HASH>..<HASH> 100644 --- a/test/index_test.rb +++ b/test/index_test.rb @@ -28,6 +28,11 @@ class IndexTest < Minitest::Test assert !old_index.exists? end + def test_total_docs + store_names ["Product A"] + assert_equal 1, Product.searchkick_index.total_docs + end + def test_mapping store_names ["Dollar Tree"], Store assert_equal [], Store.search(query: {match: {name: "dollar"}}).map(&:name)
Added test for total_docs
ankane_searchkick
train
rb
90cdeaf742a942e1c9f59f4be7dc2937b8becb95
diff --git a/packages/es-dev-server/src/config.js b/packages/es-dev-server/src/config.js index <HASH>..<HASH> 100644 --- a/packages/es-dev-server/src/config.js +++ b/packages/es-dev-server/src/config.js @@ -184,7 +184,7 @@ export function createConfig(config) { let openPath; if (typeof open === 'string' && open !== '') { // user-provided open path - openPath = path.normalize(open); + openPath = open; } else if (appIndex) { // if an appIndex was provided, use it's directory as open path openPath = `${basePath || ''}${appIndexDir}/`;
fix(es-dev-server): don't normalize file path on a browser path
open-wc_open-wc
train
js
fafe374aa288c007b4acb50fbbbf12e6c01a5c56
diff --git a/lib/ib/project.rb b/lib/ib/project.rb index <HASH>..<HASH> 100644 --- a/lib/ib/project.rb +++ b/lib/ib/project.rb @@ -109,6 +109,27 @@ class IB::Project DEFAULT_FRAMEWORKS.each do |framework| target.add_system_framework framework end + + extra_frameworks.each do |framework| + add_extra_framework framework + end + end + + def extra_frameworks + extra_frameworks = Motion::Project::App.config.vendor_projects + extra_frameworks = extra_frameworks.select { |vp| vp.opts[:ib] } + end + + def add_extra_framework(framework) + framework_name = framework.path.split('/').last + framework_group = project.new_group(framework_name) + framework_group.path = File.join(project_path, framework.path) + framework_target = project.new_target(:framework, framework_name, platform) + Dir.glob("#{framework.path}/**/*.{h,m}") do |file| + file_ref = framework_group.new_file File.join(project_path, file) + framework_target.add_file_references([file_ref]) + puts "path: #{framework.path}, file: #{file}" + end end def ib_project_path
add ability to pass along custom frameworks Example in your project Rakefile: app.vendor_project('frameworks/DesignableKit', :static, { ib: true }) passing `ib: true` in the opts for vendor_project will include the dirs h/m files in a custom framework for you.
rubymotion_ib
train
rb
2dbf6037778266fa01a19bde21fc16b9be308d5a
diff --git a/qunit/qunit.js b/qunit/qunit.js index <HASH>..<HASH> 100644 --- a/qunit/qunit.js +++ b/qunit/qunit.js @@ -953,16 +953,14 @@ QUnit.jsDump = (function() { type = "date"; } else if (QUnit.is("Function", obj)) { type = "function"; - } else if (QUnit.is("Array", obj)) { - type = "array"; - } else if (QUnit.is("Window", obj) || QUnit.is("global", obj)) { + } else if (obj.setInterval && obj.document && !obj.nodeType) { type = "window"; } else if (obj.nodeType === 9) { type = "document"; - } else if (QUnit.is("HTMLCollection", obj) || QUnit.is("NodeList", obj)) { - type = "nodelist"; } else if (obj.nodeType) { type = "node"; + } else if (typeof obj === "object" && typeof obj.length === "number" && obj.length >= 0) { + type = "array"; } else { type = typeof obj; }
More changes to the detection of types in jsDump's typeOf.
JamesMGreene_qunit-assert-html
train
js
27c0815356d274b59e416160e1b485e87a359488
diff --git a/src/Administration/Resources/app/administration/src/module/sw-cms/service/cms.service.js b/src/Administration/Resources/app/administration/src/module/sw-cms/service/cms.service.js index <HASH>..<HASH> 100644 --- a/src/Administration/Resources/app/administration/src/module/sw-cms/service/cms.service.js +++ b/src/Administration/Resources/app/administration/src/module/sw-cms/service/cms.service.js @@ -93,7 +93,7 @@ function getEntityData(element, configKey) { if (Array.isArray(configValue)) { const entityIds = []; - if (configValue[0].mediaId) { + if (configValue.length && configValue[0].mediaId) { configValue.forEach((val) => { entityIds.push(val.mediaId); });
NEXT-<I> - Added additional check before adding mediaId Fixes #<I>
shopware_platform
train
js
27d854f35c964f817986ec989bf94a2f01b30b0b
diff --git a/elasticsearch-transport/test/unit/transport_manticore_test.rb b/elasticsearch-transport/test/unit/transport_manticore_test.rb index <HASH>..<HASH> 100644 --- a/elasticsearch-transport/test/unit/transport_manticore_test.rb +++ b/elasticsearch-transport/test/unit/transport_manticore_test.rb @@ -103,8 +103,13 @@ else should "allow to set options for Manticore" do options = { :headers => {"User-Agent" => "myapp-0.0" }} transport = Manticore.new :hosts => [ { :host => 'foobar', :port => 1234 } ], :options => options - transport.connections.first.connection.expects(:get). - with('http://foobar:1234//', options).returns(stub_everything) + transport.connections.first.connection + .expects(:get) + .with do |host, options| + assert_equal 'myapp-0.0', options[:headers]['User-Agent'] + true + end + .returns(stub_everything) transport.perform_request 'GET', '/', {} end
[CLIENT] Fixed a failing Manticore unit test
elastic_elasticsearch-ruby
train
rb
33baebe22d97b5ac990707bce24a1bc55854fc50
diff --git a/app/AppKernel.php b/app/AppKernel.php index <HASH>..<HASH> 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -17,12 +17,12 @@ class AppKernel extends Kernel new Symfony\Bundle\AsseticBundle\AsseticBundle(), new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(), + new Acme\DemoBundle\AcmeDemoBundle(), ); if (in_array($this->getEnvironment(), array('dev', 'test'))) { $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); $bundles[] = new Symfony\Bundle\WebConfiguratorBundle\SymfonyWebConfiguratorBundle(); - $bundles[] = new Acme\DemoBundle\AcmeDemoBundle(); } return $bundles;
activated the AcmeDemoBundle for all env to ease things
symfony_symfony-standard
train
php
5746cc695590f21a82a7b1aa5fd39b3e8e114e74
diff --git a/db/archives.go b/db/archives.go index <HASH>..<HASH> 100644 --- a/db/archives.go +++ b/db/archives.go @@ -228,10 +228,7 @@ func (db *DB) PurgeArchive(id uuid.UUID) error { return fmt.Errorf("Invalid attempt to purge a 'valid' archive detected") } - err = db.Exec(`UPDATE archives SET purge_reason = - (SELECT status FROM archives WHERE uuid = ?) - WHERE uuid = ? - `, id.String(), id.String()) + err = db.Exec(`UPDATE archives SET purge_reason = status WHERE uuid = ?`, id.String()) if err != nil { return err }
Simplify purge_reason update SQL It should now work on PostgreSQL and MySQL (as well as SQLite tests)
starkandwayne_shield
train
go
42d4279fe62a445c210b6b76bc3a7eb41fecd587
diff --git a/src/services/printutils.js b/src/services/printutils.js index <HASH>..<HASH> 100644 --- a/src/services/printutils.js +++ b/src/services/printutils.js @@ -62,18 +62,20 @@ ngeo.PrintUtils.prototype.createPrintMaskPostcompose = function(getSize, var center = [viewportWidth / 2, viewportHeight / 2]; var size = getSize(); + var height = size[1] * ol.has.DEVICE_PIXEL_RATIO; + var width = size[0] * ol.has.DEVICE_PIXEL_RATIO; var scale = getScale(frameState); var ppi = ngeo.PrintUtils.DOTS_PER_INCH_; var ipm = ngeo.PrintUtils.INCHES_PER_METER_; var extentHalfWidth = - (((size[0] / ppi) / ipm) * scale / resolution) / 2; + (((width / ppi) / ipm) * scale / resolution) / 2; self.extentHalfHorizontalDistance_ = (((size[0] / ppi) / ipm) * scale) / 2; var extentHalfHeight = - (((size[1] / ppi) / ipm) * scale / resolution) / 2; + (((height / ppi) / ipm) * scale / resolution) / 2; self.extentHalfVerticalDistance_ = (((size[1] / ppi) / ipm) * scale) / 2;
Take device pixel ratio when displaying print mask (#<I>)
camptocamp_ngeo
train
js
caff63689cc93bc96b65f1f7f1ee899569a59f53
diff --git a/src/Palladium/Mapper/Identity.php b/src/Palladium/Mapper/Identity.php index <HASH>..<HASH> 100644 --- a/src/Palladium/Mapper/Identity.php +++ b/src/Palladium/Mapper/Identity.php @@ -46,8 +46,8 @@ class Identity extends DataMapper /** - * @param Entity\Identity $entity - */ + * @param Entity\Identity $entity + */ public function fetch(Entity\Identity $entity) { diff --git a/src/Palladium/Mapper/OneTimeIdentity.php b/src/Palladium/Mapper/OneTimeIdentity.php index <HASH>..<HASH> 100644 --- a/src/Palladium/Mapper/OneTimeIdentity.php +++ b/src/Palladium/Mapper/OneTimeIdentity.php @@ -8,7 +8,6 @@ namespace Palladium\Mapper; use Palladium\Component\DataMapper; use Palladium\Entity as Entity; -use PDOStatement; class OneTimeIdentity extends DataMapper {
Minor: fixed minor inconsistencies
teresko_palladium
train
php,php
69decb87e64d0f6b61283f3c1910bd6672a1da3f
diff --git a/oauthlib/oauth2/rfc6749/endpoints/authorization.py b/oauthlib/oauth2/rfc6749/endpoints/authorization.py index <HASH>..<HASH> 100644 --- a/oauthlib/oauth2/rfc6749/endpoints/authorization.py +++ b/oauthlib/oauth2/rfc6749/endpoints/authorization.py @@ -7,7 +7,7 @@ This module is an implementation of various logic needed for consuming and providing OAuth 2.0 RFC6749. """ from __future__ import absolute_import, unicode_literals - +import sys import logging from oauthlib.common import Request @@ -66,7 +66,8 @@ class AuthorizationEndpoint(BaseEndpoint): BaseEndpoint.__init__(self) self._response_types = {} # response_types are sorted internally so ordered comparison is faster/easier later - for k, v in response_types.iteritems(): + + for k, v in response_types.iteritems() if sys.version_info[0] == 2 else iter(response_types.items()): self._response_types[",".join(sorted(k.split()))] = v self._default_response_type = default_response_type
Iterate correctly over response_types dict without using six
oauthlib_oauthlib
train
py
61208f3743c470c89118b21ee9d315a282089349
diff --git a/src/labels/label_line.js b/src/labels/label_line.js index <HASH>..<HASH> 100644 --- a/src/labels/label_line.js +++ b/src/labels/label_line.js @@ -252,24 +252,4 @@ export default class LabelLine extends Label { this.obb = new OBB(p[0], p[1], -this.angle[0], width, height); this.aabb = this.obb.getExtent(); } - - // Try to move the label into the tile bounds - // Returns true if label was moved into tile, false if it couldn't be moved - moveIntoTile () { - let in_tile = false; - let fits_to_segment = false; - - while (!in_tile) { - let segment = this.getNextFittingSegment(); - if (segment) { - this.update(); - in_tile = this.inTileBounds(); - } - else { - return false; - } - } - - return true; - } }
Remove moveIntoTile method for LabelLine
tangrams_tangram
train
js
d5672b43dfa7647eeeb1b457da64a9ce14cbcce6
diff --git a/lib/guard/rspec/runner.rb b/lib/guard/rspec/runner.rb index <HASH>..<HASH> 100644 --- a/lib/guard/rspec/runner.rb +++ b/lib/guard/rspec/runner.rb @@ -106,6 +106,7 @@ module Guard def zeus_guard_env_file unless @zeus_guard_env_file @zeus_guard_env_file = Tempfile.new(['zeus_guard_env','.rb']) + @zeus_guard_env_file.puts '# encoding: UTF-8' @zeus_guard_env_file.puts '# Extra settings for Guard when using Zeus' @zeus_guard_env_file.puts "ENV['GUARD_NOTIFICATIONS']=#{ENV['GUARD_NOTIFICATIONS'].inspect}" if ENV['GUARD_NOTIFICATIONS'] @zeus_guard_env_file.puts "ENV['GUARD_NOTIFY']=#{ENV['GUARD_NOTIFY'].inspect}" if ENV['GUARD_NOTIFY']
allow utf-8 characters in guard environment with zeus, fixes #<I>
guard_guard-rspec
train
rb
b3c6e24b3538bc59a79288aa4beb41d903ab9015
diff --git a/seqcluster/libs/tool.py b/seqcluster/libs/tool.py index <HASH>..<HASH> 100644 --- a/seqcluster/libs/tool.py +++ b/seqcluster/libs/tool.py @@ -289,7 +289,7 @@ def _add_complete_cluster(idx, clus1): locilen_sorted = sorted(clus1.locilen.iteritems(), key=operator.itemgetter(1), reverse=True) maxidl = locilen_sorted[0][0] c = cluster(idx) - c.add_id_member(clus1.loci2seq[maxidl], maxidl) + c.add_id_member(clus1.idmembers, maxidl) c.id = idx c.toomany = len(locilen_sorted) return c @@ -527,7 +527,7 @@ def _solve_conflict(list_c, s2p, n_cluster): return list_c -def _split_cluster(c , pairs, n): +def _split_cluster(c, pairs, n): """split cluster by exclussion""" old = c[p[0]] new = c[p[1]]
for big clusters, add everything, but keep one location
lpantano_seqcluster
train
py
51c4f01d9873c1b55d55e71593794636eef3096e
diff --git a/src/main/java/com/sun/glass/ui/monocle/MonocleRobot.java b/src/main/java/com/sun/glass/ui/monocle/MonocleRobot.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/sun/glass/ui/monocle/MonocleRobot.java +++ b/src/main/java/com/sun/glass/ui/monocle/MonocleRobot.java @@ -214,7 +214,7 @@ class MonocleRobot extends GlassRobot { int colStop = Math.min(x + width, scrWidth); for (int row = y; row < rowStop; row++) { for (int col = x; col < colStop; col++) { - data[row * scrWidth + col] = buffer.get(row * scrWidth + col); + data[(row - y) * (colStop - x) + (col - x)] = buffer.get(row * scrWidth + col); } } }
Add upstream partial screen capture fix (JDK-<I>).
TestFX_Monocle
train
java
2fce51154652982e1da2a5369dfbc06f620b35b2
diff --git a/internal/provider/resource_integer.go b/internal/provider/resource_integer.go index <HASH>..<HASH> 100644 --- a/internal/provider/resource_integer.go +++ b/internal/provider/resource_integer.go @@ -21,7 +21,7 @@ func resourceInteger() *schema.Resource { "old and new resources exist concurrently.", CreateContext: CreateInteger, ReadContext: schema.NoopContext, - Delete: schema.RemoveFromState, + DeleteContext: DeleteInteger, Importer: &schema.ResourceImporter{ State: ImportInteger, }, @@ -93,6 +93,11 @@ func CreateInteger(_ context.Context, d *schema.ResourceData, meta interface{}) return nil } +func DeleteInteger(_ context.Context, d *schema.ResourceData, _ interface{}) diag.Diagnostics { + d.SetId("") + return nil +} + func ImportInteger(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { parts := strings.Split(d.Id(), ",") if len(parts) != 3 && len(parts) != 4 {
Replace usage of Delete field with DeleteContext in resource_integer
terraform-providers_terraform-provider-random
train
go
afc157e079f7c36ed4ed9c99984abab002e42197
diff --git a/plugins/crusher.js b/plugins/crusher.js index <HASH>..<HASH> 100644 --- a/plugins/crusher.js +++ b/plugins/crusher.js @@ -86,9 +86,9 @@ module.exports = Plugin.extend({ if (this.analyse) return this.analyser(function analyser(err, results) { if (err) return self.emit('error', err); - self.logger.info('The fastest engine: %s', results.fastest.engines); - self.logger.info('The smallest content: %s', results.filesize.engines); - self.logger.info('The best compressed: %s', results.bandwidth.engines); + self.logger.info('The fastest engine: '+ results.fastest.engines); + self.logger.info('The smallest content: '+ results.filesize.engines); + self.logger.info('The best compressed: '+ results.bandwidth.engines); self.emit('data'); });
[minor] The %s doesn't work, yo
observing_square
train
js
bcb10b350eb1e1c93894660bf11df139f798ffa6
diff --git a/nion/instrumentation/test/CameraControl_test.py b/nion/instrumentation/test/CameraControl_test.py index <HASH>..<HASH> 100644 --- a/nion/instrumentation/test/CameraControl_test.py +++ b/nion/instrumentation/test/CameraControl_test.py @@ -38,6 +38,7 @@ class TestCameraControlClass(unittest.TestCase): def tearDown(self): HardwareSource.HardwareSourceManager()._close_hardware_sources() + HardwareSource.HardwareSourceManager()._close_instruments() def _acquire_one(self, document_controller, hardware_source): hardware_source.start_playing() diff --git a/nion/instrumentation/test/ScanControl_test.py b/nion/instrumentation/test/ScanControl_test.py index <HASH>..<HASH> 100644 --- a/nion/instrumentation/test/ScanControl_test.py +++ b/nion/instrumentation/test/ScanControl_test.py @@ -38,6 +38,7 @@ class TestScanControlClass(unittest.TestCase): def tearDown(self): HardwareSource.HardwareSourceManager()._close_hardware_sources() + HardwareSource.HardwareSourceManager()._close_instruments() def _acquire_one(self, document_controller, hardware_source): hardware_source.start_playing(3.0)
Ensure proper instrument shutdowns (was causing failing tests).
nion-software_nionswift-instrumentation-kit
train
py,py