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 |
|---|---|---|---|---|---|
ffcc11e56f6552dd5776c1e515c96e46a4bbf65d | diff --git a/lib/runner.rb b/lib/runner.rb
index <HASH>..<HASH> 100644
--- a/lib/runner.rb
+++ b/lib/runner.rb
@@ -3,7 +3,7 @@ require 'httparty'
require 'macaddr'
require 'ostruct'
-TESTBOT_VERSION = 15
+TESTBOT_VERSION = 16
TIME_BETWEEN_POLLS = 1
TIME_BETWEEN_VERSION_CHECKS = 60
MAX_CPU_USAGE_WHEN_IDLE = 50
diff --git a/lib/server.rb b/lib/server.rb
index <HASH>..<HASH> 100644
--- a/lib/server.rb
+++ b/lib/server.rb
@@ -7,7 +7,7 @@ set :port, 2288
class Server
def self.version
- 15
+ 16
end
def self.valid_version?(runner_version) | Upping version to trigger automatic update of runners. | joakimk_testbot | train | rb,rb |
6e6de2179a3f0dcf3b742866f0771cff1be928bc | diff --git a/src/bin/cli.js b/src/bin/cli.js
index <HASH>..<HASH> 100755
--- a/src/bin/cli.js
+++ b/src/bin/cli.js
@@ -86,7 +86,7 @@ const strong = white.bold;
changelogUrl = outdatedModule.changelogUrl = await findModuleChangelogUrl(name, DEFAULT_REMOTE_CHANGELOGS_DB_URL);
}
- if (false && changelogUrl) {
+ if (changelogUrl) {
console.log(`Opening ${strong(changelogUrl)}...`);
opener(changelogUrl);
} else { | Fix bug with opening found changelog URL | th0r_npm-upgrade | train | js |
0ff02947dfd45c80d69461477ff83f0fe031eaac | diff --git a/lib/yard/handlers/ruby/legacy/mixin_handler.rb b/lib/yard/handlers/ruby/legacy/mixin_handler.rb
index <HASH>..<HASH> 100644
--- a/lib/yard/handlers/ruby/legacy/mixin_handler.rb
+++ b/lib/yard/handlers/ruby/legacy/mixin_handler.rb
@@ -23,6 +23,6 @@ class YARD::Handlers::Ruby::Legacy::MixinHandler < YARD::Handlers::Ruby::Legacy:
obj = Proxy.new(namespace, obj.value)
end
- namespace.mixins(scope).unshift(obj)
+ namespace.mixins(scope).unshift(obj) unless namespace.mixins(scope).include?(obj)
end
end
diff --git a/lib/yard/handlers/ruby/mixin_handler.rb b/lib/yard/handlers/ruby/mixin_handler.rb
index <HASH>..<HASH> 100644
--- a/lib/yard/handlers/ruby/mixin_handler.rb
+++ b/lib/yard/handlers/ruby/mixin_handler.rb
@@ -20,6 +20,6 @@ class YARD::Handlers::Ruby::MixinHandler < YARD::Handlers::Ruby::Base
obj = Proxy.new(namespace, obj.value)
end
- namespace.mixins(scope).unshift(obj)
+ namespace.mixins(scope).unshift(obj) unless namespace.mixins(scope).include?(obj)
end
end | Make sure mixins are only added if they have not been | lsegal_yard | train | rb,rb |
46fcb03918b54f96b0b07bc468192d2e48816d3f | diff --git a/findbugs/src/java/edu/umd/cs/findbugs/ba/URLClassPath.java b/findbugs/src/java/edu/umd/cs/findbugs/ba/URLClassPath.java
index <HASH>..<HASH> 100644
--- a/findbugs/src/java/edu/umd/cs/findbugs/ba/URLClassPath.java
+++ b/findbugs/src/java/edu/umd/cs/findbugs/ba/URLClassPath.java
@@ -394,6 +394,7 @@ public class URLClassPath implements Serializable {
Entry entry = i.next();
entry.close();
}
+ entryList.clear();
}
/** | Fix [ <I> ] Exception when checking project second time
Make sure to clear out the URLClassPath's entryList when all items are closed so that they are not attempted to be accessed in closed state.
git-svn-id: <URL> | spotbugs_spotbugs | train | java |
81f3bf4188338714a83fc736a5704b2df8f6efc2 | diff --git a/tests/Form/Type/SimpleFormatterTypeTest.php b/tests/Form/Type/SimpleFormatterTypeTest.php
index <HASH>..<HASH> 100644
--- a/tests/Form/Type/SimpleFormatterTypeTest.php
+++ b/tests/Form/Type/SimpleFormatterTypeTest.php
@@ -76,6 +76,9 @@ class SimpleFormatterTypeTest extends TestCase
);
}
+ /**
+ * @doesNotPerformAssertions
+ */
public function testBuildForm(): void
{
$formBuilder = $this->createMock(FormBuilderInterface::class); | Mark tests without assertions as such (#<I>)
This is intentional, we want to see if the form fails to build. | sonata-project_SonataFormatterBundle | train | php |
a1fcf1bc41f27affca7cd67b385d1796655088f4 | diff --git a/audioFeatureExtraction.py b/audioFeatureExtraction.py
index <HASH>..<HASH> 100644
--- a/audioFeatureExtraction.py
+++ b/audioFeatureExtraction.py
@@ -721,7 +721,7 @@ def dirWavFeatureExtraction(dirName, mtWin, mtStep, stWin, stStep, computeBEAT=F
allMtFeatures = numpy.array([])
processingTimes = []
- types = ('*.wav', '*.aif', '*.aiff')
+ types = ('*.wav', '*.aif', '*.aiff', '*.mp3')
wavFilesList = []
for files in types:
wavFilesList.extend(glob.glob(os.path.join(dirName, files))) | feature extraction - dir also reads mp3 files | tyiannak_pyAudioAnalysis | train | py |
70f6578fae705e5a635848cf54fdae2ca858ef68 | diff --git a/test/spec/directives/vjs.directive.js b/test/spec/directives/vjs.directive.js
index <HASH>..<HASH> 100644
--- a/test/spec/directives/vjs.directive.js
+++ b/test/spec/directives/vjs.directive.js
@@ -36,6 +36,9 @@ describe('Directive: vjs.directive.js', function () {
});
it('should throw an error if videojs is not loaded', function () {
+ //TOOD: currently, this must be the last test
+ // because it destroys the reference to videojs
+ // find a way to fix that
expect(function () {
var vjs = window.videojs,
el; | Added note that videojs not loaded test must be last
Ideally this is not good and a solution should be found for this | arm0th_vjs-video | train | js |
8c76ff968ee751f3f09d7d80551c52b63b0b24a1 | diff --git a/lib/composers/with_mobx.js b/lib/composers/with_mobx.js
index <HASH>..<HASH> 100644
--- a/lib/composers/with_mobx.js
+++ b/lib/composers/with_mobx.js
@@ -2,9 +2,7 @@ import compose from '../compose';
import { autorun } from 'mobx';
export default function composeWithMobx(fn, L, E, options) {
- const onPropsChange = (props, onData) => {
- autorun(() => fn(props, onData));
- };
+ const onPropsChange = (props, onData) => autorun(() => fn(props, onData));
return compose(onPropsChange, L, E, options);
} | #<I> Return disposer for cleanup | arunoda_react-komposer | train | js |
3fce6e7868e350df234c7a6b177dcb5ff7f6b7a7 | diff --git a/lib/custom/tests/MW/View/Engine/TwigTest.php b/lib/custom/tests/MW/View/Engine/TwigTest.php
index <HASH>..<HASH> 100644
--- a/lib/custom/tests/MW/View/Engine/TwigTest.php
+++ b/lib/custom/tests/MW/View/Engine/TwigTest.php
@@ -44,7 +44,7 @@ class TwigTest extends \PHPUnit\Framework\TestCase
$view = $this->getMockBuilder( '\Twig_Template' )
- ->setConstructorArgs( array ( $this->mock ) )
+ ->setConstructorArgs( array( $this->mock ) )
->setMethods( array( 'getBlockNames', 'render', 'renderBlock' ) )
->getMockForAbstractClass();
@@ -63,10 +63,10 @@ class TwigTest extends \PHPUnit\Framework\TestCase
->getMockForAbstractClass();
$this->mock->expects( $this->once() )->method( 'getLoader' )
- ->will( $this->returnValue( $loader) );
+ ->will( $this->returnValue( $loader ) );
$this->mock->expects( $this->once() )->method( 'loadTemplate' )
- ->will( $this->returnValue( $view) );
+ ->will( $this->returnValue( $view ) );
$result = $this->object->render( $v, __FILE__, array( 'key' => 'value' ) ); | Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on <URL> | aimeos_ai-twig | train | php |
3579cefb03e89fe08d193f9e0fe44f5595914996 | diff --git a/src/Gush/Command/PullRequestCreateCommand.php b/src/Gush/Command/PullRequestCreateCommand.php
index <HASH>..<HASH> 100644
--- a/src/Gush/Command/PullRequestCreateCommand.php
+++ b/src/Gush/Command/PullRequestCreateCommand.php
@@ -122,14 +122,7 @@ class PullRequestCreateCommand extends BaseCommand implements TableFeature, GitH
protected function getMarkdownTableHelper(Questionary $questionary)
{
$table = $this->getHelper('table');
-
- /** @var TableHelper $table */
- $table
- ->setLayout(TableHelper::LAYOUT_DEFAULT)
- ->setVerticalBorderChar('|')
- ->setHorizontalBorderChar(' ')
- ->setCrossingChar(' ')
- ;
+ $table->setLayout('github');
// adds headers from questionary
$table->addRow($questionary->getHeaders()); | refactor create pr command logic with the new overridden github layout | gushphp_gush | train | php |
99c20c78245d816e0031067eb448151b20777251 | diff --git a/lib/heroku_san/tasks.rb b/lib/heroku_san/tasks.rb
index <HASH>..<HASH> 100644
--- a/lib/heroku_san/tasks.rb
+++ b/lib/heroku_san/tasks.rb
@@ -2,7 +2,11 @@ HEROKU_CONFIG_FILE = Rails.root.join('config', 'heroku.yml')
@app_settings =
if File.exists?(HEROKU_CONFIG_FILE)
- YAML.load_file(HEROKU_CONFIG_FILE)
+ if defined?(ERB)
+ YAML.load_file(ERB.new(HEROKU_CONFIG_FILE).result)
+ else
+ YAML.load_file(HEROKU_CONFIG_FILE)
+ end
else
{}
end | Automatically parsing using ERB if it's available. | jqr_heroku_san | train | rb |
c912d9a7223af533af331b33734d9947b9b4aa57 | diff --git a/addons/depgraph/src/main/java/org/commonjava/aprox/depgraph/discover/AproxProjectGraphDiscoverer.java b/addons/depgraph/src/main/java/org/commonjava/aprox/depgraph/discover/AproxProjectGraphDiscoverer.java
index <HASH>..<HASH> 100644
--- a/addons/depgraph/src/main/java/org/commonjava/aprox/depgraph/discover/AproxProjectGraphDiscoverer.java
+++ b/addons/depgraph/src/main/java/org/commonjava/aprox/depgraph/discover/AproxProjectGraphDiscoverer.java
@@ -77,7 +77,7 @@ public class AproxProjectGraphDiscoverer
if ( !ref.isSpecificVersion() )
{
specific = resolveSpecificVersion( ref, discoveryConfig );
- if ( specific.equals( ref ) )
+ if ( specific == null || specific.equals( ref ) )
{
logger.warn( "Cannot resolve specific version of: '%s'.", ref );
return null; | Fix NPE when no version can be selected. | Commonjava_indy | train | java |
ab48ad8f12d95783b819836e707292a9610f6cb6 | diff --git a/tests/compiler/LLL/test_optimize_lll.py b/tests/compiler/LLL/test_optimize_lll.py
index <HASH>..<HASH> 100644
--- a/tests/compiler/LLL/test_optimize_lll.py
+++ b/tests/compiler/LLL/test_optimize_lll.py
@@ -7,7 +7,6 @@ optimize_list = [
(["ne", 1, 0], ["ne", 1, 0]), # noop
(["if", ["ne", 1, 0], "pass"], ["if", ["xor", 1, 0], "pass"]),
(["assert", ["ne", 1, 0]], ["assert", ["xor", 1, 0]]),
- (["assert_reason", ["ne", 1, 0], 0, 0], ["assert_reason", ["xor", 1, 0], 0, 0]),
(["mstore", 0, ["ne", 1, 0]], ["mstore", 0, ["ne", 1, 0]]), # noop
] | test: remove `assert_reason` macro from test cases | ethereum_vyper | train | py |
05114e438c730cfff851ffa8589913eb0722bcf7 | diff --git a/packages/plugin-credentials/test/unit/spec/credentials.js b/packages/plugin-credentials/test/unit/spec/credentials.js
index <HASH>..<HASH> 100644
--- a/packages/plugin-credentials/test/unit/spec/credentials.js
+++ b/packages/plugin-credentials/test/unit/spec/credentials.js
@@ -115,7 +115,12 @@ describe(`plugin-credentials`, () => {
})));
});
- it(`falls back to the supertoken`, () => assert.becomes(spark.credentials.getUserToken(`spark:kms`), supertoken));
+ // Note: don't use becomes here. they are different state objects, so
+ // they have different cids. as such, the assertion fails, but then
+ // hangs (I think) because there's a recursive loop trying to render the
+ // diff.
+ it(`falls back to the supertoken`, () => assert.isFulfilled(spark.credentials.getUserToken(`spark:kms`))
+ .then((token) => assert.deepEqual(token.serialize(), supertoken.serialize())));
});
it(`blocks while a token refresh is inflight`, () => { | fix(plugin-credentials): fix comparison that can never pass | webex_spark-js-sdk | train | js |
3eb12666fa315072d7d5080ce37e67a1c91a3f29 | diff --git a/lib/rbgccxml/sax_parser.rb b/lib/rbgccxml/sax_parser.rb
index <HASH>..<HASH> 100644
--- a/lib/rbgccxml/sax_parser.rb
+++ b/lib/rbgccxml/sax_parser.rb
@@ -35,7 +35,7 @@ module RbGCCXML
NESTED_NODES = %w(Argument Base EnumValue)
def start_element(name, attributes = [])
- attr_hash = Hash[*attributes]
+ attr_hash = Hash[*attributes.flatten]
# Need to build a node in memory for those
# that we don't directly support | Update to work with changes to Nokogiri <I> (SIGH at API changes in patch version bumps) | jasonroelofs_rbgccxml | train | rb |
2eb04880e9a27e11d0f5b41b64c1c4d78c0e66f9 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -32,8 +32,7 @@ setup(
packages=find_packages(),
install_requires=[
'attrs>=17.4.0',
- # https://github.com/docker/docker-py/issues/2082
- 'docker[tls]>=3.2,<4',
+ 'docker>=3.6,<4',
'hyperlink',
'requests',
], | Docker tls dependency issue should be fixed now | praekeltfoundation_seaworthy | train | py |
efe9dd0ea85fa394e2fccd22881ddd6dcc891b20 | diff --git a/lib/catissue/domain/participant.rb b/lib/catissue/domain/participant.rb
index <HASH>..<HASH> 100644
--- a/lib/catissue/domain/participant.rb
+++ b/lib/catissue/domain/participant.rb
@@ -3,6 +3,10 @@ require 'catissue/helpers/person'
module CaTissue
# The Participant domain class.
+ #
+ # @quirk caTissue The Participant +collection_protocol_registrations+ cannot be inferred as the
+ # CPR +participant+ inverse since the +collectionProtocolRegistrations+ Java reader method is
+ # untyped. The inverse is manually established in {CollectionProtocolRegistration}.
class Participant
include Person
@@ -27,8 +31,8 @@ module CaTissue
add_attribute_defaults(:activity_status => 'Active', :ethnicity => 'Unknown', :gender => 'Unspecified',
:sex_genotype => 'Unknown', :vital_status => 'Unknown')
- # @quirk caTissue Bug #154: Participant gender is specified by caTissue as optional, but if it is not set then
- # it appears as Female in the GUI even though it is null in the database.
+ # @quirk caTissue Bug #154: Participant gender is specified by caTissue as optional, but if it is
+ # not set then it appears as Female in the GUI even though it is null in the database.
add_mandatory_attributes(:activity_status, :gender)
# @quirk caTissue Participant CPR cascade is simulated in the bizlogic. | Document caTissue quirks. | caruby_tissue | train | rb |
8ba61284a41324224156038d29b208a7b72c6588 | diff --git a/anyconfig/inputs.py b/anyconfig/inputs.py
index <HASH>..<HASH> 100644
--- a/anyconfig/inputs.py
+++ b/anyconfig/inputs.py
@@ -140,6 +140,9 @@ def find_parser(ipath, cps_by_ext, cps_by_type, forced_type=None):
if (ipath is None or not ipath) and forced_type is None:
raise ValueError("ipath or forced_type must be some value")
+ if isinstance(forced_type, anyconfig.backend.base.Parser):
+ return forced_type
+
if forced_type is None:
parser = find_by_filepath(ipath, cps_by_ext)
if parser is None:
@@ -147,9 +150,6 @@ def find_parser(ipath, cps_by_ext, cps_by_type, forced_type=None):
return parser()
- if isinstance(forced_type, anyconfig.backend.base.Parser):
- return forced_type
-
parser = find_by_type(forced_type, cps_by_type)
if parser is None:
raise UnknownParserTypeError(forced_type) | fix: make .inputs.find_parser return the first arg if it's parser
.inputs.find_parser should return the first argument `ipath` at once if
it's a parser object but it was not and now that wrong behavior was
changed and corrected to do so. | ssato_python-anyconfig | train | py |
4e1a9f3200718652d2ee2fad05bf9bd9e1379ef9 | diff --git a/elasticsearch-rails/lib/elasticsearch/rails/tasks/import.rb b/elasticsearch-rails/lib/elasticsearch/rails/tasks/import.rb
index <HASH>..<HASH> 100644
--- a/elasticsearch-rails/lib/elasticsearch/rails/tasks/import.rb
+++ b/elasticsearch-rails/lib/elasticsearch/rails/tasks/import.rb
@@ -60,7 +60,7 @@ namespace :elasticsearch do
rescue NoMethodError; end
end
- total_errors = klass.import force: ENV.fetch('FORCE', false),
+ total_errors = klass.__elasticsearch__.import force: ENV.fetch('FORCE', false),
batch_size: ENV.fetch('BATCH', 1000).to_i,
index: ENV.fetch('INDEX', nil),
type: ENV.fetch('TYPE', nil), | [RAILS] Fixed an error, where the `import` Rake task did not use the proxy object
The importing Rake task did not use the `__elasticsearch__` proxy when calling
the `import` method, thus clashing with gems like `activerecord-import` [<URL> | elastic_elasticsearch-rails | train | rb |
c31e3b1dc77526ed1cbc1e0bd34ad03fa83da6ab | diff --git a/subdownloader/provider/SDService.py b/subdownloader/provider/SDService.py
index <HASH>..<HASH> 100644
--- a/subdownloader/provider/SDService.py
+++ b/subdownloader/provider/SDService.py
@@ -550,8 +550,8 @@ class SDService(object):
'subhash': subtitle.get_md5_hash(),
'subfilename': subtitle.get_filename(),
'moviehash': video.get_osdb_hash(),
- 'moviebytesize': video.get_size(),
- 'movietimems': video.get_time_ms(),
+ 'moviebytesize': str(video.get_size()),
+ 'movietimems': str(video.get_time_ms()),
'moviefps': video.get_fps(),
'movieframes': video.get_framecount(),
'moviefilename': video.get_filename(), | provider/SDService: send big file sizes (><I>-bit) as string | subdownloader_subdownloader | train | py |
dc64c9bafa0d4c693a449e803f3be780d3b43c8c | diff --git a/src/main/java/com/google/maps/internal/PolylineEncoding.java b/src/main/java/com/google/maps/internal/PolylineEncoding.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/google/maps/internal/PolylineEncoding.java
+++ b/src/main/java/com/google/maps/internal/PolylineEncoding.java
@@ -35,7 +35,7 @@ public class PolylineEncoding {
int len = encodedPath.length();
- final List<LatLng> path = new ArrayList<>(len / 2);
+ final List<LatLng> path = new ArrayList<LatLng>(len / 2);
int index = 0;
int lat = 0;
int lng = 0; | Fix build
Forgot about Java6 source compat. | googlemaps_google-maps-services-java | train | java |
efb197156e9d790e83f44c14535a94af1a1f1b95 | diff --git a/lib/fastlane_core/cert_checker.rb b/lib/fastlane_core/cert_checker.rb
index <HASH>..<HASH> 100644
--- a/lib/fastlane_core/cert_checker.rb
+++ b/lib/fastlane_core/cert_checker.rb
@@ -10,20 +10,6 @@ module FastlaneCore
return ids.include? finger_print
end
- def self.wwdr_certificate_installed?
- certificate_name = "Apple Worldwide Developer Relations Certification Authority"
- `security find-certificate -c #{certificate_name}`
- $?.success?
- end
-
- def self.install_wwdr_certificate
- Dir.chdir '/tmp'
- url = 'https://developer.apple.com/certificationauthority/AppleWWDRCA.cer'
- filename = File.basename(url)
- `curl -O #{url} && security import #{filename} -k login.keychain`
- raise "Could not install WWDR certificate".red unless $?.success?
- end
-
# Legacy Method, use `installed?` instead
# rubocop:disable Style/PredicateName
def self.is_installed?(path)
@@ -32,8 +18,6 @@ module FastlaneCore
# rubocop:enable Style/PredicateName
def self.installed_identies
- install_wwdr_certificate unless wwdr_certificate_installed?
-
available = `security find-identity -v -p codesigning`
ids = []
available.split("\n").each do |current| | Reverted <I>eb | fastlane_fastlane | train | rb |
5cc388652d58b4e8f31bbdd2edf81d01ac19e112 | diff --git a/drools-verifier/src/main/java/org/drools/verifier/components/LiteralRestriction.java b/drools-verifier/src/main/java/org/drools/verifier/components/LiteralRestriction.java
index <HASH>..<HASH> 100644
--- a/drools-verifier/src/main/java/org/drools/verifier/components/LiteralRestriction.java
+++ b/drools-verifier/src/main/java/org/drools/verifier/components/LiteralRestriction.java
@@ -137,6 +137,8 @@ public class LiteralRestriction extends Restriction
intValue = Integer.parseInt( value );
valueType = Field.INT;
stringValue = value;
+ //even when value is an int, we fill doubleValue too
+ doubleValue = intValue;
return;
} catch ( NumberFormatException e ) {
// Not int. | doubleValue is also set when valueType = Field.INT. This way we can always use doubleValue if valueType = Field.INT or Field.DOUBLE.
git-svn-id: <URL> | kiegroup_drools | train | java |
1b3eadbeaded2b9801c1329137dea4bf24d8cf3e | diff --git a/lib/rfd.rb b/lib/rfd.rb
index <HASH>..<HASH> 100644
--- a/lib/rfd.rb
+++ b/lib/rfd.rb
@@ -376,13 +376,13 @@ module Rfd
when 'r'
@items = @items.shift(2) + @items.partition(&:directory?).flat_map {|arr| arr.sort.reverse}
when 'S', 's'
- @items = @items.shift(2) + @items.partition(&:directory?).flat_map {|arr| arr.sort_by(&:size)}
- when 'Sr', 'sr'
@items = @items.shift(2) + @items.partition(&:directory?).flat_map {|arr| arr.sort_by {|i| -i.size}}
+ when 'Sr', 'sr'
+ @items = @items.shift(2) + @items.partition(&:directory?).flat_map {|arr| arr.sort_by(&:size)}
when 'e'
- @items = @items.shift(2) + @items.partition(&:directory?).flat_map {|arr| arr.sort_by(&:extname)}
- when 'er'
@items = @items.shift(2) + @items.partition(&:directory?).flat_map {|arr| arr.sort {|x, y| y.extname <=> x.extname}}
+ when 'er'
+ @items = @items.shift(2) + @items.partition(&:directory?).flat_map {|arr| arr.sort_by(&:extname)}
end
end | Reverse some sort orders to be compatible with ls behavior | amatsuda_rfd | train | rb |
4f9eb36bb6e8e10102fc9fe0b15ff52a82876efc | diff --git a/python/rez/versions.py b/python/rez/versions.py
index <HASH>..<HASH> 100644
--- a/python/rez/versions.py
+++ b/python/rez/versions.py
@@ -180,12 +180,7 @@ class Version(object):
accepts a Version instance or a version ge.
"""
- # allow a ge to be passed directly
- if isinstance(version, Version):
- ge = version.ge
- else:
- ge = version
- return (ge >= self.ge) and (ge < self.lt)
+ return (version.ge >= self.ge) and (version.lt <= self.lt)
def get_union(self, ver):
""" | Fix a pre-existing bug where Version('<I>+') was contained in Version('<I>') | nerdvegas_rez | train | py |
a750f8a6a768e664f0aaa0cdc71faa9e57c13fd7 | diff --git a/lib/behavior/sfPhastBehaviorPosition.php b/lib/behavior/sfPhastBehaviorPosition.php
index <HASH>..<HASH> 100644
--- a/lib/behavior/sfPhastBehaviorPosition.php
+++ b/lib/behavior/sfPhastBehaviorPosition.php
@@ -66,6 +66,9 @@ public function getHolder(){
if(\$this->holderObject !== null) return \$this->holderObject;
return \$this->holderObject = PhastHolderPeer::retrieveFor(\$this);
}
+public function renderWidget(\$column = 'content'){
+ return WidgetPeer::render(\$this, \$column);
+}
";
} | +renderWidget() for holder objects | phast_sfPhastPlugin | train | php |
772bcd9e5056cb611d3b240dbdda9a89fe1290e6 | diff --git a/lib/qiita/response_renderer.rb b/lib/qiita/response_renderer.rb
index <HASH>..<HASH> 100644
--- a/lib/qiita/response_renderer.rb
+++ b/lib/qiita/response_renderer.rb
@@ -73,7 +73,7 @@ module Qiita
end
def has_body?
- @response.body.present?
+ @response.headers['Content-Length'].to_i > 0
end
end
end | Give more suitable checking logic of response body existence | increments_qiita-rb | train | rb |
a6c06c40ed88e1e0c3ba2bee73b0e603c99f8c07 | diff --git a/src/main/java/com/ning/billing/recurly/RecurlyClient.java b/src/main/java/com/ning/billing/recurly/RecurlyClient.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/ning/billing/recurly/RecurlyClient.java
+++ b/src/main/java/com/ning/billing/recurly/RecurlyClient.java
@@ -686,7 +686,7 @@ public class RecurlyClient {
///////////////////////////////////////////////////////////////////////////
- private <T> T doGET(final String resource, final Class<T> clazz) {
+ public <T> T doGET(final String resource, final Class<T> clazz) {
final StringBuffer url = new StringBuffer(baseUrl);
url.append(resource);
if (resource != null && !resource.contains("?")) { | Increase visibility of doGET to allow hand crafted requests to invoke
calls using the client's baseUrl | killbilling_recurly-java-library | train | java |
0fec36e2ae89bd9f13c863d4bb9a5af4ae7d9e54 | diff --git a/src/projCode/Gnom.php b/src/projCode/Gnom.php
index <HASH>..<HASH> 100644
--- a/src/projCode/Gnom.php
+++ b/src/projCode/Gnom.php
@@ -146,7 +146,7 @@ class Gnom
$cosc = cos($c);
$lat = Common::asinz($cosc * $this->sin_p14 + ($p->y * $sinc * $this->cos_p14) / $rh);
- $lon = atan2($p->x * sinc, rh * $this->cos_p14 * $cosc - $p->y * $this->sin_p14 * $sinc);
+ $lon = atan2($p->x * $sinc, $rh * $this->cos_p14 * $cosc - $p->y * $this->sin_p14 * $sinc);
$lon = Common::adjust_lon($this->long0 + $lon);
} else {
$lat = $this->phic0; | @nboisteault $ is missing for sinc and rh | proj4php_proj4php | train | php |
b3db8fc285a1ba274ff63931da7278bae3c6af01 | diff --git a/packages/openneuro-server/src/datalad/dataset.js b/packages/openneuro-server/src/datalad/dataset.js
index <HASH>..<HASH> 100644
--- a/packages/openneuro-server/src/datalad/dataset.js
+++ b/packages/openneuro-server/src/datalad/dataset.js
@@ -150,7 +150,7 @@ export const datasetsFilter = options => match => {
},
{
$match: {
- $in: [options.modality, 'summaries.0.modalities'],
+ 'summaries.0.modalities': options.modality,
},
},
], | fix: Fix regression with public dataset count | OpenNeuroOrg_openneuro | train | js |
c5e7c442c11b7cce8d7dbb44b32b7eb6136ad86d | diff --git a/microcosm_flask/conventions/encoding.py b/microcosm_flask/conventions/encoding.py
index <HASH>..<HASH> 100644
--- a/microcosm_flask/conventions/encoding.py
+++ b/microcosm_flask/conventions/encoding.py
@@ -45,7 +45,7 @@ def load_query_string_data(request_schema):
"""
Load query string data using the given schema.
- Schemas are assumbed to be compatible with the `PageSchema`.
+ Schemas are assumed to be compatible with the `PageSchema`.
"""
query_string_data = request.args | Fix doc typo in encoding
Thanks! | globality-corp_microcosm-flask | train | py |
7d9ac5f2079172b9725513796718eaad96218f3b | diff --git a/aws/ec2metadata/service.go b/aws/ec2metadata/service.go
index <HASH>..<HASH> 100644
--- a/aws/ec2metadata/service.go
+++ b/aws/ec2metadata/service.go
@@ -2,7 +2,9 @@ package ec2metadata
import (
"io/ioutil"
+ "net"
"net/http"
+ "time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
@@ -88,7 +90,19 @@ func copyConfig(config *Config) *aws.Config {
}
if c.HTTPClient == nil {
- c.HTTPClient = http.DefaultClient
+ c.HTTPClient = &http.Client{
+ Transport: &http.Transport{
+ Proxy: http.ProxyFromEnvironment,
+ Dial: (&net.Dialer{
+ // use a shorter timeout than default because the metadata
+ // service is local if it is running, and to fail faster
+ // if not running on an ec2 instance.
+ Timeout: 5 * time.Second,
+ KeepAlive: 30 * time.Second,
+ }).Dial,
+ TLSHandshakeTimeout: 10 * time.Second,
+ },
+ }
}
if c.Logger == nil {
c.Logger = aws.NewDefaultLogger() | aws/ec2metadata: Use custom dial timeout for faster ec2 metadata conn failure
The default client's connect timeout is <I> seconds. Which causes the SDK
to wait for a signficant amount of time if the application is not running
on an EC2 instance. Using a custom dial timeout allows the client to fail
sooner if not running on an ec2 instance.
Fix #<I> | aws_aws-sdk-go | train | go |
24314c2b3db781132f6c30cea35851c3871d5b0b | diff --git a/lib/Thelia/Controller/Admin/CouponController.php b/lib/Thelia/Controller/Admin/CouponController.php
index <HASH>..<HASH> 100644
--- a/lib/Thelia/Controller/Admin/CouponController.php
+++ b/lib/Thelia/Controller/Admin/CouponController.php
@@ -73,6 +73,8 @@ class CouponController extends BaseAdminController
Router::ABSOLUTE_URL
);
+ $args['coupon_order'] = $this->getListOrderFromSession('coupon', 'coupon_order', 'code');
+
return $this->render('coupon-list', $args);
}
@@ -856,5 +858,4 @@ class CouponController extends BaseAdminController
)
);
}
-
} | Normalized coupon list appearance, added sorting | thelia_core | train | php |
9c24952e3f59dc83b7c6193c434d15da902c82af | diff --git a/lib/player.js b/lib/player.js
index <HASH>..<HASH> 100644
--- a/lib/player.js
+++ b/lib/player.js
@@ -117,7 +117,13 @@ Player.prototype.initialize = function(cb) {
var pend = new Pend();
pend.go(initPlayer);
pend.go(initLibrary);
- pend.wait(cb);
+ pend.wait(function(err) {
+ if (err) return cb(err);
+ self.requestUpdateDb();
+ playlistChanged(self);
+ lazyReplayGainScanPlaylist(self);
+ cacheAllOptions(cb);
+ });
function initPlayer(cb) {
var groovePlaylist = groove.createPlaylist();
@@ -220,13 +226,7 @@ Player.prototype.initialize = function(cb) {
pend.go(cacheAllDb);
pend.go(cacheAllDirs);
pend.go(cacheAllPlaylist);
- pend.wait(function(err) {
- if (err) return cb(err);
- playlistChanged(self);
- lazyReplayGainScanPlaylist(self);
- self.requestUpdateDb();
- cacheAllOptions(cb);
- });
+ pend.wait(cb);
}
function cacheAllPlaylist(cb) { | player: fix race condition on initialization. closes #<I> | andrewrk_groovebasin | train | js |
529ebbf32a5bf901597a15d6b2b5b6fdc3bb59b6 | diff --git a/src/share/classes/com/sun/tools/javac/parser/JavacParser.java b/src/share/classes/com/sun/tools/javac/parser/JavacParser.java
index <HASH>..<HASH> 100644
--- a/src/share/classes/com/sun/tools/javac/parser/JavacParser.java
+++ b/src/share/classes/com/sun/tools/javac/parser/JavacParser.java
@@ -599,7 +599,7 @@ public class JavacParser implements Parser {
}
t = toP(F.at(pos).Select(t, ident()));
if (tyannos != null && tyannos.nonEmpty()) {
- t = toP(F.at(pos).AnnotatedType(tyannos, t));
+ t = toP(F.at(tyannos.head.pos).AnnotatedType(tyannos, t));
}
}
return t;
@@ -1301,7 +1301,7 @@ public class JavacParser implements Parser {
// typeArgs saved for next loop iteration.
t = toP(F.at(pos).Select(t, ident()));
if (tyannos != null && tyannos.nonEmpty()) {
- t = toP(F.at(pos).AnnotatedType(tyannos, t));
+ t = toP(F.at(tyannos.head.pos).AnnotatedType(tyannos, t));
}
break;
case ELLIPSIS: | Fix tree positions, which gives further improvement to TreePosTest result. | wmdietl_jsr308-langtools | train | java |
168770385995add4761c82301d4454fdd87891a8 | diff --git a/heron/api/src/python/__init__.py b/heron/api/src/python/__init__.py
index <HASH>..<HASH> 100644
--- a/heron/api/src/python/__init__.py
+++ b/heron/api/src/python/__init__.py
@@ -6,6 +6,7 @@ __all__ = ['api_constants', 'bolt', 'component', 'custom_grouping', 'global_metr
# Load basic topology modules
from .stream import Stream, Grouping
from .topology import Topology, TopologyBuilder
+from .topology_context import TopologyContext
# Load spout and bolt
from .bolt import Bolt | Expose TopologyContext in heronpy (#<I>) | apache_incubator-heron | train | py |
816d3f875714a495c91ab1cde6a36e2885ac1077 | diff --git a/lxd/storage.go b/lxd/storage.go
index <HASH>..<HASH> 100644
--- a/lxd/storage.go
+++ b/lxd/storage.go
@@ -711,7 +711,7 @@ func resetContainerDiskIdmap(container *containerLXC, srcIdmap *idmap.IdmapSet)
return nil
}
-func SetupStorageDriver(s *state.State, forceCheck bool) error {
+func setupStorageDriver(s *state.State, forceCheck bool) error {
pools, err := s.Cluster.StoragePoolsNotPending()
if err != nil {
if err == db.ErrNoSuchObject { | lxd/storage: Renames SetupStorageDriver to setupStorageDriver for consistency | lxc_lxd | train | go |
0e483ff6a58e92e7fe3f3e76decebeb419ff7089 | diff --git a/lhc/file_format/gtf_/index.py b/lhc/file_format/gtf_/index.py
index <HASH>..<HASH> 100644
--- a/lhc/file_format/gtf_/index.py
+++ b/lhc/file_format/gtf_/index.py
@@ -33,11 +33,15 @@ class IndexedGtfFile(object):
raise NotImplementedError('Random access not implemented for %s'%type(key))
genes = [self._completeGene(gene) for gene in genes]
- if isinstance(key, basestring):
- for gene in genes:
- if gene.name == key:
- return gene
+ #if isinstance(key, basestring):
+ # for gene in genes:
+ # if gene.name == key:
+ # return gene
return genes
+
+ def getGenesAtPosition(self, chr, pos):
+ genes = self._getGeneIntervalsInInterval(chr, pos, pos + 1)
+ return [self._completeGene(gene) for gene in genes]
def _getGeneIntervalsInInterval(self, chr, start, stop):
idx = self.ivl_index | added convenience function to gtf set | childsish_sofia | train | py |
731052ad0a31ea743485e53effb2845b8f4f865f | diff --git a/js/models/messages.js b/js/models/messages.js
index <HASH>..<HASH> 100644
--- a/js/models/messages.js
+++ b/js/models/messages.js
@@ -246,6 +246,7 @@
}.bind(this));
}
promise.catch(function(e) {
+ this.removeConflictFor(number);
this.saveErrors(e);
}.bind(this)); | Clear old key conflict errors after failed replay
If the replay failed due to a bad mac or other decryption error for some
other reason we still want to clear the conflict. If it failed because
it's still in conflict then the newly returned error will reflect that
and be saved.
// FREEBIE | ForstaLabs_librelay-node | train | js |
b454dd07ecee192bbc8fe459ff5f56ac6d9b06aa | diff --git a/src/performers/TweenPerformerWeb.js b/src/performers/TweenPerformerWeb.js
index <HASH>..<HASH> 100644
--- a/src/performers/TweenPerformerWeb.js
+++ b/src/performers/TweenPerformerWeb.js
@@ -34,9 +34,9 @@ import type {
PlanValueT,
} from '../expressions/tween';
-export type PlanAndTargetElementT = PlanAndTargetT&{
+export type PlanAndTargetElementT = {
target:Element,
-}
+}&PlanAndTargetT
// TODO(https://github.com/material-motion/material-motion-experiments-js/issues/8):
// Add support for Element.prototype.animate to Flow | [_fixed] Flow type for TweenPerformerWeb's PlanAndTargetT
Summary: There's [a bug in Flow](<URL>) that requires the most specific type in an intersection to come first. Working around it here by changing the order of the intersection.
Reviewers: #mdm_core_contributors, markwei
Reviewed By: #mdm_core_contributors, markwei
Differential Revision: <URL> | material-motion_material-motion-js | train | js |
9a9fa531bc787341bd838b142d4b047ef000cb17 | diff --git a/WellCommerceCartBundle.php b/WellCommerceCartBundle.php
index <HASH>..<HASH> 100644
--- a/WellCommerceCartBundle.php
+++ b/WellCommerceCartBundle.php
@@ -14,9 +14,7 @@ namespace WellCommerce\Bundle\CartBundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
-use WellCommerce\Bundle\CartBundle\DependencyInjection\Compiler\AutoRegisterServicesPass;
-use WellCommerce\Bundle\CartBundle\DependencyInjection\Compiler\MappingCompilerPass;
-use WellCommerce\Bundle\CartBundle\DependencyInjection\Compiler\RegisterCartVisitorPass;
+use WellCommerce\Bundle\CartBundle\DependencyInjection\Compiler;
/**
* Class WellCommerceCartBundle
@@ -28,8 +26,8 @@ class WellCommerceCartBundle extends Bundle
public function build(ContainerBuilder $container)
{
parent::build($container);
- $container->addCompilerPass(new RegisterCartVisitorPass());
- $container->addCompilerPass(new AutoRegisterServicesPass());
- $container->addCompilerPass(new MappingCompilerPass());
+ $container->addCompilerPass(new Compiler\RegisterCartVisitorPass());
+ $container->addCompilerPass(new Compiler\AutoRegisterServicesPass());
+ $container->addCompilerPass(new Compiler\MappingCompilerPass());
}
} | Added compiler passes to all bundles
(cherry picked from commit <I>ebd<I>a7aa0b9c6be3c<I>f<I>a7ce<I>bc<I>f) | WellCommerce_WishlistBundle | train | php |
14fa039d0713492e3037b4c691beb3f2bbb10034 | diff --git a/src/commands/sandbox.js b/src/commands/sandbox.js
index <HASH>..<HASH> 100644
--- a/src/commands/sandbox.js
+++ b/src/commands/sandbox.js
@@ -129,7 +129,7 @@ export default (program: any) => {
await UserSettings.mergeAsync({ sandboxBundleId });
}
- options.type = 'sandbox';
+ options.type = 'client';
options.releaseChannel = 'default';
options.hardcodeRevisionId = 'eb310d00-2af3-11e8-9906-3ba982c41215'; | client build type from 'sandbox' -> 'client'
fbshipit-source-id: <I>b4bf | expo_exp | train | js |
2d48fc11130d5aba8ed9f37ecdf7f8b5115753cf | diff --git a/utils/cmd.go b/utils/cmd.go
index <HASH>..<HASH> 100644
--- a/utils/cmd.go
+++ b/utils/cmd.go
@@ -77,7 +77,7 @@ func InitDataDir(Datadir string) {
_, err := os.Stat(Datadir)
if err != nil {
if os.IsNotExist(err) {
- fmt.Printf("Debug logging directory '%s' doesn't exist, creating it\n", Datadir)
+ fmt.Printf("Data directory '%s' doesn't exist, creating it\n", Datadir)
os.Mkdir(Datadir, 0777)
}
} | fix logmessage if data directory doesn't exist | ethereum_go-ethereum | train | go |
32616665c5cf6294444082f45b01541a98df3172 | diff --git a/src/app.js b/src/app.js
index <HASH>..<HASH> 100644
--- a/src/app.js
+++ b/src/app.js
@@ -25,8 +25,13 @@ export default function app(WrappedComponent, store) {
_store = createStore()
}
- /* istanbul ignore next */
class App extends Component {
+ // eslint-disable-next-line
+ constructor(props) {
+ /* istanbul ignore next */
+ super(props)
+ }
+
static childContextTypes = {
alfaStore: PropTypes.object
} | Mitigate the istanbul coverage problem. | lsm_alfa | train | js |
7d5d7d1698ce0f491ed4b2f00f5960f9df6c4647 | diff --git a/openquake/calculators/hazard/general.py b/openquake/calculators/hazard/general.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/hazard/general.py
+++ b/openquake/calculators/hazard/general.py
@@ -245,7 +245,6 @@ class BaseHazardCalculator(Calculator):
site_model = models.inputs4job(
self.job_ctxt.job_id, input_type='site_model')
- import nose; nose.tools.set_trace()
if len(site_model) == 0:
# No site model found for this job. Nothing to do here.
return | Removed a breakpoint; it shouldn't have been committed.
Former-commit-id: <I>aae<I>a<I>c<I>f6de<I>cf2f1ebb<I>f5 | gem_oq-engine | train | py |
e3d0ccaa25afff5f9f812050afa7e004c5c427d5 | diff --git a/abilian/app.py b/abilian/app.py
index <HASH>..<HASH> 100644
--- a/abilian/app.py
+++ b/abilian/app.py
@@ -174,7 +174,7 @@ class Application(Flask, ServiceManager, PluginManager):
base_bundles = (
('css', Bundle(self.css_bundle,
- filters='cssrewrite',
+ filters='cssimporter, cssrewrite',
output='style-%(version)s.min.css')),
('js-top', Bundle(self.top_js_bundle, output='top-%(version)s.min.js')),
('js', Bundle(self.js_bundle, output='app-%(version)s.min.js')),
@@ -184,7 +184,7 @@ class Application(Flask, ServiceManager, PluginManager):
# webassets: setup static url for our assets
from abilian.web import assets as core_bundles
- assets.append_path(core_bundles.RESOURCES_DIR, 'static/abilian')
+ assets.append_path(core_bundles.RESOURCES_DIR, '/static/abilian')
def send_file_from_directory(filename, directory):
cache_timeout = self.get_send_file_max_age(filename) | fix css filters, fix assets path for core assets | abilian_abilian-core | train | py |
48e9213d80c1e22dc038ea22b9977900764dbda6 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -244,7 +244,7 @@ Unirest = function (method, uri, headers, body, callback) {
send: function (data) {
var type = $this.options.headers[$this.hasHeader('content-type')];
- if (is(data).a(Object)) {
+ if (is(data).a(Object) && !Buffer.isBuffer(data)) {
if (!type || type != 'application/json') {
$this.type('form');
type = $this.options.headers[$this.hasHeader('content-type')];
diff --git a/tests/basic.js b/tests/basic.js
index <HASH>..<HASH> 100644
--- a/tests/basic.js
+++ b/tests/basic.js
@@ -113,5 +113,15 @@ describe('Unirest', function () {
done();
});
});
+
+ it('should correctly post a buffer with mime-type', function (done) {
+ unirest.post('http://httpbin.org/post')
+ .headers({ 'Content-Type': 'img/svg+xml' })
+ .send(new Buffer("<svg></svg>"))
+ .end(function (response) {
+ should(response.body.headers['Content-Type']).equal('img/svg+xml');
+ done();
+ });
+ });
});
});
\ No newline at end of file | fix not to touch content_type when posting a buffer
“is(data).a(Object)” returns true when “data” is a Buffer. And
previous code is resetting type as “form” if the type isn't set to
“json”.
This commit patches to check a Buffer specifically using
“Buffer.isBuffer” method. | Kong_unirest-nodejs | train | js,js |
b3a2dfad9ae8c2fb6425b5346af07faf89d115eb | diff --git a/Tests/Unit/Fixtures/TestCode.php b/Tests/Unit/Fixtures/TestCode.php
index <HASH>..<HASH> 100644
--- a/Tests/Unit/Fixtures/TestCode.php
+++ b/Tests/Unit/Fixtures/TestCode.php
@@ -14,8 +14,9 @@ namespace Blast\Component\Code\Tests\Unit\Fixtures;
use Blast\Component\Code\Model\AbstractCode;
use Blast\Component\Code\Model\CodeInterface;
+use Blast\Component\Resource\Model\ResourceInterface;
-class TestCode extends AbstractCode implements CodeInterface
+class TestCode extends AbstractCode implements CodeInterface, ResourceInterface
{
public function __construct($value, $format = '/^[A-Z]{3}\-[\d]{8}$/')
{ | [Blast] [Code] Fix tests by setting TestCode as a resource | blast-project_Code | train | php |
73149c04206b2a59b361bc0baeecee4e2744b254 | diff --git a/werkzeug/utils.py b/werkzeug/utils.py
index <HASH>..<HASH> 100644
--- a/werkzeug/utils.py
+++ b/werkzeug/utils.py
@@ -1305,6 +1305,8 @@ def escape(s, quote=None):
"""
if s is None:
return ''
+ elif hasattr(s, '__html__'):
+ return s.__html__()
elif not isinstance(s, basestring):
s = unicode(s)
s = s.replace('&', '&').replace('<', '<').replace('>', '>') | werkzeug.escape knows about `__html__` now. | pallets_werkzeug | train | py |
57edc8cefda30656d73afe21b6e29a6d72378a20 | diff --git a/asn1crypto/core.py b/asn1crypto/core.py
index <HASH>..<HASH> 100644
--- a/asn1crypto/core.py
+++ b/asn1crypto/core.py
@@ -1164,16 +1164,15 @@ class Choice(Asn1Value):
An Asn1Value object of the chosen alternative
"""
- if self._parsed is not None:
- return self._parsed
-
- try:
- _, spec, params = self._alternatives[self._choice]
- self._parsed, _ = _parse_build(self._contents, spec=spec, spec_params=params)
- except (ValueError, TypeError) as e:
- args = e.args[1:]
- e.args = (e.args[0] + '\n while parsing %s' % type_name(self),) + args
- raise e
+ if self._parsed is None:
+ try:
+ _, spec, params = self._alternatives[self._choice]
+ self._parsed, _ = _parse_build(self._contents, spec=spec, spec_params=params)
+ except (ValueError, TypeError) as e:
+ args = e.args[1:]
+ e.args = (e.args[0] + '\n while parsing %s' % type_name(self),) + args
+ raise e
+ return self._parsed
@property
def chosen(self): | Fix missing return value from core.Choice.parse() used by core.Choice.chosen | wbond_asn1crypto | train | py |
fec85e75db19993ee8b2e86a4f93447e910ba34c | diff --git a/lib/schema-validator.js b/lib/schema-validator.js
index <HASH>..<HASH> 100644
--- a/lib/schema-validator.js
+++ b/lib/schema-validator.js
@@ -23,8 +23,15 @@ module.exports = (function() {
// Load Schemas
var schemas = fs.readdirSync(baseDir)
+ .filter(function(fileName) {
+ return /^[\w\s]+\.json$/.test(fileName);
+ })
.map(function(fileName) {
- return JSON.parse(fs.readFileSync(path.join(baseDir, fileName), 'utf8'));
+ try {
+ return JSON.parse(fs.readFileSync(path.join(baseDir, fileName), 'utf8'));
+ } catch (e) {
+ throw new Error('Failed to parse schema: ' + fileName);
+ }
})
.forEach(function(schema) {
schema.id = schema.title; | Filter unwanted files in /schemas | ripple_ripple-rest | train | js |
e5248ced1c92ee587d7c865bfffab5d6803081ec | diff --git a/samples/send.js b/samples/send.js
index <HASH>..<HASH> 100644
--- a/samples/send.js
+++ b/samples/send.js
@@ -60,10 +60,7 @@ if (parsed.address) {
var addr = parsed.address;
if (addr.indexOf('amqp://') === 0) {
hostname = addr.replace("amqp://", '');
- } else {
- hostname = addr;
}
-
if (hostname.indexOf('/') > -1) {
topic = hostname.substring(hostname.indexOf('/') + 1);
hostname = hostname.substring(0, hostname.indexOf('/')); | revert send.js -a <address> behaviour | mqlight_nodejs-mqlight | train | js |
b209ae1dc5d5a256a7c184722a5ec524ba3c7f13 | diff --git a/aeron-archiver/src/main/java/io/aeron/archiver/RecordingFragmentReader.java b/aeron-archiver/src/main/java/io/aeron/archiver/RecordingFragmentReader.java
index <HASH>..<HASH> 100644
--- a/aeron-archiver/src/main/java/io/aeron/archiver/RecordingFragmentReader.java
+++ b/aeron-archiver/src/main/java/io/aeron/archiver/RecordingFragmentReader.java
@@ -216,6 +216,11 @@ class RecordingFragmentReader implements AutoCloseable
interface SimplifiedControlledPoll
{
+ /**
+ * Called by the {@link RecordingFragmentReader}. Implementors need only process DATA fragments.
+ *
+ * @return true if fragment processed, false to abort.
+ */
boolean onFragment(
DirectBuffer fragmentBuffer,
int fragmentOffset, | [Java] Document only data frames are passed to SimplifiedControlledPoll | real-logic_aeron | train | java |
724ae3172e5fa25ca6546c218303647588c0573f | diff --git a/tests/Doctrine/Tests/TestInit.php b/tests/Doctrine/Tests/TestInit.php
index <HASH>..<HASH> 100644
--- a/tests/Doctrine/Tests/TestInit.php
+++ b/tests/Doctrine/Tests/TestInit.php
@@ -13,9 +13,6 @@ require_once __DIR__ . '/../../../lib/Doctrine/Common/ClassLoader.php';
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine');
$classLoader->register();
-require_once 'PHPUnit/Util/Filter.php';
-\PHPUnit_Util_Filter::addDirectoryToWhitelist(__DIR__ . '/../../../lib/');
-
set_include_path(
__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'lib'
. PATH_SEPARATOR . | [<I>] Reverted restriction of coverage to library path | doctrine_annotations | train | php |
2a45511ccd57ea348438fcd5a43e09bef1c94584 | diff --git a/foreman/itemHost.py b/foreman/itemHost.py
index <HASH>..<HASH> 100644
--- a/foreman/itemHost.py
+++ b/foreman/itemHost.py
@@ -165,10 +165,10 @@ class ItemHost(ForemanItem):
proxyHostname = 'foreman.' + domain
password = self.getParamFromEnv('password', defaultPwd)
sshauthkeys = self.getParamFromEnv('global_sshkey', defaultSshKey)
- with open(tplFolder+'puppet.conf', 'rb') as puppet_file:
+ with open(tplFolder+'puppet.conf', 'r') as puppet_file:
p = MyTemplate(puppet_file.read())
- enc_puppet_file = base64.b64encode(p.substitute(
- foremanHostname=proxyHostname))
+ p.substitute(foremanHostname=proxyHostname)
+ enc_puppet_file = base64.b64encode(bytes(p.template,'utf-8'))
with open(tplFolder+'cloud-init.tpl', 'r') as content_file:
s = MyTemplate(content_file.read())
if sshauthkeys: | Correct the way base<I> encoding is done | davidblaisonneau-orange_foreman | train | py |
7eb1611b972be787f4b3fd70144298d7685e866b | diff --git a/src/main/resources/META-INF/resources/primefaces/picklist/picklist.js b/src/main/resources/META-INF/resources/primefaces/picklist/picklist.js
index <HASH>..<HASH> 100644
--- a/src/main/resources/META-INF/resources/primefaces/picklist/picklist.js
+++ b/src/main/resources/META-INF/resources/primefaces/picklist/picklist.js
@@ -54,6 +54,7 @@ PrimeFaces.widget.PickList = PrimeFaces.widget.BaseWidget.extend({
cancel: '.ui-state-disabled,.ui-chkbox-box',
connectWith: this.jqId + ' .ui-picklist-list',
revert: 1,
+ helper: 'clone',
update: function(event, ui) {
$this.unselectItem(ui.item); | Fix #<I>: Picklist Firefox issue dragging elements with checkboxes. | primefaces_primefaces | train | js |
d913b395df44764812e850bb8d93a066aac8bc8a | diff --git a/Utilities/Functions.php b/Utilities/Functions.php
index <HASH>..<HASH> 100644
--- a/Utilities/Functions.php
+++ b/Utilities/Functions.php
@@ -34,7 +34,7 @@ class Functions
{
if (!is_string($selector)) {
return $selector;
- } elseif (preg_match('/\(\)|->/', $selector)) {
+ } elseif (strpos($selector, '()') !== FALSE || strpos($selector, '->') !== FALSE) {
return Functions::extractFieldRecursively($selector, $accessPrivate);
} else {
return Functions::extractField($selector, $accessPrivate); | optimised Functions::extractExpression | letsdrink_ouzo-goodies | train | php |
da6da4be2e34dde7257f614f9f0dcb7db6116831 | diff --git a/src/justbases/version.py b/src/justbases/version.py
index <HASH>..<HASH> 100644
--- a/src/justbases/version.py
+++ b/src/justbases/version.py
@@ -26,5 +26,5 @@
.. moduleauthor:: mulhern <amulhern@redhat.com>
"""
-__version__ = '0.3'
+__version__ = '0.4'
__version_info__ = tuple(int(x) for x in __version__.split('.')) | New version: <I>. | mulkieran_justbases | train | py |
506c8fdf4342be2ddb194c0a78f6360384784052 | diff --git a/src/main/java/com/stripe/model/BalanceTransaction.java b/src/main/java/com/stripe/model/BalanceTransaction.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/stripe/model/BalanceTransaction.java
+++ b/src/main/java/com/stripe/model/BalanceTransaction.java
@@ -21,7 +21,7 @@ public class BalanceTransaction extends APIResource {
Long created;
Long availableOn;
String status;
- Long fee;
+ Integer fee;
List<Fee> feeDetails;
String description;
@@ -97,11 +97,11 @@ public class BalanceTransaction extends APIResource {
this.status = status;
}
- public Long getFee() {
+ public Integer getFee() {
return fee;
}
- public void setFee(Long fee) {
+ public void setFee(Integer fee) {
this.fee = fee;
} | Migrate BalanceTransaction:fee to Integer from Long. | stripe_stripe-java | train | java |
9c0c98e61551f25584f6c35bccd1491bdad85d59 | diff --git a/workers.go b/workers.go
index <HASH>..<HASH> 100644
--- a/workers.go
+++ b/workers.go
@@ -199,7 +199,8 @@ func terminate(reflex *Reflex) {
return
}
}
- // After SIGINT doesn't do anything, try SIGKILL.
+ // After SIGINT doesn't do anything, try SIGKILL 5 seconds later.
+ timer.Reset(5000 * time.Millisecond)
sig = syscall.SIGKILL
}
} | Reset the timer after SIGINT (so that SIGKILL will really be sent). | cespare_reflex | train | go |
ee16bd65d88522158cd285245c914d9e35778d7a | diff --git a/base/Provider.php b/base/Provider.php
index <HASH>..<HASH> 100644
--- a/base/Provider.php
+++ b/base/Provider.php
@@ -32,6 +32,13 @@ abstract class Provider {
// Public Methods
// =========================================================================
+
+ public function getScopeDocsUrl()
+ {
+ return null;
+ }
+
+
public function getIconUrl()
{
return null; | Added base Provider::getScopeDocsUrl() | dukt_oauth | train | php |
0e109d201dff4f24e6d03bcf8b74dd9aaeaa968f | diff --git a/address/pythonutils/__init__.py b/address/pythonutils/__init__.py
index <HASH>..<HASH> 100644
--- a/address/pythonutils/__init__.py
+++ b/address/pythonutils/__init__.py
@@ -1,2 +0,0 @@
-import conv
-import xml_utils | Recent changes to pythonutils. | furious-luke_django-address | train | py |
4bc97cf3929d02ea740331d6a5c67be26ba98049 | diff --git a/src/Output.js b/src/Output.js
index <HASH>..<HASH> 100644
--- a/src/Output.js
+++ b/src/Output.js
@@ -1573,8 +1573,9 @@ export class Output extends EventEmitter {
}
/**
- * Sends an **all note soff** channel mode message. This will turn all currently playing notes
- * off. However, this does not prevent new notes from being played.
+ * Sends an **all notes off** channel mode message. This will make all currently playing notes
+ * fade out just as if their key had been released. This is different from the
+ * [turnSoundOff()]{@link Output#turnSoundOff} method which mutes all sounds immediately.
*
* @param {Object} [options={}]
*
diff --git a/src/OutputChannel.js b/src/OutputChannel.js
index <HASH>..<HASH> 100644
--- a/src/OutputChannel.js
+++ b/src/OutputChannel.js
@@ -1573,8 +1573,9 @@ export class OutputChannel extends EventEmitter {
}
/**
- * Sends an **all notes off** channel mode message. This will turn all currently playing notes
- * off. However, this does not prevent new notes from being played.
+ * Sends an **all notes off** channel mode message. This will make all currently playing notes
+ * fade out just as if their key had been released. This is different from the
+ * [turnSoundOff()]{@link OutputChannel#turnSoundOff} method which mutes all sounds immediately.
*
* @param {Object} [options={}]
* | Clarify what turnNotesOff() does | djipco_webmidi | train | js,js |
4676364608d586bae86b490625c2c0e1162e99de | diff --git a/BaragonBase/src/main/java/com/hubspot/baragon/models/ServiceInfo.java b/BaragonBase/src/main/java/com/hubspot/baragon/models/ServiceInfo.java
index <HASH>..<HASH> 100644
--- a/BaragonBase/src/main/java/com/hubspot/baragon/models/ServiceInfo.java
+++ b/BaragonBase/src/main/java/com/hubspot/baragon/models/ServiceInfo.java
@@ -37,13 +37,17 @@ public class ServiceInfo {
if (isAbsoluteURI(route) && ! isAbsoluteURI(rewriteAppRootTo)) {
LOG.error(String.format("Provided appRoot %s is absolute, and rewriteAppRootTo %s is not. This will result in a rewrite of %sresource to %sresource",
route, rewriteAppRootTo, route, rewriteAppRootTo));
+ this.rewriteAppRootTo = null;
} else if (! isAbsoluteURI(route) && isAbsoluteURI(rewriteAppRootTo)) {
LOG.error(String.format("Provided appRoot %s is not absolute, and rewriteAppRootTo %s is. This will result in a rewrite of %sresource to %s resource",
route, rewriteAppRootTo, route, rewriteAppRootTo));
+ this.rewriteAppRootTo = null;
} else {
this.rewriteAppRootTo = rewriteAppRootTo;
}
- }
+ } else {
+ this.rewriteAppRootTo = null;
+ }
}
private boolean isAbsoluteURI(String uri) { | compilation warnings due to this.rewriteAppRooTo not being assigned in some cases | HubSpot_Baragon | train | java |
05c65a49c73da405b684fc9f52b4568560602923 | diff --git a/lib/assignable_values/active_record/restriction/base.rb b/lib/assignable_values/active_record/restriction/base.rb
index <HASH>..<HASH> 100644
--- a/lib/assignable_values/active_record/restriction/base.rb
+++ b/lib/assignable_values/active_record/restriction/base.rb
@@ -183,7 +183,9 @@ module AssignableValues
restriction = self
enhance_model do
assignable_values_method = "assignable_#{restriction.property.to_s.pluralize}"
- define_method assignable_values_method do |options = {}|
+ define_method assignable_values_method do |*args|
+ # Ruby 1.8.7 does not support optional block arguments :(
+ options = args.first || {}
options.merge!({:decorate => true})
restriction.assignable_values(self, options)
end | Fix block with optional arguments for Ruby <I> (workaround) | makandra_assignable_values | train | rb |
04948ce5b08465adc5cd0fb94ce7c8ddcc864930 | diff --git a/synapse/lib/persist.py b/synapse/lib/persist.py
index <HASH>..<HASH> 100644
--- a/synapse/lib/persist.py
+++ b/synapse/lib/persist.py
@@ -249,7 +249,8 @@ class Dir(s_eventbus.EventBus):
next object and the unpacked object itself.
'''
que = s_queue.Queue()
- unpk = msgpack.Unpacker(use_list=0, encoding='utf8')
+ unpk = msgpack.Unpacker(use_list=0, encoding='utf8',
+ unicode_errors='surrogatepass')
# poff is used for iterating over persistence files when unpacking,
# while the user supplied offset is used to return absolute offsets | Add fix for persist surrogatepass | vertexproject_synapse | train | py |
e593eab8a1b79a3b1829ef0b29e627de6ba4ac24 | diff --git a/firebirdsql/wireprotocol.py b/firebirdsql/wireprotocol.py
index <HASH>..<HASH> 100644
--- a/firebirdsql/wireprotocol.py
+++ b/firebirdsql/wireprotocol.py
@@ -817,7 +817,7 @@ class WireProtocol:
elif op == self.op_event:
db_handle = bytes_to_int(recv_channel(self.sock, 4))
ln = bytes_to_bint(recv_channel(self.sock, 4))
- b = recv_channel(self.sock, ln)
+ b = recv_channel(self.sock, ln, True)
assert byte_to_int(b[0]) == 1
i = 1
while i < len(b):
@@ -826,8 +826,11 @@ class WireProtocol:
n = bytes_to_int(b[i+1+ln:i+1+ln+4])
event_names[s] = n
i += ln + 5
+ recv_channel(self.sock, 8) # ignore AST info
- event_id = bytes_to_int(recv_channel(self.sock, 4))
+ event_id = bytes_to_bint(recv_channel(self.sock, 4))
break
+ else:
+ raise InternalError
return (event_id, event_names) | fix recieve event packets | nakagami_pyfirebirdsql | train | py |
b656c722705e3952323d8b82477338dc99c513f6 | diff --git a/java/server/src/org/openqa/selenium/remote/server/log/LoggingManager.java b/java/server/src/org/openqa/selenium/remote/server/log/LoggingManager.java
index <HASH>..<HASH> 100644
--- a/java/server/src/org/openqa/selenium/remote/server/log/LoggingManager.java
+++ b/java/server/src/org/openqa/selenium/remote/server/log/LoggingManager.java
@@ -55,7 +55,7 @@ public class LoggingManager {
resetLoggerToOriginalState();
overrideSimpleFormatterWithTerseOneForConsoleHandler(currentLogger, debugMode);
addInMemoryLogger(currentLogger, options);
- addPerSessionLogger(currentLogger, options, debugMode);
+ //addPerSessionLogger(currentLogger, options, debugMode);
if (debugMode) {
currentLogger.setLevel(Level.FINE);
} | Fixing memory leak on grid node. It is a temporary fix, LoggingManager
needs to be rethinked as the whole. Fixes issue <I> | SeleniumHQ_selenium | train | java |
ea63ee03b82c175ae8448e5d85bdbea752d2dcd3 | diff --git a/fcrepo-kernel/src/main/java/org/fcrepo/kernel/RdfLexicon.java b/fcrepo-kernel/src/main/java/org/fcrepo/kernel/RdfLexicon.java
index <HASH>..<HASH> 100644
--- a/fcrepo-kernel/src/main/java/org/fcrepo/kernel/RdfLexicon.java
+++ b/fcrepo-kernel/src/main/java/org/fcrepo/kernel/RdfLexicon.java
@@ -67,7 +67,9 @@ public final class RdfLexicon {
* Fedora configuration namespace "fedora-config", used for user-settable
* configuration properties.
**/
- public static final String FEDORA_CONFIG_NAMESPACE =
+ // TODO from UCDetector: Constant "RdfLexicon.FEDORA_CONFIG_NAMESPACE" has 0 references
+ // should be referenced again when versioning is back in REST api
+ public static final String FEDORA_CONFIG_NAMESPACE = // NO_UCD (unused code)
"http://fedora.info/definitions/v4/config#";
/** | document a temporarily unused constant in RdfLexicon | fcrepo4_fcrepo4 | train | java |
83e0cedb6815fb8be7bbd750262c75e5c0a353ce | diff --git a/backend/agent/simple_agent.py b/backend/agent/simple_agent.py
index <HASH>..<HASH> 100644
--- a/backend/agent/simple_agent.py
+++ b/backend/agent/simple_agent.py
@@ -401,8 +401,7 @@ class SimpleAgent(object):
stdout = str(docker_connection.logs(container_id, stdout=True, stderr=False))
result = json.loads(stdout)
except Exception as e:
- print e
- self.logger.warning("Cannot get back stdout of container %s!", container_id)
+ self.logger.warning("Cannot get back stdout of container %s! (%s)", container_id, str(e))
result = {'result': 'crash', 'text': 'The grader did not return a readable output'}
# Close RPyC server
@@ -450,7 +449,8 @@ class SimpleAgent(object):
network_disabled=True,
volumes={'/task/student': {}},
command=command,
- working_dir=working_dir
+ working_dir=working_dir,
+ user="4242"
)
container_id = response["Id"] | Run student container with uid <I> | UCL-INGI_INGInious | train | py |
c473d392e15912b68f09e20a329758be7ffe7930 | diff --git a/yotta/lib/vcs.py b/yotta/lib/vcs.py
index <HASH>..<HASH> 100644
--- a/yotta/lib/vcs.py
+++ b/yotta/lib/vcs.py
@@ -110,7 +110,7 @@ class Git(VCS):
return self.worktree
def _gitCmd(self, *args):
- return ['git','--work-tree=%s' % self.worktree,'--git-dir=%s'%self.gitdir] + list(args);
+ return ['git','--work-tree=%s' % self.worktree,'--git-dir=%s'%self.gitdir.replace('\\', '/')] + list(args);
@classmethod
def _execCommands(cls, commands): | Fix 'yotta version' in Windows
Without this patch, 'yotta version' would fail with an 'Invalid argument'
error in Windows. With this patch, the command works. No idea why it works,
but it does. Also, it seems that replacing '\' with '/' only needs to
happen for --git-dir, --work-tree doesn't have a problem with backslashes. | ARMmbed_yotta | train | py |
1029ce4c9dd82e9145d45b4d2a5e90294602c6c8 | diff --git a/lib/connection.js b/lib/connection.js
index <HASH>..<HASH> 100644
--- a/lib/connection.js
+++ b/lib/connection.js
@@ -249,8 +249,8 @@ Connection.prototype.handlePacket = function (packet) {
if (packet) {
console.log(' raw: ' + packet.buffer.slice(packet.offset, packet.offset + packet.length()).toString('hex'));
console.trace();
- var commandName = this._command ? this._command._commandName + '#' : '(no command)#';
- console.log(this._internalId + ' ' + this.connectionId + ' ==> ' + this._command._commandName + '#' + this._command.stateName() + '(' + [packet.sequenceId, packet.type(), packet.length()].join(',') + ')');
+ var commandName = this._command ? this._command._commandName : '(no command)';
+ console.log(this._internalId + ' ' + this.connectionId + ' ==> ' + commandName + '#' + this._command.stateName() + '(' + [packet.sequenceId, packet.type(), packet.length()].join(',') + ')');
}
}
if (!this._command) { | don't crash in debug log if there is unexpected packet | sidorares_node-mysql2 | train | js |
f48a1e38f5fb7fcceefc109d5a6e926ebff3a2b2 | diff --git a/lib/parallel_specs.rb b/lib/parallel_specs.rb
index <HASH>..<HASH> 100644
--- a/lib/parallel_specs.rb
+++ b/lib/parallel_specs.rb
@@ -21,7 +21,7 @@ module ParallelSpecs
end
def run_tests(test_files, process_number)
- cmd = "export RAILS_ENV=test ; export TEST_ENV_NUMBER=#{process_number == 0 ? '' :process_number + 1} ; export RSPEC_COLOR=1 ; script/spec -O spec/spec.opts #{test_files * ' '}"
+ cmd = "export RAILS_ENV=test ; export TEST_ENV_NUMBER=#{process_number == 0 ? '' : process_number + 1} ; export RSPEC_COLOR=1 ; script/spec -O spec/spec.opts #{test_files * ' '}"
f = open("|#{cmd}")
while out = f.gets(".")
print out | Missed a space :). | grosser_parallel | train | rb |
1d1d32d0d8e176b171341a912aa5f04c5dcbab3a | diff --git a/zhaquirks/xbee/__init__.py b/zhaquirks/xbee/__init__.py
index <HASH>..<HASH> 100644
--- a/zhaquirks/xbee/__init__.py
+++ b/zhaquirks/xbee/__init__.py
@@ -150,7 +150,7 @@ class XBeeCommon(CustomDevice):
"""Remote at command."""
if hasattr(self._application, "remote_at_command"):
return self._application.remote_at_command(
- self.nwk, command, *args, apply_changes=True, encryption=True, **kwargs
+ self.nwk, command, *args, apply_changes=True, encryption=False, **kwargs
)
_LOGGER.warning("Remote At Command not supported by this coordinator") | Fix Remote AT encryption (#<I>)
Explicitly disable remote AT command encryption. As per the specs, it requires a secure session to be established with the destination, which we don't currently do. | dmulcahey_zha-device-handlers | train | py |
120dae77498847d98391e14ff4b5757b0f85ad4a | diff --git a/py/execnet/rsync.py b/py/execnet/rsync.py
index <HASH>..<HASH> 100644
--- a/py/execnet/rsync.py
+++ b/py/execnet/rsync.py
@@ -93,6 +93,13 @@ class RSync(object):
if self._verbose:
print '%s <= %s' % (gateway.remoteaddress, modified_rel_path)
+ def send_if_targets(self):
+ """ Sends only if there are targets, otherwise returns
+ """
+ if not self._channels:
+ return
+ self.send()
+
def send(self):
""" Sends a sourcedir to all added targets.
""" | [svn r<I>] Add a method which sends only if there are available targets
--HG--
branch : trunk | vmalloc_dessert | train | py |
1bead1a3846cf22bd59fb0daae41b1c9cc34bccb | diff --git a/lib/mongo_mapper/plugins/identity_map.rb b/lib/mongo_mapper/plugins/identity_map.rb
index <HASH>..<HASH> 100644
--- a/lib/mongo_mapper/plugins/identity_map.rb
+++ b/lib/mongo_mapper/plugins/identity_map.rb
@@ -76,6 +76,14 @@ module MongoMapper
end
end
end
+
+ def find_each(opts={}, &block)
+ query = clone.amend(opts)
+ super(opts) do |doc|
+ model.remove_documents_from_map(doc) if query.fields?
+ block.call(doc) unless block.nil?
+ end
+ end
end
def query(opts={})
diff --git a/test/functional/test_identity_map.rb b/test/functional/test_identity_map.rb
index <HASH>..<HASH> 100644
--- a/test/functional/test_identity_map.rb
+++ b/test/functional/test_identity_map.rb
@@ -372,6 +372,13 @@ class IdentityMapTest < Test::Unit::TestCase
assert_not_in_map(@person)
end
+ should "not add to map using where and each" do
+ @person_class.where(:id => @person.id).each{|_|}
+ assert_in_map(@person)
+ @person_class.where(:id => @person.id).only(:id).each{|_|}
+ assert_not_in_map(@person)
+ end
+
should "return nil if not found" do
@person_class.fields(:name).find(BSON::ObjectId.new).should be_nil
end | test/fix for records with partial set of fields being added to identity map when using .each on Plucky::Query | mongomapper_mongomapper | train | rb,rb |
6088c812dcb0c91107cebea898d0c3f14724be19 | diff --git a/samples/BAS_Sample.java b/samples/BAS_Sample.java
index <HASH>..<HASH> 100755
--- a/samples/BAS_Sample.java
+++ b/samples/BAS_Sample.java
@@ -15,6 +15,7 @@ public class BAS_Sample {
private final Map<String, String> m = new HashMap<>();
private long value = 0;
+ private Long stash = Long.valueOf(0);
public void testIfScope(String s) {
Object o = new Object();
@@ -147,6 +148,19 @@ public class BAS_Sample {
}
}
+ public Long testFPRefNull(boolean b) {
+
+ Long save = stash;
+ stash = null;
+
+ if (b) {
+ return save;
+ }
+
+ return null;
+
+ }
+
public void testFPSrcOverwrite(int src, boolean b) {
int d = src;
src = 0; | add fp for BAS with nulling | mebigfatguy_fb-contrib | train | java |
6fb1b4777dc25bf25a967315aabcfadd012193f2 | diff --git a/lib/taskHandlers/signup.js b/lib/taskHandlers/signup.js
index <HASH>..<HASH> 100644
--- a/lib/taskHandlers/signup.js
+++ b/lib/taskHandlers/signup.js
@@ -75,10 +75,10 @@ class SignUp extends TaskHandlerBase {
};
return email.send(message);
}).then(() => {
- cb(null, null);
+ cb(null, user._id);
}).catch(err => {
if (err === errActivationNotEnabled) {
- return cb(null, null);
+ return cb(null, user._id);
}
cb(err, null);
}); | returned user._id after registration | getblank_blank-node-worker | train | js |
e2bc43e31dd376eba60df40ee8227ab46da57ee4 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@ def read_description():
setup(
name='Inject',
- version='3.5.3',
+ version='3.5.4.dev0',
url='https://github.com/ivankorobkov/python-inject',
license='Apache License 2.0', | Bumpted to <I>.dev0. | ivankorobkov_python-inject | train | py |
0c6c8456f4ff58eac75419e9e625ce6fcc4dc2da | diff --git a/src/Meta/Blueprint.php b/src/Meta/Blueprint.php
index <HASH>..<HASH> 100644
--- a/src/Meta/Blueprint.php
+++ b/src/Meta/Blueprint.php
@@ -269,5 +269,7 @@ class Blueprint
}
}
}
+
+ return false;
}
} | Added "return false;". Just in case | reliese_laravel | train | php |
c5c1089a5d031c4d5f6d7fc32057ec34dc860f4f | diff --git a/rejester/workers.py b/rejester/workers.py
index <HASH>..<HASH> 100644
--- a/rejester/workers.py
+++ b/rejester/workers.py
@@ -178,6 +178,10 @@ class MultiWorker(Worker):
at :attr:`~rejester.TaskMaster.TERMINATE` from a previous
execution.
+ If `tasks_per_cpu` is set in the configuration block for rejester,
+ then that many child process will be launched for each CPU on the
+ machine.
+
'''
def __init__(self, config):
super(MultiWorker, self).__init__(config)
@@ -277,6 +281,8 @@ class MultiWorker(Worker):
tm = self.task_master
num_workers = multiprocessing.cpu_count()
+ if 'tasks_per_cpu' in self.config:
+ num_workers *= self.config.get(tasks_per_cpu) or 1
if self.pool is None:
self.pool = multiprocessing.Pool(num_workers, maxtasksperchild=1)
## slots is a fixed-length list of [AsyncRsults, WorkUnit] | If `tasks_per_cpu` is set in the configuration block for rejester,
then that many child process will be launched for each CPU on the
machine. | diffeo_rejester | train | py |
9278bb1016905a1c5dc510986bad4fda61bd5239 | diff --git a/src/main/java/com/turn/ttorrent/common/Torrent.java b/src/main/java/com/turn/ttorrent/common/Torrent.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/turn/ttorrent/common/Torrent.java
+++ b/src/main/java/com/turn/ttorrent/common/Torrent.java
@@ -575,7 +575,7 @@ public class Torrent {
Map<String, BEValue> torrent = new HashMap<String, BEValue>();
torrent.put("announce", new BEValue(announce.toString()));
- torrent.put("creation date", new BEValue(new Date().getTime()));
+ torrent.put("creation date", new BEValue(new Date().getTime() / 1000));
torrent.put("created by", new BEValue(createdBy));
Map<String, BEValue> info = new TreeMap<String, BEValue>(); | Fix torrent creation time
Date.getTime() returns milliseconds but the creation date in the torrent
metainfo structure should be a timestamp in seconds since Epoch. This
caused the date of torrents created by the Torrent utility to be
invalid. | mpetazzoni_ttorrent | train | java |
c067f95e4a93f58aa877bca4ffbc6384f2f104a3 | diff --git a/policies.go b/policies.go
index <HASH>..<HASH> 100644
--- a/policies.go
+++ b/policies.go
@@ -8,6 +8,7 @@ package gocql
//exposes the correct functions for the retry policy logic to evaluate correctly.
type RetryableQuery interface {
Attempts() int
+ GetConsistency() Consistency
}
// RetryPolicy interace is used by gocql to determine if a query can be attempted | Added missing expansion of RetryableQuery API. | gocql_gocql | train | go |
d8db43e4c59dc038c444c575b90e9405b1528a8d | diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransfer.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransfer.java
index <HASH>..<HASH> 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransfer.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransfer.java
@@ -206,15 +206,10 @@ public abstract class FileTransfer {
int count = 0;
amountWritten = 0;
- do {
- // write to the output stream
- out.write(b, 0, count);
-
- amountWritten += count;
-
- // read more bytes from the input stream
- count = in.read(b);
- } while (count != -1 && !getStatus().equals(Status.cancelled));
+ while ((count = in.read(b)) > 0 && !getStatus().equals(Status.cancelled)) {
+ out.write(b, 0, count);
+ amountWritten += count;
+ }
// the connection was likely terminated abruptly if these are not equal
if (!getStatus().equals(Status.cancelled) && getError() == Error.none | Improve FileTransfer.writeToStream()
let's use the standard idiom for Input- to OutputStream transfers. This
also avoids an initial no-op on the first write, when the count is '0'.
Also fixes a bug when the size of file/stream transferred is '0' (which
is perfectly fine and possible). | igniterealtime_Smack | train | java |
5137240a53f3cdc5d74353890bf101e2f854a4d8 | diff --git a/src/sap.m/src/sap/m/SplitContainer.js b/src/sap.m/src/sap/m/SplitContainer.js
index <HASH>..<HASH> 100644
--- a/src/sap.m/src/sap/m/SplitContainer.js
+++ b/src/sap.m/src/sap/m/SplitContainer.js
@@ -631,9 +631,15 @@ sap.ui.define(['jquery.sap.global', './library', 'sap/ui/core/Control', 'sap/ui/
return;
}
- var bIsMasterNav = true;
+ var bIsMasterNav = true,
+ $target = jQuery(oEvent.target);
- if (jQuery(oEvent.target).closest(".sapMSplitContainerDetail").length > 0) {
+ // find the closest master or detail DOM element because SplitContainers may be nested
+ while (!$target.hasClass("sapMSplitContainerDetail") && !$target.hasClass("sapMSplitContainerMaster")) {
+ $target = $target.parent();
+ }
+
+ if ($target.hasClass("sapMSplitContainerDetail")) {
bIsMasterNav = false;
} | [FIX] SplitContainer: Issue with nesting SplitContainers
- When SplitContainers are nested the Master View of the inner one does
not hide properly when mode is "HideMode"
BCP: <I>
Change-Id: Iaa<I>c9d<I>a7a<I>e<I>a<I>cfa<I>f<I> | SAP_openui5 | train | js |
152b4fb2fae983aee970493d9e853633af80944c | diff --git a/salt/modules/temp.py b/salt/modules/temp.py
index <HASH>..<HASH> 100644
--- a/salt/modules/temp.py
+++ b/salt/modules/temp.py
@@ -41,4 +41,3 @@ def file(suffix='', prefix='tmp', parent=None):
salt '*' temp.file prefix='mytemp-' parent='/var/run/'
'''
return tempfile.mkstemp(suffix, prefix, parent)[1]
- | nail in pylint newline coffin for temp | saltstack_salt | train | py |
5f4f2e8d60e637e6d30cec06a61cceeb76aff023 | diff --git a/TYPO3.Neos/Resources/Public/JavaScript/aloha.js b/TYPO3.Neos/Resources/Public/JavaScript/aloha.js
index <HASH>..<HASH> 100755
--- a/TYPO3.Neos/Resources/Public/JavaScript/aloha.js
+++ b/TYPO3.Neos/Resources/Public/JavaScript/aloha.js
@@ -225,7 +225,9 @@ function(
'h6': ['style'],
'p': ['class', 'style', 'id'],
'td': ['abbr', 'axis', 'colSpan', 'rowSpan', 'colspan', 'rowspan', 'style'],
- 'th': ['abbr', 'axis', 'colSpan', 'rowSpan', 'colspan', 'rowspan', 'scope']
+ 'th': ['abbr', 'axis', 'colSpan', 'rowSpan', 'colspan', 'rowspan', 'scope'],
+ 'ul': ['class'],
+ 'ol': ['class']
},
protocols: {
'a': {'href': ['ftp', 'http', 'https', 'mailto', '__relative__', 'node', 'asset']}, | BUGFIX: Aloha list style class not sanitized
When using Aloha list styles, the class attribute was
sanitized automatically making the feature unusable.
NEOS-<I> | neos_neos-development-collection | train | js |
abd798fd0c270af645c117bac3f3488021e95f2c | diff --git a/src/browser-client/qmachine.js b/src/browser-client/qmachine.js
index <HASH>..<HASH> 100644
--- a/src/browser-client/qmachine.js
+++ b/src/browser-client/qmachine.js
@@ -2,7 +2,7 @@
//- qmachine.js ~~
// ~~ (c) SRW, 15 Nov 2012
-// ~~ last updated 05 Dec 2012
+// ~~ last updated 06 Dec 2012
(function (global, sandbox) {
'use strict';
@@ -1147,6 +1147,9 @@
f: ((arg_f instanceof AVar) ? arg_f.val : arg_f),
x: ((arg_x instanceof AVar) ? arg_x.val : arg_x)
};
+ if (y.hasOwnProperty('box') === false) {
+ y.box = global.QM.box;
+ }
if ((y.val.env instanceof Object) === false) {
y.val.env = {};
} | Minor edit to ensure a valid `box` property is given in `submit` function | qmachine_qm-nodejs | train | js |
ed12754a6e88b347693c84772a48a900013cef1b | diff --git a/src/main/java/act/app/App.java b/src/main/java/act/app/App.java
index <HASH>..<HASH> 100644
--- a/src/main/java/act/app/App.java
+++ b/src/main/java/act/app/App.java
@@ -199,6 +199,7 @@ public class App {
File conf = RuntimeDirs.conf(this);
logger.debug("loading app configuration: %s ...", appBase.getPath());
config = new AppConfLoader().load(conf);
+ config.app(this);
}
private void initRouter() {
diff --git a/src/main/java/act/conf/AppConfig.java b/src/main/java/act/conf/AppConfig.java
index <HASH>..<HASH> 100644
--- a/src/main/java/act/conf/AppConfig.java
+++ b/src/main/java/act/conf/AppConfig.java
@@ -45,7 +45,7 @@ public class AppConfig<T extends AppConfigurator> extends Config<AppConfigKey> {
this((Map) System.getProperties());
}
- void app(App app) {
+ public void app(App app) {
E.NPE(app);
this.app = app;
} | fix NPE issue on AppConfig | actframework_actframework | train | java,java |
d0cadd65f999870c17c8585cc0f24ff9aeca7fa1 | diff --git a/lib/hydro.js b/lib/hydro.js
index <HASH>..<HASH> 100644
--- a/lib/hydro.js
+++ b/lib/hydro.js
@@ -237,6 +237,8 @@ Hydro.prototype.setup = function() {
this.root.addSuite(suite);
this.stack.unshift(suite);
}
+
+ this._init = true;
};
/**
@@ -275,7 +277,7 @@ Hydro.prototype.exec = function(fn) {
*/
Hydro.prototype.run = function(fn) {
- this.setup();
+ if (!this._init) this.setup();
this.exec(fn);
}; | `run` will setup the environment only if not done yet | vesln_hydro | train | js |
7fcd2a077d8ff98ee1e4a273f9b31eee97975263 | diff --git a/lib/weary/requestable.rb b/lib/weary/requestable.rb
index <HASH>..<HASH> 100644
--- a/lib/weary/requestable.rb
+++ b/lib/weary/requestable.rb
@@ -57,8 +57,8 @@ module Weary
#
# Returns the Requestable object.
def pass_values_onto_requestable(requestable)
- requestable.headers self.headers
- requestable.adapter self.adapter
+ requestable.headers self.headers unless @headers.nil?
+ requestable.adapter self.adapter unless @connection.nil?
if has_middleware?
@middlewares.each {|middleware| requestable.use *middleware }
end | only forward values on if they exist | mwunsch_weary | train | rb |
906e4a187f11bb69e7e7cf3c2e5ee69a7ee8b85b | diff --git a/packages/MSBot/test/msbot.update.test.suite.js b/packages/MSBot/test/msbot.update.test.suite.js
index <HASH>..<HASH> 100644
--- a/packages/MSBot/test/msbot.update.test.suite.js
+++ b/packages/MSBot/test/msbot.update.test.suite.js
@@ -193,11 +193,13 @@ describe("msbot update tests", () => {
command = `node ${msbot} update luis `;
command += `-b save.bot `;
command += `--id ${config.services[0].id} `;
- command += `--subscriptionKey 0000000f-1000-0000-0000-000000000003 `;
+ command += `--subscriptionKey 0000000f-1000-0000-0000-000000000003 `;
+ command += `--version 0.2 `;
p = await exec(command);
config = await bf.BotConfiguration.load("save.bot");
assert.equal(config.services[0].subscriptionKey, "0000000f-1000-0000-0000-000000000003", "subscriptionKey is wrong")
+ assert.equal(config.services[0].version, "0.2", "version is wrong")
});
it("msbot update endpoint", async () => { | Updated tests for msbot update luis to include change to version number | Microsoft_botbuilder-tools | train | js |
e222fb17833ec7e958e2d88cb6f89a78ba53130c | diff --git a/src/scheduler.js b/src/scheduler.js
index <HASH>..<HASH> 100644
--- a/src/scheduler.js
+++ b/src/scheduler.js
@@ -177,7 +177,7 @@ MatrixScheduler.RETRY_BACKOFF_RATELIMIT = function(event, attempts, err) {
* @see module:scheduler~queueAlgorithm
*/
MatrixScheduler.QUEUE_MESSAGES = function(event) {
- if (event.getType() === "m.room.message") {
+ if (event.getType() === "m.room.message" || !!event.getTargetId()) {
// put these events in the 'message' queue.
return "message";
} | enqueue relations and redactions as well
as they might need to wait until their target has been sent | matrix-org_matrix-js-sdk | train | js |
2fca6ddc381fe9fb9393ff3a75e7ff67cb12f800 | diff --git a/src/Handler.js b/src/Handler.js
index <HASH>..<HASH> 100644
--- a/src/Handler.js
+++ b/src/Handler.js
@@ -514,7 +514,7 @@ define(function (require) {
}
function eventNameFix(name) {
- return (name === 'mousewheel' && env.firefox) ? 'DOMMouseScroll' : name;
+ return (name === 'mousewheel' && env.browser.firefox) ? 'DOMMouseScroll' : name;
}
util.mixin(Handler, Eventful); | Fix ecomfe/echarts#<I> (can not roam on firefox) | ecomfe_zrender | train | js |
3943149f27e4e7629a4f4ea7f7898090340f0d7f | diff --git a/tests/test_sdr.py b/tests/test_sdr.py
index <HASH>..<HASH> 100644
--- a/tests/test_sdr.py
+++ b/tests/test_sdr.py
@@ -170,7 +170,7 @@ class TestSdrFullSensorRecord():
0x41, 0x32, 0x3a, 0x56, 0x63, 0x63, 0x20, 0x31,
0x32, 0x56]
sdr = SdrFullSensorRecord(data)
- eq_(sdr.device_id_string, 'A2:Vcc 12V')
+ eq_(sdr.device_id_string, b'A2:Vcc 12V')
class TestSdrCommon():
@@ -236,4 +236,4 @@ class TestSdrManagementControllerDeviceRecord():
0x41, 0x32, 0x3a, 0x41, 0x4d, 0x34, 0x32, 0x32,
0x30, 0x20]
sdr = SdrManagementControllerDeviceLocator(data)
- eq_(sdr.device_id_string, 'A2:AM4220 ')
+ eq_(sdr.device_id_string, b'A2:AM4220 ') | tests: fix in test sdr | kontron_python-ipmi | train | py |
9579fddde357f0857ddc4b688ae2254015154c79 | diff --git a/chef/lib/chef/event_dispatch/base.rb b/chef/lib/chef/event_dispatch/base.rb
index <HASH>..<HASH> 100644
--- a/chef/lib/chef/event_dispatch/base.rb
+++ b/chef/lib/chef/event_dispatch/base.rb
@@ -37,7 +37,7 @@ class Chef
end
# Called at the end of a failed Chef run.
- def run_failed(nod, exception)
+ def run_failed(node, exception)
end
# Called right after ohai runs. | Fixed a typo in base.rb. | chef_chef | train | rb |
beb9685472c317bddfb4a9f73f3dc09f056033d0 | diff --git a/classes/import.php b/classes/import.php
index <HASH>..<HASH> 100644
--- a/classes/import.php
+++ b/classes/import.php
@@ -100,7 +100,12 @@ class Import
$page_uri->page_id = $page->id;
$page_uri->uri = $uri['uri'];
$page_uri->primary_uri = false;
- $page_uri->save();
+
+ try
+ {
+ $page_uri->save();
+ }
+ catch( Sledge_Exception $e ){}
}
// Find the page's feature image. | Added test for existing URIs in secondary URI import | boomcms_boom-core | train | php |
4cd7f43f0c80500d4ea84c331ecc30dd38563145 | diff --git a/estnltk/layer/annotation.py b/estnltk/layer/annotation.py
index <HASH>..<HASH> 100644
--- a/estnltk/layer/annotation.py
+++ b/estnltk/layer/annotation.py
@@ -86,6 +86,14 @@ class Annotation:
raise AttributeError(item)
+ def __getitem__(self, item):
+ value = self._attributes[item]
+ if isinstance(value, str) and value.startswith('lambda a: '):
+ return eval(value)(self)
+ elif isinstance(value, LambdaAttribute):
+ return value(self)
+ return value
+
def __delattr__(self, item):
attributes = self._attributes
if item in attributes: | added Annotation.__getitem__ method | estnltk_estnltk | train | py |
aee0f75c5512974b860043dd390994372961ba0f | diff --git a/ibm_watson/discovery_v1.py b/ibm_watson/discovery_v1.py
index <HASH>..<HASH> 100644
--- a/ibm_watson/discovery_v1.py
+++ b/ibm_watson/discovery_v1.py
@@ -1815,7 +1815,7 @@ class DiscoveryV1(BaseService):
parameter.
:param bool spelling_suggestions: (optional) When `true` and the
**natural_language_query** parameter is used, the **natural_languge_query**
- parameter is spell checked. The most likely correction is retunred in the
+ parameter is spell checked. The most likely correction is returned in the
**suggested_query** field of the response (if one exists).
**Important:** this parameter is only valid when using the Cloud Pak
version of Discovery. | docs: fix simple typo, retunred -> returned
There is a small typo in ibm_watson/discovery_v1.py.
Should read `returned` rather than `retunred`. | watson-developer-cloud_python-sdk | train | py |
74278f2eca8ed1b8e409300a9d6b7f7030b240a8 | diff --git a/cleverhans/tests/test_per_image_standardize.py b/cleverhans/tests/test_per_image_standardize.py
index <HASH>..<HASH> 100644
--- a/cleverhans/tests/test_per_image_standardize.py
+++ b/cleverhans/tests/test_per_image_standardize.py
@@ -11,8 +11,8 @@ def test_per_image_standardize():
input_shape = (128, 32, 32, 3)
- model = MLP(input_shape=input_shape, layers=[
- PerImageStandardize(name='output')])
+ model = MLP(input_shape=input_shape,
+ layers=[PerImageStandardize(name='output')])
x = tf.random_normal(shape=input_shape)
y = model.get_layer(x, 'output') | make pylint happy | tensorflow_cleverhans | train | py |
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.