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
4764e7ad64b673cfc9f3ebe50a66b878d6f5e829
diff --git a/Query/Builder.php b/Query/Builder.php index <HASH>..<HASH> 100755 --- a/Query/Builder.php +++ b/Query/Builder.php @@ -2826,8 +2826,8 @@ class Builder */ public function aggregate($function, $columns = ['*']) { - $results = $this->cloneWithout($this->unions ? [] : ['columns']) - ->cloneWithoutBindings($this->unions ? [] : ['select']) + $results = $this->cloneWithout($this->unions || $this->havings ? [] : ['columns']) + ->cloneWithoutBindings($this->unions || $this->havings ? [] : ['select']) ->setAggregate($function, $columns) ->get($columns); diff --git a/Query/Grammars/Grammar.php b/Query/Grammars/Grammar.php index <HASH>..<HASH> 100755 --- a/Query/Grammars/Grammar.php +++ b/Query/Grammars/Grammar.php @@ -45,7 +45,7 @@ class Grammar extends BaseGrammar */ public function compileSelect(Builder $query) { - if ($query->unions && $query->aggregate) { + if (($query->unions || $query->havings) && $query->aggregate) { return $this->compileUnionAggregate($query); }
fix #<I> (aggregates with having) (#<I>)
illuminate_database
train
php,php
e019fb4c887fa95a678bd4b7dc9b915a062f7114
diff --git a/pyghmi/ipmi/events.py b/pyghmi/ipmi/events.py index <HASH>..<HASH> 100644 --- a/pyghmi/ipmi/events.py +++ b/pyghmi/ipmi/events.py @@ -454,8 +454,10 @@ class EventHandler(object): # is wholly left up to the OEM layer, using the OEM ID of the BMC event['oemdata'] = selentry[3:] self._ipmicmd._oem.process_event(event) - del event['event_type_byte'] - del event['event_data_bytes'] + if 'event_type_byte' in event: + del event['event_type_byte'] + if 'event_data_bytes' in event: + del event['event_data_bytes'] return event def _fetch_entries(self, ipmicmd, startat, targetlist, rsvid=0):
Only conditionally delete fields from event If some events (for example, OEM events) are encountered, the deleted fields won't exist in the first place. Avoid KeyErrors by checking before deleting. Change-Id: I<I>ca<I>f<I>c7b<I>e<I>c8ce1ea<I>e0d<I>
openstack_pyghmi
train
py
74ae0d4b2f7a3e0ce9d6fa7434b4da2b4dd99230
diff --git a/src/BuiltinServerFactory.php b/src/BuiltinServerFactory.php index <HASH>..<HASH> 100644 --- a/src/BuiltinServerFactory.php +++ b/src/BuiltinServerFactory.php @@ -47,7 +47,7 @@ class BuiltinServerFactory $timer->promise(), ])->then(null, function () use ($process) { $process->terminate(); - return new RejectedPromise(); + return new RejectedPromise; }); }
Removed parenthesis of the constructor that takes no arguments
mpyw_php-hyper-builtin-server
train
php
940170f882c6fb8c2704dd825cf5a6d217c8118f
diff --git a/provision/juju/provisioner_test.go b/provision/juju/provisioner_test.go index <HASH>..<HASH> 100644 --- a/provision/juju/provisioner_test.go +++ b/provision/juju/provisioner_test.go @@ -797,7 +797,7 @@ func (s *ELBSuite) TestCollectStatusWithELBAndIDChange(c *C) { c.Assert(instances, HasLen, 2) c.Assert(instances[0].InstanceId, Equals, id2) c.Assert(instances[1].InstanceId, Equals, id1) - msg, err := getQueue(app.QueueName).Get(1e6) + msg, err := getQueue(app.QueueName).Get(1e9) c.Assert(err, IsNil) c.Assert(msg.Args, DeepEquals, []string{"symfonia", "symfonia/0"}) msg.Delete()
provision/juju: another timeout increase Sometimes it fails with -race.
tsuru_tsuru
train
go
909778e8ad6a79ee8940ddb213ec95b8adae938d
diff --git a/lxd/networks.go b/lxd/networks.go index <HASH>..<HASH> 100644 --- a/lxd/networks.go +++ b/lxd/networks.go @@ -319,6 +319,26 @@ func networksPost(d *Daemon, r *http.Request) response.Response { return resp } +// networkPartiallyCreated returns true of supplied network has properties that indicate it has had previous +// create attempts run on it but failed on one or more nodes. +func networkPartiallyCreated(netInfo *api.Network) bool { + // If the network status is NetworkStatusErrored, this means create has been run in the past and has + // failed on one or more nodes. Hence it is partially created. + if netInfo.Status == api.NetworkStatusErrored { + return true + } + + // If the network has global config keys, then it has previously been created by having its global config + // inserted, and this means it is partialled created. + for key := range netInfo.Config { + if !shared.StringInSlice(key, db.NodeSpecificNetworkConfig) { + return true + } + } + + return false +} + // networksPostCluster checks that there is a pending network in the database and then attempts to setup the // network on each node. If all nodes are successfully setup then the network's state is set to created. func networksPostCluster(d *Daemon, projectName string, req api.NetworksPost, clientType request.ClientType, netType network.Type) error {
lxd/networks: Adds networkPartiallyCreated helper function
lxc_lxd
train
go
1b996eefbfe8d40cd60582a718dabf69af0cec0d
diff --git a/spec/knapsack_pro/queue_allocator_spec.rb b/spec/knapsack_pro/queue_allocator_spec.rb index <HASH>..<HASH> 100644 --- a/spec/knapsack_pro/queue_allocator_spec.rb +++ b/spec/knapsack_pro/queue_allocator_spec.rb @@ -210,7 +210,6 @@ describe KnapsackPro::QueueAllocator do context 'when 2nd response has no errors' do let(:response2_errors?) { false } - let(:response2_success?) { true } context 'when 2nd response returns test files (successful attempt to connect to queue already existing on the API side)' do let(:test_files) do
Update queue_allocator_spec.rb
KnapsackPro_knapsack_pro-ruby
train
rb
371ebb788ac776ba929bbabe0cba050cc017d9bd
diff --git a/lark/parsers/earley_forest.py b/lark/parsers/earley_forest.py index <HASH>..<HASH> 100644 --- a/lark/parsers/earley_forest.py +++ b/lark/parsers/earley_forest.py @@ -770,7 +770,7 @@ class ForestToPyDotVisitor(ForestVisitor): graph_node = self.graph.get_node(graph_node_id)[0] for child in [node.left, node.right]: if child is not None: - child_graph_node_id = str(id(child)) + child_graph_node_id = str(id(child.token if isinstance(child, TokenNode) else child)) child_graph_node = self.graph.get_node(child_graph_node_id)[0] self.graph.add_edge(self.pydot.Edge(graph_node, child_graph_node)) else:
Fix ForestToPyDotVisitor (Issue #<I>)
lark-parser_lark
train
py
8f9d039948788546fa48522d505df35bb1e510a5
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -144,7 +144,7 @@ //. //. ### Variadic functions //. -//. Ramda provides several functions with take any number of arguments. These +//. Ramda provides several functions which take any number of arguments. These //. are known as [variadic functions][]. Additionally, Ramda provides several //. functions which take variadic functions as arguments. Although natural in //. a dynamically typed language, variadic functions are at odds with the type
fix(typo): `with` should be `which`
sanctuary-js_sanctuary
train
js
ba2bd10a21bcae1ca4ac36128c7130d9d8c64076
diff --git a/lib/createLiveStyleApp.js b/lib/createLiveStyleApp.js index <HASH>..<HASH> 100644 --- a/lib/createLiveStyleApp.js +++ b/lib/createLiveStyleApp.js @@ -63,7 +63,7 @@ module.exports = function createLiveStyleApp(options) { if (options.compilesass) { app.use(compilesass({ root: options.root, - logToConsole: true + logToConsole: options.debug })); }
Join livestyle logging and sass compile logging into the same flag
One-com_livestyle
train
js
8b1f3d581d8833495cb8b70d9f1d2bcdbddc0ef2
diff --git a/lib/rollbar/request_data_extractor.rb b/lib/rollbar/request_data_extractor.rb index <HASH>..<HASH> 100644 --- a/lib/rollbar/request_data_extractor.rb +++ b/lib/rollbar/request_data_extractor.rb @@ -91,11 +91,11 @@ module Rollbar def rollbar_filtered_params(sensitive_params, params) params.inject({}) do |result, (key, value)| - if key.to_sym.in?(sensitive_params) + if sensitive_params.include?(key.to_sym) result[key] = '*' * (value.length rescue 8) elsif value.is_a?(Hash) result[key] = rollbar_filtered_params(sensitive_params, value) - elsif value.class.name.in?(ATTACHMENT_CLASSES) + elsif ATTACHMENT_CLASSES.include?(value.class.name) result[key] = { :content_type => value.content_type, :original_filename => value.original_filename,
Fix params filtering Neither Symbol nor String in Ruby has `#in?` method. So this filtering raises another exception instead of sending it:     Exception while reporting exception to Rollbar:     undefined method `in?' for :session_id:Symbol This patch fixes expressions to by Rubista not Pythonista :D
rollbar_rollbar-gem
train
rb
242159b78c09755d228fce3f541c1d18fc656322
diff --git a/custodian/vasp/handlers.py b/custodian/vasp/handlers.py index <HASH>..<HASH> 100644 --- a/custodian/vasp/handlers.py +++ b/custodian/vasp/handlers.py @@ -96,17 +96,17 @@ class VaspErrorHandler(ErrorHandler, MSONable): if "NBANDS" in vi["INCAR"]: nbands = int(vi["INCAR"]["NBANDS"]) else: - with open("OUTCAR", "r") as f: + with open("OUTCAR") as f: for line in f: if "NBANDS" in line: try: d = line.split("=") nbands = int(d[-1].strip()) break - except: + except (IndexError, ValueError): pass actions.append({"dict": "INCAR", - "action": {"_set": {"NBANDS": int(1.2 * nbands)}}}) + "action": {"_set": {"NBANDS": int(1.1 * nbands)}}}) if "triple_product" in self.errors: s = vi["POSCAR"].structure
Decrease NBANDS increment to <I>%.
materialsproject_custodian
train
py
1425765e7fd816df2d34f98a71cbebad92c5f350
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -34,7 +34,7 @@ function parse(base, key, value) { var obj = copy(value); - if (key === '') seal(base || obj.href, obj, []); + if (key === '' || obj.href) seal(base || obj.href, obj, []); return obj; } @@ -75,7 +75,7 @@ function copy(value) { } function seal(base, value, path, shouldDefineHref) { - if (!value || typeof value !== 'object') return; + if (!value || typeof value !== 'object' || Object.isFrozen(value)) return; var isCollection; for (var k in value) {
seal objects with hrefs
hypergroup_hyper-json-immutable-parse
train
js
0f2987645343a9f75dd411b3bc7451fa0ed6a5e6
diff --git a/src/main/java/org/sakaiproject/nakamura/lite/content/InternalContent.java b/src/main/java/org/sakaiproject/nakamura/lite/content/InternalContent.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/sakaiproject/nakamura/lite/content/InternalContent.java +++ b/src/main/java/org/sakaiproject/nakamura/lite/content/InternalContent.java @@ -138,6 +138,12 @@ public class InternalContent { * Mime type */ public static final String MIMETYPE = "mimeType"; + + /** + * Charset encoding if char based. + */ + public static final String ENCODING = "encoding"; + private Map<String, Object> structure;
Added Encoding field to content.
ieb_sparsemapcontent
train
java
01e38ed4cadd2558a9386cbf6106127c28702d00
diff --git a/src/js/ripple/crypt.js b/src/js/ripple/crypt.js index <HASH>..<HASH> 100644 --- a/src/js/ripple/crypt.js +++ b/src/js/ripple/crypt.js @@ -361,11 +361,19 @@ Crypt.getStringToSign = function(config, parsed, date, mechanism) { // Sort the properties of the JSON object into canonical form var canonicalData = JSON.stringify(copyObjectWithSortedKeys(config.data)); + // We're using URL parsing using browser functionality. Unfortunately the + // parsing result slightly differs in IE - it is missing a leading slash. + // XXX Proper fix would be to use a pure JS URL parser. + var pathname = parsed.pathname; + + // IE11 Workaround + if (pathname[0] !== '/') pathname = '/' + pathname; + // Canonical request using Amazon's v4 signature format // See: http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html var canonicalRequest = [ config.method || 'GET', - parsed.pathname || '', + pathname || '', parsed.search || '', // XXX Headers signing not supported '',
[BUG] merge IE<I> signature fix
ChainSQL_chainsql-lib
train
js
33fff408f6dd1ca44cf2525dfbec9a786dab8d36
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -126,6 +126,15 @@ export default class StepWizard extends PureComponent { // Update hash if prop set if (this.props.isHashEnabled) this.updateHash(this.state.activeStep); } + + /** Getters */ + get currentStep = () => { + return this.state.activeStep + 1; + } + + get totalSteps = () => { + return this.props.children.filter(el => el).length; + } /** Go to first step */ firstStep = () => this.goToStep(1) @@ -154,8 +163,8 @@ export default class StepWizard extends PureComponent { /** Render */ render() { const props = { - currentStep: this.state.activeStep + 1, - totalSteps: this.props.children.filter(el => el).length, + currentStep: this.currentStep, + totalSteps: this.totalSteps, /** Functions */ nextStep: this.nextStep, previousStep: this.previousStep,
Define currentStep and totalSteps as getters So that they can be used by the SW returned from instance
jcmcneal_react-step-wizard
train
js
a7c9328341121d8e62baf249ae61bd61f471d69e
diff --git a/src/tree/builder/TreeAdapter.js b/src/tree/builder/TreeAdapter.js index <HASH>..<HASH> 100644 --- a/src/tree/builder/TreeAdapter.js +++ b/src/tree/builder/TreeAdapter.js @@ -194,7 +194,7 @@ class TreeAdapter { the most recent ancestor which is either a heading or paragraph. */ const ancestor = TreeAdapter._findAncestor( formattingElement, TreeAdapter._isLeafNode ); - if ( ancestor && TreeAdapter._isLeafNode( ancestor ) ) { + if ( ancestor ) { // Add formatting element as formatting to the found paragraph or heading ancestor. formattingElement.parent = parent; ancestor.textContainer.formatting.push( formattingElement );
_appendFormattingElement now only checks if found ancestor is not null.
Yoast_YoastSEO.js
train
js
b4c3c6f20a9dcd30705143cf364fba784dce574f
diff --git a/ghost/admin/routes/application.js b/ghost/admin/routes/application.js index <HASH>..<HASH> 100644 --- a/ghost/admin/routes/application.js +++ b/ghost/admin/routes/application.js @@ -2,6 +2,12 @@ import ShortcutsRoute from 'ghost/mixins/shortcuts-route'; var ApplicationRoute = Ember.Route.extend(SimpleAuth.ApplicationRouteMixin, ShortcutsRoute, { + afterModel: function (model, transition) { + if (this.get('session').isAuthenticated) { + transition.send('loadServerNotifications'); + } + }, + shortcuts: { 'esc': 'closePopups' },
Check for server notifications on hard refresh Closes #<I> - Trigger the loadServerNotifications event from the ApplicationRoute's afterModel hook, which gets called every time the app gets loaded.
TryGhost_Ghost
train
js
9a9b533f2177b16d1f3fbc0b7122253c9c53e73f
diff --git a/test/utils/grunt.js b/test/utils/grunt.js index <HASH>..<HASH> 100644 --- a/test/utils/grunt.js +++ b/test/utils/grunt.js @@ -17,7 +17,7 @@ exports.runTask = function (task) { that.stderr = stderr; // Callback - done(); + done(err); }); });
If a Grunt task fails during a unit test, fail the test
twolfson_grunt-zip
train
js
84e0787665cceda1c3c33f431a1f871e8fbab3d2
diff --git a/uri/part/path.py b/uri/part/path.py index <HASH>..<HASH> 100644 --- a/uri/part/path.py +++ b/uri/part/path.py @@ -26,6 +26,9 @@ class PathPart(ProxyPart): value = str(value) obj._trailing = value.endswith('/') + if obj.authority and not value.startswith('/'): + raise ValueError("Can only assign rooted paths to URI with authority.") + super(PathPart, self).__set__(obj, value) def render(self, obj, value):
Restrict rootless path assignment if authority is present.
marrow_uri
train
py
4c1a16eed1b33ec6b0f80f290574ba07b4d6725c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -25,13 +25,14 @@ install_requires = [ setup( name='Firenado', - version=".".join(map(str,firenado.__version__)), - description='Componentized web framework based on Tornado.', + version='.'.join(map(str,firenado.__version__)), + description='Firenado is a python web framework based on ' + 'Tornado web framework/server.', license='Apache License V2.0', author='Flavio Garcia', author_email='[email protected]', install_requires=install_requires, - url='http://www.firenado.io/', + url='https://github.com/candango/firenado', packages=[ 'firenado', 'firenado.components',
Fixed setup.py for <I>.
candango_firenado
train
py
78ce0b4047f1d7fcf1e8a00da93642f1b1620bf2
diff --git a/CHANGELOG b/CHANGELOG index <HASH>..<HASH> 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [4.3.1] - 2021-01-08 +### Changed +* Remove mustache from our list of supported template engines + ## [4.3.0] - 2020-10-14 ### Changed * Replaced easyjson with json-iterator when marshalling events diff --git a/template.go b/template.go index <HASH>..<HASH> 100644 --- a/template.go +++ b/template.go @@ -10,7 +10,6 @@ type TemplateEngine string // Used by CreateTemplate() and AddTemplateVersion() to specify the template engine const ( - TemplateEngineMustache = TemplateEngine("mustache") TemplateEngineHandlebars = TemplateEngine("handlebars") TemplateEngineGo = TemplateEngine("go") ) diff --git a/version.go b/version.go index <HASH>..<HASH> 100644 --- a/version.go +++ b/version.go @@ -1,4 +1,4 @@ package mailgun // Version of current release -const Version = "4.2.0" +const Version = "4.3.1"
Remove mustache from our list of supported template engines
mailgun_mailgun-go
train
CHANGELOG,go,go
48816d9f2e0d8004717b86b2a02852b22ab5198e
diff --git a/system/src/Grav/Common/GPM/GPM.php b/system/src/Grav/Common/GPM/GPM.php index <HASH>..<HASH> 100644 --- a/system/src/Grav/Common/GPM/GPM.php +++ b/system/src/Grav/Common/GPM/GPM.php @@ -251,7 +251,7 @@ class GPM extends Iterator $repository[$slug]->version = $local_version; $repository[$slug]->name = $repository[$slug]->name; $repository[$slug]->type = $repository[$slug]->release_type; - $items[$slug] = $repository[$slug]; + $items[$slug] = $repository[$slug]->toArray(); } } @@ -330,7 +330,7 @@ class GPM extends Iterator $repository[$slug]->available = $remote_version; $repository[$slug]->version = $local_version; $repository[$slug]->type = $repository[$slug]->release_type; - $items[$slug] = $repository[$slug]; + $items[$slug] = $repository[$slug]->toArray(); } }
Fix issue with vUndefined in GPM
getgrav_grav
train
php
abbcf15bb2b0d06829dfff4bfc97ac5892365af7
diff --git a/cluster/service.go b/cluster/service.go index <HASH>..<HASH> 100644 --- a/cluster/service.go +++ b/cluster/service.go @@ -95,7 +95,7 @@ func (s *Service) Close() error { // Shut down all handlers. close(s.closing) - s.wg.Wait() + // s.wg.Wait() // FIXME(benbjohnson) return nil } diff --git a/cmd/influxd/run/server.go b/cmd/influxd/run/server.go index <HASH>..<HASH> 100644 --- a/cmd/influxd/run/server.go +++ b/cmd/influxd/run/server.go @@ -179,6 +179,7 @@ func (s *Server) Open() error { mux := tcp.NewMux() s.MetaStore.RaftListener = mux.Listen(meta.MuxRaftHeader) s.MetaStore.ExecListener = mux.Listen(meta.MuxExecHeader) + s.Services[0].(*cluster.Service).Listener = mux.Listen(cluster.MuxHeader) // Open meta store. if err := s.MetaStore.Open(); err != nil {
integrate mux into influxd cluster service
influxdata_influxdb
train
go,go
e7b71f30817643c23bab5749151a9dee795beb65
diff --git a/src/main/java/ixa/kaflib/KAFDocument.java b/src/main/java/ixa/kaflib/KAFDocument.java index <HASH>..<HASH> 100644 --- a/src/main/java/ixa/kaflib/KAFDocument.java +++ b/src/main/java/ixa/kaflib/KAFDocument.java @@ -149,7 +149,21 @@ public class KAFDocument { return lp; } - /** Returns a list of linguistic processors from the document */ + public void addLinguisticProcessors(HashMap<String, List<LinguisticProcessor>> lps) { + for (Map.Entry<String, List<LinguisticProcessor>> entry : lps.entrySet()) { + List<LinguisticProcessor> layerLps = entry.getValue(); + for (LinguisticProcessor lp : layerLps) { + this.addLinguisticProcessor(entry.getKey(), + lp.name, + lp.timestamp, + lp.version); + } + } + } + + /** Returns a hash of linguistic processors from the document. + * Hash: layer => LP + */ public HashMap<String, List<LinguisticProcessor>> getLinguisticProcessors() { return lps; }
addLinguisticProcessors() added. Using the combination of it and getLinguisticProcessors() methods, it's quite straightforward to copy LPs from one document to another.
ixa-ehu_kaflib
train
java
fad031066a3f78f818b3899b5f0c199f44b5a0bc
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,3 +1,5 @@ +// We use Grunt to build our dist files +// commands are run by the makefile var Promise = require('es6-promise').Promise; global.window = {
added some commenting to the Gruntfile
buzzfeed_solid
train
js
1442f11a5827915abb364bf02a40eaa1cfd3b33f
diff --git a/lib/parser.js b/lib/parser.js index <HASH>..<HASH> 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -50,7 +50,11 @@ var Parser = function (options) { objectMode: !self.options.passThru }) - self._buffer = Buffer.allocUnsafe(0) + self.bufferAllocUnsafe = + (typeof(Buffer.allocUnsafe) === "function") ? + Buffer.allocUnsafe : function(x) { return new Buffer(x) } + + self._buffer = self.bufferAllocUnsafe(0) var feed_progress = (self.options.passThru) ? function(a, b, c) { @@ -140,7 +144,7 @@ Parser.prototype._flush = function (done) { // don't bother sending partial packets to the TS Parser- they'll just get dropped if ((self.options.passThru) && (self._buffer.length > 0)) { self.push(self._buffer) - self._buffer = Buffer.allocUnsafe(0) + self._buffer = self.bufferAllocUnsafe(0) } done() }
lib/parser: check that `Buffer.allocUnsafe` is actually available
mkrufky_node-dvbtee
train
js
cd32f4a04356b41506b652dc8286b0c6cdd821d8
diff --git a/moneywagon/__init__.py b/moneywagon/__init__.py index <HASH>..<HASH> 100644 --- a/moneywagon/__init__.py +++ b/moneywagon/__init__.py @@ -417,11 +417,13 @@ def guess_currency_from_address(address): fixer = lambda x: x # does nothing first_byte = fixer(b58decode_check(address)[0]) + double_first_byte = fixer(b58decode_check(address)[:2]) + hits = [] for currency, data in crypto_data.items(): if hasattr(data, 'get'): # skip incomplete data listings version = data.get('address_version_byte', None) - if version is not None and first_byte == version: + if version is not None and version in [double_first_byte, first_byte]: hits.append([currency, data['name']]) if hits:
allow guess currency code to match currencies that have two version bytes
priestc_moneywagon
train
py
465dada11d8c229786ba967538cd5136dcb367a6
diff --git a/src/GraphQL.php b/src/GraphQL.php index <HASH>..<HASH> 100644 --- a/src/GraphQL.php +++ b/src/GraphQL.php @@ -193,7 +193,7 @@ class GraphQL */ protected function shouldCacheAST() { - return app()->environment('production') && config('cache.enable'); + return app()->environment('production') && config('lighthouse.cache.enable'); } /**
Fix bug preventing the AST from ever being cached
nuwave_lighthouse
train
php
dbc0ce06317382ea83acbdaed4aea5c01cc91433
diff --git a/fireplace/cards/classic/shaman.py b/fireplace/cards/classic/shaman.py index <HASH>..<HASH> 100644 --- a/fireplace/cards/classic/shaman.py +++ b/fireplace/cards/classic/shaman.py @@ -8,16 +8,6 @@ class CS2_042: action = damageTarget(3) -# Dust Devil -class EX1_243: - Recall = 2 - - -# Earth Elemental -class EX1_250: - Recall = 3 - - # Unbound Elemental class EX1_258: def OWN_CARD_PLAYED(self, card): @@ -112,7 +102,6 @@ class EX1_238: # Lava Burst class EX1_241: - Recall = 2 action = damageTarget(5) @@ -134,7 +123,6 @@ class EX1_246: # Feral Spirit class EX1_248: - Recall = 2 def action(self): self.controller.summon("EX1_tk11") self.controller.summon("EX1_tk11") @@ -142,7 +130,6 @@ class EX1_248: # Forked Lightning class EX1_251: - Recall = 2 def action(self): targets = random.sample(self.controller.opponent.field, 2) for target in targets: @@ -158,15 +145,6 @@ class EX1_245: # Lightning Storm class EX1_259: - Recall = 2 def action(self): for target in self.controller.opponent.field: self.hit(target, random.choice((2, 3))) - - -## -# Weapons - -# Doomhammer -class EX1_567: - Recall = 2
Use Recall from enhanced CardXML database Previously, Recall was stored as a boolean
jleclanche_fireplace
train
py
0ffed9132385b123546ed4cf26b3f887719229ff
diff --git a/storage/api.js b/storage/api.js index <HASH>..<HASH> 100644 --- a/storage/api.js +++ b/storage/api.js @@ -53,6 +53,9 @@ class SubStorage { set(key, value) { return this._storage.set(this._path + '/' + key, values.toJSON('mixed', value)); } + + sub(key) { + return new SubStorage(this._storage, this._path + '/' + key); } inspect() {
Add ability to create custom substorages
tinkerhub_abstract-things
train
js
9950f63e8cc1bdb764b47f299d034adc4a6d1554
diff --git a/python/ray/worker.py b/python/ray/worker.py index <HASH>..<HASH> 100644 --- a/python/ray/worker.py +++ b/python/ray/worker.py @@ -901,7 +901,7 @@ class Worker(object): if not self.actor_id.is_nil() and function_name == "__init__": self.mark_actor_init_failed(error) # Send signal with the error. - ray_signal.send(ray_signal.ErrorSignal(error)) + ray_signal.send(ray_signal.ErrorSignal(str(failure_object))) def _wait_for_and_process_task(self, task): """Wait for a task to be ready and process the task.
Send task error instead of raw exception for signal (#<I>)
ray-project_ray
train
py
3709d5694cb9727ff934b10a99eff14bca7e10bf
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -14,7 +14,7 @@ nconf module.exports = function(grunt) { - // Temporary fix for a bug in a dependency + // Temporary fix for a bug in grunt-pg grunt.utils = grunt.util; @@ -34,6 +34,7 @@ module.exports = function(grunt) { /* Database Migrations */ migrate: { options: { + migrationsDir: 'db/migrations', // Temporary fix for bug in grunt-db-migrate dir: 'db/migrations', env: { DATABASE_URL: nconf.get('DATABASE_URL')
[FIX] Added temp fix for bug in dependency grunt-db-migrate
ripple_ripple-rest
train
js
71483fd154c241b771f4a0b97335e602a39ad3fb
diff --git a/bcbio/broad/__init__.py b/bcbio/broad/__init__.py index <HASH>..<HASH> 100644 --- a/bcbio/broad/__init__.py +++ b/bcbio/broad/__init__.py @@ -50,7 +50,8 @@ class BroadRunner: subprocess.check_call(cl) def run_gatk(self, params, tmp_dir=None): - support_nt = set(["UnifiedGenotyper", "CountCovariates", "VariantEval"]) + #support_nt = set(["UnifiedGenotyper", "VariantEval"]) + support_nt = set() support_nct = set(["BaseRecalibrator"]) gatk_jar = self._get_jar("GenomeAnalysisTK", ["GenomeAnalysisTKLite"]) local_args = []
Avoid parallelizing UnifiedGenotyper, which parallelizes by splitting across chromosomes
bcbio_bcbio-nextgen
train
py
fa3ecc7d1ff0426c6c2e190b6f830427f78efca2
diff --git a/code/src/main/com/lmax/disruptor/dsl/EventProcessorRepository.java b/code/src/main/com/lmax/disruptor/dsl/EventProcessorRepository.java index <HASH>..<HASH> 100644 --- a/code/src/main/com/lmax/disruptor/dsl/EventProcessorRepository.java +++ b/code/src/main/com/lmax/disruptor/dsl/EventProcessorRepository.java @@ -44,7 +44,7 @@ class EventProcessorRepository<T> implements Iterable<EventProcessorInfo<T>> public EventProcessor[] getLastEventProcessorsInChain() { List<EventProcessor> lastEventProcessors = new ArrayList<EventProcessor>(); - for (EventProcessorInfo<T> eventProcessorInfo : eventProcessorInfoByHandler.values()) + for (EventProcessorInfo<T> eventProcessorInfo : eventProcessorInfoByEventProcessor.values()) { if (eventProcessorInfo.isEndOfChain()) {
Ensure custom event processors are included in gating sequences.
LMAX-Exchange_disruptor
train
java
acf09aa391b2b570a8002ddc08fabe297b5588b1
diff --git a/centinel/__init__.py b/centinel/__init__.py index <HASH>..<HASH> 100644 --- a/centinel/__init__.py +++ b/centinel/__init__.py @@ -1,6 +1,6 @@ #!/usr/bin/python __title__ = 'centinel' -__version__ = '0.1.5.6.1' +__version__ = '0.1.5.6.2' import centinel.backend import centinel.client diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ online information controls, and Internet censorship.""" setup( name="centinel", - version="0.1.5.6.1", + version="0.1.5.6.2", author="ICLab Developers", author_email="[email protected]", description=DESCRIPTION,
bumped to version <I>
iclab_centinel
train
py,py
a4a84ee1841854a6e325fca61e1fed099a11d2fe
diff --git a/user_management/tests/run.py b/user_management/tests/run.py index <HASH>..<HASH> 100755 --- a/user_management/tests/run.py +++ b/user_management/tests/run.py @@ -55,6 +55,12 @@ settings.configure( SENTRY_CLIENT='user_management.utils.sentry.SensitiveDjangoClient', USE_TZ=True, MIGRATION_MODULES=MIGRATION_MODULES, + TEMPLATES=[ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'APP_DIRS': True, + }, + ] )
Added Templates to settings as Django<I> complains otherwise
incuna_django-user-management
train
py
f59f8aa272ea82d16fa4179e146925f5082cbd06
diff --git a/src/tkj/Economics/Order/Order.php b/src/tkj/Economics/Order/Order.php index <HASH>..<HASH> 100644 --- a/src/tkj/Economics/Order/Order.php +++ b/src/tkj/Economics/Order/Order.php @@ -170,7 +170,7 @@ class Order { { $handle = $this->getHandle($no); - $request = array('orderHandle'=>$handel); + $request = array('orderHandle'=>$handle); if( $vat ) {
[BUGFIX] Using wrong variable name
tkjaergaard_Economic-PHP-SDK
train
php
23b014034af5f91b8b26a590bb2f7718c7cc631e
diff --git a/src/Connection/Connector.php b/src/Connection/Connector.php index <HASH>..<HASH> 100644 --- a/src/Connection/Connector.php +++ b/src/Connection/Connector.php @@ -179,7 +179,11 @@ class Connector implements ConnectorInterface protected function loadToken() { if ($this->config['api_token'] && $this->config['api_token_type'] === 'access') { - return new AccessToken(['access_token' => $this->config['api_token']]); + return new AccessToken([ + 'access_token' => $this->config['api_token'], + // Skip local expiry checking. + 'expires' => 2147483647, + ]); } if (!$this->session->get($this->storageKeys['access_token'])) { return null;
Work around missing token expiry for old-style access tokens
platformsh_platformsh-client-php
train
php
2520e535a0b4ccfa712de37139089b7a2ca54fa0
diff --git a/pkg/s3select/csv/reader.go b/pkg/s3select/csv/reader.go index <HASH>..<HASH> 100644 --- a/pkg/s3select/csv/reader.go +++ b/pkg/s3select/csv/reader.go @@ -138,6 +138,12 @@ func NewReader(readCloser io.ReadCloser, args *ReaderArgs) (*Reader, error) { csvReader.Comma = []rune(args.FieldDelimiter)[0] csvReader.Comment = []rune(args.CommentCharacter)[0] csvReader.FieldsPerRecord = -1 + // If LazyQuotes is true, a quote may appear in an unquoted field and a + // non-doubled quote may appear in a quoted field. + csvReader.LazyQuotes = true + // If TrimLeadingSpace is true, leading white space in a field is ignored. + // This is done even if the field delimiter, Comma, is white space. + csvReader.TrimLeadingSpace = true r := &Reader{ args: args,
Allow lazyQuotes for certain types of CSV (#<I>) Set lazyQuotes to true, to allow a quote to appear in an unquote field and a non-doubled quote may appear in a quoted field.
minio_minio
train
go
dce240d5a9a7100b83eca7eba5d1762c537ee758
diff --git a/security_groups.go b/security_groups.go index <HASH>..<HASH> 100644 --- a/security_groups.go +++ b/security_groups.go @@ -100,7 +100,7 @@ func (req *DeleteSecurityGroup) response() interface{} { // CloudStack API: https://cloudstack.apache.org/api/apidocs-4.10/apis/authorizeSecurityGroupIngress.html type AuthorizeSecurityGroupIngress struct { Account string `json:"account,omitempty"` - CidrList string `json:"cidrlist,omitempty"` + CidrList []string `json:"cidrlist,omitempty"` Description string `json:"description,omitempty"` DomainID string `json:"domainid,omitempty"` IcmpType int `json:"icmptype,omitempty"`
security groups: fun fact cidrlist is a list
exoscale_egoscale
train
go
31458a94a6ee5c96cbdcdaafc6720fe2dc459ed6
diff --git a/actionview/lib/action_view/railtie.rb b/actionview/lib/action_view/railtie.rb index <HASH>..<HASH> 100644 --- a/actionview/lib/action_view/railtie.rb +++ b/actionview/lib/action_view/railtie.rb @@ -37,10 +37,6 @@ module ActionView end end - initializer "action_view.collection_caching", after: "action_controller.set_configs" do |app| - PartialRenderer.collection_cache = app.config.action_controller.cache_store - end - initializer "action_view.per_request_digest_cache" do |app| ActiveSupport.on_load(:action_view) do if app.config.consider_all_requests_local @@ -55,6 +51,10 @@ module ActionView end end + initializer "action_view.collection_caching", after: "action_controller.set_configs" do |app| + PartialRenderer.collection_cache = app.config.action_controller.cache_store + end + rake_tasks do |app| unless app.config.api_only load "action_view/tasks/cache_digests.rake"
Push action_view.collection_caching to be called towards the end, since it depends on being called after action_controller.set_configs. This causes, other AV initializers after it to be called after all of AC initializers, which get pulled in before since action_controller.set_configs gets called. Hence, push initializer depending on after hook, to be called after all initializers for this railtie are done.
rails_rails
train
rb
710aafbc9128fc0cbb3f7220a2300eef7018de94
diff --git a/src/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php b/src/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php +++ b/src/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php @@ -113,7 +113,7 @@ EOF; ?? $this->context->getParameter('_locale') ?: $this->defaultLocale; - if (null !== $locale && (self::$declaredRoutes[$name.'.'.$locale][1]['_canonical_route'] ?? null) === $name) { + if (null !== $locale && (self::$declaredRoutes[$name.'.'.$locale][1]['_canonical_route'] ?? null) === $name && null !== $name) { unset($parameters['_locale']); $name .= '.'.$locale; } elseif (!isset(self::$declaredRoutes[$name])) {
[Routing] generate(null) should throw an exception
symfony_symfony
train
php
5d38a0d58ffebdc99ebac4e3a89f6533ce0456b1
diff --git a/lib/Slackbot_worker.js b/lib/Slackbot_worker.js index <HASH>..<HASH> 100755 --- a/lib/Slackbot_worker.js +++ b/lib/Slackbot_worker.js @@ -165,6 +165,7 @@ module.exports = function(botkit, config) { var err = new Error('Stale RTM connection, closing RTM'); botkit.log.error(err) bot.closeRTM(err); + clearInterval(pingIntervalId); return; }
Stop ping/pong checking once we've determined the connection is bad
howdyai_botkit
train
js
f4be18e082888f6d07dd134fd1664f0ff6c6516e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ def readme(): return f.read() setup(name='pyTelegramBotAPI', - version='0.3.8', + version='0.3.9', description='Python Telegram bot api. ', long_description=readme(), author='eternnoir',
Update Version. Change log: - New type Chat support. - Bugs fix.
eternnoir_pyTelegramBotAPI
train
py
f514ebde313dcf27afcd4806bf33f4426e59835e
diff --git a/sonar-batch/src/test/java/org/sonar/batch/issue/IssuesDecoratorTest.java b/sonar-batch/src/test/java/org/sonar/batch/issue/IssuesDecoratorTest.java index <HASH>..<HASH> 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/issue/IssuesDecoratorTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/issue/IssuesDecoratorTest.java @@ -89,6 +89,17 @@ public class IssuesDecoratorTest { verify(context).saveMeasure(CoreMetrics.ISSUES, 4.0); } + @Test + public void should_do_nothing_when_issuable_is_null() { + ResourcePerspectives perspectives = mock(ResourcePerspectives.class); + when(perspectives.as(Issuable.class, resource)).thenReturn(null); + IssuesDecorator decorator = new IssuesDecorator(perspectives, rulefinder); + + decorator.decorate(resource, context); + + verifyZeroInteractions(context); + } + /** * See http://jira.codehaus.org/browse/SONAR-1729 */
Add unit test when issuable is null
SonarSource_sonarqube
train
java
42c0af702dff1a91a56054076621b9048b77aa7e
diff --git a/model/accessory/thermostat.go b/model/accessory/thermostat.go index <HASH>..<HASH> 100644 --- a/model/accessory/thermostat.go +++ b/model/accessory/thermostat.go @@ -50,7 +50,9 @@ func (t *thermostat) TargetTemperature() float64 { } func (t *thermostat) SetMode(value model.HeatCoolMode) { - t.thermostat.Mode.SetHeatingCoolingMode(value) + if value != model.ModeAuto { + t.thermostat.Mode.SetHeatingCoolingMode(value) + } } func (t *thermostat) Mode() model.HeatCoolMode { diff --git a/model/thermostat.go b/model/thermostat.go index <HASH>..<HASH> 100644 --- a/model/thermostat.go +++ b/model/thermostat.go @@ -21,7 +21,8 @@ type Thermostat interface { // Returns the target temperature TargetTemperature() float64 - // Sets the mode + // SetMode sets the current mode + // ModeAuto is ignored because the current mode cannot be auto SetMode(HeatCoolMode) // Returns the mode
Prevent current heating cooling mode of thermostat to be auto
brutella_hc
train
go,go
e490e25834b4c81ed00bf60431716d755220583a
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,7 +1,7 @@ /** * DB task set for pon * @module pon-task-db - * @version 2.2.3 + * @version 2.2.4 */ 'use strict'
[ci skip] Travis CI committed after build
realglobe-Inc_pon-task-db
train
js
1f8fe06e47ea12f8d5a9ed5e6dd72f9164e039aa
diff --git a/ci/taskcluster/bin/decision.py b/ci/taskcluster/bin/decision.py index <HASH>..<HASH> 100755 --- a/ci/taskcluster/bin/decision.py +++ b/ci/taskcluster/bin/decision.py @@ -21,7 +21,7 @@ tasks = [ 'artifacts_from': [ { 'task_name': 'recipe-client-addon:build', - 'path': 'build.tar.gz', + 'path': 'public/build.tar.gz', 'env_var': 'BUILD_RESULT', }, ],
Use correct path for pulling build artifact in TaskCluster test script.
mozilla_normandy
train
py
c1b05b720ded1338d82f50f5c2df050930ccd350
diff --git a/python/ray/worker.py b/python/ray/worker.py index <HASH>..<HASH> 100644 --- a/python/ray/worker.py +++ b/python/ray/worker.py @@ -1391,6 +1391,9 @@ def register_custom_serializer(cls, use_dict: Deprecated. class_id (str): Unique ID of the class. Autogenerated if None. """ + worker = global_worker + worker.check_connected() + if use_pickle: raise DeprecationWarning( "`use_pickle` is no longer a valid parameter and will be removed "
calling register_custom_serializer require ray to be initialized (#<I>)
ray-project_ray
train
py
723ceb41eefefaa8731d2dd6c48e58d03ad1ab66
diff --git a/DataSet/Front/ProducerDataSet.php b/DataSet/Front/ProducerDataSet.php index <HASH>..<HASH> 100755 --- a/DataSet/Front/ProducerDataSet.php +++ b/DataSet/Front/ProducerDataSet.php @@ -13,6 +13,10 @@ namespace WellCommerce\Bundle\ProducerBundle\DataSet\Front; use WellCommerce\Bundle\ProducerBundle\DataSet\Admin\ProducerDataSet as BaseDataSet; +use WellCommerce\Bundle\ProducerBundle\Entity\Producer; +use WellCommerce\Bundle\ProducerBundle\Entity\ProducerTranslation; +use WellCommerce\Bundle\ProductBundle\Entity\Product; +use WellCommerce\Component\DataSet\Cache\CacheOptions; use WellCommerce\Component\DataSet\Configurator\DataSetConfiguratorInterface; /** @@ -37,5 +41,11 @@ class ProducerDataSet extends BaseDataSet $configurator->setColumnTransformers([ 'route' => $this->getDataSetTransformer('route') ]); + + $configurator->setCacheOptions(new CacheOptions(true, 3600, [ + Product::class, + Producer::class, + ProducerTranslation::class + ])); } }
Cached datasets, second level cache
WellCommerce_WishlistBundle
train
php
92bd0b46329388eac1d2729a9d507144e28464df
diff --git a/src/Models/Link.php b/src/Models/Link.php index <HASH>..<HASH> 100644 --- a/src/Models/Link.php +++ b/src/Models/Link.php @@ -397,7 +397,7 @@ class Link extends DataObject { $class = $this->Classes ? Convert::raw2att($this->Classes) : ''; - return $class ? " class='$class'" : ''; + return $class ? " class=$class" : ''; } /** @@ -407,7 +407,7 @@ class Link extends DataObject */ public function getTargetAttr() { - return $this->OpenInNewWindow ? " target='_blank'" : ''; + return $this->OpenInNewWindow ? " target=_blank" : ''; } /**
quotes added when template processed. no need of manually adding them in php
sheadawson_silverstripe-linkable
train
php
7afc28a24a53842f0118e33b23703240afb5372a
diff --git a/spec/twitter/client_spec.rb b/spec/twitter/client_spec.rb index <HASH>..<HASH> 100644 --- a/spec/twitter/client_spec.rb +++ b/spec/twitter/client_spec.rb @@ -83,7 +83,7 @@ describe Twitter::Client do before do stub_delete("/custom/delete").with(:query => {:deleted => "object"}) end - it "allows custom put requests" do + it "allows custom delete requests" do subject.delete("/custom/delete", {:deleted => "object"}) expect(a_delete("/custom/delete").with(:query => {:deleted => "object"})).to have_been_made end
use correct method name in spec description
sferik_twitter
train
rb
69b7821d2a0b46a12023bc19ec5eae680f840bd4
diff --git a/jupyter-js-widgets/src/widget.js b/jupyter-js-widgets/src/widget.js index <HASH>..<HASH> 100644 --- a/jupyter-js-widgets/src/widget.js +++ b/jupyter-js-widgets/src/widget.js @@ -37,9 +37,9 @@ var unpack_models = function unpack_models(value, manager) { var WidgetModel = Backbone.Model.extend({ defaults: { - _model_module: null, + _model_module: "jupyter-js-widgets", _model_name: "WidgetModel", - _view_module: "", + _view_module: "jupyter-js-widgets", _view_name: null, msg_throttle: 3 },
Set default module for model and view in the frontend
jupyter-widgets_ipywidgets
train
js
91ce841c6b253ce0e9789ffbad167bc5175e8ee6
diff --git a/src/main/java/com/couchbase/cblite/replicator/CBLReplicator.java b/src/main/java/com/couchbase/cblite/replicator/CBLReplicator.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/couchbase/cblite/replicator/CBLReplicator.java +++ b/src/main/java/com/couchbase/cblite/replicator/CBLReplicator.java @@ -217,6 +217,7 @@ public abstract class CBLReplicator extends Observable { this.changesProcessed = this.changesTotal = 0; saveLastSequence(); + setChanged(); notifyObservers(); batcher = null;
Needed to fix issue #<I> (Ektorp Tests take forever). This is needed for being able to properly observer replications.
couchbase_couchbase-lite-java-core
train
java
4142dda9988d69a9e6c3d3ac098442a9309f0c67
diff --git a/server/peer.go b/server/peer.go index <HASH>..<HASH> 100644 --- a/server/peer.go +++ b/server/peer.go @@ -265,6 +265,7 @@ func (peer *Peer) loop() error { } if oldState == bgp.BGP_FSM_ESTABLISHED { peer.fsm.peerConfig.BgpNeighborCommonState.Uptime = time.Time{} + peer.adjRib.DropAllIn(peer.rf) pm := &peerMsg{ msgType: PEER_MSG_PEER_DOWN, msgData: peer.peerInfo, diff --git a/table/table_manager.go b/table/table_manager.go index <HASH>..<HASH> 100644 --- a/table/table_manager.go +++ b/table/table_manager.go @@ -281,6 +281,11 @@ func (adj *AdjRib) GetOutPathList(rf bgp.RouteFamily) []Path { return adj.getPathList(adj.adjRibOut[rf]) } +func (adj *AdjRib) DropAllIn(rf bgp.RouteFamily) { + // replace old one + adj.adjRibIn[rf] = make(map[string]*ReceivedRoute) +} + type ReceivedRoute struct { path Path filtered bool
server: drop all paths in adj-in when peer is down
osrg_gobgp
train
go,go
381f06d34848e9bf055551dd5365f5a1e3d14120
diff --git a/api/service_consumption.go b/api/service_consumption.go index <HASH>..<HASH> 100644 --- a/api/service_consumption.go +++ b/api/service_consumption.go @@ -506,6 +506,13 @@ func serviceInstanceGrantTeam(w http.ResponseWriter, r *http.Request, t auth.Tok return serviceInstance.Grant(teamName) } +// title: revoke access to service instance +// path: /services/{service}/instances/{instance}/status +// method: DELETE +// responses: +// 200: Access revoked +// 401: Unauthorized +// 404: Service instance not found func serviceInstanceRevokeTeam(w http.ResponseWriter, r *http.Request, t auth.Token) error { instanceName := r.URL.Query().Get(":instance") serviceName := r.URL.Query().Get(":service")
api/services: add comments to describe service instance revoke access
tsuru_tsuru
train
go
1c33b650a98c1e9bfb1e177952384ec145fef612
diff --git a/src/discoursegraphs/discoursegraph.py b/src/discoursegraphs/discoursegraph.py index <HASH>..<HASH> 100644 --- a/src/discoursegraphs/discoursegraph.py +++ b/src/discoursegraphs/discoursegraph.py @@ -605,6 +605,7 @@ def get_annotation_layers(docgraph): node_layers = get_node_annotation_layers(docgraph) return node_layers.union(get_edge_annotation_layers(docgraph)) + def get_top_level_layers(docgraph): """ WARNING: this is higly inefficient! @@ -703,10 +704,12 @@ def tokens2text(docgraph, token_ids): return ' '.join(docgraph.node[token_id][docgraph.ns+':token'] for token_id in token_ids) + def istoken(docgraph, node_id): """returns true, iff the given node ID belongs to a token node.""" return docgraph.ns+':token' in docgraph.node[node_id] + def select_nodes_by_layer(docgraph, layer): """ Get all nodes belonging to the given layer.
discoursegraph.py: flake8
arne-cl_discoursegraphs
train
py
39e68348bf60a59f1ca0cd0969e7b66ea973c549
diff --git a/src/utils.js b/src/utils.js index <HASH>..<HASH> 100644 --- a/src/utils.js +++ b/src/utils.js @@ -59,3 +59,40 @@ export const swap = (o) => dict( .entries(o) .map((kv) => [].concat(kv).reverse()) ) + + + + +// setTimeout in promise/async skin +// example usage: +// +// sf.utils.timeout( +// () => { console.log("Hey!"); return 42 }, 1000, +// (c) => sf.utils.timeout(() => c("Cancelled!"), 800) +// ) +// .then((x) => console.log("Success:", x)) +// .catch((c) => console.log("Error or cancel:", c)) +// +export const timeout = (f, time = 1000, cancel = (_reason) => null) => { + let + handle = null, reject = null, + promise = new Promise((res, rej) => { + reject = rej + handle = setTimeout(() => { + try { res(f()) } + catch (ex) { rej(ex) } + }, time) + }) + cancel((reason) => { + clearTimeout(handle) + reject(reason) + }) + return promise +} + + + + +// convenience shortcut of "timeout" +export const delay = (time = 1000, cancel = (_reason) => null) => + timeout(() => time, time, cancel)
utils: timeout() and delay() added.
drmats_js-toolbox
train
js
59827b2ec88f83a0f38d09aae61857f99ba2568f
diff --git a/sciluigi/dependencies.py b/sciluigi/dependencies.py index <HASH>..<HASH> 100644 --- a/sciluigi/dependencies.py +++ b/sciluigi/dependencies.py @@ -63,11 +63,11 @@ class DependencyHelpers(): ''' if callable(val): val = val() - if isinstance(val, list): + if isinstance(val, TargetInfo): + tasks.append(val.task) + elif isinstance(val, list): for valitem in val: tasks = self._parse_inputitem(valitem, tasks) - elif isinstance(val, TargetInfo): - tasks.append(val.task) return tasks # --------------------------------------------------------
Formatting: Default case first, in recursive method
pharmbio_sciluigi
train
py
ff02a175f5c8d73b0104464868a785da07efcf98
diff --git a/gui/src/main/java/org/jboss/as/console/client/shared/subsys/infinispan/v3/CacheFinderPresenter.java b/gui/src/main/java/org/jboss/as/console/client/shared/subsys/infinispan/v3/CacheFinderPresenter.java index <HASH>..<HASH> 100644 --- a/gui/src/main/java/org/jboss/as/console/client/shared/subsys/infinispan/v3/CacheFinderPresenter.java +++ b/gui/src/main/java/org/jboss/as/console/client/shared/subsys/infinispan/v3/CacheFinderPresenter.java @@ -89,8 +89,7 @@ public class CacheFinderPresenter extends Presenter<CacheFinderPresenter.MyView, @NameToken(NameTokens.CacheFinderPresenter) @AccessControl(resources = { "{selected.profile}/subsystem=infinispan", - "{selected.profile}/subsystem=infinispan/cache-container=*", - "{selected.profile}/subsystem=infinispan/cache-container=*/transport=TRANSPORT" + "{selected.profile}/subsystem=infinispan/cache-container=*" }, recursive = false) @SearchIndex(keywords = { "cache", "ejb", "hibernate", "web", "transport"
Workaround some of the WFLY-<I> problems
hal_core
train
java
e50a7215b6aac1b0adb41dd3689a81474b666714
diff --git a/main.py b/main.py index <HASH>..<HASH> 100644 --- a/main.py +++ b/main.py @@ -44,5 +44,7 @@ def main(): args.dry_run ), args.query['query'], - args.query['options'] + args.query['options'], + args.start_at, + args.end_at )
Entrypoint should be called with start and end All collectors care about the time period they should be collecting over, so these parameters should be passed throught to the entrypoint.
alphagov_performanceplatform-collector
train
py
d8f64d487760988bbbbd77dc8785b59a94bf9548
diff --git a/src/CfdiUtils/SumasConceptos/SumasConceptos.php b/src/CfdiUtils/SumasConceptos/SumasConceptos.php index <HASH>..<HASH> 100644 --- a/src/CfdiUtils/SumasConceptos/SumasConceptos.php +++ b/src/CfdiUtils/SumasConceptos/SumasConceptos.php @@ -46,8 +46,8 @@ class SumasConceptos foreach ($conceptos as $concepto) { $this->addConcepto($concepto); } - $this->impuestosTrasladados = array_sum(array_column($this->traslados, 'Importe')); - $this->impuestosRetenidos = array_sum(array_column($this->retenciones, 'Importe')); + $this->impuestosTrasladados = (float) array_sum(array_column($this->traslados, 'Importe')); + $this->impuestosRetenidos = (float) array_sum(array_column($this->retenciones, 'Importe')); $this->total = $this->importes - $this->descuento + $this->impuestosTrasladados - $this->impuestosRetenidos; }
cast array_sum return to float since it can be integer
eclipxe13_CfdiUtils
train
php
ddb843ddfac0cf58951073c48f48c096c6bd93ad
diff --git a/hawkrest/__init__.py b/hawkrest/__init__.py index <HASH>..<HASH> 100644 --- a/hawkrest/__init__.py +++ b/hawkrest/__init__.py @@ -117,6 +117,9 @@ class HawkAuthenticatedUser(object): def get_username(self): return str(self.__class__.__name__) + def save(self, *args, **kwargs): + raise NotImplementedError() + def natural_key(self): return str(self.__class__.__name__)
Give HawkAuthenticatedUser a save() method to match AbstractBaseUser A `save()` method was added to `AbstractBaseUser` in: <URL>: File "/home/Ed/src/hawkrest/tests/test_authentication.py", line <I>, in test_method_compliance .format(name)) AssertionError: HawkAuthenticatedUser is missing method: save
kumar303_hawkrest
train
py
944156cf432bf482894d9f7be4b5e61a5122597d
diff --git a/asammdf/gui/widgets/tabular.py b/asammdf/gui/widgets/tabular.py index <HASH>..<HASH> 100644 --- a/asammdf/gui/widgets/tabular.py +++ b/asammdf/gui/widgets/tabular.py @@ -100,9 +100,18 @@ class Tabular(Ui_TabularDisplay, QtWidgets.QWidget): self.prefix.currentIndexChanged.connect(self.prefix_changed) self.tree_scroll.valueChanged.connect(self._display) + self.tree.verticalScrollBar().valueChanged.connect(self._scroll_tree) self.tree.currentItemChanged.connect(self._scroll_tree) def _scroll_tree(self, selected_item): + if isinstance(selected_item, int): + count = self.tree.topLevelItemCount() + selected_item = self.tree.topLevelItem( + int( + selected_item / self.tree.verticalScrollBar().maximum() * (count - 1) + ) + ) + count = self.tree.topLevelItemCount() if count <= 1: return
fix scrolling with mouse wheel in tabular window
danielhrisca_asammdf
train
py
9d8dbe0ba359ac15d078673a430f05f522716395
diff --git a/source/rafcon/mvc/history.py b/source/rafcon/mvc/history.py index <HASH>..<HASH> 100755 --- a/source/rafcon/mvc/history.py +++ b/source/rafcon/mvc/history.py @@ -2007,10 +2007,10 @@ class History(ModelMT): self.actual_action.after_storage = self.actual_action.get_storage() self.tmp_meta_storage = get_state_element_meta(self.state_machine_model.root_state) else: - if isinstance(overview['model'][-1], StateModel): - changed_parent_model = overview['model'][-1] + if isinstance(overview['model'][0], StateModel): + changed_parent_model = overview['model'][0] else: - changed_parent_model = overview['model'][-1].parent + changed_parent_model = overview['model'][0].parent self.actual_action = MetaAction(changed_parent_model.state.get_path(), state_machine_model=self.state_machine_model, overview=overview)
workaround for merge problem -> use default behavior of MetaAction data from root_state - at the moment the behavior is not understandable -> before merge this problem was not existing
DLR-RM_RAFCON
train
py
2992c64514e1fbf5924711858c450f534ba0dfc4
diff --git a/src/wyil/lang/IntersectionOperator.java b/src/wyil/lang/IntersectionOperator.java index <HASH>..<HASH> 100644 --- a/src/wyil/lang/IntersectionOperator.java +++ b/src/wyil/lang/IntersectionOperator.java @@ -108,7 +108,10 @@ public class IntersectionOperator implements Relation { case K_LIST: case K_PROCESS: case K_DICTIONARY: - case K_TUPLE: { + case K_TUPLE: { + if(!fromSign && !toSign) { + return true; + } // nary nodes int[] fromChildren = fromState.children; int[] toChildren = toState.children; diff --git a/src/wyil/lang/Type.java b/src/wyil/lang/Type.java index <HASH>..<HASH> 100755 --- a/src/wyil/lang/Type.java +++ b/src/wyil/lang/Type.java @@ -1727,8 +1727,8 @@ public abstract class Type { public static void main(String[] args) { // Type t1 = contractive(); //linkedList(2); - Type from = fromString("null"); - Type to = fromString("!int"); + Type from = fromString("[void]"); + Type to = fromString("![any]"); System.out.println(from + " :> " + to + " = " + isSubtype(from, to)); System.out.println("simplified(" + from + ") = " + minimise(from)); System.out.println("simplified(" + to + ") = " + minimise(to));
Possible bug fix for deterministic compound types, such as lists and sets.
Whiley_WhileyCompiler
train
java,java
461d615c045623f9f2417c9e5dc1cb397aea3433
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -107,6 +107,7 @@ module.exports = function(grunt) { ]); grunt.registerTask('release', [ + 'sauce', 'pack', 'compress', 'changelog',
chore(gruntfile): Add sauce task to release steps [skip ci]
mbenford_ngTagsInput
train
js
7fd2b4292d602ef649e5fcb1d264a91bb78b88d6
diff --git a/reana_commons/version.py b/reana_commons/version.py index <HASH>..<HASH> 100755 --- a/reana_commons/version.py +++ b/reana_commons/version.py @@ -14,4 +14,4 @@ and parsed by ``setup.py``. from __future__ import absolute_import, print_function -__version__ = "0.6.0.dev20191129" +__version__ = "0.6.0.dev20191209"
release: <I>.de<I>
reanahub_reana-commons
train
py
b4e0d91ba440e8d2ae17c62ccd9863938ef28ae9
diff --git a/core/src/main/java/hudson/model/ListView.java b/core/src/main/java/hudson/model/ListView.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/model/ListView.java +++ b/core/src/main/java/hudson/model/ListView.java @@ -217,6 +217,9 @@ public class ListView extends View implements Saveable { public void doAddJobToView(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { checkPermission(View.CONFIGURE); + if (!req.getMethod().equals("POST")) { + throw new Failure("Request must be a POST request"); + } String name = req.getParameter("name"); if(name==null) @@ -233,6 +236,9 @@ public class ListView extends View implements Saveable { public void doRemoveJobFromView(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { checkPermission(View.CONFIGURE); + if (!req.getMethod().equals("POST")) { + throw new Failure("Request must be a POST request"); + } String name = req.getParameter("name"); if(name==null)
Ensure only POST requests are responded to
jenkinsci_jenkins
train
java
d8866d17964485b5929e889d49ebfbee4686f03d
diff --git a/public/js/editor.js b/public/js/editor.js index <HASH>..<HASH> 100644 --- a/public/js/editor.js +++ b/public/js/editor.js @@ -608,6 +608,7 @@ function AposSchemas() { // Implement custom relationship field types (tags) $field.off('afterAddItem'); $field.on('afterAddItem', function(e, item, $item) { + apos.emit('enhance', $item); _.each(field.relationship || [], function(field) { if (field.type === 'tags') { var $tags = $item.findSafe('[data-name="' + field.name + '"]', '[data-selective]');
apostrophe enhance event triggered as each item is added to jquery selective, allowing for nice select dropdowns etc. However there is still an aesthetic issue which is beyond my pay grade. -Tom
apostrophecms-legacy_apostrophe-schemas
train
js
bcdde28250481902389dd04befdd87176008329a
diff --git a/openquake/engine/calculators/hazard/event_based/core.py b/openquake/engine/calculators/hazard/event_based/core.py index <HASH>..<HASH> 100644 --- a/openquake/engine/calculators/hazard/event_based/core.py +++ b/openquake/engine/calculators/hazard/event_based/core.py @@ -440,13 +440,14 @@ class EventBasedHazardCalculator(general.BaseHazardCalculator): with self.monitor('reading ruptures'): for trt_model in models.TrtModel.objects.filter( lt_model__hazard_calculation=self.job): - sesruptures.extend( - models.SESRupture.objects.filter( - rupture__trt_model=trt_model)) + for sr in models.SESRupture.objects.filter( + rupture__trt_model=trt_model): + sr.trt_id = trt_model.id + sesruptures.append(sr) self.curves = tasks.apply_reduce( compute_gmfs_and_curves, (self.job.id, sesruptures, sitecol), - self.agg_curves, {}, key=lambda sr: sr.rupture.trt_model.id) + self.agg_curves, {}, key=lambda sr: sr.trt_id) def initialize_ses_db_records(self, lt_model): """
A trick to partition the ruptures by trt_id Former-commit-id: 7df7ac<I>c<I>bfa<I>c<I>a4b4a5a<I>
gem_oq-engine
train
py
c0fd00406e3b30353f99cdf6d908302f135236ef
diff --git a/collector.js b/collector.js index <HASH>..<HASH> 100644 --- a/collector.js +++ b/collector.js @@ -21,18 +21,18 @@ module.exports = function(RED) { function CollectorNode(n) { RED.nodes.createNode(this,n); this.name = n.name; - this.state = {}; + this.values = {}; var node = this; node.on("input", function(msg) { try { if (msg.topic) { if (msg.payload == undefined || msg.payload == null || msg.payload == '') { - delete node.state[msg.topic]; + delete node.values[msg.topic]; } else { - node.state[msg.topic] = msg.payload; + node.values[msg.topic] = msg.payload; } - node.send(node.state); + node.send(node.values); } else { node.warn("No topic set on message to collector"); }
Renamed variable 'state' to 'values'
njh_node-red-contrib-collector
train
js
284aeb83ca005113e89f4a9aa2923b5b23bcbadb
diff --git a/src/basis/ui/popup.js b/src/basis/ui/popup.js index <HASH>..<HASH> 100644 --- a/src/basis/ui/popup.js +++ b/src/basis/ui/popup.js @@ -329,11 +329,15 @@ // async document.body ready basis.doc.body.ready(function(body){ - popupManager.body = body; + var popupContainer = document.createElement('div'); + popupContainer.classList.add('popup-container'); + body.appendChild(popupContainer); + + popupManager.body = popupContainer; popupManager.forEach(function(popup){ if (!domUtils.parentOf(document, popup.element)) { - body.appendChild(popup.element); + popupManager.body.appendChild(popup.element); popup.realign(); } });
basis.ui.popup: separate popup container is back Inserting popups right into <body> caused all kinds of shenanigans in Firefox, so I did a little Firefix.
basisjs_basisjs
train
js
f75524a3da4c8df19c2f0f76d6871638c0864983
diff --git a/jarn/mkrelease/tee.py b/jarn/mkrelease/tee.py index <HASH>..<HASH> 100644 --- a/jarn/mkrelease/tee.py +++ b/jarn/mkrelease/tee.py @@ -11,7 +11,7 @@ try: except NameError: from .utils import callable -__all__ = ['run', 'On', 'Off', 'NotEmpty', 'Equals', +__all__ = ['run', 'On', 'Off', 'NotEmpty', 'Equals', 'Contains', 'StartsWith', 'EndsWith', 'Before', 'NotAfter', 'After', 'NotBefore', 'Not', 'And', 'Or'] @@ -152,6 +152,19 @@ class Equals(object): return line in self.patterns +class Contains(object): + """A tee filter printing lines containing one of 'patterns'.""" + + def __init__(self, *patterns): + self.patterns = patterns + + def __call__(self, line): + for pattern in self.patterns: + if pattern in line: + return True + return False + + class StartsWith(object): """A tee filter printing lines starting with one of 'patterns'."""
Add Contains tee filter.
Jarn_jarn.mkrelease
train
py
1287e338d4ceceaa413d8f04047057334916af7c
diff --git a/gwt-material/src/main/java/gwt/material/design/client/MaterialDesignBase.java b/gwt-material/src/main/java/gwt/material/design/client/MaterialDesignBase.java index <HASH>..<HASH> 100644 --- a/gwt-material/src/main/java/gwt/material/design/client/MaterialDesignBase.java +++ b/gwt-material/src/main/java/gwt/material/design/client/MaterialDesignBase.java @@ -53,8 +53,10 @@ public class MaterialDesignBase { } protected void onModuleLoaded() { - for(FutureResource res : futureResources) { - injectJs(res.resource, res.removeTag, res.sourceUrl); + if(futureResources != null) { + for (FutureResource res : futureResources) { + injectJs(res.resource, res.removeTag, res.sourceUrl); + } } }
Ensure the futureResources list isn't null.
GwtMaterialDesign_gwt-material
train
java
cecd3ae5505ba7ee90a7e277d42949c0801034be
diff --git a/lib/Cake/Network/Http/Request.php b/lib/Cake/Network/Http/Request.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Network/Http/Request.php +++ b/lib/Cake/Network/Http/Request.php @@ -66,7 +66,7 @@ class Request extends Message { if ($method === null) { return $this->_method; } - $name = __CLASS__ . '::METHOD_' . strtoupper($method); + $name = get_called_class() . '::METHOD_' . strtoupper($method); if (!defined($name)) { throw new Error\Exception(__d('cake_dev', 'Invalid method type')); }
Fix possible early-static binding issues.
cakephp_cakephp
train
php
44e3eacf3758df05de583c96466b346d74d21245
diff --git a/tilequeue/worker.py b/tilequeue/worker.py index <HASH>..<HASH> 100644 --- a/tilequeue/worker.py +++ b/tilequeue/worker.py @@ -129,7 +129,8 @@ class DataFetch(object): log_level = logging.WARNING else: log_level = logging.ERROR - self.logger.log(log_level, stacktrace) + self.logger.log(log_level, 'Error fetching: %s - %s' % ( + serialize_coord(coord), stacktrace)) continue metadata = data['metadata'] @@ -190,7 +191,8 @@ class ProcessAndFormatData(object): unpadded_bounds, padded_bounds) except: stacktrace = format_stacktrace_one_line() - self.logger.error(stacktrace) + self.logger.error('Error processing: %s - %s' % ( + serialize_coord(coord), stacktrace)) continue metadata = data['metadata'] @@ -261,7 +263,8 @@ class S3Storage(object): if async_exc_info: stacktrace = format_stacktrace_one_line(async_exc_info) - self.logger.error(stacktrace) + self.logger.error('Error storing: %s - %s' % ( + serialize_coord(coord), stacktrace)) continue metadata = data['metadata']
Better logging of error messages in workers
tilezen_tilequeue
train
py
cb93f7b46817634a77806df8c378d60be498b1b6
diff --git a/salt/modules/linux_lvm.py b/salt/modules/linux_lvm.py index <HASH>..<HASH> 100644 --- a/salt/modules/linux_lvm.py +++ b/salt/modules/linux_lvm.py @@ -252,11 +252,6 @@ def pvremove(devices, override=True): ''' cmd = ['pvremove', '-y'] for device in devices.split(','): - if not __salt__['lvm.pvdisplay'](device): - return '{0} is not a physical volume'.format(device) - cmd.append(device) - out = __salt__['cmd.run'](cmd, python_shell=False).splitlines() - return out[0] elif not override: raise CommandExecutionError('{0} is not a physical volume'.format(device))
Remove buggy runner and its output
saltstack_salt
train
py
ed72610c542f56eaf14b1bf8aeda5709917cf274
diff --git a/robospock/src/main/java/org/robospock/internal/GradleRoboSputnik.java b/robospock/src/main/java/org/robospock/internal/GradleRoboSputnik.java index <HASH>..<HASH> 100644 --- a/robospock/src/main/java/org/robospock/internal/GradleRoboSputnik.java +++ b/robospock/src/main/java/org/robospock/internal/GradleRoboSputnik.java @@ -49,7 +49,13 @@ public class GradleRoboSputnik extends RoboSputnik { } if (FileFsFile.from(BUILD_OUTPUT, "manifests").exists()) { - manifest = FileFsFile.from(BUILD_OUTPUT, "manifests", "full", flavor, type, "AndroidManifest.xml"); + if(FileFsFile.from(BUILD_OUTPUT, "manifests", "full").exists()){ + // pre Android Gradle 2.2 + manifest = FileFsFile.from(BUILD_OUTPUT, "manifests", "full", flavor, type, "AndroidManifest.xml"); + } else { + // Android Gradle 2.2.+ + manifest = FileFsFile.from(BUILD_OUTPUT, "manifests", "aapt", flavor, type, "AndroidManifest.xml"); + } } else { manifest = FileFsFile.from(BUILD_OUTPUT, "bundles", flavor, type, "AndroidManifest.xml"); }
Read AndroidManifest from new location. Android Gradle plugin <I>.+ has moved where manifest is built. Adding some lines to be compatible with old and new plugins.
robospock_RoboSpock
train
java
6cde0648fc234e1a8cac1e0d0733f7c4e0834a95
diff --git a/css-plugin-base-builder.js b/css-plugin-base-builder.js index <HASH>..<HASH> 100644 --- a/css-plugin-base-builder.js +++ b/css-plugin-base-builder.js @@ -143,7 +143,7 @@ exports.bundle = function(loads, compileOpts, outputOpts) { })); return postcss(postCssPlugins) - .process(Object.keys(inputFiles).map(name => '@import "' + name + '";').join('\n'), { + .process(Object.keys(inputFiles).map(name => '@import "' + name.replace(/\\/g, '/') + '";').join('\n'), { from: path.join(baseURLPath, '__.css'), to: cwd + path.sep + '__.css', map: {
Convert back slashes to forward slashes in import statement. Usually an import of css is replaced with the css content, however sometimes it results in an @import statement. Could not produce an example that generates an @import statement. In a current project of mine this happens to some css files imported from a jspm package. Not sure what triggers it (size/other references/location). Therefor, no unit test was added
systemjs_plugin-css
train
js
f6f39e5ff18e39844cd5d586cc08fea18dc83926
diff --git a/spec/integration_spec.rb b/spec/integration_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration_spec.rb +++ b/spec/integration_spec.rb @@ -28,10 +28,6 @@ describe Flipper do Flipper.register(:devs) { |thing| thing.dev? } end - after do - Flipper.groups = nil - end - describe "#enable" do context "with no arguments" do before do
Already doing this for each spec so not needed.
jnunemaker_flipper
train
rb
6e66130338c84c6a4292ce2f3f4e3a0528fc5ce1
diff --git a/mod/glossary/sql.php b/mod/glossary/sql.php index <HASH>..<HASH> 100644 --- a/mod/glossary/sql.php +++ b/mod/glossary/sql.php @@ -43,7 +43,7 @@ case GLOSSARY_CATEGORY_VIEW: if ($hook == GLOSSARY_SHOW_ALL_CATEGORIES ) { - $sqlselect = "SELECT ge.*, gec.id, gc.name $as pivot"; + $sqlselect = "SELECT ge.*, gec.entryid, gc.name $as pivot"; $sqlfrom = "FROM {$CFG->prefix}glossary_entries ge, {$CFG->prefix}glossary_entries_categories gec, {$CFG->prefix}glossary_categories gc"; @@ -71,7 +71,7 @@ } else { $printpivot = 0; - $sqlselect = "SELECT ge.*, ce.id, c.name $as pivot"; + $sqlselect = "SELECT ge.*, ce.entryid, c.name $as pivot"; $sqlfrom = "FROM {$CFG->prefix}glossary_entries ge, {$CFG->prefix}glossary_entries_categories ce, {$CFG->prefix}glossary_categories c"; $sqlwhere = "WHERE ge.id = ce.entryid AND ce.categoryid = $hook AND ce.categoryid = c.id AND ge.approved != 0 AND
In 'categories view' (all and only one), now attachements, edit, comment and delete are working properly.
moodle_moodle
train
php
b7b9786414026ab2d3a4f1bc667871557799dbfb
diff --git a/lib/moodlelib.php b/lib/moodlelib.php index <HASH>..<HASH> 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -2387,7 +2387,8 @@ function authenticate_user_login($username, $password) { } if (empty($user->auth)) { // For some reason it isn't set yet - if (!empty($user->id) && (isadmin($user->id) || isguest($user->id))) { + $primadmin = get_admin(); + if (!empty($user->id) && (($user->id==$primadmin->id) || isguest($user->id))) { $auth = 'manual'; // Always assume these guys are internal } else { $auth = $CFG->auth; // Normal users default to site method
MDL-<I> removed obsoleted use of isadmin() from authenticate_user_login()
moodle_moodle
train
php
4816eb7a4155de366cc5ac87d5349159dee97dd5
diff --git a/server.js b/server.js index <HASH>..<HASH> 100644 --- a/server.js +++ b/server.js @@ -100,10 +100,13 @@ function Server (opts) { self.http.on('error', function (err) { self._onError(err) }) self.http.on('listening', onListening) - // Add default http request handler if user does not add one on same tick + // Add default http request handler on next tick to give user the chance to add + // their own handler first. Handle requests untouched by user's handler. process.nextTick(function () { - if (self.http.listenerCount('request') > 0) return self.http.on('request', function (req, res) { + if (res.headersSent) return + // For websocket trackers, we only need to handle the UPGRADE http method. + // Return 404 for all other request types. res.statusCode = 404 res.end('404 Not Found') })
send <I> response when req headers are not sent
webtorrent_bittorrent-tracker
train
js
929a9767729ed7055f853b5ab10124589ae93e47
diff --git a/kafka_scanner/msg_processor_handlers.py b/kafka_scanner/msg_processor_handlers.py index <HASH>..<HASH> 100644 --- a/kafka_scanner/msg_processor_handlers.py +++ b/kafka_scanner/msg_processor_handlers.py @@ -25,7 +25,7 @@ class MsgProcessorHandlers(object): """ Get messages batch from Kafka (list at output) """ # get messages list from kafka if self.__next_messages == 0: - self._set_next_messages(50) + self._set_next_messages(1000) self._set_next_messages(min(self.__next_messages, max_next_messages)) mark = time.time() for partition, offmsg in self.consumer.get_messages(self.__next_messages): @@ -34,7 +34,7 @@ class MsgProcessorHandlers(object): if newmark - mark > 30: self._set_next_messages(self.__next_messages / 2 or 1) elif newmark - mark < 5: - self._set_next_messages(min(self.__next_messages + 50, max_next_messages)) + self._set_next_messages(min(self.__next_messages + 100, max_next_messages)) def decompress_messages(self, partitions_offmsgs): """ Decompress pre-defined compressed fields for each message. """
better starting/step next messages modifiers
scrapinghub_kafka-scanner
train
py
b475d7f6639d6ee808419d4261166ae7ee92c066
diff --git a/lib/config.js b/lib/config.js index <HASH>..<HASH> 100755 --- a/lib/config.js +++ b/lib/config.js @@ -1 +1,31 @@ - \ No newline at end of file +/*global _*/ +/** + * @module focus/configuration + */ + +/** + * Configuration object. + * @type {{CORS: boolean}} + */ +var configuration = { + CORS: true +}; + +/** + * Function which overrides the configuration. + * @param conf + */ +function configure(conf){ + if(_.isObject(conf)){ + _.extend(configuration, conf); + } + +} + + +module.exports = { + configure: configure, + get: function(){ + return _.clone(configuration); + } +}; \ No newline at end of file
#<I> [config] Add a object and function to extend it.
KleeGroup_focus-core
train
js
c85782061e15be3a225827da3c8aaf9f2ab3116d
diff --git a/lib/plugins/slack/summary.js b/lib/plugins/slack/summary.js index <HASH>..<HASH> 100644 --- a/lib/plugins/slack/summary.js +++ b/lib/plugins/slack/summary.js @@ -86,7 +86,7 @@ module.exports = function( let logo = 'https://www.sitespeed.io/img/slack/sitespeed-logo-slack.png'; if (metrics.coachScore.median === 100) { - logo = 'https://www.sitespeed.io/img/slack/sitespeed-logo-slack-100'; + logo = 'https://www.sitespeed.io/img/slack/sitespeed-logo-slack-100.png'; } let errorText = '';
Fix incorrect url to Pippi logo.
sitespeedio_sitespeed.io
train
js
158c217eee81f744cc3a10ec23f912a8264d2af0
diff --git a/lib/json/api/resource_controller.rb b/lib/json/api/resource_controller.rb index <HASH>..<HASH> 100644 --- a/lib/json/api/resource_controller.rb +++ b/lib/json/api/resource_controller.rb @@ -212,12 +212,12 @@ module JSON return fields elsif params[:fields].is_a?(String) value = params[:fields] - resource_fields = CSV.parse_line(value, { :converters => [lambda{|s|s.to_sym}]}) + resource_fields = value.split(',').map {|s| s.to_sym } unless value.nil? || value.empty? type = resource_klass._serialize_as fields[type] = resource_fields elsif params[:fields].is_a?(ActionController::Parameters) params[:fields].each do |param, value| - resource_fields = CSV.parse_line(value, { :converters => [lambda{|s|s.to_sym}]}) unless value.nil? || value.empty? + resource_fields = value.split(',').map {|s| s.to_sym } unless value.nil? || value.empty? type = param.to_sym fields[type] = resource_fields end
Removed CSV dependency for parse_fields
cerebris_jsonapi-resources
train
rb
10162f2ddae18e415ed8f89cc5c2691a0b64735f
diff --git a/jams/tests/namespace_tests.py b/jams/tests/namespace_tests.py index <HASH>..<HASH> 100644 --- a/jams/tests/namespace_tests.py +++ b/jams/tests/namespace_tests.py @@ -167,3 +167,30 @@ def test_ns_lyrics(): for line in [23, None]: yield raises(ValidationError)(__test), line + +def test_ns_tempo_valid(): + + ann = Annotation(namespace='tempo') + + ann.append(time=0, duration=0, value=1, confidence=0.85) + + ann.validate() + + +def test_ns_tempo_invalid(): + + @raises(ValidationError) + def __test(value, confidence): + ann = Annotation(namespace='tempo') + + ann.append(time=0, duration=0, value=value, confidence=confidence) + + ann.validate() + + + for value in [-1, -0.5, 'a', None]: + yield __test, value, 0.5 + + for confidence in [-1, -0.5, 2.0, 'a', None]: + yield __test, 120.0, confidence +
#<I> added tempo validation
marl_jams
train
py
14b516df8d9b8e12aaa8dd122d918966ebe1a72f
diff --git a/lib/styleguide.js b/lib/styleguide.js index <HASH>..<HASH> 100644 --- a/lib/styleguide.js +++ b/lib/styleguide.js @@ -143,6 +143,23 @@ function generatePugMarkup(json, options) { } } +function generateStyleguideAppStyles(opt) { + var srcFiles, + cssCopiedLib, + cssCopiedDist; + srcFiles = [distPath + '/css/_fontpath_and_mixin_definition.css']; + + if (!opt.excludeDefaultStyles) { + srcFiles.push(distPath + '/css/_styleguide_default_styles.css'); + } + + srcFiles.push(distPath + '/css/_custom_styles_mixin.css'); + gulp.src(srcFiles) + .pipe(concat('styleguide-app.css')) + .pipe(gulp.dest(libPath + '/css/')) + .pipe(gulp.dest(distPath + '/css/')); +} + function generateSectionWrapperMarkup(json) { json.section = wrapperMarkup.generateSectionWrapperMarkup(json.sections); } @@ -256,6 +273,7 @@ function filterFiles(files, filter) { } module.exports.generate = function(options) { + generateStyleguideAppStyles(options); var opt = common.sanitizeOptions(options), filesBuffer = {}, throughOpts = {
fix the bug preventing styles file to get copied into project if build is clean
SC5_sc5-styleguide
train
js
dc8af4befef663b367955ceba3614276123d85a2
diff --git a/app/controllers/neighborly/balanced/bankaccount/accounts_controller.rb b/app/controllers/neighborly/balanced/bankaccount/accounts_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/neighborly/balanced/bankaccount/accounts_controller.rb +++ b/app/controllers/neighborly/balanced/bankaccount/accounts_controller.rb @@ -19,7 +19,7 @@ module Neighborly::Balanced::Bankaccount unless customer_bank_accounts.any? { |c| c.id.eql? bank_account } unstore_all_bank_accounts # The reload here is needed because of Balanced conflit error - customer.reload.add_bank_account(resource_params.fetch(:use_bank)) + customer.reload.add_bank_account(bank_account) end end
Use bank_account variable on attach new bank account
FromUte_dune-balanced-bankaccount
train
rb
d3d4276f19d5e1961736284934b171a726a1c004
diff --git a/src/basicserial/json.py b/src/basicserial/json.py index <HASH>..<HASH> 100644 --- a/src/basicserial/json.py +++ b/src/basicserial/json.py @@ -106,15 +106,8 @@ class SimpleJsonImplementation(StdlibJsonImplementation): class OrJsonImplementation(JsonImplementation): module_name = 'orjson' - def _default(self, value): # noqa: no-self-use - if isinstance(value, OrderedDict): - return dict(value) - raise TypeError - def serialize(self, value, pretty=False): - opts = { - 'default': self._default, - } + opts = {} if pretty: opts['option'] = self._module.OPT_INDENT_2 return self._module.dumps(value, **opts).decode('utf-8')
Tweaks to orjson serialization
jayclassless_basicserial
train
py
345c691af72850ebacadb67eb4745f058d94a34b
diff --git a/src/setuptools_scm/__main__.py b/src/setuptools_scm/__main__.py index <HASH>..<HASH> 100644 --- a/src/setuptools_scm/__main__.py +++ b/src/setuptools_scm/__main__.py @@ -36,7 +36,7 @@ def main() -> None: print(fname) -def _get_cli_opts(): +def _get_cli_opts() -> argparse.Namespace: prog = "python -m setuptools_scm" desc = "Print project version according to SCM metadata" parser = argparse.ArgumentParser(prog, description=desc) @@ -67,13 +67,15 @@ def _get_cli_opts(): return parser.parse_args() -def _find_pyproject(parent): +def _find_pyproject(parent: str) -> str: for directory in walk_potential_roots(os.path.abspath(parent)): pyproject = os.path.join(directory, "pyproject.toml") - if os.path.exists(pyproject): + if os.path.isfile(pyproject): return pyproject - raise FileNotFoundError("'pyproject.toml' was not found") + return os.path.abspath( + "pyproject.toml" + ) # use default name to trigger the default errors if __name__ == "__main__":
bugfix: handle errors in pyproject for cli command finding
pypa_setuptools_scm
train
py
bc840caf4bfabe49cef73961d774fd80f01df729
diff --git a/maxquant/filters.py b/maxquant/filters.py index <HASH>..<HASH> 100644 --- a/maxquant/filters.py +++ b/maxquant/filters.py @@ -58,7 +58,7 @@ def filter_localization_probability(df, threshold=0.75): return df.iloc[localization_probability_mask, :] -def minimum_valid_values_in_group(df, levels, n=1, invalid=np.nan): +def minimum_valid_values_in_any_group(df, levels, n=1, invalid=np.nan): """ Filter dataframe by at least n valid values in at least one group.
Change name of at least n in any group function
mfitzp_padua
train
py
874688d366144bef15412d8c9274d2fa54bfcffb
diff --git a/pysolr.py b/pysolr.py index <HASH>..<HASH> 100644 --- a/pysolr.py +++ b/pysolr.py @@ -102,10 +102,16 @@ document 5 from urllib import urlencode from urlparse import urlsplit -from datetime import datetime, date import re try: + # Use Django's implementation if available because it can handle dates before 1900. + from django.utils.datetime_safe import datetime, date +except ImportError: + # Fall back to the default + from datetime import datetime, date + +try: # for python 2.5 from xml.etree import cElementTree as ET except ImportError: @@ -144,7 +150,7 @@ except NameError: __author__ = 'Joseph Kocherhans, Jacob Kaplan-Moss, Daniel Lindsley' __all__ = ['Solr'] -__version__ = (2, 0, 9) +__version__ = (2, 0, 10) def get_version(): return "%s.%s.%s" % __version__ diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from distutils.core import setup setup( name = "pysolr", - version = "2.0.8", + version = "2.0.10", description = "Lightweight python wrapper for Apache Solr.", author = 'Joseph Kocherhans', author_email = '[email protected]',
Altered pysolr to use, if available, Django's implementation of datetime for dates before <I>. Falls back to the default implementation of datetime.
django-haystack_pysolr
train
py,py
aceec7b9b9e808fe7b868658030b72b92f482e60
diff --git a/includes/os/class.BSDCommon.inc.php b/includes/os/class.BSDCommon.inc.php index <HASH>..<HASH> 100644 --- a/includes/os/class.BSDCommon.inc.php +++ b/includes/os/class.BSDCommon.inc.php @@ -425,7 +425,7 @@ abstract class BSDCommon extends OS if (defined('PSI_SHOW_VIRTUALIZER_INFO') && PSI_SHOW_VIRTUALIZER_INFO) { $vendor_array = array(); $vendor_array[] = $buffer['Model']; - $vendor_array[] = $buffer['Manufacturer']; + $vendor_array[] = trim($buffer['Manufacturer']." ".$buffer['Model']); if (PSI_OS == 'NetBSD') { // NetBSD $vendor_array[] = $this->grabkey('machdep.dmi.board-vendor'); $vendor_array[] = $this->grabkey('machdep.dmi.bios-vendor');
trim($buffer['Manufacturer']." ".$buffer['Model'])
phpsysinfo_phpsysinfo
train
php
52731991583fb9fae71080ac35f27bd5297fb147
diff --git a/lib/config.js b/lib/config.js index <HASH>..<HASH> 100644 --- a/lib/config.js +++ b/lib/config.js @@ -9,6 +9,13 @@ module.exports = class Config { this.Renderer = Renderer this.commands = {} this.infoStringParsers = [] + this.loadDefaultCommands() + } + + loadDefaultCommands () { + this.commands[':'] = function (pi) { + pi.renderer.config.parseInfoString(pi.content.trim(), pi) + } } use (plugin) { diff --git a/test/document.test.js b/test/document.test.js index <HASH>..<HASH> 100644 --- a/test/document.test.js +++ b/test/document.test.js @@ -127,6 +127,18 @@ describe('Code blocks', () => { }) }) +describe('Info strings on non-code elements', () => { + const config = new Config() + const foo = sinon.spy() + config.addInfoStringParser(/foo/, foo) + const input = unindent` + # Hello world <?: foo ?> + ` + const doc = new Document(input, config) + doc.render() + expect(foo).to.have.been.called +}) + describe('options', () => { it('should respect options', () => { const input = '<hr>'
Add command to parse info strings everywhere
hagenburger_pimd
train
js,js
7838f2cfc53523bafd4578c56905d54e918661ad
diff --git a/lib/onetime/api.rb b/lib/onetime/api.rb index <HASH>..<HASH> 100644 --- a/lib/onetime/api.rb +++ b/lib/onetime/api.rb @@ -56,7 +56,7 @@ module Onetime include HTTParty base_uri 'https://onetimesecret.com/api' format :json - headers 'X-Onetime-Client' => Onetime::API::VERSION.to_s + headers 'X-Onetime-Client' => 'ruby: %s/%s' % [RUBY_VERSION, Onetime::API::VERSION.to_s] attr_reader :opts, :response, :custid, :key, :default_params, :anonymous attr_accessor :apiversion def initialize custid=nil, key=nil, opts={}
API client sends header with ruby version and lib version
onetimesecret_onetime-ruby
train
rb
90b7d26b5fc5f5fe8bf689c13f5e884f585c5be9
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 @@ -138,7 +138,7 @@ end module Hawkular::Operations::RSpec SLEEP_SECONDS = 0.1 - MAX_ATTEMPTS = 120 + MAX_ATTEMPTS = 200 def wait_for(object) fast = WebSocketVCR.cassette && !WebSocketVCR.cassette.recording?
Increase max attempts before a timeout on the specs
hawkular_hawkular-client-ruby
train
rb
1c3271172fec2dc5d04ef4dedae481b1e0f9746f
diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php index <HASH>..<HASH> 100644 --- a/scripts/update/Updater.php +++ b/scripts/update/Updater.php @@ -466,7 +466,7 @@ class Updater extends common_ext_ExtensionUpdater if (!is_a($authService, TestTakerAuthorizationDelegator::class)) { $delegator = new TestTakerAuthorizationDelegator ([ ServiceDelegatorInterface::SERVICE_HANDLERS => [ - $authService, + new TestTakerAuthorizationService(), ], ]); $this->getServiceManager()->register(TestTakerAuthorizationInterface::SERVICE_ID, $delegator);
restore updater to except future issue with delegator
oat-sa_extension-tao-proctoring
train
php