text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
[test] Update test so it matches the Windows output git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@369595 91177308-0d34-0410-b5e6-96231b3b80d8
# coding=utf8 """ Test that C++ supports char8_t correctly. """ from __future__ import print_function import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * import lldbsuite.test.lldbutil as lldbutil class CxxChar8_tTestCase(TestBase): mydir = TestBase.compute_mydir(__file__)...
# coding=utf8 """ Test that C++ supports char8_t correctly. """ from __future__ import print_function import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * import lldbsuite.test.lldbutil as lldbutil class CxxChar8_tTestCase(TestBase): mydir = TestBase.compute_mydir(__file__)...
Make flake8 happy for spd
"""Digital leben workflow.""" from adhocracy_core.workflows import add_workflow from adhocracy_core.workflows.standard import standard_meta digital_leben_meta = standard_meta \ .transform(('states', 'participate', 'acm'), {'principals': ['participan...
"""Digital leben workflow.""" from adhocracy_core.workflows import add_workflow from adhocracy_core.workflows.standard import standard_meta digital_leben_meta = standard_meta \ .transform(('states', 'participate', 'acm'), {'principals': [ 'parti...
Resolve all the JS errors
$(document).ready(function () { /*Navigation initialization*/ var navigation = $('#navigation'); var navShown = false; var navController = $('#nav-controller'); if (navController) { navController.on('click', function () { if (navShown) { navigation.removeClass('s...
$(document).ready(function () { /*Navigation initialization*/ var navigation = $('#navigation'); var navShown = false; var navController = $('#nav-controller'); if (navController) { navController.on('click', function () { if (navShown) { navigation.removeClass('s...
Add missing Everex Token and Ripple
const Lang = imports.lang; const Local = imports.misc.extensionUtils.getCurrentExtension(); const BaseProvider = Local.imports.BaseProvider; const Api = new Lang.Class({ Name: 'BXinTH.Api', Extends: BaseProvider.Api, apiName: "BX.in.th", currencies: ['THB'], coins: ['BTC','mBTC','ETH','DAS','REP','GNO',...
const Lang = imports.lang; const Local = imports.misc.extensionUtils.getCurrentExtension(); const BaseProvider = Local.imports.BaseProvider; const Api = new Lang.Class({ Name: 'BXinTH.Api', Extends: BaseProvider.Api, apiName: "BX.in.th", currencies: ['THB'], coins: ['BTC','mBTC','ETH','DAS','REP','GNO',...
Add bail option to mochacli to halt on the first failed test.
module.exports = function (grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), clean: ['.tmp'], babel: { options: { sourceMap: true }, dist: { files: { 'dist/index.js': 'src/index.js' } }, test: {...
module.exports = function (grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), clean: ['.tmp'], babel: { options: { sourceMap: true }, dist: { files: { 'dist/index.js': 'src/index.js' } }, test: {...
Switch to small gif image.
import {assert} from 'chai'; import {jsdom} from 'jsdom'; import {ImageTransformer} from '../src/imagetransformer'; describe('image transformer', function() { beforeEach(function() { this.document = jsdom(); }); it('should accept a mimetype', function() { var imt = new ImageTransformer('...
import {assert} from 'chai'; import {jsdom} from 'jsdom'; import {ImageTransformer} from '../src/imagetransformer'; describe('image transformer', function() { beforeEach(function() { this.document = jsdom(); }); it('should accept a mimetype', function() { var imt = new ImageTransformer('...
Remove a reference to search.update
import unittest from amqp import Message from mock import patch from sir.amqp.message import (InvalidMessageContentException, Message as PMessage, MESSAGE_TYPES) class AmqpMessageTest(unittest.TestCase): @staticmethod def _parsed_message(body="artis...
import unittest from amqp import Message from mock import patch from sir.amqp.message import (InvalidMessageContentException, Message as PMessage, MESSAGE_TYPES) class AmqpMessageTest(unittest.TestCase): @staticmethod def _parsed_message(body="artis...
Adjust in a BC way to introduce TestCase
from datetime import datetime from django.core.files import File from django.conf import settings from armstrong.dev.tests.utils import ArmstrongTestCase from armstrong.dev.tests.utils.backports import * from armstrong.dev.tests.utils.concrete import * from armstrong.dev.tests.utils.users import * from ..models impor...
from datetime import datetime from django.core.files import File from django.conf import settings from armstrong.dev.tests.utils import ArmstrongTestCase from armstrong.dev.tests.utils.backports import * from armstrong.dev.tests.utils.concrete import * from armstrong.dev.tests.utils.users import * from ..models impor...
Create book if one doesn't exist during tag creation
from braces.views import LoginRequiredMixin from django.core.exceptions import PermissionDenied from django.shortcuts import ( get_object_or_404, redirect ) from contacts.models import ( Book, BookOwner, ) class BookOwnerMixin(LoginRequiredMixin): def get_queryset(self): if self.kwargs.g...
from braces.views import LoginRequiredMixin from django.core.exceptions import PermissionDenied from django.shortcuts import ( get_object_or_404, redirect ) from contacts.models import ( Book, BookOwner, ) class BookOwnerMixin(LoginRequiredMixin): def get_queryset(self): if self.kwargs.g...
Use Chrome in headless mode
// Karma configuration file, see link for more information // https://karma-runner.github.io/0.13/config/configuration-file.html module.exports = function (config) { config.set({ basePath: '', frameworks: ['jasmine', '@angular/cli'], plugins: [ require('karma-jasmine'), require('karma-chrome-...
// Karma configuration file, see link for more information // https://karma-runner.github.io/0.13/config/configuration-file.html module.exports = function (config) { config.set({ basePath: '', frameworks: ['jasmine', '@angular/cli'], plugins: [ require('karma-jasmine'), require('karma-chrome-...
Change of import of libraries. Tried to fix issue displayed below. [root@alarm BeagleDash]# python3.3 CANtoUDP.py Traceback (most recent call last): File "CANtoUDP.py", line 10, in <module> listeners = [csv, UDPSender()] TypeError: 'module' object is not callable Exception AttributeError: "'super' object has no attri...
from can import Listener from socket import socket class UDPSender(Listener): dataConvert = {"0x600": {"String":"RPM:", "Slot":0, "Conversion":1}, "0x601": {"String":"OIL:", "Slot":2, ...
from can import Listener import socket class UDPSender(Listener): dataConvert = {"0x600": {"String":"RPM:", "Slot":0, "Conversion":1}, "0x601": {"String":"OIL:", "Slot":2, "Convers...
Add all available servers to status
'use strict'; const has = require('has'); function collectPoolStatus(stats, { type, host, pool }) { const poolStats = [ ['_allConnections', 'open'], ['_freeConnections', 'sleeping'], ['_acquiringConnections', 'waiting'] ] .filter(([mysqljsProp]) => has(pool, mysqljsProp) && Arr...
'use strict'; const has = require('has'); function collectPoolStatus(stats, { type, host, pool }) { const poolStats = [ ['_allConnections', 'open'], ['_freeConnections', 'sleeping'], ['_acquiringConnections', 'waiting'] ] .filter(([mysqljsProp]) => has(pool, mysqljsProp) && Arr...
Fix undefined class Profile in templates
<?php /* * This file is part of Twig. * * (c) Fabien Potencier * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Twig\Compiler; use Twig\Node\Node; /** * Represents a profile enter node. * * @author Fabien Potencier <fabien...
<?php /* * This file is part of Twig. * * (c) Fabien Potencier * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Twig\Compiler; use Twig\Node\Node; use Twig\Profiler\Profile; /** * Represents a profile enter node. * * @auth...
Change logger messages to info
# -*- coding: utf-8 -*- import logging import urllib2 from openerp.http import request from openerp.osv import orm logger = logging.getLogger(__name__) class ir_http(orm.AbstractModel): _inherit = 'ir.http' def _handle_exception(self, exception, code=500): code = getattr(exception, 'code', code) ...
# -*- coding: utf-8 -*- import logging import urllib2 from openerp.http import request from openerp.osv import orm logger = logging.getLogger(__name__) class ir_http(orm.AbstractModel): _inherit = 'ir.http' def _handle_exception(self, exception, code=500): code = getattr(exception, 'code', code) ...
Create more meaning for the template variable
var replaceAll = function( oldToken ) { var configs = this; return { from: function( string ) { return { to: function( newToken ) { var template; var index = -1; if ( configs.ignoringCase ) { template = oldToken.toLowerCase(); while(( ...
var replaceAll = function( oldToken ) { var configs = this; return { from: function( string ) { return { to: function( newToken ) { var _token; var index = -1; if ( configs.ignoringCase ) { _token = oldToken.toLowerCase(); while(( ...
Use serialized subject where possible
package org.github.pesan.tools.servicespy.action; import io.reactivex.Completable; import io.reactivex.Observable; import io.reactivex.subjects.ReplaySubject; import io.reactivex.subjects.Subject; import org.github.pesan.tools.servicespy.action.entry.LogEntry; import org.github.pesan.tools.servicespy.action.entry.Requ...
package org.github.pesan.tools.servicespy.action; import io.reactivex.Completable; import io.reactivex.Observable; import io.reactivex.subjects.ReplaySubject; import io.reactivex.subjects.Subject; import org.github.pesan.tools.servicespy.action.entry.LogEntry; import org.github.pesan.tools.servicespy.action.entry.Requ...
Add global chai `expect` for system tests
#!/usr/bin/env node require('shelljs/global'); require('colors'); var async = require('async'), fs = require('fs'), path = require('path'), expect = require('chai').expect, Mocha = require('mocha'), SPEC_SOURCE_DIR = './test/system'; module.exports = function (exit) { // banner line conso...
#!/usr/bin/env node require('shelljs/global'); require('colors'); var async = require('async'), fs = require('fs'), path = require('path'), Mocha = require('mocha'), SPEC_SOURCE_DIR = './test/system'; module.exports = function (exit) { // banner line console.log('\nRunning system tests using ...
Remove nodeunit as that test is bad
module.exports = function(grunt) { 'use strict'; grunt.initConfig({ benchmark: { singleTest: { src: ['benchmarks/singleTest.js'], dest: 'results/singleTest.csv' }, loneFunction: { src: ['benchmarks/loneFunction.js'], dest: 'results/loneFunction.csv' }, ...
module.exports = function(grunt) { 'use strict'; grunt.initConfig({ benchmark: { singleTest: { src: ['benchmarks/singleTest.js'], dest: 'results/singleTest.csv' }, loneFunction: { src: ['benchmarks/loneFunction.js'], dest: 'results/loneFunction.csv' }, ...
NXP-11577: Fix Sonar Major violation: Hide Utility Class Constructor
package org.nuxeo.drive.service.impl; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; import org.apache.commons.lang.StringUtils; import org.nuxeo.ecm.core.api.IdRef; public class RootDefinitionsHelper { private RootDefinitionsHelper() { // Utility c...
package org.nuxeo.drive.service.impl; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; import org.apache.commons.lang.StringUtils; import org.nuxeo.ecm.core.api.IdRef; public class RootDefinitionsHelper { public static Map<String, Set<IdRef>> parseRootDefinit...
Handle empty "component" streams Implement read(byte[],int,int) as optimisation
package org.bouncycastle.asn1; import java.io.InputStream; import java.io.IOException; class ConstructedOctetStream extends InputStream { private final ASN1ObjectParser _parser; private boolean _first = true; private InputStream _currentStream; ConstructedOctetStream( ...
package org.bouncycastle.asn1; import java.io.InputStream; import java.io.IOException; class ConstructedOctetStream extends InputStream { private final ASN1ObjectParser _parser; private boolean _first = true; private InputStream _currentStream; ConstructedOctetStream( ...
Sort by name if location not available
$(function () { var locationList = $("#location-list"); function populateLocations(data) { locationList.empty(); $.each(data.features, function(i, v) { $("<li/>").appendTo(locationList) .toggleClass("lead", i == 0 && data.locationKnown) .html(v.properties.details); }); } if (lo...
$(function () { var locationList = $("#location-list"); function populateLocations(features) { locationList.empty(); $.each(features, function(i, v) { $("<li/>").appendTo(locationList) .toggleClass("lead", i == 0) .html(v.properties.details); }); } if (locationList.length > 0) ...
Tweak comment about field ID Co-Authored-By: jryans <91e4c98f79b38ce04c052c188926e2d9ae2a3b28@gmail.com>
/* Copyright 2019 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software ...
/* Copyright 2019 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software ...
Allow arbitrary kwargs for die utility function. by: Glenn, Giles
# Copyright (c) 2011 Resolver Systems Ltd. # All Rights Reserved # try: import unittest2 as unittest except ImportError: import unittest from datetime import timedelta from mock import call class ResolverTestMixins(object): def assertCalledOnce(self, mock, *args, **kwargs): if mock.call_args_lis...
# Copyright (c) 2011 Resolver Systems Ltd. # All Rights Reserved # try: import unittest2 as unittest except ImportError: import unittest from datetime import timedelta from mock import call class ResolverTestMixins(object): def assertCalledOnce(self, mock, *args, **kwargs): if mock.call_args_lis...
Fix slot release on method exception
import functools from pkit.slot import get_slot_pool def acquire(pool_name): """Actor's method decorator to auto-acquire a slot before execution""" def decorator(method): @functools.wraps(method) def wrapper(self, *args, **kwargs): slots_pool = get_slot_pool(pool_name) ...
import functools from pkit.slot import get_slot_pool def acquire(pool_name): """Actor's method decorator to auto-acquire a slot before execution""" def decorator(method): @functools.wraps(method) def wrapper(self, *args, **kwargs): slots_pool = get_slot_pool(pool_name) ...
Remove .export-action-download now that reports.download_export.js is gone
hqDefine("reports/js/base", function() { $(function() { hqImport("reports/js/filters/main").init(); var initial_page_data = hqImport("hqwebapp/js/initial_page_data").get; var defaultConfig = initial_page_data('default_config') || {}; if (initial_page_data('has_datespan')) { ...
hqDefine("reports/js/base", function() { $(function() { hqImport("reports/js/filters/main").init(); var initial_page_data = hqImport("hqwebapp/js/initial_page_data").get; var defaultConfig = initial_page_data('default_config') || {}; if (initial_page_data('has_datespan')) { ...
Fix require of bluebird when installing from npm
var webpack = require('webpack'); var ejs = require('ejs'); var MIN = process.argv.indexOf('-p') > -1; function getBanner() { var pkg = require('./bower.json'); var banner = ['/**', ' * <%= pkg.name %> - <%= pkg.description %>', ' * @version v<%= pkg.version %>', ' * @link <%= pkg.homepage %>', ' *...
var webpack = require('webpack'); var ejs = require('ejs'); var MIN = process.argv.indexOf('-p') > -1; function getBanner() { var pkg = require('./bower.json'); var banner = ['/**', ' * <%= pkg.name %> - <%= pkg.description %>', ' * @version v<%= pkg.version %>', ' * @link <%= pkg.homepage %>', ' *...
webadmin: Remove host device table repeated column. Fix Bug #9493. Remove host device table repeated column result from Host Device Filter. Signed-off-by: wxt <c9605f97150d9d79b5b5f5ac50b5b2762db512c6@gmail.com>
package org.ovirt.engine.ui.webadmin.section.main.view.tab.host; import org.ovirt.engine.core.common.businessentities.HostDeviceView; import org.ovirt.engine.ui.common.system.ClientStorage; import org.ovirt.engine.ui.common.uicommon.model.SearchableTableModelProvider; import org.ovirt.engine.ui.common.widget.uicommon....
package org.ovirt.engine.ui.webadmin.section.main.view.tab.host; import org.ovirt.engine.core.common.businessentities.HostDeviceView; import org.ovirt.engine.ui.common.system.ClientStorage; import org.ovirt.engine.ui.common.uicommon.model.SearchableTableModelProvider; import org.ovirt.engine.ui.common.widget.uicommon....
Remove unused variables: util, self
var fs = require('fs') , findExec = require('find-exec') , child_process = require('child_process') , players = [ 'mplayer', 'afplay', 'mpg123', 'mpg321', 'play...
var fs = require('fs') , util = require('util') , findExec = require('find-exec') , child_process = require('child_process') , players = [ 'mplayer', 'afplay', 'mpg123', ...
Add unserialized cache component test
<?php declare(strict_types=1); namespace BEAR\Package; use BEAR\AppMeta\Meta; use BEAR\Package\Context\CliModule; use BEAR\Package\Module\AppMetaModule; use BEAR\Sunday\Extension\Application\AppInterface; use FakeVendor\HelloWorld\Module\AppModule; use FakeVendor\HelloWorld\Module\ProdModule; use PHPUnit\Framework\T...
<?php declare(strict_types=1); namespace BEAR\Package; use BEAR\AppMeta\Meta; use BEAR\Package\Context\CliModule; use BEAR\Package\Module\AppMetaModule; use BEAR\Sunday\Extension\Application\AppInterface; use FakeVendor\HelloWorld\Module\AppModule; use FakeVendor\HelloWorld\Module\ProdModule; use PHPUnit\Framework\T...
Fix electron behaviour when cancelling http basic auth
const electron = require('electron'); const BrowserWindow = electron.BrowserWindow; const ipcMain = electron.ipcMain; module.exports = { createAuthWindow: function(mainWindow, loginCallback) { var loginWindow = new BrowserWindow({ frame: false, height: 250, modal: true, parent: mainWindow, movabl...
const electron = require('electron'); const BrowserWindow = electron.BrowserWindow; const ipcMain = electron.ipcMain; module.exports = { createAuthWindow: function(mainWindow, loginCallback) { var loginWindow = new BrowserWindow({ frame: false, height: 250, modal: true, parent: mainWindow, movabl...
Update `ConfirmEmailForm` to use `user_service.validate_key`
from django.contrib.auth.models import User from django.core.signing import BadSignature, SignatureExpired from django import forms from . import user_service class SubscribeForm(forms.Form): email = forms.EmailField() tags = forms.CharField() def clean_tags(self): tags = self.cleaned_data['tags...
from django.contrib.auth.models import User from django import forms class SubscribeForm(forms.Form): email = forms.EmailField() tags = forms.CharField() def clean_tags(self): tags = self.cleaned_data['tags'].split(',') return [t.strip().lower() for t in tags] class UnsubscribeForm(form...
Fix __repr__ bug for CompletedApplication
import random from faker import Faker from .. import db from sqlalchemy.orm import validates class CompletedApplication(db.Model): id = db.Column(db.Integer, primary_key=True) student_profile_id = db.Column( db.Integer, db.ForeignKey('student_profile.id'), nullable=False) # college name college...
import random from faker import Faker from .. import db from sqlalchemy.orm import validates class CompletedApplication(db.Model): id = db.Column(db.Integer, primary_key=True) student_profile_id = db.Column( db.Integer, db.ForeignKey('student_profile.id'), nullable=False) # college name college...
MAINT: Add a 'count_nonzero' function to use with numpy 1.5.1.
"""Functions copypasted from newer versions of numpy. """ from __future__ import division, print_function, absolute_import import warnings import numpy as np from scipy.lib._version import NumpyVersion if NumpyVersion(np.__version__) > '1.7.0.dev': _assert_warns = np.testing.assert_warns else: def _assert_...
"""Functions copypasted from newer versions of numpy. """ from __future__ import division, print_function, absolute_import import warnings import numpy as np from scipy.lib._version import NumpyVersion if NumpyVersion(np.__version__) > '1.7.0.dev': _assert_warns = np.testing.assert_warns else: def _assert_...
Improve subscribe links formatting on small screen
<?php if (is_active_sidebar('sidebar-right')) { ?> <div class="col-md-3" id="sidebar-right"> <?php do_action('before_sidebar'); ?> <?php dynamic_sidebar('sidebar-right'); ?> <aside class="widget"> <h1 class="widget-title">Subscribe</h1> <ul class="subscri...
<?php if (is_active_sidebar('sidebar-right')) { ?> <div class="col-md-3" id="sidebar-right"> <?php do_action('before_sidebar'); ?> <?php dynamic_sidebar('sidebar-right'); ?> <aside class="widget"> <h1 class="widget-title">Subscribe</h1> <ul class="subscri...
Add function to outputter that returns the raw string to print
''' Used to manage the outputter system. This package is the modular system used for managing outputters. ''' # Import salt utils import salt.loader STATIC = ( 'yaml_out', 'text_out', 'raw_out', 'json_out', ) def display_output(data, out, opts=None): ''' Pri...
''' Used to manage the outputter system. This package is the modular system used for managing outputters. ''' # Import salt utils import salt.loader STATIC = ( 'yaml_out', 'text_out', 'raw_out', 'json_out', ) def display_output(data, out, opts=None): ''' Pri...
Fix condition to show the Delete Enrollment option
<div class="btn-group"> @if (Auth::user()->student->isEnrolledInCourse($course)) <button type="button" class="btn btn-outline-secondary btn-sm disabled">Enrolled</button> @if ($settings->withinEnrollmentPeriod() && Auth::student()->getEnrollmentInCourse($course)->isDeletable()) {{-- Sho...
<div class="btn-group"> @if (Auth::user()->student->isEnrolledInCourse($course)) <button type="button" class="btn btn-outline-secondary btn-sm disabled">Enrolled</button> @if ($settings->withinExchangePeriod() && Auth::student()->getEnrollmentInCourse($course)->isDeletable()) {{-- Show ...
Allow <del> and <ins> html tags.
import bleach allowed_tags = [ "a", "img", # links and images "br", "p", "span", "blockquote", # text layout "strike", "del", "ins", "strong", "u", "em", "sup", "sub", "pre", # text formatting "h1", "h2", "h3", "h4", "h5", "h6", #...
import bleach allowed_tags = [ "a", "img", # links and images "br", "p", "span", "blockquote", # text layout "strike", "strong", "u", "em", "sup", "sub", "pre", # text formatting "h1", "h2", "h3", "h4", "h5", "h6", # headings "ol", ...
Add missing void return types in console responder.
<?php /** * PHP version 7.1 * * This source file is subject to the license that is bundled with this package in the file LICENSE. */ namespace Ewallet\ManageWallet; use Ewallet\Memberships\{MemberId, MembersRepository}; use Symfony\Component\Console\Input\InputInterface; class TransferFundsConsoleResponder implem...
<?php /** * PHP version 7.1 * * This source file is subject to the license that is bundled with this package in the file LICENSE. */ namespace Ewallet\ManageWallet; use Ewallet\Memberships\{MemberId, MembersRepository}; use Symfony\Component\Console\Input\InputInterface; class TransferFundsConsoleResponder implem...
Add default for possible undefined destructuring
import debugModule from "debug"; const debug = debugModule("debugger:session:selectors"); import { createSelectorTree, createLeaf } from "reselect-tree"; import evm from "lib/evm/selectors"; import solidity from "lib/solidity/selectors"; const session = createSelectorTree({ /** * session.info */ info: { ...
import debugModule from "debug"; const debug = debugModule("debugger:session:selectors"); import { createSelectorTree, createLeaf } from "reselect-tree"; import evm from "lib/evm/selectors"; import solidity from "lib/solidity/selectors"; const session = createSelectorTree({ /** * session.info */ info: { ...
Fix formatting broken by phpstorm
<?php namespace AppBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; /** * Asset form * * note: title is hidden (filled from the controller based on AssetTypeTitle form) */ class AssetType extends...
<?php namespace AppBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; /** * Asset form * * note: title is hidden (filled from the controller based on AssetTypeTitle form) */ class AssetType extends ...
Fix monolog event handler compatibility
<?php /** * Spiral Framework. * * @license MIT * @author Anton Titov (Wolfy-J) */ declare(strict_types=1); namespace Spiral\Monolog; use Monolog\Handler\AbstractHandler; use Monolog\Logger; use Spiral\Logger\Event\LogEvent; use Spiral\Logger\ListenerRegistryInterface; final class EventHandler extends Abs...
<?php /** * Spiral Framework. * * @license MIT * @author Anton Titov (Wolfy-J) */ declare(strict_types=1); namespace Spiral\Monolog; use Monolog\Handler\AbstractHandler; use Monolog\Logger; use Spiral\Logger\Event\LogEvent; use Spiral\Logger\ListenerRegistryInterface; final class EventHandler extends Abs...
Set _version requirement for annotation
from tornado.web import Finish from biothings.web.api.es.handlers.base_handler import ESRequestHandler class BiothingHandler(ESRequestHandler): ''' Handle requests to the annotation lookup endpoint. ''' name = 'annotation' def pre_query_builder_hook(self, options): ''' Set GA tr...
from tornado.web import Finish from biothings.web.api.es.handlers.base_handler import ESRequestHandler class BiothingHandler(ESRequestHandler): ''' Handle requests to the annotation lookup endpoint. ''' name = 'annotation' def pre_query_builder_hook(self, options): ''' Inject bi...
Fix external script invocation failing with ENOENT error
'use strict'; const childProcess = require('child_process'); const fs = require('fs'); module.exports = function(type) { process.argv.shift(); process.argv.shift(); var path = process.argv.length < 1 ? 'output_data' : process.argv[0]; var process_generate = childProcess.spawn(__dirname + '/../node_mo...
'use strict'; const childProcess = require('child_process'); const fs = require('fs'); module.exports = function(type) { process.argv.shift(); process.argv.shift(); var path = process.argv.length < 1 ? 'output_data' : process.argv[0]; var process_generate = childProcess.spawn('./node_modules/podigg/b...
Fix PEP8 and add more data Added tvdb_id and tvrage_id entries to returned data
from __future__ import unicode_literals, division, absolute_import import logging import requests from flexget import plugin from flexget.event import event from flexget.entry import Entry log = logging.getLogger('sonarr') class Sonarr(object): schema = { 'type': 'object', 'properties': { ...
from __future__ import unicode_literals, division, absolute_import import logging import requests from flexget import plugin from flexget.event import event from flexget.entry import Entry log = logging.getLogger('sonarr') class Sonarr(object): schema = { 'type': 'object', 'properties': { ...
Put php docblock for the class
<?php /** * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIB...
<?php /** * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIB...
Remove protected class access, add module docstrings.
"""Test configuration utilities.""" from __future__ import absolute_import import unittest from flask import Flask from .. import config app = Flask('__config_test') class GetFuncsTest(unittest.TestCase): """All tests for get funcs function.""" def test_get_module_funcs(self): """Test the return ...
from __future__ import absolute_import import unittest from flask import Flask from .. import config app = Flask('__config_test') class GetFuncsTest(unittest.TestCase): """All tests for get funcs function.""" def test_get_module_funcs(self): """Test the return value.""" self.assertIsInstan...
Add view for update gallery action
<?php defined('M2_MICRO') or die('Direct Access to this location is not allowed.'); /** * Gallery Controller class * @name $galleryController * @package M2 Micro Framework * @subpackage Modules * @author Alexander Chaika * @since 0.2RC1 */ class GalleryControll...
<?php defined('M2_MICRO') or die('Direct Access to this location is not allowed.'); /** * Gallery Controller class * @name $galleryController * @package M2 Micro Framework * @subpackage Modules * @author Alexander Chaika * @since 0.2RC1 */ class GalleryControll...
Fix the initial cancel bug
(function ($) { var slice = Array.prototype.slice; $.defer = function (func, delay) { var args = slice.call(arguments, 2), isCancelled = false, cancel = function (reject /* = true */) { clearTimeout(timerId); isCancelled = true; if ...
(function ($) { var slice = Array.prototype.slice; $.defer = function (func, delay) { var args = slice.call(arguments, 2), cancel = function (reject /* = true */) { clearTimeout(timerId); if ((!arguments.length || reject) && deferred.state() === "pending") { ...
Move instead of symlink because we blow that dir away.
import re import os from django.conf import settings from doc_builder.base import BaseBuilder from projects.utils import run latex_re = re.compile('the LaTeX files are in (.*)\.') pdf_re = re.compile('Output written on (.*?)') class Builder(BaseBuilder): def build(self, project): self._cd_makefile(proj...
import re import os from django.conf import settings from doc_builder.base import BaseBuilder from projects.utils import run latex_re = re.compile('the LaTeX files are in (.*)\.') pdf_re = re.compile('Output written on (.*?)') class Builder(BaseBuilder): def build(self, project): self._cd_makefile(proj...
Make sock_read return the number of bytes read (value in )
package mars.mips.instructions.syscalls; import mars.util.*; import mars.mips.hardware.*; import mars.simulator.*; import mars.*; import java.net.Socket; import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; import java.util.Arrays; public class SyscallSocketRead extends AbstractSyscal...
package mars.mips.instructions.syscalls; import mars.util.*; import mars.mips.hardware.*; import mars.simulator.*; import mars.*; import java.net.Socket; import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; import java.util.Arrays; public class SyscallSocketRead extends AbstractSyscal...
Fix {X} no momento que vota e dá o erro
jQuery( function( $ ) { $('.js-vote-button').click(function() { var post_id = $(this).data('post_id'); var panel = $(this).closest('.panel-heading'); $.ajax({ url: vote.ajaxurl, dataType: 'json', method: 'POST', data: { acti...
jQuery( function( $ ) { $('.js-vote-button').click(function() { var post_id = $(this).data('post_id'); var panel = $(this).closest('.panel-heading'); $.ajax({ url: vote.ajaxurl, dataType: 'json', method: 'POST', data: { acti...
Use array_key_exists() instead of isset() So that it works when modifying the field value to null, too.
<?php /** Tatoeba Project, free collaborative creation of languages corpuses project Copyright (C) 2014 Gilles Bedel This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either...
<?php /** Tatoeba Project, free collaborative creation of languages corpuses project Copyright (C) 2014 Gilles Bedel This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either...
Support all the fortran grammars
"use babel"; export default { config: { executable: { type: "string", default: "gfortran" }, gfortran_flags: { type: "string", default: "-Wall -Wextra" }, }, activate: () => { require("atom-package-deps").install("lint...
"use babel"; export default { config: { executable: { type: "string", default: "gfortran" }, gfortran_flags: { type: "string", default: "-Wall -Wextra" }, }, activate: () => { require("atom-package-deps").install("lint...
Fix a pass by reference, and don't create APIs for hidden directories
<?php namespace App\Providers; use Illuminate\Routing\Router; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; class RouteServiceProvider extends ServiceProvider { /** * This namespace is applied to the controller routes in your routes file. * * In addition, it ...
<?php namespace App\Providers; use Illuminate\Routing\Router; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; class RouteServiceProvider extends ServiceProvider { /** * This namespace is applied to the controller routes in your routes file. * * In addition, it ...
Fix cancel session invite so that it doesn't require admin rights
(function () { 'use strict'; function cancelSessionInviteCtrl($scope, $state, $stateParams, currentUser, $translate, alertService, usSpinnerService, cdEventsService) { usSpinnerService.spin('session-spinner'); var applicationId = $stateParams.applicationId; var eventId = $stateParams.eventId;...
(function () { 'use strict'; function cancelSessionInviteCtrl($scope, $state, $stateParams, currentUser, $translate, alertService, usSpinnerService, cdEventsService) { usSpinnerService.spin('session-spinner'); var applicationId = $stateParams.applicationId; var ticketId = $stateParams.eventId...
Fix de-parametize in URL utility jQuery replaces encoded spaces with plus signs. To prevent encoding of the plus sign itself, they are replaced with a space prior to decoding. Signed-off-by: Byron Ruth <e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98@devel.io>
/* global define */ define(['jquery'], function($) { /* * Utility method for parsing links. See: * http://stackoverflow.com/a/6644749/407954 * https://developer.mozilla.org/en-US/docs/Web/API/window.location */ var linkParser = function(href) { var a = document.createElem...
/* global define */ define(['jquery'], function($) { /* * Utility method for parsing links. See: * http://stackoverflow.com/a/6644749/407954 * https://developer.mozilla.org/en-US/docs/Web/API/window.location */ var linkParser = function(href) { var a = document.createElem...
Fix the port to 9092
package com.splicemachine.kafka; import java.io.IOException; import java.util.Properties; import kafka.server.KafkaConfig; import kafka.server.KafkaServerStartable; import kafka.utils.TestUtils; public class TestKafkaCluster { KafkaServerStartable kafkaServer; public TestKafkaCluster(String connectString) th...
package com.splicemachine.kafka; import java.io.IOException; import java.util.Properties; import kafka.server.KafkaConfig; import kafka.server.KafkaServerStartable; import kafka.utils.TestUtils; public class TestKafkaCluster { KafkaServerStartable kafkaServer; public TestKafkaCluster(String connectString) th...
Move `&&` at the beginning of line to end of previous line
<?php declare (strict_types = 1); ?><!DOCTYPE html> <html <?php \language_attributes(); ?>> <head> <meta charset="<?php \bloginfo('charset'); ?>" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <!--[if IE]> <meta http-equiv="X-UA-Compatible" content=...
<?php declare (strict_types = 1); ?><!DOCTYPE html> <html <?php \language_attributes(); ?>> <head> <meta charset="<?php \bloginfo('charset'); ?>" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <!--[if IE]> <meta http-equiv="X-UA-Compatible" content=...
Fix typo in redis error message
# -*- coding: utf-8 -*- """ Interface to Redis-storage. @author: Seva Zhidkov @contact: zhidkovseva@gmail.com @license: The MIT license Copyright (C) 2015 """ from .utils import logger # We will catch all import exceptions in bot.py from redis import StrictRedis class Storage: def __init__(self, bot): ...
# -*- coding: utf-8 -*- """ Interface to Redis-storage. @author: Seva Zhidkov @contact: zhidkovseva@gmail.com @license: The MIT license Copyright (C) 2015 """ from .utils import logger # We will catch all import exceptions in bot.py from redis import StrictRedis class Storage: def __init__(self, bot): ...
crosvm: Enable clippy in windows LUCI For linux based systems, clippy continues to run in health_check BUG=b:257249038 TEST=CQ Change-Id: I39d3d45a0db72c61e79fd2c51b195b82c067a244 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3993934 Reviewed-by: Dennis Kempin <cd09796fb571bec2782819dbfd333...
# Copyright 2022 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from recipe_engine.post_process import Filter PYTHON_VERSION_COMPATIBILITY = "PY3" DEPS = [ "crosvm", "recipe_engine/buildbucket", "recipe_engine/context", "re...
# Copyright 2022 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from recipe_engine.post_process import Filter PYTHON_VERSION_COMPATIBILITY = "PY3" DEPS = [ "crosvm", "recipe_engine/buildbucket", "recipe_engine/context", "re...
Set except import error on add introspection rules south
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.db.models.fields import CharField from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import python_2_unicode_compatible from tags.models import Tag @python_2_unicode_compatible class TagField(CharField): def __init__(self, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.db.models.fields import CharField from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import python_2_unicode_compatible from tags.models import Tag @python_2_unicode_compatible class TagField(CharField): def __init__(self, ...
Allow multiple sequential rpc requests
<?php namespace OldSound\RabbitMqBundle\RabbitMq; use OldSound\RabbitMqBundle\RabbitMq\BaseAmqp; use PhpAmqpLib\Message\AMQPMessage; class RpcClient extends BaseAmqp { protected $requests = 0; protected $replies = array(); protected $queueName; public function initClient() { list($this->...
<?php namespace OldSound\RabbitMqBundle\RabbitMq; use OldSound\RabbitMqBundle\RabbitMq\BaseAmqp; use PhpAmqpLib\Message\AMQPMessage; class RpcClient extends BaseAmqp { protected $requests = 0; protected $replies = array(); protected $queueName; public function initClient() { list($this->...
Augment number of retrieved actions to the max
import R from 'ramda'; import {Observable} from 'rx'; const trelloSinkDriver = R.curry( ( boardId, input$ ) => { return { actions$: Observable.create( ( observer ) => { input$.subscribe( () => { Trello.get( '/boards/' + boardId + '/actions', { filter: 'createCard,del...
import R from 'ramda'; import {Observable} from 'rx'; const trelloSinkDriver = R.curry( ( boardId, input$ ) => { return { actions$: Observable.create( ( observer ) => { input$.subscribe( () => { Trello.get( '/boards/' + boardId + '/actions', { filter: 'createCard,del...
Update documentation link and text
import React from 'react'; import AuthStore from '../stores/AuthStore'; import AlertPanel from './AlertPanel'; import Config from '../config/Config'; import MetadataStore from '../stores/MetadataStore'; const METHODS_TO_BIND = [ 'handleUserLogout' ]; module.exports = class AccessDeniedPage extends React.Component ...
import React from 'react'; import AuthStore from '../stores/AuthStore'; import AlertPanel from './AlertPanel'; import Config from '../config/Config'; import MetadataStore from '../stores/MetadataStore'; const METHODS_TO_BIND = [ 'handleUserLogout' ]; module.exports = class AccessDeniedPage extends React.Component ...
Check for empty cluster dr files.
#!/usr/bin/env python3 from collections import defaultdict import hashlib import json import os import sys from gigacluster import Doc, dr, Tokenizer tok = Tokenizer() stats = defaultdict(int) for root, dirs, files in os.walk(sys.argv[1]): dirs.sort() files = set(files) cluster_dr = os.path.join(root, 'clu...
#!/usr/bin/env python3 import hashlib import json import os import sys print(sys.path) from gigacluster import Doc, dr, Tokenizer tok = Tokenizer() for root, dirs, files in os.walk(sys.argv[1]): dirs.sort() files = set(files) cluster_dr = os.path.join(root, 'cluster.dr') with open(cluster_dr, 'wb') as...
Add option to images links to open in parent tab or new tab
<?php namespace actsmart\actsmart\Actuators\WebChat; class WebChatImageMessage extends WebChatMessage { private $imgSrc = null; private $imgLink = null; private $linkNewTab = true; /** * @param $imgSrc * @return $this */ public function setImgSrc($imgSrc) { $this->img...
<?php namespace actsmart\actsmart\Actuators\WebChat; class WebChatImageMessage extends WebChatMessage { private $imgSrc = null; private $imgLink = null; /** * @param $imgSrc * @return $this */ public function setImgSrc($imgSrc) { $this->imgSrc = $imgSrc; return $th...
Delete `randomSample()' because it is no longer used.
""" Provides code to morph a chunk of data to a given probability distribution. The class provides an interface to morph network packet lengths to a previously generated probability distribution. The packet lengths of the morphed network data should then match the probability distribution. """ import random import ...
""" Provides code to morph a chunk of data to a given probability distribution. The class provides an interface to morph network packet lengths to a previously generated probability distribution. The packet lengths of the morphed network data should then match the probability distribution. """ import random import ...
Update to use Google Aviator test log
import os import base64 from requests import Session, Request from OpenSSL import crypto url = 'http://ct.googleapis.com/aviator/ct/v1/get-roots' s = Session() r = Request('GET', url) prepped = r.prepare() r = s.send(prepped) if r.status_code == 200: roots = r.json() # RFC 6962 defines the cert...
import os import base64 from requests import Session, Request from OpenSSL import crypto #url = 'http://ct.googleapis.com/aviator/ct/v1/get-roots' url = 'https://ct.api.venafi.com/ct/v1/get-roots' s = Session() r = Request('GET', url) prepped = r.prepare() r = s.send(prepped) if r.status_code == 20...
Use adapter position instead of layout params position as causing IndexOutOfBoundsException otherwise
package com.veyndan.redditclient.ui.recyclerview.itemdecoration; import android.content.Context; import android.graphics.Rect; import android.support.annotation.DimenRes; import android.support.annotation.NonNull; import android.support.annotation.Px; import android.support.v7.widget.RecyclerView; import android.view....
package com.veyndan.redditclient.ui.recyclerview.itemdecoration; import android.content.Context; import android.graphics.Rect; import android.support.annotation.DimenRes; import android.support.annotation.NonNull; import android.support.annotation.Px; import android.support.v7.widget.RecyclerView; import android.view....
Load babel polyfills, to work in less ES6 ready browsers.
import React from 'react'; import 'babel/polyfill'; import Logo from './components/logo' import SocialButtons from './components/social-buttons' import Navigation from './components/navigation' import Home from './components/home'; import Footer from './components/footer'; import AppUrl from './appurl' class Page { ...
import React from 'react'; import Logo from './components/logo' import SocialButtons from './components/social-buttons' import Navigation from './components/navigation' import Home from './components/home'; import Footer from './components/footer'; import AppUrl from './appurl' class Page { render() { let...
Move tokens null check to method.
<?php namespace Symfony\Upgrade\Fixer; use Symfony\CS\Tokenizer\Token; use Symfony\CS\Tokenizer\Tokens; class FormGetnameToGetblockprefixFixer extends FormTypeFixer { /** * {@inheritdoc} */ public function fix(\SplFileInfo $file, $content) { $tokens = Tokens::fromCode($content); ...
<?php namespace Symfony\Upgrade\Fixer; use Symfony\CS\Tokenizer\Token; use Symfony\CS\Tokenizer\Tokens; class FormGetnameToGetblockprefixFixer extends FormTypeFixer { /** * @inheritdoc */ public function fix(\SplFileInfo $file, $content) { $tokens = Tokens::fromCode($content); ...
Use more updated api methods
/* Collapse remember * Use a cookie to "remember" the state of bootstrap collapse divs * use the 'collapse-remember' class to get this functionality */ $(document).ready(function () { const state_cookie_c = 'collapse-remember'; var page = window.location.pathname; var state = Cookies.getJSON(state_cookie...
/* Collapse remember * Use a cookie to "remember" the state of bootstrap collapse divs * use the 'collapse-remember' class to get this functionality */ $(document).ready(function () { const state_cookie_c = 'collapse-remember'; var page = window.location.pathname; var state = Cookies.getJSON(state_cookie...
Fix thread-safety issue in stagecraft Django middleware is not thread-safe. We should store this context on the request object instance. Django always calls `process_response`, but it is possible that `process_request` has been skipped. So we have a guard checking that it’s safe to log the response time. See https:/...
# encoding: utf-8 from __future__ import unicode_literals import logging import time logger = logging.getLogger(__name__) class RequestLoggerMiddleware(object): def process_request(self, request): request.start_request_time = time.time() logger.info("{method} {path}".format( method=...
# encoding: utf-8 from __future__ import unicode_literals import logging import time logger = logging.getLogger(__name__) class RequestLoggerMiddleware(object): def process_request(self, request): self.request_time = time.time() logger.info("{method} {path}".format( method=request.m...
Split out 'test' from 'jshint' subcommands in grunt
'use strict'; module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jshint: { all: [ 'Gruntfile.js', 'lib/*.js', 'test/*.js' ], options: { jshintrc: '.jshintr...
'use strict'; module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jshint: { all: [ 'Gruntfile.js', 'lib/*.js', 'test/*.js' ], options: { jshintrc: '.jshintr...
Decrease retry delay in fault tolerant execution tests Some tests are written to fail with an external failure what causes tasks being retried several times.
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribut...
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribut...
Add control when creating a new refresh token and there is no refresh_token key in the response
<?php namespace Edujugon\GoogleAds\Console; use Edujugon\GoogleAds\Auth\OAuth2; use Illuminate\Console\Command; class RefreshTokenCommand extends Command { /** * Console command signature * * @var string */ protected $signature = 'googleads:token:generate'; /** * Description ...
<?php namespace Edujugon\GoogleAds\Console; use Edujugon\GoogleAds\Auth\OAuth2; use Illuminate\Console\Command; class RefreshTokenCommand extends Command { /** * Console command signature * * @var string */ protected $signature = 'googleads:token:generate'; /** * Description ...
Fix text to prove that behavior
# -*- coding: utf-8 -*- from __future__ import absolute_import import mock from exam import fixture from sentry.testutils import TestCase from sentry.interfaces import User from sentry.models import Event class UserTest(TestCase): @fixture def event(self): return mock.Mock(spec=Event()) @fixtu...
# -*- coding: utf-8 -*- from __future__ import absolute_import import mock from exam import fixture from sentry.testutils import TestCase from sentry.interfaces import User from sentry.models import Event class UserTest(TestCase): @fixture def event(self): return mock.Mock(spec=Event()) @fixtu...
Allow bypassing body payload directly
const Errors = require('./../../errors'); const Message = require('./../index'); const JSON_CONTENT_TYPE = "application/json"; Message.request.addInterceptor(requestInterceptorBodyParser); function requestInterceptorBodyParser() { return new Promise((resolve, reject) => { let body = []; this.re...
const Errors = require('./../../errors'); const Message = require('./../index'); const JSON_CONTENT_TYPE = "application/json"; Message.request.addInterceptor(requestInterceptorBodyParser); function requestInterceptorBodyParser() { return new Promise((resolve, reject) => { let body = []; this.re...
Fix integrity error reusing db in tests Base `setUpClass` needs to be called first so the transaction is initialized before we mutate the data. This solves a conflic raised when using `--reuse-db`.
from django.contrib.auth.models import User from django.test import TestCase, override_settings class TestLanguageSwitching(TestCase): @classmethod def setUpClass(cls): super(TestLanguageSwitching, cls).setUpClass() User.objects.create_user( username="admin", password="admin", emai...
from django.contrib.auth.models import User from django.test import TestCase, override_settings class TestLanguageSwitching(TestCase): @classmethod def setUpClass(cls): User.objects.create_user( username="admin", password="admin", email="admin@example.com" ) super(TestLangu...
Delete to existing constructor and fix typo
// Copyright 2017 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.document; import com.yahoo.document.datatypes.FieldValue; import com.yahoo.document.datatypes.ReferenceFieldValue; public class ReferenceDataType extends DataType { private final Do...
// Copyright 2017 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.document; import com.yahoo.document.datatypes.FieldValue; import com.yahoo.document.datatypes.ReferenceFieldValue; public class ReferenceDataType extends DataType { private final Do...
Use spaces instead of tabs
angular .module('ngSharepoint.Lists') .factory('Query', function() { var Query = function() { //this.__queries = {}; }; Query.prototype.unpackItem = function(item) { var query = this; var obj = {}; if (Array.isArray(query.__values)) { ...
angular .module('ngSharepoint.Lists') .factory('Query', function() { var Query = function() { //this.__queries = {}; }; Query.prototype.unpackItem = function(item) { var query = this; var obj = {}; if (Array.isArray(query.__values)) { query.__values.f...
Fix contributor URL using id instead of username [SWIK-1953]
import React from 'react'; import {creatorAttribute} from './util/ContributorsUtil'; import {contains} from './util/ContributorsUtil'; import UserPicture from '../../../common/UserPicture'; class ContributorItem extends React.Component { render() { return ( <a className="item" href={'/user/' + ...
import React from 'react'; import {creatorAttribute} from './util/ContributorsUtil'; import {contains} from './util/ContributorsUtil'; import UserPicture from '../../../common/UserPicture'; class ContributorItem extends React.Component { render() { let link = '/user/' + this.props.data.id; let func...
[test] Use single quotes for consistency.
var expect = require('expect.js'), qrcode = require('./../lib/main'), sinon = require('sinon'); describe('in the main module', function() { describe('the generate method', function () { describe('when not providing a callback', function () { beforeEach(function () { sino...
var expect = require("expect.js"), qrcode = require('./../lib/main'), sinon = require("sinon"); describe('in the main module', function() { describe("the generate method", function () { describe("when not providing a callback", function () { beforeEach(function () { sino...
Correct location of Protractor executable
'use strict'; var path = require('path'); var yargs = require('yargs'); var merge = require('lodash.merge'); var flatten = require('./lib/flatten'); module.exports = function(grunt) { grunt.registerMultiTask('ptor', 'Run Protractor e2e tests.', function() { var done = function() {}; if (process.env.NODE_...
'use strict'; var path = require('path'); var yargs = require('yargs'); var merge = require('lodash.merge'); var flatten = require('./lib/flatten'); module.exports = function(grunt) { grunt.registerMultiTask('ptor', 'Run Protractor e2e tests.', function() { var done = function() {}; if (process.env.NODE_...
Remove codecov dependency because it's now a github action
"""Mailmerge build and install configuration.""" from pathlib import Path import setuptools # Read the contents of README file PROJECT_DIR = Path(__file__).parent README = PROJECT_DIR/"README.md" LONG_DESCRIPTION = README.open().read() setuptools.setup( name="mailmerge", description="A simple, command line ...
"""Mailmerge build and install configuration.""" from pathlib import Path import setuptools # Read the contents of README file PROJECT_DIR = Path(__file__).parent README = PROJECT_DIR/"README.md" LONG_DESCRIPTION = README.open().read() setuptools.setup( name="mailmerge", description="A simple, command line ...
Fix passing sets to batchable methods Sets don't support indexing, so convert them to lists.
import functools ITERABLE_TYPES = ( list, set, tuple, ) try: from numpy import ndarray ITERABLE_TYPES = ITERABLE_TYPES + (ndarray,) except ImportError: pass def isiterable(v): return isinstance(v, ITERABLE_TYPES) def batchable(func=None, batch_size=100): def do_batch(*args, **kwar...
import functools ITERABLE_TYPES = ( list, set, tuple, ) try: from numpy import ndarray ITERABLE_TYPES = ITERABLE_TYPES + (ndarray,) except ImportError: pass def isiterable(v): return isinstance(v, ITERABLE_TYPES) def batchable(func=None, batch_size=100): def do_batch(*args, **kwar...
Change arrow function to an IE11 compatible function Imports https://github.com/api-platform/core/pull/2899 and fixes https://github.com/nelmio/NelmioApiDocBundle/issues/1517
// This file is part of the API Platform project. // // (c) Kévin Dunglas <dunglas@gmail.com> // // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. window.onload = function() { const data = JSON.parse(document.getElementById('swagger-data')....
// This file is part of the API Platform project. // // (c) Kévin Dunglas <dunglas@gmail.com> // // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. window.onload = () => { const data = JSON.parse(document.getElementById('swagger-data').inner...
Raise TypeError if positional batchable argument is missing e.g. if it's erroneously been passed as a named argument.
from __future__ import absolute_import, division, print_function from builtins import range import functools ITERABLE_TYPES = ( list, set, tuple, ) MISSING_POSITIONAL_ERR = 'Required positional argument (pos 1) not found' try: from numpy import ndarray ITERABLE_TYPES = ITERABLE_TYPES + (ndarray...
from __future__ import absolute_import, division, print_function from builtins import range import functools ITERABLE_TYPES = ( list, set, tuple, ) try: from numpy import ndarray ITERABLE_TYPES = ITERABLE_TYPES + (ndarray,) except ImportError: pass def isiterable(v): return isinstance(...
Support all Apollo's subscriptions transport sub-protocol
<?php namespace Siler\Graphql; use Ratchet\ConnectionInterface; use Ratchet\MessageComponentInterface; use Ratchet\WebSocket\WsServerInterface; use Siler\Graphql; class SubscriptionServer implements MessageComponentInterface, WsServerInterface { protected $manager; public function __construct(SubscriptionMa...
<?php namespace Siler\Graphql; use Ratchet\ConnectionInterface; use Ratchet\MessageComponentInterface; use Ratchet\WebSocket\WsServerInterface; use Siler\Graphql; class SubscriptionServer implements MessageComponentInterface, WsServerInterface { protected $manager; public function __construct(SubscriptionMa...
JBEHAVE-243: Verify content of table as string. git-svn-id: 1c3b30599278237804f5418c838e2a3e6391d478@1570 df8dfae0-ecdd-0310-b8d8-a050f7ac8317
package org.jbehave.scenario.definition; import static java.util.Arrays.asList; import static org.junit.Assert.assertEquals; import org.junit.Test; public class ExamplesTableBehaviour { String tableAsString = "|one|two|\n" + "|11|12|\n" + "|21|22|\n"; @Test public void shouldPa...
package org.jbehave.scenario.definition; import static java.util.Arrays.asList; import static org.junit.Assert.assertEquals; import org.junit.Test; public class ExamplesTableBehaviour { @Test public void shouldParseTableIntoHeadersAndRows() { String tableAsString = "|one|two|\n" + ...
Add osm id into exportde nodes [skip ci]
const parseNode = (node) => { const parsedNode = { osmId: node.$.id, name: null, amenity: null, address: { location: { latitude: parseFloat(node.$.lat), longitude: parseFloat(node.$.lon), }, }, }; node.$children.forEach(child => { if (typeof child === 'string' |...
const parseNode = (node) => { const parsedNode = { name: null, amenity: null, address: { location: { latitude: parseFloat(node.$.lat), longitude: parseFloat(node.$.lon), }, }, }; node.$children.forEach(child => { if (typeof child === 'string' || !child.$) return; ...
Improve check for single by only issuing search once
<?php class AlgorithmConnectedComponents extends Algorithm{ /** * * @var Graph */ private $graph; /** * * @param Graph $graph */ public function __construct(Graph $graph){ $this->graph = $graph; } /** * check whether this graph consist...
<?php class AlgorithmConnectedComponents extends Algorithm{ /** * * @var Graph */ private $graph; /** * * @param Graph $graph */ public function __construct(Graph $graph){ $this->graph = $graph; } /** * check whether this graph consist...
Use uvloop because apparently it's fast.
#!/usr/bin/env python3.6 import argparse import asyncio import logging import sys from pathlib import Path from MoMMI.logsetup import setup_logs # Do this BEFORE we import master, because it does a lot of event loop stuff. if sys.platform == "win32": loop = asyncio.ProactorEventLoop() asyncio.set_event_loop(lo...
#!/usr/bin/env python3 import argparse import asyncio import logging import sys from pathlib import Path from MoMMI.logsetup import setup_logs # Do this BEFORE we import master, because it does a lot of event loop stuff. if sys.platform == "win32": loop = asyncio.ProactorEventLoop() asyncio.set_event_loop(loop...
Remove broken reference to Image.LoaderError This exception has not existed since Willow 0.3. Type checking on the 'except' line only happens when an exception occurs, so most of the time this is harmless, but if an unrelated exception occurs here (such as that caused by a faulty filetype library: https://github.com/h...
import os from functools import lru_cache from django.core.checks import Warning, register from willow.image import Image @lru_cache() def has_jpeg_support(): wagtail_jpg = os.path.join(os.path.dirname(__file__), "check_files", "wagtail.jpg") succeeded = True with open(wagtail_jpg, "rb") as f: t...
import os from functools import lru_cache from django.core.checks import Warning, register from willow.image import Image @lru_cache() def has_jpeg_support(): wagtail_jpg = os.path.join(os.path.dirname(__file__), "check_files", "wagtail.jpg") succeeded = True with open(wagtail_jpg, "rb") as f: t...
Use proper import from utils
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.test import TestCase from modeltrans.manager import transform_translatable_fields from modeltrans.utils import (build_localized_fieldname, split_translated_fieldname) from tests.app.models import Blog class Uti...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.test import TestCase from modeltrans.manager import (split_translated_fieldname, transform_translatable_fields) from modeltrans.utils import build_localized_fieldname from tests.app.models import Blog class U...
Fix issue with idSelector column/line reporting
'use strict'; const parseSelector = require('../utils/parse-selector'); module.exports = { name: 'idSelector', nodeTypes: ['rule'], message: 'Selectors should not use IDs.', lint: function idSelectorLinter (config, node) { const tree = parseSelector(node); const excludes = config.excl...
'use strict'; const parseSelector = require('../utils/parse-selector'); module.exports = { name: 'idSelector', nodeTypes: ['rule'], message: 'Selectors should not use IDs.', lint: function idSelectorLinter (config, node) { const tree = parseSelector(node); const excludes = config.excl...
Use import instead of require
#!/usr/bin/env node import q from 'q'; import fs from 'fs'; import path from 'path'; import glob from 'glob'; import xml2js from 'xml2js'; import {deleteSync} from 'del'; module.exports = function(context) { var deferral = q.defer(); var parser = new xml2js.Parser(); fs.readFile('config.xml', 'utf8', function (...
#!/usr/bin/env node var q = require('q'); var fs = require('fs'); var path = require('path'); var glob = require('glob'); var xml2js = require('xml2js'); var del = require('del'); module.exports = function(context) { var deferral = q.defer(); var parser = new xml2js.Parser(); fs.readFile('config.xml', 'utf8', f...
Fix test failures in MySQLi test
<?php namespace Doctrine\Tests\DBAL\Functional\Mysqli; class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase { public function setUp() { if (!extension_loaded('mysqli')) { $this->markTestSkipped('mysqli is not installed.'); } $this->resetSharedConn(); ...
<?php namespace Doctrine\Tests\DBAL\Functional\Mysqli; class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase { public function setUp() { if (!extension_loaded('mysqli')) { $this->markTestSkipped('mysqli is not installed.'); } $driver = getenv('DB'); if...
Fix bug handling exceptions in RevisionMiddleware Recently the RevisionMiddleware was modified to avoid accessing request.user unncessarily for caching purposes. This works well except in some cases it can obscure errors generated elsewhere in a project. The RevisionContextManager has "active" and "inactive" states....
"""Middleware used by Reversion.""" from __future__ import unicode_literals from reversion.revisions import revision_context_manager REVISION_MIDDLEWARE_FLAG = "reversion.revision_middleware_active" class RevisionMiddleware(object): """Wraps the entire request in a revision.""" def process_reque...
"""Middleware used by Reversion.""" from __future__ import unicode_literals from reversion.revisions import revision_context_manager REVISION_MIDDLEWARE_FLAG = "reversion.revision_middleware_active" class RevisionMiddleware(object): """Wraps the entire request in a revision.""" def process_reque...
Fix thumb setting on local, causing thumbs to fail.
<?php // direct access protection if(!defined('KIRBY')) die('Direct access is not allowed'); /* ----------------------------------------------------------------------------- Troubleshooting -------------------------------------------------------------------------------- */ c::set('troubleshoot', false); /* ------...
<?php // direct access protection if(!defined('KIRBY')) die('Direct access is not allowed'); /* ----------------------------------------------------------------------------- Troubleshooting -------------------------------------------------------------------------------- */ c::set('troubleshoot', false); /* ------...