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
67e9e0e11bb932ef9113ac91b2c1b0af6ee4db6d
diff --git a/integration/commands_test.go b/integration/commands_test.go index <HASH>..<HASH> 100644 --- a/integration/commands_test.go +++ b/integration/commands_test.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/dotcloud/docker" "github.com/dotcloud/docker/engine" + "github.com/dotcloud/docker/term" "github.com/dotcloud/docker/utils" "io" "io/ioutil" @@ -507,6 +508,17 @@ func TestAttachDetach(t *testing.T) { <-ch }) + pty, err := container.GetPtyMaster() + if err != nil { + t.Fatal(err) + } + + state, err := term.MakeRaw(pty.Fd()) + if err != nil { + t.Fatal(err) + } + defer term.RestoreTerminal(pty.Fd(), state) + stdin, stdinPipe = io.Pipe() stdout, stdoutPipe = io.Pipe() cli = docker.NewDockerCli(stdin, stdoutPipe, ioutil.Discard, testDaemonProto, testDaemonAddr)
Make the PTY in raw mode before assert test (TestAttachDetach)
moby_moby
train
go
87bc8d8e3f8188062d127d55bca46c4bca4ba614
diff --git a/printer.go b/printer.go index <HASH>..<HASH> 100644 --- a/printer.go +++ b/printer.go @@ -19,6 +19,8 @@ var ( // If the length of array or slice is larger than this, // the buffer will be shorten as {...}. BufferFoldThreshold = 1024 + // PrintMapTypes when set to true will have map types will always appended to maps. + PrintMapTypes = true ) func format(object interface{}) string { @@ -155,7 +157,11 @@ func (p *printer) printMap() { } p.visited[p.value.Pointer()] = true - p.printf("%s{", p.typeString()) + if PrintMapTypes { + p.printf("%s{", p.typeString()) + } else { + p.println("{") + } p.indented(func() { keys := p.value.MapKeys() for i := 0; i < p.value.Len(); i++ {
Use a variable to decide whether or not maps types are printed.
k0kubun_pp
train
go
c5394ecbd6a65e870abdd3c1978650d6999ab616
diff --git a/src/sap.ui.commons/src/sap/ui/commons/Callout.js b/src/sap.ui.commons/src/sap/ui/commons/Callout.js index <HASH>..<HASH> 100644 --- a/src/sap.ui.commons/src/sap/ui/commons/Callout.js +++ b/src/sap.ui.commons/src/sap/ui/commons/Callout.js @@ -24,7 +24,7 @@ sap.ui.define(['./CalloutBase', './library', './CalloutRenderer'], * * @constructor * @public - * @deprecated Since version 1.38. Tf you want to achieve a similar behavior, use a <code>sap.m.Popover</code> control and open it next to your control. + * @deprecated Since version 1.38. If you want to achieve a similar behavior, use a <code>sap.m.Popover</code> control and open it next to your control. * @alias sap.ui.commons.Callout * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel */
[INTERNAL] sap.ui.commons.Callout: Documentation updated - There was a typo in the documentation. JIRA: BGSOFUIRILA-<I> Change-Id: Ib0fd1aca<I>a5c<I>d<I>c<I>e<I>dd<I>f<I>
SAP_openui5
train
js
5104f2cc1b5decafc56b2e542903d31758478868
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -152,7 +152,10 @@ module.exports = function (grunt) { dest: './axe.min.js' }], options: { - preserveComments: 'some', + preserveComments: function(node, comment) { + // preserve comments that start with a bang + return /^!/.test( comment.value ); + }, mangle: { except: ['commons', 'utils', 'axe', 'window', 'document'] }
Fix preserveComments in uglify which was not removing any comments
dequelabs_axe-core
train
js
06c38a384f8e0d48d9ec84d507e2a3f7fe2295d5
diff --git a/e2e/init.js b/e2e/init.js index <HASH>..<HASH> 100644 --- a/e2e/init.js +++ b/e2e/init.js @@ -11,9 +11,11 @@ after(async () => { await detox.cleanup(); }); -// Temporary solution, #2809 function disableAndroidEmulatorAnimations() { - exec.execAsync(`adb shell settings put global window_animation_scale 0.0`); - exec.execAsync(`adb shell settings put global transition_animation_scale 0.0`); - exec.execAsync(`adb shell settings put global animator_duration_scale 0.0`); + if (device.getPlatform() === 'android') { + const deviceId = device._deviceId; + exec.execAsync(`adb -s ${deviceId} shell settings put global window_animation_scale 0.0`); + exec.execAsync(`adb -s ${deviceId} shell settings put global transition_animation_scale 0.0`); + exec.execAsync(`adb -s ${deviceId} shell settings put global animator_duration_scale 0.0`); + } }
send adb command only to device under tests
wix_react-native-navigation
train
js
3fb17d23f91c277f222d9c1d13f4fafbc95180d9
diff --git a/pycpfcnpj/cpfcnpj.py b/pycpfcnpj/cpfcnpj.py index <HASH>..<HASH> 100644 --- a/pycpfcnpj/cpfcnpj.py +++ b/pycpfcnpj/cpfcnpj.py @@ -1,5 +1,4 @@ -import string - +from .compatible import clear_punctuation from . import cpf from . import cnpj @@ -17,7 +16,7 @@ def validate(number): with the right size of these numbers. """ - clean_number = number.translate(str.maketrans("", "", string.punctuation)) + clean_number = clear_punctuation(number) if len(clean_number) == 11: return cpf.validate(clean_number)
Use clean_number function in cpfcnpj
matheuscas_pycpfcnpj
train
py
0f38bc71eb87b2a3df4146fe615a9ac28a0408b5
diff --git a/blueprints/ember-frost-tabs/index.js b/blueprints/ember-frost-tabs/index.js index <HASH>..<HASH> 100644 --- a/blueprints/ember-frost-tabs/index.js +++ b/blueprints/ember-frost-tabs/index.js @@ -11,7 +11,8 @@ module.exports = { afterInstall: function () { return this.addAddonsToProject({ packages: [ - {name: 'ember-frost-core', target: '^0.29.0'} + {name: 'ember-frost-core', target: '^0.29.0'}, + {name: 'ember-simple-uuid', target: '0.1.4'} ] }) }
Add ember-simple-uuid to blueprint
ciena-frost_ember-frost-tabs
train
js
1569775b18ff72aa4ac380b3ec382d28077f9592
diff --git a/cmd/bbs/main.go b/cmd/bbs/main.go index <HASH>..<HASH> 100644 --- a/cmd/bbs/main.go +++ b/cmd/bbs/main.go @@ -160,6 +160,12 @@ var databaseConnectionString = flag.String( "SQL database connection string", ) +var maxDatabaseConnections = flag.Int( + "maxDatabaseConnections", + 200, + "Max numbers of SQL database connections", +) + var databaseDriver = flag.String( "databaseDriver", "mysql", @@ -238,6 +244,7 @@ func main() { if err != nil { logger.Fatal("failed-to-open-sql", err) } + sqlConn.SetMaxOpenConns(*maxDatabaseConnections) err = sqlConn.Ping() if err != nil {
Allow BBS to be configured a max number of SQL connections [#<I>]
cloudfoundry_bbs
train
go
34874b3bcdb42a710baecf8c6acfa3a30333d01a
diff --git a/railties/configs/routes.rb b/railties/configs/routes.rb index <HASH>..<HASH> 100644 --- a/railties/configs/routes.rb +++ b/railties/configs/routes.rb @@ -37,7 +37,7 @@ ActionController::Routing::Routes.draw do |map| # Install the default routes as the lowest priority. # Note: These default routes make all actions in every controller accessible via GET requests. You should - # consider removing the them or commenting them out if you're using named routes and resources. + # consider removing or commenting them out if you're using named routes and resources. map.connect ':controller/:action/:id' map.connect ':controller/:action/:id.:format' end
Fix typo in the generated routes.rb [#<I> state:resolved]
rails_rails
train
rb
67c38e741d6ab752ca5c7bd7763196709e4db9a1
diff --git a/lib/middleware/vhost.js b/lib/middleware/vhost.js index <HASH>..<HASH> 100644 --- a/lib/middleware/vhost.js +++ b/lib/middleware/vhost.js @@ -17,9 +17,9 @@ module.exports = () => if (bucket) { ctx.path = `/${bucket}${ctx.path}`; } - } else if (ctx.hostname !== "localhost" && !net.isIP(ctx.hostname)) { + } else if (!net.isIP(ctx.hostname) && ctx.hostname !== "localhost") { // otherwise attempt to distinguish virtual host-style requests - ctx.path = `/${bucket}${ctx.path}`; + ctx.path = `/${ctx.hostname}${ctx.path}`; } return next();
fix(vhost): actually support specifying buckets via hostname
jamhall_s3rver
train
js
cf2cd18db366da983012c7bf20a6509bd63ddeee
diff --git a/js/jqPagination.jquery.js b/js/jqPagination.jquery.js index <HASH>..<HASH> 100644 --- a/js/jqPagination.jquery.js +++ b/js/jqPagination.jquery.js @@ -65,8 +65,13 @@ http://dribbble.com/shots/59234-Pagination-for-upcoming-blog- }); base.$el.find('a').live('click', function (event) { - event.preventDefault(); - base.setPage($(this).data('action')); + + // for mac + windows (read: other), maintain the cmd + ctrl click for new tab + if (!event.metaKey && !event.ctrlKey) { + event.preventDefault(); + base.setPage($(this).data('action')); + } + }); };
Allow cmd/ctrl click on paging links to open new tab/window
beneverard_jqPagination
train
js
ad71969dda5fe3c03b063933a6c1c51d59aca7bd
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -229,6 +229,7 @@ extension_phono3py = Extension( packages_phono3py = ['phono3py', 'phono3py.cui', + 'phono3py.interface', 'phono3py.other', 'phono3py.phonon', 'phono3py.phonon3']
Fix setup.py to add phono3py.interface as module.
atztogo_phono3py
train
py
6ebd28e6662e34228c7e00c19ee484c3455d688c
diff --git a/src/Field.php b/src/Field.php index <HASH>..<HASH> 100644 --- a/src/Field.php +++ b/src/Field.php @@ -484,9 +484,9 @@ class Field implements Expressionable */ public function isEditable() { - return isset($this->ui['editable'])? $this->ui['editable'] - :($this->read_only || $this->never_persist) ? false - : !$this->system; + return isset($this->ui['editable']) ? $this->ui['editable'] + : ($this->read_only || $this->never_persist) ? false + : !$this->system; } /**
Apply fixes from StyleCI (#<I>)
atk4_data
train
php
ab1bc9c4ba1cb82c1bc44cf986a5066d8d49931e
diff --git a/Tests/Unit/Client/ConnectionTest.php b/Tests/Unit/Client/ConnectionTest.php index <HASH>..<HASH> 100644 --- a/Tests/Unit/Client/ConnectionTest.php +++ b/Tests/Unit/Client/ConnectionTest.php @@ -328,6 +328,32 @@ class ConnectionTest extends \PHPUnit_Framework_TestCase } /** + * Tests if exception is thrown while validating warmers. + * + * @expectedException \RuntimeException + * @expectedExceptionMessage Warmer(s) named bar do not exist. Available: foo + */ + public function testValidateWarmersException() + { + $warmerMock = $this->getMock('ONGR\ElasticsearchBundle\Cache\WarmerInterface'); + $warmerMock + ->expects($this->once()) + ->method('warmUp'); + $warmerMock + ->expects($this->once()) + ->method('getName') + ->will($this->returnValue('foo')); + + $connection = new Connection($this->getClient(), []); + $connection->addWarmer($warmerMock); + + $object = new \ReflectionObject($connection); + $method = $object->getMethod('validateWarmers'); + $method->setAccessible(true); + $method->invokeArgs($connection, [['bar']]); + } + + /** * Tests Connection#setIndexName method. */ public function testSetIndexName()
added Connection#validateWarmers test when exception is thrown
ongr-io_ElasticsearchBundle
train
php
930563d1de0589250977fa27e4dc359e0d6d01d2
diff --git a/src/main/java/com/github/noraui/application/steps/ScreenSteps.java b/src/main/java/com/github/noraui/application/steps/ScreenSteps.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/noraui/application/steps/ScreenSteps.java +++ b/src/main/java/com/github/noraui/application/steps/ScreenSteps.java @@ -142,7 +142,7 @@ public class ScreenSteps extends Step { @Conditioned @Et("Je défile vers {string}(\\?)") @And("I scroll to {string}(\\?)") - public void scrollIntoView(PageElement pageElement, List<GherkinStepCondition> conditions) throws TechnicalException { + public void scrollIntoView(PageElement pageElement, List<GherkinStepCondition> conditions) { log.debug("I scroll to [{}]", pageElement); screenService.scrollIntoView(Wait.until(ExpectedConditions.presenceOfElementLocated(Utilities.getLocator(pageElement)))); }
Sonar: "throws" declarations should not be superfluous
NoraUi_NoraUi
train
java
058f6ec71206f9bcf3e326d7b86be17c04b6fb21
diff --git a/web/concrete/js/build/core/style-customizer/inline-toolbar.js b/web/concrete/js/build/core/style-customizer/inline-toolbar.js index <HASH>..<HASH> 100644 --- a/web/concrete/js/build/core/style-customizer/inline-toolbar.js +++ b/web/concrete/js/build/core/style-customizer/inline-toolbar.js @@ -114,9 +114,6 @@ arEnableGridContainer = area.getEnableGridContainer() ? 1 : 0, action = CCM_DISPATCHER_FILENAME + '/ccm/system/block/render'; - if (block.getId() != parseInt(resp.bID)) { - block.id = parseInt(resp.bID); - } $.get(action, { arHandle: area.getHandle(), cID: resp.cID,
Remove unneeded assignment Former-commit-id: 1c<I>f<I>bb<I>b<I>c<I>a<I>c<I>c<I>e
concrete5_concrete5
train
js
e7d8197fe1a92698148762a94032e955cf98f5d0
diff --git a/src/MarkupTranslator/Translators/Github.php b/src/MarkupTranslator/Translators/Github.php index <HASH>..<HASH> 100644 --- a/src/MarkupTranslator/Translators/Github.php +++ b/src/MarkupTranslator/Translators/Github.php @@ -199,7 +199,7 @@ class Github extends Base } protected function addHorizontalRule() { - $this->startElement('hr'); + $this->startElement(self::NODE_HR); return $this->endElement(); } }
used class constant instead of hardcoded string
hackathoners_markup-translator
train
php
93341c05067f98a1750af89b265f0ebf20dbe1aa
diff --git a/FeatureContext.php b/FeatureContext.php index <HASH>..<HASH> 100644 --- a/FeatureContext.php +++ b/FeatureContext.php @@ -12,13 +12,6 @@ use Symfony\Component\Process\Process; require 'vendor/autoload.php'; -// -// Require 3rd-party libraries here: -// -// require_once 'PHPUnit/Autoload.php'; -// require_once 'PHPUnit/Framework/Assert/Functions.php'; -// - /** * Features context. */
Removing placeholder comment to require libraries that aren't currently being used.
jhedstrom_DrupalDriver
train
php
43781d4eafb9ada2d69aff9e58daa38a35c26397
diff --git a/clients/web/test/spec/groupSpec.js b/clients/web/test/spec/groupSpec.js index <HASH>..<HASH> 100644 --- a/clients/web/test/spec/groupSpec.js +++ b/clients/web/test/spec/groupSpec.js @@ -48,6 +48,14 @@ describe('Test group actions', function () { waitsFor(function () { return Backbone.history.fragment.slice(-18) === '/roles?dialog=edit'; }, 'the url state to change'); + + waitsFor(function () { + return $('a.btn-default').text() === 'Cancel'; + }, 'the cancel button to appear'); + + runs(function () { + $('a.btn-default').click(); + }); }); it('go back to groups page', girderTest.goToGroupsPage());
Closing the group edit dialog in the test.
girder_girder
train
js
08e317665496eadabdaafc6fa705d00abd57c994
diff --git a/taxonomy/scripts/taxomatic.py b/taxonomy/scripts/taxomatic.py index <HASH>..<HASH> 100644 --- a/taxonomy/scripts/taxomatic.py +++ b/taxonomy/scripts/taxomatic.py @@ -60,6 +60,8 @@ log = logging import Taxonomy from Taxonomy.package import manifest_name, package_contents, write_config +from Taxonomy import __version__ + class SimpleHelpFormatter(IndentedHelpFormatter): """Format help with indented section bodies. @@ -118,7 +120,7 @@ def main(): sys.exit(1) parser = OptionParser(usage='', - version="$Id$", + version=__version__, formatter=SimpleHelpFormatter()) parser.set_defaults(
brought __version__ into taxonomy.py, so --version flag will work. --version still requires a subcommand such as create, which will get fixed in a later commit.
fhcrc_taxtastic
train
py
720f4b2ff4604812976801354d28636f9436f94c
diff --git a/pycbc/ahope/coincidence_utils.py b/pycbc/ahope/coincidence_utils.py index <HASH>..<HASH> 100644 --- a/pycbc/ahope/coincidence_utils.py +++ b/pycbc/ahope/coincidence_utils.py @@ -162,7 +162,10 @@ def setup_coincidence_workflow_ligolw_thinca(workflow, science_segs, segsDict, ligolwAddOuts : ahope.AhopeFileList A list of the output files generated from ligolw_add. """ + # FIXME: Order of ifoList is not necessarily H1L1V1 + # FIXME: eg. full analysis segment of 968976015-969062415 gives "V1H1L1" ifoList = science_segs.keys() + ifoList.sort(key=str.lower) ifoString = ''.join(ifoList) veto_categories = range(1,maxVetoCat+1)
Added a FIXME to coincidence_utils.py in ahope. The ifoString was not necessarily ordered "H1L1V1" (eg. got "V1H1L1"). The FIXME sorts ifos alphabetically and then creates the ifoString.
gwastro_pycbc
train
py
37733bc1f57dcf1be9b66f9b90ab1cf3bfe580bb
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -1,8 +1,11 @@ import createReducer from './createReducer' -import { createAction, createReducerAction} from './createAction' +import { + createAction + // createReducerAction +} from './createAction' export { createReducer, - createAction, - createReducerAction + createAction + // createReducerAction } diff --git a/test/createReducerAction.js b/test/createReducerAction.js index <HASH>..<HASH> 100644 --- a/test/createReducerAction.js +++ b/test/createReducerAction.js @@ -1,4 +1,5 @@ -import { createReducer, createReducerAction } from '../src' +import { createReducer } from '../src' +import { createReducerAction } from '../src/createAction' import assert from 'assert' const emulateState = (initialState, action) => {
chore: hide undocumented function
terrierscript_redux-candy
train
js,js
d587ebc5d21ceda94162543d3c2c6966a11af86c
diff --git a/scrubadub/detectors/spacy.py b/scrubadub/detectors/spacy.py index <HASH>..<HASH> 100644 --- a/scrubadub/detectors/spacy.py +++ b/scrubadub/detectors/spacy.py @@ -32,12 +32,12 @@ class SpacyEntityDetector(Detector): >>> import scrubadub, scrubadub.detectors.spacy >>> class MoneyFilth(scrubadub.filth.Filth): - >>> type = 'money' + ... type = 'money' >>> scrubadub.detectors.spacy.SpacyEntityDetector.filth_cls_map['MONEY'] = MoneyFilth >>> detector = scrubadub.detectors.spacy.SpacyEntityDetector(named_entities=['MONEY']) >>> scrubber = scrubadub.Scrubber(detector_list=[detector]) >>> scrubber.clean("You owe me 12 dollars man!") - "You owe me {{MONEY}} man!" + 'You owe me {{MONEY}} man!' The dictonary ``scrubadub.detectors.spacy.SpacyEntityDetector.filth_cls_map`` is used to map between the spaCy named entity label and the type of scrubadub ``Filth``, while the ``named_entities`` argument sets which named
fix doc test so that it passes
datascopeanalytics_scrubadub
train
py
20d9dc4920d9fe61fa4b0211e6ebd949932b8bd5
diff --git a/yotta/lib/target.py b/yotta/lib/target.py index <HASH>..<HASH> 100644 --- a/yotta/lib/target.py +++ b/yotta/lib/target.py @@ -65,6 +65,8 @@ class Target(pack.Pack): build_type = ((None, 'Debug'), ('Release', 'RelWithDebInfo'))[release_build][debug_build] if build_type: commands.append(['cmake', '-D', 'CMAKE_BUILD_TYPE=%s' % build_type, '.']) + else: + commands.append(['cmake', '.']) commands.append(['make']) for cmd in commands: child = subprocess.Popen(
fix building when no build type is set
ARMmbed_yotta
train
py
0aadc786c0b8cf4afd1c731508690b594b711cdf
diff --git a/lib/active_record/connection_adapters/h2_adapter.rb b/lib/active_record/connection_adapters/h2_adapter.rb index <HASH>..<HASH> 100644 --- a/lib/active_record/connection_adapters/h2_adapter.rb +++ b/lib/active_record/connection_adapters/h2_adapter.rb @@ -1 +1,13 @@ -require 'active_record/connection_adapters/jdbc_adapter' \ No newline at end of file +tried_gem = false +begin + require "jdbc/h2" +rescue LoadError + unless tried_gem + require 'rubygems' + gem "jdbc-h2" + tried_gem = true + retry + end + # trust that the hsqldb jar is already present +end +require 'active_record/connection_adapters/jdbc_adapter'
Needed this to get h2 to load properly form simple script (w/o gem installed)
jruby_activerecord-jdbc-adapter
train
rb
abca69ca3f254ecadf9121cabf71b9f7a8f7ecd5
diff --git a/smartmin/users/views.py b/smartmin/users/views.py index <HASH>..<HASH> 100644 --- a/smartmin/users/views.py +++ b/smartmin/users/views.py @@ -234,8 +234,14 @@ class UserCRUDL(SmartCRUDL): def form_valid(self, form): email = form.cleaned_data['email'] - hostname = getattr(settings, 'HOSTNAME', 'hostname') - from_email = getattr(settings, 'DEFAULT_FROM_EMAIL', 'user@hostname') + hostname = getattr(settings, 'HOSTNAME', self.request.get_host()) + + col_index = hostname.find(':') + if col_index > 0: + domain = hostname[:col_index] + + from_email = getattr(settings, 'DEFAULT_FROM_EMAIL', 'website@%s' % domain) + protocol = 'https' if self.request.is_secure() else 'http' user = User.objects.filter(email=email)
better defaults for hostname for password resets
nyaruka_smartmin
train
py
3d1bca890fcb83537725307342501a5577366294
diff --git a/pylint_plugin_utils/__init__.py b/pylint_plugin_utils/__init__.py index <HASH>..<HASH> 100644 --- a/pylint_plugin_utils/__init__.py +++ b/pylint_plugin_utils/__init__.py @@ -1,8 +1,8 @@ import sys try: - from pylint.utils import UnknownMessage + from pylint.exceptions import UnknownMessageError as UnknownMessage except ImportError: - from pylint.utils import UnknownMessageError as UnknownMessage + from pylint.exceptions import UnknownMessage def get_class(module_name, kls):
Import exception from pylint.exceptions instead of utils Also tries to use the newer name (already over three years old) first. Fixes PyCQA/pylint-plugin-utils#<I>
PyCQA_pylint-plugin-utils
train
py
1d9a3a0ee9975923f75a78c8c472bd55cbfe8c62
diff --git a/spec/schema_dumper_spec.rb b/spec/schema_dumper_spec.rb index <HASH>..<HASH> 100644 --- a/spec/schema_dumper_spec.rb +++ b/spec/schema_dumper_spec.rb @@ -46,7 +46,7 @@ describe "schema dumping" do end end - context "without schema.rb" do + context "with schema.rb" do before do ActiveRecord::SchemaDumper.previous_schema = dump_schema end
spec: fix typo in group description
jenseng_hair_trigger
train
rb
bf98894d7554c4647d7eaf210f1cbfb70fcfeee8
diff --git a/app/controllers/wafflemix/contact_forms_controller.rb b/app/controllers/wafflemix/contact_forms_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/wafflemix/contact_forms_controller.rb +++ b/app/controllers/wafflemix/contact_forms_controller.rb @@ -3,22 +3,22 @@ require_dependency "wafflemix/application_controller" module Wafflemix class ContactFormsController < ApplicationController + before_filter :find_page + def show @contact_form = ContactForm.find(params[:id]) - @page = Page.find_by_link_url('contact-us') respond_to do |format| - format.html # show.html.erb + format.html format.json { render json: @contact_form } end end def new @contact_form = ContactForm.new - @page = Page.find_by_link_url('contact-us') respond_to do |format| - format.html # new.html.erb + format.html format.json { render json: @contact_form } end end @@ -37,5 +37,11 @@ module Wafflemix end end + private + + def find_page + @page = Page.find_by_link_url('contact-us') + end + end end
Give create access to the contact page for validations.
jrissler_wafflemix
train
rb
dc0542f8099067476370949b39e726ec4e4ae4fc
diff --git a/actionpack/lib/action_dispatch/journey/router.rb b/actionpack/lib/action_dispatch/journey/router.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/journey/router.rb +++ b/actionpack/lib/action_dispatch/journey/router.rb @@ -1,4 +1,3 @@ -require 'action_dispatch/journey/core-ext/hash' require 'action_dispatch/journey/router/utils' require 'action_dispatch/journey/router/strexp' require 'action_dispatch/journey/routes'
Remove obsolete Hash extension needed for Ruby <I>.x support [ci skip]
rails_rails
train
rb
0290fd793f5e71ce7550d2264f5e1616f3661013
diff --git a/Net/OpenID/DiffieHellman.php b/Net/OpenID/DiffieHellman.php index <HASH>..<HASH> 100644 --- a/Net/OpenID/DiffieHellman.php +++ b/Net/OpenID/DiffieHellman.php @@ -56,13 +56,6 @@ class Net_OpenID_DiffieHellman { E_USER_ERROR); } - if ($this->lib->type == 'dumb') { - trigger_error("No usable big integer library present ". - "(gmp or bcmath). Use of this math library wrapper". - "is not permitted without big integer support.", - E_USER_ERROR); - } - if ($mod === null) { $this->mod = $this->lib->init($_Net_OpenID_DEFAULT_MOD); } else {
[project @ Do not check for dumb math library in DiffieHellman module, since that's never instantiated now.]
openid_php-openid
train
php
a3e4dcaefcae261788bebba32059f8a78cf5ee7b
diff --git a/test/attributes/attributeforinstanceof.js b/test/attributes/attributeforinstanceof.js index <HASH>..<HASH> 100644 --- a/test/attributes/attributeforinstanceof.js +++ b/test/attributes/attributeforinstanceof.js @@ -19,7 +19,7 @@ describe("attributes/attributeforinstanceof", function () { var exceptionCaught; try { var attribute = new gpf.attributes.AttributeForInstanceOf(); - assert(attribute); + throw new Error(attribute.toString()); } catch (e) { exceptionCaught = e; } @@ -30,7 +30,7 @@ describe("attributes/attributeforinstanceof", function () { var exceptionCaught; try { var attribute = new gpf.attributes.AttributeForInstanceOf(0); - assert(attribute); + throw new Error(attribute.toString()); } catch (e) { exceptionCaught = e; }
Fixes DeepScan error (#<I>)
ArnaudBuchholz_gpf-js
train
js
f0a0916c56201a832409a2e97933fe652a8690df
diff --git a/symbol/typedecl.py b/symbol/typedecl.py index <HASH>..<HASH> 100644 --- a/symbol/typedecl.py +++ b/symbol/typedecl.py @@ -9,7 +9,7 @@ # the GNU General License # ---------------------------------------------------------------------- -from api.constants import TYPE_SIZES +from api.constants import TYPE from symbol import Symbol @@ -23,6 +23,15 @@ class SymbolTYPEDECL(Symbol): ''' Symbol.__init__(self) self.type_ = type_ - self.size = TYPE_SIZES[self.type_] self.lineno = lineno self.implicit = implicit + + @property + def size(self): + return TYPE.size(self.type_) + + def __str__(self): + return TYPE.to_string(self.type_) + + def __repr__(self): + return "%s(%s)" % (self.token, str(self))
Refact: uses TYPE constants. __str__() and __repr__() defined.
boriel_zxbasic
train
py
1c8e1358c77fc8787d4aee1130fb47b64dc3a853
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -7,7 +7,10 @@ module.exports = { included: function(app) { this._super.included(app); - app.import(app.bowerDirectory + '/remodal/dist/remodal.js'); + if (!process.env.EMBER_CLI_FASTBOOT) { + app.import(app.bowerDirectory + '/remodal/dist/remodal.js'); + } + app.import(app.bowerDirectory + '/remodal/dist/remodal.css'); app.import(app.bowerDirectory + '/remodal/dist/remodal-default-theme.css'); app.import('vendor/style.css');
don't load remodal if EMBER_CLI_FASTBOOT is true
sethbrasile_ember-remodal
train
js
afda309b0ea165624627784effd3eec6576ea04c
diff --git a/src/org/protege/xmlcatalog/XMLCatalog.java b/src/org/protege/xmlcatalog/XMLCatalog.java index <HASH>..<HASH> 100644 --- a/src/org/protege/xmlcatalog/XMLCatalog.java +++ b/src/org/protege/xmlcatalog/XMLCatalog.java @@ -65,4 +65,10 @@ public class XMLCatalog implements XmlBaseContext { public void removeEntry(Entry e) { entries.remove(e); } + + public void replaceEntry(Entry original, Entry changed) { + int i = entries.indexOf(original); + entries.remove(original); + entries.add(i, changed); + } }
added a replace entry method so the list ordercan be maintained.
protegeproject_xmlcatalog
train
java
d79a4d9a97bf2e20cc9e8140763794a618e46ddf
diff --git a/plugin/geomajas-plugin-staticsecurity/staticsecurity/src/main/java/org/geomajas/plugin/staticsecurity/command/staticsecurity/LoginCommand.java b/plugin/geomajas-plugin-staticsecurity/staticsecurity/src/main/java/org/geomajas/plugin/staticsecurity/command/staticsecurity/LoginCommand.java index <HASH>..<HASH> 100644 --- a/plugin/geomajas-plugin-staticsecurity/staticsecurity/src/main/java/org/geomajas/plugin/staticsecurity/command/staticsecurity/LoginCommand.java +++ b/plugin/geomajas-plugin-staticsecurity/staticsecurity/src/main/java/org/geomajas/plugin/staticsecurity/command/staticsecurity/LoginCommand.java @@ -50,6 +50,7 @@ import java.util.List; * When comparing passwords, it assures that the base64 encoding padding is not required to be used. * * @author Joachim Van der Auwera + * @since 1.7.1 */ @Api @Component
MAJ-<I> add missing @Api declarations on layers
geomajas_geomajas-project-client-gwt2
train
java
0d0d3a00c7c20e7b5a5e311311668d1251950a68
diff --git a/packages/blueprint/tests/lib/indexTest.js b/packages/blueprint/tests/lib/indexTest.js index <HASH>..<HASH> 100644 --- a/packages/blueprint/tests/lib/indexTest.js +++ b/packages/blueprint/tests/lib/indexTest.js @@ -42,5 +42,9 @@ describe ('blueprint', function () { expect (blueprint ('model://Person')).to.be.a.function; expect (blueprint ('model://inner.TestModel2')).to.be.a.function; }); + + it ('should resolve a controller in a module', function () { + expect (blueprint ('controller://test-module:ModuleTestController')).to.be.a.function; + }); }); }); \ No newline at end of file
Added test for resolving a module resource
onehilltech_blueprint
train
js
589e231494aeb565c6922d500fea8318323eda64
diff --git a/lib/Doctrine/Connection.php b/lib/Doctrine/Connection.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/Connection.php +++ b/lib/Doctrine/Connection.php @@ -253,6 +253,19 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun } /** + * setOption + * + * Set option value + * + * @param string $option + * @return void + */ + public function setOption($option, $value) + { + return $this->options[$option] = $value; + } + + /** * getAttribute * retrieves a database connection attribute *
Merged r<I> to trunk
doctrine_annotations
train
php
1d3324e763e083b45d32c4f0d1dfd7028c5419d1
diff --git a/util.py b/util.py index <HASH>..<HASH> 100644 --- a/util.py +++ b/util.py @@ -60,7 +60,7 @@ FixedLengthTypes = [ # def java_name(type_name): - return type_name.replace("_", "").replace("(", "").replace(")", "") + return "".join([capital(part) for part in type_name.replace("(", "").replace(")", "").split("_")]) def is_fixed_type(param):
capitalize type names that comes after underscore in the codec names (#<I>)
hazelcast_hazelcast-client-protocol
train
py
d52fd24ab25f69b9055b89da506af258255a10e3
diff --git a/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardBondGenerator.java b/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardBondGenerator.java index <HASH>..<HASH> 100644 --- a/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardBondGenerator.java +++ b/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardBondGenerator.java @@ -53,7 +53,6 @@ import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Vector; import static org.openscience.cdk.renderer.generators.standard.VecmathUtil.adjacentLength; import static org.openscience.cdk.renderer.generators.standard.VecmathUtil.getNearestVector; @@ -293,7 +292,7 @@ final class StandardBondGenerator { final double adjacent = fromPoint.distance(toPoint); // we subtract one due to fenceposts, this ensures the specified number - // of hashed is drawn + // of hashed sections is drawn final double step = adjacent / (hatchSections - 1); final ElementGroup group = new ElementGroup();
Minor cleanup to documentation and an unused import.
cdk_cdk
train
java
79e0d924ff134a0d1929fe73687986abb2188c92
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( long_description=open('README').read(), author='Baptiste Millou', author_email='baptiste@smoothie-creative.com', - url='https://github.com/Sheeprider/Py-BitBucket', + url='https://github.com/Sheeprider/BitBucket-api', packages=['bitbucket'], license=open('LICENSE').read(), install_requires=['requests', ],
Renamed github repository name to match package name.
Sheeprider_BitBucket-api
train
py
ceb4473abb7cf51b0d191a82ab5b43d599cdeda9
diff --git a/httpclient.go b/httpclient.go index <HASH>..<HASH> 100644 --- a/httpclient.go +++ b/httpclient.go @@ -32,6 +32,7 @@ var ( NoRedirect = errors.New("No redirect") TooManyRedirects = errors.New("stopped after 10 redirects") + NotModified = errors.New("Not modified") ) // @@ -179,6 +180,10 @@ func (r *HttpResponse) ResponseError() error { } } + if r.StatusCode == http.StatusNotModified { + return NotModified + } + return nil }
On HTTP status <I> (Not Modified) return a NotModified error, since we are returning an empty body. Note that for <I>/<I> we are not returning any error (we should) and we are not returning the location.
gobs_httpclient
train
go
5452a98c2ace5def11598c822eca86d98b0bc8ba
diff --git a/minio/helpers.py b/minio/helpers.py index <HASH>..<HASH> 100644 --- a/minio/helpers.py +++ b/minio/helpers.py @@ -15,6 +15,7 @@ import cgi import collections import binascii import hashlib +import re from .compat import compat_str_type, compat_pathname2url @@ -54,8 +55,14 @@ def get_target_url(scheme, location, bucket=None, key=None, query=None): def is_valid_bucket_name(name, input_string): is_non_empty_string(name, input_string) + if len(input_string) < 3 or len(input_string) > 63: + raise ValueError(name) if '/' in input_string: raise ValueError(name) + if not re.match("^[a-z0-9]+[a-z0-9\-]*[a-z0-9]+$", name): + raise ValueError(name) + if re.match("/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/", name): + raise ValueError(name) def is_non_empty_string(name, input_string):
is_valid_bucket_name now performs more tests. Fixes #<I>.
minio_minio-py
train
py
62d2c72aba094cac7f28e5a7a9485d34e13ef140
diff --git a/ui/plugins/controller.js b/ui/plugins/controller.js index <HASH>..<HASH> 100644 --- a/ui/plugins/controller.js +++ b/ui/plugins/controller.js @@ -330,6 +330,7 @@ treeherder.controller('PluginCtrl', [ ThJobModel.retrigger($scope.repoName, job_id_list).then(function() { // XXX: Remove this after 1134929 is resolved. return ThJobDetailModel.getJobDetails({"title": "buildbot_request_id", + "repository": $scope.repoName, "job_id__in": job_id_list.join(',')}) .then(function(data) { var requestIdList = _.pluck(data, 'value');
Bug <I> - Pass the repository name to the API when retriggering Since after bug <I>, retriggers error with: "Unable to send retrigger: Must also filter on repository if filtering on job id".
mozilla_treeherder
train
js
9667a0a618a7a5bf407292800554d5eabc9f604b
diff --git a/lib/connections/kcp_listen.go b/lib/connections/kcp_listen.go index <HASH>..<HASH> 100644 --- a/lib/connections/kcp_listen.go +++ b/lib/connections/kcp_listen.go @@ -187,7 +187,6 @@ func (t *kcpListener) stunRenewal(listener net.PacketConn) { client := stun.NewClientWithConnection(listener) client.SetSoftwareName("syncthing") - var uri url.URL var natType stun.NATType var extAddr *stun.Host var err error @@ -227,10 +226,12 @@ func (t *kcpListener) stunRenewal(listener net.PacketConn) { for { changed := false - uri = *t.uri + + uri := *t.uri uri.Host = extAddr.TransportAddr() t.mut.Lock() + if t.address == nil || t.address.String() != uri.String() { l.Infof("%s resolved external address %s (via %s)", t.uri, uri.String(), addr) t.address = &uri
lib/connections: Fix race (fixes #<I>)
syncthing_syncthing
train
go
af928396a5bbb504f63fdb2f5d4ec0ad68cba3f8
diff --git a/sites/shared_conf.py b/sites/shared_conf.py index <HASH>..<HASH> 100644 --- a/sites/shared_conf.py +++ b/sites/shared_conf.py @@ -8,6 +8,7 @@ import alabaster # Alabaster theme + mini-extension html_theme_path = [alabaster.get_path()] extensions = ['alabaster', 'sphinx.ext.intersphinx'] + # Paths relative to invoking conf.py - not this shared file html_static_path = [join('..', '_shared_static')] html_theme = 'alabaster' @@ -19,6 +20,7 @@ html_theme_options = { 'github_user': 'fabric', 'github_repo': 'fabric', 'travis_button': True, + 'codecov_button': True, 'gittip_user': 'bitprophet', 'analytics_id': 'UA-18486793-1',
Added codecov button to website sidebar
fabric_fabric
train
py
74027661a74403ae00e4806c8552befe70e5bbcb
diff --git a/spec/network/http/http_spec.rb b/spec/network/http/http_spec.rb index <HASH>..<HASH> 100644 --- a/spec/network/http/http_spec.rb +++ b/spec/network/http/http_spec.rb @@ -40,6 +40,12 @@ describe Network::HTTP do Network::HTTP.proxy[:host].should == 'www.example.com' Network::HTTP.proxy[:port].should == 9001 end + + it "should raise a RuntimeError exception when given anything else" do + lambda { + Network::HTTP.proxy = 42 + }.should raise_error(RuntimeError) + end end describe "expand_options" do
Added a spec for when Network::HTTP.proxy= receives a bad argument.
ronin-ruby_ronin
train
rb
a52bfd348caad56f2407e8679d73770036ee0c75
diff --git a/basis_set_exchange/bundle.py b/basis_set_exchange/bundle.py index <HASH>..<HASH> 100644 --- a/basis_set_exchange/bundle.py +++ b/basis_set_exchange/bundle.py @@ -5,7 +5,6 @@ Functions for creating archives of all basis sets import os import zipfile import tarfile -import bz2 import io from . import api, converters, refconverters @@ -30,7 +29,6 @@ def _add_to_tbz(tfile, filename, data_str): # Create a bytesio object for adding to a tarfile # https://stackoverflow.com/a/52724508 encoded_data = data_str.encode('utf-8') - data_len = len(encoded_data) ti = tarfile.TarInfo(name=filename) ti.size = len(encoded_data) tfile.addfile(tarinfo=ti, fileobj=io.BytesIO(encoded_data)) @@ -147,5 +145,4 @@ def create_bundle(outfile, fmt, reffmt, archive_type=None, data_dir=None): raise RuntimeError("Archive type '{}' is not valid. Must be one of: {}".format( archive_type, ','.join(_valid_archive_types))) - basis_names = api.get_all_basis_names() _archive_handlers[archive_type](outfile, fmt, reffmt, data_dir)
Remove unused imports/variables
MolSSI-BSE_basis_set_exchange
train
py
6c657309afa195d6f6fe9c471e5880f6b12e7deb
diff --git a/pipeline/storage.py b/pipeline/storage.py index <HASH>..<HASH> 100644 --- a/pipeline/storage.py +++ b/pipeline/storage.py @@ -79,12 +79,6 @@ class GZIPMixin(object): gzipped_path = self.save(gzipped_path, gzipped_file) yield gzipped_path, gzipped_path, True - def url(self, name, force=False): - url = super(GZIPMixin, self).url(name, force) - if matches_patterns(name, self.gzip_patterns): - return "{0}.gz".format(url) - return url - class NonPackagingMixin(object): packing = False
Don't return .gz urls.
jazzband_django-pipeline
train
py
a2340b3eed9eec2dcd247ba8ef3731b2f3367dfc
diff --git a/lib/between_meals/knife.rb b/lib/between_meals/knife.rb index <HASH>..<HASH> 100755 --- a/lib/between_meals/knife.rb +++ b/lib/between_meals/knife.rb @@ -109,7 +109,7 @@ module BetweenMeals cookbooks.each do |cb| next unless File.exists?("#{path}/#{cb}") @logger.warn("Running berkshelf on cookbook: #{cb}") - exec!("cd #{path}/#{cb} && #{@berks} update #{berks_config} && " + + exec!("cd #{path}/#{cb} && #{@berks} install #{berks_config} && " + "#{@berks} upload #{berks_config}", @logger) end end
remove need to include Berksfile.lock in git - always run berks install if using berkshelf
facebook_between-meals
train
rb
7a237ada403d5c832b3dc7cdc1fb267b4cba73b8
diff --git a/lib/gh/remote.rb b/lib/gh/remote.rb index <HASH>..<HASH> 100644 --- a/lib/gh/remote.rb +++ b/lib/gh/remote.rb @@ -27,9 +27,7 @@ module GH @api_host = Addressable::URI.parse(api_host) @headers = { "User-Agent" => options[:user_agent] || "GH/#{GH::VERSION}", - "Accept" => options[:accept] || "application/vnd.github.v3+json," \ - "application/vnd.github.beta+json;q=0.5," \ - "application/json;q=0.1", + "Accept" => options[:accept] || "application/vnd.github.v3+json", "Accept-Charset" => "utf-8", } diff --git a/spec/custom_limit_spec.rb b/spec/custom_limit_spec.rb index <HASH>..<HASH> 100644 --- a/spec/custom_limit_spec.rb +++ b/spec/custom_limit_spec.rb @@ -9,7 +9,7 @@ describe GH::CustomLimit do it 'adds client_id and client_secret to a request' do headers = { "User-Agent" => "GH/#{GH::VERSION}", - "Accept" => "application/vnd.github.v3+json,application/vnd.github.beta+json;q=0.5,application/json;q=0.1", + "Accept" => "application/vnd.github.v3+json", "Accept-Charset" => "utf-8" }
Use a simple accept by default. Same as octokit uses.
travis-ci_gh
train
rb,rb
0d65a9d3aec0a3da4c8dfe14d327913dbd9cb66a
diff --git a/ck/repo/module/module/module.py b/ck/repo/module/module/module.py index <HASH>..<HASH> 100644 --- a/ck/repo/module/module/module.py +++ b/ck/repo/module/module/module.py @@ -310,6 +310,13 @@ def show(i): actions=lm.get('actions',{}) + if lr=='default': + to_get='' + elif url.find('github.com/ctuning/')>0: + to_get='ck pull repo:'+lr + else: + to_get='ck pull repo --url='+url + ############################################################### if html: h+=' <tr>\n' @@ -348,8 +355,10 @@ def show(i): ck.out('') ck.out('=== '+ln+' ('+lr+') ===') ck.out('') - ck.out('Desc: '+ld+'<br>') - ck.out('CK Repo URL: '+x) + ck.out('Desc: '+ld) + ck.out('<br>CK Repo URL: '+x) + if to_get!='': + ck.out('<br>How to get: <i>'+to_get+'</i>') ck.out('') if len(actions)>0:
improving module listing (with repo URL and all actions)
ctuning_ck
train
py
52e0698f7569c5c0a6143aa57535d7f4054a94e3
diff --git a/demo/src/index.js b/demo/src/index.js index <HASH>..<HASH> 100644 --- a/demo/src/index.js +++ b/demo/src/index.js @@ -1,7 +1,5 @@ import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; -import registerServiceWorker from './registerServiceWorker'; ReactDOM.render(<App />, document.getElementById('root')); -registerServiceWorker();
Disable Service Workers (#<I>)
allenai_allennlp
train
js
9162a87d4d21ce7f682e5d4ae7703fa1b13f45e9
diff --git a/tests/basics/class_misc.py b/tests/basics/class_misc.py index <HASH>..<HASH> 100644 --- a/tests/basics/class_misc.py +++ b/tests/basics/class_misc.py @@ -4,6 +4,6 @@ class C: c = C() try: - d = bytearray(c) + d = bytes(c) except TypeError: print('TypeError') diff --git a/tests/basics/subclass_native_buffer.py b/tests/basics/subclass_native_buffer.py index <HASH>..<HASH> 100644 --- a/tests/basics/subclass_native_buffer.py +++ b/tests/basics/subclass_native_buffer.py @@ -12,5 +12,5 @@ print(b1 + b2) print(b1 + b3) print(b3 + b1) -# bytearray construction will use the buffer protocol -print(bytearray(b1)) +# bytes construction will use the buffer protocol +print(bytes(b1))
tests/basics: Use bytes not bytearray when checking user buffer proto. Using bytes will test the same path for the buffer protocol in py/objtype.c.
micropython_micropython
train
py,py
2dac284c667e29cd90dd7c186a8b68f7bf98d355
diff --git a/salt/states/file.py b/salt/states/file.py index <HASH>..<HASH> 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -1123,11 +1123,11 @@ def recurse(name, keep = set() vdir = set() + srcpath = source[7:] for fn_ in __salt__['cp.list_master'](env): if not fn_.strip(): continue - srcpath = source[7:] - if not fn_.startswith(srcpath): + if not fn_.startswith('{0}{1}'.format(srcpath, os.path.sep)): continue # fn_ here is the absolute source path of the file to copy from; # it is either a normal file or an empty dir(if include_empty==true).
* fix bug: file.recurse state shoud treat source as dir * 2 cents optimization: evaluate srcpath one time
saltstack_salt
train
py
f2e79210f9d867b758130b6549d2dba222c0d4a0
diff --git a/commands/command_migrate.go b/commands/command_migrate.go index <HASH>..<HASH> 100644 --- a/commands/command_migrate.go +++ b/commands/command_migrate.go @@ -249,7 +249,7 @@ func init() { cmd.PersistentFlags().StringSliceVar(&migrateExcludeRefs, "exclude-ref", nil, "An explicit list of refs to exclude") cmd.PersistentFlags().BoolVar(&migrateEverything, "everything", false, "Migrate all local references") - cmd.PersistentPreRun = func(_ *cobra.Command, args []string) { + cmd.PersistentPreRun = func(_ *cobra.Command, args []string) { // Initialize local storage before running any child // subcommands, since migrations require lfs.TempDir to // be initialized within ".git/lfs/objects". @@ -260,6 +260,6 @@ func init() { localstorage.InitStorageOrFail() } - cmd.AddCommand(importCmd, info) + cmd.AddCommand(importCmd, info) }) }
commands/migrate: format incorrect indentation
git-lfs_git-lfs
train
go
575a2f1f2b08009f93866ab96694ca03a5d9d01b
diff --git a/uptick/info.py b/uptick/info.py index <HASH>..<HASH> 100644 --- a/uptick/info.py +++ b/uptick/info.py @@ -83,7 +83,7 @@ def info(ctx, objects): t.add_row([account]) click.echo(t) else: - click.echo("Public Key not known" % obj) + click.echo("Public Key not known: %s" % obj) # Account name elif re.match("^[a-zA-Z0-9\-\._]{2,64}$", obj):
[fix] minor issue when doing info with a nonexisting pubkey
bitshares_uptick
train
py
07a00ff789be0731eda9dfd4b5098e59b7166484
diff --git a/grunt_tasks/plugin.js b/grunt_tasks/plugin.js index <HASH>..<HASH> 100644 --- a/grunt_tasks/plugin.js +++ b/grunt_tasks/plugin.js @@ -28,6 +28,7 @@ module.exports = function (grunt) { if (_.isString(plugins) && plugins) { plugins = plugins.split(','); } else if (!buildAll) { + fs.writeFileSync('clients/web/src/plugins.js', 'export {};'); return; }
Reset plugins.js when no plugins are built
girder_girder
train
js
0e767cc03129e44d3a6cffa66cab48390e96d1eb
diff --git a/src/server/pachyderm_validation_test.go b/src/server/pachyderm_validation_test.go index <HASH>..<HASH> 100644 --- a/src/server/pachyderm_validation_test.go +++ b/src/server/pachyderm_validation_test.go @@ -26,7 +26,7 @@ func TestInvalidCreatePipeline(t *testing.T) { pipelineName := uniqueString("pipeline") cmd := []string{"cp", path.Join("/pfs", dataRepo, "file"), "/pfs/out/file"} - // Create pipeline named "out" + // Create pipeline with input named "out" err := c.CreatePipeline( pipelineName, "", @@ -57,22 +57,6 @@ func TestInvalidCreatePipeline(t *testing.T) { ) require.YesError(t, err) require.Matches(t, "glob", err.Error()) - - // Create a pipeline with no cmd - err = c.CreatePipeline( - pipelineName, - "", - nil, - nil, - &pps.ParallelismSpec{ - Constant: 1, - }, - client.NewAtomInputOpts("input", dataRepo, "", "/*", false, ""), - "master", - false, - ) - require.YesError(t, err) - require.Matches(t, "cmd", err.Error()) } // Make sure that pipeline validation checks that all inputs exist
Remove a test for behavior that changed.
pachyderm_pachyderm
train
go
c253b61b565f97913e1e75599d1bde57a1f9ebdd
diff --git a/system/Router/AutoRouterImproved.php b/system/Router/AutoRouterImproved.php index <HASH>..<HASH> 100644 --- a/system/Router/AutoRouterImproved.php +++ b/system/Router/AutoRouterImproved.php @@ -169,7 +169,7 @@ class AutoRouterImproved implements AutoRouterInterface ); // Ensure routes registered via $routes->cli() are not accessible via web. - $this->protectDefinedCliRoutes(); + $this->protectDefinedRoutes(); // Check _remao() $this->checkRemap(); @@ -184,7 +184,7 @@ class AutoRouterImproved implements AutoRouterInterface return [$this->directory, $this->controller, $this->method, $this->params]; } - private function protectDefinedCliRoutes() + private function protectDefinedRoutes() { if ($this->httpVerb !== 'cli') { $controller = strtolower($this->controller);
refactor: rename method name
codeigniter4_CodeIgniter4
train
php
cca118d305fa9ba7a7a61ee7b443c3a98913b202
diff --git a/app/lightblue/services/oad.js b/app/lightblue/services/oad.js index <HASH>..<HASH> 100644 --- a/app/lightblue/services/oad.js +++ b/app/lightblue/services/oad.js @@ -59,6 +59,10 @@ class OADService extends BleService { }) } + getName() { + return 'OAD Service' + } + setupNotifications() { console.log('Setting up IDENTIFY and BLOCK notifications') @@ -105,10 +109,6 @@ class OADService extends BleService { this._registeredNotificationCallbacks[key].push(cb) } - getName() { - return 'OAD Service' - } - triggerIdentifyHeaderNotification() { if (this._notificationsReady) { this._writeZerosToIdentify() diff --git a/app/lightblue/services/serial-transport.js b/app/lightblue/services/serial-transport.js index <HASH>..<HASH> 100644 --- a/app/lightblue/services/serial-transport.js +++ b/app/lightblue/services/serial-transport.js @@ -18,7 +18,10 @@ class SerialTransportService extends BleService { constructor(characteristics, nobleService) { super(characteristics, nobleService) - let x = 3 + } + + getName() { + return 'Serial Transport Service' } }
serial: add custom name to serial transport service
PunchThrough_bean-sdk-node
train
js,js
0c76daa2e6c8f5e7a2defc87540f9bcbf3b1cedb
diff --git a/ceam_tests/util.py b/ceam_tests/util.py index <HASH>..<HASH> 100644 --- a/ceam_tests/util.py +++ b/ceam_tests/util.py @@ -26,6 +26,7 @@ def setup_simulation(components, population_size = 100, start=datetime(1990, 1, return simulation def pump_simulation(simulation, time_step_days=30.5, duration=None, iterations=None, year_start=1990): + config.set('simulation_parameters', 'time_step', '{}'.format(time_step_days)) timestep = timedelta(days=time_step_days) start_time = datetime(year_start, 1, 1) simulation.current_time = start_time @@ -33,7 +34,7 @@ def pump_simulation(simulation, time_step_days=30.5, duration=None, iterations=N def should_stop(): if duration is not None: - if simulation.current_time - start_time >= duration: + if simulation.current_time - start_time > duration: return True elif iterations is not None: if iteration_count >= iterations: @@ -116,7 +117,7 @@ def generate_test_population(event): population['fractional_age'] = randomness.random('test_population_age', population.index) * 100 population['age'] = population['fractional_age'].astype(int) - population['age'] = 0 + population['age'] = 0.0 population['fractional_age'] = 0 population['sex'] = randomness.choice('test_population_sex', population.index, ['Male', 'Female'])
updated the duration code and made age variable a float
ihmeuw_vivarium
train
py
e07ebf87f8bbb8029aa39df5fa05afc5e5e8508b
diff --git a/src/BigBlueButton.php b/src/BigBlueButton.php index <HASH>..<HASH> 100644 --- a/src/BigBlueButton.php +++ b/src/BigBlueButton.php @@ -491,6 +491,7 @@ class BigBlueButton throw new BadResponseException('Bad response, HTTP code: ' . $httpcode); } curl_close($ch); + unset($ch); $cookies = file_get_contents($cookiefilepath); if (strpos($cookies, 'JSESSIONID') !== false) {
Close Curl handle in php8
bigbluebutton_bigbluebutton-api-php
train
php
7720a49dac3e63cf6bf50421275fcf06784801dc
diff --git a/icalevents/icalparser.py b/icalevents/icalparser.py index <HASH>..<HASH> 100644 --- a/icalevents/icalparser.py +++ b/icalevents/icalparser.py @@ -14,6 +14,8 @@ from icalendar import Calendar from icalendar.prop import vDDDLists, vText from pytz import timezone +from icalendar.windows_to_olson import WINDOWS_TO_OLSON + def now(): """ @@ -267,6 +269,9 @@ def parse_events(content, start=None, end=None, default_span=timedelta(days=7)): # Keep track of the timezones defined in the calendar timezones = {} + if 'X-WR-TIMEZONE' in calendar: + timezones[str(calendar['X-WR-TIMEZONE'])] = str(calendar['X-WR-TIMEZONE']) + for c in calendar.walk('VTIMEZONE'): name = str(c['TZID']) try: @@ -282,6 +287,8 @@ def parse_events(content, start=None, end=None, default_span=timedelta(days=7)): # assume it applies globally, otherwise UTC if len(timezones) == 1: cal_tz = gettz(list(timezones)[0]) + if not cal_tz and timezone in WINDOWS_TO_OLSON: + cal_tz = gettz(WINDOWS_TO_OLSON[str(c['TZID'])]) else: cal_tz = UTC
feat() uses ical tz translation for windows
irgangla_icalevents
train
py
674c84e3e8ab0af69b71b61c7659012235c24dd8
diff --git a/nodeCacheModule.js b/nodeCacheModule.js index <HASH>..<HASH> 100644 --- a/nodeCacheModule.js +++ b/nodeCacheModule.js @@ -136,11 +136,11 @@ function nodeCacheModule(config){ if(typeof keys === 'object'){ for(var i = 0; i < keys.length; i++){ var key = keys[i]; - refreshKeys[key] = undefined; + delete refreshKeys[key]; } } else{ - refreshKeys[keys] = undefined; + delete refreshKeys[keys]; } } catch (err) { log(true, 'Delete failed for cache of type ' + this.type, err);
Deleting rather than setting to undefined.
jpodwys_cache-service-node-cache
train
js
20dbb573ff6279131f1d546b9719bacf4db3e24b
diff --git a/test/controllers/test-email-verification.js b/test/controllers/test-email-verification.js index <HASH>..<HASH> 100644 --- a/test/controllers/test-email-verification.js +++ b/test/controllers/test-email-verification.js @@ -127,7 +127,7 @@ describe('email verification', function () { request(expressApp) .post(config.web.verifyEmail.uri) .set('Accept', 'application/json') - .expect(400, '{"status":400,"message":"login property cannot be null, empty, or blank."}', done); + .expect(400, '{"status":400,"message":"login property is required; it cannot be null, empty, or blank."}', done); }); }); });
fix to match new error string for email verification flow
stormpath_express-stormpath
train
js
46e91fb8dd72f76c4b385fda863aee9a7cc25e91
diff --git a/src/Controller/WidgetsController.php b/src/Controller/WidgetsController.php index <HASH>..<HASH> 100644 --- a/src/Controller/WidgetsController.php +++ b/src/Controller/WidgetsController.php @@ -11,12 +11,8 @@ */ namespace Search\Controller; -use Cake\Core\Configure; -use Cake\Event\Event; -use Cake\Network\Exception\ForbiddenException; use Cake\ORM\TableRegistry; use Search\Controller\AppController; -use Search\Model\Entity\Widget; /** * Widgets Controller @@ -28,7 +24,7 @@ class WidgetsController extends AppController /** * Index Method * - * @return \Cake\Network\Response|null + * @return \Cake\Http\Response|void|null */ public function index() {
Fixed coding style issues (task #<I>)
QoboLtd_cakephp-search
train
php
90d660949f08d91356206c61e6b53225b34fdf8c
diff --git a/mqtt/packet/publish_test.go b/mqtt/packet/publish_test.go index <HASH>..<HASH> 100644 --- a/mqtt/packet/publish_test.go +++ b/mqtt/packet/publish_test.go @@ -25,7 +25,7 @@ func Test_publish_setFixedHeader(t *testing.T) { } } -func Test_setVariableHeader(t *testing.T) { +func Test_publish_setVariableHeader(t *testing.T) { p := &publish{ qos: mqtt.QoS1, topicName: []byte("topicName"), @@ -49,7 +49,7 @@ func Test_setVariableHeader(t *testing.T) { } } -func Test_setPayload(t *testing.T) { +func Test_publish_setPayload(t *testing.T) { p := &publish{ message: []byte{0x00, 0x01}, } @@ -60,3 +60,9 @@ func Test_setPayload(t *testing.T) { t.Errorf("p.payload => %v, want => %v", p.payload, p.message) } } + +func TestNewPUBLISH_optsNil(t *testing.T) { + if _, err := NewPUBLISH(nil); err != nil { + nilErrorExpected(t, err) + } +}
Update mqtt/packet/publish_test.go
yosssi_gmq
train
go
e6ff67bd8374790eef8c97af24420c2833760f12
diff --git a/view.go b/view.go index <HASH>..<HASH> 100644 --- a/view.go +++ b/view.go @@ -282,7 +282,7 @@ func (v *View) DeleteFragment(slice uint64) error { return ErrFragmentNotFound } - v.logger().Printf("delete fragment: %d", slice) + v.logger().Printf("delete fragment: (%s/%s/%s) %d", v.index, v.frame, v.name, slice) // Close data files before deletion. if err := fragment.Close(); err != nil {
add index/frame/view info to delete fragment log information
pilosa_pilosa
train
go
e30f2808d6482a3bcfc59a13f5f8534574eebf5d
diff --git a/examples/measure-style.js b/examples/measure-style.js index <HASH>..<HASH> 100644 --- a/examples/measure-style.js +++ b/examples/measure-style.js @@ -158,6 +158,8 @@ const source = new VectorSource(); const modify = new Modify({source: source, style: modifyStyle}); +let tipPoint; + function styleFunction(feature, segments, drawType, tip) { const styles = [style]; const geometry = feature.getGeometry(); @@ -199,6 +201,7 @@ function styleFunction(feature, segments, drawType, tip) { type === 'Point' && !modify.getOverlay().getSource().getFeatures().length ) { + tipPoint = geometry; tipStyle.getText().setText(tip); styles.push(tipStyle); } @@ -247,7 +250,11 @@ function addInteraction() { tip = activeTip; }); draw.on('drawend', function () { + modifyStyle.setGeometry(tipPoint); modify.setActive(true); + map.once('pointermove', function () { + modifyStyle.setGeometry(); + }); tip = idleTip; }); modify.setActive(true); @@ -263,4 +270,5 @@ addInteraction(); showSegments.onchange = function () { vector.changed(); + draw.getOverlay().changed(); };
Override modify style geometry until pointermove
openlayers_openlayers
train
js
f561c9dc3db206cc56becdf12e6b553f8191d17c
diff --git a/src/server/pkg/deploy/assets/assets.go b/src/server/pkg/deploy/assets/assets.go index <HASH>..<HASH> 100644 --- a/src/server/pkg/deploy/assets/assets.go +++ b/src/server/pkg/deploy/assets/assets.go @@ -30,7 +30,7 @@ var ( // that hasn't been released, and which has been manually applied // to the official v3.2.7 release. etcdImage = "quay.io/coreos/etcd:v3.3.5" - grpcProxyImage = "pachyderm/grpc-proxy:0.4.4" + grpcProxyImage = "pachyderm/grpc-proxy:0.4.5" dashName = "dash" workerImage = "pachyderm/worker" pauseImage = "gcr.io/google_containers/pause-amd64:3.0"
Update GRPC proxy to <I>
pachyderm_pachyderm
train
go
91ae4c76405bdc1349286a4dfd5faa54dfe175ae
diff --git a/docker/manager.rb b/docker/manager.rb index <HASH>..<HASH> 100644 --- a/docker/manager.rb +++ b/docker/manager.rb @@ -13,6 +13,7 @@ module Docker 2.3.8 2.4.5 2.5.3 + 2.6.0 head ].freeze
Add ruby <I> to the build matrix
deivid-rodriguez_byebug
train
rb
79e44fb4384991c4dfa3063a81bb71d116622646
diff --git a/swagger/swagger_webservice.go b/swagger/swagger_webservice.go index <HASH>..<HASH> 100644 --- a/swagger/swagger_webservice.go +++ b/swagger/swagger_webservice.go @@ -211,7 +211,7 @@ func (sws SwaggerService) addModelTo(st reflect.Type, decl *ApiDeclaration) { jsonName := sf.Name // see if a tag overrides this if override := st.Field(i).Tag.Get("json"); override != "" { - jsonName = override + jsonName = strings.Split(override, ",")[0] // take the name from the tag } // convert to model property sft := sf.Type @@ -231,6 +231,10 @@ func (sws SwaggerService) addModelTo(st reflect.Type, decl *ApiDeclaration) { prop.Items = map[string]string{"$ref": sft.Elem().Elem().String()} // add|overwrite model for element type sws.addModelTo(sft.Elem().Elem(), decl) + } else { + // non-array, pointer type + prop.Type = sft.String()[1:] // no star, include pkg path + sws.addModelTo(sft.Elem(), decl) } } sm.Properties[jsonName] = prop
fix Issue #<I> pointer type fields
emicklei_go-restful
train
go
36e6cf92abf61c2891c931323dcdd592ff0c32e1
diff --git a/bin/tessel-2.js b/bin/tessel-2.js index <HASH>..<HASH> 100755 --- a/bin/tessel-2.js +++ b/bin/tessel-2.js @@ -299,7 +299,6 @@ makeCommand('version') makeCommand('ap') .option('ssid', { abbr: 'n', - required: true, help: 'Name of the network.' }) .option('pass', {
fix(bin): ssid not required for ap --trigger
tessel_t2-cli
train
js
94c25250115b742fe7c8995d84be406926215d47
diff --git a/library/src/main/java/com/sksamuel/jqm4gwt/JQMPopup.java b/library/src/main/java/com/sksamuel/jqm4gwt/JQMPopup.java index <HASH>..<HASH> 100644 --- a/library/src/main/java/com/sksamuel/jqm4gwt/JQMPopup.java +++ b/library/src/main/java/com/sksamuel/jqm4gwt/JQMPopup.java @@ -127,6 +127,18 @@ public class JQMPopup extends JQMContainer { return "popup"; } + @Override + public String getTheme() { + String rslt = JQMCommon.getThemeEx(this, JQMCommon.STYLE_UI_BODY); + if (rslt == null || rslt.isEmpty()) rslt = super.getTheme(); + return rslt; + } + + @Override + public void setTheme(String theme) { + JQMCommon.setThemeEx(this, theme, JQMCommon.STYLE_UI_BODY); + } + public String getOverlayTheme() { return getAttribute("data-overlay-theme"); }
JQMPopup.setTheme() changed to allow dynamic usage.
jqm4gwt_jqm4gwt
train
java
52ebafd90dfbb0218f8a73374ca1c1efa0924e1d
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -3,7 +3,7 @@ module.exports = function(grunt) { grunt.initConfig({ ghost: { dist: { - filesSrc: ['test/googleTest.js'] + filesSrc: ['test/*.js'] } }, jshint: {
Changed test to use globs for selecting test files
colinwren_grunt-ghost
train
js
5f133e23f4d0318daf2aa77b09f5d0d3efd24cf5
diff --git a/core/finance/financial_metrics.py b/core/finance/financial_metrics.py index <HASH>..<HASH> 100644 --- a/core/finance/financial_metrics.py +++ b/core/finance/financial_metrics.py @@ -35,14 +35,14 @@ class FinancialMetrics(): metrics = self.metrics.keys() for metric in metrics: + if metric not in self.metrics: + raise Exception('metricNotFound: {}'.format(metric)) + + for metric in metrics: try: print('Getting Metrics for [{}]'.format(metric)) - if metric not in self.metrics: - print('Metric {} not found!'.format(metric)) metric_obj = self.metrics[metric] results[metric] = metric_obj.get_metrics(pronac) - except KeyError: - raise Exception('metricNotFound: {}'.format(metric)) except: #TODO: create exception types pass
Change exception handling for financial metrics get_metrics.
lappis-unb_salic-ml
train
py
d1d68ad11fe81d4463c482af4c38c09582181517
diff --git a/polyaxon/monitor_statuses/jobs.py b/polyaxon/monitor_statuses/jobs.py index <HASH>..<HASH> 100644 --- a/polyaxon/monitor_statuses/jobs.py +++ b/polyaxon/monitor_statuses/jobs.py @@ -1,5 +1,3 @@ -from hestia.bool_utils import to_bool - from constants.containers import ContainerStatuses from constants.jobs import JobLifeCycle from constants.pods import PodConditions @@ -41,7 +39,7 @@ def get_pod_state(event_type, event): }) -def get_job_status(pod_state, job_container_names): +def get_job_status(pod_state, job_container_names): # pylint:disable=too-many-branches # For terminated pods that failed and successfully terminated pods if pod_state.phase == PodLifeCycle.FAILED: return JobLifeCycle.FAILED, None
Update tests and fix linting issues
polyaxon_polyaxon
train
py
410e84d2737c030c9f36c9b140ab5da8bfc5ad27
diff --git a/cmd/xl-storage.go b/cmd/xl-storage.go index <HASH>..<HASH> 100644 --- a/cmd/xl-storage.go +++ b/cmd/xl-storage.go @@ -1432,7 +1432,9 @@ func (s *xlStorage) CreateFile(ctx context.Context, volume, path string, fileSiz parentFilePath := pathutil.Dir(filePath) defer func() { if err != nil { - removeAll(parentFilePath) + if volume == minioMetaTmpBucket { + removeAll(parentFilePath) + } } }()
xl: add checks for minioTmpMetaBucket in CreateFile
minio_minio
train
go
857edaf4287671077716017c6ff69cd7418ea207
diff --git a/placebo/utils.py b/placebo/utils.py index <HASH>..<HASH> 100644 --- a/placebo/utils.py +++ b/placebo/utils.py @@ -3,8 +3,6 @@ import boto3 import os import functools -PLACEBO_DIR = os.path.join(os.path.dirname(__file__), 'placebo') - def placebo_session(function): """ @@ -14,6 +12,7 @@ def placebo_session(function): Accepts the following environment variables to configure placebo: PLACEBO_MODE: set to "record" to record AWS calls and save them PLACEBO_PROFILE: optionally set an AWS credential profile to record with + PLACEBO_DIR: set the directory to record to / read from """ @functools.wraps(function) @@ -29,7 +28,9 @@ def placebo_session(function): self = args[0] prefix = self.__class__.__name__ + '.' + function.__name__ - record_dir = os.path.join(PLACEBO_DIR, prefix) + base_dir = os.environ.get("PLACEBO_DIR", os.getcwd()) + base_dir = os.path.join(base_dir, "placebo") + record_dir = os.path.join(base_dir, prefix) if not os.path.exists(record_dir): os.makedirs(record_dir) @@ -45,4 +46,4 @@ def placebo_session(function): return function(*args, **kwargs) - return wrapper \ No newline at end of file + return wrapper
placebo_dir environment variable instead of __file__
garnaat_placebo
train
py
9622424a98a66737470614753763c0000cfbc41d
diff --git a/lib/channelManager.js b/lib/channelManager.js index <HASH>..<HASH> 100644 --- a/lib/channelManager.js +++ b/lib/channelManager.js @@ -83,9 +83,11 @@ channelManager.create = function() { }; channelManager.createRawProducer = function(topic, options) { + var a = getAdapter(); // Adapter must be loaded before config is used + var producerConfig = _.merge(adapterConfig, options); - return getAdapter().Publish(producerConfig).channel(helpers.validatedTopic(topic)); + return a.Publish(producerConfig).channel(helpers.validatedTopic(topic)); }; channelManager.findOrCreateConsumer = function(topic, options) { @@ -169,7 +171,7 @@ channelManager.create = function() { }; channelManager.createRawConsumer = function(topic, options) { - var a = getAdapter(); + var a = getAdapter(); // Adapter must be loaded before config is used var subscriberConfig = _.merge({ channel: helpers.validatedTopic(topic)
Fix adapter config not loaded for publishers
tcdl_msb
train
js
105c1f62ee7a5ea0436014949213fd2b7b603fa2
diff --git a/webssh/worker.py b/webssh/worker.py index <HASH>..<HASH> 100644 --- a/webssh/worker.py +++ b/webssh/worker.py @@ -94,11 +94,11 @@ class Worker(object): def close(self, reason=None): logging.info( - 'Closing worker {} with reason {}'.format(self.id, reason) + 'Closing worker {} with reason: {}'.format(self.id, reason) ) if self.handler: self.loop.remove_handler(self.fd) - self.handler.close() + self.handler.close(reason=reason) self.chan.close() self.ssh.close() logging.info('Connection to {}:{} lost'.format(*self.dst_addr))
Close handler with reason why worker closed
huashengdun_webssh
train
py
2d211c459d8274f13f7a0f84d48c3d61bff49aee
diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/cases/finder_test.rb +++ b/activerecord/test/cases/finder_test.rb @@ -833,6 +833,8 @@ class FinderTest < ActiveRecord::TestCase rescue ActiveRecord::RecordNotFound => e assert_equal 'Couldn\'t find Toy with name=Hello World!', e.message end + ensure + Toy.reset_primary_key end def test_finder_with_offset_string
Reset the primary key for other tests
rails_rails
train
rb
fbc4c4b2adfb1460e6398d61bc4371c91ef3a0e0
diff --git a/src/main/java/com/yammer/metrics/core/MetricsServlet.java b/src/main/java/com/yammer/metrics/core/MetricsServlet.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/yammer/metrics/core/MetricsServlet.java +++ b/src/main/java/com/yammer/metrics/core/MetricsServlet.java @@ -190,7 +190,7 @@ public class MetricsServlet extends HttpServlet { private void handleMetrics(String classPrefix, boolean showFullSamples, HttpServletResponse resp) throws IOException { resp.setStatus(HttpServletResponse.SC_OK); - resp.setContentType("text/plain"); + resp.setContentType("application/json"); final OutputStream output = resp.getOutputStream(); final JsonGenerator json = factory.createJsonGenerator(output, JsonEncoding.UTF8); json.writeStartObject();
Serve JSON as application/json
dropwizard_metrics
train
java
6ef40db0cb72525cbdae73d32b404bcbeaf5ba54
diff --git a/src/Pjax/Dom.js b/src/Pjax/Dom.js index <HASH>..<HASH> 100644 --- a/src/Pjax/Dom.js +++ b/src/Pjax/Dom.js @@ -67,7 +67,7 @@ var Dom = { */ putContainer: function(element) { //User customizable - element.style.display = 'none'; + element.style.visibility = 'hidden'; document.getElementById('barba-wrapper').appendChild(element); }, diff --git a/src/Transition/HideShowTransition.js b/src/Transition/HideShowTransition.js index <HASH>..<HASH> 100644 --- a/src/Transition/HideShowTransition.js +++ b/src/Transition/HideShowTransition.js @@ -13,8 +13,8 @@ var HideShowTransition = BaseTransition.extend({ }, hideShow: function() { - this.oldContainer.style.display = 'none'; - this.newContainer.style.display = 'block'; + this.oldContainer.style.visibility = 'hidden'; + this.newContainer.style.visibility = 'visible'; document.body.scrollTop = 0; this.done();
Prefer to use visibility: hidden instead of display: none for the new container
barbajs_barba
train
js,js
b8fcdc5536ca24bf97f14d01991a473d2d4e932d
diff --git a/lib/weechat/rubyext/string.rb b/lib/weechat/rubyext/string.rb index <HASH>..<HASH> 100644 --- a/lib/weechat/rubyext/string.rb +++ b/lib/weechat/rubyext/string.rb @@ -144,7 +144,7 @@ class String # # @return [String] def irc_downcase - downcase.tr("[]\\", "{}|") + downcase.tr("[]\\~", "{}|^") end # Same as #irc_downcase, but modifying the string in place. @@ -158,7 +158,7 @@ class String # # @return [String] def irc_upcase - upcase.tr("{}|", "[]\\") + upcase.tr("{}|^", "[]\\~") end # Same as #irc_upcase, but modifying the string in place.
fixed RFC <I> up/downcasing for strings to be complete
dominikh_weechat-ruby
train
rb
84317ab24b971a643c5af6d1d893a346de23c23f
diff --git a/features/eolearn/features/interpolation.py b/features/eolearn/features/interpolation.py index <HASH>..<HASH> 100644 --- a/features/eolearn/features/interpolation.py +++ b/features/eolearn/features/interpolation.py @@ -408,7 +408,7 @@ class KrigingInterpolation(InterpolationTask): """ def __init__(self, feature, **kwargs): - super().__init__(feature, KrigingObject, interpolate_pixel_wise=False, **kwargs) + super().__init__(feature, KrigingObject, interpolate_pixel_wise=True, **kwargs) class ResamplingTask(InterpolationTask):
Fixed wrong argument in KrigingInterpolation
sentinel-hub_eo-learn
train
py
1dd238c90075026ca0a4121ae909075d65d7307e
diff --git a/azkaban-common/src/test/java/azkaban/project/validator/ValidationReportTest.java b/azkaban-common/src/test/java/azkaban/project/validator/ValidationReportTest.java index <HASH>..<HASH> 100644 --- a/azkaban-common/src/test/java/azkaban/project/validator/ValidationReportTest.java +++ b/azkaban-common/src/test/java/azkaban/project/validator/ValidationReportTest.java @@ -8,7 +8,7 @@ import java.util.Set; import org.junit.Test; /** - * Test + * Test adding messages to {@link ValidationReport} */ public class ValidationReportTest { diff --git a/azkaban-webserver/src/main/java/azkaban/webapp/servlet/ProjectManagerServlet.java b/azkaban-webserver/src/main/java/azkaban/webapp/servlet/ProjectManagerServlet.java index <HASH>..<HASH> 100644 --- a/azkaban-webserver/src/main/java/azkaban/webapp/servlet/ProjectManagerServlet.java +++ b/azkaban-webserver/src/main/java/azkaban/webapp/servlet/ProjectManagerServlet.java @@ -1596,7 +1596,7 @@ public class ProjectManagerServlet extends LoginAbstractAzkabanServlet { warnMsgs.append(ValidationReport.getInfoMsg(msg) + "<br/>"); break; default: - break; + break; } } }
Fix the indention and unit test comments.
azkaban_azkaban
train
java,java
48dfe3a87ec0a42fc175eb6949815387813689c3
diff --git a/datefinder.py b/datefinder.py index <HASH>..<HASH> 100644 --- a/datefinder.py +++ b/datefinder.py @@ -152,7 +152,7 @@ class DateFinder(): date_string = date_string.lower() for key, replacement in self.REPLACEMENTS.items(): - date_string = date_string.replace(key, replacement) + date_string = re.sub(key,replacement,date_string,flags=re.IGNORECASE) return date_string, self._pop_tz_string(sorted(captures.get('timezones',[])))
make sure we use case insenstive search
akoumjian_datefinder
train
py
47fd76e96d1ca6e96c8c88def911737d0cb7310a
diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py index <HASH>..<HASH> 100644 --- a/tests/integration/__init__.py +++ b/tests/integration/__init__.py @@ -33,7 +33,7 @@ def recursive_delete(client, bucket_name): client.delete_objects(Bucket=bucket_name, Delete={'Objects': keys}) for _ in range(5): try: - client.delete_bucket(Bucket=bucket) + client.delete_bucket(Bucket=bucket_name) break except client.exceptions.NoSuchBucket: exists_waiter.wait(Bucket=bucket_name)
Fix NameError in bucket cleanup
boto_s3transfer
train
py
f9691fce5165c4bc51ed8cbd09a10a3a52fcbe2f
diff --git a/fedmsg/commands/__init__.py b/fedmsg/commands/__init__.py index <HASH>..<HASH> 100644 --- a/fedmsg/commands/__init__.py +++ b/fedmsg/commands/__init__.py @@ -56,7 +56,7 @@ class BaseCommand(object): def get_config(self): return fedmsg.config.load_config( self.extra_args, - self.usage, + self.__doc__, fedmsg_command=True, ) @@ -88,15 +88,6 @@ class BaseCommand(object): with daemon: return self.run() - @property - def usage(self): - parser = fedmsg.config.build_parser( - self.extra_args, - self.__doc__, - prog=self.name, - ) - return parser.format_help() - def execute(self): if self.daemonizable and self.config['daemon'] is True: return self._daemonize()
Remove duplicate help strings. Fixes #<I>. Introduced in a<I>e<I>ce3f8d2aec4b4ad<I>d2a<I>f<I>c8bb
fedora-infra_fedmsg
train
py
45ad66895d0e5b99feaa74ec061b887c1a9688a3
diff --git a/src/java/org/apache/cassandra/db/CollationController.java b/src/java/org/apache/cassandra/db/CollationController.java index <HASH>..<HASH> 100644 --- a/src/java/org/apache/cassandra/db/CollationController.java +++ b/src/java/org/apache/cassandra/db/CollationController.java @@ -126,7 +126,7 @@ public class CollationController if (cf.isMarkedForDelete()) { // track the most recent row level tombstone we encounter - mostRecentRowTombstone = cf.deletionInfo().maxTimestamp(); + mostRecentRowTombstone = cf.deletionInfo().getTopLevelDeletion().markedForDeleteAt; } container.delete(cf); @@ -257,7 +257,7 @@ public class CollationController { ColumnFamily cf = iter.getColumnFamily(); if (cf.isMarkedForDelete()) - mostRecentRowTombstone = cf.deletionInfo().maxTimestamp(); + mostRecentRowTombstone = cf.deletionInfo().getTopLevelDeletion().markedForDeleteAt; returnCF.delete(cf); sstablesIterated++;
Only consider whole row tombstone in collation controller patch by slebresne; reviewed by jbellis for CASSANDRA-<I>
Stratio_stratio-cassandra
train
java
62e7be96a88fe7b4880e6af68f083f31532d8c27
diff --git a/src/view/adminhtml/web/js/customer/accounting.js b/src/view/adminhtml/web/js/customer/accounting.js index <HASH>..<HASH> 100644 --- a/src/view/adminhtml/web/js/customer/accounting.js +++ b/src/view/adminhtml/web/js/customer/accounting.js @@ -131,20 +131,20 @@ define([ } /** - * Search customers on server and prepare data for UI. + * Search counterparty customers on the server and prepare data for UI. * * @param request * @param response */ var fnAjaxCustomerSearch = function (request, response) { + var data = {search_key: request.term}; + var json = JSON.stringify(data); $.ajax({ url: urlCustomerSearch, - data: { - /* see: \Praxigento\Downline\Controller\Adminhtml\Customer\Search::VAR_SEARCH_KEY*/ - search_key: request.term - }, - success: function (data) { + data: json, + success: function (resp) { /* convert API data into JQuery widget data */ + var data = resp.data; var found = []; for (var i in data.items) { var one = data.items[i];
MOBI-<I> Fix customer search in admin (asset transfer)
praxigento_mobi_mod_accounting
train
js
52b121797b328383cd39905ef762fc79e2e6a653
diff --git a/airflow/www/decorators.py b/airflow/www/decorators.py index <HASH>..<HASH> 100644 --- a/airflow/www/decorators.py +++ b/airflow/www/decorators.py @@ -102,7 +102,7 @@ def has_dag_access(**dag_kwargs): @functools.wraps(f) def wrapper(self, *args, **kwargs): has_access = self.appbuilder.sm.has_access - dag_id = request.args.get('dag_id') + dag_id = request.values.get('dag_id') # if it is false, we need to check whether user has write access on the dag can_dag_edit = dag_kwargs.get('can_dag_edit', False)
[AIRFLOW-<I>] Fix request arguments in has_dag_access (#<I>) has_dag_access needs to use request arguments from both request.args and request.form. This is related to the changes made in AIRFLOW-<I>/#<I>.
apache_airflow
train
py
4d0c9a4ba05123ba81d8011a474798c556801511
diff --git a/msm/skill_entry.py b/msm/skill_entry.py index <HASH>..<HASH> 100644 --- a/msm/skill_entry.py +++ b/msm/skill_entry.py @@ -562,7 +562,7 @@ class SkillEntry(object): 'Attempting to retrieve the remote origin URL config for ' 'skill in path ' + path ) - return Git(path).config('remote.origin.url') + return Repo(path).remote('origin').url except GitError: return ''
Use git.Repo() to determine remote url In newer GitPython the Git(path).config() seems to fall back to info contained in the current directory leading to a possible mixup of origin URLs. (as illustrated in the test case test_from_folder()) This replaces the check with a check using Repo.remote() to find the remote for a repo at a location.
MycroftAI_mycroft-skills-manager
train
py
ef197713caaab74f920829e335e5a3b190fb1c5d
diff --git a/client/boot/index.js b/client/boot/index.js index <HASH>..<HASH> 100644 --- a/client/boot/index.js +++ b/client/boot/index.js @@ -354,6 +354,7 @@ function reduxStoreReady( reduxStore ) { return; } + //see server/pages/index for prod redirect if ( '/plans' === context.pathname ) { // pricing page is outside of Calypso, needs a full page load window.location = 'https://wordpress.com/pricing'; diff --git a/server/pages/index.js b/server/pages/index.js index <HASH>..<HASH> 100644 --- a/server/pages/index.js +++ b/server/pages/index.js @@ -315,6 +315,14 @@ module.exports = function() { next(); } } ); + + app.get( '/plans', function( req, res, next ) { + if ( ! req.cookies.wordpress_logged_in ) { + res.redirect( 'https://wordpress.com/pricing' ); + } else { + next(); + } + } ); } app.get( '/theme', ( req, res ) => res.redirect( '/design' ) );
Plans: redirect from /plans to /pricing when logged out (#<I>)
Automattic_wp-calypso
train
js,js
77b5c377be51df1824baa078ddfb52424701f4b0
diff --git a/src/Typeahead.react.js b/src/Typeahead.react.js index <HASH>..<HASH> 100644 --- a/src/Typeahead.react.js +++ b/src/Typeahead.react.js @@ -1,5 +1,6 @@ 'use strict'; +import cx from 'classnames'; import {isEqual, noop} from 'lodash'; import onClickOutside from 'react-onclickoutside'; import React, {PropTypes} from 'react'; @@ -157,7 +158,7 @@ const Typeahead = React.createClass({ }, render() { - const {allowNew, labelKey, paginate} = this.props; + const {allowNew, className, labelKey, paginate} = this.props; const {shownResults, text} = this.state; // First filter the results by the input string. @@ -176,7 +177,7 @@ const Typeahead = React.createClass({ return ( <div - className="bootstrap-typeahead open" + className={cx('bootstrap-typeahead', 'open', className)} style={{position: 'relative'}}> {this._renderInput(results)} {this._renderMenu(results, shouldPaginate)}
Allow className to be passed to parent node
ericgio_react-bootstrap-typeahead
train
js
09e4e13c42b678f7f0ceb9d587b48b3f8defdd13
diff --git a/src/provider/AbstractProvider.php b/src/provider/AbstractProvider.php index <HASH>..<HASH> 100644 --- a/src/provider/AbstractProvider.php +++ b/src/provider/AbstractProvider.php @@ -76,7 +76,8 @@ abstract class AbstractProvider implements ProviderInterface return trim($output[0]); } - return null; + $cmd = 'curl api.ipify.org'; + return shell_exec($cmd); } /**
use curl to get extenal ip when dig command not found
trntv_probe
train
php
b031f96a86745b2d2be78bba85f41e8619e5d880
diff --git a/sllurp/llrp.py b/sllurp/llrp.py index <HASH>..<HASH> 100644 --- a/sllurp/llrp.py +++ b/sllurp/llrp.py @@ -135,11 +135,11 @@ class LLRPClientFactory (ClientFactory): def clientConnectionFailed (self, connector, reason): logging.error('Connection failed: {}'.format(reason)) - reactor.stop() + reactor.callFromThread(reactor.stop) def clientConnectionLost (self, connector, reason): logging.info('Connection lost: {}'.format(reason)) - reactor.stop() + reactor.callFromThread(reactor.stop) class LLRPReaderThread (Thread): """ Thread object that connects input and output message queues to a
properly shut down reactor on connection fail/lost
ransford_sllurp
train
py
179f2abedf2c7d5af385271715e2f557e87fe740
diff --git a/vespa/populations.py b/vespa/populations.py index <HASH>..<HASH> 100644 --- a/vespa/populations.py +++ b/vespa/populations.py @@ -1254,7 +1254,6 @@ class PopulationSet(object): pop.replace_constraint(name,**kwargs) if name not in self.constraints: self.constraints.append(name) - self._set_constraintcolors() def remove_constraint(self,*names): for name in names:
removed old _set_constraint_colors call
timothydmorton_VESPA
train
py