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
7d89ee3783393d4a4b7ddf37d49b36d58e7f0491
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -14,12 +14,16 @@ from distutils.sysconfig import get_python_lib, PREFIX # Use setuptools if available, else fallback to distutils. # As an example, setuptools is available in virtualenvs and buildouts through # Setuptools or Distribute. -try: - from setuptools import setup - with_setuptools = True -except ImportError: +with_setuptools = False +if 'SETUPTOOLS' in os.environ: + try: + from setuptools import setup + with_setuptools = True + except: + with_setuptools = False + +if with_setuptools == False: from distutils.core import setup - with_setuptools = False exec(compile(open("salt/version.py").read(), "salt/version.py", 'exec'))
import setuptools if SETUPTOOLS env var exists Default to importing distutils unless the user has created an environment variable named SETUPTOOLS in which case import setuptools
saltstack_salt
train
py
31870fbd920927562d7459fe9f69f1cfe0b45bf9
diff --git a/pyblish_qml/ipc/server.py b/pyblish_qml/ipc/server.py index <HASH>..<HASH> 100644 --- a/pyblish_qml/ipc/server.py +++ b/pyblish_qml/ipc/server.py @@ -343,6 +343,23 @@ def find_pyqt5(python): os.getenv("PYBLISH_QML_PYQT5") ) + # If not registered, ask Python for it explicitly + # This avoids having to expose PyQt5 on PYTHONPATH + # where it may otherwise get picked up by bystanders + # such as Python 2. + if not pyqt5: + try: + path = subprocess.check_output([ + python, "-c", + "import PyQt5, sys;" + "sys.stdout.write(PyQt5.__file__)" + ]) + + pyqt5 = os.path.dirname(path) + + except subprocess.CalledProcessError: + pass + return pyqt5
Improve path handling for PyQt5
pyblish_pyblish-qml
train
py
3a5387346925cb7a579ef199c261d7c7de4a3423
diff --git a/packages/netlify-cms-widget-number/src/schema.js b/packages/netlify-cms-widget-number/src/schema.js index <HASH>..<HASH> 100644 --- a/packages/netlify-cms-widget-number/src/schema.js +++ b/packages/netlify-cms-widget-number/src/schema.js @@ -1,8 +1,8 @@ export default { properties: { - step: { type: 'integer' }, + step: { type: 'number' }, valueType: { type: 'string' }, - min: { type: 'integer' }, - max: { type: 'integer' }, + min: { type: 'number' }, + max: { type: 'number' }, }, };
fix(widget-number): use number instead of integer in schema (#<I>)
netlify_netlify-cms
train
js
e6ddc8382d3dcb2a708febc80c1b8f05dd03adfc
diff --git a/website/data/version.js b/website/data/version.js index <HASH>..<HASH> 100644 --- a/website/data/version.js +++ b/website/data/version.js @@ -1,6 +1,6 @@ export const VERSION = '1.7.3' export const CHANGELOG_URL = - 'https://github.com/hashicorp/vault/blob/master/CHANGELOG.md#173' + 'https://github.com/hashicorp/vault/blob/main/CHANGELOG.md#173' // HashiCorp officially supported package managers export const packageManagers = [
Updating changelog link to main (#<I>)
hashicorp_vault
train
js
3d949f34816d6eca0a6b59cfa08d91f36e8e64dd
diff --git a/activemodel/lib/active_model/serialization.rb b/activemodel/lib/active_model/serialization.rb index <HASH>..<HASH> 100644 --- a/activemodel/lib/active_model/serialization.rb +++ b/activemodel/lib/active_model/serialization.rb @@ -72,10 +72,20 @@ module ActiveModel module Serialization # Returns a serialized hash of your object. # + # class Address + # include ActiveModel::Serialization + # + # attr_accessor :city, :street + # + # def attributes + # {'city' => nil, 'street' => nil} + # end + # end + # # class Person # include ActiveModel::Serialization # - # attr_accessor :name, :age + # attr_accessor :name, :age, :address # # def attributes # {'name' => nil, 'age' => nil} @@ -89,6 +99,9 @@ module ActiveModel # person = Person.new # person.name = 'bob' # person.age = 22 + # person.address = Address.new + # person.address.city = 'New York' + # person.address.street = 'Main St' # person.serializable_hash # => {"name"=>"bob", "age"=>22} # person.serializable_hash(only: :name) # => {"name"=>"bob"} # person.serializable_hash(except: :name) # => {"age"=>22}
Add code example for include option of AM::Serialization#serializable_hash
rails_rails
train
rb
9098f6dd1f45b608cecea014c98e849280ac1671
diff --git a/rinohlib/stylesheets/matcher.py b/rinohlib/stylesheets/matcher.py index <HASH>..<HASH> 100644 --- a/rinohlib/stylesheets/matcher.py +++ b/rinohlib/stylesheets/matcher.py @@ -168,9 +168,13 @@ matcher('definition term classifier', matcher('definition', Definition) related_links = GroupedFlowables.like('related links') +related_links_list = related_links / List +related_links_list_item = related_links_list / ListItem matcher('related links', related_links) -matcher('related links section title', related_links / ... / DefinitionTerm - / ... / Paragraph) +matcher('related links section title', related_links / Paragraph.like('title')) +matcher('related links list', related_links_list) +matcher('related links list item', related_links_list_item) +matcher('related links list item label', related_links_list_item / ListItemLabel) # (Sphinx) version added/changed & deprecated
Provide selectors for styling related links lists
brechtm_rinohtype
train
py
83793ba4597125f168d687e530b8b4347480ed03
diff --git a/lib/velocity-animate-shim.js b/lib/velocity-animate-shim.js index <HASH>..<HASH> 100644 --- a/lib/velocity-animate-shim.js +++ b/lib/velocity-animate-shim.js @@ -3,7 +3,13 @@ // that they'll render, rather than doing something clever like // statically rendering the end state of any provided animations. if (typeof window !== 'undefined') { - module.exports = require('velocity-animate'); + + // this is how velocity-ui finds the Velocity instance, so lets make sure we find the right instance + var g = (window.jQuery || window.Zepto || window); + + // require Velocity if it doesn't already exist + module.exports = g.Velocity ? g.Velocity : require('velocity-animate'); + } else { var Velocity = function () {}; Velocity.velocityReactServerShim = true;
use the existing instance of Velocity instead of requiring a new one without this, velocity-react was always requiring a new instance of velocity-animate, so require('velocity-animate/velocity-ui') was attaching to the wrong instance. This finds an existing instance the correct way (the same way velocity.ui.js does it)
google-fabric_velocity-react
train
js
c77fcbe68d25be7805d334f4e22068f34493312d
diff --git a/src/Illuminate/Database/Eloquent/Factories/Factory.php b/src/Illuminate/Database/Eloquent/Factories/Factory.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Database/Eloquent/Factories/Factory.php +++ b/src/Illuminate/Database/Eloquent/Factories/Factory.php @@ -211,9 +211,9 @@ abstract class Factory public function createMany(iterable $records) { return new EloquentCollection( - array_map(function ($record) { + collect($records)->map(function ($record) { return $this->state($record)->create(); - }, $records) + }) ); }
Fix Factory hasMany method (#<I>)
laravel_framework
train
php
4fa8c80b4145eefbb84f3944a5e16b3b7d57420f
diff --git a/lib/hubotgf/command.rb b/lib/hubotgf/command.rb index <HASH>..<HASH> 100644 --- a/lib/hubotgf/command.rb +++ b/lib/hubotgf/command.rb @@ -12,5 +12,9 @@ module HubotGf regex.match(text).captures end + def to_s + regex.inspect + end + end end \ No newline at end of file
HubotGf::Command supports to_s now, returning regex.inspect
lserman_hubotgf
train
rb
bbee3a7e2825398ac15e8a97179990347b42b09b
diff --git a/tableprint/metadata.py b/tableprint/metadata.py index <HASH>..<HASH> 100644 --- a/tableprint/metadata.py +++ b/tableprint/metadata.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Version info -__version__ = '0.8.0' +__version__ = '0.7.1' __license__ = 'MIT' # Project description(s)
Updating version to <I>
nirum_tableprint
train
py
c4dc3ec98a243109095b807ec1a02a63f54d1f09
diff --git a/src/ngeo.js b/src/ngeo.js index <HASH>..<HASH> 100644 --- a/src/ngeo.js +++ b/src/ngeo.js @@ -3,7 +3,7 @@ * - a "virtual" angular module root used to automatically register finely included ngeo dependencies; * - a JS namespace for constants and types; * - a list of requires (for olx, ol3) to please GCC (using hide_warnings_for GCC parameter might help here); - * - a GCC entry point with requires on all parts of ngeo to produce the dist/exports.js file (badly broken). + * - a GCC entry point with requires on all parts of ngeo to produce the dist/ngeo.js file (badly broken). * * Also consider renaming the file, see https://github.com/google/closure-compiler/issues/2665. */ @@ -48,7 +48,7 @@ goog.require('ol.style.AtlasManager'); /** @type {!angular.Module} */ exports.module = angular.module('ngeo', [ 'gettext', 'ui.date', 'floatThead' - // src/modules/* were added for producing the dist/exports.js file, which is badly broken. + // src/modules/* were added for producing the dist/ngeo.js file, which is badly broken. // removing them as they conflict with the "virtual" angular module root "vocation" of this file. ]);
Fix ngeo.js comments
camptocamp_ngeo
train
js
6c606d6c1d0cbd2b26074dfdaaace2c06e30fdce
diff --git a/lib/class/pluginManager.js b/lib/class/pluginManager.js index <HASH>..<HASH> 100644 --- a/lib/class/pluginManager.js +++ b/lib/class/pluginManager.js @@ -35,7 +35,7 @@ PluginManager.prototype = { * @protected */ _getPluginConfigFromInstance: function() { - var config = this.instanceArgs[0]; + var config = this.instanceArgs[0] || {}; return config.plugins; },
don't break if there is no config
pllee_luc
train
js
b09609b043a2fba12853418ae4c416174d5d7f4f
diff --git a/lib/Memento/Client.php b/lib/Memento/Client.php index <HASH>..<HASH> 100644 --- a/lib/Memento/Client.php +++ b/lib/Memento/Client.php @@ -136,7 +136,7 @@ class Client $this->engine->setGroupKey($groupKey); if (!$this->engine->isValid($key)) { - return false; + return null; } return $this->engine->retrieve($key);
returns null rather than false if key doesn't exist for retrieve function
garyr_memento
train
php
20a7bff4019a93fd7cee04897effd49af8be4de4
diff --git a/src/event.js b/src/event.js index <HASH>..<HASH> 100644 --- a/src/event.js +++ b/src/event.js @@ -244,7 +244,8 @@ jQuery.event = { namespace = event.type.split("."); event.type = namespace[0]; namespace = namespace[1]; - all = !namespace && !event.exclusive; //cache this now, all = true means, any handler + // Cache this now, all = true means, any handler + all = !namespace && !event.exclusive; handlers = ( jQuery.data(this, "events") || {} )[event.type]; @@ -346,7 +347,8 @@ jQuery.event = { proxy: function( fn, proxy ){ // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++; - return proxy;//so proxy can be declared as an argument + // So proxy can be declared as an argument + return proxy; }, special: { diff --git a/src/fx.js b/src/fx.js index <HASH>..<HASH> 100644 --- a/src/fx.js +++ b/src/fx.js @@ -405,7 +405,8 @@ jQuery.extend( jQuery.fx, { speeds:{ slow: 600, fast: 200, - def: 400 //default speed + // Default speed + def: 400 }, step: { scrollLeft: function(fx){
jquery event & fx: tidying some comments.
jquery_jquery
train
js,js
08062f3b7a51a8215631b922352a15a5953c973c
diff --git a/atomic_reactor/plugins/post_koji_upload.py b/atomic_reactor/plugins/post_koji_upload.py index <HASH>..<HASH> 100644 --- a/atomic_reactor/plugins/post_koji_upload.py +++ b/atomic_reactor/plugins/post_koji_upload.py @@ -473,7 +473,7 @@ class KojiUploadPlugin(PostBuildPlugin): digests = self.get_digests() repositories = self.get_repositories(digests) - tags = set(image.tag for image in self.workflow.tag_conf.primary_images) + tags = set(image.tag for image in self.workflow.tag_conf.images) metadata, output = self.get_image_output(arch) metadata.update({ 'arch': arch, diff --git a/tests/plugins/test_koji_upload.py b/tests/plugins/test_koji_upload.py index <HASH>..<HASH> 100644 --- a/tests/plugins/test_koji_upload.py +++ b/tests/plugins/test_koji_upload.py @@ -834,7 +834,8 @@ class TestKojiUpload(object): assert isinstance(tags, list) expected_tags = set([version, "{}-{}".format(version, release), - 'latest']) + 'latest', + "{}-timestamp".format(version)]) if additional_tags: expected_tags.update(additional_tags)
Include platform-specific unique tag in Koji 'tags' metadata The platform-specific unique tag is the only tag the platform-specific image has, so it's useful to put into the Koji metadata for each "docker-image" output.
projectatomic_atomic-reactor
train
py,py
557c6eeb75362bcbae3e01c2e0c1a9af65b39496
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ setup(name='googleanalytics', 'inspect-it>=0.3.2', 'werkzeug>=0.10', 'keyring==5.3', - 'click>=3.3', + 'click>=6', 'pyyaml>=3', 'prettytable>=0.7', 'colorama>=0.3',
Update to click 6, which fixes some bugs.
debrouwere_google-analytics
train
py
39e886115f703b50d7257c51a3db4d9b4709acb3
diff --git a/lib/metadata/linux/LinuxSystemd.rb b/lib/metadata/linux/LinuxSystemd.rb index <HASH>..<HASH> 100644 --- a/lib/metadata/linux/LinuxSystemd.rb +++ b/lib/metadata/linux/LinuxSystemd.rb @@ -53,7 +53,6 @@ module MiqLinux end def parse_service(file) - return if @fs.fileSymLink?(file) debug "Parsing service unit: #{file}" unit = @fs.fileBasename(file)
Added the missing change to remove symlinks filter (transferred from ManageIQ/manageiq-gems-pending@<I>f<I>ff<I>a<I>cbb<I>de<I>f<I>e2)
ManageIQ_manageiq-smartstate
train
rb
cb7cfe3b96e941e6f22322d7e8eb0cc138af3b90
diff --git a/store.js b/store.js index <HASH>..<HASH> 100644 --- a/store.js +++ b/store.js @@ -89,7 +89,7 @@ storage = doc.createElement('div') storageOwner = doc.body } - function withIEStorage(storeFunction) { + var withIEStorage = function(storeFunction) { return function() { var args = Array.prototype.slice.call(arguments, 0) args.unshift(storage)
Make withIEStorage strict compatible Had some issues with the strict mode, this one fixes it.
marcuswestin_store.js
train
js
975996157f4cc35490acc69d98ce6582d81af93a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -200,6 +200,9 @@ amazon = [ pandas_requirement, 'mypy-boto3-rds>=1.21.0', 'mypy-boto3-redshift-data>=1.21.0', + # XML to dict 0.13.0 breaks some EMR tests + # It should be removed once we solve https://github.com/apache/airflow/issues/23576 + 'xmltodict<0.13.0', ] apache_beam = [ 'apache-beam>=2.33.0',
Temporarily pin xmltodict to <I> to fix main failure (#<I>) The xmltodict 0,<I> breaks some tests and likely <I> is buggy as the error is ValueError: Malformatted input. We pin it to <I> to fix the main failing. Related: #<I>
apache_airflow
train
py
969fa4f193cc16b68de73e1c3bccc58dfbadeaf2
diff --git a/code/extensions/WorkflowApplicable.php b/code/extensions/WorkflowApplicable.php index <HASH>..<HASH> 100755 --- a/code/extensions/WorkflowApplicable.php +++ b/code/extensions/WorkflowApplicable.php @@ -40,7 +40,7 @@ class WorkflowApplicable extends DataObjectDecorator { } $fields->addFieldsToTab('Root.Workflow', array( - new HeaderField('AppliedWorkflowHeader', _t('WorkflowApplicable.WORKFLOW', 'Workflow')), + new HeaderField('AppliedWorkflowHeader', _t('WorkflowApplicable.APPLIEDWORKFLOW', 'Applied Workflow')), new DropdownField('WorkflowDefinitionID', _t('WorkflowApplicable.DEFINITION', 'Applied Workflow'), $definitions), new ReadonlyField('EffectiveWorkflow',
MINOR: Fixed type in Workflow header - it should have been Applied Workflow.
symbiote_silverstripe-advancedworkflow
train
php
5bf2ad29a61128ad103cfee5f6a218d1873a9268
diff --git a/lib/hexdump/dumper.rb b/lib/hexdump/dumper.rb index <HASH>..<HASH> 100644 --- a/lib/hexdump/dumper.rb +++ b/lib/hexdump/dumper.rb @@ -179,7 +179,7 @@ module Hexdump if @word_size == 1 @format_cache = Hash.new do |hash,key| - hash[key] = (@format % key) + hash[key] = sprintf(@format,key) end end end @@ -360,7 +360,7 @@ module Hexdump @format_cache[word] end else - (@format % word) + sprintf(@format,word) end end
Use sprintf, as it shaves some time off the benchmarks.
postmodern_hexdump
train
rb
9c0fc8f9989152d63c450712d6abd08bf7253538
diff --git a/gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/kafka/client/AbstractBaseKafkaConsumerClient.java b/gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/kafka/client/AbstractBaseKafkaConsumerClient.java index <HASH>..<HASH> 100644 --- a/gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/kafka/client/AbstractBaseKafkaConsumerClient.java +++ b/gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/kafka/client/AbstractBaseKafkaConsumerClient.java @@ -162,4 +162,13 @@ public abstract class AbstractBaseKafkaConsumerClient implements GobblinKafkaCon * Get a list of all kafka topics */ public abstract List<KafkaTopic> getTopics(); + + /** + * Get a list of {@link KafkaTopic} with the provided topic names. + * The default implementation lists all the topics. + * Implementations of this class can improve this method. + */ + public Collection<KafkaTopic> getTopics(Collection<String> topics) { + return getTopics(); + } }
add an API in AbstractBaseKafkaConsumerClient to list selected topics (#<I>)
apache_incubator-gobblin
train
java
0e67304485c2b2393afa3a24e800fd94988d16b6
diff --git a/src/com/inet/lib/less/ReaderFactory.java b/src/com/inet/lib/less/ReaderFactory.java index <HASH>..<HASH> 100644 --- a/src/com/inet/lib/less/ReaderFactory.java +++ b/src/com/inet/lib/less/ReaderFactory.java @@ -47,7 +47,7 @@ public class ReaderFactory { * @throws IOException * If any I/O error occur on reading the URL. */ - Reader create( URL url ) throws IOException { + public Reader create( URL url ) throws IOException { return new InputStreamReader( url.openStream(), StandardCharsets.UTF_8 ); } }
Methods must be public fix #<I>
i-net-software_jlessc
train
java
0b0475e184aa73e0d2fd0f0d87547edf99749099
diff --git a/src/org/openscience/cdk/io/MDLWriter.java b/src/org/openscience/cdk/io/MDLWriter.java index <HASH>..<HASH> 100644 --- a/src/org/openscience/cdk/io/MDLWriter.java +++ b/src/org/openscience/cdk/io/MDLWriter.java @@ -167,6 +167,9 @@ public class MDLWriter implements CDKConstants, ChemObjectWriter { line = ""; line += formatMDLFloat((float) atom.getX2D()); line += formatMDLFloat((float) atom.getY2D()); + if(atom.getZ3D()!=0) + line += formatMDLFloat((float) atom.getZ3D())+" "; + else line += " 0.0000 "; line += formatMDLString(molecule.getAtomAt(f).getSymbol(), 3); line += " 0 0 0 0 0 0 0 0 0 0 0 0"; @@ -280,3 +283,4 @@ public class MDLWriter implements CDKConstants, ChemObjectWriter { } +
The MDLWriter just took <I> for the Z coordinate; I changed it to insert Z if there is one git-svn-id: <URL>
cdk_cdk
train
java
96137f026fd222f4158f5d79f7dd8994b3b03b02
diff --git a/src/runner.js b/src/runner.js index <HASH>..<HASH> 100644 --- a/src/runner.js +++ b/src/runner.js @@ -60,14 +60,16 @@ module.exports = function(options) { pass: function(data) { data = Object.assign({ - status: 'passed' + status: 'passed', + state: 'passed' }, data); this.call('tests', 'patch', data.id, data); }, fail: function(data) { data = Object.assign({ - status: 'failed' + status: 'failed', + state: 'failed' }, data); this.call('tests', 'patch', data.id, data); },
Adding state to passed and failed tests so Mocha reporters work properly (#<I>)
bitovi_testee-client
train
js
4cce3c74ec4ddb6a82dec4865f33a2942bd986ae
diff --git a/Migrations/Version20130530152255.php b/Migrations/Version20130530152255.php index <HASH>..<HASH> 100644 --- a/Migrations/Version20130530152255.php +++ b/Migrations/Version20130530152255.php @@ -29,13 +29,13 @@ class Version20130530152255 extends BundleMigration public function down(Schema $schema) { //Marche pas et aucune idée de pourquoi, merci le migrationBundle - $this->addSql("DELETE FROM `icap__associated_tag` WHERE `taggableClass` = 'ICAP\\BlogBundle\\Entity\\Post'"); - $schema ->dropTable('icap__blog_comment') ->dropTable('icap__blog_post') ->dropTable('icap__blog_options') ->dropTable('icap__blog') + ->dropTable('icap__blog_tag') + ->dropTable('icap__blog_post_tag') ; }
[BlogBundle] Deleting tables when uninstalling plugin
claroline_Distribution
train
php
3f12e2e1c316683378da5c35069abfc9f4d566f7
diff --git a/blocks/header/header__hub-services.js b/blocks/header/header__hub-services.js index <HASH>..<HASH> 100644 --- a/blocks/header/header__hub-services.js +++ b/blocks/header/header__hub-services.js @@ -1,12 +1,13 @@ define(['jquery', 'global/global__modules', 'header/header', 'auth/auth'], function ($, Module) { 'use strict'; - var convertServices = function(services) { + var convertServices = function(services, activeServiceId) { var items = []; for (var i = 0; i < services.length; ++i) { var service = services[i]; items.push({ + active: service.id === activeServiceId, label: service.name, url: service.homeUrl }); @@ -34,7 +35,8 @@ define(['jquery', 'global/global__modules', 'header/header', 'auth/auth'], funct var headerServices = header.get('view').services || []; if (list) { - header('update', 'services', headerServices.concat(convertServices(list))); + var clientServiceId = (auth.get('config') || {}).client_id; + header('update', 'services', headerServices.concat(convertServices(list, clientServiceId))); header.trigger('services:done'); } else { header.trigger('services:fail');
Make service with an id of the client to be active in the hub header Former-commit-id: a<I>f<I>f0c<I>f<I>f2af5c8ddb2f<I>b<I>e<I>
JetBrains_ring-ui
train
js
cbbdba89b143ade3bd63f2c565d0040e34f61756
diff --git a/staging/src/k8s.io/legacy-cloud-providers/azure/metrics/azure_metrics.go b/staging/src/k8s.io/legacy-cloud-providers/azure/metrics/azure_metrics.go index <HASH>..<HASH> 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/azure/metrics/azure_metrics.go +++ b/staging/src/k8s.io/legacy-cloud-providers/azure/metrics/azure_metrics.go @@ -115,6 +115,7 @@ func registerAPIMetrics(attributes ...string) *apiCallMetrics { Namespace: azureMetricsNamespace, Name: "api_request_duration_seconds", Help: "Latency of an Azure API call", + Buckets: []float64{.1, .25, .5, 1, 2.5, 5, 10, 15, 25, 50, 120, 300, 600, 1200}, StabilityLevel: metrics.ALPHA, }, attributes,
use more granular buckets for azure api calls
kubernetes_kubernetes
train
go
89d6ccaf3fa5c6b767c3b352fabb60b48f0b915d
diff --git a/tests/TestCase.php b/tests/TestCase.php index <HASH>..<HASH> 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -10,7 +10,7 @@ use Orchestra\Testbench\TestCase as Orchestra; abstract class TestCase extends Orchestra { /** - * @param \Illuminate\Foundation\Application $app + * @param \Illuminate\Foundation\Application $app * * @return array|string[] */
Apply fixes from StyleCI (#<I>)
codedge_laravel-fpdf
train
php
059007b205b51533c47f099ff0d4af79ddfcdaa6
diff --git a/src/widgets/TbHighCharts.php b/src/widgets/TbHighCharts.php index <HASH>..<HASH> 100644 --- a/src/widgets/TbHighCharts.php +++ b/src/widgets/TbHighCharts.php @@ -86,7 +86,6 @@ class TbHighCharts extends CWidget } $options = CJavaScript::encode($this->options); - var_dump($options); Yii::app()->getClientScript()->registerScript( __CLASS__ . '#' . $this->getId(),
Note that in previous commit there were change from `CJavaScript::jsonEncode` to `CJavaScript::encode` when processing options for `TbHighCharts` closes #<I> re #<I>
clevertech_YiiBooster
train
php
a2484711e55ac20fe9ea23197fc134597c95d859
diff --git a/pact/pact-runtime/src/main/java/eu/stratosphere/pact/runtime/plugable/PactRecordAccessors.java b/pact/pact-runtime/src/main/java/eu/stratosphere/pact/runtime/plugable/PactRecordAccessors.java index <HASH>..<HASH> 100644 --- a/pact/pact-runtime/src/main/java/eu/stratosphere/pact/runtime/plugable/PactRecordAccessors.java +++ b/pact/pact-runtime/src/main/java/eu/stratosphere/pact/runtime/plugable/PactRecordAccessors.java @@ -303,6 +303,7 @@ public final class PactRecordAccessors implements TypeAccessors<PactRecord> lenBytes++; } val |= curr << shift; + lenBytes++; } return val + lenBytes; }
Fixed deserialization bug in PactRecord accessors.
apache_flink
train
java
06bddb8de79cc34cff2959d787d5196c77c2a760
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -702,6 +702,11 @@ gulp.task('production', ['clean:dist', 'css:lint:break', 'js:lint:break'], () => runSequence(['css:dist', 'js:dist', 'img:dist', 'copy:dist']) }) +/* TEST + * ========================================================================== */ + +gulp.task('test', ['css:lint:break', 'js:lint:break']) + /* DEFAULT * ========================================================================== */
Add `gulp test` for linting only
pangolinjs_core
train
js
f5f79164d47a9e8082ee9a9267ac2ef9c4b9b22f
diff --git a/lib/errship.rb b/lib/errship.rb index <HASH>..<HASH> 100644 --- a/lib/errship.rb +++ b/lib/errship.rb @@ -22,7 +22,7 @@ module Errship base.rescue_from ActionController::UnknownAction, :with => :render_404_error end end - + def render_error(exception) HoptoadNotifier.notify(exception) if defined?(HoptoadNotifier) @@ -31,15 +31,10 @@ module Errship end def render_404_error(exception = nil) - - # Workaround pre-Rails 3.1 for rescue_from RoutingError - # A catchall route ends up here with params[:address] as the unknown route - exception = ActionController::RoutingError.new(%(No route matches "/#{params[:address]}")) if params[:address] - @page_title = 'Page Not Found' render :template => '/errship/standard', :locals => { :status_code => 404 } end - + # A blank page with just the layout and flash message, which can be redirected to when # all else fails. def errship_standard
Remove stale code related to Hoptoad notification of routing errors
logankoester_errship
train
rb
61aab8c91f8a2bb074f69dbf4cab407c02bc582c
diff --git a/hid.go b/hid.go index <HASH>..<HASH> 100644 --- a/hid.go +++ b/hid.go @@ -23,6 +23,7 @@ type Device interface { Open() error Close() Info() Info + SetEndpoint(int) HIDReport() ([]byte, error) SetReport(int, []byte) error GetReport(int) ([]byte, error) diff --git a/usb_linux.go b/usb_linux.go index <HASH>..<HASH> 100644 --- a/usb_linux.go +++ b/usb_linux.go @@ -27,6 +27,11 @@ type usbDevice struct { path string } +func (hid *usbDevice) SetEndpoint(ep int) { + hid.epOut = ep + hid.epIn = ep + 0x80 +} + func (hid *usbDevice) Open() (err error) { if hid.f != nil { return errors.New("device is already opened") @@ -34,7 +39,7 @@ func (hid *usbDevice) Open() (err error) { if hid.f, err = os.OpenFile(hid.path, os.O_RDWR, 0644); err != nil { return } else { - return hid.claim() + return nil //hid.claim() } }
add the ability to explicitly set endpoints
zserge_hid
train
go,go
2201ee7f4a7bcd75ef17884ef90c40a40f9e8302
diff --git a/swift.go b/swift.go index <HASH>..<HASH> 100644 --- a/swift.go +++ b/swift.go @@ -580,6 +580,7 @@ func readJson(resp *http.Response, result interface{}) (err error) { // ContainersOpts is options for Containers() and ContainerNames() type ContainersOpts struct { Limit int // For an integer value n, limits the number of results to at most n values. + Prefix string // Given a string value x, return container names matching the specified prefix. Marker string // Given a string value x, return object names greater in value than the specified marker. EndMarker string // Given a string value x, return container names less in value than the specified marker. Headers Headers // Any additional HTTP headers - can be nil @@ -593,6 +594,9 @@ func (opts *ContainersOpts) parse() (url.Values, Headers) { if opts.Limit > 0 { v.Set("limit", strconv.Itoa(opts.Limit)) } + if opts.Prefix != "" { + v.Set("prefix", opts.Prefix) + } if opts.Marker != "" { v.Set("marker", opts.Marker) }
Add Prefix variable into ContainersOpts and propagate it into container listing request
ncw_swift
train
go
774c4d2abe1a9d5ae49f3a0e9318ecc95f01d66a
diff --git a/src/hooks/HooksRunner.js b/src/hooks/HooksRunner.js index <HASH>..<HASH> 100644 --- a/src/hooks/HooksRunner.js +++ b/src/hooks/HooksRunner.js @@ -15,18 +15,17 @@ under the License. */ -var cordovaUtil = require('../cordova/util'); -var events = require('cordova-common').events; -var Q = require('q'); -var scriptsFinder = require('./scriptsFinder'); -var Context = require('./Context'); -var CordovaError = require('cordova-common').CordovaError; -var path = require('path'); -var fs = require('fs'); -var os = require('os'); -var superspawn = require('cordova-common').superspawn; - -var isWindows = os.platform().slice(0, 3) === 'win'; +const fs = require('fs'); +const os = require('os'); +const path = require('path'); +const Q = require('q'); + +const cordovaUtil = require('../cordova/util'); +const scriptsFinder = require('./scriptsFinder'); +const Context = require('./Context'); +const { CordovaError, events, superspawn } = require('cordova-common'); + +const isWindows = os.platform().slice(0, 3) === 'win'; /** * Tries to create a HooksRunner for passed project root.
Organize imports in HooksRunner.spec (#<I>) Minor cleanup of the imports in HooksRunner.spec. No functional changes.
apache_cordova-lib
train
js
3f8e69949372a6957457d737e27aae80dd74954c
diff --git a/cmd/dev.go b/cmd/dev.go index <HASH>..<HASH> 100644 --- a/cmd/dev.go +++ b/cmd/dev.go @@ -67,6 +67,8 @@ func devCmdRun(cmd *cobra.Command, args []string) { os.Exit(1) } }() + // Delay build so terminal output is grouped together for first run. + time.Sleep(1500 * time.Millisecond) go func() { err := startRefresh(ctx) if err != nil {
delay dev command refresh build for cleaner output
volatiletech_abcweb
train
go
118517aae9431109cd50e35f97137af0f67ac6a0
diff --git a/data/data.js b/data/data.js index <HASH>..<HASH> 100644 --- a/data/data.js +++ b/data/data.js @@ -76,18 +76,18 @@ const resources = [ _t: 'tradle.IDCardType', idCardType: 'Passport' }, -{ - _t: 'tradle.IDCardType', - idCardType: 'ID Card' -}, +// { +// _t: 'tradle.IDCardType', +// idCardType: 'ID Card' +// }, { _t: 'tradle.IDCardType', idCardType: 'Driver licence' }, -{ - _t: "tradle.IDCardType", - idCardType: 'Residence permit' -}, +// { +// _t: "tradle.IDCardType", +// idCardType: 'Residence permit' +// }, { _t: 'tradle.SourceOfIncome', sourceOfIncome: 'Employed'
scrap ID Card and Residence permit idCardTypes for now
tradle_models
train
js
933672fd0191134f97d8a47cd1c6d140bcee81b6
diff --git a/lib/workers/pr/changelog/index.js b/lib/workers/pr/changelog/index.js index <HASH>..<HASH> 100644 --- a/lib/workers/pr/changelog/index.js +++ b/lib/workers/pr/changelog/index.js @@ -7,14 +7,8 @@ module.exports = { }; const cacheNamespace = 'changelog'; -function getCacheKey({ - versionScheme, - fromVersion, - toVersion, - repositoryUrl, - releases, -}) { - return `${repositoryUrl}-${versionScheme}-${fromVersion}-${toVersion}-${ +function getCacheKey({ repositoryUrl, releases }) { + return `${repositoryUrl}-${ releases ? releases.map(release => release.version).join('-') : '' }`; }
refactor: simplify changelog cache key
renovatebot_renovate
train
js
c9c3a43223961764232843c81baedeb3c958d80e
diff --git a/splits/readers.py b/splits/readers.py index <HASH>..<HASH> 100644 --- a/splits/readers.py +++ b/splits/readers.py @@ -1,5 +1,3 @@ -import copy - from splits.util import path_for_part class SplitReader(object): @@ -7,7 +5,7 @@ class SplitReader(object): fileClass=open, fileArgs={'mode': 'r'}): self.fileClass = fileClass - self.fileArgs = copy.deepcopy(fileArgs) + self.fileArgs = fileArgs if type(manifest_path_or_list) == list: self.manifest = iter(self._get_files(manifest_path_or_list)) diff --git a/splits/writers.py b/splits/writers.py index <HASH>..<HASH> 100644 --- a/splits/writers.py +++ b/splits/writers.py @@ -1,5 +1,4 @@ import os -import copy from splits.util import path_for_part @@ -14,7 +13,7 @@ class SplitWriter(object): self.basepath = basepath self.lines_per_file = lines_per_file self.fileClass = fileClass - self.fileArgs = copy.deepcopy(fileArgs) + self.fileArgs = fileArgs self._seqnum = 0 self._linenum = 0 self._filelinenum = 0
dont deepcopy fileargs; makes it possible to pass s3 connection
stitchfix_splits
train
py,py
26af52b7631a0227254cadcfed5b374ecd4bc485
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -105,6 +105,9 @@ def wait_for_unassignment(consumer) end RSpec.configure do |config| + config.filter_run focus: true + config.run_all_when_everything_filtered = true + config.before(:suite) do admin = rdkafka_config.admin {
Setup 'focus' specs setting This makes possible to run specs individually --- Changelog: test
appsignal_rdkafka-ruby
train
rb
71fd8dd89ba46d88d4a20cb030a850a6b9a8b21e
diff --git a/src/Message/RestAuthorizeResponse.php b/src/Message/RestAuthorizeResponse.php index <HASH>..<HASH> 100644 --- a/src/Message/RestAuthorizeResponse.php +++ b/src/Message/RestAuthorizeResponse.php @@ -41,4 +41,4 @@ class RestAuthorizeResponse extends RestResponse implements RedirectResponseInte { return null; } -} \ No newline at end of file +} diff --git a/src/Message/RestCompletePurchaseRequest.php b/src/Message/RestCompletePurchaseRequest.php index <HASH>..<HASH> 100644 --- a/src/Message/RestCompletePurchaseRequest.php +++ b/src/Message/RestCompletePurchaseRequest.php @@ -27,4 +27,4 @@ class RestCompletePurchaseRequest extends AbstractRestRequest { return parent::getEndpoint() . '/payments/payment/' . $this->getTransactionReference() . '/execute'; } -} \ No newline at end of file +}
Fixing new lines at end of files.
thephpleague_omnipay-paypal
train
php,php
f6f42cb16a51a5b482ab65da2a17060ff2051614
diff --git a/src/main/java/nebula/plugin/metrics/dispatcher/ESClientMetricsDispatcher.java b/src/main/java/nebula/plugin/metrics/dispatcher/ESClientMetricsDispatcher.java index <HASH>..<HASH> 100644 --- a/src/main/java/nebula/plugin/metrics/dispatcher/ESClientMetricsDispatcher.java +++ b/src/main/java/nebula/plugin/metrics/dispatcher/ESClientMetricsDispatcher.java @@ -266,7 +266,8 @@ public final class ESClientMetricsDispatcher extends AbstractQueuedExecutionThre try { XContentBuilder jsonBuilder = jsonBuilder(); jsonBuilder.startObject().startObject("mappings").startObject(BUILD_TYPE); - jsonBuilder.startObject("_timestamp").field("enabled", true).field("path", "build.startTime").endObject(); + // Disable _timestamp path mapping. It's causing https://github.com/elastic/elasticsearch/issues/4718 against earlier versions of ES, and I'm not sure it's working anyway + // jsonBuilder.startObject("_timestamp").field("enabled", true).field("path", "build.startTime").endObject(); jsonBuilder.startObject("properties"); for (Map.Entry<String, List<String>> entry : nestedTypes.entrySet()) { String type = entry.getKey();
Fix Exception in thread ESClientMetricsDispatcher org.elasticsearch.ElasticsearchParseException: failed to parse doc to extract routing/timestamp/id
nebula-plugins_gradle-metrics-plugin
train
java
fd142f774b22fbd82c8d0feadae9696ace6d2b0f
diff --git a/reaction.py b/reaction.py index <HASH>..<HASH> 100644 --- a/reaction.py +++ b/reaction.py @@ -119,7 +119,7 @@ class ModelSEED(object): tokens = list(cls._tokenize(s)) direction = None for i, t in enumerate(tokens): - if t in ('<=', '<=>', '=>', ''): + if t in ('<=', '<=>', '=>', '?', ''): direction = t left = tokens[:i] right = tokens[i+1:]
reaction: Fix parse of unknown direction
zhanglab_psamm
train
py
7be2226eab684c18b74c5c28db8de9335560ffc3
diff --git a/owners_generate.go b/owners_generate.go index <HASH>..<HASH> 100644 --- a/owners_generate.go +++ b/owners_generate.go @@ -40,7 +40,10 @@ func main() { o, err = owners(p, o) return err }) - + if err != nil { + log.Fatal(err) + } + // sort it and format it list := []string{} for k := range o {
fix ineffectual assignment to err (#<I>)
coredns_coredns
train
go
b91eef070db6ebe1ef7654e24c33d6eb9f0fca80
diff --git a/src/ajax.js b/src/ajax.js index <HASH>..<HASH> 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -144,7 +144,9 @@ jQuery.extend({ contentType: "application/x-www-form-urlencoded", processData: true, async: true, - data: null + data: null, + username: null, + password: null }, // Last-Modified header cache for next request @@ -258,7 +260,7 @@ jQuery.extend({ var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); // Open the socket - xml.open(s.type, s.url, s.async); + xml.open(s.type, s.url, s.async, s.username, s.password); // Need an extra try/catch for cross domain requests in Firefox 3 try {
Adds support for username and password to $.ajax
jquery_jquery
train
js
f8345882d207ddeaaad3590c1b4e6da9e2d5dccb
diff --git a/src/core/text/Text.js b/src/core/text/Text.js index <HASH>..<HASH> 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -300,6 +300,13 @@ Text.prototype.updateText = function (respectDirty) if (style.fill) { this.drawLetterSpacing(lines[i], linePositionX + xShadowOffset, linePositionY + yShadowOffset + style.padding); + + if (style.stroke && style.strokeThickness) + { + this.context.strokeStyle = style.dropShadowColor; + this.drawLetterSpacing(lines[i], linePositionX + xShadowOffset, linePositionY + yShadowOffset + style.padding, true); + this.context.strokeStyle = style.stroke; + } } } }
Takes into account stroke thickness when drawing dropShadow
pixijs_pixi.js
train
js
d57a9d7ab59243e78836fb7bd4120106071a3d49
diff --git a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/library/SingleSourceShortestPaths.java b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/library/SingleSourceShortestPaths.java index <HASH>..<HASH> 100644 --- a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/library/SingleSourceShortestPaths.java +++ b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/library/SingleSourceShortestPaths.java @@ -71,10 +71,8 @@ public class SingleSourceShortestPaths<K extends Comparable<K> & Serializable> i } if (vertexValue > minDistance) { - vertexValue = minDistance; + setNewVertexValue(minDistance); } - - setNewVertexValue(vertexValue); } }
[FLINK-<I>] [gelly] [sssp example] only update the vertex value if new distance is smaller
apache_flink
train
java
bfbb508504ff84fa23151c68a6a6dc0da5fb038e
diff --git a/ioex/calcex.py b/ioex/calcex.py index <HASH>..<HASH> 100644 --- a/ioex/calcex.py +++ b/ioex/calcex.py @@ -90,3 +90,12 @@ class Figure(object): raise UnitMismatchError('{} - {}'.format(self, other)) else: return type(self)(value=self.value - other.value, unit=self.unit) + + def __mul__(self, factor): + if isinstance(factor, Figure): + assert not self.value is None + assert not factor.value is None + assert factor.unit is None + return type(self)(value=self.value * factor.value, unit=self.unit) + else: + return self * Figure(value=factor, unit=None) diff --git a/tests/calcex/test_figure.py b/tests/calcex/test_figure.py index <HASH>..<HASH> 100644 --- a/tests/calcex/test_figure.py +++ b/tests/calcex/test_figure.py @@ -182,3 +182,12 @@ def test_sub_persistent(): b.value = 4 b.unit[0] = 'l' assert Figure(-1, ['m']) == d + + +@pytest.mark.parametrize(('a', 'b', 'expected_product'), [ + [Figure(1, 'm'), Figure(2), Figure(2, 'm')], + [Figure(1, 'm'), 2, Figure(2, 'm')], + [Figure(2, 'm'), -1.5, Figure(-3, 'm')], +]) +def test_mult(a, b, expected_product): + assert expected_product == a * b
calcex.Figure: overload * operator
fphammerle_ioex
train
py,py
d88f6aead6ecc025eb447c4df4a36f6dc4a963fe
diff --git a/lib/Unexpected.js b/lib/Unexpected.js index <HASH>..<HASH> 100644 --- a/lib/Unexpected.js +++ b/lib/Unexpected.js @@ -1037,7 +1037,7 @@ Unexpected.prototype.expect = function expect(subject, testDescriptionString) { }; wrappedExpect.argsOutput = args.map(function (arg, i) { var argRule = wrappedExpect.assertionRule.args[i]; - if (typeof arg === 'string' && argRule && (argRule.type === AssertionStringType || wrappedExpect._getAssertionIndices().indexOf(i) >= 0)) { + if (typeof arg === 'string' && (argRule && (argRule.type === AssertionStringType) || wrappedExpect._getAssertionIndices().indexOf(i) >= 0)) { return new AssertionString(arg); }
wrappedExpect.argsOutput: Being a string listed in assertionIndices is sufficient to be rendered as an assertion.
unexpectedjs_unexpected
train
js
12b069d5526aa56540494157b0783e5c022df495
diff --git a/lib/ciri/evm/state.rb b/lib/ciri/evm/state.rb index <HASH>..<HASH> 100644 --- a/lib/ciri/evm/state.rb +++ b/lib/ciri/evm/state.rb @@ -43,7 +43,7 @@ module Ciri # get ancestor hash def get_ancestor_hash(current_hash, ancestor_distance) if ancestor_distance > 256 || ancestor_distance < 0 - 0 + ''.b elsif ancestor_distance == 0 current_hash else
EVM BLOCKHASH op return blank string if can't find block hash
ciri-ethereum_ciri
train
rb
83e6f7d3035b6bff0fa871b541da882f25bc0365
diff --git a/widgets/TbNavbar.php b/widgets/TbNavbar.php index <HASH>..<HASH> 100644 --- a/widgets/TbNavbar.php +++ b/widgets/TbNavbar.php @@ -34,7 +34,6 @@ class TbNavbar extends CWidget */ public $display = TbHtml::NAVBAR_DISPLAY_FIXEDTOP; /** - * @deprecated All containers are fluid in BS3 * @var boolean whether the navbar spans over the whole page. */ public $fluid = false; @@ -124,7 +123,7 @@ class TbNavbar extends CWidget } $containerContent = ob_get_clean(); $containerOptions = TbArray::popValue('containerOptions', $this->htmlOptions, array()); - TbHtml::addCssClass('container', $containerOptions); + TbHtml::addCssClass($this->fluid ? 'container-fluid' : 'container', $containerOptions); ob_start(); echo TbHtml::openTag('div', $containerOptions); echo $containerContent;
Navbar container will now use .container-fluid class when $fluid is set to true.
crisu83_yiistrap
train
php
2f756fa9bf95f2efa9539652b36209a371121c1f
diff --git a/code/MenuAdmin.php b/code/MenuAdmin.php index <HASH>..<HASH> 100644 --- a/code/MenuAdmin.php +++ b/code/MenuAdmin.php @@ -25,6 +25,11 @@ class MenuAdmin extends ModelAdmin * @var string */ private static $menu_title = 'Menu Management'; + + /** + * @var string + */ + private static $menu_icon_class = 'font-icon-list'; /** * @var array
Updated modelAdmin to use new icons
heyday_silverstripe-menumanager
train
php
56396254375e7f76b8bcb8a4e334a60c1da2e532
diff --git a/deal/linter/_extractors/value.py b/deal/linter/_extractors/value.py index <HASH>..<HASH> 100644 --- a/deal/linter/_extractors/value.py +++ b/deal/linter/_extractors/value.py @@ -19,9 +19,11 @@ def get_value(expr): return ast.literal_eval(expr) if isinstance(expr, astroid.node_classes.NodeNG): - renderred = expr.as_string() - with suppress(ValueError, SyntaxError): - return ast.literal_eval(renderred) + # AttributeError: 'AsStringVisitor3' object has no attribute 'visit_unknown' + with suppress(AttributeError): # pragma: no cover + renderred = expr.as_string() + with suppress(ValueError, SyntaxError): + return ast.literal_eval(renderred) handler = inner_extractor.handlers.get(type(expr)) if handler:
suppres one real-world error
orsinium_deal
train
py
ff8f80e7a314e8a9a40da09494accb190eeebe01
diff --git a/ietfparse/compat/parse.py b/ietfparse/compat/parse.py index <HASH>..<HASH> 100644 --- a/ietfparse/compat/parse.py +++ b/ietfparse/compat/parse.py @@ -41,7 +41,17 @@ except ImportError: urlencode as _urlencode, ) from urlparse import urlsplit, urlunsplit - unquote_to_bytes = unquote + + # unquote_to_bytes is extremely useful when you need to cleanly + # unquote a percent-encoded UTF-8 sequence into a unicode string + # in either Python 2.x or 3.x with unicode_literals enabled. + # The only good way that I could find to do this in Python 2.x + # is to take advantage of the "raw_unicode_escape" codec. + # + # The return value of this function is the percent decoded raw + # byte string - NOT A UNICODE STRING + def unquote_to_bytes(s): + return unquote(s).encode('raw_unicode_escape') # urlencode did not encode its parameters in Python 2.x so we # need to implement that ourselves for compatibility.
compat.parse: Fix unquote_to_bytes. unquote_to_bytes was broken when it was given a percent-encoded, UTF-8 byte string. It would return a UNICODE string containing the bytes instead of a byte string.
dave-shawley_ietfparse
train
py
e412d7915af99a12bc48f04bfbcfad3765652904
diff --git a/upload/system/library/cache/redis.php b/upload/system/library/cache/redis.php index <HASH>..<HASH> 100644 --- a/upload/system/library/cache/redis.php +++ b/upload/system/library/cache/redis.php @@ -21,7 +21,7 @@ class Redis { $status = $this->cache->set(CACHE_PREFIX . $key, json_encode($value)); if ($status) { - $this->cache->setTimeout(CACHE_PREFIX . $key, $this->expire); + $this->cache->expire(CACHE_PREFIX . $key, $this->expire); } return $status; @@ -30,4 +30,4 @@ class Redis { public function delete($key) { $this->cache->delete(CACHE_PREFIX . $key); } -} \ No newline at end of file +}
Replace setTimeout with expire setTimeout is an alias for expire and will be removed in future versions of phpredis (is already deprecated).
opencart_opencart
train
php
581ced6469f1b3e5d8d0a26fb5e2e64fcd0226ed
diff --git a/linkedin/linkedin.py b/linkedin/linkedin.py index <HASH>..<HASH> 100644 --- a/linkedin/linkedin.py +++ b/linkedin/linkedin.py @@ -334,6 +334,22 @@ class LinkedInApplication(object): raise LinkedInError(response) return True + def get_company_by_email_domain(self, email_domain, params=None, headers=None): + identifiers = [] + url = ENDPOINTS.COMPANIES + + url = '%s?email-domain=%s' % (url, email_domain) + + try: + response = self.make_request('GET', url, params=params, headers=headers) + response = response.json() + except requests.ConnectionError as error: + raise LinkedInHTTPError(error.message) + else: + if not self.request_succeeded(response): + raise LinkedInError(response) + return response + def get_companies(self, company_ids=None, universal_names=None, selectors=None, params=None, headers=None): identifiers = []
Add call to get company information by domain.
ozgur_python-linkedin
train
py
1beda3d3efd0e2d94f42c385c9c4337ecd236452
diff --git a/auto_ml/predictor.py b/auto_ml/predictor.py index <HASH>..<HASH> 100644 --- a/auto_ml/predictor.py +++ b/auto_ml/predictor.py @@ -212,7 +212,7 @@ class Predictor(object): def _get_estimator_names(self): if self.type_of_estimator == 'regressor': - base_estimators = ['LGBMRegressor'] + base_estimators = ['GradientBoostingRegressor'] if self.compare_all_models != True: return base_estimators @@ -226,7 +226,7 @@ class Predictor(object): elif self.type_of_estimator == 'classifier': - base_estimators = ['LGBMClassifier'] + base_estimators = ['GradientBoostingClassifier'] if self.compare_all_models != True: return base_estimators
switches back to GradientBoosting as default predictor
ClimbsRocks_auto_ml
train
py
d45c0fa7c812a3f828cd1e056bc3fae863a8a788
diff --git a/lib/3scale/core/version.rb b/lib/3scale/core/version.rb index <HASH>..<HASH> 100644 --- a/lib/3scale/core/version.rb +++ b/lib/3scale/core/version.rb @@ -1,5 +1,5 @@ module ThreeScale module Core - VERSION = '1.2.1' + VERSION = '1.2.2' end end
core: release bugfix version <I>
3scale_pisoni
train
rb
310c93c43e171e70dae8d332eb346bb0ad33ecc4
diff --git a/exchangelib/autodiscover/discovery.py b/exchangelib/autodiscover/discovery.py index <HASH>..<HASH> 100644 --- a/exchangelib/autodiscover/discovery.py +++ b/exchangelib/autodiscover/discovery.py @@ -75,7 +75,7 @@ class Autodiscovery: self._emails_visited = [] # Collects Autodiscover email redirects def discover(self): - self._emails_visited.append(self.email) + self._emails_visited.append(self.email.lower()) # Check the autodiscover cache to see if we already know the autodiscover service endpoint for this email # domain. Use a lock to guard against multiple threads competing to cache information.
Avoid infinite loop: add lower-case email to visited list
ecederstrand_exchangelib
train
py
45c62a7e63e0acd386b446bfdb2deadb5afbf956
diff --git a/src/Provider/Facebook.php b/src/Provider/Facebook.php index <HASH>..<HASH> 100755 --- a/src/Provider/Facebook.php +++ b/src/Provider/Facebook.php @@ -103,7 +103,7 @@ class Facebook extends AbstractProvider $fields = [ 'id', 'name', 'first_name', 'last_name', 'email', 'hometown', 'picture.type(large){url,is_silhouette}', - 'cover{source}', 'gender', 'locale', 'link', 'timezone', 'age_range' + 'gender', 'locale', 'link', 'timezone', 'age_range' ]; // backwards compatibility less than 2.8
The default scopes ('public_profile', 'email') doesn't grant the right to fetch 'cover{source}'
thephpleague_oauth2-facebook
train
php
bf30708e059fb01643a1945a2d18c020a8e0f8dd
diff --git a/src/Segment/DateSegment.php b/src/Segment/DateSegment.php index <HASH>..<HASH> 100644 --- a/src/Segment/DateSegment.php +++ b/src/Segment/DateSegment.php @@ -27,7 +27,8 @@ class DateSegment $this->date = $date; } elseif (is_numeric($date)) { - $this->date = new DateTime("@$date"); + $this->date = new DateTime(); + $this->date->setTimestamp($date); } else { $this->date = new DateTime($date);
bugfix: correct timestamp set for DateSegment
tlapnet_chart
train
php
5b46e0fd6be5f65dd99dd9d4ca1f8f71676bf3e8
diff --git a/src/netlify-identity.js b/src/netlify-identity.js index <HASH>..<HASH> 100644 --- a/src/netlify-identity.js +++ b/src/netlify-identity.js @@ -90,6 +90,7 @@ function instantiateGotrue(APIUrl) { return new GoTrue({ APIUrl: parts.join(""), setCookie: !isLocal }); } if (isLocal) { + store.setIsLocal(isLocal); return null; }
fix: ensure isLocal boolean is set on init
netlify_netlify-identity-widget
train
js
a9fc3b62f661da980845c7529666c6dc1d69a986
diff --git a/spec/bcdatabase/version_spec.rb b/spec/bcdatabase/version_spec.rb index <HASH>..<HASH> 100644 --- a/spec/bcdatabase/version_spec.rb +++ b/spec/bcdatabase/version_spec.rb @@ -3,7 +3,7 @@ require File.expand_path("../spec_helper", File.dirname(__FILE__)) require "bcdatabase/version" describe Bcdatabase do - it "should have a d.d.d version" do - Bcdatabase::VERSION.should =~ /^\d+\.\d+\.\d+$/ + it "should have a d.d.d or d.d.d.text version" do + Bcdatabase::VERSION.should =~ /^\d+\.\d+\.\d+(\.\S+)?$/ end end
This spec should accept .pre versions.
NUBIC_bcdatabase
train
rb
0e0ac3786b47769294ff28d7f23da67b297ec45b
diff --git a/src/main/org/codehaus/groovy/classgen/AsmClassGenerator.java b/src/main/org/codehaus/groovy/classgen/AsmClassGenerator.java index <HASH>..<HASH> 100644 --- a/src/main/org/codehaus/groovy/classgen/AsmClassGenerator.java +++ b/src/main/org/codehaus/groovy/classgen/AsmClassGenerator.java @@ -188,6 +188,8 @@ public class AsmClassGenerator extends ClassGenerator { } catch (GroovyRuntimeException e) { e.setModule(classNode.getModule()); throw e; + } catch (NullPointerException npe) { + throw new GroovyRuntimeException("NPE while processing "+sourceFile, npe); } } @@ -1022,7 +1024,7 @@ public class AsmClassGenerator extends ClassGenerator { int mark = operandStack.getStackLength()-1; MethodCallerMultiAdapter adapter; if (controller.getCompileStack().isLHS()) { - operandStack.box(); + //operandStack.box(); adapter = setProperty; if (isGroovyObject(objectExpression)) adapter = setGroovyObjectProperty; if (controller.isStaticContext() && isThisOrSuper(objectExpression)) adapter = setProperty;
remove unneeded boxing action and improve error reporting a little
apache_groovy
train
java
4e27b6f70f247f45affe96985676429ae962a3aa
diff --git a/lib/dust-helpers.js b/lib/dust-helpers.js index <HASH>..<HASH> 100644 --- a/lib/dust-helpers.js +++ b/lib/dust-helpers.js @@ -316,6 +316,24 @@ var helpers = { }, /** + ne helper compares the given key is not the same as the expected value + It can be used standalone or in conjunction with select for multiple branching + @param key, The actual key to be compared ( optional when helper used in conjunction with select) + either a string literal value or a dust reference + a string literal value, is enclosed in double quotes, e.g. key="foo" + a dust reference may or may not be enclosed in double quotes, e.g. key="{val}" and key=val are both valid + @param value, The expected value to compare to, when helper is used standalone or in conjunction with select + @param type (optional), supported types are number, boolean, string, date, context, defaults to string + Note : use type="number" when comparing numeric + **/ + "eq": function(chunk, context, bodies, params) { + if(params) { + params.filterOpType = "eq"; + } + return filter(chunk, context, bodies, params, function(expected, actual) { return actual !== expected; }); + }, + + /** lt helper compares the given key is less than the expected value It can be used standalone or in conjunction with select for multiple branching @param key, The actual key to be compared ( optional when helper used in conjunction with select)
Add @ne helper as the complement to the @eq helper
linkedin_dustjs-helpers
train
js
d1a84fa020d5faaa26217eb3c6ecaa3c7b366914
diff --git a/comment_frame.go b/comment_frame.go index <HASH>..<HASH> 100644 --- a/comment_frame.go +++ b/comment_frame.go @@ -37,9 +37,6 @@ func (cf CommentFrame) Body() []byte { b := new(bytes.Buffer) b.WriteByte(cf.Encoding.Key) - if cf.Language == "" { - panic("language isn't set up in comment frame with description " + cf.Description) - } b.WriteString(cf.Language) b.WriteString(cf.Description) b.Write(cf.Encoding.TerminationBytes) diff --git a/unsynchronised_lyrics_frame.go b/unsynchronised_lyrics_frame.go index <HASH>..<HASH> 100644 --- a/unsynchronised_lyrics_frame.go +++ b/unsynchronised_lyrics_frame.go @@ -34,9 +34,6 @@ func (uslf UnsynchronisedLyricsFrame) Body() []byte { b := new(bytes.Buffer) b.WriteByte(uslf.Encoding.Key) - if uslf.Language == "" { - panic("language isn't set up in USLT frame with description " + uslf.ContentDescriptor) - } b.WriteString(uslf.Language) b.WriteString(uslf.ContentDescriptor) b.Write(uslf.Encoding.TerminationBytes)
Delete panics with language warnings
bogem_id3v2
train
go,go
d1f86b3017a9cf08c2f102622f275e9a010246b3
diff --git a/numina/core/recipereqs.py b/numina/core/recipereqs.py index <HASH>..<HASH> 100644 --- a/numina/core/recipereqs.py +++ b/numina/core/recipereqs.py @@ -56,16 +56,12 @@ class RecipeRequirements(object): else: raise ValueError(' %r of type %r not defined' % (key, req.type)) - val = req.type.store(val) + nval = req.type.store(val) - if req.choices and (val not in req.choiches): - raise ValueError('%s not in %s' % (val, req.choices)) + if req.choices and (nval not in req.choiches): + raise ValueError('%s not in %s' % (nval, req.choices)) - if req.validate: - valid = req.type.validate(val) - if not valid: - raise ValueError(' %r of type %r not valid' % (val, req.type.python_type)) - setattr(self, key, val) + setattr(self, key, nval) return self
Remove validation in RecipeRequirement construction, only 'store' can fail
guaix-ucm_numina
train
py
f13506aab6bef0c3e269957d9baf09d982f07cc5
diff --git a/build.js b/build.js index <HASH>..<HASH> 100755 --- a/build.js +++ b/build.js @@ -94,12 +94,9 @@ function Builder() { if(process.platform == 'win32') { this.cppCompiler = "cl.exe"; this.linker = "link.exe"; - this.nodeDir = process.env["NODE_PATH"]; + this.nodeDir = process.env["NODE_ROOT"]; } else { - this.nodeDir = process.env["NODE_PATH"] || path.join(process.execPath, '..'); - if(this.nodeDir.match(/node_modules$/)) { - this.nodeDir = path.join(this.nodeDir, '..'); - } + this.nodeDir = process.env["NODE_ROOT"] || path.join(process.execPath, '..'); } if(this.nodeDir) {
Use NODE_ROOT rather than NODE_PATH
joeferner_node-java
train
js
adda47b6a642bd73860ec573ffce43e0683d84c9
diff --git a/lib/master.js b/lib/master.js index <HASH>..<HASH> 100644 --- a/lib/master.js +++ b/lib/master.js @@ -118,7 +118,7 @@ Master.prototype.start = function(){ */ Master.prototype.spawn = function(n){ - while (n--) this.spawnWorker(); + while (n--) this.emit('worker', this.spawnWorker()); }; /** @@ -134,6 +134,5 @@ Master.prototype.spawnWorker = function(){ worker.sock.write('test', 'ascii', this.sock); var id = this.children.push(worker); worker.id = id; - this.emit('worker', worker); return worker; };
Moved worker event emission to Master#spawn()
LearnBoost_cluster
train
js
a0f911a3ee74cd6dbd3285d014f57b1580aa5ae7
diff --git a/lib/wombat/crawler.rb b/lib/wombat/crawler.rb index <HASH>..<HASH> 100644 --- a/lib/wombat/crawler.rb +++ b/lib/wombat/crawler.rb @@ -19,7 +19,7 @@ module Wombat def crawl(url = nil, &block) if block - @metadata_dup = self.class.send(:metadata).clone + @metadata_dup = self.class.metadata.clone instance_eval do alias :old_method_missing :method_missing def method_missing method, *args, &block @@ -34,7 +34,7 @@ module Wombat end parsed else - parse(self.class.send(:metadata), url) + parse(self.class.metadata, url) end end
Call`metadata` method directly It seems `metadata` is a public method. So there is no need to call it via `send` method.
felipecsl_wombat
train
rb
a942320618ecf655f4092f3ffbc02f594070424b
diff --git a/scripts/create-dist.js b/scripts/create-dist.js index <HASH>..<HASH> 100644 --- a/scripts/create-dist.js +++ b/scripts/create-dist.js @@ -1,7 +1,8 @@ #! /usr/bin/env node echo('Cleaning up dist directory'); -rm('-rf', 'dist/*'); +rm('-f', 'dist'); +mkdir('dist'); echo('Optmizing SVG icons'); exec('npm run svgo');
Delete and re-create dist directory
socialshares_buttons
train
js
428de5e8372527755708fda5cddbb4ce0dff0cd7
diff --git a/tests/common/test_z_source_editor.py b/tests/common/test_z_source_editor.py index <HASH>..<HASH> 100644 --- a/tests/common/test_z_source_editor.py +++ b/tests/common/test_z_source_editor.py @@ -170,4 +170,6 @@ def test_gui(caplog): if __name__ == '__main__': - test_gui(None) + # test_gui(None) + import pytest + pytest.main(['-s', __file__])
source editor test: add pytest import and run - the test fails not reproducable add lines to hopefully fix this soon
DLR-RM_RAFCON
train
py
65ad68e39054d7f32f52585bb18d6f80aee667af
diff --git a/lib/modules/apostrophe-docs/lib/cursor.js b/lib/modules/apostrophe-docs/lib/cursor.js index <HASH>..<HASH> 100644 --- a/lib/modules/apostrophe-docs/lib/cursor.js +++ b/lib/modules/apostrophe-docs/lib/cursor.js @@ -237,9 +237,10 @@ module.exports = { var typeSuffix = '-' + (self.get('type') || 'doc'); var permission = self.get('permission'); if (permission !== false) { - if (!permission.match(/\-/)) { + if (permission && (!permission.match(/\-/))) { permission = permission + typeSuffix; } + var p = permission || ('view-' + typeSuffix); self.and(self.apos.permissions.criteria(self.get('req'), permission || ('view-' + typeSuffix))); } }, @@ -492,6 +493,7 @@ module.exports = { // var util = require('util'); // console.log(util.inspect(self.get('criteria'), { depth: 20 })); var mongo = self.db.find(self.get('criteria'), self.get('projection')); + var util = require('util'); mongo.skip(self.get('skip')); mongo.limit(self.get('limit')); mongo.sort(self.get('sort'));
fixed bug we introduced yesterday in permission filter which broke a test. Go team.
apostrophecms_apostrophe
train
js
38e5edea8509c330dfab89e31a3df0f43fb062fd
diff --git a/Eloquent/Relations/BelongsToMany.php b/Eloquent/Relations/BelongsToMany.php index <HASH>..<HASH> 100755 --- a/Eloquent/Relations/BelongsToMany.php +++ b/Eloquent/Relations/BelongsToMany.php @@ -750,6 +750,22 @@ class BelongsToMany extends Relation } /** + * Get a lazy collection for the given query. + * + * @return \Illuminate\Support\LazyCollection + */ + public function cursor() + { + $this->query->addSelect($this->shouldSelect()); + + return $this->query->cursor()->map(function ($model) { + $this->hydratePivotRelation([$model]); + + return $model; + }); + } + + /** * Hydrate the pivot table relationship on the models. * * @param array $models
Fix: Override BelongsToMany::cursor() to hydrate pivot relations (#<I>)
illuminate_database
train
php
719e1203438d40a62cbb3bb67dc58c8eadd615ad
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -351,6 +351,8 @@ def get_extensions(): ffmpeg_exe = distutils.spawn.find_executable('ffmpeg') has_ffmpeg = ffmpeg_exe is not None + if sys.platform != 'linux': + has_ffmpeg = False if has_ffmpeg: try: # this splits on both dots and spaces as the output format differs across versions / platforms @@ -360,7 +362,7 @@ def get_extensions(): if StrictVersion(ffmpeg_version) >= StrictVersion('4.3'): print(f'ffmpeg {ffmpeg_version} not supported yet, please use ffmpeg 4.2.') has_ffmpeg = False - except (IndexError, ValueError): + except (subprocess.CalledProcessError, IndexError, ValueError): print('Error fetching ffmpeg version, ignoring ffmpeg.') has_ffmpeg = False
Ignore platforms other than Linux for ffmpeg (#<I>) * Fix ffmpeg version * Ignore platforms other than Linux for ffmpeg * Removed unnecessary changes
pytorch_vision
train
py
5805bbdc3b9b1a0db833a8bcaac012d80b81feb9
diff --git a/example/verify.js b/example/verify.js index <HASH>..<HASH> 100644 --- a/example/verify.js +++ b/example/verify.js @@ -147,3 +147,5 @@ if( !checksumsMatch ) { console.error( `[ERROR]: Primary & Backup GPT mismatch` ) process.exit( 1 ) } + +fs.closeSync( fd )
verify: Close fd before exiting
jhermsmeier_node-gpt
train
js
1648e77e3302e4a531d987908a4d7a042affdf87
diff --git a/src/BaseMigration.php b/src/BaseMigration.php index <HASH>..<HASH> 100644 --- a/src/BaseMigration.php +++ b/src/BaseMigration.php @@ -12,14 +12,7 @@ class BaseMigration extends Migration { * @return true if this migration is applied */ function isApplied(Connection $db) { - $q = $db->prepare("SHOW TABLES LIKE ?"); - $q->execute(array("migrations")); - - if ($q->fetch()) { - return true; - } else { - return false; - } + return $this->tableExists($db, "migrations"); } /** diff --git a/src/Migration.php b/src/Migration.php index <HASH>..<HASH> 100644 --- a/src/Migration.php +++ b/src/Migration.php @@ -126,4 +126,19 @@ class Migration { return true; } + /** + * Used e.g. in BaseMigration + * @return true if the given table exists + */ + function tableExists(Connection $db, $table) { + $q = $db->prepare("SHOW TABLES LIKE ?"); + $q->execute(array($table)); + + if ($q->fetch()) { + return true; + } else { + return false; + } + } + }
Adding helper method tableExists() to Migration
openclerk_db
train
php,php
6be46d0c9f2b7e8b5d1452b220108f6cd86836de
diff --git a/src/GDS/Mapper/GoogleAPIClient.php b/src/GDS/Mapper/GoogleAPIClient.php index <HASH>..<HASH> 100644 --- a/src/GDS/Mapper/GoogleAPIClient.php +++ b/src/GDS/Mapper/GoogleAPIClient.php @@ -16,6 +16,7 @@ */ namespace GDS\Mapper; use GDS\Entity; +use GDS\Property\Geopoint; use GDS\Schema; /** @@ -105,6 +106,10 @@ class GoogleAPIClient extends \GDS\Mapper $obj_property->setBooleanValue((bool)$mix_value); break; + case Schema::PROPERTY_GEOPOINT: + throw new \RuntimeException('Geopoint properties not supported over JSON API'); + break; + case Schema::PROPERTY_STRING_LIST: $obj_property->setIndexed(null); // Ensure we only index the values, not the list $arr_values = []; @@ -323,6 +328,18 @@ class GoogleAPIClient extends \GDS\Mapper } /** + * Extract a Geopoint value (lat/lon pair) + * + * @param $obj_property + * @return Geopoint + * @throws \Exception + */ + protected function extractGeopointValue($obj_property) + { + throw new \Exception("Geopoint data not supported with JSON API"); + } + + /** * Auto detect & extract a value * * @param object $obj_property
Adhere to interfaces for Geopoint fields, but throw Exceptions as not supported over JSON API
tomwalder_php-gds
train
php
048c6ee2940b3c648f8fa76f64f9acffeb2973ad
diff --git a/lib/scoruby/models/naive_bayes.rb b/lib/scoruby/models/naive_bayes.rb index <HASH>..<HASH> 100644 --- a/lib/scoruby/models/naive_bayes.rb +++ b/lib/scoruby/models/naive_bayes.rb @@ -19,11 +19,15 @@ module Scoruby @labels.each do |label, _| features.each do |feature_name, value| - @labels[label][feature_name] = @data[feature_name][value][label] if @data[feature_name][value] + if @data[feature_name][value] + value_count = @data[feature_name][value][label].to_f + overall_count = @data[feature_name].sum { |_, value| value[label].to_f } + @labels[label][feature_name] = value_count / overall_count + end + # TODO: handle nil # TODO: handle numerical - # TODO: calc sum and ratio # TODO: consider threshold on 0 end end
NaiveBayes - Calculate ratio for each label
asafschers_scoruby
train
rb
276831d9d42d60444053a517e155d240c28c0e8a
diff --git a/milkman.py b/milkman.py index <HASH>..<HASH> 100644 --- a/milkman.py +++ b/milkman.py @@ -1,20 +1,12 @@ import random - +import string try: from django.db.models.fields.related import RelatedField except: pass - _generators = {} -def char_range(lower, upper): - return [chr(x) for x in range(lower, upper+1)] - -ASCII_NUMBERS = char_range(48,57) -ASCII_LOWER = char_range(97,122) -ASCII_UPPER = char_range(65,90) - def gen(choices=[''], size=1): for i in range(0, size): yield random.choice(choices) @@ -30,12 +22,12 @@ def value_for(field): return _generators.get(type(field), lambda f: '')(field) def random_charactor(choices=None): - return random.choice(char_set or ASCII_LOWER) + return random.choice(char_set or string.ascii_letters) def random_string(field=None, chars=None): max_length = getattr(field, 'max_length', 8) if chars is None: - chars = (ASCII_LOWER + ASCII_UPPER + ASCII_NUMBERS) + chars = (string.ascii_letters + string.digits) return ''.join(x for x in gen(chars, max_length)) def deliver(model_class):
used pythons builtin constants for ascii chars
ccollins_milkman
train
py
2588624f14dc7f54c5fc3dcd05a4c1094152818c
diff --git a/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/AgreementRule.java b/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/AgreementRule.java index <HASH>..<HASH> 100644 --- a/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/AgreementRule.java +++ b/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/AgreementRule.java @@ -1101,12 +1101,6 @@ public class AgreementRule extends Rule { csToken("das"), csToken("Sinn") ), - Arrays.asList( // War das Eifersucht oder nur ein Versehen? - pos("SENT_START"), - posRegex("VER.*:3:.*"), - csToken("das"), - posRegex("SUB:.*") - ), Arrays.asList( // Das sind beides Lichtschalter token("das"), csRegex("sind|waren"),
[de] remove old AP for DE_AGREEMENT (#<I>)
languagetool-org_languagetool
train
java
6212f41882be02f062092f05cfef782fed11956e
diff --git a/lib/rocky-lint.js b/lib/rocky-lint.js index <HASH>..<HASH> 100644 --- a/lib/rocky-lint.js +++ b/lib/rocky-lint.js @@ -9,6 +9,16 @@ function copySync(src, dest) { fs.writeFileSync(dest, data); } +/// +/// Allows flow-like inline type comments. +/// +/// function foo(string: /*: any */) { ... } +function copyAndUncommentSync(src, dest) { + const data = fs.readFileSync(src).toString(); + const uncommentedData = data.replace(/\/\*(\s*:\s+[a-zA-Z0-9._]+)\s+\*\//g, '$1') + fs.writeFileSync(dest, uncommentedData); +} + fs.mkdtemp(os.tmpdir(), (err, dir) => { const inputFile = process.argv[2]; const inputBasename = path.basename(inputFile); @@ -28,7 +38,7 @@ fs.mkdtemp(os.tmpdir(), (err, dir) => { const typescriptFile = `${path.basename(inputFile, inputExt)}.ts`; - copySync(inputFile, path.join(dir, typescriptFile)); + copyAndUncommentSync(inputFile, path.join(dir, typescriptFile)); copySync(definitionsFile, path.join(dir, 'rocky.d.ts')) console.error("Working directory: %s", dir);
Replace inline type comments (similar to Flow)
pebble_rocky-lint
train
js
77ebe05f6d30cef5bc973ae685e541b193d5c70c
diff --git a/metrics-core/src/test/java/com/codahale/metrics/SlidingTimeWindowArrayReservoirTest.java b/metrics-core/src/test/java/com/codahale/metrics/SlidingTimeWindowArrayReservoirTest.java index <HASH>..<HASH> 100644 --- a/metrics-core/src/test/java/com/codahale/metrics/SlidingTimeWindowArrayReservoirTest.java +++ b/metrics-core/src/test/java/com/codahale/metrics/SlidingTimeWindowArrayReservoirTest.java @@ -9,7 +9,7 @@ import org.junit.Test; import java.util.Arrays; import java.util.Random; -import java.util.concurrent.TimeUnit; +import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.atomic.AtomicLong; @SuppressWarnings("Duplicates")
Add a missed import for ThreadLocalRandom
dropwizard_metrics
train
java
892f84d10f7e817b42468b7f288fc9e1c723332c
diff --git a/msmbuilder/io/sampling/sampling.py b/msmbuilder/io/sampling/sampling.py index <HASH>..<HASH> 100644 --- a/msmbuilder/io/sampling/sampling.py +++ b/msmbuilder/io/sampling/sampling.py @@ -49,6 +49,7 @@ def sample_dimension(trajs, dimension, n_frames, scheme="linear"): txx = np.sort(txx) spaced_points = np.hstack((txx[:_cut_point], txx[-_cut_point:])) + spaced_points = np.reshape(spaced_points, new_shape=(len(spaced_points), 1)) else: raise ValueError("Scheme has be to one of linear, random or edge")
Reshape spaced_points to have one column Resulting array before had shape (x,) giving a ValueError in tree.query
msmbuilder_msmbuilder
train
py
e062f7f6f9ee9d64980a0e71947b3477d96e022d
diff --git a/transport-sctp/src/main/java/io/netty/channel/sctp/DefaultSctpChannelConfig.java b/transport-sctp/src/main/java/io/netty/channel/sctp/DefaultSctpChannelConfig.java index <HASH>..<HASH> 100644 --- a/transport-sctp/src/main/java/io/netty/channel/sctp/DefaultSctpChannelConfig.java +++ b/transport-sctp/src/main/java/io/netty/channel/sctp/DefaultSctpChannelConfig.java @@ -88,8 +88,8 @@ public class DefaultSctpChannelConfig extends DefaultChannelConfig implements Sc } else if (option == SCTP_NODELAY) { setSctpNoDelay((Boolean) value); } else if (option == SCTP_INIT_MAXSTREAMS) { - List<Integer> minMax = (List<Integer>) value; - setInitMaxStreams(SctpStandardSocketOptions.InitMaxStreams.create(minMax.get(0), minMax.get(1))); + List<Integer> streams = (List<Integer>) value; + setInitMaxStreams(SctpStandardSocketOptions.InitMaxStreams.create(streams.get(0), streams.get(1))); } else { return super.setOption(option, value); }
Minor refactoring in variable naming in sctp stream config
netty_netty
train
java
3c9fd8ecdaf497e31d8cff2df0f6886069c59650
diff --git a/lib/api/users.js b/lib/api/users.js index <HASH>..<HASH> 100644 --- a/lib/api/users.js +++ b/lib/api/users.js @@ -60,6 +60,9 @@ module.exports = function(grasshopper){ } }); } + else { + base.write(base.STATUS_CODES.FORBIDDEN, base.getStatusMessage(base.STATUS_CODES.FORBIDDEN), res); + } }); }; @@ -76,6 +79,9 @@ module.exports = function(grasshopper){ } }); } + else { + base.write(base.STATUS_CODES.FORBIDDEN, base.getStatusMessage(base.STATUS_CODES.FORBIDDEN), res); + } }); }; @@ -91,6 +97,9 @@ module.exports = function(grasshopper){ } }); } + else { + base.write(base.STATUS_CODES.FORBIDDEN, base.getStatusMessage(base.STATUS_CODES.FORBIDDEN), res); + } }); };
Added <I> forbidden cases for api calls.
grasshopper-cms_grasshopper-api-js
train
js
37e2a9c2f8effc02831ef68d401918ccdde513c9
diff --git a/packages/ember-application/tests/system/location_test.js b/packages/ember-application/tests/system/location_test.js index <HASH>..<HASH> 100644 --- a/packages/ember-application/tests/system/location_test.js +++ b/packages/ember-application/tests/system/location_test.js @@ -150,6 +150,24 @@ test("doesn't push a state if path has not changed", function() { locationObject.setURL(window.location.pathname); }); +test("it calls pushState if at initialURL and history.state does not exist", function() { + expect(1); + stop(); + + var count = 0; + window.history.pushState = function() { + count++; + }; + + setTimeout(function() { + start(); + equal(count, 1, "pushState should have been called"); + }, 100); + + locationObject.set('_initialURL', window.location.pathname); + locationObject.setURL('/test'); +}); + test("it handles an empty path as root", function() { equal(locationObject.formatPath(''), '/', "The formatted url is '/'"); });
Adding test for pushState when at initialURL
emberjs_ember.js
train
js
23aaa82d0ff468bec9a8a79b145d00474e178179
diff --git a/lib/bugsnag/notification.rb b/lib/bugsnag/notification.rb index <HASH>..<HASH> 100644 --- a/lib/bugsnag/notification.rb +++ b/lib/bugsnag/notification.rb @@ -77,6 +77,7 @@ module Bugsnag @request_data = request_data @meta_data = {} @user = {} + @should_ignore = false self.severity = @overrides[:severity] @overrides.delete :severity @@ -93,6 +94,7 @@ module Bugsnag # Unwrap exceptions @exceptions = [] + ex = exception while ex != nil && !@exceptions.include?(ex) && @exceptions.length < MAX_EXCEPTIONS_TO_UNWRAP @@ -195,6 +197,7 @@ module Bugsnag # Deliver this notification to bugsnag.com Also runs through the middleware as required. def deliver + return if @should_ignore return unless @configuration.should_notify? # Check we have at least an api_key @@ -270,7 +273,7 @@ module Bugsnag end def ignore? - ignore_exception_class? || ignore_user_agent? + @should_ignore || ignore_exception_class? || ignore_user_agent? end def request_data @@ -281,6 +284,10 @@ module Bugsnag @exceptions end + def ignore! + @should_ignore = true + end + private def ignore_exception_class?
lib/bugsnag/notification: add the ability to ignore notifications
bugsnag_bugsnag-ruby
train
rb
7f5312878d9dd47a3c3b2e2edbdb0e8ddeccf4c4
diff --git a/lib/Map/DataTable.js b/lib/Map/DataTable.js index <HASH>..<HASH> 100644 --- a/lib/Map/DataTable.js +++ b/lib/Map/DataTable.js @@ -333,6 +333,9 @@ DataTable.prototype.setDataVariable = function (varName) { if (!defined(this.variables[varName])) { varName = undefined; } + if (varName === this.selected.data) { + return; + } // set selected to a new cloned object so it triggers knockout's tracking var selected = clone(this.selected); selected.data = varName;
don't update selected if no change
TerriaJS_terriajs
train
js
06a4da07ea6ef8f06cde755cfbdccefb7ee257fd
diff --git a/blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/AstyanaxReader.java b/blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/AstyanaxReader.java index <HASH>..<HASH> 100644 --- a/blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/AstyanaxReader.java +++ b/blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/AstyanaxReader.java @@ -233,6 +233,7 @@ public class AstyanaxReader extends AstyanaxIO { } if (metricType.equals(com.rackspacecloud.blueflood.types.Metric.Type.STRING)) { + gran = Granularity.FULL; return getStringMetricDataForRange(locator, range, gran, StringSerializer.get()); } else if (metricType.equals(com.rackspacecloud.blueflood.types.Metric.Type.BOOLEAN)) { return getStringMetricDataForRange(locator, range, gran, BooleanSerializer.get());
- if it's a string metric, change granularity to full.
rackerlabs_blueflood
train
java
b31bd65c4f721958629a9bea31af34dae04e0bd5
diff --git a/prow/spyglass/artifacts.go b/prow/spyglass/artifacts.go index <HASH>..<HASH> 100644 --- a/prow/spyglass/artifacts.go +++ b/prow/spyglass/artifacts.go @@ -56,9 +56,9 @@ func (s *Spyglass) ListArtifacts(ctx context.Context, src string) ([]string, err // context cancelled error due to user cancelled request. if err != nil && err != context.Canceled { if config.IsNotAllowedBucketError(err) { - logrus.WithError(err).Debug("error retrieving artifact names from gcs storage") + logrus.WithError(err).WithField("gcs-key", gcsKey).Debug("error retrieving artifact names from gcs storage") } else { - logrus.WithError(err).Warn("error retrieving artifact names from gcs storage") + logrus.WithError(err).WithField("gcs-key", gcsKey).Warn("error retrieving artifact names from gcs storage") } }
Deck logs gcs path when warning about error The warning without gcs path doesn't help that much rootcausing the problem
kubernetes_test-infra
train
go
ff8c5c570ad7cd1eea4e0314421cc17011d6fe6d
diff --git a/src/cobald/monitor/format_line.py b/src/cobald/monitor/format_line.py index <HASH>..<HASH> 100644 --- a/src/cobald/monitor/format_line.py +++ b/src/cobald/monitor/format_line.py @@ -68,6 +68,8 @@ class LineProtocolFormatter(Formatter): args = {} assert isinstance(args, Mapping), \ 'monitor record argument must be a mapping, not %r' % type(args) + assert all(elem is not None for elem in args.values()), \ + 'values for arguments are not allowed to be None' record.asctime = self.formatTime(record, self.datefmt) record.message = record.getMessage() if args else record.msg tags = self._default_tags.copy()
added assertion for non-None argument values in LineProtocolFormatter
MatterMiners_cobald
train
py
bf068ca22e205401550b93c8103c9f9d8920731f
diff --git a/concrete/elements/workflow/notifications.php b/concrete/elements/workflow/notifications.php index <HASH>..<HASH> 100644 --- a/concrete/elements/workflow/notifications.php +++ b/concrete/elements/workflow/notifications.php @@ -48,7 +48,7 @@ if (is_array($workflowList) && !empty($workflowList)) { } } - if ($displayInline) { + if (!empty($displayInline)) { echo $form; echo implode("\n", $buttons); echo '</form>';
Avoid accessing undefined var in workflow/notifications element
concrete5_concrete5
train
php
31d942e875afacec8a8a15132ca3a3f9d50dbe36
diff --git a/src/utilities/__tests__/buildASTSchema-test.js b/src/utilities/__tests__/buildASTSchema-test.js index <HASH>..<HASH> 100644 --- a/src/utilities/__tests__/buildASTSchema-test.js +++ b/src/utilities/__tests__/buildASTSchema-test.js @@ -189,6 +189,24 @@ describe('Schema Builder', () => { arg: Int ) on FIELD + """Who knows what inside this scalar?""" + scalar MysteryScalar + + """This is a input object type""" + input FooInput { + """It has a field""" + field: Int + } + + """This is a interface type""" + interface Energy { + """It also has a field""" + str: String + } + + """There is nothing inside!""" + union BlackHole + """With an enum""" enum Color { RED
buildASTSchema-test: expend SDL descriptions test (#<I>)
graphql_graphql-js
train
js
3dc28e9bdeb745107d20a0be8a7ffc565a71da10
diff --git a/redis/commands.py b/redis/commands.py index <HASH>..<HASH> 100644 --- a/redis/commands.py +++ b/redis/commands.py @@ -355,6 +355,7 @@ class Commands: If type of client specified, only that type will be returned. :param _type: optional. one of the client types (normal, master, replica, pubsub) + :param client_id: optional. a list of client ids """ "Returns a list of currently connected clients" args = [] @@ -2208,7 +2209,7 @@ class Commands: """ pieces = [] if maxlen is not None and minid is not None: - raise DataError("Only one of ```maxlen``` or ```minid```", + raise DataError("Only one of ``maxlen`` or ``minid`` " "may be specified") if maxlen is not None:
Add client_id param to docs for client_list (#<I>)
andymccurdy_redis-py
train
py
a169b60e9545e2cc4d65e1e9b04448f956bdbd51
diff --git a/validator_collection/validators.py b/validator_collection/validators.py index <HASH>..<HASH> 100644 --- a/validator_collection/validators.py +++ b/validator_collection/validators.py @@ -2447,6 +2447,9 @@ def ip_address(value, elif not value: return None + if is_py2 and value and isinstance(value, unicode): + value = value.encode('utf-8') + try: value = ipv6(value, force_run = True) # pylint: disable=E1123 ipv6_failed = False
Fixed error with unicode decoding in IP Address validation that affects Python <I>.
insightindustry_validator-collection
train
py
b057590c718defb0d2ecd5e8070e36d76209d2f3
diff --git a/bika/lims/browser/analysisrequest/publish.py b/bika/lims/browser/analysisrequest/publish.py index <HASH>..<HASH> 100644 --- a/bika/lims/browser/analysisrequest/publish.py +++ b/bika/lims/browser/analysisrequest/publish.py @@ -123,6 +123,12 @@ class AnalysisRequestPublishView(BrowserView): """ return self._arsbyclient[self._current_arsbyclient_index] + def getAnalysisRequestGroupData(self): + """ Returns an array that contains the dicts (ar_data) for each + analysis request from the current group + """ + return [self._ar_data(ar) for ar in self.getAnalysisRequestGroup()] + def _nextAnalysisRequest(self): """ Move to the next analysis request """
Add function to get the formatted dicts for grouped ARs
senaite_senaite.core
train
py
f6188bc9a130a384bc3959dc2b1199221846e950
diff --git a/src/js/lib/TestCollection.js b/src/js/lib/TestCollection.js index <HASH>..<HASH> 100644 --- a/src/js/lib/TestCollection.js +++ b/src/js/lib/TestCollection.js @@ -80,7 +80,9 @@ quail.lib.TestCollection = (function () { return this; }, - // Execute a callback for every element in the matched set. + /** + * Execute a callback for every element in the matched set. + */ each: function (iterator) { var args = [].slice.call(arguments, 1); for (var i = 0, len = this.length; i < len; ++i) { @@ -103,13 +105,15 @@ quail.lib.TestCollection = (function () { this.push(test); } }, + /** + * Finds a test by its name. + */ find: function (testname) { for (var i = 0, il = this.length; i < il; ++i) { if (this[i].get('name') === testname) { return this[i]; } } - // Return an empty TestCollection for chaining. return null; }, /**
Doc updated in TestCollection.js
quailjs_quail
train
js
087a8dc3c2ba0d9391d6e867b0f2bbad5640dcf1
diff --git a/salt/states/schedule.py b/salt/states/schedule.py index <HASH>..<HASH> 100644 --- a/salt/states/schedule.py +++ b/salt/states/schedule.py @@ -185,11 +185,11 @@ def present(name, ret['comment'] = new_item['comment'] return ret - # The schedule.list gives us an item that is guaranteed to have an - # 'enabled' argument. Before comparing, add 'enabled' if it's not - # available (assume True, like schedule.list does) - if 'enabled' not in new_item: - new_item['enabled'] = True + # The schedule.list gives us an item that is guaranteed to have an + # 'enabled' argument. Before comparing, add 'enabled' if it's not + # available (assume True, like schedule.list does) + if 'enabled' not in new_item: + new_item['enabled'] = True if new_item == current_schedule[name]: ret['comment'].append('Job {0} in correct state'.format(name))
Only insert enabled if it's a dict
saltstack_salt
train
py