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
|
---|---|---|---|---|---|
ed7ae20ded6819e88b2c754da04974bc6f9f2eef | diff --git a/spyderlib/plugins/externalconsole.py b/spyderlib/plugins/externalconsole.py
index <HASH>..<HASH> 100644
--- a/spyderlib/plugins/externalconsole.py
+++ b/spyderlib/plugins/externalconsole.py
@@ -519,7 +519,7 @@ class ExternalConsole(SpyderPluginWidget):
_("You can't close an IPython kernel tab.\n\n"
"You need to close its associated console\n"
"instead or you can kill it using the button\n"
- "far to the left."),
+ "far to the right."),
QMessageBox.Ok) | Console: Fix minor wording in the message shown when trying to close an IPython kernel | spyder-ide_spyder | train | py |
e252dae499a8c682c92527262cca01af337438aa | diff --git a/rpc/args.go b/rpc/args.go
index <HASH>..<HASH> 100644
--- a/rpc/args.go
+++ b/rpc/args.go
@@ -1061,7 +1061,7 @@ func (args *WhisperFilterArgs) UnmarshalJSON(b []byte) (err error) {
for idx, field := range list {
switch value := field.(type) {
case nil:
- topics[idx] = []string{""}
+ topics[idx] = []string{}
case string:
topics[idx] = []string{value} | rpc: use nil topic wildcards instead of "" | ethereum_go-ethereum | train | go |
f7760a8e5bc3eb676cd4a17f1b813bc5a45a7157 | diff --git a/src/jamesiarmes/PhpEws/Client.php b/src/jamesiarmes/PhpEws/Client.php
index <HASH>..<HASH> 100644
--- a/src/jamesiarmes/PhpEws/Client.php
+++ b/src/jamesiarmes/PhpEws/Client.php
@@ -950,6 +950,22 @@ class Client
}
/**
+ * Retrieves configuration information for the specified type of service.
+ *
+ * This operation can return configuration settings for the Unified
+ * Messaging, Protection Rules, and Mail Tips services.
+ *
+ * @since Exchange 2010
+ *
+ * @param \jamesiarmes\PhpEws\Request\GetServiceConfigurationType $request
+ * @return \jamesiarmes\PhpEws\Response\GetServiceConfigurationResponseMessageType
+ */
+ public function GetServiceConfiguration($request)
+ {
+ return $this->makeRequest(__FUNCTION__, $request);
+ }
+
+ /**
* Function Description
*
* @param \jamesiarmes\PhpEws\Request\GetUserAvailabilityRequestType $request | Added GetServiceConfiguration operation. | jamesiarmes_php-ews | train | php |
c199d3d8c365a5507bb4ceaf1e0767d6ff87d275 | diff --git a/etcdserver/server.go b/etcdserver/server.go
index <HASH>..<HASH> 100644
--- a/etcdserver/server.go
+++ b/etcdserver/server.go
@@ -734,7 +734,7 @@ func (s *EtcdServer) start() {
s.applyWait = wait.NewTimeList()
s.done = make(chan struct{})
s.stop = make(chan struct{})
- s.stopping = make(chan struct{})
+ s.stopping = make(chan struct{}, 1)
s.ctx, s.cancel = context.WithCancel(context.Background())
s.readwaitc = make(chan struct{}, 1)
s.readNotifier = newNotifier() | server: use buffered channel to avoid goroutine leak (#<I>) | etcd-io_etcd | train | go |
4c1cd1b2666cf7cd3b5dce384ef95396e090b6a5 | diff --git a/manifest.go b/manifest.go
index <HASH>..<HASH> 100644
--- a/manifest.go
+++ b/manifest.go
@@ -323,11 +323,23 @@ func (m *Manifest) FetchDependency(dep Dependency, outputFile string) error {
return nil
}
+func (m *Manifest) entrySupportsCurrentStack(entry *ManifestEntry) bool {
+ stack := os.Getenv("CF_STACK")
+
+ for _, s := range entry.CFStacks {
+ if s == stack {
+ return true
+ }
+ }
+
+ return false
+}
+
func (m *Manifest) AllDependencyVersions(depName string) []string {
var depVersions []string
for _, e := range m.ManifestEntries {
- if e.Dependency.Name == depName {
+ if e.Dependency.Name == depName && m.entrySupportsCurrentStack(&e) {
depVersions = append(depVersions, e.Dependency.Version)
}
}
@@ -350,7 +362,7 @@ func (m *Manifest) InstallOnlyVersion(depName string, installDir string) error {
func (m *Manifest) getEntry(dep Dependency) (*ManifestEntry, error) {
for _, e := range m.ManifestEntries {
- if e.Dependency == dep {
+ if e.Dependency == dep && m.entrySupportsCurrentStack(&e) {
return &e, nil
}
} | Filter dependencies based on their stack | cloudfoundry_libbuildpack | train | go |
b8c73bef04fd714938fc27f8e99b5190e75ace1f | diff --git a/package.php b/package.php
index <HASH>..<HASH> 100644
--- a/package.php
+++ b/package.php
@@ -4,7 +4,7 @@
require_once 'PEAR/PackageFileManager2.php';
-$version = '1.4.118';
+$version = '1.4.119';
$notes = <<<EOT
No release notes for you!
EOT; | prepare for release of <I>
svn commit r<I> | silverorange_swat | train | php |
4627369206d915c0b13b29ab58177a0648b1e304 | diff --git a/lib/chars/chars.rb b/lib/chars/chars.rb
index <HASH>..<HASH> 100644
--- a/lib/chars/chars.rb
+++ b/lib/chars/chars.rb
@@ -41,7 +41,7 @@ module Chars
]
# The space character set
- SPACE = CharSet.new(' ', "\f", "\n", "\r", "\t", "\v")
+ SPACE = CharSet[' ', "\f", "\n", "\r", "\t", "\v"]
# The set of printable characters (not including spaces)
VISIBLE = ALPHA_NUMERIC | CharSet[ | Use CharSet[] to initialize the char sets. | postmodern_chars | train | rb |
738660dd207c8e3a76e63d0c579f2a6c873fc549 | diff --git a/pytablewriter/style/_cell.py b/pytablewriter/style/_cell.py
index <HASH>..<HASH> 100644
--- a/pytablewriter/style/_cell.py
+++ b/pytablewriter/style/_cell.py
@@ -10,3 +10,10 @@ class Cell:
self.col = col
self.value = value
self.default_style = default_style
+
+ def is_header_row(self) -> bool:
+ """
+ Return |True| if the cell is a header.
+ """
+
+ return self.row < 0
diff --git a/test/test_style.py b/test/test_style.py
index <HASH>..<HASH> 100644
--- a/test/test_style.py
+++ b/test/test_style.py
@@ -2,11 +2,28 @@ import sys
import pytest
-from pytablewriter.style import Align, FontSize, FontStyle, FontWeight, Style, ThousandSeparator
+from pytablewriter.style import (
+ Align,
+ Cell,
+ FontSize,
+ FontStyle,
+ FontWeight,
+ Style,
+ ThousandSeparator,
+)
from ._common import print_test_result
+class Test_Cell_is_header_row:
+ @pytest.mark.parametrize(
+ ["row", "expected"], [[-1, True], [0, False], [sys.maxsize, False]],
+ )
+ def test_normal(self, row, expected):
+ cell = Cell(row=row, col=0, value=None, default_style=None)
+ assert cell.is_header_row() is expected
+
+
class Test_Style_constructor:
@pytest.mark.parametrize(
["value", "expected"], | Add is_header_row method to Cell class | thombashi_pytablewriter | train | py,py |
4dc1155b77434013ac4dfbfc6fbf89d1ae5f884a | diff --git a/lib/dpl/providers/lambda.rb b/lib/dpl/providers/lambda.rb
index <HASH>..<HASH> 100644
--- a/lib/dpl/providers/lambda.rb
+++ b/lib/dpl/providers/lambda.rb
@@ -164,7 +164,7 @@ module Dpl
end
def split_vars(vars)
- vars.map { |var| var.split('=') }.to_h
+ vars.map { |var| var.split('=', 2) }.to_h
end
def tmp_filename | port <I> (preserve = in the rhs of env var, lambda) | travis-ci_dpl | train | rb |
b3ec718d97cab702e8ead3e2a68d854b6ef8c991 | diff --git a/src/Synapse/ApplicationInitializer.php b/src/Synapse/ApplicationInitializer.php
index <HASH>..<HASH> 100644
--- a/src/Synapse/ApplicationInitializer.php
+++ b/src/Synapse/ApplicationInitializer.php
@@ -11,13 +11,6 @@ use Symfony\Component\Debug\Debug;
class ApplicationInitializer
{
/**
- * Application version
- *
- * @var string
- */
- protected $appVersion = '0.0.0';
-
- /**
* Initialize the Silex Application
*
* Register services and routes
@@ -30,15 +23,15 @@ class ApplicationInitializer
// Create the application object
$app = new Application;
- // Store application version
- $app['version'] = $this->appVersion;
-
$this->setEnvironment($app);
$this->registerConfig($app);
// Handle init config
$initConfig = $app['config']->load('init');
+ // Store application version
+ $app['version'] = $initConfig['version'];
+
if ($initConfig['debug']) {
Debug::enable();
$app['debug'] = true; | Get application version from init config. | synapsestudios_synapse-base | train | php |
024e5fbaf7a67008eec1bc99eaeefd8755a88cee | diff --git a/src/Illuminate/Queue/IronQueue.php b/src/Illuminate/Queue/IronQueue.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Queue/IronQueue.php
+++ b/src/Illuminate/Queue/IronQueue.php
@@ -77,7 +77,7 @@ class IronQueue extends Queue implements QueueInterface {
* @param string $queue
* @return mixed
*/
-public function later($delay, $job, $data = '', $queue = null)
+ public function later($delay, $job, $data = '', $queue = null)
{
$delay = $this->getSeconds($delay);
@@ -181,4 +181,4 @@ public function later($delay, $job, $data = '', $queue = null)
return $this->iron;
}
-}
\ No newline at end of file
+} | Add missing tab
Whoops, something went wrong here. | laravel_framework | train | php |
dc9443d11809db88003ee3b360d078817bf61845 | diff --git a/html5lib/treewalkers/__init__.py b/html5lib/treewalkers/__init__.py
index <HASH>..<HASH> 100644
--- a/html5lib/treewalkers/__init__.py
+++ b/html5lib/treewalkers/__init__.py
@@ -13,7 +13,7 @@ from __future__ import absolute_import, division, unicode_literals
from .. import constants
from .._utils import default_etree
-__all__ = ["getTreeWalker", "pprint", "dom", "etree", "genshi", "etree_lxml"]
+__all__ = ["getTreeWalker", "pprint"]
treeWalkerCache = {} | Remove items from __all__ that aren't in the namespace | html5lib_html5lib-python | train | py |
77a50b2f386fb62ffe0a8f7f2641b8a9f3be3b2d | diff --git a/src/Access/TagPolicy.php b/src/Access/TagPolicy.php
index <HASH>..<HASH> 100755
--- a/src/Access/TagPolicy.php
+++ b/src/Access/TagPolicy.php
@@ -13,7 +13,6 @@ namespace Flarum\Tags\Access;
use Flarum\Core\Access\AbstractPolicy;
use Flarum\Core\User;
use Flarum\Tags\Tag;
-use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
class TagPolicy extends AbstractPolicy
@@ -39,7 +38,7 @@ class TagPolicy extends AbstractPolicy
*/
public function startDiscussion(User $actor, Tag $tag)
{
- if (! $tag->is_restricted
+ if ((! $tag->is_restricted && $actor->hasPermission('startDiscussion'))
|| $actor->hasPermission('tag' . $tag->id . '.startDiscussion')) {
return true;
} | Only allow starting a discussion on a non-restricted tag if the user has the global permission | flarum_tags | train | php |
100949df312774cea79b1667bdf6bc0055d78711 | diff --git a/src/tracing/exporters/console.js b/src/tracing/exporters/console.js
index <HASH>..<HASH> 100644
--- a/src/tracing/exporters/console.js
+++ b/src/tracing/exporters/console.js
@@ -76,7 +76,7 @@ class ConsoleTraceExporter extends BaseTraceExporter {
this.printRequest(span.id);
// remove old printed requests
- this.removeSpanWithChildren(span);
+ this.removeSpanWithChildren(span.id);
}
}
diff --git a/test/unit/tracing/exporters/console.spec.js b/test/unit/tracing/exporters/console.spec.js
index <HASH>..<HASH> 100644
--- a/test/unit/tracing/exporters/console.spec.js
+++ b/test/unit/tracing/exporters/console.spec.js
@@ -119,7 +119,7 @@ describe("Test Console tracing exporter class", () => {
expect(exporter.printRequest).toHaveBeenCalledWith("span1");
expect(exporter.removeSpanWithChildren).toHaveBeenCalledTimes(1);
- expect(exporter.removeSpanWithChildren).toHaveBeenCalledWith(span1);
+ expect(exporter.removeSpanWithChildren).toHaveBeenCalledWith("span1");
});
it("should not call printRequest if has parent span", () => { | fix span removing in console trace exporter | moleculerjs_moleculer | train | js,js |
83156acd16af899e460ef772689c511e123f3d1d | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,13 +1,13 @@
-from setuptools import setup
+from setuptools import setup, find_packages
setup(name='dispatch',
- version='0.1',
+ version='0.2.7',
description='A publishing platform for modern newspapers',
url='http://github.com/ubyssey/dispatch',
author='Peter Siemens',
author_email='[email protected]',
license='GPL',
- packages=['dispatch'],
+ packages=find_packages(),
scripts=['dispatch/bin/dispatch-admin'],
include_package_data=True,
install_requires=[ | Find all packages with find_packages() | ubyssey_dispatch | train | py |
2c80a05fdf229082152c10b21ec8d149fb2527f3 | diff --git a/packages/openneuro-client/src/datasets.js b/packages/openneuro-client/src/datasets.js
index <HASH>..<HASH> 100644
--- a/packages/openneuro-client/src/datasets.js
+++ b/packages/openneuro-client/src/datasets.js
@@ -107,3 +107,9 @@ export const updatePermissions = gql`
updatePermissions(datasetId: $datasetId, userId: $userId, level: $level)
}
`
+
+export const removePermissions = gql`
+ mutation ($datasetId: ID!, $userId: String!) {
+ removePermissions(datasetId: $datasetId, userId: $userId)
+ }
+` | removePermissions added to openneuro-client shared mutations | OpenNeuroOrg_openneuro | train | js |
d870759da289ffa1a7f6db57ccb80f6c3959755e | diff --git a/src/views/site/lockscreen.php b/src/views/site/lockscreen.php
index <HASH>..<HASH> 100644
--- a/src/views/site/lockscreen.php
+++ b/src/views/site/lockscreen.php
@@ -24,8 +24,8 @@ $this->title = 'Lockscreen';
<!-- /.lockscreen-image -->
<!-- lockscreen credentials (contains the form) -->
- <form class="lockscreen-credentials" action="<?= Yii::$app->params['hipanelUrl'] ?>">
- <input type="submit" class="form-control btn" value="Return to HiPanel" />
+ <form class="lockscreen-credentials" action="/site/back">
+ <input type="submit" class="form-control btn" value="Return to site" />
</form><!-- /.lockscreen credentials -->
</div><!-- /.lockscreen-item --> | used /site/back to return to site | hiqdev_yii2-theme-adminlte | train | php |
08e570d98a640317ff09c0c86b2673bec397032a | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -17,7 +17,8 @@
# python setup.py sdist
#
# To install distribution in current venv:
-# pip install -U dist/elfstonelib-a.b.c.tar.gz
+# pip install -U dist/pyudmx-x.y.z.tar.gz
+# where x.y.z is the version number (e.g. 1.0.0)
#
import os | Correct comment explaining how to install package into a venv. | dhocker_udmx-pyusb | train | py |
51886b05437da79c5bf2f3ec3647f1bf9e406689 | diff --git a/app/models/agents/twitter_stream_agent.rb b/app/models/agents/twitter_stream_agent.rb
index <HASH>..<HASH> 100644
--- a/app/models/agents/twitter_stream_agent.rb
+++ b/app/models/agents/twitter_stream_agent.rb
@@ -125,13 +125,13 @@ module Agents
end
def self.setup_worker
- if Agents::TwitterStreamAgent.dependencies_missing?
- STDERR.puts Agents::TwitterStreamAgent.twitter_dependencies_missing
- STDERR.flush
- return false
- end
-
Agents::TwitterStreamAgent.active.group_by { |agent| agent.twitter_oauth_token }.map do |oauth_token, agents|
+ if Agents::TwitterStreamAgent.dependencies_missing?
+ STDERR.puts Agents::TwitterStreamAgent.twitter_dependencies_missing
+ STDERR.flush
+ return false
+ end
+
filter_to_agent_map = agents.map { |agent| agent.options[:filters] }.flatten.uniq.compact.map(&:strip).inject({}) { |m, f| m[f] = []; m }
agents.each do |agent| | TwitterStream only run dependency check when agents are configured
Fixes #<I> | huginn_huginn | train | rb |
2d459fc5dcf13a0aadf4556a80d7bb6c57dad033 | diff --git a/lib/puppet/interface/option_builder.rb b/lib/puppet/interface/option_builder.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/interface/option_builder.rb
+++ b/lib/puppet/interface/option_builder.rb
@@ -19,7 +19,7 @@ class Puppet::Interface::OptionBuilder
Puppet::Interface::Option.instance_methods.grep(/=$/).each do |setter|
next if setter =~ /^=/ # special case, darn it...
- dsl = setter.sub(/=$/, '')
+ dsl = setter.to_s.sub(/=$/, '')
define_method(dsl) do |value| @option.send(setter, value) end
end
end | (#<I>) Fix string method sub call on a symbol for Ruby <I>
Ruby <I> is less forgiving about treating symbols like strings. | puppetlabs_puppet | train | rb |
b5424f5a5901acd3ff0a4e6070bac80b47bce9bb | diff --git a/openquake/calculators/classical.py b/openquake/calculators/classical.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/classical.py
+++ b/openquake/calculators/classical.py
@@ -310,7 +310,8 @@ class ClassicalCalculator(base.HazardCalculator):
self.datastore['csm_info'] = self.csm_info
return {}
smap = parallel.Starmap(
- self.core_task.__func__, h5=self.datastore.hdf5)
+ self.core_task.__func__, h5=self.datastore.hdf5,
+ num_cores=oq.num_cores)
smap.task_queue = list(self.gen_task_queue()) # really fast
acc0 = self.acc0() # create the rup/ datasets BEFORE swmr_on()
self.datastore.swmr_on() | Fixed num_cores in classical [skip CI] | gem_oq-engine | train | py |
a1679de46a59ec1295b73590d8f88ee49c606619 | diff --git a/transport/http/src/main/java/org/kaazing/gateway/transport/http/HttpConnectProcessor.java b/transport/http/src/main/java/org/kaazing/gateway/transport/http/HttpConnectProcessor.java
index <HASH>..<HASH> 100644
--- a/transport/http/src/main/java/org/kaazing/gateway/transport/http/HttpConnectProcessor.java
+++ b/transport/http/src/main/java/org/kaazing/gateway/transport/http/HttpConnectProcessor.java
@@ -71,7 +71,8 @@ public class HttpConnectProcessor extends BridgeConnectProcessor<DefaultHttpSess
// create HttpRequestMessage
HttpRequestMessage httpRequest = new HttpRequestMessage();
httpRequest.setMethod(session.getMethod());
- httpRequest.setRequestURI(session.getRequestURI());
+ URI pathFromResource = URI.create(resource.getPath());
+ httpRequest.setRequestURI(pathFromResource);
httpRequest.setVersion(session.getVersion());
Map<String, List<String>> parameters = session.getParameters();
if (!parameters.isEmpty()) { | Added the request URI to the HttpRequestMessage from the path of the remote address | kaazing_gateway | train | java |
35c900aa7079c5f2afbdd64a9722fa5f40e6acc1 | diff --git a/pkg/printers/common.go b/pkg/printers/common.go
index <HASH>..<HASH> 100644
--- a/pkg/printers/common.go
+++ b/pkg/printers/common.go
@@ -34,7 +34,7 @@ func ShortHumanDuration(d time.Duration) string {
return fmt.Sprintf("%dm", minutes)
} else if hours := int(d.Hours()); hours < 24 {
return fmt.Sprintf("%dh", hours)
- } else if hours < 24*364 {
+ } else if hours < 24*365 {
return fmt.Sprintf("%dd", hours/24)
}
return fmt.Sprintf("%dy", int(d.Hours()/24/365)) | Fixed a tiny issue for ShortHumanDuration printer.
Fixed a tiny issue for ShortHumanDuration printer
to avoid "0y" message. | kubernetes_kubernetes | train | go |
5565e96301642bd6369560fee0a12c03cb97c8d9 | diff --git a/lib/rake-pipeline-web-filters/sass_filter.rb b/lib/rake-pipeline-web-filters/sass_filter.rb
index <HASH>..<HASH> 100644
--- a/lib/rake-pipeline-web-filters/sass_filter.rb
+++ b/lib/rake-pipeline-web-filters/sass_filter.rb
@@ -63,14 +63,24 @@ module Rake::Pipeline::Web::Filters
end.flatten
end
- private
-
+ # Overwritten method from rake-pipeline
+ #
# Make sure that files within additional load paths are watched for changes
- def create_file_task(output, deps=[], &block)
- deps.concat(additional_file_paths)
- super(output, deps, &block)
+ # @return [void]
+ def generate_rake_tasks
+ @rake_tasks = outputs.map do |output, inputs|
+ dependencies = inputs.map(&:fullpath) + additional_file_paths
+
+ dependencies.each { |path| create_file_task(path) }
+
+ create_file_task(output.fullpath, dependencies) do
+ output.create { generate_output(inputs, output) }
+ end
+ end
end
+ private
+
def external_dependencies
[ 'sass', 'compass' ]
end | Overwrite generate_rake_tasks method to avoid repeated searching in additional load path for every file in filter | wycats_rake-pipeline-web-filters | train | rb |
d49ddb7f0ffb03535e652a5f2668694656c4f8e2 | diff --git a/tests/test_cli.py b/tests/test_cli.py
index <HASH>..<HASH> 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -19,6 +19,7 @@ from tests.constants import test_bel_simple, mock_bel_resources, test_bel_thorou
log = logging.getLogger(__name__)
[email protected]('PYBEL_TEST_THOROUGH' in os.environ)
class TestCli(TemporaryCacheMixin, BelReconstitutionMixin):
def setUp(self):
super(TestCli, self).setUp() | Remove CLI testing
Will have to resume later | pybel_pybel | train | py |
f0afa096d5b41395c3a091c2aea67006a19cf0cd | diff --git a/src/java/org/archive/wayback/accesscontrol/AdministrativeExclusionServlet.java b/src/java/org/archive/wayback/accesscontrol/AdministrativeExclusionServlet.java
index <HASH>..<HASH> 100644
--- a/src/java/org/archive/wayback/accesscontrol/AdministrativeExclusionServlet.java
+++ b/src/java/org/archive/wayback/accesscontrol/AdministrativeExclusionServlet.java
@@ -202,6 +202,9 @@ public class AdministrativeExclusionServlet extends WaybackServlet {
} catch (ParseException e) {
e.printStackTrace();
page.append(formatException(e));
+ } catch (DatabaseException e) {
+ e.printStackTrace();
+ page.append(formatException(e));
}
}
page.append("</body></html>");
@@ -366,7 +369,7 @@ public class AdministrativeExclusionServlet extends WaybackServlet {
}
private void handleRuleCreate(AdministrativeExclusionAuthority auth,
- Map queryMap) throws ParseException, URIException {
+ Map queryMap) throws ParseException, URIException, DatabaseException {
AdministrativeExclusionRule rule = new AdministrativeExclusionRule(); | BUGFIX: (unreported) was not handling newly thrown database exception on put()
git-svn-id: <URL> | iipc_openwayback | train | java |
40f73102ee4fac5754d1b048c35cf9d9becc12e7 | diff --git a/protocol-servlet/src/test/java/org/jboss/arquillian/protocol/servlet/ProtocolTestCase.java b/protocol-servlet/src/test/java/org/jboss/arquillian/protocol/servlet/ProtocolTestCase.java
index <HASH>..<HASH> 100644
--- a/protocol-servlet/src/test/java/org/jboss/arquillian/protocol/servlet/ProtocolTestCase.java
+++ b/protocol-servlet/src/test/java/org/jboss/arquillian/protocol/servlet/ProtocolTestCase.java
@@ -47,7 +47,7 @@ public class ProtocolTestCase
public void setup() throws Exception
{
server = new Server(8181);
- Context root = new Context(server, "/protocol", Context.SESSIONS);
+ Context root = new Context(server, "/arquillian-protocol", Context.SESSIONS);
root.addServlet(ServletTestRunner.class, "/*");
server.start();
}
@@ -156,7 +156,7 @@ public class ProtocolTestCase
private URL createURL(String outputMode, String testClass, String methodName)
{
- StringBuilder url = new StringBuilder(createBaseURL().toExternalForm()).append("protocol/");
+ StringBuilder url = new StringBuilder(createBaseURL().toExternalForm()).append("arquillian-protocol/");
boolean first = true;
if(outputMode != null)
{ | ARQ-<I> Updated protocol name | arquillian_arquillian-core | train | java |
666bfa276ef4653c73ce09cfdf6536edb4ddd2d9 | diff --git a/testsuite/run_cim_operations.py b/testsuite/run_cim_operations.py
index <HASH>..<HASH> 100755
--- a/testsuite/run_cim_operations.py
+++ b/testsuite/run_cim_operations.py
@@ -3337,6 +3337,7 @@ class ClassOperations(ClientClassTest):
type='uint8')})
# force propagated False for all properties
+ # Effictive V0.12.0 this is required.
for p in test_class.properties:
test_class.properties[p].propagated = False | Add comment as to why we set propagated | pywbem_pywbem | train | py |
1b424913c96552eec433c022c29e2cedb4803ee1 | diff --git a/new_english/bin/restintercept.py b/new_english/bin/restintercept.py
index <HASH>..<HASH> 100755
--- a/new_english/bin/restintercept.py
+++ b/new_english/bin/restintercept.py
@@ -694,7 +694,9 @@ class JsonProxyRestHandler(splunk.rest.BaseRestHandler):
self.response.setStatus(status)
self.response.setHeader('Content-Type', 'application/json')
- if status == 401:
+ authorization = self.request["headers"].get("authorization", "");
+ is_regular_authorized = authorization.startswith("Splunk");
+ if status == 401 and not is_regular_authorized:
self.response.setHeader("www-authenticate", 'Basic realm="/splunk"')
self.response.write(content) | Make new_english www-authenticate behavior (SPL-<I>)
Don't send www-authenticate if Authorization: Splunk* header is in. | splunk_splunk-sdk-javascript | train | py |
177727e41f67f3663e8db8aa1d3555ce12f5d6d4 | diff --git a/tests/test_repository_mining.py b/tests/test_repository_mining.py
index <HASH>..<HASH> 100644
--- a/tests/test_repository_mining.py
+++ b/tests/test_repository_mining.py
@@ -189,10 +189,10 @@ def test_ignore_add_whitespaces_and_changed_file():
def test_clone_repo_to():
- tmp_folder = tempfile.TemporaryDirectory()
- dt2 = datetime(2018, 10, 20)
- url = "https://github.com/ishepard/pydriller.git"
- assert len(list(RepositoryMining(
- path_to_repo=url,
- to=dt2,
- clone_repo_to=tmp_folder.name).traverse_commits())) == 159
+ with tempfile.TemporaryDirectory() as tmp_dirname:
+ dt2 = datetime(2018, 10, 20)
+ url = "https://github.com/ishepard/pydriller.git"
+ assert len(list(RepositoryMining(
+ path_to_repo=url,
+ to=dt2,
+ clone_repo_to=tmp_dirname).traverse_commits())) == 159 | in the attempt to fix python <I> on Windows. Using tempdirectory as a context manager | ishepard_pydriller | train | py |
2c64a38f673257400be8d5230377ce251338080e | diff --git a/tests/functional/contexts/FeatureContext.php b/tests/functional/contexts/FeatureContext.php
index <HASH>..<HASH> 100644
--- a/tests/functional/contexts/FeatureContext.php
+++ b/tests/functional/contexts/FeatureContext.php
@@ -38,7 +38,6 @@ class FeatureContext implements Context, SnippetAcceptingContext
$command = $this->application->find('lint');
$this->commandTester = new CommandTester($command);
-
}
/** | Fix coding standards violation in functional tests
Removed empty line before closing brace to fix Code Sniff violation. | sclable_xml-lint | train | php |
3a165e11508020456362e0ce48c6b27d6e2d83e4 | diff --git a/src/Capsule.php b/src/Capsule.php
index <HASH>..<HASH> 100644
--- a/src/Capsule.php
+++ b/src/Capsule.php
@@ -21,6 +21,16 @@ class Capsule implements \ArrayAccess
private $granules = [];
/**
+ * Constructor.
+ *
+ * @param array $initialData The initial data.
+ */
+ public function __construct(array $initialData)
+ {
+ $this->granules = $initialData;
+ }
+
+ /**
* Checks if a granule is set.
*
* @param string $key The unique key of the granule. | Added constructor with initial data in Capsule | satori-php_middleware | train | php |
549af4f4b46f06796c362b3b4a9467b920ad3275 | diff --git a/plugins/item_licenses/server/__init__.py b/plugins/item_licenses/server/__init__.py
index <HASH>..<HASH> 100644
--- a/plugins/item_licenses/server/__init__.py
+++ b/plugins/item_licenses/server/__init__.py
@@ -30,15 +30,15 @@ from .rest import getLicenses
def validateString(value):
"""
- Make sure a value is a string.
+ Make sure a value is a unicode string.
- :param value: the value to coerce into a string if it isn't already.
- :returns: the string version of the value.
+ :param value: the value to coerce into a unicode string if it isn't already.
+ :returns: the unicode string version of the value.
"""
if value is None:
- value = ''
- if not isinstance(value, six.string_types):
- value = str(value)
+ value = six.u('')
+ if not isinstance(value, six.text_type):
+ value = six.text_type(value)
return value | Validate string as unicode consistently across Python versions | girder_girder | train | py |
a833b56c25241f88071750c0a1bd209938fd0c00 | diff --git a/src/Tappleby/OAuth2/Repositories/RefreshTokenRepositoryEloquent.php b/src/Tappleby/OAuth2/Repositories/RefreshTokenRepositoryEloquent.php
index <HASH>..<HASH> 100644
--- a/src/Tappleby/OAuth2/Repositories/RefreshTokenRepositoryEloquent.php
+++ b/src/Tappleby/OAuth2/Repositories/RefreshTokenRepositoryEloquent.php
@@ -62,8 +62,6 @@ class RefreshTokenRepositoryEloquent implements RefreshTokenRepositoryInterface
*/
function create($attributes, $save = true)
{
- $attributes['refresh_token'] = $attributes['id'];
- unset($attributes['id']);
$model = $this->createModel()->fill($attributes);
if($save) $this->save($model); | No longer to to switch key of refresh token. | tappleby_laravel-oauth2-server | train | php |
148c290653aab9478b7ab1960b3d94e998008fa3 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -64,7 +64,7 @@ module.exports = function(options) {
}
ses.sendEmail({
- Source: "[email protected]",
+ Source: "Webmaker <[email protected]>",
Destination: {
ToAddresses: [options.to],
},
@@ -102,7 +102,7 @@ module.exports = function(options) {
} else {
template = 'badgeAwarded';
subject = 'badgeAwardedSubject';
- from = '[email protected]';
+ from = 'Webmaker <[email protected]>';
}
var html = templates[template].render({
@@ -161,7 +161,7 @@ module.exports = function(options) {
}
ses.sendEmail({
- Source: "[email protected]",
+ Source: "Webmaker <[email protected]>",
Destination: {
ToAddresses: [options.to]
},
@@ -199,7 +199,7 @@ module.exports = function(options) {
}
ses.sendEmail({
- Source: "[email protected]",
+ Source: "Webmaker <[email protected]>",
Destination: {
ToAddresses: [options.to]
}, | Fix bug <I> - Send emails from Webmaker | mozilla_node-webmaker-postalservice | train | js |
1aff2d40ce7579c5ead1b1fa4070aaff041d2d9c | diff --git a/pyphi/network.py b/pyphi/network.py
index <HASH>..<HASH> 100644
--- a/pyphi/network.py
+++ b/pyphi/network.py
@@ -109,7 +109,6 @@ class Network:
def __init__(self, tpm, connectivity_matrix=None, node_labels=None,
perturb_vector=None, purview_cache=None):
self.tpm = tpm
- self._size = self.tpm.shape[-1]
# TODO extend to nonbinary nodes
self._num_states = 2 ** self.size
self._node_indices = tuple(range(self.size))
@@ -117,12 +116,12 @@ class Network:
self.connectivity_matrix = connectivity_matrix
self.perturb_vector = perturb_vector
self.purview_cache = purview_cache or cache.PurviewCache()
- # Validate the entire network.
+
validate.network(self)
@property
def size(self):
- return self._size
+ return self.tpm.shape[-1]
@property
def num_states(self): | Compute `Network.size` dynamically | wmayner_pyphi | train | py |
b3df0f318d71bd066b9eb481fae9a0cb5f7ef426 | diff --git a/lib/mongo/server/connection_pool.rb b/lib/mongo/server/connection_pool.rb
index <HASH>..<HASH> 100644
--- a/lib/mongo/server/connection_pool.rb
+++ b/lib/mongo/server/connection_pool.rb
@@ -383,6 +383,12 @@ module Mongo
Monitoring::Event::Cmap::ConnectionCheckedOut.new(@server.address, connection.id, self),
)
+ if Lint.enabled?
+ unless connection.connected?
+ raise Error::LintError, 'Connection pool checked out a disconnected connection'
+ end
+ end
+
connection
ensure
check_invariants
diff --git a/spec/spec_tests/cmap_spec.rb b/spec/spec_tests/cmap_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_tests/cmap_spec.rb
+++ b/spec/spec_tests/cmap_spec.rb
@@ -62,6 +62,9 @@ describe 'Cmap' do
let!(:result) do
socket = double('fake socket')
allow(socket).to receive(:close)
+ # When linting, connection pool ensures the connection returned
+ # is connected.
+ allow(socket).to receive(:alive?).and_return(true)
allow_any_instance_of(Mongo::Server::Connection).to receive(:do_connect).and_return(socket)
spec.run | verify connection pool does not check out disconnected connections when linting (#<I>) | mongodb_mongo-ruby-driver | train | rb,rb |
bc0c9f18aafaccb694c114390a2e31fbc267e74a | diff --git a/bundles/org.eclipse.orion.client.javascript/web/tern/plugin/modules.js b/bundles/org.eclipse.orion.client.javascript/web/tern/plugin/modules.js
index <HASH>..<HASH> 100644
--- a/bundles/org.eclipse.orion.client.javascript/web/tern/plugin/modules.js
+++ b/bundles/org.eclipse.orion.client.javascript/web/tern/plugin/modules.js
@@ -43,6 +43,7 @@
},
resolveModule: function(name, parentFile) {
+ var modName = name; // ORION we need the original name for linting
var over = this.maybeOverride(name)
if (over) return over
var known = this.knownModules[name]
@@ -67,6 +68,7 @@
if (typeof resolved != "string") {
if (!relative) this.nonRelative[name] = true
+ resolved.modName = modName; //ORION tag module with original name
return resolved
}
@@ -76,7 +78,10 @@
if (/\.js$|(?:^\/)[^\.]+$/.test(resolved))
this.server.addFile(resolved, contents, parentFile)
if (!relative) this.nonRelative[name] = resolved
- return this.modules[resolved] = new infer.AVal
+ //ORION tag the module name
+ var val = new infer.AVal;
+ val.modName = modName;
+ return this.modules[resolved] = val;
},
findIn: function(array, node, pos) { | Bug <I> - [regression] We need to add back support for tagging module names to resolved files in Tern - part one | eclipse_orion.client | train | js |
fb0674145d8a6a2ade48ca6003ea28cd80214228 | diff --git a/examples/docgen/docs/.vuepress/config.js b/examples/docgen/docs/.vuepress/config.js
index <HASH>..<HASH> 100644
--- a/examples/docgen/docs/.vuepress/config.js
+++ b/examples/docgen/docs/.vuepress/config.js
@@ -15,6 +15,7 @@ module.exports = async () => {
)
return {
+ base: "/docgen/",
dest: path.join(__dirname, '../../dist'),
title: 'VuePress DocGen Live',
themeConfig: { | docs: repair docgen example | vue-styleguidist_vue-styleguidist | train | js |
91724723948640f9acba9d85a1db8e782b3a78e0 | diff --git a/chess/variant.py b/chess/variant.py
index <HASH>..<HASH> 100644
--- a/chess/variant.py
+++ b/chess/variant.py
@@ -295,7 +295,7 @@ class AtomicBoard(chess.Board):
yield move
def status(self):
- status = super(SuicideBoard, self).status()
+ status = super(AtomicBoard, self).status()
status &= ~chess.STATUS_OPPOSITE_CHECK
if self.turn == chess.WHITE:
status &= ~chess.STATUS_NO_WHITE_KING
@@ -540,7 +540,7 @@ class ThreeCheckBoard(chess.Board):
raise ValueError("three-check fen should consist of 7 parts: {0}".format(repr(fen)))
# Extract check part.
- if "+" == parts[6][0]:
+ if parts[6][0] == "+":
check_part = parts.pop()[1:]
try:
w, b = check_part.split("+", 1) | More coding style fixes by flake8 | niklasf_python-chess | train | py |
7e01974fb4eb30e70c3a90a669c572be6acebe8f | diff --git a/lib/on_membership_event.js b/lib/on_membership_event.js
index <HASH>..<HASH> 100644
--- a/lib/on_membership_event.js
+++ b/lib/on_membership_event.js
@@ -21,7 +21,7 @@
var Member = require('./membership/member.js');
var MembershipEvents = require('./membership/events.js');
-var RingEvents = require('../ring/events.js');
+var RingEvents = require('./ring/events.js');
function createChecksumComputedHandler(ringpop) {
return function onMembershipChecksumComputed() { | Wrong path to ./ring/events | esatterwhite_skyring | train | js |
68628b672c0ac39110a96e165e2e883097e48cbe | diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/home_controller.rb
+++ b/app/controllers/home_controller.rb
@@ -1,6 +1,6 @@
class HomeController < ApplicationController
def index
- @count = Rubygem.total_count
+ @count = Version.latest.count
@latest = Rubygem.latest
@downloaded = Rubygem.downloaded
@updated = Version.updated | Use Version.latest.count instead of total_count since AR hates DISTINCT | rubygems_rubygems.org | train | rb |
8e696a718c824b7473a0226154db26d481b613e6 | diff --git a/zap/src/main/java/org/parosproxy/paros/view/AbstractFrame.java b/zap/src/main/java/org/parosproxy/paros/view/AbstractFrame.java
index <HASH>..<HASH> 100644
--- a/zap/src/main/java/org/parosproxy/paros/view/AbstractFrame.java
+++ b/zap/src/main/java/org/parosproxy/paros/view/AbstractFrame.java
@@ -25,6 +25,7 @@
// ZAP: 2015/09/07 Move icon loading to a utility class
// ZAP: 2019/06/01 Normalise line endings.
// ZAP: 2019/06/05 Normalise format/style.
+// ZAP: 2020/11/05 Remove abstract modifier.
package org.parosproxy.paros.view;
import java.awt.Dimension;
@@ -61,7 +62,7 @@ import org.zaproxy.zap.utils.DisplayUtils;
* #setPreferredSize(Dimension)} instead. Also, don't use {@link #setLocation(Point)}. This abstract
* class will automatically take care of size and position.
*/
-public abstract class AbstractFrame extends JFrame {
+public class AbstractFrame extends JFrame {
private static final long serialVersionUID = 6751593232255236597L; | Allow to instantiate AbstractFrame
Do not require to extend the class to use it, it's not needed. | zaproxy_zaproxy | train | java |
d61c20fcb9d886a2565efcc6cb3ca7dd5247a604 | diff --git a/src/angular-ui-query-builder-tables.js b/src/angular-ui-query-builder-tables.js
index <HASH>..<HASH> 100644
--- a/src/angular-ui-query-builder-tables.js
+++ b/src/angular-ui-query-builder-tables.js
@@ -440,7 +440,7 @@ angular.module('angular-ui-query-builder')
of {{showRange.total | number}}
</span>
</span>
- <ul ng-if="qbTableSettings.pagination.showPages && showRange.end" class="display-pages pagination">
+ <ul ng-if="qbTableSettings.pagination.showPages && showRange.end && pages.max > 1" class="display-pages pagination">
<li ng-repeat="page in pages.range track by page.number" ng-class="page.mode == 'current' ? 'active' : ''">
<a ng-click="navPageNumber(page.number)">
{{page.number + 1 | number}} | BUGFIX: Dont show page display if there is only one page within the range anyway | MomsFriendlyDevCo_angular-ui-query-builder | train | js |
ab0ae4fe5e92de578e5ee2984489c8605811fd27 | diff --git a/src/Charcoal/Object/RoutableTrait.php b/src/Charcoal/Object/RoutableTrait.php
index <HASH>..<HASH> 100644
--- a/src/Charcoal/Object/RoutableTrait.php
+++ b/src/Charcoal/Object/RoutableTrait.php
@@ -423,6 +423,7 @@ trait RoutableTrait
$objectRoute->setData($data);
$objectRoute->setSlug($slug);
+ $objectRoute->setLang($lang);
if (!$objectRoute->isSlugUnique()) {
$objectRoute->generateUniqueSlug(); | Set lang to objectRoute. | locomotivemtl_charcoal-object | train | php |
1491c973b82b6f54b7a86161aaf2b8053964f0d3 | diff --git a/pylint/checkers/base.py b/pylint/checkers/base.py
index <HASH>..<HASH> 100644
--- a/pylint/checkers/base.py
+++ b/pylint/checkers/base.py
@@ -137,6 +137,10 @@ TYPE_QNAME = "%s.type" % BUILTINS
PY33 = sys.version_info >= (3, 3)
PY3K = sys.version_info >= (3, 0)
PY35 = sys.version_info >= (3, 5)
+ABC_METACLASSES = {
+ '_py_abc.ABCMeta', # Python 3.7+,
+ 'abc.ABCMeta',
+}
# Name categories that are always consistent with all naming conventions.
EXEMPT_NAME_CATEGORIES = {'exempt', 'ignore'}
@@ -664,7 +668,7 @@ class BasicErrorChecker(_BasicChecker):
node=node)
break
return
- if metaclass.qname() == 'abc.ABCMeta' and abstract_methods:
+ if metaclass.qname() in ABC_METACLASSES and abstract_methods:
self.add_message('abstract-class-instantiated',
args=(infered.name, ),
node=node) | abstract-class-instantiated accounts for _py_abc.ABCMeta for Python <I> | PyCQA_pylint | train | py |
f7276868ad92f123aa0fb17f315b6ab51dbf480b | diff --git a/galpy/potential_src/plotRotcurve.py b/galpy/potential_src/plotRotcurve.py
index <HASH>..<HASH> 100644
--- a/galpy/potential_src/plotRotcurve.py
+++ b/galpy/potential_src/plotRotcurve.py
@@ -89,14 +89,8 @@ def calcRotcurve(Pot,Rs):
grid=1
Rs= nu.array([Rs])
rotcurve= nu.zeros(grid)
- from planarPotential import evaluateplanarRforces
for ii in range(grid):
- try:
- rotcurve[ii]= nu.sqrt(Rs[ii]*-evaluateplanarRforces(Rs[ii],Pot))
- except TypeError:
- from planarPotential import RZToplanarPotential
- Pot= RZToplanarPotential(Pot)
- rotcurve[ii]= nu.sqrt(Rs[ii]*-evaluateplanarRforces(Rs[ii],Pot))
+ rotcurve[ii]= vcirc(Pot,Rs[ii])
return rotcurve
def vcirc(Pot,R): | rewrite calcRotcurve | jobovy_galpy | train | py |
84af7b1286ce3813fce18a6d7068a09f9b48eed5 | diff --git a/javascript/node/selenium-webdriver/http/index.js b/javascript/node/selenium-webdriver/http/index.js
index <HASH>..<HASH> 100644
--- a/javascript/node/selenium-webdriver/http/index.js
+++ b/javascript/node/selenium-webdriver/http/index.js
@@ -213,6 +213,7 @@ function sendRequest(options, onOk, onError, opt_data, opt_proxy, opt_retries) {
if (!location.hostname) {
location.hostname = hostname;
location.port = port;
+ location.auth = options.auth;
}
request.abort();
@@ -222,6 +223,7 @@ function sendRequest(options, onOk, onError, opt_data, opt_proxy, opt_retries) {
hostname: location.hostname,
port: location.port,
path: location.path,
+ auth: location.auth,
pathname: location.pathname,
search: location.search,
hash: location.hash, | fix(nodejs): include auth in same domain redirects (#<I>) | SeleniumHQ_selenium | train | js |
8c0ec268ceccdf7b79dc0f4cadfc1348e511e8ec | diff --git a/src/bg/passwords.php b/src/bg/passwords.php
index <HASH>..<HASH> 100644
--- a/src/bg/passwords.php
+++ b/src/bg/passwords.php
@@ -14,7 +14,7 @@ return [
'reset' => 'Паролата е нулирана!',
'sent' => 'Изпратено е напомняне за вашата парола!',
- 'throttled' => 'Моля изчакайте преди да опитате отново.',
+ 'throttled' => 'Моля изчакайте, преди да опитате отново.',
'token' => 'Този токен за нулиране на парола е невалиден.',
'user' => 'Потребител с такъв e-mail адрес не може да бъде открит.',
]; | [bg] Update password.php throttled translation | caouecs_Laravel-lang | train | php |
836e1112d8b0f58aa2d05f7b8fe1697ca6fc22a0 | diff --git a/lib/beanstalkd_view/beanstalkd_utils.rb b/lib/beanstalkd_view/beanstalkd_utils.rb
index <HASH>..<HASH> 100644
--- a/lib/beanstalkd_view/beanstalkd_utils.rb
+++ b/lib/beanstalkd_view/beanstalkd_utils.rb
@@ -12,7 +12,7 @@ module BeanstalkdView
def beanstalk_url
return @@url if defined?(@@url) and @@url
- ENV['BEANSTALK_URL'] || 'beanstalk://localhost/'
+ ENV['BEANSTALK_URL'] || 'beanstalk://127.0.0.1/'
end
def beanstalk_addresses | Use <I> as the default host instead of localhost
This should be used to avoid connection refused exceptions when trying
to connect to IPv6 socket (since there is no code to handle ipv4
fallback). | denniskuczynski_beanstalkd_view | train | rb |
895cbd0b4cb27e60aac630fe2e52c742038a00bf | diff --git a/middleware.go b/middleware.go
index <HASH>..<HASH> 100644
--- a/middleware.go
+++ b/middleware.go
@@ -2,7 +2,6 @@ package req
import (
"bytes"
- "github.com/imroc/req/v3/internal/util"
"io"
"io/ioutil"
"mime/multipart"
@@ -14,6 +13,8 @@ import (
"reflect"
"strings"
"time"
+
+ "github.com/imroc/req/v3/internal/util"
)
type (
@@ -272,7 +273,7 @@ func unmarshalBody(c *Client, r *Response, v interface{}) (err error) {
}
func parseResponseBody(c *Client, r *Response) (err error) {
- if r.StatusCode == http.StatusNoContent {
+ if nil == r.Response || r.StatusCode == http.StatusNoContent {
return
}
if r.Request.Result != nil && r.IsSuccess() { | :bug: Fix non-pointer panic | imroc_req | train | go |
bc86c8e97397a518d8e2167376160a4b6890454e | diff --git a/skeleton.go b/skeleton.go
index <HASH>..<HASH> 100644
--- a/skeleton.go
+++ b/skeleton.go
@@ -50,11 +50,11 @@ type conversation interface {
}
func (c *context) send(message []byte) {
- // Dummy for now
+ // FIXME Dummy for now
}
func (c *context) receive() []byte {
- // Dummy for now
+ // FIXME Dummy for now
return nil
} | Silly change to test CI config | coyim_otr3 | train | go |
32f0edffc892e21ad5bce0dfa40689aad66e18bc | diff --git a/pep8ify/pep8ify.py b/pep8ify/pep8ify.py
index <HASH>..<HASH> 100755
--- a/pep8ify/pep8ify.py
+++ b/pep8ify/pep8ify.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-from lib2to3.main import main
+import lib2to3.main
try:
import pep8ify.fixes
@@ -14,7 +14,7 @@ except ImportError:
def _main():
- raise SystemExit(main("pep8ify.fixes"))
+ raise SystemExit(lib2to3.main.main("pep8ify.fixes"))
if __name__ == '__main__':
_main() | Clean-up: Use lib2to3.main.main qualified.
Calling just `main(...)` is a bit irritating. | spulec_pep8ify | train | py |
6a224de3b81062b34390bae43b0ff66d75566d8b | diff --git a/js/src/composer-autocomplete.js b/js/src/composer-autocomplete.js
index <HASH>..<HASH> 100644
--- a/js/src/composer-autocomplete.js
+++ b/js/src/composer-autocomplete.js
@@ -152,15 +152,17 @@ export default function() {
dropdown.active(true);
clearTimeout(searchTimeout);
- searchTimeout = setTimeout(function() {
- var typedLower = typed.toLowerCase();
- if (searched.indexOf(typedLower) === -1) {
- app.store.find('users', {q: typed, page: {limit: 5}}).then(users => {
- if (dropdown.active()) buildSuggestions();
- });
- searched.push(typedLower);
- }
- }, 250);
+ if (typed) {
+ searchTimeout = setTimeout(function() {
+ var typedLower = typed.toLowerCase();
+ if (searched.indexOf(typedLower) === -1) {
+ app.store.find('users', {q: typed, page: {limit: 5}}).then(users => {
+ if (dropdown.active()) buildSuggestions();
+ });
+ searched.push(typedLower);
+ }
+ }, 250);
+ }
}
});
}); | No need to query the API about nothing | flarum_mentions | train | js |
d89025d8b7fe04c35b947f048cb91eba9f58ee39 | diff --git a/script/wee.chain.js b/script/wee.chain.js
index <HASH>..<HASH> 100644
--- a/script/wee.chain.js
+++ b/script/wee.chain.js
@@ -83,6 +83,8 @@
*/
each: function(fn, options) {
W.$each(this, fn, options);
+
+ return this;
},
/** | Return Wee instance from chained each() | weepower_wee-core | train | js |
b78bfea72f3ae2c049192feba554b0c9da14fdd0 | diff --git a/thinc/config.py b/thinc/config.py
index <HASH>..<HASH> 100644
--- a/thinc/config.py
+++ b/thinc/config.py
@@ -316,7 +316,7 @@ class registry(object):
# Handle spread arguments and use their annotation as Sequence[whatever]
if param.kind == param.VAR_POSITIONAL:
spread_annot = Sequence[annotation] # type: ignore
- sig_args[ARGS_FIELD_ALIAS] = (spread_annot, default)
+ sig_args[ARGS_FIELD_ALIAS] = (spread_annot, param.default)
else:
sig_args[param.name] = (annotation, default)
sig_args["__config__"] = _PromiseSchemaConfig | Don't make positional __args__ required if present
Functions can totally define variable *args and not have any passed in | explosion_thinc | train | py |
d951803d619787f8daa4d81480eb467d00208477 | diff --git a/test/tests/OutputChannel.test.js b/test/tests/OutputChannel.test.js
index <HASH>..<HASH> 100644
--- a/test/tests/OutputChannel.test.js
+++ b/test/tests/OutputChannel.test.js
@@ -185,4 +185,28 @@ describe("OutputChannel Object", function() {
});
+ describe("resetAllControllers()", function () {
+
+ it("should call the 'sendChannelMode' method", function () {
+
+ // Arrange
+ let spy = sinon.spy(WebMidiOutputChannel, "sendChannelMode");
+ let options = {};
+
+ // Act
+ WebMidiOutputChannel.resetAllControllers(options);
+
+ // Assert
+ expect(spy.calledOnceWithExactly("resetallcontrollers", 0, options)).to.be.true;
+
+ });
+
+ it("should return the 'OutputChannel' object for method chaining", function () {
+ expect(
+ WebMidiOutputChannel.resetAllControllers()
+ ).to.equal(WebMidiOutputChannel);
+ });
+
+ });
+
}); | Add tests for resetAllControllers() method | djipco_webmidi | train | js |
8e09d886c531ca3422e4767d86b2b3ad24ddc9ef | diff --git a/lib/search_engine.py b/lib/search_engine.py
index <HASH>..<HASH> 100644
--- a/lib/search_engine.py
+++ b/lib/search_engine.py
@@ -2320,6 +2320,7 @@ def print_records(req, recIDs, jrec=1, rg=10, format='hb', ot='', ln=cdslang, re
epilogue=format_epilogue,
ln=ln,
search_pattern=search_pattern,
+ record_separator="\n",
uid=uid))
elif format.startswith('t') or str(format[0:3]).isdigit(): | When using the new format_records() function, set the record_separator
argument to newline, fixing joined format nuisance formatting such as
"</record><record>" in the search engine MARCXML output. | inveniosoftware_invenio-records | train | py |
fbfba5b9694dc0b77cccaa1e58ee677d0d4015b6 | diff --git a/voice.go b/voice.go
index <HASH>..<HASH> 100644
--- a/voice.go
+++ b/voice.go
@@ -135,7 +135,6 @@ func (v *VoiceConnection) ChangeChannel(channelID string, mute, deaf bool) (err
// Disconnect disconnects from this voice channel and closes the websocket
// and udp connections to Discord.
-// !!! NOTE !!! this function may be removed in favour of ChannelVoiceLeave
func (v *VoiceConnection) Disconnect() (err error) {
// Send a OP4 with a nil channel to disconnect | Update Disconnect() comment
It looks like dgo has moved away from ChannelVoiceLeave ever since discord allows bot to connect to more than one channel. Confusing comment seeing that it is very hard to find information about the function that it mentions. | bwmarrin_discordgo | train | go |
a6702b64c7aceb711d109540b617eb3ec7cff556 | diff --git a/specs-go/v1/layout.go b/specs-go/v1/layout.go
index <HASH>..<HASH> 100644
--- a/specs-go/v1/layout.go
+++ b/specs-go/v1/layout.go
@@ -14,8 +14,6 @@
package v1
-import "regexp"
-
// ImageLayoutVersion is the version of ImageLayout
const ImageLayoutVersion = "1.0.0"
@@ -24,8 +22,3 @@ const ImageLayoutVersion = "1.0.0"
type ImageLayout struct {
Version string `json:"imageLayoutVersion"`
}
-
-var (
- // RefsRegexp matches requirement of image-layout 'refs' charset.
- RefsRegexp = regexp.MustCompile(`^[a-zA-Z0-9-._]+$`)
-) | specs-go/v1/layout: Remove RefsRegexp
The restriction on names was removed by <I>a6be (image-layout:
./refs/ -> index.json, <I>-<I>-<I>, #<I>) and the replacement
(org.opencontainers.ref.name) has no equivalent limitation. | opencontainers_image-spec | train | go |
721cd6cdf335033508cd8ccd6c0752a816cc1307 | diff --git a/src/Driver/Element/Wpphp/UserElement.php b/src/Driver/Element/Wpphp/UserElement.php
index <HASH>..<HASH> 100644
--- a/src/Driver/Element/Wpphp/UserElement.php
+++ b/src/Driver/Element/Wpphp/UserElement.php
@@ -27,7 +27,7 @@ class UserElement extends BaseElement
throw new UnexpectedValueException(sprintf('Failed creating new user: %s', $user->get_error_message()));
}
- return $this->get($user->ID);
+ return $this->get($user);
}
/**
diff --git a/src/Driver/WpphpDriver.php b/src/Driver/WpphpDriver.php
index <HASH>..<HASH> 100644
--- a/src/Driver/WpphpDriver.php
+++ b/src/Driver/WpphpDriver.php
@@ -302,7 +302,7 @@ class WpphpDriver extends BaseDriver
return array(
'id' => $user->ID,
- 'slug' => $user->user_nicename,
+ 'slug' => $user->$user_login,
);
} | Effect the user failure fix for the WPPHP driver also
The wpphp user element class was attempting to access $user->id where
$user was already the id of the user in question. As such a `Trying to
get property of non-object` error was thrown. The create user method now
simply access $user. | paulgibbs_behat-wordpress-extension | train | php,php |
17722400e7ef28e527fa938b817e2bbcd38d79fc | diff --git a/simple_elasticsearch/management/commands/es_manage.py b/simple_elasticsearch/management/commands/es_manage.py
index <HASH>..<HASH> 100644
--- a/simple_elasticsearch/management/commands/es_manage.py
+++ b/simple_elasticsearch/management/commands/es_manage.py
@@ -5,6 +5,17 @@ from django.core.management.base import BaseCommand, CommandError
from ...utils import get_indices, create_indices, rebuild_indices
+class Unbuffered(object):
+ def __init__(self, stream):
+ self.stream = stream
+ def write(self, data):
+ self.stream.write(data)
+ self.stream.flush()
+ def __getattr__(self, attr):
+ return getattr(self.stream, attr)
+sys.stdout = Unbuffered(sys.stdout)
+
+
class ESCommandError(CommandError):
pass | Adding a 'flushing' sys.stdout wrapper to help with some command line text output. | jaddison_django-simple-elasticsearch | train | py |
f68b85e93e8be43a0650bbeedfd9ab1079b2c373 | diff --git a/lib/docusign_rest/client.rb b/lib/docusign_rest/client.rb
index <HASH>..<HASH> 100644
--- a/lib/docusign_rest/client.rb
+++ b/lib/docusign_rest/client.rb
@@ -354,7 +354,7 @@ module DocusignRest
listTabs: get_tabs(signer[:list_tabs], options, index),
noteTabs: nil,
numberTabs: nil,
- radioGroupTabs: nil,
+ radioGroupTabs: get_tabs(signer[:radio_group_tabs], options, index),
initialHereTabs: get_tabs(signer[:initial_here_tabs], options.merge!(initial_here_tab: true), index),
signHereTabs: get_tabs(signer[:sign_here_tabs], options.merge!(sign_here_tab: true), index),
signerAttachmentTabs: nil,
@@ -415,6 +415,9 @@ module DocusignRest
tab_hash[:list_items] = tab[:list_items] if tab[:list_items]
+ tab_hash[:groupName] = tab[:group_name] if tab.key?(:group_name)
+ tab_hash[:radios] = get_tabs(tab[:radios], options, index) if tab.key?(:radios)
+
tab_array << tab_hash
end
tab_array | Added support for the Radio Group Tab. Fixes jondkinney/docusign_rest#<I> | jondkinney_docusign_rest | train | rb |
825dc8e002e026e41724b53faf71bc870c5ed7e4 | diff --git a/tasks/save.js b/tasks/save.js
index <HASH>..<HASH> 100644
--- a/tasks/save.js
+++ b/tasks/save.js
@@ -36,7 +36,7 @@ function save(name, src = path.resolve(), options) {
filter: pathToCopy => {
const match = pathToCopy.match(/node_modules$|.git$/);
if (match) {
- console.log(`${chalk.redBright(match[0])} has been excluded from ${chalk.blueBright(name)}`);
+ console.log(`${chalk.dim.redBright(match[0])} has been excluded from ${chalk.blueBright(name)}`);
}
return !match;
}
@@ -80,7 +80,7 @@ function clean(root, name) {
const itemExists = fs.pathExistsSync(pathToItem);
if (itemExists) {
fs.removeSync(pathToItem);
- console.log(`${chalk.redBright(item)} has been removed from ${chalk.blueBright(name)}`);
+ console.log(`${chalk.dim.redBright(item)} has been removed from ${chalk.blueBright(name)}`);
}
}
} | Add dim modifier to filtered and removed content logs | jolaleye_snap | train | js |
434de23e9ad5123b0b19ad5ac4339715ec954d3e | diff --git a/frigg_worker/fetcher.py b/frigg_worker/fetcher.py
index <HASH>..<HASH> 100644
--- a/frigg_worker/fetcher.py
+++ b/frigg_worker/fetcher.py
@@ -123,5 +123,5 @@ def upgrade():
pip.main(['install', '-U', 'frigg-worker'])
pip.main(['install', '-U', 'frigg-settings'])
pip.main(['install', '-U', 'frigg-test-discovery'])
- pip.main(['install', '-U', 'docker-wrapper-py'])
+ pip.main(['install', '-U', 'docker-wrapper'])
sys.exit(1)
diff --git a/tests/test_fetcher.py b/tests/test_fetcher.py
index <HASH>..<HASH> 100644
--- a/tests/test_fetcher.py
+++ b/tests/test_fetcher.py
@@ -109,5 +109,5 @@ class FetcherTests(TestCase):
call(['install', '-U', 'frigg-worker']),
call(['install', '-U', 'frigg-settings']),
call(['install', '-U', 'frigg-test-discovery']),
- call(['install', '-U', 'docker-wrapper-py'])
+ call(['install', '-U', 'docker-wrapper'])
]) | fix(deps): Set correct ref to docker-wrapper in fetcher | frigg_frigg-worker | train | py,py |
f07a2b98952f0dd92f740266b1c06a71aaf94a9f | diff --git a/version.py b/version.py
index <HASH>..<HASH> 100644
--- a/version.py
+++ b/version.py
@@ -4,7 +4,7 @@
_version_major = 0
_version_minor = 1
_version_micro = '' # use '' for first of series, number for 1 and above
-_version_extra = 'dev'
+_version_extra = 'rc1'
#_version_extra = '' # Uncomment this for full releases
# Construct full version string from these. | Making a release candidate to test installation through pip. | cni_MRS | train | py |
a433c16feb2bc0703a160ad931b13dc65b93760d | diff --git a/jax/experimental/jax2tf/tests/primitive_harness.py b/jax/experimental/jax2tf/tests/primitive_harness.py
index <HASH>..<HASH> 100644
--- a/jax/experimental/jax2tf/tests/primitive_harness.py
+++ b/jax/experimental/jax2tf/tests/primitive_harness.py
@@ -905,10 +905,10 @@ lax_conv_general_dilated = tuple( # Validate dtypes and precision
# This first harness runs the tests for all dtypes and precisions using
# default values for all the other parameters. Variations of other parameters
# can thus safely skip testing their corresponding default value.
- _make_conv_harness("dtype_precision", dtype=dtype, precision=precision)
- for dtype in jtu.dtypes.all_inexact
- for precision in [None, lax.Precision.DEFAULT, lax.Precision.HIGH,
- lax.Precision.HIGHEST]
+ # _make_conv_harness("dtype_precision", dtype=dtype, precision=precision)
+ # for dtype in jtu.dtypes.all_inexact
+ # for precision in [None, lax.Precision.DEFAULT, lax.Precision.HIGH,
+ # lax.Precision.HIGHEST]
) + tuple( # Validate variations of feature_group_count and batch_group_count
_make_conv_harness("group_counts", lhs_shape=lhs_shape, rhs_shape=rhs_shape,
feature_group_count=feature_group_count, | [jax2tf] Disable some convolution tests (#<I>) | tensorflow_probability | train | py |
6307473ffe7679363e80f4a3417ae5e9438d47a8 | diff --git a/lib/oneview-sdk/resource/api800/synergy/server_hardware_type.rb b/lib/oneview-sdk/resource/api800/synergy/server_hardware_type.rb
index <HASH>..<HASH> 100644
--- a/lib/oneview-sdk/resource/api800/synergy/server_hardware_type.rb
+++ b/lib/oneview-sdk/resource/api800/synergy/server_hardware_type.rb
@@ -15,7 +15,7 @@ module OneviewSDK
module API800
module Synergy
# Server hardware type resource implementation for API800 Synergy
- class ServerHardwareType < OneviewSDK::API800::C7000::ServerHardwareType
+ class ServerHardwareType < OneviewSDK::API800::C7000::ServerHardwareType
end
end
end | Removing whitespaces from server hardware type File | HewlettPackard_oneview-sdk-ruby | train | rb |
724181fd2655736c1f76e05e8edb3fcf0d60abc1 | diff --git a/src/utils/ui/create-publishable-api-keys-ui.js b/src/utils/ui/create-publishable-api-keys-ui.js
index <HASH>..<HASH> 100644
--- a/src/utils/ui/create-publishable-api-keys-ui.js
+++ b/src/utils/ui/create-publishable-api-keys-ui.js
@@ -148,7 +148,7 @@ export default function createPublishableApiKeysUi (a, b) {
createPromptUi({
width: 550,
title: 'Generate Publishable Api Key',
- message: 'Please specify allowed domains separated by empty space.<br>Example: "localhost *.3d.io mypage.com"',
+ message: 'Please specify allowed domains separated by empty space.<br>Example: localhost *.3d.io mypage.com',
bottom: el('<a>', {
html: 'Read more about allowed domains',
href: 'https://3d.io/docs/api/1/authentication.html',
@@ -199,4 +199,4 @@ export default function createPublishableApiKeysUi (a, b) {
})
})
-}
\ No newline at end of file
+} | Removed quotes from allowed domains example | archilogic-com_3dio-js | train | js |
2e01ce19748afc48c9e06efd2400f93fce02ade5 | diff --git a/dvc/version.py b/dvc/version.py
index <HASH>..<HASH> 100644
--- a/dvc/version.py
+++ b/dvc/version.py
@@ -6,7 +6,7 @@
import os
import subprocess
-_BASE_VERSION = "2.0.0a0"
+_BASE_VERSION = "2.0.0a1"
def _generate_version(base_version): | dvc: bump to <I>a1 | iterative_dvc | train | py |
919036474a9bc6947f4534436cb04433a549ae17 | diff --git a/lib/spear/resource/talent_network.rb b/lib/spear/resource/talent_network.rb
index <HASH>..<HASH> 100644
--- a/lib/spear/resource/talent_network.rb
+++ b/lib/spear/resource/talent_network.rb
@@ -5,12 +5,12 @@ module Spear
raise Spear::ParametersRequired.new('TalentNetworkDID') if talent_network_did.blank?
Spear::Request.new(:get, Spear.uri_tn_join_form_question % [talent_network_did, 'json'], {
- api_options: {need_test_element: true}}).execute
+ api_options: {need_test_element: false}}).execute
end
def create_member(data={})
Spear::Request.new(:post, Spear.uri_tn_menber_create % ['json'], {
- api_options: {need_test_element: true}, body: data}).execute
+ api_options: {need_test_element: false}, body: data}).execute
end
end
end
diff --git a/lib/spear/version.rb b/lib/spear/version.rb
index <HASH>..<HASH> 100644
--- a/lib/spear/version.rb
+++ b/lib/spear/version.rb
@@ -1,3 +1,3 @@
module Spear
- VERSION = "0.0.8"
+ VERSION = "0.0.9"
end | fix tn api create member bug. | hilotus_spear-cb-api | train | rb,rb |
dc60bb22f5d640289c062750b65a1afbcbef4525 | diff --git a/presto-orc/src/main/java/com/facebook/presto/orc/reader/TimestampSelectiveStreamReader.java b/presto-orc/src/main/java/com/facebook/presto/orc/reader/TimestampSelectiveStreamReader.java
index <HASH>..<HASH> 100644
--- a/presto-orc/src/main/java/com/facebook/presto/orc/reader/TimestampSelectiveStreamReader.java
+++ b/presto-orc/src/main/java/com/facebook/presto/orc/reader/TimestampSelectiveStreamReader.java
@@ -442,6 +442,17 @@ public class TimestampSelectiveStreamReader
@Override
public void close()
{
+ values = null;
+ outputPositions = null;
+ nulls = null;
+
+ presentStream = null;
+ presentStreamSource = null;
+ secondsStream = null;
+ secondsStreamSource = null;
+ nanosStream = null;
+ nanosStreamSource = null;
+
systemMemoryContext.close();
} | Speed up GC of TimestampSelectiveReader by clearing member variables in close() | prestodb_presto | train | java |
4d638b80a1bd2a4b299cb202670b17213f9a882c | diff --git a/green/loader.py b/green/loader.py
index <HASH>..<HASH> 100644
--- a/green/loader.py
+++ b/green/loader.py
@@ -88,18 +88,4 @@ def getTests(target):
logging.debug("Load method: FILE - {}".format(candidate))
return tests
-
- # INSTALLED MODULE - (Unlike the installed package, we don't discover
- # inaccessible tests in this case -- we stick to tests accessible from the
- # module)
- if target and (target[0] != '.'): # We don't handle relative installed modules
- tests = None
- try:
- module = importlib.import_module(target)
- tests = loader.loadTestsFromModule(module)
- except ImportError:
- pass
- if tests and tests.countTestCases():
- return tests
-
return None | Through extensive testing, I found that we never hit the loadTestsFromModule section, because loadTestsFromName handles the case of a built-in module and a module relative to the current path. | CleanCut_green | train | py |
56781cbcfd0e8768958654489fe5c4ac75a2ae34 | diff --git a/system/Router/Router.php b/system/Router/Router.php
index <HASH>..<HASH> 100644
--- a/system/Router/Router.php
+++ b/system/Router/Router.php
@@ -125,6 +125,8 @@ class Router implements RouterInterface
$this->method = $this->collection->getDefaultMethod();
$this->collection->setHTTPVerb($request->getMethod() ?? strtolower($_SERVER['REQUEST_METHOD']));
+
+ $this->translateURIDashes = $this->collection->shouldTranslateURIDashes();
}
/**
@@ -135,8 +137,6 @@ class Router implements RouterInterface
*/
public function handle(?string $uri = null)
{
- $this->translateURIDashes = $this->collection->shouldTranslateURIDashes();
-
// If we cannot find a URI to match against, then
// everything runs off of its default settings.
if ($uri === null || $uri === '') { | refactor: move property initialization to constructor | codeigniter4_CodeIgniter4 | train | php |
15f8d274892adced15e1af20da8e993b34d632b8 | diff --git a/DependencyInjection/Source/JWKSetSource/JKU.php b/DependencyInjection/Source/JWKSetSource/JKU.php
index <HASH>..<HASH> 100644
--- a/DependencyInjection/Source/JWKSetSource/JKU.php
+++ b/DependencyInjection/Source/JWKSetSource/JKU.php
@@ -30,7 +30,7 @@ final class JKU extends DownloadedJWKSet
$definition->setArguments([
$config['url'],
$config['is_secured'],
- $config['cache'],
+ new Reference($config['cache']),
$config['cache_ttl'],
$config['is_https'],
]); | Bug fixed when a JKU source is created from the configuration file | Spomky-Labs_jose-bundle | train | php |
5ee6306a71cb7e3c707ddd006675617a0b9f93e6 | diff --git a/lib/ponder/delegate.rb b/lib/ponder/delegate.rb
index <HASH>..<HASH> 100644
--- a/lib/ponder/delegate.rb
+++ b/lib/ponder/delegate.rb
@@ -1,6 +1,6 @@
module Ponder
module Delegate
- def delegate!
+ def delegate
thaum = self
(IRC.instance_methods + [:configure, :on, :connect, :reload!, :reloading?]).each do |method| # methods.each do |method|
diff --git a/lib/ponder/thaum.rb b/lib/ponder/thaum.rb
index <HASH>..<HASH> 100644
--- a/lib/ponder/thaum.rb
+++ b/lib/ponder/thaum.rb
@@ -1,13 +1,15 @@
require 'ponder/callback'
require 'ponder/connection'
require 'ponder/irc'
-require 'ponder/delegate'
require 'ostruct'
module Ponder
class Thaum
include IRC
- include Delegate
+ if RUBY_VERSION >= '1.9'
+ require 'ponder/delegate'
+ include Delegate
+ end
attr_reader :config
attr_accessor :connected, :traffic_logger, :error_logger, :console_logger | delegate functionality restricted for Ruby >= <I> | tbuehlmann_ponder | train | rb,rb |
24c73a489206cd8fc293d7d07534e9f59aecf1a0 | diff --git a/lib/socket.js b/lib/socket.js
index <HASH>..<HASH> 100644
--- a/lib/socket.js
+++ b/lib/socket.js
@@ -112,6 +112,11 @@ Socket.prototype.open = function () {
Socket.prototype.setTransport = function (transport) {
var self = this;
+ if (this.transport) {
+ // debug: clearing existing transport
+ this.transport.removeAllListeners();
+ }
+
// set up transport
this.transport = transport; | Sanity check: clear all events from previous transport in setTransport. | socketio_engine.io-client | train | js |
8f9ed33446c160b49e2269d098acaf7d6a05ef87 | diff --git a/test/tests/clone.js b/test/tests/clone.js
index <HASH>..<HASH> 100644
--- a/test/tests/clone.js
+++ b/test/tests/clone.js
@@ -103,4 +103,18 @@ describe("Clone", function() {
return prepTestAndClean(url, file);
});
+
+ it("will not segfault when accessing a url without username", function() {
+ var url = "https://github.com/nodegit/private";
+
+ return Clone.clone(url, git, {
+ certificateCheck: function() { return 1; },
+ remoteCallbacks: {
+ credentials: function() {
+ return NodeGit.Cred.userpassPlaintextNew("fake-token",
+ "x-oauth-basic");
+ }
+ }
+ }).catch();
+ });
}); | Unit test showing segfault via #<I>
If you attempt to clone a private repository without passing along a
username, `NULL` will make `NanNew` very upset. | nodegit_nodegit | train | js |
bc16bd57ac1a104cb7ab79db2cfe11f7bab84aca | diff --git a/mod/data/lib.php b/mod/data/lib.php
index <HASH>..<HASH> 100755
--- a/mod/data/lib.php
+++ b/mod/data/lib.php
@@ -1192,9 +1192,9 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order='
$fn = !empty($search_array[DATA_FIRSTNAME]->data) ? $search_array[DATA_FIRSTNAME]->data : '';
$ln = !empty($search_array[DATA_LASTNAME]->data) ? $search_array[DATA_LASTNAME]->data : '';
$patterns[] = '/##firstname##/';
- $replacement[] = '<input type="text" size="16" name="u_fn" value="'.$fn.'">';
+ $replacement[] = '<input type="text" size="16" name="u_fn" value="'.$fn.'" />';
$patterns[] = '/##lastname##/';
- $replacement[] = '<input type="text" size="16" name="u_ln" value="'.$ln.'">';
+ $replacement[] = '<input type="text" size="16" name="u_ln" value="'.$ln.'" />';
///actual replacement of the tags
$newtext = preg_replace($patterns, $replacement, $data->asearchtemplate); | MDL-<I> xhtml strict; merged from MOODLE_<I>_STABLE | moodle_moodle | train | php |
211102189c391f9376d0c55779d0b6dcdf10444c | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -73,7 +73,7 @@ function vimeo(str) {
var id;
var arr;
- const vimeoPipe = [
+ var vimeoPipe = [
'https?:\/\/vimeo\.com\/[0-9]+$',
'https?:\/\/player\.vimeo\.com\/video\/[0-9]+$',
'https?:\/\/vimeo\.com\/channels',
@@ -81,7 +81,7 @@ function vimeo(str) {
'album'
].join('|');
- const vimeoRegex = new RegExp(vimeoPipe, 'gim');
+ var vimeoRegex = new RegExp(vimeoPipe, 'gim');
if (vimeoRegex.test(str)) {
arr = str.split('/'); | Replace `const` with `var` in vimeo code. (#<I>)
Since `get-video-id` doesn't have a build process involving transpilation, and since node dependencies typically don't get transpiled, these `const` declarations were making their way into ES5 code. Replacing them with `var` should do the trick. | radiovisual_get-video-id | train | js |
9b76cea8c51c26ebecae975c7884a6f041669997 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -37,6 +37,7 @@ import {DoughnutChartDemo} from './showcase/chart/DoughnutChartDemo';
import {RadarChartDemo} from './showcase/chart/RadarChartDemo';
import {PolarAreaChartDemo} from './showcase/chart/PolarAreaChartDemo';
import {PaginatorDemo} from './showcase/paginator/PaginatorDemo';
+import {DataListDemo} from './showcase/datalist/DataListDemo';
import {Router, Route,browserHistory} from 'react-router';
ReactDOM.render(
@@ -78,6 +79,7 @@ ReactDOM.render(
<Route path="/polarareachart" component={PolarAreaChartDemo} />
<Route path="/radarchart" component={RadarChartDemo} />
<Route path="/paginator" component={PaginatorDemo} />
+ <Route path="/datalist" component={DataListDemo} />
</Route>
</Router>,
document.getElementById('root') | Added DataListDemo into index.js | primefaces_primereact | train | js |
eb1ea75d8f64d840f8b4fe8994ca4755987ac5ee | diff --git a/lib/chat.js b/lib/chat.js
index <HASH>..<HASH> 100644
--- a/lib/chat.js
+++ b/lib/chat.js
@@ -1,5 +1,4 @@
-var jQuery = require('jQuery'),
- builder = require('node-xmpp'),
+var builder = require('node-xmpp'),
Base = require('./base')
var Chat = function() {}
@@ -20,14 +19,13 @@ Chat.prototype.handles = function(stanza) {
Chat.prototype.handle = function(stanza) {
chat = {
from: this._getJid(stanza.attrs.from),
- content: jQuery(stanza.toString()).find('body').text()
+ content: stanza.getChild('body').getText()
}
this.socket.emit('xmpp.chat.message', chat)
return true
}
Chat.prototype.sendMessage = function(data) {
- console.log("I am " + this.manager.jid)
this.client.send(new builder.Element(
'message',
{ to: data.to, type: 'chat'} | Removing use of jQuery, issue #<I> | xmpp-ftw_xmpp-ftw | train | js |
2eda6a86266282db3f74e76330f28e38ec77a26a | diff --git a/lib/mock-promises.js b/lib/mock-promises.js
index <HASH>..<HASH> 100644
--- a/lib/mock-promises.js
+++ b/lib/mock-promises.js
@@ -28,12 +28,14 @@
};
var fakeThen = function() {
+ var promise = this;
contractsTracker.add({
- promise: this,
+ promise: promise,
fulfilledHandler: arguments[0],
errorHandler: arguments[1],
progressHandler: arguments[2]
});
+ return promise;
};
this.executeForPromise = function(promise){contractsTracker.executeForPromise(promise)};
diff --git a/spec/javascripts/mock-promises_spec.js b/spec/javascripts/mock-promises_spec.js
index <HASH>..<HASH> 100644
--- a/spec/javascripts/mock-promises_spec.js
+++ b/spec/javascripts/mock-promises_spec.js
@@ -39,6 +39,12 @@ describe("mock promises", function() {
}, 1);
});
+ it("maintains that then is chainable", function() {
+ var promise = PromiseWrapper("chainThings");
+ var chainedReturn = promise.then(function () { }).then(function () {});
+ expect(chainedReturn).toBe(promise);
+ });
+
describe("contracts", function() {
var fulfilledHandler1, fulfilledHandler2, errorHandler, progressHandler, promise1, promise2;
beforeEach(function() { | Fake then returns the promise making it chainable (and inline with Q and other libraries) | charleshansen_mock-promises | train | js,js |
bfa41d0e1d1ce71bc84abba1bc230db4a1256c0e | diff --git a/spyderlib/widgets/helperwidgets.py b/spyderlib/widgets/helperwidgets.py
index <HASH>..<HASH> 100644
--- a/spyderlib/widgets/helperwidgets.py
+++ b/spyderlib/widgets/helperwidgets.py
@@ -137,7 +137,6 @@ class HTMLDelegate(QStyledItemDelegate):
doc = QTextDocument()
doc.setHtml(options.text)
- doc.setTextWidth(options.rect.width())
return QSize(doc.idealWidth(), doc.size().height()) | File switcher: Remove option that was making it to not highlight correctly some entries | spyder-ide_spyder | train | py |
cc4782064df5811b9b083887675d0081496c83bc | diff --git a/mod/hotpot/index.php b/mod/hotpot/index.php
index <HASH>..<HASH> 100644
--- a/mod/hotpot/index.php
+++ b/mod/hotpot/index.php
@@ -356,7 +356,9 @@
// get best score
if (is_numeric($totals[$hotpot->id]->maxscore)) {
- $bestscore = $totals[$hotpot->id]->maxscore." / $hotpot->grade";
+ $weighting = $hotpot->grade / 100;
+ $precision = hotpot_get_precision($hotpot);
+ $bestscore = round($totals[$hotpot->id]->maxscore * $weighting, $precision)." / $hotpot->grade";
} else {
$bestscore = " ";
} | adjust "best grade" to range 0 to hotpot->maxgrade | moodle_moodle | train | php |
e2bc7d73c0fa1595c254977b8197fcf4c4ca357d | diff --git a/lib/withings/error.rb b/lib/withings/error.rb
index <HASH>..<HASH> 100644
--- a/lib/withings/error.rb
+++ b/lib/withings/error.rb
@@ -6,5 +6,13 @@ module Withings
# Raised when client is misconfigured
ClientConfigurationError = Class.new(self)
+
+ # Withings returns 200 for everything, making it difficult to figure out
+ # exactly what went wrong. They also appear to send back fairly arbitrary
+ # codes, for example a response with an HTTP Status Code 200 can contain
+ # a body {"status":503,"error":"Invalid Params"} if OAuth credentials are
+ # incorrect (503 normally indicates that a downstream service is unavailable).
+ # Because of this we just wrap most errors in this class.
+ InvalidResponseError = Class.new(self)
end
end
diff --git a/lib/withings/http/request.rb b/lib/withings/http/request.rb
index <HASH>..<HASH> 100644
--- a/lib/withings/http/request.rb
+++ b/lib/withings/http/request.rb
@@ -19,7 +19,7 @@ module Withings
when Net::HTTPOK
body = JSON.parse(response.body)
if body['status'].to_i != 0
- # TODO
+ raise Withings::Error::InvalidResponseError, "#{body['status']} - #{body['error']}"
end
body['body']
else | Raise exception when receiving a non-successful response | paulosman_withings-sdk | train | rb,rb |
22fe365151d008b97d6e93e48d12dc75488dcbf6 | diff --git a/core/src/main/java/org/infinispan/statetransfer/StateProviderImpl.java b/core/src/main/java/org/infinispan/statetransfer/StateProviderImpl.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/infinispan/statetransfer/StateProviderImpl.java
+++ b/core/src/main/java/org/infinispan/statetransfer/StateProviderImpl.java
@@ -112,7 +112,7 @@ public class StateProviderImpl implements StateProvider {
synchronized (transfersByDestination) {
for (Iterator<Address> it = transfersByDestination.keySet().iterator(); it.hasNext(); ) {
Address destination = it.next();
- if (!stateTransferInProgress || !members.contains(destination)) {
+ if (!members.contains(destination)) {
List<OutboundTransferTask> transfers = transfersByDestination.get(destination);
it.remove();
for (OutboundTransferTask outboundTransfer : transfers) { | ISPN-<I> fix caused unnecessary InterruptedExceptions
When state transfer is over, the response to the last StateResponseCommand
could reach the provider node after the CH_UPDATE from the coordinator.
If that happens, no data is lost, but the OutboundTransferTask thread is
interrupted and it logs the InterruptedException stack trace. | infinispan_infinispan | train | java |
ee8de1ef70517edc9622ed8ebec706e43569cef2 | diff --git a/lib/rbbt/rest/common/render.rb b/lib/rbbt/rest/common/render.rb
index <HASH>..<HASH> 100644
--- a/lib/rbbt/rest/common/render.rb
+++ b/lib/rbbt/rest/common/render.rb
@@ -147,6 +147,11 @@ module RbbtRESTHelpers
pid = @step.child{
begin
+ class << @step
+ def status=(message)
+ nil
+ end
+ end
Log.low("Fragment started: #{ fragment_file } - #{Process.pid}")
res = capture_haml fragment_code, &block
Log.low("Fragment writing: #{ fragment_file } - #{Process.pid}") | Don't allow fragments in forks to change step status, it might make it out of sync and be aborted | mikisvaz_rbbt-rest | train | rb |
c0dff3384c8e0d5d98c51d8a3c319d29236f4b9a | diff --git a/lib/ransack/constants.rb b/lib/ransack/constants.rb
index <HASH>..<HASH> 100644
--- a/lib/ransack/constants.rb
+++ b/lib/ransack/constants.rb
@@ -1,8 +1,5 @@
module Ransack
module Constants
- ASC_ARROW = '▲'.freeze
- DESC_ARROW = '▼'.freeze
-
OR = 'or'.freeze
AND = 'and'.freeze
diff --git a/lib/ransack/helpers/form_helper.rb b/lib/ransack/helpers/form_helper.rb
index <HASH>..<HASH> 100644
--- a/lib/ransack/helpers/form_helper.rb
+++ b/lib/ransack/helpers/form_helper.rb
@@ -198,8 +198,11 @@ module Ransack
end
def direction_arrow
- return Constants::DESC_ARROW if @current_dir == 'desc'.freeze
- Constants::ASC_ARROW
+ if @current_dir == 'desc'.freeze
+ '▼'.freeze
+ else
+ '▲'.freeze
+ end
end
def direction_text(dir) | Replace arrow constants with frozen strings
These constants are only used once in the code base and constant lookup
is slower than frozen strings in MRI Ruby <I>+. | activerecord-hackery_ransack | train | rb,rb |
fa1631c5a1c066489db8a595deb8a27a22d26231 | diff --git a/update.php b/update.php
index <HASH>..<HASH> 100644
--- a/update.php
+++ b/update.php
@@ -90,6 +90,9 @@
## Build is no longer used
unset($settings['symphony']['build']);
+
+ ## Remove the old Maintenance Mode setting
+ unset($settings['public']['maintenance_mode']);
## Set the default language
if(!isset($settings['symphony']['lang'])){ | Updater will remove the old public:maintenance_mode setting. [Closes Issue #<I>] | symphonycms_symphony-2 | train | php |
bd945dba76d12e05bfdb096db9984e3e8abe5b41 | diff --git a/spec/acceptance/excerpts_spec.rb b/spec/acceptance/excerpts_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/acceptance/excerpts_spec.rb
+++ b/spec/acceptance/excerpts_spec.rb
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require 'acceptance/spec_helper'
describe 'Accessing excerpts for methods on a search result', :live => true do
diff --git a/spec/acceptance/facets_spec.rb b/spec/acceptance/facets_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/acceptance/facets_spec.rb
+++ b/spec/acceptance/facets_spec.rb
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
require 'acceptance/spec_helper'
describe 'Faceted searching', :live => true do | Encoding comments for MRI <I> | pat_thinking-sphinx | train | rb,rb |
8adbbb04a42c995b1e0168505362ed1435bd4661 | diff --git a/class.phpmailer.php b/class.phpmailer.php
index <HASH>..<HASH> 100644
--- a/class.phpmailer.php
+++ b/class.phpmailer.php
@@ -2194,6 +2194,7 @@ class PHPMailer {
if (empty($this->AltBody)) {
$this->AltBody = 'To view this email message, open it in a program that understands HTML!' . "\n\n";
}
+ return $message;
}
/** | Return $message as API requires
Issue: #<I> | minmb_phpmailer | train | php |
d37a1601d0ce8d0bfec5322cfcd2d69cd597073a | diff --git a/lib/jasmine_rails/save_fixture.rb b/lib/jasmine_rails/save_fixture.rb
index <HASH>..<HASH> 100644
--- a/lib/jasmine_rails/save_fixture.rb
+++ b/lib/jasmine_rails/save_fixture.rb
@@ -1,5 +1,7 @@
require 'fileutils'
+# DEPRECATED - This feature will be removed as soon as it causes another issue
+#
# Adds a save_fixture method takes the rendered content
# and stores it in a fixture file to be used with jasmine.
# | Note that save_fixture is deprecated | searls_jasmine-rails | train | rb |
c10bf763ddeef3c92183ce3438799610de09af49 | diff --git a/lib/init.js b/lib/init.js
index <HASH>..<HASH> 100644
--- a/lib/init.js
+++ b/lib/init.js
@@ -81,14 +81,14 @@ module.exports = function (apiKey, chain) {
topic2_3_opr,
topic3) {
- const module = 'log';
+ const module = 'logs';
const action = 'getLogs';
var params = {
module, action, apiKey, address
};
- if (toBlock) {
- params.tolock = toBlock;
+ if (address) {
+ params.address = address;
}
if (fromBlock) {
@@ -96,7 +96,7 @@ module.exports = function (apiKey, chain) {
}
if (toBlock) {
- params.tolock = toBlock;
+ params.toBlock = toBlock;
}
if (topic0) { | getLogs fixed
typo in "tolock" - should be "toBlock"
no "address" field set
module should be = 'logs', not 'log' | sebs_etherscan-api | train | js |
4fa2d4eb0e98c74c59f5f49d6ffc3f3fd7e9f2eb | diff --git a/lib/ProofSet.js b/lib/ProofSet.js
index <HASH>..<HASH> 100644
--- a/lib/ProofSet.js
+++ b/lib/ProofSet.js
@@ -320,7 +320,10 @@ async function _matchProofSet({
continue;
}
- // next, find the suite that can verify the proof
+ // next, find the suite that can verify the proof; if found, `matched`
+ // will be set to `true` and the proof will be added to `purposeToProofs`
+ // and `proofToSuite` to be processed -- otherwise it will not be; if
+ // no proofs are added for a given purpose, an exception will be thrown
let matched = false;
for(const s of suites) {
// `matchingProofs` is a map of promises that resolve to whether a | Add comment about `matched` var. | digitalbazaar_jsonld-signatures | train | js |
72868fc598764bded89fb2385bb6f38f7d82715a | diff --git a/tests/test_decorators.py b/tests/test_decorators.py
index <HASH>..<HASH> 100644
--- a/tests/test_decorators.py
+++ b/tests/test_decorators.py
@@ -25,6 +25,26 @@ class TestOperation(object):
assert target.url_path is NoPath
assert target.methods == (Method.GET,)
+ def test_str(self):
+ @decorators.Operation(url_path="test/{id}/start")
+ def target(request):
+ """
+ Test target
+ """
+
+ assert "tests.test_decorators.target - GET test/{id:integer}/start" == str(target)
+
+ def test_repr(self):
+ @decorators.Operation(url_path="test/{id}/start")
+ def target(request):
+ """
+ Test target
+ """
+
+ assert "Operation('tests.test_decorators.target', " \
+ "UrlPath('test', PathParam(name='id', type=<Type.Integer: 'integer'>, type_args=None), 'start'), " \
+ "(<Method.GET: 'GET'>,))" == repr(target)
+
def test_unbound(self):
@decorators.Operation(tags=('eek', 'bar'))
def target(request): | Tests for Operation str and repr | python-odin_odinweb | train | py |
06b53653f577640ad3a82039746f7704d655991f | diff --git a/djsupervisor/templatetags/djsupervisor_tags.py b/djsupervisor/templatetags/djsupervisor_tags.py
index <HASH>..<HASH> 100644
--- a/djsupervisor/templatetags/djsupervisor_tags.py
+++ b/djsupervisor/templatetags/djsupervisor_tags.py
@@ -14,12 +14,11 @@ import shutil
from django import template
register = template.Library()
-import djsupervisor.config
-
current_context = None
@register.filter
def templated(template_path):
+ import djsupervisor.config
# Interpret paths relative to the project directory.
project_dir = current_context["PROJECT_DIR"]
full_path = os.path.join(project_dir, template_path) | Fixed cyclic import with Django <I> | rfk_django-supervisor | train | py |
9e6007a20d23c8a61d7c2202cf560036bef53050 | diff --git a/ast_/ast.py b/ast_/ast.py
index <HASH>..<HASH> 100644
--- a/ast_/ast.py
+++ b/ast_/ast.py
@@ -54,8 +54,12 @@ class NodeVisitor:
def generic_visit(node: Ast):
raise RuntimeError("No {}() method defined".format('visit_' + node.token))
- def filter_inorder(self, node, filter_func: Callable[[Any], bool]):
- """ Visit the tree inorder, but only those that return true for filter
+ def filter_inorder(self,
+ node,
+ filter_func: Callable[[Any], bool],
+ child_selector: Callable[[Ast], bool] = lambda x: True):
+ """ Visit the tree inorder, but only those that return true for filter_func and visiting children which
+ return true for child_selector.
"""
visited = set()
stack = [node]
@@ -66,5 +70,5 @@ class NodeVisitor:
visited.add(node)
if filter_func(node):
yield self.visit(node)
- elif isinstance(node, Ast):
+ if isinstance(node, Ast) and child_selector(node):
stack.extend(node.children[::-1]) | Add filter children selector to filter_inorder
Now children are also traversed on selected nodes.
Also children can be filtered out (to allow cut ! predicates) | boriel_zxbasic | train | py |
8494481972c9d1193236de8c14513f45469f25e2 | diff --git a/src/instrumentation/transaction.js b/src/instrumentation/transaction.js
index <HASH>..<HASH> 100644
--- a/src/instrumentation/transaction.js
+++ b/src/instrumentation/transaction.js
@@ -89,7 +89,9 @@ Transaction.prototype._adjustDurationToLongestTrace = function () {
Transaction.prototype.startTrace = function (signature, type) {
var trace = new Trace(this, signature, type, this._options)
- trace.setParent(this._rootTrace)
+ if (this._rootTrace) {
+ trace.setParent(this._rootTrace)
+ }
this._activeTraces[trace.getFingerprint()] = trace | Add check if rootTrace is present | opbeat_opbeat-react | train | js |
47b75e218495e4438269b69a98ef549de52b4b7d | diff --git a/lib/jasmine_rails/runner.rb b/lib/jasmine_rails/runner.rb
index <HASH>..<HASH> 100644
--- a/lib/jasmine_rails/runner.rb
+++ b/lib/jasmine_rails/runner.rb
@@ -13,7 +13,7 @@ module JasmineRails
File.open(runner_path, 'w') {|f| f << html.gsub('/assets', './assets')}
phantomjs_runner_path = File.join(File.dirname(__FILE__), '..', 'assets', 'javascripts', 'jasmine-runner.js')
- run_cmd %{phantomjs "#{phantomjs_runner_path}" "file://#{runner_path.to_s}?spec=#{spec_filter}"}
+ run_cmd %{phantomjs "#{phantomjs_runner_path}" "#{runner_path.to_s}?spec=#{spec_filter}"}
end
end | removed file:// from command run, windows does not recognise this prefix. | searls_jasmine-rails | train | rb |
Subsets and Splits