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
f2a290b9d67df9a0e5a1465ce26ea15a2674675e
diff --git a/save.go b/save.go index <HASH>..<HASH> 100644 --- a/save.go +++ b/save.go @@ -7,6 +7,7 @@ import ( "go/build" "os/exec" "path" + "regexp" "strings" ) @@ -72,15 +73,17 @@ func runSave(cmd *Command, args []string) { // Keep edits to vcs.go separate from the stock version. var headCmds = map[string]string{ - "git": "rev-parse head", - "hg": "id", - // TODO: Bzr + "git": "rev-parse head", // 2bebebd91805dbb931317f7a4057e4e8de9d9781 + "hg": "id", // 19114a3ee7d5 tip + "bzr": "log -r-1 --line", // 50: Dimiter Naydenov 2014-02-12 [merge] ec2: Added (Un)AssignPrivateIPAddresses APIs } +var revisionSeparator = regexp.MustCompile(`[ :]+`) + func (v *vcsCmd) head(dir, repo string) (string, error) { var output, err = v.runOutput(dir, headCmds[v.cmd], "dir", dir, "repo", repo) if err != nil { return "", err } - return string(output), nil + return revisionSeparator.Split(string(output), -1)[0], nil }
Support bzr, and strip hg trailing trash
robfig_glock
train
go
4989b183c51567c07e0330be7d469ad62807832d
diff --git a/src/ServiceManager.php b/src/ServiceManager.php index <HASH>..<HASH> 100644 --- a/src/ServiceManager.php +++ b/src/ServiceManager.php @@ -564,30 +564,18 @@ class ServiceManager implements ServiceLocatorInterface } /** - * Recursively resolve an alias name to a service name - * - * @param string $alias - * @return string - */ - private function resolveAlias($alias) - { - $name = $alias; - - do { - $canBeResolved = isset($this->aliases[$name]); - $name = $canBeResolved ? $this->aliases[$name] : $name; - } while ($canBeResolved); - - return $name; - } - - /** * Resolve all aliases to their canonical service names. */ private function resolveAliases(array $aliases) { foreach ($aliases as $alias => $service) { - $this->resolvedAliases[$alias] = $this->resolveAlias($alias); + $name = $alias; + + while (isset($this->aliases[$name])) { + $name = $this->aliases[$name]; + } + + $this->resolvedAliases[$alias] = $name; } }
Performance tweak: inlined `resolveAlias`
mxc-commons_mxc-servicemanager
train
php
00b0d24b51d37703fce3e738d85048ec04999ff1
diff --git a/fastods/src/main/java/com/github/jferard/fastods/TableRowImpl.java b/fastods/src/main/java/com/github/jferard/fastods/TableRowImpl.java index <HASH>..<HASH> 100644 --- a/fastods/src/main/java/com/github/jferard/fastods/TableRowImpl.java +++ b/fastods/src/main/java/com/github/jferard/fastods/TableRowImpl.java @@ -116,7 +116,7 @@ public class TableRowImpl implements TableRow { nullFieldCounter++; continue; } - this.appendRepeatedCell(util, appendable, nullFieldCounter); + this.insertBlankCells(util, appendable, nullFieldCounter); nullFieldCounter = 0; cell.appendXMLToTableRow(util, appendable); } @@ -137,8 +137,8 @@ public class TableRowImpl implements TableRow { appendable.append(">"); } - private void appendRepeatedCell(final XMLUtil util, final Appendable appendable, - final int nullFieldCounter) throws IOException { + private void insertBlankCells(final XMLUtil util, final Appendable appendable, + final int nullFieldCounter) throws IOException { if (nullFieldCounter <= 0) { return; }
Rename appendRepeatedCells to insertBlankCells (see #<I>)
jferard_fastods
train
java
189325508e996452a9da546a6fc55e5b4ecb5c90
diff --git a/lib/cli.js b/lib/cli.js index <HASH>..<HASH> 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -4,6 +4,7 @@ var fs = require('fs') , which = require('which') , parseArgs = require('minimist') , semver = require('semver') + , path = require('path') var PHANTOM_VERSION = "^1.9.0" @@ -110,7 +111,7 @@ cli.prototype.parse = function(argv, next) { this.errors.push(err) } } else { - options.css = fs.readFileSync(__dirname + '/../dist/mermaid.css') + options.css = fs.readFileSync(path.join(__dirname, '..', 'dist', 'mermaid.css')) } this.checkPhantom = createCheckPhantom(options.phantomPath)
Usage of path.join for adding styles as per suggestions from @fardog
knsv_mermaid
train
js
4a4a0d0890a0ea30d5a38982426fc381a0870d57
diff --git a/src/java/com/github/rjeschke/txtmark/HTML.java b/src/java/com/github/rjeschke/txtmark/HTML.java index <HASH>..<HASH> 100644 --- a/src/java/com/github/rjeschke/txtmark/HTML.java +++ b/src/java/com/github/rjeschke/txtmark/HTML.java @@ -114,7 +114,8 @@ class HTML HTMLElement.frame, HTMLElement.frameset, HTMLElement.iframe, - HTMLElement.script + HTMLElement.script, + HTMLElement.object, }; /** Character to entity encoding map. */
Added object to unsafe HTML elements.
rjeschke_txtmark
train
java
6362f74f088901e9a1fdc6e8c7a7df71dc5c3a42
diff --git a/spec/models/role_spec.rb b/spec/models/role_spec.rb index <HASH>..<HASH> 100644 --- a/spec/models/role_spec.rb +++ b/spec/models/role_spec.rb @@ -4,6 +4,7 @@ require "spec_helper" describe Releaf::Role do it { should serialize(:permissions).as(Array) } + it { should have_many(:admins).dependent(:restrict_with_exception) } describe 'validations' do it { should validate_presence_of(:name) }
Add test for Releaf::Role#admins associations
cubesystems_releaf
train
rb
0676b77dcbfb7939383d4aa57d4e73ddb50d3b75
diff --git a/widgets/Html/helpers/handleDOM.js b/widgets/Html/helpers/handleDOM.js index <HASH>..<HASH> 100644 --- a/widgets/Html/helpers/handleDOM.js +++ b/widgets/Html/helpers/handleDOM.js @@ -171,6 +171,6 @@ export const handleYouTube = (container) => { * Stops the player when a native app event is triggered when a webview gets hidden or when the * user navigated to some other page. */ - event.addCallback('openLink', () => { stopPlayer(youtubeIframes); }); + event.addCallback('routeDidChange', () => { stopPlayer(youtubeIframes); }); event.addCallback('viewDidDisappear', () => { stopPlayer(youtubeIframes); }); };
DTY-<I>: Youtube video plays in cart without reason - use routeDidChange event
shopgate_pwa
train
js
da58a09882bc7ce6eb7f18c4a4e4a434ef295cd4
diff --git a/code/javascript/core/scripts/selenium-testrunner.js b/code/javascript/core/scripts/selenium-testrunner.js index <HASH>..<HASH> 100644 --- a/code/javascript/core/scripts/selenium-testrunner.js +++ b/code/javascript/core/scripts/selenium-testrunner.js @@ -160,7 +160,7 @@ Object.extend(SeleniumFrame.prototype, { var styleLink = d.createElement("link"); styleLink.rel = "stylesheet"; styleLink.type = "text/css"; - styleLink.href = window.location.pathname.replace(/[^\/]+$/, "selenium-test.css"); + styleLink.href = window.location.pathname.replace(/[^\/\\]+$/, "selenium-test.css"); head.appendChild(styleLink); },
Look for the last slash or backslash; fixes broken css when running IE or HTA from c:" r<I>
SeleniumHQ_selenium
train
js
142bce45600b6bbd24b88d65710c99aac2b5f084
diff --git a/src/main/java/org/jboss/netty/handler/codec/replay/ReplayingDecoder.java b/src/main/java/org/jboss/netty/handler/codec/replay/ReplayingDecoder.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jboss/netty/handler/codec/replay/ReplayingDecoder.java +++ b/src/main/java/org/jboss/netty/handler/codec/replay/ReplayingDecoder.java @@ -324,7 +324,21 @@ public abstract class ReplayingDecoder<T extends Enum<T>> state = newState; return oldState; } - + + /** + * Returns the actual number of readable bytes in the cumulative buffer + * of this decoder. You do not need to rely on this value to write a + * decoder. Use it only when necessary. + */ + protected int actualReadableBytes() { + ChannelBuffer buf = cumulation.get(); + if (buf == null) { + return 0; + } + + return buf.readableBytes(); + } + /** * Decodes the received packets so far into a frame. *
Fixed issue: NETTY-<I> Subsitute ReplayingDecoder with FrameDecoder without losing stored buffer * Added ReplayingDecoder.actualReadableBytes()
netty_netty
train
java
7d1b1c545d7ed175be00ff89d7e36b946e1cb370
diff --git a/src/rinoh/style.py b/src/rinoh/style.py index <HASH>..<HASH> 100644 --- a/src/rinoh/style.py +++ b/src/rinoh/style.py @@ -476,6 +476,7 @@ class Styled(DocumentElement, metaclass=StyledMeta): self.style_class.__name__, style.__class__.__name__)) self.style = style + self.classes = [] def __eq__(self, other): return type(self) == type(other) and self.__dict__ == other.__dict__ @@ -582,11 +583,23 @@ class Styled(DocumentElement, metaclass=StyledMeta): else: return container.document.stylesheet.find_style(self, container) + @property + def has_class(self): + return HasClass(self) + def before_placing(self, container): if self.parent: self.parent.before_placing(container) +class HasClass(object): + def __init__(self, styled): + self.styled = styled + + def __eq__(self, class_name): + return class_name in self.styled.classes + + class InvalidStyledMatcher(Exception): """The :class:`StyledMatcher` includes selectors which reference selectors which are not defined."""
Provide Styled.has_class for use in selectors Styled.like(has_class='myclass') checks whether 'myclass' is one of the classes set for the styled. This can be used to style elements based on classes set on docutils elements.
brechtm_rinohtype
train
py
73f2a096ec011c40e0144660e410315312aa4cb0
diff --git a/lib/DataSift/User.php b/lib/DataSift/User.php index <HASH>..<HASH> 100644 --- a/lib/DataSift/User.php +++ b/lib/DataSift/User.php @@ -186,9 +186,9 @@ class DataSift_User * @throws DataSift_Exception_InvalidData * @see DataSift_StreamConsumer */ - public function getConsumer($type = DataSift_StreamConsumer::TYPE_HTTP, $hash, $onInteraction = false, $onStopped = false) + public function getConsumer($type = DataSift_StreamConsumer::TYPE_HTTP, $hash, $onInteraction = false, $onStopped = false, $onDeleted = false) { - return DataSift_StreamConsumer::factory($this, $type, new DataSift_Definition($this, false, $hash), $onInteraction, $onStopped); + return DataSift_StreamConsumer::factory($this, $type, new DataSift_Definition($this, false, $hash), $onInteraction, $onStopped, $onDeleted); } /**
Added onDeleted support for User::getConsumer.
datasift_datasift-php
train
php
0f2d5bfc5cc2557303bba25a0321c573e6d13fd4
diff --git a/lib/Alchemy/Phrasea/Core/Configuration.php b/lib/Alchemy/Phrasea/Core/Configuration.php index <HASH>..<HASH> 100644 --- a/lib/Alchemy/Phrasea/Core/Configuration.php +++ b/lib/Alchemy/Phrasea/Core/Configuration.php @@ -244,7 +244,15 @@ class Configuration public function initialize() { - return $this->specifications->initialize(); + $this->specifications->initialize(); + $this->setEnvironnement('prod'); + + return $this; + } + + public function delete() + { + return $this->specifications->delete(); } public function setConfigurations($configurations)
Add Configuration::delete method
alchemy-fr_Phraseanet
train
php
135cd3642558e0931060d6c8bff8e47386818a87
diff --git a/app/modules/mobilizations/blocks/reducers.js b/app/modules/mobilizations/blocks/reducers.js index <HASH>..<HASH> 100644 --- a/app/modules/mobilizations/blocks/reducers.js +++ b/app/modules/mobilizations/blocks/reducers.js @@ -97,7 +97,3 @@ export default function BlockReducers(state = initialState, action) { return state } } - -export function isBlocksLoaded(globalState) { - return globalState.blocks.loaded -} diff --git a/app/modules/mobilizations/blocks/selectors.js b/app/modules/mobilizations/blocks/selectors.js index <HASH>..<HASH> 100644 --- a/app/modules/mobilizations/blocks/selectors.js +++ b/app/modules/mobilizations/blocks/selectors.js @@ -1,3 +1,5 @@ export const getWidgets = ({ widgets, block }) => widgets.data.filter( widget => widget.block_id === block.id ) + +export const isLoaded = state => state.blocks.loaded
Move method that checks if blocks are loaded from reducers file to selectors #<I>
nossas_bonde-client
train
js,js
c74c8f21091d990f63a88d6cb747601d053a7f31
diff --git a/src/collectors/nginx/nginx.py b/src/collectors/nginx/nginx.py index <HASH>..<HASH> 100644 --- a/src/collectors/nginx/nginx.py +++ b/src/collectors/nginx/nginx.py @@ -35,7 +35,7 @@ For commercial nginx+: following content: <pre> server { - listen *:8080; + listen 127.0.0.1:8080; root /usr/share/nginx/html;
Change example nginx config to bind to loopback only
python-diamond_Diamond
train
py
581d0b4af65009cd4ffc10fde5d6303b8326bff2
diff --git a/lxc/storage_volume.go b/lxc/storage_volume.go index <HASH>..<HASH> 100644 --- a/lxc/storage_volume.go +++ b/lxc/storage_volume.go @@ -125,6 +125,9 @@ Unless specified through a prefix, all volume operations affect "custom" (user c storageVolumeUnsetCmd := cmdStorageVolumeUnset{global: c.global, storage: c.storage, storageVolume: c, storageVolumeSet: &storageVolumeSetCmd} cmd.AddCommand(storageVolumeUnsetCmd.Command()) + // Workaround for subcommand usage errors. See: https://github.com/spf13/cobra/issues/706 + cmd.Args = cobra.NoArgs + cmd.Run = func(cmd *cobra.Command, args []string) { cmd.Usage() } return cmd }
lxc/storage/volume: workaround for subcommand errors
lxc_lxd
train
go
739b3b789b16abcc84f82dd7344d7985c93f4cd5
diff --git a/publishable/lang/zh_CN/voyager.php b/publishable/lang/zh_CN/voyager.php index <HASH>..<HASH> 100644 --- a/publishable/lang/zh_CN/voyager.php +++ b/publishable/lang/zh_CN/voyager.php @@ -19,6 +19,9 @@ return [ 'auto_increment' => '自增', 'browse' => '浏览', 'builder' => '构建器', + 'bulk_delete' => '删除选中', + 'bulk_delete_confirm' => '是的, 删除这些', + 'bulk_delete_nothing' => '没有选择要删除的内容', 'cancel' => '取消', 'choose_type' => '选择类型', 'click_here' => '点击这里',
Add Chinese translation Add Chinese translation about bulk buttons
the-control-group_voyager
train
php
9148bac4d893d7304c018d299db69e3f27572ba2
diff --git a/src/Codeception/Module/REST.php b/src/Codeception/Module/REST.php index <HASH>..<HASH> 100644 --- a/src/Codeception/Module/REST.php +++ b/src/Codeception/Module/REST.php @@ -168,6 +168,28 @@ EOF; } /** + * Deletes the header with the passed name. Subsequent requests + * will not have the deleted header in its request. + * + * Example: + * ```php + * <?php + * $I->haveHttpHeader('X-Requested-With', 'Codeception'); + * $I->sendGET('test-headers.php'); + * // ... + * $I->deleteHeader('X-Requested-With'); + * $I->sendPOST('some-other-page.php'); + * ?> + * ``` + * + * @param string $name the name of the header to delete. + */ + public function deleteHeader($name) + { + $this->connectionModule->deleteHeader($name); + } + + /** * Checks over the given HTTP header and (optionally) * its value, asserting that are there *
Added missing deleteHeader method to REST module (#<I>) Fixes #<I>
Codeception_base
train
php
4a3bc4dd0139c8f84c45e4ecdf4ed93b13f69ced
diff --git a/server/src/main/java/io/atomix/copycat/server/state/AbstractAppender.java b/server/src/main/java/io/atomix/copycat/server/state/AbstractAppender.java index <HASH>..<HASH> 100644 --- a/server/src/main/java/io/atomix/copycat/server/state/AbstractAppender.java +++ b/server/src/main/java/io/atomix/copycat/server/state/AbstractAppender.java @@ -231,7 +231,7 @@ abstract class AbstractAppender implements AutoCloseable { .withIndex(member.getSnapshotIndex()) .withOffset(member.getSnapshotOffset()) .withData(buffer.flip()) - .withComplete(reader.hasRemaining()) + .withComplete(!reader.hasRemaining()) .build(); } }
Use SnapshotReader.hasRemaining() to determine whether bytes remain in the snapshot during replication.
atomix_copycat
train
java
35a9a703643c01d7eda90662c0ca094b0e33345e
diff --git a/src/__mocks__/mongooseCommon.js b/src/__mocks__/mongooseCommon.js index <HASH>..<HASH> 100644 --- a/src/__mocks__/mongooseCommon.js +++ b/src/__mocks__/mongooseCommon.js @@ -14,7 +14,7 @@ mongoose.connect = async () => { const mongoUri = await mongoServer.getConnectionString(); - originalConnect.bind(mongoose)(mongoUri); + originalConnect.bind(mongoose)(mongoUri, { useMongoClient: true }); mongoose.connection.on('error', e => { if (e.message.code === 'ETIMEDOUT') {
test: Fix deprecation warning with mongoose `open()` method
graphql-compose_graphql-compose-mongoose
train
js
6e8c604300cb083e355422041675df42aaf1e508
diff --git a/go/vt/vttablet/tabletserver/tabletserver.go b/go/vt/vttablet/tabletserver/tabletserver.go index <HASH>..<HASH> 100644 --- a/go/vt/vttablet/tabletserver/tabletserver.go +++ b/go/vt/vttablet/tabletserver/tabletserver.go @@ -247,8 +247,8 @@ func NewTabletServer(config tabletenv.TabletConfig, topoServer *topo.Server, ali }) stats.Publish("TabletStateName", stats.StringFunc(tsv.GetState)) - // This is the same information as the above two stats, but exported with TabletStateName as a label for Prometheus - // which doesn't support exporting strings as stat values. + // TabletServerState exports the same information as the above two stats (TabletState / TabletStateName), + // but exported with TabletStateName as a label for Prometheus, which doesn't support exporting strings as stat values. stats.NewGaugesFuncWithMultiLabels("TabletServerState", "Tablet server state labeled by state name", []string{"name"}, func() map[string]int64 { tsv.mu.Lock() state := tsv.state
Update comment to adhere to style guide.
vitessio_vitess
train
go
2ac5e6207bf6032c60cf599c1a05bcbf77351341
diff --git a/code/libraries/koowa/components/com_koowa/database/behavior/sluggable.php b/code/libraries/koowa/components/com_koowa/database/behavior/sluggable.php index <HASH>..<HASH> 100644 --- a/code/libraries/koowa/components/com_koowa/database/behavior/sluggable.php +++ b/code/libraries/koowa/components/com_koowa/database/behavior/sluggable.php @@ -52,10 +52,10 @@ class ComKoowaDatabaseBehaviorSluggable extends KDatabaseBehaviorSluggable */ protected function _canonicalizeSlug() { - parent::_canonicalizeSlug(); - if (trim(str_replace($this->_separator, '', $this->slug)) == '') { - $this->slug = JFactory::getDate()->format('Y-m-d-H-i-s'); + $this->slug = JFactory::getDate()->format('Y-m-d-H-i-s'); } + + parent::_canonicalizeSlug(); } }
re #<I>: Slugs were not always made unique
joomlatools_joomlatools-framework
train
php
33a39666bafb65d77765fdc8b044849afa078bc1
diff --git a/src/i18n/Data/Intl/IntlLocales.php b/src/i18n/Data/Intl/IntlLocales.php index <HASH>..<HASH> 100644 --- a/src/i18n/Data/Intl/IntlLocales.php +++ b/src/i18n/Data/Intl/IntlLocales.php @@ -793,7 +793,7 @@ class IntlLocales implements Locales, Resettable 'pl' => 'pl_PL', 'pon' => 'pon_FM', 'ps' => 'ps_AF', - 'pt' => 'pt_BR', + 'pt' => 'pt_PT', 'qu' => 'qu_PE', 'rm' => 'rm_CH', 'rn' => 'rn_BI',
ENHANCEMENT Promote portugese (portugal) as primary locale Fixes #<I>
silverstripe_silverstripe-framework
train
php
f2727eab5f4de2c1719e2aef6ae0dd336a76dd32
diff --git a/app/models/system.rb b/app/models/system.rb index <HASH>..<HASH> 100644 --- a/app/models/system.rb +++ b/app/models/system.rb @@ -85,17 +85,17 @@ class System < ActiveRecord::Base def readable? User.allowed_to?([:read_systems, :update_systems, :delete_systems], :organizations, nil, self.organization) || - User.allowed_to?([:read_systems, :update_systems, :delete_systems], :environment, self.environment.id, self.organization) + User.allowed_to?([:read_systems, :update_systems, :delete_systems], :environments, self.environment.id, self.organization) end def editable? User.allowed_to?(*[[:read_systems], :organizations, nil, self.organization.id]) || - User.allowed_to?(*[[:read_systems], :environment, self.environment.id, self.organization]) + User.allowed_to?(*[[:read_systems], :environments, self.environment.id, self.organization]) end def deletable? User.allowed_to?(*[[:delete_systems], :organizations, nil, self.organization.id]) || - User.allowed_to?(*[[:delete_systems], :environment, self.environment.id, self.organization]) + User.allowed_to?(*[[:delete_systems], :environments, self.environment.id, self.organization]) end
Bug fix - resource should be in plural when checking permissions
Katello_katello
train
rb
25a6d6b3bfe2aeeba8ffddbd97971c8f576b7f08
diff --git a/scrape/scrape.py b/scrape/scrape.py index <HASH>..<HASH> 100755 --- a/scrape/scrape.py +++ b/scrape/scrape.py @@ -67,6 +67,7 @@ BASEDIR = "awacs" IGNORED_SERVICE_ALIASES = { "Amazon Kinesis Analytics V2": "kinesisanalytics", "Amazon Pinpoint Email Service": "ses", + "AWS IoT Greengrass V2": "greengrass", "AWS Marketplace Catalog": "aws-marketplace", "AWS Marketplace Entitlement Service": "aws-marketplace", "AWS Marketplace Image Building Service": "aws-marketplace", @@ -143,7 +144,7 @@ async def collect_existing_actions() -> Dict[str, Set[str]]: async def collect_service_info() -> List[httpx.Response]: - max_connections = 5 + max_connections = 2 async with httpx.AsyncClient( http2=True, limits=httpx.Limits(max_connections=max_connections),
Fix scrape script breakage - Map "AWS IoT Greengrass V2" to "greengrass" - Reduce max connections to prevent server busy captcha prompt
cloudtools_awacs
train
py
6eb5f35a685ca28883da763df57c4143e0c77504
diff --git a/penaltymodel_mip/tests/test_generation.py b/penaltymodel_mip/tests/test_generation.py index <HASH>..<HASH> 100644 --- a/penaltymodel_mip/tests/test_generation.py +++ b/penaltymodel_mip/tests/test_generation.py @@ -345,11 +345,10 @@ class TestGeneration(unittest.TestCase): nodes = ['a', 'b'] graph = nx.complete_graph(nodes + ['aux0']) configurations = {(+1, +1): -3, - (+1, -1): -6, - (-1, +1): 0, - (-1, -1): -1} + (+1, -1): -3, + (-1, -1): -3} - bqm, gap = mip.generate_bqm(graph, configurations, nodes) + bqm, gap = mip.generate_bqm(graph, configurations, nodes, min_classical_gap=0) self.check_bqm_graph(bqm, graph) def test_silly(self):
Test seems to show that using auxiliary works when all configs have the same energy states and that not all possible configs are shown
dwavesystems_penaltymodel
train
py
eb0243223aa816de76cde6185e93da6469236658
diff --git a/aws/request/retryer.go b/aws/request/retryer.go index <HASH>..<HASH> 100644 --- a/aws/request/retryer.go +++ b/aws/request/retryer.go @@ -38,6 +38,7 @@ var throttleCodes = map[string]struct{}{ "RequestThrottled": {}, "LimitExceededException": {}, // Deleting 10+ DynamoDb tables at once "TooManyRequestsException": {}, // Lambda functions + "PriorRequestNotComplete": {}, // Route53 } // credsExpiredCodes is a collection of error codes which signify the credentials
Add PriorRequestNotComplete to throttle codes so it can be retried automatically (#<I>) Fix #<I>
aws_aws-sdk-go
train
go
be710e31bd5c5137ad2d6c81cfbd25a520318a33
diff --git a/gos/tasks.py b/gos/tasks.py index <HASH>..<HASH> 100644 --- a/gos/tasks.py +++ b/gos/tasks.py @@ -44,4 +44,6 @@ class TaskLoader(object): def load_tasks_from_dir(self, dir_path): if not os.path.exists(dir_path): - raise GOSTaskException + raise GOSTaskException() + if os.path.isfile(dir_path): + raise GOSTaskException() diff --git a/tests/test_tasks.py b/tests/test_tasks.py index <HASH>..<HASH> 100644 --- a/tests/test_tasks.py +++ b/tests/test_tasks.py @@ -111,6 +111,10 @@ class TaskLoaderTestCase(unittest.TestCase): with self.assertRaises(GOSTaskException): TaskLoader().load_tasks_from_dir(non_existing_dir) + def test_load_from_dir_file_supplied(self): + tmp_file = tempfile.NamedTemporaryFile(mode="wt") + with self.assertRaises(GOSTaskException): + TaskLoader().load_tasks_from_dir(tmp_file.name) if __name__ == '__main__': unittest.main()
GOS-<I> dir loading logic prohibits to load from file path
aganezov_gos
train
py,py
2bddaa3cf3e629bce02117c92787bd3b186a5627
diff --git a/src/VCard.php b/src/VCard.php index <HASH>..<HASH> 100644 --- a/src/VCard.php +++ b/src/VCard.php @@ -480,6 +480,9 @@ class VCard // decode value + lowercase the string $value = strtolower($this->decode($value)); + // urlize this part + $value = Transliterator::urlize($value); + // overwrite filename or add to filename using a prefix in between $this->filename = ($overwrite) ? $value : $this->filename . $separator . $value;
SetFilename: use Transliterator
jeroendesloovere_vcard
train
php
c2cbf114dcee670b2d416ec6428a66730a821c47
diff --git a/sos/plugins/openshift.py b/sos/plugins/openshift.py index <HASH>..<HASH> 100644 --- a/sos/plugins/openshift.py +++ b/sos/plugins/openshift.py @@ -138,14 +138,14 @@ class Openshift(Plugin, RedHatPlugin): plugin_dir = '/etc/openshift/plugins.d/' self.do_file_sub(plugin_dir + 'openshift-origin-dns-dynect.conf', r"(DYNECT_PASSWORD\s*=\s*)(.*)", - r"********") + r"\1********") # Fog cloud: FOG_RACKSPACE_API_KEY="apikey" self.do_file_sub(plugin_dir + 'openshift-origin-dns-fog.conf', r"(FOG_RACKSPACE_API_KEY\s*=\s*)(.*)", - r"********") + r"\1********") # ISC bind: BIND_KEYVALUE="rndc key" self.do_file_sub(plugin_dir + 'openshift-origin-dns-nsupdate.conf', r"(BIND_KEYVALUE\s*=\s*)(.*)", - r"********") + r"\1********") # vim: et ts=4 sw=4
[openshift] Obfuscate only DNS plugin credential values Obfuscate only the value, not the entire directive and value pair.
sosreport_sos
train
py
84941ec3dc53857115d3f266dd6f31b6f589ac5f
diff --git a/lib/nack/server.rb b/lib/nack/server.rb index <HASH>..<HASH> 100644 --- a/lib/nack/server.rb +++ b/lib/nack/server.rb @@ -91,6 +91,7 @@ module Nack if ppid != Process.ppid debug "Process is orphaned" + return end next unless readable
Break from event loop if process is orphaned
josh_nack
train
rb
34d9a7a3c129daffbff0306406d677c95f5a33c6
diff --git a/direct.go b/direct.go index <HASH>..<HASH> 100644 --- a/direct.go +++ b/direct.go @@ -390,7 +390,8 @@ func (db *RedisDB) Unlink(k string) bool { // TTL is the left over time to live. As set via EXPIRE, PEXPIRE, EXPIREAT, // PEXPIREAT. -// 0 if not set. +// Note: this direct function returns 0 if there is no TTL set, unlike redis, +// which returns -1. func (m *Miniredis) TTL(k string) time.Duration { return m.DB(m.selectedDB).TTL(k) }
update a comment There was an issue with confusion about this a while ago.
alicebob_miniredis
train
go
f8e317a7dd9cfdc68cd78bdcbd196bf83b22ef2b
diff --git a/libraries/lithium/net/socket/Curl.php b/libraries/lithium/net/socket/Curl.php index <HASH>..<HASH> 100644 --- a/libraries/lithium/net/socket/Curl.php +++ b/libraries/lithium/net/socket/Curl.php @@ -34,6 +34,11 @@ class Curl extends \lithium\net\Socket { */ public $options = array(); + public function __construct(array $config = array()) { + $defaults = array('ignoreExpect' => true); + parent::__construct($config + $defaults); + } + /** * Opens a curl connection and initializes the internal resource handle. * @@ -182,6 +187,9 @@ class Curl extends \lithium\net\Socket { $options += $defaults; $this->set(CURLOPT_URL, $message->to('url')); + if ($this->_config['ignoreExpect']) { + $message->headers('Expect', ' '); + } if (isset($message->headers)) { $this->set(CURLOPT_HTTPHEADER, $message->headers()); }
Adding flag to `Curl` socket adapter to fix requests which return with HTTP <I> Continue.
UnionOfRAD_framework
train
php
de8fa4807f375da92fa6899ed603c7aa06eefcef
diff --git a/lib/Reporter.js b/lib/Reporter.js index <HASH>..<HASH> 100644 --- a/lib/Reporter.js +++ b/lib/Reporter.js @@ -65,10 +65,7 @@ Reporter.prototype._end = function(data){ Reporter.prototype.clearLine = function() { if (!this._lastLine) return; - var spaces = ' '; - for(i in this._lastLine.length){ - spaces += ' '; - } + var spaces = str.repeat(' ', this._lastLine.length); process.stdout.write('\r' + spaces + '\r'); }; diff --git a/test/unit/testReporter.js b/test/unit/testReporter.js index <HASH>..<HASH> 100644 --- a/test/unit/testReporter.js +++ b/test/unit/testReporter.js @@ -13,5 +13,5 @@ var assert = require('assert'); reporter._progress = 5; var progress = reporter.getProgress(); - assert('5/10 50%', progress) + assert.equal('5/10 50.0%', progress) })(); \ No newline at end of file
Fixed test and used repeater for clear line
holidayextras_node-antr
train
js,js
5fc0e5be003cfa3679911747768e7126fda03f81
diff --git a/angr/manager.py b/angr/manager.py index <HASH>..<HASH> 100644 --- a/angr/manager.py +++ b/angr/manager.py @@ -600,7 +600,7 @@ class SimulationManager(ana.Storable): pg.stashes[stash] = new_active i = 0 - while n is not None and i < n: + while n is None or i < n: i += 1 l.debug("Round %d: stepping %s", i, pg)
Re-fix condition... closes #<I>
angr_angr
train
py
a5e427cae10c1e0c4721d7523e7c666839fd6fbf
diff --git a/h2o-core/src/test/java/water/rapids/RapidsTest.java b/h2o-core/src/test/java/water/rapids/RapidsTest.java index <HASH>..<HASH> 100644 --- a/h2o-core/src/test/java/water/rapids/RapidsTest.java +++ b/h2o-core/src/test/java/water/rapids/RapidsTest.java @@ -272,7 +272,7 @@ public class RapidsTest extends TestUtil { r = new Frame(r); DKV.put(r); System.out.println(r); - String x = String.format("(merge %s %s #1 #0 )",l._key,r._key); + String x = String.format("(merge %s %s #1 #0 [] [] \"auto\")",l._key,r._key); Val res = Exec.exec(x); f = res.getFrame(); System.out.println(f);
Another rapids merge addition of new arguments with Eric
h2oai_h2o-3
train
java
303f8ee853fb4588e21fd6009cae45386bb22089
diff --git a/src/Config_Command.php b/src/Config_Command.php index <HASH>..<HASH> 100644 --- a/src/Config_Command.php +++ b/src/Config_Command.php @@ -217,8 +217,9 @@ class Config_Command extends WP_CLI_Command { * +------------------+------------------------------------------------------------------+----------+ * * @when before_wp_load + * @subcommand list */ - public function list( $_, $assoc_args ) { + public function list_( $_, $assoc_args ) { $path = Utils\locate_wp_config(); if ( ! $path ) { WP_CLI::error( "'wp-config.php' not found." );
Rename method list, as it is a reserved keyword
wp-cli_config-command
train
php
23085eb5ae29b3affe396ab75a84bc8c5c49db99
diff --git a/internal/upgrade/upgrade_supported.go b/internal/upgrade/upgrade_supported.go index <HASH>..<HASH> 100644 --- a/internal/upgrade/upgrade_supported.go +++ b/internal/upgrade/upgrade_supported.go @@ -120,9 +120,6 @@ func readTarGZ(url string, dir string) (string, error) { } tr := tar.NewReader(gr) - if err != nil { - return "", err - } // Iterate through the files in the archive. for { @@ -143,14 +140,25 @@ func readTarGZ(url string, dir string) (string, error) { if err != nil { return "", err } - io.Copy(of, tr) + + _, err = io.Copy(of, tr) + if err != nil { + os.Remove(of.Name()) + return "", err + } + err = of.Close() if err != nil { os.Remove(of.Name()) return "", err } - os.Chmod(of.Name(), os.FileMode(hdr.Mode)) + err = os.Chmod(of.Name(), os.FileMode(hdr.Mode)) + if err != nil { + os.Remove(of.Name()) + return "", err + } + return of.Name(), nil } }
Must verify success of from-network copy during upgrade (ref #<I>)
syncthing_syncthing
train
go
eeb3c29fab8f7f18d198cbcfbee1ff63f6a9a3ca
diff --git a/src/Symfony/Component/Workflow/Event/GuardEvent.php b/src/Symfony/Component/Workflow/Event/GuardEvent.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Workflow/Event/GuardEvent.php +++ b/src/Symfony/Component/Workflow/Event/GuardEvent.php @@ -27,7 +27,7 @@ class GuardEvent extends Event /** * {@inheritdoc} */ - public function __construct($subject, Marking $marking, Transition $transition, $workflowName = 'unnamed') + public function __construct($subject, Marking $marking, Transition $transition, $workflowName = null) { parent::__construct($subject, $marking, $transition, $workflowName);
Remove deprecated usage null is also deprecated but must be conserved for BC purpose. Also it will will not let the develop think string is ok.
symfony_symfony
train
php
60b49f166f8ca0d2c084b5d86b0d44900b388004
diff --git a/test/test_filter.py b/test/test_filter.py index <HASH>..<HASH> 100644 --- a/test/test_filter.py +++ b/test/test_filter.py @@ -420,23 +420,6 @@ class FakeDbConnection(object): self.open = False -class FakeTaxonomyFilter(object): - """ - A class which fakes results from TaxonomyFilter. - """ - def __init__(self, gi, taxonomy): - self._gi = gi - self._taxonomy = taxonomy - self._lineage = ['Merkel cell polyomavirus', 'Polyomavirus', - 'dsDNA viruses', 'Vira'] - - def getRightResult(): - pass - - def getWrongResult(): - pass - - class TaxonomyFilterTest(TestCase): """ Tests for L{dark.filter.TaxonomyFilter} class.
removed unused test classes from test_filter.py
acorg_dark-matter
train
py
eecfe5739b22920a0c5a7e75b0ecf689f57e0c7c
diff --git a/soap-node.js b/soap-node.js index <HASH>..<HASH> 100644 --- a/soap-node.js +++ b/soap-node.js @@ -15,9 +15,9 @@ module.exports = function (RED) { node.on('input', function (msg) { var server = (msg.server)?{wsdl:msg.server, auth:0}:node.server; var lastFiveChar = server.wsdl.substr(server.wsdl.length-5); - if(lastFiveChar !== '?wsdl'){ + if(server.wsdl.indexOf("://")>0 && lastFiveChar !== '?wsdl'){ server.wsdl += '?wsdl'; - }; + } soap.createClient(server.wsdl, msg.options||{}, function (err, client) { if (err) { node.status({fill: "red", shape: "dot", text: "WSDL Config Error: " + err}); @@ -65,4 +65,4 @@ module.exports = function (RED) { } } RED.nodes.registerType("soap request", SoapCall); -}; \ No newline at end of file +};
do not suffix url with ?wsdl for local filesystem
chameleonbr_node-red-contrib-soap
train
js
c06204b68a06718ee7ab569b34ecc7b3611eb815
diff --git a/chacha20_test.go b/chacha20_test.go index <HASH>..<HASH> 100644 --- a/chacha20_test.go +++ b/chacha20_test.go @@ -5,8 +5,12 @@ import ( "encoding/hex" "fmt" "testing" + "crypto/cipher" ) +// assert that a pointer to Cipher actually meets the cipher.Stream interface +var _ cipher.Stream = &Cipher{} + // stolen from http://tools.ietf.org/html/draft-agl-tls-chacha20poly1305-00#section-7 var testVectors = [][]string{ []string{
Lock down the commitment to cipher.Stream.
codahale_chacha20
train
go
0d19396980034a08f1cb60e767e04a6074288679
diff --git a/pycronofy/request_handler.py b/pycronofy/request_handler.py index <HASH>..<HASH> 100644 --- a/pycronofy/request_handler.py +++ b/pycronofy/request_handler.py @@ -1,5 +1,6 @@ import requests import pycronofy +from pycronofy import settings from pycronofy.exceptions import PyCronofyRequestError class RequestHandler(object): @@ -60,10 +61,10 @@ class RequestHandler(object): if not params: params = {} if endpoint and not url: - url = '%s/%s/%s' % (pycronofy.settings.API_BASE_URL, pycronofy.settings.API_VERSION, endpoint) + url = '%s/%s/%s' % (settings.API_BASE_URL, settings.API_VERSION, endpoint) response = requests.__getattribute__(request_method)( url=url, - hooks=pycronofy.settings.REQUEST_HOOK, + hooks=settings.REQUEST_HOOK, headers={ 'Authorization': self.auth.get_authorization(), 'User-Agent': self.user_agent,
Import settings separately from pycronofy.
cronofy_pycronofy
train
py
dc3cd60e092d2d72e74fb05806f7a8b68ab69b0c
diff --git a/src/NamelessCoder/Gizzle/Payload.php b/src/NamelessCoder/Gizzle/Payload.php index <HASH>..<HASH> 100644 --- a/src/NamelessCoder/Gizzle/Payload.php +++ b/src/NamelessCoder/Gizzle/Payload.php @@ -219,7 +219,7 @@ class Payload extends JsonDataMapper { $base = '/' . implode('/', $segments) . '/' . $segment . '/'; $expectedFile = $base . $this->settingsFile; $expectedFile = FALSE === file_exists($expectedFile) ? $base . 'Settings.yml' : $expectedFile; - $file = TRUE === file_exists($file) ? $file : NULL; + $file = TRUE === file_exists($expectedFile) ? $expectedFile : NULL; } return (array) (TRUE === file_exists($file) ? Yaml::parse($file) : array()); }
[BUGFIX] Incorrect resolving of expected settings file
NamelessCoder_gizzle
train
php
41346c1b4b39a601b1a4e7498526a3f346c5c2ee
diff --git a/lib/timber-image-helper.php b/lib/timber-image-helper.php index <HASH>..<HASH> 100644 --- a/lib/timber-image-helper.php +++ b/lib/timber-image-helper.php @@ -19,7 +19,6 @@ class TimberImageHelper { const BASE_CONTENT = 2; public static function init() { - //self::load_dependencies(); self::add_constants(); self::add_actions(); self::add_filters(); @@ -109,19 +108,6 @@ class TimberImageHelper { } } - - /** - * load the dependencies of TimberImageOperations - * @return void - */ - static function load_dependencies() { - require_once('image/timber-image-operation.php'); - require_once('image/timber-image-operation-pngtojpg.php'); - require_once('image/timber-image-operation-retina.php'); - require_once('image/timber-image-operation-letterbox.php'); - require_once('image/timber-image-operation-resize.php'); - } - /** * adds a 'relative' key to wp_upload_dir() result. * It will contain the relative url to upload dir. @@ -134,7 +120,7 @@ class TimberImageHelper { } ); } -//-- end of public methots --// +//-- end of public methods --//
Don't manually load TimberImageHelper dependencies
timber_timber
train
php
cd484e4d9d78d2545ed6de3487d3b50b84373134
diff --git a/controller/src/main/java/org/jboss/as/controller/AbstractOperationContext.java b/controller/src/main/java/org/jboss/as/controller/AbstractOperationContext.java index <HASH>..<HASH> 100644 --- a/controller/src/main/java/org/jboss/as/controller/AbstractOperationContext.java +++ b/controller/src/main/java/org/jboss/as/controller/AbstractOperationContext.java @@ -1364,8 +1364,10 @@ abstract class AbstractOperationContext implements OperationContext { } } } catch (Exception e) { - report(MessageSeverity.ERROR, - ControllerLogger.ROOT_LOGGER.stepHandlerFailedRollback(handler, operation.asString(), address, e)); + final String failedRollbackMessage = + MGMT_OP_LOGGER.stepHandlerFailedRollback(handler, operation.asString(), address, e); + MGMT_OP_LOGGER.errorf(e, failedRollbackMessage); + report(MessageSeverity.ERROR, failedRollbackMessage); } }
[WFCORE-<I>] Wildfly does not log stack trace of an exception
wildfly_wildfly-core
train
java
a3bb3af6c952f3fcb04b886605ef473a1f038dda
diff --git a/app/models/xmlrpc/moveable_type_api.rb b/app/models/xmlrpc/moveable_type_api.rb index <HASH>..<HASH> 100644 --- a/app/models/xmlrpc/moveable_type_api.rb +++ b/app/models/xmlrpc/moveable_type_api.rb @@ -83,15 +83,13 @@ class MoveableTypeApi tb end - # I'm not sure if anything even needs to be done here - # since we're not generating static html. - # Maybe we could empty the cache to regenerate the article? def publishPost(postid, username, password) raise "Invalid login" unless valid_login?(username, password) - true + article = Article.find(postid) + article.published = 1 + article.save end - private def valid_login?(user,pass)
added support for publishPost MT api call. This will fix issues with w.blogar. closing #<I>. (Vince Hodges) git-svn-id: <URL>
publify_publify
train
rb
e4db018b6d2708ecd08697cfb1c6bc39502423d1
diff --git a/src/Symfony/Component/Lock/Store/RedisStore.php b/src/Symfony/Component/Lock/Store/RedisStore.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Lock/Store/RedisStore.php +++ b/src/Symfony/Component/Lock/Store/RedisStore.php @@ -130,8 +130,11 @@ class RedisStore implements StoreInterface return $this->redis->_instance($this->redis->_target($resource))->eval($script, array_merge(array($resource), $args), 1); } - // Have to be a \Predis\Client - return call_user_func_array(array($this->redis, 'eval'), array_merge(array($script, 1, $resource), $args)); + if ($this->redis instanceof \Predis\Client) { + return call_user_func_array(array($this->redis, 'eval'), array_merge(array($script, 1, $resource), $args)); + } + + throw new InvalidArgumentException(sprintf('%s() expects been initialized with a Redis, RedisArray, RedisCluster or Predis\Client, %s given', __METHOD__, is_object($this->redis) ? get_class($this->redis) : gettype($this->redis))); } /**
Don't call blindly the redis client
symfony_symfony
train
php
eea6a6aea7f34e4dad3177f153370adf3d31268a
diff --git a/threetaps/__init__.py b/threetaps/__init__.py index <HASH>..<HASH> 100644 --- a/threetaps/__init__.py +++ b/threetaps/__init__.py @@ -15,8 +15,7 @@ Basic usage: """ __title__ = 'threetaps' -__version__ = '0.0.1' -__build__ = 0x000001 +__version__ = '0.1dev' __author__ = 'Michael Kolodny' __license__ = 'MIT' __copyright__ = 'Copyright 2013 Michael Kolodny'
change version to <I>dev
mkolodny_3taps
train
py
bc143ca0857ea4df089a504fffbf99b4620043fe
diff --git a/anyconfig/compat.py b/anyconfig/compat.py index <HASH>..<HASH> 100644 --- a/anyconfig/compat.py +++ b/anyconfig/compat.py @@ -89,7 +89,7 @@ if IS_PYTHON_3: STR_TYPES = (str, ) else: import ConfigParser as configparser # flake8: noqa - from UserDict import UserDict # flake8: noqa + from UserDict import UserDict # flake8: noqa try: from cStringIO import StringIO # flake8: noqa except ImportError:
fix: ensure enough spaces before inline comment
ssato_python-anyconfig
train
py
14cd20fc988d73a48e262cbb8c6b1cab69ce1e29
diff --git a/jsonapi/fixtures_test.go b/jsonapi/fixtures_test.go index <HASH>..<HASH> 100644 --- a/jsonapi/fixtures_test.go +++ b/jsonapi/fixtures_test.go @@ -356,12 +356,12 @@ func (s *SQLNullPost) SetID(ID string) error { } type RenamedPostWithEmbedding struct { + Embedded SQLNullPost ID string `jsonapi:"-"` Another string `jsonapi:"name=another"` Field string `jsonapi:"name=foo"` Other string `jsonapi:"name=bar-bar"` Ignored string `jsonapi:"-"` - Embedded SQLNullPost } func (p *RenamedPostWithEmbedding) SetID(ID string) error { diff --git a/jsonapi/unmarshal.go b/jsonapi/unmarshal.go index <HASH>..<HASH> 100644 --- a/jsonapi/unmarshal.go +++ b/jsonapi/unmarshal.go @@ -320,7 +320,9 @@ func getFieldByTagName(val reflect.Value, fieldName string) (field reflect.Value _, isEmbedded := val.Field(x).Addr().Interface().(UnmarshalIdentifier) if isEmbedded { field, found = getFieldByTagName(val.Field(x), fieldName) - return + if found { + return + } } }
fix too early return when unmarshal embedded structs the search needs to go on if the field from the json was not found in the embedded struct and there are other fields. Now there is a check for that.
manyminds_api2go
train
go,go
f83de9c4c8182a77d2e7daea074f5b6fa73f3dc3
diff --git a/tests/Form/SelectTest.php b/tests/Form/SelectTest.php index <HASH>..<HASH> 100644 --- a/tests/Form/SelectTest.php +++ b/tests/Form/SelectTest.php @@ -54,7 +54,7 @@ OUT; } /** - * @dataProvider testElementSelectedStateCheckDataProvider + * @dataProvider elementSelectedStateCheckDataProvider */ public function testElementSelectedStateCheck($selectName, $optionValue, $optionText) { @@ -70,7 +70,7 @@ OUT; $this->assertTrue($option->isSelected()); } - public function testElementSelectedStateCheckDataProvider() + public function elementSelectedStateCheckDataProvider() { return array( array('select_number', '30', 'thirty'),
Corrected data provider name Having data provider methods starting with "test" will make PHPUnit consider them as tests. This has the following effects: - method is called more then once, depending on the code it might cause issues - PHPUnit in strict mode will complain that the data provider method does not do any assertions
minkphp_driver-testsuite
train
php
41ff0de382235bb28c85ca049a530d7b0f70d565
diff --git a/lib/session.js b/lib/session.js index <HASH>..<HASH> 100644 --- a/lib/session.js +++ b/lib/session.js @@ -484,8 +484,8 @@ Link.prototype.flowReceived = function(flowFrame) { if (flowFrame.handle !== null) { this.available = flowFrame.available; this.deliveryCount = flowFrame.deliveryCount; - this.linkCredit = flowFrame.linkCredit - this.totalCredits; - this.totalCredits = flowFrame.linkCredit; + this.linkCredit = flowFrame.linkCredit; + this.totalCredits += flowFrame.linkCredit; debug('Adding Credits ('+this.linkCredit+','+this.session._sessionParams.remoteIncomingWindow+')'); } this.emit(Link.CreditChange, this);
Fix credit for sending messages. EventHub seems to believe different things for sending and receiving link-credit, will follow up.
noodlefrenzy_node-amqp10
train
js
cf421ea8a72fb03303717198f08434b2d3ddce14
diff --git a/lib/add.js b/lib/add.js index <HASH>..<HASH> 100644 --- a/lib/add.js +++ b/lib/add.js @@ -12,8 +12,6 @@ exports.run = function(config, info) { var user = jsonfile.readFileSync(config.apiFile); - console.log(user.token, config.host.url + '/add'); - request.post(config.host.url + '/add', { 'form': { 'user': user.token,
Don't print out stuff on add
readmeio_oas
train
js
92ed69c785aebd54ecdf3e2553a6edc26d5e5878
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,13 @@ from distutils.core import setup setup( - name = 'usonic', - packages = ['usonic'], - version = '0.0.1', - description = 'An ultrasonic distance measurement module using HC-SR04', - author = 'Macpaul Lin', - author_email = 'macpaul@gmail.com', - url = 'https://github.com/macpaul/usonic', - download_url = 'https://github.com/macpaul/usonic/tarball/0.0.1', - keywords = ['ultrasonic', 'raspberry', 'distance'], - classifiers = [], + name = 'usonic', + packages = ['usonic'], + version = '0.0.1', + description = 'An ultrasonic distance measurement module using HC-SR04', + author = 'Macpaul Lin', + author_email = 'macpaul@gmail.com', + url = 'https://github.com/macpaul/usonic', + download_url = 'https://github.com/macpaul/usonic/tarball/0.0.1', + keywords = ['ultrasonic', 'raspberry', 'distance'], + classifiers = [], )
setup.py: fix coding style Replace tab by 4 spaces.
macpaul_usonic
train
py
351f54e5b69b7fd04a521b3fa4298a4d6a9ccfac
diff --git a/src/python_bayeux/__init__.py b/src/python_bayeux/__init__.py index <HASH>..<HASH> 100644 --- a/src/python_bayeux/__init__.py +++ b/src/python_bayeux/__init__.py @@ -252,9 +252,10 @@ class BayeuxClient(object): if channel not in self.subscription_callbacks: self.subscription_callbacks[channel] = [] + self.subscription_queue.put(subscription_queue_message) + self.subscription_callbacks[channel].append(callback) - self.subscription_queue.put(subscription_queue_message) def _subscribe_greenlet(self): channel = None
Duh, only subscribe once even if we register more callbacks
SalesforceFoundation_python-bayeux
train
py
ca5ae321e75c37820ab6929412ba3f32abe99c98
diff --git a/src/Smalot/Magento/Customer/CustomerGroup.php b/src/Smalot/Magento/Customer/CustomerGroup.php index <HASH>..<HASH> 100644 --- a/src/Smalot/Magento/Customer/CustomerGroup.php +++ b/src/Smalot/Magento/Customer/CustomerGroup.php @@ -33,6 +33,6 @@ class CustomerGroup extends MagentoModuleAbstract */ public function getGroupList() { - return $this->__createAction('customer_group.ist', func_get_args()); + return $this->__createAction('customer_group.list', func_get_args()); } }
fix typo in getGroupList fix typo in getGroupList
smalot_magento-client
train
php
d2740f0e776c2ce7dc03172f091ab13d7351cba5
diff --git a/lib/Doctrine/ORM/Query/Lexer.php b/lib/Doctrine/ORM/Query/Lexer.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ORM/Query/Lexer.php +++ b/lib/Doctrine/ORM/Query/Lexer.php @@ -152,12 +152,15 @@ class Lexer extends \Doctrine\Common\Lexer return self::T_STRING; } else if (ctype_alpha($value[0]) || $value[0] === '_') { $name = 'Doctrine\ORM\Query\Lexer::T_' . strtoupper($value); + if (defined($name)) { $type = constant($name); + if ($type > 100) { return $type; } } + return self::T_IDENTIFIER; } else if ($value[0] === '?' || $value[0] === ':') { return self::T_INPUT_PARAMETER; @@ -172,7 +175,7 @@ class Lexer extends \Doctrine\Common\Lexer case '<': return self::T_LOWER_THAN; case '+': return self::T_PLUS; case '-': return self::T_MINUS; - case '*': return self::Ts_MULTIPLY; + case '*': return self::T_MULTIPLY; case '/': return self::T_DIVIDE; case '!': return self::T_NEGATE; case '{': return self::T_OPEN_CURLY_BRACE;
Reverted extensibility of Lexer. This is not ideal.
doctrine_orm
train
php
ccd0d3dee26c873fbb385edc3d41f0cb1caaab65
diff --git a/src/LazyStrings.php b/src/LazyStrings.php index <HASH>..<HASH> 100644 --- a/src/LazyStrings.php +++ b/src/LazyStrings.php @@ -164,7 +164,7 @@ class LazyStrings foreach ($csvFile as $csvRow) { if ($csvRow) { $lineId = $this->str->strip($csvFile[0]); - $strings[$lineId] = $csvRow; + $strings[$lineId] = $csvFile[1]; } } }
Force to always use first and second column values. Closes #6
Nobox_Lazy-Strings
train
php
857aad13d31cb66e17f23550d3df823f55e917ed
diff --git a/classes/import.php b/classes/import.php index <HASH>..<HASH> 100644 --- a/classes/import.php +++ b/classes/import.php @@ -159,7 +159,7 @@ class Import $chunk->slotname = $xx['slotname']; $chunk->save(); - $images = $db->query( Database::SELECT, "select item_rid from relationship_partner inner join asset on item_rid = asset.id inner join asset_v on active_vid = asset_v.id where relationship_id in (select relationship_id from relationship_partner where item_tablename = 'tag' and item_rid = " . $xx['target_tag_rid'] . ") and item_tablename = 'asset' order by visiblefrom_timestamp desc" ); + $images = $db->query( Database::SELECT, "select item_rid from relationship_partner inner join asset on item_rid = asset.id inner join asset_v on active_vid = asset_v.id where relationship_id in (select relationship_id from relationship_partner where item_tablename = 'tag' and item_rid = " . $xx['target_tag_rid'] . ") and item_tablename = 'asset' and asset.deleted is null order by visiblefrom_timestamp desc" ); $first = true; foreach( $images as $image )
Added deleted check to importing slideshow images
boomcms_boom-core
train
php
228ab65a4eeef8a42eb4713edf72b50590f63176
diff --git a/dev/merge_spark_pr.py b/dev/merge_spark_pr.py index <HASH>..<HASH> 100755 --- a/dev/merge_spark_pr.py +++ b/dev/merge_spark_pr.py @@ -133,6 +133,8 @@ def merge_pr(pr_num, target_ref, title, body, pr_repo_desc): primary_author = raw_input( "Enter primary author in the format of \"name <email>\" [%s]: " % distinct_authors[0]) + if primary_author == "": + primary_author = distinct_authors[0] commits = run_cmd(['git', 'log', 'HEAD..%s' % pr_branch_name, '--pretty=format:%h [%an] %s']).split("\n\n")
[SPARK-<I>] [BUILD] Use default primary author if unspecified Fixes feature introduced in #<I> to use the default value if nothing is specified in command line cc liancheng rxin pwendell
apache_spark
train
py
14cd4de3acaa1af33fdc7df7def307bf83feba84
diff --git a/tests/test_integration.py b/tests/test_integration.py index <HASH>..<HASH> 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -98,3 +98,22 @@ class TestSplitTD(BaseTestPycolator): self.assertEqual(el.attrib['{%s}decoy' % target_contents['ns']], 'false') for el in decoy_contents[feat]: self.assertEqual(el.attrib['{%s}decoy' % decoy_contents['ns']], 'true') + + +class TestMerge(BaseTestPycolator): + command = 'merge' + infilename = 'splittd_target_out.xml' + + def setUp(self): + super().setUp() + self.multifiles = [os.path.join(self.fixdir, 'splittd_decoy_out.xml')] + self.resultfn = os.path.join(self.workdir, self.infilename, + '_merged.xml') + + def test_merge(self): + options = ['--multifiles'] + options.extend(self.multifiles) + self.run_pycolator(self.command, options) + expected = self.read_percolator_out(os.path.join(self.fixdir, + 'percolator_out.xml')) + result = self.read_percolator_out(self.resultfn)
Made a start on integration test for merge
glormph_msstitch
train
py
c2d645954435c073c38511dc55abd4042e87acd3
diff --git a/src/DependencyInjection/Compiler/PropelEventPass.php b/src/DependencyInjection/Compiler/PropelEventPass.php index <HASH>..<HASH> 100644 --- a/src/DependencyInjection/Compiler/PropelEventPass.php +++ b/src/DependencyInjection/Compiler/PropelEventPass.php @@ -29,7 +29,7 @@ class PropelEventPass implements CompilerPassInterface $isClass = !empty($tag['class']); if ($isListener) { - $priority = (int) @$tag['priority']; + $priority = array_key_exists('priority', $tag) ? (int)$tag['priority'] : 0; if ($isClass) { $classDefinition->addMethodCall('addListener', array(
Update PropelEventPass.php Suppressing of error by operator "@" will produce hidden warning in logs, would be faster to use array_key_exists instead "@"
glorpen_GlorpenPropelBundle
train
php
0dff9cce1bddea0c076b0861b692647b7c1d5c8f
diff --git a/src/resources/views/character/includes/menu.blade.php b/src/resources/views/character/includes/menu.blade.php index <HASH>..<HASH> 100644 --- a/src/resources/views/character/includes/menu.blade.php +++ b/src/resources/views/character/includes/menu.blade.php @@ -4,9 +4,9 @@ @foreach($menu as $menu_entry) - <li role="presentation" class="@if ($viewname == $menu_entry['highlight_view']) active @endif"> + <li role="presentation" class="nav-item"> - <a href="{{ route($menu_entry['route'], $summary->character_id) }}"> + <a href="{{ route($menu_entry['route'], $summary->character_id) }}" class="nav-link @if ($viewname == $menu_entry['highlight_view']) active @endif"> @if (array_key_exists('label', $menu_entry)) @if(array_key_exists('plural', $menu_entry)) {{ trans_choice($menu_entry['label'], 2) }}
feat(deps): upgrade character menu
eveseat_web
train
php
ba994bd4dbf4adcb965d0f9867592b39708604ab
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,9 +1,10 @@ var Individual = require("individual") var cuid = require("cuid") +var globalDocument = require("global/document") var DOMDelegator = require("./dom-delegator.js") -var delegatorCache = Individual("__DOM_DELEGATOR_CACHE@8", { +var delegatorCache = Individual("__DOM_DELEGATOR_CACHE@9", { delegators: {} }) var commonEvents = [ @@ -26,14 +27,13 @@ module.exports = Delegator function Delegator(opts) { opts = opts || {} - var document = opts.document + var document = opts.document || globalDocument - var cacheKey = document ? - document["__DOM_DELEGATOR_CACHE_TOKEN@8"] : "global" + var cacheKey = document["__DOM_DELEGATOR_CACHE_TOKEN@9"] if (!cacheKey) { cacheKey = - document["__DOM_DELEGATOR_CACHE_TOKEN@8"] = cuid() + document["__DOM_DELEGATOR_CACHE_TOKEN@9"] = cuid() } var delegator = delegatorCache.delegators[cacheKey]
changed the cache to be based on documents
Raynos_dom-delegator
train
js
73661fb04db6a0ddf0249d1df36770042039def0
diff --git a/src/lang/object.js b/src/lang/object.js index <HASH>..<HASH> 100644 --- a/src/lang/object.js +++ b/src/lang/object.js @@ -61,33 +61,6 @@ if (!Object.defineProperty) { }; } -/** - * Can be used to mix modules, to combine abilities - * @name mixin - * @memberOf external:Object# - * @function - * @param {Object} obj the object you want to throw in the mix - */ -Object.defineProperty(Object.prototype, "mixin", { - value: function (obj) { - var i, - self = this; - - // iterate over the mixin properties - for (i in obj) { - // if the current property belongs to the mixin - if (obj.hasOwnProperty(i)) { - // add the property to the mix - self[i] = obj[i]; - } - } - // return the mixed object - return self; - }, - enumerable : false, - configurable : false -}); - if (typeof Object.create !== "function") { /** * Prototypal Inheritance Create Helper
[#<I>] Remove Object.prototype.mixin, as it creates a compatibility issue with other libraries (notably socket.io) - This method is not used anywhere in melonJS core. - keep melonJS lightweight! [#<I>]
melonjs_melonJS
train
js
d334c32d9cc229ad57115a7ef3eb1dd4036be19a
diff --git a/lib/index_shotgun/analyzer.rb b/lib/index_shotgun/analyzer.rb index <HASH>..<HASH> 100644 --- a/lib/index_shotgun/analyzer.rb +++ b/lib/index_shotgun/analyzer.rb @@ -10,7 +10,10 @@ module IndexShotgun # Search duplicate index # @return [String] result message def perform - tables = ActiveRecord::Base.connection.tables + tables = + ActiveSupport::Deprecation.silence do + ActiveRecord::Base.connection.tables + end tables.reject! { |table| EXCLUDE_TABLES.include?(table) } duplicate_indexes =
[Resolve] DEPRECATION WARNING: #tables currently returns both tables and views. This behavior is deprecated and will be changed with Rails <I> to only return tables. Use #data_sources instead. (called from block in perform at /Users/sue<I>/dev/workspace/github.com/sue<I>/index_shotgun/lib/index_shotgun/analyzer.rb:<I>) I want to get only tables here
sue445_index_shotgun
train
rb
8671e5ed5e58fd29793f4553d09f10b0b6432124
diff --git a/abilian/web/forms/widgets.py b/abilian/web/forms/widgets.py index <HASH>..<HASH> 100644 --- a/abilian/web/forms/widgets.py +++ b/abilian/web/forms/widgets.py @@ -1394,7 +1394,7 @@ class Select2Ajax(object): s2_params = {} s2_params.update(self.s2_params) s2_params['ajax'] = {'url': unicode(field.ajax_source)} - s2_params['placeholder'] = field.label.text + s2_params['placeholder'] = unicode(field.label.text) if not field.flags.required: s2_params['allowClear'] = True
fix TB when placeholder is a lazy_gettext object
abilian_abilian-core
train
py
7c478244a2f8ef1b02d8426cfab22538203e5b71
diff --git a/app.py b/app.py index <HASH>..<HASH> 100644 --- a/app.py +++ b/app.py @@ -1,13 +1,21 @@ import os, sys import datetime +import logging +from functools import wraps from random import choice, seed, getstate, setstate from ConfigParser import ConfigParser +# Importing flask from flask import Flask, render_template, request, Response, make_response -from functools import wraps -import logging +# Sqlalchemy imports +from sqlalchemy import create_engine +from sqlalchemy import Column, Integer, String, DateTime, Boolean, Text +from sqlalchemy import or_ +from sqlalchemy.ext.declarative import declarative_base +from sqlalchemy.orm import sessionmaker + configfilepath = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'config.txt') @@ -131,11 +139,6 @@ def get_people(people): # Define database class #---------------------------------------------- -from sqlalchemy import create_engine -from sqlalchemy import Column, Integer, String, DateTime, Boolean, Text -from sqlalchemy import or_ -from sqlalchemy.ext.declarative import declarative_base -from sqlalchemy.orm import sessionmaker Base = declarative_base() class Participant(Base):
Just a little inconsequential cleanup.
NYUCCL_psiTurk
train
py
dbdac8f62cc58db58814c8783222cb1feade8bc7
diff --git a/lib/composable_operations/composed_operation.rb b/lib/composable_operations/composed_operation.rb index <HASH>..<HASH> 100644 --- a/lib/composable_operations/composed_operation.rb +++ b/lib/composable_operations/composed_operation.rb @@ -9,7 +9,7 @@ module ComposableOperations end def create(context, input = nil) - new input, Hash[Hash(@_options).map do |key, value| + new *Array(input), Hash[Array(@_options).map do |key, value| [key, value.kind_of?(Proc) ? context.instance_exec(&value) : value] end] end
Fixes ComposedOperation option parsing
t6d_composable_operations
train
rb
56a6f35f37f7f0a0a615310456f2d2a3fd396ddb
diff --git a/lib/ast.js b/lib/ast.js index <HASH>..<HASH> 100644 --- a/lib/ast.js +++ b/lib/ast.js @@ -32,25 +32,28 @@ Interpolation.prototype.render = function* (context) { let resolvePromise = null; let rejectPromise = null; + let end = false; const readableListener = () => resolvePromise(); const errorListener = err => rejectPromise(err); src.on('readable', readableListener); - src.on('end', readableListener); + src.on('end', () => { end = true; readableListener(); }); src.on('error', errorListener); - while (true) { + while (!end) { yield new Promise((resolve, reject) => { resolvePromise = resolve; rejectPromise = reject; }); - const chunk = src.read(); + while (!end) { + const chunk = src.read(); - if (chunk === null) break; + if (chunk === null) break; - if (this.verbatim) yield chunk; - else yield* escape(chunk); + if (this.verbatim) yield chunk; + else yield* escape(chunk); + } } src.removeListener('error', errorListener);
Update stream reading to what I currently believe is correct
maghoff_mustachio
train
js
67127d3c1cf790a143e2bc6248351bf4bba2702a
diff --git a/js/types/bars.js b/js/types/bars.js index <HASH>..<HASH> 100644 --- a/js/types/bars.js +++ b/js/types/bars.js @@ -169,6 +169,7 @@ Flotr.addType('bars', { context.save(); context.translate(options.offsetLeft, options.offsetTop); + this.translate(context, options.horizontal); context.clearRect( geometry.left - lineWidth, geometry.top - lineWidth,
Added translate to clear horizontal hits.
HumbleSoftware_Flotr2
train
js
70a839dd207bb5292c73d473024b4a33b4a22b48
diff --git a/src/Freq.php b/src/Freq.php index <HASH>..<HASH> 100644 --- a/src/Freq.php +++ b/src/Freq.php @@ -276,7 +276,16 @@ class Freq { return $ts; } + //EOP needs to have the same TIME as START ($t) + $tO = new \DateTime('@'.$t, new \DateTimeZone('UTC')); + $eop = $this->findEndOfPeriod($offset); + $eopO = new \DateTime('@'.$eop, new \DateTimeZone('UTC')); + $eopO->setTime($tO->format('H'),$tO->format('i'),$tO->format('s')); + $eop = $eopO->getTimestamp(); + unset($eopO); + unset($tO); + if ($debug) echo 'EOP: ' . date('r', $eop) . "\n"; foreach ($this->knownRules AS $rule) {
Fixes #<I>, set EOP (End of Period) TIME to START time
OzzyCzech_icalparser
train
php
de1ffed6029dc5ecec51cd613c1b04b89a5fbe98
diff --git a/cmd/structcheck/structcheck.go b/cmd/structcheck/structcheck.go index <HASH>..<HASH> 100644 --- a/cmd/structcheck/structcheck.go +++ b/cmd/structcheck/structcheck.go @@ -161,6 +161,8 @@ func main() { } fset, astFiles := check.ASTFilesForPackage(pkgPath) imp := importer.New() + // Preliminary cgo support. + imp.Config = importer.Config{UseGcFallback: true} config := types.Config{Import: imp.Import} var err error visitor.pkg, err = config.Check(pkgPath, fset, astFiles, &visitor.info) diff --git a/cmd/varcheck/varcheck.go b/cmd/varcheck/varcheck.go index <HASH>..<HASH> 100644 --- a/cmd/varcheck/varcheck.go +++ b/cmd/varcheck/varcheck.go @@ -101,6 +101,8 @@ func main() { } fset, astFiles := check.ASTFilesForPackage(pkgPath) imp := importer.New() + // Preliminary cgo support. + imp.Config = importer.Config{UseGcFallback: true} config := types.Config{Import: imp.Import} var err error visitor.pkg, err = config.Check(pkgPath, fset, astFiles, &visitor.info)
Add cgo support (fixes #4)
opennota_check
train
go,go
195f2e91a33cb621dbd14e698a2b7355f964ba1e
diff --git a/src/Twig/PageExtension.php b/src/Twig/PageExtension.php index <HASH>..<HASH> 100644 --- a/src/Twig/PageExtension.php +++ b/src/Twig/PageExtension.php @@ -80,12 +80,17 @@ class PageExtension extends \Twig_Extension return $ret; } - foreach ($this->propertyInfo->getProperties($class) as $property) { - $description = $this->propertyInfo->getShortDescription($class, $property); - if ($description) { - $ret[$property] = $description; - } else { - $ret[$property] = $property; + $properties = $this->propertyInfo->getProperties($class); + + // Properties can be null + if ($properties) { + foreach ($properties as $property) { + $description = $this->propertyInfo->getShortDescription($class, $property); + if ($description) { + $ret[$property] = $description; + } else { + $ret[$property] = $property; + } } }
avoid Twig crashes when the PropertyInfo component does not find any properties on class
makinacorpus_drupal-calista
train
php
f1d6bfd0325290d9067e3db9ea2caea56733e5ac
diff --git a/concrete/src/Calendar/Event/EventService.php b/concrete/src/Calendar/Event/EventService.php index <HASH>..<HASH> 100755 --- a/concrete/src/Calendar/Event/EventService.php +++ b/concrete/src/Calendar/Event/EventService.php @@ -152,7 +152,7 @@ class EventService $type = Type::getByID($calendar->getEventPageTypeID()); if (is_object($type)) { $page = $parent->add($type, array('cName' => $event->getName())); - $page->setAttribute($calendar->getEventPageAttributeKeyHandle(), $this); + $page->setAttribute($calendar->getEventPageAttributeKeyHandle(), $event); $event->setPageID($page->getCollectionID()); $event->setRelatedPageRelationType('C'); $this->save($event);
Pass the event as opposed to the service to the pages related event attribute.
concrete5_concrete5
train
php
f1d49a7d61e892e4110f6c5979865e5c8fb608fe
diff --git a/emir/dataproducts.py b/emir/dataproducts.py index <HASH>..<HASH> 100644 --- a/emir/dataproducts.py +++ b/emir/dataproducts.py @@ -20,14 +20,13 @@ '''Data products produced by the EMIR pipeline.''' import logging - import pyfits from numina.recipes import Image -from emir.instrument import EmirImageFactory -_logger = logging.getLogger('emir.dataproducts') +from .simulator import EmirImageFactory +_logger = logging.getLogger('emir.dataproducts') class MasterBadPixelMask(Image): def __init__(self, hdu):
EmirImageFactory has moved to simulator module
guaix-ucm_pyemir
train
py
9ecbcf74b2df39a46a4aeeb309bd171089a159a5
diff --git a/httpinvoke-node.js b/httpinvoke-node.js index <HASH>..<HASH> 100644 --- a/httpinvoke-node.js +++ b/httpinvoke-node.js @@ -35,6 +35,10 @@ module.exports = function(uri, method, options) { path: uri.path, method: method }, function(res) { + if(statusCb) { + statusCb(res.statusCode, res.headers); + statusCb = null; + } if(cb) { var output = ''; res.setEncoding('utf8');
-node: implement options.gotStatus
jakutis_httpinvoke
train
js
72f94460569fd9c001b36eed7767931f90db317e
diff --git a/lib/editor/htmlarea/popups/select_color.php b/lib/editor/htmlarea/popups/select_color.php index <HASH>..<HASH> 100644 --- a/lib/editor/htmlarea/popups/select_color.php +++ b/lib/editor/htmlarea/popups/select_color.php @@ -1,8 +1,11 @@ <?php include("../../../../config.php"); ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> +<meta http-equiv="content-type" content="text/html; charset=<?php print_string("thischarset");?>" /> <title><?php print_string("selectcolor","editor");?></title> <style type="text/css"> html, body { width: 238; height: 188; }
select_color.php popup should specify charset MDL-<I>; patch by Hiroto Kagotani; merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
baeafd30b9a1c482df32037b2ded77fd32bd1fb5
diff --git a/simuvex/s_state.py b/simuvex/s_state.py index <HASH>..<HASH> 100644 --- a/simuvex/s_state.py +++ b/simuvex/s_state.py @@ -86,6 +86,7 @@ class SimState(ana.Storable): # pylint: disable=R0904 # this is a global condition, applied to all added constraints, memory reads, etc self._global_condition = None + self.eip_constraints = [] def _ana_getstate(self): s = dict(ana.Storable._ana_getstate(self)) @@ -326,6 +327,7 @@ class SimState(ana.Storable): # pylint: disable=R0904 state.uninitialized_access_handler = self.uninitialized_access_handler state._special_memory_filler = self._special_memory_filler + state.eip_constraints = self.eip_constraints return state
eip_constraints in state
angr_angr
train
py
b0fc6b03b0f236950f5f74bb61f07cdf88091627
diff --git a/lib/skpm-link.js b/lib/skpm-link.js index <HASH>..<HASH> 100644 --- a/lib/skpm-link.js +++ b/lib/skpm-link.js @@ -72,9 +72,11 @@ if (!packageJSON.name) { console.log(chalk.dim('[1/1]') + ' 🔗 Symlinking the plugin ' + packageJSON.name + '...') try { - if (!fs.existsSync(path.join(pluginDirectory, packageJSON.name))) { - fs.mkdirSync(path.join(pluginDirectory, packageJSON.name)) + if (fs.existsSync(path.join(pluginDirectory, packageJSON.name))) { + return console.log(chalk.red('error') + ' This plugin has already been linked.') } + + fs.mkdirSync(path.join(pluginDirectory, packageJSON.name)) fs.symlinkSync(getPath(packageJSON.main), path.join(pluginDirectory, packageJSON.name, packageJSON.main)) testDevMode(function () {
Generating a clearer error message when a plugin has already been linked
skpm_skpm
train
js
9d4ceac22d51aba0b05ea96d7c5581287e5dc752
diff --git a/awsshell/ui.py b/awsshell/ui.py index <HASH>..<HASH> 100644 --- a/awsshell/ui.py +++ b/awsshell/ui.py @@ -109,6 +109,13 @@ def create_default_layout(app, message='', else: return LayoutDimension() + def separator(): + return ConditionalContainer( + content=Window(height=LayoutDimension.exact(1), + content=FillControl(u'\u2500', + token=Token.Separator)), + filter=HasDocumentation(app) & ~IsDone()) + # Create and return Layout instance. return HSplit([ ConditionalContainer( @@ -154,7 +161,7 @@ def create_default_layout(app, message='', ] ), ]), - # Docs container. + separator(), ConditionalContainer( content=Window( BufferControl( @@ -163,12 +170,7 @@ def create_default_layout(app, message='', height=LayoutDimension(max=15)), filter=HasDocumentation(app) & ~IsDone(), ), - # Toolbar options container. - ConditionalContainer( - content=Window(height=LayoutDimension.exact(1), - content=FillControl(u'\u2500', - token=Token.Separator)), - filter=HasDocumentation(app) & ~IsDone()), + separator(), ValidationToolbar(), SystemToolbar(),
Set separators above and below the help pane.
awslabs_aws-shell
train
py
d3063e20f43cb3c68aaddce517e62889c7bd4830
diff --git a/godbf/dbfreader.go b/godbf/dbfreader.go index <HASH>..<HASH> 100644 --- a/godbf/dbfreader.go +++ b/godbf/dbfreader.go @@ -5,7 +5,7 @@ import ( "errors" "os" "time" - "mahonia" + "code.google.com/p/mahonia" "strings" "strconv" )
Chanigng mahonia dependency to google.com/p/mahonia
LindsayBradford_go-dbf
train
go
a7769b370b9cc199e59e5a9cfc12f9549654d991
diff --git a/lib/dom2.js b/lib/dom2.js index <HASH>..<HASH> 100644 --- a/lib/dom2.js +++ b/lib/dom2.js @@ -60,13 +60,20 @@ AbstractXHRObject.prototype._start = function(method, url, payload, opts) { var status = x.status; var text = x.responseText; } catch (x) {}; + // IE returns 1223 for 204: http://bugs.jquery.com/ticket/1450 + if (status === 1223) status = 204; + // IE does return readystate == 3 for 404 answers. if (text && text.length > 0) { that.emit('chunk', status, text); } break; case 4: - that.emit('finish', x.status, x.responseText); + var status = x.status; + // IE returns 1223 for 204: http://bugs.jquery.com/ticket/1450 + if (status === 1223) status = 204; + + that.emit('finish', status, x.responseText); that._cleanup(false); break; }
Work around another IE bug - <I> gets mangled to <I>
sockjs_sockjs-client
train
js
4354f0a107b0a5c38a91fa26f10f571f7018e237
diff --git a/registry/client/repository.go b/registry/client/repository.go index <HASH>..<HASH> 100644 --- a/registry/client/repository.go +++ b/registry/client/repository.go @@ -36,8 +36,21 @@ func checkHTTPRedirect(req *http.Request, via []*http.Request) error { if len(via) > 0 { for headerName, headerVals := range via[0].Header { - if headerName == "Accept" || headerName == "Range" { - for _, val := range headerVals { + if headerName != "Accept" && headerName != "Range" { + continue + } + for _, val := range headerVals { + // Don't add to redirected request if redirected + // request already has a header with the same + // name and value. + hasValue := false + for _, existingVal := range req.Header[headerName] { + if existingVal == val { + hasValue = true + break + } + } + if !hasValue { req.Header.Add(headerName, val) } }
On redirect, only copy headers when they don't already exist in the redirected request A changeset under consideration for Go <I> would automatically copy headers on redirect. This change future-proofs our code so we won't make duplicate copies of the headers if net/http does it automatically in the future.
docker_distribution
train
go
678984b9e435414ec64584679ef752ff537ab6b0
diff --git a/lib/Compilation.js b/lib/Compilation.js index <HASH>..<HASH> 100644 --- a/lib/Compilation.js +++ b/lib/Compilation.js @@ -34,7 +34,7 @@ function Compilation(compiler) { this.performance = options && options.performance; this.mainTemplate = new MainTemplate(this.outputOptions); - this.chunkTemplate = new ChunkTemplate(this.outputOptions, this.mainTemplate); + this.chunkTemplate = new ChunkTemplate(this.outputOptions); this.hotUpdateChunkTemplate = new HotUpdateChunkTemplate(this.outputOptions); this.moduleTemplate = new ModuleTemplate(this.outputOptions);
remove second param to `ChunkTemplate` constructor the ChunkTemplate contructor only expects one parameter, therefore it seams unnecessary that `this.mainTemplate` is passed
webpack_webpack
train
js
a513adf906039ba932b72abf223fef655262cbd1
diff --git a/modules/text/text.test.js b/modules/text/text.test.js index <HASH>..<HASH> 100644 --- a/modules/text/text.test.js +++ b/modules/text/text.test.js @@ -53,6 +53,24 @@ test("makePath", (t) => { t.is(ctx.strokeStyle, t.context.options.stroke); }); +test("makePath with underscore", (t) => { + t.context.text = " "; + t.context.options.underscore = true; + + const ctx = { + beginPath: () => t.pass(), + fillText: () => t.pass(), + moveTo: () => t.pass(), + lineTo: () => t.pass(), + stroke: () => t.pass(), + closePath: () => t.pass(), + }; + t.plan(7); + + t.context.makePath(ctx); + t.is(ctx.strokeStyle, t.context.options.fill); +}); + test("makePath with no text", (t) => { const ctx = { fillText: () => t.fail(),
:white_check_mark: Adding tests. Add tests for Text's underscore option
pencil-js_pencil.js
train
js
90d833d5dc1c35a4cf2e41a0271c7bd62e408212
diff --git a/salt/modules/file.py b/salt/modules/file.py index <HASH>..<HASH> 100644 --- a/salt/modules/file.py +++ b/salt/modules/file.py @@ -2771,7 +2771,7 @@ def get_managed( elif source.startswith('/'): source_sum = get_hash(source) elif source_hash: - protos = ('salt', 'http', 'https', 'ftp', 'swift') + protos = ('salt', 'http', 'https', 'ftp', 'swift', 's3') if _urlparse(source_hash).scheme in protos: # The source_hash is a file on a server hash_fn = __salt__['cp.cache_file'](source_hash, saltenv)
fix bad merge <I>fc7ec
saltstack_salt
train
py
38fad083a9d6c1661c7cf97feeeec3f4ebfdeacd
diff --git a/lib/missinglink.rb b/lib/missinglink.rb index <HASH>..<HASH> 100644 --- a/lib/missinglink.rb +++ b/lib/missinglink.rb @@ -1,6 +1,5 @@ require "missinglink/engine" require "missinglink/connection" -require 'typhoeus' module Missinglink include Connection diff --git a/lib/missinglink/connection.rb b/lib/missinglink/connection.rb index <HASH>..<HASH> 100644 --- a/lib/missinglink/connection.rb +++ b/lib/missinglink/connection.rb @@ -1,3 +1,5 @@ +require 'typhoeus' + module Missinglink module Connection extend self
move typheous requirement to connection, where it belongs
MustWin_missinglink
train
rb,rb
2b18c8bad71fb3463b46aecd75f9fbd572a6d841
diff --git a/lib/fastlane/actions/produce.rb b/lib/fastlane/actions/produce.rb index <HASH>..<HASH> 100644 --- a/lib/fastlane/actions/produce.rb +++ b/lib/fastlane/actions/produce.rb @@ -1,7 +1,7 @@ module Fastlane module Actions module SharedValues - + PRODUCE_APPLE_ID = :PRODUCE_APPLE_ID end class ProduceAction @@ -22,7 +22,12 @@ module Fastlane CredentialsManager::PasswordManager.shared_manager(ENV['PRODUCE_USERNAME']) if ENV['PRODUCE_USERNAME'] Produce::Config.shared_config # to ask for missing information right in the beginning - Produce::Manager.start_producing + + apple_id = Produce::Manager.start_producing.to_s + + + Actions.lane_context[SharedValues::PRODUCE_APPLE_ID] = apple_id + ENV["PRODUCE_APPLE_ID"] = apple_id end end end
Added storing of produce Apple ID in environment and lane context
fastlane_fastlane
train
rb
12f6e18bcabfbc91ef49396b642e9e6129dece97
diff --git a/tests/lax_numpy_test.py b/tests/lax_numpy_test.py index <HASH>..<HASH> 100644 --- a/tests/lax_numpy_test.py +++ b/tests/lax_numpy_test.py @@ -203,7 +203,8 @@ JAX_COMPOUND_OP_RECORDS = [ op_record("real", 1, number_dtypes, all_shapes, jtu.rand_some_inf(), []), op_record("remainder", 2, default_dtypes, all_shapes, jtu.rand_nonzero(), []), op_record("mod", 2, default_dtypes, all_shapes, jtu.rand_nonzero(), []), - op_record("sinc", 1, number_dtypes, all_shapes, jtu.rand_default(), ["rev"]), + op_record("sinc", 1, number_dtypes, all_shapes, jtu.rand_default(), ["rev"], + tolerance={onp.complex64: 1e-5}), op_record("square", 1, number_dtypes, all_shapes, jtu.rand_default(), ["rev"]), op_record("sqrt", 1, number_dtypes, all_shapes, jtu.rand_positive(), ["rev"]), op_record("transpose", 1, all_dtypes, all_shapes, jtu.rand_default(), ["rev"]),
Relax tolerance of np.sinc test. (#<I>)
tensorflow_probability
train
py
1d878243ca50dcfe371ef30eec1bad4bd6b2e4a5
diff --git a/tests/rules/test_python_command.py b/tests/rules/test_python_command.py index <HASH>..<HASH> 100644 --- a/tests/rules/test_python_command.py +++ b/tests/rules/test_python_command.py @@ -2,7 +2,7 @@ from thefuck.main import Command from thefuck.rules.python_command import match, get_new_command def test_match(): - assert match(Command('', '', 'Permission denied'), None) + assert match(Command('temp.py', '', 'Permission denied'), None) assert not match(Command('', '', ''), None) def test_get_new_command():
A special case for 'Permission denied' error msg when trying to execute a python scripy. The script does not have execute permission and/or does not start with !#/usr/... In that case, pre-pend the command with 'python' keyword. Change-Id: Idf<I>ee9cf0a<I>f<I>c<I>a<I>b2fcedc1e6
nvbn_thefuck
train
py
13e4bf5e722f467d1c5f576e548a61a3bb047e94
diff --git a/eventsourcing/application/process.py b/eventsourcing/application/process.py index <HASH>..<HASH> 100644 --- a/eventsourcing/application/process.py +++ b/eventsourcing/application/process.py @@ -238,16 +238,17 @@ class Process(Pipeable, SimpleApplication): assert isinstance(record_manager, RelationalRecordManager) event_records += record_manager.to_records(sequenced_items) - current_max = record_manager.get_max_record_id() or 0 - for event_record in event_records: - current_max += 1 - event_record.id = current_max + if len(event_records): + current_max = record_manager.get_max_record_id() or 0 + for event_record in event_records: + current_max += 1 + event_record.id = current_max - causal_dependencies = json_dumps(causal_dependencies) + if hasattr(record_manager.record_class, 'causal_dependencies'): + causal_dependencies = json_dumps(causal_dependencies) - if hasattr(record_manager.record_class, 'causal_dependencies'): - for event_record in event_records: - event_record.causal_dependencies = causal_dependencies + # Only need first event to carry the dependencies. + event_records[0].causal_dependencies = causal_dependencies return event_records
Simplified setting of causal dependencies.
johnbywater_eventsourcing
train
py
596d38d78a6588615e22182bd872394907695a1b
diff --git a/tests/TestCase/Http/Middleware/CsrfProtectionMiddlewareTest.php b/tests/TestCase/Http/Middleware/CsrfProtectionMiddlewareTest.php index <HASH>..<HASH> 100644 --- a/tests/TestCase/Http/Middleware/CsrfProtectionMiddlewareTest.php +++ b/tests/TestCase/Http/Middleware/CsrfProtectionMiddlewareTest.php @@ -27,26 +27,6 @@ class CsrfProtectionMiddlewareTest extends TestCase { /** - * setup - * - * @return void - */ - public function setUp() - { - parent::setUp(); - } - - /** - * teardown - * - * @return void - */ - public function tearDown() - { - parent::tearDown(); - } - - /** * Data provider for HTTP method tests. * * HEAD and GET do not populate $_POST or request->data.
Removing method stubs from the CsrfProtectionMiddlewareTest
cakephp_cakephp
train
php
bc3f0ba6e5f66d8695988b83b5ad2dc35b740586
diff --git a/master/setup.py b/master/setup.py index <HASH>..<HASH> 100755 --- a/master/setup.py +++ b/master/setup.py @@ -399,7 +399,8 @@ setup_args = { ('buildbot.www.authz', [ 'Authz', 'fnmatchStrMatcher', 'reStrMatcher']), ('buildbot.www.authz.roles', [ - 'RolesFromEmails', 'RolesFromGroups', 'RolesFromOwner', 'RolesFromUsername']), + 'RolesFromEmails', 'RolesFromGroups', 'RolesFromOwner', 'RolesFromUsername', + 'RolesFromDomain']), ('buildbot.www.authz.endpointmatchers', [ 'AnyEndpointMatcher', 'StopBuildEndpointMatcher', 'ForceBuildEndpointMatcher', 'RebuildBuildEndpointMatcher', 'AnyControlEndpointMatcher', 'EnableSchedulerEndpointMatcher']),
Add information regarding RolesFromDomain to setup.py.
buildbot_buildbot
train
py
b02af0aef50609833fe709fd743090b9b513e0a1
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100755 --- a/lib/index.js +++ b/lib/index.js @@ -138,7 +138,7 @@ internals.docs = function(settings) { // will show routes WITH 'mountains' AND 'beach' AND NO 'horses' if (request.query.tags) { - tags = request.query.tags.split(','); + tags = ['api'].concat(request.query.tags.split(',')); routes = routes.filter(function(route) { var exit; @@ -324,7 +324,7 @@ internals.buildAPIInfo = function(settings, apiData, slug) { "apiVersion": "unknown", "swaggerVersion": "1.2", "basePath": settings.basePath, - "resourcePat11h": '/' + slug, + "resourcePath": '/' + slug, "apis": [], "models": {} };
fix for -tag only; also resourcePat<I>h to reasourcePath
reptilbud_hapi-swagger
train
js
3f708685265ba640f7f12fc4ecc8a518b4acd521
diff --git a/raven/base.py b/raven/base.py index <HASH>..<HASH> 100644 --- a/raven/base.py +++ b/raven/base.py @@ -53,7 +53,7 @@ class Client(object): def __init__(self, servers, include_paths=None, exclude_paths=None, timeout=None, name=None, auto_log_stacks=None, key=None, string_max_length=None, list_max_length=None, site=None, public_key=None, secret_key=None, - processors=None, project=1, **kwargs): + processors=None, project=None, **kwargs): # servers may be set to a NoneType (for Django) if servers and not (key or (secret_key and public_key)): raise TypeError('You must specify a key to communicate with the remote Sentry servers.') @@ -73,7 +73,7 @@ class Client(object): self.site = None self.public_key = public_key self.secret_key = secret_key - self.project = project + self.project = int(project or defaults.PROJECT) self.processors = processors or defaults.PROCESSORS self.logger = logging.getLogger(__name__)
Handle missing project value with proper default of 1
elastic_apm-agent-python
train
py
2a92b2d554e47b76356635afe1611ede6bad20fd
diff --git a/bugzilla/bugzilla3.py b/bugzilla/bugzilla3.py index <HASH>..<HASH> 100644 --- a/bugzilla/bugzilla3.py +++ b/bugzilla/bugzilla3.py @@ -62,7 +62,7 @@ class Bugzilla3(bugzilla.base.BugzillaBase): def _getbugs(self,idlist): '''Return a list of dicts of full bug info for each given bug id''' - r = self._proxy.Bug.get_bugs({'ids':idlist}) + r = self._proxy.Bug.get_bugs({'ids':idlist, 'permissive': 1}) return [i['internals'] for i in r['bugs']] def _getbug(self,id): '''Return a dict of full bug info for the given bug id'''
Add permissive so that invalid bugs don't abort the whole request for bugs. This matches with the <I>.x python-bugzilla API and seems more generally useful.
python-bugzilla_python-bugzilla
train
py
d95d817bdb1fba7eb0ce0cdabcd64a9908796d2a
diff --git a/tests/unit/test_ls.py b/tests/unit/test_ls.py index <HASH>..<HASH> 100644 --- a/tests/unit/test_ls.py +++ b/tests/unit/test_ls.py @@ -38,6 +38,7 @@ class LsTests(CliTestCase): """ Confirms -F json works with the RecursiveLsResponse """ - output = self.run_line("globus ls -r -F json {}:/".format(GO_EP1_ID)) + output = self.run_line( + "globus ls -r -F json {}:/share".format(GO_EP1_ID)) self.assertIn('"DATA":', output) - self.assertIn('"name": "share/godata/file1.txt"', output) + self.assertIn('"name": "godata/file1.txt"', output)
Fix concurrency bug in ls tests
globus_globus-cli
train
py
ce0a342fec06868842d9c0d67e813c83fc114c23
diff --git a/lib/action_kit_api.rb b/lib/action_kit_api.rb index <HASH>..<HASH> 100644 --- a/lib/action_kit_api.rb +++ b/lib/action_kit_api.rb @@ -7,3 +7,4 @@ require "action_kit_api/data_model" require "action_kit_api/user" require "action_kit_api/page" require "action_kit_api/page_types/petition" +require "action_kit_api/page_types/signup"
Included SignupPage in the ActionKitApi models
Democracy-for-America_ActionKitApi
train
rb
94cb3cfdbc1c0038d12595fa0af005f86713c2fe
diff --git a/lib/timing/time_in_zone.rb b/lib/timing/time_in_zone.rb index <HASH>..<HASH> 100644 --- a/lib/timing/time_in_zone.rb +++ b/lib/timing/time_in_zone.rb @@ -5,7 +5,7 @@ module Timing REGEXP = /[+-]\d\d:?\d\d/ - def_delegators :time, :to_i, :to_f, :to_date, :to_datetime, :<, :<=, :==, :>, :>=, :between?, :eql?, :hash + def_delegators :time, :to_i, :to_f, :to_date, :to_datetime, :<, :<=, :==, :>, :>=, :between?, :eql?, :hash, :iso8601 def_delegators :time_with_offset, :year, :month, :day, :hour, :min, :sec, :wday, :yday attr_reader :zone_offset
Added iso<I> to TimeInZone
gabynaiman_timing
train
rb