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 |
|---|---|---|---|---|---|
0c22d86254cc42603b12cec2a5d2d882b80fa1fd | diff --git a/src/Buffered/Utils/BufferCollection.php b/src/Buffered/Utils/BufferCollection.php
index <HASH>..<HASH> 100644
--- a/src/Buffered/Utils/BufferCollection.php
+++ b/src/Buffered/Utils/BufferCollection.php
@@ -5,7 +5,7 @@ namespace MatthiasMullie\Scrapbook\Buffered\Utils;
use MatthiasMullie\Scrapbook\Adapters\Collections\MemoryStore as MemoryStoreCollection;
/**
- * @todo
+ * A collection implementation for Buffer.
*
* @author Matthias Mullie <scrapbook@mullie.eu>
* @copyright Copyright (c) 2014, Matthias Mullie. All rights reserved | Get rid of a stray todo | matthiasmullie_scrapbook | train | php |
96fc129fea3ad50521ef19ed572bdccffcd0937e | diff --git a/dosagelib/plugins/g.py b/dosagelib/plugins/g.py
index <HASH>..<HASH> 100644
--- a/dosagelib/plugins/g.py
+++ b/dosagelib/plugins/g.py
@@ -64,6 +64,25 @@ class GeeksNextDoor(_BasicScraper):
help = 'Index format: yyyy-mm-dd'
+# disallowed by robots.txt
+class _GeneralProtectionFault(_BasicScraper):
+ description = u'General Protection Fault'
+ url = 'http://www.gpf-comics.com/'
+ rurl = escape(url)
+ stripUrl = url + 'archive/%s'
+ firstStripUrl = stripUrl % '1998/11/02'
+ imageSearch = compile(tagre("img", "src", r'(/comics/[^"]*)'))
+ prevSearch = compile(tagre("a", "href", r'(%s[^"]+)' % rurl) +
+ tagre("img", "alt", "Previous Comic"))
+ help = 'Index format: yyyy/mm/dd'
+
+ @classmethod
+ def namer(cls, imageUrl, pageUrl):
+ """Remove random stuff from filename."""
+ imageName = imageUrl.split('/')[-1]
+ return imageName[:11] + imageName[-4:]
+
+
class GirlsWithSlingshots(_BasicScraper):
url = 'http://www.girlswithslingshots.com/'
rurl = escape(url) | Add GeneralProtectionFault (disallowed by robots.txt) | wummel_dosage | train | py |
d4cd926c96c8ae1102ec493b403e9814b06eacfd | diff --git a/xds/src/main/java/io/grpc/xds/ClientXdsClient.java b/xds/src/main/java/io/grpc/xds/ClientXdsClient.java
index <HASH>..<HASH> 100644
--- a/xds/src/main/java/io/grpc/xds/ClientXdsClient.java
+++ b/xds/src/main/java/io/grpc/xds/ClientXdsClient.java
@@ -169,7 +169,7 @@ final class ClientXdsClient extends XdsClient implements XdsResponseHandler, Res
|| Boolean.parseBoolean(System.getenv("GRPC_EXPERIMENTAL_XDS_CUSTOM_LB_CONFIG"));
@VisibleForTesting
static boolean enableOutlierDetection =
- !Strings.isNullOrEmpty(System.getenv("GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION"))
+ Strings.isNullOrEmpty(System.getenv("GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION"))
|| Boolean.parseBoolean(System.getenv("GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION"));
private static final String TYPE_URL_HTTP_CONNECTION_MANAGER_V2 =
"type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2" | core: Enable outlier detection by default. (#<I>) | grpc_grpc-java | train | java |
bdc772b7be799aede01260cee3aba49ab4f9b204 | diff --git a/lib/agent/index.js b/lib/agent/index.js
index <HASH>..<HASH> 100644
--- a/lib/agent/index.js
+++ b/lib/agent/index.js
@@ -164,10 +164,16 @@ var load_plugin = function(name, cb) {
var run_from_command_line = function() {
if (!program.debug) logger.pause();
+
hooks.on('data', console.log);
hooks.on('error', console.log);
hooks.on('report', console.log);
- commands.perform(commands.parse(program.run)[1]);
+
+ var parsed = commands.parse(program.run);
+ if (!parsed)
+ return console.log('Invalid command.');
+
+ commands.perform(parsed[1]);
}
//////////////////////////////////////////////////////////////////// | Handle invalid command in agent/index. | prey_prey-node-client | train | js |
3fb0cd4db9b4d00ad498bf91f150a02aa86eaeaa | diff --git a/tests/Http/RequestTest.php b/tests/Http/RequestTest.php
index <HASH>..<HASH> 100644
--- a/tests/Http/RequestTest.php
+++ b/tests/Http/RequestTest.php
@@ -694,7 +694,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase
$body = new RequestBody();
$body->write('foo=bar');
$request = new Request($method, $uri, $headers, $cookies, $serverParams, $body);
- $this->assertEquals((object)['foo' => 'bar'], $request->getParsedBody());
+ $this->assertEquals(['foo' => 'bar'], $request->getParsedBody());
}
public function testGetParsedBodyJson()
@@ -709,7 +709,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase
$body->write('{"foo":"bar"}');
$request = new Request($method, $uri, $headers, $cookies, $serverParams, $body);
- $this->assertEquals((object)['foo' => 'bar'], $request->getParsedBody());
+ $this->assertEquals(['foo' => 'bar'], $request->getParsedBody());
}
public function testGetParsedBodyXml() | Update unit tests to expect arrays from getParsedBody() | slimphp_Slim | train | php |
6af225c27a4eaad2d8d3f55bac2671d56a3f31b6 | diff --git a/NavigationReactNative/src/android/app/src/main/java/com/navigation/reactnative/SceneActivity.java b/NavigationReactNative/src/android/app/src/main/java/com/navigation/reactnative/SceneActivity.java
index <HASH>..<HASH> 100644
--- a/NavigationReactNative/src/android/app/src/main/java/com/navigation/reactnative/SceneActivity.java
+++ b/NavigationReactNative/src/android/app/src/main/java/com/navigation/reactnative/SceneActivity.java
@@ -36,8 +36,8 @@ public class SceneActivity extends Activity implements DefaultHardwareBackBtnHan
super.onCreate(savedInstanceState);
int crumb = getIntent().getIntExtra(CRUMB, 0);
rootView = new SceneRootViewGroup(getReactNativeHost().getReactInstanceManager().getCurrentReactContext());
- crumb = Math.min(crumb, NavigationStackView.scenes.size() - 1);
- rootView.addView(NavigationStackView.scenes.get(crumb).view);
+ if (crumb < NavigationStackView.scenes.size())
+ rootView.addView(NavigationStackView.scenes.get(crumb).view);
setContentView(rootView);
@SuppressWarnings("unchecked")
HashSet<String> sharedElements = (HashSet<String>) getIntent().getSerializableExtra(SHARED_ELEMENTS); | Changed fluent navigation then back check
if navigate from A --> B --> C --> D --> E and fluently from C to E, then navigate back 3 to B then it will come in the create activity of D because it wasn't created. At that time it will have the crumb for D but there won't be a scene view for it. Still created the host view because onNewIntent is about to run and needs a container | grahammendick_navigation | train | java |
ee90f31722aad29cb4502f177df4d431b5833922 | diff --git a/pathquery/__init__.py b/pathquery/__init__.py
index <HASH>..<HASH> 100644
--- a/pathquery/__init__.py
+++ b/pathquery/__init__.py
@@ -56,16 +56,14 @@ class pathq(object):
return is_match
def __iter__(self):
- matches = []
for root, dirnames, filenames_in_dir in walk(self._head):
if self._is_match(root):
if root.startswith("./"):
root = root[2:]
- matches.append(Path(root))
+ yield Path(root)
for filename_in_dir in filenames_in_dir:
full_filename = join(root, filename_in_dir)
if self._is_match(full_filename):
if full_filename.startswith("./"):
full_filename = full_filename[2:]
- matches.append(Path(full_filename))
- return iter(matches)
+ yield Path(full_filename) | REFACTOR : Turned iterator over a list into a generator to increase performance. | crdoconnor_pathquery | train | py |
7763d79a4e8154e1bfa6bfc1dc25ddb36c8e93ec | diff --git a/lib/spaceship/client.rb b/lib/spaceship/client.rb
index <HASH>..<HASH> 100644
--- a/lib/spaceship/client.rb
+++ b/lib/spaceship/client.rb
@@ -200,7 +200,7 @@ module Spaceship
end
# Set a new team ID which will be used from now on
- def current_team_id=(team_id)
+ def team_id=(team_id)
@current_team_id = team_id
end
diff --git a/spec/client_spec.rb b/spec/client_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/client_spec.rb
+++ b/spec/client_spec.rb
@@ -62,6 +62,12 @@ describe Spaceship::Client do
it 'returns the default team_id' do
expect(subject.team_id).to eq('XXXXXXXXXX')
end
+
+ it "set custom Team ID" do
+ team_id = "ABCDEF"
+ subject.team_id = team_id
+ expect(subject.team_id).to eq(team_id)
+ end
end
describe "test timeout catching" do
diff --git a/spec/spaceship_spec.rb b/spec/spaceship_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/spaceship_spec.rb
+++ b/spec/spaceship_spec.rb
@@ -18,6 +18,7 @@ describe Spaceship do
expect(subject.device).to eq(Spaceship::Device)
expect(subject.provisioning_profile).to eq(Spaceship::ProvisioningProfile)
end
+
it 'passes the client to the models' do
expect(subject.device.client).to eq(subject.client)
end | Renamed current_team_id= to team_id= in client | fastlane_fastlane | train | rb,rb,rb |
87bb11ac0b3cf51efa3b76054df4d4638c41b846 | diff --git a/examples/standalone_proxy/plugIt/views.py b/examples/standalone_proxy/plugIt/views.py
index <HASH>..<HASH> 100644
--- a/examples/standalone_proxy/plugIt/views.py
+++ b/examples/standalone_proxy/plugIt/views.py
@@ -887,6 +887,8 @@ def api_user(request, userPk, key=None, hproPk=None):
if not check_api_key(request, key, hproPk):
raise Http404
+ hproject = None
+
if settings.PIAPI_STANDALONE:
if not settings.PIAPI_REALUSERS:
user = generate_user(pk=userPk) | Added hrpoject to None | ebu_PlugIt | train | py |
7bcd869dbf9aa108fda8c01a3544666288c02578 | diff --git a/src/ClassTrait.php b/src/ClassTrait.php
index <HASH>..<HASH> 100644
--- a/src/ClassTrait.php
+++ b/src/ClassTrait.php
@@ -33,20 +33,6 @@ trait ClassTrait
}
/**
- * @return Monomelodies\Reflex\ReflectionProperty[]
- */
- public function getDefaultProperties() : array
- {
- $properties = parent::getDefaultProperties();
- if ($properties) {
- array_walk($properties, function (&$property) {
- $property = new ReflectionProperty($this->getName(), $property->getName());
- });
- }
- return $properties;
- }
-
- /**
* @param int|null $filter
* @return Monomelodies\Reflex\ReflectionProperty[]
*/ | that works weird and did not need an override | monomelodies_reflex | train | php |
68ab0b9a5e81fcf7417637b3b5662a4b46851cb5 | diff --git a/src/metpy/calc/thermo.py b/src/metpy/calc/thermo.py
index <HASH>..<HASH> 100644
--- a/src/metpy/calc/thermo.py
+++ b/src/metpy/calc/thermo.py
@@ -3278,12 +3278,12 @@ def specific_humidity_from_dewpoint(pressure, dewpoint):
Parameters
----------
- dewpoint: `pint.Quantity`
- Dewpoint temperature
-
pressure: `pint.Quantity`
Pressure
+ dewpoint: `pint.Quantity`
+ Dewpoint temperature
+
Returns
-------
`pint.Quantity` | DOC: switch order of Parameters in specific_humidity_from_dewpoint | Unidata_MetPy | train | py |
eb630652df13985f365e9c59baa9db78d959ec2b | diff --git a/pythran/transformations/handle_import.py b/pythran/transformations/handle_import.py
index <HASH>..<HASH> 100644
--- a/pythran/transformations/handle_import.py
+++ b/pythran/transformations/handle_import.py
@@ -363,8 +363,9 @@ class HandleImport(Transformation):
# Patch module body: prepend all imported function and import nodes
imported = self.registry.generate_ImportList()
- external_modules_name = [f for f in self.module.imported_modules
- if not is_builtin_module_name(f)]
+ imported_modules = self.module.imported_modules.items()
+ external_modules_name = [alias for alias, name in imported_modules
+ if not is_builtin_module_name(name)]
if not imported and external_modules_name:
# We can't raise an exception as it may just be an unused import.
# FIXME : To improve this, we have to handle aliasing so that we | Fix import warning.
* It was looking for builtin modules based on alias name which is incorrect. | serge-sans-paille_pythran | train | py |
6d801a6e8ff22bc5e6429ffd7128ff99b7164941 | diff --git a/modules/lazyLoadableImages/scope.js b/modules/lazyLoadableImages/scope.js
index <HASH>..<HASH> 100644
--- a/modules/lazyLoadableImages/scope.js
+++ b/modules/lazyLoadableImages/scope.js
@@ -4,7 +4,7 @@
"setting up which images can be lazy-loaded analysis"
);
- window.addEventListener("beforeunload", () => {
+ window.addEventListener("load", () => {
phantomas.spyEnabled(false, "analyzing which images can be lazy-loaded");
var images = document.body.getElementsByTagName("img"), | lazyLoadableImages/scope.js: bind to window.load event | macbre_phantomas | train | js |
530780359892e0cd5ea714d3abce884ab7871ca9 | diff --git a/ui/app/routes/jobs/job/task-group.js b/ui/app/routes/jobs/job/task-group.js
index <HASH>..<HASH> 100644
--- a/ui/app/routes/jobs/job/task-group.js
+++ b/ui/app/routes/jobs/job/task-group.js
@@ -1,4 +1,6 @@
import Route from '@ember/routing/route';
+import { collect } from '@ember/object/computed';
+import { watchRecord, watchRelationship } from 'nomad-ui/utils/properties/watch';
export default Route.extend({
model({ name }) {
@@ -15,4 +17,27 @@ export default Route.extend({
});
});
},
+
+ setupController(controller, model) {
+ const job = model.get('job');
+ controller.set('watchers', {
+ job: this.get('watchJob').perform(job),
+ summary: this.get('watchSummary').perform(job),
+ allocations: this.get('watchAllocations').perform(job),
+ });
+ return this._super(...arguments);
+ },
+
+ deactivate() {
+ this.get('allWatchers').forEach(watcher => {
+ watcher.cancelAll();
+ });
+ return this._super(...arguments);
+ },
+
+ watchJob: watchRecord('job'),
+ watchSummary: watchRelationship('summary'),
+ watchAllocations: watchRelationship('allocations'),
+
+ allWatchers: collect('watchJob', 'watchSummary', 'watchAllocations'),
}); | Watch job, job-summary, and job-allocs on the task group page | hashicorp_nomad | train | js |
7d03ba92d027ce79a406adeb5b3f13010dfc595d | diff --git a/simulation_test.go b/simulation_test.go
index <HASH>..<HASH> 100644
--- a/simulation_test.go
+++ b/simulation_test.go
@@ -10,7 +10,7 @@ import (
"github.com/boltdb/bolt"
)
-func TestSimulate_1op_1p(t *testing.T) { testSimulate(t, 100, 1) }
+func TestSimulate_1op_1p(t *testing.T) { testSimulate(t, 1, 1) }
func TestSimulate_10op_1p(t *testing.T) { testSimulate(t, 10, 1) }
func TestSimulate_100op_1p(t *testing.T) { testSimulate(t, 100, 1) }
func TestSimulate_1000op_1p(t *testing.T) { testSimulate(t, 1000, 1) } | FIX: Incorrect threadCount in simulation_test.go
TestSimulate_1op_1p should pass 1 as the threadCount instead of <I> | boltdb_bolt | train | go |
735515fccdec53652bc3a4c8d459c392f1041f94 | diff --git a/tang/src/main/java/com/microsoft/tang/implementation/ConfigurationImpl.java b/tang/src/main/java/com/microsoft/tang/implementation/ConfigurationImpl.java
index <HASH>..<HASH> 100644
--- a/tang/src/main/java/com/microsoft/tang/implementation/ConfigurationImpl.java
+++ b/tang/src/main/java/com/microsoft/tang/implementation/ConfigurationImpl.java
@@ -103,9 +103,9 @@ public class ConfigurationImpl implements Configuration {
}
Map<String, String> ret = new HashMap<String, String>();
- for (Class<?> opt : namespace.getRegisteredClasses()) {
- ret.put(opt.getName(), REGISTERED);
- }
+// for (Class<?> opt : namespace.getRegisteredClasses()) {
+// ret.put(opt.getName(), REGISTERED);
+// }
for (Node opt : boundImpls.keySet()) {
ret.put(opt.getFullName(), boundImpls.get(opt).getName());
} | comment out line that emits regitered lines in config file | apache_reef | train | java |
e89348a4700ba1930f80e757e36afb3e9dbd59ba | diff --git a/core/src/main/java/io/micronaut/core/io/socket/SocketUtils.java b/core/src/main/java/io/micronaut/core/io/socket/SocketUtils.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/io/micronaut/core/io/socket/SocketUtils.java
+++ b/core/src/main/java/io/micronaut/core/io/socket/SocketUtils.java
@@ -17,6 +17,7 @@ package io.micronaut.core.io.socket;
import io.micronaut.core.util.ArgumentUtils;
+import java.net.ConnectException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
@@ -89,8 +90,10 @@ public class SocketUtils {
try (Socket socket = new Socket()) {
socket.connect(new InetSocketAddress(InetAddress.getLocalHost(), currentPort), 20);
return false;
- } catch (Throwable e) {
+ } catch (ConnectException e) {
return true;
+ } catch (Throwable e) {
+ return false;
}
} | SocketUtils considers a port available if a ConnectException is thrown during connect attempt (#<I>) (#<I>) | micronaut-projects_micronaut-core | train | java |
efb7b0676cf6e57b5446f15e297a187ddc989004 | diff --git a/packages/cli/lib/commands/create.js b/packages/cli/lib/commands/create.js
index <HASH>..<HASH> 100644
--- a/packages/cli/lib/commands/create.js
+++ b/packages/cli/lib/commands/create.js
@@ -12,8 +12,13 @@ module.exports = async (name, starter = 'default') => {
const starters = ['default', 'wordpress']
const hasYarn = await useYarn()
- if (fs.existsSync(dir)) {
- return console.log(chalk.red(`Directory «${projectName}» already exists.`))
+ try {
+ const files = fs.readdirSync(dir)
+ if (files.length > 1) {
+ return console.log(chalk.red(`Directory «${projectName}» is not empty.`))
+ }
+ } catch (err) {
+ throw new Error(err.message)
}
if (starters.includes(starter)) { | fix(cli): create project in current directory (#<I>) | gridsome_gridsome | train | js |
fab6e9df63de6705ecfcdf595ec88a75a0003c9e | diff --git a/common_mnoe_dependencies.rb b/common_mnoe_dependencies.rb
index <HASH>..<HASH> 100644
--- a/common_mnoe_dependencies.rb
+++ b/common_mnoe_dependencies.rb
@@ -3,7 +3,8 @@
# the one component of Mnoe.
source 'https://rubygems.org'
-gem 'sqlite3'
+# sqlite3_adapter requires 1.3.x
+gem 'sqlite3', '~> 1.3.13'
group :test do
gem 'rspec-rails' | Add dependency constraint on sqlite3
sqlite3 <I> is conflicting with sqlite3_adapter which requires <I>.x
See <URL> | maestrano_mno-enterprise | train | rb |
7e71b73e4a925e5085222240847b2ed774b2da62 | diff --git a/lib/vagrant/util/ssh.rb b/lib/vagrant/util/ssh.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant/util/ssh.rb
+++ b/lib/vagrant/util/ssh.rb
@@ -101,10 +101,13 @@ module Vagrant
"-o", "ForwardX11Trusted=yes"]
end
- # Configurables -- extra_args should always be last due to the way the ssh args parser works;
- # e.g. if the user wants to use the -t option, any shell command(s) she'd like to run on the
- # remote server would have to be the last part of the 'ssh' command:
- # $: ssh localhost -t -p 2222 "cd mydirectory; bash"
+ # Configurables -- extra_args should always be last due to the way the
+ # ssh args parser works. e.g. if the user wants to use the -t option,
+ # any shell command(s) she'd like to run on the remote server would
+ # have to be the last part of the 'ssh' command:
+ #
+ # $ ssh localhost -t -p 2222 "cd mydirectory; bash"
+ #
# Without having extra_args be last, the user loses this ability
command_options += ["-o", "ForwardAgent=yes"] if ssh_info[:forward_agent]
command_options.concat(opts[:extra_args]) if opts[:extra_args] | Reformat some comments to be within <I> chars | hashicorp_vagrant | train | rb |
6f1b9d7e94496543eacc63807b99fa29059ed300 | diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
index <HASH>..<HASH> 100644
--- a/lib/sup/crypto.rb
+++ b/lib/sup/crypto.rb
@@ -313,7 +313,7 @@ private
if signature.validity != GPGME::GPGME_VALIDITY_FULL && signature.validity != GPGME::GPGME_VALIDITY_MARGINAL
output_lines << "WARNING: This key is not certified with a trusted signature!"
output_lines << "There is no indication that the signature belongs to the owner"
- output_lines << "Full fingerprint is: " + (0..9).map {|i| signature.fpr[(i*2),2]}.join(":")
+ output_lines << "Full fingerprint is: " + (0..9).map {|i| signature.fpr[(i*4),4]}.join(":")
else
trusted = true
end | show the FULL key fingerprint, not just the first half | sup-heliotrope_sup | train | rb |
19347a69753a8905a2c8f3991251d622fcc7e0b4 | diff --git a/lib/3scale/core/version.rb b/lib/3scale/core/version.rb
index <HASH>..<HASH> 100644
--- a/lib/3scale/core/version.rb
+++ b/lib/3scale/core/version.rb
@@ -1,5 +1,5 @@
module ThreeScale
module Core
- VERSION = '1.2.2'
+ VERSION = '1.2.3'
end
end | core: bugfix release <I> | 3scale_pisoni | train | rb |
ee04997eb26adf3f71dcc12d3210fe5f39c68fe4 | diff --git a/py/test/rsession/executor.py b/py/test/rsession/executor.py
index <HASH>..<HASH> 100644
--- a/py/test/rsession/executor.py
+++ b/py/test/rsession/executor.py
@@ -29,6 +29,8 @@ class RunExecutor(object):
outcome = Outcome()
except Skipped, e:
outcome = Outcome(skipped=str(e))
+ except (SystemExit, KeyboardInterrupt):
+ raise
except:
excinfo = py.code.ExceptionInfo()
if isinstance(self.item, py.test.Function): | [svn r<I>] No, this is needed for C-c to work.
--HG--
branch : trunk | vmalloc_dessert | train | py |
152f5ac76f17e284de91b5591b8bd64be1c794d2 | diff --git a/__init__.py b/__init__.py
index <HASH>..<HASH> 100644
--- a/__init__.py
+++ b/__init__.py
@@ -39,7 +39,7 @@ if not settings.LDAP:
settings.LDAP[DEFAULT_LDAP_ALIAS]["TLS_CA"] = settings.LDAP_TLS_CA
if DEFAULT_LDAP_ALIAS not in settings.LDAP:
- raise ImproperlyConfigured("You must define a '%s' ldap database" % DEFAULT_LDAP_ALIAS)
+ raise RuntimeError("You must define a '%s' ldap database" % DEFAULT_LDAP_ALIAS)
connections = ConnectionHandler(settings.LDAP)
connection = connections[DEFAULT_LDAP_ALIAS] | ImproperlyConfigured not defined here, use RuntimeError instead. | Karaage-Cluster_python-tldap | train | py |
3c8bb29834f049aa82b90ca2151608f6fc16a9f2 | diff --git a/lib/cache/FileCachePlugin.js b/lib/cache/FileCachePlugin.js
index <HASH>..<HASH> 100644
--- a/lib/cache/FileCachePlugin.js
+++ b/lib/cache/FileCachePlugin.js
@@ -173,7 +173,7 @@ class FileCachePlugin {
(identifier, etag, data) => {
const entry = {
identifier,
- data: store === "pack" ? data : () => data,
+ data: etag ? () => data : data,
etag,
version
}; | use lazy serialization when etag is passed | webpack_webpack | train | js |
86e1f079eefca5386bb83d756a7f7ffe464b2ab3 | diff --git a/services/injection.js b/services/injection.js
index <HASH>..<HASH> 100644
--- a/services/injection.js
+++ b/services/injection.js
@@ -215,6 +215,17 @@ exports.initializeScopedThen = function (Q) {
} || fn;
}));
};
+ var superNodeify = Q.makePromise.prototype.nodeify;
+ Q.makePromise.prototype.nodeify = function () {
+ var storedScope = exports.storeScope();
+
+ return superNodeify.apply(this, _.map(arguments, function (fn) {
+ return _.isFunction(fn) && function () {
+ var resolveArgs = arguments;
+ return exports.restoreScope(storedScope, function () { return fn.apply(null, resolveArgs) });
+ } || fn;
+ }));
+ };
Q.makePromise.prototype.scopedThenInitialized = true;
}; | Q.nodeify doesn't propagate injection scope
Fixes #<I> | allcount_allcountjs | train | js |
ff657e73f0b61a7e224a9f158467ed2ec915bd9b | diff --git a/activemodel/lib/active_model/secure_password.rb b/activemodel/lib/active_model/secure_password.rb
index <HASH>..<HASH> 100644
--- a/activemodel/lib/active_model/secure_password.rb
+++ b/activemodel/lib/active_model/secure_password.rb
@@ -4,8 +4,8 @@ module ActiveModel
module SecurePassword
extend ActiveSupport::Concern
- # BCrypt hash function can handle maximum 72 characters, and if we pass
- # password of length more than 72 characters it ignores extra characters.
+ # BCrypt hash function can handle maximum 72 bytes, and if we pass
+ # password of length more than 72 bytes it ignores extra characters.
# Hence need to put a restriction on password length.
MAX_PASSWORD_LENGTH_ALLOWED = 72
@@ -20,7 +20,7 @@ module ActiveModel
#
# The following validations are added automatically:
# * Password must be present on creation
- # * Password length should be less than or equal to 72 characters
+ # * Password length should be less than or equal to 72 bytes
# * Confirmation of password (using a +password_confirmation+ attribute)
#
# If password confirmation validation is not needed, simply leave out the | Talk about bytes not characters
[ci skip]
Closes #<I> | rails_rails | train | rb |
b13222b8214f4690c169eefc13354ff5f6479c2e | diff --git a/proton-c/bindings/ruby/lib/qpid_proton/messenger.rb b/proton-c/bindings/ruby/lib/qpid_proton/messenger.rb
index <HASH>..<HASH> 100644
--- a/proton-c/bindings/ruby/lib/qpid_proton/messenger.rb
+++ b/proton-c/bindings/ruby/lib/qpid_proton/messenger.rb
@@ -208,10 +208,10 @@ module Qpid
Cproton.pn_messenger_stop(@impl)
end
- # Returns true iff a Messenger is in the stopped state.
+ # Returns true if a Messenger is in the stopped state.
# This function does not block.
#
- def stopped
+ def stopped?
Cproton.pn_messenger_stopped(@impl)
end
@@ -389,7 +389,8 @@ module Qpid
Cproton.pn_messenger_recv(@impl, limit)
end
- def receiving
+ # Returns true if the messenger is currently receiving data.
+ def receiving?
Cproton.pn_messenger_receiving(@impl)
end | NO-JIRA: Fix a few Ruby method names to fit naming conventions.
Messenger::receiving and Messenger::stopped renamed to
Messenger::receiving? and Messenger::stopped?
Also fixed a typo in one rdoc and added rdoc to receiving? | apache_qpid-proton | train | rb |
e0d117ce80c91c6aa22eda69545a79270325ca92 | diff --git a/internal/merger/merger.go b/internal/merger/merger.go
index <HASH>..<HASH> 100644
--- a/internal/merger/merger.go
+++ b/internal/merger/merger.go
@@ -99,7 +99,6 @@ func init() {
"go_proto_library",
},
attrs: []string{
- "compilers",
"proto",
},
}, { | internal/merger: make "compilers" attribute unmergeable (#<I>)
Gazelle won't modify or delete this attribute if it's set
in existing rules.
Fixes #<I> | bazelbuild_bazel-gazelle | train | go |
b4defd5e3f05b70f1b746aa6ba1605c7bfe63fab | diff --git a/client/fileuploader.js b/client/fileuploader.js
index <HASH>..<HASH> 100755
--- a/client/fileuploader.js
+++ b/client/fileuploader.js
@@ -920,6 +920,8 @@ qq.extend(qq.FileUploader.prototype, {
qq.preventDefault(e);
var item = target.parentNode;
+ while(item.qqFileId == undefined) { item = target = target.parentNode; }
+
self._handler.cancel(item.qqFileId);
qq.remove(item);
} | Fix for nested cancel button/link
Cancel handler not work if `fileTemplate` root node is different of cancel `parentNode`, maybe it's not good idea use a `while` but if file template root node always have a `qqFileId` [line <I>](#L<I>) property why not? | FineUploader_fine-uploader | train | js |
8646f54faf62cb63f165f7699b8ace5b4a08233c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@ import sys
import os
from setuptools import setup
-__version__ = '0.8.1'
+__version__ = '0.8.2'
__description__ = 'A Python package for building Alexa skills.'
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
diff --git a/skillful/controller.py b/skillful/controller.py
index <HASH>..<HASH> 100644
--- a/skillful/controller.py
+++ b/skillful/controller.py
@@ -112,8 +112,7 @@ class Skill(object):
response.
Args:
- body: dict. HTTP request body. If str is passed, attempts conversion
- to dict.
+ body: str. HTTP request body.
url: str. SignatureCertChainUrl header value sent by request.
PEM-encoded X.509 certificate chain that Alexa used to sign the
message.
diff --git a/skillful/interface.py b/skillful/interface.py
index <HASH>..<HASH> 100644
--- a/skillful/interface.py
+++ b/skillful/interface.py
@@ -113,8 +113,7 @@ class RequestBody(Body):
"""Parse JSON request, storing content in object attributes.
Args:
- body: dict. HTTP request body. If str is passed, parse will attempt
- conversion to dict.
+ body: str. HTTP request body.
Returns:
self | Updated doc to indicate body is str type. | bmweiner_skillful | train | py,py,py |
863a91b84fd6ac52ccb057afff8d07bb6e6bbf0d | diff --git a/test/test_torconfig.py b/test/test_torconfig.py
index <HASH>..<HASH> 100644
--- a/test/test_torconfig.py
+++ b/test/test_torconfig.py
@@ -469,14 +469,16 @@ class CreateTorrcTests(unittest.TestCase):
config.Log = ['80 127.0.0.1:80', '90 127.0.0.1:90']
config.save()
torrc = config.create_torrc()
- self.assertEqual(torrc, '''HiddenServiceDir /some/dir
+ lines = torrc.split('\n')
+ lines.sort()
+ torrc = '\n'.join(lines).strip()
+ self.assertEqual(torrc, '''HiddenServiceAuthorizeClient auth
+HiddenServiceDir /some/dir
HiddenServicePort 80 127.0.0.1:1234
HiddenServiceVersion 2
-HiddenServiceAuthorizeClient auth
Log 80 127.0.0.1:80
Log 90 127.0.0.1:90
-SocksPort 1234
-''')
+SocksPort 1234''')
class HiddenServiceTests(unittest.TestCase): | re-organize test so it's always alphabetical | meejah_txtorcon | train | py |
c61eebd64e579b196678e79dfbc3285de61d3923 | diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
@@ -711,12 +711,13 @@ module ActiveRecord
end
def rename_column_sql(table_name, column_name, new_column_name)
- options = { name: new_column_name }
column = column_for(table_name, column_name)
-
- options[:default] = column.default
- options[:null] = column.null
- options[:auto_increment] = column.extra == "auto_increment"
+ options = {
+ name: new_column_name,
+ default: column.default,
+ null: column.null,
+ auto_increment: column.extra == "auto_increment"
+ }
current_type = select_one("SHOW COLUMNS FROM #{quote_table_name(table_name)} LIKE '#{column_name}'", 'SCHEMA')["Type"]
schema_creation.accept ChangeColumnDefinition.new column, current_type, options | Simplify building options hash in rename column method for mysql | rails_rails | train | rb |
158a0309008db08fc865ddeb91c8aeb54fe15a57 | diff --git a/MicroTokenizer/training/train.py b/MicroTokenizer/training/train.py
index <HASH>..<HASH> 100644
--- a/MicroTokenizer/training/train.py
+++ b/MicroTokenizer/training/train.py
@@ -59,7 +59,7 @@ def train(input_files_list, output_dir, **kwargs):
corpus = []
for input_file in input_files_list:
- with open(input_file) as fd:
+ with open(input_file, encoding="utf-8") as fd:
for raw_line in fd:
line = raw_line.strip() | fix file read encoding issue on Windows | howl-anderson_MicroTokenizer | train | py |
3ddbcc2b05e76689ad16d44f8a2c594818dc6de7 | diff --git a/Tests/IntegrationTest.php b/Tests/IntegrationTest.php
index <HASH>..<HASH> 100644
--- a/Tests/IntegrationTest.php
+++ b/Tests/IntegrationTest.php
@@ -25,9 +25,9 @@ class IntegrationTest extends ProviderIntegrationTest
protected $testIpv6 = false;
protected $skippedTests = [
- 'testGeocodeQuery' => 'Geopunt provider supports Brussels (Belgium) only.',
- 'testReverseQuery' => 'Geopunt provider supports Brussels (Belgium) only.',
- 'testReverseQueryWithNoResults' => 'Geopunt provider supports Brussels (Belgium) only.',
+ 'testGeocodeQuery' => 'Geopunt provider supports Brussels and Flanders (Belgium) only.',
+ 'testReverseQuery' => 'Geopunt provider supports Brussels and Flanders (Belgium) only.',
+ 'testReverseQueryWithNoResults' => 'Geopunt provider supports Brussels and Flanders (Belgium) only.',
];
protected function createProvider(HttpClient $httpClient) | Update Tests/IntegrationTest.php | geo6_geocoder-php-geopunt-provider | train | php |
a78076382e7980681f4c69f9e1ae1421789c9b25 | diff --git a/code/macroeco/form_func.py b/code/macroeco/form_func.py
index <HASH>..<HASH> 100644
--- a/code/macroeco/form_func.py
+++ b/code/macroeco/form_func.py
@@ -102,7 +102,7 @@ def make_spec_dict(spp_array):
unq_specs = np.unique(spp_array)
unq_ints = np.linspace(0, len(unq_specs) - 1, num=len(unq_specs))
spec_dict = np.empty(len(unq_ints), dtype=[('spp_code', np.int), \
- ('spp', 'S10')])
+ ('spp', 'S29')])
spec_dict['spp'] = unq_specs
spec_dict['spp_code'] = unq_ints
return spec_dict | Checked in KORU dataset
This data set still needs metadata. | jkitzes_macroeco | train | py |
8af5187edd8113c45875d13a0c45f022d6dc6f31 | diff --git a/js/app.js b/js/app.js
index <HASH>..<HASH> 100644
--- a/js/app.js
+++ b/js/app.js
@@ -735,7 +735,9 @@ App.prototype.registerAssessment = function( name, assessment, pluginName ) {
* Disables markers visually in the UI.
*/
App.prototype.disableMarkers = function() {
- this.seoAssessorPresenter.disableMarker();
+ if ( !isUndefined( this.seoAssessorPresenter ) ) {
+ this.seoAssessorPresenter.disableMarker();
+ }
if ( !isUndefined( this.contentAssessorPresenter ) ) {
this.contentAssessorPresenter.disableMarker(); | Added a missing if around the seoAssessorPresenter | Yoast_YoastSEO.js | train | js |
8483d7df35d6a8821d3fe1ff2f4148e31f7c78e2 | diff --git a/test/terrific-modules/terrific.js b/test/terrific-modules/terrific.js
index <HASH>..<HASH> 100644
--- a/test/terrific-modules/terrific.js
+++ b/test/terrific-modules/terrific.js
@@ -80,7 +80,6 @@ describe('terrific::renderModule', function() {
});
it('should render a basic module, with a nested module', function() {
var actual = terrific.renderModule({}, { name: 'basic', template: 'nested' });
- console.log(actual)
var expected = grunt.file.read('test/terrific-modules/expected/basic/basic-nested.html');
assert.equal(actual, expected);
}); | Whoops. Remove console.log from a test. | MarcDiethelm_xtc | train | js |
1e4a712fe6f8b74b51bd247b18e415fbe752fe71 | diff --git a/src/Http/Firewall/SessionExpirationListener.php b/src/Http/Firewall/SessionExpirationListener.php
index <HASH>..<HASH> 100644
--- a/src/Http/Firewall/SessionExpirationListener.php
+++ b/src/Http/Firewall/SessionExpirationListener.php
@@ -14,7 +14,7 @@ namespace Ajgl\Security\Http\Firewall;
use Ajgl\Security\Core\Exception\SessionExpiredException;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
-use Symfony\Component\HttpKernel\Log\LoggerInterface;
+use Psr\Log\LoggerInterface;
use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\Security\Http\Firewall\ListenerInterface;
use Symfony\Component\Security\Http\HttpUtils; | Use the PSR LoggerInterface instead of the deprecated one | ajgarlag_AjglSessionExpiration | train | php |
1233835c5432b41f9bce084b8d5b52867309ecff | diff --git a/org.ektorp.android/src/main/java/org/ektorp/android/http/AndroidHttpResponse.java b/org.ektorp.android/src/main/java/org/ektorp/android/http/AndroidHttpResponse.java
index <HASH>..<HASH> 100644
--- a/org.ektorp.android/src/main/java/org/ektorp/android/http/AndroidHttpResponse.java
+++ b/org.ektorp.android/src/main/java/org/ektorp/android/http/AndroidHttpResponse.java
@@ -57,8 +57,8 @@ public class AndroidHttpResponse implements HttpResponse {
}
@Override
- public int getContentLength() {
- return (int) entity.getContentLength();
+ public long getContentLength() {
+ return entity.getContentLength();
}
@Override | fix compilation issue for Android introduced by <I>da<I>af5df7fb<I>baddae<I>d<I>c<I>cf0f | helun_Ektorp | train | java |
9c6b22b596ab36995b4e3fa61f394dceb8893655 | diff --git a/aeron-client/src/main/java/io/aeron/ClientConductor.java b/aeron-client/src/main/java/io/aeron/ClientConductor.java
index <HASH>..<HASH> 100644
--- a/aeron-client/src/main/java/io/aeron/ClientConductor.java
+++ b/aeron-client/src/main/java/io/aeron/ClientConductor.java
@@ -775,7 +775,7 @@ class ClientConductor implements Agent, DriverEventsListener
}
while (nanoClock.nanoTime() < deadlineNs);
- throw new DriverTimeoutException("No response from MediaDriver within (ns):" + driverTimeoutNs);
+ throw new DriverTimeoutException("No response from MediaDriver within (ns): " + driverTimeoutNs);
}
private int onCheckTimeouts() | [Java] Error formatting. | real-logic_aeron | train | java |
16082546a05ad3d2edcd0583dfc6a0d79dba3d79 | diff --git a/fastlane/lib/fastlane/documentation/docs_generator.rb b/fastlane/lib/fastlane/documentation/docs_generator.rb
index <HASH>..<HASH> 100644
--- a/fastlane/lib/fastlane/documentation/docs_generator.rb
+++ b/fastlane/lib/fastlane/documentation/docs_generator.rb
@@ -18,9 +18,9 @@ module Fastlane
output << ""
output << "<table width=\"100%\" >"
output << "<tr>"
- output << "<th width=\"33%\"><a href=\"http://brew.sh\">Homebrew</a></td>"
- output << "<th width=\"33%\">Installer Script</td>"
- output << "<th width=\"33%\">RubyGems</td>"
+ output << "<th width=\"33%\"><a href=\"http://brew.sh\">Homebrew</a></th>"
+ output << "<th width=\"33%\">Installer Script</th>"
+ output << "<th width=\"33%\">RubyGems</th>"
output << "</tr>"
output << "<tr>"
output << "<td width=\"33%\" align=\"center\">macOS</td>" | Fix mismatched <th> tags in docs_generator (#<I>) | fastlane_fastlane | train | rb |
5fc3502376566945dd77f6d425f82df307ca2a1f | diff --git a/reana_commons/utils.py b/reana_commons/utils.py
index <HASH>..<HASH> 100644
--- a/reana_commons/utils.py
+++ b/reana_commons/utils.py
@@ -19,7 +19,7 @@
# In applying this license, CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization or
# submit itself to any jurisdiction.
-"""REANA commons utils."""
+"""REANA-Commons utils."""
import hashlib
import json
@@ -52,14 +52,14 @@ def click_table_printer(headers, _filter, data):
click.echo(formatted_output.format(*row))
-def get_user_analyses_dir(org, user):
- """Build the analyses directory path for certain user and organization.
+def get_user_workflows_dir(org, user):
+ """Build the workflow directory path for certain user and organization.
:param org: Organization which user is part of.
:param user: Working directory owner.
- :return: Path to the user's analyses directory.
+ :return: Path to the user's workflow directories.
"""
- return fs.path.join(org, user, 'analyses')
+ return fs.path.join(org, user, 'workflows')
def calculate_hash_of_dir(directory, file_list=None): | utils: analyses renaming to workflows | reanahub_reana-commons | train | py |
675257f6f0e6e5a63e4507510d265ac7a4ae8d66 | diff --git a/py/__init__.py b/py/__init__.py
index <HASH>..<HASH> 100644
--- a/py/__init__.py
+++ b/py/__init__.py
@@ -36,7 +36,6 @@ py_ignore_service_list = {
"Cache",
"CardinalityEstimator",
"Client.addPartitionLostListener",
- "Client.authenticationCustom",
"Client.createProxies",
"Client.removeMigrationListener",
"Client.removePartitionLostListener", | Enables custom authentication for the Python client (#<I>) | hazelcast_hazelcast-client-protocol | train | py |
093c399ab956ab6b03d3025bb74033f66fa0d4f5 | diff --git a/classes/phing/tasks/system/ImportTask.php b/classes/phing/tasks/system/ImportTask.php
index <HASH>..<HASH> 100644
--- a/classes/phing/tasks/system/ImportTask.php
+++ b/classes/phing/tasks/system/ImportTask.php
@@ -106,6 +106,7 @@ class ImportTask extends Task {
$msg = "Unable to find build file: {$file->getPath()}";
if ($this->optional) {
$this->log($msg . '... skipped');
+ return;
} else {
throw new BuildException($msg);
} | Refs #<I> - import task doesn't skip file if optional is set to true | phingofficial_phing | train | php |
9bfb7b74c5f4ee909dbde899e6d8e06845cab230 | diff --git a/src/Controller/Component/AuthComponent.php b/src/Controller/Component/AuthComponent.php
index <HASH>..<HASH> 100644
--- a/src/Controller/Component/AuthComponent.php
+++ b/src/Controller/Component/AuthComponent.php
@@ -656,8 +656,8 @@ class AuthComponent extends Component
/**
* Get the current user from storage.
*
- * @param string $key Field to retrieve. Leave null to get entire User record.
- * @return mixed Either User record or null if no user is logged in, or retrieved field if key is specified.
+ * @param string|null $key Field to retrieve. Leave null to get entire User record.
+ * @return mixed|null Either User record or null if no user is logged in, or retrieved field if key is specified.
* @link http://book.cakephp.org/3.0/en/controllers/components/authentication.html#accessing-the-logged-in-user
*/
public function user($key = null) | Update phpdoc in AuthComponent | cakephp_cakephp | train | php |
ef5023d6474e95760cf0d52f85651972a19e4a76 | diff --git a/spyder/plugins/editor/widgets/editor.py b/spyder/plugins/editor/widgets/editor.py
index <HASH>..<HASH> 100644
--- a/spyder/plugins/editor/widgets/editor.py
+++ b/spyder/plugins/editor/widgets/editor.py
@@ -866,7 +866,7 @@ class EditorStack(QWidget):
def get_plugin_title(self):
"""Get the plugin title of the parent widget."""
# Needed for the editor stack to use its own fileswitcher instance.
- # See issue # 9469
+ # See spyder-ide/spyder#9469
return self.parent().plugin.get_plugin_title()
def get_current_tab_manager(self): | Editor: Change comment to use URL awareness | spyder-ide_spyder | train | py |
c1fee0b3e0ce6746d1850f7f913bde9daf546ee9 | 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
@@ -1944,8 +1944,6 @@ class MultipleTypesChecker(BaseChecker):
var_type = var_type.pytype()
types.add(var_type)
if len(types) > 1:
- print ('more than one possible type for node %s (%s, %s)'
- % (node.as_string(), types.pop(), types.pop()))
return
except InferenceError:
return | Drop print
related to issue #<I> | PyCQA_pylint | train | py |
899f44cea5b1ae110c5c742b76f8ace13bc632a0 | diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/GwtExtension.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/GwtExtension.java
index <HASH>..<HASH> 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/web/GwtExtension.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/web/GwtExtension.java
@@ -23,7 +23,9 @@ import org.sonar.api.ServerExtension;
/**
* @since 1.10
+ * @deprecated in 3.7. Replaced by Ruby on Rails extensions
*/
+@Deprecated
public interface GwtExtension extends ServerExtension {
String getGwtId();
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/GwtPage.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/GwtPage.java
index <HASH>..<HASH> 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/web/GwtPage.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/web/GwtPage.java
@@ -21,7 +21,9 @@ package org.sonar.api.web;
/**
* @since 1.11
+ * @deprecated in 3.7. Replaced by Ruby on Rails pages.
*/
+@Deprecated
public abstract class GwtPage implements Page, GwtExtension {
public final String getId() { | Deprecated Gwt API | SonarSource_sonarqube | train | java,java |
d806110f67f18a1a39eb3b423408a5fe60db7de0 | diff --git a/DBAL/Types/AbstractEnumType.php b/DBAL/Types/AbstractEnumType.php
index <HASH>..<HASH> 100644
--- a/DBAL/Types/AbstractEnumType.php
+++ b/DBAL/Types/AbstractEnumType.php
@@ -93,7 +93,7 @@ abstract class AbstractEnumType extends Type
*/
public function getName()
{
- return $this->name ?: (new \ReflectionClass(get_class($this)))->getShortName();
+ return $this->name ?: array_search(get_class($this), self::getTypesMap(), true);
}
/** | Fix mapping of types when using a key other than the short class name | fre5h_DoctrineEnumBundle | train | php |
bd4f0c38cef80d0868125494c0e853edf9456b63 | diff --git a/pywindow/utilities.py b/pywindow/utilities.py
index <HASH>..<HASH> 100644
--- a/pywindow/utilities.py
+++ b/pywindow/utilities.py
@@ -1329,8 +1329,8 @@ def find_avarage_diameter(elements, coordinates, adjust=1, increment=0.1,
average_2 = 0
for i, j in zip(weighted_avarage, normalised):
if i:
- average_1 += np.mean(i) * j[1]
- average_2 += j[1]
+ average_1 += np.mean(i) * len(i)
+ average_2 += len(i)
average = average_1 / average_2
return average * 2 | Fixed a bug in the weighted avarage diameter feature. No longer it weights for the overall density, just the count of vectors. Seems to work better | marcinmiklitz_pywindow | train | py |
5fa3091dd2cfe07bd0bf9df0cb73c112b6369950 | diff --git a/shared/util/feature-flags.native.js b/shared/util/feature-flags.native.js
index <HASH>..<HASH> 100644
--- a/shared/util/feature-flags.native.js
+++ b/shared/util/feature-flags.native.js
@@ -7,7 +7,7 @@ const ff: FeatureFlags = {
plansEnabled: false,
recentFilesEnabled: false,
tabPeopleEnabled: false,
- teamChatEnabled: false,
+ teamChatEnabled: true,
}
if (__DEV__) { | teams features for mobile (#<I>) | keybase_client | train | js |
92899637e1408b7054136842bd7c7e4dd007ac8f | diff --git a/lib/epuber/server.rb b/lib/epuber/server.rb
index <HASH>..<HASH> 100644
--- a/lib/epuber/server.rb
+++ b/lib/epuber/server.rb
@@ -241,8 +241,8 @@ module Epuber
src = node[attribute_name]
unless src.nil?
- abs_path = File.expand_path(src, File.join(build_path, File.dirname(context_path)))
- relative_path = abs_path.sub(File.expand_path(build_path), '')
+ abs_path = File.expand_path(src, File.join(build_path, File.dirname(context_path))).unicode_normalize
+ relative_path = abs_path.sub(File.expand_path(build_path).unicode_normalize, '')
node[attribute_name] = File.join('', 'raw', relative_path.to_s)
end | [Server] add support for unicode paths | epuber-io_epuber | train | rb |
5c8ca669e2940cb6b358e6863ac1617b004759bd | diff --git a/test/bulletproof.py b/test/bulletproof.py
index <HASH>..<HASH> 100644
--- a/test/bulletproof.py
+++ b/test/bulletproof.py
@@ -48,7 +48,7 @@ class TestJpypeModule(unittest.TestCase):
expect=c[1]
if expect==None:
method(*args)
- print("PASS: %s => None "%n)
+ #print("PASS: %s => None "%n)
else:
self.assertRaises(expect, method, *args) | removed dbg statement [ci skip] | jpype-project_jpype | train | py |
4de4c9356e882c50e3d3d0373ae74431d49419fe | diff --git a/airflow/www/static/js/graph.js b/airflow/www/static/js/graph.js
index <HASH>..<HASH> 100644
--- a/airflow/www/static/js/graph.js
+++ b/airflow/www/static/js/graph.js
@@ -102,7 +102,12 @@ const updateNodeLabels = (node, instances) => {
haveLabelsChanged = true;
}
- if (node.children) return node.children.some((n) => updateNodeLabels(n, instances));
+ if (node.children) {
+ // Iterate through children and return true if at least one has been changed
+ const updatedNodes = node.children.map((n) => updateNodeLabels(n, instances));
+ return updatedNodes.some((changed) => changed);
+ }
+
return haveLabelsChanged;
}; | Make sure all mapped nodes are updated. (#<I>) | apache_airflow | train | js |
d6e823ce2685316b812e0544606c129c4119e13e | diff --git a/XBRL-US-TaxonomyPackage.php b/XBRL-US-TaxonomyPackage.php
index <HASH>..<HASH> 100644
--- a/XBRL-US-TaxonomyPackage.php
+++ b/XBRL-US-TaxonomyPackage.php
@@ -65,6 +65,31 @@ EOT;
const namespacePrefix = "http://fasb.org/us-gaap/";
/**
+ * Provides a URL for the entity publishing the taxonomy. This element SHOULD be used to provide
+ * the primary website of the publishing entity. The URL used SHOULD be the same as that used in
+ * other Taxonomy Packages published by the same entity.
+ * @var string
+ */
+ public $publisherURL;
+
+ /**
+ * Provides a date on which the taxonomy was published.
+ * @var string
+ */
+ public $publicationDate = "";
+
+ /**
+ * Default constructor
+ * @param ZipArchive $zipArchive
+ */
+ public function __construct( ZipArchive $zipArchive )
+ {
+ parent::__construct( $zipArchive );
+
+ $this->publisherURL = XBRL_US_TaxonomyPackage::filePrefix;
+ }
+
+ /**
* Returns true if the zip file represents an SEC package
* {@inheritDoc}
* @see XBRL_IPackage::isPackage()
@@ -84,6 +109,8 @@ EOT;
return false;
}
+ $this->publicationDate = $matches['date'];
+
$found = false;
$this->traverseContents( function( $path, $name, $type ) use( &$found )
{ | Updated to add publishURL and publicationDate | bseddon_XBRL | train | php |
76ccede398de3e65edb1a5a8cfe8bd971f5d552c | diff --git a/src/scriptworker/constants.py b/src/scriptworker/constants.py
index <HASH>..<HASH> 100644
--- a/src/scriptworker/constants.py
+++ b/src/scriptworker/constants.py
@@ -372,7 +372,7 @@ DEFAULT_CONFIG: immutabledict[str, Any] = immutabledict(
"project:comm:thunderbird:releng:balrog:server:esr": "esr",
"project:comm:thunderbird:releng:beetmover:bucket:nightly": "all-nightly-branches",
"project:comm:thunderbird:releng:beetmover:bucket:release": "all-release-branches",
- "project:comm:thunderbird:releng:bouncer:server:production": "all-release-branches",
+ "project:comm:thunderbird:releng:bouncer:server:production": "all-nightly-branches",
"project:comm:thunderbird:releng:signing:cert:nightly-signing": "all-nightly-branches",
"project:comm:thunderbird:releng:signing:cert:release-signing": "all-release-branches",
} | Bug <I> - Allow comm-central to use production bouncer scope. (#<I>)
The scope is used by the "bouncer-locations" on comm-central to
keep the Thunderbird Daily bouncer products pointing to the
latest version. | mozilla-releng_scriptworker | train | py |
16eb823066407a4115bb129ac3fce1872c16dc6b | diff --git a/tests/rules/test_sudo.py b/tests/rules/test_sudo.py
index <HASH>..<HASH> 100644
--- a/tests/rules/test_sudo.py
+++ b/tests/rules/test_sudo.py
@@ -10,6 +10,8 @@ from thefuck.types import Command
'requested operation requires superuser privilege',
'need to be root',
'need root',
+ 'shutdown: NOT super-user',
+ 'Error: This command has to be run with superuser privileges (under the root user on most systems).',
'must be root',
'You don\'t have access to the history DB.',
"error: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/ipaddr.py'"])
diff --git a/thefuck/rules/sudo.py b/thefuck/rules/sudo.py
index <HASH>..<HASH> 100644
--- a/thefuck/rules/sudo.py
+++ b/thefuck/rules/sudo.py
@@ -4,6 +4,8 @@ patterns = ['permission denied',
'you cannot perform this operation unless you are root',
'non-root users cannot',
'operation not permitted',
+ 'not super-user',
+ 'superuser privilege',
'root privilege',
'this command has to be run under the root user.',
'this operation requires root.', | #<I>: Add two more patterns to sudo rule (#<I>)
* macos shutdown sudo fix
* Update tests/rules/test_sudo.py
* Update thefuck/rules/sudo.py
* Update tests/rules/test_sudo.py
* Update thefuck/rules/sudo.py | nvbn_thefuck | train | py,py |
1b8b30940f5357cecd607a74171bf16556832a68 | diff --git a/serenata_toolbox/datasets/__init__.py b/serenata_toolbox/datasets/__init__.py
index <HASH>..<HASH> 100644
--- a/serenata_toolbox/datasets/__init__.py
+++ b/serenata_toolbox/datasets/__init__.py
@@ -79,8 +79,8 @@ def fetch_latest_backup(destination_path):
datasets = Datasets(destination_path)
files = tuple(
- f for f in datasets.downloader.LATEST
- if not os.path.exists(os.path.join(destination_path, f))
+ dataset_file for dataset_file in datasets.downloader.LATEST
+ if not os.path.exists(os.path.join(destination_path, dataset_file))
)
if not files: | Avoids variable with one letter on __init__ for datasets | okfn-brasil_serenata-toolbox | train | py |
f793daa73d527990eab01bd5248878856285da67 | diff --git a/modules.js b/modules.js
index <HASH>..<HASH> 100644
--- a/modules.js
+++ b/modules.js
@@ -69,8 +69,11 @@ const make = () => {
assert(_.is.Object(module), "second argument must an object or inferred, got: " + typeof module);
if (module.binding && !module.Bridge) {
+ console.log("DEBUG: will _use_binding", module);
+
return _use_binding(module.binding);
}
+ console.log("DEBUG: standard module:", _.is.String(module_name) ? module_name : null);
module.module_name = module_name;
@@ -102,7 +105,8 @@ const make = () => {
new_binding.bridge = new_module.Bridge;
new_binding.__sideload = true;
- new_module.bindings = old_module.bindings.concat(new_binding);
+ new_module.bindings = Object.assign([], old_module.bindings);
+ new_module.bindings.splice(0, 0, new_binding);
_moduled[module_name] = new_module
} | sideload to front of array, not back | dpjanes_node-iotdb | train | js |
b486f3d70a9d8e2f3d75960ae77f05e0a2d20b2b | diff --git a/Kwc/Newsletter/Detail/RecipientsAction.js b/Kwc/Newsletter/Detail/RecipientsAction.js
index <HASH>..<HASH> 100644
--- a/Kwc/Newsletter/Detail/RecipientsAction.js
+++ b/Kwc/Newsletter/Detail/RecipientsAction.js
@@ -33,7 +33,12 @@ Kwc.Newsletter.Detail.RecipientsAction = Ext.extend(Ext.Action, {
msgText += ':<div class="recipientsStatusRtr">'+r.rtrExcluded.join('<br />')+'</div>';
}
Ext.MessageBox.alert(trlKwf('Status'), msgText, function() {
- this.findParentByType('kwc.newsletter.recipients').fireEvent('queueChanged');
+ this.findParentBy(function (container) {
+ if (container instanceof Kwc.Newsletter.Detail.RecipientsPanel) {
+ return true;
+ }
+ return false;
+ }, this).fireEvent('queueChanged');
}, this);
},
progress: true, | Find parent with instanceof instead of xtype-compare
This enables to override parent (kwc.newsletter.recipients) in web.
Was needed for TIS to add a custom action to filter recipients. | koala-framework_koala-framework | train | js |
4d5d5240697398e3739f80d1f82c55c07f27fcea | diff --git a/decidim-assemblies/spec/commands/update_assembly_member_spec.rb b/decidim-assemblies/spec/commands/update_assembly_member_spec.rb
index <HASH>..<HASH> 100644
--- a/decidim-assemblies/spec/commands/update_assembly_member_spec.rb
+++ b/decidim-assemblies/spec/commands/update_assembly_member_spec.rb
@@ -30,7 +30,7 @@ module Decidim::Assemblies
ceased_date: nil,
designation_date: Time.current,
position: Decidim::AssemblyMember::POSITIONS.sample,
- position_other: "",
+ position_other: Faker::Lorem.word,
existing_user: existing_user,
non_user_avatar: non_user_avatar,
user_id: user&.id | Fix flaky test in UpdateAssemblyMember (#<I>) | decidim_decidim | train | rb |
16090817bdae195b778933b149e86b5c4176d3b5 | diff --git a/src/HelpScout/ApiClient.php b/src/HelpScout/ApiClient.php
index <HASH>..<HASH> 100644
--- a/src/HelpScout/ApiClient.php
+++ b/src/HelpScout/ApiClient.php
@@ -718,6 +718,7 @@ final class ApiClient {
*/
private function checkStatus($statusCode, $type, $expected = 200, $responseBody = array()) {
$expected = (array) $expected;
+ $responseBody = $responseBody ?: array();
if (!in_array($statusCode, $expected)) {
$exception = new ApiException( | Fix issue where a null response body in `checkStatus` would trigger a type violation on `getErrorMessage` | helpscout_helpscout-api-php | train | php |
fb75926c9e68bd70ed557effc1b54d4af5682384 | diff --git a/test/component/bin.spec.js b/test/component/bin.spec.js
index <HASH>..<HASH> 100644
--- a/test/component/bin.spec.js
+++ b/test/component/bin.spec.js
@@ -32,7 +32,6 @@ describe('bin', () => {
beforeEach(() => {
sandbox = sinon.sandbox.create();
- sandbox.stub(path, 'resolve').returnsArg(1);
sandbox.stub(path, 'relative').returnsArg(1);
on = sandbox.stub();
spawn = sandbox.stub(child_process, 'spawn').returns({ | Do not stub path.resolve (#<I>) | qlik-oss_after-work.js | train | js |
b45df4ea2eee49e4ab7f13f345fa5bb532b49bc4 | diff --git a/aiogram/dispatcher/handler.py b/aiogram/dispatcher/handler.py
index <HASH>..<HASH> 100644
--- a/aiogram/dispatcher/handler.py
+++ b/aiogram/dispatcher/handler.py
@@ -72,7 +72,7 @@ class Handler:
context.set_value('handler', handler)
await self.dispatcher.middleware.trigger(f"process_{self.middleware_key}", args)
response = await handler(*args)
- if results is not None:
+ if response is not None:
results.append(response)
if self.once:
break | Fix response None check in handlers | aiogram_aiogram | train | py |
351121186753da5a7ad17c1407b91ff4766df378 | diff --git a/test/src/main/java/org/vertexium/test/GraphTestBase.java b/test/src/main/java/org/vertexium/test/GraphTestBase.java
index <HASH>..<HASH> 100644
--- a/test/src/main/java/org/vertexium/test/GraphTestBase.java
+++ b/test/src/main/java/org/vertexium/test/GraphTestBase.java
@@ -2544,7 +2544,7 @@ public abstract class GraphTestBase {
Assert.assertEquals(1, count(v.getProperties()));
assertEquals("value1", v.getPropertyValue("prop1"));
- m.save(AUTHORIZATIONS_A_AND_B);
+ v = m.save(AUTHORIZATIONS_A_AND_B);
Assert.assertEquals(2, count(v.getProperties()));
assertEquals("value2", v.getPropertyValue("prop1"));
assertEquals("value2", v.getPropertyValue("prop2")); | try fixing test that only fails on Jenkins | visallo_vertexium | train | java |
628f09375a84d062f7ace368cb968533d141ab47 | diff --git a/gflags/flag.py b/gflags/flag.py
index <HASH>..<HASH> 100644
--- a/gflags/flag.py
+++ b/gflags/flag.py
@@ -29,12 +29,13 @@
"""Contains Flag class - information about single command-line flag."""
-
+from functools import total_ordering
from gflags import _helpers
from gflags import argument_parser
from gflags import exceptions
+@total_ordering
class Flag(object):
"""Information about a command-line flag. | Class Flag defines __eq__ and __lt__ but does not define other relations. Since there are no implied relationships among the comparison operators, to automatically generate ordering operations
from a single root operation functools.total_ordering() used.
<URL> | google_python-gflags | train | py |
e0b69af5de3941101dd2bd950d212b6a419f450d | diff --git a/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java b/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
index <HASH>..<HASH> 100644
--- a/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
+++ b/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
@@ -4075,4 +4075,16 @@ public class AmazonS3Client extends AmazonWebServiceClient implements AmazonS3 {
return bucketRegion;
}
+
+ @Override
+ public boolean doesObjectExistInBucket(String bucketName, String objectName) throws AmazonServiceException, AmazonClientException {
+ try {
+ getObjectMetadata(bucketName, objectName);
+ } catch (AmazonS3Exception e) {
+ if (e.getStatusCode() == 404) return false;
+ throw e;
+ }
+
+ return true;
+ }
} | Implementation of `doesObjectExistInBucket` | aws_aws-sdk-java | train | java |
81cc214f66fd8587bd03d9b96a35b6c69144d691 | diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php
index <HASH>..<HASH> 100644
--- a/code/controllers/CMSMain.php
+++ b/code/controllers/CMSMain.php
@@ -159,7 +159,6 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
function SearchForm() {
// get all page types in a dropdown-compatible format
$pageTypes = SiteTree::page_type_classes();
- array_unshift($pageTypes, _t('CMSMain.PAGETYPEANYOPT','Any'));
$pageTypes = array_combine($pageTypes, $pageTypes);
asort($pageTypes); | BUGFIX SSF-<I> remove one of the duplicated 'Any' options which also cause that search on the second 'Any' broke. | silverstripe_silverstripe-siteconfig | train | php |
fe7829c50c32842fc8faca87283ae3af5172afca | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@ with open(path.join(this_folder,'README.md'),encoding='utf-8') as inf:
setup(
name='pythologist',
- version='1.1.1',
+ version='1.2.1',
test_suite='nose2.collector.collector',
description='inForm PerkinElmer Reader - Python interface to read outputs of the PerkinElmer inForm software',
long_description=long_description, | tick version for modification to permutation command | jason-weirather_pythologist | train | py |
c9ae1bf421635e79bf6e5f964372010c65117012 | diff --git a/flate/crc32_amd64.go b/flate/crc32_amd64.go
index <HASH>..<HASH> 100644
--- a/flate/crc32_amd64.go
+++ b/flate/crc32_amd64.go
@@ -1,5 +1,6 @@
//+build !noasm
//+build !appengine
+//+build !gccgo
// Copyright 2015, Klaus Post, see LICENSE for details.
diff --git a/flate/crc32_amd64.s b/flate/crc32_amd64.s
index <HASH>..<HASH> 100644
--- a/flate/crc32_amd64.s
+++ b/flate/crc32_amd64.s
@@ -1,5 +1,6 @@
//+build !noasm
//+build !appengine
+//+build !gccgo
// Copyright 2015, Klaus Post, see LICENSE for details.
diff --git a/flate/crc32_noasm.go b/flate/crc32_noasm.go
index <HASH>..<HASH> 100644
--- a/flate/crc32_noasm.go
+++ b/flate/crc32_noasm.go
@@ -1,4 +1,4 @@
-//+build !amd64 noasm appengine
+//+build !amd64 noasm appengine gccgo
// Copyright 2015, Klaus Post, see LICENSE for details. | Don't use flate asm code when building for gccgo.
Updates golang/go#<I> | klauspost_compress | train | go,s,go |
a8eae202c35560d06ee981429562e4832c771e88 | diff --git a/config/config.php b/config/config.php
index <HASH>..<HASH> 100644
--- a/config/config.php
+++ b/config/config.php
@@ -69,6 +69,11 @@ return [
'tinymce' => '//tinymce.cachefly.net/4.2/tinymce.min.js',
]
],
+
+ // Checkable
+ 'checkable' => [
+ 'span' => true
+ ],
// TinyMCE configuration
'tinymce' => [
diff --git a/src/Controls/Checkable.php b/src/Controls/Checkable.php
index <HASH>..<HASH> 100644
--- a/src/Controls/Checkable.php
+++ b/src/Controls/Checkable.php
@@ -110,6 +110,8 @@ class Checkable extends Field
'checked' => $this->binder()->checked($this->key($this->name), $this->value, $this->checked)
]));
}
+
+ $content .= config('fluentform.checkable.span') ? $this->html()->tag('span') : '';
if (!empty($this->getLabel()))
{ | Added configurable span element for checkables. | inkvizytor_FluentForm | train | php,php |
115ed66ede67b422b1c19270be1b725a21461a65 | diff --git a/test/unit/Reflection/Exception/InvalidConstantNodeTest.php b/test/unit/Reflection/Exception/InvalidConstantNodeTest.php
index <HASH>..<HASH> 100644
--- a/test/unit/Reflection/Exception/InvalidConstantNodeTest.php
+++ b/test/unit/Reflection/Exception/InvalidConstantNodeTest.php
@@ -15,9 +15,9 @@ class InvalidConstantNodeTest extends TestCase
{
public function testCreate(): void
{
- $exception = InvalidConstantNode::create(new Node\Name('Whatever'));
+ $exception = InvalidConstantNode::create(new Node\UnionType([new Node\Name('Whatever\Something\Anything'), new Node\Name('\Very\Long\Name\That\Will\Be\Truncated')]));
self::assertInstanceOf(InvalidConstantNode::class, $exception);
- self::assertSame('Invalid constant node (first 50 characters: Whatever)', $exception->getMessage());
+ self::assertSame('Invalid constant node (first 50 characters: Whatever\Something\Anything|\Very\Long\Name\That\W)', $exception->getMessage());
}
} | Improved test for InvalidConstantNode | Roave_BetterReflection | train | php |
4593c616ef601099d1e6052bbb739cab1656b49f | diff --git a/tabula/wrapper.py b/tabula/wrapper.py
index <HASH>..<HASH> 100644
--- a/tabula/wrapper.py
+++ b/tabula/wrapper.py
@@ -76,7 +76,7 @@ def read_pdf(input_path,
java_options = []
elif isinstance(java_options, str):
- java_options = [java_options]
+ java_options = shlex.split(java_options)
options = build_options(kwargs)
@@ -148,7 +148,7 @@ def convert_into(input_path, output_path, output_format='csv', java_options=None
java_options = []
elif isinstance(java_options, str):
- java_options = [java_options]
+ java_options = shlex.split(java_options)
options = build_options(kwargs)
path, is_url = localize_file(input_path)
@@ -197,7 +197,7 @@ def convert_into_by_batch(input_dir, output_format='csv', java_options=None, **k
java_options = []
elif isinstance(java_options, str):
- java_options = [java_options]
+ java_options = shlex.split(java_options)
# Option for batch
kwargs['batch'] = input_dir | Use shlex.split() instad of just building a list for java_options | chezou_tabula-py | train | py |
5a7365ef588e2b8f68378a7762e57124261d6cfe | diff --git a/multiqc/modules/seqyclean/seqyclean.py b/multiqc/modules/seqyclean/seqyclean.py
index <HASH>..<HASH> 100644
--- a/multiqc/modules/seqyclean/seqyclean.py
+++ b/multiqc/modules/seqyclean/seqyclean.py
@@ -11,7 +11,6 @@ from multiqc.modules.base_module import BaseMultiqcModule
# Initialise the logger
log = logging.getLogger(__name__)
-import traceback
class MultiqcModule(BaseMultiqcModule):
def __init__(self): | Update multiqc/modules/seqyclean/seqyclean.py | ewels_MultiQC | train | py |
2cf9060db40e746eb49665b3eac83c72fd81d461 | diff --git a/apigpio/utils.py b/apigpio/utils.py
index <HASH>..<HASH> 100644
--- a/apigpio/utils.py
+++ b/apigpio/utils.py
@@ -20,6 +20,7 @@ def Debounce(threshold=100):
call if your callback is called twice with that interval.
"""
threshold *= 1000
+ max_tick = 0xFFFFFFFF
class _decorated(object):
@@ -33,9 +34,18 @@ def Debounce(threshold=100):
tick = args[3]
else:
tick = args[2]
- if tick - self.last > threshold:
+ if self.last > tick:
+ delay = max_tick-self.last + tick
+ else:
+ delay = tick - self.last
+ if delay > threshold:
self._fn(*args, **kwargs)
+ print('call passed by debouncer {} {} {}'
+ .format(tick, self.last, threshold))
self.last = tick
+ else:
+ print('call filtered out by debouncer {} {} {}'
+ .format(tick, self.last, threshold))
def __get__(self, instance, type=None):
# with is called when an instance of `_decorated` is used as a class | Fix callback erroneously filtered out
The tick from pigpio wraps aroud after xFFFFFFFF,
approximately 1h<I>. When it wraps the delay was not computed
correctly, causing all following calls to be filtered out. | PierreRust_apigpio | train | py |
5c34c2ff7f0c44ec9e1d77059162584c6bd99c92 | diff --git a/tests/io/open_append.py b/tests/io/open_append.py
index <HASH>..<HASH> 100644
--- a/tests/io/open_append.py
+++ b/tests/io/open_append.py
@@ -3,13 +3,13 @@ try:
except ImportError:
import os
-if not hasattr(os, "unlink"):
+if not hasattr(os, "remove"):
print("SKIP")
raise SystemExit
# cleanup in case testfile exists
try:
- os.unlink("testfile")
+ os.remove("testfile")
except OSError:
pass
@@ -32,6 +32,6 @@ f.close()
# cleanup
try:
- os.unlink("testfile")
+ os.remove("testfile")
except OSError:
pass
diff --git a/tests/io/open_plus.py b/tests/io/open_plus.py
index <HASH>..<HASH> 100644
--- a/tests/io/open_plus.py
+++ b/tests/io/open_plus.py
@@ -3,13 +3,13 @@ try:
except ImportError:
import os
-if not hasattr(os, "unlink"):
+if not hasattr(os, "remove"):
print("SKIP")
raise SystemExit
# cleanup in case testfile exists
try:
- os.unlink("testfile")
+ os.remove("testfile")
except OSError:
pass
@@ -42,6 +42,6 @@ f.close()
# cleanup
try:
- os.unlink("testfile")
+ os.remove("testfile")
except OSError:
pass | tests/io: Update tests to use uos.remove() instead of uos.unlink().
After Unix port switches from one to another, to be consistent with
baremetal ports. | micropython_micropython | train | py,py |
ecde3e00de3782024f0dfbab7f2d7912ab62342b | diff --git a/src/birding/__init__.py b/src/birding/__init__.py
index <HASH>..<HASH> 100644
--- a/src/birding/__init__.py
+++ b/src/birding/__init__.py
@@ -3,15 +3,11 @@ from __future__ import absolute_import, print_function
import logging
from . import bolt, config, follow, search, spout, twitter_api
-from .search import SearchManager
-from .twitter_api import Twitter
from .version import VERSION, __version__
from .version import __doc__ as __license__
__all__ = [
- 'SearchManager',
- 'Twitter',
'VERSION',
'__license__',
'__version__', | Remove unnecessary objects from root namespace. | Parsely_birding | train | py |
c8c900c97775671dd601d8b8a22e0a79b8703734 | diff --git a/dev/com.ibm.websphere.security/src/com/ibm/websphere/security/audit/AuditEvent.java b/dev/com.ibm.websphere.security/src/com/ibm/websphere/security/audit/AuditEvent.java
index <HASH>..<HASH> 100644
--- a/dev/com.ibm.websphere.security/src/com/ibm/websphere/security/audit/AuditEvent.java
+++ b/dev/com.ibm.websphere.security/src/com/ibm/websphere/security/audit/AuditEvent.java
@@ -236,7 +236,7 @@ public class AuditEvent {
*/
public String getCurrentTime() {
TimeZone tz = TimeZone.getTimeZone("UTC");
- DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'"); // Quoted "Z" to indicate UTC, no timezone offset
+ DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); // Quoted "Z" to indicate UTC, no timezone offset
df.setTimeZone(tz);
String nowAsISO = df.format(new Date()); | Issue<I>-AuditForCloudSequenceConsistency | OpenLiberty_open-liberty | train | java |
e15b3bb689b62e0ce6eb5943d9e60458e4a6ff56 | diff --git a/tests/integration_test.py b/tests/integration_test.py
index <HASH>..<HASH> 100644
--- a/tests/integration_test.py
+++ b/tests/integration_test.py
@@ -28,6 +28,8 @@ import six
# FIXME: missing tests for
# export; history; import_image; insert; port; push; tag; get; load
+DEFAULT_BASE_URL = os.environ.get('DOCKER_HOST')
+
class BaseTestCase(unittest.TestCase):
tmp_imgs = []
@@ -35,7 +37,7 @@ class BaseTestCase(unittest.TestCase):
tmp_folders = []
def setUp(self):
- self.client = docker.Client(timeout=5)
+ self.client = docker.Client(base_url=DEFAULT_BASE_URL, timeout=5)
self.tmp_imgs = []
self.tmp_containers = []
self.tmp_folders = []
@@ -910,6 +912,6 @@ class TestConnectionTimeout(unittest.TestCase):
if __name__ == '__main__':
- c = docker.Client()
+ c = docker.Client(base_url=DEFAULT_BASE_URL)
c.pull('busybox')
unittest.main() | allow docker client to connect to a remote host
to run the tests on a host without using the default unix socket, it's
now possible to specify:
DOCKER_HOST=tcp://localdocker:<I> env/bin/python setup.py test | docker_docker-py | train | py |
016e00bf7a914c2db3d53128291a953bf3ea0fa8 | diff --git a/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollEventLoop.java b/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollEventLoop.java
index <HASH>..<HASH> 100644
--- a/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollEventLoop.java
+++ b/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollEventLoop.java
@@ -350,6 +350,8 @@ final class EpollEventLoop extends SingleThreadEventLoop {
} catch (IOException ignore) {
// ignore on close
}
+ // Using the intermediate collection to prevent ConcurrentModificationException.
+ // In the `close()` method, the channel is deleted from `channels` map.
Collection<AbstractEpollChannel> array = new ArrayList<AbstractEpollChannel>(channels.size());
for (AbstractEpollChannel channel: channels.values()) { | Clarify the appointment of the intermediate collection
Motivation:
An intermediate list is creating in the `EpollEventLoop#closeAll` to prevent ConcurrentModificationException. But this is not the obvious purpose has no comment.
Modifications:
Add comment to clarify the appointment of the intermediate collection.
Result:
More clear code. | netty_netty | train | java |
2c143fa749d24a4966b1c20691b9b20f42f7cae2 | diff --git a/gspread/models.py b/gspread/models.py
index <HASH>..<HASH> 100644
--- a/gspread/models.py
+++ b/gspread/models.py
@@ -1468,6 +1468,29 @@ class Worksheet(object):
}
return self.spreadsheet.values_append(self.title, params, body)
+
+ def append_rows(self, values, value_input_option='RAW'):
+ """Adds rows to the worksheet and populates it with values.
+ Widens the worksheet if there are more values than columns.
+
+ :param values: Values for new rows. Values must be a list of lists.
+ :param value_input_option: (optional) Determines how input data should
+ be interpreted. See `ValueInputOption`_ in
+ the Sheets API.
+ :type value_input_option: str
+
+ .. _ValueInputOption: https://developers.google.com/sheets/api/reference/rest/v4/ValueInputOption
+
+ """
+ params = {
+ 'valueInputOption': value_input_option
+ }
+
+ body = {
+ 'values': values
+ }
+
+ return self.spreadsheet.values_append(self.title, params, body)
def insert_row(
self, | Added append_rows method to simplify the procedure of adding multiple rows (#<I>)
Closes #<I> | burnash_gspread | train | py |
3181340fa412c71d6e9a5721d4589b7c748284f2 | diff --git a/_pydevd_bundle/pydevd_comm.py b/_pydevd_bundle/pydevd_comm.py
index <HASH>..<HASH> 100644
--- a/_pydevd_bundle/pydevd_comm.py
+++ b/_pydevd_bundle/pydevd_comm.py
@@ -752,7 +752,7 @@ class NetCommandFactory:
v = v[0:MAX_IO_MSG_SIZE]
v += '...'
- v = pydevd_xml.make_valid_xml_value(quote(v, '/>_= \t'))
+ v = pydevd_xml.make_valid_xml_value(quote(v, '/>_= '))
return NetCommand(str(CMD_WRITE_TO_CONSOLE), 0, '<xml><io s="%s" ctx="%s"/></xml>' % (v, ctx))
except:
return self.make_error_message(0, get_exception_traceback_str()) | Preserve tab character while parsing XML ptvsd:<I> | fabioz_PyDev.Debugger | train | py |
309d67e8398f38e56ece789ebe3a91c47f66ba58 | diff --git a/docs/src/Tag.doc.js b/docs/src/Tag.doc.js
index <HASH>..<HASH> 100644
--- a/docs/src/Tag.doc.js
+++ b/docs/src/Tag.doc.js
@@ -10,7 +10,7 @@ const card = (c) => cards.push(c);
card(
<PageHeader
name="Tag"
- description="Tag is a object that holds text. It also has an x icon to remove it. Tags can appear within a [form field](/TextField#tagsExample) or as standalone components."
+ description="Tags are objects that hold text and have a delete icon to remove them. They can appear within [TextFields](/TextField#tagsExample), [TextAreas](/TextArea#tagsExample), [Typeaheads](/Typeahead#tagsExample), or as standalone components."
/>
); | Tag: fix typo in documentation (#<I>)
Fixing grammar in the Tag description | pinterest_gestalt | train | js |
12ec521bff5d1c1de1ae300b4f69e181046b79c4 | diff --git a/src/utils/router.js b/src/utils/router.js
index <HASH>..<HASH> 100644
--- a/src/utils/router.js
+++ b/src/utils/router.js
@@ -146,6 +146,7 @@ export default class Framework7Router {
findMatchingRoute(url) {
var matchingRoute;
if (!url) return matchingRoute;
+ url = ""+url; //Insures that the url is of type string so url.split does not crash app in weird situations.
var routes = this.routes;
var query = this.dom7.parseUrlQuery(url); | Fixes edge case
Insures that the url is of type string so url.split does not crash app in weird situations. | framework7io_framework7-vue | train | js |
caca21cd4ab8b0d0d2eb6ed34d3136cc7d051501 | diff --git a/src/components/Tabs.js b/src/components/Tabs.js
index <HASH>..<HASH> 100644
--- a/src/components/Tabs.js
+++ b/src/components/Tabs.js
@@ -26,7 +26,7 @@ class Tabs extends Component {
let firstDefaultLink;
const traverse = child => {
- if (!child.props || firstDefaultLink) {
+ if (!child || !child.props || firstDefaultLink) {
return;
} | don't crash if child is null | patrik-piskay_react-tabs-redux | train | js |
2317729efda198d4cd2cf7380fde027c647f542c | diff --git a/docs/source/conf.py b/docs/source/conf.py
index <HASH>..<HASH> 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -41,6 +41,10 @@ extensions = [
'sphinx.ext.viewcode'
]
+# Napoleon settings
+napoleon_google_docstring = True
+napoleon_include_special_with_doc = True
+
# Show todos
todo_include_todos = True | Added few config options for sphinx napoleon ext. | dariusbakunas_rawdisk | train | py |
496da260c0f04ca7753a8a14bf2eac4c1bbdb9e2 | diff --git a/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractConnectProtocol.java b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractConnectProtocol.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractConnectProtocol.java
+++ b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractConnectProtocol.java
@@ -1334,7 +1334,7 @@ public abstract class AbstractConnectProtocol implements Protocol {
}
public String getTraces() {
- if (options.enablePacketDebug) return traceCache.printStack();
+ if (options.enablePacketDebug && traceCache != null) return traceCache.printStack();
return "";
}
} | [misc] ensure stability if option "enablePacketDebug" is set and IOException occur in when establishing socket | MariaDB_mariadb-connector-j | train | java |
d4fa91564d164fce22acb6e58bd9dac220ac0f57 | diff --git a/version.php b/version.php
index <HASH>..<HASH> 100644
--- a/version.php
+++ b/version.php
@@ -26,7 +26,7 @@
defined('MOODLE_INTERNAL') || die;
$module->version = 2011110500; // The current module version (Date: YYYYMMDDXX)
-$module->requires = 2011070101; // Requires this Moodle version
+$module->requires = 2011070100; // Requires this Moodle version
$module->cron = 0; // Period for cron to check this module (secs)
$module->component = 'mod_book'; // Full name of the plugin (used for diagnostics) | fix requires, originally plugins database did not allow proper version there | moodle_moodle | train | php |
da0f7218f097e45e6857974234d1a61d68b144a2 | diff --git a/packages/vue-inbrowser-compiler-demi/postinstall.js b/packages/vue-inbrowser-compiler-demi/postinstall.js
index <HASH>..<HASH> 100644
--- a/packages/vue-inbrowser-compiler-demi/postinstall.js
+++ b/packages/vue-inbrowser-compiler-demi/postinstall.js
@@ -3,7 +3,7 @@ const fs = require('fs')
function getVuePackageVersion() {
try {
- const pkg = require('vue/package.json')
+ const pkg = require('vue')
return pkg.version
} catch {
return 'unknown'
@@ -39,8 +39,8 @@ function updateIndexForVue3() {
})
}
-const pkg = getVuePackageVersion()
+const version = getVuePackageVersion()
-if (pkg.version.startsWith('3.')) {
+if (version.startsWith('3.')) {
updateIndexForVue3()
} | fix: require version instead of pkg | vue-styleguidist_vue-styleguidist | train | js |
00b57f74b7edcf9d5f4996453a513a8c28c213de | diff --git a/lib/ruff.js b/lib/ruff.js
index <HASH>..<HASH> 100644
--- a/lib/ruff.js
+++ b/lib/ruff.js
@@ -66,8 +66,8 @@
*
*/
function Emitify() {
- this._all = {};
- }
+ this._all = {};
+ }
Emitify.prototype._check = function(event, callback) {
var isTwo = arguments.length === 2; | chore(ruff) rm " " | coderaiser_ruff | train | js |
a7c9609ba5ef035c136fda84b73b5a3a3dff004a | diff --git a/admin/index.php b/admin/index.php
index <HASH>..<HASH> 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -306,8 +306,8 @@ if (during_initial_install()) {
}
}
- // at this stage there can be only one admin - users may change username, so do not rely on that
- $adminuser = get_complete_user_data('id', $CFG->siteadmins);
+ // at this stage there can be only one admin unless more were added by install - users may change username, so do not rely on that
+ $adminuser = get_complete_user_data('id', reset(explode(',', $CFG->siteadmins)));
if ($adminuser->password === 'adminsetuppending') {
// prevent installation hijacking | MDL-<I>: admin: allow install to proceed when multiple admins exist already | moodle_moodle | train | php |
6cafa12f81634bba0ac53843371833176a458cb6 | diff --git a/src/Bandcamp.php b/src/Bandcamp.php
index <HASH>..<HASH> 100644
--- a/src/Bandcamp.php
+++ b/src/Bandcamp.php
@@ -60,7 +60,7 @@ class Bandcamp
*/
public static function title(Crawler $crawler)
{
- $crawler = $crawler->filter('meta[name="title"]');
+ $crawler = $crawler->filter('meta[property="og:title"]');
return $crawler->count() === 1 ? $crawler->attr('content') : null;
}
diff --git a/tests/response/Bandcamp.php b/tests/response/Bandcamp.php
index <HASH>..<HASH> 100644
--- a/tests/response/Bandcamp.php
+++ b/tests/response/Bandcamp.php
@@ -4,7 +4,7 @@ return <<<'HTML'
<html lang="en">
<head>
<meta charset="UTF-8">
- <meta name="title" content="Bandcamp Title">
+ <meta property="og:title" content="Bandcamp Title">
<meta property="og:image" content="bandcamp-thumbnail.jpg">
<meta property="og:video" content="https://bandcamp.com/EmbeddedPlayer/v=2/track=1234567890/">
<title></title> | Change the meta property in Bandcamp for the title | jamband_ripple | train | php,php |
7589e2b015fec6e64f5350d1cc92fba0cfd97b47 | diff --git a/spec/lib/pushr/configuration_spec.rb b/spec/lib/pushr/configuration_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/pushr/configuration_spec.rb
+++ b/spec/lib/pushr/configuration_spec.rb
@@ -1,4 +1,5 @@
require 'spec_helper'
+require 'pushr/daemon'
describe Pushr::Configuration do
@@ -6,7 +7,9 @@ describe Pushr::Configuration do
Pushr::Core.configure do |config|
config.redis = ConnectionPool.new(size: 1, timeout: 1) { MockRedis.new }
end
+ Pushr::Daemon.config = settings
end
+ let(:settings) { Pushr::Daemon::Settings.new }
describe 'all' do
it 'returns all configurations' do | added settings object to config spec | 9to5_pushr-core | train | rb |
59df1c4523de303f88ca920e5e831fd91cbef8f2 | diff --git a/lib/travis/services/users/update.rb b/lib/travis/services/users/update.rb
index <HASH>..<HASH> 100644
--- a/lib/travis/services/users/update.rb
+++ b/lib/travis/services/users/update.rb
@@ -9,6 +9,7 @@ module Travis
def run
@result = current_user.update_attributes!(attributes) if valid_locale?
+ current_user
end
def messages | Return currnet user after updating it | travis-ci_travis-core | train | rb |
322173b956e8a47df566382be309846e27800edc | diff --git a/lib/Thumbor/Url/CommandSet.php b/lib/Thumbor/Url/CommandSet.php
index <HASH>..<HASH> 100644
--- a/lib/Thumbor/Url/CommandSet.php
+++ b/lib/Thumbor/Url/CommandSet.php
@@ -93,7 +93,7 @@ class CommandSet
{
$args = func_get_args();
$filter = array_shift($args);
- $this->filters []= sprintf('%s(%s)', $filter, implode(', ', $args));
+ $this->filters []= sprintf('%s(%s)', $filter, implode(',', $args));
}
/** | Fixing spaces on multiple filter arguments so that hash works properly | 99designs_phumbor | train | php |
b73149e7b133e50243e914fce5e0ce83c1c0f221 | diff --git a/Object/Form/Model/Dummy/Sort.php b/Object/Form/Model/Dummy/Sort.php
index <HASH>..<HASH> 100755
--- a/Object/Form/Model/Dummy/Sort.php
+++ b/Object/Form/Model/Dummy/Sort.php
@@ -25,7 +25,7 @@ class Sort extends \Object\Table {
public $options_map = [];
public $options_active = [];
public $engine = [
- 'mysqli' => 'InnoDB'
+ 'MySQLi' => 'InnoDB'
];
public $cache = false;
diff --git a/System/managers/manager.php b/System/managers/manager.php
index <HASH>..<HASH> 100755
--- a/System/managers/manager.php
+++ b/System/managers/manager.php
@@ -21,6 +21,9 @@ if (file_exists('../libraries/vendor/autoload.php')) {
require('../libraries/vendor/Numbers/Framework/Application.php');
Application::run(['__run_only_bootstrap' => 1]);
+// disable debug
+\Debug::$debug = false;
+
// increase in memory and unlimited execution time
ini_set('memory_limit', '2048M');
set_time_limit(0); | debug, mysql engine | volodymyr-volynets_framework | train | php,php |
5ddbc3544ce4d129d843587d8218db13e84bef10 | diff --git a/src/DispatchesCommands.php b/src/DispatchesCommands.php
index <HASH>..<HASH> 100644
--- a/src/DispatchesCommands.php
+++ b/src/DispatchesCommands.php
@@ -13,7 +13,7 @@ trait DispatchesCommands
*
* @return mixed
*/
- protected function dispatch($command)
+ protected function dispatchCommand($command)
{
return app('tactician.dispatcher')->dispatch($command);
}
@@ -27,7 +27,7 @@ trait DispatchesCommands
*
* @return mixed
*/
- protected function dispatchFrom($command, ArrayAccess $source, array $extras = [])
+ protected function dispatchCommandFrom($command, ArrayAccess $source, array $extras = [])
{
return app('tactician.dispatcher')->dispatchFrom($command, $source, $extras);
}
@@ -40,7 +40,7 @@ trait DispatchesCommands
*
* @return mixed
*/
- protected function dispatchFromArray($command, array $array)
+ protected function dispatchCommandFromArray($command, array $array)
{
return app('tactician.dispatcher')->dispatchFromArray($command, $array);
} | Fix name conflicts with Laravel's DispatchesJobs trait | gearhub_tactician-for-laravel | train | php |
08f8bdb43a8f4643f1c51917dc921b398acd6958 | diff --git a/cluster/config.go b/cluster/config.go
index <HASH>..<HASH> 100644
--- a/cluster/config.go
+++ b/cluster/config.go
@@ -123,6 +123,8 @@ func ConfigProcess() {
KeepAlive: 30 * time.Second,
}).Dial,
TLSHandshakeTimeout: time.Second,
+ MaxIdleConns: 1000,
+ MaxIdleConnsPerHost: 100,
}
client = http.Client{
Transport: transport, | increase connection pool usage.
Default maxIdleConns is <I>, but default maxIdleConnsPerHost is only
2. MT nodes are very chatty and these low limits will result in lots
of requests having to establish new TCP connections. | grafana_metrictank | train | go |
febf982a887ffe3e37651f3a7636dd7ce51306d1 | diff --git a/lib/procodile/cli.rb b/lib/procodile/cli.rb
index <HASH>..<HASH> 100644
--- a/lib/procodile/cli.rb
+++ b/lib/procodile/cli.rb
@@ -45,12 +45,6 @@ module Procodile
# Help
#
- command def proxy
- require 'procodile/tcp_proxy'
- p = Procodile::TCPProxy.new(Supervisor.new(@config, {}))
- p.run
- end
-
desc "Shows this help output"
command def help
puts "\e[45;37mWelcome to Procodile v#{Procodile::VERSION}\e[0m" | remove proxy command that isn't ever used as the proxy runs within a supervisor | adamcooke_procodile | train | rb |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.