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 |
|---|---|---|---|---|---|
70d93c4a5ab6b765d2dd2c692e3e94697683f86e | diff --git a/public/js/omega.js b/public/js/omega.js
index <HASH>..<HASH> 100644
--- a/public/js/omega.js
+++ b/public/js/omega.js
@@ -200,9 +200,11 @@ var OmegaIssueTracker = {};
break;
case 'close':
case 'resolve':
- case 'resolved':
this.closeIssue(parseInt(rest, 10));
break;
+ case 'reopen':
+ this.updateIssue(parseInt(rest, 10), { closed: false });
+ break;
case 'unassign':
this.assignIssue(parseInt(rest, 10), 'nobody');
break;
@@ -213,6 +215,7 @@ var OmegaIssueTracker = {};
this.assignIssue(id, assignee);
break;
case 'edit':
+ case 'update':
// only allow editing the description
var id = parseInt(getArgument(rest, 1), 10);
var desc = getArgument(rest, 2); | Add ability to reopen issues. | wachunga_omega | train | js |
7a6c51bf2e0a926ffe2595f008c68c6b63db2ce7 | diff --git a/kafka/conn.py b/kafka/conn.py
index <HASH>..<HASH> 100644
--- a/kafka/conn.py
+++ b/kafka/conn.py
@@ -88,12 +88,13 @@ class BrokerConnection(local):
# instead we read directly from the socket fd buffer
# alternatively, we could read size bytes into a separate buffer
# and decode from that buffer (and verify buffer is empty afterwards)
- size = Int32.decode(self._read_fd)
- recv_correlation_id = Int32.decode(self._read_fd)
- assert correlation_id == recv_correlation_id
try:
+ size = Int32.decode(self._read_fd)
+ recv_correlation_id = Int32.decode(self._read_fd)
+ if correlation_id != recv_correlation_id:
+ raise RuntimeError('Correlation ids do not match!')
response = response_type.decode(self._read_fd)
- except socket.error as e:
+ except (RuntimeError, socket.error) as e:
log.exception("Error in BrokerConnection.recv()")
self.close()
return None | Add size and correlation id decoding to try/except block in BrokerConnection | dpkp_kafka-python | train | py |
407837eef8cd50a07384efdded9bb7b23a345e99 | diff --git a/lib/rack/schema/version.rb b/lib/rack/schema/version.rb
index <HASH>..<HASH> 100644
--- a/lib/rack/schema/version.rb
+++ b/lib/rack/schema/version.rb
@@ -1,5 +1,5 @@
module Rack
class Schema
- VERSION = "0.6.1"
+ VERSION = "0.7.0"
end
end | <I>: relaxed rack constraint, to "support" <I>.alpha | pd_rack-schema | train | rb |
79ba3dbb7f39ffccf5b6eb8d6b4f477becb15281 | diff --git a/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/TraceWebFilter.java b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/TraceWebFilter.java
index <HASH>..<HASH> 100644
--- a/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/TraceWebFilter.java
+++ b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/TraceWebFilter.java
@@ -20,7 +20,6 @@ import org.springframework.http.server.reactive.ServerHttpResponse;
import org.springframework.util.StringUtils;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.reactive.HandlerMapping;
-import org.springframework.web.reactive.resource.ResourceWebHandler;
import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.server.WebFilter;
import org.springframework.web.server.WebFilterChain; | More defensive approach with HandlerMethod | spring-cloud_spring-cloud-sleuth | train | java |
5032a4b0fd6c04ed40a1fd1d7ac6308cf8a5b986 | diff --git a/Ansible/Ansible.php b/Ansible/Ansible.php
index <HASH>..<HASH> 100644
--- a/Ansible/Ansible.php
+++ b/Ansible/Ansible.php
@@ -128,7 +128,7 @@ final class Ansible
{
// normally ansible is in /usr/local/bin/*
if ('' === $command) {
- if (true === shell_exec('which ' . $default)) {
+ if (!empty(shell_exec('which ' . $default))) {
$command = $default;
} else { // not testable without ansible installation
throw new CommandException('No ' . $default . ' executable present in PATH!'); | Fixing issue with Ansible::checkCommand() method that expects shell_exec() to return a boolean value from a which call. shell_exec() returns null if there is an error, so we can assume the command exists as long as the return value is not empty. | maschmann_php-ansible | train | php |
c9d529895e062f19b09810b9951fd7788ee494f1 | diff --git a/src/Encryption/Cryptography/sha256.php b/src/Encryption/Cryptography/sha256.php
index <HASH>..<HASH> 100644
--- a/src/Encryption/Cryptography/sha256.php
+++ b/src/Encryption/Cryptography/sha256.php
@@ -31,6 +31,9 @@ class sha256 extends Util
*/
private $x_sha256_record = array();
+ /**
+ * @var sha256 object
+ */
private static $instance;
/* --------------------------------------------------------------------------------*
@@ -78,7 +81,7 @@ class sha256 extends Util
return hash('sha256', $string);
}
- $instance = self::Singleton();
+ $instance = self::singleton();
if (is_array($string) || is_object($string)) {
$type = gettype($string);
$caller = next(debug_backtrace());
@@ -101,8 +104,8 @@ class sha256 extends Util
* Instance Application
* @var object
*/
- $instance = self::Singleton();
- $key = md5::hash($string);
+ $instance = self::singleton();
+ $key = md5($string);
if (isset($instance->sha1_record[$key])) {
return $instance->sha1_record[$key];
} | Update sha<I>.php | aufa_Encryption | train | php |
cef879f5e04df2f7f0cace2435705f7df5f3a134 | diff --git a/liquibase-integration-tests/src/test/java/liquibase/dbtest/sqlite/SQLiteIntegrationTest.java b/liquibase-integration-tests/src/test/java/liquibase/dbtest/sqlite/SQLiteIntegrationTest.java
index <HASH>..<HASH> 100644
--- a/liquibase-integration-tests/src/test/java/liquibase/dbtest/sqlite/SQLiteIntegrationTest.java
+++ b/liquibase-integration-tests/src/test/java/liquibase/dbtest/sqlite/SQLiteIntegrationTest.java
@@ -73,4 +73,17 @@ public class SQLiteIntegrationTest extends AbstractIntegrationTest {
assertTrue(true);
}
+ @Override
+ public void tearDown() throws Exception {
+ super.tearDown();
+ try {
+ String url = getDatabase().getConnection().getURL()
+ .replaceFirst("jdbc:sqlite:", ""); // remove the prefix of the URL jdbc:sqlite:C:\path\to\tmp\dir\liquibase.db
+ Scope.getCurrentScope().getLog(getClass()).info("Marking SQLite database as delete on exit: " + url);
+ // Want to delete the sqlite db on jvm exit so that future runs are not using stale data.
+ new File(url).deleteOnExit();
+ } catch (Exception e) {
+ Scope.getCurrentScope().getLog(getClass()).warning("Failed to mark SQLite database as delete on exit.", e);
+ }
+ }
} | Cleanup SQLite database after tests complete and JVM exits | liquibase_liquibase | train | java |
a2cf5a0e3fc2c463bcb44b665367db34fb7830b9 | diff --git a/airflow/models/connection.py b/airflow/models/connection.py
index <HASH>..<HASH> 100644
--- a/airflow/models/connection.py
+++ b/airflow/models/connection.py
@@ -130,7 +130,7 @@ class Connection(Base, LoggingMixin):
:type host: str
:param login: The login.
:type login: str
- :param password: The pasword.
+ :param password: The password.
:type password: str
:param schema: The schema.
:type schema: str | Fix typo in password (#<I>)
`pasword` -> `password` | apache_airflow | train | py |
8e6254930534b8e28314157b80a507d102694509 | diff --git a/rb/lib/selenium/webdriver/remote/http/default.rb b/rb/lib/selenium/webdriver/remote/http/default.rb
index <HASH>..<HASH> 100644
--- a/rb/lib/selenium/webdriver/remote/http/default.rb
+++ b/rb/lib/selenium/webdriver/remote/http/default.rb
@@ -55,8 +55,7 @@ module Selenium
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
end
- # Defaulting open_timeout to nil to be consistent with Ruby 2.2 and earlier.
- http.open_timeout = open_timeout
+ http.open_timeout = open_timeout if open_timeout
http.read_timeout = read_timeout if read_timeout
start(http)
diff --git a/rb/spec/unit/selenium/webdriver/remote/http/default_spec.rb b/rb/spec/unit/selenium/webdriver/remote/http/default_spec.rb
index <HASH>..<HASH> 100644
--- a/rb/spec/unit/selenium/webdriver/remote/http/default_spec.rb
+++ b/rb/spec/unit/selenium/webdriver/remote/http/default_spec.rb
@@ -34,7 +34,7 @@ module Selenium
it 'assigns default timeout to nil' do
http = client.send :http
- expect(http.open_timeout).to eq nil
+ expect(http.open_timeout).to eq 60
expect(http.read_timeout).to eq 60
end | [rb] debug clients have fixed problem with non-nil open_timeout values, switch to using library default | SeleniumHQ_selenium | train | rb,rb |
cd1f58f4d2dfdac89165d2b2256476d572743554 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -40,13 +40,15 @@ requirements = [
'numpy',
'six',
'torch',
- 'tqdm'
]
pillow_ver = ' >= 4.1.1'
pillow_req = 'pillow-simd' if get_dist('pillow-simd') is not None else 'pillow'
requirements.append(pillow_req + pillow_ver)
+tqdm_ver = ' == 4.19.9' if sys.version_info[0] < 3 else ''
+requirements.append('tqdm' + tqdm_ver)
+
setup(
# Metadata
name='torchvision', | Downgrade tqdm version to <I> for py<I> (#<I>)
* reduce tqdm version to <I> for py<I> to avoid spurious error
* Update setup.py
* Missed =
* Update wrong version string | pytorch_vision | train | py |
d08120fa0c226458edf1cf6c28ed4111b58b10ee | diff --git a/test/raw-revwalk.js b/test/raw-revwalk.js
index <HASH>..<HASH> 100644
--- a/test/raw-revwalk.js
+++ b/test/raw-revwalk.js
@@ -25,7 +25,9 @@ var helper = {
}
};
-// RevWalk
+/**
+ * RevWalk
+ */
exports.constructor = function(test){
test.expect(3);
@@ -33,9 +35,8 @@ exports.constructor = function(test){
helper.testFunction(test.equals, git.RevWalk, 'RevWalk');
// Ensure we get an instance of Oid
- testRepo.open( './dummyrepo/.git', function(error, path) {
- test.ok(new git.RevWalk(testRepo) instanceof git.RevWalk, 'Invocation returns an instance of RevWalk');
-
+ testRepo.open('../.git', function(error, repository) {
+ test.ok(new git.RevWalk(repository) instanceof git.RevWalk, 'Invocation returns an instance of RevWalk');
test.done();
});
}; | Updated raw-revwalk test | nodegit_nodegit | train | js |
db2fe4c5a2897bd74df82848abb91a968441f0ac | diff --git a/cm15/examples/rsssh/main.go b/cm15/examples/rsssh/main.go
index <HASH>..<HASH> 100644
--- a/cm15/examples/rsssh/main.go
+++ b/cm15/examples/rsssh/main.go
@@ -169,7 +169,7 @@ func serverArray(client *cm15.Api, name string) []*cm15.Instance {
}
// Makes a GET call on the given server and returns the current instance of the server.
-func server(client *cm15.Api, name string) cm15.Instance {
+func server(client *cm15.Api, name string) *cm15.Instance {
serverLocator := client.ServerLocator("/api/servers")
servers, err := serverLocator.Index(rsapi.ApiParams{"view": "instance_detail", "filter": []string{"name==" + name}})
if err != nil { | Fix types in rsssh example. | rightscale_rsc | train | go |
5a33d1e6976b669fc71562fb25287064c7fe72b7 | diff --git a/salt/states/http.py b/salt/states/http.py
index <HASH>..<HASH> 100644
--- a/salt/states/http.py
+++ b/salt/states/http.py
@@ -93,7 +93,7 @@ def query(name, match=None, match_type='string', status=None, **kwargs):
ret['result'] = False
ret['comment'] += ' Match text "{0}" was not found.'.format(match)
elif match_type == 'pcre':
- if re.search(match, data['text']):
+ if re.search(match, data.get('text', '')):
ret['result'] = True
ret['comment'] += ' Match pattern "{0}" was found.'.format(match)
else: | Fix http.query when result has no text (#<I>) | saltstack_salt | train | py |
9df873274b7b971e3338ea06b2db765a09054a58 | diff --git a/src/Fbf/LaravelPages/LaravelPagesServiceProvider.php b/src/Fbf/LaravelPages/LaravelPagesServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/Fbf/LaravelPages/LaravelPagesServiceProvider.php
+++ b/src/Fbf/LaravelPages/LaravelPagesServiceProvider.php
@@ -19,10 +19,6 @@ class LaravelPagesServiceProvider extends ServiceProvider {
public function boot()
{
$this->package('fbf/laravel-pages');
- if (\Config::get('laravel-pages::use_built_in_route', true))
- {
- include __DIR__.'/../../routes.php';
- }
\App::register('Cviebrock\EloquentSluggable\SluggableServiceProvider');
@@ -41,7 +37,10 @@ class LaravelPagesServiceProvider extends ServiceProvider {
*/
public function register()
{
- //
+ if (\Config::get('laravel-pages::use_built_in_route', true))
+ {
+ include __DIR__.'/../../routes.php';
+ }
}
/** | Moving routes inclusion to register, rather than boot, so it happens later and doesn't override app routes | FbF_Laravel-Pages | train | php |
f13e422f9c5fbd0ed9642f9fcd4119c3245407ec | diff --git a/src/Acme/DemoBundle/Controller/DemoController.php b/src/Acme/DemoBundle/Controller/DemoController.php
index <HASH>..<HASH> 100644
--- a/src/Acme/DemoBundle/Controller/DemoController.php
+++ b/src/Acme/DemoBundle/Controller/DemoController.php
@@ -40,7 +40,7 @@ class DemoController extends Controller
$request = $this->get('request');
if ('POST' == $request->getMethod()) {
- $form->bindRequest($request);
+ $form->bind($request);
if ($form->isValid()) {
$mailer = $this->get('mailer');
// .. setup a message and send it | Remove a deprecated call to bindRequest() | symfony_symfony-standard | train | php |
4070210d93d63ef3771005cd4ec5836ce0b69133 | diff --git a/question/category_class.php b/question/category_class.php
index <HASH>..<HASH> 100644
--- a/question/category_class.php
+++ b/question/category_class.php
@@ -228,7 +228,7 @@ class question_category_object {
* Displays the user interface
*
*/
- function display_randomquestion_user_interface($addonpage) {
+ function display_randomquestion_user_interface($addonpage=0) {
$this->catform_rand->set_data(array('addonpage'=>$addonpage));
/// Interface for adding a new category:
$this->output_new_randomquestion_table(); | quiz editing: MDL-<I> Added a default value to avoid error messages
Added a default value to the function that passes a page number to avoid error messages. | moodle_moodle | train | php |
b29a3dafc022c8aebd1bc9ec4b4be8b2f314ffb8 | diff --git a/tests/Translator/Extractor/SymfonyExtractorTest.php b/tests/Translator/Extractor/SymfonyExtractorTest.php
index <HASH>..<HASH> 100644
--- a/tests/Translator/Extractor/SymfonyExtractorTest.php
+++ b/tests/Translator/Extractor/SymfonyExtractorTest.php
@@ -45,7 +45,7 @@ class SymfonyExtractorTest extends TestCase
$symfonyExtractor->extract(Argument::exact($dir), Argument::exact($catalogue))->shouldHaveBeenCalled();
}
foreach ($nonDirPaths as $path) {
- $symfonyExtractor->extract(Argument::exact($path), Argument::exact($catalogue))->shouldNotBeenCalled();
+ $symfonyExtractor->extract(Argument::exact($path), Argument::exact($catalogue))->shouldNotHaveBeenCalled();
}
} | Migrate to the non-deprecated Prophecy method | Incenteev_translation-checker-bundle | train | php |
52fa830677faad952f99b64fa2a36ad50fafa548 | diff --git a/state/state.go b/state/state.go
index <HASH>..<HASH> 100644
--- a/state/state.go
+++ b/state/state.go
@@ -117,8 +117,7 @@ func (st *State) ControllerUUID() string {
return st.controllerTag.Id()
}
-// ControllerTag returns the tag form of the the return value of
-// ControllerUUID.
+// ControllerTag returns the tag form of the ControllerUUID.
func (st *State) ControllerTag() names.ControllerTag {
return st.controllerTag
}
diff --git a/state/upgrades_test.go b/state/upgrades_test.go
index <HASH>..<HASH> 100644
--- a/state/upgrades_test.go
+++ b/state/upgrades_test.go
@@ -6698,15 +6698,13 @@ func (s *upgradesSuite) TestRemoveLocalCharmOriginChannels(c *gc.C) {
)
}
-func (s *upgradesSuite) TestFixCharmhubLastPolltime(c *gc.C) {
+func (s *upgradesSuite) TestFixCharmhubLastPollTime(c *gc.C) {
model1 := s.makeModel(c, "model-1", coretesting.Attrs{})
model2 := s.makeModel(c, "model-2", coretesting.Attrs{})
defer func() {
_ = model1.Close()
_ = model2.Close()
}()
- model1.stateClock = s.state.stateClock
- model2.stateClock = s.state.stateClock
uuid1 := model1.ModelUUID()
uuid2 := model2.ModelUUID() | Removes explicit setting of model clock, which causes a race check
failure in TestFixCharmhubLastPollTime.
The clock that was being set is the same one anyway. | juju_juju | train | go,go |
3cdab36cecdef52f2f101cfa41dd2f5b6956c40d | diff --git a/src/settings.js b/src/settings.js
index <HASH>..<HASH> 100644
--- a/src/settings.js
+++ b/src/settings.js
@@ -227,22 +227,19 @@ parseCrop = function(val) {
}
parseShrink = function(val) {
- var reShrink, shrink, size
- reShrink = /^([0-9]+)x([0-9]+)(?:\s+(\d{1,2}|100)%)?$/i
- shrink = reShrink.exec($.trim(val.toLowerCase())) || []
+ const reShrink = /^([0-9]+)x([0-9]+)(?:\s+(\d{1,2}|100)%)?$/i
+ const shrink = reShrink.exec($.trim(val.toLowerCase())) || []
if (!shrink.length) {
return false
}
- size = shrink[1] * shrink[2]
+ const size = shrink[1] * shrink[2]
if (size > 5000000) {
// ios max canvas square
warnOnce(
- 'Shrinked size can not be larger than 5MP. ' +
+ 'Shrinked size larger than 5MP can not fit in maximum browser canvas size. ' +
`You have set ${shrink[1]}x${shrink[2]} (` +
`${Math.ceil(size / 1000 / 100) / 10}MP).`
)
-
- return false
}
return {
quality: shrink[3] ? shrink[3] / 100 : undefined, | chore: add warning about different shrink size in different browsers | uploadcare_uploadcare-widget | train | js |
dc4430b6633e59ef53849dc30bf9241caba06af6 | diff --git a/pkg/kubelet/cm/cpumanager/cpu_assignment.go b/pkg/kubelet/cm/cpumanager/cpu_assignment.go
index <HASH>..<HASH> 100644
--- a/pkg/kubelet/cm/cpumanager/cpu_assignment.go
+++ b/pkg/kubelet/cm/cpumanager/cpu_assignment.go
@@ -63,6 +63,14 @@ func (m mapIntInt) Values(keys ...int) []int {
return values
}
+func sum(xs []int) int {
+ var s int
+ for _, x := range xs {
+ s += x
+ }
+ return s
+}
+
func mean(xs []int) float64 {
var sum float64
for _, x := range xs { | Add a sum() helper to the CPUManager cpuassignment logic | kubernetes_kubernetes | train | go |
bd49e220bd8b1b9eb7e9ff84fc13cfd9ed7e84cc | diff --git a/lib/countries/country.rb b/lib/countries/country.rb
index <HASH>..<HASH> 100644
--- a/lib/countries/country.rb
+++ b/lib/countries/country.rb
@@ -108,6 +108,8 @@ class ISO3166::Country
def translation(language_alpha2 = 'en')
I18nData.countries(language_alpha2)[alpha2]
+ rescue I18nData::NoTranslationAvailable
+ nil
end
private
diff --git a/spec/country_spec.rb b/spec/country_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/country_spec.rb
+++ b/spec/country_spec.rb
@@ -227,6 +227,11 @@ describe ISO3166::Country do
expect(countries).to be_an(String)
expect(countries).to eq('Germany')
end
+
+ it 'should return nil when a translation is not found' do
+ countries = ISO3166::Country.new(:de).translation('xxx')
+ expect(countries).to be_nil
+ end
end
describe 'translations' do | Return nil if translation is not found
The newly added translation method in ISO<I>::Country should return nil
rather than throwing an I<I>nData::NoTranslationAvailable exception. | hexorx_countries | train | rb,rb |
b53a036671d9552112a7307ddcd249eb9d1c708d | diff --git a/iktomi/cli/sqla.py b/iktomi/cli/sqla.py
index <HASH>..<HASH> 100644
--- a/iktomi/cli/sqla.py
+++ b/iktomi/cli/sqla.py
@@ -123,7 +123,7 @@ class Sqla(Cli):
sys.exit('Interrupted')
def _drop_metadata_tables(metadata):
- table = metadata.tables.itervalues().next()
+ table = next(metadata.tables.itervalues(), None)
if table is None:
print('Failed to find engine')
else: | Fix StopIteration when there are no tables in metadata. | SmartTeleMax_iktomi | train | py |
1a02b06c24c76983e3098350f9d9fc2762076b75 | diff --git a/src/Refinery29.php b/src/Refinery29.php
index <HASH>..<HASH> 100644
--- a/src/Refinery29.php
+++ b/src/Refinery29.php
@@ -101,8 +101,8 @@ class Refinery29 extends Config
'phpdoc_indent' => true,
'phpdoc_inline_tag' => true,
'phpdoc_no_access' => true,
+ 'phpdoc_no_empty_return' => true,
'phpdoc_no_package' => true,
- 'phpdoc_no_simplified_null_return' => true,
'phpdoc_scalar' => true,
'phpdoc_separation' => true,
'phpdoc_summary' => false,
diff --git a/test/Refinery29Test.php b/test/Refinery29Test.php
index <HASH>..<HASH> 100644
--- a/test/Refinery29Test.php
+++ b/test/Refinery29Test.php
@@ -233,8 +233,8 @@ class Refinery29Test extends \PHPUnit_Framework_TestCase
'phpdoc_indent' => true,
'phpdoc_inline_tag' => true,
'phpdoc_no_access' => true,
+ 'phpdoc_no_empty_return' => true,
'phpdoc_no_package' => true,
- 'phpdoc_no_simplified_null_return' => true,
'phpdoc_scalar' => true,
'phpdoc_separation' => true,
'phpdoc_summary' => false, | Fix: Fixer phpdoc_no_simplified_null_return has been renamed to phpdoc_no_empty_return | refinery29_php-cs-fixer-config | train | php,php |
1ef9a2be4d8fd35b1fac1472decb2bdfedc33686 | diff --git a/resemble.js b/resemble.js
index <HASH>..<HASH> 100644
--- a/resemble.js
+++ b/resemble.js
@@ -175,15 +175,15 @@ URL: https://github.com/Huddle/Resemble.js
var imageData;
var width = hiddenImage.width;
- var height = hiddenImage.height;
+ var height = hiddenImage.height;
- if( scaleToSameSize && images.length == 1 ){
- width = images[0].width;
- height = images[0].height;
- }
+ if( scaleToSameSize && images.length == 1 ){
+ width = images[0].width;
+ height = images[0].height;
+ }
- hiddenCanvas.width = width;
- hiddenCanvas.height = height;
+ hiddenCanvas.width = width;
+ hiddenCanvas.height = height;
hiddenCanvas.getContext('2d').drawImage(hiddenImage, 0, 0, width, height);
imageData = hiddenCanvas.getContext('2d').getImageData(0, 0, width, height); | What sane person uses tabs? | rsmbl_Resemble.js | train | js |
45e3f575b0eedd771259dc59b99c1c2671594184 | diff --git a/eqcorrscan/core/match_filter.py b/eqcorrscan/core/match_filter.py
index <HASH>..<HASH> 100644
--- a/eqcorrscan/core/match_filter.py
+++ b/eqcorrscan/core/match_filter.py
@@ -4156,12 +4156,6 @@ def match_filter(template_names, template_list, st, threshold,
stream[0].stats.starttime.datetime.strftime('%Y%j')]),
4, debug)
if all_peaks[i]:
- if len(all_peaks[i]) > 1000:
- warnings.warn('Detections: more than 1000 peaks per ' +
- 'processing for template ' +
- _template_names[i] + ' on ' +
- stream[0].stats.starttime.datetime.
- strftime('%Y%m%d%H'))
for peak in all_peaks[i]:
# TODO: This should be abstracted out into a peak_to_det func
detecttime = stream[0].stats.starttime + \ | Remove arbitrary warning on number of detections | eqcorrscan_EQcorrscan | train | py |
643e20b64f3439508e3d131d76c6e8a8de8c1188 | diff --git a/billy/bin/update.py b/billy/bin/update.py
index <HASH>..<HASH> 100755
--- a/billy/bin/update.py
+++ b/billy/bin/update.py
@@ -357,7 +357,7 @@ def main():
# scraper order matters
order = ('legislators', 'committees', 'votes', 'bills',
- 'speeches', 'events')
+ 'events', 'speeches')
_traceback = None
try:
for stype in order: | reordering events & speeches | openstates_billy | train | py |
86f974333eef6a57a2393f09cb81ec71fd7a57f8 | diff --git a/core/src/main/java/io/grpc/ClientStreamTracer.java b/core/src/main/java/io/grpc/ClientStreamTracer.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/io/grpc/ClientStreamTracer.java
+++ b/core/src/main/java/io/grpc/ClientStreamTracer.java
@@ -53,24 +53,13 @@ public abstract class ClientStreamTracer extends StreamTracer {
/**
* Creates a {@link ClientStreamTracer} for a new client stream.
*
- * @deprecated Override/call {@link #newClientStreamTracer(CallOptions, Metadata)} instead.
- */
- @Deprecated
- public ClientStreamTracer newClientStreamTracer(Metadata headers) {
- throw new UnsupportedOperationException("This method will be deleted. Do not call.");
- }
-
- /**
- * Creates a {@link ClientStreamTracer} for a new client stream.
- *
* @param callOptions the effective CallOptions of the call
* @param headers the mutable headers of the stream. It can be safely mutated within this
* method. It should not be saved because it is not safe for read or write after the
* method returns.
*/
- @SuppressWarnings("deprecation")
public ClientStreamTracer newClientStreamTracer(CallOptions callOptions, Metadata headers) {
- return newClientStreamTracer(headers);
+ throw new UnsupportedOperationException("Not implemented");
}
}
} | core: delete deprecated ClientStreamTracer.Factory#newClientStreamTracer (#<I>) | grpc_grpc-java | train | java |
0909ca448162c0d0565d1cccb4f462a5435ae209 | diff --git a/convertToWav.py b/convertToWav.py
index <HASH>..<HASH> 100644
--- a/convertToWav.py
+++ b/convertToWav.py
@@ -5,7 +5,7 @@
import glob, sys, os
def getVideoFilesFromFolder(dirPath):
- types = (dirPath+os.sep+'*.avi', dirPath+os.sep+'*.mkv', dirPath+os.sep+'*.mp4', dirPath+os.sep+'*.mp3') # the tuple of file types
+ types = (dirPath+os.sep+'*.avi', dirPath+os.sep+'*.mkv', dirPath+os.sep+'*.mp4', dirPath+os.sep+'*.mp3', dirPath+os.sep+'*.flac') # the tuple of file types
files_grabbed = []
for files in types:
files_grabbed.extend(glob.glob(files)) | flac added in convertToWav | tyiannak_pyAudioAnalysis | train | py |
1d8527e4fa5914e458cc74978bbde52919f1f4f2 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,8 @@ setup(
tests_require=[
'pytest',
'pytest-cov',
- 'eth-tester[py-evm]==0.1.0b31',
+ 'py-evm==0.2.0a32',
+ 'eth-tester[py-evm]==0.1.0b32',
'web3==4.4.1',
],
scripts=[ | Bump eth-tester and py-evm versions. | ethereum_vyper | train | py |
188b1904d995dac9d3a5f10c61dba06d6fbcbe00 | diff --git a/zengine/lib/forms.py b/zengine/lib/forms.py
index <HASH>..<HASH> 100644
--- a/zengine/lib/forms.py
+++ b/zengine/lib/forms.py
@@ -1,9 +1,9 @@
from datetime import datetime, date
from pyoko.field import DATE_FORMAT, DATE_TIME_FORMAT
-from pyoko.form import Form
+from pyoko.form import ModelForm
-class JsonForm(Form):
+class JsonForm(ModelForm):
def serialize(self):
result = {
"schema": { | added comma separated model list support for flush_db | zetaops_zengine | train | py |
dc045d079d6b80279f27bab2f10391a005159ea4 | diff --git a/code/LeftAndMain.php b/code/LeftAndMain.php
index <HASH>..<HASH> 100644
--- a/code/LeftAndMain.php
+++ b/code/LeftAndMain.php
@@ -1001,8 +1001,8 @@ class LeftAndMain extends Controller {
* @return int
*/
public function currentPageID() {
- if($this->request->getVar('ID')) {
- return $this->request->getVar('ID');
+ if($this->request->requestVar('ID')) {
+ return $this->request->requestVar('ID');
} elseif ($this->request->param('ID') && is_numeric($this->request->param('ID'))) {
return $this->request->param('ID');
} elseif(Session::get("{$this->class}.currentPage")) { | BUGFIX Allowing POST data in LeftAndMain->currentPageID() in order to fix stricter form submission validations in RequestHandler (checks for valid form action before executing e.g. 'save' command, hence needs to construct a correct form state) | silverstripe_silverstripe-siteconfig | train | php |
b3f63cf35e0360d6a9d9d1938f755d601d4f528c | diff --git a/blockmanager.go b/blockmanager.go
index <HASH>..<HASH> 100644
--- a/blockmanager.go
+++ b/blockmanager.go
@@ -1030,7 +1030,7 @@ func (b *blockManager) handleHeadersMsg(bmsg *headersMsg) {
nheaders := len(msg.Headers)
if nheaders == 0 {
- bmgrLog.Infof("Received %v0 block headers: Fetching blocks",
+ bmgrLog.Infof("Received %v block headers: Fetching blocks",
len(b.headerPool))
b.fetchHeaderBlocks()
return | Fix typo in fetch blocks log message. | btcsuite_btcd | train | go |
acae77d976c6352f87c5a9549a9e5c71e43c9151 | diff --git a/test/unit/gateways/iridium_test.rb b/test/unit/gateways/iridium_test.rb
index <HASH>..<HASH> 100644
--- a/test/unit/gateways/iridium_test.rb
+++ b/test/unit/gateways/iridium_test.rb
@@ -94,6 +94,7 @@ class IridiumTest < Test::Unit::TestCase
end
def test_do_not_depend_on_expiry_date_class
+ @gateway.stubs(:ssl_post).returns(successful_purchase_response)
@credit_card.expects(:expiry_date).never
@gateway.purchase(@amount, @credit_card, @options)
diff --git a/test/unit/gateways/netaxept_test.rb b/test/unit/gateways/netaxept_test.rb
index <HASH>..<HASH> 100644
--- a/test/unit/gateways/netaxept_test.rb
+++ b/test/unit/gateways/netaxept_test.rb
@@ -156,7 +156,8 @@ class NetaxeptTest < Test::Unit::TestCase
brand = @credit_card.type
@credit_card.expects(:type).never
@credit_card.expects(:brand).at_least_once.returns(brand)
- @gateway.purchase(@amount, @credit_card, @options)
+
+ @gateway.send(:add_creditcard, {}, @credit_card)
end
def test_url_escape_password | Fix accidental remote calls in two tests. | activemerchant_active_merchant | train | rb,rb |
3f5455c1bea54b8bc976ce8eb66417d42a676d77 | diff --git a/lib/gsl.rb b/lib/gsl.rb
index <HASH>..<HASH> 100644
--- a/lib/gsl.rb
+++ b/lib/gsl.rb
@@ -5,7 +5,8 @@ end
begin
require "gsl/#{RUBY_VERSION[/\d+.\d+/]}/gsl_native"
-rescue LoadError
+rescue LoadError => err
+ raise if err.respond_to?(:path) && !err.path
require 'gsl/gsl_native'
end | lib/gsl.rb: Reraise extension LoadError other than "cannot load such file". | SciRuby_rb-gsl | train | rb |
ca802926f84b83bf7d994221e7aa1a836a1dd3dc | diff --git a/src/DOIServiceProvider.php b/src/DOIServiceProvider.php
index <HASH>..<HASH> 100755
--- a/src/DOIServiceProvider.php
+++ b/src/DOIServiceProvider.php
@@ -177,7 +177,7 @@ class DOIServiceProvider
* @param $xml
* @return bool
*/
- private function validateXML($xml)
+ public function validateXML($xml)
{
$xmlValidator = new XMLValidator();
$result = $xmlValidator->validateSchemaVersion($xml); | made private xml validator function public for api use | au-research_ANDS-DOI-Service | train | php |
c5002d19d685f281be7445dcac7d610605422570 | diff --git a/spec/requests/admin/user_spec.rb b/spec/requests/admin/user_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/requests/admin/user_spec.rb
+++ b/spec/requests/admin/user_spec.rb
@@ -29,6 +29,7 @@ describe "users" do
end
it "validates user password and confirmation match" do
+ pending "temporarily disabled until fix found"
fill_in "user_password", with: "password"
fill_in "user_password", with: "password2"
click_button "Save" | Merge changes from master and ignore one test causing problem with rails4 | jipiboily_monologue | train | rb |
23e503d74c017886ec07991a3e20e6bce2840f62 | diff --git a/horizon/static/horizon/js/horizon.tables.js b/horizon/static/horizon/js/horizon.tables.js
index <HASH>..<HASH> 100644
--- a/horizon/static/horizon/js/horizon.tables.js
+++ b/horizon/static/horizon/js/horizon.tables.js
@@ -292,7 +292,7 @@ horizon.datatables.add_table_checkboxes = function(parent) {
$(parent).find('table thead .multi_select_column').each(function(index, thead) {
if (!$(thead).find('.table-row-multi-select:checkbox').length &&
$(thead).parents('table').find('tbody .table-row-multi-select:checkbox').length) {
- $(thead).append('<input type="checkbox">');
+ $(thead).append('<input type="checkbox" class="table-row-multi-select">');
}
});
}; | Fix behavior of select all checkbox
The "select all" checkbox in tables didn't work due to a missing CSS class.
Add the missing class so that the checkbox behaves as expected.
Change-Id: I5dcfdf9a7a<I>ea<I>c<I>fabeb7a8f<I>b<I>fe7
Closes-Bug: #<I> | openstack_horizon | train | js |
4aec19c4df983713ea7971a472549ae787107e8b | diff --git a/examples/estimate-container.py b/examples/estimate-container.py
index <HASH>..<HASH> 100644
--- a/examples/estimate-container.py
+++ b/examples/estimate-container.py
@@ -104,8 +104,7 @@ def total_capacity(koji, channel_id):
Look up the current capacity for this channel.
"""
total_capacity = 0
- hosts = yield koji.listHosts(channelID=channel_id,
- enabled=True, ready=True)
+ hosts = yield koji.listHosts(channelID=channel_id, enabled=True)
for host in hosts:
total_capacity += host.capacity
defer.returnValue(total_capacity) | estimate-container: fix total_capacity query
"ready=True" means "I am online, *and* I have spare capacity".
If a channel's queue is really backed up with free tasks, the no hosts
in our channel will be "ready". | ktdreyer_txkoji | train | py |
01d62a10fd07d74d2d87b9805197802a4322f90a | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -10,6 +10,11 @@ import moment from 'moment'
import request from 'request'
let Fut = class Fut extends Methods {
+ static isPriceValid = utils.isPriceValid;
+ static calculateValidPrice = utils.calculateValidPrice;
+ static calculateNextLowerPrice = utils.calculateNextLowerPrice;
+ static calculateNextHigherPrice = utils.calculateNextHigherPrice;
+ static getBaseId = utils.getBaseId;
/**
* [constructor description]
* @param {[type]} options.email [description]
@@ -150,12 +155,4 @@ let Fut = class Fut extends Methods {
}
}
-// Object.assign(Fut.prototype, Methods.prototype)
module.exports = Fut
-
-// futapi.isPriceValid = utils.isPriceValid
-// futapi.calculateValidPrice = utils.calculateValidPrice
-// futapi.calculateNextLowerPrice = utils.calculateNextLowerPrice
-// futapi.calculateNextHigherPrice = utils.calculateNextHigherPrice
-// futapi.getBaseId = utils.getBaseId
-// module.exports = futapi | FIXED: restore static helper functions | futjs_fut-api | train | js |
9c4647dc55ef470a5c144eae2428347397e0e303 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -95,6 +95,14 @@ var Base = Backbone.View.extend({
this.subviews[view.cid] = view;
el.append(view.el);
+ _.defer(function () {
+ view.trigger('afterAppend');
+ });
+
+ if (view.afterAppend) {
+ view.afterAppend();
+ }
+
}
, closeSubviews: function() { | Add an afterAppend event and method | Techwraith_ribcage-view | train | js |
25f357da2acee440bc1aa2057b1d5799ee15330a | diff --git a/src/serial/raw/to.js b/src/serial/raw/to.js
index <HASH>..<HASH> 100644
--- a/src/serial/raw/to.js
+++ b/src/serial/raw/to.js
@@ -1,5 +1,6 @@
/**
* @file to raw serialization
+ * @since 0.2.8
*/
/*#ifndef(UMD)*/
"use strict";
@@ -35,6 +36,7 @@ function _gpfSerialRawBuild (SerializableClass) {
* @return {Function} A function that accepts only instances of the given class and returns a dictionary with all
* serializable properties (indexed by member names)
* @throws {gpf.Error.InvalidParameter}
+ * @since 0.2.8
*/
gpf.serial.buildToRaw = function (SerializableClass) {
if ("function" !== typeof SerializableClass) { | Documentation (#<I>) | ArnaudBuchholz_gpf-js | train | js |
3fb3a3b8c0f8358cc91fe0e61c4229d482954209 | diff --git a/cmd/main.js b/cmd/main.js
index <HASH>..<HASH> 100755
--- a/cmd/main.js
+++ b/cmd/main.js
@@ -251,6 +251,8 @@ if (cli.install) {
let fileName = cli['<script>'];
// TODO - refactor to wirkspace
let file = fs.readFileSync(workspace.getPackageRoot() + '/' + fileName, 'utf8');
+ let confirmationBlocks = workspace.dappfile.environments[env].confirmationBlocks;
+ if(typeof confirmationBlocks === 'undefined') confirmationBlocks = 1;
req.pipelines
.BuildPipeline({
packageRoot: Workspace.findPackageRoot(),
@@ -263,7 +265,7 @@ if (cli.install) {
throws: !cli['--force'],
web3: (rc.environment(env).ethereum || 'internal'),
workspace: workspace,
- confirmationBlocks: workspace.dappfile.environments[env].confirmationBlocks || 1
+ confirmationBlocks: confirmationBlocks
}));
} else if (cli.step) {
let workspace = Workspace.atPackageRoot(); | fix js dynamic typing bullshit language 'feature' | dapphub_dapple | train | js |
19308ce5e67438be40dbe3086bdc39ce9a929303 | diff --git a/packages/ember-runtime/lib/mixins/enumerable.js b/packages/ember-runtime/lib/mixins/enumerable.js
index <HASH>..<HASH> 100644
--- a/packages/ember-runtime/lib/mixins/enumerable.js
+++ b/packages/ember-runtime/lib/mixins/enumerable.js
@@ -1134,7 +1134,7 @@ export default Mixin.create({
@param {String} property name(s) to sort on
@return {Array} The sorted array.
@since 1.2.0
- @private
+ @public
*/
sortBy() {
var sortKeys = arguments; | Mark Enumerable#sortBy as public | emberjs_ember.js | train | js |
d7e944004a47825578e3d96327e3c2399269a999 | diff --git a/test/Stagehand/TestRunner/TestCase.php b/test/Stagehand/TestRunner/TestCase.php
index <HASH>..<HASH> 100644
--- a/test/Stagehand/TestRunner/TestCase.php
+++ b/test/Stagehand/TestRunner/TestCase.php
@@ -74,7 +74,8 @@ abstract class Stagehand_TestRunner_TestCase extends PHPUnit_Framework_TestCase
'_GET',
'_COOKIE',
'_SERVER',
- '_FILES'
+ '_FILES',
+ '_REQUEST'
);
protected function setUp() | Fixed code that caused some assertions to be failed on Windows. | piece_stagehand-testrunner | train | php |
450f5da7e1ea95a6cf898a5d00a328c03a7fbfff | diff --git a/accounts/url_test.go b/accounts/url_test.go
index <HASH>..<HASH> 100644
--- a/accounts/url_test.go
+++ b/accounts/url_test.go
@@ -32,9 +32,10 @@ func TestURLParsing(t *testing.T) {
t.Errorf("expected: %v, got: %v", "ethereum.org", url.Path)
}
- _, err = parseURL("ethereum.org")
- if err == nil {
- t.Error("expected err, got: nil")
+ for _, u := range []string{"ethereum.org", ""} {
+ if _, err = parseURL(u); err == nil {
+ t.Errorf("input %v, expected err, got: nil", u)
+ }
}
} | accounts: increase parseURL test coverage (#<I>)
accounts/url: add test logic what check null string to parseURL() | ethereum_go-ethereum | train | go |
4e07843066d1ae0166b7b4ed44534c151f6a8fb9 | diff --git a/packages/service-worker-mock/models/Response.js b/packages/service-worker-mock/models/Response.js
index <HASH>..<HASH> 100644
--- a/packages/service-worker-mock/models/Response.js
+++ b/packages/service-worker-mock/models/Response.js
@@ -7,7 +7,7 @@ class Response {
this.statusText = (init && init.statusText) || 'OK';
this.headers = (init && init.headers);
- this.type = 'basic';
+ this.type = this.status === 0 ? 'opaque' : 'basic';
this.redirected = false;
this.url = 'http://example.com/asset';
} | Update service-worker-mock Response type (#<I>) | pinterest_service-workers | train | js |
c82ccdbe12611b85abf9df7bc772834a18741786 | diff --git a/lib/thinking_sphinx/configuration.rb b/lib/thinking_sphinx/configuration.rb
index <HASH>..<HASH> 100644
--- a/lib/thinking_sphinx/configuration.rb
+++ b/lib/thinking_sphinx/configuration.rb
@@ -147,7 +147,7 @@ class ThinkingSphinx::Configuration < Riddle::Configuration
@indices_location = settings['indices_location'] || framework_root.join(
'db', 'sphinx', environment
).to_s
- @version = settings['version'] || '2.0.6'
+ @version = settings['version'] || '2.1.4'
configure_searchd
diff --git a/spec/thinking_sphinx/configuration_spec.rb b/spec/thinking_sphinx/configuration_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/thinking_sphinx/configuration_spec.rb
+++ b/spec/thinking_sphinx/configuration_spec.rb
@@ -377,8 +377,8 @@ describe ThinkingSphinx::Configuration do
end
describe '#version' do
- it "defaults to 2.0.6" do
- config.version.should == '2.0.6'
+ it "defaults to 2.1.4" do
+ config.version.should == '2.1.4'
end
it "respects supplied YAML versions" do | Default Sphinx version is <I>.
This is (as far as I know) only used by Thinking Sphinx. Let's do our best to keep people on modern versions of Sphinx as much as possible. | pat_thinking-sphinx | train | rb,rb |
c4a77a26bc61cdfea0bf97360ff657be499548c4 | diff --git a/src/View/Helper/AuthHelper.php b/src/View/Helper/AuthHelper.php
index <HASH>..<HASH> 100644
--- a/src/View/Helper/AuthHelper.php
+++ b/src/View/Helper/AuthHelper.php
@@ -56,9 +56,9 @@ class AuthHelper extends Helper {
if (is_string($this->_config['session'])) {
$this->_userData = CakeSession::read($this->_config['session']);
} else {
- if (!isset($this->_View->viewVars[$this->_config['viewVar']])) {
+ if (!isset($this->_View->viewVars[$this->_config['viewVar']]) && $this->_View->viewVars[$this->_config['viewVar']] !== null) {
if ($this->_config['viewVarException'] === true) {
- throw new \RuntimeException(__d('user_tools', 'View var %s not present!'));
+ throw new \RuntimeException(__d('user_tools', 'View var `{0}` not present!', $this->_config['viewVar']));
}
} else {
$this->_userData = $this->_View->viewVars[$this->_config['viewVar']]; | Fixing the Auth helpers check for the view variable. | burzum_cakephp-user-tools | train | php |
b3a06d25aaa0271e26efa4064b69579bc4003aae | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -18,7 +18,7 @@ function sortMentions(mentions) {
}
function mentionRegExp(mention) {
- return new RegExp(`^${escapeStringRegExp(mention)}(?:\\b|\\s)`, 'i');
+ return new RegExp(`^${escapeStringRegExp(mention)}(?:\\b|\\s|$)`, 'i');
}
function tokenize(text, opts = {}) {
diff --git a/test.js b/test.js
index <HASH>..<HASH> 100644
--- a/test.js
+++ b/test.js
@@ -177,6 +177,13 @@ describe('utils/parseChatMarkup', () => {
{ type: 'mention', mention: 'user[afk]', raw: 'user[AFK]' },
' hello!'
]);
+
+ expect(parseChatMarkup('hello @user[AFK]', {
+ mentions: ['user[AFK]']
+ })).to.eql([
+ 'hello ',
+ { type: 'mention', mention: 'user[afk]', raw: 'user[AFK]' }
+ ]);
});
});
}); | fix mentions with punctuation at the end of a message | u-wave_parse-chat-markup | train | js,js |
3f96dc7825de8df2961ad5510be0018d37e350b0 | diff --git a/src/Rocketeer/Traits/BashModules/Scm.php b/src/Rocketeer/Traits/BashModules/Scm.php
index <HASH>..<HASH> 100644
--- a/src/Rocketeer/Traits/BashModules/Scm.php
+++ b/src/Rocketeer/Traits/BashModules/Scm.php
@@ -43,7 +43,7 @@ class Scm extends Binaries
}
// Deploy submodules
- if ($this->app['rocketeer.rocketeer']->getOption('scm.submodules')) {
+ if ($this->rocketeer->getOption('scm.submodules')) {
$this->command->info('Initializing submodules if any');
$this->runForCurrentRelease($this->scm->submodules());
} | As suggested by Maxime, a shorter way to get the rocketeer object | rocketeers_rocketeer | train | php |
bbdb2f98f138789e941d31de4d8ca0d7a4c09b9c | diff --git a/src/Smokescreen.php b/src/Smokescreen.php
index <HASH>..<HASH> 100644
--- a/src/Smokescreen.php
+++ b/src/Smokescreen.php
@@ -166,6 +166,10 @@ class Smokescreen implements \JsonSerializable
throw new MissingResourceException('No resource has been defined to transform');
}
+ if ($this->includes === null) {
+ $this->parseIncludes('');
+ }
+
// Kick of serialization of the resource
return $this->serializeResource($this->resource, $this->includes);
} | Fix bug where no includes are parsed
- Initialise an empty includes object if no includes have been parsed at the time of generating output | rexlabsio_smokescreen-php | train | php |
bb0248bb3c0953f8233262e3e7b4de6631d9c453 | diff --git a/giotto/views/__init__.py b/giotto/views/__init__.py
index <HASH>..<HASH> 100644
--- a/giotto/views/__init__.py
+++ b/giotto/views/__init__.py
@@ -80,7 +80,7 @@ class GiottoView(object):
"""
Render a model result into `mimetype` format.
"""
- available_mimetypes = self.render_map.keys()
+ available_mimetypes = [x for x in self.render_map.keys() if '/' in x]
render_func = None
if '/' not in mimetype: | fixed bug where invalid mimetypes were messing up mimetype negotiation | priestc_giotto | train | py |
f9845bf30b32deff657df9a384bb5e5b53c96fa9 | diff --git a/shell/src/main/resources/org/efaps/js/definitions/Admin/Access/DataModels/TYPE_Admin_Access_AccessSet2UserAbstract.js b/shell/src/main/resources/org/efaps/js/definitions/Admin/Access/DataModels/TYPE_Admin_Access_AccessSet2UserAbstract.js
index <HASH>..<HASH> 100644
--- a/shell/src/main/resources/org/efaps/js/definitions/Admin/Access/DataModels/TYPE_Admin_Access_AccessSet2UserAbstract.js
+++ b/shell/src/main/resources/org/efaps/js/definitions/Admin/Access/DataModels/TYPE_Admin_Access_AccessSet2UserAbstract.js
@@ -56,7 +56,7 @@ with (TYPE) {
setSQLTable("Admin_Access_AccessSet2UserAbstractSQLTable");
setSQLColumn("ACCESSSET");
}
- with (addAttribute("UserAbstractTypeLink")) {
+ with (addAttribute("UserAbstractLink")) {
setAttributeType("Link");
setTypeLink("Admin_User_Abstract");
setSQLTable("Admin_Access_AccessSet2UserAbstractSQLTable"); | - name of attribute for the link to the users was wrong
(from 'UserAbstractTypeLink' to 'UserAbstractLink')
git-svn-id: <URL> | eFaps_eFaps-Kernel | train | js |
1a32435a4d6eeb8ff6f77e7db052bc65619f8c41 | diff --git a/agent/proxy/manager.go b/agent/proxy/manager.go
index <HASH>..<HASH> 100644
--- a/agent/proxy/manager.go
+++ b/agent/proxy/manager.go
@@ -96,8 +96,14 @@ type Manager struct {
// for changes to this value.
runState managerRunState
- proxies map[string]Proxy
+ // lastSnapshot stores a pointer to the last snapshot that successfully
+ // wrote to disk. This is used for dup detection to prevent rewriting
+ // the same snapshot multiple times. snapshots should never be that
+ // large so keeping it in-memory should be cheap even for thousands of
+ // proxies (unlikely scenario).
lastSnapshot *snapshot
+
+ proxies map[string]Proxy
}
// NewManager initializes a Manager. After initialization, the exported
diff --git a/agent/proxy/snapshot.go b/agent/proxy/snapshot.go
index <HASH>..<HASH> 100644
--- a/agent/proxy/snapshot.go
+++ b/agent/proxy/snapshot.go
@@ -101,7 +101,10 @@ func (m *Manager) snapshot(path string, checkDup bool) error {
// Write the file
err = file.WriteAtomic(path, encoded)
- if err == nil && checkDup {
+
+ // If we are checking for dups and we had a successful write, store
+ // it so we don't rewrite the same value.
+ if checkDup && err == nil {
m.lastSnapshot = &s
}
return err | agent/proxy: improve comments on snapshotting | hashicorp_consul | train | go,go |
da1360cbd69a0ee039267f2467ace2854d1afaa2 | diff --git a/src/View/Helper/AssetCompressHelper.php b/src/View/Helper/AssetCompressHelper.php
index <HASH>..<HASH> 100644
--- a/src/View/Helper/AssetCompressHelper.php
+++ b/src/View/Helper/AssetCompressHelper.php
@@ -282,8 +282,10 @@ class AssetCompressHelper extends Helper
return $baseUrl . $this->_getBuildName($target);
}
- $path = $target->outputDir();
- $path = str_replace(WWW_ROOT, '/', $path);
+ $root = str_replace('\\', '/', WWW_ROOT);
+ $path = str_replace('\\', '/', $target->outputDir());
+ $path = str_replace($root, '/', $path);
+
if (!$devMode) {
$path = rtrim($path, '/') . '/';
$route = $path . $this->_getBuildName($target); | Fix issues on windows where full paths would be used.
Refs #<I> | markstory_asset_compress | train | php |
ca9c7238e94aa0fe0e9244ca22c93ebd8768e29b | diff --git a/pyrap_quanta/trunk/pyrap_quanta/quantity.py b/pyrap_quanta/trunk/pyrap_quanta/quantity.py
index <HASH>..<HASH> 100644
--- a/pyrap_quanta/trunk/pyrap_quanta/quantity.py
+++ b/pyrap_quanta/trunk/pyrap_quanta/quantity.py
@@ -30,6 +30,10 @@ def quantity(*args):
return QuantVec(from_dict_v(args[0]))
else:
return Quantity(from_dict(args[0]))
+ elif isinstance(args[0], Quantity) or isinstance(args[0], QuantVec):
+ return args[0]
+ else:
+ raise TypeError("Invalid argument type for")
else:
if hasattr(args[0], "__len__"):
return QuantVec(*args) | handle a quantity as an argumnet to quantity | casacore_python-casacore | train | py |
be32a74dcfc92d353c734a2d184d22eff38f7df2 | diff --git a/views/js/qtiCreator/widgets/helpers/formElement.js b/views/js/qtiCreator/widgets/helpers/formElement.js
index <HASH>..<HASH> 100644
--- a/views/js/qtiCreator/widgets/helpers/formElement.js
+++ b/views/js/qtiCreator/widgets/helpers/formElement.js
@@ -13,7 +13,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * Copyright (c) 2015 (original work) Open Assessment Technologies SA;
+ * Copyright (c) 2015-2021 (original work) Open Assessment Technologies SA;
*
*/
@@ -282,7 +282,10 @@ define([
updateResponseDeclaration(element, value, options.updateCardinality);
}
- if (!value && (element.is('orderInteraction') || element.is('graphicOrderInteraction'))) {
+ if (this.disabled) {
+ // if the field is disabled, the corresponding attribute should be removed.
+ element[options.attrMethodNames.remove](name);
+ } else if (!value && (element.is('orderInteraction') || element.is('graphicOrderInteraction'))) {
element[options.attrMethodNames.remove](name); //to be removed for order interactions
} else {
element[options.attrMethodNames.set](name, value); //required | fix: removed upperbound value if field is disabled | oat-sa_extension-tao-itemqti | train | js |
bef131b89367cfc98bcd05c336040280d0f92419 | diff --git a/src/textfield/textfield.js b/src/textfield/textfield.js
index <HASH>..<HASH> 100644
--- a/src/textfield/textfield.js
+++ b/src/textfield/textfield.js
@@ -213,12 +213,33 @@
* @public
*/
MaterialTextfield.prototype.change = function(value) {
-
this.input_.value = value || '';
this.updateClasses_();
};
MaterialTextfield.prototype['change'] = MaterialTextfield.prototype.change;
+ /**
+ * Focus text field.
+ *
+ * @public
+ */
+ MaterialTextfield.prototype.focus = function() {
+ this.input_.focus();
+ this.updateClasses_();
+ };
+ MaterialTextfield.prototype['focus'] = MaterialTextfield.prototype.focus;
+
+ /**
+ * Blur text field.
+ *
+ * @public
+ */
+ MaterialTextfield.prototype.blur = function() {
+ this.input_.blur();
+ this.updateClasses_();
+ };
+ MaterialTextfield.prototype['blur'] = MaterialTextfield.prototype.blur;
+
/**
* Initialize element.
*/ | Add blur and focus public functions
So it can be called throught MaterialTextfield instead of retrieving the inner input element | material-components_material-components-web | train | js |
e7c7dec333cb3667d0b700b252dee1d3d5ac20f0 | diff --git a/chef/lib/chef/environment.rb b/chef/lib/chef/environment.rb
index <HASH>..<HASH> 100644
--- a/chef/lib/chef/environment.rb
+++ b/chef/lib/chef/environment.rb
@@ -212,7 +212,7 @@ class Chef
def self.cdb_load_filtered_cookbook_versions(name, couchdb=nil)
cvs = begin
- name.nil? ? Hash.new : Chef::Environment.cdb_load(name, couchdb).cookbook_versions.inject({}) {|res, (k,v)| res[k] = Gem::Requirement.new(v); res}
+ Chef::Environment.cdb_load(name, couchdb).cookbook_versions.inject({}) {|res, (k,v)| res[k] = Gem::Requirement.new(v); res}
rescue Chef::Exceptions::CouchDBNotFound => e
raise e
end | remove nil environment from loading cookbooks | chef_chef | train | rb |
435e31865e90a7e4e1637b7cd9c257367be84364 | diff --git a/app/src/Bolt/Controllers/Backend.php b/app/src/Bolt/Controllers/Backend.php
index <HASH>..<HASH> 100644
--- a/app/src/Bolt/Controllers/Backend.php
+++ b/app/src/Bolt/Controllers/Backend.php
@@ -441,7 +441,7 @@ class Backend implements ControllerProviderInterface
$contenttype = $app['storage']->getContentType($contenttypeslug);
- $order = $app['request']->query->get('order', $contenttype['sort']);
+ $order = $app['request']->query->get('order', false);
$page = $app['request']->query->get('page');
$filter = $app['request']->query->get('filter'); | Fixes grouping sort order on overviews. | bolt_bolt | train | php |
863f1ce6105856bbe4e6d058c8d57036647cecaf | diff --git a/etrago/appl.py b/etrago/appl.py
index <HASH>..<HASH> 100755
--- a/etrago/appl.py
+++ b/etrago/appl.py
@@ -89,12 +89,20 @@ args = {
'sector_coupled_clustering': {
'active': True, # choose if clustering is activated
'carrier_data': {
- 'H2_ind_load': {
- 'base': ['H2_grid', 'H2_saltcavern'],
+ 'H2_ind_load': { # key: name of the carrier for the buses to cluster
+ 'base': ['H2_grid'],
+ # list of carriers, that clustering should be topologically
+ # based on
'skip': None,
+ # list of carriers, that are skipped in topological bus
+ # clustering, but will be aggregated on the clustered buses in
+ # a second step. E.g. every central_heat bus has a respective
+ # central_heat_store bus. central_heat will be clustered as
+ # provided in the config, and the central_heat_store will be
+ # aggregated on the clustered central_heat buses afterwards
},
'central_heat': {
- 'base': ['AC', 'CH4'],
+ 'base': ['CH4'],
'skip': 'central_heat_store'
},
'rural_heat': { | Add comments on config for sector coupling, update defaults | openego_eTraGo | train | py |
0bca5c3dc865ae99c1169afa1dbcf59c715dc2d1 | diff --git a/lib/session.py b/lib/session.py
index <HASH>..<HASH> 100644
--- a/lib/session.py
+++ b/lib/session.py
@@ -748,7 +748,7 @@ class ResponseWrapper:
elif name =="secure" and value:
options += "; secure"
cookie_str = "%s=%s%s" % (cookie_name, cookie_value, options)
- self.request.headers_out["Set-Cookie"] = cookie_str
+ self.request.headers_out.add("Set-Cookie", cookie_str)
if 'expires' not in attrs or attrs['expires'] != 0:
self.request.cds_wrapper.setSession(cookie_value)
self.request.cds_wrapper.cookies[cookie_name] = cookie_value | Fixed table.add with Set-Cookie. | inveniosoftware_invenio-accounts | train | py |
507ca478d84b73ebd776a698e62326c8e7ded8c1 | diff --git a/tacl/constants.py b/tacl/constants.py
index <HASH>..<HASH> 100644
--- a/tacl/constants.py
+++ b/tacl/constants.py
@@ -414,7 +414,7 @@ HIGHLIGHT_TEMPLATE = '''<!DOCTYPE html>
var max = $("input").length;
function recalculateHeat (textname, change) {{
- $("span[data-texts~='" + textname.replace('\\', '\\\\') + "']").each(function () {{
+ $("span[data-texts~='" + textname.replace('\\\\', '\\\\\\\\') + "']").each(function () {{
$(this).attr("data-count", function () {{
return parseInt($(this).attr("data-count")) + change;
}}); | Added further escaping of backslashes so that the correctly exorbitant number are present in the JS. | ajenhl_tacl | train | py |
78562309fc44a4bf28dcadd048e81545ccc716fb | diff --git a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
@@ -99,7 +99,7 @@ module ActiveRecord
# This works for mysql and mysql2 where table.column can be used to
# resolve ambiguity.
#
- # We override this in the sqlite and postgresql adaptors to use only
+ # We override this in the sqlite and postgresql adapters to use only
# the column name (as per syntax requirements).
def quote_table_name_for_assignment(table, attr)
quote_table_name("#{table}.#{attr}") | Fix typo: adaptors => adapters [ci skip] | rails_rails | train | rb |
690bb51c1ff8f007bab82e0866d5676bc3a7796d | diff --git a/tests/test_apps/export-benchmark/src/exportbenchmark/DummyExporter.java b/tests/test_apps/export-benchmark/src/exportbenchmark/DummyExporter.java
index <HASH>..<HASH> 100644
--- a/tests/test_apps/export-benchmark/src/exportbenchmark/DummyExporter.java
+++ b/tests/test_apps/export-benchmark/src/exportbenchmark/DummyExporter.java
@@ -1,12 +1,17 @@
package exportbenchmark;
+import java.util.Properties;
import org.voltdb.exportclient.ExportClientBase;
import org.voltdb.exportclient.ExportDecoderBase;
-import org.voltdb.exportclient.ExportDecoderBase.RestartBlockException;
import org.voltdb.export.AdvertisedDataSource;
public class DummyExporter extends ExportClientBase {
+ @Override
+ public void configure(Properties config) throws Exception {
+ // We have no properties to configure at this point
+ }
+
static class PrinterExportDecoder extends ExportDecoderBase {
PrinterExportDecoder(AdvertisedDataSource source) {
super(source); | Added a configure function to DummyExport | VoltDB_voltdb | train | java |
91b99002493a0acee7568504f571c09962de2a38 | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -49,9 +49,9 @@ copyright = u'2012, Juan Pedro Fisanotti'
# built documents.
#
# The short X.Y version.
-version = '0.5'
+version = '0.6'
# The full version, including alpha/beta/rc tags.
-release = '0.5'
+release = '0.6'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ from distutils.core import setup
setup(
name='simpleai',
- version='0.5.10',
+ version='0.6',
description=u'An implementation of AI algorithms based on aima-python',
long_description=open('README.rst').read(),
author = u'Juan Pedro Fisanotti', | Updated version to make release with search viewers | simpleai-team_simpleai | train | py,py |
e402d6dad3b45b9ce57faa24a5803b9bc1284307 | diff --git a/peers.js b/peers.js
index <HASH>..<HASH> 100644
--- a/peers.js
+++ b/peers.js
@@ -125,10 +125,7 @@ TChannelPeers.prototype.clear = function clear() {
var self = this;
var keys = self.keys();
var vals = new Array(keys.length);
- for (var i = 0; i < keys.length; i++) {
- vals[i] = self._map[keys[i]];
- delete self._map[keys[i]];
- }
+ self._map = Object.create(null);
return vals;
}; | Peers#clear: just over-write _map | uber_tchannel-node | train | js |
9a4fb9335d21971271445d58b6b6e1f210733689 | diff --git a/tests/unit/test_rss.py b/tests/unit/test_rss.py
index <HASH>..<HASH> 100644
--- a/tests/unit/test_rss.py
+++ b/tests/unit/test_rss.py
@@ -37,3 +37,18 @@ class TestFeedHistory(object):
"an entry with no id/link/title"
assert not history.add_seen_feed(entry, 'http://example.com')
+
+ def test_feeds_loaded(self, history):
+ """
+ Feeds saved in one history should be already present when loaded
+ subsequently in a new history object.
+ """
+ entry = {'id': '1234'}
+ history.add_seen_feed(entry, 'http://example.com')
+ assert len(history) == 1
+
+ # now create a new history object
+ orig_uri = history.store.uri
+ new_history = pmxbot.rss.FeedHistory(orig_uri)
+ assert len(new_history) == 1
+ assert new_history.add_seen_feed(entry) is False | Added test demonstrating that feed history isn't being loaded from the database. | yougov_pmxbot | train | py |
8af73071666e9d6ce936435a8bd5536d6dee19b7 | diff --git a/src/org/opencms/search/solr/CmsSolrQuery.java b/src/org/opencms/search/solr/CmsSolrQuery.java
index <HASH>..<HASH> 100644
--- a/src/org/opencms/search/solr/CmsSolrQuery.java
+++ b/src/org/opencms/search/solr/CmsSolrQuery.java
@@ -77,6 +77,8 @@ public class CmsSolrQuery extends SolrQuery {
+ ","
+ CmsSearchField.FIELD_TYPE
+ ","
+ + CmsSearchField.FIELD_SOLR_ID
+ + ","
+ CmsSearchField.FIELD_ID;
/** A constant to add the score field to the result documents. */ | CmsSolrQuery: added minimally returned field solr_id. | alkacon_opencms-core | train | java |
54caf2532a5a36e69bf2a98f43bf658d7bd7e8e5 | diff --git a/examples/rules/bash_version.py b/examples/rules/bash_version.py
index <HASH>..<HASH> 100644
--- a/examples/rules/bash_version.py
+++ b/examples/rules/bash_version.py
@@ -11,7 +11,7 @@ or from the examples/rules directory::
$ python sample_rules.py
"""
-from insights.core.plugins import make_pass, rule
+from insights.core.plugins import make_info, rule
from insights.parsers.installed_rpms import InstalledRpms
KEY = "BASH_VERSION"
@@ -21,5 +21,5 @@ CONTENT = "Bash RPM Version: {{ bash_version }}"
@rule(InstalledRpms)
def report(rpms):
- bash_ver = rpms.get_max('bash')
- return make_pass(KEY, bash_version=bash_ver)
+ bash = rpms.get_max('bash')
+ return make_info(KEY, bash_version=bash.nvra) | Return the nvra instead of the InstalledRpm object. (#<I>)
Fixes #<I> | RedHatInsights_insights-core | train | py |
7fb9426ebd03ed6431e5c5ea831f23536891adbf | diff --git a/hanzidentifier.py b/hanzidentifier.py
index <HASH>..<HASH> 100644
--- a/hanzidentifier.py
+++ b/hanzidentifier.py
@@ -76,8 +76,11 @@ def is_traditional(s):
"""
chinese = _get_hanzi(s)
- if (chinese.issubset(_SHARED_CHARACTERS) or
- chinese.issubset(_TRADITIONAL_CHARACTERS)):
+ if not chinese:
+ return False
+ elif chinese.issubset(_SHARED_CHARACTERS):
+ return True
+ elif chinese.issubset(_TRADITIONAL_CHARACTERS):
return True
return False
@@ -90,7 +93,10 @@ def is_simplified(s):
"""
chinese = _get_hanzi(s)
- if (chinese.issubset(_SHARED_CHARACTERS) or
- chinese.issubset(_SIMPLIFIED_CHARACTERS)):
+ if not chinese:
+ return False
+ elif chinese.issubset(_SHARED_CHARACTERS):
+ return True
+ elif chinese.issubset(_SIMPLIFIED_CHARACTERS):
return True
return False | Fixes typo in helper functions. | tsroten_hanzidentifier | train | py |
ef86fb2f23297633399e93c337a38df44fc88b92 | diff --git a/store/store.go b/store/store.go
index <HASH>..<HASH> 100644
--- a/store/store.go
+++ b/store/store.go
@@ -548,7 +548,7 @@ func (s *Store) RemoveACI(key string) error {
dirUid := int(fi.Sys().(*syscall.Stat_t).Uid)
if uid != dirUid && uid != 0 {
- return fmt.Errorf("permission denied, are you root or the owner of the image?")
+ return fmt.Errorf("permission denied on %s, directory owner id (%d) does not match current real id (%d). Are you root or the owner of the image?", path, dirUid, uid)
}
} | store: print more information on rm as non-root | rkt_rkt | train | go |
bc0e9735748f53fce692217c0ef2cd875e597a1c | diff --git a/joomla/html/html.php b/joomla/html/html.php
index <HASH>..<HASH> 100644
--- a/joomla/html/html.php
+++ b/joomla/html/html.php
@@ -147,10 +147,10 @@ abstract class JHtml
}
/**
- * Write a <img></amg> element
+ * Write a <img></img> element
*
* @access public
- * @param string The relative or absoluete URL to use for the src attribute
+ * @param string The relative or absolute URL to use for the src attribute
* @param string The target attribute to use
* @param array An associative array of attributes to add
* @since 1.5 | [#<I>] [patch] docblock typos in html.php
null
--HG--
extra : convert_revision : svn%3A6f6e1ebd-4c2b-<I>-<I>f-f<I>bde<I>bce9/development/trunk/libraries%<I> | joomla_joomla-framework | train | php |
b534888b72b96a588a8afa24daf5f96b6f5a6288 | diff --git a/views/js/qtiCommonRenderer/helpers/uploadMime.js b/views/js/qtiCommonRenderer/helpers/uploadMime.js
index <HASH>..<HASH> 100644
--- a/views/js/qtiCommonRenderer/helpers/uploadMime.js
+++ b/views/js/qtiCommonRenderer/helpers/uploadMime.js
@@ -58,7 +58,7 @@ define([
*/
setExpectedTypes : function setExpectedTypes(interaction, types) {
var classes = interaction.attr('class') || '';
- classes = classes.replace(/x-tao-upload-type-[-_a-zA-Z]*/g, '').trim();
+ classes = classes.replace(/x-tao-upload-type-[-_a-zA-Z+.]*/g, '').trim();
interaction.attr('class', classes);
interaction.removeAttr('type');
@@ -94,7 +94,7 @@ define([
if (interaction.attr('type')) {
types.push(interaction.attr('type'));
} else {
- classes.replace(/x-tao-upload-type-([-_a-zA-Z]*)/g, function ($0, type) {
+ classes.replace(/x-tao-upload-type-([-_a-zA-Z+.]*)/g, function ($0, type) {
types.push(type.replace('_', '/').trim());
});
} | fixed the regex for mime type parsing | oat-sa_extension-tao-itemqti | train | js |
d6ad5dbcbc3c645724fc65c38d7940e7bb025df7 | diff --git a/LiSE/LiSE/util.py b/LiSE/LiSE/util.py
index <HASH>..<HASH> 100644
--- a/LiSE/LiSE/util.py
+++ b/LiSE/LiSE/util.py
@@ -256,8 +256,7 @@ _sort_set_memo = {}
def sort_set(s):
"""Return a sorted list of the contents of a set
- This is intended to be used to iterate over world state, where you just need keys
- to be in some deterministic order, but the sort order should be obvious from the key.
+ This is intended to be used to iterate over world state.
Non-strings come before strings and then tuples. Tuples compare element-wise as normal.
But ultimately all comparisons are between values' ``repr``. | Make the docstring for sort_set less weird | LogicalDash_LiSE | train | py |
ed0817c55dc45290d9de594fea28f7bc35d564da | diff --git a/core/filter.go b/core/filter.go
index <HASH>..<HASH> 100644
--- a/core/filter.go
+++ b/core/filter.go
@@ -134,7 +134,8 @@ Logs:
for i, topics := range self.topics {
for _, topic := range topics {
var match bool
- if log.Topics[i] == topic {
+ // common.Hash{} is a match all (wildcard)
+ if (topic == common.Hash{}) || log.Topics[i] == topic {
match = true
}
if !match {
diff --git a/rpc/args.go b/rpc/args.go
index <HASH>..<HASH> 100644
--- a/rpc/args.go
+++ b/rpc/args.go
@@ -739,10 +739,14 @@ func (args *BlockFilterArgs) UnmarshalJSON(b []byte) (err error) {
for j, jv := range argarray {
if v, ok := jv.(string); ok {
topicdbl[i][j] = v
+ } else if jv == nil {
+ topicdbl[i][j] = ""
} else {
return NewInvalidTypeError(fmt.Sprintf("topic[%d][%d]", i, j), "is not a string")
}
}
+ } else if iv == nil {
+ topicdbl[i] = []string{""}
} else {
return NewInvalidTypeError(fmt.Sprintf("topic[%d]", i), "not a string or array")
} | core/rpc: fix for null entries in log filters. Closes #<I>
You can now specify `null` as a way of saying "not interested in this
topic, match all". core.Filter assumes the zero'd address to be the
wildcard. JSON rpc assumes empty strings to be wildcards. | ethereum_go-ethereum | train | go,go |
acd75e395b209407a262cf7a67f78db72479bebf | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -23,7 +23,7 @@ if __name__ == "__main__":
setup(
name=name,
author=author,
- author_email='paul.mueller at biotec.tu-dresden.de',
+ author_email='paul.mueller@biotec.tu-dresden.de',
url='http://RI-imaging.github.io/ODTbrain/',
version=version,
packages=[name], | cannot upload to pypi with fake email | RI-imaging_ODTbrain | train | py |
f171647480e2413b469149572e23e60c8fd02b1d | diff --git a/repository/repository.go b/repository/repository.go
index <HASH>..<HASH> 100644
--- a/repository/repository.go
+++ b/repository/repository.go
@@ -10,6 +10,7 @@ import (
"github.com/globocom/config"
"github.com/globocom/tsuru/log"
"io"
+ "strings"
)
// Unit interface represents a unit of execution.
@@ -76,12 +77,14 @@ func getGitServer() string {
// GetUrl returns the ssh clone-url from an app.
func GetUrl(app string) string {
- return fmt.Sprintf("git@%s:%s.git", getGitServer(), app)
+ s := strings.Replace(getGitServer(), "http://", "", -1) // https?
+ return fmt.Sprintf("git@%s:%s.git", s, app)
}
// GetReadOnlyUrl returns the ssh url for communication with git-daemon.
func GetReadOnlyUrl(app string) string {
- return fmt.Sprintf("git://%s/%s.git", getGitServer(), app)
+ s := strings.Replace(getGitServer(), "http://", "", -1) // https?
+ return fmt.Sprintf("git://%s/%s.git", s, app)
}
// GetPath returns the path to the repository where the app code is in its | repository: fixing repository url by removing the protocol | tsuru_tsuru | train | go |
d02e4bdbecd2b3e1c39d1f065c147c24f699cc2f | diff --git a/parser.go b/parser.go
index <HASH>..<HASH> 100644
--- a/parser.go
+++ b/parser.go
@@ -449,10 +449,10 @@ func GetBoolean(data []byte, keys ...string) (val bool, err error) {
// ParseBoolean parses a Boolean ValueType into a Go bool (not particularly useful, but here for completeness)
func ParseBoolean(b []byte) (bool, error) {
- switch b[0] {
- case 't':
+ switch {
+ case bytes.Equal(b, trueLiteral):
return true, nil
- case 'f':
+ case bytes.Equal(b, falseLiteral):
return false, nil
default:
return false, MalformedValueError | Made ParseBoolean more robust
(It's not a performance-critical function so I think this should be
fine.) | buger_jsonparser | train | go |
3340234785351ef4680421f5c07f5706bd1524e0 | diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/ORM/UnitOfWork.php
+++ b/lib/Doctrine/ORM/UnitOfWork.php
@@ -2356,6 +2356,7 @@ class UnitOfWork implements PropertyChangedListener
$this->collectionUpdates =
$this->extraUpdates =
$this->readOnlyObjects =
+ $this->visitedCollections =
$this->orphanRemovals = array();
if ($this->commitOrderCalculator !== null) { | Clear visitedCollections
Visited collections are cleared only in commit(). Commit clears up only if it actually has something to do. Processing large amounts of records without changing them cause visitedCollections to grow without any way of clearing. | doctrine_orm | train | php |
be93f9a14fadfbaf3aabfba544f04bb0a1dcb9f2 | diff --git a/lib/bibtex/entry/rdf_converter.rb b/lib/bibtex/entry/rdf_converter.rb
index <HASH>..<HASH> 100644
--- a/lib/bibtex/entry/rdf_converter.rb
+++ b/lib/bibtex/entry/rdf_converter.rb
@@ -418,6 +418,7 @@ class BibTeX::Entry::RDFConverter
case bibtex[:type]
when 'mathesis' then bibo['degrees/ma']
when 'phdthesis' then bibo['degrees/phd']
+ when /Dissertation/i then bibo['degrees/phd']
when /Bachelor['s]{0,2} Thesis/i then "Bachelor's Thesis"
when /Diplomarbeit/i then bibo['degrees/ms']
when /Magisterarbeit/i then bibo['degrees/ma'] | Add "Dissertation" to #thesis_degree | inukshuk_bibtex-ruby | train | rb |
afba6ce907287f495fea05c01caa2b3d51b3cdbf | diff --git a/doc/en/conf.py b/doc/en/conf.py
index <HASH>..<HASH> 100644
--- a/doc/en/conf.py
+++ b/doc/en/conf.py
@@ -115,7 +115,9 @@ html_theme = 'flask'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
-html_theme_options = {}
+html_theme_options = {
+ 'index_logo': None
+}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = [] | doc: Don't show not existing logo | vmalloc_dessert | train | py |
d399214d475d3cbd1902ebc73e2f32d844a189bb | diff --git a/lib/nugrant/version.rb b/lib/nugrant/version.rb
index <HASH>..<HASH> 100644
--- a/lib/nugrant/version.rb
+++ b/lib/nugrant/version.rb
@@ -1,3 +1,3 @@
module Nugrant
- VERSION = "0.0.14"
+ VERSION = "0.0.15.dev"
end | Bumped to <I>.dev | maoueh_nugrant | train | rb |
b6d1fc458e30fbf77906021cefbcc3cd8227b422 | diff --git a/plenum/test/restart/test_restart_to_inconsistent_state.py b/plenum/test/restart/test_restart_to_inconsistent_state.py
index <HASH>..<HASH> 100644
--- a/plenum/test/restart/test_restart_to_inconsistent_state.py
+++ b/plenum/test/restart/test_restart_to_inconsistent_state.py
@@ -115,4 +115,4 @@ def test_restart_half_to_lower_view(looper, txnPoolNodeSet, tconf, tdir, allPlug
assert node.spylog.count(node.on_inconsistent_3pc_state) == 0
# Check that all nodes are still functional
- sdk_ensure_pool_functional(looper, txnPoolNodeSet, sdk_wallet_client, sdk_pool_handle)
+ sdk_ensure_pool_functional(looper, txnPoolNodeSet, sdk_wallet_client, sdk_pool_handle, num_reqs=2, num_batches=1) | Decrease number of pool checking reqs | hyperledger_indy-plenum | train | py |
deb6b061ceb08608414ec1bec53eda999f9c69ea | diff --git a/src/installer/lombok/installer/IdeFinder.java b/src/installer/lombok/installer/IdeFinder.java
index <HASH>..<HASH> 100644
--- a/src/installer/lombok/installer/IdeFinder.java
+++ b/src/installer/lombok/installer/IdeFinder.java
@@ -126,7 +126,7 @@ public abstract class IdeFinder {
String prop = System.getProperty("os.name", "").toLowerCase();
if (prop.matches("^.*\\bmac\\b.*$")) return OS.MAC_OS_X;
if (prop.matches("^.*\\bdarwin\\b.*$")) return OS.MAC_OS_X;
- if (prop.matches("^.*\\bwin(dows)\\b.*$")) return OS.WINDOWS;
+ if (prop.matches("^.*\\bwindows\\b.*$")) return OS.WINDOWS;
return OS.UNIX;
} | Detector regexp for windows had a pointless grouping in it. | rzwitserloot_lombok | train | java |
c329a63b07f4144ce4064acfc138b77f14145485 | diff --git a/savepagenow/api.py b/savepagenow/api.py
index <HASH>..<HASH> 100644
--- a/savepagenow/api.py
+++ b/savepagenow/api.py
@@ -8,7 +8,6 @@ from .exceptions import (
BlockedByRobots
)
from urllib.parse import urljoin
-from requests.utils import parse_header_links
def capture(
@@ -51,14 +50,11 @@ def capture(
if response.status_code in [403, 502, 520]:
raise WaybackRuntimeError(response.headers)
- # Parse the Link tag in the header, which points to memento URLs in Wayback
- header_links = parse_header_links(response.headers['Link'])
-
# The link object marked as the `memento` is the one we want to return
try:
- archive_obj = [h for h in header_links if h['rel'] == 'memento'][0]
- archive_url = archive_obj['url']
- except (IndexError, KeyError):
+ content_location = response.headers['Content-Location']
+ archive_url = domain + content_location
+ except KeyError:
raise WaybackRuntimeError(dict(status_code=response.status_code, headers=response.headers))
# Determine if the response was cached | Changed api access to match changes to archive.org responses | pastpages_savepagenow | train | py |
e0e93e134200a0daaa9fb73587f42b893b5738d1 | diff --git a/pythran/toolchain.py b/pythran/toolchain.py
index <HASH>..<HASH> 100644
--- a/pythran/toolchain.py
+++ b/pythran/toolchain.py
@@ -469,11 +469,12 @@ def compile_pythranfile(file_path, output_file=None, module_name=None,
kwargs.setdefault('specs', specs)
try:
- output_file = compile_pythrancode(module_name, open(file_path).read(),
- output_file=output_file,
- cpponly=cpponly, pyonly=pyonly,
- module_dir=module_dir,
- **kwargs)
+ with open(file_path) as fd:
+ output_file = compile_pythrancode(module_name, fd.read(),
+ output_file=output_file,
+ cpponly=cpponly, pyonly=pyonly,
+ module_dir=module_dir,
+ **kwargs)
except PythranSyntaxError as e:
if e.filename is None:
e.filename = file_path | Make sure pythran always properly closes the file it compiles
(should) fix #<I> | serge-sans-paille_pythran | train | py |
aa3cad542292b20cf441e7501baa041d9e5e85cf | diff --git a/lib/Gitlab/Api/Groups.php b/lib/Gitlab/Api/Groups.php
index <HASH>..<HASH> 100644
--- a/lib/Gitlab/Api/Groups.php
+++ b/lib/Gitlab/Api/Groups.php
@@ -30,9 +30,12 @@ class Groups extends AbstractApi
return $this->post('groups/'.urlencode($group_id).'/projects/'.urlencode($project_id));
}
- public function members($id)
+ public function members($id, $page = 1, $per_page = self::PER_PAGE)
{
- return $this->get('groups/'.urlencode($id).'/members');
+ return $this->get('groups/'.urlencode($id).'/members', array(
+ 'page=' => $page,
+ 'per_page' => $per_page
+ ));
}
public function addMember($group_id, $user_id, $access_level) | Add pagination support for api('groups')->members | m4tthumphrey_php-gitlab-api | train | php |
57e2e06602d63889493b0dfb872136e60ab3a54e | diff --git a/tofu/imas2tofu/_comp.py b/tofu/imas2tofu/_comp.py
index <HASH>..<HASH> 100644
--- a/tofu/imas2tofu/_comp.py
+++ b/tofu/imas2tofu/_comp.py
@@ -247,7 +247,7 @@ def get_fsig(sig):
lc = [(stack and nsig > 1 and isinstance(sig[0], np.ndarray)
and all([ss.shape == sig[0].shape for ss in sig[1:]])),
(stack and nsig > 1
- and type(sig[0]) in [int, float, np.int_, np.float_, str],
+ and type(sig[0]) in [int, float, np.int_, np.float_, str]),
(stack and nsig == 1
and type(sig) in [np.ndarray, list, tuple])]
diff --git a/tofu/version.py b/tofu/version.py
index <HASH>..<HASH> 100644
--- a/tofu/version.py
+++ b/tofu/version.py
@@ -1,2 +1,2 @@
# Do not edit, pipeline versioning governed by git tags!
-__version__ = '1.4.3b4-121-g6a0efefa'
+__version__ = '1.4.3b4-122-g14660c54' | [Issue<I>] PEP8 Compliance 5 | ToFuProject_tofu | train | py,py |
435d7db84a2073cec9614ad62ea179c24f4f92af | diff --git a/lib/chef/provider/service/debian.rb b/lib/chef/provider/service/debian.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/provider/service/debian.rb
+++ b/lib/chef/provider/service/debian.rb
@@ -78,7 +78,7 @@ class Chef
if line =~ /^### BEGIN INIT INFO/
in_info = true
elsif line =~ /^### END INIT INFO/
- in_info = false
+ break acc
elsif in_info
if line =~ /Default-(Start|Stop):\s+(\d.*)/
acc << $2.split(" ") | stop parsing init script at the "### END INIT INFO" marker. | chef_chef | train | rb |
5a0a2369e08a141a9a5bc8f091c4fc0522b07fa3 | diff --git a/openupgradelib/openupgrade.py b/openupgradelib/openupgrade.py
index <HASH>..<HASH> 100644
--- a/openupgradelib/openupgrade.py
+++ b/openupgradelib/openupgrade.py
@@ -2032,7 +2032,7 @@ def add_fields(env, field_spec):
It's intended for being run in pre-migration scripts for pre-populating
fields that are going to be declared later in the module.
- NOTE: This only works in >=v8 and is not needed in >=v12, as now Odoo
+ NOTE: This only works in >=v9 and is not needed in >=v12, as now Odoo
always add the XML-ID entry:
https://github.com/odoo/odoo/blob/9201f92a4f29a53a014b462469f27b32dca8fc5a/
odoo/addons/base/models/ir_model.py#L794-L802, but you can still call | [FIX] add_fields: Valid since v9, not v8 | OCA_openupgradelib | train | py |
45be0cde6f51d63a856027cbbbf516ba4acf7ce8 | diff --git a/bubbletools/__init__.py b/bubbletools/__init__.py
index <HASH>..<HASH> 100644
--- a/bubbletools/__init__.py
+++ b/bubbletools/__init__.py
@@ -3,4 +3,4 @@ from bubbletools.validator import validate
from bubbletools.bbltree import BubbleTree
-__version__ = '0.6.7.dev0'
+__version__ = '0.6.7' | Preparing release <I> | Aluriak_bubble-tools | train | py |
85eebfe78f37e7cb2227ed96576318de222a6b2a | diff --git a/spyder/utils/syntaxhighlighters.py b/spyder/utils/syntaxhighlighters.py
index <HASH>..<HASH> 100644
--- a/spyder/utils/syntaxhighlighters.py
+++ b/spyder/utils/syntaxhighlighters.py
@@ -981,7 +981,10 @@ class MarkdownSH(BaseSH):
self.setCurrentBlockState(previous_state)
match = self.PROG.search(text)
- while match:
+ match_count = 0
+ n_characters = len(text)
+
+ while match and match_count< n_characters:
for key, value in list(match.groupdict().items()):
start, end = match.span(key)
@@ -1006,6 +1009,7 @@ class MarkdownSH(BaseSH):
self.setFormat(start, end - start, self.formats[key])
match = self.PROG.search(text, match.end())
+ match_count += 1
self.highlight_spaces(text) | Add break condition to Markdown syntax highlighter to avoid it to be trapped in an infinite loop. | spyder-ide_spyder | train | py |
58d88de0c8b3380154ea28b281af71eecc2baf1d | diff --git a/testutils.py b/testutils.py
index <HASH>..<HASH> 100644
--- a/testutils.py
+++ b/testutils.py
@@ -186,6 +186,16 @@ class InvenioTestCase(TestCase):
app.testing = True
return app
+ def login(self, username, password):
+ from flask import request
+ return self.client.post('/youraccount/login',
+ base_url=rewrite_to_secure_url(request.base_url),
+ data=dict(nickname=username, password=password),
+ follow_redirects=True)
+
+ def logout(self):
+ return self.client.get('/youraccount/logout', follow_redirects=True)
+
class FlaskSQLAlchemyTest(InvenioTestCase):
@@ -199,16 +209,6 @@ class FlaskSQLAlchemyTest(InvenioTestCase):
db.session.rollback()
db.drop_all()
- def login(self, username, password):
- from flask import request
- return self.client.post('/youraccount/login',
- base_url=rewrite_to_secure_url(request.base_url),
- data=dict(nickname=username, password=password),
- follow_redirects=True)
-
- def logout(self):
- return self.client.get('/youraccount/logout', follow_redirects=True)
-
@nottest
def make_flask_test_suite(*test_cases): | testutils: login and logout in InvenioTestCase
* Moves methods `login` and `logout` to `InvenioTestCase`.
* One can use `self.login('romeo', 'r<I>omeo')` inside tests
instead of manually filling and posting the form. | inveniosoftware-attic_invenio-utils | train | py |
7c259cd1eef96cec8e69abaa4cfbfaa173f239d3 | diff --git a/packages/react-bootstrap-table2-toolkit/src/search/SearchBar.js b/packages/react-bootstrap-table2-toolkit/src/search/SearchBar.js
index <HASH>..<HASH> 100644
--- a/packages/react-bootstrap-table2-toolkit/src/search/SearchBar.js
+++ b/packages/react-bootstrap-table2-toolkit/src/search/SearchBar.js
@@ -69,6 +69,7 @@ class SearchBar extends React.Component {
id={ `search-bar-${tableId}` }
type="text"
style={ style }
+ aria-label="enter text you want to search"
onKeyUp={ () => this.onKeyup() }
onChange={ this.onChangeValue }
className={ `form-control ${className}` } | Add aria-label to search input (#<I>) | react-bootstrap-table_react-bootstrap-table2 | train | js |
d8fbc8e816b1c7f90fcc21c7d887204ab746caf8 | diff --git a/test/com/opera/core/systems/OperaLauncherRunnerTest.java b/test/com/opera/core/systems/OperaLauncherRunnerTest.java
index <HASH>..<HASH> 100644
--- a/test/com/opera/core/systems/OperaLauncherRunnerTest.java
+++ b/test/com/opera/core/systems/OperaLauncherRunnerTest.java
@@ -142,7 +142,8 @@ public class OperaLauncherRunnerTest extends OperaDriverTestCase {
runner = new OperaLauncherRunner(settings);
fail("Did not throw OperaRunnerException");
} catch (OperaRunnerException e) {
- assertTrue("Throws timeout error", e.getMessage().toLowerCase().contains("timeout"));
+ assertTrue("Expected a timeout exception, got: " + e,
+ e.getMessage().toLowerCase().contains("timeout"));
}
} | Making assertion clearer if it fails | operasoftware_operaprestodriver | train | java |
b8a5b55f62365078b882782e46b65f26e4dc265b | diff --git a/lib/reporters/console.js b/lib/reporters/console.js
index <HASH>..<HASH> 100644
--- a/lib/reporters/console.js
+++ b/lib/reporters/console.js
@@ -62,7 +62,7 @@ function _end(debug) {
} else {
failures.forEach(function (failure) {
- console.log(util.format('\n---\n%s%s> %s',
+ console.error(util.format('\n---\n%s%s> %s',
failure.test.description ? failure.test.description + '\n' : '',
failure.test.file.cyan,
failure.test.command)); | Fix failure output ordering, failure header used to be logged async. | cliffano_cmdt | train | js |
ad1ea9411a6fd895b36e5f2f4fd43bace93ed12a | diff --git a/spec/pcore/map_spec.rb b/spec/pcore/map_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/pcore/map_spec.rb
+++ b/spec/pcore/map_spec.rb
@@ -104,6 +104,39 @@ describe 'Flor procedures' do
expect(r['point']).to eq('terminated')
expect(r['payload']['ret']).to eq([ 0, 1 ])
end
+
+ it 'maps thanks to the last fun in the block' do
+
+ flon = %{
+ map [ 0, 1 ]
+ define sum x
+ set y (+ y 1)
+ + x y
+ set y 2
+ sum
+ }
+
+ r = @executor.launch(flon)
+
+ expect(r['point']).to eq('terminated')
+ expect(r['payload']['ret']).to eq([ 3, 5 ])
+ end
+
+ it 'maps thanks to the last fun in the block' do
+
+ flon = %{
+ map [ 0, 1 ]
+ set y 1
+ def x
+ set y (+ y 1)
+ + x y
+ }
+
+ r = @executor.launch(flon)
+
+ expect(r['point']).to eq('terminated')
+ expect(r['payload']['ret']).to eq([ 2, 4 ])
+ end
end
end | Add specs for "map" and function blocks | floraison_flor | train | rb |
f6e91155d3cf1402633292140bc0adf05f4ddb9b | diff --git a/tests/Unit/bootstrap.php b/tests/Unit/bootstrap.php
index <HASH>..<HASH> 100644
--- a/tests/Unit/bootstrap.php
+++ b/tests/Unit/bootstrap.php
@@ -3,3 +3,22 @@
chdir(__DIR__ . '/../..');
require_once __DIR__ . '/../../vendor/autoload.php';
+
+// Closure autoloader from
+// https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader-examples.md#closure-example
+
+spl_autoload_register(function ($class) {
+ $prefix = 'Brera\\';
+ $len = strlen($prefix);
+ if (strncmp($prefix, $class, $len) !== 0) {
+ return;
+ }
+
+ $relativeClass = substr($class, $len);
+
+ $file = __DIR__ . '/Suites/' . str_replace('\\', '/', $relativeClass) . '.php';
+
+ if (file_exists($file)) {
+ require $file;
+ }
+}); | Issue #<I>: Add PSR-4 compatible autoloader to unit test bootstrap so classes can be PSR-2 compliant | lizards-and-pumpkins_catalog | train | php |
96a04afc3b6c8e45a0cda32ed12dc2dea77827e1 | diff --git a/lib/foreman_ansible/version.rb b/lib/foreman_ansible/version.rb
index <HASH>..<HASH> 100644
--- a/lib/foreman_ansible/version.rb
+++ b/lib/foreman_ansible/version.rb
@@ -4,5 +4,5 @@
# This way other parts of Foreman can just call ForemanAnsible::VERSION
# and detect what version the plugin is running.
module ForemanAnsible
- VERSION = '6.4.1'
+ VERSION = '7.0.0'
end | Bump foreman_ansible to <I> | theforeman_foreman_ansible | 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.