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
7b053cbd3538495b7fdae1a7e015ccfcf8340150
diff --git a/test/http_verbs_feature_test.rb b/test/http_verbs_feature_test.rb index <HASH>..<HASH> 100644 --- a/test/http_verbs_feature_test.rb +++ b/test/http_verbs_feature_test.rb @@ -44,6 +44,7 @@ class HttpVerbsTest < MiniTest::Spec end # FIXME: move to faraday test. + require 'roar/representer/transport/faraday' describe 'a non-existent resource' do it 'handles HTTP errors and raises a ResourceNotFound error with FaradayHttpTransport' do @band.transport_engine = Roar::Representer::Transport::Faraday @@ -73,7 +74,7 @@ class HttpVerbsTest < MiniTest::Spec it "updates instance with incoming representation" do @band.name = "Strung Out" assert_equal nil, @band.label - + @band.post("http://roar.example.com/bands", "application/xml") assert_equal "STRUNG OUT", @band.name assert_equal nil, @band.label
require the transport/faraday feature in the test.
trailblazer_roar
train
rb
076d79a11ff67f999ad673bb0e574e036c52fd7a
diff --git a/TYPO3.Neos/Scripts/Gruntfile.js b/TYPO3.Neos/Scripts/Gruntfile.js index <HASH>..<HASH> 100644 --- a/TYPO3.Neos/Scripts/Gruntfile.js +++ b/TYPO3.Neos/Scripts/Gruntfile.js @@ -172,6 +172,7 @@ module.exports = function (grunt) { src = src.replace('data-toggle', 'data-neos-toggle'); // Tooltip + src = src.replace(/trigger: 'hover focus'/g, "trigger: 'hover'"); src = src.replace(/in top bottom left right/g, 'neos-in neos-top neos-bottom neos-left neos-right'); src = src.replace(/\.addClass\(placement\)/g, ".addClass('neos-' + placement)"); src = src.replace('delay: 0', "delay: { 'show': 500, 'hide': 100 }");
BUGFIX: Avoid stuck tooltip in node tree This switches (bootstrap) tooltips from being triggered on hover and focus to just hover. This avoids the tooltip being activated e.g. by expand a subtree. Should fix #<I>
neos_neos-development-collection
train
js
0b56e908ff3ee9a1ac371e64051dee0212659b48
diff --git a/lib/grn2drn/groonga-command-converter.rb b/lib/grn2drn/groonga-command-converter.rb index <HASH>..<HASH> 100644 --- a/lib/grn2drn/groonga-command-converter.rb +++ b/lib/grn2drn/groonga-command-converter.rb @@ -15,10 +15,11 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -require "groonga/command/parser" require "digest/sha1" require "time" +require "groonga/command/parser" + module Grn2Drn class GroongaCommandConverter def initialize(options={})
Put the standard library requires at the top
droonga_grn2drn
train
rb
3b049b76268e85dc510e289e1f68df60daebe6c2
diff --git a/question/engine/datalib.php b/question/engine/datalib.php index <HASH>..<HASH> 100644 --- a/question/engine/datalib.php +++ b/question/engine/datalib.php @@ -688,7 +688,7 @@ ORDER BY $this->delete_response_files($context->id, "IN ( SELECT id - FROM question_attempt_step + FROM {question_attempt_steps} WHERE questionattemptid $test)", $params); $this->db->delete_records_select('question_attempt_step_data', "attemptstepid IN (
MDL-<I> question engine stupid typo in DB query broke regrading. #<I>
moodle_moodle
train
php
f29667f638c1245b5ae6abc0e278dd222dbf9908
diff --git a/lib/weblib.php b/lib/weblib.php index <HASH>..<HASH> 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1400,7 +1400,7 @@ function print_user($user, $course) { $timemidnight = usergetmidnight(time()); echo "<a href=\"$CFG->wwwroot/course/user.php?id=$course->id&user=$user->id\">$string->activity</a><br>"; if (!iscreator($user->id)) { // Includes admins - if (isteacheredit($course->id) and isstudent($course->id, $user->id)) { // Includes admins + if ($course->category and isteacheredit($course->id) and isstudent($course->id, $user->id)) { // Includes admins echo "<a href=\"$CFG->wwwroot/course/unenrol.php?id=$course->id&user=$user->id\">$string->unenrol</a><br />"; } if ($USER->id != $user->id) {
Hide "Unenrol" when we're not in a course
moodle_moodle
train
php
14008ce175814714f3fea4ab6153f88b93e2ff08
diff --git a/api/transactions.js b/api/transactions.js index <HASH>..<HASH> 100644 --- a/api/transactions.js +++ b/api/transactions.js @@ -288,7 +288,7 @@ function getTransaction(account, identifier, callback) { // Request transaction based on either the hash supplied in the request // or the hash found in the database - remote.requestTx(requestHash || dbEntryHash, function(error, transaction) { + remote.requestTx({ hash: requestHash || dbEntryHash }, function(error, transaction) { if (error) { return async_callback(error); }
[TASK] Fix ripple-lib deprecation warnings From `Remote` in ripple-lib: `DEPRECATED: First argument to request constructor should be an object containing request properties`
ripple_ripple-rest
train
js
067fa8fd525b44efb9d68f484339bdddbe04e980
diff --git a/spec/cb/utils/validator_spec.rb b/spec/cb/utils/validator_spec.rb index <HASH>..<HASH> 100644 --- a/spec/cb/utils/validator_spec.rb +++ b/spec/cb/utils/validator_spec.rb @@ -48,9 +48,16 @@ module Cb expect(validation.empty?).to be_truthy end - it 'should raise a ServiceUnavailableError when status code is 503' do - allow(response).to receive(:code).and_return 503 - expect{ ResponseValidator.validate(response) }.to raise_error(Cb::ServiceUnavailableError) + context 'raises a ServiceUnavailableError' do + it 'when status code is 503' do + allow(response).to receive(:code).and_return 503 + expect { ResponseValidator.validate(response) }.to raise_error(Cb::ServiceUnavailableError) + end + + it 'when simulation flag is turned on via ENV' do + allow(ENV).to receive(:[]).and_return 'true' + expect { ResponseValidator.validate(response) }.to raise_error(Cb::ServiceUnavailableError) + end end it 'should raise an UnauthorizedError when status code is 401' do
specs for auth outage simulation flag
careerbuilder_ruby-cb-api
train
rb
b61be95144553cb106330fab278b9778bc03c467
diff --git a/lib/ruby_odata/service.rb b/lib/ruby_odata/service.rb index <HASH>..<HASH> 100644 --- a/lib/ruby_odata/service.rb +++ b/lib/ruby_odata/service.rb @@ -96,6 +96,7 @@ class Service # Performs query operations (Read) against the server. # Typically this returns an array of record instances, except in the case of count queries + # @raise [ServiceError] if there is an error when talking to the service def execute begin @response = RestClient::Resource.new(build_query_uri, @rest_options).get
Added documentation to the execute method, noting that it will raise a ServiceError if there is a problem with the service.
visoft_ruby_odata
train
rb
c9b87002ae38317a8f4979c21cd819baf95cf996
diff --git a/client/signup/jetpack-connect/controller.js b/client/signup/jetpack-connect/controller.js index <HASH>..<HASH> 100644 --- a/client/signup/jetpack-connect/controller.js +++ b/client/signup/jetpack-connect/controller.js @@ -26,7 +26,8 @@ import analytics from 'lib/analytics'; import config from 'config'; import route from 'lib/route'; import { setDocumentHeadTitle as setTitle } from 'state/document-head/actions'; -import { getSelectedSite } from 'state/ui/selectors'; +import { getSelectedSiteId } from 'state/ui/selectors'; +import { isJetpackSite } from 'state/sites/selectors'; /** * Module variables @@ -176,12 +177,14 @@ export default { plansLanding( context ) { const Plans = require( './plans' ), CheckoutData = require( 'components/data/checkout' ), - site = getSelectedSite( context.store.getState() ), + state = context.store.getState(), + siteId = getSelectedSiteId( state ), + isJetpack = isJetpackSite( state, siteId ), analyticsPageTitle = 'Plans', basePath = route.sectionify( context.path ), analyticsBasePath = basePath + '/:site'; - if ( ! site || ! site.jetpack || ! config.isEnabled( 'jetpack/connect' ) ) { + if ( ! config.isEnabled( 'jetpack/connect' ) || ! isJetpack ) { return; }
Jetpack Connect: Avoid fetching a full site object in plans controller
Automattic_wp-calypso
train
js
a8c185f56ce68446a314b16fbd148f8e34100be6
diff --git a/cmd/shadowsocks-local/local.go b/cmd/shadowsocks-local/local.go index <HASH>..<HASH> 100644 --- a/cmd/shadowsocks-local/local.go +++ b/cmd/shadowsocks-local/local.go @@ -224,11 +224,12 @@ func main() { flag.Parse() exists, err := isFileExists(configFile) - // if no config file in current directory, search it in the binary directory - if !exists || err != nil { - baseDir := path.Dir(os.Args[0]) + // If no config file in current directory, try search it in the binary directory + // Note there's no portable way to detect the binary directory. + binDir := path.Dir(os.Args[0]) + if (!exists || err != nil) && binDir != "" && binDir != "." { oldConfig := configFile - configFile = path.Join(baseDir, "config.json") + configFile = path.Join(binDir, "config.json") log.Printf("%s not found, try config file %s\n", oldConfig, configFile) }
Do not try another config file if dir of args[0] is current dir.
shadowsocks_shadowsocks-go
train
go
42478f0358f0fbae6a58407afc729e86737003f8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ packages = [ requires = [ 'skosprovider>=0.5.0', - 'requests>=2.3.0', + 'requests', 'rdflib' ]
Remove requirement on requests version. Refs #<I>.
OnroerendErfgoed_skosprovider_getty
train
py
8445b710bdd34e0847f9f2bfd062b26606703e03
diff --git a/src/browsing.js b/src/browsing.js index <HASH>..<HASH> 100644 --- a/src/browsing.js +++ b/src/browsing.js @@ -53,17 +53,33 @@ function lines(text) { return text.split(/\r\n|\n\r|\r|\n/); } +function inheritedMeta(m, name) { + if (m[name]) { + return m[name]; + } else { + var parent = m.belongsTo; + if (parent) { + return inheritedMeta(mm.get(parent), name); + } else { + return null; + } + } +} + function getObjectMeta(object) { - var result = {}; if (Object(object) !== object) { - return result; + return {}; } - while (object != null) { - result = extend(mm.get(object), result); - object = prototypeOf(object); - } - - return result; + var meta = mm.get(object); + return extend(meta, { + authors : inheritedMeta(meta, 'authors'), + licence : inheritedMeta(meta, 'licence'), + since : inheritedMeta(meta, 'since'), + platforms : inheritedMeta(meta, 'platforms'), + repository : inheritedMeta(meta, 'repository'), + stability : inheritedMeta(meta, 'stability'), + portability : inheritedMeta(meta, 'portability') + }); } function signature(meta) {
feat: Allows inheritance of some properties from container objects.
robotlolita_metamagical
train
js
35215a060da28afe4677a729e43d2897d0c29bc0
diff --git a/lib/csvlint.rb b/lib/csvlint.rb index <HASH>..<HASH> 100644 --- a/lib/csvlint.rb +++ b/lib/csvlint.rb @@ -91,9 +91,9 @@ module Csvlint def check_format(row, line) f = {} - row.each do |col, i| f[i] = "numeric" if col =~ /[0-9]+/ + row.each_with_index do |col, i| unless @formats[i].nil? build_warnings(:inconsistent_values, line) if @formats[i] != f[i] else
each_with_index you fool!
theodi_csvlint.rb
train
rb
e98f798eb39787d6033dff23a39f15286e9e5558
diff --git a/cme/protocols/smb.py b/cme/protocols/smb.py index <HASH>..<HASH> 100755 --- a/cme/protocols/smb.py +++ b/cme/protocols/smb.py @@ -5,6 +5,7 @@ import os import ntpath from StringIO import StringIO from impacket.smbconnection import SMBConnection, SessionError +from impacket.smb import SMB_DIALECT from impacket.examples.secretsdump import RemoteOperations, SAMHashes, LSASecrets, NTDSHashes from impacket.nmb import NetBIOSError from impacket.dcerpc.v5 import transport, lsat, lsad @@ -312,8 +313,9 @@ class smb(connection): return False def create_conn_obj(self): + #Seems like SMBv3 doesn't give us the 'pretty' OS banners, sticking to SMBv1 for now try: - self.conn = SMBConnection(self.host, self.host, None, self.args.smb_port) + self.conn = SMBConnection(self.host, self.host, None, self.args.smb_port, preferredDialect=SMB_DIALECT) except socket.error: return False except Exception as e:
Forcing the SMB dialect to SMBv1 since it gives us prettier OS banners
byt3bl33d3r_CrackMapExec
train
py
b43d621dfc3766e8361f3aaa27e13add1dc8a9c6
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 @@ -519,6 +519,20 @@ class GPM extends Iterator } /** + * Check the passed packages list can be updated + * + * @param $packages_names_list + * + * @throws \Exception + */ + public function checkPackagesCanBeInstalled($packages_names_list) + { + foreach ($packages_names_list as $package_name) { + $this->checkNoOtherPackageNeedsThisDependencyInALowerVersion($package_name, $this->getLatestVersionOfPackage($package_name)); + } + } + + /** * Fetch the dependencies, check the installed packages and return an array with * the list of packages with associated an information on what to do: install, update or ignore. *
Added GPM:: checkPackagesCanBeInstalled(), checks the passed packages list can be installed/updated
getgrav_grav
train
php
b4efa920265b42cad60b655f2bce33820ee8e71d
diff --git a/core/AssetManager.php b/core/AssetManager.php index <HASH>..<HASH> 100644 --- a/core/AssetManager.php +++ b/core/AssetManager.php @@ -91,6 +91,8 @@ class Piwik_AssetManager } $rootDirectoryLen = strlen($rootDirectory); + $less = new lessc; + // Loop through each css file $files = self::getCssFiles(); foreach ($files as $file) { @@ -98,6 +100,7 @@ class Piwik_AssetManager self::validateCssFile($file); $fileLocation = self::getAbsoluteLocation($file); + $less->addImportDir(dirname($fileLocation)); $content = file_get_contents($fileLocation); // Rewrite css url directives @@ -115,7 +118,6 @@ class Piwik_AssetManager $mergedContent = $mergedContent . $content; } - $less = new lessc; $mergedContent = $less->compile($mergedContent); Piwik_PostEvent('AssetManager.filterMergedCss', array(&$mergedContent));
Handle @import rule in less files
matomo-org_matomo
train
php
eab5fa3ed4122f9773c124d0329ea0f194ad0ad7
diff --git a/lib/discovery_home_helper_patch.rb b/lib/discovery_home_helper_patch.rb index <HASH>..<HASH> 100644 --- a/lib/discovery_home_helper_patch.rb +++ b/lib/discovery_home_helper_patch.rb @@ -3,16 +3,16 @@ module DiscoveryHomeHelperPatch base.send(:include, InstanceMethods) base.class_eval do - alias_method_chain :setting_options, :discovers_link + alias_method_chain :settings_menu_items, :discovers_link end end module InstanceMethods # Adds a discovers link to the More menu - def setting_options_with_discovers_link - choices = setting_options_without_discovers_link - choices[2][2].insert(2,['Discovered Hosts', :discovers]) - authorized_menu_actions(choices) + def settings_menu_items_with_discovers_link + menu_items = settings_menu_items_without_discovers_link + menu_items[2][2].insert(2,['Discovered Hosts', :discovers]) if menu_items[2] + menu_items end end end
fixes #<I> error in discovery plugin menu and user without provisioning permissions
theforeman_foreman_discovery
train
rb
c6435c4afb070bebcc0b140d8e44d833a930b136
diff --git a/influxdb/client.py b/influxdb/client.py index <HASH>..<HASH> 100644 --- a/influxdb/client.py +++ b/influxdb/client.py @@ -157,12 +157,8 @@ class InfluxDBClient(object): else: chunked_param = 'false' - url = "{0}/db/{1}/series" - - url.format( - self._baseurl, - self._database - ) + # Build the URL of the serie to query + url = "{0}/db/{1}/series".format(self._baseurl, self._database) params = { 'u': self._username,
Broken query() was not building a valid url
influxdata_influxdb-python
train
py
6d893ad9c2e721c326baf078116dd5823c6ba632
diff --git a/lib/SourceMapDevToolPlugin.js b/lib/SourceMapDevToolPlugin.js index <HASH>..<HASH> 100644 --- a/lib/SourceMapDevToolPlugin.js +++ b/lib/SourceMapDevToolPlugin.js @@ -103,7 +103,10 @@ class SourceMapDevToolPlugin { reportProgress(0.0); const tasks = []; - files.forEach(({ file, chunk }, idx) => { + files.forEach(({ + file, + chunk + }, idx) => { reportProgress(0.5 * idx / files.length, file, "generate SourceMap"); const task = getTaskForFile(file, chunk, options, compilation);
Feature: SourceMapDevToolPlugin progress: make the linter happy again
webpack_webpack
train
js
4920b74e0ba6d82285092ef2826bb830c7a209b6
diff --git a/pyvim/commands/commands.py b/pyvim/commands/commands.py index <HASH>..<HASH> 100644 --- a/pyvim/commands/commands.py +++ b/pyvim/commands/commands.py @@ -241,6 +241,7 @@ def _buffer(editor, variables, force=False): @cmd('bw') +@cmd('bd') def _(editor): """ Wipe buffer. @@ -253,6 +254,7 @@ def _(editor): @cmd('bw!') +@cmd('bd!') def _(editor): """ Force wipe buffer.
Added :bd as keybinding to buffer close
prompt-toolkit_pyvim
train
py
4c9adcf00eb72b787b48d709a3d2942980ac0b1a
diff --git a/oct2py/tests/test_misc.py b/oct2py/tests/test_misc.py index <HASH>..<HASH> 100644 --- a/oct2py/tests/test_misc.py +++ b/oct2py/tests/test_misc.py @@ -236,3 +236,20 @@ class MiscTests(test.TestCase): def test_clear(self): """Make sure clearing variables does not mess anything up.""" self.oc.clear() + + def test_multiline_statement(self): + sobj = StringIO() + hdlr = logging.StreamHandler(sobj) + hdlr.setLevel(logging.DEBUG) + self.oc.logger.addHandler(hdlr) + + self.oc.logger.setLevel(logging.DEBUG) + + ans = self.oc.eval(""" + a =1 + a + 1 + b = 3 + b + 1""") + text = hdlr.stream.getvalue().strip() + assert ans == 4 + assert text.endswith('\na = 1\nans = 2\nb = 3')
Add test for multiline output with two ans statements.
blink1073_oct2py
train
py
d5b761e2c6d4d4f594734e656ae517eb93d3a5a0
diff --git a/soco/core.py b/soco/core.py index <HASH>..<HASH> 100755 --- a/soco/core.py +++ b/soco/core.py @@ -722,7 +722,7 @@ class SoCo(_SocoSingletonBase): coordinator_uid = group_element.attrib['Coordinator'] group_uid = group_element.attrib['ID'] members = set() - for member_element in group_element.iter('ZoneGroupMember'): + for member_element in group_element.findall('ZoneGroupMember'): # Create a SoCo instance for each member. Because SoCo # instances are singletons, this is cheap if they have already # been created, and useful if they haven't. We can then
Missed a change needed for Python <I> in <I>
amelchio_pysonos
train
py
bb45e66edd41ab0b9c3a087f880cf0e5ea65787a
diff --git a/lib/archivist/vaults/mysql/index.js b/lib/archivist/vaults/mysql/index.js index <HASH>..<HASH> 100644 --- a/lib/archivist/vaults/mysql/index.js +++ b/lib/archivist/vaults/mysql/index.js @@ -80,15 +80,18 @@ MysqlVault.prototype.setup = function (cfg, cb) { this.config = cfg.options; } + this.pool = this.mysql.createPool(this.config); + setImmediate(cb); }; MysqlVault.prototype.open = function (cb) { this.logger.verbose('Opening vault:', this.name); - this.pool = this.mysql.createPool(this.config); - - setImmediate(cb); + // Create one connection + this.pool.getConnection((err) => { + return cb(err); + }); }; MysqlVault.prototype.close = function () {
Fix mysql vault setup Mysql pool was created in MysqlVault.open but it should be created in MysqlVault.setup as it's not doing any connection. Also, MysqlVault.createDatabase and MysqlVault.dropDatabase need the pool when MysqlVault.open is not called.
mage_mage
train
js
b26333eaf70c196e24327abc62b44ce16c549368
diff --git a/udata/__init__.py b/udata/__init__.py index <HASH>..<HASH> 100644 --- a/udata/__init__.py +++ b/udata/__init__.py @@ -5,5 +5,5 @@ uData ''' from __future__ import unicode_literals -__version__ = '1.0.0.dev' +__version__ = '1.1.0.dev' __description__ = 'Open data portal'
Set base version to <I> (#<I>)
opendatateam_udata
train
py
71aec7e3ffe167a509e270f195f0fc050fab15b8
diff --git a/osgi/src/main/java/org/jbundle/util/webapp/osgi/OSGiFileServlet.java b/osgi/src/main/java/org/jbundle/util/webapp/osgi/OSGiFileServlet.java index <HASH>..<HASH> 100644 --- a/osgi/src/main/java/org/jbundle/util/webapp/osgi/OSGiFileServlet.java +++ b/osgi/src/main/java/org/jbundle/util/webapp/osgi/OSGiFileServlet.java @@ -61,7 +61,7 @@ public class OSGiFileServlet extends BaseOsgiServlet path = path.substring(1); // Can't start from root try { - url = ClassServiceUtility.getClassService().getResourceURL(path, null, this.getClass().getClassLoader()); + url = ClassServiceUtility.getClassService().getResourceURL(path, null, null, this.getClass().getClassLoader()); } catch (RuntimeException e) { e.printStackTrace(); // ??? }
Add version to OSGi lookup
jbundle_webapp
train
java
e35b9773350c7d80f08e5bc095ee7bac9f8c80b2
diff --git a/oct2py/core.py b/oct2py/core.py index <HASH>..<HASH> 100644 --- a/oct2py/core.py +++ b/oct2py/core.py @@ -404,8 +404,6 @@ class Oct2Py(object): """ Octave command """ kwargs['nout'] = kwargs.get('nout', get_nout()) kwargs['verbose'] = kwargs.get('verbose', False) - if not 'Built-in Function' in doc: - self.eval('clear {0}'.format(name), log=False, verbose=False) return self._call(name, *args, **kwargs) # convert to ascii for pydoc try: @@ -743,9 +741,10 @@ class _Session(object): %(pre_call)s clear("ans"); + rehash; clear("_"); clear("a__"); - disp(char(2)) + disp(char(2)); try disp(char(2));
Use rehash to keep paths up to date
blink1073_oct2py
train
py
4aa6cd2575407aae357b8505b3f3cefb4fb2e0a6
diff --git a/tests/test_sources.py b/tests/test_sources.py index <HASH>..<HASH> 100644 --- a/tests/test_sources.py +++ b/tests/test_sources.py @@ -77,7 +77,7 @@ def test_Sources_roundtrip_latex(tmpdir, bibtex, expected): src = Sources() src.add(bibtex) bib = tmpdir / 'test.bib' - src.write(bib) + src.write(str(bib)) assert expected in bib.read_text('utf8')
fix failing tests on py<I>
cldf_pycldf
train
py
e6549e13f964a2c032a7158ca59d7da7f60407c3
diff --git a/Swat/SwatCalendar.php b/Swat/SwatCalendar.php index <HASH>..<HASH> 100644 --- a/Swat/SwatCalendar.php +++ b/Swat/SwatCalendar.php @@ -64,10 +64,12 @@ class SwatCalendar extends SwatControl $anchor_tag = new SwatHtmlTag('a'); $anchor_tag->href = "javascript:{$this->id}_obj.toggle();"; + $anchor_tag->title = Swat::_('toggle calendar'); $anchor_tag->open(); $img_tag = new SwatHtmlTag('img'); $img_tag->src = 'swat/images/calendar.png'; + $img_tag->alt = Swat::_('calendar toggle graphic'); $img_tag->class = 'swat-calendar-icon'; $img_tag->id = $this->id.'_toggle'; $img_tag->display();
- Added alt text to toggle image (validates XHTML). - Added title to toggle link. svn commit r<I>
silverorange_swat
train
php
dc8460c2417d8d87e4e9505b2a09e9a00a930a2a
diff --git a/colorama/tests/ansitowin32_test.py b/colorama/tests/ansitowin32_test.py index <HASH>..<HASH> 100644 --- a/colorama/tests/ansitowin32_test.py +++ b/colorama/tests/ansitowin32_test.py @@ -170,13 +170,19 @@ class AnsiToWin32Test(TestCase): def test_wrap_shouldnt_raise_on_closed_orig_stdout(self): stream = StringIO() stream.close() - converter = AnsiToWin32(stream) - self.assertFalse(converter.strip) + with \ + patch("colorama.ansitowin32.os.name", "nt"), \ + patch("colorama.ansitowin32.winapi_test", lambda: True): + converter = AnsiToWin32(stream) + self.assertTrue(converter.strip) self.assertFalse(converter.convert) def test_wrap_shouldnt_raise_on_missing_closed_attr(self): - converter = AnsiToWin32(object()) - self.assertFalse(converter.strip) + with \ + patch("colorama.ansitowin32.os.name", "nt"), \ + patch("colorama.ansitowin32.winapi_test", lambda: True): + converter = AnsiToWin32(object()) + self.assertTrue(converter.strip) self.assertFalse(converter.convert) def testExtractParams(self):
Make tests pass on all OS. These were failing for me when run on Windows. But passed on Linux. Now they pass everywhere.
tartley_colorama
train
py
c256de1fa0252c75806ea38048d325410cf453b4
diff --git a/www/javascript/swat-color-entry.js b/www/javascript/swat-color-entry.js index <HASH>..<HASH> 100644 --- a/www/javascript/swat-color-entry.js +++ b/www/javascript/swat-color-entry.js @@ -6,7 +6,7 @@ function SwatColorEntry(id) this.hex = Array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'); this.shades = new Array(1, 0.80, 0.60, 0.40, 0.20, 0); - this.entryElement = document.getElementById(this.id); + this.entryElement = document.getElementById(this.id + '_value'); if (this.entryElement.value.length == 6) { this.setHex(this.entryElement.value);
Respect Swat changes to ColorEntry in JavaScript. svn commit r<I>
silverorange_swat
train
js
cb3a38d5c039484ba231461c6f599593af59b94b
diff --git a/lib/discordrb/bot.rb b/lib/discordrb/bot.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/bot.rb +++ b/lib/discordrb/bot.rb @@ -1370,6 +1370,15 @@ module Discordrb def send_heartbeat(sequence = nil) sequence ||= @sequence + + if @awaiting_ack + # There has been no HEARTBEAT_ACK between the last heartbeat and now, so reconnect because the connection might + # be a zombie + LOGGER.warn("No HEARTBEAT_ACK received between the last heartbeat and now! (seq: #{sequence}) Reconnecting + because the connection might be a zombie.") + websocket_reconnect(nil) + end + LOGGER.out("Sending heartbeat with sequence #{sequence}") data = { op: Opcodes::HEARTBEAT,
Reconnect if there has been too much time between the last heartbeat and the current one
meew0_discordrb
train
rb
4199c35e1c3b10b4ac32a51403db33909e7c59b2
diff --git a/lib/util/data-server.js b/lib/util/data-server.js index <HASH>..<HASH> 100644 --- a/lib/util/data-server.js +++ b/lib/util/data-server.js @@ -197,6 +197,9 @@ module.exports = function init(_proxy) { var result; if (ip === 'self') { ip = clientIp; + cid = clientId; + } else if (ip === 'clientIp') { + ip = clientIp; } if (ip === 'clientId') { if (clientId) { cid = clientId; @@ -211,6 +214,9 @@ module.exports = function init(_proxy) { cid = clientId; } else { if (item === 'self') { + cid = clientId; + item = clientIp; + } else if (item === 'clientIp') { item = clientIp; } if (net.isIP(item) && list.indexOf(item) === -1) {
feat: self <=> clientIp + clientId
avwo_whistle
train
js
7bcee6f8612967153126f7dc7ac8841578154d5b
diff --git a/livetests.py b/livetests.py index <HASH>..<HASH> 100755 --- a/livetests.py +++ b/livetests.py @@ -131,6 +131,11 @@ class TestGerritAgainstLiveServer(object): # Will raise binascii.Error if content is not properly encoded base64.b64decode(response) + def test_get_patch_zip(self, gerrit_api): + """Test a GET request to get a patch file (issue #19).""" + change_id = self._get_test_change(gerrit_api)["id"] + gerrit_api.get("/changes/" + change_id + "/revisions/current/patch?zip") + def test_put_with_no_content(self, gerrit_api): """Test a PUT request with no content.""" change_id = self._get_test_change(gerrit_api)["id"]
Add a test to confirm that GET works with patch zip file Closes #<I> Change-Id: Ide4fd5c2bd3cbe<I>d<I>e<I>b<I>d1b2c7
dpursehouse_pygerrit2
train
py
abd9159fab2fd67a26ed6dbc6c35eef4facc6435
diff --git a/src/utils/scrollTo.js b/src/utils/scrollTo.js index <HASH>..<HASH> 100644 --- a/src/utils/scrollTo.js +++ b/src/utils/scrollTo.js @@ -1,5 +1,5 @@ export default function scrollTo(id) { - const element = document.querySelector('html'); + const element = document.scrollingElement || document.documentElement; let to = 0; if (id) { to = document.getElementById(id).offsetTop;
Fixes scrolling in Safari and a few other browsers
vue-styleguidist_vue-styleguidist
train
js
70434a35cbd5dfe596cb6dcd7479a25a6227b71a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,6 @@ setup( extras_require={ 'tests': [ 'pytest>3.6.4', - 'pytest-requests', 'pytest-cov<2.6', 'coveralls', 'pytest-mock',
pytest-requests is not used
danielperna84_ha-philipsjs
train
py
33edafe70064a690949c505f7312e9eaa18e3761
diff --git a/src/Silex/WebTestCase.php b/src/Silex/WebTestCase.php index <HASH>..<HASH> 100644 --- a/src/Silex/WebTestCase.php +++ b/src/Silex/WebTestCase.php @@ -21,6 +21,11 @@ use Symfony\Component\HttpKernel\HttpKernel; */ abstract class WebTestCase extends \PHPUnit_Framework_TestCase { + /** + * Application instance. + * + * @var Application + */ protected $app; /**
Add docblock for the $app field
silexphp_Silex
train
php
75d3938a4842b2aa667dcd902e376a5a01a797e5
diff --git a/commitizen/git.py b/commitizen/git.py index <HASH>..<HASH> 100644 --- a/commitizen/git.py +++ b/commitizen/git.py @@ -21,7 +21,10 @@ class GitCommit(GitObject): @property def message(self): - return f"{self.title}\n\n{self.body}" + message = self.title + if self.body: + message = message + f"\n\n{self.body}" + return message def __repr__(self): return f"{self.title} ({self.rev})"
fix(git): fix returned value for GitCommit.message when body is empty GitCommit.message should return only title without excess newlines if commit body is empty.
Woile_commitizen
train
py
8f8ef52616f778e3a5e5bacb04bb0666674b0b8e
diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/Message.java b/graylog2-server/src/main/java/org/graylog2/plugin/Message.java index <HASH>..<HASH> 100644 --- a/graylog2-server/src/main/java/org/graylog2/plugin/Message.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/Message.java @@ -257,7 +257,9 @@ public class Message implements Messages { return; } - if(value instanceof String) { + if (FIELD_TIMESTAMP.equals(key.trim()) && value != null && value instanceof Date) { + fields.put(FIELD_TIMESTAMP, new DateTime(value)); + } else if(value instanceof String) { final String str = ((String) value).trim(); if(!str.isEmpty()) {
addField allows Date objects for timestamp fields this leads to all kind of sadness later on: we really depend on timestamp being a DateTime instance Enforce a DateTime in case it was a Date
Graylog2_graylog2-server
train
java
00b42eb05f28610256e1362a3bb840ebb7ffd978
diff --git a/nailgun/entities.py b/nailgun/entities.py index <HASH>..<HASH> 100644 --- a/nailgun/entities.py +++ b/nailgun/entities.py @@ -6485,6 +6485,7 @@ class Subscription( def __init__(self, server_config=None, **kwargs): self._fields = { 'activation_key': entity_fields.OneToManyField(ActivationKey), + 'cp_id': entity_fields.StringField(unique=True), 'name': entity_fields.StringField(), 'organization': entity_fields.OneToOneField(Organization), 'provided_product': entity_fields.OneToManyField(Product),
Read Pool ID of Subscription (#<I>)
SatelliteQE_nailgun
train
py
1ba10cab7be6389d65c208df7a5c52c0bebb4f51
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ except: setup( name = "netsnmpagent", - version = "0.1.1", + version = "0.2", description = "Facilitates writing Net-SNMP (AgentX) subagents in Python", long_description = """ python-netsnmpagent is a Python module that facilitates writing Net-SNMP
Increase version number to <I>
pief_python-netsnmpagent
train
py
3b3445fb7c5b4e652c272c539588c70bb4f47819
diff --git a/bootstrap-rating.js b/bootstrap-rating.js index <HASH>..<HASH> 100644 --- a/bootstrap-rating.js +++ b/bootstrap-rating.js @@ -6,6 +6,10 @@ $.fn.rating = function (options) { return this.each(function () { var $input = $(this); + // Prevent against multiple instantiations. + if ($input.data('rating')) + return; + $input.data('rating', true); // Merge data and parameter options. // Those provided as parameter prevail over the data ones. var opts = $.extend({}, $input.data(), options);
Prevent against multiple instantiations #9
dreyescat_bootstrap-rating
train
js
5c59ba037f87c4dbdb0be24c5f498df10140d638
diff --git a/sos/report/plugins/ipmitool.py b/sos/report/plugins/ipmitool.py index <HASH>..<HASH> 100644 --- a/sos/report/plugins/ipmitool.py +++ b/sos/report/plugins/ipmitool.py @@ -26,12 +26,14 @@ class IpmiTool(Plugin, RedHatPlugin, DebianPlugin): if result['status'] == 0: cmd += " -I usb" + for subcmd in ['channel info', 'channel getaccess', 'lan print']: + for channel in [1, 3]: + self.add_cmd_output("%s %s %d" % (cmd, subcmd, channel)) + # raw 0x30 0x65: Get HDD drive Fault LED State # raw 0x30 0xb0: Get LED Status self.add_cmd_output([ - "%s channel info 3" % cmd, - "%s channel getaccess 3" % cmd, "%s raw 0x30 0x65" % cmd, "%s raw 0x30 0xb0" % cmd, "%s sel info" % cmd, @@ -40,7 +42,6 @@ class IpmiTool(Plugin, RedHatPlugin, DebianPlugin): "%s sensor list" % cmd, "%s chassis status" % cmd, "%s lan print" % cmd, - "%s lan print 3" % cmd, "%s fru print" % cmd, "%s mc info" % cmd, "%s sdr info" % cmd
[ipmitool] Collect data for IPMI channel number 1 Hardware vendors choose an IPMI channel number for BMC LAN. The current IPMI plugin is collecting data for channel 3. Dell is using channel number 3. The number is not reserved for a specific hardware vendor. It can be used by others too.
sosreport_sos
train
py
4bbce0243c0da8924fc3c94b44f6ba0ae31b956f
diff --git a/lib/deep_cover/node.rb b/lib/deep_cover/node.rb index <HASH>..<HASH> 100644 --- a/lib/deep_cover/node.rb +++ b/lib/deep_cover/node.rb @@ -97,5 +97,11 @@ module DeepCover children_nodes.each(&:line_cover) end + def fancy_type + class_name = self.class.to_s.rpartition('::').last + t = super + t.casecmp(class_name) == 0 ? t : "#{t}[#{class_name}]" + end + end end
Output class when it doesn't match the type
deep-cover_deep-cover
train
rb
1ed2c161c6c6aae2c51350fe27197df112500490
diff --git a/src/Phpro/SoapClient/CodeGenerator/Util/Normalizer.php b/src/Phpro/SoapClient/CodeGenerator/Util/Normalizer.php index <HASH>..<HASH> 100644 --- a/src/Phpro/SoapClient/CodeGenerator/Util/Normalizer.php +++ b/src/Phpro/SoapClient/CodeGenerator/Util/Normalizer.php @@ -50,23 +50,16 @@ class Normalizer $normalizations = [ 'long' => 'int', 'short' => 'int', - 'dateTime' => '\\DateTime', + 'datetime' => '\\DateTime', 'date' => '\\DateTime', 'boolean' => 'bool', 'decimal' => 'float', 'double' => 'float', ]; - return preg_replace( - array_map( - function ($search) { - return '/^' . $search. '$/i'; - }, - array_keys($normalizations) - ), - array_values($normalizations), - $type - ); + $searchType = strtolower($type); + + return array_key_exists($searchType, $normalizations) ? $normalizations[$searchType] : $type; } /**
Make type normalization code easier to understand
phpro_soap-client
train
php
4665cc8cd1036064e49a9932e33c20a72f2fd280
diff --git a/lib/render.js b/lib/render.js index <HASH>..<HASH> 100644 --- a/lib/render.js +++ b/lib/render.js @@ -8,6 +8,6 @@ hbs.registerHelper('is', function(variable,test,options) { }); module.exports = function(template,data) { - var render = hbs.compile(template); + var render = hbs.compile(template,{noEscape: true}); return render(data); }; \ No newline at end of file
Added option to fix html template issues
Jam3_nyg
train
js
783f1ad8d706d7b70a0e440e75933fb9b375934f
diff --git a/src/transaction_base.js b/src/transaction_base.js index <HASH>..<HASH> 100644 --- a/src/transaction_base.js +++ b/src/transaction_base.js @@ -79,7 +79,7 @@ export class TransactionBase { /** * Signs a transaction with the given {@link Keypair}. Useful if someone sends * you a transaction XDR for you to sign and return (see - * {@link #addSignature} for how that works). + * [addSignature](#addSignature) for more information). * * When you get a transaction XDR to sign.... * - Instantiate a `Transaction` object with the XDR @@ -117,9 +117,9 @@ export class TransactionBase { * transactions onto your account! Doing so will invalidate this pre-compiled * transaction! * - Send this XDR string to your other parties. They can use the instructions - * for {@link #getKeypairSignature} to sign the transaction. + * for [getKeypairSignature](#getKeypairSignature) to sign the transaction. * - They should send you back their `publicKey` and the `signature` string - * from {@link #getKeypairSignature}, both of which you pass to + * from [getKeypairSignature](#getKeypairSignature), both of which you pass to * this function. * * @param {string} publicKey The public key of the signer
Fix relative URL. (#<I>) The previous syntax was not valid, producing an invalid link. Also it happened to break the developers portal build.
stellar_js-stellar-base
train
js
39ca3044eaf1fbda41b3519118b93335c6c32ec4
diff --git a/backup/util/plan/base_plan.class.php b/backup/util/plan/base_plan.class.php index <HASH>..<HASH> 100644 --- a/backup/util/plan/base_plan.class.php +++ b/backup/util/plan/base_plan.class.php @@ -60,13 +60,17 @@ abstract class base_plan implements checksumable, executable { $task->set_plan($this); // Append task settings to plan array, if not present, for comodity foreach ($task->get_settings() as $key => $setting) { - if (!in_array($setting, $this->settings)) { - $name = $setting->get_name(); - if (!isset($this->settings[$name])) { - $this->settings[$name] = $setting; - } else { - throw new base_plan_exception('multiple_settings_by_name_found', $name); - } + // Check if there is already a setting for this name. + $name = $setting->get_name(); + if (!isset($this->settings[$name])) { + // There is no setting, so add it. + $this->settings[$name] = $setting; + } else if ($this->settings[$name] != $setting) { + // If the setting already exists AND it is not the same setting, + // then throw an error. (I.e. you're allowed to add the same + // setting twice, but cannot add two different ones with same + // name.) + throw new base_plan_exception('multiple_settings_by_name_found', $name); } } }
MDL-<I> Backup: Unnecessary use of in_array in base_plan Remove unnecessary use of in_array which causes performance problems when loading the plan for very large courses.
moodle_moodle
train
php
41a3fdd1c3dedddf37ac4bc97551a00cb0aa0d25
diff --git a/plex_metadata/guid.py b/plex_metadata/guid.py index <HASH>..<HASH> 100644 --- a/plex_metadata/guid.py +++ b/plex_metadata/guid.py @@ -66,16 +66,10 @@ class Guid(object): def __repr__(self): parameters = [ - 'agent: %r' % self.agent, - 'value: %r' % self.value + 'service: %r' % self.service, + 'id: %r' % self.id ] - if self.service is not None: - parameters.append('service: %r' % self.service) - - if self.id is not None: - parameters.append('id: %r' % self.id) - if self.season is not None: parameters.append('season: %r' % self.season)
Updated `Guid.__repr__()`
fuzeman_plex.metadata.py
train
py
5c2bbef86612775eb376d2dd50d50242c87793ea
diff --git a/command/install_lib.py b/command/install_lib.py index <HASH>..<HASH> 100644 --- a/command/install_lib.py +++ b/command/install_lib.py @@ -77,7 +77,8 @@ class install_lib(Command): if not isinstance(self.optimize, int): try: self.optimize = int(self.optimize) - assert self.optimize in (0, 1, 2) + if self.optimize not in (0, 1, 2): + raise AssertionError except (ValueError, AssertionError): raise DistutilsOptionError("optimize must be 0, 1, or 2")
Merged revisions <I> via svnmerge from svn+ssh://<EMAIL>/python/trunk ........ r<I> | tarek.ziade | <I>-<I>-<I> <I>:<I>:<I> <I> (Tue, <I> May <I>) | 1 line removing the assert statement so the code works when Python is run with -O ........
pypa_setuptools
train
py
5ed8c6e7b2f1138ca60ce27906e6ac50195504f2
diff --git a/pyemma/coordinates/transform/tica.py b/pyemma/coordinates/transform/tica.py index <HASH>..<HASH> 100644 --- a/pyemma/coordinates/transform/tica.py +++ b/pyemma/coordinates/transform/tica.py @@ -344,9 +344,11 @@ class TICA(StreamingTransformer): """ X_meanfree = X - self.mean Y = np.dot(X_meanfree, self.eigenvectors[:, 0:self.dimension()]) + if self.kinetic_map and self.commute_map: + raise ValueError('Trying to use both kinetic_map and commute_map. Use either or.') if self.kinetic_map: # scale by eigenvalues Y *= self.eigenvalues[0:self.dimension()] - if self.commute_map: + if self.commute_map: # scale by (regularized) timescales timescales = self.timescales[0:self.dimension()] # dampen timescales smaller than the lag time, as in section 2.5 of ref. [5]
Raise ValueError in `transform_array` Previously, this was only checked in the constructor. This now catches if the user has set the `kinetic_map` or `commute_map` attributes incorrectly after construction.
markovmodel_PyEMMA
train
py
aa36d2f39a0432738ae4c560c12867e1c18f3328
diff --git a/gooey/gui/widgets/components.py b/gooey/gui/widgets/components.py index <HASH>..<HASH> 100644 --- a/gooey/gui/widgets/components.py +++ b/gooey/gui/widgets/components.py @@ -182,7 +182,7 @@ class RadioGroup(object): self.option_stings = [btn_data['commands'] for btn_data in self.data] # box = wx.StaticBox(self.panel, -1, label=self.data['group_name']) - box = wx.StaticBox(self.panel, -1, label='Set Verbosity Level') + box = wx.StaticBox(self.panel, -1, label='') vertical_container = wx.StaticBoxSizer(box, wx.VERTICAL) for button, name, help in zip(self.radio_buttons, self.btn_names, self.help_msgs):
Removed hard-coded title from StaticBox constructor
chriskiehl_Gooey
train
py
1268537bcacb0fa9ba8e512414ca5b0c8988d815
diff --git a/client/lib/wp/browser.js b/client/lib/wp/browser.js index <HASH>..<HASH> 100644 --- a/client/lib/wp/browser.js +++ b/client/lib/wp/browser.js @@ -51,7 +51,7 @@ if ( config.isEnabled( 'support-user' ) ) { // expose wpcom global var only in development if ( 'development' === config( 'env' ) ) { - let wpcomPKG = require( 'wpcom/package' ); + const wpcomPKG = require( 'wpcom/package' ); window.wpcom = wpcom; window.wpcom.__version = wpcomPKG.version; }
wp: fix eslint warning.
Automattic_wp-calypso
train
js
49865fced0e5ceaa90a48c26fe590be978ada0d4
diff --git a/structurizr-core/src/com/structurizr/util/WorkspaceUtils.java b/structurizr-core/src/com/structurizr/util/WorkspaceUtils.java index <HASH>..<HASH> 100644 --- a/structurizr-core/src/com/structurizr/util/WorkspaceUtils.java +++ b/structurizr-core/src/com/structurizr/util/WorkspaceUtils.java @@ -5,10 +5,8 @@ import com.structurizr.io.WorkspaceWriterException; import com.structurizr.io.json.JsonReader; import com.structurizr.io.json.JsonWriter; -import java.io.File; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.StringWriter; +import java.io.*; +import java.nio.charset.StandardCharsets; /** * Some utility methods related to workspaces. @@ -46,7 +44,7 @@ public final class WorkspaceUtils { throw new IllegalArgumentException("The path to a JSON file must be specified."); } - FileWriter writer = new FileWriter(file); + OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8); new JsonWriter(true).write(workspace, writer); writer.flush(); writer.close();
Force UTF-8 file encoding.
structurizr_java
train
java
4b4f4fdad637ba4e32d69456e455fef78e920025
diff --git a/src/toil/test/cwl/cwlTest.py b/src/toil/test/cwl/cwlTest.py index <HASH>..<HASH> 100644 --- a/src/toil/test/cwl/cwlTest.py +++ b/src/toil/test/cwl/cwlTest.py @@ -137,7 +137,7 @@ class CWLTest(ToilTest): os.remove("spec.zip") try: cmd = ["bash", "run_test.sh", "RUNNER=toil-cwl-runner", - "DRAFT=v1.0"] + "DRAFT=v1.0", "-j4"] if batchSystem: cmd.extend(["--batchSystem", batchSystem]) subprocess.check_output(cmd, cwd=cwlSpec, stderr=subprocess.STDOUT)
speed up the CWL conformance testing
DataBiosphere_toil
train
py
c5c12411b8c0b2039060dc88c29e943c8f8c06d6
diff --git a/lib/completion.js b/lib/completion.js index <HASH>..<HASH> 100644 --- a/lib/completion.js +++ b/lib/completion.js @@ -11,7 +11,7 @@ module.exports = function(name) { console.log(fs.readFileSync(filepath, 'utf8')); process.exit(0); } catch (err) { - console.log('echo "Specified gulp shell auto-completion rules for "'+name+'" not found'); + console.log('echo "Specified gulp shell auto-completion rules for \''+name+'\' not found"'); process.exit(5); } };
Quick fix bug in autocompletion
ratson_gulp-v4
train
js
89aacb10ebbf66ebdb4adf54a0a5cf31d7f9d0a0
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -200,7 +200,7 @@ Hyperdrive.prototype._fetchVersion = function (prev, cb) { }) function ondata (data, next) { - if (updated || error) return next(new Error('Out of date')) + if (updated || error) return callAndKick(next, new Error('Out of date')) if (queued >= maxQueued) { waitingData = data @@ -211,12 +211,12 @@ Hyperdrive.prototype._fetchVersion = function (prev, cb) { var start = data.value.offset var end = start + data.value.blocks - if (start === end) return next() + if (start === end) return callAndKick(next, null) queued++ self.content.download({start: start, end: end}, function (err) { - if (updated) return kick() - queued-- + if (updated && !waitingCallback) return kick() + if (!updated) queued-- if (waitingCallback) { data = waitingData @@ -237,6 +237,11 @@ Hyperdrive.prototype._fetchVersion = function (prev, cb) { process.nextTick(next) } + function callAndKick (next, err) { + next(err) + kick() + } + function kick () { if (!done || queued) return queued = -1 // so we don't enter this twice
fix downloads getting stuck in edge case
mafintosh_hyperdrive
train
js
07ea9ad4dc5aa5b28b40bea5b3517dbc092f2112
diff --git a/shared/app.js b/shared/app.js index <HASH>..<HASH> 100644 --- a/shared/app.js +++ b/shared/app.js @@ -6,7 +6,8 @@ var Backbone = require('backbone'), Fetcher = require('./fetcher'), ModelUtils = require('./modelUtils'), - isServer = (typeof window === 'undefined'); + isServer = (typeof window === 'undefined'), + defaultRouterModule = 'app/router'; if (!isServer) { Backbone.$ = window.$ || require('jquery'); @@ -72,7 +73,7 @@ module.exports = Backbone.Model.extend({ * Initialize the `ClientRouter` on the client-side. */ if (!isServer) { - var ClientRouter = options.ClientRouter || require('app/router'); + var ClientRouter = options.ClientRouter || require(defaultRouterModule); new ClientRouter({ app: this,
Pull router module name into variable so browserify doesn't follow it
rendrjs_rendr
train
js
c28c2224c4e87afb08d441a0f769fa79b0931a34
diff --git a/core/commands/root.go b/core/commands/root.go index <HASH>..<HASH> 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -68,7 +68,7 @@ at ~/.ipfs. To change the repo location, set the $IPFS_PATH environment variable EXIT STATUS -The CLI will exits with one of the following values: +The CLI will exit with one of the following values: 0 Successful execution. 1 Failed executions.
Fix typo Brought up bt tmg on irc License: MIT
ipfs_go-ipfs
train
go
6714e7a124669a01eb33cb51f092dd7cb14ffe9d
diff --git a/allegedb/allegedb/tests/test_load.py b/allegedb/allegedb/tests/test_load.py index <HASH>..<HASH> 100644 --- a/allegedb/allegedb/tests/test_load.py +++ b/allegedb/allegedb/tests/test_load.py @@ -34,7 +34,7 @@ def db(): nx.MultiGraph: orm.new_multigraph, nx.MultiDiGraph: orm.new_multidigraph }[type(graph)](graph.name, graph) - assert set(graph.node.keys()) == set(orm.graph[graph.name].node.keys()), \ + assert set(graph.nodes.keys()) == set(orm.graph[graph.name].nodes.keys()), \ "{}'s nodes changed during instantiation".format(graph.name) assert set(graph.edges) == set(orm.graph[graph.name].edges), \ "{}'s edges changed during instantiation".format(graph.name)
Fix another test that broke on networkx <I>
LogicalDash_LiSE
train
py
ebb74b489a65b7991333e7b0a3494f4a91a64a11
diff --git a/tools/static/hooks/hook-pycbc.py b/tools/static/hooks/hook-pycbc.py index <HASH>..<HASH> 100644 --- a/tools/static/hooks/hook-pycbc.py +++ b/tools/static/hooks/hook-pycbc.py @@ -41,6 +41,7 @@ hiddenimports = ['pycbc.fft.fft_cpu', 'pycbc.waveform.spa_tmplt_cpu', 'pycbc.types.array_cpu', 'pycbc.fft.backend_cpu', + 'pycbc.fft.backend_mkl', 'pycbc.fft.fftw', 'pycbc.fft.mkl', 'pycbc.fft.lalfft',
Add pycbc.fft.backend_mkl as hidden dependency for pyinstaller
gwastro_pycbc
train
py
1d87dceded0469415b71ac30249159fc301a6486
diff --git a/lib/gp-hmac.js b/lib/gp-hmac.js index <HASH>..<HASH> 100644 --- a/lib/gp-hmac.js +++ b/lib/gp-hmac.js @@ -30,7 +30,7 @@ var GaasHmac = function GaasHmac(name, user, secret) { if(!this.name || !this.user || !this.secret) { throw new Error('GaasHmac: params need to be "name,user,secret"'); } - this.secretBuffer = new Buffer(this.secret, this.ENC); + this.secretBuffer = Buffer.alloc(this.secret.length, this.secret, this.ENC); }; GaasHmac.prototype.name = null;
fix use of deprecated Buffer
IBM-Cloud_gp-js-client
train
js
7f66de0f1ba71f560e93974022d7f90f41830459
diff --git a/pylint/lint/pylinter.py b/pylint/lint/pylinter.py index <HASH>..<HASH> 100644 --- a/pylint/lint/pylinter.py +++ b/pylint/lint/pylinter.py @@ -894,8 +894,7 @@ class PyLinter( # notify global begin for checker in _checkers: checker.open() - if interfaces.implements(checker, interfaces.IAstroidChecker): - walker.add_checker(checker) + walker.add_checker(checker) yield functools.partial( self.check_astroid_module,
No longer care about ``interfaces.IAstroidChecker``
PyCQA_pylint
train
py
6d9412672a28b1256d103c4fe654cde868513200
diff --git a/src/Creiwork.php b/src/Creiwork.php index <HASH>..<HASH> 100644 --- a/src/Creiwork.php +++ b/src/Creiwork.php @@ -210,20 +210,7 @@ class Creiwork $routerunner->setPostProcessor($container->get(PostProcessor::class)); return $routerunner; }, - - \PDO::class => function (Config $config) { - $database = $config->get('database.database'); - $host = $config->get('database.host'); - $port = $config->get('database.port'); - return new PDO( - "mysql:dbname=$database;host=$host;port=$port;charset=utf8", - $config->get('database.user'), - $config->get('database.password') - ); - }, - - Database::class => create(PdoDatabase::class), - + Plates\Engine::class => function () { $templateDirectory = null; if ($this->isTemplateDirectorySet()) {
removed duplicate DI definitions for PDO and Database
creios_creiwork-framework
train
php
28380520fbfdaf3f7e5a8cc3b8788b48bf33d2cc
diff --git a/tests/test_serializer.py b/tests/test_serializer.py index <HASH>..<HASH> 100644 --- a/tests/test_serializer.py +++ b/tests/test_serializer.py @@ -68,8 +68,8 @@ class TestCase(unittest.TestCase): if result not in expected: if options.get("omit_optional_tags", True): options["omit_optional_tags"] = False - self.assertEquals(self.serialize_html(input, options), result) - else: + result = self.serialize_html(input, options) + if result not in expected: self.fail("Expected: %s, Received: %s" % (expected, result)) def serialize_html(self, input, options): @@ -79,6 +79,7 @@ class TestCase(unittest.TestCase): def test_serializer(): for filename in glob.glob('serializer/*.test'): + if filename.find('core')<0: continue tests = simplejson.load(file(filename)) for test in tests['tests']: yield test
Instead of comparing the result against the previous result, compare it against what is expected. --HG-- extra : convert_revision : svn%3Aacbfec<I>-<I>-<I>-a<I>-<I>a<I>e<I>e0/trunk%<I>
html5lib_html5lib-python
train
py
4e5b696f04f19eb68a4f06bebf180ca4c4f6b1f2
diff --git a/lib/tori/define.rb b/lib/tori/define.rb index <HASH>..<HASH> 100644 --- a/lib/tori/define.rb +++ b/lib/tori/define.rb @@ -1,16 +1,16 @@ module Tori module Define def tori(name) - name_file_ivar = "@#{name}_file".to_sym + name_ivar = "@#{name}".to_sym define_method(name) do - ivar = instance_variable_get name_file_ivar - instance_variable_set name_file_ivar, ivar || File.new(self) + ivar = instance_variable_get name_ivar + instance_variable_set name_ivar, ivar || File.new(self) end define_method("#{name}=") do |uploader| file = File.new(self, uploader) - instance_variable_set name_file_ivar, file + instance_variable_set name_ivar, file end end end
Rename ivar to simple name.
ksss_tori
train
rb
c77d86a68ac2a5a5104ec8f5b66633ce26307dda
diff --git a/src/main/java/strman/Strman.java b/src/main/java/strman/Strman.java index <HASH>..<HASH> 100644 --- a/src/main/java/strman/Strman.java +++ b/src/main/java/strman/Strman.java @@ -490,7 +490,7 @@ public abstract class Strman { if (index > value.length()) { return value; } - return value.substring(0, index) + substr + value.substring(index); + return append(value.substring(0, index), substr, value.substring(index)); } public static String leftPad(final String value, final String pad, final int length) {
Fixed #7. Added support for `insert` function
shekhargulati_strman-java
train
java
e7645da0c7ae4ffdd1b9760aaa5e20b01989d0c2
diff --git a/Command/Validators.php b/Command/Validators.php index <HASH>..<HASH> 100644 --- a/Command/Validators.php +++ b/Command/Validators.php @@ -61,7 +61,7 @@ class Validators public static function validateBundleName($bundle) { if (!preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $bundle)) { - throw new \InvalidArgumentException('The bundle name contains invalid characters.'); + throw new \InvalidArgumentException(sprintf('The bundle name %s contains invalid characters.', $bundle)); } if (!preg_match('/Bundle$/', $bundle)) {
Improving error message on the validator - just a bit more helpful when I'm doing tests
sensiolabs_SensioGeneratorBundle
train
php
83ef47c8d0d603ea1d7352c64d92674b568d2693
diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php @@ -3200,10 +3200,6 @@ class ClassMetadataInfo implements ClassMetadata ); } -// $fieldMapping['columnName'] = ! empty($this->embeddedClasses[$property]['columnPrefix']) || $this->embeddedClasses[$property]['columnPrefix'] === false -// ? $this->embeddedClasses[$property]['columnPrefix'] . $fieldMapping['columnName'] -// : $this->namingStrategy->embeddedFieldToColumnName($property, $fieldMapping['columnName'], $this->reflClass->name, $embeddable->reflClass->name); - $this->mapField($fieldMapping); } }
This fixes ticket DDC-<I> Enables columnPrefix to be "false" so no prefix is added. Changed the structure a bit (to if/else) to be more readable with the additional condition.
doctrine_orm
train
php
864ce5aa89a99b17051bb41ce243490b8be0d4a1
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -5,28 +5,24 @@ var isVendorPrefixed = require('is-vendor-prefixed') module.exports = postcss.plugin('postcss-remove-prefixes', function (options) { if (!options) { - options = {}; + options = { + ignore: [] + } } - var ignore = options.ignore ? Array.isArray(options.ignore) ? options.ignore : false : []; - - if (ignore === false) { + if (!Array.isArray(options.ignore)) { throw TypeError("options.ignore must be an array") } - for (var i = 0; i < ignore.length; ++i) { - var value = ignore[i]; - - if (typeof value === "string") { - value = new RegExp(value + "$", "i") + var ignore = options.ignore.map(function (value) { + if (typeof value === 'string') { + return new RegExp(value + '$', 'i') } else if (value instanceof RegExp) { - + return value } else { - throw TypeError("options.ignore values can either be a string or a regular expression") + throw TypeError('options.ignore values can either be a string or a regular expression') } - - ignore[i] = value; - } + }) return function removePrefixes(root, result) { root.walkDecls(function (declaration) {
Change code as per @johnotander's suggestion
johno_postcss-remove-prefixes
train
js
ae4728c5d674a59870393e0611375c70ac5aa710
diff --git a/shared/framework/lib/rhom/rhom_db_adapter.rb b/shared/framework/lib/rhom/rhom_db_adapter.rb index <HASH>..<HASH> 100644 --- a/shared/framework/lib/rhom/rhom_db_adapter.rb +++ b/shared/framework/lib/rhom/rhom_db_adapter.rb @@ -71,7 +71,7 @@ module Rhom SyncEngine::unlock_sync_mutex end end - #puts "returned #{result.length.to_s} records..." + puts "returned #{result.length.to_s} records..." result end diff --git a/shared/framework/lib/rhom/rhom_object_factory.rb b/shared/framework/lib/rhom/rhom_object_factory.rb index <HASH>..<HASH> 100644 --- a/shared/framework/lib/rhom/rhom_object_factory.rb +++ b/shared/framework/lib/rhom/rhom_object_factory.rb @@ -90,7 +90,7 @@ module Rhom {"object"=>obj,"update_type"=>'query'}) end list = get_list(result) - if list.length == 1 + if list.length == 1 and args.first != :all return list[0] end list
fixed bug where no records were returned if calling find with :all parameter
rhomobile_rhodes
train
rb,rb
65cb9945d46c85e6f418d13e39716ee8669036f6
diff --git a/kubespawner/traitlets.py b/kubespawner/traitlets.py index <HASH>..<HASH> 100644 --- a/kubespawner/traitlets.py +++ b/kubespawner/traitlets.py @@ -34,11 +34,11 @@ class LabelSelector(Dict): """ if not isinstance(d, dict) or not d: return level - return max(Selector.depth(d[k], level + 1) for k in d) + return max(LabelSelector.depth(d[k], level + 1) for k in d) def validate(self, obj, value): - value = super(Selector, self).validate(obj, value) - depth = Selector.depth(value) + value = super(LabelSelector, self).validate(obj, value) + depth = LabelSelector.depth(value) if depth <= 1: return value else:
Rename Selector to LabelSelector
jupyterhub_kubespawner
train
py
b59ab6f24f26234caa9d8f84f0dc73a48ff99be5
diff --git a/src/main/resources/META-INF/monkey_patches.rb b/src/main/resources/META-INF/monkey_patches.rb index <HASH>..<HASH> 100644 --- a/src/main/resources/META-INF/monkey_patches.rb +++ b/src/main/resources/META-INF/monkey_patches.rb @@ -1,7 +1,7 @@ # if the GEM_PATH set to uri:classloader://WEB-INF/classes then # JRuby does ignore it. this statement sets it - assuming a single path # element -Gem::Specification.add_dir ENV["GEM_PATH"] +Gem::Specification.add_dir ENV["GEM_PATH"] rescue nil # bundler includes Bundler::SharedHelpers into its runtime # adding the included method allows to monkey patch the runtime
make monkey patches fail safe for older jrubies
jruby_jruby-mains
train
rb
9fbd0ce208c0e593702611f34689a385b9052ded
diff --git a/library/src/main/java/com/mikepenz/materialdrawer/model/AbstractDrawerItem.java b/library/src/main/java/com/mikepenz/materialdrawer/model/AbstractDrawerItem.java index <HASH>..<HASH> 100644 --- a/library/src/main/java/com/mikepenz/materialdrawer/model/AbstractDrawerItem.java +++ b/library/src/main/java/com/mikepenz/materialdrawer/model/AbstractDrawerItem.java @@ -240,6 +240,9 @@ public abstract class AbstractDrawerItem<T, VH extends RecyclerView.ViewHolder> */ public T withSubItems(List<IDrawerItem> subItems) { this.mSubItems = subItems; + for (IDrawerItem subItem : subItems) { + subItem.withParent(this); + } return (T) this; } @@ -254,6 +257,9 @@ public abstract class AbstractDrawerItem<T, VH extends RecyclerView.ViewHolder> if (mSubItems == null) { mSubItems = new ArrayList<>(); } + for (IDrawerItem subItem : subItems) { + subItem.withParent(this); + } Collections.addAll(mSubItems, subItems); return (T) this; }
* ensure the parent is set to the sub items * FIX #<I> **THANKS** @hamzabinamin for reporting
mikepenz_MaterialDrawer
train
java
717efd097ddeee04fb911fd1a9798a2d129c2965
diff --git a/internal/loop/run.go b/internal/loop/run.go index <HASH>..<HASH> 100644 --- a/internal/loop/run.go +++ b/internal/loop/run.go @@ -143,7 +143,13 @@ func (c *runContext) updateCount(now int64) int { } c.lastClockFrame = f } else { - count = int(t * int64(clock.FPS) / int64(time.Second)) + if t > 5*int64(time.Second)/int64(clock.FPS) { + // The previous time is too old. Let's assume that the window was unfocused. + count = 0 + c.lastUpdated = now + } else { + count = int(t * int64(clock.FPS) / int64(time.Second)) + } } // Stabilize FPS.
loop: Bug fix: the clock needs to be stopped when the window is unfocused
hajimehoshi_ebiten
train
go
6b85255843a0297699a2159336e67b7bdcf40d8b
diff --git a/setup_utils.py b/setup_utils.py index <HASH>..<HASH> 100755 --- a/setup_utils.py +++ b/setup_utils.py @@ -293,8 +293,8 @@ class port(Command): log.info(' %s: %s' % (key, val)) # write finished portfile to file with open(self.portfile, 'w') as fport: - fport.write(self._template.render( - version=self.distribution.get_version(), **digest)) + print(self._template.render( + version=self.distribution.get_version(), **digest), file=fport) log.info('portfile written to %r' % self.portfile) @staticmethod
setup_utils.py: use `print()` to write Portfile includes trailing newline at end of file
gwpy_gwpy
train
py
51c4b13911338acb4b5f89139f5bec4521288708
diff --git a/lib/dynamic_library.js b/lib/dynamic_library.js index <HASH>..<HASH> 100644 --- a/lib/dynamic_library.js +++ b/lib/dynamic_library.js @@ -112,12 +112,8 @@ DynamicLibrary.prototype.close = function () { DynamicLibrary.prototype.get = function (symbol) { debug('dlsym()', symbol) + assert.equal('string', typeof symbol) - if (typeof symbol === 'string') { - symbol = ref.allocCString(symbol) - } - - assert(Buffer.isBuffer(symbol)) var ptr = dlsym(this._handle, symbol) assert(Buffer.isBuffer(ptr)) @@ -125,6 +121,8 @@ DynamicLibrary.prototype.get = function (symbol) { throw new Error('Dynamic Symbol Retrieval Error: ' + this.error()) } + ptr.name = symbol + return ptr }
dynamic_library: set the "name" property of the returned Buffer when get() is called
node-ffi-napi_node-ffi-napi
train
js
30be4a847fbe1b5219b5a77ddb73a6c0fffc5139
diff --git a/tools/win/generate_breakpad_symbols.py b/tools/win/generate_breakpad_symbols.py index <HASH>..<HASH> 100644 --- a/tools/win/generate_breakpad_symbols.py +++ b/tools/win/generate_breakpad_symbols.py @@ -79,7 +79,7 @@ def GenerateSymbols(options, binaries): output_path = os.path.join(options.symbols_dir, module_line.group(2), module_line.group(1)) mkdir_p(output_path) - symbol_file = "%s.sym" % module_line.group(2) + symbol_file = "%s.sym" % module_line.group(2)[:-4] # strip .pdb f = open(os.path.join(output_path, symbol_file), 'w') f.write(syms) f.close() @@ -123,7 +123,8 @@ def main(): pdbs = [] for directory in directories: - pdbs += glob.glob(os.path.join(directory, '*.pdb')) + pdbs += glob.glob(os.path.join(directory, '*.exe.pdb')) + pdbs += glob.glob(os.path.join(directory, '*.dll.pdb')) RegisterRequiredDll(); GenerateSymbols(options, pdbs)
win: Do not generate symbols for static libraries and strip .pdb in symbol name.
electron_electron
train
py
ff639108a5b841aa192202bdeee56e2e1e7185fb
diff --git a/lib/RestClient.js b/lib/RestClient.js index <HASH>..<HASH> 100644 --- a/lib/RestClient.js +++ b/lib/RestClient.js @@ -88,7 +88,7 @@ function processKeys(source) { }); //Look for and convert date strings for specific keys - ['startDate', 'endDate', 'dateCreated', 'dateUpdated', 'startTime', 'endTime'].forEach(function(dateKey) { + ['startDate', 'endDate', 'dateCreated', 'dateUpdated', 'startTime', 'endTime', 'dateSent'].forEach(function(dateKey) { if (source[dateKey]) { source[dateKey] = new Date(source[dateKey]); }
add dateSent to list of date converted strings Right now the 'dateSent' property isn't getting automatically formatted as a date. This field is returned in the `getSms` response callback. I'd like to add that this method of converting dates should be reconsidered for something more flexible. I'd propose searching *all* fields for things that look datey, or convert to a valid date when they're `Date.parse()`'d. This would add a little processing overhead, though.
twilio_twilio-node
train
js
a35552cfcf772d55fabb9b70395e409633b7f83e
diff --git a/openquake/calculators/classical.py b/openquake/calculators/classical.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/classical.py +++ b/openquake/calculators/classical.py @@ -379,7 +379,7 @@ def build_hcurves_and_stats(pgetter, hstats, monitor): The "kind" is a string of the form 'rlz-XXX' or 'mean' of 'quantile-XXX' used to specify the kind of output. """ - with monitor('combine pmaps'): + with monitor('combine pmaps'), pgetter.dstore: pmaps = pgetter.get_pmaps(pgetter.sids) if sum(len(pmap) for pmap in pmaps) == 0: # no data return {}
Opened/closed dstore Former-commit-id: fbcbaff<I>b6cbeca<I>f<I>df<I>f<I>a3be
gem_oq-engine
train
py
9d940353c1cd2b8abda0da31dba73dc14ea9c589
diff --git a/context/sync.go b/context/sync.go index <HASH>..<HASH> 100644 --- a/context/sync.go +++ b/context/sync.go @@ -350,8 +350,11 @@ func (ctx *Context) Sync() (err error) { rem = append(rem, remoteFailure{Msg: "failed to get ignore files", Path: vp.Path, Err: err}) continue } + + root, _ := pathos.TrimCommonSuffix(src, vp.Path) + // Need to ensure we copy files from "b.Root/<import-path>" for the following command. - ctx.CopyPackage(dest, src, repoRootDir, vp.Path, ignoreFiles, vp.Tree, h) + ctx.CopyPackage(dest, src, root, vp.Path, ignoreFiles, vp.Tree, h) checksum := h.Sum(nil) h.Reset() vp.ChecksumSHA1 = base64.StdEncoding.EncodeToString(checksum)
context: fix sync license copy.
kardianos_govendor
train
go
60aa163a00063c27346024c3c2d5443009c9b449
diff --git a/php/utils.php b/php/utils.php index <HASH>..<HASH> 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1100,7 +1100,9 @@ function glob_brace( $pattern, $dummy_flags = null ) { function get_suggestion( $target, array $options, $threshold = 2 ) { $suggestion_map = array( + 'add' => 'create', 'check' => 'check-update', + 'capability' => 'cap', 'clear' => 'flush', 'decrement' => 'decr', 'del' => 'delete', @@ -1116,6 +1118,7 @@ function get_suggestion( $target, array $options, $threshold = 2 ) { 'regen' => 'regenerate', 'rep' => 'replace', 'repl' => 'replace', + 'trash' => 'delete', 'v' => 'version', );
Add some more suggestions for mis-typed arguments.
wp-cli_wp-cli
train
php
31fe4def3a93dd826cc2b5df86ce33ab9e70f349
diff --git a/migrations/0-to-1.php b/migrations/0-to-1.php index <HASH>..<HASH> 100644 --- a/migrations/0-to-1.php +++ b/migrations/0-to-1.php @@ -7,10 +7,10 @@ use Wedeto\DB\Schema\Index; $table = new Table( "db_version", - new Column\TSerial('id'), - new Column\TVarchar('module', 128), - new Column\TInt('version'), - new Column\TDatetime('date_upgraded'), + new Column\Serial('id'), + new Column\Varchar('module', 128), + new Column\Integer('version'), + new Column\Datetime('date_upgraded'), new Index(Index::PRIMARY, 'id'), new Index(Index::UNIQUE, 'module', 'version') );
Rename sql directory to migrations
Wedeto_DB
train
php
91399aff0d54879ee026ef2bc17f970b3ad3938a
diff --git a/server/src/main/java/org/jboss/as/server/deployment/Phase.java b/server/src/main/java/org/jboss/as/server/deployment/Phase.java index <HASH>..<HASH> 100644 --- a/server/src/main/java/org/jboss/as/server/deployment/Phase.java +++ b/server/src/main/java/org/jboss/as/server/deployment/Phase.java @@ -284,6 +284,7 @@ public enum Phase { // Sets up appropriate module dependencies for EJB deployments public static final int DEPENDENCIES_EJB = 0x0F00; public static final int DEPENDENCIES_JPA = 0x1000; + public static final int DEPENDENCIES_GLOBAL_MODULES = 0x1100; // CONFIGURE_MODULE public static final int CONFIGURE_MODULE_SPEC = 0x0100;
Add a global modules facility to specify modules that should be added to all deployments was: 0f8b<I>dec1ab<I>a<I>a<I>f<I>a4
wildfly_wildfly-core
train
java
b6c42d01b71d7f620930180b5800077388d7fb50
diff --git a/src/rammbock/Rammbock.py b/src/rammbock/Rammbock.py index <HASH>..<HASH> 100755 --- a/src/rammbock/Rammbock.py +++ b/src/rammbock/Rammbock.py @@ -114,8 +114,16 @@ class Rammbock(object): return self._data def read_from_data(self, length): + length = int(length) message = "" - for d in range(0, int(length)): - message += str(struct.unpack('B', self._data[0])[0]) - self._data = self._data[1:] + for d in self._data[:length]: + message += str(struct.unpack('B', d)[0]) + self._data = self._data[length:] return str(int(message)) + + def read_to_binary_from_data(self, length): + self.binary += bin(self.read_from_data(length))[2:] + + def read_from_binary(self, length): + pass +
yet another refactoring to read_from_data
robotframework_Rammbock
train
py
44031b7e829b4fe16d6224513b8b8e222c12487b
diff --git a/src/main/java/water/Job.java b/src/main/java/water/Job.java index <HASH>..<HASH> 100644 --- a/src/main/java/water/Job.java +++ b/src/main/java/water/Job.java @@ -334,7 +334,7 @@ public class Job extends Request2 { public Job start(final H2OCountedCompleter fjtask) { _fjtask = fjtask; Futures fs = new Futures(); - DKV.put(job_key, new Value(job_key, new byte[0]),fs); + DKV.put(job_key,this,fs); start_time = System.currentTimeMillis(); new TAtomic<List>() { @Override public List atomic(List old) {
Get a rid of instantiation error. Job#all() expects that DKV contains a job stored under a given key but we stored Value(job_key, new byte[0]). However, this is only WIP patch since we lost track of jobs.
h2oai_h2o-2
train
java
a60c5ea1e050d8a77653da6d468dbde45e9fc668
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -91,7 +91,7 @@ setup( setup_requires=['numpy>=1.14.3', 'setuptools>=18.0'], python_requires='>=3.6', install_requires=["numpy>=1.14.3", "requests", "ruamel.yaml>=0.15.6", - "monty>=1.0.6", "scipy>=1.0.1", "pydispatcher>=2.0.5", + "monty>=2.0.6", "scipy>=1.0.1", "pydispatcher>=2.0.5", "tabulate", "spglib>=1.9.9.44", "networkx>=2.2", "matplotlib>=1.5", "palettable>=3.1.1", "sympy", "pandas"], extras_require={ @@ -168,4 +168,4 @@ setup( 'get_environment = pymatgen.cli.get_environment:main', ] } -) \ No newline at end of file +)
Upgade monty version in setup.py
materialsproject_pymatgen
train
py
cde4e1bb300d838982aeaa148306933fcde415d7
diff --git a/core/modules/requestsMonitor/requestsMonitor.js b/core/modules/requestsMonitor/requestsMonitor.js index <HASH>..<HASH> 100644 --- a/core/modules/requestsMonitor/requestsMonitor.js +++ b/core/modules/requestsMonitor/requestsMonitor.js @@ -237,11 +237,15 @@ exports.module = function(phantomas) { }); // TTFB / TTLB metrics + var ttfbMeasured = false; + phantomas.on('recv', function(entry, res) { - // check the first request - if (entry.id === 1) { + // check the first response which is not a redirect (issue #74) + if (!ttfbMeasured && !entry.isRedirect) { phantomas.setMetric('timeToFirstByte', entry.timeToFirstByte); phantomas.setMetric('timeToLastByte', entry.timeToLastByte); + + ttfbMeasured = true; } // completion of the last HTTP request
Fix TimeToFirstByte with redirects Record time to first byte for the first response which is not a redirect
macbre_phantomas
train
js
065be937f27c25bc7d23e0dd35ad4aa84818b167
diff --git a/activesupport/lib/active_support/core_ext/string/output_safety.rb b/activesupport/lib/active_support/core_ext/string/output_safety.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/core_ext/string/output_safety.rb +++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb @@ -15,9 +15,6 @@ class ERB # A utility method for escaping HTML tag characters. # This method is also aliased as <tt>h</tt>. # - # In your ERB templates, use this method to escape any unsafe content. For example: - # <%= h @person.name %> - # # puts html_escape('is a > 0 & a < 10?') # # => is a &gt; 0 &amp; a &lt; 10? def html_escape(s)
Remove obsolete documentation [ci skip] Instructions to use `h` or `html_escape` in ERB templates were added to `actionpack/lib/action_view/template_handlers/erb.rb` in a1b<I> (Rails <I>), but ERB has automatically escaped values since Rails 3.
rails_rails
train
rb
7989a080afa7d14c32f27fc087f0a65a7d620db2
diff --git a/codec.go b/codec.go index <HASH>..<HASH> 100644 --- a/codec.go +++ b/codec.go @@ -11,7 +11,7 @@ func stringToBytes(s string) ([]byte, error) { // consume trailing slashes s = strings.TrimRight(s, "/") - b := new(bytes.Buffer) + var b bytes.Buffer sp := strings.Split(s, "/") if sp[0] != "" {
don't put the buffer struct on the heap This showed up when profile go-ipfs.
multiformats_go-multiaddr
train
go
0eee4fb1e802f914faa74e51e31dfcd54ab1be18
diff --git a/spec/ospec/runner.rb b/spec/ospec/runner.rb index <HASH>..<HASH> 100644 --- a/spec/ospec/runner.rb +++ b/spec/ospec/runner.rb @@ -7,6 +7,21 @@ module MSpec end end +# Add keys to pending array as names of specs not to run. +class OSpecFilter + def initialize + @pending = {} + end + + def register + MSpec.register :exclude, self + end + + def ===(string) + @pending.has_key? string + end +end + class OSpecRunner def self.main @main ||= self.new @@ -20,6 +35,9 @@ class OSpecRunner def register formatter = PhantomFormatter.new formatter.register + + filter = OSpecFilter.new + filter.register end def run
Add OSpecFilter to filter non-compliant specs from running in mspec
opal_opal
train
rb
05f1ee95d915972dbed1a08bf8b7aebbe9694620
diff --git a/test/unit/rules/no-empty-headings-test.js b/test/unit/rules/no-empty-headings-test.js index <HASH>..<HASH> 100644 --- a/test/unit/rules/no-empty-headings-test.js +++ b/test/unit/rules/no-empty-headings-test.js @@ -26,10 +26,10 @@ generateRuleTests({ '<p></p>', '<span></span>', '<header></header>', - '<h2>{{component value="Hej"}}</h2>', - '<h2><span>{{component value="Hej"}}</span></h2>', - '<h2><div><span>{{component value="Hej"}}</span></div></h2>', - '<h2><span>Some text{{component value="Hej"}}</span></h2>', + '<h2>{{@title}}</h2>', + '<h2><span>{{@title}}</span></h2>', + '<h2><div><span>{{@title}}</span></div></h2>', + '<h2><span>Some text{{@title}}</span></h2>', ], bad: [
use @args in curly tests
ember-template-lint_ember-template-lint
train
js
f502ed6e943f1b5500ff9f76370867fca7ea0f91
diff --git a/lib/tilelive.js b/lib/tilelive.js index <HASH>..<HASH> 100644 --- a/lib/tilelive.js +++ b/lib/tilelive.js @@ -253,7 +253,7 @@ tilelive.copy = function(args, callback) { // Precalculate the tile int bounds for each zoom level. var bounds = {}; for (var z = args.minZoom; z <= args.maxZoom; z++) { - bounds[z] = sm.xyz(args.bbox, z, true); + bounds[z] = sm.xyz(args.bbox, z); action.total += (bounds[z].maxX - bounds[z].minX + 1) * (bounds[z].maxY - bounds[z].minY + 1); }
don't to tms style coordinates
mapbox_tilelive
train
js
7d058b56937cd03fc112406d35474d9579bdec17
diff --git a/lib/graphql/models/loader.rb b/lib/graphql/models/loader.rb index <HASH>..<HASH> 100644 --- a/lib/graphql/models/loader.rb +++ b/lib/graphql/models/loader.rb @@ -46,7 +46,15 @@ module GraphQL arel = relation.arel next nil unless arel.orders.any? - %{ RANK() OVER (ORDER BY #{arel.orders.map(&:to_sql).join(', ')}) AS "sort_relation_#{index}" } + order_by = arel.orders.map do |expr| + if expr.is_a?(Arel::Nodes::SqlLiteral) + expr.to_s + else + expr.to_sql + end + end + + %{ RANK() OVER (ORDER BY #{order_by.join(', ')}) AS "sort_relation_#{index}" } end sorting_columns.compact!
Fixing bug with order_by expressions
goco-inc_graphql-activerecord
train
rb
a0c0d70cee3801f5a4498628582291224acc204a
diff --git a/Listener/Resource/FileListener.php b/Listener/Resource/FileListener.php index <HASH>..<HASH> 100644 --- a/Listener/Resource/FileListener.php +++ b/Listener/Resource/FileListener.php @@ -407,7 +407,7 @@ class FileListener implements ContainerAwareInterface private function uploadFile(\DirectoryIterator $file, ResourceNode $parent, array $perms) { $entityFile = new File(); - $fileName = $file->getFilename(); + $fileName = utf8_encode($file->getFilename()); $size = @filesize($file); $extension = pathinfo($fileName, PATHINFO_EXTENSION); $mimeType = $this->container->get('claroline.utilities.mime_type_guesser')->guess($extension);
Fixing unzipping error on special chars.
claroline_CoreBundle
train
php
a53315a0d3fd1d6134ccb4eb1b56371fa2a9e8d8
diff --git a/lib/formtastic.rb b/lib/formtastic.rb index <HASH>..<HASH> 100644 --- a/lib/formtastic.rb +++ b/lib/formtastic.rb @@ -1491,7 +1491,7 @@ module Formtastic #:nodoc: reflection.klass.where(conditions).where(options[:find_options][:conditions]) end else - reflection.klass.all + reflection.klass.all(options[:find_options]) end else create_boolean_collection(options)
Respect :find_options even when no conditions have been set
justinfrench_formtastic
train
rb
f396f6296c82ed05c95a4c353ebd0eb05dd306e2
diff --git a/plugins/src/kg/apc/jmeter/vizualizers/ResponseTimesPercentilesGui.java b/plugins/src/kg/apc/jmeter/vizualizers/ResponseTimesPercentilesGui.java index <HASH>..<HASH> 100644 --- a/plugins/src/kg/apc/jmeter/vizualizers/ResponseTimesPercentilesGui.java +++ b/plugins/src/kg/apc/jmeter/vizualizers/ResponseTimesPercentilesGui.java @@ -64,7 +64,9 @@ public class ResponseTimesPercentilesGui return new JSettingsPanel(this, JSettingsPanel.GRADIENT_OPTION | JSettingsPanel.MAXY_OPTION - | JSettingsPanel.AGGREGATE_OPTION); + | JSettingsPanel.AGGREGATE_OPTION + | JSettingsPanel.LIMIT_POINT_OPTION + | JSettingsPanel.MARKERS_OPTION_DISABLED); } @Override
Add limit nb of point and line option to percentile
undera_jmeter-plugins
train
java
d256711c53e16a720ce58712581697093c3126d7
diff --git a/selectron.js b/selectron.js index <HASH>..<HASH> 100644 --- a/selectron.js +++ b/selectron.js @@ -105,8 +105,8 @@ function count(root, ref, countAll) { */ function offset(element, caret, countAll) { var rng = s().getRangeAt(0), - ref = rng[(caret || 'start') + 'Container'], - off = rng[(caret || 'start') + 'Offset']; + ref = rng[(caret || 'end') + 'Container'], + off = rng[(caret || 'end') + 'Offset']; element = element || $(ref).closest(sectionTags.join(','))[0];
Use endContainer and offset as default in offset()... because of IE.
lohfu_spytext
train
js
61c70b442bbd08858ce2435cf410f31a7ec91d37
diff --git a/packages/www/webpack.client.config.base.js b/packages/www/webpack.client.config.base.js index <HASH>..<HASH> 100644 --- a/packages/www/webpack.client.config.base.js +++ b/packages/www/webpack.client.config.base.js @@ -58,7 +58,8 @@ const views = [ ["photos", `${config.get("www.publishUrl")}${config.get("www.photosUrl")}`], ["words", `${config.get("www.publishUrl")}${config.get("www.wordsUrl")}`], ["resume", `${config.get("www.publishUrl")}${config.get("www.resumeUrl")}`], - ["letter", `${config.get("www.publishUrl")}${config.get("www.letterUrl")}`] + ["letter", `${config.get("www.publishUrl")}${config.get("www.letterUrl")}`], + ["map", `${config.get("www.publishUrl")}${config.get("www.mapUrl")}`] ]; module.exports = ({plugins, ...overrides}) => webpackBaseConfig({
fix(www): Generate a `map.html` file so we don't give crawlers <I>s. SEO~~
randytarampi_me
train
js
93bbed5e1331395f54c7602784b30d4a22e95e37
diff --git a/nose/test_potential.py b/nose/test_potential.py index <HASH>..<HASH> 100644 --- a/nose/test_potential.py +++ b/nose/test_potential.py @@ -958,7 +958,7 @@ def test_vcirc_vesc_special(): dp= potential.DehnenBarPotential() try: potential.plotRotcurve([dp]) - except AttributeError: #should be raised + except (AttributeError,potential.PotentialError): #should be raised pass else: raise AssertionError("plotRotcurve for non-axisymmetric potential should have raised AttributeError, but didn't")
Fail of vcirc for non-axi potentials can now also be a PotentialError
jobovy_galpy
train
py
12d5df3c669b929f945a00ec1b5f5b99b54988c3
diff --git a/src/FlexiblePool.php b/src/FlexiblePool.php index <HASH>..<HASH> 100644 --- a/src/FlexiblePool.php +++ b/src/FlexiblePool.php @@ -115,7 +115,6 @@ class FlexiblePool extends EventEmitter implements PoolInterface } if ( - $this->callQueue->count() > 0 && $this->readyPool->count() == 0 && ( $this->startingProcesses + $this->pool->count()
The count of jobs in the queue is irrelevant for calling rpc means it's plus one anyway
WyriHaximus_reactphp-child-process-pool
train
php