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
|
|---|---|---|---|---|---|
c6d4a62702a6930f03b21cc7f45ecfc439aea024
|
diff --git a/lib/geocoder/openstreetmapgeocoder.js b/lib/geocoder/openstreetmapgeocoder.js
index <HASH>..<HASH> 100644
--- a/lib/geocoder/openstreetmapgeocoder.js
+++ b/lib/geocoder/openstreetmapgeocoder.js
@@ -53,7 +53,7 @@ OpenStreetMapGeocoder.prototype._formatResult = function(result) {
'latitude' : result.lat,
'longitude' : result.lon,
'country' : result.address.country,
- 'city' : result.address.city,
+ 'city' : result.address.city || result.address.town,
'state': result.address.state,
'zipcode' : result.address.postcode,
'streetName': result.address.road || result.address.cycleway,
|
OpenSteetMap : fix town result
In some cases, in results `city` is `town`...
Fallback it !
|
nchaulet_node-geocoder
|
train
|
js
|
0f2dd7b5d29a2cb14df6acd1137df1d404d5ff18
|
diff --git a/lib/twitter.rb b/lib/twitter.rb
index <HASH>..<HASH> 100644
--- a/lib/twitter.rb
+++ b/lib/twitter.rb
@@ -21,7 +21,7 @@ module Twitter
client.send(method, *args, &block)
end
- def self.respond_to?(method)
- client.respond_to?(method) || super
+ def self.respond_to?(method, include_private = false)
+ client.respond_to?(method, include_private) || super(method, include_private)
end
end
diff --git a/spec/twitter_spec.rb b/spec/twitter_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/twitter_spec.rb
+++ b/spec/twitter_spec.rb
@@ -26,6 +26,12 @@ describe Twitter do
end
+ describe '.respond_to?' do
+ it 'takes an optional include private argument' do
+ Twitter.respond_to?(:client, true).should be_true
+ end
+ end
+
describe ".client" do
it "should be a Twitter::Client" do
Twitter.client.should be_a Twitter::Client
|
Fix respond_to parameter list
`respond_to?` should take two arguments, first the method name and
second whether to include private methods.
<URL>
|
sferik_twitter
|
train
|
rb,rb
|
0e710fedaa6cae5b6cbaac95ffc3be4f7b407bcc
|
diff --git a/ProxyQuery/ElasticaProxyQuery.php b/ProxyQuery/ElasticaProxyQuery.php
index <HASH>..<HASH> 100644
--- a/ProxyQuery/ElasticaProxyQuery.php
+++ b/ProxyQuery/ElasticaProxyQuery.php
@@ -51,7 +51,7 @@ class ElasticaProxyQuery implements ProxyQueryInterface
) {
$this->finder = $finder;
$this->query = new \Elastica\Query();
- $this->boolQuery = new \Elastica\Query\Bool();
+ $this->boolQuery = new \Elastica\Query\BoolQuery();
}
/**
|
use BoolQuery instead of Bool
Bool is incompatible with php 7.
|
sonata-project_SonataAdminSearchBundle
|
train
|
php
|
5fe082dfe0e86e5ea3d1fbd5946b6657631ac286
|
diff --git a/testsuite/domain/src/test/java/org/jboss/as/test/integration/domain/ExpressionSupportSmokeTestCase.java b/testsuite/domain/src/test/java/org/jboss/as/test/integration/domain/ExpressionSupportSmokeTestCase.java
index <HASH>..<HASH> 100644
--- a/testsuite/domain/src/test/java/org/jboss/as/test/integration/domain/ExpressionSupportSmokeTestCase.java
+++ b/testsuite/domain/src/test/java/org/jboss/as/test/integration/domain/ExpressionSupportSmokeTestCase.java
@@ -157,6 +157,8 @@ public class ExpressionSupportSmokeTestCase extends BuildConfigurationTestBase {
public void setUp() throws IOException {
final WildFlyManagedConfiguration config = createConfiguration("domain.xml", "host.xml", getClass().getSimpleName());
config.setAdminOnly(true);
+ config.setReadOnlyDomain(true);
+ config.setReadOnlyHost(true);
// Trigger the servers to fail on boot if there are runtime errors
String hostProps = config.getHostCommandLineProperties();
|
Use read-only configs in ExpressionSupportSmokeTestCase to save thousands of config copies
|
wildfly_wildfly
|
train
|
java
|
f75f4aac9286b695109381fd09a9ca869a95eced
|
diff --git a/lib/duse/cli/api_command.rb b/lib/duse/cli/api_command.rb
index <HASH>..<HASH> 100644
--- a/lib/duse/cli/api_command.rb
+++ b/lib/duse/cli/api_command.rb
@@ -15,6 +15,8 @@ module Duse
rescue JSON::ParserError => e
error 'Parsing error'
end
+ rescue Duse::Client::NotLoggedIn
+ error "not logged in, run `#$0 login`"
rescue Duse::Client::Error => e
error e.message
rescue Interrupt
@@ -24,11 +26,11 @@ module Duse
private
def ensure_uri_is_set
- error 'not configured, please run "duse config"' if config.uri.nil?
+ error "client not configured, run `#$0 config`" if config.uri.nil?
end
def authenticate
- error 'not logged in, please run "duse login"' if config.token.nil?
+ fail Duse::Client::NotLoggedIn if config.token.nil?
Duse.session = Duse::Client::Session.new(
uri: config.uri,
token: config.token
|
better not logged in handling and error messages
|
duse-io_duse.rb
|
train
|
rb
|
b61aa363039b2bfe82c4174e8945cef0475cff53
|
diff --git a/src/EchoIt/JsonApi/Model.php b/src/EchoIt/JsonApi/Model.php
index <HASH>..<HASH> 100644
--- a/src/EchoIt/JsonApi/Model.php
+++ b/src/EchoIt/JsonApi/Model.php
@@ -37,6 +37,14 @@ class Model extends \Eloquent
protected $resourceType = null;
/**
+ * Expose the resource relations links by default when viewing a
+ * resource
+ *
+ * @var array
+ */
+ protected $exposedRelations = [];
+
+ /**
* mark this model as changed
*
* @return void
@@ -76,6 +84,12 @@ class Model extends \Eloquent
public function toArray()
{
$relations = [];
+
+ // include any relations exposed by default
+ foreach ($this->exposedRelations as $relation) {
+ $this->load($relation);
+ }
+
foreach ($this->getArrayableRelations() as $relation => $value) {
if (in_array($relation, $this->hidden)) {
continue;
|
Ability to automatically expose relations for a resource
As per specification a resource may choose to expose relations within a
links node (this happens currently when including a relation)
This PR adds an attribute to the model which enables a resource to
identify relations it wishes to expose via the links permanently (when
no include is specified).
This identifies the resource within the links node but DOES NOT include
the relation.
<URL>
|
egeriis_laravel-jsonapi
|
train
|
php
|
b1f9fdd280a74eb1e3e18af1d84e97b14124e3e2
|
diff --git a/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragment.java b/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragment.java
index <HASH>..<HASH> 100644
--- a/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragment.java
+++ b/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragment.java
@@ -126,6 +126,10 @@ public class ScreenStackFragment extends ScreenFragment {
AppBarLayout.LayoutParams.MATCH_PARENT, AppBarLayout.LayoutParams.WRAP_CONTENT));
view.addView(mAppBarLayout);
+ if (mShadowHidden) {
+ mAppBarLayout.setTargetElevation(0);
+ }
+
if (mToolbar != null) {
mAppBarLayout.addView(recycleView(mToolbar));
}
|
fix: disable shadow if needed (#<I>)
mAppBarLayout is created on every screen change so we need to check if the shadow shouldn't be disabled. This method is needed here since the if clause in setToolbarShadowHidden will return false e.g. when going back to the previous screen.
|
kmagiera_react-native-screens
|
train
|
java
|
adf875b4ce8c3d6ea84d8471086e8eff91429b94
|
diff --git a/python/ray/_private/worker.py b/python/ray/_private/worker.py
index <HASH>..<HASH> 100644
--- a/python/ray/_private/worker.py
+++ b/python/ray/_private/worker.py
@@ -597,11 +597,9 @@ class Worker:
# Make sure that the value is not an object ref.
if isinstance(value, ObjectRef):
raise TypeError(
- "Calling 'put' on an ray.ObjectRef is not allowed "
- "(similarly, returning an ray.ObjectRef from a remote "
- "function is not allowed). If you really want to "
- "do this, you can wrap the ray.ObjectRef in a list and "
- "call 'put' on it (or return it)."
+ "Calling 'put' on an ray.ObjectRef is not allowed. "
+ "If you really want to do this, you can wrap the "
+ "ray.ObjectRef in a list and call 'put' on it."
)
if self.mode == LOCAL_MODE:
|
[Cleanup] Update Put error message (#<I>)
We allow tasks to return ObjectRefs. I'm not sure when this support was added, but I think for quite a while.
|
ray-project_ray
|
train
|
py
|
a9b893dee23f394489f833f4aecc0ff92c1a0726
|
diff --git a/dispatch/modules/content/models.py b/dispatch/modules/content/models.py
index <HASH>..<HASH> 100644
--- a/dispatch/modules/content/models.py
+++ b/dispatch/modules/content/models.py
@@ -439,6 +439,11 @@ class Column(Model, AuthorMixin):
def get_published_articles(self):
return Article.objects.filter(column=self, is_published=True)
+ def get_absolute_url(self):
+ """
+ Returns the column URL.
+ """
+ return "%s%s/" % (settings.BASE_URL, self.slug)
class Page(Publishable):
parent = ForeignKey('Page', related_name='page_parent', blank=True, null=True)
|
added get absolute url to column model
|
ubyssey_dispatch
|
train
|
py
|
c73d0ba3c073dd355dd7d1c224f666358e08cd9e
|
diff --git a/src/main/java/jcifs/smb/SmbFile.java b/src/main/java/jcifs/smb/SmbFile.java
index <HASH>..<HASH> 100644
--- a/src/main/java/jcifs/smb/SmbFile.java
+++ b/src/main/java/jcifs/smb/SmbFile.java
@@ -1440,20 +1440,6 @@ public class SmbFile extends URLConnection implements SmbResource, SmbConstants
close();
}
-
- /**
- * {@inheritDoc}
- *
- * @see java.lang.Object#finalize()
- */
- @Override
- protected void finalize () throws Throwable {
- if ( this.treeHandle != null ) {
- log.debug("File was not properly released " + this);
- }
- }
-
-
void delete ( String fileName ) throws CIFSException {
if ( this.fileLocator.isRootOrShare() ) {
throw new SmbException("Invalid operation for workgroups, servers, or shares");
|
Remove SmbFile finalizer (#<I>)
Likely to cause GC performance issues, not very useful.
|
AgNO3_jcifs-ng
|
train
|
java
|
706a845b06bab872e1b58334c91415ed6692cdcb
|
diff --git a/src/AdminServiceProvider.php b/src/AdminServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/AdminServiceProvider.php
+++ b/src/AdminServiceProvider.php
@@ -67,7 +67,7 @@ class AdminServiceProvider extends ServiceProvider
if ($this->app->runningInConsole()) {
$this->publishes([__DIR__.'/../config' => config_path()], 'laravel-admin-config');
$this->publishes([__DIR__.'/../resources/lang' => resource_path('lang')], 'laravel-admin-lang');
-// $this->publishes([__DIR__.'/../resources/views' => resource_path('views/admin')], 'laravel-admin-views');
+// $this->publishes([__DIR__.'/../resources/views' => resource_path('views/vendor/admin')], 'laravel-admin-views');
$this->publishes([__DIR__.'/../database/migrations' => database_path('migrations')], 'laravel-admin-migrations');
$this->publishes([__DIR__.'/../resources/assets' => public_path('vendor/laravel-admin')], 'laravel-admin-assets');
}
|
Update AdminServiceProvider.php
fix view publish path
|
z-song_laravel-admin
|
train
|
php
|
7fdc6f1fc252a320da1052b035d30da5ed4078dd
|
diff --git a/lib/dataflow/nodes/join_node.rb b/lib/dataflow/nodes/join_node.rb
index <HASH>..<HASH> 100644
--- a/lib/dataflow/nodes/join_node.rb
+++ b/lib/dataflow/nodes/join_node.rb
@@ -35,9 +35,9 @@ module Dataflow
# merge both dependencies schemas
sch1 = dependencies.first.schema || {}
- sch1 = sch1.select { |k,v| select_keys1.include?(k) } if select_keys1.present?
+ sch1 = sch1.select { |k,v| select_keys1.include?(k.to_s) } if select_keys1.present?
sch2 = dependencies.second.schema || {}
- sch2 = sch2.select { |k,v| select_keys2.include?(k) } if select_keys2.present?
+ sch2 = sch2.select { |k,v| select_keys2.include?(k.to_s) } if select_keys2.present?
sch = sch1.merge(sch2)
sch
|
Support symbols in schema keys when merging schemas in the join node
|
Phybbit_dataflow-rb
|
train
|
rb
|
313bb75724a25fec908c29805b990341cd765681
|
diff --git a/src/p4p/nt/scalar.py b/src/p4p/nt/scalar.py
index <HASH>..<HASH> 100644
--- a/src/p4p/nt/scalar.py
+++ b/src/p4p/nt/scalar.py
@@ -67,7 +67,7 @@ class ntbool(ntwrappercommon, int):
return int.__new__(cls, bool(value))
def __repr__(self):
- return bool(self).__repr__()
+ return bool(self).__repr__().lower()
class ntstr(ntwrappercommon, unicode):
|
lower() bool
Avoid ambiguity with True/False singletons
|
mdavidsaver_p4p
|
train
|
py
|
8a6dc3d694942d891cfb6d8dd1b7f92e9cd177bd
|
diff --git a/grimoire/elk/git.py b/grimoire/elk/git.py
index <HASH>..<HASH> 100644
--- a/grimoire/elk/git.py
+++ b/grimoire/elk/git.py
@@ -140,7 +140,7 @@ class GitEnrich(Enrich):
def get_rich_commit(self, commit):
eitem = {}
# Fields that are the same in item and eitem
- copy_fields = ["message","Author","metadata__updated_on","ocean-unique-id"]
+ copy_fields = ["message","Author","metadata__updated_on","ocean-unique-id","metadata__origin"]
for f in copy_fields:
if f in commit:
eitem[f] = commit[f]
|
[Enrich Git] Add metadata__origin to enriched items for update filtering.
|
chaoss_grimoirelab-elk
|
train
|
py
|
adf6349c8e6deb70fd6a47c24eb525c8dd9030ef
|
diff --git a/src/Application.php b/src/Application.php
index <HASH>..<HASH> 100644
--- a/src/Application.php
+++ b/src/Application.php
@@ -282,6 +282,10 @@ class Application extends Container
return $this->loadComponent('auth', 'Illuminate\Auth\AuthServiceProvider', 'auth.driver');
});
+ $this->singleton('Illuminate\Auth\AuthManager', function () {
+ return $this->loadComponent('auth', 'Illuminate\Auth\AuthServiceProvider', 'auth');
+ });
+
$this->singleton('Illuminate\Contracts\Auth\Access\Gate', function () {
return $this->loadComponent('auth', 'Illuminate\Auth\AuthServiceProvider', 'Illuminate\Contracts\Auth\Access\Gate');
});
|
Fix AuthManager resolving
|
laravel_lumen-framework
|
train
|
php
|
efcfedaf2714ce0d71aac96049a761bab7dbc693
|
diff --git a/lib/request.js b/lib/request.js
index <HASH>..<HASH> 100644
--- a/lib/request.js
+++ b/lib/request.js
@@ -23,7 +23,9 @@ module.exports = {
}
const rejectErrors = async res => {
- const body = await res.json()
+ let body = await res.text()
+ // When Wikibase crash it doesn't return JSON errors anymore
+ if (body[0] === '{') body = JSON.parse(body)
let { status: statusCode } = res
if (statusCode >= 400) {
throw newError(statusCode, body)
@@ -37,7 +39,11 @@ const rejectErrors = async res => {
}
const newError = (statusCode, body, statusMessage) => {
- statusMessage = statusMessage || body.message || statusCode
+ if (typeof body === 'string') {
+ statusMessage = body
+ } else {
+ statusMessage = statusMessage || body.message || statusCode
+ }
const err = new Error(statusMessage)
err.statusMessage = statusMessage
err.status = err.statusCode = statusCode
|
request: handle case where the body isn't json
|
maxlath_wikidata-cli
|
train
|
js
|
c3a9a70bf5d05333ac03a275eab012ab1a3ee472
|
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
index <HASH>..<HASH> 100644
--- a/alot/commands/envelope.py
+++ b/alot/commands/envelope.py
@@ -196,7 +196,10 @@ class EditCommand(Command):
# remove to be edited lines from envelope
del self.envelope[key]
+
for value in vlist:
+ # remove newlines in values
+ value = value.replace('\n', ' ')
headertext += '%s: %s\n' % (key, value)
bodytext = self.envelope.body
|
don't write newlines to templates
issue #<I>
|
pazz_alot
|
train
|
py
|
97ec746f33c6a459aa4e5b1ff832da71bbfe85fe
|
diff --git a/regdeferred.rb b/regdeferred.rb
index <HASH>..<HASH> 100755
--- a/regdeferred.rb
+++ b/regdeferred.rb
@@ -89,7 +89,7 @@ module Reg
include BlankSlate
restore :inspect,:extend
restore :respond_to?
- restore :respond_to?
+# restore :respond_to?
include Formula
attr_reader :operation, :args, :target, :block
|
no need to restore :respond_to? twice, is there?
|
coatl_reg
|
train
|
rb
|
0bc80cec359524d1da8df38859751c3f3bfa0384
|
diff --git a/lib/devise.rb b/lib/devise.rb
index <HASH>..<HASH> 100644
--- a/lib/devise.rb
+++ b/lib/devise.rb
@@ -18,7 +18,6 @@ module Devise
module Encryptors
autoload :Base, 'devise/encryptors/base'
- autoload :Bcrypt, 'devise/encryptors/bcrypt'
autoload :AuthlogicSha512, 'devise/encryptors/authlogic_sha512'
autoload :ClearanceSha1, 'devise/encryptors/clearance_sha1'
autoload :RestfulAuthenticationSha1, 'devise/encryptors/restful_authentication_sha1'
|
Remove autoload for Bcrypt encryptor, it does not exist anymore
|
plataformatec_devise
|
train
|
rb
|
0f32918c05041496b3ae95c16892eb61394759c7
|
diff --git a/vendor/broccoli-fontawesome-pack.js b/vendor/broccoli-fontawesome-pack.js
index <HASH>..<HASH> 100644
--- a/vendor/broccoli-fontawesome-pack.js
+++ b/vendor/broccoli-fontawesome-pack.js
@@ -3,7 +3,7 @@
var Plugin = require('broccoli-plugin')
var path = require('path')
var fs = require('fs')
-var { camelCase } = require('camel-case')
+var { camelCase, camelCaseTransformMerge } = require('camel-case')
var { config } = require('@fortawesome/fontawesome-svg-core');
class FontAwesomePack extends Plugin {
@@ -54,7 +54,7 @@ class FontAwesomePack extends Plugin {
iconName = `${prefix}-${iconName}`;
}
- return camelCase(iconName);
+ return camelCase(iconName, { transform: camelCaseTransformMerge });
});
}
|
remove prefixing behaviour before numbers.
|
FortAwesome_ember-fontawesome
|
train
|
js
|
36e03d3d477e81451eef5fb629df3f79151d85ca
|
diff --git a/src/Intahwebz/ViewModel.php b/src/Intahwebz/ViewModel.php
index <HASH>..<HASH> 100644
--- a/src/Intahwebz/ViewModel.php
+++ b/src/Intahwebz/ViewModel.php
@@ -20,7 +20,7 @@ interface ViewModel {
function setTemplate($templateFile);
-
+ function getTemplate();
/**
* @param $message
diff --git a/src/Intahwebz/ViewModel/BasicViewModel.php b/src/Intahwebz/ViewModel/BasicViewModel.php
index <HASH>..<HASH> 100644
--- a/src/Intahwebz/ViewModel/BasicViewModel.php
+++ b/src/Intahwebz/ViewModel/BasicViewModel.php
@@ -12,6 +12,8 @@ class BasicViewModel implements ViewModel {
*/
private $boundFunctions = array();
+ protected $template;
+
/**
* @var array Stores the variables available in the ViewModel
*/
@@ -78,11 +80,16 @@ class BasicViewModel implements ViewModel {
throw new ViewModelException("No method [$functionName]");
}
- //Todo - this should not be in here
+
function setTemplate($templateFile) {
- // TODO: Implement setTemplate() method.
+ $this->template = $templateFile;
}
+ function getTemplate() {
+ return $this->template;
+ }
+
+
/**
* @param $message
* @return mixed
|
Added template to ViewModel because YOLO.
|
Danack_intahwebz-core
|
train
|
php,php
|
9e7d76faa69ab5b60fdab21d0ee542f781b5b5ec
|
diff --git a/packages/teraslice/lib/cluster/services/api.js b/packages/teraslice/lib/cluster/services/api.js
index <HASH>..<HASH> 100644
--- a/packages/teraslice/lib/cluster/services/api.js
+++ b/packages/teraslice/lib/cluster/services/api.js
@@ -114,6 +114,8 @@ module.exports = function apiService(context, { assetsUrl, app }) {
if (req.query.active === 'true') {
query = 'job_id:* AND !active:false';
+ } else if (req.query.active === 'false') {
+ query = 'job_id:* AND active:false';
} else {
query = 'job_id:*';
}
@@ -367,6 +369,8 @@ module.exports = function apiService(context, { assetsUrl, app }) {
if (req.query.active === 'true') {
query = 'job_id:* AND !active:false';
+ } else if (req.query.active === 'false') {
+ query = 'job_id:* AND active:false';
} else {
query = 'job_id:*';
}
|
handle active:false on txt and json job endpoints
|
terascope_teraslice
|
train
|
js
|
7fe9988f1efb9b3c49346c301e29da7d18cd36eb
|
diff --git a/raus_test.go b/raus_test.go
index <HASH>..<HASH> 100644
--- a/raus_test.go
+++ b/raus_test.go
@@ -51,20 +51,24 @@ var parseTestSet = []parseTest{
},
}
+func testWithLocalRedis(run func() int) int {
+ conf := redistest.Config{"port": "26379", "save": ""}
+ s, err := redistest.NewServer(true, conf)
+ if err != nil {
+ panic(err)
+ }
+ defer s.Stop()
+ return run()
+}
+
func TestMain(m *testing.M) {
- var s *redistest.Server
+ var code int
if path, err := exec.LookPath("redis-server"); err == nil {
log.Printf("testing with local %s", path)
- conf := make(redistest.Config)
- conf["port"] = "26379"
- conf["save"] = ""
- s, err = redistest.NewServer(true, conf)
- if err != nil {
- panic(err)
- }
+ code = testWithLocalRedis(m.Run)
+ } else {
+ code = m.Run()
}
- code := m.Run()
- s.Stop()
os.Exit(code)
}
|
refactor test with local/remote redis.
|
fujiwara_raus
|
train
|
go
|
e96a22b06838739a466bde5ca25cf995d51cb906
|
diff --git a/squad/ci/backend/lava.py b/squad/ci/backend/lava.py
index <HASH>..<HASH> 100644
--- a/squad/ci/backend/lava.py
+++ b/squad/ci/backend/lava.py
@@ -226,7 +226,7 @@ class Backend(BaseBackend):
else:
for result in data['results']:
if result['suite'] != 'lava':
- suite = result['suite'].split("_", 1)[1]
+ suite = result['suite'].split("_", 1)[-1]
res_name = "%s/%s" % (suite, result['name'])
# YAML from LAVA has all values serialized to strings
if result['measurement'] == 'None':
|
ci/lava: fix parsing of test suite names
This fixes the case where result['suite'] does not contain any _
characters, so result['suite'].split('_', 1) has a single element. For
the case where there is at least one underscore,
result['suite'].split('_', 1) will always have just 2 elements. In both
cases, indexing with -1 will return the last element.
|
Linaro_squad
|
train
|
py
|
ea1b92e75a5ba017d378202b5759e3d055557abd
|
diff --git a/Tone/core/Transport.js b/Tone/core/Transport.js
index <HASH>..<HASH> 100644
--- a/Tone/core/Transport.js
+++ b/Tone/core/Transport.js
@@ -606,15 +606,17 @@ function(Tone){
return this._clock.ticks;
},
set : function(t){
- var now = this.now();
- //stop everything synced to the transport
- if (this.state === Tone.State.Started){
- this.emit("stop", now);
- this._clock.ticks = t;
- //restart it with the new time
- this.emit("start", now, this.seconds);
- } else {
- this._clock.ticks = t;
+ if (this._clock.ticks !== t){
+ var now = this.now();
+ //stop everything synced to the transport
+ if (this.state === Tone.State.Started){
+ this.emit("stop", now);
+ this._clock.ticks = t;
+ //restart it with the new time
+ this.emit("start", now, this.seconds);
+ } else {
+ this._clock.ticks = t;
+ }
}
}
});
|
only set the clock ticks when the value has changed
optimization
|
Tonejs_Tone.js
|
train
|
js
|
caa21e42b831ef8fc6d6600ddc6ec37a1bb6ac1a
|
diff --git a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
@@ -80,6 +80,7 @@ module ActiveRecord
disconnect!
connect
end
+ alias :reset! :reconnect!
# Disconnects from the database if already connected.
# Otherwise, this method does nothing.
@@ -90,11 +91,6 @@ module ActiveRecord
end
end
- def reset!
- disconnect!
- connect
- end
-
# DATABASE STATEMENTS ======================================
def explain(arel, binds = [])
|
Alias reconnect! to reset! for Mysql2 adapter since they have same
behavior.
|
rails_rails
|
train
|
rb
|
e4cdb197377a40f29db47d6fe8d6a64ace709287
|
diff --git a/src/extensions/default/StaticServer/main.js b/src/extensions/default/StaticServer/main.js
index <HASH>..<HASH> 100644
--- a/src/extensions/default/StaticServer/main.js
+++ b/src/extensions/default/StaticServer/main.js
@@ -62,9 +62,13 @@ define(function (require, exports, module) {
* request -- Passes {location: {hostname: string, port: number, root: string, pathname: string}, send: function({body: string}) }
* Listeners define paths to intercept requests for by supplying those
* paths to setRequestFilterPaths([path1,...,pathN]).
+ *
* When requests for those paths are received on the server, StaticServerProvider
* creates a "request" event with a send() callback that allows the listener to
* override the default static file server response.
+ *
+ * Listeners to this event should be installed before any HTTP
+ * requests are sent to the server.
*/
function StaticServerProvider() {}
|
update comment to clarify when request listeners should be installed
|
adobe_brackets
|
train
|
js
|
135adbf443368eaa37dde3b1f7e28c066dc57280
|
diff --git a/modules/es/models/es.SurfaceModel.js b/modules/es/models/es.SurfaceModel.js
index <HASH>..<HASH> 100644
--- a/modules/es/models/es.SurfaceModel.js
+++ b/modules/es/models/es.SurfaceModel.js
@@ -28,6 +28,9 @@ es.SurfaceModel = function( doc ) {
es.SurfaceModel.prototype.purgeHistory = function() {
this.selection = null;
+ this.smallStack = [];
+ this.bigStack = [];
+ this.undoIndex = 0;
};
/**
@@ -87,7 +90,7 @@ es.SurfaceModel.prototype.select = function( selection, isManual ) {
* (such as when replacing - delete, then insert)
*/
es.SurfaceModel.prototype.transact = function( transaction ) {
- this.bigStack = this.bigStack.slice( 0, this.bigStack.length - this.undoIndex + 1 );
+ this.bigStack = this.bigStack.slice( 0, this.bigStack.length - this.undoIndex );
this.undoIndex = 0;
this.smallStack.push( transaction );
this.doc.commit( transaction );
|
Make purgeHistory method work in SurfaceModel with new data structure
|
wikimedia_parsoid
|
train
|
js
|
65fce01d49fa2c9deed372a00f461e0910c76b8a
|
diff --git a/Database/ObjectCollection.php b/Database/ObjectCollection.php
index <HASH>..<HASH> 100644
--- a/Database/ObjectCollection.php
+++ b/Database/ObjectCollection.php
@@ -265,11 +265,11 @@ abstract class ObjectCollection extends DynamicCollection implements IDynamicCol
*/
protected function rebuildQueryForCustomLoad($query)
{
- if ($this->where !== null) {
- if ($this->getFieldsAndTypes() === false) {
- return false;
- }
+ if ($this->getFieldsAndTypes() === false) {
+ return false;
+ }
+ if ($this->where !== null) {
$where = $this->where;
if (count($where) !== 1) {
return false;
|
fix not loaded Model properties through many-to-many
|
PHPColibri_framework
|
train
|
php
|
9fc9dc4359b3123adbc2ee7e2fccfa085242edcb
|
diff --git a/Services/Yadis/XRDS.php b/Services/Yadis/XRDS.php
index <HASH>..<HASH> 100644
--- a/Services/Yadis/XRDS.php
+++ b/Services/Yadis/XRDS.php
@@ -30,6 +30,10 @@ define('SERVICES_YADIS_MATCH_ALL', 101);
*/
define('SERVICES_YADIS_MATCH_ANY', 102);
+/**
+ * The priority value used for service elements with no priority
+ * specified.
+ */
define('SERVICES_YADIS_MAX_PRIORITY', pow(2, 30));
function Services_Yadis_getNSMap()
|
[project @ Max priority docstring]
|
openid_php-openid
|
train
|
php
|
2144fe465b58d788b889cf650feaf27df07c786b
|
diff --git a/rxjava-core/src/test/java/rx/schedulers/ExecutorSchedulerTest.java b/rxjava-core/src/test/java/rx/schedulers/ExecutorSchedulerTest.java
index <HASH>..<HASH> 100644
--- a/rxjava-core/src/test/java/rx/schedulers/ExecutorSchedulerTest.java
+++ b/rxjava-core/src/test/java/rx/schedulers/ExecutorSchedulerTest.java
@@ -18,13 +18,16 @@ package rx.schedulers;
import rx.Scheduler;
import rx.internal.util.RxThreadFactory;
+import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
public class ExecutorSchedulerTest extends AbstractSchedulerConcurrencyTests {
+ final static Executor executor = Executors.newFixedThreadPool(2, new RxThreadFactory("TestCustomPool-"));
+
@Override
protected Scheduler getScheduler() {
- return Schedulers.from(Executors.newFixedThreadPool(2, new RxThreadFactory("TestCustomPool-")));
+ return Schedulers.from(executor);
}
}
|
Use single Executor for all tests
... so it doesn't leak for every test.
|
ReactiveX_RxJava
|
train
|
java
|
399a6c655ae9c2d852a628a51650d07b5d12a893
|
diff --git a/openquake/db/models.py b/openquake/db/models.py
index <HASH>..<HASH> 100644
--- a/openquake/db/models.py
+++ b/openquake/db/models.py
@@ -325,6 +325,24 @@ class ComplexFault(models.Model):
db_table = 'hzrdi\".\"complex_fault'
+
+class FaultEdge(models.Model):
+ '''
+ Fault edge
+ '''
+ id = models.IntegerField(primary_key=True)
+ owner = models.ForeignKey('OqUser')
+ gid = models.TextField()
+ name = models.TextField(null=True)
+ description = models.TextField(null=True)
+ last_update = models.DateTimeField(editable=False, default=datetime.utcnow)
+ top = models.LineStringField(srid=4326)
+ bottom = models.LineStringField(srid=4326)
+
+ class Meta:
+ db_table = 'hzrdi\".\"fault_edge'
+
+
class RDepthDistr(models.Model):
'''
Rupture Depth Distribution
|
added missing model
Former-commit-id: aadb9d3dfb6b<I>dd6e9b<I>b9ff<I>fdb<I>d
|
gem_oq-engine
|
train
|
py
|
24f32a710f9f5908dfe7dd1d45be3043580c4c29
|
diff --git a/Tests/Resource/FileReplicatorTest.php b/Tests/Resource/FileReplicatorTest.php
index <HASH>..<HASH> 100644
--- a/Tests/Resource/FileReplicatorTest.php
+++ b/Tests/Resource/FileReplicatorTest.php
@@ -25,8 +25,8 @@ class FileReplicatorTest extends \PHPUnit_Framework_TestCase
{
$directory = $this->generateDirectory();
$replicator = new FileReplicator('http://example.com/', $directory);
- $replicator->replicate(new GenericResource('test'));
- $file = $directory.'/test';
+ $replicator->replicate(new GenericResource('test/nested'));
+ $file = $directory.'/test/nested';
$this->assertTrue(file_exists($file));
$this->assertGreaterThan(0, filesize($file));
}
@@ -51,7 +51,7 @@ class FileReplicatorTest extends \PHPUnit_Framework_TestCase
*/
public function testReplicateBadDirectory()
{
- $replicator = new FileReplicator('http://example.com/', '/probably/a/bad/directory');
+ $replicator = new FileReplicator('http://example.com/', '/@%%:;5#_+');
$replicator->replicate(new GenericResource('test'));
}
|
Test for nested directory and invalid directory names (to avoid permissive file system for testing).
|
orbt_ResourceMirror
|
train
|
php
|
15f4a96beb00b2b6c1f77cb3d5bcd04c9aca9c7b
|
diff --git a/Entity/MediaManager.php b/Entity/MediaManager.php
index <HASH>..<HASH> 100644
--- a/Entity/MediaManager.php
+++ b/Entity/MediaManager.php
@@ -37,7 +37,7 @@ class MediaManager extends BaseEntityManager implements MediaManagerInterface
$media->setProviderName(func_get_arg(2));
}
- if ($andFlush && is_bool($andFlush)) {
+ if (is_bool($andFlush)) {
parent::save($media, $andFlush);
} else {
// BC compatibility with previous signature
|
Flush whatever of the $andFlush value
Take $andFlush into account when it is boolean
If $andFlush is false, save() will be called with true, so $andFlush
will not
be taken into account at all.
|
sonata-project_SonataMediaBundle
|
train
|
php
|
47b2462086b8104d854642329d9253bd69bb31df
|
diff --git a/src/nami.js b/src/nami.js
index <HASH>..<HASH> 100644
--- a/src/nami.js
+++ b/src/nami.js
@@ -186,6 +186,8 @@ Nami.prototype.onWelcomeMessage = function (data) {
* @returns void
*/
Nami.prototype.close = function () {
+ var self = this;
+ this.send(new action.Logoff(), function () { self.logger.info('Logged out'); });
this.logger.info('Closing connection');
this.removeAllListeners();
this.socket.removeAllListeners();
|
now sends logoff action when closing connection
|
marcelog_Nami
|
train
|
js
|
6e72d2c3926d37e61cf86f902659b28572d55400
|
diff --git a/server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/command/OServerCommandAbstract.java b/server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/command/OServerCommandAbstract.java
index <HASH>..<HASH> 100644
--- a/server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/command/OServerCommandAbstract.java
+++ b/server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/command/OServerCommandAbstract.java
@@ -87,9 +87,6 @@ public abstract class OServerCommandAbstract implements OServerCommand {
writeLine(iRequest, null);
- if (!empty)
- writeContent(iRequest, content);
-
if (binaryContent != null)
iRequest.channel.outStream.write(binaryContent);
iRequest.channel.flush();
|
Fix by Luca Molino to close issue <I>
|
orientechnologies_orientdb
|
train
|
java
|
25b06fcc4fd301573755813edfebd1750a9bbc55
|
diff --git a/pdb.py b/pdb.py
index <HASH>..<HASH> 100644
--- a/pdb.py
+++ b/pdb.py
@@ -453,6 +453,12 @@ Frames can marked as hidden in the following ways:
do_l = do_list
+ def do_continue(self, arg):
+ if arg != '':
+ self.do_tbreak(arg)
+ return pdb.Pdb.do_continue(self, '')
+ do_c = do_cont = do_continue
+
def do_pp(self, arg):
width, height = self.get_terminal_size()
try:
diff --git a/testing/test_pdb.py b/testing/test_pdb.py
index <HASH>..<HASH> 100644
--- a/testing/test_pdb.py
+++ b/testing/test_pdb.py
@@ -999,3 +999,24 @@ def test_unicode_bug():
# c
""")
+
+def test_continue_arg():
+ def fn():
+ set_trace()
+ x = 1
+ y = 2
+ z = 3
+ return x+y+z
+ _, lineno = inspect.getsourcelines(fn)
+ line_z = lineno+4
+
+ check(fn, """
+> .*fn()
+-> x = 1
+# c %d
+Breakpoint 1 at .*/test_pdb.py:%d
+Deleted breakpoint 1
+> .*fn()
+-> z = 3
+# c
+""" % (line_z, line_z))
|
a new feature: now you can type 'continue n' to continue the execution until line n'
|
antocuni_pdb
|
train
|
py,py
|
46ff7ad321cf3f011d137896df7fc2ec60e5a7c1
|
diff --git a/AdminModule/presenters/CloningPresenter.php b/AdminModule/presenters/CloningPresenter.php
index <HASH>..<HASH> 100755
--- a/AdminModule/presenters/CloningPresenter.php
+++ b/AdminModule/presenters/CloningPresenter.php
@@ -92,7 +92,7 @@ class CloningPresenter extends BasePresenter
}
foreach ($pages as $page) {
- $this->pageCreateBoxes($page);
+ $this->pageCreateBoxes($page, $transformTable);
}
// clone all data
@@ -147,14 +147,14 @@ class CloningPresenter extends BasePresenter
*
* @return [type] [description]
*/
- private function pageCreateBoxes($page)
+ private function pageCreateBoxes($page, $transformTable)
{
$boxes = $this->em->getRepository('WebCMS\Entity\Box')->findBy(array(
'pageTo' => $page,
));
foreach ($boxes as $box) {
- $newBox = $this->createNewBox($box);
+ $newBox = $this->createNewBox($box, $transformTable);
$this->em->persist($newBox);
}
}
@@ -222,7 +222,7 @@ class CloningPresenter extends BasePresenter
* @param [type] $box [description]
* @return [type] [description]
*/
- private function createNewBox($box)
+ private function createNewBox($box, $transformTable)
{
$newBox = new \WebCMS\Entity\Box();
$newBox->setBox($box->getBox());
|
Bugfix - cloning of boxes
|
voslartomas_WebCMS2
|
train
|
php
|
3e3ec23aec50209d29b080eff852905ea3596158
|
diff --git a/hug/interface.py b/hug/interface.py
index <HASH>..<HASH> 100644
--- a/hug/interface.py
+++ b/hug/interface.py
@@ -178,6 +178,8 @@ class Interface(object):
usage = self.interface.spec.__doc__
if usage:
doc['usage'] = usage
+ if getattr(self, 'requires', None):
+ doc['requires'] = [getattr(requirement, '__doc__', requirement.__name__) for requirement in self.requires]
doc['outputs'] = OrderedDict()
doc['outputs']['format'] = self.outputs.__doc__
doc['outputs']['content_type'] = self.outputs.content_type
|
Add support for showing requriments in documentation
|
hugapi_hug
|
train
|
py
|
990ea0b8364a49cff43cd12b985cdd3a0f058c12
|
diff --git a/setup_utils.py b/setup_utils.py
index <HASH>..<HASH> 100755
--- a/setup_utils.py
+++ b/setup_utils.py
@@ -121,6 +121,7 @@ class changelog(Command):
for line in lines:
print(line, file=f)
+
CMDCLASS['changelog'] = changelog
SETUP_REQUIRES.append(('changelog', ['GitPython']))
@@ -155,6 +156,7 @@ class bdist_spec(bdist_rpm):
# execute distutils version of bdist_rpm.run to avoid calling egg_info
distutils_bdist_rpm.run(self)
+
CMDCLASS['bdist_spec'] = bdist_spec
orig_egg_info = CMDCLASS.pop('egg_info', _egg_info)
@@ -177,6 +179,7 @@ class egg_info(orig_egg_info):
orig_egg_info.run(self)
+
CMDCLASS['egg_info'] = egg_info
@@ -210,6 +213,7 @@ class clean(CMDCLASS.pop('clean', _clean)):
os.unlink(portfile)
clean.run(self)
+
CMDCLASS['clean'] = clean
@@ -272,6 +276,7 @@ class port(Command):
out = subprocess.check_output(['openssl', 'rmd160', filename])
return out.splitlines()[0].rsplit(' ', 1)[-1]
+
CMDCLASS['port'] = port
SETUP_REQUIRES.append(('port', ['jinja2']))
|
setup_utils.py: fixed pep8 issues [ci skip]
|
gwpy_gwpy
|
train
|
py
|
64efcd3e0e552088d808a2b0564ec16bc032272a
|
diff --git a/src/main/java/org/eluder/jersey/mustache/MustacheViewProcessor.java b/src/main/java/org/eluder/jersey/mustache/MustacheViewProcessor.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/eluder/jersey/mustache/MustacheViewProcessor.java
+++ b/src/main/java/org/eluder/jersey/mustache/MustacheViewProcessor.java
@@ -122,7 +122,7 @@ public class MustacheViewProcessor implements ViewProcessor<Mustache> {
// render the actual template
OutputStreamWriter writer = new OutputStreamWriter(out);
- t.execute(writer, getScope(viewable)).flush();
+ t.execute(writer, getScope(viewable)).close();
}
/**
|
Writer must be closed to correctly flush asynchronous data to response. Closing underlying stream is not enough.
|
trautonen_jersey-mustache
|
train
|
java
|
dda25a63cf1ebe70c33c4f45cc65a620de622a84
|
diff --git a/src/components/checkbox/checkbox.js b/src/components/checkbox/checkbox.js
index <HASH>..<HASH> 100644
--- a/src/components/checkbox/checkbox.js
+++ b/src/components/checkbox/checkbox.js
@@ -111,7 +111,8 @@ function MdCheckboxDirective(inputDirective, $mdAria, $mdConstant, $mdTheming, $
attr.$set('aria-labelledby', labelId);
var label = element.children()[1];
- label.remove();
+ // Use jQLite here since ChildNode.remove() is not supported in IE11.
+ angular.element(label).remove();
label.removeAttribute('ng-transclude');
label.className = 'md-checkbox-link-label';
label.setAttribute('id', labelId);
|
fix(checkbox): labels with links throw exception in IE<I>
|
angular_material
|
train
|
js
|
5be33c5396286f7041fcd22ac27a4191abb6832f
|
diff --git a/angr/procedures/posix/accept.py b/angr/procedures/posix/accept.py
index <HASH>..<HASH> 100644
--- a/angr/procedures/posix/accept.py
+++ b/angr/procedures/posix/accept.py
@@ -18,7 +18,8 @@ class accept(angr.SimProcedure):
if sockfd in self.state.posix.fd:
simsockfd = self.state.posix.fd[sockfd]
for potential_ident in self.state.posix.sockets:
- if self.state.posix.sockets[potential_ident] is simsockfd:
+ if self.state.posix.sockets[potential_ident][0] is simsockfd.read_storage and \
+ self.state.posix.sockets[potential_ident][1] is simsockfd.write_storage:
ident = potential_ident
break
|
Fix `accept` finds ident in a wrong way.
|
angr_angr
|
train
|
py
|
aba2447116a4c3840b440fa969a367569c29153d
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -18,5 +18,5 @@ setup(name = "amqplib",
author = "Barry Pederson",
author_email = "bp@barryp.org",
url = "http://barryp.org/software/py-amqplib/",
- packages = ['amqplib']
+ packages = ['amqplib', 'amqplib.client_0_8']
)
|
Need to add another item to setup.py for this to actually build and install.
|
barryp_py-amqplib
|
train
|
py
|
23d87353a27dba347ea2fb357de106dd02c2d385
|
diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
@@ -302,6 +302,7 @@ class FrameworkExtension extends Extension
$this->addClassesToCompile(array(
'Symfony\\Bundle\\FrameworkBundle\\EventListener\\SessionListener',
'Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage',
+ 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeFileSessionHandler',
'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\AbstractProxy',
'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\SessionHandlerProxy',
$container->getDefinition('session')->getClass(),
|
Added NativeFileSessionHandler to classes to compile .
|
symfony_symfony
|
train
|
php
|
5a28b6bed444a997a1a7f8718c4b1c07298027c2
|
diff --git a/juicer/juicer/Juicer.py b/juicer/juicer/Juicer.py
index <HASH>..<HASH> 100644
--- a/juicer/juicer/Juicer.py
+++ b/juicer/juicer/Juicer.py
@@ -404,7 +404,9 @@ class Juicer(object):
'type_ids': ['rpm'],
'filters': {
'unit': {
- 'filename': rpm
+ 'filename': {
+ "$regex": rpm
+ }
}
}
}
|
Deleting with a regex seems to work better.
|
juicer_juicer
|
train
|
py
|
b8b34fdaed80bd757a67499a43e5babf434d184c
|
diff --git a/test/interop_sanity_test.js b/test/interop_sanity_test.js
index <HASH>..<HASH> 100644
--- a/test/interop_sanity_test.js
+++ b/test/interop_sanity_test.js
@@ -48,6 +48,9 @@ describe('Interop tests', function() {
port = 'localhost:' + server_obj.port;
done();
});
+ after(function() {
+ server.shutdown();
+ });
// This depends on not using a binary stream
it('should pass empty_unary', function(done) {
interop_client.runTest(port, name_override, 'empty_unary', true, done);
|
Added missing server shutdown to interop test runner
|
grpc_grpc-node
|
train
|
js
|
06556f04fd065acf72dca41b344b1f73a503b9c7
|
diff --git a/migrate.go b/migrate.go
index <HASH>..<HASH> 100644
--- a/migrate.go
+++ b/migrate.go
@@ -261,7 +261,7 @@ func ParseMigration(id string, r io.ReadSeeker) (*Migration, error) {
parsed, err := sqlparse.ParseMigration(r)
if err != nil {
- return nil, err
+ return nil, fmt.Errorf("Error parsing migration (%s): %s", id, err)
}
m.Up = parsed.UpStatements
|
Make it more clear which migration causes a parse error
|
rubenv_sql-migrate
|
train
|
go
|
bdda42637fb7902e4fcf5172210cf46a7b4ec5ad
|
diff --git a/opal/clearwater/application.rb b/opal/clearwater/application.rb
index <HASH>..<HASH> 100644
--- a/opal/clearwater/application.rb
+++ b/opal/clearwater/application.rb
@@ -98,7 +98,7 @@ module Clearwater
raise TypeError, "Cannot render to a non-existent element. Make sure the document ready event has been triggered before invoking the application."
end
- rendered = benchmark('Generated virtual DOM') { component.render }
+ rendered = benchmark('Generated virtual DOM') { Component.sanitize_content(component.render) }
benchmark('Rendered to actual DOM') { virtual_dom.render rendered }
@will_render = false
run_callbacks
|
Sanitize root component
Previously, if the root component delegated directly to another
component, this caused a problem because that delegate component's
render method was never invoked. Sanitizing it handles that.
|
clearwater-rb_clearwater
|
train
|
rb
|
e504bd8a0f4fbd9965e9c5fdc3d0faaf201ed679
|
diff --git a/generator/classes/propel/engine/platform/PlatformMssqlImpl.php b/generator/classes/propel/engine/platform/PlatformMssqlImpl.php
index <HASH>..<HASH> 100644
--- a/generator/classes/propel/engine/platform/PlatformMssqlImpl.php
+++ b/generator/classes/propel/engine/platform/PlatformMssqlImpl.php
@@ -79,5 +79,13 @@ class PlatformMssqlImpl extends PlatformDefaultImpl {
{
return true;
}
+
+ /**
+ * @see Platform::hasSize(String)
+ */
+ public function hasSize($sqlType)
+ {
+ return !("INT" == $sqlType || "TEXT" == $sqlType);
+ }
}
|
Added a better (though certainly not conclusive) hasSize() method for the MSSQL platform class.
|
propelorm_Propel
|
train
|
php
|
e73f2a0dd315be25d0735ff434991e3c372b979d
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -13,7 +13,7 @@ Welcome
setup(
name='synonyms',
- version='1.9',
+ version='2.0',
description='Chinese Synonyms for Natural Language Processing and Understanding',
long_description=LONGDOC,
author='Hai Liang Wang, Hu Ying Xi',
diff --git a/synonyms/__init__.py b/synonyms/__init__.py
index <HASH>..<HASH> 100755
--- a/synonyms/__init__.py
+++ b/synonyms/__init__.py
@@ -219,8 +219,8 @@ def _similarity_distance(s1, s2):
# https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.linalg.norm.html
g = 1 / (np.linalg.norm(a - b) + 1)
u = _levenshtein_distance(s1, s2)
- r = g * 1.8 + u * 0.4
- r = min((r * 18), 1.0)
+ r = g * 5 + u * 0.8
+ r = min(r, 1.0)
return float("%.3f" % r)
|
Refine distance params, upgrade to v2
|
huyingxi_Synonyms
|
train
|
py,py
|
871acccbb1409c2864b8dfd69d936878ea3458e3
|
diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -167,8 +167,8 @@ module.exports = function(grunt) {
browsers: [
{browserName: 'chrome'},
{browserName: 'firefox', platform: 'Linux'},
- {browserName: 'safari', version: 9, platform: 'OS X 10.11'},
- {browserName: 'safari', version: 8, platform: 'OS X 10.10'},
+ // {browserName: 'safari', version: 9, platform: 'OS X 10.11'},
+ // {browserName: 'safari', version: 8, platform: 'OS X 10.10'},
{browserName: 'internet explorer', version: 11, platform: 'Windows 8.1'},
{browserName: 'internet explorer', version: 10, platform: 'Windows 8'}
]
|
test: remove safari from saucelabs
|
wycats_handlebars.js
|
train
|
js
|
b48d10efab762dfa87213ed7469d54e138d47f96
|
diff --git a/test/test_requests.rb b/test/test_requests.rb
index <HASH>..<HASH> 100644
--- a/test/test_requests.rb
+++ b/test/test_requests.rb
@@ -100,12 +100,10 @@ describe "when handling requests" do
end
it "should return status 404 for 'directory' without index.html" do
- skip
@request.get("/dir-without-index").status.must_equal 404
end
it "should return status 404 for 'directory/' without index.html" do
- skip
@request.get("/dir-without-index/").status.must_equal 404
end
end
|
Unskip test cases that are now passing
The path is now normalized before testing for a file, not after.
|
adaoraul_rack-jekyll
|
train
|
rb
|
8ae3b34b053951da8e1b51f90c2ac00b1a850fe3
|
diff --git a/hypervisor/network.go b/hypervisor/network.go
index <HASH>..<HASH> 100644
--- a/hypervisor/network.go
+++ b/hypervisor/network.go
@@ -70,13 +70,13 @@ func (nc *NetworkContext) freeSlot(slot int) {
if inf, ok := nc.eth[slot]; !ok {
nc.sandbox.Log(WARNING, "Freeing an unoccupied eth slot %d", slot)
return
- } else {
+ } else if inf != nil {
if _, ok := nc.idMap[inf.Id]; ok {
delete(nc.idMap, inf.Id)
}
- nc.sandbox.Log(DEBUG, "Free slot %d of eth", slot)
- delete(nc.eth, slot)
}
+ nc.sandbox.Log(DEBUG, "Free slot %d of eth", slot)
+ delete(nc.eth, slot)
}
func (nc *NetworkContext) addInterface(inf *api.InterfaceDescription, result chan api.Result) {
|
fix panic in freeSlot
inf may be nil if configureInterface failed
|
hyperhq_runv
|
train
|
go
|
0328e4ad4faf03fac0d504b422feef520f4e1739
|
diff --git a/test/ost_test.rb b/test/ost_test.rb
index <HASH>..<HASH> 100644
--- a/test/ost_test.rb
+++ b/test/ost_test.rb
@@ -58,7 +58,7 @@ scope do
Thread.new do
sleep 2
- enqueue(1)
+ redis.lpush(Ost[:events].key, 1)
end
ost do |item|
|
Use a different connection in threaded test.
|
soveran_ost
|
train
|
rb
|
4334460741be58dff707f727e59ec607e38953f4
|
diff --git a/sos/jupyter/sos_step.py b/sos/jupyter/sos_step.py
index <HASH>..<HASH> 100755
--- a/sos/jupyter/sos_step.py
+++ b/sos/jupyter/sos_step.py
@@ -35,7 +35,7 @@ class Interactive_Step_Executor(SP_Step_Executor):
Base_Step_Executor.__init__(self, step)
def pending_tasks(self, tasks):
- host = Host(start_task_engine=True)
+ host = Host()
for task in tasks:
host.submit_task(task)
while True:
|
Fix jupyter for the removal of option start_task_engine
|
vatlab_SoS
|
train
|
py
|
f5ce1c4fe70859d729fd60788d1c8f9c074a81a6
|
diff --git a/test/lib/rules/disallow-objectcontroller.js b/test/lib/rules/disallow-objectcontroller.js
index <HASH>..<HASH> 100644
--- a/test/lib/rules/disallow-objectcontroller.js
+++ b/test/lib/rules/disallow-objectcontroller.js
@@ -37,6 +37,11 @@ describe('lib/rules/disallow-objectcontroller', function () {
var foo = Ember.ObjectController;
}
}, {
+ it: 'should not report',
+ code: function() {
+ Ember.ObjectController.foo();
+ }
+ }, {
it: 'should report deprecated use',
errors: 1,
code: function() {
|
add test for calls to objectcontroller that aren't real
|
minichate_jscs-ember-deprecations
|
train
|
js
|
b8498c3a7f4ed1cf69b9a527df59f9272906e60d
|
diff --git a/addon/components/power-select-multiple/trigger.js b/addon/components/power-select-multiple/trigger.js
index <HASH>..<HASH> 100644
--- a/addon/components/power-select-multiple/trigger.js
+++ b/addon/components/power-select-multiple/trigger.js
@@ -5,7 +5,7 @@ import updateInput from '../../utils/update-input-value';
const { computed, get, isBlank, run } = Ember;
const { htmlSafe } = Ember.String;
-const ua = window.navigator.userAgent;
+const ua = self.window ? self.window.navigator.userAgent : '';
const isIE = ua.indexOf('MSIE ') > -1 || ua.indexOf('Trident/') > -1;
export default Ember.Component.extend({
tagName: '',
|
Protect for the ausence of window in fastboot mode
|
cibernox_ember-power-select
|
train
|
js
|
7edf69b44d0afae55429742a9642910cc709924f
|
diff --git a/keyboard/mouse.py b/keyboard/mouse.py
index <HASH>..<HASH> 100644
--- a/keyboard/mouse.py
+++ b/keyboard/mouse.py
@@ -157,7 +157,7 @@ def unhook_all():
Removes all hooks registered by this application. Note this may include
hooks installed by high level functions, such as `record`.
"""
- _listener.handlers.clear()
+ del _listener.handlers[:]
def record(button=RIGHT, target_types=(DOWN,)):
"""
|
Remove python3-only method in mouse too
|
boppreh_keyboard
|
train
|
py
|
8910a25eb6b7fc148cbb4ed54ae4d1070e47fb38
|
diff --git a/lib/dimples/version.rb b/lib/dimples/version.rb
index <HASH>..<HASH> 100644
--- a/lib/dimples/version.rb
+++ b/lib/dimples/version.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
module Dimples
- VERSION = '6.5.4'
+ VERSION = '6.6.0'
end
|
Bump dimples to <I>
|
waferbaby_dimples
|
train
|
rb
|
9c4435afd63add4fdf656ca17f2350243434ddfe
|
diff --git a/src/main/java/io/github/bonigarcia/wdm/Downloader.java b/src/main/java/io/github/bonigarcia/wdm/Downloader.java
index <HASH>..<HASH> 100644
--- a/src/main/java/io/github/bonigarcia/wdm/Downloader.java
+++ b/src/main/java/io/github/bonigarcia/wdm/Downloader.java
@@ -236,8 +236,11 @@ public class Downloader {
compressedFile.delete();
file = browserManager.postDownload(compressedFile);
- log.trace("Resulting binary file {}", file.getAbsoluteFile());
- return file.getAbsoluteFile();
+ File result = file.getAbsoluteFile();
+ result.setExecutable(true);
+ log.trace("Resulting binary file {}", result);
+
+ return result;
}
public static File unGzip(File archive) throws IOException {
|
Force to be executable resulting binary after extracting
|
bonigarcia_webdrivermanager
|
train
|
java
|
652cb2363d7941dd4052c1f6393d29acb9d3b8f8
|
diff --git a/internal/service/macie2/classification_job.go b/internal/service/macie2/classification_job.go
index <HASH>..<HASH> 100644
--- a/internal/service/macie2/classification_job.go
+++ b/internal/service/macie2/classification_job.go
@@ -551,12 +551,18 @@ func resourceClassificationJobCustomizeDiff(_ context.Context, diff *schema.Reso
if diff.Id() != "" {
for _, key := range diff.GetChangedKeysPrefix("s3_job_definition.0.scoping.0.excludes") {
if strings.Contains(key, "tag_scope_term") && strings.Contains(key, "target") {
- diff.Clear(key)
+ err := diff.Clear(key)
+ if err != nil {
+ return err
+ }
}
}
for _, key := range diff.GetChangedKeysPrefix("s3_job_definition.0.scoping.0.includes") {
if strings.Contains(key, "tag_scope_term") && strings.Contains(key, "target") {
- diff.Clear(key)
+ err := diff.Clear(key)
+ if err != nil {
+ return err
+ }
}
}
}
|
#<I> check return value for diff
|
terraform-providers_terraform-provider-aws
|
train
|
go
|
46fe636af34c428997cb8d9262c8899fa7928bf8
|
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/history/MeasureHistory.js b/server/sonar-web/src/main/js/apps/component-measures/details/history/MeasureHistory.js
index <HASH>..<HASH> 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/details/history/MeasureHistory.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/details/history/MeasureHistory.js
@@ -90,6 +90,10 @@ export default class MeasureHistory extends React.Component {
}
fetchEvents () {
+ if (this.props.component.qualifier !== 'TRK') {
+ return Promise.resolve([]);
+ }
+
return getProjectActivity(this.props.component.key, { category: 'VERSION' }).then(({ analyses }) => {
const events = analyses.map(analysis => {
const version = analysis.events.find(event => event.category === 'VERSION');
|
do not request activity for views on the measure history page
|
SonarSource_sonarqube
|
train
|
js
|
d4ff4316e413c64f16edd9679799e60c20131338
|
diff --git a/src/watch.js b/src/watch.js
index <HASH>..<HASH> 100644
--- a/src/watch.js
+++ b/src/watch.js
@@ -50,10 +50,9 @@ export default function(files, command, options = {}) {
Config.WATCHING = true; // Enable plumber
Gulp.watch(files, function watcher(event) {
- if (!event) {
- console.error('Unexpected event object in watch', event, new Error().stack);
+ if (event) {
+ changed.push(event);
}
- changed.push(event);
if (running) {
rerun = true;
|
Avoid inserting null change on tast rerun.
|
kpdecker_linoleum
|
train
|
js
|
84db5db8e16af8461925a3e3a4a0145437e7e1c0
|
diff --git a/tests/test_request_construction.py b/tests/test_request_construction.py
index <HASH>..<HASH> 100644
--- a/tests/test_request_construction.py
+++ b/tests/test_request_construction.py
@@ -148,6 +148,9 @@ class TestExtraParameters:
self.expect_no_error(1)
self.expect_no_error(a=1)
+ self.expect_no_error(None, 1, 2)
+ self.expect_no_error(b1=2, b2=3)
+ self.expect_no_error(None, b1=2, b2=3)
self.expect_no_error(1, b1=None, b2=None)
def test_multiple_consecutive_choice_parameters(self):
|
update the 'sequence inside a choice' extra parameter test
In case the subsequence contains multiple elements, specifying non-None values
for more than one of those elements should not be interpreted as a 'multiple
values defined for a single choice group' error.
|
ovnicraft_suds2
|
train
|
py
|
486218ab2843547da8962810a5dbf9bffbf789cd
|
diff --git a/src/main/java/org/jboss/netty/channel/socket/nio/NioWorker.java b/src/main/java/org/jboss/netty/channel/socket/nio/NioWorker.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jboss/netty/channel/socket/nio/NioWorker.java
+++ b/src/main/java/org/jboss/netty/channel/socket/nio/NioWorker.java
@@ -89,11 +89,14 @@ class NioWorker implements Runnable {
boolean firstChannel = started.compareAndSet(false, true);
Selector selector;
if (firstChannel) {
+ selectorGuard.writeLock().lock();
try {
this.selector = selector = Selector.open();
} catch (IOException e) {
throw new ChannelException(
"Failed to create a selector.", e);
+ } finally {
+ selectorGuard.writeLock().unlock();
}
} else {
selector = this.selector;
|
Potential fix for NPE during SocketChannel.register(..)
|
netty_netty
|
train
|
java
|
fa8616355b89ef25840393df862de2815a4f1e64
|
diff --git a/bin/methods/generateAction.js b/bin/methods/generateAction.js
index <HASH>..<HASH> 100755
--- a/bin/methods/generateAction.js
+++ b/bin/methods/generateAction.js
@@ -18,6 +18,7 @@ exports['generateAction'] = function(binary, next){
templateLines.push(' outputExample: {},');
templateLines.push(' matchExtensionMimeType: false,');
templateLines.push(' version: 1.0,');
+ templateLines.push(' toDocument: true,');
templateLines.push(' run: function(api, connection, next){');
templateLines.push(' // your logic here');
templateLines.push(' next(connection, true);');
|
note that actions can be hidden from documentation
|
actionhero_actionhero
|
train
|
js
|
359cff142b4259657ba81f6e4aa7ebe2b6dd12b2
|
diff --git a/lib/dhis2/api/organisation_unit.rb b/lib/dhis2/api/organisation_unit.rb
index <HASH>..<HASH> 100644
--- a/lib/dhis2/api/organisation_unit.rb
+++ b/lib/dhis2/api/organisation_unit.rb
@@ -45,7 +45,13 @@ module Dhis2
short_name: orgunit[:short_name],
opening_date: orgunit[:opening_date]
}
- organisation_unit[:parent] = {id: orgunit[:parent_id]} if orgunit[:parent_id]
+ organisation_unit[:parent] = {id: orgunit[:parent_id]} if orgunit[:parent_id]
+
+ organisation_unit[:contact_person] = {contact_person: orgunit[:contact_person]} if orgunit[:contact_person]
+ organisation_unit[:phone_number] = {phone_number: orgunit[:phone_number]} if orgunit[:phone_number]
+ organisation_unit[:email] = {email: orgunit[:email]} if orgunit[:email]
+ organisation_unit[:address] = {address: orgunit[:address]} if orgunit[:address]
+
organisation_unit
end
}
|
Adding the missing org unit fields
|
BLSQ_dhis2
|
train
|
rb
|
c80c142f2af84724f3154f574c3957877b698839
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -73,7 +73,7 @@ fn = function (req, res, next) {
};
if (Churchill.options.reqLogger && loggers.length === 1 && req.logger === undefined) {
- req.logger = loggers[0];
+ req.logger = loggers[0][0];
}
next();
|
Bugfix not using logger at that point
|
easternbloc_churchill
|
train
|
js
|
dc374f493e2864969a9b893b3211e414a52f6a62
|
diff --git a/src/org/jgroups/protocols/pbcast/GMS.java b/src/org/jgroups/protocols/pbcast/GMS.java
index <HASH>..<HASH> 100644
--- a/src/org/jgroups/protocols/pbcast/GMS.java
+++ b/src/org/jgroups/protocols/pbcast/GMS.java
@@ -1,4 +1,4 @@
-// $Id: GMS.java,v 1.14 2004/08/19 09:24:11 belaban Exp $
+// $Id: GMS.java,v 1.15 2004/08/31 16:29:25 belaban Exp $
package org.jgroups.protocols.pbcast;
@@ -367,7 +367,9 @@ public class GMS extends Protocol {
passUp(view_event);
coord=determineCoordinator();
- if(coord != null && coord.equals(local_addr) && !(coord.equals(vid.getCoordAddress()))) {
+ // if(coord != null && coord.equals(local_addr) && !(coord.equals(vid.getCoordAddress()))) {
+ // changed on suggestion by yaronr
+ if(coord != null && coord.equals(local_addr)) {
becomeCoordinator();
}
else {
|
correct handling of new coord determination after merge
|
belaban_JGroups
|
train
|
java
|
7b392d6ed9ccf400936211ce01b14cac2993acb6
|
diff --git a/monoseq/monoseq.py b/monoseq/monoseq.py
index <HASH>..<HASH> 100644
--- a/monoseq/monoseq.py
+++ b/monoseq/monoseq.py
@@ -43,7 +43,7 @@ AnsiFormat = Format([('\033[91m', '\033[0m'), # Red.
#: HTML output format.
HtmlFormat = Format([('<span class="monoseq-annotation-%i">' % i, '</span>')
- for i in range(5)],
+ for i in range(10)],
('<span class="monoseq-margin">', '</span>'))
|
Support <I> annotation levels in HtmlFormat
|
martijnvermaat_monoseq
|
train
|
py
|
dae2eba903ea4e9d5432df552b981c3ec4082ddc
|
diff --git a/flask_cors/extension.py b/flask_cors/extension.py
index <HASH>..<HASH> 100644
--- a/flask_cors/extension.py
+++ b/flask_cors/extension.py
@@ -61,7 +61,11 @@ class CORS(object):
:param origins:
The origin, or list of origins to allow requests from.
The origin(s) may be regular expressions, case-sensitive strings,
- or else an asterisk
+ or else an asterisk.
+
+ :note: origins must include the schema and the port (if not port 80),
+ e.g.,
+ `CORS(app, origins=["http://localhost:8000", "https://example.com"])`.
Default : '*'
:type origins: list, string or regex
|
Include examples to specify that schema and port must be included in origins documentation. (#<I>)
|
corydolphin_flask-cors
|
train
|
py
|
71feec2c201fd2e2bc07809f31019841ccd0d899
|
diff --git a/lib/rubocop/cop/style/regexp_literal.rb b/lib/rubocop/cop/style/regexp_literal.rb
index <HASH>..<HASH> 100644
--- a/lib/rubocop/cop/style/regexp_literal.rb
+++ b/lib/rubocop/cop/style/regexp_literal.rb
@@ -170,27 +170,31 @@ module RuboCop
end
def correct_inner_slashes(node, corrector)
- search_indices(
- node_body(node),
- inner_slash_before_correction(node)
- ).each do |index|
+ regexp_begin = node.loc.begin.end_pos
+
+ inner_slash_indices(node).each do |index|
+ start = regexp_begin + index
+
corrector.replace(
range_between(
- node.loc.begin.end_pos + index,
- node.loc.begin.end_pos + index +
- inner_slash_before_correction(node).length
+ start,
+ start + inner_slash_before_correction(node).length
),
inner_slash_after_correction(node)
)
end
end
- def search_indices(text, pattern)
- index = -1
+ def inner_slash_indices(node)
+ text = node_body(node)
+ pattern = inner_slash_before_correction(node)
+ index = -1
indices = []
+
while (index = text.index(pattern, index + 1))
indices << index
end
+
indices
end
|
Refactor complex method in Style/RegexpLiteral cop
This cop had a relatively complex (ABC = <I>) method `#correct_inner_slashes`.
This change attempts to simplify it by making the method `#search_indices`
less general, and having it take on some of the responsibility that was
previously in `#correct_inner_slashes`.
|
rubocop-hq_rubocop
|
train
|
rb
|
226dd4b90723a421ccd04460c7bf4a265d7a2936
|
diff --git a/superset/views/core.py b/superset/views/core.py
index <HASH>..<HASH> 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -2793,7 +2793,7 @@ class Superset(BaseSupersetView): # pylint: disable=too-many-public-methods
.scalar()
)
if welcome_dashboard_id:
- return self.dashboard(str(welcome_dashboard_id))
+ return self.dashboard(dashboard_id_or_slug=str(welcome_dashboard_id))
payload = {
"user": bootstrap_user_data(g.user),
|
Fixed KeyError by making kwarg explicit (#<I>)
|
apache_incubator-superset
|
train
|
py
|
0cc83101d6cecb6cc5796f39884015563d471556
|
diff --git a/indra/assemblers/pysb/assembler.py b/indra/assemblers/pysb/assembler.py
index <HASH>..<HASH> 100644
--- a/indra/assemblers/pysb/assembler.py
+++ b/indra/assemblers/pysb/assembler.py
@@ -2101,7 +2101,7 @@ def conversion_assemble_one_step(stmt, model, agent_set, parameters):
sites_dict[site] = obj_to_monomer.site_states[site][0]
else:
sites_dict[site] = None
- obj_to_pattern = obj_to_monomer(**sites_dict)
+ obj_to_pattern = ComplexPattern([obj_to_monomer(**sites_dict)], None)
obj_to_patterns.append(obj_to_pattern)
obj_to_pattern = ReactionPattern(obj_to_patterns)
|
Change object elements to ComplexPattern
|
sorgerlab_indra
|
train
|
py
|
d69bbfff9ffbabe078e5d08b786901b0df311901
|
diff --git a/serviced/stats.go b/serviced/stats.go
index <HASH>..<HASH> 100644
--- a/serviced/stats.go
+++ b/serviced/stats.go
@@ -25,9 +25,9 @@ import (
)
const (
- BLKIODIR = "/sys/fs/cgroup/blkio/lxc"
- CPUDIR = "/sys/fs/cgroup/cpuacct/lxc"
- MEMDIR = "/sys/fs/cgroup/memory/lxc"
+ BLKIODIR = "/sys/fs/cgroup/blkio"
+ CPUDIR = "/sys/fs/cgroup/cpuacct"
+ MEMDIR = "/sys/fs/cgroup/memory"
)
// StatsReporter is a mechanism for gathering container statistics and sending
|
don't use lxc specific stats for cgroups
|
control-center_serviced
|
train
|
go
|
cf7111fedb18253b1acb5c6eb48232e268ad7da1
|
diff --git a/wikitextparser/spans.py b/wikitextparser/spans.py
index <HASH>..<HASH> 100644
--- a/wikitextparser/spans.py
+++ b/wikitextparser/spans.py
@@ -121,7 +121,6 @@ def parse_to_spans(string):
'wikilinks': wikilink_spans,
'comments': comment_spans,
'exttags': extension_tag_spans,
- 'tables': tables
}
"""
comment_spans = []
@@ -202,7 +201,7 @@ def indexed_parse_to_spans(
"""Basically the same as `parse_to_spans`, but with some arguments.
Accept an index and list of spans as argument.
- Designed to deal with wikitexts within extension tags.
+ The goal is to deal with wikitexts within extension tags.
"""
# Currently, does not work with nested <!-- comments --> or tag extensions.
# The title in WikiLinks may contain braces that interfere with
|
remove 'tables': tables from docstring.
Currently I've decided to implemented it in a seprate module.
|
5j9_wikitextparser
|
train
|
py
|
08d3e8ddf21f2934251deb3215d25ce865d31bb0
|
diff --git a/src/voeventparse/voevent.py b/src/voeventparse/voevent.py
index <HASH>..<HASH> 100644
--- a/src/voeventparse/voevent.py
+++ b/src/voeventparse/voevent.py
@@ -82,7 +82,7 @@ def loads(s, check_version=True):
Returns:
:py:class:`Voevent`: Root-node of the etree.
Raises:
- exceptions.ValueError: If passed a VOEvent of wrong schema version
+ ValueError: If passed a VOEvent of wrong schema version
(i.e. schema 1.1)
"""
|
DOCS: Fix docs-build for Sphinx <I>.
It seems exceptions must no longer have the `exceptions.` prefix for Intersphinx to handle
them correctly.
|
timstaley_voevent-parse
|
train
|
py
|
6a7db17c9e4737663e6cf25b2f4383877af8780a
|
diff --git a/lib/sensor/driver/gps/index.js b/lib/sensor/driver/gps/index.js
index <HASH>..<HASH> 100644
--- a/lib/sensor/driver/gps/index.js
+++ b/lib/sensor/driver/gps/index.js
@@ -36,7 +36,7 @@ function Gps(sensorInfo, options) {
if (addr) {
port = new serialport.SerialPort('/dev/ttyO' + addr, {
- baudrate: options.baudRate || 4800,
+ baudrate: options.baudRate || 9600,
parser: serialport.parsers.readline('\r\n')
});
port.on('data', function(line) {
|
[driver/gps] change default baudRate from <I> to <I>
|
daliworks_sensorjs
|
train
|
js
|
646e427633879d38ed32dc81e28a1314ebb28a8c
|
diff --git a/android/src/main/java/com/imagepicker/ImagePickerModule.java b/android/src/main/java/com/imagepicker/ImagePickerModule.java
index <HASH>..<HASH> 100644
--- a/android/src/main/java/com/imagepicker/ImagePickerModule.java
+++ b/android/src/main/java/com/imagepicker/ImagePickerModule.java
@@ -307,7 +307,7 @@ public class ImagePickerModule extends ReactContextBaseJavaModule
// user cancel
if (resultCode != Activity.RESULT_OK) {
- responseHelper.invokeResponse(callback);
+ responseHelper.invokeCancel(callback);
callback = null;
return;
}
|
Android: fix cancellation handling (#<I>)
- This was broken by #<I>.
- Currently, the response object is empty, lacking the `didCancel` flag.
|
react-native-community_react-native-image-picker
|
train
|
java
|
4b9ab337d8410ac9e2a82bc299bd549d6d5de8a5
|
diff --git a/ocsp/responder.go b/ocsp/responder.go
index <HASH>..<HASH> 100644
--- a/ocsp/responder.go
+++ b/ocsp/responder.go
@@ -197,8 +197,8 @@ func (rs Responder) ServeHTTP(response http.ResponseWriter, request *http.Reques
expiresIn := int(parsedResponse.NextUpdate.Sub(now) / time.Second)
maxAge = &expiresIn
} else {
- zero := 0
- maxAge = &zero
+ zero := 0 // XXX: we want max-age=0 but since this is technically an authorized OCSP response
+ maxAge = &zero // (despite being stale) and 5019 forbids attaching no-cache we get a little tricky
}
response.WriteHeader(http.StatusOK)
response.Write(ocspResponse)
|
Add comment about max-age for stale response
|
cloudflare_cfssl
|
train
|
go
|
5a3e023fe5065160172f154a2b64861fb6f32439
|
diff --git a/src/org/opencms/jsp/CmsJspNavBuilder.java b/src/org/opencms/jsp/CmsJspNavBuilder.java
index <HASH>..<HASH> 100644
--- a/src/org/opencms/jsp/CmsJspNavBuilder.java
+++ b/src/org/opencms/jsp/CmsJspNavBuilder.java
@@ -592,7 +592,7 @@ public class CmsJspNavBuilder {
list.add(ne);
// check if navigation entry is a folder and below the max level -> if so, get the navigation from this folder as well
if (ne.isFolderLink() && (noLimit || (ne.getNavTreeLevel() < endLevel))) {
- List<CmsJspNavElement> subnav = getSiteNavigation(ne.getResourceName(), endLevel);
+ List<CmsJspNavElement> subnav = getSiteNavigation(m_cms.getSitePath(ne.getResource()), endLevel);
// copy the result of the subfolder to the result list
list.addAll(subnav);
}
|
Fixed problem with navigation levels breaking the site navigation.
|
alkacon_opencms-core
|
train
|
java
|
bbb8ce3c43bcf811ba2b43d375b5a4405a9282a1
|
diff --git a/src/api/Search.js b/src/api/Search.js
index <HASH>..<HASH> 100644
--- a/src/api/Search.js
+++ b/src/api/Search.js
@@ -1,7 +1,6 @@
// @flow
import SimpleQueryRequest from './SimpleQueryRequest';
import QueryResponse from './QueryResponse';
-import FieldNames from './FieldNames';
import AuthUtils from '../util/AuthUtils';
import FetchUtils from '../util/FetchUtils';
import ObjectUtils from '../util/ObjectUtils';
|
Issue <I>: Remove unused import
|
attivio_suit
|
train
|
js
|
11078a7dd6200a048a88c4c1054f8dc2d471fb4d
|
diff --git a/docs/master/sidebar.js b/docs/master/sidebar.js
index <HASH>..<HASH> 100644
--- a/docs/master/sidebar.js
+++ b/docs/master/sidebar.js
@@ -104,7 +104,6 @@ module.exports = [{
'guides/validation',
'guides/relationships',
'guides/file-uploads',
- 'guides/custom-directives',
'guides/error-handling',
'guides/plugin-development'
]
|
Docs: remove deleted guide from sidebar
|
nuwave_lighthouse
|
train
|
js
|
b3f48a6e94c28f53cf1aa2421c1de93618c0cf4a
|
diff --git a/spec/rester/client_spec.rb b/spec/rester/client_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/rester/client_spec.rb
+++ b/spec/rester/client_spec.rb
@@ -261,8 +261,7 @@ module Rester
end
it 'should return the context back to nil' do
- client.with_context(context) do
- end
+ client.with_context(context) {}
expect(client.adapter.context).to eq nil
end
end # with StubAdapter
@@ -272,8 +271,7 @@ module Rester
it 'should raise error' do
expect {
- client.with_context(context) do
- end
+ client.with_context(context) {}
}.to raise_error Errors::MethodError, 'Can only use "with_context" with a StubAdapter'
end
end # with non-StubAdapter
|
[#<I>] Shorten block
|
payout_rester
|
train
|
rb
|
5edcd6886e9538401004cb2bb43cc7b876e10105
|
diff --git a/baselines/deepq/experiments/run_atari.py b/baselines/deepq/experiments/run_atari.py
index <HASH>..<HASH> 100644
--- a/baselines/deepq/experiments/run_atari.py
+++ b/baselines/deepq/experiments/run_atari.py
@@ -23,17 +23,15 @@ def main():
env = make_atari(args.env)
env = bench.Monitor(env, logger.get_dir())
env = deepq.wrap_atari_dqn(env)
- model = deepq.models.cnn_to_mlp(
- convs=[(32, 8, 4), (64, 4, 2), (64, 3, 1)],
- hiddens=[256],
- dueling=bool(args.dueling),
- )
deepq.learn(
env,
- q_func=model,
+ "conv_only",
+ convs=[(32, 8, 4), (64, 4, 2), (64, 3, 1)],
+ hiddens=[256],
+ dueling=bool(args.dueling),
lr=1e-4,
- max_timesteps=args.num_timesteps,
+ total_timesteps=args.num_timesteps,
buffer_size=10000,
exploration_fraction=0.1,
exploration_final_eps=0.01,
|
Fix argument error in deepq (#<I>)
* Fix argment error in deepq
* Fix argment error in deepq
|
openai_baselines
|
train
|
py
|
f391cedb088a861ef7112d4bb6e56808c4a1b92a
|
diff --git a/libraries/mako/ArrayTo.php b/libraries/mako/ArrayTo.php
index <HASH>..<HASH> 100644
--- a/libraries/mako/ArrayTo.php
+++ b/libraries/mako/ArrayTo.php
@@ -51,7 +51,7 @@ class ArrayTo
{
$data = json_encode($data);
- if(isset($_GET['jsoncallback']))
+ if(!empty($_GET['jsoncallback']))
{
$data = $_GET['jsoncallback'] . '(' . $data . ')';
}
|
Replaced isset with !empty
|
mako-framework_framework
|
train
|
php
|
c32645ca226218f44c8745e1b9e06e5705ff306e
|
diff --git a/src/js/plugin/dendrogram.js b/src/js/plugin/dendrogram.js
index <HASH>..<HASH> 100644
--- a/src/js/plugin/dendrogram.js
+++ b/src/js/plugin/dendrogram.js
@@ -39,7 +39,7 @@
selectedNodeOpacity: null,
collapsedNodeColor: null,
collapsedNodeOpacity: null,
- initialize: null
+ newNodes: null
},
_missing: {
@@ -453,8 +453,8 @@
d.y0 = d.y;
});
- if (this.options.initialize) {
- this.options.initialize(nodeEnter, node, nodeExit);
+ if (this.options.newNodes) {
+ nodeEnter.each(this.options.newNodes);
}
},
|
Renamed "initialize" to "newNodes"; eliminated access to update and exit selections.
|
Kitware_tangelo
|
train
|
js
|
33f2f17da747c4b63dbc8cbfa49682d6cd5da6f9
|
diff --git a/src/from_dom.js b/src/from_dom.js
index <HASH>..<HASH> 100644
--- a/src/from_dom.js
+++ b/src/from_dom.js
@@ -425,7 +425,7 @@ class ParseContext {
// none is found, the element's content nodes are added directly.
addElement(dom) {
let name = dom.nodeName.toLowerCase()
- if (listTags.hasOwnProperty(name) && this.normalizeLists) normalizeList(dom)
+ if (listTags.hasOwnProperty(name) && this.parser.normalizeLists) normalizeList(dom)
let rule = (this.options.ruleFromNode && this.options.ruleFromNode(dom)) || this.parser.matchTag(dom, this)
if (rule ? rule.ignore : ignoreTags.hasOwnProperty(name)) {
this.findInside(dom)
|
Fix list normalization in DOM parser
FIX: Fix a bug that prevented non-canonical list structure from being
normalized.
|
ProseMirror_prosemirror-model
|
train
|
js
|
ac67c796fd99fa25c03c3b7fe3c2111f10e41e47
|
diff --git a/proctor-webapp-library/src/main/java/com/indeed/proctor/webapp/jobs/EditAndPromoteJob.java b/proctor-webapp-library/src/main/java/com/indeed/proctor/webapp/jobs/EditAndPromoteJob.java
index <HASH>..<HASH> 100644
--- a/proctor-webapp-library/src/main/java/com/indeed/proctor/webapp/jobs/EditAndPromoteJob.java
+++ b/proctor-webapp-library/src/main/java/com/indeed/proctor/webapp/jobs/EditAndPromoteJob.java
@@ -475,6 +475,10 @@ public class EditAndPromoteJob extends AbstractJob {
}
private static boolean isInactiveBucket(final TestBucket bucket) {
+ // Proctor does not define inactive buckets,
+ // so we only assume a bucket is the inactive group
+ // if it has value value -1 and one of the 2 typical names "inactive" or "disabled".
+ // See further discussion in the ticket. https://bugs.indeed.com/browse/PROW-518
return bucket.getValue() == -1 &&
("inactive".equalsIgnoreCase(bucket.getName()) || "disabled".equalsIgnoreCase(bucket.getName()));
}
|
PROW-<I>: Add comments about identifying inactive test
|
indeedeng_proctor
|
train
|
java
|
e1056139a39ecd1438f764f176fc31360c3fe98a
|
diff --git a/spec/integration/enqueuing_jobs_spec.rb b/spec/integration/enqueuing_jobs_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/integration/enqueuing_jobs_spec.rb
+++ b/spec/integration/enqueuing_jobs_spec.rb
@@ -9,7 +9,7 @@ describe 'enqueuing jobs to Redis' do
serialized_job = redis.lpop(TEST_QUEUE)
job_from_redis = Workerholic::JobSerializer.deserialize(serialized_job)
- expected_job = Workerholic::JobWrapper.new(klass: SimpleJobTest, arguments: ['test job'])
+ expected_job = Workerholic::JobWrapper.new(klass: SimpleJobTest, arguments: ['test job'], wrapper: SimpleJobTest)
expected_job.statistics.enqueued_at = job_from_redis.statistics.enqueued_at
expect(job_from_redis.to_hash).to eq(expected_job.to_hash)
@@ -22,7 +22,8 @@ describe 'enqueuing jobs to Redis' do
expected_job = Workerholic::JobWrapper.new(
klass: ComplexJobTest,
- arguments: ['test job', { a: 1, b: 2 }, [1, 2, 3]]
+ arguments: ['test job', { a: 1, b: 2 }, [1, 2, 3]],
+ wrapper: ComplexJobTest
)
expected_job.statistics.enqueued_at = job_from_redis.statistics.enqueued_at
|
update enqueuing integration spec to include wrapper class
|
workerholic_workerholic
|
train
|
rb
|
f0342217794dedcd172f5b21015e5dfd681ba3c0
|
diff --git a/packages/@vue/cli-service/lib/commands/serve.js b/packages/@vue/cli-service/lib/commands/serve.js
index <HASH>..<HASH> 100644
--- a/packages/@vue/cli-service/lib/commands/serve.js
+++ b/packages/@vue/cli-service/lib/commands/serve.js
@@ -76,8 +76,8 @@ module.exports = (api, options) => {
`webpack-dev-server/client/?${urls.localUrlForBrowser}`,
// hmr client
projectDevServerOptions.hotOnly
- ? 'webpack/hot/dev-server'
- : 'webpack/hot/only-dev-server'
+ ? 'webpack/hot/only-dev-server'
+ : 'webpack/hot/dev-server'
// TODO custom overlay client
// `@vue/cli-overlay/dist/client`
])
|
fix hot/hotOnly client check
|
vuejs_vue-cli
|
train
|
js
|
1a403e6633b86351851df859f416779e103e16d3
|
diff --git a/lib/rack/tracker/google_analytics/google_analytics.rb b/lib/rack/tracker/google_analytics/google_analytics.rb
index <HASH>..<HASH> 100644
--- a/lib/rack/tracker/google_analytics/google_analytics.rb
+++ b/lib/rack/tracker/google_analytics/google_analytics.rb
@@ -1,5 +1,12 @@
require 'ostruct'
+# Backport of 2.0.0 stdlib ostruct#to_h
+class OpenStruct
+ def to_h
+ @table.dup
+ end unless method_defined? :to_h
+end
+
class Rack::Tracker::GoogleAnalytics < Rack::Tracker::Handler
class Event < OpenStruct
def write
|
test backport of ostruct#to_h on travis
|
railslove_rack-tracker
|
train
|
rb
|
0d9cd505bfc2e94e17007df0c50bf59c2c1e7a24
|
diff --git a/assets/js/ajax-section.js b/assets/js/ajax-section.js
index <HASH>..<HASH> 100644
--- a/assets/js/ajax-section.js
+++ b/assets/js/ajax-section.js
@@ -122,7 +122,7 @@ athens.ajax_section = (function () {
var targetDiv, targetUrl;
targetDiv = $("#" + id);
- if (sectionRegistry.hasOwnProperty(id)) {
+ if (sectionRegistry.hasOwnProperty(id) && !targetDiv.data("request-uri")) {
targetUrl = sectionRegistry[id];
} else {
targetUrl = targetDiv.data("request-uri");
|
Don't store section url.
|
AthensFramework_Core
|
train
|
js
|
82cc7cdb31c9ef22db75bf26b494bb946e452b02
|
diff --git a/tests/commands/test_usage.py b/tests/commands/test_usage.py
index <HASH>..<HASH> 100644
--- a/tests/commands/test_usage.py
+++ b/tests/commands/test_usage.py
@@ -102,7 +102,7 @@ def test_command_config_file():
test_font = os.path.join("data", "test", "nunito", "Nunito-Regular.ttf")
result = subprocess.run(["fontbakery", "check-googlefonts",
"--config", config.name,
- test_font], capture_output=True)
+ test_font], stdout=subprocess.PIPE)
stdout = result.stdout.decode()
assert "running 1 individual check" in stdout
os.unlink(config.name)
@@ -122,7 +122,7 @@ OK = 123
"-C",
"--config", config.name,
test_profile,
- test_font], capture_output=True)
+ test_font], stdout=subprocess.PIPE)
stdout = result.stdout.decode()
assert "FAIL: 0" in stdout
os.unlink(config.name)
|
Avoid <I>ism.
|
googlefonts_fontbakery
|
train
|
py
|
951f1ee78660d4d9460038a91692557dd43e5b69
|
diff --git a/src/widgets/views/DocumentByMonthButton.php b/src/widgets/views/DocumentByMonthButton.php
index <HASH>..<HASH> 100644
--- a/src/widgets/views/DocumentByMonthButton.php
+++ b/src/widgets/views/DocumentByMonthButton.php
@@ -1,7 +1,7 @@
<?php
use hipanel\widgets\ModalButton;
-use kartik\date\DatePicker;
+use hipanel\widgets\DateTimePicker;
use yii\helpers\Html;
/** @var string $prepend */
@@ -38,14 +38,14 @@ use yii\helpers\Html;
<?= $prepend ?>
-<?= $modalButton->form->field($model, 'month')->widget(DatePicker::class, [
+<?= $modalButton->form->field($model, 'month')->widget(DateTimePicker::class, [
'options' => [
'id' => 'purse-month-' . uniqid(),
],
- 'pluginOptions' => [
+ 'clientOptions' => [
'format' => 'yyyy-mm',
- 'viewMode' => 'months',
- 'minViewMode' => 'months',
+ 'minView' => 3,
+ 'startView' => 'year',
'autoclose' => true,
'endDate' => $dt->modify('next month')->format('Y-m'),
],
|
replaced DatePicker class with DateTimePicker (#<I>)
* removed DatePicker class
* fixed datetime widget clicking bug
|
hiqdev_hipanel-module-finance
|
train
|
php
|
0565160b01f7eb8a08f0589019d5580d4a5a4856
|
diff --git a/lib/code_climate_check/compare_gpa.rb b/lib/code_climate_check/compare_gpa.rb
index <HASH>..<HASH> 100644
--- a/lib/code_climate_check/compare_gpa.rb
+++ b/lib/code_climate_check/compare_gpa.rb
@@ -2,7 +2,6 @@ require 'code_climate_check/get_gpa'
module CodeClimateCheck
class CompareGpa
-
def initialize(token, repo)
@token, @repo = token, repo
end
|
Remove extra empty line in compare_gpa
|
fs_codeclimate_ci
|
train
|
rb
|
bfb170769f0b142274480e7f3c21a5b73be91154
|
diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/parser/resource.rb
+++ b/lib/puppet/parser/resource.rb
@@ -5,8 +5,6 @@ require 'puppet/resource'
# parent is that this class has rules on who can set
# parameters
class Puppet::Parser::Resource < Puppet::Resource
- extend Forwardable
-
require 'puppet/parser/resource/param'
require 'puppet/util/tagging'
require 'puppet/parser/yaml_trimmer'
@@ -56,7 +54,9 @@ class Puppet::Parser::Resource < Puppet::Resource
end
end
- def_delegator :scope, :environment
+ def environment
+ scope.environment
+ end
# Process the stage metaparameter for a class. A containment edge
# is drawn from the class to the stage. The stage for containment
@@ -228,7 +228,9 @@ class Puppet::Parser::Resource < Puppet::Resource
end
# Convert this resource to a RAL resource.
- def_delegator :to_resource, :to_ral
+ def to_ral
+ to_resource.to_ral
+ end
private
|
(#<I>) Remove 2 def_delegator's in favor of explicit method invocations.
|
puppetlabs_puppet
|
train
|
rb
|
2896a27f753c9abe65e5334e34b141853cb01353
|
diff --git a/dp_tornado/helper/numeric/__init__.py b/dp_tornado/helper/numeric/__init__.py
index <HASH>..<HASH> 100644
--- a/dp_tornado/helper/numeric/__init__.py
+++ b/dp_tornado/helper/numeric/__init__.py
@@ -25,7 +25,22 @@ class NumericHelper(dpHelper):
return re.sub(r'\D+', '', string)
def number_format(self, value, tsep=',', dsep='.'):
- value = self.extract_numbers(value)
+ if self.helper.misc.type.check.string(value):
+ value = value.replace(',', '')
+
+ if '.' in value:
+ value_cast = self.helper.numeric.cast.float(value)
+ else:
+ value_cast = self.helper.numeric.cast.long(value)
+
+ if value_cast is not False:
+ value = value_cast
+ else:
+ value = self.extract_numbers(value)
+ elif self.helper.misc.type.check.numeric(value):
+ value = value
+ else:
+ raise Exception('Invalid value.')
if not value:
return '0'
|
enhanced type casting for number_format.
|
why2pac_dp-tornado
|
train
|
py
|
9482c7c7231a851be711743acb998a3c10e35848
|
diff --git a/mailmerge/sendmail_client.py b/mailmerge/sendmail_client.py
index <HASH>..<HASH> 100644
--- a/mailmerge/sendmail_client.py
+++ b/mailmerge/sendmail_client.py
@@ -70,12 +70,7 @@ class SendmailClient:
)
def sendmail(self, sender, recipients, message):
- """Send email message.
-
- Note that we can't use the elegant smtp.send_message(message)" because
- Python 2 doesn't support it. Both Python 2 and Python 3 support
- smtp.sendmail(sender, recipients, flattened_message_str).
- """
+ """Send email message."""
if self.dry_run:
return
|
Kill comment. We can't use send_message() because of BCC privacy
|
awdeorio_mailmerge
|
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.