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
56937e19080a0d26a6a20a54269ae77a673f38c9
diff --git a/test_dataclasses.py b/test_dataclasses.py index <HASH>..<HASH> 100755 --- a/test_dataclasses.py +++ b/test_dataclasses.py @@ -1197,11 +1197,19 @@ class TestCase(unittest.TestCase): self.assertEqual(c.x, 20) def test_init_var_inheritance(self): + # Note that this deliberately tests that a dataclass need not + # have a __post_init__ function if it has an InitVar field. + # It could just be used in a derived class, as shown here. @dataclass class Base: x: int init_base: InitVar[int] + # We can instantiate by passing the InitVar, even though + # it's not used. + b = Base(0, 10) + self.assertEqual(vars(b), {'x': 0}) + @dataclass class C(Base): y: int
Be explicit about allowing an InitVar even without a __post_init__().
ericvsmith_dataclasses
train
py
e93c478adc5f1524d3dc77fea53a3c4cd34fd79b
diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -113,6 +113,13 @@ class Application extends Container implements ApplicationContract, CachesConfig protected $databasePath; /** + * The custom language file path defined by the developer. + * + * @var string + */ + protected $langPath; + + /** * The custom storage path defined by the developer. * * @var string @@ -407,7 +414,30 @@ class Application extends Container implements ApplicationContract, CachesConfig */ public function langPath() { - return $this->resourcePath().DIRECTORY_SEPARATOR.'lang'; + if ($this->langPath) { + return $this->langPath; + } + + if (is_dir($path = $this->resourcePath().DIRECTORY_SEPARATOR.'lang')) { + return $path; + } + + return $this->basePath().DIRECTORY_SEPARATOR.'lang'; + } + + /** + * Set the language file directory. + * + * @param string $path + * @return $this + */ + public function useLangPath($path) + { + $this->langPath = $path; + + $this->instance('path.lang', $path); + + return $this; } /**
Lang Fallback (#<I>) * let lang be found in base directory * allow method to override lang path
laravel_framework
train
php
7c5d5b6ae7da3ab3ac72e5e229210d1ff7cced22
diff --git a/src/cst/Node.js b/src/cst/Node.js index <HASH>..<HASH> 100644 --- a/src/cst/Node.js +++ b/src/cst/Node.js @@ -90,14 +90,6 @@ export default class Node { return ch === '\n' || ch === '\t' || ch === ' ' || (endAsBlank && !ch) } - static atCollectionItem(src, offset) { - const ch = src[offset] - return ( - (ch === '?' || ch === ':' || ch === '-') && - Node.atBlank(src, offset + 1, true) - ) - } - static nextNodeIsIndented(ch, indentDiff, indicatorAsIndent) { if (!ch || indentDiff < 0) return false if (indentDiff > 0) return true
cst: Drop Node.atCollectionItem as unused since <I>a8a<I>
eemeli_yaml
train
js
9af1080d952e76260da66eba291f28829773fdba
diff --git a/src/connection.js b/src/connection.js index <HASH>..<HASH> 100644 --- a/src/connection.js +++ b/src/connection.js @@ -15,6 +15,7 @@ const RpcRequestPayload = require('./rpcrequest-payload'); const SqlBatchPayload = require('./sqlbatch-payload'); const MessageIO = require('./message-io'); const Socket = require('net').Socket; +const isIP = require('net').isIP; const dns = require('dns'); const TokenStreamParser = require('./token/token-stream-parser').Parser; const Transaction = require('./transaction').Transaction; @@ -399,7 +400,9 @@ class Connection extends EventEmitter { connectOpts.localAddress = this.config.options.localAddress; } - if (!multiSubnetFailover) { + if (isIP(connectOpts.host) || !multiSubnetFailover) { + //if no multiSubnetFailver or host is an ip address + //directly connect to first resolved ip address(by using socket.connect) this.socket.connect(connectOpts); } else { //look up both ipv4 and ipv6 addresses
check if host is ip address before use multisubnetfailover config
tediousjs_tedious
train
js
8ca4609ff851771885c5b0b2923dc6e10946d74b
diff --git a/includes/functions/functions.php b/includes/functions/functions.php index <HASH>..<HASH> 100644 --- a/includes/functions/functions.php +++ b/includes/functions/functions.php @@ -2970,7 +2970,7 @@ function get_theme_names() { static $themes; if ($themes===null) { $themes = array(); - $d = dir("themes"); + $d = dir(WT_ROOT.'themes'); while (false !== ($entry = $d->read())) { if ($entry{0}!="." && $entry!="CVS" && !stristr($entry, "svn") && is_dir(WT_ROOT.'themes/'.$entry) && file_exists(WT_ROOT.'themes/'.$entry.'/theme.php')) { $themefile = implode("", file(WT_ROOT.'themes/'.$entry.'/theme.php'));
Fix: get_theme_names() needs absolute paths, rather than relative
fisharebest_webtrees
train
php
fa2f923e4861e0c930de6e8c96b607a06bcc4398
diff --git a/Lib/fontbakery/checkrunner.py b/Lib/fontbakery/checkrunner.py index <HASH>..<HASH> 100644 --- a/Lib/fontbakery/checkrunner.py +++ b/Lib/fontbakery/checkrunner.py @@ -352,7 +352,7 @@ class CheckRunner(object): return # Do not fall through to rest of method. except Exception as e: error = FailedCheckError(e) - result = (FAIL, error) + result = (ERROR, error) yield self._check_result(result)
An exception in a check signifies an ERROR rather than a FAIL
googlefonts_fontbakery
train
py
449afa775a57042f48409bd7586b2cf27b523122
diff --git a/addon/components/spectrum-color-picker.js b/addon/components/spectrum-color-picker.js index <HASH>..<HASH> 100644 --- a/addon/components/spectrum-color-picker.js +++ b/addon/components/spectrum-color-picker.js @@ -89,5 +89,9 @@ export default Ember.Component.extend({ } this.$().spectrum(opts); - } + }, + + updatePicker: function() { + this.$().spectrum("set", this.get("color")); + }.observes("color") });
Push changes back to the picker when our data is changed.
RSSchermer_ember-spectrum-color-picker
train
js
fafa683c5cc1e736df03116b11fc5868c54e30d5
diff --git a/auth/team.go b/auth/team.go index <HASH>..<HASH> 100644 --- a/auth/team.go +++ b/auth/team.go @@ -9,7 +9,6 @@ import ( "fmt" "regexp" "strings" - "sync" "github.com/tsuru/tsuru/db" "github.com/tsuru/tsuru/log" @@ -146,20 +145,10 @@ func CheckUserAccess(teamNames []string, u *User) bool { } defer conn.Close() conn.Teams().Find(q).All(&teams) - var wg sync.WaitGroup - found := make(chan bool, len(teams)+1) for _, team := range teams { - wg.Add(1) - go func(t Team) { - if t.ContainsUser(u) { - found <- true - } - wg.Done() - }(team) - } - go func() { - wg.Wait() - found <- false - }() - return <-found + if team.ContainsUser(u) { + return true + } + } + return false }
auth: simplifying CheckUserAccess.
tsuru_tsuru
train
go
02f43e7b77a1b3e027026e0d102fd4c12497e183
diff --git a/pysat/_constellation.py b/pysat/_constellation.py index <HASH>..<HASH> 100644 --- a/pysat/_constellation.py +++ b/pysat/_constellation.py @@ -15,4 +15,6 @@ class Constellation(object): # FIXME pass - + + def __getitem__(instruments, index): + return self.instruments[index]
Added __getitem__ method
rstoneback_pysat
train
py
60fe91f499d94c2b0888458c3e3a314f23e0d170
diff --git a/test/spec/helpers/lazy_default_spec.rb b/test/spec/helpers/lazy_default_spec.rb index <HASH>..<HASH> 100644 --- a/test/spec/helpers/lazy_default_spec.rb +++ b/test/spec/helpers/lazy_default_spec.rb @@ -48,7 +48,7 @@ describe Poise::Helpers::LazyDefault do poise_sub 'test' end - it { is_expected.to run_poise_test('test').with(value: 'test_lazy') } + it { is_expected.to run_poise_sub('test').with(value: 'test_lazy') } end # /context in a subclass context 'with an external global' do
Fix test. This was only ever working by accident?
poise_poise
train
rb
5d5c1b1e03cc685d2c771b32aec32dab76ead109
diff --git a/lib/puppet/pops/issues.rb b/lib/puppet/pops/issues.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/pops/issues.rb +++ b/lib/puppet/pops/issues.rb @@ -295,8 +295,7 @@ module Puppet::Pops::Issues "Illegal expression. #{label.a_an_uc(semantic)} is unacceptable as #{feature} in #{label.a_an(container)}" end - # Issues when an expression is used where it is not legal. - # E.g. an arithmetic expression where a hostname is expected. + # Issues when a variable is not a NAME # ILLEGAL_VARIABLE_EXPRESSION = hard_issue :ILLEGAL_VARIABLE_EXPRESSION do "Illegal variable expression. #{label.a_an_uc(semantic)} did not produce a variable name (String or Numeric)."
(maint) Fix bad comment for issue ILLEGAL_VARIABLE_EXPRESSION
puppetlabs_puppet
train
rb
d32b89213722be21031abde21fb0fceff0fba2ee
diff --git a/zinnia/tests/test_templatetags.py b/zinnia/tests/test_templatetags.py index <HASH>..<HASH> 100644 --- a/zinnia/tests/test_templatetags.py +++ b/zinnia/tests/test_templatetags.py @@ -47,6 +47,7 @@ from zinnia.templatetags.zinnia_tags import get_featured_entries from zinnia.templatetags.zinnia_tags import get_calendar_entries from zinnia.templatetags.zinnia_tags import get_archives_entries from zinnia.templatetags.zinnia_tags import get_archives_entries_tree +from zinnia.templatetags.zinnia_tags import comment_admin_urlname class TemplateTagsTestCase(TestCase): @@ -817,6 +818,11 @@ class TemplateTagsTestCase(TestCase): self.assertEqual(week_number(datetime(2013, 1, 1)), '0') self.assertEqual(week_number(datetime(2013, 12, 21)), '50') + def test_comment_admin_urlname(self): + comment_admin_url = comment_admin_urlname('action') + self.assertTrue(comment_admin_url.startswith('admin:')) + self.assertTrue(comment_admin_url.endswith('_action')) + @skipIfCustomUser def test_zinnia_statistics(self): with self.assertNumQueries(8):
Testing the comment_admin_urlname template filter
Fantomas42_django-blog-zinnia
train
py
2d860dcde18b196ca2bf533d4243a8bb13e25282
diff --git a/lib/Curler/Certbot.php b/lib/Curler/Certbot.php index <HASH>..<HASH> 100755 --- a/lib/Curler/Certbot.php +++ b/lib/Curler/Certbot.php @@ -93,6 +93,10 @@ class Certbot extends Curler { foreach ($this->accounttypes as $type) { foreach ($this->accounts[$type] as $account) { + // Skip empty accounts with no visible certificates + if (!isset($account['certificates'])) { + continue; + } foreach ($account['certificates'] as $certificate) { if ($certificate['name'] == $name) { $certificate['accounttype'] = $type;
handled certbot accounts with no visible certs
metaclassing_utility
train
php
f37534d398f7c9117a0604dcd0be60a0208aa155
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -640,9 +640,10 @@ func (f *File) Name() string { const maxConcurrentRequests = 64 -// Read reads up to len(b) bytes from the File. It returns the number of -// bytes read and an error, if any. EOF is signaled by a zero count with -// err set to io.EOF. +// Read reads up to len(b) bytes from the File. It returns the number of bytes +// read and an error, if any. Read follows io.Reader semantics, so when Read +// encounters an error or EOF condition after successfully reading n > 0 bytes, +// it returns the number of bytes read. func (f *File) Read(b []byte) (int, error) { // Split the read into multiple maxPacket sized concurrent reads // bounded by maxConcurrentRequests. This allows reads with a suitably
Fixes #<I>, documentation of File.Read() Docs had it following semantics of os.File.Read when it was actually adhering to io.Reader.Read semantics.
pkg_sftp
train
go
125d18901cb0d9b76888baeb817bb57e2b57a9e4
diff --git a/lib/filterer/base.rb b/lib/filterer/base.rb index <HASH>..<HASH> 100644 --- a/lib/filterer/base.rb +++ b/lib/filterer/base.rb @@ -86,8 +86,9 @@ module Filterer def find_results @results = opts.delete(:starting_query) || starting_query add_params_to_query - return if @opts[:chainable] + return if @opts[:chainable] && !@opts[:include_ordering] order_results + return if @opts[:chainable] add_meta return if @opts[:meta_only]
Implement `include_ordering` option
dobtco_filterer
train
rb
d4e56f1d91aaf40456770dd8aeaad43507f32366
diff --git a/src/Traits/TraversalTrait.php b/src/Traits/TraversalTrait.php index <HASH>..<HASH> 100644 --- a/src/Traits/TraversalTrait.php +++ b/src/Traits/TraversalTrait.php @@ -353,6 +353,8 @@ trait TraversalTrait */ public function contents() { $results = $this->collection()->reduce(function($carry, $node) { + if($node->isRemoved()) + return $this->newNodeList(); return $carry->merge( $node->newNodeList($node->childNodes) );
Additional checks to prevent "Couldn't fetch DOMWrap\Element. Node nolonger exists
scotteh_php-dom-wrapper
train
php
e3be07cd0e2c1ce5342fc37e18b3bdb641c4468a
diff --git a/src/core/validator.js b/src/core/validator.js index <HASH>..<HASH> 100644 --- a/src/core/validator.js +++ b/src/core/validator.js @@ -25,7 +25,11 @@ export default class Validator { constructor (validations?: MapObject, options?: MapObject = { vm: null, fastExit: true }) { this.strict = STRICT_MODE; this.errors = new ErrorBag(); - ERRORS.push(this.errors); + + // We are running in SSR Mode. Do not keep a reference. It prevent garbage collection. + if (typeof window !== 'undefined') { + ERRORS.push(this.errors); + } this.fields = new FieldBag(); this.flags = {}; this._createFields(validations);
Fix Memory leak in SSR The global ERROR object keeps references to the errors objects. This prevent the garbage collector from freeing the memory. This fix simply check if a window exists (if yes we are running in the browser) else we are in SSR. Do not add the error object to the ERROR const global variable to allow GC cleanup.
baianat_vee-validate
train
js
56c74eaec8ac31abf1bd5e8605a2838b291d257b
diff --git a/lib/commands/help.js b/lib/commands/help.js index <HASH>..<HASH> 100644 --- a/lib/commands/help.js +++ b/lib/commands/help.js @@ -1,5 +1,6 @@ var Chalk = require('chalk'); var Promise = require('es6-promise').Promise; +var Pkg = require('../../package.json'); exports.help = [ 'Print the help text' @@ -7,8 +8,9 @@ exports.help = [ exports.run = function (config) { + var header = Chalk.bold('requireSafe(+)') + ' v' + Pkg.version + '\n\n'; var helpText; - var fullHelp = Object.keys(config.commands).map(function (cmd) { + var fullHelp = header + Object.keys(config.commands).map(function (cmd) { return [ ' ' + Chalk.bold(cmd),
adds the version # to the help header cause it's useful
nodesecurity_nsp
train
js
7e3f781adab857b6c07aea6af3a04d0abfd8cfd2
diff --git a/dallinger/config.py b/dallinger/config.py index <HASH>..<HASH> 100644 --- a/dallinger/config.py +++ b/dallinger/config.py @@ -44,7 +44,7 @@ default_keys = ( ('dyno_type', unicode, []), ('heroku_email_address', unicode, [], True), ('heroku_password', unicode, [], True), - ('heroku_team', unicode, []), + ('heroku_team', unicode, ['team']), ('host', unicode, []), ('port', int, ['PORT']), ('lifetime', int, []),
Make 'team' a synonym of 'heroku_team' (To improve backwards-compatibility with versions 2.x.)
Dallinger_Dallinger
train
py
b9928512cfc00ad62f2c97bbc4f79f6243f859f9
diff --git a/lib/puppet/reference/providers.rb b/lib/puppet/reference/providers.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/reference/providers.rb +++ b/lib/puppet/reference/providers.rb @@ -13,11 +13,10 @@ providers = Puppet::Util::Reference.newreference :providers, :title => "Provider ret = "Details about this host:\n\n" # Throw some facts in there, so we know where the report is from. - ["Ruby Version", "Puppet Version", "Operating System", "Operating System Release"].each do |label| - name = label.gsub(/\s+/, '') - value = Facter.value(name) - ret << option(label, value) - end + ret << option('Ruby Version', Facter.value('ruby.version')) + ret << option('Puppet Version', Facter.value('puppetversion')) + ret << option('Operating System', Facter.value('os.name')) + ret << option('Operating System Release', Facter.value('os.release.full')) ret << "\n" count = 1
(PUP-<I>) Use structured facts in the providers report
puppetlabs_puppet
train
rb
8bd0449ad83ff10abfa783b58c3bbba0b18bcf79
diff --git a/src/OrgManager.php b/src/OrgManager.php index <HASH>..<HASH> 100644 --- a/src/OrgManager.php +++ b/src/OrgManager.php @@ -78,6 +78,17 @@ class OrgManager } /** + * @param string $id + * @param string $password + * + * @return array + */ + public function changeOrgPassword($id, $password) + { + return $this->post('/org/'.$id, ['password' => $password]); + } + + /** * @param string $resource * @param array $query * @@ -143,7 +154,7 @@ class OrgManager $data['headers'] = ['Authorization' => 'Bearer '.$this->apiToken]; $data['json'] = $rawdata; $results = $this->client - ->delete("{$this->baseUrl}{$resource}", $data) + ->request('DELETE', "{$this->baseUrl}{$resource}", $data) ->getBody() ->getContents(); return json_decode($results, true);
Add a function to change Organization Password
orgmanager_php-orgmanager-api
train
php
f05937411e2c30711d2c9c819c448caf33e4e7be
diff --git a/src/org/zaproxy/zap/extension/api/API.java b/src/org/zaproxy/zap/extension/api/API.java index <HASH>..<HASH> 100644 --- a/src/org/zaproxy/zap/extension/api/API.java +++ b/src/org/zaproxy/zap/extension/api/API.java @@ -132,10 +132,12 @@ public class API { } } String path = requestHeader.getURI().getPath(); - for (Entry<String, ApiImplementor> shortcut : shortcuts.entrySet()) { - if (path.startsWith(shortcut.getKey())) { - shortcutImpl = shortcut.getValue(); - break; + if (path != null) { + for (Entry<String, ApiImplementor> shortcut : shortcuts.entrySet()) { + if (path.startsWith(shortcut.getKey())) { + shortcutImpl = shortcut.getValue(); + break; + } } }
Issue <I> - NullPointerException while proxying with a URI with an empty path component Changed to check if the URI path component is not null before using it.
zaproxy_zaproxy
train
java
bd1d41b83c06b05c40d510187f8e2c397d5cbace
diff --git a/dosagelib/rss.py b/dosagelib/rss.py index <HASH>..<HASH> 100644 --- a/dosagelib/rss.py +++ b/dosagelib/rss.py @@ -50,7 +50,7 @@ class Feed(object): def write(self, path): """Write RSS content to file.""" - with open(path, 'w') as f: + with open(path, 'wb') as f: f.write(self.getXML()) def getXML(self):
Write encoded data in binary format.
wummel_dosage
train
py
12749e3c411750f754d50f093471234c7ab270b0
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -10,10 +10,17 @@ var typeOf = require('kind-of'); module.exports = function isNumber(num) { + if (!num && num !== 0) return false; + var type = typeOf(num); if (type !== 'number' && type !== 'string') { return false; } + if (type === 'string') { + num = num.trim(); + if (!num.length) return false; + } + var n = +num; - return (n - n + 1) >= 0 && num !== ''; + return (n - n + 1) >= 0; }; diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -40,6 +40,7 @@ var shouldPass = [ '10.10', '100', '5e3', + ' 56\r\n ', // issue#3 Math.LN2, Number(1), @@ -109,6 +110,8 @@ var shouldPass = [ ]; var shouldFail = [ + ' ', // issue#3 + '\r\n\t', // issue#3 '', '3a', 'abc',
fixes #3 and add tests for it, micro optimization
jonschlinkert_is-number
train
js,js
c778e1edc864f1daabd2efe25c74e53f4f8ffe65
diff --git a/indra/bel/processor.py b/indra/bel/processor.py index <HASH>..<HASH> 100644 --- a/indra/bel/processor.py +++ b/indra/bel/processor.py @@ -241,12 +241,13 @@ class BelProcessor(object): sub_name = gene_name_from_uri(stmt[1]) sub = Agent(sub_name) mod = term_from_uri(stmt[2]) + residue = self._get_residue(mod) mod_pos = term_from_uri(stmt[3]) stmt_str = strip_statement(stmt[4]) # Mark this as a converted statement self.converted_stmts.append(stmt_str) self.statements.append( - Dephosphorylation(phos, sub, mod, mod_pos, evidence)) + Dephosphorylation(phos, sub, residue, mod_pos, evidence)) def get_composite_activating_mods(self): # To eliminate multiple matches, we use pos1 < pos2 but this will
Fix bug in processing dephosphorylation stmts
sorgerlab_indra
train
py
9e43ec32185ed528a047131dbf9ba6f6d9573e23
diff --git a/src/util/index.js b/src/util/index.js index <HASH>..<HASH> 100644 --- a/src/util/index.js +++ b/src/util/index.js @@ -7,7 +7,6 @@ export aria from './aria' export DOM from './DOM' export role from './role' export browser from './browser' -export testRules from './test-rules' export const devices = { screenReaders: Symbol('screenReaders') diff --git a/test/rules.js b/test/rules.js index <HASH>..<HASH> 100644 --- a/test/rules.js +++ b/test/rules.js @@ -3,9 +3,9 @@ import ReactDOM from 'react-dom' import path from 'path' import rules from '../src/rules' -import { - testRules -} from '../src/util' +import testRules from '../src/util/test-rules' + +// const ctx = require.context('../src/rules', true, /\.js$/) testRules({ React
remove test-rules from source tree, so it doen't show warnings and need chai
reactjs_react-a11y
train
js,js
00ac10b20b4f7ada79ee661d4b16e13836cd562a
diff --git a/tests/Entity/EntityCollectionTest.php b/tests/Entity/EntityCollectionTest.php index <HASH>..<HASH> 100644 --- a/tests/Entity/EntityCollectionTest.php +++ b/tests/Entity/EntityCollectionTest.php @@ -41,6 +41,9 @@ class EntityCollectionTest extends TestCase */ public function acceptOnlyEntities() { + if (version_compare(PHP_VERSION, '7.0.0') >= 0) { + $this->markTestSkipped('Type check not necessary here.'); + } $this->assertSame( $this->entities, $this->entities->add(new Person(['id' => 2]))
Skiping tests for PHP 7 type check.
slickframework_orm
train
php
a9a51c7e13e014b2c6de47417c1ca6484346eb06
diff --git a/raiden_contracts/contract_source_manager.py b/raiden_contracts/contract_source_manager.py index <HASH>..<HASH> 100644 --- a/raiden_contracts/contract_source_manager.py +++ b/raiden_contracts/contract_source_manager.py @@ -60,6 +60,7 @@ class ContractSourceManager: import_remappings=import_dir_map, optimize=True, optimize_runs=200, + no_optimize_yul=True ) ret.update(_fix_contract_key_names(res))
Disable yul optimizations Without this the optimizer will hit stack errors in the next commits.
raiden-network_raiden-contracts
train
py
b240b07a9d5b539157b651d23e6fd51819021e5c
diff --git a/configure.py b/configure.py index <HASH>..<HASH> 100755 --- a/configure.py +++ b/configure.py @@ -300,6 +300,9 @@ ninja_test = n.build(binary('ninja_test'), 'link', objs, implicit=ninja_lib, n.newline() all_targets += ninja_test +if platform == 'windows': + n.build('ninja_test', 'phony', binary('ninja_test')) + n.comment('Perftest executable.') objs = cxx('parser_perftest') parser_perftest = n.build(binary('parser_perftest'), 'link', objs,
Provide 'ninja_test' as alias for 'ninja_test.exe' on windows.
ninja-build_ninja
train
py
aadde18cb2c74b743a65a2832e65363f78aede20
diff --git a/model/RelationshipIndex.js b/model/RelationshipIndex.js index <HASH>..<HASH> 100644 --- a/model/RelationshipIndex.js +++ b/model/RelationshipIndex.js @@ -1,3 +1,4 @@ +import { uuid } from '../util' import DocumentIndex from './DocumentIndex' export default class RelationshipIndex extends DocumentIndex { @@ -5,6 +6,7 @@ export default class RelationshipIndex extends DocumentIndex { super() this.reverseIndex = new Map() + this.sha = uuid() } select (node) { @@ -13,6 +15,7 @@ export default class RelationshipIndex extends DocumentIndex { clear () { this.reverseIndex.clear() + this._updateSha() } get (id) { @@ -76,6 +79,7 @@ export default class RelationshipIndex extends DocumentIndex { this.reverseIndex.set(id, refs) } refs.add(ref) + this._updateSha() } _remove (id, ref) { @@ -83,6 +87,12 @@ export default class RelationshipIndex extends DocumentIndex { const refs = this.reverseIndex.get(id) if (refs) { refs.delete(ref) + this._updateSha() } } + + _updateSha () { + // console.log('RelationshipIndex._updateSha()') + this.sha = uuid() + } }
Introduce a sha stamp for RelationshipIndex.
substance_substance
train
js
6990f142986af5a4d5372b3a990147db9073307d
diff --git a/lib/codemirror.js b/lib/codemirror.js index <HASH>..<HASH> 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -3665,7 +3665,8 @@ setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex), {scroll: false, origin: "*mouse"}); } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == "single" && !e.shiftKey) { - setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0)); + setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), + {scroll: false, origin: "*mouse"}); startSel = doc.sel; } else { replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);
Don't scroll selection into view when removing a cursor Closes #<I>
codemirror_CodeMirror
train
js
94690b7856bf1e8637732f878e96794eeefd79f9
diff --git a/code/authenticators/LDAPAuthenticator.php b/code/authenticators/LDAPAuthenticator.php index <HASH>..<HASH> 100644 --- a/code/authenticators/LDAPAuthenticator.php +++ b/code/authenticators/LDAPAuthenticator.php @@ -147,10 +147,10 @@ class LDAPAuthenticator extends Authenticator * Try to authenticate using the fallback authenticator. * * @param array $data - * @param Form $form + * @param null|Form $form * @return null|Member */ - protected static function fallback_authenticate($data, Form $form) + protected static function fallback_authenticate($data, Form $form = null) { return call_user_func( array(Config::inst()->get('LDAPAuthenticator', 'fallback_authenticator_class'), 'authenticate'),
$form can sometimes be null. Allow this
silverstripe_silverstripe-activedirectory
train
php
1f03e8667a4d199d2a087682ea07ce27a6da655e
diff --git a/blockmanager.go b/blockmanager.go index <HASH>..<HASH> 100644 --- a/blockmanager.go +++ b/blockmanager.go @@ -1007,6 +1007,10 @@ func (b *blockManager) handleHeadersMsg(hmsg *headersMsg) { log.Tracef("Writing header batch of %v block headers", len(headerWriteBatch)) + if len(headerWriteBatch) == 0 { + log.Warnf("Headers message does not connect to main chain") + return + } // With all the headers in this batch validated, we'll write them all // in a single transaction such that this entire batch is atomic. @@ -1326,7 +1330,7 @@ func (b *blockManager) handleProcessCFHeadersMsg(msg *processCFHeadersMsg) { } } - log.Tracef("Writing fitler batch of %v filter headers", + log.Tracef("Writing filter batch of %v filter headers", len(headerWriteBatch)) // With all the headers in this batch validated, we'll write them all
neutrino: ensure nil chain tip isn't written in case of orphan inv
lightninglabs_neutrino
train
go
f9190d86044ceb93d2b894d0614bb3584cc10182
diff --git a/polyinterface/__init__.py b/polyinterface/__init__.py index <HASH>..<HASH> 100644 --- a/polyinterface/__init__.py +++ b/polyinterface/__init__.py @@ -6,3 +6,5 @@ __url__ = 'https://github.com/UniversalDevicesInc/polyglot-v2-python-int __author__ = 'James Milne' __authoremail__ = '[email protected]' __license__ = 'MIT' + +LOGGER.info('{} {} Starting...'.format(__description__,__version__)) diff --git a/polyinterface/polyinterface.py b/polyinterface/polyinterface.py index <HASH>..<HASH> 100644 --- a/polyinterface/polyinterface.py +++ b/polyinterface/polyinterface.py @@ -71,7 +71,6 @@ LOGGER = setup_log() sys.stdout = LoggerWriter(LOGGER.debug) sys.stderr = LoggerWriter(LOGGER.error) -LOGGER.info('Polyglot v2 Interface Starting...') """ Grab the ~/.polyglot/.env file for variables If you are running Polyglot v2 on this same machine
Move printing of Starting... message to __init__ and print version
UniversalDevicesInc_polyglot-v2-python-interface
train
py,py
071c393e3f4489b801102147889aac99be9db2ca
diff --git a/src/Captioning/Format/SubstationalphaFile.php b/src/Captioning/Format/SubstationalphaFile.php index <HASH>..<HASH> 100644 --- a/src/Captioning/Format/SubstationalphaFile.php +++ b/src/Captioning/Format/SubstationalphaFile.php @@ -56,6 +56,7 @@ class SubstationalphaFile extends File 'MarginL' => 15, 'MarginR' => 15, 'MarginV' => 15, + 'AlphaLevel' => 0, 'Encoding' => 0 ); @@ -102,6 +103,23 @@ class SubstationalphaFile extends File return $this->styles; } + public function setStyles($_styles) + { + $this->styles = $_styles; + } + + public function setEvents($_events) + { + if (!empty($_events) && is_array($_events)) { + $this->events = $_events; + } + } + + public function getEvents() + { + return $this->events; + } + public function addComment($_comment) { $this->comments[] = $_comment;
Added possibility to change styles and events + add AlphaLevel to default styles
captioning_captioning
train
php
2853a7ae0548cf898f0acebe3e7df7ceb92a0025
diff --git a/paramiko/transport.py b/paramiko/transport.py index <HASH>..<HASH> 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -51,7 +51,7 @@ from paramiko.ssh_exception import SSHException, BadAuthenticationType # PyCrypt compiled for Win32 can be downloaded from the HashTar homepage: # http://nitace.bsd.uchicago.edu:8080/hashtar from Crypto.Cipher import Blowfish, AES, DES3 -from Crypto.Hash import SHA, MD5, HMAC +from Crypto.Hash import SHA, MD5 # for thread cleanup
[project @ <EMAIL><I>-<I>d<I>bf<I>ac5b] Transport doesn't need HMAC
bitprophet_ssh
train
py
665599673d168752652c31fe9a7798a5c616b821
diff --git a/hybrid.php b/hybrid.php index <HASH>..<HASH> 100644 --- a/hybrid.php +++ b/hybrid.php @@ -24,7 +24,7 @@ * to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * @package HybridCore - * @version 1.5.5-alpha + * @version 1.5.5 * @author Justin Tadlock <[email protected]> * @copyright Copyright (c) 2008 - 2013, Justin Tadlock * @link http://themehybrid.com/hybrid-core
Version bump to <I>.
justintadlock_hybrid-core
train
php
85c462847a564abd20e5c8aaa12b0d150de12d1e
diff --git a/ninio-core/src/test/java/com/davfx/ninio/core/TcpdumpTest.java b/ninio-core/src/test/java/com/davfx/ninio/core/TcpdumpTest.java index <HASH>..<HASH> 100644 --- a/ninio-core/src/test/java/com/davfx/ninio/core/TcpdumpTest.java +++ b/ninio-core/src/test/java/com/davfx/ninio/core/TcpdumpTest.java @@ -4,6 +4,7 @@ import java.io.IOException; import java.nio.ByteBuffer; import org.assertj.core.api.Assertions; +import org.junit.Ignore; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -18,6 +19,7 @@ public class TcpdumpTest { private static final Logger LOGGER = LoggerFactory.getLogger(TcpdumpTest.class); + @Ignore @Test public void test() throws Exception { System.setProperty("ninio.tcpdump.mode", "hex"); // raw not working on Mac OS X
Ignoring too much machine-dependent test
davidfauthoux_ninio
train
java
d5064399fc1b3ea37af2837edf2156a2307f23eb
diff --git a/src/models/application.js b/src/models/application.js index <HASH>..<HASH> 100644 --- a/src/models/application.js +++ b/src/models/application.js @@ -81,9 +81,9 @@ var getApplicationByName = function(s_apps, name) { if(filtered_apps.length === 1) { return Bacon.once(filtered_apps[0]); } else if(filtered_apps.length === 0) { - return Bacon.once(new Bacon.Error("Ambiguous application name")); - } else { return Bacon.once(new Bacon.Error("Application not found")); + } else { + return Bacon.once(new Bacon.Error("Ambiguous application name")); } }); diff --git a/src/models/organisation.js b/src/models/organisation.js index <HASH>..<HASH> 100644 --- a/src/models/organisation.js +++ b/src/models/organisation.js @@ -16,9 +16,9 @@ Organisation.getByName = function(api, name) { if(filtered_orgs.length === 1) { return Bacon.once(filtered_orgs[0]); } else if(filtered_orgs.length === 0) { - return Bacon.once(new Bacon.Error("Ambiguous organisation name")); - } else { return Bacon.once(new Bacon.Error("Organisation not found")); + } else { + return Bacon.once(new Bacon.Error("Ambiguous organisation name")); } });
Switch ambiguous / not found error messages When linking an app, the ambiguous / not found error messages were switched around
CleverCloud_clever-tools
train
js,js
5a2b1c9c3166781afc7aac17867b93aa3552b542
diff --git a/Http/HeaderBagTest.php b/Http/HeaderBagTest.php index <HASH>..<HASH> 100644 --- a/Http/HeaderBagTest.php +++ b/Http/HeaderBagTest.php @@ -29,7 +29,7 @@ use Queryyetsimple\Http\HeaderBag; * @version 1.0 * @see Symfony\Component\HttpFoundation (https://github.com/symfony/symfony) */ -class JsonResponseTest extends TestCase +class HeaderBagTest extends TestCase { public function testConstructor() {
whoops and Collision is coming
hunzhiwange_framework
train
php
130bccc7630a6f6ec7990900bc9dc9bce410a6ad
diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go index <HASH>..<HASH> 100644 --- a/cmd/utils/cmd.go +++ b/cmd/utils/cmd.go @@ -73,15 +73,13 @@ func StartNode(stack *node.Node) { <-sigc glog.V(logger.Info).Infoln("Got interrupt, shutting down...") go stack.Stop() - logger.Flush() for i := 10; i > 0; i-- { <-sigc if i > 1 { - glog.V(logger.Info).Infoln("Already shutting down, please be patient.") - glog.V(logger.Info).Infoln("Interrupt", i-1, "more times to induce panic.") + glog.V(logger.Info).Infof("Already shutting down, interrupt %d more times for panic.", i-1) } } - glog.V(logger.Error).Infof("Force quitting: this might not end so well.") + debug.Exit() // ensure trace and CPU profile data is flushed. debug.LoudPanic("boom") }() }
cmd/utils: flush trace and CPU profile data when force-qutting Also reduce log messages a little bit.
ethereum_go-ethereum
train
go
6f7b03d53750aad5d9e75a09744c13a3f5a34439
diff --git a/zsl/utils/string_helper.py b/zsl/utils/string_helper.py index <HASH>..<HASH> 100644 --- a/zsl/utils/string_helper.py +++ b/zsl/utils/string_helper.py @@ -28,13 +28,8 @@ def underscore_to_camelcase(value): >>> underscore_to_camelcase('camel_case') 'camelCase' """ - def camelcase(): - while True: - yield str.capitalize - value = str(value) - c = camelcase() - return "".join(c.next()(x) if x else '_' for x in value.split("_")) + return "".join(x.title() if x else '_' for x in value.split("_")) def camelcase_to_underscore(name):
FIX underscore_to_camelcase in python 3
AtteqCom_zsl
train
py
463a2ea05b34d46c600aec162b6b0b6f14fd6315
diff --git a/lib/mincer/helpers/paths.js b/lib/mincer/helpers/paths.js index <HASH>..<HASH> 100644 --- a/lib/mincer/helpers/paths.js +++ b/lib/mincer/helpers/paths.js @@ -89,7 +89,7 @@ module.exports.clearPaths = function () { var trail = this.__trail__; this.paths.forEach(function (path) { - trail.remove(path); + trail.paths.remove(path); }); };
Fix #clearPaths mixin
nodeca_mincer
train
js
3fe81bbdaec330f1bd9a72bf63f1ab4c380bd840
diff --git a/lib/domv.js b/lib/domv.js index <HASH>..<HASH> 100644 --- a/lib/domv.js +++ b/lib/domv.js @@ -473,7 +473,7 @@ module.exports.shorthand = function(document, tagName) var fn = domv.create; var thisObj = this; var shorthandArguments = slice.call(arguments, 2); - var ret; + var shorthandInstance; if (document.isDOMVComponent) { @@ -497,7 +497,7 @@ module.exports.shorthand = function(document, tagName) return document.__domv__shorthandCache[tagName]; } - ret = function(a0, a1, a2, a3, a4) + shorthandInstance = function(a0, a1, a2, a3, a4) { if (arguments.length <= 5) { @@ -529,10 +529,10 @@ module.exports.shorthand = function(document, tagName) document.__domv__shorthandCache = Object.create(null); } - document.__domv__shorthandCache[tagName] = ret; + document.__domv__shorthandCache[tagName] = shorthandInstance; } - return ret; + return shorthandInstance; }; /** Creates a new wrapped TextNode.
Rename of a function to make debugging easier
Joris-van-der-Wel_domv
train
js
1c5876d468b9a50ecade4ec6cb90e1a2c642b68d
diff --git a/components/commit/commit.js b/components/commit/commit.js index <HASH>..<HASH> 100644 --- a/components/commit/commit.js +++ b/components/commit/commit.js @@ -42,7 +42,7 @@ function CommitViewModel(gitNode) { this.diffStyle = ko.computed(function() { var marginLeft = Math.min((gitNode.branchOrder() * 70), 450) * -1; if (self.selected() && self.element()) return { "margin-left": marginLeft + 'px', width: (window.innerWidth - 220) + 'px' }; - else return { left: '0px', width: self.element() ? ((self.element().clientWidth - 20) + 'px') : 'inherit' }; + else return {}; }); } CommitViewModel.prototype.updateNode = function(parentElement) {
fix commit detail layout while hovering over commit node
FredrikNoren_ungit
train
js
8cfd14663057593b1215047a2110fecd54d8d3bd
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -5,5 +5,5 @@ export default function(Vue) { } export function timer(name, time, options) { - return Object.assign({ name: name, time: time }, options) + return mixin.assign({ name: name, time: time }, options) } diff --git a/mixin.js b/mixin.js index <HASH>..<HASH> 100644 --- a/mixin.js +++ b/mixin.js @@ -1,3 +1,4 @@ +// jshint esversion: 6, asi: true import { set } from './utils' function generateData(timers) { @@ -135,5 +136,21 @@ export default { Object.keys(vm.$options.timers).forEach(function(key) { vm.$timer.stop(key) }) + }, + + /** + * Polyfill for Object.assign for IE11 support + */ + assign: function (){ + var assign = Object.assign || function assign(to) { + for (var s = 1; s < arguments.length; s += 1) { + var from = arguments[s] + for (var key in from) { + to[key] = from[key] + } + } + return to + } + return assign } }
added ie<I>-polyfill Object.assign isn't supported by IE<I>. See reference: <URL>
Kelin2025_vue-timers
train
js,js
66a3af96177920e73f0461ed713d77a2dd6f1e58
diff --git a/asammdf/mdf.py b/asammdf/mdf.py index <HASH>..<HASH> 100644 --- a/asammdf/mdf.py +++ b/asammdf/mdf.py @@ -881,6 +881,9 @@ class MDF(object): """ export *MDF* to other formats. The *MDF* file name is used is available, else the *filename* argument must be provided. + The *pandas* export option was removed. you should use the method + *to_dataframe* instead. + Parameters ---------- fmt : string
document the removal of "pandas" export option
danielhrisca_asammdf
train
py
61f59c8b939d438ccf7e8fccb28286545d2e624e
diff --git a/src/lib/YandexMoney/ApiRequestor.php b/src/lib/YandexMoney/ApiRequestor.php index <HASH>..<HASH> 100644 --- a/src/lib/YandexMoney/ApiRequestor.php +++ b/src/lib/YandexMoney/ApiRequestor.php @@ -48,15 +48,20 @@ class YM_ApiRequestor { } private function _interpretResponse($rbody, $rcode) { + if ($rcode < 200 || $rcode >= 300) { + $this->_handleApiError($rbody, $rcode, $resp); + } + try { - $resp = json_decode($rbody, true); + $resp = json_decode($rbody, true); } catch (Exception $e) { throw new YM_ApiError("Invalid response body from API: $rbody (HTTP response code was $rcode)", $rcode, $rbody); - } + } - if ($rcode < 200 || $rcode >= 300) { - $this->_handleApiError($rbody, $rcode, $resp); + if ($resp === null) { + throw new YM_ApiError("Server response body is null: $rbody (HTTP response code was $rcode)", $rcode, $rbody); } + return $resp; }
Fixed bug with fake succes results because of null response body although response code == <I>.
romkavt_yandex-money-sdk-php
train
php
4ad4cbe64596f1da57cc986262e103560fe6104e
diff --git a/src/Excel.php b/src/Excel.php index <HASH>..<HASH> 100644 --- a/src/Excel.php +++ b/src/Excel.php @@ -106,8 +106,8 @@ class Excel { string $path = '', array $options = [], array $columnDataTypes = [], - array $styles = [], - array $columnsWithCustomNumberFormats = [] ) { + array $columnsWithCustomNumberFormats = [], + array $styles = [] ) { try { $numeric_columns = [];
Changed order of passed params
DPRMC_Excel
train
php
50b701f5b3731ce19b6da811b8a7db845fb1db52
diff --git a/src/Providers/ContactsServiceProvider.php b/src/Providers/ContactsServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Providers/ContactsServiceProvider.php +++ b/src/Providers/ContactsServiceProvider.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Rinvex\Contacts\Providers; +use Rinvex\Contacts\Models\Contact; use Illuminate\Support\ServiceProvider; use Rinvex\Contacts\Console\Commands\MigrateCommand; @@ -26,10 +27,11 @@ class ContactsServiceProvider extends ServiceProvider // Merge config $this->mergeConfigFrom(realpath(__DIR__.'/../../config/config.php'), 'rinvex.contacts'); - // Register eloquent models + // Bind eloquent models to IoC container $this->app->singleton('rinvex.contacts.contact', function ($app) { return new $app['config']['rinvex.contacts.models.contact'](); }); + $this->app->alias('rinvex.contacts.contact', Contact::class); // Register artisan commands foreach ($this->commands as $key => $value) {
Bind model alias into IoC container
rinvex_laravel-contacts
train
php
953afc77ce02cada280247b57b0cae1077b7d592
diff --git a/xmp.py b/xmp.py index <HASH>..<HASH> 100755 --- a/xmp.py +++ b/xmp.py @@ -156,7 +156,7 @@ Userspace nullfs-alike: mirror the filesystem tree from some point on. """ + Fuse.fusage server = Xmp(version="%prog " + fuse.__version__, - usage=usage), + usage=usage, dash_s_do='setsingle') server.parser.add_option(mountopt="root", metavar="PATH", default='/', type=str,
fix typo in xmp.py
libfuse_python-fuse
train
py
9e61c6cb8bee334911711a4f8a771d9a72e8f568
diff --git a/js/app.js b/js/app.js index <HASH>..<HASH> 100644 --- a/js/app.js +++ b/js/app.js @@ -369,6 +369,8 @@ YoastSEO.App.prototype.runAnalyzer = function() { this.analyzerData.queue = [ "keyWordCheck", "wordCount", "fleschReading", "pageTitleLength", "urlStopwords", "metaDescriptionLength" ]; } + this.analyzerData.keyword = keyword; + if ( typeof this.pageAnalyzer === "undefined" ) { this.pageAnalyzer = new YoastSEO.Analyzer( this.analyzerData );
send sanitized keyword to the analyser.
Yoast_YoastSEO.js
train
js
ff3eff6f1f89e37c859dfef1e7a20ee7ffac5eca
diff --git a/core/teo.app.js b/core/teo.app.js index <HASH>..<HASH> 100644 --- a/core/teo.app.js +++ b/core/teo.app.js @@ -301,10 +301,6 @@ class App extends Base { throw new Error("Protocol is not set in the server config"); } - if (!serverConfig.host) { - throw new Error("Host is not set in the server config"); - } - if (!serverConfig.port) { throw new Error("Port is not set in the server config"); } diff --git a/test/specs/core/teo.app.spec.js b/test/specs/core/teo.app.spec.js index <HASH>..<HASH> 100644 --- a/test/specs/core/teo.app.spec.js +++ b/test/specs/core/teo.app.spec.js @@ -198,21 +198,6 @@ describe("Testing Teo App", () => { })); - it("Should throw an error if no host", async(function* () { - - configStub.withArgs("server").returns({ - protocol: "smth", - host: undefined - }); - - try { - yield* app.createServer(); - } catch(e) { - assert.equal(e.message, "Host is not set in the server config"); - } - - })); - it("Should throw an error if no port", async(function* () { configStub.withArgs("server").returns({
allow to omit host in config
Antyfive_teo.js
train
js,js
3df7af085ac3c02f913aca99232c797227ba9df3
diff --git a/lib/ronin/platform/overlay.rb b/lib/ronin/platform/overlay.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/platform/overlay.rb +++ b/lib/ronin/platform/overlay.rb @@ -170,7 +170,8 @@ module Ronin @repository = begin Pullr::LocalRepository.new( :path => self.path, - :scm => self.scm + :scm => self.scm, + :uri => self.uri ) rescue Pullr::AmbigiousRepository nil
Pass the Overlay's URI into LocalRepository.new. * This is for rsync repositories, that need a URI to update against.
ronin-ruby_ronin
train
rb
2a17867ce2fe7049c7bc1c4b5ae7b7c325dce846
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ def read(fname): setup( name="nosebook", - version="0.2.0", + version="0.3.0", author="Nicholas Bollweg", author_email="[email protected]", description="a nose plugin for IPython notebooks",
whoops, too much entropy
bollwyvl_nosebook
train
py
2eadb7e54a3ddc0a0187d2bda6a09d02731c5726
diff --git a/src/transformers/models/visual_bert/modeling_visual_bert.py b/src/transformers/models/visual_bert/modeling_visual_bert.py index <HASH>..<HASH> 100755 --- a/src/transformers/models/visual_bert/modeling_visual_bert.py +++ b/src/transformers/models/visual_bert/modeling_visual_bert.py @@ -929,7 +929,7 @@ class VisualBertForPreTraining(VisualBertPreTrainedModel): tokenizer = BertTokenizer.from_pretrained("bert-base-uncased") model = VisualBertForPreTraining.from_pretrained("uclanlp/visualbert-vqa-coco-pre") - inputs = tokenizer("The capital of France is {mask}.", return_tensors="pt") + inputs = tokenizer("The capital of France is [MASK].", return_tensors="pt") visual_embeds = get_visual_embeddings(image).unsqueeze(0) visual_token_type_ids = torch.ones(visual_embeds.shape[:-1], dtype=torch.long) visual_attention_mask = torch.ones(visual_embeds.shape[:-1], dtype=torch.float)
Fix mask token in the example (#<I>) VIsualBert uses bert-base-uncased tokenizer, therefore, instead of {mask}, the mask token should be [MASK]
huggingface_pytorch-pretrained-BERT
train
py
161550b2d2fd1a6da90c0b299f0f52b105f33d89
diff --git a/examples/63-server-streaming-request.php b/examples/63-server-streaming-request.php index <HASH>..<HASH> 100644 --- a/examples/63-server-streaming-request.php +++ b/examples/63-server-streaming-request.php @@ -9,7 +9,8 @@ $loop = Factory::create(); // Note how this example uses the advanced `StreamingRequestMiddleware` to allow streaming // the incoming HTTP request. This very simple example merely counts the size // of the streaming body, it does not otherwise buffer its contents in memory. -$server = new React\Http\Server(array( +$server = new React\Http\Server( + $loop, new React\Http\Middleware\StreamingRequestMiddleware(), function (Psr\Http\Message\ServerRequestInterface $request) { $body = $request->getBody(); @@ -44,7 +45,7 @@ $server = new React\Http\Server(array( }); }); } -)); +); $server->on('error', 'printf');
Update example <I> to support <I>+ Add LoopInterface as first constructor argument to Server and change Server to accept variadic middleware handlers instead of array.
reactphp_http
train
php
035eaf86cd29bf28ee245fca31ed8c054acbf061
diff --git a/src/main/java/com/indeed/proctor/webapp/controllers/ProctorTestDefinitionController.java b/src/main/java/com/indeed/proctor/webapp/controllers/ProctorTestDefinitionController.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/indeed/proctor/webapp/controllers/ProctorTestDefinitionController.java +++ b/src/main/java/com/indeed/proctor/webapp/controllers/ProctorTestDefinitionController.java @@ -384,10 +384,10 @@ public class ProctorTestDefinitionController extends AbstractController { log("(svn) delete " + testName); store.deleteTestDefinition(username, password, srcRevision, testName, definition, fullComment); - for (Environment otherEnvironment : Environment.values()) { + for (final Environment otherEnvironment : Environment.values()) { if (otherEnvironment != source) { final ProctorStore otherStore = determineStoreFromEnvironment(otherEnvironment); - TestDefinition otherDefinition = getTestDefinition(otherStore, testName); + final TestDefinition otherDefinition = getTestDefinition(otherStore, testName); if (otherDefinition != null) { addUrl("/proctor/definition/" + UtilityFunctions.urlEncode(testName) + "?branch=" + otherEnvironment.getName(), "view " + testName + " on " + otherEnvironment.getName()); }
jira/PROW-<I> Make some local variables final according to code review.
indeedeng_proctor
train
java
02f37a34eec3d45541f9843361c063a662ba6c92
diff --git a/tracker_scraper.go b/tracker_scraper.go index <HASH>..<HASH> 100644 --- a/tracker_scraper.go +++ b/tracker_scraper.go @@ -138,12 +138,17 @@ func (me *trackerScraper) Run() { me.t.cl.unlock() wait: - interval := time.Until(ar.Completed.Add(ar.Interval)) + interval := ar.Interval + if interval < time.Minute { + interval = time.Minute + } + wantPeers := me.t.wantPeersEvent.LockedChan(me.t.cl.locker()) select { - case <-me.t.wantPeersEvent.LockedChan(me.t.cl.locker()): + case <-wantPeers: if interval > time.Minute { interval = time.Minute } + wantPeers = nil default: } @@ -152,9 +157,9 @@ func (me *trackerScraper) Run() { return case <-me.stop.LockedChan(me.t.cl.locker()): return - case <-time.After(interval): - case <-me.t.wantPeersEvent.LockedChan(me.t.cl.locker()): + case <-wantPeers: goto wait + case <-time.After(time.Until(ar.Completed.Add(interval))): } } }
Fix timer leak in tracker announces when peers are wanted Fixes #<I>.
anacrolix_torrent
train
go
0ae6849fed0827ec5246cfd02db6f32a2770dbc8
diff --git a/turberfield/dialogue/test/test_model.py b/turberfield/dialogue/test/test_model.py index <HASH>..<HASH> 100644 --- a/turberfield/dialogue/test/test_model.py +++ b/turberfield/dialogue/test/test_model.py @@ -253,3 +253,17 @@ class SelectTests(unittest.TestCase): rv = list(script.select(ensemble).values()) self.assertIsNone(rv[0]) self.assertEqual(ensemble[0], rv[1]) + + def test_select_with_two_roles(self): + + content = textwrap.dedent(""" + .. entity:: FIGHTER_1 + + .. entity:: FIGHTER_2 + + """) + ensemble = copy.deepcopy(PropertyDirectiveTests.personae[0:1]) + script = SceneScript("inline", doc=SceneScript.read(content)) + rv = list(script.select(ensemble, roles=2).values()) + self.assertEqual(ensemble[0], rv[0]) + self.assertEqual(ensemble[0], rv[1])
Added test for select with two roles.
tundish_turberfield-dialogue
train
py
ae1cbfe59ecc269ce412640a9a2262a646b04f45
diff --git a/libkbfs/tlf_journal_test.go b/libkbfs/tlf_journal_test.go index <HASH>..<HASH> 100644 --- a/libkbfs/tlf_journal_test.go +++ b/libkbfs/tlf_journal_test.go @@ -1545,6 +1545,8 @@ func TestTLFJournal(t *testing.T) { testTLFJournalBasic, testTLFJournalPauseResume, testTLFJournalPauseShutdown, + testTLFJournalBlockOpBasic, + testTLFJournalBlockOpBusyPause, testTLFJournalBlockOpBusyShutdown, testTLFJournalSecondBlockOpWhileBusy, testTLFJournalMDServerBusyPause,
Actually run some TLF journal tests (#<I>)
keybase_client
train
go
c0da98314edee6f41c2e920cfd5d9314a00b99c2
diff --git a/src/modules/sync-cli.js b/src/modules/sync-cli.js index <HASH>..<HASH> 100755 --- a/src/modules/sync-cli.js +++ b/src/modules/sync-cli.js @@ -1278,6 +1278,7 @@ module.exports = { manage: self.manage, notify: self.notify, doList: self.list, + getUID: self.getUID, doCreate: self.create, doRead: self.read, doUpdate: self.update,
Allowing users to get UIDs for sync records. The allows users to check if a local record UID has been associated to one from the server
feedhenry_fh-sync-js
train
js
f1830a1ada87a21d851290398feac326e015dc3d
diff --git a/openhtf/plugs/user_input.py b/openhtf/plugs/user_input.py index <HASH>..<HASH> 100644 --- a/openhtf/plugs/user_input.py +++ b/openhtf/plugs/user_input.py @@ -114,6 +114,8 @@ class UserInput(plugs.BasePlug): def _asdict(self): """Return a dict representation of the current prompt.""" + if self._prompt is None: + return None return {'id': self._prompt.id.hex, 'message': self._prompt.message, 'text-input': self._prompt.text_input}
Fix bug when prompt is none (#<I>) (#<I>)
google_openhtf
train
py
76bbc60a1dc462e0ab1a2de3fe3655f707dee70c
diff --git a/xdg.py b/xdg.py index <HASH>..<HASH> 100644 --- a/xdg.py +++ b/xdg.py @@ -1,5 +1,3 @@ -# encoding=utf-8 - """XDG Base Directory Specification variables. XDG_CACHE_HOME, XDG_CONFIG_HOME, and XDG_DATA_HOME are strings
Remove declaration of encoding xdg now supports only Python 3, where UTF-8 is the default encoding.
srstevenson_xdg
train
py
63778550e5106dff114b8276cb8591ccb2ca63a3
diff --git a/control/Director.php b/control/Director.php index <HASH>..<HASH> 100644 --- a/control/Director.php +++ b/control/Director.php @@ -147,11 +147,22 @@ class Director implements TemplateGlobalProvider { // Return code for a redirection request if(is_string($result) && substr($result,0,9) == 'redirect:') { - $response = new SS_HTTPResponse(); - $response->redirect(substr($result, 9)); - $res = Injector::inst()->get('RequestProcessor')->postRequest($req, $response, $model); - if ($res !== false) { - $response->output(); + $url = substr($result, 9); + + if(Director::is_cli()) { + // on cli, follow SilverStripe redirects automatically + return Director::direct( + str_replace(Director::absoluteBaseURL(), '', $url), + DataModel::inst() + ); + } else { + $response = new SS_HTTPResponse(); + $response->redirect($url); + $res = Injector::inst()->get('RequestProcessor')->postRequest($req, $response, $model); + + if ($res !== false) { + $response->output(); + } } // Handle a controller } else if($result) {
FIX: Follow internal redirections for cli operations.
silverstripe_silverstripe-framework
train
php
18e7be24bd7e912b074b480879fec43f777d7242
diff --git a/packages/aws-amplify-react/src/Storage/S3Album.js b/packages/aws-amplify-react/src/Storage/S3Album.js index <HASH>..<HASH> 100644 --- a/packages/aws-amplify-react/src/Storage/S3Album.js +++ b/packages/aws-amplify-react/src/Storage/S3Album.js @@ -176,7 +176,7 @@ export default class S3Album extends Component { }); let items = this.filter(list); - items = this.sort(list); + items = this.sort(items); this.setState({ items }); }
Fix missed rename of a variable
aws-amplify_amplify-js
train
js
7686b6b1d0868d782cc617cba09af125428fbfee
diff --git a/message/lib.php b/message/lib.php index <HASH>..<HASH> 100644 --- a/message/lib.php +++ b/message/lib.php @@ -1023,12 +1023,12 @@ function message_get_participants() { global $CFG; - return get_records_sql("SELECT useridfrom,useridfrom FROM {$CFG->prefix}message - UNION SELECT useridto,useridto FROM {$CFG->prefix}message - UNION SELECT useridfrom,useridfrom FROM {$CFG->prefix}message_read - UNION SELECT useridto,useridto FROM {$CFG->prefix}message_read - UNION SELECT userid,userid FROM {$CFG->prefix}message_contacts - UNION SELECT contactid,contactid from {$CFG->prefix}message_contacts"); + return get_records_sql("SELECT useridfrom as id,1 FROM {$CFG->prefix}message + UNION SELECT useridto as id,1 FROM {$CFG->prefix}message + UNION SELECT useridfrom as id,1 FROM {$CFG->prefix}message_read + UNION SELECT useridto as id,1 FROM {$CFG->prefix}message_read + UNION SELECT userid as id,1 FROM {$CFG->prefix}message_contacts + UNION SELECT contactid as id,1 from {$CFG->prefix}message_contacts"); } ?>
Merged from MOODLE_<I>_STABLE (ish): better fix to messaging problem query
moodle_moodle
train
php
97738ec540e78b37dbe9d5e64f33157f4bc0fced
diff --git a/controller/frontend/tests/TestHelperFrontend.php b/controller/frontend/tests/TestHelperFrontend.php index <HASH>..<HASH> 100644 --- a/controller/frontend/tests/TestHelperFrontend.php +++ b/controller/frontend/tests/TestHelperFrontend.php @@ -56,9 +56,9 @@ class TestHelperFrontend $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; $file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser'; - $conf = new \Aimeos\MW\Config\PHPArray( [], $paths ); - $conf = new \Aimeos\MW\Config\Decorator\Memory( $conf ); - $conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file ); + $conf = new \Aimeos\Base\Config\PHPArray( [], $paths ); + $conf = new \Aimeos\Base\Config\Decorator\Memory( $conf ); + $conf = new \Aimeos\Base\Config\Decorator\Documentor( $conf, $file ); $ctx->setConfig( $conf );
Use config adapter from base package
aimeos_ai-controller-frontend
train
php
38f9007223ec7bfcdef5ccc9f9df3aa2c8cc1b6f
diff --git a/tornado/web.py b/tornado/web.py index <HASH>..<HASH> 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -751,10 +751,10 @@ class RequestHandler(object): if hasattr(self.request, "connection"): # Now that the request is finished, clear the callback we - # set on the IOStream (which would otherwise prevent the + # set on the HTTPConnection (which would otherwise prevent the # garbage collection of the RequestHandler when there # are keepalive connections) - self.request.connection.stream.set_close_callback(None) + self.request.connection.set_close_callback(None) if not self.application._wsgi: self.flush(include_footers=True)
RequestHandler sets its close callback on the HTTPConnection, not the IOStream. Fixes a bug in which close callbacks would never be called for subsequent requests on a reused connection.
tornadoweb_tornado
train
py
196407c54f0736c275d2ad4e6f8b0ac55360ad95
diff --git a/actionpack/lib/action_view/helpers/sanitize_helper.rb b/actionpack/lib/action_view/helpers/sanitize_helper.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_view/helpers/sanitize_helper.rb +++ b/actionpack/lib/action_view/helpers/sanitize_helper.rb @@ -1,6 +1,5 @@ require 'active_support/core_ext/object/try' require 'action_controller/vendor/html-scanner' -require 'action_view/helpers/tag_helper' module ActionView # = Action View Sanitize Helpers diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_view/helpers/text_helper.rb +++ b/actionpack/lib/action_view/helpers/text_helper.rb @@ -1,6 +1,5 @@ require 'active_support/core_ext/object/blank' require 'active_support/core_ext/string/filters' -require 'action_view/helpers/tag_helper' module ActionView # = Action View Text Helpers @@ -31,6 +30,7 @@ module ActionView extend ActiveSupport::Concern include SanitizeHelper + include TagHelper # The preferred method of outputting text in your views is to use the # <%= "text" %> eRuby syntax. The regular _puts_ and _print_ methods # do not operate as expected in an eRuby code block. If you absolutely must
Include TagHelper but don't explicitly require it Allow autoloading to work as intended and avoid multiple requires.
rails_rails
train
rb,rb
b2eb1d744ebe736d671f73af67b74b5ad512d779
diff --git a/scenarios/kubernetes_e2e.py b/scenarios/kubernetes_e2e.py index <HASH>..<HASH> 100755 --- a/scenarios/kubernetes_e2e.py +++ b/scenarios/kubernetes_e2e.py @@ -508,7 +508,7 @@ def create_parser(): parser.add_argument( '--soak-test', action='store_true', help='If the test is a soak test job') parser.add_argument( - '--tag', default='v20170525-59b0e879', help='Use a specific kubekins-e2e tag if set') + '--tag', default='v20170531-e6de0525', help='Use a specific kubekins-e2e tag if set') parser.add_argument( '--test', default='true', help='If we need to run any actual test within kubetest') parser.add_argument(
Update e2e image tag (#<I>)
kubernetes_test-infra
train
py
a051892b92c72630b48e95587ee5563d3378f37b
diff --git a/src/ol/source/TileDebug.js b/src/ol/source/TileDebug.js index <HASH>..<HASH> 100644 --- a/src/ol/source/TileDebug.js +++ b/src/ol/source/TileDebug.js @@ -55,10 +55,12 @@ class LabeledTile extends Tile { context.strokeRect(0.5, 0.5, tileSize[0] + 0.5, tileSize[1] + 0.5); context.fillStyle = 'grey'; + context.strokeStyle = 'white'; context.textAlign = 'center'; context.textBaseline = 'middle'; - context.font = '24px sans-serif'; - context.fillText(this.text_, tileSize[0] / 2, tileSize[1] / 2); + context.font = 'bold 24px sans-serif'; + context.fillText(this.text_, tileSize[0] / 2, tileSize[1] / 2, tileSize[0]); + context.strokeText(this.text_, tileSize[0] / 2, tileSize[1] / 2, tileSize[0]); this.canvas_ = context.canvas; return context.canvas;
enhance tile-debug readability this commit enhances the readability of tile debug coordinates by adding a stroke for better readability on aerial imagery and a maxWidth for high zoom levels
openlayers_openlayers
train
js
3f2baed32cf3a623ba316846b9bf92b4ee915779
diff --git a/src/QueryBuilder/QueryToken/Value.php b/src/QueryBuilder/QueryToken/Value.php index <HASH>..<HASH> 100644 --- a/src/QueryBuilder/QueryToken/Value.php +++ b/src/QueryBuilder/QueryToken/Value.php @@ -2,9 +2,17 @@ namespace Silktide\Reposition\QueryBuilder\QueryToken; +use Silktide\Reposition\Exception\QueryException; + class Value extends Token { + const TYPE_STRING = "string"; + const TYPE_INT = "int"; + const TYPE_FLOAT = "float"; + const TYPE_BOOL = "bool"; + const TYPE_NULL = "null"; + /** * @var mixed */ @@ -17,7 +25,22 @@ class Value extends Token public function __construct($type, $value) { $this->value = $value; - parent::__construct($type); + $this->setType($type); + } + + protected function setType($type) + { + switch ($type) { + case self::TYPE_STRING: + case self::TYPE_INT: + case self::TYPE_FLOAT: + case self::TYPE_BOOL: + case self::TYPE_NULL: + $this->type = $type; + break; + default: + throw new QueryException("Invalid value type: '$type'"); + } } /**
Values can have types (string, int, etc...) This is required so that we can request a specific type in the token definitions and also so we can handle specific cases where we need to render a keyword instead of the raw value (TRUE, FALSE, NULL, etc...)
lexide_reposition
train
php
57148af24f54724fa58c2a3ae4baef909f0dfc62
diff --git a/src/Views/helpers/category/category_inline_js.blade.php b/src/Views/helpers/category/category_inline_js.blade.php index <HASH>..<HASH> 100644 --- a/src/Views/helpers/category/category_inline_js.blade.php +++ b/src/Views/helpers/category/category_inline_js.blade.php @@ -13,6 +13,10 @@ @else category_save(formData, '{{$callback}}'); @endif + if(typeof parent.refresh !== 'undefined') + { + parent.refresh() ; + } }); diff --git a/src/Views/upload.blade.php b/src/Views/upload.blade.php index <HASH>..<HASH> 100644 --- a/src/Views/upload.blade.php +++ b/src/Views/upload.blade.php @@ -58,15 +58,10 @@ '</a>'; $(".file-footer-buttons").append(btns); } - - @if ($callback) { - if(parent.{{$callback}}) - { - parent.{{$callback}}(); - - } + if(typeof parent.refresh !== 'undefined') + { + parent.refresh() ; } - @endif }); $('#cancel_btn').off('click'); $('#cancel_btn').on('click', function () {
add refresh() to category and upload.blade.php
artincms_laravel_file_manager
train
php,php
01e69c4eaef54153e6dde5015b24581c153278e1
diff --git a/lib/rails3-jquery-autocomplete/orm/active_record.rb b/lib/rails3-jquery-autocomplete/orm/active_record.rb index <HASH>..<HASH> 100644 --- a/lib/rails3-jquery-autocomplete/orm/active_record.rb +++ b/lib/rails3-jquery-autocomplete/orm/active_record.rb @@ -9,14 +9,13 @@ module Rails3JQueryAutocomplete end def get_autocomplete_items(parameters) - model = parameters[:model] - term = parameters[:term] - method = parameters[:method] - options = parameters[:options] - - scopes = Array(options[:scopes]) - limit = get_autocomplete_limit(options) - order = get_autocomplete_order(method, options, model) + model = parameters[:model] + term = parameters[:term] + method = parameters[:method] + options = parameters[:options] + scopes = Array(options[:scopes]) + limit = get_autocomplete_limit(options) + order = get_autocomplete_order(method, options, model) items = model.scoped
Aesthetic chance on AR Driver
crowdint_rails3-jquery-autocomplete
train
rb
a15a5e75381662be4043cf49b5bcbedbc932df88
diff --git a/images/spec/requests/refinery/admin/images_spec.rb b/images/spec/requests/refinery/admin/images_spec.rb index <HASH>..<HASH> 100644 --- a/images/spec/requests/refinery/admin/images_spec.rb +++ b/images/spec/requests/refinery/admin/images_spec.rb @@ -32,8 +32,11 @@ module Refinery page.should have_content("'Image With Dashes' was successfully added.") Refinery::Image.count.should == 1 + end - get Refinery::Image.last.url + it 'is accessible via url' do + image = Refinery::Image.create(:image => Refinery.roots(:'refinery/images').join("spec/fixtures/image-with-dashes.jpg")) + get image.url response.should be_success end
Specs should only fail for one reason.
refinery_refinerycms
train
rb
ea8c51db3965efbb31baaf2b7ba1e4f361182c92
diff --git a/src/EdpUser/Mapper/UserDoctrine.php b/src/EdpUser/Mapper/UserDoctrine.php index <HASH>..<HASH> 100644 --- a/src/EdpUser/Mapper/UserDoctrine.php +++ b/src/EdpUser/Mapper/UserDoctrine.php @@ -27,7 +27,8 @@ class UserDoctrine extends EventProvider implements UserInterface public function findByEmail($email) { $user = $this->getUserRepository()->findOneBy(array('email' => $email)); - $user->ext('EdpUserTwitter', $user->getTwitter()); + $this->events()->trigger(__FUNCTION__, $this, array('user' => $user)); + return $user; } public function findByUsername($username)
Add return value and findByEmail event
ZF-Commons_ZfcUser
train
php
00131053e8431cbeda639ceef23aef0ab7b7075b
diff --git a/angr/analyses/vfg.py b/angr/analyses/vfg.py index <HASH>..<HASH> 100644 --- a/angr/analyses/vfg.py +++ b/angr/analyses/vfg.py @@ -838,7 +838,7 @@ class VFG(Analysis): reg_sp_si = self._create_stack_region(successor_path.state, successor_path.addr) # Save the new sp register - new_reg_sp_expr = successor_path.state.se.ValueSet() + new_reg_sp_expr = successor_path.state.se.ValueSet(bits=suc_state.arch.bits) new_reg_sp_expr.model.set_si('global', reg_sp_si.copy()) reg_sp_offset = successor_state.arch.sp_offset successor_path.state.store_reg(reg_sp_offset, new_reg_sp_expr)
satisfy new requirement of bits on all BVs
angr_angr
train
py
80f15e96c73e12300e8992532046a587b7c1be2e
diff --git a/spec/functional/resource/user/useradd_spec.rb b/spec/functional/resource/user/useradd_spec.rb index <HASH>..<HASH> 100644 --- a/spec/functional/resource/user/useradd_spec.rb +++ b/spec/functional/resource/user/useradd_spec.rb @@ -627,7 +627,7 @@ describe Chef::Provider::User::Useradd, metadata do context "when the user exists" do include_context "user exists for lock/unlock" - let(:shell) { "/bin/bash" } + let(:shell) { "/bin/sh" } before do begin
change shell to /bin/sh in user_add tests to fix aix
chef_chef
train
rb
5354cbebe61c1a024b972abbafb44dcdcbd3a4b5
diff --git a/lib/helpers/watcher.js b/lib/helpers/watcher.js index <HASH>..<HASH> 100644 --- a/lib/helpers/watcher.js +++ b/lib/helpers/watcher.js @@ -4,6 +4,7 @@ const path = require('path') const chokidar = require('chokidar') const bs = require('browser-sync').create() +const config = require('../config') const {assets} = require('../assets') // ------------------------------------------------------------- @@ -11,7 +12,7 @@ const {assets} = require('../assets') // ------------------------------------------------------------- function installWatcher (startingFolder, callback) { - const buildFolder = path.join(startingFolder, './build') + const buildFolder = path.join(config.commands.build.output, './build') // BrowserSync will watch for changes in the assets CSS. // It will also create a server with the build folder an the assets.
Serve files from the actual build folder It would use the entry point and not the actual build folder (this behavior changed in the commit <I>b<I>be<I>e<I>e6b<I>b with the output option).
pixelnest_presskit.html
train
js
531d39ff7efa349ddcb6113d31bd4bfd387eaeb1
diff --git a/Job/ShareNewsItem.php b/Job/ShareNewsItem.php index <HASH>..<HASH> 100755 --- a/Job/ShareNewsItem.php +++ b/Job/ShareNewsItem.php @@ -58,9 +58,18 @@ XMLBODY; } else { $ctaService = $this->container->get('campaignchain.core.cta'); - // process urls and add tracking + /* + * process urls and add tracking + * important: both the urls in the message and submitted url field must be identical + * + */ + $newsitem->setLinkUrl( - $ctaService->processCTAs($newsitem->getLinkUrl(), $newsitem->getOperation(), 'txt')->getContent(CTAParserData::URL_TYPE_TRACKED) + $ctaService->processCTAs($newsitem->getLinkUrl(), $newsitem->getOperation(), 'txt')->getContent() + ); + + $newsitem->setMessage( + $ctaService->processCTAs($newsitem->getMessage(), $newsitem->getOperation(), 'txt')->getContent() ); $xmlBody = <<<XMLBODY
CE-<I> - fix problem, that LinkedIn removes our campaignchain-id
CampaignChain_operation-linkedin
train
php
b5ceb9568b758f92df3d75b33285f50ca2102064
diff --git a/invenio_communities/__init__.py b/invenio_communities/__init__.py index <HASH>..<HASH> 100644 --- a/invenio_communities/__init__.py +++ b/invenio_communities/__init__.py @@ -11,7 +11,7 @@ from .ext import InvenioCommunities from .proxies import current_communities -__version__ = "2.8.0.dev6" +__version__ = "2.8.0.dev7" __all__ = ( 'InvenioCommunities',
release: <I>.dev7
inveniosoftware_invenio-communities
train
py
27f520d1b612c239cc7929de16ec559622255bf4
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -50,8 +50,8 @@ setup( version=version, description="OAuth 2.0 client library", long_description=long_desc, - author="Joe Gregorio", - author_email="[email protected]", + author="John Asmuth", + author_email="[email protected]", url="http://github.com/google/oauth2client/", install_requires=install_requires, packages=packages,
Updated setup.py with new authorship.
googleapis_oauth2client
train
py
632cdba5fab5df66cbbc98bb7168c13e9b5eb81b
diff --git a/packages/mjml-spacer/src/index.js b/packages/mjml-spacer/src/index.js index <HASH>..<HASH> 100644 --- a/packages/mjml-spacer/src/index.js +++ b/packages/mjml-spacer/src/index.js @@ -28,7 +28,8 @@ class Spacer extends Component { return { div: { fontSize: '1px', - lineHeight: defaultUnit(mjAttribute('height')) + lineHeight: defaultUnit(mjAttribute('height')), + whiteSpace: 'nowrap' } } }
Fix escaping servers which replace the `&nbsp;` with a space We have seen some servers which replace the non-breaking space character with an actual space. This should ensure that even when there is a space the div actually renders
mjmlio_mjml
train
js
ed132aebe91a48eacacdcc9a37972a65b58c50ee
diff --git a/lib/resource/index.js b/lib/resource/index.js index <HASH>..<HASH> 100644 --- a/lib/resource/index.js +++ b/lib/resource/index.js @@ -766,7 +766,6 @@ Resource = new Class({ var mutable = mutableMethods.indexOf( bundle.req.method.toLowerCase() ) !== -1; that.modified = mutable ? (new Date()).toUTCString() : that.modified; that.modified && reply.header('Last-Modified', that.modified ); - typeof data === 'string' && reply.header('Content-Length', Buffer.byteLength( data ) ); mutable = null; return cb && cb( null, reply );
Remove the content length header. Hapi sends chunked responses
node-tastypie_tastypie
train
js
6ed91f61e8f0aeae525cebe556f71eb15436b76b
diff --git a/lib/sensu-handler.rb b/lib/sensu-handler.rb index <HASH>..<HASH> 100644 --- a/lib/sensu-handler.rb +++ b/lib/sensu-handler.rb @@ -67,7 +67,7 @@ module Sensu def filter_repeated occurrences = @event['check']['occurrences'] || 1 interval = @event['check']['interval'] || 30 - refresh = @event['check']['refresh'] || settings['checks']['refresh'] || 1800 + refresh = @event['check']['refresh'] || settings['check']['refresh'] || 1800 if @event['occurrences'] < occurrences bail 'not enough occurrences' end
Use settings['check']['refresh'] rather than checks
sensu-plugins_sensu-plugin
train
rb
01cffbf1adc4419ef890af7e46433d004e5bbd1f
diff --git a/src/Search_Replace_Command.php b/src/Search_Replace_Command.php index <HASH>..<HASH> 100644 --- a/src/Search_Replace_Command.php +++ b/src/Search_Replace_Command.php @@ -302,7 +302,12 @@ class Search_Replace_Command extends WP_CLI_Command { // since we'll be updating one row at a time, // we need a primary key to identify the row if ( empty( $primary_keys ) ) { - if ( $this->report && ! $this->report_changed_only ) { + + // wasn't updated, so skip to the next table + if ( $this->report_changed_only ) { + continue; + } + if ( $this->report ) { $report[] = array( $table, '', 'skipped', '' ); } else { WP_CLI::warning( $all_columns ? "No primary keys for table '$table'." : "No such table '$table'." );
silently ignore skipped tables when only reporting changes
wp-cli_search-replace-command
train
php
0c4b10afb2a4fa81f6d75517f012401b57cdd21b
diff --git a/commands/http/client.go b/commands/http/client.go index <HASH>..<HASH> 100644 --- a/commands/http/client.go +++ b/commands/http/client.go @@ -34,6 +34,9 @@ type client struct { } func NewClient(address string) Client { + // We cannot use the default transport because of a bug in go's connection reuse + // code. It causes random failures in the connection including io.EOF and connection + // refused on 'client.Do' return &client{ serverAddress: address, httpClient: http.Client{
comment need for custom client License: MIT
ipfs_go-ipfs
train
go
24c306ecaa82cdc3c18e8352eaf8cc404f4c3d54
diff --git a/lib/entity_snapshot/postgres/postgres.rb b/lib/entity_snapshot/postgres/postgres.rb index <HASH>..<HASH> 100644 --- a/lib/entity_snapshot/postgres/postgres.rb +++ b/lib/entity_snapshot/postgres/postgres.rb @@ -14,7 +14,7 @@ module EntitySnapshot entity_class_name = entity_class.name.split('::').last entity_cateogry = Casing::Camel.(entity_class_name) - Messaging::StreamName.stream_name(id, "#{entity_cateogry}:snapshot") + Messaging::StreamName.stream_name(id, entity_cateogry, type: 'snapshot') end def configure(session: nil)
Snapshot stream name is composed entirely by the Messaging StreamName module
eventide-project_entity-snapshot-postgres
train
rb
9ca7d6919eb24c3703f615cefaeea616a5dc3e43
diff --git a/openfisca_core/taxbenefitsystems.py b/openfisca_core/taxbenefitsystems.py index <HASH>..<HASH> 100644 --- a/openfisca_core/taxbenefitsystems.py +++ b/openfisca_core/taxbenefitsystems.py @@ -114,7 +114,7 @@ class XmlBasedTaxBenefitSystem(AbstractTaxBenefitSystem): legislation_json = conv.check(legislationsxml.xml_legislation_file_path_to_json)( self.legislation_xml_file_path, state = state) if self.preprocess_legislation is not None: - self.preprocess_legislation(legislation_json) + legislation_json = self.preprocess_legislation(legislation_json) super(XmlBasedTaxBenefitSystem, self).__init__( entity_class_by_key_plural = entity_class_by_key_plural, legislation_json = legislation_json,
preprocess_legislation returns modified legislation_json
openfisca_openfisca-core
train
py
d2a0b9a3887725f266a8e5a134aea48844a6d7ff
diff --git a/config/environments/production.rb b/config/environments/production.rb index <HASH>..<HASH> 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -30,6 +30,8 @@ Refinery::Application.configure do # Enable threaded mode # config.threadsafe! + + config.active_support.deprecation = :stderr end # When true will use Amazon's Simple Storage Service on your production machine diff --git a/config/environments/test.rb b/config/environments/test.rb index <HASH>..<HASH> 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -26,4 +26,6 @@ Refinery::Application.configure do # This is necessary if your schema can't be completely dumped by the schema dumper, # like if you have constraints or database-specific column types # config.active_record.schema_format = :sql + + config.active_support.deprecation = :stderr end
Set deprecation warning locations in these environments too, but to stderr as they should be brought to our attention.
refinery_refinerycms
train
rb,rb
2b03d90de821f38e6485a2c32686d4b0a4c588b4
diff --git a/galpy/df/streamdf.py b/galpy/df/streamdf.py index <HASH>..<HASH> 100644 --- a/galpy/df/streamdf.py +++ b/galpy/df/streamdf.py @@ -1276,6 +1276,7 @@ class streamdf(df): obskwargs['ro']= ro obskwargs['vo']= vo obskwargs['obs']= obs + obskwargs['quantity']= False self._ErrCovsLBScale= [180.,90., self._progenitor.dist(**obskwargs), numpy.fabs(self._progenitor.vlos(**obskwargs)),
Make sure to not get quantity output in streamdf setup
jobovy_galpy
train
py
77e85eeb85206c4175913bd689d8a9a001242cc9
diff --git a/controllers/CiiController.php b/controllers/CiiController.php index <HASH>..<HASH> 100644 --- a/controllers/CiiController.php +++ b/controllers/CiiController.php @@ -11,10 +11,15 @@ class CiiController extends CController * Retrieves the asset manager for the theme * @return Published AssetManager path */ - public function getAsset() + public function getAsset($dist=false) { $theme = $this->getTheme(); - return Yii::app()->assetManager->publish(YiiBase::getPathOfAlias('webroot.themes.' . $theme . '.assets'), false, -1, YII_DEBUG); + $assetAlias = 'webroot.themes.' . $theme . '.assets'; + + if ($dist == true) + $assetAlias .= '.dist'; + + return Yii::app()->assetManager->publish(Yii::getPathOfAlias($assetAlias), false, -1, YII_DEBUG); } /**
Adding the option to use a dist directory rather than the entire assets folder
ciims_cii
train
php
cc89b345664a60ecd33fd2f20cce683efc8f4ab4
diff --git a/lib/conf/tasks/os/windows.js b/lib/conf/tasks/os/windows.js index <HASH>..<HASH> 100755 --- a/lib/conf/tasks/os/windows.js +++ b/lib/conf/tasks/os/windows.js @@ -2,14 +2,17 @@ var firewall = require('firewall'), join = require('path').join, - paths = require(join('..', '..', 'system/paths')), - versions = require(join('..', 'versions')), - exports = module.exports; + paths = require(join('..', '..', '..', 'system', 'paths')), + shared = require(join('..', '..', 'shared')); var firewall_desc = 'Prey Agent'; +var get_node_path = function(base) { + return join(base, 'bin', 'node.exe'); +} + function remove_firewall_rules (cb) { - var list = versions.list(); + var list = shared.version_manager.list(); if (!list || !list[0]) return cb(); var count = list.length; @@ -23,7 +26,7 @@ function remove_firewall_rules (cb) { desc : firewall_desc, bin : get_node_path(join(paths.versions, ver)) } - firewall.remove_rule(obj, removed_rule); + firewall.remove_rule(obj, done); }); }
Fixes in Windows post_install hooks.
prey_prey-node-client
train
js
55a428f430c309342be0ade17b56dbb809788337
diff --git a/ui/src/components/tabs/QTabs.js b/ui/src/components/tabs/QTabs.js index <HASH>..<HASH> 100644 --- a/ui/src/components/tabs/QTabs.js +++ b/ui/src/components/tabs/QTabs.js @@ -180,6 +180,11 @@ export default defineComponent({ } function updateContainer (domSize) { + // it can be called faster than component being initialized + // so we need to protect against that case + // (one example of such case is the docs release notes page) + if (domProps.value === void 0) { return } + const size = domSize[ domProps.value.container ], scrollSize = Math.min(
fix(QTabs): protect updateContainer() against being executed too early
quasarframework_quasar
train
js
f985c6f55ffb9c343af8345d8bb323a01055fac9
diff --git a/htmresearch/frameworks/layers/l2_l4_inference.py b/htmresearch/frameworks/layers/l2_l4_inference.py index <HASH>..<HASH> 100644 --- a/htmresearch/frameworks/layers/l2_l4_inference.py +++ b/htmresearch/frameworks/layers/l2_l4_inference.py @@ -299,7 +299,7 @@ class L4L2Experiment(object): # plot request stats for field in fields: fieldKey = field + " C" + str(i) - plt.plot(stats[fieldKey], figure=figIdx, marker='+', label=fieldKey) + plt.plot(stats[fieldKey], marker='+', label=fieldKey) # format plt.legend(loc="upper right")
minor change to plot function to avoid matplotlib crash
numenta_htmresearch
train
py
7d262217f0464f2f9ac417ff677c9adf197ef83a
diff --git a/app/models/releaf/admin.rb b/app/models/releaf/admin.rb index <HASH>..<HASH> 100644 --- a/app/models/releaf/admin.rb +++ b/app/models/releaf/admin.rb @@ -10,7 +10,7 @@ module Releaf # :lockable, :timeoutable and :omniauthable # :registerable devise :database_authenticatable, :rememberable, :trackable, :validatable - validates_presence_of :name, :surname, :role_id, :locale + validates_presence_of :name, :surname, :role, :locale belongs_to :role diff --git a/spec/models/admin_spec.rb b/spec/models/admin_spec.rb index <HASH>..<HASH> 100644 --- a/spec/models/admin_spec.rb +++ b/spec/models/admin_spec.rb @@ -6,7 +6,7 @@ describe Releaf::Admin do describe 'validations' do it { should validate_presence_of(:name) } it { should validate_presence_of(:surname) } - it { should validate_presence_of(:role_id) } + it { should validate_presence_of(:role) } it { should validate_presence_of(:locale) } it { should validate_presence_of(:email) } it { FactoryGirl.create(:admin); should validate_uniqueness_of(:email) }
Validate presence of role, not role_id in Releaf::Admin
cubesystems_releaf
train
rb,rb
06d0637bab967aa55c19b87d41413ed1d8ab3029
diff --git a/Classes/Controller/Backend/AjaxController.php b/Classes/Controller/Backend/AjaxController.php index <HASH>..<HASH> 100644 --- a/Classes/Controller/Backend/AjaxController.php +++ b/Classes/Controller/Backend/AjaxController.php @@ -29,6 +29,7 @@ use ApacheSolrForTypo3\Solr\ConnectionManager; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Core\Http\Response; /** * Handling of Ajax requests @@ -71,10 +72,12 @@ class AjaxController * @param ResponseInterface $response * @return ResponseInterface */ - public function updateConnections(ServerRequestInterface $request, ResponseInterface $response) + public function updateConnections(ServerRequestInterface $request): ResponseInterface { $connectionManager = GeneralUtility::makeInstance(ConnectionManager::class); $connectionManager->updateConnections(); + // Currently no return value from connection manager + return new Response(); } }
[BUGFIX] Ensure AjaxController returns a response (#<I>) * [BUGFIX] Ensure AjaxController returns a response In TYPO3 v9, all Routes should return a PSR-7 compatible Response object. However "updateConnections" does not do so, resulting in a PHP error. * Return an empty Response object for ClearCacheMenu item
TYPO3-Solr_ext-solr
train
php
9ee5f3ee10623db6abe0268ac553fc50f0f60373
diff --git a/lib/guard/jasmine.rb b/lib/guard/jasmine.rb index <HASH>..<HASH> 100644 --- a/lib/guard/jasmine.rb +++ b/lib/guard/jasmine.rb @@ -155,10 +155,10 @@ module Guard if !version notify_failure('PhantomJS binary missing', "PhantomJS binary doesn't exist at #{ bin }") + elsif version.to_version < '1.3.0'.to_version + notify_failure('Wrong PhantomJS version', "PhantomJS binary at #{ bin } must be at least version 1.3.0") else - if version.to_version < '1.3.0'.to_version - notify_failure('Wrong PhantomJS version', "PhantomJS binary at #{ bin } must be at least version 1.3.0") - end + true end end @@ -173,6 +173,7 @@ module Guard :title => title, :image => :failed, :priority => 2) if options[:notification] + false end end
Return proper boolean status from PhantomJS bin check.
guard_guard-jasmine
train
rb
ee289552fe0045e3f22cfab128ececf9c585a3ea
diff --git a/tests/test_corpora.py b/tests/test_corpora.py index <HASH>..<HASH> 100644 --- a/tests/test_corpora.py +++ b/tests/test_corpora.py @@ -3,7 +3,6 @@ # Author: Arne Neumann <[email protected]> from copy import deepcopy -from multiprocessing import Process import pkgutil from tempfile import NamedTemporaryFile, mkdtemp @@ -19,7 +18,9 @@ def test_pcc(): create document graphs for all PCC documents containing all annotation layers and test them for cyclicity. """ - def convert_pcc_doc(doc_id): + assert len(pcc.document_ids) == 176 + + for doc_id in pcc.document_ids: docgraph = pcc[doc_id] assert isinstance(docgraph, dg.DiscourseDocumentGraph) @@ -36,8 +37,3 @@ def test_pcc(): assert nx.is_directed_acyclic_graph(docgraph) - assert len(pcc.document_ids) == 176 - - p = Process(target=convert_pcc_doc, args=pcc.document_ids) - p.start() - p.join()
fix: removed broken multiprocessing from tests
arne-cl_discoursegraphs
train
py