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
ebaec2436218195b1edc6646b9a047bcd1b80fa0
diff --git a/tests-arquillian/src/test/java/org/jboss/weld/tests/proxy/instantiator/PerDeploymentInstantiatorWithTest.java b/tests-arquillian/src/test/java/org/jboss/weld/tests/proxy/instantiator/PerDeploymentInstantiatorWithTest.java index <HASH>..<HASH> 100644 --- a/tests-arquillian/src/test/java/org/jboss/weld/tests/proxy/instantiator/PerDeploymentInstantiatorWithTest.java +++ b/tests-arquillian/src/test/java/org/jboss/weld/tests/proxy/instantiator/PerDeploymentInstantiatorWithTest.java @@ -36,7 +36,9 @@ public class PerDeploymentInstantiatorWithTest extends AbstractPerDeploymentInst @Deployment public static WebArchive getDeploymentWith() { - return getDeployment().addAsWebInfResource(EmptyAsset.INSTANCE, "classes/META-INF/org.jboss.weld.enableUnsafeProxies"); + return getDeployment() + .addAsWebInfResource(EmptyAsset.INSTANCE, "classes/META-INF/org.jboss.weld.enableUnsafeProxies") + .addAsManifestResource(EmptyAsset.INSTANCE, "org.jboss.weld.enableUnsafeProxies"); // workaround embedded? } @Inject
Workaround embedded resource lookup issue.
weld_core
train
java
8d29630fd8d7713313c3cfc7111b1b856bfed4df
diff --git a/src/Torann/GeoIP/GeoIP.php b/src/Torann/GeoIP/GeoIP.php index <HASH>..<HASH> 100644 --- a/src/Torann/GeoIP/GeoIP.php +++ b/src/Torann/GeoIP/GeoIP.php @@ -63,8 +63,8 @@ class GeoIP { "city" => "New Haven", "state" => "CT", "postal_code" => "06510", - "lat" => 41.28, - "lon" => -72.88 + "lat" => 41.31, + "lon" => -72.92 ); /**
Wikipedia was wrong! Fixed lat/lon for new haven.
Torann_laravel-geoip
train
php
4dbdd181bef374c16f430cbeb56dfe03c5f1cb9c
diff --git a/commons/src/main/java/com/cisco/oss/foundation/ip/utils/IpUtils.java b/commons/src/main/java/com/cisco/oss/foundation/ip/utils/IpUtils.java index <HASH>..<HASH> 100644 --- a/commons/src/main/java/com/cisco/oss/foundation/ip/utils/IpUtils.java +++ b/commons/src/main/java/com/cisco/oss/foundation/ip/utils/IpUtils.java @@ -46,7 +46,7 @@ public class IpUtils { try { localHost = java.net.InetAddress.getLocalHost(); } catch (UnknownHostException e) { - LOGGER.error("Can not get local host address. exception is: " + e); + LOGGER.error("Cannot get local host address. exception is: " + e); localHost = null; hostName = "UNKNOWN"; ipAddress = "UNKNOWN";
add override of getBoolean to perorm better
foundation-runtime_common
train
java
2a5495fb115da531b42d9499b5bab4fa4dc329b7
diff --git a/base/project.js b/base/project.js index <HASH>..<HASH> 100644 --- a/base/project.js +++ b/base/project.js @@ -197,14 +197,21 @@ Project.prototype.render = function project_request (route_info, request, view, // todo: add a way to configure this via the route view.content_type = 'text/html'; + + var method = request.method; + + // allow postbody overrides of the http method so that we can structure our http methods + if (method === "POST" && request.body._method) { + method = request.body._method; + } var route = this.controller(route_info.controller)[route_info.view]; if (typeof route === "object") { - if (typeof route[request.method] === "undefined") { + if (typeof route[method] === "undefined") { view.statusUnsupportedMethod(Object.keys(route)); return true; } else { - return route[request.method].call(this, request, view, next); + return route[method].call(this, request, view, next); } } else { // call request directly
allow a post parameter to override the http method for the sake of web forms
Dashron_roads
train
js
0d8ed98e71c2bc33b070d4c4b48f365f65f4016f
diff --git a/Model/GroupMembershipInterface.php b/Model/GroupMembershipInterface.php index <HASH>..<HASH> 100644 --- a/Model/GroupMembershipInterface.php +++ b/Model/GroupMembershipInterface.php @@ -13,8 +13,8 @@ interface GroupMembershipInterface public function removeRole(string $role); public function hasRole(string $role): bool; - public function getStatus(): ?bool; - public function setStatus(bool $status); + public function isActive(): bool; + public function setActive(bool $status); public function getMember(): ?GroupMemberInterface; public function setMember(GroupMemberInterface $member); diff --git a/Security/GroupRoleVoter.php b/Security/GroupRoleVoter.php index <HASH>..<HASH> 100644 --- a/Security/GroupRoleVoter.php +++ b/Security/GroupRoleVoter.php @@ -47,7 +47,7 @@ abstract class GroupRoleVoter extends Voter foreach ($user->getMemberships() as $membership) { // User has an active membership. if ($subject->isEqualTo($membership->getGroup()) - && $membership->getStatus() + && $membership->isActive() && !$membership->isExpired()) { // Check the roles for this membership. foreach ($this->extractRoles($membership) as $role) {
BC BREAK: Change name of status property to active.
midnightLuke_group-security-bundle
train
php,php
0001439b3eda35f7e05a74b35ee7d93c45e68ecd
diff --git a/CHANGELOG.md b/CHANGELOG.md index <HASH>..<HASH> 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log +## [4.2.0a2](https://github.com/plivo/plivo-python/tree/v4.2-alpha2) (2018-08-03) +- Fix PHLO Url and component name + ## [4.2.0a1](https://github.com/plivo/plivo-python/tree/v4.2-alpha1) (2018-08-03) - Add PHLO support in alpha release diff --git a/plivo/version.py b/plivo/version.py index <HASH>..<HASH> 100755 --- a/plivo/version.py +++ b/plivo/version.py @@ -1,2 +1,2 @@ # -*- coding: utf-8 -*- -__version__ = '4.2.0a1' +__version__ = '4.2.0a2' diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ See https://github.com/plivo/plivo-python for more information. setup( name='plivo', - version='4.2.0a1', + version='4.2.0a2', description= 'A Python SDK to make voice calls & send SMS using Plivo and to generate Plivo XML', long_description=long_description,
bump to version <I>a2
plivo_plivo-python
train
md,py,py
f14922bd0bade645a102e3098834de0fb077cb4f
diff --git a/concrete/src/Job/Job.php b/concrete/src/Job/Job.php index <HASH>..<HASH> 100644 --- a/concrete/src/Job/Job.php +++ b/concrete/src/Job/Job.php @@ -252,7 +252,7 @@ abstract class Job extends ConcreteObject if (class_exists($className, true)) { $j = Core::make($className); $j->jHandle = $jHandle; - if (intval($jobData['jID']) > 0) { + if (isset($jobData['jID']) && (int) $jobData['jID'] > 0) { $j->setPropertiesFromArray($jobData); }
Avoid accessing undefined array index in Job
concrete5_concrete5
train
php
eb5f739abeef18aec87e28b7c6935bd922d0862a
diff --git a/rah_terminal.php b/rah_terminal.php index <HASH>..<HASH> 100644 --- a/rah_terminal.php +++ b/rah_terminal.php @@ -83,7 +83,6 @@ class rah_terminal { */ public function panes() { - require_privs('rah_terminal'); global $step; $steps =
Calling require_privs() is unnecessary. Textpattern has done that by itself for ages.
gocom_rah_terminal
train
php
3cb781a7bf3d99386f7642484df4dae73279401b
diff --git a/lib/view/xml_view.rb b/lib/view/xml_view.rb index <HASH>..<HASH> 100644 --- a/lib/view/xml_view.rb +++ b/lib/view/xml_view.rb @@ -10,7 +10,7 @@ module PdfExtract @@numeric_attributes = [:x, :y, :width, :height, :line_height, :page_height, :page_width, :x_offset, :y_offset, - :spacing] + :spacing, :letter_ratio] # Return renderable attributes def get_xml_attributes obj @@ -34,7 +34,7 @@ module PdfExtract end def render options={} - @render_options = {:lines => true, :round => 1, :outline => false}.merge(options) + @render_options = {:lines => true, :round => 2, :outline => false}.merge(options) pages = {} page_params = {}
xml_view.rb: Mark :letter_ratio as a numerical attribute.
CrossRef_pdfextract
train
rb
eb8a6f3041533a5781436218bbed680c94ae4447
diff --git a/lib/rollout_ui/feature.rb b/lib/rollout_ui/feature.rb index <HASH>..<HASH> 100644 --- a/lib/rollout_ui/feature.rb +++ b/lib/rollout_ui/feature.rb @@ -4,21 +4,23 @@ module RolloutUi attr_reader :name + delegate :percentage_key, :group_key, :user_key, :to => :rollout + def initialize(name) @wrapper = Wrapper.new @name = name end def percentage - redis.get("feature:#{name}:percentage") + redis.get(percentage_key(name)) end def groups - redis.smembers("feature:#{name}:groups") + redis.smembers(group_key(name)) end def users - redis.smembers("feature:#{name}:users") + redis.smembers(user_key(name)) end def percentage=(percentage) @@ -26,12 +28,12 @@ module RolloutUi end def groups=(groups) - redis.del("feature:#{name}:groups") + redis.del(group_key(name)) groups.each { |group| rollout.activate_group(name, group) } end def users=(users) - redis.del("feature:#{name}:users") + redis.del(user_key(name)) users.each { |user| rollout.activate_user(name, User.new(user)) unless user.empty? } end
Delegate redis keys to the rollout instance
jrallison_rollout_ui
train
rb
0e61a5eb8528b36644cf69f9cbd2fbfcc74c27d2
diff --git a/lib/dpl/provider/cloud_foundry.rb b/lib/dpl/provider/cloud_foundry.rb index <HASH>..<HASH> 100644 --- a/lib/dpl/provider/cloud_foundry.rb +++ b/lib/dpl/provider/cloud_foundry.rb @@ -22,7 +22,7 @@ module DPL end def push_app - context.shell "cf push #{manifest}" + context.shell "cf push#{manifest}" context.shell "cf logout" end @@ -33,7 +33,7 @@ module DPL end def manifest - options[:manifest].nil? ? "" : "-f #{options[:manifest]}" + options[:manifest].nil? ? "" : " -f #{options[:manifest]}" end end end
Push the white space in the right spot So that the specs pass
travis-ci_dpl
train
rb
3dc5b026433795946eba623aa04d2c3c88a99281
diff --git a/billing/gateway.py b/billing/gateway.py index <HASH>..<HASH> 100644 --- a/billing/gateway.py +++ b/billing/gateway.py @@ -38,10 +38,6 @@ class Gateway(object): and calls the `is_valid` method on it. Responsibility of the gateway author to use this method before every card transaction.""" - # Gateways might provide some random number which - # might not pass Luhn's test. - if self.test_mode: - return True card_supported = None for card in self.supported_cardtypes: card_supported = card.regexp.match(credit_card.number) @@ -51,6 +47,10 @@ class Gateway(object): if not card_supported: raise CardNotSupported("This credit card is not " "supported by the gateway.") + # Gateways might provide some random number which + # might not pass Luhn's test. + if self.test_mode: + return True return credit_card.is_valid() def purchase(self, money, credit_card, options = {}):
Move the credit card test mode checking so that credit card type can be assigned
agiliq_merchant
train
py
304936154d02e99b45f094b11afd7b9b03bf8458
diff --git a/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/query/RemoteQueryDslConditionsFilesystemTest.java b/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/query/RemoteQueryDslConditionsFilesystemTest.java index <HASH>..<HASH> 100644 --- a/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/query/RemoteQueryDslConditionsFilesystemTest.java +++ b/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/query/RemoteQueryDslConditionsFilesystemTest.java @@ -2,6 +2,7 @@ package org.infinispan.client.hotrod.query; import org.infinispan.configuration.cache.ConfigurationBuilder; import org.infinispan.test.TestingUtil; +import org.testng.annotations.AfterClass; import org.testng.annotations.Test; import java.io.File; @@ -38,6 +39,7 @@ public class RemoteQueryDslConditionsFilesystemTest extends RemoteQueryDslCondit return builder; } + @AfterClass(alwaysRun = true) @Override protected void destroy() { try {
ISPN-<I> Unify test suite for remote and embedded DSL based query tests * Fixed test so it will properly close cache manager and continue build
infinispan_infinispan
train
java
7605fbe19ea3f5ca9402490be0e17baf431172fa
diff --git a/packages/canner/src/components/Provider.js b/packages/canner/src/components/Provider.js index <HASH>..<HASH> 100644 --- a/packages/canner/src/components/Provider.js +++ b/packages/canner/src/components/Provider.js @@ -132,7 +132,10 @@ export default class Provider extends React.PureComponent<Props, State> { } else { const refetch = (routes.length > 1 && schema[paths[0]] && schema[paths[0]].refetch); log('updateQuery', variables, args); - return this.observableQueryMap[paths[0]].setVariables(variables, refetch || false).then(() => false); + if (refetch) { + return this.observableQueryMap[paths[0]].refetch(variables).then(() => false); + } + return this.observableQueryMap[paths[0]].setVariables(variables).then(() => false); } }
use refetch instead of setVariables
Canner_canner
train
js
852325708e1317210eebc1fc145fb13851438930
diff --git a/bin/commands/migrate-notes.php b/bin/commands/migrate-notes.php index <HASH>..<HASH> 100644 --- a/bin/commands/migrate-notes.php +++ b/bin/commands/migrate-notes.php @@ -179,10 +179,15 @@ function comment_rewrite($code) if (!$newDoc) { $newDoc = "/**\n$newNoteLined */"; } else { - $newDoc = preg_replace("~(\*/\s*)$~", "*\n$newNoteLined */", $newDoc); + // preg_replace requires backslashes to be escaped in the replacement pattern + $newNoteReplace = str_replace("\\", "\\\\", $newNoteLined); + $newDoc = preg_replace("~(\*/\s*)$~", "*\n$newNoteReplace */", $newDoc); } - $code = preg_replace('~'.preg_quote($doc, '~').'~', $newDoc, $code, 1, $count); + // preg_replace requires backslashes to be escaped in the replacement pattern + $newDocReplace = str_replace("\\", "\\\\", $newDoc); + + $code = preg_replace('~'.preg_quote($doc, '~').'~', $newDocReplace, $code, 1, $count); if (!$count) { throw new RewriteException(); }
fixed escaping issue in migrate-notes
shabbyrobe_amiss
train
php
42044f6ca8e08163ee588e653a60216e9d50fe73
diff --git a/cmd/juju/controller/listmodels.go b/cmd/juju/controller/listmodels.go index <HASH>..<HASH> 100644 --- a/cmd/juju/controller/listmodels.go +++ b/cmd/juju/controller/listmodels.go @@ -145,13 +145,14 @@ func (c *modelsCommand) Run(ctx *cmd.Context) error { } now := time.Now() - // New code path - modelInfo, err := c.getNewModelInfo(controllerName, now) - if err != nil { - return errors.Annotate(err, "unable to get model details") - } - + var modelInfo []common.ModelInfo if false { + // New code path + modelInfo, err = c.getNewModelInfo(controllerName, now) + if err != nil { + return errors.Annotate(err, "unable to get model details") + } + } else { // First get a list of the models. var models []base.UserModel if c.all {
Make it easier to toggle old and new to compare results
juju_juju
train
go
a6984205fd1ba71c443e30023a8cff7824f1e248
diff --git a/classes/fields/pick.php b/classes/fields/pick.php index <HASH>..<HASH> 100644 --- a/classes/fields/pick.php +++ b/classes/fields/pick.php @@ -616,6 +616,9 @@ class PodsField_Pick extends PodsField { } } elseif ( 'multi' == pods_var( 'pick_format_type', $options, 'single' ) ) { + if ( !empty( $value ) && !is_array( $value ) ) + $value = explode( ',', $value ); + if ( 'checkbox' == pods_var( 'pick_format_multi', $options, 'checkbox' ) ) $field_type = 'checkbox'; elseif ( 'multiselect' == pods_var( 'pick_format_multi', $options, 'checkbox' ) )
Fix for default values that are comma-separated for multiple-select relationship field inputs
pods-framework_pods
train
php
0c8d31165722852049389bc0208149b8e60d980f
diff --git a/src/Symfony/Component/Console/Input/ArrayInput.php b/src/Symfony/Component/Console/Input/ArrayInput.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Console/Input/ArrayInput.php +++ b/src/Symfony/Component/Console/Input/ArrayInput.php @@ -19,7 +19,7 @@ use Symfony\Component\Console\Exception\InvalidOptionException; * * Usage: * - * $input = new ArrayInput(['name' => 'foo', '--bar' => 'foobar']); + * $input = new ArrayInput(['command' => 'foo:bar', 'foo' => 'bar', '--bar' => 'foobar']); * * @author Fabien Potencier <[email protected]> */
Update usage example in ArrayInput doc block. Make the ArrayInput doc block example more self-explanatory and less misleading. Show the common use case of having `command`, and replace the confusing `name` argument with something more arbitrary.
symfony_symfony
train
php
041c01d58362784bb81459d0f975077c03cd35f8
diff --git a/client/fs_endpoint_test.go b/client/fs_endpoint_test.go index <HASH>..<HASH> 100644 --- a/client/fs_endpoint_test.go +++ b/client/fs_endpoint_test.go @@ -1706,6 +1706,9 @@ func TestFS_streamFile_Truncate(t *testing.T) { } func TestFS_streamImpl_Delete(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("Windows does not allow us to delete a file while it is open") + } t.Parallel() c, cleanup := TestClient(t, nil) @@ -1730,7 +1733,11 @@ func TestFS_streamImpl_Delete(t *testing.T) { frames := make(chan *sframer.StreamFrame, 4) go func() { for { - frame := <-frames + frame, ok := <-frames + if !ok { + return + } + if frame.IsHeartbeat() { continue }
client/fs: Skip delete-while-streaming test on win
hashicorp_nomad
train
go
9703fe95dc9c5e161a4bff4e92b501115e5b9d01
diff --git a/test/integration/search_test.rb b/test/integration/search_test.rb index <HASH>..<HASH> 100644 --- a/test/integration/search_test.rb +++ b/test/integration/search_test.rb @@ -61,6 +61,7 @@ class SearchTest < SystemTest test "params has non white listed keys" do visit '/search?query=ruby&script_name=javascript:alert(1)//' + refute page.has_content? "ruby0" assert page.has_content? "ruby1" assert page.has_content? "ruby2" assert page.has_link?("Next", href: "/search?page=2&query=ruby")
Improve search_test refute content ruby0
rubygems_rubygems.org
train
rb
2a6e4b07ec226cb24f75441250d07cffbdbf4efb
diff --git a/template/tests/phpunit/src/TestBase.php b/template/tests/phpunit/src/TestBase.php index <HASH>..<HASH> 100644 --- a/template/tests/phpunit/src/TestBase.php +++ b/template/tests/phpunit/src/TestBase.php @@ -24,6 +24,9 @@ abstract class TestBase extends \PHPUnit_Framework_TestCase { $this->projectDirectory = dirname(dirname(dirname(__DIR__))); $this->drupalRoot = $this->projectDirectory . '/docroot'; $this->config = Yaml::parse(file_get_contents("{$this->projectDirectory}/project.yml")); + if (file_exists("{$this->projectDirectory}/project.local.yml")) { + $this->config = array_replace_recursive($this->config, Yaml::parse(file_get_contents("{$this->projectDirectory}/project.local.yml"))); + } } }
Update TestBase.php to respect project.local.yml (#<I>)
acquia_blt
train
php
ed1c7111c5f9e9a05392f40a7d4768bed153e5b2
diff --git a/phydmslib/parsearguments.py b/phydmslib/parsearguments.py index <HASH>..<HASH> 100644 --- a/phydmslib/parsearguments.py +++ b/phydmslib/parsearguments.py @@ -135,7 +135,9 @@ def PhyDMSParser(): parser.add_argument('--fitF3X4', dest='fitF3X4', action='store_true', help='Fit F3X4 frequencies for YNGKP; otherwise use empirical') parser.add_argument('--minbrlen', default=1e-6, help='Min branch length for starting tree.', type=FloatGreaterThanZero) parser.add_argument('--seed', type=int, default=1, help="Random number seed.") - parser.add_argument('--recursion', choices=['S', 'D'], default='S', help='Likelihood recursion for Bio++.') + parser.set_defaults(recursion='S') + # comment out this option for now as the double recursion seems not to work properly + #parser.add_argument('--recursion', choices=['S', 'D'], default='S', help='Likelihood recursion for Bio++.') parser.add_argument('-v', '--version', action='version', version='%(prog)s {version}'.format(version=phydmslib.__version__)) return parser
Fix --recursion to S for now
jbloomlab_phydms
train
py
b658cd9f6d0645878a670a2073db8e0494166824
diff --git a/concrete/attributes/calendar_event/controller.php b/concrete/attributes/calendar_event/controller.php index <HASH>..<HASH> 100755 --- a/concrete/attributes/calendar_event/controller.php +++ b/concrete/attributes/calendar_event/controller.php @@ -31,10 +31,7 @@ class Controller extends \Concrete\Attribute\Number\Controller public function getSearchIndexValue() { - $value = $this->getAttributeValue()->getValueObject(); - if ($value) { - return intval($value->getValue()); - } + return '1'; } public function getPlainTextValue() @@ -103,18 +100,4 @@ class Controller extends \Concrete\Attribute\Number\Controller } $this->set('calendars', $calendars); } - - public function search() - { - $this->form(); - $v = $this->getView(); - $v->render(); - } - - public function searchForm($list) - { - $eventID = (int) ($this->request('eventID')); - $list->filterByAttribute($this->attributeKey->getAttributeKeyHandle(), $eventID, '='); - return $list; - } }
Removing unrelated changes already in another pull request
concrete5_concrete5
train
php
082f3843c8524f3d0b0bd82aea9218b6a74fb549
diff --git a/lib/railjet/repository.rb b/lib/railjet/repository.rb index <HASH>..<HASH> 100644 --- a/lib/railjet/repository.rb +++ b/lib/railjet/repository.rb @@ -11,12 +11,11 @@ module Railjet private def repositories - klass = self.class - - klass.constants.select do |k| - name = klass.const_get(k).name - name.end_with?("Repository") - end.map do |k| + klass = self.class + inner_klasses = klass.constants + inner_repos = inner_klasses.select { |k| k.to_s.end_with?("Repository") } + + inner_repos.map do |k| klass.const_get(k) end end
Fix initialising repositories with inner classes that are not repos We sometimes have helper objects, constants defined (eg. Transfer Chunk, Source name). We don’t want them to be mistreated as repos
nedap_railjet
train
rb
d0faf36cbdcb1dc8559a7d4bfa1baecf011ca847
diff --git a/lavalink/websocket.py b/lavalink/websocket.py index <HASH>..<HASH> 100644 --- a/lavalink/websocket.py +++ b/lavalink/websocket.py @@ -31,7 +31,7 @@ class WebSocket: @property def connected(self): """ Returns whether there is a valid WebSocket connection to the Lavalink server or not. """ - return self._ws and not getattr(self._ws, "closed", True) + return self._ws and not self._ws.closed async def listen(self): """ Waits to receive a payload from the Lavalink server and processes it. """
this is why we can't have nice things
Devoxin_Lavalink.py
train
py
26f66533e5b1b644d70c19edc290c13d1135311c
diff --git a/lib/reterm/components/dialog.rb b/lib/reterm/components/dialog.rb index <HASH>..<HASH> 100644 --- a/lib/reterm/components/dialog.rb +++ b/lib/reterm/components/dialog.rb @@ -4,6 +4,11 @@ module RETerm class Dialog < Component include CDKComponent + BUTTONS = { + :ok => ["</B/24>OK"], + :ok_cancel => ["</B/24>OK", "</B16>Cancel"] + } + # Initialize the Dialog component # # @param [Hash] args dialog params @@ -17,7 +22,7 @@ module RETerm @message = [args[:message]].flatten.compact @buttons = [args[:buttons]].flatten.compact - @buttons = ["</B/24>OK", "</B16>Cancel"] if @buttons.empty? + @buttons = BUTTONS[:ok_cancel] if @buttons.empty? end # Client may invoke this to
Add map containing some dialog button combinations
movitto_reterm
train
rb
189f945c83bb5d3287a4b60f8eab5f43ec7dc56d
diff --git a/spec/unit/provider/service/freebsd_spec.rb b/spec/unit/provider/service/freebsd_spec.rb index <HASH>..<HASH> 100755 --- a/spec/unit/provider/service/freebsd_spec.rb +++ b/spec/unit/provider/service/freebsd_spec.rb @@ -44,6 +44,22 @@ OUTPUT expect(@provider.rcvar).to eq(['# ntpd', 'ntpd=YES']) end + it 'should parse service names with a description' do + @provider.stubs(:execute).returns <<OUTPUT +# local_unbound : local caching forwarding resolver +local_unbound_enable="YES" +OUTPUT + expect(@provider.service_name).to eq('local_unbound') + end + + it 'should parse service names without a description' do + @provider.stubs(:execute).returns <<OUTPUT +# local_unbound +local_unbound="YES" +OUTPUT + expect(@provider.service_name).to eq('local_unbound') + end + it "should find the right rcvar_value for FreeBSD < 7" do @provider.stubs(:rcvar).returns(['# ntpd', 'ntpd_enable=YES'])
(PUP-<I>) Add test for parsing FreeBSD service names. Add tests for parsing a FreeBSD service name with and without a description.
puppetlabs_puppet
train
rb
a201a3db629e8a959c909ccb755da6b0ec97fb9d
diff --git a/environment/src/main/java/jetbrains/exodus/env/EnvironmentImpl.java b/environment/src/main/java/jetbrains/exodus/env/EnvironmentImpl.java index <HASH>..<HASH> 100644 --- a/environment/src/main/java/jetbrains/exodus/env/EnvironmentImpl.java +++ b/environment/src/main/java/jetbrains/exodus/env/EnvironmentImpl.java @@ -397,9 +397,7 @@ public class EnvironmentImpl implements Environment { @Nullable BTree loadMetaTree(final long rootAddress) { if (rootAddress < 0 || rootAddress >= log.getHighAddress()) return null; - final BTree result = new BTree(log, getBTreeBalancePolicy(), rootAddress, false, META_TREE_ID); - result.setTreeNodesCache(treeNodesCache); - return result; + return new BTree(log, getBTreeBalancePolicy(), rootAddress, false, META_TREE_ID); } @SuppressWarnings("OverlyNestedMethod")
MetaTree doesn't affect tree nodes cache
JetBrains_xodus
train
java
0084803dec37a8d6e6aebcf00870b61166fa48e2
diff --git a/modules/social_features/social_event/modules/social_event_invite/src/SocialEventInviteAccessHelper.php b/modules/social_features/social_event/modules/social_event_invite/src/SocialEventInviteAccessHelper.php index <HASH>..<HASH> 100644 --- a/modules/social_features/social_event/modules/social_event_invite/src/SocialEventInviteAccessHelper.php +++ b/modules/social_features/social_event/modules/social_event_invite/src/SocialEventInviteAccessHelper.php @@ -158,9 +158,11 @@ class SocialEventInviteAccessHelper { // Get the user. $account = $this->routeMatch->getRawParameter('user'); - $account = User::load($account); - if ($account instanceof UserInterface) { - return AccessResult::allowedIf($account->id() === $this->currentUser->id()); + if (!empty($account)) { + $account = User::load($account); + if ($account instanceof UserInterface) { + return AccessResult::allowedIf($account->id() === $this->currentUser->id()); + } } return AccessResult::neutral();
Flipping string issue, grrr
goalgorilla_open_social
train
php
357f3d739440ccb02c7191073d95562ea3f98502
diff --git a/src/internal/arrays/arrays.js b/src/internal/arrays/arrays.js index <HASH>..<HASH> 100644 --- a/src/internal/arrays/arrays.js +++ b/src/internal/arrays/arrays.js @@ -127,7 +127,7 @@ // using the normal method - we want to do a smart update whereby elements // are removed from the right place. But we do need to clear the cache clearCache( root, keypath ); - + // find dependants. If any are DOM sections, we do a smart update // rather than a ractive.set() blunderbuss smartUpdateQueue = []; @@ -170,10 +170,14 @@ upstreamQueue[ upstreamQueue.length ] = keys.join( '.' ); } - // ...and length property! - upstreamQueue[ upstreamQueue.length ] = keypath + '.length'; - notifyMultipleDependants( root, upstreamQueue, true ); + + // length property has changed - notify dependants + // TODO in some cases (e.g. todo list example, when marking all as complete, then + // adding a new item (which should deactivate the 'all complete' checkbox + // but doesn't) this needs to happen before other updates. But doing so causes + // other mental problems. not sure what's going on... + notifyDependants( root, keypath + '.length', true ); }; // TODO can we get rid of this whole queueing nonsense?
hmmm.... weird bug, not sure how to classify it
ractivejs_ractive
train
js
a5a1adc833b099b7867e4b86ed5caf7d5a2c60be
diff --git a/pyvera/subscribe.py b/pyvera/subscribe.py index <HASH>..<HASH> 100644 --- a/pyvera/subscribe.py +++ b/pyvera/subscribe.py @@ -65,6 +65,8 @@ class SubscriptionRegistry(object): try: device_ids, timestamp = ( controller.get_changed_devices(timestamp)) + if self._exiting: + continue; if device_ids is None: LOG.info("No changes in poll interval") continue;
Don't call subscriptions if exiting.
pavoni_pyvera
train
py
acf14729254d1d6feb19d6f904d8128507d78e53
diff --git a/h2o-core/src/test/java/water/TCPReceiverThreadTest.java b/h2o-core/src/test/java/water/TCPReceiverThreadTest.java index <HASH>..<HASH> 100644 --- a/h2o-core/src/test/java/water/TCPReceiverThreadTest.java +++ b/h2o-core/src/test/java/water/TCPReceiverThreadTest.java @@ -49,6 +49,7 @@ public class TCPReceiverThreadTest extends TestUtil { } @Test + @Ignore // test only passes individually public void testConnectFromClientWhenClientsDisabled() throws Exception { NodeLocalEventCollectingListener ext = NodeLocalEventCollectingListener.getFreshInstance();
TCPReceiverThreadTest: reverted back to Ignoring the test The test doesn't work on Jenkins and is no longer necessary since SW doesn't use client mode by default
h2oai_h2o-3
train
java
416a8f2b80748203bc4c42e646eefd50ef825899
diff --git a/lib/query_data.js b/lib/query_data.js index <HASH>..<HASH> 100644 --- a/lib/query_data.js +++ b/lib/query_data.js @@ -6,7 +6,7 @@ var QueryData = function (data) { this.initPredefined(); }; -QueryData.predefinedNow = function () { +QueryData.prototype.predefinedNow = function () { return new Date(); };
fixed problem with '.now' argument
dimsmol_npgt
train
js
465652708034f4e1ba0d9f26e6ce0df2f6e8da56
diff --git a/concrete/blocks/form/auto.js b/concrete/blocks/form/auto.js index <HASH>..<HASH> 100644 --- a/concrete/blocks/form/auto.js +++ b/concrete/blocks/form/auto.js @@ -208,9 +208,9 @@ var miniSurvey = { if (key_val.length == 2) { if (key_val[0] == 'send_notification_from') { if (key_val[1] == 1) { - $('.send_notification_from_edit input').prop('checked', true); + $('input[name="send_notification_from_edit"]').prop('checked', true); } else { - $('.send_notification_from_edit input').prop('checked', false); + $('input[name="send_notification_from_edit"]').prop('checked', false); } } }
"reply to this email address" checked state was not properly passed to the form
concrete5_concrete5
train
js
423417ee82efa8d23e31ab8c52af6ff39e716953
diff --git a/test/AddTrackTests.js b/test/AddTrackTests.js index <HASH>..<HASH> 100644 --- a/test/AddTrackTests.js +++ b/test/AddTrackTests.js @@ -121,6 +121,7 @@ describe('Simple HiGlassComponent', () => { ptc = atm.plotTypeChooser; + console.warn('ptc.AVAILABLE_TRACK_TYPES', ptc.AVAILABLE_TRACK_TYPES); // should just have the horizontal-heatmap track type expect(ptc.AVAILABLE_TRACK_TYPES.length).to.eql(3);
Added a warn statement about the number of available tracks
higlass_higlass
train
js
1b51815dcceacdbbedc3490ad508d0e8e34f31b1
diff --git a/ContentSecurityPolicy/Violation/Log/Logger.php b/ContentSecurityPolicy/Violation/Log/Logger.php index <HASH>..<HASH> 100644 --- a/ContentSecurityPolicy/Violation/Log/Logger.php +++ b/ContentSecurityPolicy/Violation/Log/Logger.php @@ -20,7 +20,7 @@ class Logger public function log(Report $report) { - $this->logger->log($this->level, $this->logFormatter->format($report), array('csp-report' => $report->getData())); + $this->logger->log($this->level, $this->logFormatter->format($report), array('csp-report' => $report->getData(), 'user-agent' => $report->getUserAgent())); } public function getLogger()
Include user agent in logged CSP reports
nelmio_NelmioSecurityBundle
train
php
c1d5c614c38db015485190d65db05b0b75d171d4
diff --git a/git/repo/base.py b/git/repo/base.py index <HASH>..<HASH> 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -737,7 +737,7 @@ class Repo(object): return blames @classmethod - def init(cls, path=None, mkdir=True, **kwargs): + def init(cls, path=None, mkdir=True, odbt=DefaultDBType, **kwargs): """Initialize a git repository at the given path if specified :param path: @@ -762,7 +762,7 @@ class Repo(object): # git command automatically chdir into the directory git = Git(path) git.init(**kwargs) - return cls(path) + return cls(path, odbt=odbt) @classmethod def _clone(cls, git, url, path, odb_default_type, progress, **kwargs):
support passing odbt for using with Repo
gitpython-developers_GitPython
train
py
262cfb84f0febbc60fea6121161e338770114c52
diff --git a/framework/core/src/Events/RegisterApiRoutes.php b/framework/core/src/Events/RegisterApiRoutes.php index <HASH>..<HASH> 100644 --- a/framework/core/src/Events/RegisterApiRoutes.php +++ b/framework/core/src/Events/RegisterApiRoutes.php @@ -24,11 +24,21 @@ class RegisterApiRoutes $this->route('get', $url, $name, $action); } + public function post($url, $name, $action) + { + $this->route('post', $url, $name, $action); + } + public function patch($url, $name, $action) { $this->route('patch', $url, $name, $action); } + public function delete($url, $name, $action) + { + $this->route('delete', $url, $name, $action); + } + protected function route($method, $url, $name, $action) { $this->routes->$method($url, $name, $this->action($action));
Add API methods to add POST/DELETE routes to the API
flarum_core
train
php
58ed2bf436513609c914558611c462a6ffe9fe0c
diff --git a/state/unit_test.go b/state/unit_test.go index <HASH>..<HASH> 100644 --- a/state/unit_test.go +++ b/state/unit_test.go @@ -422,6 +422,8 @@ func (s *UnitSuite) TestGetSetClearResolved(c *C) { err = s.unit.ClearResolved() c.Assert(err, IsNil) + err = s.unit.SetResolved(state.ResolvedNone) + c.Assert(err, ErrorMatches, `cannot set resolved mode for unit "wordpress/0": invalid error resolution mode: ""`) err = s.unit.SetResolved(state.ResolvedMode("foo")) c.Assert(err, ErrorMatches, `cannot set resolved mode for unit "wordpress/0": invalid error resolution mode: "foo"`) }
add extra SetResolved test to cover behaviour tweak
juju_juju
train
go
90d8c74f479893070ab94329fa65596b5cb6f3eb
diff --git a/account/views.py b/account/views.py index <HASH>..<HASH> 100644 --- a/account/views.py +++ b/account/views.py @@ -283,8 +283,6 @@ class ConfirmEmailView(TemplateResponseMixin, View): def post(self, *args, **kwargs): self.object = confirmation = self.get_object() - if confirmation.email_address.user != self.request.user: - raise Http404() confirmation.confirm() user = confirmation.email_address.user user.is_active = True
Removed user check when confirming email address We can't try to be clever and ensure the email address confirmation is coming from who we expect. This view can be called anonymously due to ACCOUNT_EMAIL_CONFIRMATION_REQUIRED being True. Fixes #<I> and #<I>.
pinax_django-user-accounts
train
py
da4aed7a6ffcd7e25dc1159d9ce6bedf0cb9e960
diff --git a/src/PortaText/Command/Base.php b/src/PortaText/Command/Base.php index <HASH>..<HASH> 100644 --- a/src/PortaText/Command/Base.php +++ b/src/PortaText/Command/Base.php @@ -176,7 +176,6 @@ abstract class Base implements ICommand */ public function __construct() { - $this->logger = new NullLogger; $this->args = array(); } }
removing unused reference to stale variable
PortaText_php-sdk
train
php
d3f785d5c8199d28143df9d49a7f1c0d84c91b40
diff --git a/DependencyInjection/MongoDBExtension.php b/DependencyInjection/MongoDBExtension.php index <HASH>..<HASH> 100755 --- a/DependencyInjection/MongoDBExtension.php +++ b/DependencyInjection/MongoDBExtension.php @@ -74,8 +74,7 @@ class MongoDBExtension extends Extension */ protected function loadDefaults(array $config, ContainerBuilder $container) { - if(!$container->hasDefinition('doctrine.odm.mongodb.metadata.annotation')) - { + if (!$container->hasDefinition('doctrine.odm.mongodb.metadata.annotation')) { // Load DoctrineMongoDBBundle/Resources/config/mongodb.xml $loader = new XmlFileLoader($container, __DIR__.'/../Resources/config'); $loader->load($this->resources['mongodb']);
[DoctrineMongoDBBundle] fixed coding standards
doctrine_DoctrineMongoDBBundle
train
php
cecc3db7e78f5c346434a412100ba4f0cd7698a0
diff --git a/lib/simple_state_machine/simple_state_machine.rb b/lib/simple_state_machine/simple_state_machine.rb index <HASH>..<HASH> 100644 --- a/lib/simple_state_machine/simple_state_machine.rb +++ b/lib/simple_state_machine/simple_state_machine.rb @@ -89,7 +89,7 @@ module SimpleStateMachine # Graphviz dot format for rendering as a directional graph def to_graphviz_dot - transitions.map { |t| t.to_graphviz_dot }.join(";") + transitions.map { |t| t.to_graphviz_dot }.sort.join(";") end # Generates a url that renders states and events as a directional graph.
#to_graphviz_dot now returns data points in sorted order so specs don't fail at random
mdh_ssm
train
rb
bf41f18bbd4fb9b8fe4ab368620b7733af893f29
diff --git a/rocketbelt/components/buttons/rocketbelt.dynamic-button.js b/rocketbelt/components/buttons/rocketbelt.dynamic-button.js index <HASH>..<HASH> 100644 --- a/rocketbelt/components/buttons/rocketbelt.dynamic-button.js +++ b/rocketbelt/components/buttons/rocketbelt.dynamic-button.js @@ -33,7 +33,7 @@ var baseWidth = base.$el.outerWidth(); // Event attachment - base.$el.on('click', function (e) { + base.$el.on('click buttonActionBusy', function (e) { buttonActionBusy.call(this, btnClass, baseWidth); });
Add event to dynamic button so I don't have to fake a click binding
Pier1_rocketbelt
train
js
864e03f7890d82cdc3921aaf285227dd3915f5d1
diff --git a/lib/tacokit/transform.rb b/lib/tacokit/transform.rb index <HASH>..<HASH> 100644 --- a/lib/tacokit/transform.rb +++ b/lib/tacokit/transform.rb @@ -17,10 +17,8 @@ module Tacokit private def normalize_request_params(params) - {}.tap do |norm| - (params || {}).each do |key, value| - norm[key] = normalize_param_value(value) - end + (params || {}).each_with_object({}) do |(key, value), norm| + norm[key] = normalize_param_value(value) end end
Use each_with_object in serialization util
rossta_tacokit.rb
train
rb
86516fa423f26663cc6e9fdc797af1580bc19654
diff --git a/assets/javascript/app.js b/assets/javascript/app.js index <HASH>..<HASH> 100644 --- a/assets/javascript/app.js +++ b/assets/javascript/app.js @@ -301,7 +301,7 @@ App.IndexView = Em.View.extend({ Em.run.next(function(){ - if(localStorage && localStorage.logster_divider_top){ + if(localStorage && localStorage.logster_divider_bottom){ var fromTop = $win.height() - parseInt(localStorage.logster_divider_bottom,10); self.divideView(fromTop, $win); }
BUGFIX: divider playing up
discourse_logster
train
js
425e12d73b08000b2261d135f06f86367b7d4dac
diff --git a/src/Console/Commands/GenerateApiKey.php b/src/Console/Commands/GenerateApiKey.php index <HASH>..<HASH> 100644 --- a/src/Console/Commands/GenerateApiKey.php +++ b/src/Console/Commands/GenerateApiKey.php @@ -10,7 +10,7 @@ class GenerateApiKey extends Command /** * Error messages */ - const MESSAGE_ERROR_INVALID_NAME_FORMAT = 'Invalid name. Must be a lowercase alphabetic characters and hyphens less than 255 characters long.'; + const MESSAGE_ERROR_INVALID_NAME_FORMAT = 'Invalid name. Must be a lowercase alphabetic characters, numbers and hyphens less than 255 characters long.'; const MESSAGE_ERROR_NAME_ALREADY_USED = 'Name is unavailable.'; /**
Added the word "numbers" to the invalid api key name message
ejarnutowski_laravel-api-key
train
php
8b2df20b95cc11c6259674ee728aff0a716ca58e
diff --git a/src/Monolog/Processor/IntrospectionProcessor.php b/src/Monolog/Processor/IntrospectionProcessor.php index <HASH>..<HASH> 100644 --- a/src/Monolog/Processor/IntrospectionProcessor.php +++ b/src/Monolog/Processor/IntrospectionProcessor.php @@ -61,7 +61,7 @@ class IntrospectionProcessor $i = 0; - while (isset($trace[$i]['class']) || in_array($trace[$i]['function'], $this->skipFunctions)) { + while ($this->isTraceClassOrNotSkippedFunction($trace, $i)) { if (isset($trace[$i]['class'])) { foreach ($this->skipClassesPartials as $part) { if (strpos($trace[$i]['class'], $part) !== false) { @@ -90,4 +90,13 @@ class IntrospectionProcessor return $record; } + + private function isTraceClassOrNotSkippedFunction ($trace, $index) + { + if (isset($trace[$index]) === false) { + return false; + } + + return isset($trace[$index]['class']) || in_array($trace[$index]['function'], $this->skipFunctions); + } }
FIX IntrospectionProcessor: E_NOTICE Recent merge of #<I> misses check whether the trace exists at all at the specific index, leading to undefined offset. ``` E_NOTICE: Undefined offset: 3 ``` And because the while statement became unreadable (and too long), I moved it into a separate method.
Seldaek_monolog
train
php
f4c587218924cbb62cd2e643f394791c789c7f21
diff --git a/salt/modules/virtualenv.py b/salt/modules/virtualenv.py index <HASH>..<HASH> 100644 --- a/salt/modules/virtualenv.py +++ b/salt/modules/virtualenv.py @@ -11,7 +11,7 @@ __opts__ = { def create(path, venv_bin=__opts__['venv_bin'], - no_site_packages=False, + no_site_packages=True, system_site_packages=False, clear=False, python='',
changing virtualenv to use no-site-packages by default, since it has been change to be the default behavior
saltstack_salt
train
py
bdb8cd01a827494b7e10086e68909211e434813d
diff --git a/src/Auth/AuthenticationService.php b/src/Auth/AuthenticationService.php index <HASH>..<HASH> 100644 --- a/src/Auth/AuthenticationService.php +++ b/src/Auth/AuthenticationService.php @@ -81,4 +81,14 @@ class AuthenticationService extends ZendAuthService $this->user = null; // clear user (especially guest user) return parent::authenticate($adapter); } + + public function clearIdentity() + { + parent::clearIdentity(); + $this->user = null; + + return $this; + } + + }
[Auth] Fixes: User entity instance is not cleared upon clearing identity.
yawik_auth
train
php
b16721ebdce9c008d6b733b6cd73722d16f70106
diff --git a/biz/index.js b/biz/index.js index <HASH>..<HASH> 100644 --- a/biz/index.js +++ b/biz/index.js @@ -4,6 +4,7 @@ var util = require('../lib/util'); var HTTP_PROXY_RE = /^(?:proxy|http-proxy|http2https-proxy|https2http-proxy|internal-proxy):\/\//; var INTERNAL_APP; +var WEBUI_PATH; var PLUGIN_RE; function convertToLocalUIHost(req, isInternal) { @@ -14,7 +15,7 @@ function convertToLocalUIHost(req, isInternal) { module.exports = function(req, res, next) { var config = this.config; var pluginMgr = this.pluginMgr; - var WEBUI_PATH = config.WEBUI_PATH; + WEBUI_PATH = config.WEBUI_PATH; if (!INTERNAL_APP) { var webuiPathRe = util.escapeRegExp(WEBUI_PATH); INTERNAL_APP = new RegExp('^' + webuiPathRe + '(log|weinre)\\.(\\d{1,5})/');
refactor: the webui url
avwo_whistle
train
js
8fea05bfb432b19d198c240229b53f7e52f55498
diff --git a/grade/grading/form/rubric/lib.php b/grade/grading/form/rubric/lib.php index <HASH>..<HASH> 100644 --- a/grade/grading/form/rubric/lib.php +++ b/grade/grading/form/rubric/lib.php @@ -556,7 +556,8 @@ class gradingform_rubric_controller extends gradingform_controller { return $this->get_instance($instance); } if ($itemid && $raterid) { - if ($rs = $DB->get_records('grading_instances', array('raterid' => $raterid, 'itemid' => $itemid), 'timemodified DESC', '*', 0, 1)) { + $params = array('definitionid' => $this->definition->id, 'raterid' => $raterid, 'itemid' => $itemid); + if ($rs = $DB->get_records('grading_instances', $params, 'timemodified DESC', '*', 0, 1)) { $record = reset($rs); $currentinstance = $this->get_current_instance($raterid, $itemid); if ($record->status == gradingform_rubric_instance::INSTANCE_STATUS_INCOMPLETE &&
MDL-<I> gradingform_rubric Adding the definition when retrieving grading instances Credit to Sam Chaffee
moodle_moodle
train
php
18528e590cb8e1af1b2900c87ad8082839a3d52e
diff --git a/ml-agents/mlagents/envs/rpc_communicator.py b/ml-agents/mlagents/envs/rpc_communicator.py index <HASH>..<HASH> 100644 --- a/ml-agents/mlagents/envs/rpc_communicator.py +++ b/ml-agents/mlagents/envs/rpc_communicator.py @@ -53,7 +53,9 @@ class RpcCommunicator(Communicator): self.server = grpc.server(ThreadPoolExecutor(max_workers=10)) self.unity_to_external = UnityToExternalServicerImplementation() add_UnityToExternalServicer_to_server(self.unity_to_external, self.server) - self.server.add_insecure_port('localhost:' + str(self.port)) + # Using unspecified address, which means that grpc is communicating on all IPs + # This is so that the docker container can connect. + self.server.add_insecure_port('[::]:' + str(self.port)) self.server.start() self.is_open = True except:
Fix In editor Docker training (#<I>)
Unity-Technologies_ml-agents
train
py
d892f0fc8585ac1de6c4d0d6e51f46eff35c35d0
diff --git a/metpy/io/tools.py b/metpy/io/tools.py index <HASH>..<HASH> 100644 --- a/metpy/io/tools.py +++ b/metpy/io/tools.py @@ -223,10 +223,11 @@ def zlib_decompress_all_frames(data): decomp = zlib.decompressobj() try: frames.extend(decomp.decompress(data)) + data = decomp.unused_data except zlib.error: + frames.extend(data) break - data = decomp.unused_data - return frames + data + return frames def bits_to_code(val):
Small cleanup for zlib decompression.
Unidata_MetPy
train
py
e3706b809a067c80514a6b5aeb516623eeacbb57
diff --git a/src/Stillat/Common/Collections/Sorting/BaseSorter.php b/src/Stillat/Common/Collections/Sorting/BaseSorter.php index <HASH>..<HASH> 100644 --- a/src/Stillat/Common/Collections/Sorting/BaseSorter.php +++ b/src/Stillat/Common/Collections/Sorting/BaseSorter.php @@ -2,7 +2,7 @@ use Stillat\Common\Collections\ArraySortingInterface; -class BaseSorter implements ArraySortingInterface { +abstract class BaseSorter implements ArraySortingInterface { protected $forwardSort = true; @@ -14,5 +14,5 @@ class BaseSorter implements ArraySortingInterface { abstract function sort(array $collection); abstract function tros(array $collection); - + } \ No newline at end of file
Redeclared BaseSorter as abstract.
Stillat_Common
train
php
d3245e618cbdf49eb494207d9bc9a0f3b08f41dc
diff --git a/src/commands/lint.js b/src/commands/lint.js index <HASH>..<HASH> 100644 --- a/src/commands/lint.js +++ b/src/commands/lint.js @@ -60,11 +60,12 @@ function lintSources(args) { function lintTests(args) { let eslintArgs = [ - '--ignore-pattern "src/**"', - '--ignore-pattern "!**/__tests__"', - '--ignore-pattern "!**/__tests__/**"', + '--ignore-pattern "**/__fixture__"', + '--ignore-pattern "**/__fixture__/**"', + '--ignore-pattern "**/__fixtures__"', + '--ignore-pattern "**/__fixtures__/**"', `--config "${CONFIG_PATH}"`, - `"${join(getProjectDir(), 'src')}"`, + `"${join(getProjectDir(), 'src')}/**/__tests__/**"`, ] let {fix} = args
Simplify eslint tests pattern
borela-tech_js-toolbox
train
js
824ed6345bc69e2aeab8473d383a3916242f80e1
diff --git a/modules/Redirect.js b/modules/Redirect.js index <HASH>..<HASH> 100644 --- a/modules/Redirect.js +++ b/modules/Redirect.js @@ -1,9 +1,10 @@ import React from 'react'; import invariant from 'invariant'; import { createRouteFromReactElement } from './RouteUtils'; +import { formatPattern } from './URLUtils'; import { falsy } from './PropTypes'; -var { string } = React.PropTypes; +var { string, object } = React.PropTypes; export var Redirect = React.createClass({ @@ -15,8 +16,15 @@ export var Redirect = React.createClass({ if (route.from) route.path = route.from; - route.onEnter = function (nextState, router) { - router.replaceWith(route.to, nextState.query); + route.onEnter = function (nextState, transition) { + var { location, params } = nextState; + var pathname = route.to ? formatPattern(route.to, params) : location.pathname; + + transition.to( + pathname, + route.query || location.query, + route.state || location.state + ); }; return route; @@ -25,8 +33,11 @@ export var Redirect = React.createClass({ }, propTypes: { - from: string, + path: string, + from: string, // Alias for path to: string.isRequired, + query: object, + state: object, onEnter: falsy, children: falsy },
[fixed] <Redirect> handling [added] <Redirect query> [added] <Redirect state>
taion_rrtr
train
js
0b1bfb15047d761feb50522af7e8c553877b5992
diff --git a/Grido/DataSources/ArraySource.php b/Grido/DataSources/ArraySource.php index <HASH>..<HASH> 100644 --- a/Grido/DataSources/ArraySource.php +++ b/Grido/DataSources/ArraySource.php @@ -53,12 +53,12 @@ class ArraySource extends \Nette\Object implements IDataSource * @param array $condition * @return void */ - protected function getFilter($selection, array $condition) + protected function getFilter(array $condition) { $value = $condition[1]; $condition = $this->formatFilterCondition($condition); - return array_filter($selection, function ($row) use ($value, $condition) { + return array_filter($this->data, function ($row) use ($value, $condition) { if ($condition[1] === 'LIKE') { if (strlen($value) <= 2) { return TRUE;
DataSources\ArraySource: Typo
o5_grido
train
php
57b17ceb7b562a7ec001d9785f69b5a168ca1f26
diff --git a/penaltymodel_cache/tests/test_interface.py b/penaltymodel_cache/tests/test_interface.py index <HASH>..<HASH> 100644 --- a/penaltymodel_cache/tests/test_interface.py +++ b/penaltymodel_cache/tests/test_interface.py @@ -198,3 +198,20 @@ class TestInterfaceFunctions(unittest.TestCase): self.assertNotEqual(ret_pmodel, pmodel) except: pass + + def test_one_variable_insert_retrieve(self): + dbfile = self.database + + # generate one variable model (i.e. no quadratic terms) + spec = pm.Specification(graph=nx.complete_graph(1), + decision_variables=[0], + feasible_configurations=[(-1,)], + min_classical_gap=2, vartype='SPIN') + pmodel = pm.get_penalty_model(spec) + + # insert model into cache + pmc.cache_penalty_model(pmodel, database=dbfile) + + # retrieve model back from cache + retrieved_model = pmc.get_penalty_model(spec, database=dbfile) + self.assertEqual(pmodel, retrieved_model)
Add rough version of one-variable cache test
dwavesystems_penaltymodel
train
py
bf678fccd39604d4afd803e703da21acbe3674e4
diff --git a/guanciale/config.py b/guanciale/config.py index <HASH>..<HASH> 100644 --- a/guanciale/config.py +++ b/guanciale/config.py @@ -131,7 +131,11 @@ def populateConfig_idacmd(): #TODO add native macOS and Linux support #get wine full path - winepath = subprocess.check_output("which wine", shell=True).rstrip() + winepath = "" + try: + winepath = subprocess.check_output("which wine", shell=True).rstrip() + except: + pass if len(winepath) > 0: #wine is in PATH prefix = "~/.wine" try:
solved 'which wine' issue in config.py
Carbonara-Project_Guanciale
train
py
38077253561947040f8143ff3d5ca7683bda7d44
diff --git a/lib/proxy.js b/lib/proxy.js index <HASH>..<HASH> 100644 --- a/lib/proxy.js +++ b/lib/proxy.js @@ -389,7 +389,7 @@ ReverseProxy.prototype._defaultResolver.priority = 0; ReverseProxy.prototype.resolve = function(host, url){ var route; - host = host || host.toLowerCase(); + host = host && host.toLowerCase(); for(var i=0; i < this.resolvers.length; i++){ route = this.resolvers[i].call(this, host, url); if(route && (route = ReverseProxy.buildRoute(route))){ diff --git a/test/test_register.js b/test/test_register.js index <HASH>..<HASH> 100644 --- a/test/test_register.js +++ b/test/test_register.js @@ -45,7 +45,9 @@ describe("Route registration", function(){ redbird.register('example.com', '192.168.1.2:8080'); - expect(redbird.resolve('Example.com')).to.be.an("object"); + var target = redbird.resolve('Example.com'); + expect(target).to.be.an("object"); + expect(target.urls[0].hostname).to.be.equal('192.168.1.2'); redbird.close(); });
re-fixed #<I>
OptimalBits_redbird
train
js,js
dbbde1e89bb3f43e09e86e4a8a029ffba080a791
diff --git a/nsqd/diskqueue_test.go b/nsqd/diskqueue_test.go index <HASH>..<HASH> 100644 --- a/nsqd/diskqueue_test.go +++ b/nsqd/diskqueue_test.go @@ -345,8 +345,10 @@ func BenchmarkDiskQueueGet(b *testing.B) { } defer os.RemoveAll(tmpDir) dq := newDiskQueue(dqName, tmpDir, 1024768, 0, 1<<10, 2500, 2*time.Second, l) + data := []byte("aaaaaaaaaaaaaaaaaaaaaaaaaaa") + b.SetBytes(int64(len(data))) for i := 0; i < b.N; i++ { - dq.Put([]byte("aaaaaaaaaaaaaaaaaaaaaaaaaaa")) + dq.Put(data) } b.StartTimer()
provide bytes indicator for BenchmarkDiskQueueGet, like the others
nsqio_nsq
train
go
6f3ff704835a0582e467f85b24d84b88eddc92e1
diff --git a/lib/seahorse/client/request.rb b/lib/seahorse/client/request.rb index <HASH>..<HASH> 100644 --- a/lib/seahorse/client/request.rb +++ b/lib/seahorse/client/request.rb @@ -63,8 +63,8 @@ module Seahorse private - def emit(*args, &block) - @events.emit(*args, &block) + def emit(*args) + @events.emit(*args) end end
Removed untested block param to Request#emit.
aws_aws-sdk-ruby
train
rb
6d30bfa0a902cd1aa06f6f96d4587c4881b28420
diff --git a/lib/celerity/elements/table.rb b/lib/celerity/elements/table.rb index <HASH>..<HASH> 100644 --- a/lib/celerity/elements/table.rb +++ b/lib/celerity/elements/table.rb @@ -21,7 +21,12 @@ module Celerity def locate super - if @object # cant call assert_exists here, as an exists? method call will fail + if @object + + unless @object.kind_of?(HtmlUnit::Html::HtmlTable) + raise TypeError, "expected HtmlTable, got #{@object.class}" + end + @rows = @object.getRows @cells = [] @rows.each do |row|
Add a guard for invalid use of XPath in Table#locate
jarib_celerity
train
rb
a69a718bd89086cad23180382f6dd0bc73709ce5
diff --git a/src/main/java/hex/CoxPH.java b/src/main/java/hex/CoxPH.java index <HASH>..<HASH> 100644 --- a/src/main/java/hex/CoxPH.java +++ b/src/main/java/hex/CoxPH.java @@ -527,10 +527,8 @@ public class CoxPH extends Job { for (int i = 0; i <= iter_max; ++i) { model.iter = i; - // Map, Reduce & Finalize CoxPHMRTask coxMR = new CoxPHMRTask(newCoef, model.min_time, n_time, use_start_column, model.x_mean).doAll(source.vecs()); - coxMR.finish(); if (i == 0) model.calcCounts(coxMR); @@ -740,7 +738,8 @@ public class CoxPH extends Job { Utils.add(rcumsumXXRisk, that.rcumsumXXRisk); } - protected void finish() { + @Override + protected void postGlobal() { if (!_use_start_column) { for (int t = rcumsumRisk.length - 2; t >= 0; --t) rcumsumRisk[t] += rcumsumRisk[t + 1];
Overload postGlobal method in CoxPH.
h2oai_h2o-2
train
java
16489dc08435ff9f51bb403084e35fa4dffb03be
diff --git a/src/Composer/Downloader/SvnDownloader.php b/src/Composer/Downloader/SvnDownloader.php index <HASH>..<HASH> 100644 --- a/src/Composer/Downloader/SvnDownloader.php +++ b/src/Composer/Downloader/SvnDownloader.php @@ -48,7 +48,7 @@ class SvnDownloader extends VcsDownloader } $this->io->write(" Checking out " . $ref); - $this->execute($url, "svn switch", sprintf("%s/%s", $url, $ref), $path); + $this->execute($url, "svn switch --ignore-ancestry", sprintf("%s/%s", $url, $ref), $path); } /**
Update SvnDownloader.php added --ignore-ancestry to the switch statement because it can be a problem with svn:properties
mothership-ec_composer
train
php
1518365d87c112d032206facd706413d6256ebcc
diff --git a/src/Rasterization/Renderers/SVGRenderer.php b/src/Rasterization/Renderers/SVGRenderer.php index <HASH>..<HASH> 100644 --- a/src/Rasterization/Renderers/SVGRenderer.php +++ b/src/Rasterization/Renderers/SVGRenderer.php @@ -75,8 +75,8 @@ abstract class SVGRenderer $color = SVG::parseColor($color); $rgb = ($color[0] << 16) + ($color[1] << 8) + ($color[2]); - $a = 127 - intval($color[3] * 127 / 255); - $a = $a * self::calculateTotalOpacity($context); + $opacity = self::calculateTotalOpacity($context); + $a = 127 - $opacity * intval($color[3] * 127 / 255); return $rgb | ($a << 24); }
Fix opacity calculation for renderers
meyfa_php-svg
train
php
9101636bf60af71aa5902ff1d9f469ca3b2e0b36
diff --git a/zipline/assets/assets.py b/zipline/assets/assets.py index <HASH>..<HASH> 100644 --- a/zipline/assets/assets.py +++ b/zipline/assets/assets.py @@ -256,9 +256,6 @@ class AssetFinder(object): """ return self._retrieve_assets(sids, self.futures_contracts, Future) - def _retrieve_futures_contract(self, sid): - return self._retrieve_futures_contracts((sid,))[sid] - @staticmethod def _select_assets_by_sid(asset_tbl, sids): return sa.select([asset_tbl]).where(
MAINT: Remove unused method.
quantopian_zipline
train
py
2ea17181e3e1ee3b1bea490f405c044385a11ae2
diff --git a/src/js/select2/core.js b/src/js/select2/core.js index <HASH>..<HASH> 100644 --- a/src/js/select2/core.js +++ b/src/js/select2/core.js @@ -276,6 +276,23 @@ define([ Select2.prototype._registerEvents = function () { var self = this; + + this.on('focus', function () { + self.$container.addClass('select2-container--focus'); + + if (!self.$container.hasClass('select2-container--disabled') && + !self.isOpen()) { + if (self.options.get('multiple')) { + window.setTimeout(function () { + self.open(); + }, + self.options.get('ajax') ? 300 : 100); + } + else { + self.open(); + } + } + }); this.on('open', function () { self.$container.addClass('select2-container--open');
PR for -> autofocus isn't supported #<I> (#<I>) * Update core.js * Update core.js * Update core.js
select2_select2
train
js
e43c809c1db5bf5be560bd607150befb65668b43
diff --git a/vyper/context/types/meta/interface.py b/vyper/context/types/meta/interface.py index <HASH>..<HASH> 100644 --- a/vyper/context/types/meta/interface.py +++ b/vyper/context/types/meta/interface.py @@ -37,6 +37,9 @@ class InterfaceDefinition(MemberTypeDefinition): for key, type_ in members.items(): self.add_member(key, type_) + def get_signature(self): + return (), AddressDefinition() + class InterfacePrimitive:
fix: return address in interface `get_signature`
ethereum_vyper
train
py
fd2a0d8264319a47a2422b544c15622b5cc7c735
diff --git a/src/test/org/openscience/cdk/renderer/generators/ExtendedAtomGeneratorTest.java b/src/test/org/openscience/cdk/renderer/generators/ExtendedAtomGeneratorTest.java index <HASH>..<HASH> 100644 --- a/src/test/org/openscience/cdk/renderer/generators/ExtendedAtomGeneratorTest.java +++ b/src/test/org/openscience/cdk/renderer/generators/ExtendedAtomGeneratorTest.java @@ -82,8 +82,8 @@ public class ExtendedAtomGeneratorTest extends BasicAtomGeneratorTest { int alignment = 1; AtomSymbolElement element = generator.generateElement(atom, alignment, model); - Assert.assertEquals(atom.getPoint2d().x, element.xCoord); - Assert.assertEquals(atom.getPoint2d().y, element.yCoord); + Assert.assertEquals(atom.getPoint2d().x, element.xCoord, 0.1); + Assert.assertEquals(atom.getPoint2d().y, element.yCoord, 0.1); Assert.assertEquals(atom.getSymbol(), element.text); Assert.assertEquals((int)atom.getFormalCharge(), element.formalCharge); Assert.assertEquals((int)atom.getImplicitHydrogenCount(), element.hydrogenCount);
Providing required delta for comparing floating points.
cdk_cdk
train
java
aa5ea652c8864f014e1fa480d7e504f0d742c170
diff --git a/integration-cli/docker_cli_update_unix_test.go b/integration-cli/docker_cli_update_unix_test.go index <HASH>..<HASH> 100644 --- a/integration-cli/docker_cli_update_unix_test.go +++ b/integration-cli/docker_cli_update_unix_test.go @@ -180,7 +180,7 @@ func GetKernelVersion() *kernel.VersionInfo { // CheckKernelVersion checks if current kernel is newer than (or equal to) // the given version. func CheckKernelVersion(k, major, minor int) bool { - return kernel.CompareKernelVersion(*GetKernelVersion(), kernel.VersionInfo{Kernel: k, Major: major, Minor: minor}) > 0 + return kernel.CompareKernelVersion(*GetKernelVersion(), kernel.VersionInfo{Kernel: k, Major: major, Minor: minor}) >= 0 } func (s *DockerSuite) TestUpdateSwapMemoryOnly(c *check.C) {
[integration-cli] fix s<I>x flaky test s<I>x node-1 has kernel <I>, kernel.CompareKernelVersion() returns 0 if the kernels are equal, so include that. Full logic for CompareKernelVersion() is a > b ret 1, a == b ret 0, a < b ret -1
moby_moby
train
go
7b26c661a4b4bec3c71d835ddc0435a88969eb33
diff --git a/lxd/network/network_utils.go b/lxd/network/network_utils.go index <HASH>..<HASH> 100644 --- a/lxd/network/network_utils.go +++ b/lxd/network/network_utils.go @@ -38,8 +38,9 @@ func IsInUse(c instance.Instance, networkName string) bool { continue } - if d["network"] == networkName { - return true + // Temporarily populate parent from network setting if used. + if d["network"] != "" { + d["parent"] = d["network"] } if d["parent"] == "" {
lxd/network/network/utils: Updates network setting detection in IsInUse
lxc_lxd
train
go
965baaf276bd8b7ef3676f6fa9af19b1caddfe92
diff --git a/estnltk/tests/test_timex.py b/estnltk/tests/test_timex.py index <HASH>..<HASH> 100644 --- a/estnltk/tests/test_timex.py +++ b/estnltk/tests/test_timex.py @@ -23,7 +23,7 @@ class TimexTest(unittest.TestCase): 'id': 0, 'start': 0, 'temporal_function': False, - 'text': '3 . detsembril 2014', + 'text': '3. detsembril 2014', 'tid': 't1', 'type': 'DATE', 'value': '2014-12-03'},
Small update in TimexTest (die to updated word tokenizer)
estnltk_estnltk
train
py
49fd5a646f329be1147b43b8c2c611f1424abe22
diff --git a/spacy/about.py b/spacy/about.py index <HASH>..<HASH> 100644 --- a/spacy/about.py +++ b/spacy/about.py @@ -3,13 +3,13 @@ # https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py __title__ = 'spacy' -__version__ = '2.0.2.dev1' +__version__ = '2.0.2' __summary__ = 'Industrial-strength Natural Language Processing (NLP) with Python and Cython' __uri__ = 'https://spacy.io' __author__ = 'Explosion AI' __email__ = '[email protected]' __license__ = 'MIT' -__release__ = False +__release__ = True __docs_models__ = 'https://spacy.io/usage/models' __download_url__ = 'https://github.com/explosion/spacy-models/releases/download'
Set version for <I> release
explosion_spaCy
train
py
e39650b7ecc9d9ac9c8d7d8375052ba10ecb533d
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -11,7 +11,7 @@ module ActionDispatch class Mapper URL_OPTIONS = [:protocol, :subdomain, :domain, :host, :port] - class Constraints < Endpoint #:nodoc: + class Constraints < Routing::Endpoint #:nodoc: attr_reader :app, :constraints SERVE = ->(app, req) { app.serve req }
Add `Routing` namespace to point appropriate constant Make it clear we use `ActionDispatch::Routing::Endpoint`
rails_rails
train
rb
98df9123a7971c0256fec2e0fe3ba72ecb8776bf
diff --git a/pycbc/tmpltbank/brute_force_methods.py b/pycbc/tmpltbank/brute_force_methods.py index <HASH>..<HASH> 100644 --- a/pycbc/tmpltbank/brute_force_methods.py +++ b/pycbc/tmpltbank/brute_force_methods.py @@ -332,7 +332,7 @@ def get_mass_distribution(bestMasses, scaleFactor, order, evecs, evals, \ totmass[mass2 > maxmass2] = 0.0001 # There is some numerical error which can push this a bit higher. We do # *not* want to reject the initial guide point. This error comes from - # Masses -> totmass, eta -> masses conversion, we will have points pushing + # Masses -> totmass, eta -> masses conversion, we will have points pushing # onto the boudaries of the space. if maxTotalMass: totmass[totmass > maxTotalMass*1.0001] = 0.0001
Some non-ASCII character crept in ... not sure how this happens!
gwastro_pycbc
train
py
6c0355c95cf94deb91922fe176ec7a39e6252efe
diff --git a/src/OfficeConverter/OfficeConverter.php b/src/OfficeConverter/OfficeConverter.php index <HASH>..<HASH> 100755 --- a/src/OfficeConverter/OfficeConverter.php +++ b/src/OfficeConverter/OfficeConverter.php @@ -129,7 +129,7 @@ class OfficeConverter protected function prepOutput($outdir, $filename, $outputExtension) { $DS = DIRECTORY_SEPARATOR; - $tmpName = str_replace($this->extension, '', $this->basename).$outputExtension; + $tmpName = ($this->extension ? str_replace($this->extension, '', $this->basename) : $this->basename . '.').$outputExtension; if (rename($outdir.$DS.$tmpName, $outdir.$DS.$filename)) { return $outdir.$DS.$filename; } elseif (is_file($outdir.$DS.$tmpName)) {
Fix: when temp file has no extension rename faild
ncjoes_office-converter
train
php
93ef768c9130aa5d6a53358a5da3141286bd80dd
diff --git a/user_management/api/serializers.py b/user_management/api/serializers.py index <HASH>..<HASH> 100644 --- a/user_management/api/serializers.py +++ b/user_management/api/serializers.py @@ -11,7 +11,8 @@ User = get_user_model() class UniqueEmailValidator(validators.UniqueValidator): def filter_queryset(self, value, queryset): """Check lower-cased email is unique.""" - return super(UniqueEmailValidator, self).filter_queryset( + return validators.UniqueValidator.filter_queryset( + self, value.lower(), queryset, )
Add old-style class compatible superclass call * DRF validators are old-style classes on python2.
incuna_django-user-management
train
py
2dfa7c203b8eeba93f0d0643bdc9e18c4e51328e
diff --git a/prompt-autocomplete.js b/prompt-autocomplete.js index <HASH>..<HASH> 100644 --- a/prompt-autocomplete.js +++ b/prompt-autocomplete.js @@ -13,7 +13,7 @@ function askQuestion () { var items = arguments[1]; var config = (typeof arguments[2] == 'function' ? {} : arguments[2] || {}); var answerCallback = (typeof arguments[2] == 'function' ? arguments[2] : arguments[3]); - var maxAutocomplete = config.maxAutocomplete || 5; + var maxAutocomplete = config.maxAutocomplete || process.stdout.rows - 2; var highlightMode = config.highlightMode || "bright"; var candidates = [];
set default maxAutocomplete dynamically, based on the prompt height
rickbergfalk_prompt-autocomplete
train
js
93890cd085005676b1b782d09fc2670b9140c504
diff --git a/goatools/anno/annoreader_base.py b/goatools/anno/annoreader_base.py index <HASH>..<HASH> 100755 --- a/goatools/anno/annoreader_base.py +++ b/goatools/anno/annoreader_base.py @@ -49,6 +49,19 @@ class AnnoReaderBase(object): self.associations = self._init_associations(filename, **kws) # assert self.associations, 'NO ANNOTATIONS FOUND: {ANNO}'.format(ANNO=filename) + def get_population(self): + """Get population IDs (all DB_IDs)""" + return self._get_population(self.associations) + + def get_ids_g_goids(self, goids): + """Get database IDs (DB_IDs), given a set of GO IDs.""" + return set(nt.DB_ID for nt in self.associations if nt.GO_ID in goids) + + @staticmethod + def _get_population(associations): + """Get all IDs in the associations""" + return set(nt.DB_ID for nt in associations) + def get_id2gos(self, **kws): """Get associations in dict, id2gos""" options = AnnoOptions(**kws)
New functions to return population and IDs assc w/set of GO IDs
tanghaibao_goatools
train
py
c98a074f0dd14a646a3eb919397f38b2a8269ba5
diff --git a/common/config.go b/common/config.go index <HASH>..<HASH> 100644 --- a/common/config.go +++ b/common/config.go @@ -44,9 +44,9 @@ func ChooseString(vals ...string) string { return "" } -// SupportedURL verifies that the url passed is actually supported or not +// SupportedProtocol verifies that the url passed is actually supported or not // This will also validate that the protocol is one that's actually implemented. -func SupportedURL(u *url.URL) bool { +func SupportedProtocol(u *url.URL) bool { // url.Parse shouldn't return nil except on error....but it can. if u == nil { return false @@ -159,7 +159,7 @@ func ValidatedURL(original string) (string, error) { } // We should now have a url, so verify that it's a protocol we support. - if !SupportedURL(u) { + if !SupportedProtocol(u) { return "", fmt.Errorf("Unsupported protocol scheme! (%#v)", u) }
Renamed common/config.go's SupportedURL to SupportedProtocol as suggested by @SwampDragons.
hashicorp_packer
train
go
7a923d67d7d77ac994c55a395047d18cf5ec6505
diff --git a/lib/feed2email/config.rb b/lib/feed2email/config.rb index <HASH>..<HASH> 100644 --- a/lib/feed2email/config.rb +++ b/lib/feed2email/config.rb @@ -11,7 +11,7 @@ module Feed2Email attr_reader :path def initialize(path) - @path = File.expand_path(path) + @path = path check end
Do not expand config path Assume it is absolute
agorf_feed2email
train
rb
52f049179c322e379d342f3fc195f1a8c978236f
diff --git a/source/index.js b/source/index.js index <HASH>..<HASH> 100644 --- a/source/index.js +++ b/source/index.js @@ -60,17 +60,6 @@ function DotCfg(namespace, scope, strategy) { } /** - * Static methods - */ -DotCfg.strategy = dotStrategyDefault; -DotCfg.assign = assignStrategy; -DotCfg.normalize = normalize; -DotCfg.resolver = resolver; -DotCfg.resolve = resolve; -DotCfg.write = write; -DotCfg.read = read; - -/** * Public methods and properties. */ DotCfg.prototype = { @@ -138,4 +127,15 @@ DotCfg.prototype = { }, }; +/** + * Static methods + */ +DotCfg.strategy = dotStrategyDefault; +DotCfg.assign = assignStrategy; +DotCfg.normalize = normalize; +DotCfg.resolver = resolver; +DotCfg.resolve = resolve; +DotCfg.write = write; +DotCfg.read = read; + export default DotCfg;
chore: recursive option to normalize
adriancmiranda_dotcfg
train
js
af4ccbd4e7662789dc93796333b97af2b1816933
diff --git a/mqtt/client/pubsubs.py b/mqtt/client/pubsubs.py index <HASH>..<HASH> 100644 --- a/mqtt/client/pubsubs.py +++ b/mqtt/client/pubsubs.py @@ -151,7 +151,8 @@ class MQTTProtocol(MQTTBaseProtocol): self._factor = self.DEFAULT_FACTOR # additional, per-connection subscriber state self._onPublish = None - + # a callback for when .connect() is done + self._onMqttConnectionMade = None # ----------------------------- @@ -356,6 +357,8 @@ class MQTTProtocol(MQTTBaseProtocol): self._purgeSession() else: self._syncSession() + if self._onMqttConnectionMade: + self._onMqttConnectionMade() # --------------------------- # State Machine API callbacks
Add a callback when the CONNACK has been sent, letting twisted know it's fully connected, not just TCP connected.
astrorafael_twisted-mqtt
train
py
67fedaf6dd684f53f465d7698aef378ec8d63c85
diff --git a/tests/test_simulate_consistency.py b/tests/test_simulate_consistency.py index <HASH>..<HASH> 100644 --- a/tests/test_simulate_consistency.py +++ b/tests/test_simulate_consistency.py @@ -31,6 +31,7 @@ def test_100genes_main(): 'use_unmapped': False, 'processes': 0, 'num_permutations': 100, + 'seed': None, 'kind': 'oncogene'} result = sc.main(opts) diff --git a/tests/test_simulate_performance.py b/tests/test_simulate_performance.py index <HASH>..<HASH> 100644 --- a/tests/test_simulate_performance.py +++ b/tests/test_simulate_performance.py @@ -33,6 +33,7 @@ def test_100genes_main(): 'random_samples': True, 'random_tumor_types': False, 'bootstrap': False, + 'seed': None, 'start_sample_rate': .1, 'end_sample_rate': 1.0, 'num_sample_rate': 3}
Fixed unit tests for simulations to include the seed parameter
KarchinLab_probabilistic2020
train
py,py
9ce7e67cde6d2bcc088c0aa100f18f3cbe19f531
diff --git a/goDB/Implementations/sqlite.php b/goDB/Implementations/sqlite.php index <HASH>..<HASH> 100644 --- a/goDB/Implementations/sqlite.php +++ b/goDB/Implementations/sqlite.php @@ -175,6 +175,17 @@ final class sqlite extends Base * @override Base * * @param mixed $connection + * @param scalar $value + * @return string + */ + public function reprString($connection, $value) { + return "'".$this->escapeString($connection, $value)."'"; + } + + /** + * @override Base + * + * @param mixed $connection * @param string $value * @return string */
[Issue #<I>]: fix sqlite escape (single quotes for value)
vasa-c_go-db
train
php
a52709584ebdaebc47e0c0a57e86f33b429d3fda
diff --git a/lib/todoist/plugin.rb b/lib/todoist/plugin.rb index <HASH>..<HASH> 100644 --- a/lib/todoist/plugin.rb +++ b/lib/todoist/plugin.rb @@ -108,8 +108,10 @@ module Danger @todos = [] return if files_of_interest.empty? - @todos = DiffTodoFinder.new(keywords).call(diffs_of_interest) + - DiffInlineTodoFinder.new(keywords).call(diffs_of_interest) + @todos = finders + .map { |finder_class| finder_class.new(keywords) } + .map { |finder| finder.call(diffs_of_interest) } + .flatten end def keywords @@ -142,6 +144,10 @@ module Danger def log_unable_to_find_diff(file) markdown("* danger-todoist was unable to determine diff for \"#{file}\".") end + + def finders + [DiffTodoFinder, DiffInlineTodoFinder] + end end # Null object incase a diff cannot be determined
Extract finders array and map over them
hanneskaeufler_danger-todoist
train
rb
cc7bb29944147fb36e7e76ac1c2fe8f470af4b13
diff --git a/table.go b/table.go index <HASH>..<HASH> 100644 --- a/table.go +++ b/table.go @@ -539,6 +539,9 @@ ColumnLoop: // Get the cell. cell := getCell(row, column) + if cell == nil { + continue + } // Determine colors. bgColor := t.backgroundColor
Avoiding access to nil pointer.
rivo_tview
train
go
fe34ca4dcb8b9246cde42fc17aef11013aacbacc
diff --git a/spec/adhearsion/rayo/commands/output_spec.rb b/spec/adhearsion/rayo/commands/output_spec.rb index <HASH>..<HASH> 100644 --- a/spec/adhearsion/rayo/commands/output_spec.rb +++ b/spec/adhearsion/rayo/commands/output_spec.rb @@ -249,8 +249,24 @@ module Adhearsion end describe "#interruptible_play" do - pending - end + let(:ssml) { RubySpeech::SSML.draw {"press a button"} } + let(:component) { + Punchblock::Component::Input.new( + {:mode => :dtmf, + :grammar => {:value => '[1 DIGIT]', :content_type => 'application/grammar+voxeo'} + }) + } + it "accepts SSML to play as a prompt" do + mock_execution_environment.should_receive(:interruptible_play).once.with(ssml) + mock_execution_environment.interruptible_play(ssml).should be nil + end + + it "sends the correct input command" do + pending + #expect_message_waiting_for_response component + #mock_execution_environment.interruptible_play(ssml) + end + end#describe #interruptible_play describe "#raw_output" do pending
Added a simple test for interruptible_play
adhearsion_adhearsion
train
rb
1e7ba09b60aa0bc527dc7e0159071a6d47796de4
diff --git a/integration-cli/docker_cli_build_test.go b/integration-cli/docker_cli_build_test.go index <HASH>..<HASH> 100644 --- a/integration-cli/docker_cli_build_test.go +++ b/integration-cli/docker_cli_build_test.go @@ -1732,6 +1732,29 @@ func TestBuildExpose(t *testing.T) { logDone("build - expose") } +func TestBuildExposeOrder(t *testing.T) { + buildID := func(name, exposed string) string { + _, err := buildImage(name, fmt.Sprintf(`FROM scratch + EXPOSE %s`, exposed), true) + if err != nil { + t.Fatal(err) + } + id, err := inspectField(name, "Id") + if err != nil { + t.Fatal(err) + } + return id + } + + id1 := buildID("testbuildexpose1", "80 2375") + id2 := buildID("testbuildexpose2", "2375 80") + defer deleteImages("testbuildexpose1", "testbuildexpose2") + if id1 != id2 { + t.Errorf("EXPOSE should invalidate the cache only when ports actually changed") + } + logDone("build - expose order") +} + func TestBuildEmptyEntrypointInheritance(t *testing.T) { name := "testbuildentrypointinheritance" name2 := "testbuildentrypointinheritance2"
add a test case for EXPOSE ports order changing order of EXPOSE ports should not invalidate the cache as the content doesnt change Docker-DCO-<I>-
moby_moby
train
go
76f6163ed598fd733edd5eb150f7d4cdf946263b
diff --git a/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb b/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb index <HASH>..<HASH> 100644 --- a/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb +++ b/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb @@ -1141,9 +1141,11 @@ module ActiveRecord def translate_exception(exception, message) #:nodoc: case @connection.error_code(exception) when 1 - RecordNotUnique.new(message, exception) + RecordNotUnique.new(message) when 2291 - InvalidForeignKey.new(message, exception) + InvalidForeignKey.new(message) + when 12899 + ValueTooLong.new(message) else super end
Add `ActiveRecord::ValueTooLong` exception class and supress `DEPRECATION WARNING: Passing #original_exception is deprecated and has no effect. Exceptions will automatically capture the original exception. ` Refer: <URL>
rsim_oracle-enhanced
train
rb
e13171c48fcaddb8e52be0b5eb8248e932ad0e9c
diff --git a/dedupe/api.py b/dedupe/api.py index <HASH>..<HASH> 100644 --- a/dedupe/api.py +++ b/dedupe/api.py @@ -548,7 +548,15 @@ class StaticMatching(Matching): for predicate in full_predicate: if hasattr(predicate, "index") and predicate.index is None: predicate.index = predicate.initIndex() - predicate.index._doc_to_id = doc_to_ids[predicate] + doc_to_id_max_id = max(doc_to_ids[predicate].values()) + try: + predicate.index._doc_to_id = defaultdict( + itertools.count(doc_to_id_max_id + 1).next) + + except AttributeError: # py 3 + predicate.index._doc_to_id = defaultdict( + itertools.count(doc_to_id_max_id + 1).__next__) + if hasattr(predicate, "canopy"): predicate.canopy = canopies[predicate] else:
unpickle doc_to_id as enumerating defaultdict * load data into defaultdict update loading of _doc_to_id data. * simpler code to find the max * increase the next id by 1 * adding python 2, python 3 compatibility
dedupeio_dedupe
train
py
05145acc3e09f72d41198a02c0ce8ae997c91a7e
diff --git a/src/Client.php b/src/Client.php index <HASH>..<HASH> 100644 --- a/src/Client.php +++ b/src/Client.php @@ -173,7 +173,7 @@ class Client extends EventEmitter implements */ protected function getSocket($remote, array $context) { - $socket = @stream_socket_client( + $socket = stream_socket_client( $remote, $errno, $errstr,
Removed use of the @ operator in Client
phergie_phergie-irc-client-react
train
php
f48e520875868801d306d60f92d48b07218ca888
diff --git a/lib/mapping.js b/lib/mapping.js index <HASH>..<HASH> 100644 --- a/lib/mapping.js +++ b/lib/mapping.js @@ -48,7 +48,7 @@ Mapping.prototype.map = function(input) { // If we have only been passed the alias and no options then use the // default value if there is one. - if (_.keys(input).length === 1 && !_.has(ingredients, "mapping")) { + if (_.keys(input).length === 1) { ingredients["default"] = this["default"]; return this.formula.cook(ingredients); }
Don't check if we have mappings for default. By this time we'll have already cooked and returned a formula.
RickEyre_command-mapper
train
js
8db290bde88879fe915b1a99118b55b1308bd900
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/PackageTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/PackageTest.java index <HASH>..<HASH> 100644 --- a/logback-classic/src/test/java/ch/qos/logback/classic/PackageTest.java +++ b/logback-classic/src/test/java/ch/qos/logback/classic/PackageTest.java @@ -21,6 +21,7 @@ public class PackageTest extends TestCase { suite.addTestSuite(BasicLoggerTest.class); suite.addTestSuite(MessageFormattingTest.class); suite.addTestSuite(MDCTest.class); + suite.addTestSuite(LoggerTest.class); return suite; } } \ No newline at end of file
added LoggerTest to the suite
tony19_logback-android
train
java
978263acdf489dfe2bcb9275a71ed6fda92c7d71
diff --git a/corser.js b/corser.js index <HASH>..<HASH> 100644 --- a/corser.js +++ b/corser.js @@ -1,4 +1,6 @@ -var http = require('http'); +var http, port; +http = require('http'); +port = 80; http.createServer(function (req, res) { res.setHeader('Access-Control-Allow-Origin', '*'); res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS'); @@ -6,5 +8,5 @@ http.createServer(function (req, res) { res.end(JSON.stringify({ message: req.headers.host + ' answered a ' + req.method + ' request.' })); -}).listen(80, '0.0.0.0'); -console.log('Server running at http://127.0.0.1:1337/'); +}).listen(port); +console.log('Server running on port ' + port + '.');
node.js accepts connections directed to any IPv4 address by default.
agrueneberg_Corser
train
js
a33ef5e174d6d277579e0133effdf106ca4b9ce0
diff --git a/Models/Objects/IntelParserTrait.php b/Models/Objects/IntelParserTrait.php index <HASH>..<HASH> 100644 --- a/Models/Objects/IntelParserTrait.php +++ b/Models/Objects/IntelParserTrait.php @@ -168,9 +168,9 @@ trait IntelParserTrait Splash::log()->trace(); //====================================================================// // Init Reading - $newObjectId = null; // If Object Created, we MUST Return Object Id - $this->in = $list; // Store List of Field to Write in Buffer - $this->isUpdated(); // Clear Updated Flag before Writing + $newObjectId = null; // If Object Created, we MUST Return Object ID + $this->in = $list; // Store List of Field to Write in Buffer + $this->isUpdated(); // Clear Updated Flag before Writing //====================================================================// // Load or Create Requested Object
FIX List Fields in Extensions
SplashSync_Php-Core
train
php
a389bfaf8e2e5024a065022bdc89962813b96fcc
diff --git a/tests/specs/delete-db.js b/tests/specs/delete-db.js index <HASH>..<HASH> 100644 --- a/tests/specs/delete-db.js +++ b/tests/specs/delete-db.js @@ -4,7 +4,19 @@ var dbName = 'tests', indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.oIndexedDB || window.msIndexedDB; + beforeEach(function (done) { + var request = indexedDB.deleteDatabase( dbName ); + request.onsuccess = function () { + done(); + }; + request.onerror = function ( e ) { + done( e ); + }; + request.onblocked = function ( e ) { + done( e ); + }; + }); it( 'should delete a created db' , function (done) { db.open( { server: dbName ,
ensure db is never present at beginning
aaronpowell_db.js
train
js
a86a84d4445b38b203b280480bed67acbc95ed3d
diff --git a/src/Rasterization/Path/SVGPathApproximator.php b/src/Rasterization/Path/SVGPathApproximator.php index <HASH>..<HASH> 100644 --- a/src/Rasterization/Path/SVGPathApproximator.php +++ b/src/Rasterization/Path/SVGPathApproximator.php @@ -131,7 +131,7 @@ class SVGPathApproximator $p2 = array($args[2], $args[3]); $p3 = array($args[4], $args[5]); - if ($id === 'q') { + if ($id === 'c') { $p1[0] += $p0[0]; $p1[1] += $p0[1];
Fix rel. CurveToCubic wrong in SVGPathApproximator
meyfa_php-svg
train
php