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
0e440aa075c13511bafa16e2af7c21e4510d1c68
diff --git a/classes/phing/tasks/system/AppendTask.php b/classes/phing/tasks/system/AppendTask.php index <HASH>..<HASH> 100644 --- a/classes/phing/tasks/system/AppendTask.php +++ b/classes/phing/tasks/system/AppendTask.php @@ -166,6 +166,15 @@ class AppendTask extends Task } /** + * Sets specific file to append. + * @param PhingFile $f + */ + public function setFile(PhingFile $f) + { + $this->file = $f; + } + + /** * Supports embedded <filelist> element. * * @return FileList
Update AppendTask.php (#<I>)
phingofficial_phing
train
php
3a4c0c72bf157cd912752a2893d10e37cdacd5aa
diff --git a/flight/template/View.php b/flight/template/View.php index <HASH>..<HASH> 100644 --- a/flight/template/View.php +++ b/flight/template/View.php @@ -122,9 +122,7 @@ class View { ob_start(); $this->render($file, $data); - $output = ob_get_contents(); - - ob_end_clean(); + $output = ob_get_clean(); return $output; }
Simplify output buffering code No need to use both ob_get_contents() and ob_end_clean() when you can just use ob_get_clean().
mikecao_flight
train
php
3fe8be5775cab220db1ab074ad4c554ed4a0860f
diff --git a/js/kucoin.js b/js/kucoin.js index <HASH>..<HASH> 100644 --- a/js/kucoin.js +++ b/js/kucoin.js @@ -356,7 +356,7 @@ module.exports = class kucoin extends Exchange { if (feeCurrency in this.currencies_by_id) feeCurrency = this.currencies_by_id[feeCurrency]['code']; } - }; + } let feeCost = this.safeFloat (order, 'fee'); let fee = { 'cost': this.safeFloat (order, 'feeTotal', feeCost),
removed unnecessary semicolon from kucoin parseOrder, minor typo
ccxt_ccxt
train
js
a522a74aa0acb2de62b7a157e18f15cc00378006
diff --git a/lib/inherited_views/base.rb b/lib/inherited_views/base.rb index <HASH>..<HASH> 100644 --- a/lib/inherited_views/base.rb +++ b/lib/inherited_views/base.rb @@ -82,7 +82,7 @@ module InheritedViews def render_or_default(name, args = {}) render name, args rescue ActionView::MissingTemplate - render "#{self.class.default_views}/#{name}", args + render args.merge(:template => "#{self.class.default_views}/#{name}", :prefix => '') end end
Ensure that we force the proper template file to be rendered when rendering the default
gregbell_inherited_views
train
rb
8ac5386d8f0a5a76807253ada24f1591720a8133
diff --git a/backend/product-browse.go b/backend/product-browse.go index <HASH>..<HASH> 100644 --- a/backend/product-browse.go +++ b/backend/product-browse.go @@ -83,6 +83,9 @@ func InitProductBrowse() { RegisterSample("samples_templates/product_page", renderProduct) RegisterSampleEndpoint("samples_templates/product_browse_page", SEARCH, handleSearchRequest) http.HandleFunc("/samples_templates/products", handleProductsRequest) + http.HandleFunc(ADD_TO_CART_PATH, func(w http.ResponseWriter, r *http.Request) { + handlePost(w, r, addToCart) + }) cache = NewLRUCache(100) }
Fix shopping cart (#<I>) * Fix shopping cart * Fix style
ampproject_amp-by-example
train
go
bdf06ee532b0b3ac14a8094f8ffa46a562255dac
diff --git a/pp/channel.py b/pp/channel.py index <HASH>..<HASH> 100644 --- a/pp/channel.py +++ b/pp/channel.py @@ -108,7 +108,7 @@ class Channel(GenericChannel): raise ValueError("Cannot define a channel with neither name " "nor wavelength range.") - if not isinstance(resolution, int): + if not isinstance(resolution, (int, float)): raise TypeError("Resolution must be an integer number of meters.") self.resolution = resolution
Resolution can now be a floating point number.
pytroll_satpy
train
py
b2a535329e4ae84315f4de5a3fd5a14e97ab8eb0
diff --git a/rest_hooks/__init__.py b/rest_hooks/__init__.py index <HASH>..<HASH> 100644 --- a/rest_hooks/__init__.py +++ b/rest_hooks/__init__.py @@ -1 +1 @@ -VERSION = (1, 4, 3) +VERSION = (1, 5, 0)
Updates version tuple for release Updates tuple for <I> release
zapier_django-rest-hooks
train
py
3311315771c3688c7aa342ec0404ae186dcbab1f
diff --git a/src/Drupal/DrupalExtension/Context/DrupalContext.php b/src/Drupal/DrupalExtension/Context/DrupalContext.php index <HASH>..<HASH> 100644 --- a/src/Drupal/DrupalExtension/Context/DrupalContext.php +++ b/src/Drupal/DrupalExtension/Context/DrupalContext.php @@ -420,7 +420,14 @@ class DrupalContext extends MinkContext implements DrupalAwareInterface, Transla // Use a step 'I press the "Esc" key in the "LABEL" field' to close // autocomplete suggestion boxes with Mink. "Click" events on the // autocomplete suggestion do not work. - $this->getSession()->wait(1000, 'jQuery("#autocomplete").length === 0'); + try { + $this->getSession()->wait(1000, 'jQuery("#autocomplete").length === 0'); + } + catch (UnsupportedDriverActionException $e) { + // The jQuery probably failed because the driver does not support + // javascript. That is okay, because if the driver does not support + // javascript, it does not support autocomplete boxes either. + } // Use the Mink Extension step definition. return parent::pressButton($button);
Add support for drivers that do not support Javascript. * <URL>
jhedstrom_drupalextension
train
php
71bb63376f9b5f9b15d1fe2ffbae1395054cc8a7
diff --git a/bigchaindb/backend/rethinkdb/query.py b/bigchaindb/backend/rethinkdb/query.py index <HASH>..<HASH> 100644 --- a/bigchaindb/backend/rethinkdb/query.py +++ b/bigchaindb/backend/rethinkdb/query.py @@ -134,7 +134,7 @@ def get_votes_by_block_id_and_voter(connection, block_id, node_pubkey): def write_block(connection, block): return connection.run( r.table('bigchain') - .insert(r.json(block), durability=WRITE_DURABILITY)) + .insert(r.json(block.to_str()), durability=WRITE_DURABILITY)) @register_query(RethinkDBConnection) diff --git a/bigchaindb/core.py b/bigchaindb/core.py index <HASH>..<HASH> 100644 --- a/bigchaindb/core.py +++ b/bigchaindb/core.py @@ -516,7 +516,7 @@ class Bigchain(object): block (Block): block to write to bigchain. """ - return backend.query.write_block(self.connection, block.to_str()) + return backend.query.write_block(self.connection, block) def transaction_exists(self, transaction_id): return backend.query.has_transaction(self.connection, transaction_id)
fix mongodb write_block without thouching mongodb code
bigchaindb_bigchaindb
train
py,py
f3258bb4f7aedcd6ab30414b1966783253a5ad6c
diff --git a/peng3d/util/__init__.py b/peng3d/util/__init__.py index <HASH>..<HASH> 100644 --- a/peng3d/util/__init__.py +++ b/peng3d/util/__init__.py @@ -195,12 +195,12 @@ class calculated_from(object): *args ) self.multiargs: bool = len(args) != 1 - self.func: Optional[Callable[[...], T]] = None + self.func: Optional[Callable[[Any], T]] = None # self.hashcode: Optional[int] = None # self.cached_value: T = None - def __call__(self, func: Callable[[...], T]) -> Callable[[...], T]: + def __call__(self, func: Callable[[Any], T]) -> Callable[[Any], T]: self.func = func return self._call
Fixed broken tests/RTD builds on Python <= <I>
not-na_peng3d
train
py
e5146c8e742a226c7c48ff403491f90dea1a97b9
diff --git a/Net/OpenID/OIDUtil.php b/Net/OpenID/OIDUtil.php index <HASH>..<HASH> 100644 --- a/Net/OpenID/OIDUtil.php +++ b/Net/OpenID/OIDUtil.php @@ -21,6 +21,25 @@ $_Net_OpenID_digits = "0123456789"; $_Net_OpenID_punct = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"; /** + * Convenience function for getting array values. + */ +function Net_OpenID_array_get($arr, $key, $fallback = null) +{ + if (is_array($arr)) { + if (array_key_exists($key, $arr)) { + return $arr[$key]; + } else { + return $fallback; + } + } else { + trigger_error("Net_OpenID_array_get expected " . + "array as first parameter", E_USER_WARNING); + return false; + } +} + + +/** * Prints the specified message using trigger_error(E_USER_NOTICE). */ function Net_OpenID_log($message, $unused_level = 0)
[project @ Added array_get convenience function]
openid_php-openid
train
php
deed3895084c429056fefabf6c9c13cf59de49a9
diff --git a/tests/test_integration.py b/tests/test_integration.py index <HASH>..<HASH> 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -73,7 +73,6 @@ def test_execute_conda_wrappers(tmpdir, monkeypatch): 'installed and added to PATH env var') subprocess.check_call(['conda', 'create', - '--offline', '--clone', 'root', '-p', 'conda envs/test'])
Don't use --offline when cloning the conda env It's not guaranteed that all packages are already cached.
gqmelo_exec-wrappers
train
py
2bb60777c34962f8f76aef3afbc14788cde76afb
diff --git a/lib/node_modules/@stdlib/math/generics/statistics/kstest/lib/cdf.js b/lib/node_modules/@stdlib/math/generics/statistics/kstest/lib/cdf.js index <HASH>..<HASH> 100644 --- a/lib/node_modules/@stdlib/math/generics/statistics/kstest/lib/cdf.js +++ b/lib/node_modules/@stdlib/math/generics/statistics/kstest/lib/cdf.js @@ -8,6 +8,7 @@ var CDF = {}; +CDF[ 'arcsine' ] = require( '@stdlib/math/base/dist/arcsine/cdf' ); CDF[ 'beta' ] = require( '@stdlib/math/base/dist/beta/cdf' ); CDF[ 'cauchy' ] = require( '@stdlib/math/base/dist/cauchy/cdf' ); CDF[ 'chisquare' ] = require( '@stdlib/math/base/dist/chisquare/cdf' );
Support arcsine in kstest
stdlib-js_stdlib
train
js
bed268674a51ccad25301667fa180023ba6a5fce
diff --git a/spinoff/util/testing.py b/spinoff/util/testing.py index <HASH>..<HASH> 100644 --- a/spinoff/util/testing.py +++ b/spinoff/util/testing.py @@ -197,6 +197,8 @@ class Container(MockActor): # from Actor, so __exit__ is not DRY etc. There might be a way to refactor Actor to allow for a more elegant # implementation of this class. + _actor = None + def __init__(self, actor_cls=None, start_automatically=True): super(Container, self).__init__() self._actor_cls = actor_cls
Added support for 'with testing.contain(None) as (container, _)' for consistency/completeness
eallik_spinoff
train
py
a05814fe26a6a299dd75e73a5015719b686e049a
diff --git a/lib/how_is/cli.rb b/lib/how_is/cli.rb index <HASH>..<HASH> 100644 --- a/lib/how_is/cli.rb +++ b/lib/how_is/cli.rb @@ -23,7 +23,7 @@ module HowIs # Parses +argv+ to generate an options Hash to control the behavior of # the library. def parse(argv) - opts, options = parse_main(argv) + parser, options = parse_main(argv) # Options that are mutually-exclusive with everything else. options = {:help => true} if options[:help] @@ -32,8 +32,7 @@ module HowIs validate_options!(options) @options = options - @parser = opts - @help_text = @parser.to_s + @help_text = parser.to_s self end
miscellaneous cleanup of CLI code.
duckinator_inq
train
rb
89e63fa6917d11c1e3d593c1fe7ae7f936271b3a
diff --git a/will/__init__.py b/will/__init__.py index <HASH>..<HASH> 100644 --- a/will/__init__.py +++ b/will/__init__.py @@ -0,0 +1 @@ +VERSION = "0.6.6" \ No newline at end of file
Bugfix to tagging script.
skoczen_will
train
py
0fdbe5241fac1a3a6fbff86d73e1ac79966721e1
diff --git a/spyderlib/config.py b/spyderlib/config.py index <HASH>..<HASH> 100644 --- a/spyderlib/config.py +++ b/spyderlib/config.py @@ -589,8 +589,8 @@ DEFAULTS = [ # ---- IDLE ---- # Name Color Bold Italic 'idle/background': "#ffffff", - 'idle/currentline': "#d9e8c9", - 'idle/currentcell': "#f9ffe7", + 'idle/currentline': "#e3e7d3", + 'idle/currentcell': "#edf1dc", 'idle/occurence': "#e8f2fe", 'idle/ctrlclick': "#0000ff", 'idle/sideareas': "#efefef", @@ -661,7 +661,7 @@ DEFAULTS = [ # ---- Spyder ---- # Name Color Bold Italic 'spyder/background': "#ffffff", - 'spyder/currentline': "#d8d8bd", + 'spyder/currentline': "#e6e6c9", 'spyder/currentcell': "#fcfcdc", 'spyder/occurence': "#ffff99", 'spyder/ctrlclick': "#0000ff",
Spyder and IDLE schemes (edited online with Bitbucket)
spyder-ide_spyder
train
py
73ec69e115e05c7288cc70c8e2447568083f21e5
diff --git a/server/src/main/java/org/cloudfoundry/identity/uaa/util/UaaMapUtils.java b/server/src/main/java/org/cloudfoundry/identity/uaa/util/UaaMapUtils.java index <HASH>..<HASH> 100644 --- a/server/src/main/java/org/cloudfoundry/identity/uaa/util/UaaMapUtils.java +++ b/server/src/main/java/org/cloudfoundry/identity/uaa/util/UaaMapUtils.java @@ -113,7 +113,7 @@ public class UaaMapUtils { return new AbstractMap.SimpleEntry<>(key, value); } - public static <K extends Comparable<? super K>, V extends Object> Map<K, V> sortByKeys(Map<K,V> map) { + public static <K extends Comparable<? super K>, V> Map<K, V> sortByKeys(Map<K,V> map) { List<Entry<K, V>> sortedEntries = map .entrySet() .stream() @@ -130,7 +130,7 @@ public class UaaMapUtils { return result; } - public static <K extends Comparable<? super K>, V extends Object> String prettyPrintYaml(Map<K,V> map) { + public static <K extends Comparable<? super K>, V> String prettyPrintYaml(Map<K,V> map) { DumperOptions dump = new DumperOptions(); dump.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); dump.setPrettyFlow(true);
Type parameter doesn't need to explictly extend Object [#<I>]
cloudfoundry_uaa
train
java
4d631761e036039401305b5b0fd562ceed99dcdd
diff --git a/lib/jets/commands/base.rb b/lib/jets/commands/base.rb index <HASH>..<HASH> 100644 --- a/lib/jets/commands/base.rb +++ b/lib/jets/commands/base.rb @@ -138,6 +138,8 @@ class Jets::Commands::Base < Thor def eager_load! return if Jets::Turbo.afterburner? + # Jets::Dotenv.load! - so ENV vars can be used in class definitions. + Jets::Dotenv.load! Jets.application.setup_auto_load_paths # in case an app/extension is defined Jets::Autoloaders.once.eager_load end
allow usage of env vars in class methods
tongueroo_jets
train
rb
9ff1c2dd04317004cb68aff2d2559bb732cdbb70
diff --git a/src/candela/util/vega/index.js b/src/candela/util/vega/index.js index <HASH>..<HASH> 100644 --- a/src/candela/util/vega/index.js +++ b/src/candela/util/vega/index.js @@ -206,7 +206,7 @@ let templateFunctions = { type: 'linear', zero: false, domain: {data: params.data, field: params.field}, - range: ['#dfd', 'green'] + range: ['#df2709', '#2709df'] }; },
Use a red-to-blue default colormap for Vega components
Kitware_candela
train
js
06677708cf0699b0aa375bf2f15e7002b1d4a3b5
diff --git a/command/agent/testagent.go b/command/agent/testagent.go index <HASH>..<HASH> 100644 --- a/command/agent/testagent.go +++ b/command/agent/testagent.go @@ -130,7 +130,7 @@ func (a *TestAgent) Start() *TestAgent { a.Agent = agent a.Agent.LogOutput = a.LogOutput a.Agent.LogWriter = a.LogWriter - retry.Run(&panicFailer{}, func(r *retry.R) { + retry.RunWith(retry.ThreeTimes(), &panicFailer{}, func(r *retry.R) { err := a.Agent.Start() if err == nil { return
test: use less aggressive retry for agent startup
hashicorp_consul
train
go
587fd7b3c1c6ea0bccb23c127f65402a6b2c0260
diff --git a/src/PHPCoverFish/Common/Base/BaseCoverFishOutput.php b/src/PHPCoverFish/Common/Base/BaseCoverFishOutput.php index <HASH>..<HASH> 100644 --- a/src/PHPCoverFish/Common/Base/BaseCoverFishOutput.php +++ b/src/PHPCoverFish/Common/Base/BaseCoverFishOutput.php @@ -45,7 +45,7 @@ abstract class BaseCoverFishOutput protected $outputFormat; /** - * @var string + * @var int */ protected $outputLevel; @@ -85,13 +85,13 @@ abstract class BaseCoverFishOutput protected $scanFailure; /** - * @param $content + * @param string $content * * @return null on json */ protected function writeLine($content) { - if (true === $this->outputFormatJson || -1 === $this->outputLevel) { + if (true === $this->outputFormatJson) { return null; } @@ -99,13 +99,13 @@ abstract class BaseCoverFishOutput } /** - * @param $content + * @param string $content * * @return null on json */ protected function write($content) { - if (true === $this->outputFormatJson || -1 === $this->outputLevel) { + if (true === $this->outputFormatJson) { return null; }
fix base output class, scrutinizer issues
dunkelfrosch_phpcoverfish
train
php
85a4a24c8330883c444b57876b3ecfcee7041f69
diff --git a/core/lib/torquebox/option_utils.rb b/core/lib/torquebox/option_utils.rb index <HASH>..<HASH> 100644 --- a/core/lib/torquebox/option_utils.rb +++ b/core/lib/torquebox/option_utils.rb @@ -63,7 +63,7 @@ module TorqueBox extracted_options = {} options.each_pair do |key, value| if opts_hash.include?(key) - extracted_options[opts_hash[key]] = value + extracted_options[opts_hash[key]] = value.is_a?(Symbol) ? value.to_s : value end end extracted_options
Coerce symbol option values to strings. This allows symbols to be used when the wunderboss value is a String without requiring manual coercion.
torquebox_torquebox
train
rb
ed64dc4eec8ced8a0d41b848c281d39660fb7282
diff --git a/src/ModuleConfig/ModuleConfig.php b/src/ModuleConfig/ModuleConfig.php index <HASH>..<HASH> 100644 --- a/src/ModuleConfig/ModuleConfig.php +++ b/src/ModuleConfig/ModuleConfig.php @@ -346,6 +346,8 @@ class ModuleConfig */ protected function prefixMessages($messages, $prefix) { + $result = []; + $prefix = (string)$prefix; // Convert single messages to array @@ -354,9 +356,9 @@ class ModuleConfig } // Prefix all messages - $messages = array_map(function ($item) use ($prefix) { - return sprintf("[%s][%s] %s : %s", $this->module, $this->configType, $prefix, $item); - }, $messages); + foreach ($messages as $message) { + $result[] = sprintf("[%s][%s] %s : %s", $this->module, $this->configType, $prefix, $message); + } return $messages; }
Replaced array_map() with foreach() for clarity (task #<I>) Simple foreach() is easier to read than the array_map() with the closure. Also, it might be slightly faster and/or consume less memory. Read more: <URL>
QoboLtd_cakephp-utils
train
php
1736d6c00bd87731479fcccc7ae3b2d64d0d04ba
diff --git a/auth_server/authn/ldap_auth.go b/auth_server/authn/ldap_auth.go index <HASH>..<HASH> 100755 --- a/auth_server/authn/ldap_auth.go +++ b/auth_server/authn/ldap_auth.go @@ -92,8 +92,9 @@ func (la *LDAPAuth) bindReadOnlyUser(l *ldap.Conn) error { if err != nil { return err } - glog.V(2).Infof("Bind read-only user %s", string(password)) - err = l.Bind(la.config.BindDN, string(password)) + password_str := strings.TrimSpace(string(password)) + glog.V(2).Infof("Bind read-only user %s", password_str) + err = l.Bind(la.config.BindDN, password_str) if err != nil { return err }
Trim space from LDAP password before use Makes it editor-friendly.
cesanta_docker_auth
train
go
57c416526a4415b19e170965b59d61e6be1add19
diff --git a/src/Auth/ShibbolethAuthenticate.php b/src/Auth/ShibbolethAuthenticate.php index <HASH>..<HASH> 100644 --- a/src/Auth/ShibbolethAuthenticate.php +++ b/src/Auth/ShibbolethAuthenticate.php @@ -11,7 +11,7 @@ use Cake\Http\Response; class ShibbolethAuthenticate extends BaseAuthenticate { - protected $mod_rewrite_prefix = 'REDIRECT_'; + const MOD_REWRITE_PREFIX = 'REDIRECT_'; /** * Contains the key-value mapping between Shibooleth attributes and users properties @@ -195,17 +195,16 @@ class ShibbolethAuthenticate extends BaseAuthenticate { $repeat = 0; $value = null; - - while(!isset($value) && $repeat < 5) + while (!isset($value) && $repeat < 6) { - $value = $request->getEnv($this->mod_rewrite_prefix . $attribute_name); + $value = $request->getEnv($attribute_name); if(isset($value)) { return $value; } - $attribute_name = $this->mod_rewrite_prefix . $attribute_name; + $attribute_name = self::MOD_REWRITE_PREFIX . $attribute_name; $repeat++; }
ShibbolethAuthenticate: try first to get Shibboleth attributes without mode_rewrite prefix
alaxos_cakephp3-libs
train
php
27f3d9826a37de37d64f4ef791c07c0753f169d4
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -62,7 +62,7 @@ setup(name="ctypeslib", author="Thomas Heller", author_email="theller@ctypes.org", license="MIT License", - version = "0.5.0", + version = "0.5.1", ## url="http://starship.python.net/crew/theller/ctypes.html", ## platforms=["windows", "Linux", "MacOS X", "Solaris", "FreeBSD"],
Change the version number to the setup script (only to experiment with easy_install). git-svn-id: <URL>
trolldbois_ctypeslib
train
py
adb7cbb43868d40d2e87f6106d61ab891e63a15f
diff --git a/lib/form/areafiles.php b/lib/form/areafiles.php index <HASH>..<HASH> 100644 --- a/lib/form/areafiles.php +++ b/lib/form/areafiles.php @@ -6,16 +6,19 @@ class MoodleQuickForm_areafiles extends HTML_QuickForm_element { protected $_helpbutton = ''; protected $_options = array('subdirs'=>0, 'maxbytes'=>0); - function MoodleQuickForm_areafiles($elementName=null, $elementLabel=null, $options=null) { + function MoodleQuickForm_areafiles($elementName=null, $elementLabel=null, $options=null, $attributes=null) { global $CFG; - if (!empty($options['subdirs'])) { - $this->_options['subdirs'] = 1; + $options = (array)$options; + foreach ($options as $name=>$value) { + if (array_key_exists($name, $this->_options)) { + $this->_options[$name] = $value; + } } if (!empty($options['maxbytes'])) { $this->_options['maxbytes'] = get_max_upload_file_size($CFG->maxbytes, $options['maxbytes']); } - parent::HTML_QuickForm_element($elementName, $elementLabel); + parent::HTML_QuickForm_element($elementName, $elementLabel, $attributes); } function setName($name) {
MDL-<I> minor constructor improvements
moodle_moodle
train
php
2abdc93ce207678658be2b5dedb94b0295be55a7
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -66,6 +66,9 @@ module.exports = (opts = {}) => { if (!passthrough) { const msg = debug ? e.message : 'Authentication Error'; ctx.throw(401, msg, { originalError: e }); + }else{ + //lets downstream middlewares handle JWT exceptions + ctx.state.jwtOriginalError = e; } }
error handling when passthrough is on Let downstream middlewares handle verification exceptions
koajs_jwt
train
js
c97439ed304a27146c38971f9f38305d6e21c06c
diff --git a/lib/WeChatApp.php b/lib/WeChatApp.php index <HASH>..<HASH> 100644 --- a/lib/WeChatApp.php +++ b/lib/WeChatApp.php @@ -689,6 +689,21 @@ class WeChatApp extends Base } /** + * Returns the text content or click event key + * + * @return bool|string + */ + public function getKeyword() + { + if ($this->getMsgType() == 'text') { + return strtolower($this->getContent()); + } elseif ($this->getMsgType() == 'event' && $this->getEvent() == 'click') { + return strtolower($this->getEventKey()); + } + return false; + } + + /** * Generate message for output * * @param string $type The type of message
added getKeyword for weChatApp service
twinh_wei
train
php
bf801bf069f1bd97069f6ac8c6373621901ab612
diff --git a/src/Rcm/Repository/Site.php b/src/Rcm/Repository/Site.php index <HASH>..<HASH> 100644 --- a/src/Rcm/Repository/Site.php +++ b/src/Rcm/Repository/Site.php @@ -127,10 +127,10 @@ class Site extends EntityRepository ->where('site.siteId = :siteId') ->setParameter('siteId', $siteId); -// if ($checkActive) { -// $queryBuilder->andWhere('site.status = :status'); -// $queryBuilder->setParameter('status', 'A'); -// } + if ($checkActive) { + $queryBuilder->andWhere('site.status = :status'); + $queryBuilder->setParameter('status', 'A'); + } $result = $queryBuilder->getQuery()->getScalarResult();
Disable sites Enable sites Uncomment some code
reliv_Rcm
train
php
f7a8f3c2a2b7e70e9b0eca6dc93e4e5608d5a446
diff --git a/app/models/multi_client/client.rb b/app/models/multi_client/client.rb index <HASH>..<HASH> 100644 --- a/app/models/multi_client/client.rb +++ b/app/models/multi_client/client.rb @@ -8,6 +8,10 @@ module MultiClient scope :enabled, -> { where(enabled: true) } + def self.master + where(identifier: Configuration.master_tenant_identifier).first + end + def self.current_id=(id) Thread.current[:client_id] = id end @@ -36,10 +40,12 @@ module MultiClient original_id = current_id begin self.current_id = tenant.id + Rails.logger.info "Temporarily set tenant id to #{tenant.id}" block.call rescue raise ensure + Rails.logger.info "Restored tenant id to #{original_id}" self.current_id = original_id end end
Added log message when setting master. Added master query method.
robotex82_multi_client
train
rb
e5fede1f013671465e4023d5048d2fbab33a8932
diff --git a/tests/test_bdist.py b/tests/test_bdist.py index <HASH>..<HASH> 100644 --- a/tests/test_bdist.py +++ b/tests/test_bdist.py @@ -39,6 +39,9 @@ class BuildTestCase(support.TempdirManager, for name in names: subcmd = cmd.get_finalized_command(name) + if getattr(subcmd, '_unsupported', False): + # command is not supported on this build + continue self.assertTrue(subcmd.skip_build, '%s should take --skip-build from bdist' % name) diff --git a/tests/test_bdist_wininst.py b/tests/test_bdist_wininst.py index <HASH>..<HASH> 100644 --- a/tests/test_bdist_wininst.py +++ b/tests/test_bdist_wininst.py @@ -5,6 +5,8 @@ from test.support import run_unittest from distutils.command.bdist_wininst import bdist_wininst from distutils.tests import support +@unittest.skipIf(getattr(bdist_wininst, '_unsupported', False), + 'bdist_wininst is not supported in this install') class BuildWinInstTestCase(support.TempdirManager, support.LoggingSilencer, unittest.TestCase):
bpo-<I>: Fixes missing venv files and other tests (GH-<I>)
pypa_setuptools
train
py,py
3fc2e2bbc57cf9b6da4ece20ffc0999e82a1a235
diff --git a/lib/mongoid/relations/eager.rb b/lib/mongoid/relations/eager.rb index <HASH>..<HASH> 100644 --- a/lib/mongoid/relations/eager.rb +++ b/lib/mongoid/relations/eager.rb @@ -23,11 +23,9 @@ module Mongoid def preload(relations, docs) grouped_relations = relations.group_by(&:inverse_class_name) - grouped_relations.keys.each do |klass| - grouped_relations[klass] = grouped_relations[klass].group_by(&:relation) - end - grouped_relations.each do |_klass, associations| - associations.each do |relation, association| + grouped_relations.values.each do |associations| + associations.group_by(&:relation) + .each do |relation, association| relation.eager_load_klass.new(association, docs).run end end
Remove double iteration on grouped relations
mongodb_mongoid
train
rb
0c31d92452adc00d1c0ff90c59cb87b9703a0495
diff --git a/grade/lib.php b/grade/lib.php index <HASH>..<HASH> 100644 --- a/grade/lib.php +++ b/grade/lib.php @@ -1002,6 +1002,11 @@ function print_grade_page_head($courseid, $active_type, $active_plugin=null, grade_extend_settings($plugin_info, $courseid); } + // Set the current report as active in the breadcrumbs. + if ($active_plugin !== null && $reportnav = $PAGE->settingsnav->find($active_plugin, navigation_node::TYPE_SETTING)) { + $reportnav->make_active(); + } + $returnval = $OUTPUT->header(); if (!$return) {
MDL-<I> grade: Ensure report appears in breadcrumbs
moodle_moodle
train
php
a284e44e5769c9255d429fed14aa68a54ef72fd6
diff --git a/Kwc/Abstract/Cards/Generator.php b/Kwc/Abstract/Cards/Generator.php index <HASH>..<HASH> 100644 --- a/Kwc/Abstract/Cards/Generator.php +++ b/Kwc/Abstract/Cards/Generator.php @@ -25,8 +25,8 @@ class Kwc_Abstract_Cards_Generator extends Kwf_Component_Generator_Static $cc = $select->getPart(Kwf_Component_Select::WHERE_COMPONENT_CLASSES); if (is_array($parentData)) { } else { - $row = $this->_getModel()->getRow($parentData->dbId); - if (!in_array($this->_settings['component'][$row->component], $cc)) return null; + $component = $this->_getModel()->fetchColumnByPrimaryId('component', $parentData->dbId); + if (!$component || !in_array($this->_settings['component'][$component], $cc)) return null; } } return parent::_formatSelect($parentData, $select);
use more efficient fetchColumnByPrimaryId method to get the selected component
koala-framework_koala-framework
train
php
5acffbd2bd912ce0cef3bd317258f09e45294665
diff --git a/src/com/google/javascript/jscomp/DefaultPassConfig.java b/src/com/google/javascript/jscomp/DefaultPassConfig.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/DefaultPassConfig.java +++ b/src/com/google/javascript/jscomp/DefaultPassConfig.java @@ -46,6 +46,7 @@ import com.google.javascript.jscomp.lint.CheckUselessBlocks; import com.google.javascript.jscomp.parsing.ParserRunner; import com.google.javascript.rhino.IR; import com.google.javascript.rhino.Node; + import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -394,7 +395,10 @@ public final class DefaultPassConfig extends PassConfig { checks.add(checkAccessControls); } - checks.add(checkConsts); + if (!options.getNewTypeInference()) { + // NTI performs this check already + checks.add(checkConsts); + } // Analyzer checks must be run after typechecking. if (options.enables(DiagnosticGroups.ANALYZER_CHECKS)) {
[NTI] Don't run checkConsts when NTI is enabled. ------------- Created by MOE: <URL>
google_closure-compiler
train
java
da190e1fe57cb6bc60a3d9d407533d944c7c450d
diff --git a/_demos/editbox.go b/_demos/editbox.go index <HASH>..<HASH> 100644 --- a/_demos/editbox.go +++ b/_demos/editbox.go @@ -2,13 +2,14 @@ package main import ( "github.com/nsf/termbox-go" + "github.com/mattn/go-runewidth" "unicode/utf8" ) func tbprint(x, y int, fg, bg termbox.Attribute, msg string) { for _, c := range msg { termbox.SetCell(x, y, c, fg, bg) - x++ + x += runewidth.RuneWidth(c) } }
fix tbprint for multi-width characters
nsf_termbox-go
train
go
3a9e20a0f22470fd4770101ad70832cfa2b6a7f4
diff --git a/core-bundle/src/Resources/contao/library/Contao/System.php b/core-bundle/src/Resources/contao/library/Contao/System.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/library/Contao/System.php +++ b/core-bundle/src/Resources/contao/library/Contao/System.php @@ -438,7 +438,7 @@ abstract class System /** - * Return the counties as array + * Return the countries as array * * @return array An array of country names */
[Core] Fixed a typo in the `getCountries()` phpDoc
contao_contao
train
php
53db2b139ad6268dca0f0f3d0ebfc2fcf04b118f
diff --git a/salt/runners/survey.py b/salt/runners/survey.py index <HASH>..<HASH> 100644 --- a/salt/runners/survey.py +++ b/salt/runners/survey.py @@ -152,7 +152,7 @@ def _get_pool_results(*args, **kwargs): expr_form = kwargs.get('expr_form', 'compound') if expr_form not in ['compound', 'pcre']: - expr_form='compound' + expr_form = 'compound' client = salt.client.get_local_client(__opts__['conf_file']) try:
regular expressions in specifiing targets for salt-run survey.diff, hash
saltstack_salt
train
py
e3103ca72653fd8812ea4fa7720e16cdb45dbdda
diff --git a/src/AssetManager/Service/AssetManager.php b/src/AssetManager/Service/AssetManager.php index <HASH>..<HASH> 100644 --- a/src/AssetManager/Service/AssetManager.php +++ b/src/AssetManager/Service/AssetManager.php @@ -27,6 +27,20 @@ class AssetManager return $this; } + public function send($file) + { + $finfo = new finfo(FILEINFO_MIME); + $mimeType = $finfo->file($file); + $fileinfo = new SplFileInfo($file); + $file = $fileinfo->openFile('rb'); + + header("Content-Type: $mimeType"); + header("Content-Length: " . $file->getSize()); + + $file->fpassthru(); + exit; + } + public function setServiceLocator(ServiceLocatorInterface $serviceLocator) { $this->serviceLocator = $serviceLocator;
Added send method to send file to client
wshafer_assetmanager-core
train
php
19037ed61ae6ed27200441f74276dff431bb9a83
diff --git a/yubico/yubico.py b/yubico/yubico.py index <HASH>..<HASH> 100644 --- a/yubico/yubico.py +++ b/yubico/yubico.py @@ -194,13 +194,12 @@ class Yubico(): if signature != generated_signature: raise SignatureVerificationError(generated_signature, signature) - param_dict = self.get_parameters_as_dictionary(parameters) - if param_dict.get('otp', otp) != otp: + if 'otp' in param_dict and param_dict['dict'] != otp: raise InvalidValidationResponse('Unexpected OTP in response. Possible attack!', response, param_dict) - if param_dict.get('nonce', nonce) != nonce: + if 'nonce' in param_dict and param_dict['nonce'] != nonce: raise InvalidValidationResponse('Unexpected nonce in response. Possible attack!', response, param_dict)
Only check otp and nonce if they are present in the response.
Kami_python-yubico-client
train
py
61181474b5f105a5b9535f4feb7150b716157f6c
diff --git a/spec/level_spec.rb b/spec/level_spec.rb index <HASH>..<HASH> 100644 --- a/spec/level_spec.rb +++ b/spec/level_spec.rb @@ -1,6 +1,10 @@ require 'level' describe Level do + before(:all) do + IO.any_instance.stub(:puts) + end + describe '#initialize' do it 'exits when level is not defined' do expect { Level.new(:undefined_level) }.to raise_error SystemExit
Stub 'puts' to avoid some echoing from the tests
mrhead_ruby_arena
train
rb
cd23a7cc58b83c98f0cdafdfd1bc2a19b7eac188
diff --git a/base/src/main/java/uk/ac/ebi/atlas/experimentimport/admin/ExperimentAdminHelpPage.java b/base/src/main/java/uk/ac/ebi/atlas/experimentimport/admin/ExperimentAdminHelpPage.java index <HASH>..<HASH> 100644 --- a/base/src/main/java/uk/ac/ebi/atlas/experimentimport/admin/ExperimentAdminHelpPage.java +++ b/base/src/main/java/uk/ac/ebi/atlas/experimentimport/admin/ExperimentAdminHelpPage.java @@ -21,6 +21,12 @@ public class ExperimentAdminHelpPage { addLine(result, title); addLine(result, StringUtils.repeat('-', title.length())); addLine(result,""); + addLine(result, "### Usage"); + addLine(result,""); + addLine(result, "admin/experiments/<accessions>/<ops>"); + addLine(result,"e.g."); + addLine(result, "admin/experiments/E-MTAB-513/update_design"); + addLine(result,""); addLine(result, "### Operations by name"); addLine(result,""); for(Op op: Op.values()){
The help page explanation gets a bit longer
ebi-gene-expression-group_atlas
train
java
32329eaa135e2a47f1de524ae0231de5c45cf39a
diff --git a/sacred/optional.py b/sacred/optional.py index <HASH>..<HASH> 100644 --- a/sacred/optional.py +++ b/sacred/optional.py @@ -13,6 +13,10 @@ class MissingDependencyMock(object): raise ImportError('Depends on missing "{}" package.' .format(object.__getattribute__(self, 'depends_on'))) + def __call__(self, *args, **kwargs): + raise ImportError('Depends on missing "{}" package.' + .format(object.__getattribute__(self, 'depends_on'))) + try: import numpy as np diff --git a/tests/conftest.py b/tests/conftest.py index <HASH>..<HASH> 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -42,7 +42,7 @@ def pytest_generate_tests(metafunc): if 'example_test' in metafunc.fixturenames: examples = [f.strip('.py') for f in os.listdir(EXAMPLES_PATH) if os.path.isfile(os.path.join(EXAMPLES_PATH, f)) and - f.endswith('.py')] + f.endswith('.py') and f != '__init__.py'] sys.path.append(EXAMPLES_PATH) example_tests = []
MissingDependencyMock is now callable
IDSIA_sacred
train
py,py
b3c0c2981eea035bce3ec4f835528fc5c3b47eeb
diff --git a/cpnet/qstest.py b/cpnet/qstest.py index <HASH>..<HASH> 100644 --- a/cpnet/qstest.py +++ b/cpnet/qstest.py @@ -47,7 +47,7 @@ def qstest( significance_level=0.05, null_model=config_model, sfunc=sz_n, - num_of_rand_net=300, + num_of_rand_net=100, q_tilde=[], s_tilde=[], **params @@ -106,7 +106,7 @@ def qstest( if len(q_tilde) == 0: results = [] for _ in tqdm(range(num_of_rand_net)): - results+=sampling(G, cpa, sfunc, null_model) + results+=[sampling(G, cpa, sfunc, null_model)] if isinstance(results[0]["q"], list): q_tilde = np.array(sum([res["q"] for res in results], [])) else:
fix compatilibity issue with numba and add test scripts
skojaku_core-periphery-detection
train
py
4aa646f6b006bd3799026c502614ac7c8c1e149e
diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go index <HASH>..<HASH> 100644 --- a/bridge/mattermost/mattermost.go +++ b/bridge/mattermost/mattermost.go @@ -181,7 +181,7 @@ func (b *Bmattermost) handleMatterClient(mchan chan *MMMessage) { m.Text = message.Text + b.Config.EditSuffix } if len(message.Post.FileIds) > 0 { - for _, link := range b.mc.GetPublicLinks(message.Post.FileIds) { + for _, link := range b.mc.GetFileLinks(message.Post.FileIds) { m.Text = m.Text + "\n" + link } }
Use GetFileLinks. Also show links to non-public files (mattermost)
42wim_matterbridge
train
go
bb03ecac1cbb209b2e669710c02df02d0272d99e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ setup( maintainer_email="tribaal@gmail.com", url="http://www.xhtml2pdf.com", keywords="PDF, HTML, XHTML, XML, CSS", - install_requires = ["html5lib", "pypdf", "pil", "reportlab"], + install_requires = ["html5lib", "pyPdf", "Pillow", "reportlab"], include_package_data = True, packages=find_packages(exclude=["tests", "tests.*"]), # test_suite = "tests", They're not even working yet
Update setup.py to use Pillow rather than PIL PIL is old and broken, using Pillow instead to support modern systems.
xhtml2pdf_xhtml2pdf
train
py
660cdec576d82dd72ba4ae41abe02951e19b550f
diff --git a/Resources/public/js/components/products/components/attributes/main.js b/Resources/public/js/components/products/components/attributes/main.js index <HASH>..<HASH> 100644 --- a/Resources/public/js/components/products/components/attributes/main.js +++ b/Resources/public/js/components/products/components/attributes/main.js @@ -353,7 +353,6 @@ define([ this.status = !!this.options.data ? this.options.data.status : Config.get('product.status.active'); this.render(); - } }; });
Remove empty line at the end of function
sulu_SuluProductBundle
train
js
9440e81a95ac075d281be3eb95d791212e65ac50
diff --git a/lib/GoCardless/Request.php b/lib/GoCardless/Request.php index <HASH>..<HASH> 100644 --- a/lib/GoCardless/Request.php +++ b/lib/GoCardless/Request.php @@ -84,6 +84,10 @@ class GoCardless_Request { // Request format $curl_options[CURLOPT_HTTPHEADER][] = 'Accept: application/json'; + // Enable SSL certificate validation. + // This is true by default since libcurl 7.1. + $curl_options[CURLOPT_SSL_VERIFYPEER] = true; + // Debug - DO NOT USE THIS IN PRODUCTION FOR SECURITY REASONS // // This fixes a problem in some environments with connecting to HTTPS-enabled servers.
Setting CURLOPT_SSL_VERIFYPEER to 'true' to avoid insecure default in old libcurl versions.
gocardless_gocardless-legacy-php
train
php
4965291cc86d5cbd02ce3ff9b4b3fa7e73211e01
diff --git a/spec/unit/azurerm_server_delete_spec.rb b/spec/unit/azurerm_server_delete_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/azurerm_server_delete_spec.rb +++ b/spec/unit/azurerm_server_delete_spec.rb @@ -17,8 +17,8 @@ describe Chef::Knife::AzurermServerDelete do @arm_server_instance.name_args = ['VM001'] @server_detail = double('server', :name => "VM001", :hardware_profile => double, :storage_profile => double(:os_disk => double)) - allow(@server_detail.hardware_profile).to receive_message_chain(:vm_size).and_return("10") - allow(@server_detail.storage_profile.os_disk).to receive_message_chain(:os_type).and_return("Linux") + allow(@server_detail.hardware_profile).to receive(:vm_size).and_return("10") + allow(@server_detail.storage_profile.os_disk).to receive(:os_type).and_return("Linux") end it "deletes server" do
Updated code logic and removed unused methods and specs related to azure management gems
chef_knife-azure
train
rb
014ba24935654cd483c5463485bb3826721b58ff
diff --git a/core/src/test/java/io/basic/ddf/BasicDDFTests.java b/core/src/test/java/io/basic/ddf/BasicDDFTests.java index <HASH>..<HASH> 100644 --- a/core/src/test/java/io/basic/ddf/BasicDDFTests.java +++ b/core/src/test/java/io/basic/ddf/BasicDDFTests.java @@ -40,7 +40,6 @@ public class BasicDDFTests { Assert.assertNotNull("DDF cannot be null", ddf); Assert.assertNotNull(ddf.getNamespace()); - Assert.assertNotNull(ddf.getTableName()); Assert.assertNotNull(ddf.getUUID()); DDF ddf2 = this.getTestDDF();
don't need to check tableName
ddf-project_DDF
train
java
9c5b6dba3cca51bf3f7c9565e92114987554ad2f
diff --git a/spec/active_pstore/base_spec.rb b/spec/active_pstore/base_spec.rb index <HASH>..<HASH> 100644 --- a/spec/active_pstore/base_spec.rb +++ b/spec/active_pstore/base_spec.rb @@ -124,4 +124,22 @@ describe ActivePStore::Base do it { expect(subject.birth_date).to be_nil } end end + + describe '#valid?' do + let(:artist) { Artist.new(name: name) } + + subject { artist.valid? } + + context 'valid' do + let(:name) { 'foo' } + + it { is_expected.to be true } + end + + context 'invalid' do + let(:name) { '' } + + it { is_expected.to be false } + end + end end 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 @@ -1,3 +1,6 @@ +require 'rspec/expectations' +require 'rspec/mocks' + require 'codeclimate-test-reporter' CodeClimate::TestReporter.start @@ -5,6 +8,8 @@ require 'active_pstore' class Artist < ActivePStore::Base attr_accessor :name, :associated_act, :instrument, :birth_date + + validates_presence_of :name end Dir['./spec/support/**/*.rb'].each {|f| require f}
add specs for `valid?` method.
koic_active_pstore
train
rb,rb
18f05a26c497876104593a83def2cab02f15a8cd
diff --git a/src/Models/MenuGenerator.php b/src/Models/MenuGenerator.php index <HASH>..<HASH> 100755 --- a/src/Models/MenuGenerator.php +++ b/src/Models/MenuGenerator.php @@ -379,8 +379,8 @@ class MenuGenerator implements Countable { return $this->items->sortBy('properties.order')->each(function(MenuItem $parent) { $parent->hideWhen(function() use ($parent) { - return ! $parent->getChilds()->reduce(function($carry, MenuItem $child) { - return $carry || !$child->isHidden(); + return in_array($parent->properties['type'], ['dropdown', 'header']) && ! $parent->getChilds()->reduce(function($carry, MenuItem $child) { + return $carry || ! $child->isHidden(); }, false); }); });
Fix hide logic for hiding parent items without visible children, only if type is dropdown or header
rinvex_laravel-menus
train
php
1d0c3137542436be620f3bf653c9b24003cfc19e
diff --git a/lib/define.js b/lib/define.js index <HASH>..<HASH> 100755 --- a/lib/define.js +++ b/lib/define.js @@ -38,8 +38,6 @@ var functionWrapper = function (f, name, supers) { } ret = f.apply(this, arguments); this._super = orgSuper || null; - } else if (f.__meta && f.__meta.isConstructor) { - f.apply(null, arguments); } else { ret = f.apply(this, arguments); } diff --git a/test/define.test.js b/test/define.test.js index <HASH>..<HASH> 100755 --- a/test/define.test.js +++ b/test/define.test.js @@ -429,6 +429,24 @@ suite.addBatch({ } }); + +suite.addBatch({ + "when in creating a class that that has another class as a property it should not wrap it":{ + topic:function () { + return define([Mammal, Wolf, Dog, Breed], { + static:{ + DogMammal : Dog + } + }); + }, + + "it should call init":function (Mammal) { + assert.deepEqual(Mammal.DogMammal, Dog); + assert.instanceOf(new Mammal.DogMammal(), Dog); + } + } +}); + suite.addBatch({ "When using as to export an object to exports":{ topic:function () {
Bug fixes * Removed dead code from define.js * Added new test for Object Properties
C2FO_comb
train
js,js
1e077aca2f75d31979feea0bb3bac7c2e88a7fb4
diff --git a/clustergrammer_widget/_version.py b/clustergrammer_widget/_version.py index <HASH>..<HASH> 100644 --- a/clustergrammer_widget/_version.py +++ b/clustergrammer_widget/_version.py @@ -1,2 +1,2 @@ -version_info = (1, 0, 1) +version_info = (1, 1, 0) __version__ = '.'.join(map(str, version_info))
going to publish clustergrammer_widget <I>
ismms-himc_clustergrammer2
train
py
aa7419b3ad67311ab34ca5a906e275dc2b5fbf26
diff --git a/drivers/python/rethinkdb/rethinkdb.py b/drivers/python/rethinkdb/rethinkdb.py index <HASH>..<HASH> 100644 --- a/drivers/python/rethinkdb/rethinkdb.py +++ b/drivers/python/rethinkdb/rethinkdb.py @@ -96,7 +96,10 @@ class Connection(object): if debug: print "response:", response - if response.status_code == p.Response.SUCCESS: + if response.status_code == p.Response.SUCCESS_JSON: + return json.loads(response.response[0]) + # FIXME: need to handle SUCCESS_EMPTY, SUCCESS_PARTIAL + if response.status_code == p.Response.SUCCESS_STREAM: return [json.loads(s) for s in response.response] if response.status_code == p.Response.PARTIAL: new_protobuf = p.Query()
partially fix python client
rethinkdb_rethinkdb
train
py
8b0aee03ce4447f70f5575216955f0cfd134034b
diff --git a/salt/modules/cron.py b/salt/modules/cron.py index <HASH>..<HASH> 100644 --- a/salt/modules/cron.py +++ b/salt/modules/cron.py @@ -151,7 +151,7 @@ def set_special(user, special, cmd): 'cmd': cmd} lst['special'].append(spec) comdat = _write_cron(user, _render_tab(lst)) - if not comdat['retcode']: + if comdat['retcode']: # Failed to commit, return the error return comdat['stderr'] return 'new'
Fixed set_special from returning stderr on success instead of 'new'.
saltstack_salt
train
py
9ff1fd4d21d229799fb9ea7d16cd209aa318576d
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -102,7 +102,8 @@ module.exports = function (grunt) { grunt.registerTask('phpcs', 'PHP Codesniffer', 'exec:phpcs'); grunt.registerTask('phpmd', 'PHP Mess Detector', 'exec:phpmd'); grunt.registerTask('install', 'Install all project dependencies', ['exec:npm-install', 'exec:composer-install', 'exec:bundle-install']); - grunt.registerTask('default', ['phpunit']); + grunt.registerTask('default', ['qa']); + grunt.registerTask('qa', ['exec:composer-install', 'phpunit', 'phpcs', 'phpmd']); grunt.registerTask('jenkins', ['exec:ci-prepare', 'phpunit-ci', 'phpcs', 'phpmd']); } ;
Add new grunt task for QA. Set as default task.
aptoma_silex-extras
train
js
19a44ce3b0f14465dbbad6d9c7831d19fe792375
diff --git a/spyder/app/tests/test_mainwindow.py b/spyder/app/tests/test_mainwindow.py index <HASH>..<HASH> 100644 --- a/spyder/app/tests/test_mainwindow.py +++ b/spyder/app/tests/test_mainwindow.py @@ -82,6 +82,7 @@ def main_window(request): # Tests #============================================================================== @flaky(max_runs=10) +@pytest.mark.skipif(os.name == 'nt', reason="It times out sometimes on Windows") def test_open_notebooks_from_project_explorer(main_window, qtbot): """Test that new breakpoints are set in the IPython console.""" projects = main_window.projects
Testing: Skip improved test on Windows because it hangs there
spyder-ide_spyder
train
py
ddcee3e0ad11771360a726c460a3427c9c78a566
diff --git a/lib/async.js b/lib/async.js index <HASH>..<HASH> 100644 --- a/lib/async.js +++ b/lib/async.js @@ -14,7 +14,16 @@ // global on the server, window in the browser var root, previous_async; - root = this; + if (typeof window == 'object' && this === window) { + root = window; + } + else if (typeof global == 'object' && this === global) { + root = global; + } + else { + root = this; + } + if (root != null) { previous_async = root.async; }
Better support for browsers. In a RequireJS environment `this` doesn't refer to the `window` object, so async doesn't work there.
caolan_async
train
js
c82afab387700a79df561b24f2c84f4abc15796e
diff --git a/firebase_test.go b/firebase_test.go index <HASH>..<HASH> 100644 --- a/firebase_test.go +++ b/firebase_test.go @@ -1,7 +1,6 @@ package firebase_test import ( - "fmt" "os" "reflect" "testing" @@ -159,10 +158,11 @@ func TestSetRules(t *testing.T) { } } +/* TODO: Once circle ci supports go 1.4, uncomment this func TestMain(m *testing.M) { if testUrl == "" || testAuth == "" { fmt.Printf("You need to set FIREBASE_TEST_URL and FIREBASE_TEST_AUTH\n") os.Exit(1) } os.Exit(m.Run()) -} +}*/
Disable go <I> features for now, they just make us fail more elegantly
ereyes01_firebase
train
go
3d3c677ed06e0430212efb0a57e13db7c0dc6f42
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -58,7 +58,7 @@ master_doc = 'index' # General information about the project. project = u'ciscosparkapi' -copyright = u'2016, Cisco DevNet' +copyright = u'2016 Cisco Systems, Inc.' author = u'Chris Lunsford' # The version info for the project you're documenting, acts as replacement for
Update copyright in docs/conf.py This copyright reference shows up in the footers of the HTML docs generated by Sphinx.
CiscoDevNet_webexteamssdk
train
py
44069c0078dc4f25224c25588077d91692e6371f
diff --git a/Model/Api.php b/Model/Api.php index <HASH>..<HASH> 100644 --- a/Model/Api.php +++ b/Model/Api.php @@ -679,7 +679,12 @@ class Api // Must have at least ONE valid contact field (some are to be ignored since we provide them or they are core). $ignore = ['ip', 'attribution', 'attribution_date', 'utm_source']; if (!count(array_diff_key($this->fieldsProvided, array_flip($ignore)))) { - return null; + throw new ContactSourceException( + 'There were no fields provided. A contact could not be created.', + Codes::HTTP_BAD_REQUEST, + null, + Stat::TYPE_INVALID + ); } // Dynamically generate the field map and import.
Prevent exception when no fields are provided via Source API.
TheDMSGroup_mautic-contact-source
train
php
e0b29e3c108b5361f53bc39aeac2b8a71dd205b4
diff --git a/reformulation-core/src/main/java/org/semanticweb/ontop/owlrefplatform/core/translator/IntermediateQueryToDatalogTranslator.java b/reformulation-core/src/main/java/org/semanticweb/ontop/owlrefplatform/core/translator/IntermediateQueryToDatalogTranslator.java index <HASH>..<HASH> 100644 --- a/reformulation-core/src/main/java/org/semanticweb/ontop/owlrefplatform/core/translator/IntermediateQueryToDatalogTranslator.java +++ b/reformulation-core/src/main/java/org/semanticweb/ontop/owlrefplatform/core/translator/IntermediateQueryToDatalogTranslator.java @@ -112,7 +112,7 @@ public class IntermediateQueryToDatalogTranslator { List<Function> atoms = new LinkedList<Function>(); //Constructing the rule - CQIE newrule = ofac.getCQIE(substitutedHead, atoms); + CQIE newrule = ofac.getCQIE(convertToMutableFunction(substitutedHead), atoms); pr.appendRule(newrule); @@ -218,7 +218,7 @@ public class IntermediateQueryToDatalogTranslator { QueryNode nod= listnode.get(0); if (nod instanceof ConstructionNode) { - Function newAns = ((ConstructionNode) nod).getProjectionAtom(); + Function newAns = convertToMutableFunction(((ConstructionNode) nod).getProjectionAtom()); body.add(newAns); return body; }else{
Makes the heads and the sub-rule atoms mutable after translation back to Datalog.
ontop_ontop
train
java
e0273b6edc1c099b60f2b928bf1bff0a431a8736
diff --git a/src/rituals/invoke_tasks.py b/src/rituals/invoke_tasks.py index <HASH>..<HASH> 100644 --- a/src/rituals/invoke_tasks.py +++ b/src/rituals/invoke_tasks.py @@ -136,8 +136,8 @@ def test(): except which.WhichError: pytest = None - if console and pytest: - run('{0} --color=yes {1}'.format(pytest, cfg.testdir), echo=RUN_ECHO) + if pytest: + run('{}{} "{}"'.format(pytest, ' --color=yes' if console else '', cfg.testdir), echo=RUN_ECHO) else: run('python setup.py test', echo=RUN_ECHO)
:twisted_rightwards_arrows: if py.test is found, always use it directly
jhermann_rituals
train
py
8d44d6f80b20a3d6e063d3667c9a19dfa5fc1aa7
diff --git a/lib/genevalidator/version.rb b/lib/genevalidator/version.rb index <HASH>..<HASH> 100644 --- a/lib/genevalidator/version.rb +++ b/lib/genevalidator/version.rb @@ -1,3 +1,3 @@ module GeneValidator - VERSION = "1.0.0" + VERSION = "1.0.1" end \ No newline at end of file
Update the Version and add IsmailM as co-author
wurmlab_genevalidator
train
rb
25839860711987b48b5e5a6d919b4ea294ac10a8
diff --git a/activerecord/lib/active_record/railtie.rb b/activerecord/lib/active_record/railtie.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/railtie.rb +++ b/activerecord/lib/active_record/railtie.rb @@ -168,21 +168,7 @@ end_error initializer "active_record.initialize_database" do ActiveSupport.on_load(:active_record) do self.configurations = Rails.application.config.database_configuration - - begin - establish_connection - rescue ActiveRecord::NoDatabaseError - warn <<-end_warning -Oops - You have a database configured, but it doesn't exist yet! - -Here's how to get started: - - 1. Configure your database in config/database.yml. - 2. Run `rails db:create` to create the database. - 3. Run `rails db:setup` to load your database schema. -end_warning - raise - end + establish_connection end end
Remove unreachable database warning `establish_connection` will never raise `ActiveRecord::NoDatabaseError`, because it doesn't connect to a database; it sets up a connection pool.
rails_rails
train
rb
a8a0943eb50d4c9d20f9690e778df5ddac4714ed
diff --git a/sitetree/management/commands/sitetreedump.py b/sitetree/management/commands/sitetreedump.py index <HASH>..<HASH> 100644 --- a/sitetree/management/commands/sitetreedump.py +++ b/sitetree/management/commands/sitetreedump.py @@ -38,9 +38,9 @@ class Command(BaseCommand): objects.extend(trees) for tree in trees: - objects.extend(TreeItem._default_manager.using(using).filter(tree=tree)) + objects.extend(TreeItem._default_manager.using(using).filter(tree=tree).order_by('parent')) try: return serializers.serialize('json', objects, indent=indent) except Exception, e: - raise CommandError("Unable to serialize sitetree(s): %s" % e) + raise CommandError('Unable to serialize sitetree(s): %s' % e)
Updated tree items order in 'sitetreedump' management command.
idlesign_django-sitetree
train
py
4548a66dcf019741eb0678f3d1efc7a79bbbd26f
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 @@ -24,7 +24,7 @@ ActiveRecord::Base.establish_connection(ENV["DB"] || "sqlite") load File.dirname(__FILE__) + "/fixtures/schema.rb" # Freeze time to Jan 1st of this year -Timecop.travel(Time.local(Time.zone.now.year, 1, 1)) +Timecop.travel(Time.local(Time.zone.now.year, 1, 1, 0, 0, 0)) load File.dirname(__FILE__) + "/fixtures/models.rb"
Set hours, mins and sec for Timecop.travel in spec_helper.rb This will fix by_weekend tests, and cause last commit to be reverted
radar_by_star
train
rb
ebe47d9702889d62f7be76a36d8976612882c099
diff --git a/js/main.js b/js/main.js index <HASH>..<HASH> 100644 --- a/js/main.js +++ b/js/main.js @@ -59,12 +59,19 @@ GraphNode.Impl = class { } } + /* + * + * @param {type} f + * @returns {unresolved} a promise thta is satisfied whne all promises returned by f are resolved + */ each(f) { - this.nodes.forEach(node => f(GraphNode([node], this.graph, this.sources))); + var results = this.nodes.map(node => f(GraphNode([node], this.graph, this.sources))); + return Promise.all(results); } fetchEach(f) { - this.nodes.forEach(node => GraphNode([node], this.graph, this.sources).fetch().then(f)); + var results = this.nodes.map(node => GraphNode([node], this.graph, this.sources).fetch().then(f)); + return Promise.all(results); } out(predicate) {
returning promise in each and eachFetch
retog_rdfgraphnode
train
js
fc9267e34ac7ccb7f5cdfc9296bb38cd105c728b
diff --git a/lib/active_job/arguments.rb b/lib/active_job/arguments.rb index <HASH>..<HASH> 100644 --- a/lib/active_job/arguments.rb +++ b/lib/active_job/arguments.rb @@ -1,4 +1,5 @@ require 'active_model/global_locator' +require 'active_model/global_identification' module ActiveJob class Arguments
Require global_identification in serialisations
rails_rails
train
rb
3c5f9a5d0532cea627c51febf2854eb1a59c5b4b
diff --git a/indra/statements.py b/indra/statements.py index <HASH>..<HASH> 100644 --- a/indra/statements.py +++ b/indra/statements.py @@ -1048,6 +1048,17 @@ class Evidence(object): text_refs : dict A dictionary of various reference ids to the source text, e.g. DOI, PMID, URL, etc. + + Additional Attributes + --------------------- + source_hash : int + A hash calculated from the evidence text, source api, and pmid and/or + source_id if available. This is generated automatcially when the object + is instantiated. + stmt_tag : int + This is a hash calculated by a Statement to which this evidence refers, + and is set by said Statement. It is useful for tracing ownership of + an Evidence object. """ def __init__(self, source_api=None, source_id=None, pmid=None, text=None, annotations=None, epistemics=None, context=None, @@ -1079,6 +1090,10 @@ class Evidence(object): state['context'] = None if 'text_refs' not in state: state['text_refs'] = {} + if 'stmt_tag' not in state: + state['stmt_tag'] = None + if 'source_hash' not in state: + state['source_hash'] = None self.__dict__ = state def get_source_hash(self, refresh=False):
Add some documentation and fix set-state.
sorgerlab_indra
train
py
7100d91610c7248150e2c8a730d47d96816bc93f
diff --git a/closure/goog/net/xhrmanager.js b/closure/goog/net/xhrmanager.js index <HASH>..<HASH> 100644 --- a/closure/goog/net/xhrmanager.js +++ b/closure/goog/net/xhrmanager.js @@ -139,7 +139,7 @@ goog.net.XhrManager.prototype.setTimeoutInterval = function(ms) { /** - * Returns the number of reuqests either in flight, or waiting to be sent. + * Returns the number of requests either in flight, or waiting to be sent. * @return {number} The number of requests in flight or pending send. */ goog.net.XhrManager.prototype.getOutstandingCount = function() {
Fix spelling errors for reuqest. Mostly makes searching comments better, but there are some bonafide bugs here! R=pallosp DELTA=1 (0 added, 0 deleted, 1 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=<I> git-svn-id: <URL>
google_closure-library
train
js
c7a46f0c13b7f6b764c55bb741672bc557eada80
diff --git a/tests/Queue/QueueWorkerTest.php b/tests/Queue/QueueWorkerTest.php index <HASH>..<HASH> 100755 --- a/tests/Queue/QueueWorkerTest.php +++ b/tests/Queue/QueueWorkerTest.php @@ -243,7 +243,6 @@ class QueueWorkerTest extends TestCase $this->assertNull($job->failedWith); } - public function test_job_based_failed_delay() { $job = new WorkerFakeJob(function ($job) { @@ -259,7 +258,6 @@ class QueueWorkerTest extends TestCase $this->assertEquals(10, $job->releaseAfter); } - /** * Helpers... */
Apply fixes from StyleCI (#<I>)
laravel_framework
train
php
d25af2d81d600414ab416fa2c6c06783d1eee2d7
diff --git a/library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java b/library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java index <HASH>..<HASH> 100644 --- a/library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java +++ b/library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java @@ -311,6 +311,7 @@ public class EmvTemplate { if (config == null) { config = Config(); } + parsers = new ArrayList<IParser>(); if (!config.removeDefaultParsers) { addDefaultParsers(); } @@ -321,7 +322,6 @@ public class EmvTemplate { * Add default parser implementation */ private void addDefaultParsers() { - parsers = new ArrayList<IParser>(); parsers.add(new GeldKarteParser(this)); parsers.add(new EmvParser(this)); }
Ensure list of parsers not null when the defaults are not added
devnied_EMV-NFC-Paycard-Enrollment
train
java
c66b4054c2ab4a97350dc26eec0ef14876159bba
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open("README.md", "r") as fh: setuptools.setup( name = 'openhomedevice', - version = '0.6.2', + version = '0.6.3', author = 'Barry John Williams', author_email = 'barry@bjw.me.uk', description='Provides an API for requesting information from an Openhome device',
Bumped version number to <I>
bazwilliams_openhomedevice
train
py
5f61c0c5d0794ef513d3c790578e87dbad7d4bd3
diff --git a/cli/cumulusci.py b/cli/cumulusci.py index <HASH>..<HASH> 100644 --- a/cli/cumulusci.py +++ b/cli/cumulusci.py @@ -85,10 +85,16 @@ def build_router(config): if branch.startswith('feature/'): click.echo('-- Building with feature branch flow') + config.sf_username = os.environ.get('SF_USERNAME_FEATURE') + config.sf_password = os.environ.get('SF_PASSWORD_FEATURE') + config.sf_serverurl = os.environ.get('SF_SERVERURL_FEATURE', config.sf_serverurl) unmanaged_deploy.main(args=['--run-tests','True']) elif branch == 'master': click.echo('-- Building with master branch flow') + config.sf_username = os.environ.get('SF_USERNAME_PACKAGING') + config.sf_password = os.environ.get('SF_PASSWORD_PACKAGING') + config.sf_serverurl = os.environ.get('SF_SERVERURL_PACKAGING', config.sf_serverurl) package_deploy(args=['--run-tests','True']) @click.group()
Switch build target orgs in build_router based on environment variable suffixes
SFDO-Tooling_CumulusCI
train
py
b04a022cf204d85974079695049d5a63ba400287
diff --git a/src/Illuminate/Database/Query/Builder.php b/src/Illuminate/Database/Query/Builder.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Database/Query/Builder.php +++ b/src/Illuminate/Database/Query/Builder.php @@ -655,9 +655,9 @@ class Builder return $this->whereNested($column, $boolean); } - // If the column is a Closure instance and there an operator set, we will - // assume the developer wants to run a subquery and then compare the - // results of the subquery with the value that was provided. + // If the column is a Closure instance and there is an operator set, we + // will assume the developer wants to run a subquery and then compare + // the results of that subquery with the value that was provided. if ($column instanceof Closure && ! is_null($operator)) { [$sub, $bindings] = $this->createSub($column);
Tweak comment in query builder where method
laravel_framework
train
php
4740d97b56dd63865ea391f8cda992e714993118
diff --git a/packages/reactstrap-validation-select/AvSelect.js b/packages/reactstrap-validation-select/AvSelect.js index <HASH>..<HASH> 100644 --- a/packages/reactstrap-validation-select/AvSelect.js +++ b/packages/reactstrap-validation-select/AvSelect.js @@ -196,10 +196,7 @@ class AvSelect extends AvBaseInput { let shouldAutofillField = false; if (typeof this.props.autofill === 'object') { - shouldAutofillField = Object.prototype.hasOwnProperty.call( - this.props.autofill, - fieldName - ); + shouldAutofillField = this.props.autofill[fieldName]; } else { shouldAutofillField = Object.prototype.hasOwnProperty.call( rawValue,
fix(reactstrap-validation-select): check autofill key is truthy
Availity_availity-react
train
js
e8c52e6d2b52eca158999c50db8cd2bcaae84e30
diff --git a/src/LooplineSystems/CloseIoApiWrapper/Api/LeadApi.php b/src/LooplineSystems/CloseIoApiWrapper/Api/LeadApi.php index <HASH>..<HASH> 100644 --- a/src/LooplineSystems/CloseIoApiWrapper/Api/LeadApi.php +++ b/src/LooplineSystems/CloseIoApiWrapper/Api/LeadApi.php @@ -27,8 +27,8 @@ class LeadApi extends AbstractApi $this->urls = [ 'get-leads' => '/lead/', 'add-lead' => '/lead/', - 'get-lead' => '/lead/[:id]', - 'update-lead' => 'lead/[:id]' + 'get-lead' => '/lead/[:id]/', + 'update-lead' => '/lead/[:id]/', ]; }
Fixes typo in lead urls
loopline-systems_closeio-api-wrapper
train
php
583e918c7c5e9d80f27cbb72a9026363fb58f56b
diff --git a/src/Console/Command/Task/PluginTask.php b/src/Console/Command/Task/PluginTask.php index <HASH>..<HASH> 100644 --- a/src/Console/Command/Task/PluginTask.php +++ b/src/Console/Command/Task/PluginTask.php @@ -213,6 +213,14 @@ class PluginTask extends BakeTask { $this->createFile($file, $out); } +/** + * Modifies App's coposer.json to include the plugin and tries to call + * composer dump-autoload to refresh the autoloader cache + * + * @param string $plugin Name of plugin + * @param string $path The path to save the phpunit.xml file to. + * @return boolean True if composer could be modified correctly + */ protected function _modifyAutoloader($plugin, $path) { $path = dirname($path); @@ -239,7 +247,8 @@ class PluginTask extends BakeTask { } try { - $command = 'php ' . escapeshellarg($composer) . ' dump-autoload '; + $command = 'cd ' . escapeshellarg($path) . '; '; + $command .= 'php ' . escapeshellarg($composer) . ' dump-autoload '; $this->Project->callComposer($command); } catch (\RuntimeException $e) { $error = $e->getMessage();
Fixing an error when calling composer and adding doc block
cakephp_cakephp
train
php
de0a0c3c68776d559b4cf9598b257b70e1f7d35d
diff --git a/lib/gemsmith/gem/specification.rb b/lib/gemsmith/gem/specification.rb index <HASH>..<HASH> 100644 --- a/lib/gemsmith/gem/specification.rb +++ b/lib/gemsmith/gem/specification.rb @@ -44,11 +44,11 @@ module Gemsmith end def allowed_push_key - spec.metadata.fetch("allowed_push_key") { "rubygems_api_key" } + spec.metadata.fetch "allowed_push_key", "rubygems_api_key" end def allowed_push_host - spec.metadata.fetch("allowed_push_host") { self.class.default_gem_host } + spec.metadata.fetch "allowed_push_host", self.class.default_gem_host end def package_file_name
Fixed Style/RedundantFetchBlock issue with gem specification Use of the block was unnecessary.
bkuhlmann_gemsmith
train
rb
03a8202354c782279486534a0f228c2457f68287
diff --git a/plaso/parsers/winreg_plugins/interface.py b/plaso/parsers/winreg_plugins/interface.py index <HASH>..<HASH> 100644 --- a/plaso/parsers/winreg_plugins/interface.py +++ b/plaso/parsers/winreg_plugins/interface.py @@ -143,7 +143,7 @@ class WindowsRegistryKeyPathPrefixFilter(BaseWindowsRegistryKeyFilter): Returns: bool: True if the keys match. """ - return registry_key.path.startsswith(self._key_path_prefix) + return registry_key.path.startswith(self._key_path_prefix) class WindowsRegistryKeyPathSuffixFilter(BaseWindowsRegistryKeyFilter):
Fix simple typo in winreg_plugins interface (#<I>)
log2timeline_plaso
train
py
504f496f032cfbf4f2869349f8ca5e7a9b63a489
diff --git a/ezp/Persistence/Tests/InMemoryEngine/BackendDataTest.php b/ezp/Persistence/Tests/InMemoryEngine/BackendDataTest.php index <HASH>..<HASH> 100644 --- a/ezp/Persistence/Tests/InMemoryEngine/BackendDataTest.php +++ b/ezp/Persistence/Tests/InMemoryEngine/BackendDataTest.php @@ -336,6 +336,34 @@ class BackendDataTest extends PHPUnit_Framework_TestCase } /** + * Test counting content without results + * + * @dataProvider providerForFindEmpty + * @covers ezp\Persistence\Tests\InMemoryEngine\Backend::count + */ + public function testCountEmpty( $searchData ) + { + $this->assertEquals( + 0, + $this->backend->count( "Content", $searchData ) + ); + } + + /** + * Test counting content with results + * + * @dataProvider providerForFind + * @covers ezp\Persistence\Tests\InMemoryEngine\Backend::count + */ + public function testCount( $searchData, $result ) + { + $this->assertEquals( + count( $result ), + $this->backend->count( "Content", $searchData ) + ); + } + + /** * Test loading content without results * * @dataProvider providerForLoadEmpty
Added: additional InMemoryEngine\Backend tests
ezsystems_ezpublish-kernel
train
php
77e8742056a77a1603cf3473a1e2afda8de0493c
diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -57,6 +57,7 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $name; protected $startTime; protected $classes; + protected $errorReportingLevel; const VERSION = '2.1.0-DEV'; @@ -91,7 +92,7 @@ abstract class Kernel implements KernelInterface, TerminableInterface error_reporting(-1); DebugUniversalClassLoader::enable(); - ErrorHandler::register(); + ErrorHandler::register($this->errorReportingLevel); if ('cli' !== php_sapi_name()) { ExceptionHandler::register(); }
Allow people to set the error level, this is especially important when dealing with misbehaving libraries as part of legacy integrations. Usage would be to extend the Kernel, and set the errorReportingLevel prior to calling parent::__construct(). Not ideal, but this doesn't break BC and allows the user to defer the decision as late as possible. This can/should be handled better in <I>.x
symfony_symfony
train
php
550294a39104859dbb1b4667b69e1d2ebc53cd33
diff --git a/src/Illuminate/Cache/TaggedCache.php b/src/Illuminate/Cache/TaggedCache.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Cache/TaggedCache.php +++ b/src/Illuminate/Cache/TaggedCache.php @@ -2,7 +2,7 @@ use Closure; -class TaggedCache { +class TaggedCache implements StoreInterface { /** * The cache store implementation. @@ -187,4 +187,14 @@ class TaggedCache { { return $this->tags->getNamespace().':'.$key; } + + /** + * Get the cache key prefix. + * + * @return string + */ + public function getPrefix() + { + return $this->store->getPrefix(); + } }
Make TaggedCache implement StoreInterface This way, a tagged cache can be passed to a class that expects a StoreInterface, and doesn't have to know that it is dealing with a tagged cache. Tag-related operations can be handled outside the class.
laravel_framework
train
php
7196455b13aeca2767fe33e20a435bdb9d94bbab
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -48,4 +48,8 @@ setup( 'rshell=rshell.command_line:main' ], }, + extras_require={ + ':sys_platform == "win32"': [ + 'pyreadline'] + } )
Address #<I>: Add pyreadline dependency for Windows platform
dhylands_rshell
train
py
289bcda97d7998d832257f3ed5bc3837b2156379
diff --git a/src/howler.core.js b/src/howler.core.js index <HASH>..<HASH> 100644 --- a/src/howler.core.js +++ b/src/howler.core.js @@ -1604,7 +1604,7 @@ } // If the sound hasn't loaded, add it to the load queue to seek when capable. - if (self._state !== 'loaded' || self._playLock) { + if (typeof seek === 'number' && (self._state !== 'loaded' || self._playLock)) { self._queue.push({ event: 'seek', action: function() {
Don't add seek without value to queue when loading Fixes #<I>
goldfire_howler.js
train
js
09df6aa4bd1bf84771112abf663cd94c4ddc7dff
diff --git a/bettercache/views.py b/bettercache/views.py index <HASH>..<HASH> 100644 --- a/bettercache/views.py +++ b/bettercache/views.py @@ -1,3 +1,5 @@ +import urllib2, time + from django.http import HttpResponse from bettercache.utils import CachingMixin from bettercache.tasks import GeneratePage @@ -18,10 +20,12 @@ class BetterView(CachingMixin): if response is None: response = self.proxy(request) - return HttpResponse('OH YEAH') + return response #HttpResponse('OH YEAH') def proxy(self, request): - return None + response = urllib2.urlopen('http://www.test.clarkhoward.com',str(time.time)) + hr = HttpResponse(response.read()) + return hr #TODO: properly implement a class based view
[CMSPERF-<I>] slightly better it now proxies
ironfroggy_django-better-cache
train
py
75aed75953397350b696363d5cef96a9ca551f11
diff --git a/lib/cl/version.rb b/lib/cl/version.rb index <HASH>..<HASH> 100644 --- a/lib/cl/version.rb +++ b/lib/cl/version.rb @@ -1,3 +1,3 @@ class Cl - VERSION = '0.1.15' + VERSION = '0.1.16' end
Bump cl to <I>
svenfuchs_cl
train
rb
c366ade709c895f3bdf0654a8875a52e4d95fb26
diff --git a/helpers/map-deep-merge.js b/helpers/map-deep-merge.js index <HASH>..<HASH> 100644 --- a/helpers/map-deep-merge.js +++ b/helpers/map-deep-merge.js @@ -172,7 +172,8 @@ function typeFromList( list ){ return list && list._define && list._define.definitions["#"] && list._define.definitions["#"].Type; } function idFromType( Type ){ - return Type && Type.algebra && Type.algebra.clauses && Type.algebra.clauses.id && function(o){ + return Type && Type.connection && Type.connection.id || + Type && Type.algebra && Type.algebra.clauses && Type.algebra.clauses.id && function(o){ var idProp = Object.keys(Type.algebra.clauses.id)[0]; return o[idProp]; } || function(o){
smart-merge: read id usign connection.id
canjs_can-connect
train
js
9b094370c71d64d17c049c4f0fd2bb614ab452f3
diff --git a/msg/scratch_msgs.js b/msg/scratch_msgs.js index <HASH>..<HASH> 100644 --- a/msg/scratch_msgs.js +++ b/msg/scratch_msgs.js @@ -9,7 +9,7 @@ goog.require('Blockly.ScratchMsgs'); Blockly.ScratchMsgs.locales["ab"] = { - "CONTROL_FOREVER": "инагӡалатәуп", + "CONTROL_FOREVER": "инагӡалатәуп еснагь", "CONTROL_REPEAT": "инагӡалатәуп %1 - нтә", "CONTROL_IF": "%1 акәзар", "CONTROL_ELSE": "акәымзар",
[skip ci] Update translations from transifex
LLK_scratch-blocks
train
js
9c8be9edd144be500772e9a106f8f7282aba5956
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ tests_require = [ 'pydocstyle>=2.0.0', 'pytest-cov>=1.8.0', 'pytest-pep8>=1.0.6', - 'pytest>=2.8.0', + 'pytest>=4.0.0,<5.0.0', 'mock>=1.3.0', ]
setup: pin pytest version (closes #<I>)
inveniosoftware_invenio-jsonschemas
train
py
0a8e9364b8e9f31a990aa8dacd19f357c5195d1a
diff --git a/openquake/commonlib/readinput.py b/openquake/commonlib/readinput.py index <HASH>..<HASH> 100644 --- a/openquake/commonlib/readinput.py +++ b/openquake/commonlib/readinput.py @@ -1034,14 +1034,18 @@ def get_checksum32(oqparam): """ Build an unsigned 32 bit integer from the input files of the calculation """ + # NB: using adler32 & 0xffffffff is the documented way to get a checksum + # which is the same between Python 2 and Python 3 checksum = 0 for key in sorted(oqparam.inputs): fname = oqparam.inputs[key] if key == 'source': # list of fnames and/or strings for f in fname: - checksum = zlib.adler32(open(f, 'rb').read(), checksum) + data = open(f, 'rb').read() + checksum = zlib.adler32(data, checksum) & 0xffffffff elif os.path.exists(fname): - checksum = zlib.adler32(open(fname, 'rb').read(), checksum) + data = open(fname, 'rb').read() + checksum = zlib.adler32(data, checksum) & 0xffffffff else: raise ValueError('%s is not a file' % fname) return checksum
Fixed a Python 2<->3 issue
gem_oq-engine
train
py
c5aedc4264cb8327a6fb86598d615bdf287102fb
diff --git a/osrframework/__init__.py b/osrframework/__init__.py index <HASH>..<HASH> 100644 --- a/osrframework/__init__.py +++ b/osrframework/__init__.py @@ -23,4 +23,4 @@ import osrframework.utils.logger # Calling the logger when being imported osrframework.utils.logger.setupLogger(loggerName="osrframework") -__version__="0.15.0rc4" +__version__="0.15.0rc5"
Set release version to <I>rc5
i3visio_osrframework
train
py
da34ca0ec93e6e893acb9380b825cd9c5a9c3b9a
diff --git a/lib/client.js b/lib/client.js index <HASH>..<HASH> 100644 --- a/lib/client.js +++ b/lib/client.js @@ -95,6 +95,8 @@ extend(Raven.prototype, { }, install: function install(opts, cb) { + if (this.installed) return this; + if (typeof opts === 'function') { cb = opts; } @@ -110,6 +112,8 @@ extend(Raven.prototype, { } } + this.installed = true; + return this; }, @@ -386,6 +390,8 @@ extend(Raven.prototype, { }, captureBreadcrumb: function (breadcrumb) { + if (!this.installed) return; + breadcrumb = extend({ timestamp: +new Date / 1000 }, breadcrumb);
Add installed flag to avoid capturing console breadcrumbs prematurely
getsentry_sentry-javascript
train
js
a6d72c94b7f11f21356612d12f975aecad58c869
diff --git a/core/class-kirki-init.php b/core/class-kirki-init.php index <HASH>..<HASH> 100644 --- a/core/class-kirki-init.php +++ b/core/class-kirki-init.php @@ -285,7 +285,7 @@ class Kirki_Init { * @return bool */ public static function is_plugin() { - _doing_it_wrong( __METHOD__, esc_attr__( 'We detected you\'re using Kirki_Init::is_plugin(). Please use Kirki_Util::is_plugin() instead.', 'kirki' ), '3.0.10' ); + /* _doing_it_wrong( __METHOD__, esc_attr__( 'We detected you\'re using Kirki_Init::is_plugin(). Please use Kirki_Util::is_plugin() instead.', 'kirki' ), '3.0.10' ); */ // Return result using the Kirki_Util class. return Kirki_Util::is_plugin(); }
Don't add this message for now, we'll see how it goes.
aristath_kirki
train
php
8162d71c88da2c76917adc568bd2fd12ea601ea0
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -80,7 +80,7 @@ setup( 'boto', 'kazoo', #'marisa-trie', - #'jellyfish', ## required in .rpm + 'jellyfish', 'nilsimsa>=0.2', 'pytest', ## required in .rpm 'pycassa', diff --git a/src/kba/pipeline/_run_lingpipe.py b/src/kba/pipeline/_run_lingpipe.py index <HASH>..<HASH> 100644 --- a/src/kba/pipeline/_run_lingpipe.py +++ b/src/kba/pipeline/_run_lingpipe.py @@ -15,7 +15,7 @@ atomic move to put the final product into position. import streamcorpus from streamcorpus import Chunk, Label, Tagging -import lingpipe +#import lingpipe import os import re
fixing pylint fatal errors by including jellyfish in setup.py and commenting out the non-existant "lingpipe" package
trec-kba_streamcorpus-pipeline
train
py,py
2297fffa63e7e1d03f23612f5e7c550b5e79148b
diff --git a/lib/stax/mixin/dms.rb b/lib/stax/mixin/dms.rb index <HASH>..<HASH> 100644 --- a/lib/stax/mixin/dms.rb +++ b/lib/stax/mixin/dms.rb @@ -73,8 +73,8 @@ module Stax print_table Aws::Dms.tasks(filters: [{name: 'replication-task-arn', values: dms_task_arns}]).map { |t| [ t.replication_task_identifier, color(t.status, COLORS), t.migration_type, - "#{t.replication_task_stats.full_load_progress_percent}%", "#{(t.replication_task_stats.elapsed_time_millis/1000).to_i}s", - "#{t.replication_task_stats.tables_loaded} loaded", "#{t.replication_task_stats.tables_errored} errors", + "#{t.replication_task_stats&.full_load_progress_percent}%", "#{(t.replication_task_stats&.elapsed_time_millis/1000).to_i}s", + "#{t.replication_task_stats&.tables_loaded} loaded", "#{t.replication_task_stats&.tables_errored} errors", ] } end
handle nil stats for new tasks not run yet
rlister_stax
train
rb