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 |
|---|---|---|---|---|---|
c860070ca306998937247a9c8f22bac1ad30100b | diff --git a/backbone.js b/backbone.js
index <HASH>..<HASH> 100644
--- a/backbone.js
+++ b/backbone.js
@@ -163,11 +163,10 @@
this.attributes = {};
this._escapedAttributes = {};
this.cid = _.uniqueId('c');
- this._changed = {};
if (!this.set(attributes, {silent: true})) {
throw new Error("Can't create an invalid model");
}
- this._changed = {};
+ delete this._changed;
this._previousAttributes = _.clone(this.attributes);
this.initialize.apply(this, arguments);
};
@@ -235,6 +234,7 @@
var escaped = this._escapedAttributes;
var prev = this._previousAttributes || {};
var alreadyChanging = this._changing;
+ this._changed || (this._changed = {});
this._changing = true;
// Update attributes.
@@ -378,13 +378,13 @@
}
this.trigger('change', this, options);
this._previousAttributes = _.clone(this.attributes);
- this._changed = {};
+ delete this._changed;
},
// Determine if the model has changed since the last `"change"` event.
// If you specify an attribute name, determine if that attribute has changed.
hasChanged: function(attr) {
- if (attr) return _.has(this._changed, attr);
+ if (attr) return this._changed && _.has(this._changed, attr);
return !_.isEmpty(this._changed);
}, | refactor `_changed` to prevent confusion | jashkenas_backbone | train | js |
06c28bc5bd5b59a25ed02113b76fa56d20c52e7c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
setup(name='instana',
- version='0.5.2',
+ version='0.5.3',
download_url='https://github.com/instana/python-sensor',
url='https://www.instana.com/',
license='MIT', | Bump package version to <I> | instana_python-sensor | train | py |
a9c79d16f47cb2d60208de41993d63848cd85640 | diff --git a/packages/idyll-layouts/src/blog/styles.js b/packages/idyll-layouts/src/blog/styles.js
index <HASH>..<HASH> 100644
--- a/packages/idyll-layouts/src/blog/styles.js
+++ b/packages/idyll-layouts/src/blog/styles.js
@@ -67,6 +67,10 @@ input {
position: sticky;
}
+.idyll-scroll-graphic img {
+ max-height: 100vh;
+}
+
@media all and (max-width: 1600px) {
.fixed {
width: calc((85vw - 600px) - 50px);
diff --git a/packages/idyll-layouts/src/centered/styles.js b/packages/idyll-layouts/src/centered/styles.js
index <HASH>..<HASH> 100644
--- a/packages/idyll-layouts/src/centered/styles.js
+++ b/packages/idyll-layouts/src/centered/styles.js
@@ -38,6 +38,10 @@ input {
position: sticky;
}
+.idyll-scroll-graphic {
+ max-height: 100vh;
+}
+
@media all and (max-width: 1000px) {
.idyll-root { | make graphic images scaled to view height | idyll-lang_idyll | train | js,js |
14141ae48ee9c3e15a9eafd0684af241cb98f2dc | diff --git a/src/Services/ContactService.php b/src/Services/ContactService.php
index <HASH>..<HASH> 100644
--- a/src/Services/ContactService.php
+++ b/src/Services/ContactService.php
@@ -51,7 +51,7 @@ final class ContactService extends Service
* @param string $contactId
* @param array|ArrayObject $params
*
- * @throws NotFoundException The payment does not exist
+ * @throws NotFoundException The contact does not exist
*
* @return Contact
*/
@@ -89,4 +89,14 @@ final class ContactService extends Service
{
return $this->client()->put($data, 'contacts/{contactId}', ['contactId' => $contactId]);
}
+
+ /**
+ * @param string $contactId
+ *
+ * @throws NotFoundException The contact does not exist
+ */
+ public function delete($contactId)
+ {
+ $this->client()->delete('contacts/{contactId}', ['contactId' => $contactId]);
+ }
} | DELETE support in Contacts (#<I>)
* GWY-<I> 2FA functionality in user profile module
* renaming according to @slavacodedev note.
* DELETE support for contacts | Rebilly_rebilly-php | train | php |
82a4b4977a7993644efcc097978034884288842c | diff --git a/src/pyforce/marshall.py b/src/pyforce/marshall.py
index <HASH>..<HASH> 100644
--- a/src/pyforce/marshall.py
+++ b/src/pyforce/marshall.py
@@ -15,7 +15,7 @@ datetimeregx = re.compile(
doubleregx = re.compile(r'^(\d)+(\.\d+)?$')
stringtypes = ('string', 'id', 'phone', 'url', 'email',
- 'anyType', 'picklist', 'reference', 'encryptedstring')
+ 'anyType', 'picklist', 'reference', 'encryptedstring')
texttypes = ('textarea')
@@ -140,8 +140,8 @@ register('base64', base64Marshaller)
def dictMarshaller(fieldname, xml, ns):
mydict = {}
- for x in xml[getattr(ns,fieldname)]:
- mydict[x._name[1]] = x.__str__()
+ for key in xml[getattr(ns, fieldname)]:
+ mydict[key._name[1]] = key.__str__()
return mydict
register(dicttypes, dictMarshaller) | Some recently added code did not follow pep8 standard. Fixed | alanjcastonguay_pyforce | train | py |
f522bf51be82f4aa965f93b75e5b0f113cf81f0d | diff --git a/mod/quiz/report/reportlib.php b/mod/quiz/report/reportlib.php
index <HASH>..<HASH> 100644
--- a/mod/quiz/report/reportlib.php
+++ b/mod/quiz/report/reportlib.php
@@ -163,12 +163,13 @@ function quiz_report_qm_filter_subselect($quiz, $useridsql = 'u.id'){
}
function quiz_report_grade_bands($bandwidth, $bands, $quizid, $useridlist){
+ global $CFG;
$sql = "SELECT
FLOOR(qg.grade/$bandwidth) AS band,
COUNT(1) AS num
FROM
- mdl_quiz_grades qg,
- mdl_quiz q
+ {$CFG->prefix}quiz_grades qg,
+ {$CFG->prefix}quiz q
WHERE qg.quiz = q.id AND qg.quiz = $quizid AND qg.userid IN ($useridlist)
GROUP BY band
ORDER BY band"; | MDL-<I> "tables have been hardcoded with a prefix of "mdl" - causing an error." Ooops! | moodle_moodle | train | php |
95a682918f1b8a00724167c9c478cab48a536e57 | diff --git a/demos/node/demo.js b/demos/node/demo.js
index <HASH>..<HASH> 100644
--- a/demos/node/demo.js
+++ b/demos/node/demo.js
@@ -101,8 +101,9 @@ else {
// EXAMPLE 2: Use an inline callback function
pptx.writeFile(exportName+'-ex2')
- .catch(ex => { console.log('ERROR: '+err) })
- .then(fileName => { console.log('Ex2 inline callback exported: '+fileName); } );
+ .catch(err => {throw err})
+ .then(fileName => { console.log('Ex2 inline callback exported: '+fileName); } )
+ .catch(err => { console.log('ERROR: '+err) });
// EXAMPLE 3: Use defined callback function
//pptx.save( exportName+'-ex3', saveCallback ); | node demo runs now (no ppt yet though) | gitbrent_PptxGenJS | train | js |
45572a28635e63559dcc3b60c30c6ce09acb0a90 | diff --git a/remote.go b/remote.go
index <HASH>..<HASH> 100644
--- a/remote.go
+++ b/remote.go
@@ -51,7 +51,7 @@ func (r *Remote) Connect() error {
var err error
r.fetchSession, err = r.client.NewFetchPackSession(r.endpoint)
if err != nil {
- return nil
+ return err
}
return r.retrieveAdvertisedReferences()
diff --git a/remote_test.go b/remote_test.go
index <HASH>..<HASH> 100644
--- a/remote_test.go
+++ b/remote_test.go
@@ -44,6 +44,13 @@ func (s *RemoteSuite) TestnewRemoteInvalidEndpoint(c *C) {
c.Assert(err, NotNil)
}
+func (s *RemoteSuite) TestnewRemoteNonExistentEndpoint(c *C) {
+ r := newRemote(nil, nil, &config.RemoteConfig{Name: "foo", URL: "ssh://non-existent/foo.git"})
+
+ err := r.Connect()
+ c.Assert(err, NotNil)
+}
+
func (s *RemoteSuite) TestnewRemoteInvalidSchemaEndpoint(c *C) {
r := newRemote(nil, nil, &config.RemoteConfig{Name: "foo", URL: "qux://foo"}) | remote: fix Connect, returned nil error on failure. (#<I>) | src-d_go-git | train | go,go |
5faaa5957abee743e2bbf38341e32bcc9ae1f059 | diff --git a/tests/Doctrine/MongoDB/Tests/CollectionTest.php b/tests/Doctrine/MongoDB/Tests/CollectionTest.php
index <HASH>..<HASH> 100644
--- a/tests/Doctrine/MongoDB/Tests/CollectionTest.php
+++ b/tests/Doctrine/MongoDB/Tests/CollectionTest.php
@@ -312,7 +312,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
}
/**
- * @covers Collection::getIndexInfo
+ * @covers Doctrine\MongoDB\Collection::getIndexInfo
* @dataProvider provideIsFieldIndex
*/
public function testIsFieldIndexed($indexInfo, $field, $expectedResult) | Use FQCN in code coverage annotation | doctrine_mongodb | train | php |
7f52e0f0d1731173d4929ae9d16aa83944ae0433 | diff --git a/lib/filepicker/rails/form_builder.rb b/lib/filepicker/rails/form_builder.rb
index <HASH>..<HASH> 100644
--- a/lib/filepicker/rails/form_builder.rb
+++ b/lib/filepicker/rails/form_builder.rb
@@ -10,7 +10,8 @@ module Filepicker
input_options.merge!(secure_filepicker) unless input_options['data-fp-policy'].present?
input_options['type'] = type
- ActionView::Helpers::Tags::TextField.new(@object_name, method, @template).tag('input', input_options)
+ ActionView::Helpers::InstanceTag.new(@object_name, method, @template).to_input_field_tag(type, input_options)
+
end
private | fix for uninitialized constant ActionView::Helpers::Tags issue #<I> | filestack_filestack-rails | train | rb |
e688603b8d04100f2b17206396f263e00a451152 | diff --git a/newsletter-bundle/src/Resources/contao/dca/tl_newsletter.php b/newsletter-bundle/src/Resources/contao/dca/tl_newsletter.php
index <HASH>..<HASH> 100644
--- a/newsletter-bundle/src/Resources/contao/dca/tl_newsletter.php
+++ b/newsletter-bundle/src/Resources/contao/dca/tl_newsletter.php
@@ -208,7 +208,7 @@ $GLOBALS['TL_DCA']['tl_newsletter'] = array
'label' => &$GLOBALS['TL_LANG']['tl_newsletter']['files'],
'exclude' => true,
'inputType' => 'fileTree',
- 'eval' => array('fieldType'=>'checkbox', 'filesOnly'=>true, 'mandatory'=>true),
+ 'eval' => array('multiple'=>true, 'fieldType'=>'checkbox', 'filesOnly'=>true, 'mandatory'=>true),
'sql' => "blob NULL"
),
'template' => array | [Newsletter] Automatically scan for fileTree fields during the version <I> update | contao_contao | train | php |
5459dcc9f8b53224a5a62aede8c93665a61d81ef | diff --git a/src/main/java/org/jfrog/hudson/maven3/extractor/MavenExtractorEnvironment.java b/src/main/java/org/jfrog/hudson/maven3/extractor/MavenExtractorEnvironment.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jfrog/hudson/maven3/extractor/MavenExtractorEnvironment.java
+++ b/src/main/java/org/jfrog/hudson/maven3/extractor/MavenExtractorEnvironment.java
@@ -109,13 +109,12 @@ public class MavenExtractorEnvironment extends Environment {
}
env.put(ExtractorUtils.EXTRACTOR_USED, "true");
+ ReleaseAction release = ActionableHelper.getLatestAction(build, ReleaseAction.class);
+ if (release != null) {
+ release.addVars(env);
+ }
if (!initialized) {
- ReleaseAction release = ActionableHelper.getLatestAction(build, ReleaseAction.class);
- if (release != null) {
- release.addVars(env);
- }
-
try {
PublisherContext publisherContext = null;
if (publisher != null) { | HAP-<I> - Jenkins plugin: Environment property for Release Tag | jenkinsci_artifactory-plugin | train | java |
248b998cd54a86c100d2ae388ac0d5b4e5657694 | diff --git a/tests/test-timber-image-multisite.php b/tests/test-timber-image-multisite.php
index <HASH>..<HASH> 100644
--- a/tests/test-timber-image-multisite.php
+++ b/tests/test-timber-image-multisite.php
@@ -23,6 +23,10 @@
}
function testSubDomainImageLocaion() {
+ if ( !is_multisite() ) {
+ $this->markTestSkipped('Test is only for Multisite');
+ return;
+ }
$blog_id = $this->createSubDomainSite();
$pretend_image = 'http://example.org/wp-content/2015/08/fake-pic.jpg';
$is_external = TimberURLHelper::is_external_content( $pretend_image );
@@ -30,6 +34,10 @@
}
function testSubDirectoryImageLocaion() {
+ if ( !is_multisite() ) {
+ $this->markTestSkipped('Test is only for Multisite');
+ return;
+ }
$blog_id = $this->createSubDirectorySite();
$blog_details = get_blog_details($blog_id);
print_r($blog_details); | ref #<I> -- Added multisite tests for diff't image handling situations | timber_timber | train | php |
4b55604116a781c82bbc40f0929bc26dd97da675 | diff --git a/includes/mappers/class.matches_mapper.php b/includes/mappers/class.matches_mapper.php
index <HASH>..<HASH> 100644
--- a/includes/mappers/class.matches_mapper.php
+++ b/includes/mappers/class.matches_mapper.php
@@ -198,7 +198,7 @@ abstract class matches_mapper {
*/
public function set_matches_requested($matches_requested) {
$matches_requested = intval($matches_requested);
- if ($matches_requested > 0 && $matches_requested <= 25) {
+ if ($matches_requested > 0 && $matches_requested <= 100) {
$this->_matches_requested = $matches_requested;
}
return $this; | #<I> Update GetMatchHistory limit from <I> to <I> | kronusme_dota2-api | train | php |
e6a3f69d61a49a5d7ae2b053cdd79289e11a8a73 | diff --git a/sundial/fields.py b/sundial/fields.py
index <HASH>..<HASH> 100644
--- a/sundial/fields.py
+++ b/sundial/fields.py
@@ -19,7 +19,7 @@ class TimezoneField(with_metaclass(TimezoneFieldBase, models.CharField)):
kwargs.setdefault('max_length', self.default_max_length)
super(TimezoneField, self).__init__(*args, **kwargs)
- def from_db_value(self, value, connection, context):
+ def from_db_value(self, value, expression, connection, context):
if value:
value = coerce_timezone(value)
return value | Fix compatibility issues in Django <I>. | charettes_django-sundial | train | py |
80a67c99d6c464aa16a83453bbbea619d26c7309 | diff --git a/app/code/community/Webcomm/BootstrapNavigation/Block/Page/Html/Topmenu.php b/app/code/community/Webcomm/BootstrapNavigation/Block/Page/Html/Topmenu.php
index <HASH>..<HASH> 100644
--- a/app/code/community/Webcomm/BootstrapNavigation/Block/Page/Html/Topmenu.php
+++ b/app/code/community/Webcomm/BootstrapNavigation/Block/Page/Html/Topmenu.php
@@ -81,7 +81,7 @@ class Webcomm_BootstrapNavigation_Block_Page_Html_Topmenu extends Mage_Page_Bloc
$suffix = Mage::getStoreConfig('catalog/navigation/top_in_dropdown_suffix');
$html .= '<li class="level1 level-top-in-dropdown">';
$html .= '<a href="'.$child->getUrl().'"><span>';
- $html .= $this->escapeHtml($prefix.' '.$child->getName().' '.$suffix);
+ $html .= $this->escapeHtml($this->__($prefix).' '.$child->getName().' '.$suffix);
$html .= '</span></a>';
$html .= '</li>';
$html .= '<li class="divider"></li>'; | Added translation for menue suffix | webcomm_magento-boilerplate | train | php |
74abd750c5f0061d5249de7e2cca40b00a61c6d6 | diff --git a/Server/Python/src/dbs/business/DBSBlockInsert.py b/Server/Python/src/dbs/business/DBSBlockInsert.py
index <HASH>..<HASH> 100644
--- a/Server/Python/src/dbs/business/DBSBlockInsert.py
+++ b/Server/Python/src/dbs/business/DBSBlockInsert.py
@@ -387,8 +387,13 @@ class DBSBlockInsert :
conn = self.dbi.connection()
# First, check and see if the dataset exists.
- datasetID = self.datasetid.execute(conn, dataset['dataset'])
- dataset['dataset_id'] = datasetID
+ try:
+ datasetID = self.datasetid.execute(conn, dataset['dataset'])
+ dataset['dataset_id'] = datasetID
+ except KeyError, ex:
+ dbsExceptionHandler("dbsException-invalid-input", "DBSBlockInsert/InsertDataset: Dataset is required.\
+ Exception: %s. troubled dataset are: %s" %(ex.args[0], dataset) )
+ if conn:conn.close()
if datasetID > 0:
# Then we already have a valid dataset. We only need to fill the map (dataset & output module config)
# Skip to the END | Catch exception when dataset is missing during dataset insertion. YG
From: yuyi <<EMAIL>>
git-svn-id: svn+ssh://svn.cern.ch/reps/CMSDMWM/DBS/trunk@<I> <I>e-<I>-<I>b1-a<I>-d<I>a<I>b | dmwm_DBS | train | py |
e9456c2d477dbab45c97b4381a37f7daceab0f2e | diff --git a/tests/TestCase/ORM/QueryTest.php b/tests/TestCase/ORM/QueryTest.php
index <HASH>..<HASH> 100644
--- a/tests/TestCase/ORM/QueryTest.php
+++ b/tests/TestCase/ORM/QueryTest.php
@@ -1973,4 +1973,18 @@ class QueryTest extends TestCase {
$this->assertNull($article['articles_tag']);
}
+
+/**
+ * Tests that queries can be serialized to json to get the results
+ *
+ * @return void
+ */
+ public function testJsonSerialize() {
+ $table = TableRegistry::get('Articles');
+ $this->assertEquals(
+ json_encode($table->find()),
+ json_encode($table->find()->toArray())
+ );
+ }
+
} | Adding tests for serializing a query to json | cakephp_cakephp | train | php |
58ff4ac8dbbbd5bb52e825c538621ec422793971 | diff --git a/lib/generators/sorcery/helpers.rb b/lib/generators/sorcery/helpers.rb
index <HASH>..<HASH> 100644
--- a/lib/generators/sorcery/helpers.rb
+++ b/lib/generators/sorcery/helpers.rb
@@ -13,7 +13,7 @@ module Sorcery
end
def tableized_model_class
- options[:model] ? options[:model].gsub(/::/, '').tableize : 'User'
+ options[:model] ? options[:model].gsub(/::/, '').tableize : 'users'
end
def model_path | Fix default table name being incorrect in migration generator (#<I>) | Sorcery_sorcery | train | rb |
f2fa23431034c4d33c690120a12e10594e562e45 | diff --git a/zengine/views/crud.py b/zengine/views/crud.py
index <HASH>..<HASH> 100644
--- a/zengine/views/crud.py
+++ b/zengine/views/crud.py
@@ -329,15 +329,15 @@ class CrudView(BaseView):
:param query:
:return: query
"""
- filters = self.Meta.allow_filters and self.input.get('filters') or self.req.params
+ filters = self.Meta.allow_filters and self.input.get('filters')
if filters:
- for k, v in filters.items():
- if k == 'query': # workaround
- continue
- if ',' in v: # handle multiple selection
- query = query.filter(**{'%__in' % k: v.split(',')})
+ for fltr in filters:
+ if fltr.get('type') == 'date':
+ start = fltr['values'][0]
+ end = fltr['values'][1]
+ query = query.filter(**{'%s__range' % fltr['field']: (start, end)})
else:
- query = query.filter(**{k: v})
+ query = query.filter(**{'%s__in' % fltr['field']: fltr['values']})
return query
@list_query | refactored _apply_list_filters method and added date filter support | zetaops_zengine | train | py |
5f82207491618b261310a9975614e7cf29e11ecb | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -11,8 +11,11 @@ ez_setup.use_setuptools()
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
-README = open(os.path.join(here, 'README.rst')).read()
-NEWS = open(os.path.join(here, 'NEWS.txt')).read()
+with open(os.path.join(here, 'README.rst')) as file_readme:
+ README = file_readme.read()
+
+with open(os.path.join(here, 'NEWS.txt')) as file_news:
+ NEWS = file_news.read()
# from mpld3 | Ensure file handles are closed using with statement | brentp_toolshed | train | py |
1ae52dab8357f1e5780e1e07109e3e287598365a | diff --git a/rkt/stage1hash.go b/rkt/stage1hash.go
index <HASH>..<HASH> 100644
--- a/rkt/stage1hash.go
+++ b/rkt/stage1hash.go
@@ -82,7 +82,7 @@ func getStage1Hash(s *store.Store, cmd *cobra.Command) (*types.Hash, error) {
imageActionData: imageActionData{
s: s,
},
- storeOnly: true,
+ storeOnly: false,
noStore: false,
withDeps: false,
}
@@ -118,7 +118,9 @@ func getDefaultStage1HashFromStore(fn *finder) *types.Hash {
// otherwise we don't know if something changed
if !strings.HasSuffix(defaultStage1Version, "-dirty") {
stage1AppName := fmt.Sprintf("%s:%s", defaultStage1Name, defaultStage1Version)
+ fn.storeOnly = true
s1img, _ := fn.findImage(stage1AppName, "")
+ fn.storeOnly = false
return s1img
}
return nil | rkt: stage1hash: make storeOnly false by default
This was causing URL values in `--stage1-image` to fail. Now we set it
to true only when needed. | rkt_rkt | train | go |
ed3b712483696c73b8202ef51cc191b3c4493f35 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -183,12 +183,14 @@ function handleApp(appHost){
return loader.loadModule(configModuleId)
.then(m => {
aurelia = new Aurelia(loader);
+ aurelia.host = appHost;
return configureAurelia(aurelia).then(() => { return m.configure(aurelia); });
}).catch(e => {
setTimeout(function(){ throw e; }, 0);
});
}else{
aurelia = new Aurelia();
+ aurelia.host = appHost;
return configureAurelia(aurelia).then(() => {
if(runningLocally()){
@@ -197,7 +199,7 @@ function handleApp(appHost){
aurelia.use.standardConfiguration();
- return aurelia.start().then(a => { return a.setRoot(undefined, appHost); });
+ return aurelia.start().then(a => a.setRoot());
}).catch(e => {
setTimeout(function(){ throw e; }, 0);
}); | fix(all): root should default to aurelia-app host when not specified
Fixes #5 | aurelia_bootstrapper | train | js |
afbd998247742754fd8538721cb900c06a18912c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -14,7 +14,7 @@ setup(
keywords='graph neo4j py2neo ORM',
tests_require=['nose==1.1.2'],
test_suite='nose.collector',
- install_requires=['lucene-querybuilder==0.1.6', 'py2neo==1.4.6', 'pytz==2012j'],
+ install_requires=['lucene-querybuilder==0.1.6', 'py2neo==1.5', 'pytz==2012j'],
classifiers=[
"Development Status :: 5 - Production/Stable",
'Intended Audience :: Developers', | bump py2neo version | neo4j-contrib_neomodel | train | py |
74a563189651ab78240f3b3ee68d7723c48bf390 | diff --git a/m2r.py b/m2r.py
index <HASH>..<HASH> 100644
--- a/m2r.py
+++ b/m2r.py
@@ -228,7 +228,7 @@ class RestRenderer(mistune.Renderer):
elif lang:
first_line = '\n.. code-block:: {}\n\n'.format(lang)
elif _is_sphinx:
- first_line = '\n.. code-block:: guess\n\n'
+ first_line = '\n::\n\n'
else:
first_line = '\n.. code-block::\n\n'
return first_line + self._indent_block(code) + '\n' | Use reST literal block for Sphinx code block
This lets language be managed by Sphinx config option 'highlight_language'. | miyakogi_m2r | train | py |
32e295b65303eb31b840343fe59f6353ed0d6f66 | diff --git a/html/utilities/validation/isValidMonetary.js b/html/utilities/validation/isValidMonetary.js
index <HASH>..<HASH> 100644
--- a/html/utilities/validation/isValidMonetary.js
+++ b/html/utilities/validation/isValidMonetary.js
@@ -1,4 +1,4 @@
-let isValidMonetary = (value) => {
+const isValidMonetary = (value) => {
const expression = /(^\$?(\d+|\d{1,3}(,\d{3})*)(\.\d+)?$)|^$/;
return expression.test(value);
} | Updated isValidMonetary to be an arrow function | sparkdesignsystem_spark-design-system | train | js |
ff35f2f2be438e6dd1cbc3870dcb3d40979f3613 | diff --git a/ftpd.rb b/ftpd.rb
index <HASH>..<HASH> 100644
--- a/ftpd.rb
+++ b/ftpd.rb
@@ -301,8 +301,8 @@ class FTPServer < EM::Protocols::LineAndTextProtocol
puts "connecting to client #{host} on #{port}"
@datasocket = FTPActiveDataSocket.open(host, port)
- puts "Opened passive connection at #{host}:#{port}"
- send_response "200 Passive connection established (#{port})"
+ puts "Opened active connection at #{host}:#{port}"
+ send_response "200 Connection established (#{port})"
rescue
puts "Error opening data connection to #{host}:#{port}"
send_response "425 Data connection failed" | log message fix: PORT starts an active session, not a passive one | yob_em-ftpd | train | rb |
8f671e94e3edde8d022654ce4e612af3e85855df | diff --git a/app/src/Bolt/Application.php b/app/src/Bolt/Application.php
index <HASH>..<HASH> 100644
--- a/app/src/Bolt/Application.php
+++ b/app/src/Bolt/Application.php
@@ -35,8 +35,8 @@ class Application extends BaseApplication
{
public function __construct(array $values = array())
{
- $values['bolt_version'] = '1.0.0';
- $values['bolt_name'] = '';
+ $values['bolt_version'] = '1.1';
+ $values['bolt_name'] = 'prerelease';
parent::__construct($values);
} | Bumping version number to "<I> prerelease" | bolt_bolt | train | php |
c9edd41710aff78615e75983344123929df40a53 | diff --git a/lib/vestal_versions/versions.rb b/lib/vestal_versions/versions.rb
index <HASH>..<HASH> 100644
--- a/lib/vestal_versions/versions.rb
+++ b/lib/vestal_versions/versions.rb
@@ -3,6 +3,7 @@ module VestalVersions
def between(from, to)
from_number, to_number = number_at(from), number_at(to)
return [] if from_number.nil? || to_number.nil?
+
condition = (from_number == to_number) ? to_number : Range.new(*[from_number, to_number].sort)
all(
:conditions => {:number => condition},
@@ -12,20 +13,20 @@ module VestalVersions
def at(value)
case value
- when Version then value
- when Numeric then find_by_number(value.floor)
when Date, Time then last(:conditions => ["#{aliased_table_name}.created_at <= ?", value.to_time])
- when Symbol then respond_to?(value) ? send(value) : nil
+ when Numeric then find_by_number(value.floor)
when String then first(:conditions => {:tag => value})
+ when Symbol then respond_to?(value) ? send(value) : nil
+ when Version then value
end
end
def number_at(value)
case value
- when Version then value.number
- when Numeric then value.floor
when Date, Time then at(value).try(:number) || 1
- when Symbol, String then at(value).try(:number)
+ when Numeric then value.floor
+ when String, Symbol then at(value).try(:number)
+ when Version then value.number
end
end
end | Just cleaned up the versions association methods. | laserlemon_vestal_versions | train | rb |
29f10f277179f89082e0e9bd43bb942b7d04da9e | diff --git a/telethon/telegram_client.py b/telethon/telegram_client.py
index <HASH>..<HASH> 100644
--- a/telethon/telegram_client.py
+++ b/telethon/telegram_client.py
@@ -1281,7 +1281,8 @@ class TelegramClient(TelegramBareClient):
def send_voice_note(self, *args, **kwargs):
"""Wrapper method around .send_file() with is_voice_note=True"""
- return self.send_file(*args, **kwargs, is_voice_note=True)
+ kwargs['is_voice_note'] = True
+ return self.send_file(*args, **kwargs)
def _send_album(self, entity, files, caption=None,
progress_callback=None, reply_to=None): | Fix named arguments after kwargs (#<I>)
In Python3, you're unable to send named parameters after **kwargs
* Use single quotes | LonamiWebs_Telethon | train | py |
63605e1f5325291200293785765eaa0306a8f024 | diff --git a/locationpicker.jquery.js b/locationpicker.jquery.js
index <HASH>..<HASH> 100644
--- a/locationpicker.jquery.js
+++ b/locationpicker.jquery.js
@@ -146,16 +146,16 @@
if (!inputBinding) return;
var currentLocation = GmUtility.locationFromLatLng(gmapContext.location);
if (inputBinding.latitudeInput) {
- inputBinding.latitudeInput.val(currentLocation.latitude);
+ inputBinding.latitudeInput.val(currentLocation.latitude).change();
}
if (inputBinding.longitudeInput) {
- inputBinding.longitudeInput.val(currentLocation.longitude);
+ inputBinding.longitudeInput.val(currentLocation.longitude).change();
}
if (inputBinding.radiusInput) {
- inputBinding.radiusInput.val(gmapContext.radius);
+ inputBinding.radiusInput.val(gmapContext.radius).change();
}
if (inputBinding.locationNameInput) {
- inputBinding.locationNameInput.val(gmapContext.locationName);
+ inputBinding.locationNameInput.val(gmapContext.locationName).change();
}
} | Update: fire change event on bound input changes | Logicify_jquery-locationpicker-plugin | train | js |
5f7ad743cb53870275290b375082ee9ea6080e99 | diff --git a/src/main/java/com/lazerycode/jmeter/JMeterMojo.java b/src/main/java/com/lazerycode/jmeter/JMeterMojo.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/lazerycode/jmeter/JMeterMojo.java
+++ b/src/main/java/com/lazerycode/jmeter/JMeterMojo.java
@@ -42,6 +42,11 @@ public class JMeterMojo extends JMeterAbstractMojo {
List<String> testResults = jMeterTestManager.executeTests();
new ReportGenerator(this.reportConfig).makeReport(testResults);
parseTestResults(testResults);
+
+ // JMeter sets this system property. to "org.apache.commons.logging.impl.LogKitLogger".
+ // If another plugin is executed after this plugin that also uses (a third-party library that uses) commons-logging, but doesn't supply the same logger, execution will fail.
+ // TODO: may not work if SecurityManager is enabled. Needs PropertyPermission "key", "read,write" to work.
+ System.clearProperty("org.apache.commons.logging.Log");
}
/** | clear system property "org.apache.commons.logging.Log" at the end of the test run | jmeter-maven-plugin_jmeter-maven-plugin | train | java |
3a623f8d51df1f35c750babd393fa87ec25040f9 | diff --git a/src/main/java/com/google/maps/model/DirectionsStep.java b/src/main/java/com/google/maps/model/DirectionsStep.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/google/maps/model/DirectionsStep.java
+++ b/src/main/java/com/google/maps/model/DirectionsStep.java
@@ -44,6 +44,7 @@ public class DirectionsStep {
/**
* {@code distance} contains the distance covered by this step until the next step.
*/
+ @Deprecated
public Distance distance;
/** | Adding @Deprecated since feature is not officially documented. | googlemaps_google-maps-services-java | train | java |
4f92a108472845afe0dc1b604b59003b3b14dc8b | diff --git a/lib/slanger/channel.rb b/lib/slanger/channel.rb
index <HASH>..<HASH> 100644
--- a/lib/slanger/channel.rb
+++ b/lib/slanger/channel.rb
@@ -16,8 +16,9 @@ module Slanger
def_delegators :channel, :subscribe, :unsubscribe, :push
- def self.from channel
- channel[/^presence-/] ? PresenceChannel : Channel
+ def self.from channel_id
+ klass = channel_id[/^presence-/] ? PresenceChannel : Channel
+ klass.find_or_create_by_channel_id channel_id
end
def initialize(attrs)
diff --git a/lib/slanger/redis.rb b/lib/slanger/redis.rb
index <HASH>..<HASH> 100644
--- a/lib/slanger/redis.rb
+++ b/lib/slanger/redis.rb
@@ -11,8 +11,8 @@ module Slanger
# Dispatch messages received from Redis to their destination channel.
base.on(:message) do |channel, message|
message = JSON.parse message
- klass = Channel.from message['channel']
- klass.find_or_create_by_channel_id(message['channel']).dispatch message, channel
+ c = Channel.from message['channel']
+ c.dispatch message, channel
end
end | moved more logic into Channel class from Redis | stevegraham_slanger | train | rb,rb |
f8e8c85ba7b095c5941af629e6b93743f1f3efd2 | diff --git a/src/Model/Behavior/ProfferBehavior.php b/src/Model/Behavior/ProfferBehavior.php
index <HASH>..<HASH> 100644
--- a/src/Model/Behavior/ProfferBehavior.php
+++ b/src/Model/Behavior/ProfferBehavior.php
@@ -118,6 +118,8 @@ class ProfferBehavior extends Behavior
$path->deleteFiles($path->getFolder(), true);
}
+
+ unset($path);
}
return true; | Resolves #<I> | davidyell_CakePHP3-Proffer | train | php |
2c8b72de8d2b9e49a09a0c0e55a4a50c79f1e0d7 | diff --git a/src/Options.php b/src/Options.php
index <HASH>..<HASH> 100644
--- a/src/Options.php
+++ b/src/Options.php
@@ -34,6 +34,7 @@ class Options
public function __construct()
{
$this->headers = [];
+ $this->useComplexClientType();
}
/** | Defined default client type into constructor | g4code_gateway | train | php |
34d640ed3332ef5ea31b8edd43d4df770b47c1c9 | diff --git a/lib/AbstractObject.php b/lib/AbstractObject.php
index <HASH>..<HASH> 100644
--- a/lib/AbstractObject.php
+++ b/lib/AbstractObject.php
@@ -22,6 +22,7 @@ abstract class AbstractObject {
public $elements = array ();
public $default_exception='BaseException';
+ public $settings=array('extension'=>'.html');
/* Configuration passed as a 2nd argument/array to add. Useful for dependency injection */
public $di_config = array();
@@ -240,6 +241,9 @@ abstract class AbstractObject {
}
$e=new $type($message);
+ $e->owner=$this;
+ $e->api=$this->api;
+ $e->init();
return $e;
}
function fatal($error, $shift = 0) { | Improve system-wide support for exception() | atk4_atk4 | train | php |
90e95cf8d413db454cab7d906fc889120a0ce502 | diff --git a/opal/corelib/array.rb b/opal/corelib/array.rb
index <HASH>..<HASH> 100644
--- a/opal/corelib/array.rb
+++ b/opal/corelib/array.rb
@@ -440,6 +440,14 @@ class Array < `Array`
end
end
+ def any?
+ if empty?
+ false
+ else
+ super
+ end
+ end
+
def assoc(object)
%x{
for (var i = 0, length = self.length, item; i < length; i++) { | Optimize Array#any? for an empty array (#<I>)
If an array is empty, we know `any?` cannot possibly return false.
Otherwise, fall back to the `Enumerable` implementation of the method. | opal_opal | train | rb |
ee05582d1e5579a52754f47ba8c6d6f8fabe0f45 | diff --git a/binstar_client/inspect_package/conda.py b/binstar_client/inspect_package/conda.py
index <HASH>..<HASH> 100644
--- a/binstar_client/inspect_package/conda.py
+++ b/binstar_client/inspect_package/conda.py
@@ -127,9 +127,15 @@ def inspect_conda_package(filename, fileobj, *args, **kwargs):
package_data = {
'name': index.pop('name'),
+ # TODO: this info should be removed and moved to release
'summary': about.get('summary', ''),
- 'license': about.get('license'),
'description': about.get('description', ''),
+ 'license': about.get('license'),
+ 'license_url': about.get('license_url'),
+ 'dev_url': about.get('dev_url'),
+ 'doc_url': about.get('doc_url'),
+ 'home': about.get('home'),
+ 'source_git_url': about.get('source_git_url'),
}
release_data = {
'version': index.pop('version'), | reverted some fields for backward compatibility | Anaconda-Platform_anaconda-client | train | py |
b89a734c5d16328e21306bccb1fd454f257d9f7c | diff --git a/packages/ui-babel-preset/lib/index.js b/packages/ui-babel-preset/lib/index.js
index <HASH>..<HASH> 100644
--- a/packages/ui-babel-preset/lib/index.js
+++ b/packages/ui-babel-preset/lib/index.js
@@ -74,7 +74,6 @@ module.exports = function (
}
])
}
-
// Work around https://github.com/babel/babel/issues/10261, which causes
// Babel to not use the runtime helpers for things like _objectSpread.
// Remove this once that babel issue is fixed
@@ -107,8 +106,7 @@ module.exports = function (
}
],
require('@babel/plugin-syntax-dynamic-import').default,
- require('babel-plugin-transform-undefined-to-void'),
- require('babel-plugin-add-import-extension')
+ require('babel-plugin-transform-undefined-to-void')
])
if (process.env.NODE_ENV === 'production') { | chore(ui-babel-preset): remove babel-plugin-add-import-extension
Closes: INSTUI-<I>
Removed babel-plugin-add-import-extension becuase it interfered with webpack since we are using the
babel-loader to transpile ts files on the fly and this plugin injected .js extensions to the
imports. | instructure_instructure-ui | train | js |
9c58d048ec4af8a35b680a5654c2a18985704f8b | diff --git a/datasette/views/table.py b/datasette/views/table.py
index <HASH>..<HASH> 100644
--- a/datasette/views/table.py
+++ b/datasette/views/table.py
@@ -629,6 +629,8 @@ class TableView(RowTableShared):
# If there's a sort or sort_desc, add that value as a prefix
if (sort or sort_desc) and not is_view:
prefix = rows[-2][sort or sort_desc]
+ if isinstance(prefix, dict) and "value" in prefix:
+ prefix = prefix["value"]
if prefix is None:
prefix = "$null"
else:
diff --git a/tests/test_api.py b/tests/test_api.py
index <HASH>..<HASH> 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -753,6 +753,8 @@ def test_table_with_reserved_word_name(app_client):
("/fixtures/123_starts_with_digits.json", 0, 1),
# Ensure faceting doesn't break pagination:
("/fixtures/compound_three_primary_keys.json?_facet=pk1", 1001, 21),
+ # Paginating while sorted by an expanded foreign key should work
+ ("/fixtures/roadside_attraction_characteristics.json?_size=2&_sort=attraction_id&_labels=on", 5, 3),
],
)
def test_paginate_tables_and_views(app_client, path, expected_rows, expected_pages): | Fix pagination when sorted by expanded foreign key
Closes #<I> | simonw_datasette | train | py,py |
37ca522bebe93fdf3934413bf1df7b6cccc8c5f7 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -15,11 +15,12 @@ function makeDictionary() {
cache['_dict'] = null;
delete cache['_dict'];
-
return cache;
}
function Funnel(inputTree, options) {
+ if (!(this instanceof Funnel)) { return new Funnel(inputTree, options); }
+
this.inputTree = inputTree;
this._includeFileCache = makeDictionary(); | Don't require "new"
Broccoli plugins typically call "new" on themselves when called as a
plain function. | broccolijs_broccoli-funnel | train | js |
e8ac2ff36044ea4d2522dd75b71fa425bf4b4fb3 | diff --git a/lib/ronin/model/types/description.rb b/lib/ronin/model/types/description.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/model/types/description.rb
+++ b/lib/ronin/model/types/description.rb
@@ -48,7 +48,7 @@ module Ronin
else
sanitized_lines = []
- value.each_line do |line|
+ value.to_s.each_line do |line|
sanitized_lines << line.strip
end | Convert the value to a String before calling each_line. | ronin-ruby_ronin | train | rb |
0e7096bd2d9a1de0d418221332125185986ec68e | diff --git a/utils.py b/utils.py
index <HASH>..<HASH> 100644
--- a/utils.py
+++ b/utils.py
@@ -106,7 +106,19 @@ def recursive_zip(zipf, directory, folder = ""):
elif os.path.isdir(os.path.join(directory, item)):
recursive_zip(zipf, os.path.join(directory, item),
os.path.join(folder, item))
-
+
+def suggestedArticleTypes():
+ '''Returns a list of suggested values for article-type'''
+ #See http://dtd.nlm.nih.gov/publishing/tag-library/3.0/n-w2d0.html
+ s = ['abstract', 'addendum', 'announcement', 'article-commentary',
+ 'book-review', 'books-received', 'brief-report', 'calendar',
+ 'case-report', 'collection', 'correction', 'discussion',
+ 'dissertation', 'editorial', 'in-brief', 'introduction', 'letter',
+ 'meeting-report', 'news', 'obituary', 'oration',
+ 'partial-retraction', 'product-review', 'rapid-communication',
+ 'rapid-communication', 'reply', 'reprint', 'research-article',
+ 'retraction', 'review-article', 'translation']
+ return(s)
def initiateDocument(titlestring,
_publicId = '-//W3C//DTD XHTML 1.1//EN', | Created suggestedArticleTypes() which returns a list of suggest values for the article-type attribute | SavinaRoja_OpenAccess_EPUB | train | py |
56683a45150a092e8dcff186b5568c440ba7b1e3 | diff --git a/core/tasks/static-generator.js b/core/tasks/static-generator.js
index <HASH>..<HASH> 100644
--- a/core/tasks/static-generator.js
+++ b/core/tasks/static-generator.js
@@ -132,8 +132,8 @@ module.exports = class {
convertCacheBusters(content_) {
let content = content_;
- content = content.replace(/((href|src)\s*=\s*"[^"]*)\?\d*/gi, '$1');
- content = content.replace(/((href|src)\s*=\s*'[^']*)\?\d*/gi, '$1');
+ content = content.replace(/((href|src)\s*=\s*"[^"]*)\?\d+/gi, '$1');
+ content = content.replace(/((href|src)\s*=\s*'[^']*)\?\d+/gi, '$1');
return content;
} | fixing static generator removal of cacheBusters | electric-eloquence_fepper-npm | train | js |
dee9834b2101952bc3cec9eae434e644a2ccdce7 | diff --git a/architect.js b/architect.js
index <HASH>..<HASH> 100644
--- a/architect.js
+++ b/architect.js
@@ -283,10 +283,13 @@ function startContainers(config, callback) {
var Agent = require('architect-agent').Agent;
var socketTransport = require('architect-socket-transport');
+ var env = process.env || {};
+ env.ARCHITECT_CONTAINER_NAME = name;
+
var child = spawn(process.execPath, [require.resolve('./worker-process.js')], {
customFds: [-1, 1, 2],
stdinStream: createPipe(true),
- env: { ARCHITECT_CONTAINER_NAME: name }
+ env: env
});
var transport = socketTransport(child.stdin); | Pass environment variables to the spawned container | c9_architect | train | js |
1903dc6e9bd9869c1deef586aaaee64b820b4d1e | diff --git a/plugins/Live/VisitorLog.php b/plugins/Live/VisitorLog.php
index <HASH>..<HASH> 100644
--- a/plugins/Live/VisitorLog.php
+++ b/plugins/Live/VisitorLog.php
@@ -20,7 +20,7 @@ use Piwik\View;
*/
class VisitorLog extends Visualization
{
- const ID = '\Piwik\Plugins\Live\VisitorLog';
+ const ID = '\\Piwik\\Plugins\\Live\\VisitorLog';
const TEMPLATE_FILE = "@Live/_dataTableViz_visitorLog.twig";
public function beforeLoadDataTable() | Trying fix for error reported in forums <URL> | matomo-org_matomo | train | php |
7bf37937fc6dfa29e7feabaa478c4d57f7c8ef0d | diff --git a/bundles/org.eclipse.orion.client.core/web/orion/preferences.js b/bundles/org.eclipse.orion.client.core/web/orion/preferences.js
index <HASH>..<HASH> 100644
--- a/bundles/org.eclipse.orion.client.core/web/orion/preferences.js
+++ b/bundles/org.eclipse.orion.client.core/web/orion/preferences.js
@@ -223,7 +223,7 @@ define(['require', 'dojo', 'orion/auth', 'dojo/DeferredList'], function(require,
function UserPreferencesProvider(serviceRegistry) {
this._currentPromises = {};
- this._cache = new Cache("/orion/preferences/user", 0);
+ this._cache = new Cache("/orion/preferences/user", 60*60);
this._service = null;
this.available = function() { | Making user preferences cache for 1 hour. We still need the logout to reset preferences in M2. | eclipse_orion.client | train | js |
6af4905131979f5b051ace0e3850ab555e964080 | diff --git a/spec/unit/knife_spec.rb b/spec/unit/knife_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/knife_spec.rb
+++ b/spec/unit/knife_spec.rb
@@ -33,7 +33,10 @@ describe Chef::Knife do
let(:config_location) { File.expand_path("~/.chef/config.rb") }
let(:config_loader) do
- instance_double("WorkstationConfigLoader", load: nil, no_config_found?: false, config_location: config_location)
+ instance_double("WorkstationConfigLoader",
+ load: nil, no_config_found?: false,
+ config_location: config_location,
+ :chef_config_dir => "/etc/chef")
end
before(:each) do | Fixed knife_spec unit test
This is failing on both my and btm's machine. No idea how it passes
in other places. | chef_chef | train | rb |
0a04a73ed431a5bf0b13b13712df25039b2fd531 | diff --git a/src/Spotlight.js b/src/Spotlight.js
index <HASH>..<HASH> 100644
--- a/src/Spotlight.js
+++ b/src/Spotlight.js
@@ -52,10 +52,12 @@ class Spotlight extends Base {
componentDidMount() {
const handleSelectedIndexChanged = event => {
+ this[symbols.raiseChangeEvents] = true;
const selectedIndex = event.detail.selectedIndex;
if (this.selectedIndex !== selectedIndex) {
this.selectedIndex = selectedIndex;
}
+ this[symbols.raiseChangeEvents] = false;
};
this.$.stage.addEventListener('selected-index-changed', handleSelectedIndexChanged);
this.$.cast.addEventListener('selected-index-changed', handleSelectedIndexChanged);
@@ -65,7 +67,7 @@ class Spotlight extends Base {
}
componentDidUpdate(previousState) {
- if (super.componentDidMount) { super.componentDidMount(); }
+ if (super.componentDidUpdate) { super.componentDidUpdate(previousState); }
updateDefaultCast(this);
} | Ensure Spotlight raises change events when either inner element is manipulated by user. | elix_elix | train | js |
c248cf0fc3e9086e8da167a79efcd7e506220459 | diff --git a/app/code/community/Nexcessnet/Turpentine/Block/Core/Messages.php b/app/code/community/Nexcessnet/Turpentine/Block/Core/Messages.php
index <HASH>..<HASH> 100644
--- a/app/code/community/Nexcessnet/Turpentine/Block/Core/Messages.php
+++ b/app/code/community/Nexcessnet/Turpentine/Block/Core/Messages.php
@@ -254,7 +254,8 @@ class Nexcessnet_Turpentine_Block_Core_Messages extends Mage_Core_Block_Messages
$this->_loadMessagesFromStorage( $storage );
}
} else {
- $this->_loadMessagesFromStorage( 'core/session' );
+ $storage = 'core/session';
+ $this->_loadMessagesFromStorage( $storage );
}
}
@@ -343,7 +344,8 @@ class Nexcessnet_Turpentine_Block_Core_Messages extends Mage_Core_Block_Messages
* @return boolean
*/
protected function _isEsiRequest() {
- return is_subclass_of( Mage::app()->getRequest(),
- 'Nexcessnet_Turpentine_Model_Dummy_Request' );
+ $result = (bool)preg_match( '~/turpentine/esi/getBlock/~',
+ $_SERVER['SCRIPT_URL'] );
+ return $result;
}
} | make _isEsiRequest more reliable | nexcess_magento-turpentine | train | php |
9dc2ee548df71cbfc46286804d17968a35d8d53e | diff --git a/mod/lti/locallib.php b/mod/lti/locallib.php
index <HASH>..<HASH> 100644
--- a/mod/lti/locallib.php
+++ b/mod/lti/locallib.php
@@ -4013,7 +4013,7 @@ function get_tool_type_icon_url(stdClass $type) {
}
if (empty($iconurl)) {
- $iconurl = $OUTPUT->image_url('icon', 'lti')->out();
+ $iconurl = $OUTPUT->image_url('monologo', 'lti')->out();
}
return $iconurl;
@@ -4100,7 +4100,7 @@ function get_tool_proxy_urls(stdClass $proxy) {
global $OUTPUT;
$urls = array(
- 'icon' => $OUTPUT->image_url('icon', 'lti')->out(),
+ 'icon' => $OUTPUT->image_url('monologo', 'lti')->out(),
'edit' => get_tool_proxy_edit_url($proxy),
); | MDL-<I> mod_lti: Update use of logo to monologo | moodle_moodle | train | php |
14f7789266168358b06cf9c393afb33fd8d3fe02 | diff --git a/lib/smpp.js b/lib/smpp.js
index <HASH>..<HASH> 100644
--- a/lib/smpp.js
+++ b/lib/smpp.js
@@ -41,17 +41,21 @@ Session.prototype.connect = function() {
Session.prototype._extractPDUs = function() {
var pdu;
- try {
- while (!this.paused && (pdu = PDU.fromStream(this.socket))) {
- this.emit('pdu', pdu);
- this.emit(pdu.command, pdu);
- if (pdu.isResponse() && this._callbacks[pdu.sequence_number]) {
- this._callbacks[pdu.sequence_number](pdu);
- delete this._callbacks[pdu.sequence_number];
+ while (!this.paused) {
+ try {
+ if (!(pdu = PDU.fromStream(this.socket))) {
+ return;
}
+ } catch (e) {
+ this.emit('error', e);
+ return;
+ }
+ this.emit('pdu', pdu);
+ this.emit(pdu.command, pdu);
+ if (pdu.isResponse() && this._callbacks[pdu.sequence_number]) {
+ this._callbacks[pdu.sequence_number](pdu);
+ delete this._callbacks[pdu.sequence_number];
}
- } catch (e) {
- this.emit('error', e);
}
}; | Put only PDU.fromStream in try-catch | farhadi_node-smpp | train | js |
1eef8c8422e4f3e141b1408a669149959d8f3488 | diff --git a/src/Elcodi/Component/Media/Services/ImageManager.php b/src/Elcodi/Component/Media/Services/ImageManager.php
index <HASH>..<HASH> 100644
--- a/src/Elcodi/Component/Media/Services/ImageManager.php
+++ b/src/Elcodi/Component/Media/Services/ImageManager.php
@@ -17,6 +17,7 @@
namespace Elcodi\Component\Media\Services;
use Symfony\Component\HttpFoundation\File\File;
+use Symfony\Component\HttpFoundation\File\UploadedFile;
use Elcodi\Component\Media\Adapter\Resizer\Interfaces\ResizeAdapterInterface;
use Elcodi\Component\Media\ElcodiMediaImageResizeTypes;
@@ -96,6 +97,12 @@ class ImageManager
throw new InvalidImageException();
}
+ $extension = $file->getExtension();
+
+ if (!$extension && $file instanceof UploadedFile) {
+ $extension = $file->getClientOriginalExtension();
+ }
+
/**
* @var ImageInterface $image
*/
@@ -108,7 +115,7 @@ class ImageManager
->setHeight($imageSizeData[1])
->setContentType($fileMime)
->setSize($file->getSize())
- ->setExtension($file->getExtension())
+ ->setExtension($extension)
->setName($name);
return $image; | Use getClientOriginalExtension insted getExtension to get the image extension
Fixx travis errors
Squashing 2 commits | elcodi_elcodi | train | php |
c2e162352903968962067fdd59ee84f8eeea175b | diff --git a/test/spec/ol/control/control.test.js b/test/spec/ol/control/control.test.js
index <HASH>..<HASH> 100644
--- a/test/spec/ol/control/control.test.js
+++ b/test/spec/ol/control/control.test.js
@@ -13,17 +13,18 @@ describe('ol.control.Control', function() {
});
afterEach(function() {
- map.dispose();
+ goog.dispose(map);
});
describe('dispose', function() {
it('removes the control element from its parent', function() {
- control.dispose();
+ goog.dispose(control);
expect(goog.dom.getParentElement(control.element)).to.be(null);
});
});
});
+goog.require('goog.dispose');
goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('ol.Map'); | Fix use of dispose in ol.control tests | openlayers_openlayers | train | js |
d7692b02bdeafc2837bf4269527c2eaa8be254b1 | diff --git a/daemon/execdriver/windows/exec.go b/daemon/execdriver/windows/exec.go
index <HASH>..<HASH> 100644
--- a/daemon/execdriver/windows/exec.go
+++ b/daemon/execdriver/windows/exec.go
@@ -30,10 +30,11 @@ func (d *Driver) Exec(c *execdriver.Command, processConfig *execdriver.ProcessCo
WorkingDirectory: c.WorkingDir,
}
- // Configure the environment for the process // Note NOT c.ProcessConfig.Tty
+ // Configure the environment for the process // Note NOT c.ProcessConfig.Env
createProcessParms.Environment = setupEnvironmentVariables(processConfig.Env)
- createProcessParms.CommandLine, err = createCommandLine(&c.ProcessConfig, c.ArgsEscaped)
+ // Create the commandline for the process // Note NOT c.ProcessConfig
+ createProcessParms.CommandLine, err = createCommandLine(processConfig, false)
if err != nil {
return -1, err | Typo in previous PR processConfig, not c.ProcessConfig | moby_moby | train | go |
0ac7a722bbe66a151e448eeebaa266d000574f14 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@ setup(
author="Sentry",
author_email="hello@sentry.io",
install_requires=["flake8>=3.7.0,<3.8.0"],
- test_requires=["pytest"],
+ tests_require=["pytest==4.6.5"], # last 2.7 and 3.7 compat version
py_modules=["sentry_check"],
entry_points={"flake8.extension": ["B = sentry_check:SentryCheck"]},
) | correct test_requires to tests_require and pin pytest to <I> lts version | getsentry_sentry-flake8 | train | py |
c66c6c8145fdd1b1fa7f37854c4b59b47e3280b0 | diff --git a/REST/XingClient.php b/REST/XingClient.php
index <HASH>..<HASH> 100755
--- a/REST/XingClient.php
+++ b/REST/XingClient.php
@@ -1,11 +1,18 @@
<?php
/*
- * This file is part of the CampaignChain package.
+ * Copyright 2016 CampaignChain, Inc. <info@campaignchain.com>
*
- * (c) CampaignChain Inc. <info@campaignchain.com>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
namespace CampaignChain\Channel\XingBundle\REST; | CampaignChain/campaignchain#<I> Change copyright notice to match with recommendation of ASF | CampaignChain_channel-xing | train | php |
ca985563bf527f2d784c6b6f3705a5b1a417dc46 | diff --git a/doctoc.js b/doctoc.js
index <HASH>..<HASH> 100644
--- a/doctoc.js
+++ b/doctoc.js
@@ -85,13 +85,15 @@ function transform (f, content) {
_lines = _(lines).chain(),
allHeaders = getHashedHeaders(_lines).concat(getUnderlinedHeaders(_lines)),
+ lowestRank = _(allHeaders).chain().pluck('rank').min(),
linkedHeaders = _(allHeaders).map(addLink);
if (linkedHeaders.length === 0) return { transformed: false };
+
var toc =
linkedHeaders.map(function (x) {
- var indent = _(_.range(x.rank - 1))
+ var indent = _(_.range(x.rank - lowestRank))
.reduce(function (acc, x) { return acc + '\t'; }, '');
return indent + '- [' + x.name + '](' + x.link + ')'; | fixing tocs for docs without h1 | thlorenz_doctoc | train | js |
32dde9d9dc2c7928250d7c08970ab57eb09bde0a | diff --git a/src/net/sf/mpxj/junit/MppFilterTest.java b/src/net/sf/mpxj/junit/MppFilterTest.java
index <HASH>..<HASH> 100644
--- a/src/net/sf/mpxj/junit/MppFilterTest.java
+++ b/src/net/sf/mpxj/junit/MppFilterTest.java
@@ -275,6 +275,14 @@ public class MppFilterTest extends MPXJTestCase
assertTrue(filter.evaluate(task5));
assertFalse(filter.evaluate(task6));
assertFalse(filter.evaluate(task7));
+
+ // Create and test an "is any value" filter
+ filter = new Filter ();
+ FilterCriteria criteria = new FilterCriteria(mpp);
+ filter.addCriteria(criteria);
+ criteria.setField(TaskField.DEADLINE);
+ criteria.setOperator(TestOperator.IS_ANY_VALUE);
+ assertTrue(filter.evaluate(task1));
}
/** | Added a test to exercise "is any value" operator. | joniles_mpxj | train | java |
5173fc2725e3c0f1c178fac7b04bddbf02f29e7b | diff --git a/templates/custom-sidebar-details.php b/templates/custom-sidebar-details.php
index <HASH>..<HASH> 100644
--- a/templates/custom-sidebar-details.php
+++ b/templates/custom-sidebar-details.php
@@ -26,6 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<label for="custom-sidebar-select"><?php _e( 'Use the following sidebar for this page:', 'custom-sidebars' ); ?></label>
<select name="custom-sidebar-select">
<option value="none"><?php /* translators: as in 'No sidebar' */ _e( 'None', 'custom-sidebars' ); ?></option>
+ <option value=""><?php _e( 'Default Sidebar', 'custom-sidebars' ); ?></option>
<?php $metabox->sidebar_select_options(); ?>
</select> | Add ability to use default sidebar on a single post/page | clubdeuce_custom-sidebars | train | php |
ef2eaceb88d936c3dfab35954a13d7833ca4c9c7 | diff --git a/lib/metadata/policies.js b/lib/metadata/policies.js
index <HASH>..<HASH> 100644
--- a/lib/metadata/policies.js
+++ b/lib/metadata/policies.js
@@ -226,7 +226,7 @@ var policies = {
};
}
},
- "evalCalls": {
+ /*"evalCalls": {
"tool": "phantomas",
"label": "eval calls",
"message": "<p>The 'eval' function is slow and is a bad coding practice. Try to get rid of it.</p>",
@@ -234,7 +234,7 @@ var policies = {
"isBadThreshold": 10,
"isAbnormalThreshold": 20,
"hasOffenders": false
- },
+ },*/
"documentWriteCalls": {
"tool": "phantomas",
"label": "document.write calls", | Remove evalCalls from policies (phantomas bug) | gmetais_YellowLabTools | train | js |
6ef910a6102c7e2bc45ad7ef6918becaf4934767 | diff --git a/bokeh/enums.py b/bokeh/enums.py
index <HASH>..<HASH> 100644
--- a/bokeh/enums.py
+++ b/bokeh/enums.py
@@ -31,7 +31,7 @@ Direction = enumeration("clock", "anticlock")
Units = enumeration("screen", "data")
AngleUnits = enumeration("deg", "rad")
Dimension = enumeration("width", "height", "x", "y")
-Location = enumeration("top", "bottom", "left", "right", "min")
+Location = enumeration("top", "bottom", "left", "right", "min", "max")
Orientation = enumeration("top_right", "top_left", "bottom_left", "bottom_right")
BorderSymmetry = enumeration("h", "v", "hv", "vh")
DashPattern = enumeration("solid", "dashed", "dotted", "dotdash", "dashdot") | Add "max" to Location enumeration | bokeh_bokeh | train | py |
eba45d5945688c72d87292dd8151bc6700c47fd7 | diff --git a/lib/model/attr.js b/lib/model/attr.js
index <HASH>..<HASH> 100644
--- a/lib/model/attr.js
+++ b/lib/model/attr.js
@@ -47,7 +47,8 @@ var Attr = Property.extend(/** @lends Attr# */ {
var attr = this._attr(opts.name);
return function() {
this._super.apply(this, arguments);
- this._attrs[attr] = this._attrs[attr] || undefined;
+ this._attrs[attr] = (this._attrs[attr] !== undefined) ?
+ this._attrs[attr] : undefined;
};
},
diff --git a/test/model/model_tests.js b/test/model/model_tests.js
index <HASH>..<HASH> 100644
--- a/test/model/model_tests.js
+++ b/test/model/model_tests.js
@@ -239,6 +239,12 @@ describe('Model', function() {
expect(user.username).to.eql('wbyoung');
expect(user.attrs).to.have.property('username', 'wbyoung');
});
+
+ it('can handles `false` as an attribute value', function() {
+ Article.reopen({ published: db.attr() });
+ var article = Article.create({ id: 5, published: false });
+ expect(article.published).to.equal(false);
+ });
});
it('can create objects', function(done) { | Fixed an issue with undefined/falsey values. | wbyoung_azul | train | js,js |
c135a74092d85a9ddbd6d9e70ba2987ed1d52958 | diff --git a/safe/race_test.go b/safe/race_test.go
index <HASH>..<HASH> 100644
--- a/safe/race_test.go
+++ b/safe/race_test.go
@@ -1,4 +1,4 @@
-// Copyright 2013 tsuru authors. All rights reserved.
+// Copyright 2014 tsuru authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
diff --git a/safe/reader.go b/safe/reader.go
index <HASH>..<HASH> 100644
--- a/safe/reader.go
+++ b/safe/reader.go
@@ -1,4 +1,4 @@
-// Copyright 2013 tsuru authors. All rights reserved.
+// Copyright 2014 tsuru authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
diff --git a/safe/reader_test.go b/safe/reader_test.go
index <HASH>..<HASH> 100644
--- a/safe/reader_test.go
+++ b/safe/reader_test.go
@@ -1,4 +1,4 @@
-// Copyright 2013 tsuru authors. All rights reserved.
+// Copyright 2014 tsuru authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. | safe: fix year in copyright headers | tsuru_tsuru | train | go,go,go |
df5b562817fce057e4787bc3fa2c888a90572fe1 | diff --git a/lib/passport/http/request.js b/lib/passport/http/request.js
index <HASH>..<HASH> 100644
--- a/lib/passport/http/request.js
+++ b/lib/passport/http/request.js
@@ -12,5 +12,5 @@ var http = require('http')
* @api public
*/
req.isAuthenticated = function() {
- return (this._passport.user) ? true : false;
+ return (this._passport && this._passport.user) ? true : false;
};
diff --git a/test/http/request-test.js b/test/http/request-test.js
index <HASH>..<HASH> 100644
--- a/test/http/request-test.js
+++ b/test/http/request-test.js
@@ -33,5 +33,17 @@ vows.describe('HttpServerRequest').addBatch({
assert.isTrue(req.isAuthenticated());
},
},
+
+ 'request without an internal passport': {
+ topic: function() {
+ var req = new http.IncomingMessage();
+ return req;
+ },
+
+ 'should not be authenticated': function (req) {
+ assert.isFunction(req.isAuthenticated);
+ assert.isFalse(req.isAuthenticated());
+ },
+ },
}).export(module); | Request operates properly when lacking a passport. | jaredhanson_passport | train | js,js |
3f7252e54af5769c3e0c551f93ba468885f89f4c | diff --git a/examples/plotting/file/line_select.py b/examples/plotting/file/line_select.py
index <HASH>..<HASH> 100644
--- a/examples/plotting/file/line_select.py
+++ b/examples/plotting/file/line_select.py
@@ -10,7 +10,9 @@ from bokeh.plotting import output_file, show, figure
# The data is setup to have very different scales in x and y, to verify
# that picking happens in pixels. Different widths are used to test that
# you can click anywhere on the visible line.
-
+#
+# Note that the get_view() function used here is not documented and
+# might change in future versions of Bokeh.
t = np.linspace(0, 0.1, 100)
code = """ | add note to line_select example | bokeh_bokeh | train | py |
04eb5e7e315d3e154db0b5fb540858f8e4a5600a | diff --git a/salt/states/saltmod.py b/salt/states/saltmod.py
index <HASH>..<HASH> 100644
--- a/salt/states/saltmod.py
+++ b/salt/states/saltmod.py
@@ -427,6 +427,11 @@ def function(
func_ret['comment'] = str(exc)
return func_ret
+ try:
+ func_ret['__jid__'] = cmd_ret[next(iter(cmd_ret))]['jid']
+ except (StopIteration, KeyError):
+ pass
+
changes = {}
fail = set()
failures = {} | Add jid to salt.function orchestration events | saltstack_salt | train | py |
1c7bbeabe1c1f3eea053c8fd8b6649ba388c1d2e | diff --git a/waliki/slides/views.py b/waliki/slides/views.py
index <HASH>..<HASH> 100644
--- a/waliki/slides/views.py
+++ b/waliki/slides/views.py
@@ -5,8 +5,10 @@ from sh import hovercraft
from django.shortcuts import get_object_or_404
from django.http import HttpResponse
from waliki.models import Page
+from waliki.acl import permission_required
+@permission_required('view_page')
def slides(request, slug):
page = get_object_or_404(Page, slug=slug)
outpath = tempfile.mkdtemp() | Add permission check to slide urls. | mgaitan_waliki | train | py |
1057c3323d0fad907161b076a4a593eefdf1e826 | diff --git a/pygubu/builder/tkstdwidgets.py b/pygubu/builder/tkstdwidgets.py
index <HASH>..<HASH> 100644
--- a/pygubu/builder/tkstdwidgets.py
+++ b/pygubu/builder/tkstdwidgets.py
@@ -336,6 +336,7 @@ class TKPanedWindow(PanedWindowBO):
'background', 'borderwidth', 'cursor', 'orient', 'relief',)
OPTIONS_SPECIFIC = (
'handlepad', 'handlesize', 'height', 'opaqueresize',
+ 'proxybackground', 'proxyborderwidth', 'proxyrelief',
'sashcursor', 'sashpad', 'sashrelief', 'sashwidth', 'showhandle',
'width')
properties = OPTIONS_STANDARD + OPTIONS_SPECIFIC | Add missing proxybackground, proxy* missing options of tk.Panedwindow. | alejandroautalan_pygubu | train | py |
67bb614913c9d0297d3f71b9223cafe17c31f6f7 | diff --git a/py/dynesty/nestedsamplers.py b/py/dynesty/nestedsamplers.py
index <HASH>..<HASH> 100644
--- a/py/dynesty/nestedsamplers.py
+++ b/py/dynesty/nestedsamplers.py
@@ -184,7 +184,12 @@ class SuperSampler(Sampler):
# https://www.tandfonline.com/doi/full/10.1080/10618600.2013.791193
# and https://github.com/joshspeagle/dynesty/issues/260
nexpand, ncontract = max(blob['nexpand'], 1), blob['ncontract']
- self.scale *= nexpand * 2. / (nexpand + ncontract)
+ mult = (nexpand * 2. / (nexpand + ncontract))
+ # avoid drastic updates to the scale factor limiting to factor
+ # of two
+ mult = np.clip(mult, 0.5, 2)
+ # No need to set the scale to be larger than half cube diagonal
+ self.scale = np.minimum(self.scale * mult, np.sqrt(self.npdim) / 2.)
def update_hslice(self, blob):
"""Update the Hamiltonian slice proposal scale based | long overdue fix to the scaling of slice sampling.
There is no need to update scale by large amount in each iteration
Also we should prevent warnings down the line by refusing to set the scale
larger than half of the cube diagonal | joshspeagle_dynesty | train | py |
4e24b672861651a7a382be8d802621b1494c9f0e | diff --git a/lib/moped/node.rb b/lib/moped/node.rb
index <HASH>..<HASH> 100644
--- a/lib/moped/node.rb
+++ b/lib/moped/node.rb
@@ -219,9 +219,7 @@ module Moped
# @since 1.0.0
def get_more(database, collection, cursor_id, limit)
operation = Protocol::GetMore.new(database, collection, cursor_id, limit)
- reply = Read.new(operation).execute(self)
- raise Moped::Errors::CursorNotFound.new("GET MORE", cursor_id) if reply.cursor_not_found?
- reply
+ Read.new(operation).execute(self)
end
# Get the hash identifier for the node. | Get more exceptions are handled in the read class | mongoid_moped | train | rb |
417d7bb42f4b23626f424fa98ecd35f372356a57 | diff --git a/qtpylib/blotter.py b/qtpylib/blotter.py
index <HASH>..<HASH> 100644
--- a/qtpylib/blotter.py
+++ b/qtpylib/blotter.py
@@ -776,6 +776,7 @@ class Blotter():
# fix expiry formatting (no floats)
df['expiry'] = df['expiry'].fillna(0).astype(int).astype(str)
df.loc[df['expiry'] == "0", 'expiry'] = ""
+ df = df[df['sec_type'] != 'BAG']
df.fillna("", inplace=True)
df.to_csv(self.args['symbols'], header=True, index=False) | don't add BAG contracts to blotter | ranaroussi_qtpylib | train | py |
718c8286c477723d94cb51d738b1e6cc7bfe3a8a | diff --git a/Eloquent/Model.php b/Eloquent/Model.php
index <HASH>..<HASH> 100644
--- a/Eloquent/Model.php
+++ b/Eloquent/Model.php
@@ -1252,9 +1252,11 @@ abstract class Model implements ArrayAccess, ArrayableInterface, JsonableInterfa
*/
public static function trashed()
{
- $column = $this->getQualifiedDeletedAtColumn();
+ $instance = new static;
+
+ $column = $instance->getQualifiedDeletedAtColumn();
- return $this->newQueryWithDeleted()->whereNotNull($column);
+ return $instance->newQueryWithDeleted()->whereNotNull($column);
}
/** | Fix static bug in trashed. | illuminate_database | train | php |
1ad9a966b33edfddf1a6a4be1fed82856ee1b579 | diff --git a/twarc/client2.py b/twarc/client2.py
index <HASH>..<HASH> 100644
--- a/twarc/client2.py
+++ b/twarc/client2.py
@@ -438,7 +438,7 @@ class Twarc2:
generator[dict]: a generator, dict for each tweet.
"""
url = "https://api.twitter.com/2/tweets/sample/stream"
- while True:
+ while catch_request_exceptions(lambda: True):
log.info("Connecting to V2 sample stream")
resp = self.get(url, params=expansions.EVERYTHING.copy(), stream=True)
for line in resp.iter_lines(chunk_size=512):
@@ -533,7 +533,7 @@ class Twarc2:
url = "https://api.twitter.com/2/tweets/search/stream"
params = expansions.EVERYTHING.copy()
- while True:
+ while catch_request_exceptions(lambda: True):
log.info("Connecting to V2 stream")
resp = self.get(url, params=params, stream=True)
for line in resp.iter_lines():
@@ -557,6 +557,7 @@ class Twarc2:
if self._check_for_disconnect(data):
break
+
def _timeline(
self,
user_id,
diff --git a/twarc/version.py b/twarc/version.py
index <HASH>..<HASH> 100644
--- a/twarc/version.py
+++ b/twarc/version.py
@@ -1 +1 @@
-version = "2.3.7"
+version = "2.3.8" | catch request exceptions during streaming
This commit reuses twarc.decorators2.catch_request_exceptions in the
context of streaming responses with iter_lines. Hopefully this will
address #<I> but it will require testing by people who continue seeing
the error in the wild. | DocNow_twarc | train | py,py |
f48c63ffb4471c7be25bee5511ca369ad0292d50 | diff --git a/source/resource/Base.php b/source/resource/Base.php
index <HASH>..<HASH> 100644
--- a/source/resource/Base.php
+++ b/source/resource/Base.php
@@ -464,7 +464,7 @@ class GenericResource {
$not = array('primary_method', 'lastUpdate', 'subfunctions', 'client');
// we only need key value
foreach ($proto as $k => $p) {
- if (is_object($p) || in_array($k, $not)) {
+ if (in_array($k, $not)) {
unset($proto[$k]);
}
} | toArray/0: update only ignore known keys in serializing | Bandwidth_php-bandwidth | train | php |
c69643d4ef2840e946310499f92ebf2f6745d7f4 | diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py
index <HASH>..<HASH> 100644
--- a/tests/integration/__init__.py
+++ b/tests/integration/__init__.py
@@ -1811,12 +1811,12 @@ class ShellCase(AdaptedConfigurationTestCaseMixIn, ShellTestCase, ScriptPathMixi
except OSError:
os.chdir(INTEGRATION_TEST_DIR)
- def run_salt(self, arg_str, with_retcode=False, catch_stderr=False, timeout=15): # pylint: disable=W0221
+ def run_salt(self, arg_str, with_retcode=False, catch_stderr=False, timeout=30): # pylint: disable=W0221
'''
Execute salt
'''
arg_str = '-c {0} {1}'.format(self.get_config_dir(), arg_str)
- return self.run_script('salt', arg_str, with_retcode=with_retcode, catch_stderr=catch_stderr, timeout=30)
+ return self.run_script('salt', arg_str, with_retcode=with_retcode, catch_stderr=catch_stderr, timeout=timeout)
def run_ssh(self, arg_str, with_retcode=False, catch_stderr=False, timeout=25): # pylint: disable=W0221
''' | Fix error in passing timeout for salt tests | saltstack_salt | train | py |
b74242a62ea6bce0abda91770af58c5f4b4a55b8 | diff --git a/integration/integration_tests.js b/integration/integration_tests.js
index <HASH>..<HASH> 100644
--- a/integration/integration_tests.js
+++ b/integration/integration_tests.js
@@ -4797,9 +4797,10 @@ var all_tests = {
count = total,
run = function(i) {
// search by regex
- collection.findOne({keywords: {$all: [/ser/, /test/, /seg/, /fault/, /nat/]}}, function(err, item) {
+ //collection.findOne({keywords: /ser/}, function(err, item) {
+ collection.findOne({keywords: {$all: [/ser/, /test/, /seg/, /fault/, /nat/]}}, function(err, item) {
test.equal(6, item.keywords.length);
- if (i === total) {
+ if (i === 0) {
finished_test({test_regex_serialization:'ok'});
}
}); | bug fix for regex serialization test | mongodb_node-mongodb-native | train | js |
52bcf1546a5097f4513c0ad900fbdc2a58a6eaa4 | diff --git a/connector/src/main/java/org/jboss/as/connector/deployers/processors/DriverProcessor.java b/connector/src/main/java/org/jboss/as/connector/deployers/processors/DriverProcessor.java
index <HASH>..<HASH> 100644
--- a/connector/src/main/java/org/jboss/as/connector/deployers/processors/DriverProcessor.java
+++ b/connector/src/main/java/org/jboss/as/connector/deployers/processors/DriverProcessor.java
@@ -73,7 +73,7 @@ public final class DriverProcessor implements DeploymentUnitProcessor {
DEPLOYER_JDBC_LOGGER.deployingNonCompliantJdbcDriver(driverClass, Integer.valueOf(majorVersion),
Integer.valueOf(minorVersion));
}
- String driverName = deploymentUnit.getName();
+ String driverName = driverNames.size() == 1 ? deploymentUnit.getName() : deploymentUnit.getName() + driverClassName + "_" + majorVersion +"_" + minorVersion;
InstalledDriver driverMetadata = new InstalledDriver(driverName, driverClass.getName(), null, null, majorVersion,
minorVersion, compliant);
DriverService driverService = new DriverService(driverMetadata, driver);
@@ -86,6 +86,7 @@ public final class DriverProcessor implements DeploymentUnitProcessor {
} catch (Exception e) {
DEPLOYER_JDBC_LOGGER.cannotInstantiateDriverClass(driverClassName, e);
}
+
}
}
} | AS7-<I> Datasource drivers contained in deployments create services identified by deployment's name | wildfly_wildfly | train | java |
3a26d67d1ad79c030e1de82dd57728e88984fc27 | diff --git a/bench_test.go b/bench_test.go
index <HASH>..<HASH> 100644
--- a/bench_test.go
+++ b/bench_test.go
@@ -15,7 +15,6 @@ func BenchmarkPublishSpeed(b *testing.B) {
}
defer nc.Close()
b.StartTimer()
- b.SetBytes(1)
msg := []byte("Hello World")
@@ -42,7 +41,6 @@ func BenchmarkPubSubSpeed(b *testing.B) {
ch := make(chan bool)
b.StartTimer()
- b.SetBytes(2)
nc.Opts.AsyncErrorCB = func(nc *Conn, s *Subscription, err error) {
b.Fatalf("Error : %v\n", err) | Removed helper setBytes | nats-io_go-nats | train | go |
9a1cafcf9f2548d371c326a4a1ca0b89f8bb5451 | diff --git a/src/Utility/Import.php b/src/Utility/Import.php
index <HASH>..<HASH> 100644
--- a/src/Utility/Import.php
+++ b/src/Utility/Import.php
@@ -202,7 +202,7 @@ class Import
*/
public static function getRowsCount($path, $withHeader = false)
{
- $result = exec("/usr/bin/env wc -l '" . $path . "'", $output, $return);
+ $result = trim(exec("/usr/bin/env wc -l '" . $path . "'", $output, $return));
if (0 === $return) {
list($result, ) = explode(' ', $result);
$result = (int)$result; | WC command produces extra spaces that breaks line count (task #<I>) | QoboLtd_cakephp-csv-migrations | train | php |
1d7e2b6fca76ad725251b87c9b9160eb45f4ab03 | diff --git a/src/HealthGraph/HealthGraphClient.php b/src/HealthGraph/HealthGraphClient.php
index <HASH>..<HASH> 100644
--- a/src/HealthGraph/HealthGraphClient.php
+++ b/src/HealthGraph/HealthGraphClient.php
@@ -20,9 +20,12 @@ class HealthGraphClient extends Client
*
* @TODO update factory method and docblock for parameters
*/
- public static function factory($config = array(), $logger = null)
+ public static function factory($config = array())
{
- $default = array('base_url' => 'https://api.runkeeper.com');
+ $default = array(
+ 'base_url' => 'https://api.runkeeper.com',
+ 'logger' => FALSE,
+ );
$required = array('base_url');
$config = Collection::fromConfig($config, $default, $required);
@@ -39,8 +42,8 @@ class HealthGraphClient extends Client
new HealthGraphIteratorFactory(array("{$prefix}\\Common\\Iterator"))
);
- if ($logger) {
- $adapter = new \Guzzle\Log\PsrLogAdapter($logger);
+ if ($config->get('logger')) {
+ $adapter = new \Guzzle\Log\PsrLogAdapter($config->get('logger'));
$logPlugin = new \Guzzle\Plugin\Log\LogPlugin(
$adapter,
\Guzzle\Log\MessageFormatter::DEBUG_FORMAT | Altered factory method for client to accept logger | jyokum_healthgraph | train | php |
36d4d24d30dda65633e9c0c1d68141d8a7cd00bc | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -56,7 +56,7 @@ dependency_links = [
install_requires = [
'django',
'django-colorful',
- 'django-author',
+ 'django-author>=0.2',
'django-admin-sortable2',
'psycopg2',
'easy_thumbnails', | version of django-author | auto-mat_django-webmap-corpus | train | py |
ce7c5a04214476457d2c1481a8067708e5485305 | diff --git a/benchexec/tablegenerator/textable.py b/benchexec/tablegenerator/textable.py
index <HASH>..<HASH> 100644
--- a/benchexec/tablegenerator/textable.py
+++ b/benchexec/tablegenerator/textable.py
@@ -82,10 +82,10 @@ class LatexCommand:
"""
if not value:
logging.warning(
- "Trying to print latex command without value! Using 0 as value for command:\n %s"
+ "Trying to print latex command without value! Using EMPTY value for command:\n %s"
% self
)
- value = "0"
+ value = ""
return str(self) + "{%s}" % value
@staticmethod | Printing empty value instead of 0 now | sosy-lab_benchexec | train | py |
e78ee468ba8ab97f03099f4631578ddad947106d | diff --git a/src/CirclicalUser/Exception/PrivilegeEscalationException.php b/src/CirclicalUser/Exception/PrivilegeEscalationException.php
index <HASH>..<HASH> 100644
--- a/src/CirclicalUser/Exception/PrivilegeEscalationException.php
+++ b/src/CirclicalUser/Exception/PrivilegeEscalationException.php
@@ -10,5 +10,4 @@ class PrivilegeEscalationException extends \Exception
{
parent::__construct("For security reasons, the super-admin role cannot be granted via the library. It must be injected through other means.");
}
-
}
diff --git a/src/CirclicalUser/Listener/AccessListener.php b/src/CirclicalUser/Listener/AccessListener.php
index <HASH>..<HASH> 100644
--- a/src/CirclicalUser/Listener/AccessListener.php
+++ b/src/CirclicalUser/Listener/AccessListener.php
@@ -74,7 +74,7 @@ class AccessListener implements ListenerAggregateInterface
return;
}
} else {
- throw new \LogicException('A controller and action, or middleware are required to verify access!');
+ throw new \LogicException('A controller-action pair or middleware are required to verify access!');
}
} | Analysis trigger to test Codacy problems. | Saeven_zf3-circlical-user | train | php,php |
7509ec2a0d5885c45a38f172c9433935b42eae5d | diff --git a/spec/net_http_spec.rb b/spec/net_http_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/net_http_spec.rb
+++ b/spec/net_http_spec.rb
@@ -11,8 +11,8 @@ describe Net::HTTP do
it "should reject SSL mismatches" do
lambda {
- Net::HTTP.post_form_with_ssl URI.parse('https://72.32.178.162/'), {}
+ Net::HTTP.post_form_with_ssl URI.parse('https://67.207.202.119/'), {}
}.should raise_exception(OpenSSL::SSL::SSLError, /hostname/)
end
end
-end
\ No newline at end of file
+end | Fix hanging spec
IP is Fusemail's www server | mudbugmedia_fusebox | train | rb |
a607afb8d243953b8aeb647103430b642127cd16 | diff --git a/src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php b/src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php
index <HASH>..<HASH> 100755
--- a/src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php
+++ b/src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php
@@ -71,6 +71,12 @@ class DoctrineExtension extends AbstractDoctrineExtension
$container->getDefinition('doctrine.dbal.connection_factory')->replaceArgument(0, $config['types']);
+ $connections = array();
+ foreach (array_keys($config['connections']) as $name) {
+ $connections[$name] = sprintf('doctrine.dbal.%s_connection', $name);
+ }
+ $container->setParameter('doctrine.dbal.connections', $connections);
+
foreach ($config['connections'] as $name => $connection) {
$this->loadDbalConnection($name, $connection, $container);
} | [DoctrineBundle] added a doctrine.dbal.connections parameter that keeps the list of registered DBAL connections | symfony_symfony | train | php |
58ba0c40a596e35600d7c75083e8aaf86e6452f2 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -44,8 +44,8 @@ setup(name = 'Rtree',
keywords = 'gis spatial index',
author = 'Sean Gillies',
author_email = 'sgillies@frii.com',
- maintainer = 'Howard Butler',
- maintainer_email = 'hobu.inc@gmail.com',
+ maintainer = 'Sean Gillies',
+ maintainer_email = 'sgillies@frii.com',
url = 'http://trac.gispython.org/lab/wiki/Rtree',
long_description = readme_text,
packages = ['rtree'], | revert maintainer change because of PyPI | Toblerity_rtree | train | py |
39251a69ee1b01d909fb4c77cc1d9026883749a9 | diff --git a/src/AlgorithmConnectedComponents.php b/src/AlgorithmConnectedComponents.php
index <HASH>..<HASH> 100644
--- a/src/AlgorithmConnectedComponents.php
+++ b/src/AlgorithmConnectedComponents.php
@@ -16,6 +16,22 @@ class AlgorithmConnectedComponents extends Algorithm{
$this->graph = $graph;
}
+ /**
+ * create subgraph with all vertices connected to given vertex (i.e. the connected component of ths given vertex)
+ *
+ * @param Vertex $vertex
+ * @return Graph
+ * @throws Exception
+ * @uses AlgorithmSearchBreadthFirst::getVerticesIds()
+ * @uses Graph::createGraphCloneVertices()
+ */
+ public function createGraphComponentVertex(Vertex $vertex){
+ if($vertex->getGraph() !== $this->graph){
+ throw new Exception('This graph does not contain the given vertex');
+ }
+ return $this->graph->createGraphCloneVertices($this->createSearch($vertex)->getVertices());
+ }
+
private function createSearch(Vertex $vertex){
$alg = new AlgorithmSearchBreadthFirst($vertex);
return $alg->setDirection(AlgorithmSearch::DIRECTION_BOTH); // follow into both directions (loosely connected) | Additional helper for connected component of vertex | graphp_algorithms | train | php |
70fccff1ef19d17e42ff85af3ae4e2d49fe13b79 | diff --git a/fortranmagic.py b/fortranmagic.py
index <HASH>..<HASH> 100644
--- a/fortranmagic.py
+++ b/fortranmagic.py
@@ -186,11 +186,11 @@ class FortranMagics(Magics):
except:
pass
if err:
- sys.stderr.write(err)
+ sys.stderr.write(err.decode())
sys.stderr.flush()
if show_captured or verbosity > 2:
if out:
- sys.stdout.write(out)
+ sys.stdout.write(out.decode())
sys.stdout.flush()
captured()
except SystemExit as e: | Decode text before printing, fix #<I> | mgaitan_fortran_magic | train | py |
8d67bb47cf601d970bb78088e459ceba6dd2bd48 | diff --git a/sastool/classes2/loader.py b/sastool/classes2/loader.py
index <HASH>..<HASH> 100644
--- a/sastool/classes2/loader.py
+++ b/sastool/classes2/loader.py
@@ -55,9 +55,11 @@ class Loader(object, metaclass=abc.ABCMeta):
def loadexposure(self, fsn: int) -> Exposure:
"""Load the exposure for the given file sequence number."""
- def find_file(self, filename: str) -> str:
+ def find_file(self, filename: str, strip_path: bool = True) -> str:
"""Find file in the path"""
tried = []
+ if strip_path:
+ filename = os.path.split(filename)[-1]
for d in self._path:
if os.path.exists(os.path.join(d, filename)):
tried.append(os.path.join(d, filename)) | Loader.find_file() strips the path from the file. | awacha_sastool | train | py |
ef92c331d32fa85036a5828d6eafb2c349fbcd04 | diff --git a/blocks/query-assist/query-assist.js b/blocks/query-assist/query-assist.js
index <HASH>..<HASH> 100644
--- a/blocks/query-assist/query-assist.js
+++ b/blocks/query-assist/query-assist.js
@@ -58,6 +58,7 @@ define([
this.onApply_ = config.onApply || $.noop;
this.onChange_ = config.onChange || $.noop;
this.onFocusChange_ = config.onFocusChange || $.noop;
+ this.onClose_ = config.onClose || $.noop;
View.init(MODULE, this.$target_, config.method || 'prepend', {}, config).then(function($view) {
self.$view_ = $view;
@@ -88,6 +89,8 @@ define([
},
'esc':function(e) {
e.preventDefault();
+ e.stopPropagation();
+ self.onClose_(e);
// Hide dropdown and fall to next shortcut scope if there was none
if (!actionList('remove')) {
return true;
@@ -272,6 +275,7 @@ define([
*/
QueryAssist.prototype.apply_ = function(e) {
this.onApply_(this.query_);
+ this.onClose_(e);
actionList('remove');
if (e) {
e.preventDefault(); | RG-<I> Closing query-assist by pressing Esc closes Upsource popups
Former-commit-id: a2ee<I>bf1d<I>e1f<I>f4f<I>f<I>fbf7b5e<I>e5 | JetBrains_ring-ui | train | js |
26f6f89ddc588e4f399a2acb84bf2c56ccf8ac06 | diff --git a/pywws/toservice.py b/pywws/toservice.py
index <HASH>..<HASH> 100644
--- a/pywws/toservice.py
+++ b/pywws/toservice.py
@@ -22,7 +22,7 @@ class ToService(object):
self.logger = logging.getLogger('pywws.%s' % self.__class__.__name__)
self.params = params
self.data = calib_data
- self.old_result = None
+ self.old_response = None
self.old_ex = None
# set default socket timeout, so urlopen calls don't hang forever
socket.setdefaulttimeout(10)
@@ -84,14 +84,16 @@ class ToService(object):
wudata = urllib.urlopen(server, coded_data)
response = wudata.readlines()
wudata.close()
+ if response != self.old_response:
+ for line in response:
+ self.logger.error(line)
+ self.old_response = response
if not response:
# Met office returns empty array on success
return True
- for line in response:
+ if response[0] == 'success\n':
# Weather Underground returns 'success' string
- if line == 'success\n':
- return True
- self.logger.error(line)
+ return True
except Exception, ex:
e = str(ex)
if e != self.old_ex: | Slightly rearranged error reporting in toservice.py. Should reduce
chance of multiple repeated messages in the log. | jim-easterbrook_pywws | train | py |
06dee576e017760227dca87bc168412825ef576c | diff --git a/tests/test_angle_tools.py b/tests/test_angle_tools.py
index <HASH>..<HASH> 100644
--- a/tests/test_angle_tools.py
+++ b/tests/test_angle_tools.py
@@ -66,6 +66,16 @@ def test_bear():
assert_almost_equal(ans, bear, err_msg="{0:5.2f},{1:5.2f} <-> {2:5.2f},{3:5.2f} == {4:g} != {5:g}".format(ra1, dec1, ra2, dec2, bear, ans))
+def test_translate():
+ for (ra1, dec1), (r, theta), (ra2, dec2) in [((0, 0), (1, 0), (0, 1)),
+ ((45, 89.75), (0.5, 0), (225, 89.75)), # over the pole
+ ((12, -45), (-1, 180), (12, -44)) # negative r
+ ]:
+ ans = at.translate(ra1, dec1, r, theta)
+ assert_almost_equal(ans, (ra2, dec2), err_msg="{0:5.2f},{1:5.2f} -> {2:g},{3:g} -> {4:5.2f},{5:5.2f} != {6:g},{7:g}".format(ra1, dec1, r, theta, ra2, dec2, *ans))
+
+
+
if __name__ == "__main__":
# introspect and run all the functions starting with 'test'
for f in dir(): | now testing all functions use by Aegean | PaulHancock_Aegean | train | py |
bcc143a3cf871f352141261a92b4e9ca7fd98b8d | diff --git a/grpc/interceptor/interceptor.go b/grpc/interceptor/interceptor.go
index <HASH>..<HASH> 100644
--- a/grpc/interceptor/interceptor.go
+++ b/grpc/interceptor/interceptor.go
@@ -30,7 +30,7 @@ func Unary(fn func(req interface{}, info *grpc.UnaryServerInfo) (log.Interface,
code := grpc.Code(grpcErr)
log = log.WithField("code", code)
- if grpcErr != nil && code != codes.Canceled {
+ if grpcErr != nil {
log.WithError(err).Errorf("%s failed", reqStr)
} else {
log.Debugf("%s completed", reqStr) | grpc/interceptor: count canceled req as failed | TheThingsNetwork_go-utils | train | go |
dc1b260085680be1cb09dc2b04b9e30f14531f4c | diff --git a/core/src/main/java/org/testcontainers/images/builder/ImageFromDockerfile.java b/core/src/main/java/org/testcontainers/images/builder/ImageFromDockerfile.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/testcontainers/images/builder/ImageFromDockerfile.java
+++ b/core/src/main/java/org/testcontainers/images/builder/ImageFromDockerfile.java
@@ -6,6 +6,7 @@ import com.github.dockerjava.api.exception.DockerClientException;
import com.github.dockerjava.api.model.BuildResponseItem;
import com.github.dockerjava.core.command.BuildImageResultCallback;
import com.google.common.collect.Sets;
+import lombok.Cleanup;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
@@ -113,8 +114,8 @@ public class ImageFromDockerfile extends LazyFuture<String> implements
};
// We have to use pipes to avoid high memory consumption since users might want to build really big images
- PipedInputStream in = new PipedInputStream();
- PipedOutputStream out = new PipedOutputStream(in);
+ @Cleanup PipedInputStream in = new PipedInputStream();
+ @Cleanup PipedOutputStream out = new PipedOutputStream(in);
profiler.start("Configure image");
BuildImageCmd buildImageCmd = dockerClient.buildImageCmd(in); | Ensure that piped streams are closed automatically. This resolves an apparently deadlock somewhere between netty/docker if a previous test, affected by #<I>, has failed during copying of a file. | testcontainers_testcontainers-java | train | java |
dea6217f2c5a277fc72dc1bf6f7fbc0303e7c26b | diff --git a/src/api/knowledgebase.js b/src/api/knowledgebase.js
index <HASH>..<HASH> 100644
--- a/src/api/knowledgebase.js
+++ b/src/api/knowledgebase.js
@@ -679,7 +679,17 @@ function runToolChain(axios, modelId, toolchainId, attackerProfileId, _callbacks
callbacks.onToolChainStart();
return axios(params)
- .then((res) => res.data);
+ .then((res) => res.data)
+ .then((data) => {
+ // kb used to return `task_url`, but we
+ // need to contruct our own url, a la:
+ // http://localhost:8080/tkb/task/0d178007ae7044fdb3de5b204ce94e36
+ return Object.assign(
+ {},
+ data,
+ { task_url: api.makeUrl(paths, `task/${data.task_id}`) }
+ );
+ });
}; | we need to construct our own task url | trespass-project_trespass.js | train | js |
eea4570c39212ba4e195650a7b33e80ee83a26a0 | diff --git a/pfmisc/pfmisc.py b/pfmisc/pfmisc.py
index <HASH>..<HASH> 100755
--- a/pfmisc/pfmisc.py
+++ b/pfmisc/pfmisc.py
@@ -79,6 +79,10 @@ class pfmisc():
self.dp2.qprint("Why hello there, world! In a debugging file!")
print('* Check on /tmp/pfmisc.txt')
+ print('* calling: self.dp.qprint("Why hello there, world! With teeFile!", teeFile="/tmp/pfmisc-teefile.txt", teeMode = "w+"):')
+ self.dp.qprint("Why hello there, world! With teeFile!", teeFile="/tmp/pfmisc-teefile.txt", teeMode = "w+")
+ print('* Check on /tmp/pfmisc-teefile.txt')
+
other = someOtherClass()
other.say("And this is from a different class") | Update demo with teeFile example. | FNNDSC_pfmisc | train | py |
662ae0c0a0cc6c8db27f5e394c2b15d00cdb7877 | diff --git a/lib/nominet-epp.rb b/lib/nominet-epp.rb
index <HASH>..<HASH> 100644
--- a/lib/nominet-epp.rb
+++ b/lib/nominet-epp.rb
@@ -75,11 +75,7 @@ module NominetEPP
# @return [Hash] Nominet Schema Locations by prefix
def schemaLocations
- { :domain => 'http://www.nominet.org.uk/epp/xml/nom-domain-2.0 nom-domain-2.0.xsd',
- :account => 'http://www.nominet.org.uk/epp/xml/nom-account-2.0 nom-account-2.0.xsd',
- :contact => 'http://www.nominet.org.uk/epp/xml/nom-contact-2.0 nom-contact-1.0.xsd',
- :tag => 'http://www.nominet.org.uk/epp/xml/nom-tag-1.0 nom-tag-1.0.xsd',
- :n => 'http://www.nominet.org.uk/epp/xml/nom-notifications-2.0 nom-notifications-2.0.xsd' }
+ { }
end
include Helpers | Remove all old schemaLocation information. | m247_nominet-epp | train | rb |
377591db1eb9ba08010faf5ac29473739ae7c54b | diff --git a/src/main/java/org/serversass/Parser.java b/src/main/java/org/serversass/Parser.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/serversass/Parser.java
+++ b/src/main/java/org/serversass/Parser.java
@@ -411,10 +411,10 @@ public class Parser {
}
/**
- * Parses and consumes selector prefixes which add pseudo-classes ('&:') or pseudo-elements ('&::') to an existing selector,
- * Arguments on pseudo classes like '&:not(.class)' are also parsed and consumed.
- * For valid input like e.g. '&::after' , '&:first-child' , '&:not(.class)' two selectors are added to the given List:
- * 1. '&'
+ * Parses and consumes selector prefixes which add pseudo-classes ('&:') or pseudo-elements ('&::') to an existing selector,
+ * Arguments on pseudo classes like '&:not(.class)' are also parsed and consumed.
+ * For valid input like e.g. '&::after' , '&:first-child' , '&:not(.class)' two selectors are added to the given List:
+ * 1. '&'
* 2. the pseudo-class/element e.g. '::after' , ':first-child' , ':not(.class)'
*
* @param selector the List to which the selectors are added. | Replaces & with & in javadoc | scireum_server-sass | train | java |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.