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
61b78cd6890c539c2931ce94f2b6cac320b2d8c9
diff --git a/dygraph.js b/dygraph.js index <HASH>..<HASH> 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1565,8 +1565,8 @@ Dygraph.prototype.drawGraph_ = function(data) { var extremes = this.extremeValues_(series); var thisMinY = extremes[0]; var thisMaxY = extremes[1]; - if (!minY || thisMinY < minY) minY = thisMinY; - if (!maxY || thisMaxY > maxY) maxY = thisMaxY; + if (minY === null || thisMinY < minY) minY = thisMinY; + if (maxY === null || thisMaxY > maxY) maxY = thisMaxY; if (bars) { var vals = [];
fix a small bug which appeared when a series had a min/max of zero
danvk_dygraphs
train
js
5f0fe869ddfb26b3b046ed726cf91f78adfc9aa5
diff --git a/src/diamond/collector.py b/src/diamond/collector.py index <HASH>..<HASH> 100644 --- a/src/diamond/collector.py +++ b/src/diamond/collector.py @@ -72,6 +72,8 @@ class Collector(object): return self.config['hostname'] if 'hostname_method' not in self.config or self.config['hostname_method'] == 'fqdn_short': return socket.getfqdn().split('.')[0] + if self.config['hostname_method'] == 'fqdn': + return socket.getfqdn().replace('.','_') if self.config['hostname_method'] == 'fqdn_rev': hostname = socket.getfqdn().split('.') hostname.reverse()
Add fqdn as a hostname method, to complete the set of name options
python-diamond_Diamond
train
py
49efae096ea79e23723bd2c7de91378415313b7a
diff --git a/src/permission.mdl.js b/src/permission.mdl.js index <HASH>..<HASH> 100644 --- a/src/permission.mdl.js +++ b/src/permission.mdl.js @@ -6,15 +6,12 @@ permission.run(['$rootScope', 'Permission', '$state', '$q', function ($rootScope, Permission, $state, $q) { $rootScope.$on('$stateChangeStart', function (event, toState, toParams, fromState, fromParams) { - //noinspection JSUnresolvedVariable if (toState.$$finishAuthorize || !toState.data || !toState.data.permissions) { return; } - //noinspection JSUnresolvedVariable var permissions = toState.data.permissions; - //noinspection JSUnresolvedFunction event.preventDefault(); toState = angular.extend({'$$finishAuthorize': true}, toState); @@ -31,7 +28,6 @@ if (!$rootScope.$broadcast('$stateChangeStart', toState, toParams, fromState, fromParams).defaultPrevented) { $rootScope.$broadcast('$stateChangePermissionAccepted', toState, toParams); - //noinspection JSUnresolvedVariable,JSUnresolvedFunction $state .go(toState.name, toParams, {notify: false}) .then(function () {
Remove warning suppressing comments for jshint.
RafaelVidaurre_angular-permission
train
js
96718deb2ffbb02d89ecefacc4609493beeb00f5
diff --git a/agent.go b/agent.go index <HASH>..<HASH> 100644 --- a/agent.go +++ b/agent.go @@ -3,10 +3,11 @@ package gorelic import ( "errors" "fmt" - metrics "github.com/yvasiyarov/go-metrics" - "github.com/yvasiyarov/newrelic_platform_go" "log" "net/http" + + metrics "github.com/yvasiyarov/go-metrics" + "github.com/yvasiyarov/newrelic_platform_go" ) const ( @@ -52,6 +53,10 @@ type Agent struct { plugin *newrelic_platform_go.NewrelicPlugin HTTPTimer metrics.Timer Tracer *Tracer + + // All HTTP requests will be done using this client. Change it if you need + // to use a proxy. + Client http.Client } //NewAgent build new Agent objects. @@ -97,6 +102,7 @@ func (agent *Agent) Run() error { } agent.plugin = newrelic_platform_go.NewNewrelicPlugin(agent.AgentVersion, agent.NewrelicLicense, agent.NewrelicPollInterval) + agent.plugin.Client = agent.Client component := newrelic_platform_go.NewPluginComponent(agent.NewrelicName, agent.AgentGUID) agent.plugin.AddComponent(component)
Added support for HTTP proxies
yvasiyarov_gorelic
train
go
e1c5aabd9d17592421f377aea0fd34820ed31a52
diff --git a/src/test/java/org/cactoos/collection/MappedTest.java b/src/test/java/org/cactoos/collection/MappedTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/cactoos/collection/MappedTest.java +++ b/src/test/java/org/cactoos/collection/MappedTest.java @@ -44,6 +44,7 @@ import org.junit.Test; * @since 0.14 * @checkstyle JavadocMethodCheck (500 lines) * @checkstyle MagicNumberCheck (500 lines) + * @checkstyle ClassDataAbstractionCouplingCheck (500 lines) */ public final class MappedTest {
Checkstyle Class Data Abstraction Coupling
yegor256_cactoos
train
java
357e707e2c3b6e7423960ca97e765cc12a6ffa4a
diff --git a/lib/NormalModule.js b/lib/NormalModule.js index <HASH>..<HASH> 100644 --- a/lib/NormalModule.js +++ b/lib/NormalModule.js @@ -78,7 +78,7 @@ const contextifySourceUrl = (context, source, associatedObjectForCache) => { */ const contextifySourceMap = (context, sourceMap, associatedObjectForCache) => { if (!Array.isArray(sourceMap.sources)) return sourceMap; - const sourceRoot = sourceMap.sourceRoot; + const { sourceRoot } = sourceMap; /** @type {function(string): string} */ const mapper = !sourceRoot ? source => source
refactor: prefer destructuring approach
webpack_webpack
train
js
fe0917865c5ecc217de084f339402714bc27a3fb
diff --git a/hug/middleware.py b/hug/middleware.py index <HASH>..<HASH> 100644 --- a/hug/middleware.py +++ b/hug/middleware.py @@ -90,9 +90,10 @@ class LogMiddleware(object): def _generate_combined_log(self, request, response): """Given a request/response pair, generate a logging format similar to the NGINX combined style.""" current_time = datetime.utcnow() + data_len = '-' if response.data is None else len(response.data) return '{0} - - [{1}] {2} {3} {4} {5} {6}'.format(request.remote_addr, current_time, request.method, request.relative_uri, response.status, - len(response.data), request.user_agent) + data_len, request.user_agent) def process_request(self, request, response): """Logs the basic endpoint requested"""
Don't get len of response data if there is no data
hugapi_hug
train
py
a7b447b360ce5883dcb677ee3311ce708166745a
diff --git a/executable/executable_darwin.go b/executable/executable_darwin.go index <HASH>..<HASH> 100644 --- a/executable/executable_darwin.go +++ b/executable/executable_darwin.go @@ -1,7 +1,7 @@ -package executable - // +build darwin +package executable + // #import <mach-o/dyld.h> // #import <libproc.h> import "C" diff --git a/executable/executable_linux.go b/executable/executable_linux.go index <HASH>..<HASH> 100644 --- a/executable/executable_linux.go +++ b/executable/executable_linux.go @@ -1,7 +1,7 @@ -package executable - // +build linux +package executable + import ( "fmt" "io/ioutil"
move build tags before package declaration Something in the Go <I> toolchain (automatic "go vet"?) complains about this.
fastly_go-utils
train
go,go
5dd00f1913ee95ad78483475599f57a5b73dbe43
diff --git a/Kwc/Newsletter/Controller.php b/Kwc/Newsletter/Controller.php index <HASH>..<HASH> 100644 --- a/Kwc/Newsletter/Controller.php +++ b/Kwc/Newsletter/Controller.php @@ -31,12 +31,12 @@ class Kwc_Newsletter_Controller extends Kwc_Directories_Item_Directory_Controlle $this->view->data = array('duplicatedIds' => array()); $parentTarget = Kwf_Component_Data_Root::getInstance() - ->getComponentById($this->_getParam('componentId')); + ->getComponentByDbId($this->_getParam('componentId')); foreach ($ids as $id) { $sourceId = $this->_getParam('componentId').'_'.$id; $source = Kwf_Component_Data_Root::getInstance() - ->getComponentById($sourceId); + ->getComponentByDbId($sourceId); // Switch off observer due to performance - it's not necessary here Kwf_Component_ModelObserver::getInstance()->disable();
MenuConfig always passes dbId 2
koala-framework_koala-framework
train
php
fceb161f99553ec4c37bd488a48ce741642efa2d
diff --git a/src/Str.php b/src/Str.php index <HASH>..<HASH> 100644 --- a/src/Str.php +++ b/src/Str.php @@ -69,6 +69,10 @@ final class Str implements \Countable { * @return bool whether the supplied other string can be found at the beginning of this string */ public function startsWith($prefix) { + if (\PHP_VERSION_ID >= 80000) { + return $prefix !== '' && \str_starts_with($this->rawString, $prefix); + } + return $prefix !== '' && \strncmp($this->rawString, $prefix, \strlen($prefix)) === 0; }
Improve 'startsWith' to be another 3% to <I>% faster on PHP <I>+ The new implementation is more CPU-efficient. The exact performance, of course, depends on the length and nature of the haystack and the needle. Anyway, this is a micro-optimization, as the operation is generally very fast and running at (single-digit) millions of operations per second on a single modern CPU core.
delight-im_PHP-Str
train
php
2e949eec555cf16d2fab94015e49c7bc67b03b92
diff --git a/server/src/main/java/io/atomix/copycat/server/state/ServerContext.java b/server/src/main/java/io/atomix/copycat/server/state/ServerContext.java index <HASH>..<HASH> 100644 --- a/server/src/main/java/io/atomix/copycat/server/state/ServerContext.java +++ b/server/src/main/java/io/atomix/copycat/server/state/ServerContext.java @@ -351,8 +351,8 @@ public class ServerContext implements AutoCloseable { ServerContext setCommitIndex(long commitIndex) { Assert.argNot(commitIndex < 0, "commit index must be positive"); Assert.argNot(commitIndex < this.commitIndex, "cannot decrease commit index"); - this.commitIndex = commitIndex; - log.commit(Math.min(commitIndex, log.lastIndex())); + this.commitIndex = Math.max(this.commitIndex, commitIndex); + log.commit(Math.min(this.commitIndex, log.lastIndex())); return this; }
Ensure commitIndex cannot decrease when switching replication from followers.
atomix_copycat
train
java
b7ee095f966485ea191fe4867892c299e33f839c
diff --git a/txkoji/task.py b/txkoji/task.py index <HASH>..<HASH> 100644 --- a/txkoji/task.py +++ b/txkoji/task.py @@ -28,6 +28,8 @@ class Task(Munch): return self.params[1] if self.method == 'createImage': return self.params[3] + if self.method == 'indirectionimage': + return self.params[0]['arch'] @property def arches(self): @@ -186,6 +188,8 @@ class Task(Munch): return self.params[1]['name'] if self.method in ('createImage', 'image', 'livecd'): return self.params[0] + if self.method == 'indirectionimage': + return self.params[0]['name'] # params[0] is the source URL for these tasks: if self.method not in ('build', 'buildArch', 'buildContainer', 'buildMaven', 'buildSRPMFromSCM', 'maven'): @@ -263,6 +267,8 @@ class Task(Munch): return self.params[4]['name'] if self.method in ('image', 'livecd'): return self.params[3] + if self.method == 'indirectionimage': + return self.params[0]['target'] if self.method == 'wrapperRPM': return self.params[1]['name']
task: populate .arch, .package, .target for indirectionimage
ktdreyer_txkoji
train
py
9547efcc0ac2242f05708ef30efa721c286ec540
diff --git a/wav/decode.go b/wav/decode.go index <HASH>..<HASH> 100644 --- a/wav/decode.go +++ b/wav/decode.go @@ -11,7 +11,7 @@ import ( ) // Decode takes a ReadCloser containing audio data in WAVE format and returns a StreamSeekCloser, -// which streams that audio. The Seek method will return an error if rc is not io.Seeker. +// which streams that audio. The Seek method will panic if rc is not io.Seeker. // // Do not close the supplied ReadSeekCloser, instead, use the Close method of the returned // StreamSeekCloser when you want to release the resources. @@ -94,7 +94,7 @@ func (d *decoder) Position() int { func (d *decoder) Seek(p int) error { seeker, ok := d.rc.(io.Seeker) if !ok { - return fmt.Errorf("wav: seek: resource is not io.Seeker") + panic(fmt.Errorf("wav: seek: resource is not io.Seeker")) } if p < 0 || d.Len() < p { return fmt.Errorf("wav: seek position %v out of range [%v, %v]", p, 0, d.Len())
wav: decode: panic when seeking a non-seeker source
faiface_beep
train
go
7d57180c190f8d12c4c179133a6daa73739d2925
diff --git a/addon/components/gravatar-image.js b/addon/components/gravatar-image.js index <HASH>..<HASH> 100644 --- a/addon/components/gravatar-image.js +++ b/addon/components/gravatar-image.js @@ -18,11 +18,11 @@ export default Ember.Component.extend({ secure = this.get("secure"), protocol; if(secure===null){ - protocol = '' + protocol = ''; } else if (secure===false){ - protocol = 'http:' + protocol = 'http:'; } else{ - protocol = 'https:' + protocol = 'https:'; } return protocol + '//www.gravatar.com/avatar/' + md5(email) + '?s=' + size + '&d=' + def; })
Adding Forgotten semicolons.
johno_ember-cli-gravatar
train
js
ce6c629fbc72ca87fe7dbe5c22d199f5540d3c82
diff --git a/src/Client.php b/src/Client.php index <HASH>..<HASH> 100644 --- a/src/Client.php +++ b/src/Client.php @@ -231,7 +231,7 @@ class Client * * @param string $curl_url * Ex: /x/ACCESSTOKEN/alerts/ALERTID - * @return boolean + * @return bool * Response code. */ private function curlDelete($curl_url)
Always with the code style guide... still trying to get it right
DoSomething_stathat-php
train
php
f8c022e02ceac0eee6b0151cd6203dfbc8398314
diff --git a/src/Connection.js b/src/Connection.js index <HASH>..<HASH> 100644 --- a/src/Connection.js +++ b/src/Connection.js @@ -85,7 +85,7 @@ Connection = module.exports = Class.extend({ var register = this.getRegister(properties.route); if (properties.service) { properties.service.connection = this; - properties.service.mount(properties); + properties.service.install(properties); } else { register.addProcessor(properties); }
For extras/services, now using install/uninstall instead of mount/unmount - for greater clarity.
simplygreatwork_godsend
train
js
a2a8e58f478bcf2537a4de1c9e1340a9737d38c7
diff --git a/src/git.js b/src/git.js index <HASH>..<HASH> 100644 --- a/src/git.js +++ b/src/git.js @@ -25,6 +25,19 @@ }; /** + * Clone a git repo + * + * @param {Function} [then] + */ + Git.prototype.clone = function(repoPath, localPath, then ) { + return this._run('git clone ' + repoPath + ' ' + localPath, function(err) { + then && then(err); + }); + }; + + + + /** * Internally uses pull and tags to get the list of tags then checks out the latest tag. * * @param {Function} [then] @@ -88,6 +101,7 @@ */ Git.prototype.fetch = function(then) { return this._run('git fetch', function(err, data) { + console.log( data ); then && then(err, !err && this._parseFetch(data)); }); };
Added simple clone functionality
steveukx_git-js
train
js
b9ec6fd36f9038ef9e820ec461d886f2976608e1
diff --git a/scss.inc.php b/scss.inc.php index <HASH>..<HASH> 100644 --- a/scss.inc.php +++ b/scss.inc.php @@ -4349,7 +4349,7 @@ class scss_server { } $this->cacheDir = $cacheDir; - if (!is_dir($this->cacheDir)) mkdir($this->cacheDir); + if (!is_dir($this->cacheDir)) mkdir($this->cacheDir, 0755, true); if (is_null($scss)) { $scss = new scssc();
Recursively create cache-dir with decent permissions
leafo_scssphp
train
php
ecb45574827bc03a51e03da164b94e692cf9cd8f
diff --git a/source/library/com/restfb/FacebookClient.java b/source/library/com/restfb/FacebookClient.java index <HASH>..<HASH> 100644 --- a/source/library/com/restfb/FacebookClient.java +++ b/source/library/com/restfb/FacebookClient.java @@ -443,10 +443,13 @@ public interface FacebookClient { // If an expires value was provided and it's a valid long, great - use it. // Otherwise ignore it. - if (urlParameters.containsKey("expires")) + if (urlParameters.containsKey("expires")) { try { expires = Long.valueOf(urlParameters.get("expires").get(0)); } catch (NumberFormatException e) {} + if (expires != null) + expires = new Date().getTime() + 1000L * expires; + } AccessToken accessToken = new AccessToken(); accessToken.accessToken = extendedAccessToken; @@ -493,7 +496,7 @@ public interface FacebookClient { * @return The date on which the access token expires. */ public Date getExpires() { - return expires == null ? null : new Date(1000L * expires); + return expires == null ? null : new Date(expires); } } } \ No newline at end of file
Fix extended access token expiration date Facebook sends "seconds to expiry" not a timestamp.
restfb_restfb
train
java
54d0ec4653481346471870e761aa83f0010f55e9
diff --git a/test/unsupported_test.rb b/test/unsupported_test.rb index <HASH>..<HASH> 100644 --- a/test/unsupported_test.rb +++ b/test/unsupported_test.rb @@ -47,6 +47,22 @@ describe 'unsupported behavior' do ) end end + describe 'below nonschema root' do + it "instantiates" do + schema_doc_schema = JSI::JSONSchemaOrgDraft04.new_schema({ + 'properties' => {'schema' => {'$ref' => 'http://json-schema.org/draft-04/schema'}} + }) + schema_doc = schema_doc_schema.new_jsi({ + 'schema' => {'$ref' => '#/unknown'}, + 'unknown' => {}, + }) + subject = schema_doc.schema.new_jsi({}) + assert_equal( + [JSI::Ptr["unknown"]], + subject.jsi_schemas.map(&:jsi_ptr) + ) + end + end end end end
test (unsupported) reinstantiation of an undescribed schema below a non-schema resource root
notEthan_jsi
train
rb
30af211a22126672c04e3fcf705633cb4c26f976
diff --git a/src/Core/Factory.php b/src/Core/Factory.php index <HASH>..<HASH> 100644 --- a/src/Core/Factory.php +++ b/src/Core/Factory.php @@ -24,6 +24,9 @@ class Factory public function register($class, $indexList) { + if (!is_array($indexList)) { + $indexList = array($indexList); + } foreach ($indexList as $index) { $id = strtolower($index); static::$indexList[$id] = $class;
Allow class factory registering with only one index
Baddum_Model418
train
php
2d21b02a60fb50a4f215f5be9c692d677c4cee92
diff --git a/lib/model/graph/ModelGraphBuilder.js b/lib/model/graph/ModelGraphBuilder.js index <HASH>..<HASH> 100644 --- a/lib/model/graph/ModelGraphBuilder.js +++ b/lib/model/graph/ModelGraphBuilder.js @@ -33,17 +33,21 @@ class ModelGraphBuilder { } _buildNodes(modelClass, objs, parentNode = null, relation = null) { - asArray(objs).forEach((obj, index) => { + objs = asArray(objs); + + objs.forEach((obj, index) => { this._buildNode(modelClass, obj, parentNode, relation, index); }); } _buildNode(modelClass, obj, parentNode = null, relation = null, index = null) { + obj = asSingle(obj); + if (!isObject(obj) || !obj.$isObjectionModel) { throw createNotModelError(modelClass, obj); } - const node = new ModelGraphNode(modelClass, asSingle(obj)); + const node = new ModelGraphNode(modelClass, obj); this.nodes.push(node); if (parentNode) {
fix regression with arrays in belongsToOne + upsertGraph
Vincit_objection.js
train
js
8b835de90abc6b2d39881f7ab248ea1cc1c82fe7
diff --git a/awkward/array/union.py b/awkward/array/union.py index <HASH>..<HASH> 100644 --- a/awkward/array/union.py +++ b/awkward/array/union.py @@ -44,16 +44,17 @@ class UnionArray(awkward.array.base.AwkwardArray): def fromtags(cls, tags, contents): out = cls.__new__(cls) out.tags = tags - out.index = awkward.util.numpy.empty(out._tags.shape, dtype=awkward.util.INDEXTYPE) out.contents = contents if len(out._tags.reshape(-1)) > 0 and out._tags.reshape(-1).max() >= len(out._contents): raise ValueError("maximum tag is {0} but there are only {1} contents arrays".format(out._tags.reshape(-1).max(), len(out._contents))) + index = awkward.util.numpy.full(out._tags.shape, -1, dtype=awkward.util.INDEXTYPE) for tag, content in enumerate(out._contents): mask = (out._tags == tag) - out._index[mask] = awkward.util.numpy.arange(awkward.util.numpy.count_nonzero(mask)) + index[mask] = awkward.util.numpy.arange(awkward.util.numpy.count_nonzero(mask)) + out.index = index return out def copy(self, tags=None, index=None, contents=None):
fix fromtags order of operations, closing #8
scikit-hep_awkward-array
train
py
a09845323fb21b1afffcb412e18ed1a0312f6763
diff --git a/ipyleaflet/leaflet.py b/ipyleaflet/leaflet.py index <HASH>..<HASH> 100644 --- a/ipyleaflet/leaflet.py +++ b/ipyleaflet/leaflet.py @@ -633,17 +633,11 @@ class Map(DOMWidget, InteractMixin): return self # Event handling - _moveend_callbacks = Instance(CallbackDispatcher, ()) _interaction_callbacks = Instance(CallbackDispatcher, ()) def _handle_leaflet_event(self, _, content, buffers): - if content.get('event', '') == 'moveend': - self._moveend_callbacks(**content) if content.get('event', '') == 'interaction': self._interaction_callbacks(**content) - def on_moveend(self, callback, remove=False): - self._moveend_callbacks.register_callback(callback, remove=remove) - def on_interaction(self, callback, remove=False): self._interaction_callbacks.register_callback(callback, remove=remove)
Remove on_moveend event from Map class
jupyter-widgets_ipyleaflet
train
py
c89303cf5937a4dc7cf1eda8e662dc702b5e0ad9
diff --git a/irc3/plugins/command.py b/irc3/plugins/command.py index <HASH>..<HASH> 100644 --- a/irc3/plugins/command.py +++ b/irc3/plugins/command.py @@ -267,7 +267,9 @@ class Commands(dict): def split_command(self, data, use_shlex=None): if data: - if (use_shlex or self.use_shlex) is True: + if use_shlex is None: + use_shlex = self.use_shlex + if use_shlex: return shlex.split(data) else: return data.split(' ')
Fixed use_shlex in Commands.split_command
gawel_irc3
train
py
13f85407dc4937cb0b4301c44a8f4258e3449304
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -119,7 +119,9 @@ module.exports = function Cardboard(c) { cardboard.del = function(primary, dataset, callback) { var key = { dataset: dataset, id: 'id!' + primary }; - dyno.deleteItems([ key ], function(err) { + var opts = { expected: { id: 'NOT_NULL'} } + dyno.deleteItem(key, opts, function(err, res) { + if (err && err.code === 'ConditionalCheckFailedException') return callback(new Error('Feature does not exist')); if (err) return callback(err, true); else callback(); });
singular deleteItem, conditional to check for existence of feature
mapbox_cardboard
train
js
f4790622e2d2edaf2d403c01f31a582d08f63589
diff --git a/belpy/bel/bel_api.py b/belpy/bel/bel_api.py index <HASH>..<HASH> 100644 --- a/belpy/bel/bel_api.py +++ b/belpy/bel/bel_api.py @@ -3,8 +3,12 @@ import rdflib from BelProcessor import BelProcessor def process_ndex_neighborhood(gene_names): - pass - + from ndex-python-client import query_to_bel + bel_script = query_to_bel(gene_names) + fh = open('tmp.bel') + fh.write(bel_script) + fh.close() + def process_belrdf(rdf_filename): # Parse the RDF g = rdflib.Graph()
Start imlementing API for NDEx client
sorgerlab_indra
train
py
5b14409835161a823d20e53daba7ca3f5bb8cd93
diff --git a/Kwf/Util/Build.php b/Kwf/Util/Build.php index <HASH>..<HASH> 100644 --- a/Kwf/Util/Build.php +++ b/Kwf/Util/Build.php @@ -28,6 +28,21 @@ class Kwf_Util_Build $types[] = new Kwf_Util_Build_Types_RteStyles(); } + $types[] = new Kwf_Util_Build_Types_RteStyles(); + + $files = array('composer.json'); + $files = array_merge($files, glob('vendor/*/*/composer.json')); + foreach ($files as $file) { + $composerJson = json_decode(file_get_contents($file), true); + if (isset($composerJson['extra']['koala-framework-build-step'])) { + $steps = $composerJson['extra']['koala-framework-build-step']; + if (!is_array($steps)) $steps = array($steps); + foreach ($steps as $type) { + $types[] = new $type(); + } + } + } + return $types; }
Add possibility for packages to integrate into kwf build With this change packages can define a build step in composer.json that will be added as step in koala build
koala-framework_koala-framework
train
php
489fa871ed7417075de615d1390560380c4107d0
diff --git a/model/HardwareSource.py b/model/HardwareSource.py index <HASH>..<HASH> 100644 --- a/model/HardwareSource.py +++ b/model/HardwareSource.py @@ -416,7 +416,7 @@ class HardwareSource(Observable.Broadcaster): return self.__should_abort with self.__channel_states_mutex: are_all_channel_stopped = len(self.__channel_states) > 0 - for channel, state in self.__channel_states.iteritems(): + for state in self.__channel_states.values(): if state != "stopped": are_all_channel_stopped = False break
Simplify a loop in hardware source. svn r<I>
nion-software_nionswift
train
py
cffbaff2dc4f3d6900c50d95645353c6ca7363b8
diff --git a/lib/ipatlas/plot.php b/lib/ipatlas/plot.php index <HASH>..<HASH> 100644 --- a/lib/ipatlas/plot.php +++ b/lib/ipatlas/plot.php @@ -5,7 +5,7 @@ include("plot.inc"); if (isset($user)) { $user = get_record("user", "id", $user); - $username = "<B>$user->firstname $user->lastname</B>"; + $username = "<B>$user->firstname $user->lastname</B> [$user->city, $user->country] : "; } else { $username = ""; } @@ -112,7 +112,7 @@ print ' '; if(isset($address)) { -print "$username, $values[desc]"; +print "$username $values[desc]"; } $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];
Print the user's stated city/country as well
moodle_moodle
train
php
b8d455ae23ccf4514fc3cad96433e40b599ed5ac
diff --git a/graphdb/src/test/java/com/tinkerpop/blueprints/impls/orient/OrientGraphFactoryEncryptionTest.java b/graphdb/src/test/java/com/tinkerpop/blueprints/impls/orient/OrientGraphFactoryEncryptionTest.java index <HASH>..<HASH> 100755 --- a/graphdb/src/test/java/com/tinkerpop/blueprints/impls/orient/OrientGraphFactoryEncryptionTest.java +++ b/graphdb/src/test/java/com/tinkerpop/blueprints/impls/orient/OrientGraphFactoryEncryptionTest.java @@ -90,6 +90,9 @@ public class OrientGraphFactoryEncryptionTest { @Test public void shouldFailWitWrongKey() { try (OrientDB orientDB = new OrientDB("embedded:" + dbDir, OrientDBConfig.defaultConfig())) { + if (orientDB.exists(dbName)) { + orientDB.drop(dbName); + } orientDB.create(dbName, ODatabaseType.PLOCAL); try (ODatabaseSession db = orientDB.open(dbName, "admin", "admin")) {
fix test failures due to test order (3)
orientechnologies_orientdb
train
java
79cb494cb5d7c45f730e01d1df1243b3a281e6e7
diff --git a/src/sap.ui.core/src/sap/ui/test/BranchTracking.js b/src/sap.ui.core/src/sap/ui/test/BranchTracking.js index <HASH>..<HASH> 100644 --- a/src/sap.ui.core/src/sap/ui/test/BranchTracking.js +++ b/src/sap.ui.core/src/sap/ui/test/BranchTracking.js @@ -185,7 +185,7 @@ && !(Device && Device.browser.msie); } - return oNode.body[0].leadingComments + return oNode.body[0] && oNode.body[0].leadingComments && oNode.body[0].leadingComments.some(isNotForDevice); }
[INTERNAL] sap.ui.test.BranchTracking: robustness in case of empty "then" block PS1: "if (...) {}" caused the instrumentation to fail when looking for device-specific meta comments Change-Id: Ib4fed6b1d<I>ac<I>fe<I>f<I>e
SAP_openui5
train
js
7345d2e278ef6add13b0c799d69edf1221331d61
diff --git a/src/Testing/TestCase.php b/src/Testing/TestCase.php index <HASH>..<HASH> 100644 --- a/src/Testing/TestCase.php +++ b/src/Testing/TestCase.php @@ -55,6 +55,8 @@ abstract class TestCase extends BaseTestCase $this->app = $this->createApplication(); + $this->app->make('url')->forceRootUrl(env('APP_URL', 'http://localhost/')); + $this->app->boot(); }
Set the application url when running tests.
laravel_lumen-framework
train
php
a379f86064d388069a2da382c97c77d5495c63f1
diff --git a/command/agent/agent_test.go b/command/agent/agent_test.go index <HASH>..<HASH> 100644 --- a/command/agent/agent_test.go +++ b/command/agent/agent_test.go @@ -155,7 +155,7 @@ func TestAgent_ServerConfig(t *testing.T) { conf.Addresses.RPC = "127.0.0.2" conf.Addresses.Serf = "127.0.0.2" conf.Addresses.HTTP = "127.0.0.2" - conf.AdvertiseAddrs.HTTP = "10.0.0.10:4646" + conf.AdvertiseAddrs.HTTP = "10.0.0.10" conf.AdvertiseAddrs.RPC = "" conf.AdvertiseAddrs.Serf = "10.0.0.12:4004"
Check that advertise without ports works in test
hashicorp_nomad
train
go
2861764dfaff112ccea7a574ccf75710528b1b9f
diff --git a/lib/transitions/parseTransitions.js b/lib/transitions/parseTransitions.js index <HASH>..<HASH> 100644 --- a/lib/transitions/parseTransitions.js +++ b/lib/transitions/parseTransitions.js @@ -9,20 +9,30 @@ module.exports = function(driver, states, transitions) { var from = transition.from || throwError('from', i, transition); var to = transition.to || throwError('to', i, transition); - var animation = transition.animation || {}; - var animationDefinition = createTransitions(animation, states[ from ], states[ to ]); - - // else build the the transition + var animation = transition.animation; + var duration; + var animationDefinition; + + + // if animation is an object then it's a Tween like definition + // otherwise we'll assume that animation is a function and we can simply + // pass that to the driver if(typeof animation == 'object') { + animationDefinition = createTransitions(animation, states[ from ], states[ to ]); // this animation = getInterpolation( animationDefinition.transitions ); + + duration = animationDefinition.duration; + } else { + + duration = animation.duration; } // animation will either be a function passed in or generated from an object definition - driver.fromTo(from, to, animationDefinition.duration, animation); + driver.fromTo(from, to, duration, animation); }); };
Put back in handling for animation being a function for transition definitions
Jam3_f1
train
js
86575c7e39949d95ebcc037cd89ae67fdef64c0b
diff --git a/corelib/enumerable.rb b/corelib/enumerable.rb index <HASH>..<HASH> 100644 --- a/corelib/enumerable.rb +++ b/corelib/enumerable.rb @@ -470,9 +470,27 @@ module Enumerable hash = Hash.new { |h, k| h[k] = [] } - each do |el| - hash[block.call(el)] << el - end + %x{ + var result; + + self.$each._p = function() { + var param = #{Opal.destructure(`arguments`)}, + value = $opal.$yield1(block, param); + + if (value === $breaker) { + result = $breaker.$v; + return $breaker; + } + + #{hash[`value`] << `param`}; + } + + self.$each(); + + if (result !== undefined) { + return result; + } + } hash end
Cleanup and compliancy fixes for Enumerable#group_by
opal_opal
train
rb
0ff4d3c3ecaf3cc10b3284505b4055b80b09251e
diff --git a/hadoopy/_hdfs.py b/hadoopy/_hdfs.py index <HASH>..<HASH> 100755 --- a/hadoopy/_hdfs.py +++ b/hadoopy/_hdfs.py @@ -54,9 +54,7 @@ def ls(path): stderr=subprocess.PIPE) out, err = p.communicate() if p.returncode: - raise IOError - except IOError: - raise IOError('Ran[%s]: %s' % (path, err)) + raise IOError('Ran[%s]: %s' % (path, err)) found_line = lambda x: re.search('Found [0-9]+ items$', x) out = [x.split(' ')[-1] for x in out.split('\n') if x and not found_line(x)]
Fixed exception handeling to rethrow on HDFS ls error
bwhite_hadoopy
train
py
94db8253870d94fb0a58ca5753e92220694d4aef
diff --git a/channel.go b/channel.go index <HASH>..<HASH> 100644 --- a/channel.go +++ b/channel.go @@ -1585,3 +1585,8 @@ func (ch *Channel) Reject(tag uint64, requeue bool) error { Requeue: requeue, }) } + +// Confirms returns control structure over confirm mode +func (ch *Channel) Confirms() *confirms { + return ch.confirms +} diff --git a/confirms.go b/confirms.go index <HASH>..<HASH> 100644 --- a/confirms.go +++ b/confirms.go @@ -20,6 +20,14 @@ func newConfirms() *confirms { } } +// Published returns sequential number of published messages +func (c *confirms) Published() uint64 { + c.m.Lock() + defer c.m.Unlock() + + return c.published +} + func (c *confirms) Listen(l chan Confirmation) { c.m.Lock() defer c.m.Unlock()
Channel exposes confirms in order to get sequential number of the published messages
streadway_amqp
train
go,go
2c4fa38f4e015198d5ccc8ea792928fbfc6d6639
diff --git a/services/datalad/datalad_service/app.py b/services/datalad/datalad_service/app.py index <HASH>..<HASH> 100644 --- a/services/datalad/datalad_service/app.py +++ b/services/datalad/datalad_service/app.py @@ -37,7 +37,7 @@ def create_app(annex_path): sender.add_periodic_task( 60 * 15, audit_datasets.s(annex_path), queue=dataset_queue('publish')) - api = falcon.API(middleware=AuthenticateMiddleware()) + api = falcon.API(middleware=[AuthenticateMiddleware()]) api.router_options.converters['path'] = PathConverter store = DataladStore(annex_path)
Fix startup bug with Sentry + Falcon middleware.
OpenNeuroOrg_openneuro
train
py
2ee7388ab0c84cfb32658e6ac3eeb348a676c266
diff --git a/tests/PHPUnit/IntegrationTestCase.php b/tests/PHPUnit/IntegrationTestCase.php index <HASH>..<HASH> 100755 --- a/tests/PHPUnit/IntegrationTestCase.php +++ b/tests/PHPUnit/IntegrationTestCase.php @@ -847,7 +847,11 @@ abstract class IntegrationTestCase extends PHPUnit_Framework_TestCase $expected = $this->loadExpectedFile($expectedFilePath); if (empty($expected)) { - return; + print("The expected file is not found. The Processed response was:"); + print("\n----------------------------\n\n"); + var_dump($response); + print("\n----------------------------\n"); + return; } // @todo This should not vary between systems AFAIK... "idsubdatatable can differ"
Display processed response when there is no expected yet (useful to see processed response output on jenkins, rather than downloading the "Build artifacts") git-svn-id: <URL>
matomo-org_matomo
train
php
61e94d28e5e3a0e11830dd93ff5b46546ff9f9c6
diff --git a/test/config/config.js b/test/config/config.js index <HASH>..<HASH> 100644 --- a/test/config/config.js +++ b/test/config/config.js @@ -16,7 +16,7 @@ exports.config = { rdio_oauth_access: 'http://api.rdio.com/oauth/access_token', rdio_oauth_auth: 'https://www.rdio.com/oauth/authorize?oauth_token=', rdio_api: 'http://api.rdio.com/1/', - rdio_api_key: '8nfujzs8m5td6wy5cquap8vb', - rdio_api_shared: 'FajApfbYva', + rdio_api_key: process.env.rdio_api_key, + rdio_api_shared: process.env.rdio_api_shared, songs_to_grab: 10, -}; \ No newline at end of file +};
Update config.js Just modified line <I> and <I> to use process.env for the api keys, instead of clear text!
dawnerd_node-rdio
train
js
f83ed952a8f6d05726865103bcf0b4702c96dd5e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -1,6 +1,7 @@ +import sys +import os from setuptools import setup, find_packages from setuptools.command.test import test - from rest_framework_gis import get_version @@ -18,6 +19,15 @@ def get_install_requires(): return requirements +if sys.argv[-1] == 'publish': + os.system("python setup.py sdist upload") + args = {'version': get_version()} + print("You probably want to also tag the version now:") + print(" git tag -a %(version)s -m 'version %(version)s'" % args) + print(" git push --tags") + sys.exit() + + setup( name='djangorestframework-gis', version=get_version(),
Added publish setup.py command
djangonauts_django-rest-framework-gis
train
py
37a1fb67a92acc7e4df4394cef766ec1604f57ee
diff --git a/Extra/RateLimit.php b/Extra/RateLimit.php index <HASH>..<HASH> 100644 --- a/Extra/RateLimit.php +++ b/Extra/RateLimit.php @@ -19,7 +19,7 @@ use Predis\Transaction\MultiExec; * Redis library `Redback` for Node.JS. * * @see https://github.com/chriso/redback/blob/master/lib/advanced_structures/RateLimit.js - * @see http://chris6f.com/rate-limiting-with-redis + * @see https://gist.github.com/chriso/54dd46b03155fcf555adccea822193da * * Usage: *
Update RateLimit.php to correct post URL The link in the file for how to use the class is no longer valid. The node repo from which this class was ported has been updated to reference the new URL <URL>
snc_SncRedisBundle
train
php
60c536c7e723c41d8e3a600daa1d44bd90fd1a03
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,14 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -VERSION='0.1' +VERSION = '0.1' from distutils.core import setup, Extension -sources=[ 'src/llist.c', - 'src/dllist.c', - 'src/sllist.c', - ] +sources = ['src/llist.c', + 'src/dllist.c', + 'src/sllist.c', + ] setup(name='llist', description='Linked list data structures for Python', @@ -20,7 +20,9 @@ setup(name='llist', download_url='http://pypi.python.org/pypi/llist/%s' % VERSION, license='MIT', keywords='linked list, list', - ext_modules=[ Extension('llist', sources) ], + ext_modules=[Extension('llist', + sources, + extra_compile_args=['-ansi', '-pedantic'])], classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers',
added -ansi -pedantic flags to setup.py
ajakubek_python-llist
train
py
8e4b1ecf9ca927823817bfe190def8df4f23fc5f
diff --git a/app/assets/javascripts/common/katello.js b/app/assets/javascripts/common/katello.js index <HASH>..<HASH> 100644 --- a/app/assets/javascripts/common/katello.js +++ b/app/assets/javascripts/common/katello.js @@ -25,6 +25,10 @@ KT.widget = {}; KT.utils = _.noConflict(); +// Must be at the top to prevent AngularJS unnecessary digest operations +// And to handle the hashPrefix that AngularJS adds that confuses BBQ +$.bbq.pushState('!', ''); + //i18n global variable var i18n = {};
Experimental Menu - Fixes an issue where clicking the new button on tupane wouldn't directly open the panel by injecting a root hash on the end of the URL. This is needed because of angularjs $locationProvider adding a hashPrefix.
Katello_katello
train
js
c2cf8d924052935d3fc52fe4c5845e6aaca5daa2
diff --git a/djangoql/static/djangoql/js/completion.js b/djangoql/static/djangoql/js/completion.js index <HASH>..<HASH> 100644 --- a/djangoql/static/djangoql/js/completion.js +++ b/djangoql/static/djangoql/js/completion.js @@ -910,7 +910,12 @@ }, populateFieldOptions: function (loadMore) { - var fieldOptions = this.getCurrentFieldOptions() || {}; + var fieldOptions = this.getCurrentFieldOptions(); + if (fieldOptions === null) { + // 1) we are out of field options context + // 2) field has no options + return; + } var options = fieldOptions.options; var prefix = fieldOptions.context && fieldOptions.context.prefix; var input = this.textarea; @@ -978,6 +983,7 @@ var scrollBottom = this.completionUL.scrollTop + rectHeight; if (scrollBottom > rectHeight && scrollBottom > (this.completionUL.scrollHeight - rectHeight)) { + // TODO: add some checks of context? this.populateFieldOptions(true); } },
Fixed the issue with suggestions hiding after scroll
ivelum_djangoql
train
js
c70e1930cc8540ae65f9f12a0ae4745bb17e66f6
diff --git a/src/main/java/com/github/oxo42/stateless4j/triggers/TriggerBehaviour.java b/src/main/java/com/github/oxo42/stateless4j/triggers/TriggerBehaviour.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/oxo42/stateless4j/triggers/TriggerBehaviour.java +++ b/src/main/java/com/github/oxo42/stateless4j/triggers/TriggerBehaviour.java @@ -5,6 +5,11 @@ import com.github.oxo42.stateless4j.delegates.FuncBoolean; public abstract class TriggerBehaviour<S, T> { private final T trigger; + + /** + * Note that this guard gets called quite often, and sometimes multiple times per fire() call. + * Thus, it should not be anything performance intensive. + */ private final FuncBoolean guard; protected TriggerBehaviour(T trigger, FuncBoolean guard) {
Giving a notice on the behavior of the guard variable because of #<I> The guard variable in TriggerBehavior gets called often and multiple times, this is now noted in the documentation.
oxo42_stateless4j
train
java
73fa60dcb18826f2e3077278673e6e154ca98b28
diff --git a/src/Mainio/C5/SymfonyForms/Controller/Extension/SymfonyFormsExtension.php b/src/Mainio/C5/SymfonyForms/Controller/Extension/SymfonyFormsExtension.php index <HASH>..<HASH> 100644 --- a/src/Mainio/C5/SymfonyForms/Controller/Extension/SymfonyFormsExtension.php +++ b/src/Mainio/C5/SymfonyForms/Controller/Extension/SymfonyFormsExtension.php @@ -21,7 +21,7 @@ trait SymfonyFormsExtension if (!isset($this->twig)) { $prefix = ''; $page = $this->getPageObject(); - if (strlen($page->getPackageID())) { + if (strlen($page->getPackageID()) && $page->getPackageID() > 0) { $prefix = $page->getPackageHandle() . '/'; } $this->twig = Core::make($prefix . 'environment/twig');
Fixed issue when using outside of a package
mainio_c5pkg_symfony_forms
train
php
e0c91a4c8d3b182683df8176356055edda4d883c
diff --git a/spacy/about.py b/spacy/about.py index <HASH>..<HASH> 100644 --- a/spacy/about.py +++ b/spacy/about.py @@ -4,13 +4,13 @@ # fmt: off __title__ = "spacy-nightly" -__version__ = "2.1.0a7.dev8" +__version__ = "2.1.0a7" __summary__ = "Industrial-strength Natural Language Processing (NLP) with Python and Cython" __uri__ = "https://spacy.io" __author__ = "Explosion AI" __email__ = "contact@explosion.ai" __license__ = "MIT" -__release__ = False +__release__ = True __download_url__ = "https://github.com/explosion/spacy-models/releases/download" __compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json"
Set version to <I>a7
explosion_spaCy
train
py
6ff57b0a911ad0532e480e462d491597b84a29a4
diff --git a/amqpstorm/tests/functional/reliability_tests.py b/amqpstorm/tests/functional/reliability_tests.py index <HASH>..<HASH> 100644 --- a/amqpstorm/tests/functional/reliability_tests.py +++ b/amqpstorm/tests/functional/reliability_tests.py @@ -55,6 +55,7 @@ class OpenCloseChannelLoopTest(unittest.TestCase): self.assertTrue(self.connection.is_closed) self.assertIsNone(self.connection._io.socket) self.assertIsNone(self.connection._io.poller) + self.assertFalse(self.connection._io._running.is_set()) time.sleep(1) @@ -96,6 +97,7 @@ class OpenMultipleChannelTest(unittest.TestCase): self.assertTrue(self.connection.is_closed) self.assertIsNone(self.connection._io.socket) self.assertIsNone(self.connection._io.poller) + self.assertFalse(self.connection._io._running.is_set()) self.assertEqual(threading.activeCount(), 1, msg='Current Active threads: %s' % threading._active)
Added additional check to reability tests
eandersson_amqpstorm
train
py
73a69afe1211e16061088e86a25ee8d019e75cf5
diff --git a/go/vt/vtgate/buffer/shard_buffer.go b/go/vt/vtgate/buffer/shard_buffer.go index <HASH>..<HASH> 100644 --- a/go/vt/vtgate/buffer/shard_buffer.go +++ b/go/vt/vtgate/buffer/shard_buffer.go @@ -286,13 +286,14 @@ func (sb *shardBuffer) oldestEntry() *entry { // queue if it exceeded its buffering window. func (sb *shardBuffer) evictOldestEntry(e *entry) { sb.mu.Lock() + defer sb.mu.Unlock() + if len(sb.queue) == 0 || e != sb.queue[0] { // Entry is already removed e.g. by remove(). Ignore it. return } sb.unblockAndWait(e, nil /* err */, true /* releaseSlot */) sb.queue = sb.queue[1:] - sb.mu.Unlock() } // remove must be called when the request was canceled from outside and not
vtgate/buffer: Fix lost lock when returning early. BUG=<I>
vitessio_vitess
train
go
7aa67e388c8fcc8c84b4396a6be5bab0aed12922
diff --git a/crackmapexec.py b/crackmapexec.py index <HASH>..<HASH> 100755 --- a/crackmapexec.py +++ b/crackmapexec.py @@ -55,7 +55,7 @@ parser = argparse.ArgumentParser(description=""" yellow(CODENAME)), formatter_class=RawTextHelpFormatter, - version='2.0 - {}'.format(CODENAME), + version='{} - {}'.format(VERSION, CODENAME), epilog='There\'s been an awakening... have you felt it?') parser.add_argument("target", nargs=1, type=str, help="The target IP, range, CIDR identifier, hostname, FQDN or list or file containg a list of targets")
Resolves #<I>
byt3bl33d3r_CrackMapExec
train
py
4882c8e4b4b5c26a3dc5c5befdccdc383efde408
diff --git a/spec/gocli/integration/cli_logs_spec.rb b/spec/gocli/integration/cli_logs_spec.rb index <HASH>..<HASH> 100644 --- a/spec/gocli/integration/cli_logs_spec.rb +++ b/spec/gocli/integration/cli_logs_spec.rb @@ -15,9 +15,9 @@ describe 'cli: logs', type: :integration do deployment_name = manifest_hash['name'] - expect(bosh_runner.run("-d #{deployment_name} logs first-job/#{index}")).to match /first-job-.*\.tgz/ + expect(bosh_runner.run("-d #{deployment_name} logs first-job/#{index}")).to match /first-job\..*\.tgz/ - expect(bosh_runner.run("-d #{deployment_name} logs first-job/'#{id}'")).to match /first-job-.*\.tgz/ + expect(bosh_runner.run("-d #{deployment_name} logs first-job/'#{id}'")).to match /first-job\..*\.tgz/ expect(bosh_runner.run("-d #{deployment_name} logs first-job/'#{id}'")).to include "Fetching logs for first-job/#{id} (#{index})" end end
Small fix test for cloudfoundry/bosh-cli#<I> Better changes still need to be reviewed/merged from cloudfoundry/bosh#<I>
cloudfoundry_bosh
train
rb
f70747be18377f0ff102607e09eebf7697846171
diff --git a/mambuclient.py b/mambuclient.py index <HASH>..<HASH> 100644 --- a/mambuclient.py +++ b/mambuclient.py @@ -144,8 +144,11 @@ class MambuClient(MambuStruct): except KeyError: pass - for idDoc in self.attrs['idDocuments']: - self.attrs[idDoc['documentType']] = idDoc['documentId'] + try: + for idDoc in self.attrs['idDocuments']: + self.attrs[idDoc['documentType']] = idDoc['documentId'] + except KeyError: + pass # De un diccionario de valores como cadenas, convierte los pertinentes a numeros/fechas def convertDict2Attrs(self, *args, **kwargs):
Try/catch when expanding id docs for mambuclients
jstitch_MambuPy
train
py
d24ae7bb8192317a22c5332d9a5c9a4e7b39c90a
diff --git a/tests/library/CM/Stream/Adapter/Video/WowzaTest.php b/tests/library/CM/Stream/Adapter/Video/WowzaTest.php index <HASH>..<HASH> 100644 --- a/tests/library/CM/Stream/Adapter/Video/WowzaTest.php +++ b/tests/library/CM/Stream/Adapter/Video/WowzaTest.php @@ -45,9 +45,10 @@ class CM_Stream_Adapter_Video_WowzaTest extends CMTest_TestCase { $wowza->expects($this->at(1))->method('_stopClient')->with($streamPublish->getKey(), $streamChannel->getPrivateHost()); $wowza->expects($this->at(2))->method('_stopClient')->with($streamSubscribe->getKey(), $streamChannel->getPrivateHost()); $wowza->expects($this->exactly(2))->method('_stopClient'); - $streamChannel->delete(); - /** @var $wowza CM_Stream_Video */ + /** @var $wowza CM_Stream_Adapter_Video_Wowza */ + $wowza->unpublish($streamChannel->getKey()); + $wowza->unsubscribe($streamChannel->getKey(), $streamSubscribe->getKey()); $wowza->synchronize(); }
Adjust test to unpublish, unsubscribe
cargomedia_cm
train
php
3107db60397d9283d7ae2419820f5cfe6928b101
diff --git a/odl/test/solvers/nonsmooth/adupdates_test.py b/odl/test/solvers/nonsmooth/adupdates_test.py index <HASH>..<HASH> 100644 --- a/odl/test/solvers/nonsmooth/adupdates_test.py +++ b/odl/test/solvers/nonsmooth/adupdates_test.py @@ -37,12 +37,15 @@ def test_adupdates(): (c) = (19/20) then (x_3) = (1) (d) (319/420), (x_4) = (1). - We therefore solve the problem + We solve the problem min ||Ax - b||^2 + TV(x) s.t. x >= 0 - for the matrix A, the r.h.s. b as above and the total variation TV. - The solution of this problem is clearly x = (1, 1, 1, 1). + for the matrix A, the r.h.s. b as above and the total variation TV, which + is given as the sum of the absoulute values of consecutive entries of the + solution. The solution of this problem is clearly x = (1, 1, 1, 1), since + it satisfies the additional constraint and minimizes both terms of the + objective function. """ mat1 = [[1, 1 / 2, 1 / 3, 1 / 4],
DOC/TST: Add clarifying remarks to the docstring of the adupdates test.
odlgroup_odl
train
py
a09a05a6b9fb681bdf38da7499b8d69b9c98fb99
diff --git a/install.py b/install.py index <HASH>..<HASH> 100644 --- a/install.py +++ b/install.py @@ -47,14 +47,13 @@ except ImportError: sys.exit('venv is missing! Please see the documentation of your Operating System to install it') else: if os.path.exists('./python._pth.old'): - VENV = os.path.expanduser('C:\\Program Files\\OpenQuake') + VENV = os.path('C:\\Program Files\\OpenQuake') OQ = os.path.join(VENV, '\\Scripts\\oq') - OQDATA = os.path.expanduser('~\\oqdata') + OQDATA = os.path.join(VENV, '~\\oqdata') else: sys.exit('venv is missing! Please see the documentation of your Operating System to install it') - class server: """ Parameters for a server installation (with root permissions) @@ -78,9 +77,8 @@ class user: """ Parameters for a user installation """ - # check platform - if sys.platform == 'win32': - VENV = os.path.expanduser('C:\\Program Files\\OpenQuake') + if (sys.platform == 'win32') and not (os.path.exists('./python._pth.old')): + VENV = os.path.expanduser('~\\openquake') OQ = os.path.join(VENV, '\\Scripts\\oq') OQDATA = os.path.expanduser('~\\oqdata') else:
add condition to meet windows installer with nsis
gem_oq-engine
train
py
5a6c804e03c1a32939af4276109f335d8c3b1375
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -60,7 +60,7 @@ setup_params = dict( tests_require=[ 'pymongo', 'pytest', - 'jaraco.test', + 'jaraco.test>=1.0.1', ], )
Bump to jaraco.test <I> with the dependencies declared
yougov_pmxbot
train
py
4d963fa43e4bc66636b5e57710200acc5f8b64cd
diff --git a/phy/cluster/algorithms.py b/phy/cluster/algorithms.py index <HASH>..<HASH> 100644 --- a/phy/cluster/algorithms.py +++ b/phy/cluster/algorithms.py @@ -737,9 +737,10 @@ class SpikeDetekt(EventEmitter): # Clustering class #------------------------------------------------------------------------------ -class KlustaKwik(object): +class KlustaKwik(EventEmitter): """KlustaKwik automatic clustering algorithm.""" def __init__(self, **kwargs): + super(KlustaKwik, self).__init__() self._kwargs = kwargs self.__dict__.update(kwargs) # Set the version. @@ -769,6 +770,11 @@ class KlustaKwik(object): # Run KK. from klustakwik2 import KK kk = KK(data, **self._kwargs) + + @kk.register_callback + def f(_): + self.emit('iter', kk.clusters) + self.params = kk.all_params kk.cluster_mask_starts() spike_clusters = kk.clusters
KlustaKwik class now emits an event at each iteration.
kwikteam_phy
train
py
dd3571664757e3829b3a8412ae80e087cc503324
diff --git a/lib/hrr_rb_ssh/connection/request_handler/reference_shell_request_handler.rb b/lib/hrr_rb_ssh/connection/request_handler/reference_shell_request_handler.rb index <HASH>..<HASH> 100644 --- a/lib/hrr_rb_ssh/connection/request_handler/reference_shell_request_handler.rb +++ b/lib/hrr_rb_ssh/connection/request_handler/reference_shell_request_handler.rb @@ -23,7 +23,7 @@ module HrrRbSsh STDERR.reopen pts, 'w' pts.close context.vars[:env] ||= Hash.new - exec context.vars[:env], 'login', '-f', context.username + exec context.vars[:env], 'login', '-pf', context.username end pts.close
update reference shell request handler so that env is passed to the shell session
hirura_hrr_rb_ssh
train
rb
60d5555db679c59e963bb819dd44e52866195412
diff --git a/lib/delorean/base.rb b/lib/delorean/base.rb index <HASH>..<HASH> 100644 --- a/lib/delorean/base.rb +++ b/lib/delorean/base.rb @@ -94,7 +94,7 @@ module Delorean # This is pretty awful. NOTE: can't sanitize params as Marty # patches NodeCall and modifies params to send _parent_id. # This whole thing needs to be redone. - @cp ||= params.clone + @cp ||= Hash[params] end def evaluate(attr)
replace hash.clone with Hash[hash] for performance
arman000_delorean_lang
train
rb
eb61867fa3723e68e3171fc2a3af4fb64f820bb7
diff --git a/src/base/config.php b/src/base/config.php index <HASH>..<HASH> 100644 --- a/src/base/config.php +++ b/src/base/config.php @@ -39,6 +39,9 @@ return [ 'init' => [ 'class' => 'hidev\controllers\InitController', ], + 'github' => [ + 'class' => 'hidev\controllers\GithubController', + ], 'vendor' => [ 'class' => 'hidev\controllers\VendorController', ],
added GithubController to config
hiqdev_hidev
train
php
284e75f2625e2bc923a68ba0b750d192fdafba32
diff --git a/Auth/OpenID.php b/Auth/OpenID.php index <HASH>..<HASH> 100644 --- a/Auth/OpenID.php +++ b/Auth/OpenID.php @@ -18,6 +18,11 @@ */ /** + * The library version string + */ +define('Auth_OpenID_VERSION', '2.0.2'); + +/** * Require the fetcher code. */ require_once "Auth/Yadis/PlainHTTPFetcher.php";
[project @ Add version string to Auth/OpenID.php]
openid_php-openid
train
php
baa83a762cb6d0204e06b975878c0dfb10bbe570
diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/settings.py b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/settings.py index <HASH>..<HASH> 100644 --- a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/settings.py +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/settings.py @@ -272,7 +272,7 @@ class Local(Common): 'SHOW_TEMPLATE_CONTEXT': True, } ########## end django-debug-toolbar - + ########## STATIC FILE CONFIGURATION # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-root STATIC_ROOT = 'staticfiles' @@ -380,7 +380,7 @@ class Production(Common): ########## CACHING # Only do this here because thanks to django-pylibmc-sasl and pylibmc memcacheify is painful to install on windows. - CACHES = values.CacheURLValue("memcached://127.0.0.1:11211") + CACHES = values.CacheURLValue(default="memcached://127.0.0.1:11211") ########## END CACHING ########## Your production stuff: Below this line define 3rd party libary settings
wont define the cache value unless default keyword is present for argument
pydanny_cookiecutter-django
train
py
6e678ae7f61420a7db1ac1248373ba5e05922cae
diff --git a/libkbfs/folder_block_ops.go b/libkbfs/folder_block_ops.go index <HASH>..<HASH> 100644 --- a/libkbfs/folder_block_ops.go +++ b/libkbfs/folder_block_ops.go @@ -1964,6 +1964,12 @@ func (fbo *folderBlockOps) startSyncWrite(ctx context.Context, } fbo.unrefCache[fileRef].op = syncOpCopy + // If there are any deferred bytes, it must be because this is + // a retried sync and some blocks snuck in between sync. Those + // blocks will get transferred now, but they are also on the + // deferred list and will be retried on the next sync as well. + df.assimilateDeferredNewBytes() + // TODO: Returning si.bps in this way is racy, since si is a // member of unrefCache. return fblock, si.bps, syncState, dirtyDe, nil @@ -2071,10 +2077,6 @@ func (fbo *folderBlockOps) CleanupSyncState( mdToCleanIfUnused{md, result.si.bps.DeepCopy()}) } if isRecoverableBlockError(err) { - if df := fbo.dirtyFiles[file.tailPointer()]; df != nil { - df.assimilateDeferredNewBytes() - } - if result.si != nil { fbo.revertSyncInfoAfterRecoverableError(blocksToRemove, result) }
folder_block_ops: assimilate deferred bytes in startSyncWrite Because deferred bytes can sneak in between the end of the failed sync and the start of the retried sync, which are included in the retried sync. Issue: KBFS-<I>
keybase_client
train
go
c3f23f84e3010aee5bf68f53cd3bdd01517518e7
diff --git a/lib/Doctrine/Hydrator.php b/lib/Doctrine/Hydrator.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/Hydrator.php +++ b/lib/Doctrine/Hydrator.php @@ -70,7 +70,7 @@ class Doctrine_Hydrator extends Doctrine_Hydrator_Abstract $this->_tableAliases = $tableAliases; - if ($hydrationMode === Doctrine::HYDRATE_ARRAY) { + if ($hydrationMode == Doctrine::HYDRATE_ARRAY) { $driver = new Doctrine_Hydrator_ArrayDriver(); } else { $driver = new Doctrine_Hydrator_RecordDriver();
relaxed a comparison in the hydrator. caused buggy behavior.
doctrine_annotations
train
php
9b1f0684c127834f89b5c0aa3615d93a9aa06718
diff --git a/core/client/src/test/java/alluxio/hadoop/AbstractFileSystemTest.java b/core/client/src/test/java/alluxio/hadoop/AbstractFileSystemTest.java index <HASH>..<HASH> 100644 --- a/core/client/src/test/java/alluxio/hadoop/AbstractFileSystemTest.java +++ b/core/client/src/test/java/alluxio/hadoop/AbstractFileSystemTest.java @@ -72,11 +72,11 @@ public class AbstractFileSystemTest { mockMasterClient(); if (isHadoop1x()) { - LOG.debug("Running Alluxio FS tests against hadoop 1x"); + LOG.debug("Running TFS tests against hadoop 1x"); } else if (isHadoop2x()) { - LOG.debug("Running Alluxio FS tests against hadoop 2x"); + LOG.debug("Running TFS tests against hadoop 2x"); } else { - LOG.warn("Running Alluxio FS tests against untargeted Hadoop version: " + getHadoopVersion()); + LOG.warn("Running TFS tests against untargeted Hadoop version: " + getHadoopVersion()); } }
[ALLUXIO-<I>] Made correction of TFS to Alluxio FS in AbstractFileSystemTest
Alluxio_alluxio
train
java
ad4f6707cc66c5fbc3a255edc838d3da3f539182
diff --git a/src/Modules/BaseModule.php b/src/Modules/BaseModule.php index <HASH>..<HASH> 100644 --- a/src/Modules/BaseModule.php +++ b/src/Modules/BaseModule.php @@ -271,6 +271,7 @@ class BaseModule implements BaseModuleInterface{ * @param $content string to sanitize * * @return string + * @codeCoverageIgnore */ public function sanitize($content){ return 'Implement sanitize() method!';
ignore coverage for BaseModule::sanitize()
chillerlan_php-bbcode
train
php
774c600bfe84bfbadff332bb3361531ff80ddb2e
diff --git a/lib/fog/test_helpers/collection_helper.rb b/lib/fog/test_helpers/collection_helper.rb index <HASH>..<HASH> 100644 --- a/lib/fog/test_helpers/collection_helper.rb +++ b/lib/fog/test_helpers/collection_helper.rb @@ -30,7 +30,7 @@ def collection_tests(collection, params = {}, mocks_implemented = true) tests("Enumerable") do pending if Fog.mocking? && !mocks_implemented - methods = %w(all any? find detect collect map find_index flat_map + methods = %w(all? any? find detect collect map find_index flat_map collect_concat group_by none? one?) # JRuby 1.7.5+ issue causes a SystemStackError: stack level too deep
fix mistake in collections helper/enum tests closes #<I>
fog_fog-core
train
rb
21a3df354a5cd33b2037abdd5e4f476553cbac42
diff --git a/src/main/java/com/smartsheet/api/models/Cell.java b/src/main/java/com/smartsheet/api/models/Cell.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/smartsheet/api/models/Cell.java +++ b/src/main/java/com/smartsheet/api/models/Cell.java @@ -237,11 +237,13 @@ public class Cell { * @param strict the strict * @return the update row cells builder */ - public UpdateRowCellsBuilder addCell(Long columnId, Object value, Boolean strict) { + public UpdateRowCellsBuilder addCell(Long columnId, Object value, Boolean strict, com.smartsheet.api.models.Hyperlink hyperlink, CellLink linkInFromCell) { Cell cell = new Cell(); cell.setColumnId(columnId); cell.setValue(value); cell.setStrict(strict); + cell.setHyperlink(hyperlink); + cell.setLinkInFromCell(linkInFromCell); cells.add(cell); return this; } @@ -258,7 +260,7 @@ public class Cell { * @return the update row cells builder */ public UpdateRowCellsBuilder addCell(Long columnId, Object value) { - addCell(columnId, value, true); + addCell(columnId, value, true, null, null); return this; }
Updated the builder to include all parameters.
smartsheet-platform_smartsheet-java-sdk
train
java
ad34e98004bbb90fcaab4f59281557532ab330da
diff --git a/gremlin/gremlin-test/src/main/java/com/tinkerpop/gremlin/algorithm/generator/CommunityGeneratorTest.java b/gremlin/gremlin-test/src/main/java/com/tinkerpop/gremlin/algorithm/generator/CommunityGeneratorTest.java index <HASH>..<HASH> 100644 --- a/gremlin/gremlin-test/src/main/java/com/tinkerpop/gremlin/algorithm/generator/CommunityGeneratorTest.java +++ b/gremlin/gremlin-test/src/main/java/com/tinkerpop/gremlin/algorithm/generator/CommunityGeneratorTest.java @@ -125,7 +125,7 @@ public class CommunityGeneratorTest { generated = true; } catch (IllegalArgumentException iae) { generated = false; - localCrossPcent = localCrossPcent - 0.05d; + localCrossPcent = localCrossPcent - 0.005d; if (localCrossPcent < 0d) fail("Cross community percentage should not be less than zero");
Lower the incremental retry threshold to allow for more chances for tests to pass....
apache_tinkerpop
train
java
156985294ecf34db572da15a847f59ce7067b55a
diff --git a/optalg/opt_solver/clp_cmd.py b/optalg/opt_solver/clp_cmd.py index <HASH>..<HASH> 100644 --- a/optalg/opt_solver/clp_cmd.py +++ b/optalg/opt_solver/clp_cmd.py @@ -53,7 +53,8 @@ class OptSolverClpCMD(OptSolver): x = np.zeros(problem.c.size) for l in f: l = l.split() - i = int(l[0]) + name = l[1] + i = int(name.split('_')[1]) val = float(l[2]) x[i] = val f.close()
- fixed bug with clp cmd read sol
ttinoco_OPTALG
train
py
828f49524f11de0caf37cdc98148a8e3921ded35
diff --git a/lib/discordrb/data.rb b/lib/discordrb/data.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/data.rb +++ b/lib/discordrb/data.rb @@ -586,9 +586,10 @@ module Discordrb # Sends a message to this channel. # @param content [String] The content to send. Should not be longer than 2000 characters or it will result in an error. + # @param tts [true, false] Whether or not this message should be sent using Discord text-to-speech. # @return [Message] the message that was sent. - def send_message(content) - @bot.send_message(@id, content) + def send_message(content, tts = false) + @bot.send_message(@id, content, tts) end # Sends a file to this channel. If it is an image, it will be embedded.
Expose TTS in Channel#send_message
meew0_discordrb
train
rb
a3e7b7e42d21565a19599e0af72575caa6252f9f
diff --git a/django_extensions/management/commands/sqldiff.py b/django_extensions/management/commands/sqldiff.py index <HASH>..<HASH> 100644 --- a/django_extensions/management/commands/sqldiff.py +++ b/django_extensions/management/commands/sqldiff.py @@ -653,7 +653,7 @@ because you haven't specified the DATABASE_ENGINE setting. Edit your settings file and change DATABASE_ENGINE to something like 'postgresql' or 'mysql'.""") if options.get('all_applications', False): - app_models = models.get_models() + app_models = models.get_models(include_auto_created=True) else: if not app_labels: raise CommandError('Enter at least one appname.') @@ -664,7 +664,7 @@ Edit your settings file and change DATABASE_ENGINE to something like 'postgresql app_models = [] for app in app_list: - app_models.extend(models.get_models(app)) + app_models.extend(models.get_models(app, include_auto_created=True)) ## remove all models that are not managed by Django #app_models = [model for model in app_models if getattr(model._meta, 'managed', True)]
Support for doing diffs involving many-to-many tables include_auto_created was needed for Django to return all models (including the ones created by using ManyToManyFields)
django-extensions_django-extensions
train
py
c88979a36999e86e101a450d54343ab706331e26
diff --git a/src/main/webapp/js/help.js b/src/main/webapp/js/help.js index <HASH>..<HASH> 100644 --- a/src/main/webapp/js/help.js +++ b/src/main/webapp/js/help.js @@ -11,7 +11,7 @@ $(function() { }); $(document).on("click touchend", function(e) { - if (!$(e.target).closest("#searchOptions, #searchOptionsButton").length) { + if (!$(e.target).closest("#searchOptions, [data-toggle='control-options']").length) { $("#searchOptions").removeClass("active"); } }); diff --git a/src/main/webapp/js/search.js b/src/main/webapp/js/search.js index <HASH>..<HASH> 100644 --- a/src/main/webapp/js/search.js +++ b/src/main/webapp/js/search.js @@ -15,7 +15,7 @@ $(function() { }); $(document).on("click touchend", function(e) { - if (!$(e.target).closest("#searchOptions, #searchOptionsButton").length) { + if (!$(e.target).closest("#searchOptions, [data-toggle='control-options']").length) { $("#searchOptions").removeClass("active"); } });
fix #<I> fix links of menus
codelibs_fess
train
js,js
b6715c025de25e29c58e4ba8e46f6f2b2bb10743
diff --git a/src/js/Tree.js b/src/js/Tree.js index <HASH>..<HASH> 100644 --- a/src/js/Tree.js +++ b/src/js/Tree.js @@ -39,7 +39,7 @@ class Tree extends React.Component { } onCheck(node) { - const { checked } = this.props; + const checked = [...this.props.checked]; const isChecked = node.checked; this.setCheckState(checked, node, isChecked); @@ -49,7 +49,7 @@ class Tree extends React.Component { onExpand(node) { const isExpanded = node.expanded; - const expanded = this.props.expanded; + const expanded = [...this.props.expanded]; const nodeIndex = expanded.indexOf(node.value); if (!isExpanded && nodeIndex > -1) {
Do not mutate properties Resolves #<I>
jakezatecky_react-checkbox-tree
train
js
b372a3cc8305c4488efa2202a2a3376a5665cfe6
diff --git a/src/nupic/regions/TMRegion.py b/src/nupic/regions/TMRegion.py index <HASH>..<HASH> 100644 --- a/src/nupic/regions/TMRegion.py +++ b/src/nupic/regions/TMRegion.py @@ -43,8 +43,6 @@ def _getTPClass(temporalImp): return backtracking_tm_shim.TMShim elif temporalImp == 'tm_cpp': return backtracking_tm_shim.TMCPPShim - elif temporalImp == 'tm_py_fast': - return backtracking_tm_shim.FastTMShim elif temporalImp == 'monitored_tm_py': return backtracking_tm_shim.MonitoredTMShim else: @@ -422,8 +420,8 @@ class TMRegion(PyRegion): tpClass = _getTPClass(self.temporalImp) if self.temporalImp in ['py', 'cpp', 'r', - 'tm_py', 'tm_cpp', 'tm_py_fast', - 'monitored_tm_py', 'monitored_tm_py_fast']: + 'tm_py', 'tm_cpp', + 'monitored_tm_py',]: self._tfdr = tpClass( numberOfCols=self.columnCount, cellsPerColumn=self.cellsPerColumn,
Removed references to obsolete tm_py_fast shim (#<I>)
numenta_nupic
train
py
8c7ec7569cd6697475061361ecfa0c1f735903ae
diff --git a/tests/features/UserTest.php b/tests/features/UserTest.php index <HASH>..<HASH> 100644 --- a/tests/features/UserTest.php +++ b/tests/features/UserTest.php @@ -4,6 +4,7 @@ use App\Owner; use App\User; use Faker\Factory; use Illuminate\Foundation\Testing\DatabaseMigrations; +use LaravelEnso\Core\app\Notifications\ResetPasswordNotification; use LaravelEnso\RoleManager\app\Models\Role; use LaravelEnso\TestHelper\app\Classes\TestHelper; @@ -45,6 +46,8 @@ class UserTest extends TestHelper /** @test */ public function store() { + Notification::fake(); + $postParams = $this->postParams(); $response = $this->post('/administration/users', $postParams); $user = User::whereFirstName($postParams['first_name'])->first(['id']); @@ -54,6 +57,8 @@ class UserTest extends TestHelper 'message' => 'The user was created!', 'redirect' => '/administration/users/'.$user->id.'/edit', ]); + + Notification::assertSentTo([$user], ResetPasswordNotification::class); } /** @test */
mocked user reset password notification in test
laravel-enso_Core
train
php
c7ea314de0c7850f0af225594261d4b2d3ac947f
diff --git a/doc.go b/doc.go index <HASH>..<HASH> 100644 --- a/doc.go +++ b/doc.go @@ -25,7 +25,6 @@ BitTorrent features implemented include: - 15: UDP Tracker Protocol - 20: Peer ID convention ("-GTnnnn-") - 23: Tracker Returns Compact Peer Lists - - 27: Private torrents - 29: uTorrent transport protocol - 41: UDP Tracker Protocol Extensions - 42: DHT Security extension
BEP<I> isn't implemented <URL>
anacrolix_torrent
train
go
d451fecbdfba0c8a5d8689f6d24c7d038aacd2ca
diff --git a/model/PropertySelection.js b/model/PropertySelection.js index <HASH>..<HASH> 100644 --- a/model/PropertySelection.js +++ b/model/PropertySelection.js @@ -403,6 +403,12 @@ Object.defineProperties(PropertySelection.prototype, { }, set: function() { throw new Error('immutable.'); } }, + startPath: { + get: function() { + return this.range.start.path; + }, + set: function() { throw new Error('immutable.'); } + }, /** @property {Number} PropertySelection.startOffset */
Added PropertySelection#startPath.
substance_substance
train
js
44cc1e83d3c8fb0c00b27e691567c08f69d39345
diff --git a/riemann/__init__.py b/riemann/__init__.py index <HASH>..<HASH> 100644 --- a/riemann/__init__.py +++ b/riemann/__init__.py @@ -1,4 +1,4 @@ """A Python Riemann client and command line tool""" -__version__ = '2.0.1' +__version__ = '2.1.0' __author__ = 'Sam Clements <sam.clements@datasift.com>' diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ import sys setuptools.setup( name = "riemann-client", - version = '2.0.1', + version = '2.1.0', author = "Sam Clements", author_email = "sam.clements@datasift.com", @@ -17,7 +17,7 @@ setuptools.setup( packages = setuptools.find_packages(), install_requires = [ - 'argparse==1.2.1', + 'argparse==1.1', 'protobuf==2.5.0', ], diff --git a/tox.ini b/tox.ini index <HASH>..<HASH> 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -minversion=1.5.0 +minversion=1.6.0 envlist=py26,py27,py26-flake8 [testenv]
Replaced argparse <I> with <I> Versions of argparse above <I> are not hosted on PyPi, and so will not be installed by pip when using the default settings. Version <I> uses the Apache licence, whereas <I> uses the Python licence. The tox configuration has been updated to use tox <I> or above, which will install development packages using pip.
borntyping_python-riemann-client
train
py,py,ini
bd4a7e6f0804a0d370af710ca5c0d6e23a2eaa29
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ tests_require = [ ] -version = (1, 0, 0, 'alpha') +version = (1, 1, 0, 'alpha') def get_version():
Version in setup.py on the master branch is out of date The version in setup.py on the master branch is <I> even though it includes all the commits in later stable releases.
fusionbox_django-pyscss
train
py
c199567904204f673b060e39c191eb88769737cb
diff --git a/TYPO3.Neos/Migrations/Postgresql/Version20151120170812.php b/TYPO3.Neos/Migrations/Postgresql/Version20151120170812.php index <HASH>..<HASH> 100644 --- a/TYPO3.Neos/Migrations/Postgresql/Version20151120170812.php +++ b/TYPO3.Neos/Migrations/Postgresql/Version20151120170812.php @@ -18,9 +18,9 @@ class Version20151120170812 extends AbstractMigration { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); - $this->addSql("ALTER TABLE typo3_typo3cr_domain_model_nodedata ALTER dimensionvalues TYPE jsonb"); + $this->addSql("ALTER TABLE typo3_typo3cr_domain_model_nodedata ALTER dimensionvalues TYPE jsonb USING dimensionvalues::jsonb"); $this->addSql("ALTER TABLE typo3_typo3cr_domain_model_nodedata ALTER dimensionvalues DROP DEFAULT"); - $this->addSql("ALTER TABLE typo3_typo3cr_domain_model_nodedata ALTER accessroles TYPE jsonb"); + $this->addSql("ALTER TABLE typo3_typo3cr_domain_model_nodedata ALTER accessroles TYPE jsonb USING accessroles::jsonb"); $this->addSql("ALTER TABLE typo3_typo3cr_domain_model_nodedata ALTER accessroles DROP DEFAULT"); }
BUGFIX: Add type cast to column type change statements When changing from json to jsonb existing data could not be converted in all cases. Adding an explicit cast solves this. NEOS-<I> #close
neos_neos-development-collection
train
php
c4373ce99fc25f3fcaabfc1ac68903183eb7b042
diff --git a/src/Form/Elements/NamedElement.php b/src/Form/Elements/NamedElement.php index <HASH>..<HASH> 100644 --- a/src/Form/Elements/NamedElement.php +++ b/src/Form/Elements/NamedElement.php @@ -93,7 +93,7 @@ class NamedElement extends Element implements Validatable protected function getValidationRuleName($rule) { - list($name,) = explode(':', (string)$rule, 2); + list($name, ) = explode(':', (string)$rule, 2); return $name; } } diff --git a/src/View/Extensions/Extension.php b/src/View/Extensions/Extension.php index <HASH>..<HASH> 100644 --- a/src/View/Extensions/Extension.php +++ b/src/View/Extensions/Extension.php @@ -7,7 +7,6 @@ use Sco\Admin\Contracts\View\Extensions\ExtensionInterface; abstract class Extension extends Collection implements ExtensionInterface { - abstract public function add($value); /**
Apply fixes from StyleCI (#5)
ScoLib_admin
train
php,php
0026ac275a4a903cc201d94967e75b4963be2105
diff --git a/core/bulk.go b/core/bulk.go index <HASH>..<HASH> 100644 --- a/core/bulk.go +++ b/core/bulk.go @@ -338,7 +338,6 @@ func BulkSend(buf *bytes.Buffer) error { _, err := api.DoCommand("POST", "/_bulk", nil, buf) if err != nil { BulkErrorCt += 1 - log.Printf("error in BulkSend:%v", err) return err } return nil @@ -385,7 +384,8 @@ func WriteBulkBytes(op string, index string, _type string, id, ttl string, date buf.WriteString(`,"refresh":true`) } buf.WriteString(`}}`) - buf.WriteByte('\n') + buf.WriteRune('\n') + //buf.WriteByte('\n') switch v := data.(type) { case *bytes.Buffer: io.Copy(&buf, v) @@ -400,8 +400,10 @@ func WriteBulkBytes(op string, index string, _type string, id, ttl string, date return nil, jsonErr } buf.Write(body) + // buf.WriteRune('\n') } - buf.WriteByte('\n') + buf.WriteRune('\n') + // buf.WriteByte('\n') return buf.Bytes(), nil }
no idea why drone.io is failing, testing....
mattbaird_elastigo
train
go
bc01cd249ddb1249640350d4c436d60e35002593
diff --git a/hgtools/plugins.py b/hgtools/plugins.py index <HASH>..<HASH> 100644 --- a/hgtools/plugins.py +++ b/hgtools/plugins.py @@ -2,12 +2,6 @@ setuptools plugins """ -""" -This file (and everything it imports) must remain runnable on both -Python 2 and Python 3 without conversion (because it runs as part -of setup.py when hgtools is itself installed). -""" - import sys try: # Prefer the Python 2 version of configparser because Python 3
Remove comment that applies to the whole package now.
jaraco_hgtools
train
py
c4e9a17355bb26f4db3f752e4b99c93112dfae71
diff --git a/tests/content_test.py b/tests/content_test.py index <HASH>..<HASH> 100644 --- a/tests/content_test.py +++ b/tests/content_test.py @@ -1,5 +1,7 @@ from datetime import datetime +import markdown + from russell.content import ( ContentManager, Post, @@ -20,7 +22,9 @@ def test_basic_parsing(): def test_code_block_parsing(): md = "# Hello world!\n\n```sh\nfoo\n```" post = Post.from_string(md) - assert '<pre><code class="language-sh">foo\n</code></pre>' in post.body + html_class = "language-sh" if markdown.__version_info__ >= (3, 3) else "sh" + expected = '<pre><code class="%s">foo\n</code></pre>' % html_class + assert expected in post.body def test_pubdate_parsing():
make test compatible with both versions of markdown
anlutro_russell
train
py
5384c1ce668597b660f1b43aea281a19e330ab56
diff --git a/lib/Pipe/Context.php b/lib/Pipe/Context.php index <HASH>..<HASH> 100644 --- a/lib/Pipe/Context.php +++ b/lib/Pipe/Context.php @@ -76,7 +76,6 @@ class Context $data = $processor->render($subContext); } - $this->requiredPaths = array_merge($this->requiredPaths, $subContext->requiredPaths); $this->dependencyPaths = array_merge($this->dependencyPaths, $subContext->dependencyPaths); $this->dependencyAssets = array_merge($this->dependencyAssets, $subContext->dependencyAssets); @@ -215,7 +214,7 @@ class Context { $context = new static($this->environment); $context->path = $this->path; - $context->requiredPaths = $this->requiredPaths; + $context->requiredPaths =& $this->requiredPaths; return $context; }
Fixed memory issue. Required paths get now passed as reference to sub contexts
CHH_pipe
train
php
c87ff49db6bda3c16a70113ca60b61a4621df433
diff --git a/ipywidgets/widgets/tests/test_interaction.py b/ipywidgets/widgets/tests/test_interaction.py index <HASH>..<HASH> 100644 --- a/ipywidgets/widgets/tests/test_interaction.py +++ b/ipywidgets/widgets/tests/test_interaction.py @@ -89,17 +89,6 @@ def test_single_value_string(): value=a, ) -def test_single_value_password_string(): - a = u'hello' - c = interactive(f, a=a) - w = c.children[0] - check_widget(w, - cls=widgets.Password, - description='a', - value=a, - ) - - def test_single_value_bool(): for a in (True, False): c = interactive(f, a=a)
Adding type=password support for Text in TextView class.
jupyter-widgets_ipywidgets
train
py
21c63279228549f8d03648cf1940e028c9972800
diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index <HASH>..<HASH> 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -1617,16 +1617,12 @@ module Sinatra if path.respond_to? :to_str keys = [] - # We append a / at the end if there was one. - # Reason: Splitting does not split off an empty - # string at the end if the split separator - # is at the end. - # - postfix = '/' if path =~ /\/\z/ - # Split the path into pieces in between forward slashes. + # A negative number is given as the second argument of path.split + # because with this number, the method does not ignore / at the end + # and appends an empty string at the end of the return value. # - segments = path.split('/').map! do |segment| + segments = path.split('/', -1).map! do |segment| ignore = [] # Special character handling. @@ -1667,7 +1663,7 @@ module Sinatra segments << segment end end - [/\A#{segments.join('/')}#{postfix}\z/, keys] + [/\A#{segments.join('/')}\z/, keys] elsif path.respond_to?(:keys) && path.respond_to?(:match) [path, path.keys] elsif path.respond_to?(:names) && path.respond_to?(:match)
refactor Base.compile: the handling of path separators at the end is simplified.
sinatra_sinatra
train
rb
47a6a32b27f7af24dec5dc963fa951177a091cd2
diff --git a/build/test/data/name.php b/build/test/data/name.php index <HASH>..<HASH> 100644 --- a/build/test/data/name.php +++ b/build/test/data/name.php @@ -18,5 +18,11 @@ if($name == 'foo') { echo "pan"; die(); } +$request = apache_request_headers(); +$request = $request['customHeader']; +if(strlen($request) > 0) { + echo $request; + die(); +} echo 'ERROR <script type="text/javascript">ok( true, "name.php executed" );</script>'; ?> \ No newline at end of file
Introduced before callback (#<I>) (updated test data)
jquery_jquery
train
php
2a978c2928c9f519d5d6066730bd905c1df1415b
diff --git a/tinman/data.py b/tinman/data.py index <HASH>..<HASH> 100644 --- a/tinman/data.py +++ b/tinman/data.py @@ -68,17 +68,16 @@ class DataLayer: logging.debug('Beginning session "%s"' % connection) connections[connection]['session'].begin() - def commit(self, connection_name=None): + def commit(self, all=False): global connections - if connection_name: - logging.debug('Committing connection "%s"' % connection_name) - connections[connection_name]['session'].commit() + if not all: + logging.debug('Committing active connection') + self.session.commit() else: for connection in connections: if connections[connection]['driver'] == 'SQLAlchemy': - if connections[connection]['session'].dirty: - logging.debug('Committing connection "%s"' % connection) - connections[connection]['session'].commit() + logging.debug('Committing connection "%s"' % connection) + connections[connection]['session'].commit() def create_all(self): global connections
Change commit() so it doesn't use a dirty check (delete doesn't cause dirty rows) and commit only the active session by default.
gmr_tinman
train
py
ecd329832403370998e91c760af8db79d937c2c9
diff --git a/growler/application.py b/growler/application.py index <HASH>..<HASH> 100644 --- a/growler/application.py +++ b/growler/application.py @@ -446,7 +446,8 @@ class Application: lines_ += [prefix + "├── %s %s %s" % info] if mw.is_subchain: lines_ += decend_into_tree(mw.func, level+1) - lines_[-1] = lines_[-1].replace('├', '└') + if level: + lines_[-1] = lines_[-1].replace('├', '└') return lines_ lines = [self.name]
Application: Minor change to print-middleware-tree: only "close" a tree branch for subtrees - the main trunk will have a ┴ char appended.
pyGrowler_Growler
train
py
c011061a4e105bcad7e101f3ebd0e6bfa2528164
diff --git a/django_mako_plus/static_files.py b/django_mako_plus/static_files.py index <HASH>..<HASH> 100644 --- a/django_mako_plus/static_files.py +++ b/django_mako_plus/static_files.py @@ -7,6 +7,18 @@ from .util import run_command, get_dmp_instance, log, DMP_OPTIONS import os, os.path, posixpath, subprocess + +if DMP_OPTIONS.get('MINIFY_JS_CSS', False) and not settings.DEBUG: + try: + from rjsmin import jsmin + except ImportError: + raise ImproperlyConfigured('MINIFY_JS_CSS = True in the Django Mako Plus settings, but the "rjsmin" package does not seem to be loaded.') + try: + from rcssmin import cssmin + except ImportError: + raise ImproperlyConfigured('MINIFY_JS_CSS = True in the Django Mako Plus settings, but the "rcssmin" package does not seem to be loaded.') + + # keys to attach TemplateInfo objects and static renderer to the Mako Template itself # I attach it to the template objects because they are already cached by mako, so # caching them again here would result in double-caching. It's a bit of a
somehow the rjsmin and rcssmin imports got taken out of static_files.py!
doconix_django-mako-plus
train
py
e16ade30f50860abe0ebcb8ce3c1a3f8b6d3a452
diff --git a/andes/models/synchronous.py b/andes/models/synchronous.py index <HASH>..<HASH> 100644 --- a/andes/models/synchronous.py +++ b/andes/models/synchronous.py @@ -35,6 +35,7 @@ class GENBaseData(ModelData): self.Sn = NumParam(default=100.0, info="Power rating", tex_name='S_n', + unit='MVA', ) self.Vn = NumParam(default=110.0, info="AC voltage rating",
Added unit MVA to GENBASE Sn
cuihantao_andes
train
py
e6913c606854fe043eb082ae761ad92912087a12
diff --git a/stagpy/stagyyparsers.py b/stagpy/stagyyparsers.py index <HASH>..<HASH> 100644 --- a/stagpy/stagyyparsers.py +++ b/stagpy/stagyyparsers.py @@ -532,7 +532,7 @@ def _get_field(xdmf_file, data_item): """Extract field from data item.""" shp = _get_dim(data_item) h5file, group = data_item.text.strip().split(':/', 1) - icore = int(group.split('_')[1]) - 1 + icore = int(group.split('_')[-2]) - 1 fld = _read_group_h5(xdmf_file.parent / h5file, group).reshape(shp) return icore, fld
Fix icore recovery of H5 field file
StagPython_StagPy
train
py
05a863b71c4ea43f3af8156f0fe1045c7229e438
diff --git a/lib/sup/message.rb b/lib/sup/message.rb index <HASH>..<HASH> 100644 --- a/lib/sup/message.rb +++ b/lib/sup/message.rb @@ -459,8 +459,21 @@ private chunks elsif m.header.content_type && m.header.content_type.downcase == "message/rfc822" + encoding = m.header["Content-Transfer-Encoding"] if m.body - payload = RMail::Parser.read(m.body) + body = + case encoding + when "base64" + m.body.unpack("m")[0] + when "quoted-printable" + m.body.unpack("M")[0] + when "7bit", "8bit", nil + m.body + else + raise EncodingUnsupportedError, encoding.inspect + end + body = body.normalize_whitespace + payload = RMail::Parser.read(body) from = payload.header.from.first ? payload.header.from.first.format : "" to = payload.header.to.map { |p| p.format }.join(", ") cc = payload.header.cc.map { |p| p.format }.join(", ")
Decode messages according to their Content-Transfer-Encoding This is necessary for MIME-messages (for example as part of multipart/signed) which are encoded in base<I>.
sup-heliotrope_sup
train
rb
99f86e6e13ff1d04d3787667a7d7a89746187fcd
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -6,12 +6,6 @@ const mocha = require("gulp-mocha"); const eslint = require("gulp-eslint"); const runSequence = require("run-sequence"); -gulp.task("cover", () => { - return gulp.src(["src/**/*.js"]) - .pipe(istanbul()) - .pipe(istanbul.hookRequire()); -}); - gulp.task("eslint", () => { return gulp.src(["src/**/*.js", "test/**/*.test.js"]) .pipe(eslint()) @@ -39,7 +33,7 @@ gulp.task("mocha", ["cover"], callback => { }); gulp.task("test", callback => { - runSequence("cover", "mocha", "eslint", callback); + runSequence("mocha", "eslint", callback); }); gulp.task("watch", () => {
removed cover task from gulp build
owejs_owe
train
js
91bf92d895d3c17e53130e93a9a472be1803d415
diff --git a/src/Form/Field/MultipleFile.php b/src/Form/Field/MultipleFile.php index <HASH>..<HASH> 100644 --- a/src/Form/Field/MultipleFile.php +++ b/src/Form/Field/MultipleFile.php @@ -344,7 +344,5 @@ EOT; unset($files[$key]); return $files; - - return array_values($files); } }
Fix mutiple-file upload issue.
z-song_laravel-admin
train
php
f19c9648e94b95c3e4ba7d8c535a29bd1ea61e0b
diff --git a/src/LaraPress/Menus/MenuBuilder.php b/src/LaraPress/Menus/MenuBuilder.php index <HASH>..<HASH> 100644 --- a/src/LaraPress/Menus/MenuBuilder.php +++ b/src/LaraPress/Menus/MenuBuilder.php @@ -8,6 +8,10 @@ class MenuBuilder protected $menuItems; protected $activePostId = false; + /** + * @param $menuId + * @return MenuItem[] + */ public function find($menuId) { if (app()->isShared('post')) { @@ -31,7 +35,7 @@ class MenuBuilder protected function getTopLevelMenuItems() { return array_where($this->menuItems, function ($menuItem) { - return ! $menuItem->menu_item_parent; + return !$menuItem->menu_item_parent; }); } @@ -46,7 +50,7 @@ class MenuBuilder { $menuLocations = get_nav_menu_locations(); - if ( ! array_has($menuLocations, $menuId)) { + if (!array_has($menuLocations, $menuId)) { return []; // id must be registered and then assigned a menu in WordPress. }
Add docblock for menu builder
lara-press_framework
train
php