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 |
|---|---|---|---|---|---|
44cfa0540face9970aae704096aa75d8d1e080ae | diff --git a/features/step_definitions/jekyll_steps.rb b/features/step_definitions/jekyll_steps.rb
index <HASH>..<HASH> 100644
--- a/features/step_definitions/jekyll_steps.rb
+++ b/features/step_definitions/jekyll_steps.rb
@@ -14,7 +14,7 @@ Given /^I have a blank site in "(.*)"$/ do |path|
end
Given /^I do not have a "(.*)" directory$/ do |path|
- Dir.exists?("#{TEST_DIR}/#{path}")
+ File.directory?("#{TEST_DIR}/#{path}")
end
# Like "I have a foo file" but gives a yaml front matter so jekyll actually processes it
@@ -141,7 +141,7 @@ Then /^the (.*) directory should exist$/ do |dir|
end
Then /^the "(.*)" file should exist in the (.*) path$/ do |file, path|
- assert File.file?("#{TEST_DIR}/#{path}/#{file}")
+ assert File.exists?("#{TEST_DIR}/#{path}/#{file}")
end
Then /^the (.*) directory should exist in the (.*) path$/ do |dir, path| | Switch it to file.exists? and File.directory? so <I> doesn't complain. | jekyll_jekyll | train | rb |
ef7bd0f4cb38bb3cefc91b35819cd99e7465f181 | diff --git a/angr/knowledge/function.py b/angr/knowledge/function.py
index <HASH>..<HASH> 100644
--- a/angr/knowledge/function.py
+++ b/angr/knowledge/function.py
@@ -64,7 +64,7 @@ class Function(object):
if project.is_hooked(addr):
hooker = project.hooked_by(addr)
name = hooker.display_name
- else:
+ elif project._simos.is_syscall_addr(addr):
syscall_inst = project._simos.syscall_from_addr(addr)
name = syscall_inst.display_name
diff --git a/angr/simos.py b/angr/simos.py
index <HASH>..<HASH> 100644
--- a/angr/simos.py
+++ b/angr/simos.py
@@ -246,6 +246,20 @@ class SimOS(object):
basic_addr = self.project.loader.extern_object.get_pseudo_addr(symbol_name)
return basic_addr, basic_addr
+ # Dummy stuff to allow this API to be used freely
+
+ def syscall(self, state, allow_unsupported=True):
+ return None
+
+ def is_syscall_addr(self, addr):
+ return False
+
+ def syscall_from_addr(self, addr, allow_unsupported=True):
+ return None
+
+ def syscall_from_number(self, number, allow_unsupported=True):
+ return None
+
class SimUserland(SimOS):
""" | Add dummy shim for syscall stuff in SimOS base | angr_angr | train | py,py |
ef5ca6933798cc75f8c52d80ce55d824eabf62a7 | diff --git a/tests/DispatcherTest.php b/tests/DispatcherTest.php
index <HASH>..<HASH> 100644
--- a/tests/DispatcherTest.php
+++ b/tests/DispatcherTest.php
@@ -19,7 +19,7 @@ class DispatcherTest extends TestCase
new FakeEndPointMiddleware(),
]);
- $this->assertResponse('', $dispatcher->dispatch(new ServerRequest()));
+ $this->assertResponse('', $dispatcher(new ServerRequest()));
}
public function testMiddleware()
@@ -148,6 +148,28 @@ class DispatcherTest extends TestCase
$dispatcher->dispatch(new ServerRequest());
}
+ public function testInvalidStringMiddlewareException()
+ {
+ $this->expectException(InvalidArgumentException::class);
+
+ $dispatcher = new Dispatcher([
+ 'invalid'
+ ]);
+
+ $dispatcher->dispatch(new ServerRequest());
+ }
+
+ public function testInvalidMatcherException()
+ {
+ $this->expectException(InvalidArgumentException::class);
+
+ $dispatcher = new Dispatcher([
+ [new Datetime(), new FakeMiddleware()]
+ ]);
+
+ $dispatcher->dispatch(new ServerRequest());
+ }
+
private function assertResponse(string $body, ResponseInterface $response)
{
$this->assertEquals($body, (string) $response->getBody()); | added tests for <I>% coverage | oscarotero_middleland | train | php |
0042db6fff6c26797c6120612546cf762b00d270 | diff --git a/valley/mixins.py b/valley/mixins.py
index <HASH>..<HASH> 100644
--- a/valley/mixins.py
+++ b/valley/mixins.py
@@ -198,7 +198,7 @@ class BooleanMixin(VariableMixin):
self.validators = [BooleanValidator()]
def get_db_value(self, value):
- return bool(value)
+ return self.get_python_value(value)
def get_python_value(self, value):
true_vals = ('True', 'true', 1, '1',True) | fixed get_db_Value for BooleanMixin | capless_valley | train | py |
5b84923fed5a984faae5c21e3d1968b9f3c4a5f1 | diff --git a/lib/IDS/Converter.php b/lib/IDS/Converter.php
index <HASH>..<HASH> 100644
--- a/lib/IDS/Converter.php
+++ b/lib/IDS/Converter.php
@@ -561,6 +561,9 @@ class IDS_Converter
$value
);
+ // normalize separation char repetion
+ $value = preg_replace('/([.+~=\-])\1{2,}/m', '$1', $value);
+
//remove parenthesis inside sentences
$value = preg_replace('/(\w\s)\(([&\w]+)\)(\s\w|$)/', '$1$2$3', $value); | added code to deal with abnormal repetiton of separation chars | PHPIDS_PHPIDS | train | php |
bb915cbf3d34b2ec1d828a2e4f6a20445aeef32a | diff --git a/src/ol/proj/proj.js b/src/ol/proj/proj.js
index <HASH>..<HASH> 100644
--- a/src/ol/proj/proj.js
+++ b/src/ol/proj/proj.js
@@ -228,11 +228,9 @@ goog.inherits(ol.Proj4jsProjection_, ol.Projection);
* @inheritDoc
*/
ol.Proj4jsProjection_.prototype.getMetersPerUnit = function() {
- var metersPerUnit;
- if (!goog.isNull(this.units_)) {
+ var metersPerUnit = this.proj4jsProj_.to_meter;
+ if (!goog.isDef(metersPerUnit)) {
metersPerUnit = ol.METERS_PER_UNIT[this.units_];
- } else {
- metersPerUnit = this.getProj4jsProj().to_meter;
}
return metersPerUnit;
}; | Less code
Since out meters per unit conversion table is a bit spare, prefer the configured conversion. | openlayers_openlayers | train | js |
698f9c717bff4ec9190ca9e6a7e9ad016a3e7e57 | diff --git a/tests/test_jujupy.py b/tests/test_jujupy.py
index <HASH>..<HASH> 100644
--- a/tests/test_jujupy.py
+++ b/tests/test_jujupy.py
@@ -1516,6 +1516,13 @@ class TestEnvJujuClient(ClientTest):
client.wait_for_started(start=now - timedelta(1200))
self.assertEqual(writes, ['pending: jenkins/0', '\n'])
+ def test__wait_for_status_suppresses_deadline(self):
+ client = EnvJujuClient(JujuData('local'), None, None)
+ client._wait_for_status(None, None)
+ soft_deadline = datetime(2015, 1, 2, 3, 4, 6)
+ now = soft_deadline + timedelta(seconds=1)
+ client._backend.soft_deadline = soft_deadline
+
def test_wait_for_started_logs_status(self):
value = self.make_status_yaml('agent-state', 'pending', 'started')
client = EnvJujuClient(JujuData('local'), None, None) | Start testing wait_for_status. | juju_juju | train | py |
d27ef4df2986a8291ccf2c859a41852f45d7843e | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -24,7 +24,7 @@ def tag_version():
"""Generate version number from Git Tag, e.g. v2.0.0, v2.0.0-1."""
recent_tag = subprocess.check_output(shlex.split('git describe --long'))
tag, count, _ = recent_tag.decode().split('-')
- version = '-'.join([tag, count]) if int(count) else tag
+ version = 'a'.join([tag, count]) if int(count) else tag
return version | feat: Default to alpha releases | foremast_foremast | train | py |
31da21b8c96b01eb53597c1f567edb87c8a4a31f | diff --git a/codeTemplates/src/Entity/Repositories/AbstractEntityRepository.php b/codeTemplates/src/Entity/Repositories/AbstractEntityRepository.php
index <HASH>..<HASH> 100644
--- a/codeTemplates/src/Entity/Repositories/AbstractEntityRepository.php
+++ b/codeTemplates/src/Entity/Repositories/AbstractEntityRepository.php
@@ -1,7 +1,7 @@
<?php declare(strict_types=1);
namespace TemplateNamespace\Entity\Repositories;
-// phpcs:disable - line length
+// phpcs:disable -- line length
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Mapping;
diff --git a/codeTemplates/src/Entity/Repositories/TemplateEntityRepository.php b/codeTemplates/src/Entity/Repositories/TemplateEntityRepository.php
index <HASH>..<HASH> 100644
--- a/codeTemplates/src/Entity/Repositories/TemplateEntityRepository.php
+++ b/codeTemplates/src/Entity/Repositories/TemplateEntityRepository.php
@@ -3,7 +3,7 @@
namespace TemplateNamespace\Entity\Repositories;
use FQNFor\AbstractEntityRepository;
-// phpcs:disable - line length
+// phpcs:disable -- line length
class TemplateEntityRepository extends AbstractEntityRepository
{
// phpcs: enable | May have made a mistake with the csignore comments | edmondscommerce_doctrine-static-meta | train | php,php |
7690ae68749c687711085184dd7ef7673e0e60f1 | diff --git a/lib/cuda/driver/ffi-cu.rb b/lib/cuda/driver/ffi-cu.rb
index <HASH>..<HASH> 100644
--- a/lib/cuda/driver/ffi-cu.rb
+++ b/lib/cuda/driver/ffi-cu.rb
@@ -122,9 +122,12 @@ module API
:MAXIMUM_TEXTURE3D_WIDTH, 24,
:MAXIMUM_TEXTURE3D_HEIGHT, 25,
:MAXIMUM_TEXTURE3D_DEPTH, 26,
- :MAXIMUM_TEXTURE2D_ARRAY_WIDTH, 27,
- :MAXIMUM_TEXTURE2D_ARRAY_HEIGHT, 28,
- :MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES, 29,
+ :MAXIMUM_TEXTURE2D_LAYERED_WIDTH, 27,
+ :MAXIMUM_TEXTURE2D_LAYERED_HEIGHT, 28,
+ :MAXIMUM_TEXTURE2D_LAYERED_LAYERS, 29,
+ :MAXIMUM_TEXTURE2D_ARRAY_WIDTH, 27, # Deprecated.
+ :MAXIMUM_TEXTURE2D_ARRAY_HEIGHT, 28, # Deprecated.
+ :MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES, 29, # Deprecated.
:SURFACE_ALIGNMENT, 30,
:CONCURRENT_KERNELS, 31,
:ECC_ENABLED, 32, | CU: Update texture attributes of CUDeviceAttribute for CUDA <I>. | xman_sgc-ruby-cuda | train | rb |
8c96b22b44ef75b859d98d3dc55d9fb193aa8192 | diff --git a/trovebox/http.py b/trovebox/http.py
index <HASH>..<HASH> 100644
--- a/trovebox/http.py
+++ b/trovebox/http.py
@@ -105,7 +105,7 @@ class Http(object):
self._logger.info("GET %s" % url)
self._logger.info("---")
self._logger.info(response.text[:1000])
- if len(response.text) > 1000:
+ if len(response.text) > 1000: # pragma: no cover
self._logger.info("[Response truncated to 1000 characters]")
self.last_url = url
@@ -161,7 +161,7 @@ class Http(object):
self._logger.info("files: %s" % repr(files))
self._logger.info("---")
self._logger.info(response.text[:1000])
- if len(response.text) > 1000:
+ if len(response.text) > 1000: # pragma: no cover
self._logger.info("[Response truncated to 1000 characters]")
self.last_url = url | No coverage required for response logging truncation | photo_openphoto-python | train | py |
ccdd80ebcafc541d44faf941211a11b8f7abf004 | diff --git a/lib/openapi3_parser/source.rb b/lib/openapi3_parser/source.rb
index <HASH>..<HASH> 100644
--- a/lib/openapi3_parser/source.rb
+++ b/lib/openapi3_parser/source.rb
@@ -72,7 +72,7 @@ module Openapi3Parser
data.dig(*json_pointer) if data.respond_to?(:dig)
end
- def has_pointer?(json_pointer) # rubocop:disable Style/PredicateName
+ def has_pointer?(json_pointer) # rubocop:disable Naming/PredicateName
!data_at_pointer(json_pointer).nil?
end | Rename rubocop rule disabling
This was incorrectly namespaced to Style when it is actually under
Naming namespace. | kevindew_openapi3_parser | train | rb |
b0f92d23dc807ed01068a9cd9cf7555121975274 | diff --git a/src/Models/Monitor.php b/src/Models/Monitor.php
index <HASH>..<HASH> 100644
--- a/src/Models/Monitor.php
+++ b/src/Models/Monitor.php
@@ -76,7 +76,7 @@ class Monitor extends Model
{
parent::boot();
- static::saving(function (Monitor $monitor) {
+ static::saving(function (self $monitor) {
if (static::alreadyExists($monitor)) {
throw CannotSaveMonitor::alreadyExists($monitor);
} | Apply fixes from StyleCI (#<I>) | spatie_laravel-uptime-monitor | train | php |
bf229a1952d5c4595e5de348a27d6aed9ebccc4d | diff --git a/workbench/server/dir_watcher.py b/workbench/server/dir_watcher.py
index <HASH>..<HASH> 100644
--- a/workbench/server/dir_watcher.py
+++ b/workbench/server/dir_watcher.py
@@ -26,7 +26,7 @@ class DirWatcher(object):
def start_monitoring(self):
""" Monitor the path given """
- self.jobs = [gevent.spawn(self._start_monitoring)]
+ # self.jobs = [gevent.spawn(self._start_monitoring)]
def _start_monitoring(self):
""" Internal method that monitors the directory for changes """ | disable file monitoring until we figure out a bad bug | SuperCowPowers_workbench | train | py |
9d8f4c1bfa7fec2cff9007dcd9c27d66c7340bb1 | diff --git a/test/spec/Editor-test.js b/test/spec/Editor-test.js
index <HASH>..<HASH> 100644
--- a/test/spec/Editor-test.js
+++ b/test/spec/Editor-test.js
@@ -184,6 +184,12 @@ define(function (require, exports, module) {
// Mode for range - mix of modes
myEditor.setSelection({line: 2, ch: 4}, {line: 3, ch: 7});
expect(myEditor.getModeForSelection()).toBeNull();
+
+ // Mode for range - mix of modes where start & endpoints are same mode
+ // Known limitation of getModeForSelection() that it does not spot where the mode
+ // differs in mid-selection
+ myEditor.setSelection({line: 0, ch: 0}, {line: 6, ch: 14}); // select all
+ expect(myEditor.getModeForSelection()).toBe("html");
});
}); | Add one more unit test, requested in code review - mixed mode selection range
the exposes the limitations of only looking at start & end of range. | adobe_brackets | train | js |
61af0862cdbc517c292825a726f8055559f6a0ca | diff --git a/vault/core.go b/vault/core.go
index <HASH>..<HASH> 100644
--- a/vault/core.go
+++ b/vault/core.go
@@ -666,16 +666,16 @@ func (c *Core) Standby() (bool, error) {
func (c *Core) Leader() (bool, string, error) {
c.stateLock.RLock()
defer c.stateLock.RUnlock()
- // Check if sealed
- if c.sealed {
- return false, "", ErrSealed
- }
-
// Check if HA enabled
if c.ha == nil {
return false, "", ErrHANotEnabled
}
+ // Check if sealed
+ if c.sealed {
+ return false, "", ErrSealed
+ }
+
// Check if we are the leader
if !c.standby {
return true, c.advertiseAddr, nil | vault: Swap the HAEnabled check with the sealed check | hashicorp_vault | train | go |
7e2f228b1d55427b4c83b4d75002fd2bb0618188 | diff --git a/web/src/test/java/uk/ac/ebi/atlas/acceptance/rest/tests/mtab1066/MTAB1066GeneProfilesDownloadControllerIT.java b/web/src/test/java/uk/ac/ebi/atlas/acceptance/rest/tests/mtab1066/MTAB1066GeneProfilesDownloadControllerIT.java
index <HASH>..<HASH> 100644
--- a/web/src/test/java/uk/ac/ebi/atlas/acceptance/rest/tests/mtab1066/MTAB1066GeneProfilesDownloadControllerIT.java
+++ b/web/src/test/java/uk/ac/ebi/atlas/acceptance/rest/tests/mtab1066/MTAB1066GeneProfilesDownloadControllerIT.java
@@ -78,7 +78,7 @@ public class MTAB1066GeneProfilesDownloadControllerIT {
ResponseBody body = subject.getResponseBody();
String[] lines = body.asString().split("\n");
- assertThat(lines.length, is(176));
+ assertThat(lines.length, greaterThan(170));
}
}
\ No newline at end of file | as index size varies between a fresh local index and an old index on lime, had to soften gene profile download length test | ebi-gene-expression-group_atlas | train | java |
16196d0049517d25148b23864f40c7923acad262 | diff --git a/lib/veritas/relation/empty.rb b/lib/veritas/relation/empty.rb
index <HASH>..<HASH> 100644
--- a/lib/veritas/relation/empty.rb
+++ b/lib/veritas/relation/empty.rb
@@ -3,8 +3,10 @@ module Veritas
class Empty < Materialized
include Optimizable # for no-op #optimize
+ ZERO_TUPLE = [].freeze
+
def initialize(header)
- super(header, Set.new)
+ super(header, ZERO_TUPLE)
@predicate = Logic::Proposition::False.instance
end | Use an Array to initialize an Empty relation | dkubb_axiom | train | rb |
34ba0eaa9ac71663e2b511e0155d5a6b3abc9dcf | diff --git a/trunk/JLanguageTool/src/main/dev/org/languagetool/dev/WordTokenizer.java b/trunk/JLanguageTool/src/main/dev/org/languagetool/dev/WordTokenizer.java
index <HASH>..<HASH> 100644
--- a/trunk/JLanguageTool/src/main/dev/org/languagetool/dev/WordTokenizer.java
+++ b/trunk/JLanguageTool/src/main/dev/org/languagetool/dev/WordTokenizer.java
@@ -37,7 +37,6 @@ import org.languagetool.Language;
*/
public final class WordTokenizer {
-
public static void main(final String[] args) throws IOException {
final WordTokenizer prg = new WordTokenizer();
if (args.length != 1) {
@@ -48,7 +47,6 @@ public final class WordTokenizer {
}
private void run(final String lang) throws IOException {
-
JLanguageTool langTool = new JLanguageTool(
Language.getLanguageForShortName(lang));
BufferedReader in = null;
@@ -63,14 +61,9 @@ public final class WordTokenizer {
for (AnalyzedTokenReadings a : atr) {
out.write(a.getToken());
out.write("\n");
- }
+ }
}
- }
- catch (IOException e) {
- System.err.println("IOException reading System.in" + e);
- throw e;
- }
- finally {
+ } finally {
if (in != null) {
in.close();
} | small code simplification: no need to catch exception | languagetool-org_languagetool | train | java |
f39f092b9440f2f032f03c1ffc772043abec58d6 | diff --git a/lib/celluloid/calls.rb b/lib/celluloid/calls.rb
index <HASH>..<HASH> 100644
--- a/lib/celluloid/calls.rb
+++ b/lib/celluloid/calls.rb
@@ -3,7 +3,11 @@ module Celluloid
class Call
attr_reader :method, :arguments, :block
+ RETRY_CALL = 3
+ RETRY_LIMIT = 5
+
def initialize(method, arguments = [], block = nil)
+ @retry = 0
@method, @arguments = method, arguments
if block
if Celluloid.exclusive?
@@ -24,6 +28,11 @@ module Celluloid
check(obj)
_b = @block && @block.to_proc
obj.public_send(@method, *@arguments, &_b)
+ rescue Celluloid::TimeoutError => ex
+ raise ex unless ( @retry += 1 ) <= RETRY_LIMIT
+ Internals::Logger.warn("TimeoutError at Call dispatch. Retrying in #{RETRY_CALL} seconds. ( Attempt #{@retry} of #{RETRY_LIMIT} )")
+ sleep RETRY_CALL
+ retry
end
def check(obj) | retry structure for calls coming in primatively, to be continued in #<I> | celluloid_celluloid | train | rb |
2d97b68f58d78a9185965a3279a363f4eb2126e7 | diff --git a/config/initializers/indexing_adapter_initializer.rb b/config/initializers/indexing_adapter_initializer.rb
index <HASH>..<HASH> 100644
--- a/config/initializers/indexing_adapter_initializer.rb
+++ b/config/initializers/indexing_adapter_initializer.rb
@@ -5,7 +5,7 @@ require 'valkyrie/indexing/null_indexing_adapter'
Rails.application.config.to_prepare do
Valkyrie::IndexingAdapter.register(
- Valkyrie::Indexing::Solr::IndexingAdapter.new(),
+ Valkyrie::Indexing::Solr::IndexingAdapter.new,
:solr_index
)
Valkyrie::IndexingAdapter.register( | updated lint regarding no params on method call | samvera_hyrax | train | rb |
9e3747324f8442008687073e8da0111d8fa669d7 | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -18,10 +18,14 @@ module.exports = function(grunt) {
port: 8050,
host: "*",
keepalive: true,
- livereload: true
+ livereload: true,
+ open: {
+ target: 'http://localhost:8050/tests/SpecRunner.html',
+ appName: 'xdg-open',
+ callback: function() {} // App that will be called with the target url to open the browser.
+ }
}
}
-
},
mocha: {
test: { | Automatically open test page in browser using xdg-open. | MiguelCastillo_spromise | train | js |
b9900356fd2b8171fdfecc0cc092499364bb61ca | diff --git a/src/sap.ui.core/src/sap/ui/model/FilterProcessor.js b/src/sap.ui.core/src/sap/ui/model/FilterProcessor.js
index <HASH>..<HASH> 100644
--- a/src/sap.ui.core/src/sap/ui/model/FilterProcessor.js
+++ b/src/sap.ui.core/src/sap/ui/model/FilterProcessor.js
@@ -101,7 +101,7 @@ sap.ui.define(['./Filter', 'jquery.sap.global', 'jquery.sap.unicode'],
if (typeof oValue == "string") {
// Internet Explorer and Edge cannot uppercase properly on composed characters
if (String.prototype.normalize && (sap.ui.Device.browser.msie || sap.ui.Device.browser.edge)) {
- oValue = oValue.normalize("NFD");
+ oValue = oValue.normalize("NFKD");
}
oValue = oValue.toUpperCase();
// use canonical composition as recommended by W3C | [FIX] FilterProcessor: Adapt normalization for MS Edge <I>+
Since MS Edge <I> the behaviour of toUpperCase with composed Unicode
characters changed, which requires compatibility decomposition to still
work as expected.
BCP: <I>
Change-Id: Id<I>a<I>c<I>cd9aab<I>c4dd<I>bc<I> | SAP_openui5 | train | js |
334e35f0a2dc5288e27c31e8e8ed4aad5ea1bf35 | diff --git a/src/Http/MellonAuthenticationHook.php b/src/Http/MellonAuthenticationHook.php
index <HASH>..<HASH> 100644
--- a/src/Http/MellonAuthenticationHook.php
+++ b/src/Http/MellonAuthenticationHook.php
@@ -38,20 +38,20 @@ class MellonAuthenticationHook implements BeforeHookInterface
public function executeBefore(Request $request, array $hookData)
{
+ $userId = $request->getHeader($this->userIdAttribute);
if ($this->addEntityId) {
// add the entity ID to the user ID, this is used when we have
// different IdPs that do not guarantee uniqueness among the used
// user identifier attribute, e.g. NAME_ID or uid
- return sprintf(
+ $userId = sprintf(
'%s|%s',
// strip out all "special" characters from the entityID, just
// like mod_auth_mellon does
preg_replace('/__*/', '_', preg_replace('/[^A-Za-z.]/', '_', $request->getHeader('MELLON_IDP'))),
- $request->getHeader($this->userIdAttribute)
+ $userId
);
}
- $userId = $request->getHeader($this->userIdAttribute);
if ($this->session->has('_mellon_auth_user')) {
if ($userId !== $this->session->get('_mellon_auth_user')) {
// if we have an application session where the user_id does not | also fix #6 for the case where addEntityID is true | eduvpn_vpn-lib-common | train | php |
becd6d24b0d122d84ead56293778af0f3f9ec066 | diff --git a/apptentive/src/main/java/com/apptentive/android/sdk/ApptentiveViewActivity.java b/apptentive/src/main/java/com/apptentive/android/sdk/ApptentiveViewActivity.java
index <HASH>..<HASH> 100644
--- a/apptentive/src/main/java/com/apptentive/android/sdk/ApptentiveViewActivity.java
+++ b/apptentive/src/main/java/com/apptentive/android/sdk/ApptentiveViewActivity.java
@@ -408,7 +408,7 @@ public class ApptentiveViewActivity extends ApptentiveComponentActivity
//region User log out listener
@Override
public void onUserLogOut() {
- if (isFinishing()) {
+ if (!isFinishing()) {
finish();
}
} | Fixed dismissing ApptentiveViewActivity on user log out | apptentive_apptentive-android | train | java |
e23160e945cdbf28fa3d42699b931234b8bc95d7 | diff --git a/jenetics/src/main/java/io/jenetics/internal/util/StreamProxy.java b/jenetics/src/main/java/io/jenetics/internal/util/StreamProxy.java
index <HASH>..<HASH> 100644
--- a/jenetics/src/main/java/io/jenetics/internal/util/StreamProxy.java
+++ b/jenetics/src/main/java/io/jenetics/internal/util/StreamProxy.java
@@ -36,6 +36,7 @@ import java.util.function.Supplier;
import java.util.function.ToDoubleFunction;
import java.util.function.ToIntFunction;
import java.util.function.ToLongFunction;
+import java.util.function.UnaryOperator;
import java.util.stream.Collector;
import java.util.stream.DoubleStream;
import java.util.stream.IntStream;
@@ -297,4 +298,14 @@ public abstract class StreamProxy<T> implements Stream<T> {
return _self.unordered();
}
+ @Override
+ public Stream<T> takeWhile(final Predicate<? super T> predicate) {
+ return _self.takeWhile(predicate);
+ }
+
+ @Override
+ public Stream<T> dropWhile(final Predicate<? super T> predicate) {
+ return _self.dropWhile(predicate);
+ }
+
} | Delegate new 'Stream' methods 'takeWhile' and 'dropWhile'. | jenetics_jenetics | train | java |
c864dbf87c25929191d3470f0ac0b14c656fd2a8 | diff --git a/test/helper.rb b/test/helper.rb
index <HASH>..<HASH> 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -1,4 +1,5 @@
require 'rubygems' if RUBY_VERSION < '1.9.0'
+gem 'test-unit'
require "test/unit"
require 'em-spec/test'
Dir.glob(File.dirname(__FILE__) + '/../lib/sensu/*', &method(:require)) | [travis] em-spec working w/ ruby <I> | sensu_sensu | train | rb |
bc88daab99cc6511995faf5ef1e9816fc40097ab | diff --git a/src/Forms/ApiAccessTokenFormFactory.php b/src/Forms/ApiAccessTokenFormFactory.php
index <HASH>..<HASH> 100644
--- a/src/Forms/ApiAccessTokenFormFactory.php
+++ b/src/Forms/ApiAccessTokenFormFactory.php
@@ -14,7 +14,7 @@ class ApiAccessTokenFormFactory
private $apiAccessRepository;
private $apiAccessTokensRepository;
-
+
private $translator;
public $onSubmit;
@@ -48,10 +48,10 @@ class ApiAccessTokenFormFactory
$form->setRenderer(new BootstrapRenderer());
$form->addProtection();
- $form->addSubmit('send', $this->translator->translate('api.admin.access.form.check_all'))
+ $form->addSubmit('send')
->getControlPrototype()
->setName('button')
- ->setHtml('<i class="fa fa-cloud-upload"></i> ' . $this->translator->translate('api.admin.access.form.save'));
+ ->setHtml('<i class="fa fa-save"></i> ' . $this->translator->translate('api.admin.access.form.save'));
$form->setDefaults($defaults); | Fix translation of button for api access form
Removing caption from button. Caption "check all" is incorrect and
translations are sometimes incorrectly cached if both caption & setHtml
are used on addButton / addSubmit. | remp2020_crm-api-module | train | php |
6a73f032cd7095a4e5dd227f2c176b3b5abd0803 | diff --git a/lib/naver/ext/hash/to_underscore_keys.rb b/lib/naver/ext/hash/to_underscore_keys.rb
index <HASH>..<HASH> 100644
--- a/lib/naver/ext/hash/to_underscore_keys.rb
+++ b/lib/naver/ext/hash/to_underscore_keys.rb
@@ -29,7 +29,7 @@ class Hash
end
def underscore(camel_cased_word)
- return camel_cased_word unless /[A-Z-]|::/.match?(camel_cased_word)
+ return camel_cased_word unless camel_cased_word =~ /[A-Z-]|::/
word = camel_cased_word.to_s.gsub("::".freeze, "/".freeze)
word.gsub!(/([A-Z\d]+)([A-Z][a-z])/, '\1_\2'.freeze)
word.gsub!(/([a-z\d])([A-Z])/, '\1_\2'.freeze) | REGEX.match? is ruby <I> only. replace to =~ | kimsuelim_naver-sdk-ruby | train | rb |
ae4aeeb23332ae0671d2e9d15770b69c3ce30fac | diff --git a/tests/test_textFile.py b/tests/test_textFile.py
index <HASH>..<HASH> 100644
--- a/tests/test_textFile.py
+++ b/tests/test_textFile.py
@@ -30,6 +30,7 @@ def test_s3_textFile():
's3n://aws-publicdatasets/common-crawl/crawl-data/CC-MAIN-2015-11/warc.paths.*'
)
print(myrdd.collect())
+ assert 'common-crawl/crawl-data/CC-MAIN-2015-11/segments/1424937481488.49/warc/CC-MAIN-20150226075801-00329-ip-10-28-5-156.ec2.internal.warc.gz' in myrdd.collect()
def test_saveAsTextFile():
@@ -60,5 +61,6 @@ def test_saveAsTextFile_bz2():
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
- test_local_textFile_2()
+ # test_local_textFile_2()
# test_saveAsTextFile_gz()
+ test_s3_textFile() | add an assert to the s3-gz-compressed-textFile test case | svenkreiss_pysparkling | train | py |
5c6472453307f9feca1fbaebcaeaf90d2e37e047 | diff --git a/modules/hypermedia.js b/modules/hypermedia.js
index <HASH>..<HASH> 100644
--- a/modules/hypermedia.js
+++ b/modules/hypermedia.js
@@ -198,15 +198,8 @@ define([
enter: function (rel, parameters, actions, options) {
var homeResource = this.getDefinition(rel);
- // Override the default actions for the entry point $resource
- // We only use get, other actions will not do anything
- // Also specify the accepted content-type to be of type hypermedia
actions = actions ? actions : {};
angular.extend(actions, {
- query: angular.noop,
- delete: angular.noop,
- remove: angular.noop,
- save: angular.noop,
get: {
method: 'GET',
headers: { 'accept': HYPERMEDIA_TYPE } | Enable the use of other http verb with json home endpoints (it was limited to get only) | w20-framework_w20 | train | js |
5debcffd556128c36370c7cdd81cc343c18477b8 | diff --git a/remi/gui.py b/remi/gui.py
index <HASH>..<HASH> 100644
--- a/remi/gui.py
+++ b/remi/gui.py
@@ -1033,7 +1033,6 @@ class TabBox(Widget):
def add_tab(self, widget, name, tab_cb):
holder = Tag(_type='div', _class='')
- holder.style['padding'] = '15px'
holder.add_child('content', widget)
li = Tag(_type='li', _class='') | BigFix graphical unwanted padding in TabBox | dddomodossola_remi | train | py |
8578841972f86f3c0f5197d194df43feef29ba33 | diff --git a/cloudaux/aws/ec2.py b/cloudaux/aws/ec2.py
index <HASH>..<HASH> 100644
--- a/cloudaux/aws/ec2.py
+++ b/cloudaux/aws/ec2.py
@@ -93,6 +93,12 @@ def describe_instances(**kwargs):
@sts_conn('ec2')
@rate_limited()
+def describe_vpcs(**kwargs):
+ return kwargs.pop('client').describe_vpcs(**kwargs)
+
+
+@sts_conn('ec2')
+@rate_limited()
def describe_images(**kwargs):
return kwargs.pop('client').describe_images(**kwargs)['Images'] | Adding the ability to describe vpcs. | Netflix-Skunkworks_cloudaux | train | py |
eef95ba0d2f9a7f29bcd061a664c930c97c3f3f3 | diff --git a/src/resolver.js b/src/resolver.js
index <HASH>..<HASH> 100644
--- a/src/resolver.js
+++ b/src/resolver.js
@@ -44,9 +44,6 @@ function resolverFactory(target, options) {
type = type.ofType || type;
findOptions.attributes = targetAttributes;
-
- findOptions.root = context;
- findOptions.context = context;
findOptions.logging = findOptions.logging || context.logging;
return Promise.resolve(options.before(findOptions, args, context, info)).then(function (findOptions) { | dont add context to findOptions as Sequelize might memory leak | mickhansen_graphql-sequelize | train | js |
10e8f1be8b2796642f6f398c024a8d9f0369512e | diff --git a/lib/socket.js b/lib/socket.js
index <HASH>..<HASH> 100644
--- a/lib/socket.js
+++ b/lib/socket.js
@@ -220,14 +220,11 @@ Socket.prototype.onOpen = function () {
*/
Socket.prototype.onMessage = function (msg) {
+ // debug: socket receive: type "%s" | data "%s", msg.type, msg.data
switch (msg.type) {
case 'noop':
break;
- case 'open':
- this.onOpen();
- break;
-
case 'ping':
this.sendPacket('pong');
break; | Instrumented onMessage and removed unnecessary `open` handler. | socketio_engine.io-client | train | js |
b69dac92f29e1c3814cb0959f155bbc939f2e4a1 | diff --git a/lib/rvc/modules/vim.rb b/lib/rvc/modules/vim.rb
index <HASH>..<HASH> 100644
--- a/lib/rvc/modules/vim.rb
+++ b/lib/rvc/modules/vim.rb
@@ -81,7 +81,7 @@ def connect uri, opts
unless opts[:rev]
# negotiate API version
rev = vim.serviceContent.about.apiVersion
- vim.rev = [rev, '4.1'].min
+ vim.rev = [rev, ENV['RVC_VIMREV'] || '4.1'].min
end
isVC = vim.serviceContent.about.apiType == "VirtualCenter" | allow RVC_VIMREV environment variable to override maximum supported version | vmware_rvc | train | rb |
de47c3f0eeb9d9b03526a0707f275d3cf752b086 | diff --git a/src/Message/PurchaseRequest.php b/src/Message/PurchaseRequest.php
index <HASH>..<HASH> 100644
--- a/src/Message/PurchaseRequest.php
+++ b/src/Message/PurchaseRequest.php
@@ -22,9 +22,9 @@ class PurchaseRequest extends AbstractRequest
return $this->setParameter('language', $value);
}
- public function getClient()
+ public function getClient(): string
{
- return $this->getParameter('client');
+ return (string) $this->getParameter('client');
}
public function setClient($value) | fix: client could be object and throws exceptions | hiqdev_omnipay-freekassa | train | php |
a4a90c33fcf0a4ea01f65cb74c60db21ab62bd88 | diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -1,8 +1,10 @@
+"use strict";
+
var gulp = require("gulp"),
jshint = require("gulp-jshint");
gulp.task("lint", function() {
- return gulp.src(["./lib/*.js", "./test/*.js"])
+ return gulp.src(["./lib/**/*.js", "./test/**/*.js"])
.pipe(jshint())
.pipe(jshint.reporter("jshint-stylish"));
}); | Include more files to lint | jchristin_dataflow | train | js |
34c068ec49ce884e17b489ebbf064473e93d4579 | diff --git a/salt/modules/win_file.py b/salt/modules/win_file.py
index <HASH>..<HASH> 100644
--- a/salt/modules/win_file.py
+++ b/salt/modules/win_file.py
@@ -17,8 +17,8 @@ import logging
# pylint: disable=W0611
import tempfile # do not remove. Used in salt.modules.file.__clean_tmp
import itertools # same as above, do not remove, it's used in __clean_tmp
-import contextlib # do not remove, used in imported file.py functions
-import difflib # do not remove, used in imported file.py functions
+import contextlib # do not remove, used in imported file.py functions
+import difflib # do not remove, used in imported file.py functions
# pylint: enable=W0611
# Import third party libs | use two spaces before inline comment
Keep pylint happy | saltstack_salt | train | py |
4a0642d17ef60caa3816abbe5cc99184a8acf44b | diff --git a/src/Fields/Datepicker.php b/src/Fields/Datepicker.php
index <HASH>..<HASH> 100644
--- a/src/Fields/Datepicker.php
+++ b/src/Fields/Datepicker.php
@@ -94,15 +94,20 @@ EOT;
{
$startDay = $options['start-day'] ?? 1;
$format = $options['format'] ?? 'YYYY-MM-DD';
+ $event = $options['event'] ?? 'keydown';
return <<<EOT
-datepicker("#$id", {
+var _{$id}Datepicker = datepicker("#$id", {
startDay: $startDay,
dateSelected: moment(document.getElementById("$id").value).toDate(),
formatter: (input, date, instance) => {
input.value = moment(date).format("$format");
}
});
+document.getElementById("$id").addEventListener('{$event}', function () {
+ let date = moment(this.value).toDate();
+ _{$id}Datepicker.setDate(date, true);
+});
EOT;
}
} | Because datepicker had an issue with updating | GrafiteInc_FormMaker | train | php |
fdedba02f1d360839df3795f66369207c5793842 | diff --git a/userservice/user.py b/userservice/user.py
index <HASH>..<HASH> 100644
--- a/userservice/user.py
+++ b/userservice/user.py
@@ -24,8 +24,11 @@ class UserService:
def _require_middleware(self):
if "initialized" not in self._get_current_user_data():
- raise UninitializedError("You need to have this line in your "
- "MIDDLEWARE_CLASSES: 'userservice.user.UserServiceMiddleware'")
+ if settings.DEBUG:
+ print("You need to have this in settings.MIDDLEWARE_CLASSES: "
+ "'userservice.user.UserServiceMiddleware'")
+
+ raise UninitializedError("Missing UserServiceMiddleware")
def get_request(self):
data = self._get_current_user_data() | print warning when DEBUG is True | uw-it-aca_django-userservice | train | py |
ec0b51878be740397084b76e5a3cb71f096cb2be | diff --git a/src/mako/session/Session.php b/src/mako/session/Session.php
index <HASH>..<HASH> 100644
--- a/src/mako/session/Session.php
+++ b/src/mako/session/Session.php
@@ -296,7 +296,12 @@ class Session
// Get the session id from the cookie or generate a new one if it doesn't exist.
- $this->sessionId = $this->request->signedCookie($this->cookieName, $this->generateId());
+ $this->sessionId = $this->request->signedCookie($this->cookieName, false);
+
+ if($this->sessionId === false)
+ {
+ $this->sessionId = $this->generateId();
+ }
// Create a new / update the existing session cookie | No longer loading the UUID class unnecessarily | mako-framework_framework | train | php |
c047979b168ee1f84310907d5bfee166391dd74a | diff --git a/sdk/go/common/apitype/history.go b/sdk/go/common/apitype/history.go
index <HASH>..<HASH> 100644
--- a/sdk/go/common/apitype/history.go
+++ b/sdk/go/common/apitype/history.go
@@ -84,6 +84,7 @@ const (
// Should generally mirror backend.UpdateInfo, but we clone it in this package to add
// flexibility in case there is a breaking change in the backend-type.
type UpdateInfo struct {
+ Version int `json:"version"`
// Information known before an update is started.
Kind UpdateKind `json:"kind"`
StartTime int64 `json:"startTime"` | Export UpdateID as part of the UpdateInfo event that comes from the SaaS (#<I>) | pulumi_pulumi | train | go |
8385a991d18ac4559f999fb4f12018d422ddf39b | diff --git a/lib/slimmer.rb b/lib/slimmer.rb
index <HASH>..<HASH> 100644
--- a/lib/slimmer.rb
+++ b/lib/slimmer.rb
@@ -197,6 +197,18 @@ module Slimmer
dest.at_css(@path).replace(body)
end
end
+
+ class BodyClassCopier
+ def filter(src, dest)
+ src_body_tag = src.at_css("body")
+ dest_body_tag = dest.at_css('body')
+ if src_body_tag.has_attribute?("class")
+ combinded_classes = dest_body_tag.attr('class').to_s.split(/ +/)
+ combinded_classes << src_body_tag.attr('class').to_s.split(/ +/)
+ dest_body_tag.set_attribute("class", combinded_classes.join(' '))
+ end
+ end
+ end
class AdminTitleInserter
def filter(src,dest)
@@ -278,6 +290,7 @@ module Slimmer
AdminTitleInserter.new,
FooterRemover.new,
BodyInserter.new(),
+ BodyClassCopier.new
]
self.process(processors,body,template('admin'))
end
@@ -288,6 +301,7 @@ module Slimmer
TitleInserter.new(),
TagMover.new(),
BodyInserter.new(),
+ BodyClassCopier.new,
SectionInserter.new()
] | Allow body classes to be propogated from both the template and application layout. | alphagov_slimmer | train | rb |
47133a3e7e8230e9cb8674a97efc8fc7c8e007e7 | diff --git a/src/cr/cube/cubepart.py b/src/cr/cube/cubepart.py
index <HASH>..<HASH> 100644
--- a/src/cr/cube/cubepart.py
+++ b/src/cr/cube/cubepart.py
@@ -1572,6 +1572,8 @@ class _Nub(CubePartition):
@lazyproperty
def is_empty(self):
+ if self.unweighted_count <= 0:
+ return True
return math.isnan(self.unweighted_count)
@lazyproperty
diff --git a/tests/unit/test_cubepart.py b/tests/unit/test_cubepart.py
index <HASH>..<HASH> 100644
--- a/tests/unit/test_cubepart.py
+++ b/tests/unit/test_cubepart.py
@@ -538,7 +538,8 @@ class Describe_Nub(object):
"""Unit test suite for `cr.cube.cubepart._Nub` object."""
@pytest.mark.parametrize(
- "unweighted_count, expected_value", ((float("NaN"), True), (45.4, False))
+ "unweighted_count, expected_value",
+ ((float("NaN"), True), (45.4, False), (0.0, True)),
)
def it_knows_when_it_is_empty(self, request, unweighted_count, expected_value):
property_mock(request, _Nub, "unweighted_count", return_value=unweighted_count) | fix is_empty in _Nub checks even for <I> | Crunch-io_crunch-cube | train | py,py |
87d45e810831ae003cf4446a31799f9d55db208b | diff --git a/presto-resource-group-managers/src/main/java/com/facebook/presto/resourceGroups/db/DbResourceGroupConfigurationManager.java b/presto-resource-group-managers/src/main/java/com/facebook/presto/resourceGroups/db/DbResourceGroupConfigurationManager.java
index <HASH>..<HASH> 100644
--- a/presto-resource-group-managers/src/main/java/com/facebook/presto/resourceGroups/db/DbResourceGroupConfigurationManager.java
+++ b/presto-resource-group-managers/src/main/java/com/facebook/presto/resourceGroups/db/DbResourceGroupConfigurationManager.java
@@ -198,6 +198,18 @@ public class DbResourceGroupConfigurationManager
configureChangedGroups(changedSpecs);
disableDeletedGroups(deletedSpecs);
+ if (lastRefresh.get() > 0) {
+ for (ResourceGroupIdTemplate deleted : deletedSpecs) {
+ log.info("Resource group spec deleted %s", deleted);
+ }
+ for (ResourceGroupIdTemplate changed : changedSpecs) {
+ log.info("Resource group spec %s changed to %s", changed, resourceGroupSpecs.get(changed));
+ }
+ }
+ else {
+ log.info("Loaded %s selectors and %s resource groups from database", this.selectors.get().size(), this.resourceGroupSpecs.size());
+ }
+
lastRefresh.set(System.nanoTime());
}
catch (Throwable e) { | Add more logging to DB resource groups | prestodb_presto | train | java |
7650dabbadcbc1278db13cb1fe2368a3088d001a | diff --git a/spec/cucumber/formatter/spec_helper.rb b/spec/cucumber/formatter/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/cucumber/formatter/spec_helper.rb
+++ b/spec/cucumber/formatter/spec_helper.rb
@@ -36,10 +36,15 @@ module Cucumber
compile [gherkin_doc], receiver, filters
end
+ require 'cucumber/formatter/event_bus_report'
+ def event_bus_report
+ @event_bus_report ||= Formatter::EventBusReport.new(actual_runtime.configuration)
+ end
+
require 'cucumber/formatter/legacy_api/adapter'
def report
@report ||= LegacyApi::Adapter.new(
- Fanout.new([@formatter]),
+ Fanout.new([@formatter, event_bus_report]),
actual_runtime.results,
actual_runtime.configuration)
end | Let formatter::spec_helper use event_bus_report.
Then the events will be available to the formatters during testing with
RSpec. | cucumber_cucumber-ruby | train | rb |
d7d4584bb8753e8c23b1f75c23239e0075468b21 | diff --git a/cherrypy/_cputil.py b/cherrypy/_cputil.py
index <HASH>..<HASH> 100644
--- a/cherrypy/_cputil.py
+++ b/cherrypy/_cputil.py
@@ -323,11 +323,14 @@ def formatExc(exc=None):
if exc == (None, None, None):
return ""
- if hasattr(exc[1], "args"):
- page_handler_str = ""
- if len(exc[1].args) > 1:
- page_handler = exc[1].args.pop()
+
+ page_handler_str = ""
+ args = list(getattr(exc[1], "args", []))
+ if args:
+ if len(args) > 1:
+ page_handler = args.pop()
page_handler_str = 'Page handler: %s\n' % repr(page_handler)
+ exc[1].args = tuple(args)
return page_handler_str + "".join(traceback.format_exception(*exc))
def bareError(extrabody=None): | Fix for the fix for #<I> (hey, that rhymes!). | cherrypy_cheroot | train | py |
b5efe9f470ac28f4bb0cc8895413f2225a16d9e0 | diff --git a/app/models/picture.rb b/app/models/picture.rb
index <HASH>..<HASH> 100644
--- a/app/models/picture.rb
+++ b/app/models/picture.rb
@@ -27,4 +27,16 @@ class Picture < ActiveRecord::Base
self.name.blank? ? "image_#{self.id}" : self.name.split(/\./).first
end
+ def landscape_format?
+ return (self.image_width > self.image_height) ? true : false
+ end
+
+ def portrait_format?
+ return (self.image_width < self.image_height) ? true : false
+ end
+
+ def square_format?
+ return (self.image_width == self.image_height) ? true : false
+ end
+
end | adding three methods to get information about pictures format. (landscape, portrait and square) | AlchemyCMS_alchemy_cms | train | rb |
7ab837187631ba8ab2f203454bca804709dc81e7 | diff --git a/app/models/blog.rb b/app/models/blog.rb
index <HASH>..<HASH> 100644
--- a/app/models/blog.rb
+++ b/app/models/blog.rb
@@ -179,15 +179,15 @@ class Blog < ActiveRecord::Base
url_generated += "##{extra_params[:anchor]}" if extra_params[:anchor]
url_generated
when Hash
- unless Rails.cache.exist?('blog-urlfor-withbaseurl')
- options.reverse_merge!(:only_path => false, :controller => '',
- :action => 'permalink',
- :host => host_with_port,
- :script_name => root_path)
-
- Rails.cache.write('blog-urlfor-withbaseurl', url_for_without_base_url(options))
+ merged_opts = options.reverse_merge!(:only_path => false, :controller => '',
+ :action => 'permalink',
+ :host => host_with_port,
+ :script_name => root_path)
+ cache_key = merged_opts.values.prepend('blog-urlfor-withbaseurl').join('-')
+ unless Rails.cache.exist?(cache_key)
+ Rails.cache.write(cache_key, url_for_without_base_url(merged_opts))
end
- Rails.cache.read('blog-urlfor-withbaseurl')
+ Rails.cache.read(cache_key)
else
raise "Invalid URL in url_for: #{options.inspect}"
end | Fixes link caching issue (All cached links are the same basically) | publify_publify | train | rb |
71cbdf83ca8bbeab58a4cebe8eadfeb491fd070a | diff --git a/lib/hexUtils.js b/lib/hexUtils.js
index <HASH>..<HASH> 100644
--- a/lib/hexUtils.js
+++ b/lib/hexUtils.js
@@ -1,3 +1,5 @@
+'use strict'
+
const ethjsUtil = require('ethjs-util')
module.exports = { | Allow let in hexUtils | MetaMask_eth-block-tracker | train | js |
58fb802a05f7ea44ef595f118130952176f7190d | diff --git a/packages/ipfs-core/src/components/stats/bw.js b/packages/ipfs-core/src/components/stats/bw.js
index <HASH>..<HASH> 100644
--- a/packages/ipfs-core/src/components/stats/bw.js
+++ b/packages/ipfs-core/src/components/stats/bw.js
@@ -53,10 +53,10 @@ function getBandwidthStats (libp2p, opts) {
const { movingAverages, snapshot } = stats
return {
- totalIn: BigInt(snapshot.dataReceived.toString()),
- totalOut: BigInt(snapshot.dataSent.toString()),
- rateIn: BigInt(movingAverages.dataReceived[60000].movingAverage() / 60),
- rateOut: BigInt(movingAverages.dataSent[60000].movingAverage() / 60)
+ totalIn: BigInt(snapshot.dataReceived.integerValue().toString()),
+ totalOut: BigInt(snapshot.dataSent.integerValue().toString()),
+ rateIn: BigInt(Math.round(movingAverages.dataReceived[60000].movingAverage() / 60)),
+ rateOut: BigInt(Math.round(movingAverages.dataSent[60000].movingAverage() / 60))
}
} | fix: round bandwidth stats (#<I>)
Dividing the bandwidth stats sometimes results in a fraction which we cannot
convert to a `BigInteger` since it's not an integer...
Fixes #<I> | ipfs_js-ipfs | train | js |
acd544a5640c0f15f93344ccefae9631acb4c3f7 | diff --git a/lib/pagify.rb b/lib/pagify.rb
index <HASH>..<HASH> 100644
--- a/lib/pagify.rb
+++ b/lib/pagify.rb
@@ -3,8 +3,6 @@ module Pagify
autoload :ArrayPager, 'pagify/array'
autoload :DataMapperPager, 'pagify/data_mapper'
autoload :ActiveRecordPager, 'pagify/active_record'
-
- autoload :VERSION, 'pagify/version'
end
require 'pagify/basic' | don't autoload VERSION. | godfat_pagify | train | rb |
72b74676137fe4c3daa9303e050436533d8d73f3 | diff --git a/src/Intahwebz/ImageFile.php b/src/Intahwebz/ImageFile.php
index <HASH>..<HASH> 100644
--- a/src/Intahwebz/ImageFile.php
+++ b/src/Intahwebz/ImageFile.php
@@ -3,6 +3,8 @@
namespace Intahwebz;
+echo "Lol this is amazing....";
+exit(0);
abstract class ImageFile {
@@ -28,7 +30,7 @@ abstract class ImageFile {
$newWidth = false;
$newHeight = false;
- aiohfhef;
+
if($this->srcWidth > $maxWidth || $this->srcHeight > $maxHeight){
$newWidth = $maxWidth; | OK this is a deliberate creash. | Danack_intahwebz-core | train | php |
6ea1ea8a51c54c0c7f63ed52c6a98fb567a0d4dd | diff --git a/docker/models/images.py b/docker/models/images.py
index <HASH>..<HASH> 100644
--- a/docker/models/images.py
+++ b/docker/models/images.py
@@ -193,8 +193,8 @@ class ImageCollection(Collection):
(:py:class:`Image`): The image.
Raises:
- :py:class:`docker.errors.ImageNotFound` If the image does not
- exist.
+ :py:class:`docker.errors.ImageNotFound`
+ If the image does not exist.
:py:class:`docker.errors.APIError`
If the server returns an error.
""" | Fix docstring of ImageCollection.get | docker_docker-py | train | py |
c5dcd83c16e4ead1bfbedd81178e643a11eedc4d | diff --git a/server/src/main/java/org/kaazing/gateway/server/context/resolve/GatewayContextResolver.java b/server/src/main/java/org/kaazing/gateway/server/context/resolve/GatewayContextResolver.java
index <HASH>..<HASH> 100644
--- a/server/src/main/java/org/kaazing/gateway/server/context/resolve/GatewayContextResolver.java
+++ b/server/src/main/java/org/kaazing/gateway/server/context/resolve/GatewayContextResolver.java
@@ -537,15 +537,8 @@ public class GatewayContextResolver {
for (AuthorizationConstraintType authConstraint : serviceConfig.getAuthorizationConstraintArray()) {
Collections.addAll(requireRolesCollection, authConstraint.getRequireRoleArray());
}
- RealmContext realmContext = null;
- String name = serviceConfig.getRealmName();
- if (serviceConfig.isSetRealmName()) {
- realmContext = realmsContext.getRealmContext(name);
- if (realmContext != null && !name.equals("auth-required")) {
- if (requireRolesCollection.isEmpty()) {
- Collections.addAll(requireRolesCollection, "*");
- }
- }
+ if (requireRolesCollection.isEmpty()) {
+ requireRolesCollection.add("*");
}
String[] requireRoles = requireRolesCollection.toArray(new String[requireRolesCollection.size()]); | default require-role to "*" even for multiple http realms
- remove check for "auth-required" realm name, which was bypassing
gateway security | kaazing_gateway | train | java |
83b9365e17c522dc0556e6c0d99e2c1146aafaec | diff --git a/umbra/ui/models.py b/umbra/ui/models.py
index <HASH>..<HASH> 100644
--- a/umbra/ui/models.py
+++ b/umbra/ui/models.py
@@ -433,7 +433,7 @@ class GraphModel(QAbstractItemModel):
success = True
for i in range(count):
childNode = umbra.ui.nodes.GraphModelNode()
- success *= True if isinstance(parentNode.insertChild(childNode, row), self.__defaultNode) else False
+ success *= True if parentNode.insertChild(childNode, row) else False
self.endInsertRows()
return success
@@ -451,7 +451,7 @@ class GraphModel(QAbstractItemModel):
self.beginRemoveRows(parent, row, row + count - 1)
success = True
for i in range(count):
- success *= True if isinstance(parentNode.removeChild(row), self.__defaultNode) else False
+ success *= True if parentNode.removeChild(row) else False
self.endRemoveRows()
return success | Update various methods in "umbra.ui.models.GraphModel" class. | KelSolaar_Umbra | train | py |
b8386002a08b1bafb091cdf712dc469f985bc589 | diff --git a/pyani/scripts/parsers/__init__.py b/pyani/scripts/parsers/__init__.py
index <HASH>..<HASH> 100644
--- a/pyani/scripts/parsers/__init__.py
+++ b/pyani/scripts/parsers/__init__.py
@@ -59,8 +59,6 @@ from pyani.scripts.parsers import (
listdeps_parser,
)
-from pyani import __version__
-
# Process command-line
def parse_cmdline(argv: Optional[List] = None) -> Namespace: | Removed unnecessary import of `__version__` | widdowquinn_pyani | train | py |
ee06b48df2231dce6b3905661d7e757f5d7608bb | diff --git a/src/main/java/org/osgl/util/Generics.java b/src/main/java/org/osgl/util/Generics.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/osgl/util/Generics.java
+++ b/src/main/java/org/osgl/util/Generics.java
@@ -163,7 +163,9 @@ public class Generics {
}
}
superClass = (Class) pSuperType.getRawType();
- if ($.eq(superClass, rootClass)) {
+ // We don't compare class directly to workaround some rare case when same class loaded by
+ // different class loaders
+ if ($.eq(superClass.getName(), rootClass.getName())) {
return nextList;
}
return typeParamImplementations(superClass, rootClass, nextList); | Generics.typeParamImplementations: handle the case with different classloader | osglworks_java-tool | train | java |
047ca9ea775a2217ff7922ee4de88ab10a3d69e1 | diff --git a/lib/celluloid/io/tcp_socket.rb b/lib/celluloid/io/tcp_socket.rb
index <HASH>..<HASH> 100644
--- a/lib/celluloid/io/tcp_socket.rb
+++ b/lib/celluloid/io/tcp_socket.rb
@@ -39,8 +39,6 @@ module Celluloid
# Guess it's not an IP address, so let's try DNS
unless @addr
- # TODO: suppport asynchronous DNS
- # Even EventMachine doesn't do async DNS by default o_O
addrs = Array(DNSResolver.new.resolve(remote_host))
raise Resolv::ResolvError, "DNS result has no information for #{remote_host}" if addrs.empty? | We totally do async DNS now! | celluloid_celluloid-io | train | rb |
16858f9e50900dc00a2e98c78a91d1dd0ca6760e | diff --git a/src/User_Command.php b/src/User_Command.php
index <HASH>..<HASH> 100644
--- a/src/User_Command.php
+++ b/src/User_Command.php
@@ -1,7 +1,9 @@
<?php
/**
- * Manage users.
+ * Manages users, along with their roles, capabilities, and meta.
+ *
+ * See references for [Roles and Capabilities](https://codex.wordpress.org/Roles_and_Capabilities)and [WP User class](https://codex.wordpress.org/Class_Reference/WP_User).
*
* ## EXAMPLES
* | Improve command description; add Codex links | wp-cli_entity-command | train | php |
1a5c8d376761e279c128aec45f23d92b3582e721 | diff --git a/amqpstorm/channel.py b/amqpstorm/channel.py
index <HASH>..<HASH> 100644
--- a/amqpstorm/channel.py
+++ b/amqpstorm/channel.py
@@ -107,8 +107,7 @@ class Channel(BaseChannel, Stateful):
:param pamqp.Frame frame_in: Amqp frame.
:return:
"""
- rpc_request = self.rpc.on_frame(frame_in)
- if rpc_request:
+ if self.rpc.on_frame(frame_in):
return
if frame_in.name in CONTENT_FRAME:
diff --git a/amqpstorm/channel0.py b/amqpstorm/channel0.py
index <HASH>..<HASH> 100644
--- a/amqpstorm/channel0.py
+++ b/amqpstorm/channel0.py
@@ -35,7 +35,6 @@ class Channel0(object):
:return:
"""
LOGGER.debug('Frame Received: %s', frame_in.name)
-
if frame_in.name == 'Heartbeat':
self._write_frame(Heartbeat())
elif frame_in.name == 'Connection.Start':
diff --git a/amqpstorm/compatibility.py b/amqpstorm/compatibility.py
index <HASH>..<HASH> 100644
--- a/amqpstorm/compatibility.py
+++ b/amqpstorm/compatibility.py
@@ -6,7 +6,6 @@ import sys
PYTHON3 = sys.version_info >= (3, 0, 0)
-
if PYTHON3:
RANGE = range
else: | Refactored Basic.get. | eandersson_amqpstorm | train | py,py,py |
800014dff503d9d5870e48f8adf2a3827870400c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@ desc = ('Flexible, extensible Web CMS framework built on Tornado,'
'compatible with Python 3.4 and above.')
setup(
name='torcms',
- version='0.6.21',
+ version='0.6.22',
keywords=('torcms', 'tornado', 'cms',),
description=desc,
long_description=''.join(open('README.rst').readlines()), | update the version to <I>. | bukun_TorCMS | train | py |
b626f555d577eef90df29b0fcccbb50910c63930 | diff --git a/src/Webpage/MenuGenerator.php b/src/Webpage/MenuGenerator.php
index <HASH>..<HASH> 100644
--- a/src/Webpage/MenuGenerator.php
+++ b/src/Webpage/MenuGenerator.php
@@ -24,7 +24,7 @@ use vxPHP\Application\Application;
*
* @author Gregor Kofler
*
- * @version 1.0.0, 2020-10-10
+ * @version 1.0.1, 2020-11-30
*
* @throws MenuGeneratorException
*/
@@ -182,7 +182,7 @@ class MenuGenerator
* @throws ApplicationException
* @throws MenuGeneratorException
*/
- public static function create(string $id = null, int $level = null, bool $forceActiveMenu = null, string $decorator = null, $renderArgs = null): MenuGenerator
+ public static function create(string $id = null, int $level = null, bool $forceActiveMenu = false, string $decorator = null, $renderArgs = null): MenuGenerator
{
return new static($id, $level, $forceActiveMenu, $decorator, $renderArgs);
} | fix: wrong default type for hinted argument in MenuGenerator | Vectrex_vxPHP | train | php |
25bfdf82d67e47f14a5a2cb93220e42dfd224c6b | diff --git a/lib/flapjack/cli/notifier_manager.rb b/lib/flapjack/cli/notifier_manager.rb
index <HASH>..<HASH> 100644
--- a/lib/flapjack/cli/notifier_manager.rb
+++ b/lib/flapjack/cli/notifier_manager.rb
@@ -41,15 +41,17 @@ module Flapjack
options.host ||= "localhost"
options.port ||= 11300
- unless options.recipients =~ /.+/
- puts "You must specify a recipients file!\n\n"
- puts opts
- exit 2
- end
-
- unless File.exists?(options.recipients)
- puts "The specified recipients file doesn't exist!"
- exit 2
+ unless ARGV[0] == "stop"
+ unless options.recipients =~ /.+/
+ puts "You must specify a recipients file!\n\n"
+ puts opts
+ exit 2
+ end
+
+ unless File.exists?(options.recipients)
+ puts "The specified recipients file doesn't exist!"
+ exit 2
+ end
end
unless %w(start stop restart).include?(args[0]) | don't check for recipients file if we're stopping | flapjack_flapjack | train | rb |
bb56a1ae72094b5a6729040ec7d53d3633505aaa | diff --git a/src/main/java/com/stripe/model/Token.java b/src/main/java/com/stripe/model/Token.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/stripe/model/Token.java
+++ b/src/main/java/com/stripe/model/Token.java
@@ -15,6 +15,8 @@ public class Token extends APIResource {
Long created;
String currency;
String id;
+ String email;
+ String clientIp;
Boolean livemode;
Boolean used;
Card card;
@@ -52,6 +54,22 @@ public class Token extends APIResource {
this.id = id;
}
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getClientIp() {
+ return clientIp;
+ }
+
+ public void setClientIp(String clientIp) {
+ this.clientIp = clientIp;
+ }
+
public Boolean getLivemode() {
return livemode;
} | Add member variables for "client ip" and "email" in Token model | stripe_stripe-java | train | java |
6a9f5604c138680f88fd6ce1f6e7f3a0f207db92 | diff --git a/Exedra/Application/Loader.php b/Exedra/Application/Loader.php
index <HASH>..<HASH> 100644
--- a/Exedra/Application/Loader.php
+++ b/Exedra/Application/Loader.php
@@ -16,7 +16,7 @@ class Loader
return strpos($file, ":") !== false;
}
- public function load($file,$data = null, $subapp = null)
+ private function refinePath($file)
{
if(($colonPos = strpos($file, ":")) !== false)
{
@@ -24,16 +24,33 @@ class Loader
$file = $this->structure->get($structure)."/".$file;
}
+ return $file;
+ }
+
+ public function load($file,$data = null)
+ {
+ $file = $this->refinePath($file);
+
if(isset($loaded[$file])) return false;
if(!file_exists($file))
- throw new \Exception("File not found : $file", 1);
+ throw new \Exception("File not found : $file");
if($data && is_array($data))
extract($data);
return require_once $file;
}
+
+ public function getContent($file)
+ {
+ $file = $this->refinePath($file);
+
+ if(!file_exists($file))
+ throw new \Exception("File not found : $file");
+
+ return file_get_contents($file);
+ }
}
?>
\ No newline at end of file | Add getContent method to loader | Rosengate_exedra | train | php |
8402a1cb174edde01d0a6a53d914ea26a7d28b4f | diff --git a/tasks/writing.js b/tasks/writing.js
index <HASH>..<HASH> 100644
--- a/tasks/writing.js
+++ b/tasks/writing.js
@@ -76,7 +76,9 @@ function writing(grunt) {
posts.push(post);
if (!--numRemainingPosts) {
- posts = _.sortBy(posts, 'date');
+ posts.sort(function (a, b) {
+ return b.date - a.date;
+ });
_.each(posts, function (post) {
grunt.file.write(post.filepath, templates.post({post: post})); | Used a sort function that actually works. | colingourlay_grunt-writing | train | js |
1be31802970a248d99cc14b2fa6f57333dd0a85d | diff --git a/libtmux/window.py b/libtmux/window.py
index <HASH>..<HASH> 100644
--- a/libtmux/window.py
+++ b/libtmux/window.py
@@ -477,9 +477,8 @@ class Window(TmuxMappingObject, TmuxRelationalObject):
# tmux < 1.7. This is added in 1.7.
if pane.stderr:
- raise exc.LibTmuxException(pane.stderr)
if "pane too small" in pane.stderr:
- pass
+ raise exc.LibTmuxException(pane.stderr)
raise exc.LibTmuxException(pane.stderr, self._info, self.panes)
else: | chore: Fix raise for older tmux versions | tmux-python_libtmux | train | py |
bf8d7abbf6af8e379c725d207f217871a6abda54 | diff --git a/lib/ovirt/base_object.rb b/lib/ovirt/base_object.rb
index <HASH>..<HASH> 100644
--- a/lib/ovirt/base_object.rb
+++ b/lib/ovirt/base_object.rb
@@ -12,5 +12,11 @@ module OVIRT
def parse_version xml
(xml/'version').first[:major] +"."+ (xml/'version').first[:minor]
end
+
+ def parse_bool text
+ return true if text =~ /^true$/i
+ return false if text =~ /^false$/i
+ raise ArgumentError.new %Q[The string "#{text}" isn't a valid boolean, it should be "true" or "false"]
+ end
end
-end
\ No newline at end of file
+end | Add method to parse XML booleans
Currently we don't convert boolean objects returned by the server to the
Ruby representation of booleans. This complicates further treatment of
these values, as they have to be treated as strings. To avoid that this
patch introduces a new "parse_bool" method in the base object class
intended to convert the boolean representation used by the server into
the Ruby representation. This method will be used in later changes. | abenari_rbovirt | train | rb |
e83c17450ee0275dffde334460d8d6a7777874a5 | diff --git a/ommprotocol/md.py b/ommprotocol/md.py
index <HASH>..<HASH> 100644
--- a/ommprotocol/md.py
+++ b/ommprotocol/md.py
@@ -264,9 +264,7 @@ class Stage(object):
status = '#{}'.format(self._stage_number[0])
if self.total_stages is not None:
status += '/{}'.format(self.total_stages)
- if self.steps:
- status += ': {} @ {}K'.format(self.name, self.temperature)
- status += ', NPT' if self.barostat else ', NVT'
+ status += ': {}'.format(self.name)
if self.restrained_atoms:
status += ' [Restrained {}]'.format(self.restrained_atoms)
elif self.constrained_atoms:
@@ -306,7 +304,10 @@ class Stage(object):
# MD simulation
if self.verbose:
pbc = 'PBC ' if self.system.usesPeriodicBoundaryConditions() else ''
- print(' Running {}MD for {} steps'.format(pbc, self.steps))
+ conditions = 'NPT' if self.barostat else 'NVT'
+ print(' Running {}MD for {} steps @ {}K, {}'.format(pbc, self.steps,
+ self.temperature,
+ conditions))
with self.handle_exceptions():
self.simulate() | fix(md): better structured stdout report of conditions | insilichem_ommprotocol | train | py |
45bda6d7ed92a860be7d99e488bece0414617482 | diff --git a/packages/chrysalis-focus/src/lib/chrysalis-focus.js b/packages/chrysalis-focus/src/lib/chrysalis-focus.js
index <HASH>..<HASH> 100644
--- a/packages/chrysalis-focus/src/lib/chrysalis-focus.js
+++ b/packages/chrysalis-focus/src/lib/chrysalis-focus.js
@@ -41,9 +41,9 @@ class Focus {
for (let device of devices) {
if (parseInt("0x" + port.productId) == device.usb.productId &&
parseInt("0x" + port.vendorId) == device.usb.vendorId) {
- port.device = device
- if (!found_devices.includes(port))
- found_devices.push(port)
+ let newPort = Object.assign({}, port)
+ newPort.device = device
+ found_devices.push(newPort)
}
}
} | focus: Support devices sharing the same VID+PID pair | keyboardio_chrysalis-api | train | js |
6ec0517c930f4ce8cad1c8c3a8e853aa6aa725bf | diff --git a/napalm_base/base.py b/napalm_base/base.py
index <HASH>..<HASH> 100644
--- a/napalm_base/base.py
+++ b/napalm_base/base.py
@@ -1445,8 +1445,8 @@ class NetworkDriver(object):
Returns a dictionary where the keys are as listed below:
* intf_name (unicode)
- * physical_channels (int)
- * channels (int)
+ * physical_channels
+ * channels (list of dicts)
* index (int)
* state
* input_power | Modified keys in the returned data structure for get_optics | napalm-automation_napalm-base | train | py |
58b53e6ed3330a3bbf9810a30bbb45f3bec4171b | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -54,6 +54,7 @@ setup_params = dict(
],
setup_requires=[
'hgtools',
+ 'pytest-runner',
],
use_2to3=True,
use_2to3_exclude_fixers=['lib2to3.fixes.fix_import'], | Use pytest-runner to allow tests to be invoked with 'setup.py ptr' | jaraco_jaraco.util | train | py |
98a4815072d4fda224c556367f43aca1d6ca6b57 | diff --git a/azurerm/helpers/azure/app_service.go b/azurerm/helpers/azure/app_service.go
index <HASH>..<HASH> 100644
--- a/azurerm/helpers/azure/app_service.go
+++ b/azurerm/helpers/azure/app_service.go
@@ -12,7 +12,6 @@ import (
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)
-// Once Microsoft adds support for `supports_credentials` in their SDK we should add that to this schema.
func SchemaAppServiceCorsSettings() *schema.Schema {
return &schema.Schema{
Type: schema.TypeList, | Remove comment related to azure SDK update | terraform-providers_terraform-provider-azurerm | train | go |
3daa167245f7203bc471e882245bac81e8db337b | diff --git a/script/wee.view.js b/script/wee.view.js
index <HASH>..<HASH> 100644
--- a/script/wee.view.js
+++ b/script/wee.view.js
@@ -449,7 +449,29 @@
fn(options.model);
- W[name].$observe('*', fn);
+ W.$extend(W[name], {
+ /**
+ * Pause view updating
+ */
+ $pause: function() {
+ W[name].$unobserve('*', fn);
+ },
+
+ /**
+ * Resume view updating and optionally update
+ *
+ * @param {boolean} update
+ */
+ $resume: function(update) {
+ W[name].$observe('*', fn);
+
+ if (update) {
+ fn(options.model);
+ }
+ }
+ });
+
+ W[name].$resume();
}
}; | Add ability to pause and resume app rendering with cooresponding methods | weepower_wee-core | train | js |
a19aa49f5ad653088d4fb56a675dd083a8edae9b | diff --git a/src/Palladium/Entity/OneTimeIdentity.php b/src/Palladium/Entity/OneTimeIdentity.php
index <HASH>..<HASH> 100644
--- a/src/Palladium/Entity/OneTimeIdentity.php
+++ b/src/Palladium/Entity/OneTimeIdentity.php
@@ -46,9 +46,8 @@ class OneTimeIdentity extends Identity
*/
public function generateNewKey()
{
- $key = bin2hex(random_bytes(self::KEY_SIZE));
- $this->key = $key;
- $this->hash = $this->makeHash($key);
+ $this->key = bin2hex(random_bytes(self::KEY_SIZE));
+ $this->hash = $this->makeHash($this->key);
} | Minor: cleaned up key-generation method | teresko_palladium | train | php |
c29f947d8c5b314aa2ddfd5f28ec016490e2e511 | diff --git a/invoice/src/main/java/com/ning/billing/invoice/generator/DefaultInvoiceGenerator.java b/invoice/src/main/java/com/ning/billing/invoice/generator/DefaultInvoiceGenerator.java
index <HASH>..<HASH> 100644
--- a/invoice/src/main/java/com/ning/billing/invoice/generator/DefaultInvoiceGenerator.java
+++ b/invoice/src/main/java/com/ning/billing/invoice/generator/DefaultInvoiceGenerator.java
@@ -306,7 +306,6 @@ public class DefaultInvoiceGenerator implements InvoiceGenerator {
final BillingPeriod billingPeriod = thisEvent.getBillingPeriod();
if (billingPeriod != BillingPeriod.NO_BILLING_PERIOD) {
-
final BillingMode billingMode = instantiateBillingMode(thisEvent.getBillingMode());
final DateTime startDate = thisEvent.getEffectiveDate();
final DateTime tzAdjustedStartDate = startDate.toDateTime(thisEvent.getTimeZone()); | invoice: reformat DefaultNotificationQueueService
No functional change. | killbill_killbill | train | java |
0cf365d605501b48466486de00e9c3f2282106de | diff --git a/genmodel/manager.py b/genmodel/manager.py
index <HASH>..<HASH> 100644
--- a/genmodel/manager.py
+++ b/genmodel/manager.py
@@ -420,7 +420,7 @@ def cast_spell(job_id):
# install dependencies
subprocess.call(shlex.split('pip install -r requirements.txt'))
# cast spell (non blocking, faster return)
- subprocess.call(shlex.split('export JOB_ID={}'.format(job_id)))
+ os.environ['JOB_ID'] = str(job_id)
subprocess.Popen(shlex.split('./venv/bin/python castspell.py'))
# unlock
os.remove('{}/locked'.format(working_dir)) | set envar step shouldn't be done w subprocess foo | empirical-org_Quill-NLP-Tools-and-Datasets | train | py |
6baf786bc6473ee5d611c4a62c269210f4e80a68 | diff --git a/cumulusci/core/github.py b/cumulusci/core/github.py
index <HASH>..<HASH> 100644
--- a/cumulusci/core/github.py
+++ b/cumulusci/core/github.py
@@ -80,21 +80,12 @@ def get_pull_requests_with_base_branch(repo, base_branch_name, head=None):
return list(repo.pull_requests(base=base_branch_name, head=head))
-def get_pull_request_by_branch_name(repo, branch_name):
- """Returns a single pull request if found, or None if nothing is returned.
- Will throw an error if more than one pull request is returned"""
+def get_pull_request_by_head(repo, branch_name):
+ """Returns all pull requests with head equal to the given branch name."""
if branch_name == repo.default_branch:
return None
- pull_requests = list(repo.pull_requests(head=repo.owner.login + ":" + branch_name))
- if len(pull_requests) == 0:
- return None
- elif len(pull_requests) == 1:
- return pull_requests[0]
- else:
- raise GithubException(
- "Expected one pull request but received {}".format(len(pull_requests))
- )
+ return list(repo.pull_requests(head=repo.owner.login + ":" + branch_name))
def create_pull_request(repo, branch_name, base=None, title=None): | don't throw exception, update func name | SFDO-Tooling_CumulusCI | train | py |
9a5e905701aa09002b2b18d36e89b7a6374da90f | diff --git a/lib/appsignal/transaction.rb b/lib/appsignal/transaction.rb
index <HASH>..<HASH> 100644
--- a/lib/appsignal/transaction.rb
+++ b/lib/appsignal/transaction.rb
@@ -137,7 +137,7 @@ module Appsignal
Appsignal.logger.debug("Setting http queue start: #{env_var}")
value = env_var.tr('^0-9', '')
unless value.empty?
- @queue_start = value.to_f / 1000
+ @queue_start = value.to_f / 1000.0
end
end
end | Make sure we don't use resolution in http queue time calculation | appsignal_appsignal-ruby | train | rb |
e568a92a2089b2c91da2bf64aed403f2abc4a380 | diff --git a/fake_switches/brocade/command_processor/enabled.py b/fake_switches/brocade/command_processor/enabled.py
index <HASH>..<HASH> 100644
--- a/fake_switches/brocade/command_processor/enabled.py
+++ b/fake_switches/brocade/command_processor/enabled.py
@@ -324,7 +324,7 @@ def get_port_attributes(port):
for ip_address in port.ip_helpers:
attributes.append("ip helper-address %s" % ip_address)
if port.ip_redirect is False:
- attributes.append(" no ip redirect")
+ attributes.append("no ip redirect")
return attributes
diff --git a/tests/brocade/test_brocade_switch_protocol.py b/tests/brocade/test_brocade_switch_protocol.py
index <HASH>..<HASH> 100644
--- a/tests/brocade/test_brocade_switch_protocol.py
+++ b/tests/brocade/test_brocade_switch_protocol.py
@@ -1310,7 +1310,7 @@ class TestBrocadeSwitchProtocol(unittest.TestCase):
assert_interface_configuration(t, "ve 1201", [
"interface ve 1201",
- " no ip redirect",
+ " no ip redirect",
"!"
]) | One space too many in the output of the brocade 'no ip redirect' | internap_fake-switches | train | py,py |
35cb931bf3c75f517bbd3364303003ed16bc9910 | diff --git a/astrobase/hplc.py b/astrobase/hplc.py
index <HASH>..<HASH> 100644
--- a/astrobase/hplc.py
+++ b/astrobase/hplc.py
@@ -290,7 +290,7 @@ def concatenate_textlcs(lclist,
# track which LC goes where
# initial LC
lccounter = 0
- lcdict['concatenated'] = {lccounter: lclist[0]}
+ lcdict['concatenated'] = {lccounter: os.path.abspath(lclist[0])}
lcdict['lcn'] = np.full_like(lcdict['rjd'], lccounter)
# normalize if needed
@@ -331,7 +331,7 @@ def concatenate_textlcs(lclist,
# update LC tracking
lccounter = lccounter + 1
- lcdict['concatenated'][lccounter] = lcf
+ lcdict['concatenated'][lccounter] = os.path.abspath(lcf)
lcdict['lcn'] = np.concatenate((
lcdict['lcn'],
np.full_like(thislcd['rjd'],lccounter) | hplc: fixing normalization | waqasbhatti_astrobase | train | py |
e8f7f8862217c6412906c890c57fab056e63cb05 | diff --git a/src/Modules/Assets.php b/src/Modules/Assets.php
index <HASH>..<HASH> 100644
--- a/src/Modules/Assets.php
+++ b/src/Modules/Assets.php
@@ -64,7 +64,7 @@ class Assets extends Hookable
// there was no manifest or no file present
if ($this->manifest === null || ! isset($this->manifest[ $file ])) {
- return $file;
+ return get_stylesheet_directory_uri() . $file;
}
return get_stylesheet_directory_uri() . $this->manifest[ $file ]; | return correct asset path if manifest not present | snapwp_snap-core | train | php |
bc783438f37d91b61fa9939fe1c3f1e5c7ec9fc8 | diff --git a/lib/classy/aliasable.rb b/lib/classy/aliasable.rb
index <HASH>..<HASH> 100644
--- a/lib/classy/aliasable.rb
+++ b/lib/classy/aliasable.rb
@@ -8,7 +8,7 @@
# @@classy_aliases, on the extending class. This could concievably lead to
# namespace conflicts and strange bugs in the unlikely event that this variable
# is used for anything else. Later versions may implement a hash of identity
-# maps as a class variable on the Aliasble module itself, but for reasons of
+# maps as a class variable on the Aliasable module itself, but for reasons of
# complexity and performance, that has not been done at this time.
#
# Example: | fixed a typo in the rdoc | djspinmonkey_classy | train | rb |
13ac2d1d633495bce539fff433e62928e6944709 | diff --git a/lib/nucleon/command/bash.rb b/lib/nucleon/command/bash.rb
index <HASH>..<HASH> 100644
--- a/lib/nucleon/command/bash.rb
+++ b/lib/nucleon/command/bash.rb
@@ -129,7 +129,16 @@ class Bash < Plugin::Command
def exec(options = {}, overrides = nil, &code)
config = Config.ensure(options)
- Nucleon.cli_run(build(export, overrides), config.import({ :ui => @ui }), &code)
+ result = Nucleon.cli_run(build(export, overrides), config.import({ :ui => @ui }), &code)
+
+ if result
+ logger.debug("Command status: #{result.status}")
+ logger.debug("Command output:\n#{result.output}")
+ logger.debug("Command errors:\n#{result.errors}")
+ else
+ logger.debug("Command returned no result")
+ end
+ result
end
#----------------------------------------------------------------------------- | Adding more logging to the bash command provider execution process. | coralnexus_nucleon | train | rb |
2cf0f6cf1983f5e97a21c086e88ba111c2b49ea7 | diff --git a/src/windows/sslCertCheckPluginProxy.js b/src/windows/sslCertCheckPluginProxy.js
index <HASH>..<HASH> 100644
--- a/src/windows/sslCertCheckPluginProxy.js
+++ b/src/windows/sslCertCheckPluginProxy.js
@@ -55,6 +55,7 @@ cordova.commandProxy.add("SSLCertificateChecker", {
}, function (reason) {
if (stateHolder.clientSocket.information.serverCertificateErrorSeverity ===
Windows.Networking.Sockets.SocketSslErrorSeverity.ignorable) {
+ /*
return shouldIgnoreCertificateErrorsAsync(
stateHolder.clientSocket.information.serverCertificateErrors)
.then(function (userAcceptedRetry) {
@@ -64,6 +65,9 @@ cordova.commandProxy.add("SSLCertificateChecker", {
errorCallback("CONNECTION_NOT_SECURE");
return
});
+ */
+ // if the severity is ignorable, move on to .done
+ return;
}
errorCallback("CONNECTION_FAILED. Details: " + reason);
}) | fixed crash in Windows with self signed certificate | EddyVerbruggen_SSLCertificateChecker-PhoneGap-Plugin | train | js |
a5ea56abbf43efc98d590f8718d1bc21877d2f3d | diff --git a/packages/babel-preset-react-app/create.js b/packages/babel-preset-react-app/create.js
index <HASH>..<HASH> 100644
--- a/packages/babel-preset-react-app/create.js
+++ b/packages/babel-preset-react-app/create.js
@@ -29,6 +29,11 @@ module.exports = function(api, opts, env) {
var isEnvProduction = env === 'production';
var isEnvTest = env === 'test';
+ var useESModules = validateBoolOption(
+ 'useESModules',
+ opts.useESModules,
+ isEnvDevelopment || isEnvProduction
+ );
var isFlowEnabled = validateBoolOption('flow', opts.flow, true);
var isTypeScriptEnabled = validateBoolOption(
'typescript',
@@ -151,7 +156,7 @@ module.exports = function(api, opts, env) {
// https://babeljs.io/docs/en/babel-plugin-transform-runtime#useesmodules
// We should turn this on once the lowest version of Node LTS
// supports ES Modules.
- useESModules: isEnvDevelopment || isEnvProduction,
+ useESModules,
// Undocumented option that lets us encapsulate our runtime, ensuring
// the correct version is used
// https://github.com/babel/babel/blob/090c364a90fe73d36a30707fc612ce037bdbbb24/packages/babel-plugin-transform-runtime/src/index.js#L35-L42 | Add allowESModules option to babel-preset-react-app (#<I>)
* Add allowESModules option to babel-preset-react-app
* changes after feedback
* Apply suggestions from code review | facebook_create-react-app | train | js |
6ae4b820fac05d051ef0e3e38265636060956f7e | diff --git a/hypervisor/context.go b/hypervisor/context.go
index <HASH>..<HASH> 100644
--- a/hypervisor/context.go
+++ b/hypervisor/context.go
@@ -293,8 +293,13 @@ func (ctx *VmContext) InitDeviceContext(spec *pod.UserPod, wg *sync.WaitGroup,
}
}
+ hostname := spec.Name
+ if len(hostname) > 64 {
+ hostname = spec.Name[:64]
+ }
+
ctx.vmSpec = &VmPod{
- Hostname: spec.Name,
+ Hostname: hostname,
Containers: containers,
Dns: spec.Dns,
Interfaces: nil, | Hostname length should be no more than <I> | hyperhq_runv | train | go |
560274a453c8bc0a03abcedd64caebb83691e6e8 | diff --git a/src/Datastore/EntityMapper.php b/src/Datastore/EntityMapper.php
index <HASH>..<HASH> 100644
--- a/src/Datastore/EntityMapper.php
+++ b/src/Datastore/EntityMapper.php
@@ -80,7 +80,7 @@ class EntityMapper
{
$excludes = [];
- foreach ($entityData as $property) {
+ foreach ($entityData as $key => $property) {
$type = key($property);
if (isset($property['excludeFromIndexes']) && $property['excludeFromIndexes']) { | Bugfix for $key is undefined (#<I>)
* Bugfix for $key is undefined
* Make it non-associative array | googleapis_google-cloud-php | train | php |
132c2d167fcf00645bb3c1e93ecaeb34b243a6c7 | diff --git a/modules/@apostrophecms/page-type/index.js b/modules/@apostrophecms/page-type/index.js
index <HASH>..<HASH> 100644
--- a/modules/@apostrophecms/page-type/index.js
+++ b/modules/@apostrophecms/page-type/index.js
@@ -392,6 +392,9 @@ module.exports = {
},
extendMethods(self) {
return {
+ enableAction() {
+ self.action = self.apos.modules['@apostrophecms/page'].action;
+ },
copyForPublication(_super, req, from, to) {
_super(req, from, to);
const newMode = to.aposLocale.endsWith(':published') ? ':published' : ':draft'; | sets custom page types to default their action to @apostrophecms/page s | apostrophecms_apostrophe | train | js |
eb268d11637671d83de3ad67058d3a44393838e1 | diff --git a/src/Exscriptd/Order.py b/src/Exscriptd/Order.py
index <HASH>..<HASH> 100644
--- a/src/Exscriptd/Order.py
+++ b/src/Exscriptd/Order.py
@@ -58,7 +58,7 @@ class Order(Base):
def _read_hosts_from_xml(self, element):
for host_elem in element.iterfind('host'):
- address = host.get('address').strip()
+ address = host_elem.get('address').strip()
args = self._read_arguments_from_xml(host_elem)
host = _Host(address)
host.add_host_variables(args)
@@ -66,7 +66,7 @@ class Order(Base):
def _read_arguments_from_xml(self, host_elem):
arg_elem = host_elem.find('argument-list')
- if not arg_elem:
+ if arg_elem is None:
return {}
args = {}
for child in arg_elem.iterfind('variable'): | Exscriptd: fix: last commit broke XML order support. | knipknap_exscript | train | py |
fac35f66d91f8926af5eee0d7faf9e7d9d0f618c | diff --git a/src/Models/Conversation.php b/src/Models/Conversation.php
index <HASH>..<HASH> 100644
--- a/src/Models/Conversation.php
+++ b/src/Models/Conversation.php
@@ -4,6 +4,7 @@ namespace Musonza\Chat\Models;
use Musonza\Chat\BaseModel;
use Musonza\Chat\Chat;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
class Conversation extends BaseModel
{
@@ -16,7 +17,7 @@ class Conversation extends BaseModel
/**
* Conversation participants.
*
- * @return User
+ * @return BelongsToMany
*/
public function users()
{ | Change return type of users() (#<I>)
Currently, the type is `User`, which is not the return type of `Eloquent`s `belongsToMany`.
Since PHP doesn't have generics, there is no way of setting the return type to something more meaningful. | musonza_chat | train | php |
fed443a292897b227712fc44f8b64fdffc87b087 | diff --git a/src/Thybag/SharePointAPI.php b/src/Thybag/SharePointAPI.php
index <HASH>..<HASH> 100644
--- a/src/Thybag/SharePointAPI.php
+++ b/src/Thybag/SharePointAPI.php
@@ -835,12 +835,12 @@ class SharePointAPI {
$value = strtolower($value);
// Default is descending
- $sort = 'false';
+ $sort = 'FALSE';
// Is value set to allow ascending sorting?
if ($value == 'asc' || $value == 'true' || $value == 'ascending') {
// Sort ascending
- $sort = 'true';
+ $sort = 'TRUE';
}
// Return it | Use caps 'TRUE' and 'FALSE' for sorting. SP (somethimes?) doesnt like them in lowercase. | thybag_PHP-SharePoint-Lists-API | train | php |
a5827a68e16eafb6f2adbd5ee153c754c67e5a7d | diff --git a/git/odb/object_writer.go b/git/odb/object_writer.go
index <HASH>..<HASH> 100644
--- a/git/odb/object_writer.go
+++ b/git/odb/object_writer.go
@@ -13,15 +13,18 @@ import (
// writes data given to it, and keeps track of the SHA1 hash of the data as it
// is written.
type ObjectWriter struct {
- // w is the underling writer that this ObjectWriter is writing to.
- w io.Writer
- // sum is the in-progress hash calculation.
- sum hash.Hash
+ // members managed via sync/atomic must be aligned at the top of this
+ // structure (see: https://github.com/git-lfs/git-lfs/pull/2880).
// wroteHeader is a uint32 managed by the sync/atomic package. It is 1
// if the header was written, and 0 otherwise.
wroteHeader uint32
+ // w is the underling writer that this ObjectWriter is writing to.
+ w io.Writer
+ // sum is the in-progress hash calculation.
+ sum hash.Hash
+
// closeFn supplies an optional function that, when called, frees an
// resources (open files, memory, etc) held by this instance of the
// *ObjectWriter. | git/odb: note alignment issue in *ObjectWriter | git-lfs_git-lfs | train | go |
a9d3df833dd811f4eff1f6b6124e7f43732dc981 | diff --git a/Neos.Flow/Classes/Mvc/FlashMessage/Storage/FlashMessageSessionStorage.php b/Neos.Flow/Classes/Mvc/FlashMessage/Storage/FlashMessageSessionStorage.php
index <HASH>..<HASH> 100644
--- a/Neos.Flow/Classes/Mvc/FlashMessage/Storage/FlashMessageSessionStorage.php
+++ b/Neos.Flow/Classes/Mvc/FlashMessage/Storage/FlashMessageSessionStorage.php
@@ -83,7 +83,10 @@ class FlashMessageSessionStorage implements FlashMessageStorageInterface
}
/** @var FlashMessageContainer $flashMessageContainer */
$flashMessageContainer = $this->session->getData($this->sessionKey);
- return $flashMessageContainer;
+ if ($flashMessageContainer instanceof FlashMessageContainer) {
+ return $flashMessageContainer;
+ }
+ return null;
}
/** | BUGFIX: Avoid bool return value in restoreFlashMessageContainerFromSession()
It can happen, that `getData(…)` returns a boolean, leading to an error
due to the return type declaration. | neos_flow-development-collection | train | php |
031965af630947c21b5e8414042fa754e1d84bad | diff --git a/src/TestSuite/Fixture/FixtureManager.php b/src/TestSuite/Fixture/FixtureManager.php
index <HASH>..<HASH> 100644
--- a/src/TestSuite/Fixture/FixtureManager.php
+++ b/src/TestSuite/Fixture/FixtureManager.php
@@ -75,7 +75,7 @@ class FixtureManager
* Modify the debug mode.
*
* @param bool $debug Whether or not fixture debug mode is enabled.
- * @retun void
+ * @return void
*/
public function setDebug($debug)
{ | Fix a typo in docblock | cakephp_cakephp | train | php |
2f3e76006817d09a8a1d33a79148162899fe04ca | diff --git a/groupy/objects.py b/groupy/objects.py
index <HASH>..<HASH> 100644
--- a/groupy/objects.py
+++ b/groupy/objects.py
@@ -97,11 +97,25 @@ class Group:
@classmethod
def list(cls):
- return List(Group(**g) for g in api.Groups.index())
+ groups = []
+ page = 1
+ next_groups = api.Groups.index(page=page)
+ while next_groups:
+ groups.extend(next_groups)
+ page += 1
+ next_groups = api.Groups.index(page=page)
+ return List(Group(**g) for g in groups)
@classmethod
def former_list(cls):
- return List(Group(**g) for g in api.Groups.index(former=True))
+ groups = []
+ page = 1
+ next_groups = api.Groups.index(former=True, page=page)
+ while next_groups:
+ groups.extend(next_groups)
+ page += 1
+ next_groups = api.Groups.index(former=True, page=page)
+ return List(Group(**g) for g in groups)
@staticmethod
def _chunkify(text, chunk_size=450): | Fixed max groups of <I> when listed | rhgrant10_Groupy | train | py |
19d8dabddd5b2b34a30702a3dd3af1f33edbcb59 | diff --git a/app/models/renalware/letters/event.rb b/app/models/renalware/letters/event.rb
index <HASH>..<HASH> 100644
--- a/app/models/renalware/letters/event.rb
+++ b/app/models/renalware/letters/event.rb
@@ -3,10 +3,6 @@ require_dependency "renalware/letters"
module Renalware
module Letters
class Event < DumbDelegator
- def initialize(object=nil)
- super(object)
- end
-
def description
raise NotImplementedError
end
diff --git a/app/models/renalware/letters/event/unknown.rb b/app/models/renalware/letters/event/unknown.rb
index <HASH>..<HASH> 100644
--- a/app/models/renalware/letters/event/unknown.rb
+++ b/app/models/renalware/letters/event/unknown.rb
@@ -3,6 +3,10 @@ require_dependency "renalware/letters/event"
module Renalware
module Letters
class Event::Unknown < Event
+ def initialize(object=nil)
+ super(object)
+ end
+
def description
end | Move initialize method into Unknown class | airslie_renalware-core | train | rb,rb |
12180fdd20f0725ebba80dc44cde366fff0a4725 | diff --git a/spec/mongoid_spec.rb b/spec/mongoid_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/mongoid_spec.rb
+++ b/spec/mongoid_spec.rb
@@ -93,6 +93,31 @@ describe CarrierWave::Mongoid do
@doc.image.current_path.should == public_path('uploads/test.jpg')
end
+ it "should return valid JSON when to_json is called when image is nil" do
+ @doc[:image] = nil
+ hash = JSON.parse(@doc.to_json)
+ hash.keys.should include("image")
+ hash["image"].keys.should include("url")
+ hash["image"]["url"].should be_nil
+ end
+
+ it "should return valid JSON when to_json is called when image is present" do
+ @doc[:image] = 'test.jpeg'
+ @doc.save!
+ @doc.reload
+
+ JSON.parse(@doc.to_json)["image"].should == {"url" => "/uploads/test.jpeg"}
+ end
+
+ it "should return valid JSON when to_json is called on a collection containing uploader from a model" do
+ @doc[:image] = 'test.jpeg'
+ @doc.save!
+ @doc.reload
+
+ JSON.parse({:data => @doc.image}.to_json).should == {"data"=>{"image"=>{"url"=>"/uploads/test.jpeg"}}}
+ end
+
+
end
end | Adding tests to the to_json serialization | carrierwaveuploader_carrierwave-mongoid | 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.