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 |
|---|---|---|---|---|---|
7b0445ec6c019c03cc4a57975e84f02363d6f14f | diff --git a/pkg/cmd/server/kube_master.go b/pkg/cmd/server/kube_master.go
index <HASH>..<HASH> 100644
--- a/pkg/cmd/server/kube_master.go
+++ b/pkg/cmd/server/kube_master.go
@@ -47,7 +47,7 @@ func (cfg Config) BuildKubernetesMasterConfig(requestContextMapper kapi.RequestC
kmaster := &kubernetes.MasterConfig{
MasterIP: masterIP,
MasterPort: cfg.MasterAddr.Port,
- NodeHosts: cfg.NodeList,
+ NodeHosts: cfg.GetNodeList(),
PortalNet: &portalNet,
RequestContextMapper: requestContextMapper,
EtcdHelper: ketcdHelper, | fix nodelist access for kube master | openshift_origin | train | go |
ce015ce4f2becb89ed1db07c9f2f11422467a9ca | diff --git a/bin/mott.js b/bin/mott.js
index <HASH>..<HASH> 100755
--- a/bin/mott.js
+++ b/bin/mott.js
@@ -2,8 +2,6 @@
"use strict";
var mott,
- fs = require('fs-extra'),
- argv = require('optimist').argv,
path = require('path');
try{
@@ -15,6 +13,10 @@ catch(e){
require.paths.push(path.resolve(__dirname + '/../mott/node_modules'));
console.error(require.paths);
+
+var fs = require('fs-extra'),
+ argv = require('optimist').argv;
+
if(argv._[0] === 'new'){
var path = require('path'),
async = require('async'), | Blah wth is this bug... | imlucas_mott | train | js |
0f3691f6345c2b60b2eb781e5f5aaeaae339e295 | diff --git a/bigquery/client.py b/bigquery/client.py
index <HASH>..<HASH> 100644
--- a/bigquery/client.py
+++ b/bigquery/client.py
@@ -388,10 +388,10 @@ class BigQueryClient(object):
"sourceUris": source_uris,
}
- if max_bad_records:
+ if max_bad_records is not None:
configuration['maxBadRecords'] = max_bad_records
- if ignore_unknown_values:
+ if ignore_unknown_values is not None:
configuration['ignoreUnknownValues'] = ignore_unknown_values
if create_disposition:
@@ -421,10 +421,10 @@ class BigQueryClient(object):
if field_delimiter:
configuration['fieldDelimiter'] = field_delimiter
- if allow_jagged_rows:
+ if allow_jagged_rows is not None:
configuration['allowJaggedRows'] = allow_jagged_rows
- if allow_quoted_newlines:
+ if allow_quoted_newlines is not None:
configuration['allowQuotedNewlines'] = allow_quoted_newlines
if quote: | Fix truthy evaluation for boolean | tylertreat_BigQuery-Python | train | py |
1b41c0aaeafb94e844c90c36c38396dd3cc9d359 | diff --git a/version.go b/version.go
index <HASH>..<HASH> 100644
--- a/version.go
+++ b/version.go
@@ -1,4 +1,4 @@
package gock
// Version defines the current package semantic version.
-const Version = "1.0.13"
+const Version = "1.0.14" | feat(version): bump to <I> | h2non_gock | train | go |
e29c800c87c82411fde0526b7e9dc96f9ba28e71 | diff --git a/solvebio/resource/object.py b/solvebio/resource/object.py
index <HASH>..<HASH> 100644
--- a/solvebio/resource/object.py
+++ b/solvebio/resource/object.py
@@ -592,13 +592,9 @@ class Object(CreateableAPIResource,
if not self.is_dataset:
raise SolveError("Only datasets can be restored.")
- # The default storage class for most accounts is Standard
- # This is simplest for now. We could also:
- # - choose the Vault.default_storage_class if set
- # - the Account.default_storage_class if set (and exposed?)
- # - get the most recent Dataset snapshot task and pull config from there
+ # By default, datasets will be restored to Standard-IA
if not storage_class:
- self.storage_class = "Standard"
+ storage_class = "Standard-IA"
# Updating storage class is only available at the objects endpoint
self.storage_class = storage_class | fix default restore storage class, change to Standard-IA instead of Standard (#<I>) | solvebio_solvebio-python | train | py |
9a2115181b211fa8c9fb0e86172b6412b061b037 | diff --git a/command/config.go b/command/config.go
index <HASH>..<HASH> 100644
--- a/command/config.go
+++ b/command/config.go
@@ -53,9 +53,10 @@ func LoadConfig(path string) (*DefaultConfig, error) {
path = v
}
+ // NOTE: requires HOME env var to be set
path, err := homedir.Expand(path)
if err != nil {
- return nil, fmt.Errorf("Error expanding config path: %s", err)
+ return nil, fmt.Errorf("Error expanding config path %s: %s", path, err)
}
contents, err := ioutil.ReadFile(path) | Improve error handling re: homedir expansion
Useful if the HOME envvar is not set because `vault` was launched in a clean environment (e.g. `env -i vault ...`). | hashicorp_vault | train | go |
a6f625c5c6a8eea467f5e91ae6aee5e80101e1a0 | diff --git a/test/integration/offline.js b/test/integration/offline.js
index <HASH>..<HASH> 100644
--- a/test/integration/offline.js
+++ b/test/integration/offline.js
@@ -76,7 +76,7 @@ describe('Offline', () => {
});
context('handling html', () => {
- it.skip('should handle html end point configuration', (done) => {
+ it('should handle html end point configuration', (done) => {
const offLine = new OffLineBuilder().addFunctionConfig('index', {
handler: 'users.index',
events: [{
@@ -96,7 +96,7 @@ describe('Offline', () => {
}, (event, context, cb) => cb(null, 'Hello World')).toObject();
offLine.inject("/index", (res) => {
- expect(res.statusCode).to.eq(200);
+ expect(res.statusCode).to.eq('200');
done();
});
}); | Unskipped html integration test | dherault_serverless-offline | train | js |
e1ab188f960cd38b8d90c3de26b5345da658d840 | diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/resource_spec.rb
+++ b/spec/unit/resource_spec.rb
@@ -71,6 +71,12 @@ class Banana < Fruit
property :type, Discriminator
end
+class Cyclist
+ include DataMapper::Resource
+ property :id, Integer, :serial => true
+ property :victories, Integer
+end
+
# rSpec completely FUBARs everything if you give it a Module here.
# So we give it a String of the module name instead.
# DO NOT CHANGE THIS!
@@ -178,6 +184,13 @@ describe "DataMapper::Resource" do
resource.save.should be_false
end
+
+ it "for an integer field, should save a string as nil" do
+ resource = Cyclist.new
+ resource.victories = "none"
+ resource.save.should be_true
+ resource.victories.should == nil
+ end
end
describe 'with an existing resource' do | Added failing spec to show problem
See this thread for discussion:
* <URL> | datamapper_dm-core | train | rb |
750efa5769d9d8c16c570104c9bf83616e88a45a | diff --git a/cpuinfo/cpuinfo.py b/cpuinfo/cpuinfo.py
index <HASH>..<HASH> 100644
--- a/cpuinfo/cpuinfo.py
+++ b/cpuinfo/cpuinfo.py
@@ -671,6 +671,7 @@ class CPUID(object):
# Get the Extended CPU flags
extended_flags = {}
+ # https://en.wikipedia.org/wiki/CPUID#EAX.3D80000001h:_Extended_Processor_Info_and_Feature_Bits
if max_extension_support >= 0x80000001:
# EBX
ebx = self._run_asm( | Added more links to CPUID documentation | workhorsy_py-cpuinfo | train | py |
0d349dd496e8278eba49216b3efe7d14546fe82d | diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/CachePoolsTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/CachePoolsTest.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/CachePoolsTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/CachePoolsTest.php
@@ -13,6 +13,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\Cache\Adapter\RedisAdapter;
+use Symfony\Component\Cache\Exception\InvalidArgumentException;
class CachePoolsTest extends WebTestCase
{
@@ -33,6 +34,11 @@ class CachePoolsTest extends WebTestCase
throw $e;
}
$this->markTestSkipped($e->getMessage());
+ } catch (InvalidArgumentException $e) {
+ if (0 !== strpos($e->getMessage(), 'Redis connection failed')) {
+ throw $e;
+ }
+ $this->markTestSkipped($e->getMessage());
}
} | [FrameworkBundle] Skip redis cache pools test on failed connection | symfony_symfony | train | php |
19e98b0e2e17711283cb247331c0962ce63b419d | diff --git a/lib/kjess/connection.rb b/lib/kjess/connection.rb
index <HASH>..<HASH> 100644
--- a/lib/kjess/connection.rb
+++ b/lib/kjess/connection.rb
@@ -32,8 +32,11 @@ module KJess
#
# Returns a TCPSocket
def socket
+ close if @pid && @pid != Process.pid
return @socket if @socket and not @socket.closed?
- return @socket = connect()
+ @socket = connect()
+ @pid = Process.pid
+ return @socket
end
# Internal: Create the socket we use to talk to the Kestrel server | Ensure we aren't sharing sockets across processes
Adds a check to see if the pid that connected to kestrel is the same as the
current pid. | copiousfreetime_kjess | train | rb |
a579b5bc681e2a43385e6d0cb0229a69ba090f7e | diff --git a/src/main/java/water/api/NNProgressPage.java b/src/main/java/water/api/NNProgressPage.java
index <HASH>..<HASH> 100644
--- a/src/main/java/water/api/NNProgressPage.java
+++ b/src/main/java/water/api/NNProgressPage.java
@@ -19,7 +19,7 @@ public class NNProgressPage extends Progress2 {
Job jjob = Job.findJob(job_key);
if (jjob ==null) return true;
NNModel m = UKV.get(jjob.dest());
- if (m!=null) m.generateHTML("NeuralNet Model", sb);
+ if (m!=null) m.generateHTML("NeuralNet2 Model", sb);
else DocGen.HTML.paragraph(sb, "Pending...");
return true;
} | Update naming for NeuralNet2 Progress. | h2oai_h2o-2 | train | java |
017f97e50d2e5a815e877cc254e4fc1dc1332495 | diff --git a/littlechef/runner.py b/littlechef/runner.py
index <HASH>..<HASH> 100644
--- a/littlechef/runner.py
+++ b/littlechef/runner.py
@@ -59,7 +59,7 @@ def new_kitchen():
_mkdir("nodes")
_mkdir("roles")
_mkdir("data_bags")
- for cookbook_path in cookbook_paths:
+ for cookbook_path in settings.cookbook_paths:
_mkdir(cookbook_path)
# Add skeleton auth.cfg
if not os.path.exists("auth.cfg"): | Recent refactoring removed cookbook_paths import from settings. Fixed. | tobami_littlechef | train | py |
b20e0f96bd803616997ee8403e5d23ef723208ca | diff --git a/passpie/importers/default_importer.py b/passpie/importers/default_importer.py
index <HASH>..<HASH> 100644
--- a/passpie/importers/default_importer.py
+++ b/passpie/importers/default_importer.py
@@ -1,4 +1,5 @@
import yaml
+from yaml.reader import ReaderError
from yaml.scanner import ScannerError
from passpie.importers import BaseImporter
@@ -15,7 +16,7 @@ class DefaultImporter(BaseImporter):
try:
dict_content = yaml.load(file_content)
- except ScannerError:
+ except (ReaderError, ScannerError):
return False
try: | added another exception handling for the default importer | marcwebbie_passpie | train | py |
3232c91b8ede8ca86e8962981d881af78875542f | diff --git a/webbrowser.go b/webbrowser.go
index <HASH>..<HASH> 100644
--- a/webbrowser.go
+++ b/webbrowser.go
@@ -75,6 +75,7 @@ func init() {
var (
osCommand = map[string]*browserCommand{
+ "android": &browserCommand{"xdg-open", nil},
"darwin": &browserCommand{"open", nil},
"freebsd": &browserCommand{"xdg-open", nil},
"linux": &browserCommand{"xdg-open", nil}, | Android support Thanks @ashleynykiel ! | toqueteos_webbrowser | train | go |
c5085841187f9927971d19ffaf95b6efeea68517 | diff --git a/spec/addressable/uri_spec.rb b/spec/addressable/uri_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/addressable/uri_spec.rb
+++ b/spec/addressable/uri_spec.rb
@@ -1823,6 +1823,12 @@ describe Addressable::URI, "when parsed from " +
end).to raise_error(Addressable::URI::InvalidURIError)
end
+ it "should not allow origin assignment with bogus type" do
+ expect(lambda do
+ @uri.origin = :bogus
+ end).to raise_error(TypeError)
+ end
+
# Section 6.2.3 of RFC 3986
it "should be equivalent to http://example.com/" do
expect(@uri).to eq(Addressable::URI.parse("http://example.com/")) | Adding test for origin assignment type error. | sporkmonger_addressable | train | rb |
351132c4cb07284a8910f4a0fadc162de03d338c | diff --git a/src/Pasoonate.js b/src/Pasoonate.js
index <HASH>..<HASH> 100644
--- a/src/Pasoonate.js
+++ b/src/Pasoonate.js
@@ -4,10 +4,10 @@ import DateFormat from './formatter/DateFormat';
import SimpleDateFormat from './formatter/SimpleDateFormat';
import CalendarManager from './calendar/CalendarManager';
-class Pasoonate extends Constants {
+class Pasoonate {
constructor () {
- super();
+
}
static make (timestamp, timezoneOffset) {
@@ -35,6 +35,8 @@ class Pasoonate extends Constants {
}
}
+Object.assign(Pasoonate, Constants);
+
Pasoonate.localization = new Localization();
Object.defineProperty(Pasoonate, 'localization', {
writable: false, | Assign the Constants object to the Pasoonate class. | pasoonate_pasoonate-js | train | js |
d5f7518921d0f632a376185265e4c7feba224f60 | diff --git a/core/interpreter/src/main/java/org/overture/interpreter/utilities/pattern/LengthFinder.java b/core/interpreter/src/main/java/org/overture/interpreter/utilities/pattern/LengthFinder.java
index <HASH>..<HASH> 100644
--- a/core/interpreter/src/main/java/org/overture/interpreter/utilities/pattern/LengthFinder.java
+++ b/core/interpreter/src/main/java/org/overture/interpreter/utilities/pattern/LengthFinder.java
@@ -4,6 +4,7 @@ import org.overture.ast.analysis.AnalysisException;
import org.overture.ast.analysis.AnswerAdaptor;
import org.overture.ast.node.INode;
import org.overture.ast.patterns.AConcatenationPattern;
+import org.overture.ast.patterns.AExpressionPattern;
import org.overture.ast.patterns.AIdentifierPattern;
import org.overture.ast.patterns.AIgnorePattern;
import org.overture.ast.patterns.AMapPattern;
@@ -56,6 +57,13 @@ public class LengthFinder extends AnswerAdaptor<Integer>
}
@Override
+ public Integer caseAExpressionPattern(AExpressionPattern pattern)
+ throws AnalysisException
+ {
+ return PPatternAssistantInterpreter.ANY; // Special value meaning "any length"
+ }
+
+ @Override
public Integer caseAMapPattern(AMapPattern pattern)
throws AnalysisException
{ | Expression patterns should be length ANY, fixes #<I> | overturetool_overture | train | java |
e2f140767b1d07ba771e749b0582337565a64890 | diff --git a/wire.py b/wire.py
index <HASH>..<HASH> 100644
--- a/wire.py
+++ b/wire.py
@@ -553,8 +553,8 @@ for before they are aborted and a |Timeout| error is returned to the \
client.''').
AddJsonParameter('type', '{string}',
'The type of operation to set the timeout for. Valid \
-values are: "script" for script timeouts and "implicit" for modifying the \
-implicit wait timeout.').
+values are: "script" for script timeouts, "implicit" for modifying the \
+implicit wait timeout and "page load" for setting a page load timeout.').
AddJsonParameter('ms', '{number}',
'The amount of time, in milliseconds, that time-limited'
' commands are permitted to run.')) | LukeIS: adding info about 'page load' that can be set on timeouts wire command
r<I> | SeleniumHQ_selenium | train | py |
643d1624bbea4f171d0930ad9e5c278a8101fb10 | diff --git a/test/core/Context.js b/test/core/Context.js
index <HASH>..<HASH> 100644
--- a/test/core/Context.js
+++ b/test/core/Context.js
@@ -212,13 +212,13 @@ define(["helper/Test", "Tone/core/Context", "Tone/core/Tone", "helper/Offline",
Tone.context.dispose();
});
- it("can have two instances running on the same page", function(){
+ /*it("can have two instances running on the same page", function(){
var baseUrl = "../test/html/";
if (window.__karma__){
baseUrl = "/base/test/html/";
}
return LoadHTML(baseUrl + "multiple_instances.html");
- });
+ });*/
});
/*it("Transport and Master instance is the same after running Tone.Offline", function(){ | removing faulty same_context test
for now | Tonejs_Tone.js | train | js |
0816598a84bc19a4f70c6cbb07c8c5691db3c164 | diff --git a/lib/ruby-debug/completion.rb b/lib/ruby-debug/completion.rb
index <HASH>..<HASH> 100644
--- a/lib/ruby-debug/completion.rb
+++ b/lib/ruby-debug/completion.rb
@@ -68,4 +68,4 @@ module Debugger
end
Object.send :include, Debugger::Completion::Command
-Debugger::Completion.start
+Debugger::Completion.start unless Bond.started? | Don't add completions when Bond has already started in script/console, thanks bundler | cldwalker_debugger-completion | train | rb |
f0576cd27f678ae1f7b4717c18d16c029220b863 | diff --git a/app/code/community/Aoe/Scheduler/Helper/Data.php b/app/code/community/Aoe/Scheduler/Helper/Data.php
index <HASH>..<HASH> 100755
--- a/app/code/community/Aoe/Scheduler/Helper/Data.php
+++ b/app/code/community/Aoe/Scheduler/Helper/Data.php
@@ -183,6 +183,11 @@ class Aoe_Scheduler_Helper_Data extends Mage_Core_Helper_Abstract
*/
public function matchesIncludeExclude($jobCode, array $include, array $exclude)
{
+ $include = array_filter(array_map('trim', $include));
+ $exclude = array_filter(array_map('trim', $exclude));
+
+ sort($include);
+ sort($exclude);
$key = $jobCode . '|' . implode(',', $include) . '|' . implode(',', $exclude);
static $cache = array(); | Normalize and sort arrays as they are user input and used in a cache key | AOEpeople_Aoe_Scheduler | train | php |
da3f104d75a8580c56bcff8af1d421a4035684d7 | diff --git a/lib/udongo.rb b/lib/udongo.rb
index <HASH>..<HASH> 100644
--- a/lib/udongo.rb
+++ b/lib/udongo.rb
@@ -11,6 +11,8 @@ require 'reform'
require 'rakismet'
module Udongo
+ PATH = File.expand_path('../../', __FILE__)
+
class << self
attr_writer :config
end | Add the general udongo path. | udongo_udongo | train | rb |
348c2ccac62b003cb7f1a2cae5d08045ef606c13 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,12 +3,12 @@ from setuptools import setup, find_packages
setup(
name='reportportal-client',
packages=find_packages(),
- version='3.1.0',
+ version='3.2.0',
description='Python client for Report Portal',
author='Artsiom Tkachou',
author_email='SupportEPMC-TSTReportPortal@epam.com',
url='https://github.com/reportportal/client-Python',
- download_url='https://github.com/reportportal/client-Python/tarball/3.0.0',
+ download_url='https://github.com/reportportal/client-Python/tarball/3.2.0',
license='GNU General Public License v3',
keywords=['testing', 'reporting', 'reportportal'],
classifiers=[], | bumped version to <I> | reportportal_client-Python | train | py |
f581c918367e525494be9bf4e4b25c373153d02d | diff --git a/Classes/lib/class.tx_kesearch_lib_searchresult.php b/Classes/lib/class.tx_kesearch_lib_searchresult.php
index <HASH>..<HASH> 100644
--- a/Classes/lib/class.tx_kesearch_lib_searchresult.php
+++ b/Classes/lib/class.tx_kesearch_lib_searchresult.php
@@ -220,7 +220,7 @@ class tx_kesearch_lib_searchresult
'<span class="hit">\0</span>';
foreach ($wordArray as $word) {
- $word = preg_quote($word);
+ $word = preg_quote($word, '/');
$word = htmlspecialchars($word);
$content = preg_replace('/(' . $word . ')/iu', $highlightedWord, $content);
} | [BUGFIX] Add missing delimiter information to preg_quote usage | teaminmedias-pluswerk_ke_search | train | php |
97041fac1cacb559c757a6625b15ed23f9a39afb | diff --git a/scraper/util.py b/scraper/util.py
index <HASH>..<HASH> 100644
--- a/scraper/util.py
+++ b/scraper/util.py
@@ -84,7 +84,9 @@ def git_repo_to_sloc(url):
Given a Git repository URL, returns number of lines of code based on cloc
Reference:
- - cloc: https://github.com/AlDanial/cloc
+ - cloc: https://github.com/AlDanial/cloc
+ - https://www.omg.org/spec/AFP/
+ - Another potential way to calculation effort
Sample cloc output:
{ | Added references to other effort calculation approaches | LLNL_scraper | train | py |
c755291678fe957392a030e12858b5e1327f678d | diff --git a/molgenis-core-ui/src/main/java/org/molgenis/ui/controller/StaticContentServiceImpl.java b/molgenis-core-ui/src/main/java/org/molgenis/ui/controller/StaticContentServiceImpl.java
index <HASH>..<HASH> 100644
--- a/molgenis-core-ui/src/main/java/org/molgenis/ui/controller/StaticContentServiceImpl.java
+++ b/molgenis-core-ui/src/main/java/org/molgenis/ui/controller/StaticContentServiceImpl.java
@@ -43,7 +43,7 @@ public class StaticContentServiceImpl implements StaticContentService
StaticContent staticContent = dataService.findOneById(STATIC_CONTENT, key, StaticContent.class);
if (staticContent == null)
{
- staticContent = staticContentFactory.create();
+ staticContent = staticContentFactory.create(key);
staticContent.setContent(content);
dataService.add(STATIC_CONTENT, staticContent);
} | Fix #<I> Creating StaticContent is no longer saved | molgenis_molgenis | train | java |
dcd8511fdc2b3da009598e6acd6f7cbaf8030862 | diff --git a/src/PatternLab/Installer.php b/src/PatternLab/Installer.php
index <HASH>..<HASH> 100644
--- a/src/PatternLab/Installer.php
+++ b/src/PatternLab/Installer.php
@@ -107,8 +107,11 @@ class Installer {
$destination = $fileItem[$source];
// depending on the source handle things differently. mirror if it ends in /*
- if ($source == "*") {
+ if (($source == "*") && ($destination == "*")) {
$fs->mirror($sourceBase."/assets/",$destinationBase."/");
+ } else if (($source == "*") && ($destination[strlen($source)-1] == "*")) {
+ $destination = rtrim($destination,"/*");
+ $fs->mirror($sourceBase."/assets/",$destinationBase."/".$destination);
} else if ($source[strlen($source)-1] == "*") {
$source = rtrim($source,"/*");
$destination = rtrim($destination,"/*"); | handling some other cases for moving files from assets | pattern-lab_patternlab-php-core | train | php |
7a48cf99313044125c0cfa8931204aba53c0421f | diff --git a/server/container_create_linux.go b/server/container_create_linux.go
index <HASH>..<HASH> 100644
--- a/server/container_create_linux.go
+++ b/server/container_create_linux.go
@@ -944,6 +944,10 @@ func addOCIBindMounts(ctx context.Context, mountLabel string, containerConfig *p
specgen.AddMount(m)
}
+ mountInfos, err := mount.GetMounts()
+ if err != nil {
+ return nil, nil, err
+ }
for _, m := range mounts {
dest := m.GetContainerPath()
if dest == "" {
@@ -973,10 +977,6 @@ func addOCIBindMounts(ctx context.Context, mountLabel string, containerConfig *p
options = append(options, "rbind")
// mount propagation
- mountInfos, err := mount.GetMounts()
- if err != nil {
- return nil, nil, err
- }
switch m.GetPropagation() {
case pb.MountPropagation_PROPAGATION_PRIVATE:
options = append(options, "rprivate") | server/addOCIBindMounts: speed up
There is no need to parse /proc/self/mountinfo for each bind mount.
This should give a nice container create speedup on a busy system. | cri-o_cri-o | train | go |
63cd37da6f7a9673f774437a548d980584640230 | diff --git a/push_notifications/fields.py b/push_notifications/fields.py
index <HASH>..<HASH> 100644
--- a/push_notifications/fields.py
+++ b/push_notifications/fields.py
@@ -46,7 +46,7 @@ class HexIntegerField(with_metaclass(models.SubfieldBase, models.BigIntegerField
return self.__class__.__name__
def get_prep_value(self, value):
- if value is None or value is "":
+ if value is None or value == "":
return None
value = int(value, 16)
# on postgres only, interpret as signed | use '==' for comparison against empty string instead of 'is' | jazzband_django-push-notifications | train | py |
b7206d4aebdf75f9cf2fa05944c74b0b253b6729 | diff --git a/net.go b/net.go
index <HASH>..<HASH> 100644
--- a/net.go
+++ b/net.go
@@ -410,8 +410,8 @@ func (m *Memberlist) sendLocalState(conn net.Conn) error {
// recvRemoteState is used to read the remote state from a connection
func readRemoteState(conn net.Conn) ([]pushNodeState, []byte, error) {
// Read the message type
- buf := []byte{0}
- if _, err := conn.Read(buf); err != nil {
+ buf := [1]byte{0}
+ if _, err := conn.Read(buf[:]); err != nil {
return nil, nil, err
}
msgType := uint8(buf[0]) | Use an array instead of a slice
/cc @armon - I'm not sure if this changes anything, but I'm hoping this
is a much easier hint to the compiler to just use some stack space since
the Go compiler can be dumb. | hashicorp_memberlist | train | go |
e9315d9ad392ae38d58696053eddc033d295c2cb | diff --git a/Resources/Private/JavaScript/Host/Service/FeedbackManager.js b/Resources/Private/JavaScript/Host/Service/FeedbackManager.js
index <HASH>..<HASH> 100644
--- a/Resources/Private/JavaScript/Host/Service/FeedbackManager.js
+++ b/Resources/Private/JavaScript/Host/Service/FeedbackManager.js
@@ -13,7 +13,6 @@ feedbackHandlers.registerAll({
'Neos.Neos.Ui:ReloadDocument': feedbackHandler.reloadDocument
});
-// TODO: looks as if this code is obsolete by now, as feedbackHandlers is nowhere to be found
class FeedbackManager {
constructor(store) {
this.store = store; | CLEANUP: Remove an incorrect todo comment | neos_neos-ui | train | js |
3277281f2db7dfd879c1e0c547d9a54b0923dcbe | diff --git a/grail/steps.py b/grail/steps.py
index <HASH>..<HASH> 100644
--- a/grail/steps.py
+++ b/grail/steps.py
@@ -52,6 +52,8 @@ class _RedirectOut(object):
def _should_skip_step():
if settings.disable_steps:
return True
+ if settings.export_mode:
+ return False
for filename, line_number, func_name, text in traceback.extract_stack():
if func_name in settings.skip_func:
return True
@@ -72,7 +74,7 @@ def _validate_step_info(step_info):
def _execute(step_info):
- if not settings.export_mode and _should_skip_step():
+ if _should_skip_step():
return step_info.run_function()
redirected_out = _RedirectOut() | Move condition into "_should_skip_step" method | wgnet_grail | train | py |
2f40b60145d9c4739e3fc9394dad05fdacc00dc4 | diff --git a/help.php b/help.php
index <HASH>..<HASH> 100644
--- a/help.php
+++ b/help.php
@@ -34,19 +34,21 @@ if (!empty($file)) {
// Get the list of parent languages.
if (empty($forcelang)) {
$langs = array(current_language(), get_string('parentlanguage'), 'en_utf8'); // Fallback
- // _local language packs take precedence
- $xlangs = array();
- foreach ($langs as $lang) {
- if (!empty($lang)) {
- $xlangs[] = $lang . '_local';
- $xlangs[] = $lang;
- }
- }
- $langs = $xlangs;
- unset($xlangs);
} else {
$langs = array($forcelang);
}
+
+ // _local language packs take precedence with both forced language and non-forced language settings
+ $xlangs = array();
+ foreach ($langs as $lang) {
+ if (!empty($lang)) {
+ $xlangs[] = $lang . '_local';
+ $xlangs[] = $lang;
+ }
+ }
+ $langs = $xlangs;
+ unset($xlangs);
+
// Define possible locations for help file similar to locations for language strings
// Note: Always retain module directory as before | _local language packs take precedence with both forced language and non-forced language settings.
Fixes reopened MDL-<I>. | moodle_moodle | train | php |
1d5b1b377a3bafadba23adcd7f096ef8f5ca9077 | diff --git a/vc_zoom/indico_vc_zoom/plugin.py b/vc_zoom/indico_vc_zoom/plugin.py
index <HASH>..<HASH> 100644
--- a/vc_zoom/indico_vc_zoom/plugin.py
+++ b/vc_zoom/indico_vc_zoom/plugin.py
@@ -154,7 +154,7 @@ class ZoomPlugin(VCPluginMixin, IndicoPlugin):
# webinar hosts cannot be changed through the API
form.host_choice.render_kw = {'disabled': True}
form.host_user.render_kw = {'disabled': True}
- else:
+ elif not form.is_submitted():
form.password.data = gen_random_password()
return form | VC/Zoom: Fix setting initial passcode | indico_indico-plugins | train | py |
b8cae541b6b10b38f0c506ee59b78b15670fc4a8 | diff --git a/examples/uibench/app.js b/examples/uibench/app.js
index <HASH>..<HASH> 100644
--- a/examples/uibench/app.js
+++ b/examples/uibench/app.js
@@ -79,7 +79,7 @@
}, InfernoDOM);
var tableRowTpl = t(function (classes, id, children) {
- return e('tr').props({ className: classes, 'data-id': id }).children(children).childrenType(ChildrenTypes.KEYED_LIST);
+ return e('tr').props({ className: classes, 'data-id': id }).key(id).children(children).childrenType(ChildrenTypes.KEYED_LIST);
}, InfernoDOM);
function tableRow(data) { | added keys back into uibench, perf went up! | infernojs_inferno | train | js |
e1ffdcc4ba1ed348aac51e54a260f015ff9a38f7 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -60,6 +60,7 @@ CLASSIFIERS = [
LONG_DESCRIPTION = text_of('README.rst') + '\n\n' + text_of('HISTORY.rst')
+ZIP_SAFE = False
params = {
'name': NAME,
@@ -77,6 +78,7 @@ params = {
'tests_require': TESTS_REQUIRE,
'test_suite': TEST_SUITE,
'classifiers': CLASSIFIERS,
+ 'zip_safe': ZIP_SAFE,
}
setup(**params) | Add 'zip_safe' == False to setup.py | python-openxml_python-docx | train | py |
962afd41b88ff4c13fc41b9333f1a9ad42b91606 | diff --git a/src/CollectionPathResolver.php b/src/CollectionPathResolver.php
index <HASH>..<HASH> 100644
--- a/src/CollectionPathResolver.php
+++ b/src/CollectionPathResolver.php
@@ -57,7 +57,7 @@ class CollectionPathResolver
private function getDefaultPermalink($data)
{
- return str_slug($data['filename']);
+ return str_slug($data['collection']) . '/' . str_slug($data['filename']);
}
private function parseShorthand($path, $data)
@@ -65,7 +65,7 @@ class CollectionPathResolver
preg_match_all('/\{(.*?)\}/', $path, $bracketedParameters);
if (count($bracketedParameters[0]) == 0) {
- return $path . '/' . $this->getDefaultPermalink($data);
+ return $path . '/' . str_slug($data['filename']);
}
$bracketedParametersReplaced = | Change default collection permalink to include collection name | tightenco_jigsaw | train | php |
16bbe287b92151985670be55f9b3b9933be8707f | diff --git a/helmsman.js b/helmsman.js
index <HASH>..<HASH> 100644
--- a/helmsman.js
+++ b/helmsman.js
@@ -116,7 +116,9 @@ function Helmsman(options){
path: file
};
- var commandData;
+ // We get the defaults as a minimum if there's no strategy for the
+ // extension and no custom fillCommandData function specified
+ var commandData = _.clone(defaultCommandData);
// Load the command data from the metadata option if present
if (options.metadata[name]) { | Fix for non-JS, non-custom commands | mattmcmanus_node-helmsman | train | js |
b3c46b79bf07cf6dceba4a73d428a9adee7d0081 | diff --git a/libexec/sendmailservice.py b/libexec/sendmailservice.py
index <HASH>..<HASH> 100755
--- a/libexec/sendmailservice.py
+++ b/libexec/sendmailservice.py
@@ -73,7 +73,13 @@ msg['To'] = args.to
#
# According to RFC 2046, the last part of a multipart message, in this
# case the HTML message, is best and preferred.
+#
+# :fixme: need to encode the body if not ascii, see
+# http://mg.pov.lt/blog/unicode-emails-in-python.html for a nice
+# solution.
+#
msg.attach(MIMEText(TEXT_template % vars(args), 'plain'))
+# :fixme: need to html-escape all values and encode the body
msg.attach(MIMEText(HTML_template % vars(args), 'html'))
# Send the message via local SMTP server. | Add comments about work still to do (encoding, escaping). | Alignak-monitoring_alignak | train | py |
25cc942982d05171e1ae0990fcdf18e98b30ebfa | diff --git a/lib/alchemy/engine.rb b/lib/alchemy/engine.rb
index <HASH>..<HASH> 100644
--- a/lib/alchemy/engine.rb
+++ b/lib/alchemy/engine.rb
@@ -45,5 +45,16 @@ module Alchemy
end
end
end
+
+ initializer "alchemy.webp-mime_type" do
+ # Rails does not know anything about webp even in 2022
+ unless Mime::Type.lookup_by_extension(:webp)
+ Mime::Type.register("image/webp", :webp)
+ end
+ # Dragonfly uses Rack to read the mime type and guess what
+ unless Rack::Mime::MIME_TYPES[".webp"]
+ Rack::Mime::MIME_TYPES[".webp"] = "image/webp"
+ end
+ end
end
end | Register webp as mime type
Rails <I> does not have a image/webp mime type registered. | AlchemyCMS_alchemy_cms | train | rb |
3d0a8c4c5980d7e2792f2255bbb9a88fb7723ff9 | diff --git a/src/Psalm/Internal/TypeVisitor/ImmutablePropertyAssignmentVisitor.php b/src/Psalm/Internal/TypeVisitor/ImmutablePropertyAssignmentVisitor.php
index <HASH>..<HASH> 100644
--- a/src/Psalm/Internal/TypeVisitor/ImmutablePropertyAssignmentVisitor.php
+++ b/src/Psalm/Internal/TypeVisitor/ImmutablePropertyAssignmentVisitor.php
@@ -8,6 +8,7 @@ use Psalm\IssueBuffer;
use Psalm\Issue\ImpurePropertyAssignment;
use Psalm\Type\NodeVisitor;
use Psalm\Type\Union;
+use Psalm\Type\Atomic\TClassString;
use Psalm\Type\Atomic\TNamedObject;
use Psalm\Type\TypeNode;
@@ -30,6 +31,10 @@ class ImmutablePropertyAssignmentVisitor extends NodeVisitor
return NodeVisitor::DONT_TRAVERSE_CHILDREN;
}
+ if ($type instanceof TClassString) {
+ return NodeVisitor::DONT_TRAVERSE_CHILDREN;
+ }
+
if ($type instanceof TNamedObject) {
$codebase = $this->statements_analyzer->getCodebase(); | Fix #<I> - allow storing references to class-strings inside immutable | vimeo_psalm | train | php |
3b4ba0519d657ba4027e98d605ae95cd0cdb19d3 | diff --git a/gerrit/ssh.py b/gerrit/ssh.py
index <HASH>..<HASH> 100644
--- a/gerrit/ssh.py
+++ b/gerrit/ssh.py
@@ -36,7 +36,7 @@ class Client(object):
self.host = conf['hostname']
self.port = int(conf.get('port', self.port))
- self.username = conf.get('user', self.user)
+ self.user = conf.get('user', self.user)
self.key = conf.get('identityfile', self.key)
@property | Fixed a bug with username being set in ssh config.
Code was incorrectly setting self.username which
was then not used. Switched to self.user and it
now passes the user set in the ssh config. | flaper87_python-gerrit | train | py |
dbfb8e6f897889f2baabdd1e50145a1762044683 | diff --git a/sass_processor/__init__.py b/sass_processor/__init__.py
index <HASH>..<HASH> 100644
--- a/sass_processor/__init__.py
+++ b/sass_processor/__init__.py
@@ -1 +1 @@
-__version__ = '0.3.3'
+__version__ = '0.3.4'
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -34,6 +34,7 @@ setup(
author_email='jacob.rief@gmail.com',
url='https://github.com/jrief/django-sass-processor',
packages=find_packages(),
+ install_requires=['libsass'],
license='LICENSE-MIT',
platforms=['OS Independent'],
classifiers=CLASSIFIERS, | added requirement libsass | jrief_django-sass-processor | train | py,py |
496a18f6a66ed925388389010d3a868bfaec403d | diff --git a/server/app.js b/server/app.js
index <HASH>..<HASH> 100644
--- a/server/app.js
+++ b/server/app.js
@@ -2,12 +2,14 @@
const express = require('express');
const bodyParser = require('body-parser');
+const cookieParser = require('cookie-parser');
const app = express();
app.use(bodyParser.urlencoded({
extended: false
}));
app.use(bodyParser.json());
+app.use(cookieParser());
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); | Update app.js to include middleware cookie-parser
We need to be able to read cookies (to change locale). | zeachco_stubborn-server | train | js |
c358a7e28388cfe7b1b5a93c3cf09b53dfb8874a | diff --git a/src/Bkwld/Decoy/Auth/Sentry.php b/src/Bkwld/Decoy/Auth/Sentry.php
index <HASH>..<HASH> 100644
--- a/src/Bkwld/Decoy/Auth/Sentry.php
+++ b/src/Bkwld/Decoy/Auth/Sentry.php
@@ -3,7 +3,7 @@
// Dependencies
use Cartalyst\Sentry\Users\UserNotFoundException;
use DecoyURL;
-use Html;
+use HTML;
use Sentry as CartalystSentry;
/**
diff --git a/src/Bkwld/Decoy/Models/Admin.php b/src/Bkwld/Decoy/Models/Admin.php
index <HASH>..<HASH> 100644
--- a/src/Bkwld/Decoy/Models/Admin.php
+++ b/src/Bkwld/Decoy/Models/Admin.php
@@ -4,7 +4,7 @@
use App;
use Config;
use DB;
-use Html;
+use HTML;
use Input;
use Mail;
use Redirect; | Fixing issue with casing of HTML | BKWLD_decoy | train | php,php |
f068a42754f24344a9d63b31e005eb76c633b13d | diff --git a/js/test/test.js b/js/test/test.js
index <HASH>..<HASH> 100644
--- a/js/test/test.js
+++ b/js/test/test.js
@@ -226,7 +226,7 @@ async function testExchange (exchange) {
'ZRX',
]
- let code = codes[0]
+ let code = undefined
for (let i = 0; i < codes.length; i++) {
if (codes[i] in exchange.currencies) {
code = codes[i] | fix `code` undefined
When exchange doesn't contain any of the hardcoded 'test' codes, build throws error. This needs to be fixed. | ccxt_ccxt | train | js |
75c7e4fc07aa9bc59b4eff7a578e7909fd55d0d0 | diff --git a/src/str-replace.js b/src/str-replace.js
index <HASH>..<HASH> 100644
--- a/src/str-replace.js
+++ b/src/str-replace.js
@@ -7,23 +7,23 @@ var replaceAll = function( oldToken ) {
var _token;
var index = -1;
if ( configs.ignoringCase ) {
- _token = oldToken.toLowerCase();
- while((
- index = string
- .toLowerCase()
- .indexOf(
- _token,
- index >= 0 ?
- index + newToken.length : 0
- )
- ) !== -1
- ) {
- string = string
- .substring( 0, index ) +
- newToken +
- string.substring( index + newToken.length );
- }
- return string;
+ _token = oldToken.toLowerCase();
+ while((
+ index = string
+ .toLowerCase()
+ .indexOf(
+ _token,
+ index >= 0 ?
+ index + newToken.length : 0
+ )
+ ) !== -1
+ ) {
+ string = string
+ .substring( 0, index ) +
+ newToken +
+ string.substring( index + newToken.length );
+ }
+ return string;
}
return string.split( oldToken ).join( newToken );
} | Identation is 2 spaces not 4 | FagnerMartinsBrack_str-replace | train | js |
5eddfc36c9a305fe8c3d992839d388fc24ba0e2d | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -128,11 +128,11 @@ def find_casacore():
casacoreversion = getCasacoreVersion()
except:
# getVersion was fixed in casacore 2.3.0
- raise RuntimeError("Your casacore version is older than 2.3.0! You need to upgrade your casacore.")
+ warnings.warn("Your casacore version is older than 2.3.0! You need to upgrade your casacore.")
else:
if LooseVersion(casacoreversion.decode()) < LooseVersion(__mincasacoreversion__):
- raise RuntimeError("Your casacore version is too old. Minimum is " + __mincasacoreversion__ +
- ", you have " + casacoreversion.decode('utf-8'))
+ warnings.warn("Your casacore version is too old. Minimum is " + __mincasacoreversion__ +
+ ", you have " + casacoreversion.decode('utf-8'))
libdir = dirname(libcasacasa)
includedir = join(dirname(libdir), "include") | Warn, do not crash on old casacore | casacore_python-casacore | train | py |
fb6d1a5797f536d474118404f37326b1bd3981f4 | diff --git a/modules/components/Route.js b/modules/components/Route.js
index <HASH>..<HASH> 100644
--- a/modules/components/Route.js
+++ b/modules/components/Route.js
@@ -447,7 +447,7 @@ function computeHandlerProps(matches, query) {
}
childHandler = function (props, addedProps, children) {
- return route.props.handler(mergeProperties(props, addedProps), children);
+ return route.props.handler.apply(null, [mergeProperties(props, addedProps)].concat(children));
}.bind(this, props);
match.refName = props.ref; | activeRoute actually needs to support multiple children.
Much | taion_rrtr | train | js |
caa30c8b80a7fc48a16786784438e81f4bd84668 | diff --git a/vsphere/resource_vsphere_virtual_machine.go b/vsphere/resource_vsphere_virtual_machine.go
index <HASH>..<HASH> 100644
--- a/vsphere/resource_vsphere_virtual_machine.go
+++ b/vsphere/resource_vsphere_virtual_machine.go
@@ -881,6 +881,10 @@ func resourceVSphereVirtualMachineCustomizeDiff(d *schema.ResourceDiff, meta int
}
}
+ if len(d.Get("ovf_deploy").([]interface{})) == 0 && len(d.Get("network_interface").([]interface{})) == 0 {
+ return fmt.Errorf("network_interface parameter is required when not deploying from ovf template")
+
+ }
// Validate network device sub-resources
if err := virtualdevice.NetworkInterfaceDiffOperation(d, client); err != nil {
return err | Adding Required check for network_interface param when not deploying from ovf | terraform-providers_terraform-provider-vsphere | train | go |
eb3e69e11bcdbffaea17767d125820e63ade96d0 | diff --git a/lib/assets/KnockoutJsTemplate.js b/lib/assets/KnockoutJsTemplate.js
index <HASH>..<HASH> 100644
--- a/lib/assets/KnockoutJsTemplate.js
+++ b/lib/assets/KnockoutJsTemplate.js
@@ -16,6 +16,8 @@ extendWithGettersAndSetters(KnockoutJsTemplate.prototype, {
type: 'Html'
},
+ contentType: null, // Avoid reregisting text/html
+
defaultExtension: '.ko',
alternativeExtensions: [] // Avoid reregistering xhtml etc. | assets.KnockoutTemplate: Don't overwrite text/html in the contentType registry. | assetgraph_assetgraph | train | js |
a6be1726324d906972b9fa3c21d87429893e5320 | diff --git a/speech-to-text/src/test/java/com/ibm/watson/speech_to_text/v1/SpeechToTextIT.java b/speech-to-text/src/test/java/com/ibm/watson/speech_to_text/v1/SpeechToTextIT.java
index <HASH>..<HASH> 100755
--- a/speech-to-text/src/test/java/com/ibm/watson/speech_to_text/v1/SpeechToTextIT.java
+++ b/speech-to-text/src/test/java/com/ibm/watson/speech_to_text/v1/SpeechToTextIT.java
@@ -918,6 +918,8 @@ public class SpeechToTextIT extends WatsonServiceTest {
}
}
+ // Avoid running in CI due to possible timeouts.
+ @Ignore
@Test
public void testGrammarOperations() throws FileNotFoundException, InterruptedException {
while (!isCustomizationReady(customizationId)) { | test(Speech to Text): Avoid running long-running test in CI to avoid timeouts | watson-developer-cloud_java-sdk | train | java |
14fe16f79e9a702e6cc1cd9e86cc95d5ba1e5a16 | diff --git a/examples/glyphs/glyph2.py b/examples/glyphs/glyph2.py
index <HASH>..<HASH> 100644
--- a/examples/glyphs/glyph2.py
+++ b/examples/glyphs/glyph2.py
@@ -69,5 +69,3 @@ sess.plotcontext._dirty = True
# not so nice.. but set the model doens't know
# that we appended to children
sess.store_all()
-import webbrowser
-webbrowser.open("http://localhost:5006/bokeh") | Don't open web browser in examples/glyphs/glyph2.py | bokeh_bokeh | train | py |
70062ebc9cef301f2742ee08d2fade1bb7a41866 | diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php
index <HASH>..<HASH> 100644
--- a/code/controllers/CMSMain.php
+++ b/code/controllers/CMSMain.php
@@ -592,7 +592,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
*/
public function getEditForm($id = null, $fields = null) {
if(!$id) $id = $this->currentPageID();
- $form = parent::getEditForm($id);
+ $form = parent::getEditForm($id, $fields);
// TODO Duplicate record fetching (see parent implementation)
$record = $this->getRecord($id); | FIX 'Settings' fields being overwritten by 'Content' fields
CMSMain::getEditForm wasn't passing the $fields parameter to the parent. The the "Settings" fields we being replaced with the "Content" settings when requesting /admin/pages/settings/show/<I> | silverstripe_silverstripe-cms | train | php |
a0510b33b92dda65670d5c20c5bad1020a4e71dd | diff --git a/aiogram/contrib/middlewares/fsm.py b/aiogram/contrib/middlewares/fsm.py
index <HASH>..<HASH> 100644
--- a/aiogram/contrib/middlewares/fsm.py
+++ b/aiogram/contrib/middlewares/fsm.py
@@ -1,5 +1,4 @@
import copy
-import weakref
from aiogram.dispatcher.middlewares import LifetimeControllerMiddleware
from aiogram.dispatcher.storage import FSMContext
@@ -8,10 +7,6 @@ from aiogram.dispatcher.storage import FSMContext
class FSMMiddleware(LifetimeControllerMiddleware):
skip_patterns = ['error', 'update']
- def __init__(self):
- super(FSMMiddleware, self).__init__()
- self._proxies = weakref.WeakKeyDictionary()
-
async def pre_process(self, obj, data, *args):
proxy = await FSMSStorageProxy.create(self.manager.dispatcher.current_state())
data['state_data'] = proxy | Remove unused code from fsm.py (#<I>) | aiogram_aiogram | train | py |
1cca047026466a137f472633a9739d739732da67 | diff --git a/lib/heroku/helpers.rb b/lib/heroku/helpers.rb
index <HASH>..<HASH> 100644
--- a/lib/heroku/helpers.rb
+++ b/lib/heroku/helpers.rb
@@ -300,7 +300,7 @@ module Heroku
def format_with_bang(message)
return '' if message.to_s.strip == ""
- " ! " + message.encode('utf-8', invalid: :replace, undef: :replace).split("\n").join("\n ! ")
+ " ! " + message.encode('utf-8', 'binary', invalid: :replace, undef: :replace).split("\n").join("\n ! ")
end
def output_with_bang(message="", new_line=true)
diff --git a/spec/heroku/helpers_spec.rb b/spec/heroku/helpers_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/heroku/helpers_spec.rb
+++ b/spec/heroku/helpers_spec.rb
@@ -177,7 +177,7 @@ OUT
context "format_with_bang" do
it "should not fail with bad utf characters" do
message = "hello joel\255".force_encoding('UTF-8')
- expect(" ! hello joel�").to eq(format_with_bang(message))
+ expect(" ! hello joel\u{FFFD}").to eq(format_with_bang(message))
end
end | Fix encode & unicode character for <I> | heroku_legacy-cli | train | rb,rb |
4dd1c8d84119cf81130fc6b6fcb5b0f3e7c0bb7c | diff --git a/py/selenium/webdriver/firefox/firefox_profile.py b/py/selenium/webdriver/firefox/firefox_profile.py
index <HASH>..<HASH> 100644
--- a/py/selenium/webdriver/firefox/firefox_profile.py
+++ b/py/selenium/webdriver/firefox/firefox_profile.py
@@ -28,7 +28,7 @@ import zipfile
try:
from cStringIO import StringIO as BytesIO
bytes = str
- str = unicode
+ str = basestring
except ImportError:
from io import BytesIO
@@ -361,7 +361,7 @@ class FirefoxProfile(object):
raise AddonFormatError(str(e), sys.exc_info()[2])
# turn unpack into a true/false value
- if isinstance(details['unpack'], basestring):
+ if isinstance(details['unpack'], str):
details['unpack'] = details['unpack'].lower() == 'true'
# If no ID is set, the add-on is invalid | correct string handling to support py3 again | SeleniumHQ_selenium | train | py |
b87afcb4795fbab449df441330eb4161d7cf5f5e | diff --git a/sess.go b/sess.go
index <HASH>..<HASH> 100644
--- a/sess.go
+++ b/sess.go
@@ -564,7 +564,7 @@ func (s *UDPSession) kcpInput(data []byte) {
func (s *UDPSession) receiver(ch chan []byte) {
for {
data := s.xmitBuf.Get().([]byte)[:mtuLimit]
- if n, _, err := s.conn.ReadFromUDP(data); err == nil && n >= s.headerSize+IKCP_OVERHEAD {
+ if n, err := s.conn.Read(data); err == nil && n >= s.headerSize+IKCP_OVERHEAD {
select {
case ch <- data[:n]:
case <-s.die: | faster syscall for client receiving | xtaci_kcp-go | train | go |
7f1a84f5e48fe8f9027fdd63c2dba32dee4299c3 | diff --git a/godet.go b/godet.go
index <HASH>..<HASH> 100644
--- a/godet.go
+++ b/godet.go
@@ -6,6 +6,7 @@ package godet
import (
"encoding/base64"
"encoding/json"
+ "fmt"
"log"
"sync"
@@ -551,12 +552,12 @@ func (remote *RemoteDebugger) Evaluate(expr string) (interface{}, error) {
}
//
-// To evaluate a list of expression, WrapEvaluate wraps them in `(function(){ ... })()`.
+// To evaluate a list of expression, EvaluateWrap wraps them in `(function(){ ... })()`.
//
// Use a return statement to return a value.
//
-func (remote *RemoteDebugger) WrapEvaluate(expr string) (interface{}, error) {
- expr := fmt.Sprintf("(function(){%v})()", expr)
+func (remote *RemoteDebugger) EvaluateWrap(expr string) (interface{}, error) {
+ expr = fmt.Sprintf("(function(){%v})()", expr)
return remote.Evaluate(expr)
} | fix and rename EvaluateWrap | raff_godet | train | go |
b01b75e36790d8026dd27ce59051d9581ad47940 | diff --git a/framework/core/src/Extend/Link.php b/framework/core/src/Extend/Link.php
index <HASH>..<HASH> 100644
--- a/framework/core/src/Extend/Link.php
+++ b/framework/core/src/Extend/Link.php
@@ -21,14 +21,14 @@ class Link implements ExtenderInterface
protected $setRel = null;
protected $setTarget = null;
- public function setRel(callable $callable): static
+ public function setRel(callable $callable)
{
$this->setRel = $callable;
return $this;
}
- public function setTarget(callable $callable): static
+ public function setTarget(callable $callable)
{
$this->setTarget = $callable; | fix: return type hint static is php 8+ | flarum_core | train | php |
2d3068946ee7d242ca5bf34d0747f19baf049b50 | diff --git a/src/test/java/net/openhft/chronicle/map/StatelessClientTest.java b/src/test/java/net/openhft/chronicle/map/StatelessClientTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/net/openhft/chronicle/map/StatelessClientTest.java
+++ b/src/test/java/net/openhft/chronicle/map/StatelessClientTest.java
@@ -680,7 +680,6 @@ public class StatelessClientTest {
}
}
- @org.junit.Ignore("HCOLL-276 Improve serializer resilience")
@Test
public void startChronicleMapServer() throws IOException {
@@ -692,8 +691,9 @@ public class StatelessClientTest {
.constantKeySizeBySample(new byte[14])
.create()) {
- try (ChronicleMap<byte[], CharSequence> map2 = ChronicleMapBuilder.of(byte[].class, CharSequence.class)
- // .constantKeySizeBySample(new byte[14])
+ try (ChronicleMap<byte[], CharSequence> map2 = ChronicleMapBuilder
+ .of(byte[].class, CharSequence.class)
+ .constantKeySizeBySample(new byte[14])
.statelessClient(new InetSocketAddress("localhost", 8875))
.create()) { | HCOLL-<I> configs on sever and client MUST be identical, as of now | OpenHFT_Chronicle-Map | train | java |
5c5fc3a54a4733552ebe885c253bb8a7e69c750c | diff --git a/client/mobilizations/widgets/__plugins__/form/components/input.js b/client/mobilizations/widgets/__plugins__/form/components/input.js
index <HASH>..<HASH> 100644
--- a/client/mobilizations/widgets/__plugins__/form/components/input.js
+++ b/client/mobilizations/widgets/__plugins__/form/components/input.js
@@ -97,7 +97,7 @@ class Input extends Component {
}}
onBlur={onBlur}
placeholder={field.placeholder}
- type='text'
+ type={field.kind === 'email' ? 'email' : 'text'}
/>
)
} | fix(form-widget): input type as email by field kind close #<I> | nossas_bonde-client | train | js |
bde9037208742f224b72878189d251b841e8d3db | diff --git a/test/k8sT/external_ips.go b/test/k8sT/external_ips.go
index <HASH>..<HASH> 100644
--- a/test/k8sT/external_ips.go
+++ b/test/k8sT/external_ips.go
@@ -243,6 +243,7 @@ var _ = Describe("K8sKubeProxyFreeMatrix tests", func() {
"global.autoDirectNodeRoutes": "true",
"global.nodePort.device": external_ips.PublicInterfaceName,
"global.nodePort.enabled": "true",
+ "global.bpfMasquerade": "false",
})
})
DescribeTable("From pod running on node-1 to services being backed by a pod running on node-1",
@@ -287,6 +288,7 @@ var _ = Describe("K8sKubeProxyFreeMatrix tests", func() {
"global.tunnel": "vxlan",
"global.nodePort.device": external_ips.PublicInterfaceName,
"global.nodePort.enabled": "true",
+ "global.bpfMasquerade": "false",
})
})
DescribeTable("From pod running on node-1 to services being backed by a pod running on node-1", | test: Disable BPF masq for K8sKubeProxyFreeMatrix
Disable the BPF masq in the vxlan tests until PublicInterfaceName is
decluttered. The communication between pod and remote node has to be
SNAT'd in the case of vxlan, which is currently not feasible, as
bpf_netdev is loaded only on PublicInterfaceName. | cilium_cilium | train | go |
987c0cfb9d112d168077215511a7c92a79a6e380 | diff --git a/openquake/baselib/parallel.py b/openquake/baselib/parallel.py
index <HASH>..<HASH> 100644
--- a/openquake/baselib/parallel.py
+++ b/openquake/baselib/parallel.py
@@ -234,7 +234,11 @@ def safely_call(func, args):
child.hdf5path = mon.hdf5path
else:
mon = child
- check_mem_usage(mon) # check if too much memory is used
+ # FIXME check_mem_usage is disabled here because it's causing
+ # dead locks in threads when log messages are raised.
+ # check is done anyway in other parts of the code (submit and iter).
+ # Further investigation is needed
+ # check_mem_usage(mon) # check if too much memory is used
# FIXME: this approach does not work with the Threadmap
mon._flush = False
try: | Remove check_mem_usage from the safety_call cause is giving troubles
Former-commit-id: <I>b<I>e<I>f<I>fb<I>c<I>dcb5b7fb<I>c<I> | gem_oq-engine | train | py |
28638eb9f6905eb8453475fee30b4048b142886d | diff --git a/Domain/FieldEntry.php b/Domain/FieldEntry.php
index <HASH>..<HASH> 100644
--- a/Domain/FieldEntry.php
+++ b/Domain/FieldEntry.php
@@ -67,6 +67,9 @@ class FieldEntry extends Entry implements FieldEntryInterface
public function unserialize($serialized)
{
list($this->field, $parentStr) = unserialize($serialized);
+ if (!\is_string($parentStr)) {
+ throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
+ }
parent::unserialize($parentStr);
}
} | Dont allow unserializing classes with a destructor - security-acl | symfony_security-acl | train | php |
d9a344b601d59063307d749792ae1fed2a5d4749 | diff --git a/api/app/util.go b/api/app/util.go
index <HASH>..<HASH> 100644
--- a/api/app/util.go
+++ b/api/app/util.go
@@ -43,13 +43,13 @@ func filterOutput(output []byte, filterFunc func([]byte) bool) []byte {
var createRunFileCommand = `cat > /home/application/run-command <<END
#!/bin/bash
-[-f /home/application/apprc ] && source /home/application/apprc
-[-d /home/application/current] && cd /home/application/current
+[ -f /home/application/apprc ] && source /home/application/apprc
+[ -d /home/application/current] && cd /home/application/current
eval $*
END
`
func createRunFileIfNeed(unit unit.Unit) {
- cmd := "[-f /home/application/run-command] || " + createRunFileCommand + "; chmod +x /home/application/run-command"
+ cmd := "[ -f /home/application/run-command ] || " + createRunFileCommand + "; chmod +x /home/application/run-command"
unit.Command(cmd)
} | api/app: fix bash commands
damn brackets. | tsuru_tsuru | train | go |
a1cf5c8d9999652ed74fcb46ddeb11108c71af7e | diff --git a/mdp.py b/mdp.py
index <HASH>..<HASH> 100644
--- a/mdp.py
+++ b/mdp.py
@@ -1650,7 +1650,7 @@ class RelativeValueIteration(MDP):
self.epsilon = epsilon
self.discount = 1
- self.V = zeros((self.S, 1))
+ self.V = zeros(self.S)
self.gain = 0 # self.U[self.S]
self.average_reward = None
@@ -2003,10 +2003,9 @@ class ValueIterationGS(ValueIteration):
Vprev = self.V.copy()
for s in range(self.S):
- Q = []
- for a in range(self.A):
- Q.append(float(self.R[a][s] +
- self.discount * self.P[a][s, :] * self.V))
+ Q = [float(self.R[a][s]+
+ self.discount * self.P[a][s, :].dot(self.V))
+ for a in range(self.A)]
self.V[s] = max(Q)
@@ -2031,7 +2030,7 @@ class ValueIterationGS(ValueIteration):
for s in range(self.S):
Q = zeros(self.A)
for a in range(self.A):
- Q[a] = self.R[a][s] + self.P[a][s,:] * self.discount * self.V
+ Q[a] = self.R[a][s] + self.discount * self.P[a][s,:].dot(self.V)
self.V[s] = Q.max()
self.policy.append(int(Q.argmax())) | fixes to make sure that the dot product method of numpy arrays are called | sawcordwell_pymdptoolbox | train | py |
ae8da10aa91cbf533267a568e871913c0e19093a | diff --git a/core/model/MySQLDatabase.php b/core/model/MySQLDatabase.php
index <HASH>..<HASH> 100644
--- a/core/model/MySQLDatabase.php
+++ b/core/model/MySQLDatabase.php
@@ -145,7 +145,7 @@ class MySQLDatabase extends Database {
*/
public function selectDatabase($dbname) {
$this->database = $dbname;
- if($this->databaseExists($this->databse)) mysql_select_db($this->database, $this->dbConn);
+ if($this->databaseExists($this->database)) mysql_select_db($this->database, $this->dbConn);
$this->tableList = $this->fieldList = $this->indexList = null;
}
diff --git a/tests/SapphireTest.php b/tests/SapphireTest.php
index <HASH>..<HASH> 100644
--- a/tests/SapphireTest.php
+++ b/tests/SapphireTest.php
@@ -111,7 +111,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
foreach($fields as $fieldName => $fieldVal) {
// Parse a dictionary reference - used to set foreign keys
if(substr($fieldVal,0,2) == '=>') {
- $obj->$fieldName = $this->fixtureDicationary[ substr($fieldVal,2) ];
+ $obj->$fieldName = $this->fixtureDictionary[ substr($fieldVal,2) ];
// Regular field value setting
} else { | Fixed some spelling mistakes that were causing errors when running tests via SapphireTest.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@<I> <I>b<I>ca-7a2a-<I>-9d3b-<I>d<I>a<I>a9 | silverstripe_silverstripe-framework | train | php,php |
43b9318b2d806cf22549b297b41ba9d2405ab00d | diff --git a/contractcourt/commit_sweep_resolver.go b/contractcourt/commit_sweep_resolver.go
index <HASH>..<HASH> 100644
--- a/contractcourt/commit_sweep_resolver.go
+++ b/contractcourt/commit_sweep_resolver.go
@@ -248,7 +248,7 @@ func (c *commitSweepResolver) Resolve() (ContractResolver, error) {
// it's likely what we sent was actually a revoked
// commitment. Report the error and continue to wrap up
// the contract.
- c.log.Errorf("local commitment output was swept by "+
+ c.log.Warnf("local commitment output was swept by "+
"remote party via %v", sweepResult.Tx.TxHash())
recovered = false
case nil: | contractcourt/commit_sweep_resolver: reduce log msg to warn | lightningnetwork_lnd | train | go |
70f64a174b816c7145458d5e9f51f5c91073e366 | diff --git a/resource_aws_dynamodb_table.go b/resource_aws_dynamodb_table.go
index <HASH>..<HASH> 100644
--- a/resource_aws_dynamodb_table.go
+++ b/resource_aws_dynamodb_table.go
@@ -34,6 +34,10 @@ func resourceAwsDynamoDbTable() *schema.Resource {
Delete: resourceAwsDynamoDbTableDelete,
Schema: map[string]*schema.Schema{
+ "arn": &schema.Schema{
+ Type: schema.TypeString,
+ Computed: true,
+ },
"name": &schema.Schema{
Type: schema.TypeString,
Required: true,
@@ -283,7 +287,6 @@ func resourceAwsDynamoDbTableCreate(d *schema.ResourceData, meta interface{}) er
} else {
// No error, set ID and return
d.SetId(*output.TableDescription.TableName)
- d.Set("arn", *output.TableDescription.TableARN)
return nil
}
}
@@ -576,6 +579,7 @@ func resourceAwsDynamoDbTableRead(d *schema.ResourceData, meta interface{}) erro
}
d.Set("global_secondary_index", gsiList)
+ d.Set("arn", table.TableARN)
return nil
} | provider/aws: Add ARN to Dynamo schema | terraform-providers_terraform-provider-aws | train | go |
a1dd3d5ec75ec4e275ea9f17ed94e1443fc2dd5b | diff --git a/spyder_kernels/customize/spydercustomize.py b/spyder_kernels/customize/spydercustomize.py
index <HASH>..<HASH> 100644
--- a/spyder_kernels/customize/spydercustomize.py
+++ b/spyder_kernels/customize/spydercustomize.py
@@ -487,7 +487,7 @@ def get_file_code(filename, save_all=True):
try:
file_code = frontend_request().get_file_code(
filename, save_all=save_all)
- except (CommError, TimeoutError):
+ except (CommError, TimeoutError, RuntimeError):
file_code = None
if file_code is None:
with open(filename, 'r') as f: | Catch RuntimeError when trying to get code from the editor
This can happen when the editor is not available on the Spyder side | spyder-ide_spyder-kernels | train | py |
299b8847203563a35d011565e82af309f87dc6f6 | diff --git a/hazelcast/src/main/java/com/hazelcast/client/impl/protocol/task/AbstractMessageTask.java b/hazelcast/src/main/java/com/hazelcast/client/impl/protocol/task/AbstractMessageTask.java
index <HASH>..<HASH> 100644
--- a/hazelcast/src/main/java/com/hazelcast/client/impl/protocol/task/AbstractMessageTask.java
+++ b/hazelcast/src/main/java/com/hazelcast/client/impl/protocol/task/AbstractMessageTask.java
@@ -129,7 +129,7 @@ public abstract class AbstractMessageTask<P>
} else {
exception = new HazelcastInstanceNotActiveException();
}
- endpoint.sendResponse(exception, clientMessage.getCorrelationId());
+ sendClientMessage(exception);
endpointManager.removeEndpoint(endpoint);
} | Exception send to new client via old protocol
In case there is a authentication failure, exception is send as
packet, but rather it should be send as client message.
fixes #<I> | hazelcast_hazelcast | train | java |
f1b3bbebd4a0f5d050d95220cbf09ae231aed44e | diff --git a/utilities/query-helper.js b/utilities/query-helper.js
index <HASH>..<HASH> 100644
--- a/utilities/query-helper.js
+++ b/utilities/query-helper.js
@@ -200,6 +200,23 @@ module.exports = {
return queryableFields;
},
+ getStringFields: function (model, Log) {
+ validationHelper.validateModel(model, Log);
+
+ var stringFields = [];
+
+ var fields = model.schema.paths;
+
+ for (var fieldName in fields) {
+ var field = fields[fieldName].options;
+ if (field.type.schemaName === "String") {
+ stringFields.push(fieldName);
+ }
+ }
+
+ return stringFields;
+ },
+
/**
* Set the skip amount for the mongoose query. Typically used for paging.
* @param query: The incoming request query.
@@ -241,6 +258,12 @@ module.exports = {
if (query.$term) {
query.$or = [];//TODO: allow option to choose ANDing or ORing of searchFields/queryableFields
var queryableFields = this.getQueryableFields(model, Log);
+ var stringFields = this.getStringFields(model, Log);
+
+ //EXPL: we can only search fields that are a string type
+ queryableFields = queryableFields.filter(function(field) {
+ return stringFields.indexOf(field) > -1;
+ });
//EXPL: search only specified fields if included
if (query.$searchFields) { | Fix regex search to only apply to String fields. | JKHeadley_rest-hapi | train | js |
8117f515ab9c22d4319be25eececd2eb772a38b8 | diff --git a/test/e2e/volumes.go b/test/e2e/volumes.go
index <HASH>..<HASH> 100644
--- a/test/e2e/volumes.go
+++ b/test/e2e/volumes.go
@@ -806,7 +806,8 @@ var _ = framework.KubeDescribe("Volumes [Volume]", func() {
////////////////////////////////////////////////////////////////////////
framework.KubeDescribe("PD", func() {
- It("should be mountable", func() {
+ // Flaky issue: #43977
+ It("should be mountable [Flaky]", func() {
framework.SkipUnlessProviderIs("gce", "gke")
config := VolumeTestConfig{
namespace: namespace.Name, | Mark PD test as flaky. | kubernetes_kubernetes | train | go |
d2820f7d80a79f34d122ab146cea1d34bb9cd7c7 | diff --git a/tests/frontend/org/voltdb/regressionsuites/TestGiantDeleteSuite.java b/tests/frontend/org/voltdb/regressionsuites/TestGiantDeleteSuite.java
index <HASH>..<HASH> 100644
--- a/tests/frontend/org/voltdb/regressionsuites/TestGiantDeleteSuite.java
+++ b/tests/frontend/org/voltdb/regressionsuites/TestGiantDeleteSuite.java
@@ -40,6 +40,12 @@ public class TestGiantDeleteSuite extends RegressionSuite {
public void testGiantDelete() throws IOException, ProcCallException
{
+ /*
+ * Times out with valgrind
+ */
+ if (isValgrind()) {
+ return;
+ }
Client client = getClient();
client.callProcedure("InsertBatch", 20000000, 0);
boolean threw = false; | Opt out TestGiantDelete suit from the valgrind build because it will never be able to run fast enough to pass. | VoltDB_voltdb | train | java |
f6ef9a0eb9de4512969e0b870ca6720e4c5d8d66 | diff --git a/h2o-core/src/main/java/water/server/ServletUtils.java b/h2o-core/src/main/java/water/server/ServletUtils.java
index <HASH>..<HASH> 100644
--- a/h2o-core/src/main/java/water/server/ServletUtils.java
+++ b/h2o-core/src/main/java/water/server/ServletUtils.java
@@ -192,7 +192,8 @@ public class ServletUtils {
response.setHeader("X-Content-Type-Options", "nosniff");
response.setHeader("Content-Security-Policy", "default-src 'self' 'unsafe-eval' 'unsafe-inline'");
// Note: ^^^ unsafe-eval/-inline are essential for Flow to work
- // this will also kill the component "Star H2O on Github" in Flow - see HEXDEV-730
+ // this will also kill the component "Star H2O on Github" in Flow - see HEXDEV-739
+
}
public static String sanatizeContextPath(String context_path) { | Fix link to jira | h2oai_h2o-3 | train | java |
ea41215646c765f026c179a8cbe034649ded2928 | diff --git a/salt/modules/win_pkg.py b/salt/modules/win_pkg.py
index <HASH>..<HASH> 100644
--- a/salt/modules/win_pkg.py
+++ b/salt/modules/win_pkg.py
@@ -701,7 +701,7 @@ def refresh_db(**kwargs):
path=repo_details.winrepo_source_dir,
saltenv=saltenv,
include_pat='*.sls',
- exclude_pat=r'E@\/\..*\/' # Exclude all hidden directories (.git)
+ exclude_pat=r'E@\/\..*?\/' # Exclude all hidden directories (.git)
)
return genrepo(saltenv=saltenv, verbose=verbose, failhard=failhard) | Make the regex pattern less greedy | saltstack_salt | train | py |
bc7ec3d4c7964dc4789a7f491bdad8ebbf6439ad | diff --git a/test/pipeline/test_phase.py b/test/pipeline/test_phase.py
index <HASH>..<HASH> 100644
--- a/test/pipeline/test_phase.py
+++ b/test/pipeline/test_phase.py
@@ -178,6 +178,17 @@ class TestAutomaticPriorPassing(object):
assert phase.lens_galaxies.galaxy_one == new_galaxy_model
assert argument_tuples == [(galaxy, galaxy_model)]
+ def test_model_instance_sum_priority(self):
+ instance_1 = mm.ModelInstance()
+ galaxy_1 = g.Galaxy()
+ instance_1.galaxy = galaxy_1
+
+ instance_2 = mm.ModelInstance()
+ galaxy_2 = g.Galaxy()
+ instance_2.galaxy = galaxy_2
+
+ assert (instance_1 + instance_2).galaxy == galaxy_2
+
def clean_images():
try: | sanity check that model overriding works as expected | Jammy2211_PyAutoLens | train | py |
e96dbfb973eb8c47aa635444e435370bcaa8c282 | diff --git a/etcdserver/api/v2auth/auth_requests.go b/etcdserver/api/v2auth/auth_requests.go
index <HASH>..<HASH> 100644
--- a/etcdserver/api/v2auth/auth_requests.go
+++ b/etcdserver/api/v2auth/auth_requests.go
@@ -32,7 +32,6 @@ func (s *store) ensureAuthDirectories() error {
}
for _, res := range []string{StorePermsPrefix, StorePermsPrefix + "/users/", StorePermsPrefix + "/roles/"} {
ctx, cancel := context.WithTimeout(context.Background(), s.timeout)
- defer cancel()
pe := false
rr := etcdserverpb.Request{
Method: "PUT",
@@ -41,6 +40,7 @@ func (s *store) ensureAuthDirectories() error {
PrevExist: &pe,
}
_, err := s.server.Do(ctx, rr)
+ cancel()
if err != nil {
if e, ok := err.(*v2error.Error); ok {
if e.ErrorCode == v2error.EcodeNodeExist { | api/v2auth: remove defer in loop. | etcd-io_etcd | train | go |
705f8127a05e341c6a9192527ac7fc46316e9a00 | diff --git a/lib/delegates/SocketMessageDelegate.js b/lib/delegates/SocketMessageDelegate.js
index <HASH>..<HASH> 100644
--- a/lib/delegates/SocketMessageDelegate.js
+++ b/lib/delegates/SocketMessageDelegate.js
@@ -4,15 +4,18 @@
* @author darryl.west@raincitysoftware.com
* @created 2016-09-26
*/
-const dash = require('lodash'),
- DAY = 24 * 60 * 60 * 1000;
+const dash = require('lodash');
const SocketMessageDelegate = function(options) {
'use strict';
+ const createOrigin = function() {
+ return (dash.random(10000, 99999999999) + 100000000000).toString(19);
+ };
+
const smd = this,
log = options.log,
- origin = (dash.random(10000, 99999999999) + 100000000000).toString(19);
+ origin = createOrigin();
let messageCount = dash.isNumber(options.messageCount) ? Math.round( options.messageCount ) : 0; | refactored origin to it's | darrylwest_node-service-commons | train | js |
dc41a5f3cb02ff19ea0b33f34a94fc90b71a60cd | diff --git a/DependencyInjection/SncRedisExtension.php b/DependencyInjection/SncRedisExtension.php
index <HASH>..<HASH> 100644
--- a/DependencyInjection/SncRedisExtension.php
+++ b/DependencyInjection/SncRedisExtension.php
@@ -337,7 +337,7 @@ class SncRedisExtension extends Extension
if ($cache['namespace']) {
$def->addMethodCall('setNamespace', array($cache['namespace']));
}
- $container->setDefinition(sprintf('doctrine.odm.mongodb.%s_%s', $dm, $name), $def);
+ $container->setDefinition(sprintf('doctrine_mongodb.odm.%s_%s', $dm, $name), $def);
}
}
} | Updated service name for Doctrine ODM
Addresses issue #<I>, sets the correct service definition for document management allowing sessions to be correctly cached. | snc_SncRedisBundle | train | php |
e5a857f960da593a5a86034a1395a9d55c35d381 | diff --git a/tests/functional/__init__.py b/tests/functional/__init__.py
index <HASH>..<HASH> 100644
--- a/tests/functional/__init__.py
+++ b/tests/functional/__init__.py
@@ -44,7 +44,7 @@ class PmxbotHarness(object):
'from pmxbot.pmxbot import run; run()', configfile])
except OSError:
py.test.skip("Unable to launch pmxbot (pmxbot must be installed)")
- time.sleep(1)
+ time.sleep(2)
cls.client = TestingClient('localhost', 6668, 'testingbot')
def check_logs(cls, channel='', nick='', message=''): | Extended delay when starting up pmxbot under test | yougov_pmxbot | train | py |
440c25502dbaa7774e02b7f3470a6da251f3703c | diff --git a/armstrong/core/arm_sections/tests/views.py b/armstrong/core/arm_sections/tests/views.py
index <HASH>..<HASH> 100644
--- a/armstrong/core/arm_sections/tests/views.py
+++ b/armstrong/core/arm_sections/tests/views.py
@@ -36,3 +36,10 @@ class SectionsViewTestCase(ArmSectionsTestCase):
kwargs={'full_slug': self.us_pro_sports.full_slug})
response = self.client.get(url)
self.assertEquals(response.status_code, 200)
+
+ def test_feed_view_for_missing_section_raises_404(self):
+ url = urlresolvers.reverse(
+ 'section_feed',
+ kwargs={'full_slug': 'not-a-section/nope/'})
+ response = self.client.get(url)
+ self.assertEquals(response.status_code, 404) | Test that feed view raises <I> for missing section | armstrong_armstrong.core.arm_sections | train | py |
5d21d8bd5674c9737c8480928a7ef014a9ffd4bd | diff --git a/lib/lanes/api/generic_controller.rb b/lib/lanes/api/generic_controller.rb
index <HASH>..<HASH> 100644
--- a/lib/lanes/api/generic_controller.rb
+++ b/lib/lanes/api/generic_controller.rb
@@ -7,8 +7,8 @@ module Lanes
def show
query = build_query
options = build_reply_options
- query = add_modifiers_to_query(query)
options[:total_count] = query.dup.unscope(:select).count if should_include_total_count?
+ query = add_modifiers_to_query(query)
if params[:id]
query = query.first!
end | get total_count before adding modifiers | argosity_hippo | train | rb |
754bc36358760e5dff67b4aa5d80494a57b811d4 | diff --git a/src/Mapper/Nette/NetteMapper.php b/src/Mapper/Nette/NetteMapper.php
index <HASH>..<HASH> 100644
--- a/src/Mapper/Nette/NetteMapper.php
+++ b/src/Mapper/Nette/NetteMapper.php
@@ -266,7 +266,7 @@ class NetteMapper extends BaseMapper
if ($id) {
return $id;
} else {
- return $this->databaseContext->getInsertId();
+ return $this->databaseContext->getInsertId($this->databaseStructure->getPrimaryKeySequence($this->getTableName()));
}
} else {
$primary = []; | [mapper] fixed support for sequences/postgre | nextras_orm | train | php |
3d2cc59ef447c737b23ef8faadb4a7397474661d | diff --git a/tests/test_connection.py b/tests/test_connection.py
index <HASH>..<HASH> 100644
--- a/tests/test_connection.py
+++ b/tests/test_connection.py
@@ -285,3 +285,29 @@ class TestConnection(XvfbTest):
conn = xcffib.connect(display=os.environ['DISPLAY'], auth=authstr)
assert conn.get_setup().roots[0].root > 0
+
+ # This is an adaptation of the test from #27
+ def test_build_atom_cache(self):
+ # This will hold the forward *and* reverse lookups for any given atom
+ atoms = {}
+ cookies = []
+ # Batch the replies by creating a list of cookies first:
+ for i in xrange(1, 10000):
+ c = self.conn.core.GetAtomName(i)
+ cookies.append((i, c))
+ for i, c in cookies:
+ try:
+ name = ''.join(c.reply().name)
+ except xcffib.xproto.BadAtom:
+ continue
+ atoms.update({i: name}) # Lookup by number
+ atoms.update({name: i}) # Lookup by name
+
+ # Make sure we've got *all* the atoms we need
+ for name in _ewmh_atoms + _icccm_atoms:
+ if name not in atoms:
+ atom = self.conn.core.InternAtomUnchecked(False, len(name), name)
+ r = atom.reply()
+ if r:
+ atoms.update({r.atom: name})
+ atoms.update({name: r.atom}) | Add the failing test from #<I> as a testcase | tych0_xcffib | train | py |
2ee327055b6660c6797faef7069ecfb069b89567 | diff --git a/src/View.php b/src/View.php
index <HASH>..<HASH> 100644
--- a/src/View.php
+++ b/src/View.php
@@ -88,9 +88,11 @@ function isvalue( $m, $name, $value = null )
// If this is boolean and it matches $value
case 'boolean': return (isset($value) ? $var == $value : $var);
// If this is number and it matches $value
- case 'integer': return (isset($value) ? $var === intval($value): false);
+ case 'integer': return (isset($value) ? $var === intval($value): $var);
// If this is double and it matches $value
- case 'double': return (isset($value) ? $var === doubleval($value): false);
+ case 'double': return (isset($value) ? $var === doubleval($value): $var);
+ // If this is double and it matches $value
+ case 'float': return (isset($value) ? $var === floatval($value): $var);
// If this is not empty array
case 'array': return sizeof($var);
// If this is a string and it matches $value or if no $value is set string is not empty | Fixed isvalue bug when no matching value is passed - returned false | samsonos_php_core | train | php |
cc7bd23d051f3786de28dc596cb433527d9c2266 | diff --git a/hepnames/fields/bd1xx.py b/hepnames/fields/bd1xx.py
index <HASH>..<HASH> 100644
--- a/hepnames/fields/bd1xx.py
+++ b/hepnames/fields/bd1xx.py
@@ -159,16 +159,21 @@ def ids(self, key, value):
if INSPIRE_BAI.match(a_value):
return 'INSPIRE BAI'
+ def _try_to_correct_value(type_, a_value):
+ if type_ == 'CERN' and a_value.startswith('CERN-'):
+ return 'CERN-' + NON_DIGIT.sub('', a_value)
+ elif type_ == 'KAKEN':
+ return 'KAKEN-' + a_value
+ else:
+ return a_value
+
a_value = force_single_element(value.get('a'))
type_ = _get_type(value)
if type_ is None:
type_ = _guess_type_from_value(a_value)
- if type_ == 'CERN' and a_value.startswith('CERN-'):
- a_value = 'CERN-' + NON_DIGIT.sub('', a_value)
- elif type_ == 'KAKEN':
- a_value = 'KAKEN-' + a_value
+ a_value = _try_to_correct_value(type_, a_value)
return {
'type': type_, | dojson: refactor ids rule | inspirehep_inspire-dojson | train | py |
1f45119008d700bb37ffaacd9c9056f68311e12c | diff --git a/lib/profanity_filter.rb b/lib/profanity_filter.rb
index <HASH>..<HASH> 100644
--- a/lib/profanity_filter.rb
+++ b/lib/profanity_filter.rb
@@ -34,7 +34,8 @@ module ProfanityFilter
DICTIONARY = YAML.load_file(File.join(File.dirname(__FILE__), '../config/dictionary.yml'))
def self.clean(text, replace_method = '')
- text.split(/(\W)/).collect{|word| replace_method == 'dictionary' ? clean_word_dictionary(word) : clean_word_basic(word)}.join rescue nil
+ return text if text.blank?
+ text.split(/(\W)/).collect{|word| replace_method == 'dictionary' ? clean_word_dictionary(word) : clean_word_basic(word)}.join
end
def self.clean_word_dictionary(word) | Ditched rescue nil in favor of something a bit more explicit. [#9 status:resolved] | mobomo_profanity_filter | train | rb |
a59b5577075c7362201cec26b32dfc12f0583719 | diff --git a/src/server/worker/simpleworker.js b/src/server/worker/simpleworker.js
index <HASH>..<HASH> 100644
--- a/src/server/worker/simpleworker.js
+++ b/src/server/worker/simpleworker.js
@@ -648,7 +648,7 @@ function(CONSTANT,Core,Storage,GUID,DUMP,logManager,FS,PATH,BlobServerClient,Plu
} else {
resultReady = true;
error = err;
- result = null;
+ result = r;
}
});
break; | fix of worker behaviour
Former-commit-id: 9d<I>c<I>f<I>d<I>bc<I>ebd<I>a<I>b4 | webgme_webgme-engine | train | js |
e4e7aba3ae3b233aa39a1414d33cfd202c671e75 | diff --git a/core/Plugin/MetadataLoader.php b/core/Plugin/MetadataLoader.php
index <HASH>..<HASH> 100644
--- a/core/Plugin/MetadataLoader.php
+++ b/core/Plugin/MetadataLoader.php
@@ -49,9 +49,17 @@ class MetadataLoader
*/
public function load()
{
+ $defaults = $this->getDefaultPluginInformation();
+ $plugin = $this->loadPluginInfoJson();
+
+ // use translated plugin description if available
+ if ($defaults['description'] != Piwik::translate($defaults['description'])) {
+ unset($plugin['description']);
+ }
+
return array_merge(
- $this->getDefaultPluginInformation(),
- $this->loadPluginInfoJson()
+ $defaults,
+ $plugin
);
} | use translation of plugin description if available, even if defined in plugin.json | matomo-org_matomo | train | php |
112958cc119b89c9f8f99e236cfcde8f804d6de4 | diff --git a/cmd/selfupdate.go b/cmd/selfupdate.go
index <HASH>..<HASH> 100644
--- a/cmd/selfupdate.go
+++ b/cmd/selfupdate.go
@@ -1,3 +1,5 @@
+// +build !homebrew
+
// Copyright © 2016 The Things Network
// Use of this source code is governed by the MIT license that can be found in the LICENSE file.
diff --git a/ttnctl/cmd/selfupdate.go b/ttnctl/cmd/selfupdate.go
index <HASH>..<HASH> 100644
--- a/ttnctl/cmd/selfupdate.go
+++ b/ttnctl/cmd/selfupdate.go
@@ -1,3 +1,5 @@
+// +build !homebrew
+
// Copyright © 2016 The Things Network
// Use of this source code is governed by the MIT license that can be found in the LICENSE file. | Exclude selfupdate from Homebrew builds | TheThingsNetwork_ttn | train | go,go |
98144d28e5ea8218e14f43ca9345b1a764fceb00 | diff --git a/frontend/Module.php b/frontend/Module.php
index <HASH>..<HASH> 100644
--- a/frontend/Module.php
+++ b/frontend/Module.php
@@ -1,5 +1,7 @@
<?php
namespace bl\cms\cart\frontend;
+
+use bl\cms\cart\CartComponent;
use Yii;
/**
@@ -11,6 +13,11 @@ class Module extends \yii\base\Module
public $defaultRoute = 'cart';
/**
+ * @var CartComponent
+ */
+ public static $cart;
+
+ /**
* @var bool
* Enables logging
*/
@@ -19,6 +26,9 @@ class Module extends \yii\base\Module
public function init()
{
parent::init();
+
+ self::$cart = Yii::$app->cart;
+
$this->registerTranslations();
} | Added cart component prop to frontend Module | black-lamp_blcms-cart | train | php |
a0e68ffc81b68ffa37332e9e0142947995721d3b | diff --git a/blocks/moodleblock.class.php b/blocks/moodleblock.class.php
index <HASH>..<HASH> 100644
--- a/blocks/moodleblock.class.php
+++ b/blocks/moodleblock.class.php
@@ -764,8 +764,8 @@ EOD;
public static function comment_url($options) {
return null;
}
- public static function comment_display(&$comments, $options) {
- return true;
+ public static function comment_display($comments, $options) {
+ return $comments;
}
public static function comment_add(&$comments, $options) {
return true;
@@ -855,4 +855,4 @@ class block_tree extends block_list {
}
return $content;
}
-}
\ No newline at end of file
+}
diff --git a/comment/lib.php b/comment/lib.php
index <HASH>..<HASH> 100644
--- a/comment/lib.php
+++ b/comment/lib.php
@@ -413,7 +413,7 @@ EOD;
if (!empty($this->plugintype)) {
// moodle module will filter comments
- plugin_callback($this->plugintype, $this->pluginname, FEATURE_COMMENT, 'display', array(&$comments, $this->options));
+ $comments = plugin_callback($this->plugintype, $this->pluginname, FEATURE_COMMENT, 'display', array($comments, $this->options));
}
return $comments; | "MDL-<I>, do not pass by reference to plugin_callback" | moodle_moodle | train | php,php |
ac09860662ed334c5cb5ea1d8e7e776384d39863 | diff --git a/app/helpers/bento_search_helper.rb b/app/helpers/bento_search_helper.rb
index <HASH>..<HASH> 100644
--- a/app/helpers/bento_search_helper.rb
+++ b/app/helpers/bento_search_helper.rb
@@ -89,7 +89,7 @@ module BentoSearchHelper
def bento_item_title(item)
content_tag("h4", :class => "bento_item_title") do
safe_join([
- link_to_unless( item.link.blank?, item.title, item.link ),
+ link_to_unless( item.link.blank?, item.complete_title, item.link ),
if item.format
content_tag("small", :class => "bento_item_about") do
" (#{ t(item.format, :scope => [:bento_search, :format], :default => item.format.to_s.titleize) })" | make sure to include subtitle in displayed heading | jrochkind_bento_search | train | rb |
5f64503132218213330ee59c4540400146e127fc | diff --git a/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php b/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php
+++ b/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php
@@ -207,6 +207,14 @@ class UrlGeneratorTest extends \PHPUnit_Framework_TestCase
$this->assertNull($generator->generate('test', array('foo' => 'bar'), true));
}
+ public function testGenerateForRouteWithInvalidParameterButDisabledRequirementsCheck()
+ {
+ $routes = $this->getRoutes('test', new Route('/testing/{foo}', array('foo' => '1'), array('foo' => 'd+')));
+ $generator = $this->getGenerator($routes);
+ $generator->setStrictRequirements(null);
+ $this->assertSame('/app.php/testing/bar', $generator->generate('test', array('foo' => 'bar')));
+ }
+
/**
* @expectedException Symfony\Component\Routing\Exception\InvalidParameterException
*/ | [Routing] added test for disabled requirements check | symfony_symfony | train | php |
70424e64eacacd2ec5871f3423f3311e199df106 | diff --git a/multiqc/modules/pangolin/pangolin.py b/multiqc/modules/pangolin/pangolin.py
index <HASH>..<HASH> 100644
--- a/multiqc/modules/pangolin/pangolin.py
+++ b/multiqc/modules/pangolin/pangolin.py
@@ -98,7 +98,8 @@ class MultiqcModule(BaseMultiqcModule):
if s_name in self.pangolin_data:
log.debug("Duplicate sample name found! Overwriting: {}".format(s_name))
# Avoid generic header ID that clashes with other modules
- row["qc_status"] = row.pop("status")
+ if "qc_status" not in row:
+ row["qc_status"] = row.pop("status")
self.pangolin_data[s_name] = row
# Just save the lineage key for now - we will sort out the colours later
self.lineage_colours[row["lineage"]] = None | Pangolin <I> compatability
Recently pangolin has been updated to version <I> and this changes the output CSV file - see: <URL> | ewels_MultiQC | train | py |
c62e0e00435579141b9f8738f6db76b4accab928 | diff --git a/ngxtop/ngxtop.py b/ngxtop/ngxtop.py
index <HASH>..<HASH> 100755
--- a/ngxtop/ngxtop.py
+++ b/ngxtop/ngxtop.py
@@ -29,7 +29,6 @@ Options:
-c <file>, --config <file> allow ngxtop to parse nginx config file for log format and location.
-i <filter-expression>, --filter <filter-expression> filter in, records satisfied given expression are processed.
-p <filter-expression>, --pre-filter <filter-expression> in-filter expression to check in pre-parsing phase.
- -s, --from-stdin read lines from stdin.
-b, --db-dump dump database to disk
Examples:
@@ -429,7 +428,7 @@ def process(arguments):
global processor
access_log = arguments['--access-log']
log_format = arguments['--log-format']
- if not access_log and (arguments['--from-stdin'] or not sys.stdin.isatty()):
+ if not access_log and not sys.stdin.isatty():
access_log = 'stdin'
else:
if access_log is None or log_format is None: | Remove -s option, as it is not really needed | lebinh_ngxtop | train | py |
38d6a7fed640ff9a03c0b7158f5b07fc7c6cc463 | diff --git a/src/main/java/net/jodah/lyra/config/Config.java b/src/main/java/net/jodah/lyra/config/Config.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/jodah/lyra/config/Config.java
+++ b/src/main/java/net/jodah/lyra/config/Config.java
@@ -249,13 +249,13 @@ public class Config implements ConnectionConfig {
}
@Override
- public ConsumerConfig withExchangeRecovery(boolean enabled) {
+ public Config withExchangeRecovery(boolean enabled) {
exchangeRecovery = Boolean.valueOf(enabled);
return this;
}
@Override
- public ConsumerConfig withQueueRecovery(boolean enabled) {
+ public Config withQueueRecovery(boolean enabled) {
queueRecovery = Boolean.valueOf(enabled);
return this;
} | Config builder methods should always return Config | jhalterman_lyra | train | java |
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.