text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Use class notation in config
<?php return [ /* |-------------------------------------------------------------------------- | Authorization Models |-------------------------------------------------------------------------- */ 'models' => [ /* * The class name of the permission model to be used. *...
<?php return [ /* |-------------------------------------------------------------------------- | Authorization Models |-------------------------------------------------------------------------- */ 'models' => [ /* * The class name of the permission model to be used. *...
Use canonical form of Docker folder when building TAR files In BuildImageCmdImpl#buildDockerFolderTar a canonical form of the source files referenced in the Dockerfile is used. But the Docker folder is passed in the given form to the CompressArchiveUtil. CompressArchiveUtil#relativize creates absolute TAR archive ent...
package com.github.dockerjava.core; import org.apache.commons.compress.archivers.tar.TarArchiveEntry; import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream; import org.apache.commons.io.FileUtils; import java.io.*; public class CompressArchiveUtil { public static File archiveTARFiles(File base...
package com.github.dockerjava.core; import org.apache.commons.compress.archivers.tar.TarArchiveEntry; import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream; import org.apache.commons.io.FileUtils; import java.io.*; public class CompressArchiveUtil { public static File archiveTARFiles(File base...
Refactor the timing decorator to be less confusing Also means that we don't have to ignore a flake8 error.
from functools import wraps from time import time from django_statsd.clients import statsd class UnauthorizedException(Exception): """Failure to log into the email server.""" pass class NewsletterException(Exception): """Error when trying to talk to the the email server.""" def __init__(self, msg=...
from functools import wraps from time import time from django_statsd.clients import statsd class UnauthorizedException(Exception): """Failure to log into the email server.""" pass class NewsletterException(Exception): """Error when trying to talk to the the email server.""" def __init__(self, msg=...
Move gin-config to install_requires to fix build. PiperOrigin-RevId: 258563598
"""Install Mesh TensorFlow.""" from setuptools import find_packages from setuptools import setup setup( name='mesh-tensorflow', version='0.0.5', description='Mesh TensorFlow', author='Google Inc.', author_email='no-reply@google.com', url='http://github.com/tensorflow/mesh', license='Apache...
"""Install Mesh TensorFlow.""" from setuptools import find_packages from setuptools import setup setup( name='mesh-tensorflow', version='0.0.5', description='Mesh TensorFlow', author='Google Inc.', author_email='no-reply@google.com', url='http://github.com/tensorflow/mesh', license='Apache...
Use font awesome user and search iscons
/** * @module SOCIAL */ var SOCIAL = (function (SOCIAL) { /** * @property breadcrumbs * @type {{content: string, title: string, isValid: isValid, href: string}[]} * * Data structure that defines the sub-level tabs for * our plugin, used by the navbar controller to show * or hide tab...
/** * @module SOCIAL */ var SOCIAL = (function (SOCIAL) { /** * @property breadcrumbs * @type {{content: string, title: string, isValid: isValid, href: string}[]} * * Data structure that defines the sub-level tabs for * our plugin, used by the navbar controller to show * or hide tab...
Implement method injection to fetch the query.
<?php namespace Yajra\CMS\DataTables; use Yajra\Acl\Models\Role; use Yajra\DataTables\EloquentDataTable; use Yajra\DataTables\Services\DataTable; class RolesDataTable extends DataTable { /** * @return \Yajra\DataTables\Html\Builder */ public function html() { return $this->builder() ...
<?php namespace Yajra\CMS\DataTables; use Yajra\Acl\Models\Role; use Yajra\DataTables\EloquentDataTable; use Yajra\DataTables\Services\DataTable; class RolesDataTable extends DataTable { /** * @return \Yajra\DataTables\Html\Builder */ public function html() { return $this->builder() ...
Add comment to Pillow requirement to indicate that 2.0.0 is needed for Mac users.
#/usr/bin/env python import os from setuptools import setup, find_packages ROOT_DIR = os.path.dirname(__file__) SOURCE_DIR = os.path.join(ROOT_DIR) version = '2.6.dev0' setup( name="django-photologue", version=version, description="Powerful image management for the Django web framework.", author="Jus...
#/usr/bin/env python import os from setuptools import setup, find_packages ROOT_DIR = os.path.dirname(__file__) SOURCE_DIR = os.path.join(ROOT_DIR) version = '2.6.dev0' setup( name="django-photologue", version=version, description="Powerful image management for the Django web framework.", author="Jus...
Fix assignment issue in coallatz
''' Module for running arbitrairy tests ''' import time def echo(text): ''' Return a string - used for testing the connection CLI Example: salt '*' test.echo 'foo bar baz quo qux' ''' print 'Echo got called!' return text def ping(): ''' Just used to make sure the minion is up and...
''' Module for running arbitrairy tests ''' import time def echo(text): ''' Return a string - used for testing the connection CLI Example: salt '*' test.echo 'foo bar baz quo qux' ''' print 'Echo got called!' return text def ping(): ''' Just used to make sure the minion is up and...
Remove os.scandir usage (not in python 3.4)
import uuid import os from audio_pipeline.util.AudioFileFactory import AudioFileFactory from audio_pipeline.util import Exceptions mbid_directory = "Ready To Filewalk" picard_directory = "Picard Me!" cache_limit = 30 cancel = -1 checked = 1 unchecked = 0 def has_mbid(track): """ Check whether or not the gi...
import uuid import os from audio_pipeline.util.AudioFileFactory import AudioFileFactory from audio_pipeline.util import Exceptions mbid_directory = "Ready To Filewalk" picard_directory = "Picard Me!" cache_limit = 30 cancel = -1 checked = 1 unchecked = 0 def has_mbid(track): """ Check whether or not the gi...
Remove if(this.viewHeight){} since block is empty.
class MCShowSampleComponentController { /*@ngInject*/ constructor($stateParams, samplesService, toast, $mdDialog) { this.projectId = $stateParams.project_id; this.samplesService = samplesService; this.toast = toast; this.$mdDialog = $mdDialog; this.viewHeight = this.viewH...
class MCShowSampleComponentController { /*@ngInject*/ constructor($stateParams, samplesService, toast, $mdDialog) { this.projectId = $stateParams.project_id; this.samplesService = samplesService; this.toast = toast; this.$mdDialog = $mdDialog; this.viewHeight = this.viewH...
Restructure format for videos table
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class CreateVideosTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('videos', function (Blueprint $table) { $tab...
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class CreateVideosTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('videos', function (Blueprint $table) { $tab...
Add root path to url
<?php namespace Simox; class Url extends SimoxServiceBase { private $_root_path; /** * Base uri is prepended to all resources (css, images, links..) */ private $_base_uri; public function __construct() { $this->_base_uri = "/"; $this->_root_path =...
<?php namespace Simox; class Url extends SimoxServiceBase { /** * Base uri is prepended to all resources (css, images, links..) */ private $_base_uri; public function __construct() { $this->_base_uri = "/"; } /** * Sets the base uri * * @param s...
Fix dab command failing on users with multiple words in their name Closes #22
package com.nincraft.ninbot.command; import com.nincraft.ninbot.util.MessageUtils; import lombok.val; import net.dv8tion.jda.core.entities.Message; import net.dv8tion.jda.core.events.message.MessageReceivedEvent; public class DabCommand extends AbstractCommand { public DabCommand() { length = 3; ...
package com.nincraft.ninbot.command; import com.nincraft.ninbot.util.MessageUtils; import lombok.val; import net.dv8tion.jda.core.entities.Message; import net.dv8tion.jda.core.events.message.MessageReceivedEvent; public class DabCommand extends AbstractCommand { public DabCommand() { length = 3; ...
Fix typo in RevisionUpgrade command.
<?php namespace Sofa\Revisionable\Laravel; use Illuminate\Console\Command; use Illuminate\Support\Composer; use Illuminate\Filesystem\Filesystem; class RevisionsUpgradeCommand extends Command { /** @var string */ protected $name = 'revisions:upgrade-5.3'; /** @var string */ protected $description = ...
<?php namespace Sofa\Revisionable\Laravel; use Illuminate\Console\Command; use Illuminate\Support\Composer; use Illuminate\Filesystem\Filesystem; class RevisionsUpgradeCommand extends Command { /** @var string */ protected $name = 'revisions:upgrade-5.3'; /** @var string */ protected $description = ...
Add missing dependency for backend
<?php class Kwc_Advanced_GoogleMap_Component extends Kwc_Advanced_GoogleMapView_Component { public static function getSettings() { $ret = array_merge(parent::getSettings(), array( 'componentName' => trlKwfStatic('Google Maps'), 'ownModel' => 'Kwc_Advanced_GoogleMap_Model', ...
<?php class Kwc_Advanced_GoogleMap_Component extends Kwc_Advanced_GoogleMapView_Component { public static function getSettings() { $ret = array_merge(parent::getSettings(), array( 'componentName' => trlKwfStatic('Google Maps'), 'ownModel' => 'Kwc_Advanced_GoogleMap_Model', ...
Use relative path for db REST API access
'use strict'; /* Controllers */ var recordControllers = angular.module('myApp.recordControllers', []); recordControllers.controller('recordCtrl', ['$scope', '$http', '_', function($scope, $http, _) { // Initialize $scope.distance = '25m'; $scope.style = '自由形'; $scope.submit = function() { let...
'use strict'; /* Controllers */ var recordControllers = angular.module('myApp.recordControllers', []); recordControllers.controller('recordCtrl', ['$scope', '$http', '_', function($scope, $http, _) { // Initialize $scope.distance = '25m'; $scope.style = '自由形'; $scope.submit = function() { let...
Load relationships and remove data formatting
<?php namespace App\Repositories; use App\Models\Schedule; use App\Repositories\Contracts\ScheduleRepositoryInterface; class ScheduleRepository extends Repository implements ScheduleRepositoryInterface { public function __construct(Schedule $model) { $this->model = $model; } public function ...
<?php namespace App\Repositories; use App\Models\Schedule; use App\Repositories\Contracts\ScheduleRepositoryInterface; class ScheduleRepository extends Repository implements ScheduleRepositoryInterface { public function __construct(Schedule $model) { $this->model = $model; } public function ...
Fix 500 error when no ID parameter is passed
import json from django.core.exceptions import ObjectDoesNotExist from django.http import HttpResponse, Http404 from django.views.generic.detail import BaseDetailView from .models import Marker class MarkerDetailView(BaseDetailView): """ Simple view for fetching marker details. """ # TODO: support dif...
import json from django.core.exceptions import ObjectDoesNotExist from django.http import HttpResponse, Http404, HttpResponseBadRequest from django.views.generic.detail import BaseDetailView from .models import Marker class MarkerDetailView(BaseDetailView): """ Simple view for fetching marker details. """...
Set blocked attribute when account is created
/** facebook.js * @file: /config/passport/facebook.js * @description: Handles passport authentication for Facebook strategy * @parameters: Object(config) * @exports: Facebook authentication for Passport */ var FacebookStrategy = require('passport-facebook').Strategy module.exports = function(resources) { return new...
/** facebook.js * @file: /config/passport/facebook.js * @description: Handles passport authentication for Facebook strategy * @parameters: Object(config) * @exports: Facebook authentication for Passport */ var FacebookStrategy = require('passport-facebook').Strategy module.exports = function(resources) { return new...
Update git command that will support old version of git also
<?php if (! function_exists('create_hooks_dir')) { /** * Create hook directory if not exists. * * @param string $dir * @param int $mode * @param bool $recursive * * @return void */ function create_hooks_dir($dir, $mode = 0700, $recursive = true) { if (!...
<?php if (! function_exists('create_hooks_dir')) { /** * Create hook directory if not exists. * * @param string $dir * @param int $mode * @param bool $recursive * * @return void */ function create_hooks_dir($dir, $mode = 0700, $recursive = true) { if (!...
Install mock package when not in stdlib
#!/usr/bin/env python from distutils.core import setup from clusterjob import __version__ try: # In Python >3.3, 'mock' is part of the standard library import unittest.mock mock_package = [] except ImportError: # In other versions, it has be to be installed as an exernal package mock_package = ['mo...
#!/usr/bin/env python from distutils.core import setup from clusterjob import __version__ setup(name='clusterjob', version=__version__, description='Manage traditional HPC cluster workflows in Python', author='Michael Goerz', author_email='goerz@stanford.edu', url='https://github.com/goe...
Make isStandalone() compatible with webkit1 In webkit1 implementation, we don't use 'activity' as a protocol.
define(function () { 'use strict'; var env = {}; env.getEnvironment = function (callback) { // FIXME: we assume this code runs on the same thread as the // javascript executed from sugar-toolkit-gtk3 (python) if (env.isStandalone()) { setTimeout(function () { ...
define(function () { 'use strict'; var env = {}; env.getEnvironment = function (callback) { // FIXME: we assume this code runs on the same thread as the // javascript executed from sugar-toolkit-gtk3 (python) if (env.isStandalone()) { setTimeout(function () { ...
Remove `files` key from BrowserSync config, to prevent double reload
let argv = require('yargs').argv; let bin = require('./bin'); let command = require('node-cmd'); let AfterWebpack = require('on-build-webpack'); let BrowserSync = require('browser-sync'); let BrowserSyncPlugin = require('browser-sync-webpack-plugin'); let Watch = require('webpack-watch'); let browserSyncInstance; let...
let argv = require('yargs').argv; let bin = require('./bin'); let command = require('node-cmd'); let AfterWebpack = require('on-build-webpack'); let BrowserSync = require('browser-sync'); let BrowserSyncPlugin = require('browser-sync-webpack-plugin'); let Watch = require('webpack-watch'); let browserSyncInstance; let...
Add possibility to set celeryconfig module with ENV["CELERY_CONFIG_MODULE"] + always add celery to INSTALLED_APPS
import os from celery.loaders.base import BaseLoader DEFAULT_CONFIG_MODULE = "celeryconfig" DEFAULT_SETTINGS = { "DEBUG": False, "DATABASE_ENGINE": "sqlite3", "DATABASE_NAME": "celery.sqlite", "INSTALLED_APPS": ("celery", ), } def wanted_module_item(item): is_private = item.startswith("_") r...
from celery.loaders.base import BaseLoader DEFAULT_SETTINGS = { "DEBUG": False, "DATABASE_ENGINE": "sqlite3", "DATABASE_NAME": "celery.sqlite", "INSTALLED_APPS": ("celery", ), } def wanted_module_item(item): is_private = item.startswith("_") return not is_private class Loader(BaseLoader): ...
Fix behavior on create new version - Was not redirecting to the correct state
(function() {'use strict'; angular.module('ag-admin').controller( 'ApiVersionController', function($scope, $timeout, $state, $stateParams, flash, ApiRepository) { ApiRepository.getApi($stateParams.apiName, $stateParams.version).then(function (api) { $scope.api = api; $scope.cur...
(function() {'use strict'; angular.module('ag-admin').controller( 'ApiVersionController', function($scope, $timeout, $state, $stateParams, flash, ApiRepository) { ApiRepository.getApi($stateParams.apiName, $stateParams.version).then(function (api) { $scope.api = api; $scope.cur...
Bump version number to 0.0.2
from setuptools import setup from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='flask-swagger-ui', version='0.0.2',...
from setuptools import setup from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='flask-swagger-ui', version='0.0.1a'...
Fix display tests in navbar prev $this->data[] is overwritten QuestionEdit by controller
<?php namespace Egzaminer\Question; use Egzaminer\Admin\Dashboard as Controller; class QuestionAdd extends Controller { public function addAction($testId) { $this->testId = $testId; $this->data['question'] = [ 'content' => '', 'correct' => '', ]; $this-...
<?php namespace Egzaminer\Question; use Egzaminer\Admin\Dashboard as Controller; class QuestionAdd extends Controller { public function addAction($testId) { $this->testId = $testId; $this->data = [ 'question' => [ 'content' => '', 'correct' => '', ...
Set overflow:hidden to hide default windows scrollbars on drawer
import React from 'react'; import Drawer from 'material-ui/Drawer'; import DrawerMenuItems from '../../containers/drawer-menu-items'; import * as ImagesHelper from '../../../util/images'; export default class DrawerNavigation extends React.Component { componentDidMount() { // iubenda Privacy Policy (functio...
import React from 'react'; import Drawer from 'material-ui/Drawer'; import DrawerMenuItems from '../../containers/drawer-menu-items'; import * as ImagesHelper from '../../../util/images'; export default class DrawerNavigation extends React.Component { componentDidMount() { // iubenda Privacy Policy (functio...
Fix Gulp watch for theme files Rebuild when a theme file is modified
/*! * gulpfile */ // Load plugins var gulp = require('gulp'); var stylus = require('gulp-stylus'); var rename = require('gulp-rename'); var jade = require('gulp-jade'); var inline = require('gulp-inline-css'); // Paths var sourcePath = 'src'; var paths = { emails: sourcePath + ...
/*! * gulpfile */ // Load plugins var gulp = require('gulp'); var stylus = require('gulp-stylus'); var rename = require('gulp-rename'); var jade = require('gulp-jade'); var inline = require('gulp-inline-css'); // Paths var sourcePath = 'src'; var paths = { emails: sourcePath + ...
Fix Elastica_Log param. Remove Elastica_Client here
<?php require_once dirname(__FILE__) . '/../../bootstrap.php'; class Elastica_LogTest extends Elastica_Test { public function testSetLogConfigPath() { $logPath = '/tmp/php.log'; $client = new Elastica_Client(array('log' => $logPath)); $this->assertEquals($logPath, $client->getConfig('l...
<?php require_once dirname(__FILE__) . '/../../bootstrap.php'; class Elastica_LogTest extends Elastica_Test { public function testSetLogConfigPath() { $logPath = '/tmp/php.log'; $client = new Elastica_Client(array('log' => $logPath)); $this->assertEquals($logPath, $client->getConfig('l...
Fix wrong template usage in error pages
package li.l1t.tingo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.web.ErrorAttributes; import org.springframework.boot.autoconfigure.web.ErrorController; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.sp...
package li.l1t.tingo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.web.ErrorAttributes; import org.springframework.boot.autoconfigure.web.ErrorController; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.sp...
Install yarn.lock in target project
const Generator = require('yeoman-generator') const humps = require('humps') module.exports = class ReactZeal extends Generator { prompting() { return this.prompt([ { type: 'input', name: 'name', message: 'Your project name', default: kabob(this.appname) } ]).then(...
const Generator = require('yeoman-generator') const humps = require('humps') module.exports = class ReactZeal extends Generator { prompting() { return this.prompt([ { type: 'input', name: 'name', message: 'Your project name', default: kabob(this.appname) } ]).then(...
Move logic out of the loop.
<?php namespace mcordingley\Regression\Algorithm\GradientDescent\Gradient; final class Linear implements Gradient { /** @var int */ private $power; /** * @param int $power */ public function __construct($power = 2) { $this->power = $power; } /** * @param array $coe...
<?php namespace mcordingley\Regression\Algorithm\GradientDescent\Gradient; final class Linear implements Gradient { /** @var int */ private $power; /** * @param int $power */ public function __construct($power = 2) { $this->power = $power; } /** * @param array $coe...
Add built-in interceptors via configration
JARS.internal('InternalBootstrapper', function(InternalsManager) { 'use strict'; var getInternal = InternalsManager.get, InternalBootstrapper; /** * @namespace * * @memberof JARS.internals */ InternalBootstrapper = { bootstrap: function() { var SourceMan...
JARS.internal('InternalBootstrapper', function(InternalsManager) { 'use strict'; var getInternal = InternalsManager.get, InternalBootstrapper; /** * @namespace * * @memberof JARS.internals */ InternalBootstrapper = { bootstrap: function() { var SourceMan...
Add documentation to BaseCaller and BaseOptimizer class
""" This module provides an abstract base class for implementing optimizer """ from __future__ import division, print_function, with_statement from abc import abstractmethod, ABCMeta # Abstract Base Class class BaseOptimizer(object): """ Abstract base class for objects optimizing objective functions. "...
""" Abstract optimizer defining the API of optimizer implementations. """ from __future__ import division, print_function, with_statement from abc import abstractmethod, ABCMeta # Abstract Base Class class BaseOptimizer(object): """ Abstract optimizer, a systematic way to call a function with arguments. ...
Fix SAM checker to for better coverage
"""Functions for checking files""" import os import stat import mimetypes from .checker import is_link from .config import CONFIG def is_fastq(fi): """Check whether a given file is a fastq file.""" path = fi['path'] if os.path.splitext(path)[1] == ".fastq": if not is_link(path): return...
"""Functions for checking files""" import os import stat import mimetypes from .checker import is_link from .config import CONFIG def is_fastq(fi): """Check whether a given file is a fastq file.""" path = fi['path'] if os.path.splitext(path)[1] == ".fastq": if not is_link(path): return...
Clean up formatting. Assign function name to comparePasswords
/* eslint new-cap: 0 */ const mongoose = require('mongoose'); const bcrypt = require('bcrypt-nodejs'); const Q = require('q'); const SALT_WORK_FACTOR = 10; const UserSchema = new mongoose.Schema({ username: { type: String, required: true, unique: true, }, password: { type: String, required:...
/* eslint new-cap: 0 */ const mongoose = require('mongoose'); const bcrypt = require('bcrypt-nodejs'); const Q = require('q'); const SALT_WORK_FACTOR = 10; const UserSchema = new mongoose.Schema({ username: { type: String, required: true, unique: true, }, password: { type: String, required: ...
Add date at the end
# -*- coding: utf-8 -*- import json from collections import defaultdict from datetime import datetime from unidecode import unidecode from .items import Subject from .spiders.cagr import SEMESTER # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.s...
# -*- coding: utf-8 -*- import json from collections import defaultdict from datetime import datetime from unidecode import unidecode from .items import Subject from .spiders.cagr import SEMESTER # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.s...
Use dominate to render comments as well.
from flask import current_app from dominate import tags from visitor import Visitor class BaseRenderer(Visitor): def visit_object(self, node): if current_app.debug: return tags.comment( 'no implementation in {} to render {}'.format( self.__class__.__name__,...
from flask import current_app from dominate import tags from visitor import Visitor class BaseRenderer(Visitor): def visit_object(self, node): if current_app.debug: return '<!-- no implementation in {} to render {} -->'.format( self.__class__.__name__, node.__class__.__name__,...
Fix syntax error, filter row log
var RSVP = require('rsvp'), utils = require('./lib'), GoogleSpreadsheet = require("google-spreadsheet"), config = require('./config.js'), doc = new GoogleSpreadsheet(config['google_spreadsheet_key']), process = require('process'); RSVP.hash({ currentItems: utils.getWishlistFromAmazon(config...
var RSVP = require('rsvp'), utils = require('./lib'), GoogleSpreadsheet = require("google-spreadsheet"), config = require('./config.js'), doc = new GoogleSpreadsheet(config['google_spreadsheet_key']), process = require('process'); RSVP.hash({ currentItems: utils.getWishlistFromAmazon(config...
Fix NPE when saving smart lock
package com.firebase.ui.auth.provider; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.support.annotation.LayoutRes; import com.firebase.ui.auth.R; import com.firebase.ui.auth.ResultCodes; import com.firebase.ui.auth.ui.BaseHelper; import com.firebase.ui.auth...
package com.firebase.ui.auth.provider; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.support.annotation.LayoutRes; import com.firebase.ui.auth.R; import com.firebase.ui.auth.ResultCodes; import com.firebase.ui.auth.ui.BaseHelper; import com.firebase.ui.auth...
Use more reliable time threshold for SSL reload.
<?php declare(strict_types=1); namespace App\Sync\Task; use App\Doctrine\ReloadableEntityManagerInterface; use App\Entity\Repository\SettingsRepository; use App\Radio\Adapters; use App\Radio\CertificateLocator; use Psr\Log\LoggerInterface; class ReloadFrontendAfterSslChangeTask extends AbstractTask { public fun...
<?php declare(strict_types=1); namespace App\Sync\Task; use App\Doctrine\ReloadableEntityManagerInterface; use App\Radio\Adapters; use App\Radio\CertificateLocator; use Psr\Log\LoggerInterface; class ReloadFrontendAfterSslChangeTask extends AbstractTask { public function __construct( protected Adapters ...
Save the scroll position more often
function rememberScrollPosition() { function rememberScrollPositionForElement(element) { var id = element.getAttribute('id'); var scrollTimer; element.onscroll = function (e) { clearTimeout(scrollTimer); scrollTimer = setTimeout(function () { localStor...
function rememberScrollPosition() { function rememberScrollPositionForElement(element) { var id = element.getAttribute('id'); var scrollTimer; element.onscroll = function (e) { clearTimeout(scrollTimer); scrollTimer = setTimeout(function () { localStor...
Add graphitesend dependency for graphiteservice output.
from setuptools import setup, find_packages setup( name='braubuddy', version='0.3.0', author='James Stewart', author_email='jstewart101@gmail.com', description='An extensile thermostat framework', long_description=open('README.rst').read(), license='LICENSE.txt', packages=find_packages(...
from setuptools import setup, find_packages setup( name='braubuddy', version='0.3.0', author='James Stewart', author_email='jstewart101@gmail.com', description='An extensile thermostat framework', long_description=open('README.rst').read(), license='LICENSE.txt', packages=find_packages(...
Add CommandResponse class to use instead of (out, err) tuple
# -*- coding: utf-8 -*- import subprocess class SessionExists(Exception): description = "Session already exists." pass class ServerConnectionError(Exception): description = "tmux server is not currently running." pass class SessionDoesNotExist(Exception): description = "Session does not exist...
# -*- coding: utf-8 -*- import subprocess class SessionExists(Exception): description = "Session already exists." pass class ServerConnectionError(Exception): description = "tmux server is not currently running." pass class SessionDoesNotExist(Exception): description = "Session does not exist...
Fix LoginSerializer to support custom username fields of custom user models
from django.contrib.auth import get_user_model, authenticate from rest_framework import serializers from oscarapi.utils import overridable User = get_user_model() def field_length(fieldname): field = next( field for field in User._meta.fields if field.name == fieldname) return field.max_length cl...
from django.contrib.auth import get_user_model, authenticate from rest_framework import serializers from oscarapi.utils import overridable User = get_user_model() def field_length(fieldname): field = next( field for field in User._meta.fields if field.name == fieldname) return field.max_length cl...
Allow query parameters in font source urls
// noinspection JSUnresolvedVariable module.exports = { cache: false, debug: false, module: { loaders: [ { // This is a custom property. name: 'jsx', test: /\.jsx?$/, loader: 'babel', query: { presets: ['react', 'es2015', 'stage-0'], }, e...
// noinspection JSUnresolvedVariable module.exports = { cache: false, debug: false, module: { loaders: [ { // This is a custom property. name: 'jsx', test: /\.jsx?$/, loader: 'babel', query: { presets: ['react', 'es2015', 'stage-0'], }, e...
Add placeholder for secret key
# -*- coding: utf-8 -*- """Application configuration.""" import os class Config(object): """Base configuration.""" DEBUG = False TESTING = False APP_DIR = os.path.abspath(os.path.dirname(__file__)) PROJECT_ROOT = os.path.abspath(os.path.join(APP_DIR, os.pardir)) SECRET_KEY = str(os.environ.g...
# -*- coding: utf-8 -*- """Application configuration.""" import os class Config(object): """Base configuration.""" DEBUG = False TESTING = False APP_DIR = os.path.abspath(os.path.dirname(__file__)) PROJECT_ROOT = os.path.abspath(os.path.join(APP_DIR, os.pardir)) # Local Settings """MONG...
Remove console logging from figuring out graphjs.
import Ember from 'ember'; export default Ember.Component.extend({ didInsertElement() { Chart.defaults.global.responsive = true; Chart.defaults.global.legend.display =false }, didRender() { let data = this.get('data'); let toGraph = { labels: [], ...
import Ember from 'ember'; export default Ember.Component.extend({ didInsertElement() { Chart.defaults.global.responsive = true; Chart.defaults.global.legend.display =false }, didRender() { let data = this.get('data'); let toGraph = { labels: [], ...
Fix up settings for upstream Girder change
from girder.api import access from girder.api.describe import Description, autoDescribeRoute from girder.api.rest import Resource, RestException from girder.constants import AccessType, TokenScope from girder.models.setting import Setting from .constants import Features, Deployment, Branding class Configuration(Resou...
from girder.api import access from girder.api.describe import Description, autoDescribeRoute from girder.api.rest import Resource, RestException from girder.constants import AccessType, TokenScope from girder.models.setting import Setting from .constants import Features, Deployment, Branding class Configuration(Resou...
Correct some comments in command producer
<?php /* * (c) Jérémy Marodon <marodon.jeremy@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Th3Mouk\RxTraining\Commands; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\Inp...
<?php /* * (c) Jérémy Marodon <marodon.jeremy@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Th3Mouk\RxTraining\Commands; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\Inp...
Use inspect.getdoc() instead of plain __doc__
""" Interface for all launch-control-tool commands """ import inspect from launch_control.utils.registry import RegistryBase class Command(RegistryBase): """ Base class for all command line tool sub-commands. """ def __init__(self, parser, args): """ Prepare instance for executing co...
""" Interface for all launch-control-tool commands """ from launch_control.utils.registry import RegistryBase class Command(RegistryBase): """ Base class for all command line tool sub-commands. """ def __init__(self, parser, args): """ Prepare instance for executing commands. ...
Make test case valid MiniJava.
/** * Tests some evaluation order / side effects with && and ||. * * @author Elvis Stansvik <elvstone@gmail.com> */ //EXT:BDJ //EXT:IWE class SideEffects { public static void main(String[] args) { IncredibleMachine m; m = new IncredibleMachine(); System.out.println(m.run()); // Should ...
/** * Tests some evaluation order / side effects with && and ||. * * @author Elvis Stansvik <elvstone@gmail.com> */ //EXT:BDJ class SideEffects { public static void main(String[] args) { IncredibleMachine m; m = new IncredibleMachine(); System.out.println(m.run()); // Should print 329....
Fix other SyntaxError: invalid syntax Fix Traceback (most recent call last): File "<string>", line 20, in <module> File "/tmp/pip-7dj0aup6-build/setup.py", line 19 classifiers=[ ^ SyntaxError: invalid syntax
#!/usr/bin/env python from distutils.core import setup setup( name='wagtail_embed_videos', version='0.0.5', description='Embed Videos for Wagtail CMS.', long_description=README, author='Diogo Marques', author_email='doriva.marques.29@gmail.com', maintainer='Diogo Marques', maintainer_e...
#!/usr/bin/env python from distutils.core import setup setup( name='wagtail_embed_videos', version='0.0.5', description='Embed Videos for Wagtail CMS.', long_description=README, author='Diogo Marques', author_email='doriva.marques.29@gmail.com', maintainer='Diogo Marques', maintainer_e...
Add missing attribute declaration (was made dynamically)
<?php /** * @author Pierre-Henry Soria <hello@ph7cms.com> * @copyright (c) 2017-2018, Pierre-Henry Soria. All Rights Reserved. * @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory. * @package PH7 / Framework / Service / SearchImage...
<?php /** * @author Pierre-Henry Soria <hello@ph7cms.com> * @copyright (c) 2017-2018, Pierre-Henry Soria. All Rights Reserved. * @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory. * @package PH7 / Framework / Service / SearchImage...
Allow Lady-In-Waiting to only target cards that can be duped (owned and controlled)
const DrawCard = require('../../../drawcard.js'); class LadyInWaiting extends DrawCard { setupCardAbilities() { this.playAction({ title: 'Marshal as dupe', condition: () => this.canMarshalAsDupe(), handler: () => { this.game.promptForSelect(this.controlle...
const DrawCard = require('../../../drawcard.js'); class LadyInWaiting extends DrawCard { setupCardAbilities() { this.playAction({ title: 'Marshal as dupe', condition: () => this.canMarshalAsDupe(), handler: () => { this.game.promptForSelect(this.controlle...
Remove old dependency to kit from euth frontend
"""Adhocracy frontend customization package.""" import os import version from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() CHANGES = open(os.path.join(here, 'CHANGES.rst')).read() requires = ['adhocracy_frontend', ...
"""Adhocracy frontend customization package.""" import os import version from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() CHANGES = open(os.path.join(here, 'CHANGES.rst')).read() requires = ['adhocracy_frontend', ...
Use six instead of sys.version_info
import six from .log import log_input, log_output def open(*args, **kwargs): """Built-in open replacement that logs input and output Workaround for issue #44. Patching `__builtins__['open']` is complicated, because many libraries use standard open internally, while we only want to log inputs and out...
import sys from .log import log_input, log_output def open(*args, **kwargs): """Built-in open replacement that logs input and output Workaround for issue #44. Patching `__builtins__['open']` is complicated, because many libraries use standard open internally, while we only want to log inputs and out...
Remove cwd from file name.
const fs = require('fs'); const parseInput = (input, config) => new Promise((resolve, reject) => { let parser = () => null; if (!config.parser) { parser = require('doxdox-parser-dox'); } fs.stat(input, (err, stats) => { if (err) { return reject(err); } ...
const fs = require('fs'); const parseInput = (input, config) => new Promise((resolve, reject) => { let parser = () => null; if (!config.parser) { parser = require('doxdox-parser-dox'); } fs.stat(input, (err, stats) => { if (err) { return reject(err); } ...
Fix edit user route param Signed-off-by: Christoph Wurst <7abde52c298496fa169fb750f91f213a282142af@winzerhof-wurst.at>
@extends('settings/settings') @section('settings_content') <h1>Benutzer</h1> @if (Auth::user()->isAdmin()) <a class="btn btn-default" type="button" href="{!! route('settings.users/create') !!}"> <span class="glyphicon glyphicon-plus"></span> Benutzer hinzuf&uuml;gen </a> @endif <div class="table-responsiv...
@extends('settings/settings') @section('settings_content') <h1>Benutzer</h1> @if (Auth::user()->isAdmin()) <a class="btn btn-default" type="button" href="{!! route('settings.users/create') !!}"> <span class="glyphicon glyphicon-plus"></span> Benutzer hinzuf&uuml;gen </a> @endif <div class="table-responsiv...
Add cancel button to earnings' edit view
@extends('layout') @section('body') <div class="wrapper my-3"> <h2>{{ __('actions.edit') }} {{ __('general.earning') }}</h2> <div class="box mt-3"> <form method="POST" action="/earnings/{{ $earning->id }}" autocomplete="off"> {{ method_field('PATCH') }} {...
@extends('layout') @section('body') <div class="wrapper my-3"> <h2>{{ __('actions.edit') }} {{ __('general.earning') }}</h2> <div class="box mt-3"> <form method="POST" action="/earnings/{{ $earning->id }}" autocomplete="off"> {{ method_field('PATCH') }} {...
Add a link to the import-subscribers page in the sidebar
import React from 'react'; import SideLink from '../common/SideLink'; import { Link } from 'react-router'; const Sidebar = (props) => { // eslint-disable-line no-unused-vars return ( <aside className="main-sidebar"> <section className="sidebar"> <div className="user-panel"> ...
import React from 'react'; import SideLink from '../common/SideLink'; import { Link } from 'react-router'; const Sidebar = (props) => { // eslint-disable-line no-unused-vars return ( <aside className="main-sidebar"> <section className="sidebar"> <div className="user-panel"> ...
Remove "recursive symlink detected" UserWarning
import os from pathlib import Path from typing import Iterable, Iterator, List, Set from isort.settings import Config def find( paths: Iterable[str], config: Config, skipped: List[str], broken: List[str] ) -> Iterator[str]: """Fines and provides an iterator for all Python source files defined in paths.""" ...
import os from pathlib import Path from typing import Iterable, Iterator, List, Set from warnings import warn from isort.settings import Config def find( paths: Iterable[str], config: Config, skipped: List[str], broken: List[str] ) -> Iterator[str]: """Fines and provides an iterator for all Python source fil...
Fix metric expression test name.
from datetime import datetime import json import unittest from pypercube.cube import Cube from pypercube.cube import Query from pypercube.metric import Metric from pypercube.expression import EventExpression from pypercube.expression import Sum from tests import MockResponse from tests import mock_get class TestMet...
from datetime import datetime import json import unittest from pypercube.cube import Cube from pypercube.cube import Query from pypercube.metric import Metric from pypercube.expression import EventExpression from pypercube.expression import Sum from tests import MockResponse from tests import mock_get class TestEve...
Migrate from deprecated imp to importlib
""" automatically maintains the latest git tag + revision info in a python file """ import importlib import os import subprocess def get_project_version(version_file): version_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), version_file) try: module = importlib.load_module(version_f...
""" automatically maintains the latest git tag + revision info in a python file """ import imp import os import subprocess def get_project_version(version_file): version_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), version_file) try: module = imp.load_source("verfile", version_fi...
Change logging default true => false; accept nulls for logging and obfuscate_client_ip
<?php namespace OwsProxy3\CoreBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * @author Christian Wygoda */ class Configuration implements ConfigurationInterface { /** * {@inheritDoc} */ ...
<?php namespace OwsProxy3\CoreBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * @author Christian Wygoda */ class Configuration implements ConfigurationInterface { /** * {@inheritDoc} */ ...
Fix e.keypress being called when it does not exist
function add_quicksearch(input, result_div, url) { input.closest('form').submit(function() { result_div.load(url, {quicksearch: input.val()}); return false; }); } function add_tablesorter(table) { var table = $(table); var headers = {}; headers[table.find('th').length - 1] = { sorte...
function add_quicksearch(input, result_div, url) { input.closest('form').submit(function() { result_div.load(url, {quicksearch: input.val()}); return false; }); } function add_tablesorter(table) { var table = $(table); var headers = {}; headers[table.find('th').length - 1] = { sorte...
Correct link in backend not logged
<td class="header_menu"> <div class="menu_top"> <table> <tr> <td rowspan="2" style="height:90px">&nbsp;</td> </tr> <tr> <td> <ul class="menu_link"> <li><?php echo link_to(__('Our collections'),$sf_context->getConfiguration()->generatePublicUrl('homepage'));?...
<td class="header_menu"> <div class="menu_top"> <table> <tr> <td rowspan="2" style="height:90px">&nbsp;</td> </tr> <tr> <td> <ul class="menu_link"> <li><?php echo link_to(__('Our collections'),$sf_context->getConfiguration()->generatePublicUrl('homepage'));?...
Add classifiers of Python 3.6 3.7
from setuptools import setup import urlfetch import re import os import sys setup( name="urlfetch", version=urlfetch.__version__, author=re.sub(r'\s+<.*', r'', urlfetch.__author__), author_email=re.sub(r'(^.*<)|(>.*$)', r'', urlfetch.__author__), url=urlfetch.__url__, description="An easy to us...
from setuptools import setup import urlfetch import re import os import sys setup( name="urlfetch", version=urlfetch.__version__, author=re.sub(r'\s+<.*', r'', urlfetch.__author__), author_email=re.sub(r'(^.*<)|(>.*$)', r'', urlfetch.__author__), url=urlfetch.__url__, description="An easy to us...
Cut the message buffer down before forwarding
package blue.mesh; import android.util.Log; public class ReadWriteThread extends Thread { private final RouterObject router; private final Connection connection; private static final String TAG = "ReadWriteThread"; protected ReadWriteThread(RouterObject a_router, Connection a_connection){ ...
package blue.mesh; import android.util.Log; public class ReadWriteThread extends Thread { private final RouterObject router; private final Connection connection; private static final String TAG = "ReadWriteThread"; protected ReadWriteThread(RouterObject a_router, Connection a_connection){ ...
Add some commented-out code to hide the text label of rich text elements
/* global django, CKEDITOR */ (function($) { // Activate and deactivate the CKEDITOR because it does not like // getting dragged or its underlying ID changed. // The 'data-processed' attribute is set for compatibility with // django-ckeditor. $(document).on( 'content-editor:activate', ...
/* global django, CKEDITOR */ (function($) { // Activate and deactivate the CKEDITOR because it does not like // getting dragged or its underlying ID changed. // The 'data-processed' attribute is set for compatibility with // django-ckeditor. $(document).on( 'content-editor:activate', ...
Make cache headers sentitive to urls
(function (angular) { "use strict"; angular.module("mfl.gis.interceptor", []) .factory("mfl.gis.interceptor.headers", [function () { var cache_headers = {}; var request_fxn = function(config) { var headers = cache_headers[config.url]; if (_.isUndefined(headers)) { ...
(function (angular) { "use strict"; angular.module("mfl.gis.interceptor", []) .factory("mfl.gis.interceptor.headers", [function () { var etag_header = null; var last_modified_header = null; return { "request" : function(config) { if (etag_header) { ...
Fix width and height properties in url() method
<?php namespace Uploadify\Casts; use Uploadify\Casts\Cast as BaseCast; class ImageCast extends BaseCast { /** * Get full url to file * * @param int|array $width * @param int $height * @param array $options * @return string */ public function url($width...
<?php namespace Uploadify\Casts; use Uploadify\Casts\Cast as BaseCast; class ImageCast extends BaseCast { /** * Get full url to file * * @param int|array $width * @param int $height * @param array $options * @return string */ public function url($width...
Remove a ton of metaclass complexity If I'd read the jinja2 documentation, I'd have seen that dotted notation is equivalent to subscript notation, which means metaclasses and generated classes aren't necessary. At all. Note-to-self for the future: RTFM.
import argparse import jinja2 import os import yaml from debug.debug import dprint def load_templates(template_dir=os.path.join(os.getcwd(), 'template')): loader = jinja2.FileSystemLoader(template_dir) environment = jinja2.environment.Environment(loader=loader) return environment if __name__ == "__main__...
import argparse import jinja2 import os import types import yaml from debug.debug import dprint def load_templates(template_dir=os.path.join(os.getcwd(), 'template')): loader = jinja2.FileSystemLoader(template_dir) environment = jinja2.environment.Environment(loader=loader) return environment if __name__...
Revert "Enabled a custom mapping" This reverts commit ca094beb7e2effd0b38faeba1dd95b2437ffb443.
<?php namespace Xidea\Bundle\BaseBundle; use Symfony\Component\HttpKernel\Bundle\Bundle, Symfony\Component\DependencyInjection\ContainerBuilder; use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass; abstract class AbstractBundle extends Bundle { public function build(C...
<?php namespace Xidea\Bundle\BaseBundle; use Symfony\Component\HttpKernel\Bundle\Bundle, Symfony\Component\DependencyInjection\ContainerBuilder; use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass; abstract class AbstractBundle extends Bundle { public function build(C...
Make sure to support new linter
// @flow import pushUniqueVariable from '../helpers/pushUniqueVariable' type Context = { [number]: Array<VariableName>, } function getVariablesInContext(context: Context, column: number) { return Object.keys(context) .filter(key => Number(key) <= column) // $FlowFixMe .map(key => context[key]) .r...
// @flow import pushUniqueVariable from '../helpers/pushUniqueVariable' type Context = { [number]: Array<VariableName>, } function getVariablesInContext(context: Context, column: number) { return Object.keys(context) .filter(key => Number(key) <= column) // $FlowFixMe .map(key => context[key]) .r...
Use print_verbose for conditional printing.
# ome - Object Message Expressions # Copyright (c) 2015-2016 Luke McCarthy <luke@iogopro.co.uk>. All rights reserved. import sys from .command import command_args from .error import OmeError from .terminal import stderr def print_verbose(*args, **kwargs): if command_args.verbose: print(*args, **kwargs) d...
# ome - Object Message Expressions # Copyright (c) 2015-2016 Luke McCarthy <luke@iogopro.co.uk>. All rights reserved. import sys from .command import command_args from .error import OmeError from .terminal import stderr def main(): stderr.reset() try: from . import compiler target = compiler.g...
Add individual curated set lookup
"use strict"; var querystring = require("querystring"); var SdkException = require("./sdkexception.js"); var WebHelper = require("./webhelper.js"); var GettyApiRequest = require("./baseclasses/gettyApiRequest.js"); const _ids = new WeakMap(); const _fields = new WeakMap(); class Events extends GettyApiRequest { ...
"use strict"; var querystring = require("querystring"); var SdkException = require("./sdkexception.js"); var WebHelper = require("./webhelper.js"); var GettyApiRequest = require("./baseclasses/gettyApiRequest.js"); const _ids = new WeakMap(); const _fields = new WeakMap(); class Events extends GettyApiRequest { ...
Use "style" property in package.json This seems to be a prevailing standard already (http://stackoverflow.com/questions/32037150/style-field-in-package-json) so use that instead of https://xkcd.com/927/
var findup = require('findup'), path = require('path'); var local = require('./local'); function find(dir, file, callback) { var name = file.split('/')[0], modulePath = './node_modules/' + name + '/package.json'; findup(dir, modulePath, function (err, moduleDir) { if (err) { return callba...
var findup = require('findup'), path = require('path'); var local = require('./local'); function find(dir, file, callback) { var name = file.split('/')[0], modulePath = './node_modules/' + name + '/package.json'; findup(dir, modulePath, function (err, moduleDir) { if (err) { return callba...
Call go test for src/ only
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), // the package file to use qunit: { // internal task or name of a plugin (like "qunit") all: ['js/tests/*.html'] }, watch: { files: [ 'js/tests/*.j...
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), // the package file to use qunit: { // internal task or name of a plugin (like "qunit") all: ['js/tests/*.html'] }, watch: { files: [ 'js/tests/*.j...
Use appropriate order of classes
# -*- coding: utf-8 -*- from adminsortable.admin import SortableAdmin from cms.admin.placeholderadmin import PlaceholderAdmin from django.contrib import admin from distutils.version import LooseVersion from hvad.admin import TranslatableAdmin import cms from . import models from aldryn_faq.forms import CategoryForm ...
# -*- coding: utf-8 -*- from adminsortable.admin import SortableAdmin from cms.admin.placeholderadmin import PlaceholderAdmin from django.contrib import admin from distutils.version import LooseVersion from hvad.admin import TranslatableAdmin import cms from . import models from aldryn_faq.forms import CategoryForm ...
Document that python 3.10 is supported and update version number.
from setuptools import setup # type: ignore[import] with open("README.md", "r") as fh: long_description = fh.read() setup( name="objname", version="0.12.0", packages=["objname"], package_data={ "objname": ["__init__.py", "py.typed", "_module.py", "test_objname.py"], ...
from setuptools import setup # type: ignore[import] with open("README.md", "r") as fh: long_description = fh.read() setup( name="objname", version="0.11.0", packages=["objname"], package_data={ "objname": ["__init__.py", "py.typed", "_module.py", "test_objname.py"], ...
Fix pytest path to root of package Instead of the package init file.
from ._version import get_versions __version__ = get_versions()['version'] del get_versions __all__ = ['__version__'] # We first need to detect if we're being called as part of the skmisc # setup procedure itself in a reliable manner. try: __SKMISC_SETUP__ except NameError: __SKMISC_SETUP__ = False if __SKM...
from ._version import get_versions __version__ = get_versions()['version'] del get_versions __all__ = ['__version__'] # We first need to detect if we're being called as part of the skmisc # setup procedure itself in a reliable manner. try: __SKMISC_SETUP__ except NameError: __SKMISC_SETUP__ = False if __SKM...
Add select2 to long filters as well
$(function() { $('select').each(function() { var $select = $(this) if ($select.find('option').length < 7) return; if ($select.is('[multiple]')) { $select.siblings('.help-inline').addClass('hide') } $select.select2({ width: $select.width() })...
$(function() { $('.change-form select').each(function() { var $select = $(this) if ($select.is('[multiple]')) { $select.siblings('.help-inline').addClass('hide') } $select.select2({ width: $select.width() }) }) }) function dismissAddAnotherPopup...
Add user's names to review
import React, { Component } from 'react'; class Review extends Component { constructor(props) { super(props); this.renderReviews = this.renderReviews.bind(this); } renderReviews() { const { reviews } = this.props; if (!reviews.length) { return ( <div className = "row center"...
import React, { Component } from 'react'; class Review extends Component { constructor(props) { super(props); this.renderReviews = this.renderReviews.bind(this); } renderReviews() { const { reviews } = this.props; if (!reviews.length) { return ( <div className = "row center"...
Fix create action for key value pair
from st2actions.runners.pythonrunner import Action from st2client.client import Client from st2client.models.datastore import KeyValuePair class KVPAction(Action): def run(self, key, action, st2host='localhost', value=""): st2_endpoints = { 'action': "http://%s:9101" % st2host, 'r...
from st2actions.runners.pythonrunner import Action from st2client.client import Client from st2client.models.datastore import KeyValuePair class KVPAction(Action): def run(self, key, action, st2host='localhost', value=""): st2_endpoints = { 'action': "http://%s:9101" % st2host, 'r...
Fix bug in ParticleSorter initialization
from hoomd.operation import _Tuner from hoomd.parameterdicts import ParameterDict from hoomd.typeconverter import OnlyType from hoomd.trigger import Trigger from hoomd import _hoomd from math import log2, ceil def to_power_of_two(value): return int(2. ** ceil(log2(value))) def natural_number(value): try: ...
from hoomd.operation import _Tuner from hoomd.parameterdicts import ParameterDict from hoomd.typeconverter import OnlyType from hoomd.trigger import Trigger from hoomd import _hoomd from math import log2, ceil def to_power_of_two(value): return int(2. ** ceil(log2(value))) def natural_number(value): try: ...
Test that nodes contain the methods we use
chrome.extension.sendMessage({}, function(response) { var readyStateCheckInterval = setInterval(function() { if (document.readyState === "complete") { clearInterval(readyStateCheckInterval); var observer = new MutationObserver(function (mutations) { mutations.forEach(handleMutationEvents); ...
chrome.extension.sendMessage({}, function(response) { var readyStateCheckInterval = setInterval(function() { if (document.readyState === "complete") { clearInterval(readyStateCheckInterval); var observer = new MutationObserver(function (mutations) { mutations.forEach(handleMutationEvents); ...
Adhocracy-service: Change API to get single external static page
import requests from pylons import config class RESTAPI(object): """Helper to work with the adhocarcy_service rest api (adhocracy_kotti.mediacenter, adhocracy_kotti.staticpages, plone). """ session = requests.Session() def __init__(self): self.api_token = config.get('adhocracy_servic...
import requests from pylons import config class RESTAPI(object): """Helper to work with the adhocarcy_service rest api (adhocracy_kotti.mediacenter, adhocracy_kotti.staticpages, plone). """ session = requests.Session() def __init__(self): self.api_token = config.get('adhocracy_servic...
Fix inability to edit or delete external links Former-commit-id: 6e002af2f8605aaf35a0f8b2121c22a05716c082
<?php namespace Concrete\Controller\Backend\UserInterface; use Exception; use Page as ConcretePage; use Permissions; abstract class Page extends \Concrete\Controller\Backend\UserInterface { /** @var ConcretePage A page object */ protected $page; public function __construct() { parent::__cons...
<?php namespace Concrete\Controller\Backend\UserInterface; use Exception; use Page as ConcretePage; use Permissions; abstract class Page extends \Concrete\Controller\Backend\UserInterface { /** @var ConcretePage A page object */ protected $page; public function __construct() { parent::__cons...
Add model transformer for json field
<?php namespace Furniture\ProductBundle\Form\Type\PdpIntellectual; use Furniture\CommonBundle\Form\DataTransformer\ObjectToStringTransformer; use Furniture\ProductBundle\Entity\PdpIntellectualRoot; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\CallbackTransformer; use Symfony\Component\Form\Form...
<?php namespace Furniture\ProductBundle\Form\Type\PdpIntellectual; use Furniture\CommonBundle\Form\DataTransformer\ObjectToStringTransformer; use Furniture\ProductBundle\Entity\PdpIntellectualRoot; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsR...
Add method to construct Capsule set from Iterable.
package mb.nabl2.util; import java.util.Map.Entry; import org.metaborg.util.functions.Function2; import io.usethesource.capsule.Map; import io.usethesource.capsule.Set; public final class CapsuleUtil { private CapsuleUtil() { } public static <K, V> void replace(Map.Transient<K, V> map, Function2<K, V,...
package mb.nabl2.util; import java.util.Map.Entry; import org.metaborg.util.functions.Function2; import io.usethesource.capsule.Map; public final class CapsuleUtil { private CapsuleUtil() { } public static <K, V> void replace(Map.Transient<K, V> map, Function2<K, V, V> mapper) { for(Entry<K, V...
Use io.open to support Python 2
import io from setuptools import setup, find_packages # pylint: disable=no-name-in-module,import-error def dependencies(file): with open(file) as f: return f.read().splitlines() with io.open("README.md", encoding='utf-8') as infile: long_description = infile.read() setup( name='halo', pack...
from setuptools import setup, find_packages # pylint: disable=no-name-in-module,import-error def dependencies(file): with open(file) as f: return f.read().splitlines() with open("README.md", encoding='utf-8') as infile: long_description = infile.read() setup( name='halo', packages=find_pac...
Deploy a single listener for UDP as port reuse is not supported.
package com.codingchili.router; import com.codingchili.router.configuration.ListenerSettings; import com.codingchili.router.configuration.RouterContext; import com.codingchili.router.controller.RouterHandler; import com.codingchili.router.controller.transport.*; import io.vertx.core.*; import com.codingchili.core.pro...
package com.codingchili.router; import com.codingchili.router.configuration.ListenerSettings; import com.codingchili.router.configuration.RouterContext; import com.codingchili.router.controller.RouterHandler; import com.codingchili.router.controller.transport.*; import io.vertx.core.*; import com.codingchili.core.pro...
Revert "E arruma o alinhamento do texto" This reverts commit a7cb58ef323df97de537bb7cf0571c5ed26e113c.
import os import datetime import time import picamera from PIL import Image, ImageStat, ImageFont, ImageDraw with picamera.PiCamera() as camera: camera.resolution = (1024, 768) camera.rotation = 180 time.sleep(2) # camera warm-up time for filename in camera.capture_continuous('images/img_{timesta...
import os import datetime import time import picamera from PIL import Image, ImageStat, ImageFont, ImageDraw with picamera.PiCamera() as camera: camera.resolution = (1024, 768) camera.rotation = 180 time.sleep(2) # camera warm-up time for filename in camera.capture_continuous('images/img_{timesta...
Fix deadlock in remote debugger (PY-18546)
import sys def __getfilesystemencoding(): ''' Note: there's a copy of this method in interpreterInfo.py ''' try: ret = sys.getfilesystemencoding() if not ret: raise RuntimeError('Unable to get encoding.') return ret except: try: #Handle Jytho...
def __getfilesystemencoding(): ''' Note: there's a copy of this method in interpreterInfo.py ''' import sys try: ret = sys.getfilesystemencoding() if not ret: raise RuntimeError('Unable to get encoding.') return ret except: try: #Handle Jyt...
Add constituent lookup tab, shorten tab labels
import React from 'react'; import Relay from 'react-relay'; import {Styles} from 'material-ui'; import MuiThemeProvider from 'material-ui/lib/MuiThemeProvider'; import TopNav from './TopNav'; import {BernieTheme} from './styles/bernie-theme'; import {BernieColors} from './styles/bernie-css'; class AdminDashboard exten...
import React from 'react'; import Relay from 'react-relay'; import {Styles} from 'material-ui'; import MuiThemeProvider from 'material-ui/lib/MuiThemeProvider'; import TopNav from './TopNav'; import {BernieTheme} from './styles/bernie-theme'; import {BernieColors} from './styles/bernie-css'; class AdminDashboard exten...
Make initial scene fadein slower.
define(function(require){ var TimeLine = require("timeline"); var renderer = new THREE.WebGLRenderer( {antialias: true, alpha:true} ); renderer.shadowMapEnabled = true; var scene; var timeSource; return { init:function(){ renderer.autoClear = false; ...
define(function(require){ var TimeLine = require("timeline"); var renderer = new THREE.WebGLRenderer( {antialias: true, alpha:true} ); renderer.shadowMapEnabled = true; var scene; var timeSource; return { init:function(){ renderer.autoClear = false; ...
Use dev env while building for production This yields better errors.
'use strict'; var fs = require('fs'); var path = require('path'); var merge = require('webpack-merge'); var webpack = require('webpack'); module.exports = function(config) { return new Promise(function(resolve, reject) { var cwd = process.cwd(); var parent = path.join(__dirname, '..'); var siteConfig = ...
'use strict'; var fs = require('fs'); var path = require('path'); var merge = require('webpack-merge'); var webpack = require('webpack'); module.exports = function(config) { return new Promise(function(resolve, reject) { var cwd = process.cwd(); var parent = path.join(__dirname, '..'); var siteConfig = ...
Increase service worker cache version
'use strict'; var CACHE_NAME = 'offline-issues-cache-v2'; var urlsToCache = [ './', 'css/bootstrap.css', 'css/app.css', 'js/lodash.js', 'js/jquery-2.2.4.js', 'js/bootstrap.js', 'js/github.bundle.min.js', 'js/pouchdb-5.4.5.js', 'js/pouchdb.all-dbs.js', 'js/moment.min.js', 'js/markdown.js', 'js/...
'use strict'; var CACHE_NAME = 'offline-issues-cache-v1'; var urlsToCache = [ './', 'css/bootstrap.css', 'css/app.css', 'js/lodash.js', 'js/jquery-2.2.4.js', 'js/bootstrap.js', 'js/github.bundle.min.js', 'js/pouchdb-5.4.5.js', 'js/pouchdb.all-dbs.js', 'js/moment.min.js', 'js/markdown.js', 'js/...