text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Remove unused fopenmp compile args | #!/usr/bin/env python
import os
from skimage._build import cython
base_path = os.path.abspath(os.path.dirname(__file__))
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
config = Configuration('transform', parent_package, top_... | #!/usr/bin/env python
import os
from skimage._build import cython
base_path = os.path.abspath(os.path.dirname(__file__))
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
config = Configuration('transform', parent_package, top_... |
Comment the new library requirement | """Mailmerge build and install configuration."""
import os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme_file:
README = readme_file.read()
setup(
name="mailmerge",
description="A sim... | """Mailmerge build and install configuration."""
import os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme_file:
README = readme_file.read()
setup(
name="mailmerge",
description="A sim... |
Increase the count so we don't spin forever | import urlparse
import requests
def purge_fastly_tags(domain, api_key, service_id, tags, max_tries=25):
session = requests.session()
headers = {"X-Fastly-Key": api_key, "Accept": "application/json"}
all_tags = set(tags)
purges = {}
count = 0
while all_tags and not count > max_tries:
... | import urlparse
import requests
def purge_fastly_tags(domain, api_key, service_id, tags, max_tries=25):
session = requests.session()
headers = {"X-Fastly-Key": api_key, "Accept": "application/json"}
all_tags = set(tags)
purges = {}
count = 0
while all_tags and not count > max_tries:
... |
Fix missing import, add alias/deactivate method | import json
import random
import string
from flask import Flask, request, jsonify, render_template
from flask.ext.pymongo import PyMongo
from pymongo.errors import DuplicateKeyError
app = Flask(__name__)
app.config['MONGO_DBNAME'] = 'kasm'
mongo = PyMongo(app)
@app.route('/')
def hello_world():
return render_temp... | import json
import random
import string
from flask import Flask, request, jsonify, render_template
from flask.ext.pymongo import PyMongo
from pymongo.errors import DuplicateKeyError
app = Flask(__name__)
app.config['MONGO_DBNAME'] = 'kasm'
mongo = PyMongo(app)
@app.route('/')
def hello_world():
return render_temp... |
Add button to the template | 'use strict';
const request = require('request-promise');
const config = require('../../config');
const scraper = require('./scraper');
module.exports = {
getFirstMessagingEntry: (body) => {
const val = body.object == 'page' &&
body.entry &&
Array.isArray(body.entry) &&
body.entry.length > 0 ... | 'use strict';
const request = require('request-promise');
const config = require('../../config');
const scraper = require('./scraper');
module.exports = {
getFirstMessagingEntry: (body) => {
const val = body.object == 'page' &&
body.entry &&
Array.isArray(body.entry) &&
body.entry.length > 0 ... |
Set pano popje when straatbeeld exsts | (function () {
'use strict';
angular
.module('atlas')
.controller('MapController', MapController);
MapController.$inject = ['store', 'crsConverter'];
function MapController (store, crsConverter) {
var vm = this;
store.subscribe(update);
update();
fun... | (function () {
'use strict';
angular
.module('atlas')
.controller('MapController', MapController);
MapController.$inject = ['store', 'crsConverter'];
function MapController (store, crsConverter) {
var vm = this;
store.subscribe(update);
update();
fun... |
Change comp and swap count from int to long | package org.algorithmprac.sort;
import com.google.common.base.Stopwatch;
import java.util.concurrent.TimeUnit;
public abstract class AbstractCostAwareSorter extends AbstractSorter implements CostAwareSorter {
private final Stopwatch stopwatch = Stopwatch.createUnstarted();
private long cmpCount = 0;
p... | package org.algorithmprac.sort;
import com.google.common.base.Stopwatch;
import java.util.concurrent.TimeUnit;
public abstract class AbstractCostAwareSorter extends AbstractSorter implements CostAwareSorter {
private final Stopwatch stopwatch = Stopwatch.createUnstarted();
private int cmpCount = 0;
pr... |
Update comment and optional instructions | import sys
from starlette.requests import Request
from starlette.types import Receive, Scope, Send
import rollbar
from .requests import store_current_request
from rollbar.contrib.asgi import ReporterMiddleware as ASGIReporterMiddleware
from rollbar.lib._async import RollbarAsyncError, try_report
class ReporterMiddl... | import sys
from starlette.requests import Request
from starlette.types import Receive, Scope, Send
import rollbar
from .requests import store_current_request
from rollbar.contrib.asgi import ReporterMiddleware as ASGIReporterMiddleware
from rollbar.lib._async import RollbarAsyncError, try_report
class ReporterMiddl... |
Update author and maintainer information | # -*- coding: utf-8 -*-
import os
from setuptools import setup
import redis_shard
def read_file(*path):
base_dir = os.path.dirname(__file__)
file_path = (base_dir, ) + tuple(path)
return open(os.path.join(*file_path)).read()
setup(
name="redis-shard",
url="https://pypi.python.org/pypi/redis-sha... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
import redis_shard
def read_file(*path):
base_dir = os.path.dirname(__file__)
file_path = (base_dir, ) + tuple(path)
return open(os.path.join(*file_path)).read()
setup(
name="redis-shard",
url="https://pypi.python.org/pypi/redis-sha... |
Fix to allow overriding subject formatting | import logging
from subprocess import Popen, PIPE
class EximHandler(logging.Handler):
"""
A handler class which sends an email using exim for each logging event.
"""
def __init__(self, toaddr, subject, exim_path="/usr/sbin/exim"):
"""
Initialize the handler.
"""
logging... | import logging
from subprocess import Popen, PIPE
class EximHandler(logging.Handler):
"""
A handler class which sends an email using exim for each logging event.
"""
def __init__(self, toaddr, subject, exim_path="/usr/sbin/exim"):
"""
Initialize the handler.
"""
logging... |
refactor(rasterize-list): Update test to improve speed by only writing and unlinking files once | 'use strict';
const expect = require('../../helpers/expect');
const fs = require('fs');
const sizeOf = require('image-size');
const RasterizeList = require('../../../src/utils/rasterize-list');
describe('RasterizeList', function() {
// Hitting the file system is slow
this.timeout(0);
... | 'use strict';
const expect = require('../../helpers/expect');
const fs = require('fs');
const sizeOf = require('image-size');
const RasterizeList = require('../../../src/utils/rasterize-list');
describe('RasterizeList', function() {
// Hitting the file system is slow
this.timeout(0);
... |
Fix line endings in CSV and stdout typo | #!/usr/bin/env python
"""Calculate QuadKey for TSV file and append it as column
Usage:
calculate_quad_key.py <list_file>
calculate_quad_key.py (-h | --help)
calculate_quad_key.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
import sys
impor... | #!/usr/bin/env python
"""Calculate QuadKey for TSV file and append it as column
Usage:
calculate_quad_key.py <list_file>
calculate_quad_key.py (-h | --help)
calculate_quad_key.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
import system
im... |
Fix the relative path to vendor resources | <?php
namespace InfyOm\RoutesExplorer;
use Illuminate\Support\ServiceProvider;
class RoutesExplorerServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
$configPath = __DIR__ . '/../config/routes_explor... | <?php
namespace InfyOm\RoutesExplorer;
use Illuminate\Support\ServiceProvider;
class RoutesExplorerServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
$configPath = __DIR__ . './../config/routes_explo... |
Update description of the blog sidebar snippet. | from django.core.management.base import BaseCommand
from us_ignite.snippets.models import Snippet
FIXTURES = [
{
'slug': 'home-box',
'name': 'UP NEXT: LOREM IPSUM',
'body': '',
'url_text': 'GET INVOLVED',
'url': '',
},
{
'slug': 'featured',
'name': ... | from django.core.management.base import BaseCommand
from us_ignite.snippets.models import Snippet
FIXTURES = [
{
'slug': 'home-box',
'name': 'UP NEXT: LOREM IPSUM',
'body': '',
'url_text': 'GET INVOLVED',
'url': '',
},
{
'slug': 'featured',
'name': ... |
Replace forEach with while for wider reach | (function () {
function descend(path, o) {
var step = path.shift();
if (typeof(o[step]) === "undefined") {
throw new Error("Broken descend path");
}
while (path.length > 0) {
if (typeof(o[step]) !== "object") {
throw new Error("Invalid descend path");
}
ret... | (function () {
function descend(path, o) {
var step = path.shift();
if (typeof(o[step]) === "undefined") {
throw new Error("Broken descend path");
}
while (path.length > 0) {
if (typeof(o[step]) !== "object") {
throw new Error("Invalid descend path");
}
ret... |
Add pseudo bar chart using D3 scales with JSX | import React from "react";
import ReactDOM from "react-dom";
import tabify from "../../utils/tabify";
import * as d3 from "d3";
import "./BarGraph.css";
export default class BarGraph extends React.Component {
constructor(){
super();
this.xScale = d3.scaleBand();
this.yScale = d3.scaleLinea... | import React from "react";
import ReactDOM from "react-dom";
import tabify from "../../utils/tabify";
import * as d3 from "d3";
import "./BarGraph.css";
export default class BarGraph extends React.Component {
render() {
const { response, configuration, onBarClick } = this.props;
const { width, he... |
Remove support for deprecated Python versions. | #!/usr/bin/env python
import io
from setuptools import find_packages, setup, Extension
with io.open('README.rst', encoding='utf8') as readme:
long_description = readme.read()
setup(
name="pyspamsum",
version="1.0.5",
description="A Python wrapper for Andrew Tridgell's spamsum algorithm",
long_d... | #!/usr/bin/env python
import io
from setuptools import find_packages, setup, Extension
with io.open('README.rst', encoding='utf8') as readme:
long_description = readme.read()
setup(
name="pyspamsum",
version="1.0.5",
description="A Python wrapper for Andrew Tridgell's spamsum algorithm",
long_d... |
Use “helpers” as independent module for “tests.runtests” environment | # vim: fileencoding=utf-8 et sw=4 ts=4 tw=80:
# python-quilt - A Python implementation of the quilt patch system
#
# See LICENSE comming with the source of python-quilt for details.
import os
from helpers import make_file
from unittest import TestCase
import quilt.refresh
from quilt.db import Db, Patch
from quilt.... | # vim: fileencoding=utf-8 et sw=4 ts=4 tw=80:
# python-quilt - A Python implementation of the quilt patch system
#
# See LICENSE comming with the source of python-quilt for details.
import os
from .helpers import make_file
from unittest import TestCase
import quilt.refresh
from quilt.db import Db, Patch
from quilt... |
Update dependency jsonschema to v2.6.0 | # -*- coding: utf-8 -*-
import os
import sys
from setuptools import (
find_packages,
setup,
)
here = os.path.dirname(__file__)
requires = [
'jsonschema==2.6.0',
]
if sys.version_info <= (3, 5):
requires.append('zipp == 1.2.0')
tests_require = [
'pytest',
'pytest-cov',
'pytest-flake8',
]
... | # -*- coding: utf-8 -*-
import os
import sys
from setuptools import (
find_packages,
setup,
)
here = os.path.dirname(__file__)
requires = [
'jsonschema==2.4.0',
]
if sys.version_info <= (3, 5):
requires.append('zipp == 1.2.0')
tests_require = [
'pytest',
'pytest-cov',
'pytest-flake8',
]
... |
Upgrade ldap3 1.0.4 => 1.1.2 | import sys
from setuptools import find_packages, setup
with open('VERSION') as version_fp:
VERSION = version_fp.read().strip()
install_requires = [
'django-local-settings>=1.0a14',
'stashward',
]
if sys.version_info[:2] < (3, 4):
install_requires.append('enum34')
setup(
name='django-arcutils... | import sys
from setuptools import find_packages, setup
with open('VERSION') as version_fp:
VERSION = version_fp.read().strip()
install_requires = [
'django-local-settings>=1.0a14',
'stashward',
]
if sys.version_info[:2] < (3, 4):
install_requires.append('enum34')
setup(
name='django-arcutils... |
Move hide class to collection to remove margin-top spaces on hidden collections
SRFCMSAL-2500 | export function init() {
let triggers = document.querySelectorAll('.js-filter-bar-trigger');
for (let i = 0; i < triggers.length; i++) {
let currentTrigger = triggers[i];
currentTrigger.addEventListener('click', function(e) {
e.preventDefault();
const blockID = this.get... | export function init() {
let triggers = document.querySelectorAll('.js-filter-bar-trigger');
for (let i = 0; i < triggers.length; i++) {
let currentTrigger = triggers[i];
currentTrigger.addEventListener('click', function(e) {
e.preventDefault();
const blockID = this.get... |
Fix encoding (thanks to Yasushi Masuda) | # -*- coding: utf-8 -*-
#$HeadURL$
#$LastChangedDate$
#$LastChangedRevision$
import sys
from reportlab.platypus import PageBreak, Spacer
from flowables import *
import shlex
from log import log
def parseRaw (data):
'''Parse and process a simple DSL to handle creation of flowables.
Supported (can... | #$HeadURL$
#$LastChangedDate$
#$LastChangedRevision$
import sys
from reportlab.platypus import PageBreak, Spacer
from flowables import *
import shlex
from log import log
def parseRaw (data):
'''Parse and process a simple DSL to handle creation of flowables.
Supported (can add others on request):
... |
Change the way to instaniate models | from flask import Blueprint, request, json
from alfred_db.models import Repository, Commit
from .database import db
from .helpers import parse_hook_data
webhooks = Blueprint('webhooks', __name__)
@webhooks.route('/', methods=['POST'])
def handler():
payload = request.form.get('payload', '')
try:
pa... | from flask import Blueprint, request, json
from alfred_db.models import Repository, Commit
from .database import db
from .helpers import parse_hook_data
webhooks = Blueprint('webhooks', __name__)
@webhooks.route('/', methods=['POST'])
def handler():
payload = request.form.get('payload', '')
try:
pa... |
Comment out assertion of environment variables(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY).
When test fail, all environment variables appear in the error log in some case.
Use credential file(~/.aws/credential) configuration for testing. | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import unicode_literals
import codecs
import contextlib
import functools
import os
class Env(object):
def __init__(self):
# self.user = os.getenv('AWS_ACCESS_KEY_ID', None)
# assert self.user, \
# 'Required e... | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import unicode_literals
import codecs
import contextlib
import functools
import os
class Env(object):
def __init__(self):
self.user = os.getenv('AWS_ACCESS_KEY_ID', None)
assert self.user, \
'Required environ... |
Fix path to css files | module.exports = function(grunt) {
// Chargement automatique de tous nos modules
require('load-grunt-tasks')(grunt);
// Configuration des plugins
grunt.initConfig({
// Concat and compress CSS
cssmin: {
combine: {
options:{
report: 'gzip',
... | module.exports = function(grunt) {
// Chargement automatique de tous nos modules
require('load-grunt-tasks')(grunt);
// Configuration des plugins
grunt.initConfig({
// Concat and compress CSS
cssmin: {
combine: {
options:{
report: 'gzip',
... |
Make navbar fixed and align links right | import React from 'react';
import {
Collapse,
Nav,
Navbar,
NavbarBrand,
NavbarToggler,
NavItem,
NavLink
} from 'reactstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faGithub, faLinkedin } from '@fortawesome/free-brands-svg-icons'
export default class Naviga... | import React from 'react';
import {
Collapse,
Nav,
Navbar,
NavbarBrand,
NavbarToggler,
NavItem,
NavLink
} from 'reactstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faGithub, faLinkedin } from '@fortawesome/free-brands-svg-icons'
export default class Naviga... |
Move reset to on stop | let videoImage = document.getElementById('video_image');
videoImage.src = `http://${document.domain}:8080/?action=stream`;
let cameraJoystick = {
zone: videoImage,
color: 'red'
};
let cameraJoystickManager = nipplejs.create(cameraJoystick);
const clickTimeout = 500;
var lastStopClick = Date.now();
cameraJoysti... | let videoImage = document.getElementById('video_image');
videoImage.src = `http://${document.domain}:8080/?action=stream`;
let cameraJoystick = {
zone: videoImage,
color: 'red'
};
let cameraJoystickManager = nipplejs.create(cameraJoystick);
const clickTimeout = 500;
var lastStartClick = Date.now();
cameraJoyst... |
Remove broken leading and trailing characters. | #!/usr/bin/env python
import base64
import rsa
import six
from st2common.runners.base_action import Action
class AwsDecryptPassworData(Action):
def run(self, keyfile, password_data):
# copied from:
# https://github.com/aws/aws-cli/blob/master/awscli/customizations/ec2/decryptpassword.py#L96-L12... | #!/usr/bin/env python
import base64
import rsa
import six
from st2common.runners.base_action import Action
class AwsDecryptPassworData(Action):
def run(self, keyfile, password_data):
# copied from:
# https://github.com/aws/aws-cli/blob/master/awscli/customizations/ec2/decryptpassword.py#L96-L12... |
Add uuid to identifier in test script | from __future__ import print_function
import datetime
import os
import sys
from io import BytesIO
from pprint import pprint
from uuid import uuid4
import requests
import voxjar
if __name__ == "__main__":
metadata = {
"identifier": "test_{}".format(uuid4()),
"timestamp": datetime.datetime.now(),
... | from __future__ import print_function
import datetime
import os
import sys
from io import BytesIO
from pprint import pprint
import requests
import voxjar
if __name__ == "__main__":
metadata = {
"identifier": "test_call_identifier",
"timestamp": datetime.datetime.now(),
"type": {
... |
Adjust for compatibility with Python 2.5 | try:
from collections import Mapping
except ImportError:
# compatibility with Python 2.5
Mapping = dict
def quacks_like_dict(object):
"""Check if object is dict-like"""
return isinstance(object, Mapping)
def deep_merge(a, b):
"""Merge two deep dicts non-destructively
Uses a stack ... | import collections
def quacks_like_dict(object):
"""Check if object is dict-like"""
return isinstance(object, collections.Mapping)
def deep_merge(a, b):
"""Merge two deep dicts non-destructively
Uses a stack to avoid maximum recursion depth exceptions
>>> a = {'a': 1, 'b': {1: 1, 2: ... |
Revert "Revert "Last codestyle fix (I hope)""
This reverts commit f57f550268ef23ccb74c6b4da6f4e0cb4d515179. | <?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework;
use PHPUnit\Util\Test as TestUtil;
/... | <?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework;
use PHPUnit\Util\Test as TestUtil;
/... |
Fix JS to use 2-space tabs | $(function () {
var params = {'data_type': '23andme_names'};
$.ajax({
'type': 'GET',
'url': '/json-data/',
'data': params,
'success': function(data) {
if (data.profiles && data.profiles.length > 0) {
for (var i = 0; i < data.profiles.length; i++) {
var radioElem = $('<input ... | $(function () {
var params = {'data_type': '23andme_names'};
$.ajax({
'type': 'GET',
'url': '/json-data/',
'data': params,
'success': function(data) {
if (data.profiles && data.profiles.length > 0) {
for (var i = 0; i < data.profiles.length; i++) {
... |
Remove person link in gadget | <?php
$gadgets = Witi::fetchGadgets();
?>
<ul class="gadgets list">
<li class="col-md-2 col-sm-4 col-xs-6 person add">
<a class="add-trigger">
<figure class="image">
<img src="img/white_bg.jpg" alt="">
</figure>
<div class="icon-wrapper">
... | <?php
$gadgets = Witi::fetchGadgets();
?>
<ul class="gadgets list">
<li class="col-md-2 col-sm-4 col-xs-6 person add">
<a class="add-trigger">
<figure class="image">
<img src="img/white_bg.jpg" alt="">
</figure>
<div class="icon-wrapper">
... |
Fix a typo on error message | import requests
import os
from .endpoints import *
class UnauthorizedToken(Exception):
pass
class ReviewsAPI:
def __init__(self):
token = os.environ['UDACITY_AUTH_TOKEN']
self.headers = {'Authorization': token, 'Content-Length': '0'}
def execute(self, request):
try:
... | import requests
import os
from .endpoints import *
class UnauthorizedToken(Exception):
pass
class ReviewsAPI:
def __init__(self):
token = os.environ['UDACITY_AUTH_TOKEN']
self.headers = {'Authorization': token, 'Content-Length': '0'}
def execute(self, request):
try:
... |
Add missing import for sys | from gengine.app.tests import db as db
from gengine.metadata import init_declarative_base, init_session
import unittest
import os
import pkgutil
import testing.redis
import logging
import sys
log = logging.getLogger(__name__)
init_session()
init_declarative_base()
__path__ = [x[0] for x in os.walk(os.path.dirname(__... | from gengine.app.tests import db as db
from gengine.metadata import init_declarative_base, init_session
import unittest
import os
import pkgutil
import testing.redis
import logging
log = logging.getLogger(__name__)
init_session()
init_declarative_base()
__path__ = [x[0] for x in os.walk(os.path.dirname(__file__))]
... |
Move from celery task to regular-old function | import urlparse
import requests
from celery.utils.log import get_task_logger
from api.base import settings
logger = get_task_logger(__name__)
def get_varnish_servers():
# TODO: this should get the varnish servers from HAProxy or a setting
return settings.VARNISH_SERVERS
def ban_url(url):
timeout = 0.5... | import urlparse
import celery
import requests
from celery.utils.log import get_task_logger
from api.base import settings
from framework.tasks import app as celery_app
logger = get_task_logger(__name__)
class VarnishTask(celery.Task):
abstract = True
max_retries = 5
def get_varnish_servers():
# TODO: t... |
Add better description to built-in Home
Summary: Ref T12174. This could be a little more verbose.
Test Plan: Review Global Menu Items
Reviewers: epriestley
Reviewed By: epriestley
Subscribers: Korvin
Maniphest Tasks: T12174
Differential Revision: https://secure.phabricator.com/D17294 | <?php
final class PhabricatorHomeProfileMenuItem
extends PhabricatorProfileMenuItem {
const MENUITEMKEY = 'home.dashboard';
public function getMenuItemTypeName() {
return pht('Built-in Homepage');
}
private function getDefaultName() {
return pht('Home');
}
public function canMakeDefault(
... | <?php
final class PhabricatorHomeProfileMenuItem
extends PhabricatorProfileMenuItem {
const MENUITEMKEY = 'home.dashboard';
public function getMenuItemTypeName() {
return pht('Home');
}
private function getDefaultName() {
return pht('Home');
}
public function canMakeDefault(
PhabricatorPr... |
Fix next activities bug (date filter D8 not operational) | (function ($) {
'use strict';
setNextActivities();
function setNextActivities() {
$.ajax({
url: "/next_activities"
}).done(function (data) {
var count = 0;
var str = '';
$.each(data, function (index, activity) {
if(new Date(a... | (function ($) {
'use strict';
setNextActivities();
function setNextActivities() {
$.ajax({
url: "/next_activities"
}).done(function (data) {
var str = '';
$.each(data, function (index, activity) {
if(new Date(activity.field_date_1)>new D... |
Add optional callbacks for call buffer | from constants import *
import collections
import uuid
class CallBuffer():
def __init__(self):
self.waiters = set()
self.cache = collections.deque(maxlen=CALL_CACHE_MAX)
self.call_waiters = {}
def wait_for_calls(self, callback, cursor=None):
if cursor:
calls = []
... | from constants import *
import collections
import uuid
class CallBuffer():
def __init__(self):
self.waiters = set()
self.cache = collections.deque(maxlen=CALL_CACHE_MAX)
self.call_waiters = {}
def wait_for_calls(self, callback, cursor=None):
if cursor:
calls = []
... |
Use migrationJob identifier hashcode as notification identifier. | package com.novoda.downloadmanager;
import android.app.Notification;
import android.content.Context;
import android.support.v4.app.NotificationCompat;
class MigrationStatusNotificationCreator implements NotificationCreator<MigrationStatus> {
private final Context applicationContext;
private final Notificatio... | package com.novoda.downloadmanager;
import android.app.Notification;
import android.content.Context;
import android.support.v4.app.NotificationCompat;
class MigrationStatusNotificationCreator implements NotificationCreator<MigrationStatus> {
private final Context applicationContext;
private final Notificatio... |
Fix CSV generator sometimes printing empty entries | <?php
namespace Craft;
class SlugRegen_RegenerateEntrySlugsTask extends BaseTask
{
private $settings;
private $entries;
private $_totalSteps = null;
public function getTotalSteps()
{
if (is_int($this->_totalSteps)) {
return $this->_totalSteps;
}
$this->settings = $this->model->getAttrib... | <?php
namespace Craft;
class SlugRegen_RegenerateEntrySlugsTask extends BaseTask
{
private $settings;
private $entries;
private $_totalSteps = null;
public function getTotalSteps()
{
if (is_int($this->_totalSteps)) {
return $this->_totalSteps;
}
$this->settings = $this->model->getAttrib... |
Correct link to fix Javadoc warnings | /*
* Copyright 2016 Datalogics Inc.
*/
package com.datalogics.pdf.security;
import java.security.Key;
import java.security.cert.Certificate;
/**
* The basic interface for logging into a HSM machine.
*/
public interface HsmManager {
/**
* Performs a login operation to the HSM device.
*
* @par... | /*
* Copyright 2016 Datalogics Inc.
*/
package com.datalogics.pdf.security;
import java.security.Key;
import java.security.cert.Certificate;
/**
* The basic interface for logging into a HSM machine.
*/
public interface HsmManager {
/**
* Performs a login operation to the HSM device.
*
* @par... |
Revert parameter name for isExpired() to validSeconds | "use strict";
const VError = require("verror");
module.exports = function (dependencies) {
const sign = dependencies.sign;
const decode = dependencies.decode;
const resolve = dependencies.resolve;
function prepareToken(options) {
let keyData;
try {
keyData = resolve(options.key);
} catch (e... | "use strict";
const VError = require("verror");
module.exports = function (dependencies) {
const sign = dependencies.sign;
const decode = dependencies.decode;
const resolve = dependencies.resolve;
function prepareToken(options) {
let keyData;
try {
keyData = resolve(options.key);
} catch (e... |
Return the Link instance itself when accessed through a class (so sphinx autodoc works) | import logging
import remoteobjects.dataobject
import remoteobjects.fields
from remoteobjects.fields import *
import typepad.tpobject
class Link(remoteobjects.fields.Link):
"""A `TypePadObject` property representing a link from one TypePad API
object to another.
This `Link` works like `remoteobjects.fi... | import logging
import remoteobjects.dataobject
import remoteobjects.fields
from remoteobjects.fields import *
import typepad.tpobject
class Link(remoteobjects.fields.Link):
"""A `TypePadObject` property representing a link from one TypePad API
object to another.
This `Link` works like `remoteobjects.fi... |
Fix generator path for service provider | <?php namespace Pingpong\Modules\Commands;
use Illuminate\Support\Str;
use Pingpong\Generators\Stub;
use Pingpong\Modules\Traits\ModuleCommandTrait;
use Symfony\Component\Console\Input\InputArgument;
class GenerateProviderCommand extends GeneratorCommand {
use ModuleCommandTrait;
/**
* The console comm... | <?php namespace Pingpong\Modules\Commands;
use Illuminate\Support\Str;
use Pingpong\Generators\Stub;
use Pingpong\Modules\Traits\ModuleCommandTrait;
use Symfony\Component\Console\Input\InputArgument;
class GenerateProviderCommand extends GeneratorCommand {
use ModuleCommandTrait;
/**
* The console comm... |
Implement pause property more accurately | # coding: utf-8
import logging
import psutil
from subprocess import PIPE
class FfmpegProcess(object):
def __init__(self):
self._cmdline = None
self._process = None
self._paused = False
def run(self):
if self._cmdline is None:
logging.debug('cmdline is not yet defin... | # coding: utf-8
import logging
import psutil
from subprocess import PIPE
class FfmpegProcess(object):
def __init__(self):
self._cmdline = None
self._process = None
self._paused = False
def run(self):
if self._cmdline is None:
logging.debug('cmdline is not yet defin... |
Add a tool tip to the form. | import React, { PropTypes, Component } from 'react'
import moment from 'moment'
import style from './../../../styles/organisms/ThermostatForm.scss'
class ThermostatForm extends Component {
getLastRemoteCheckin() {
return moment().diff(this.props.lastCheckin, 'minutes')
}
render() {
const minutesSince... | import React, { PropTypes, Component } from 'react'
import moment from 'moment'
import style from './../../../styles/organisms/ThermostatForm.scss'
class ThermostatForm extends Component {
getLastRemoteCheckin() {
return moment().diff(this.props.lastCheckin, 'minutes')
}
render() {
const minutesSince... |
Enable Command to support memory limiting. | import subprocess as sp
import signal
import threading
import os
SIGTERM_TIMEOUT = 1.0
class Command(object):
def __init__(self, cmd, memlimit=None):
self.cmd = cmd
self.memlimit = memlimit
self.process = None
self.stdout = None
self.stderr = None
self.exitcode = ... | import subprocess as sp
import signal
import threading
import os
SIGTERM_TIMEOUT = 1.0
class Command(object):
def __init__(self, cmd, memlimit=None):
self.cmd = cmd
self.memlimit = memlimit
self.process = None
self.stdout = None
self.stderr = None
self.exitcode = ... |
Improve API test by only comparing args and varargs. | # coding: utf-8
"""
Test the backend API
Written so that after creating a new backend, you can immediately see which
parts are missing!
"""
from unittest import TestCase
import inspect
from pycurlbrowser.backend import *
from pycurlbrowser import Browser
def is_http_backend_derived(t):
if t is HttpBackend:
... | # coding: utf-8
"""
Test the backend API
Written so that after creating a new backend, you can immediately see which
parts are missing!
"""
from unittest import TestCase
import inspect
from pycurlbrowser.backend import *
from pycurlbrowser import Browser
def is_http_backend_derived(t):
if t is HttpBackend:
... |
Fix server error when login with u2f | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
from u2flib_server.u2f import (begin_registration,
begin_authentication,
complete_registration,
complete_authentication)
from components.eternity import config
facet... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
from u2flib_server.u2f import (begin_registration,
begin_authentication,
complete_registration,
complete_authentication)
from components.eternity import config
facet... |
Add test for use case when at least two neightbours are alive |
var GameOfLife = (function() {
var ALIVE = "alive", DEAD = "dead";
function Cell(initialState) {
var state = initialState || DEAD;
function getNumberOfAlive(neighbours) {
var nbAliveCells = 0;
neighbours.forEach(function (neighbor) {
if (neighbor.isAliv... |
var GameOfLife = (function() {
var ALIVE = "alive", DEAD = "dead";
function Cell(initialState) {
var state = initialState || DEAD;
function getNumberOfAlive(neighbours) {
var nbAliveCells = 0;
neighbours.forEach(function (neighbor) {
if (neighbor.isAliv... |
Add verification that the code ran on GPU. Otherwise we get a false positive. | package com.amd.aparapi.test.runtime;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import com.amd.aparapi.Kernel;
class AnotherClass{
static public int foo(int i) {
return i + 42;
}
};
public class CallStaticFromAnonymousKernel {
static final int size = 256;
f... | package com.amd.aparapi.test.runtime;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import com.amd.aparapi.Kernel;
class AnotherClass{
static public int foo(int i) {
return i + 42;
}
};
public class CallStaticFromAnonymousKernel {
static final int size = 256;
f... |
fix(lang): Fix comment for lang method | <?php
namespace Unicodeveloper\Identify;
use Sinergi\BrowserDetector\Browser;
use Sinergi\BrowserDetector\Os;
use Sinergi\BrowserDetector\Language;
class Identify {
/**
* Store the browser object
* @var object
*/
protected $browser;
/**
* Store the os object
* @var object
... | <?php
namespace Unicodeveloper\Identify;
use Sinergi\BrowserDetector\Browser;
use Sinergi\BrowserDetector\Os;
use Sinergi\BrowserDetector\Language;
class Identify {
/**
* Store the browser object
* @var object
*/
protected $browser;
/**
* Store the os object
* @var object
... |
Fix unbloud local error if no matching records | import logging
from django.core.management.base import BaseCommand
from cityhallmonitor.models import Document
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = 'For each document, force an update of its related fields and its postgres text index'
def add_arguments(self, parser):
... | import logging
from django.core.management.base import BaseCommand
from cityhallmonitor.models import Document
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = 'For each document, force an update of its related fields and its postgres text index'
def add_arguments(self, parser):
... |
Use -platform:anycpu while compiling .NET assemblies
git-svn-id: 8d82213adbbc6b1538a984bace977d31fcb31691@349 2f5d681c-ba19-11dd-a503-ed2d4bea8bb5 | import os.path
import SCons.Builder
import SCons.Node.FS
import SCons.Util
csccom = "$CSC $CSCFLAGS $_CSCLIBPATH -r:$_CSCLIBS -out:${TARGET.abspath} $SOURCES"
csclibcom = "$CSC -t:library $CSCLIBFLAGS $_CSCLIBPATH $_CSCLIBS -out:${TARGET.abspath} $SOURCES"
McsBuilder = SCons.Builder.Builder(action = '$CSCCOM',
... | import os.path
import SCons.Builder
import SCons.Node.FS
import SCons.Util
csccom = "$CSC $CSCFLAGS $_CSCLIBPATH -r:$_CSCLIBS -out:${TARGET.abspath} $SOURCES"
csclibcom = "$CSC -t:library $CSCLIBFLAGS $_CSCLIBPATH $_CSCLIBS -out:${TARGET.abspath} $SOURCES"
McsBuilder = SCons.Builder.Builder(action = '$CSCCOM',
... |
Remove some single quotes from a key | (function() {
'use strict';
angular.module('app.config')
.config(navigation);
/** @ngInject */
function navigation(NavigationProvider) {
NavigationProvider.configure({
items: {
primary: [
{
title: 'Dashboard',
state: 'dashboard',
icon: 'fa fa... | (function() {
'use strict';
angular.module('app.config')
.config(navigation);
/** @ngInject */
function navigation(NavigationProvider) {
NavigationProvider.configure({
items: {
primary: [
{
title: 'Dashboard',
'state': 'dashboard',
icon: 'fa ... |
Add wait for pagination test | import unittest
import sys
import os
try:
from instagram_private_api_extensions import pagination
except ImportError:
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from instagram_private_api_extensions import pagination
class TestPagination(unittest.TestCase):
def test_page(self):
... | import unittest
import sys
import os
try:
from instagram_private_api_extensions import pagination
except ImportError:
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from instagram_private_api_extensions import pagination
class TestPagination(unittest.TestCase):
def test_page(self):
... |
Update version number to 0.6.2 | from setuptools import setup, find_packages
version = '0.6.2'
setup(
name='ckanext-oaipmh',
version=version,
description="OAI-PMH server and harvester for CKAN",
long_description="""\
""",
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywor... | from setuptools import setup, find_packages
version = '0.6.1'
setup(
name='ckanext-oaipmh',
version=version,
description="OAI-PMH server and harvester for CKAN",
long_description="""\
""",
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywor... |
Align media form with displayed media link info
The issue was that if you have a media link and click ad media link
the form had a different order or type and uri. | <?php
namespace Talk;
use Event\EventEntity;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
/**
* Form used to render and validate the speakers collection on a Talk form
*/
class TalkMediaFormType extends AbstractType
{
/**
* Returns the name of this form type.
... | <?php
namespace Talk;
use Event\EventEntity;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
/**
* Form used to render and validate the speakers collection on a Talk form
*/
class TalkMediaFormType extends AbstractType
{
/**
* Returns the name of this form type.
... |
Fix level not returned in getLevel(). | <?php
namespace MinePlus\VoterBundle;
class VoteDispatcher
{
protected $voters;
public function hasVoters()
{
// An empty array cast's into false
return (boolean) $this->voters;
}
public function addVoter($eventName, $voter, $multiplicator)
{
$this->voter... | <?php
namespace MinePlus\VoterBundle;
class VoteDispatcher
{
protected $voters;
public function hasVoters()
{
// An empty array cast's into false
return (boolean) $this->voters;
}
public function addVoter($eventName, $voter, $multiplicator)
{
$this->voter... |
Handle alternate form of mongoose 11000 error | var mongoose = require('mongoose');
var ShortId = require('./shortid');
var defaultSave = mongoose.Model.prototype.save;
mongoose.Model.prototype.save = function(cb) {
for (fieldName in this.schema.tree) {
if (this.isNew && this[fieldName] === undefined) {
var idType = this.schema.tree[fieldName];
i... | var mongoose = require('mongoose');
var ShortId = require('./shortid');
var defaultSave = mongoose.Model.prototype.save;
mongoose.Model.prototype.save = function(cb) {
for (fieldName in this.schema.tree) {
if (this.isNew && this[fieldName] === undefined) {
var idType = this.schema.tree[fieldName];
i... |
Use query result rather than simply syntax binding | <?php
namespace DB\Driver;
/**
* Database driver for MYSQL using MYSQLI rather than default and deprecated
* MYSQL which is recommended by most PHP developer.
*
* @package DB\Driver
*/
class MYSQLI implements IDriver
{
private $mysqli;
public function connect($... | <?php
namespace DB\Driver;
/**
* Database driver for MYSQL using MYSQLI rather than default and deprecated
* MYSQL which is recommended by most PHP developer.
*
* @package DB\Driver
*/
class MYSQLI implements IDriver
{
private $mysqli;
public function connect($... |
Handle cases where nvidia-smi does not exist | from setuptools import setup
from subprocess import check_output, CalledProcessError
try:
num_gpus = len(check_output(['nvidia-smi', '--query-gpu=gpu_name',
'--format=csv']).decode().strip().split('\n'))
tf = 'tensorflow-gpu' if num_gpus > 1 else 'tensorflow'
except CalledProce... | from setuptools import setup
from subprocess import check_output, CalledProcessError
try:
num_gpus = len(check_output(['nvidia-smi', '--query-gpu=gpu_name',
'--format=csv']).decode().strip().split('\n'))
tf = 'tensorflow-gpu' if num_gpus > 1 else 'tensorflow'
except CalledProce... |
Remove the ? mark at because not all video URLs contain it, therefore it misses some URLs. | function findUrls( text )
{
var source = (text || '').toString();
var urlArray = [];
var url;
var matchArray;
// Regular expression to find FTP, HTTP(S) and email URLs.
var regexToken = /(((ftp|https?):\/\/)[\-\w@:%_\+.~#?,&\/\/=]+)|((mailto:)?[_.\w-]+@([\w][\w\-]+\.)+[a-zA-Z]{2,3})/g;
// ... | function findUrls( text )
{
var source = (text || '').toString();
var urlArray = [];
var url;
var matchArray;
// Regular expression to find FTP, HTTP(S) and email URLs.
var regexToken = /(((ftp|https?):\/\/)[\-\w@:%_\+.~#?,&\/\/=]+)|((mailto:)?[_.\w-]+@([\w][\w\-]+\.)+[a-zA-Z]{2,3})/g;
// ... |
Test changes in myfeature branch | <?php
/* MYFEATURE BRANCH */
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/ZendSkeletonModule for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/licen... | <?php
/* DEVELOPMENT BRANCH */
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/ZendSkeletonModule for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/lic... |
Send theme setting during startup | //
// Copyright 2009-2015 Ilkka Oksanen <iao@iki.fi>
//
// 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 b... | //
// Copyright 2009-2015 Ilkka Oksanen <iao@iki.fi>
//
// 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 b... |
Revert "Get more data from onChange event" | import React, { PropTypes } from 'react';
import classNames from 'classnames';
import mdlUpgrade from './utils/mdlUpgrade';
class Switch extends React.Component {
static propTypes = {
checked: PropTypes.bool,
className: PropTypes.string,
disabled: PropTypes.bool,
id: PropTypes.strin... | import React, { PropTypes } from 'react';
import classNames from 'classnames';
import mdlUpgrade from './utils/mdlUpgrade';
class Switch extends React.Component {
static propTypes = {
checked: PropTypes.bool,
className: PropTypes.string,
disabled: PropTypes.bool,
id: PropTypes.strin... |
Set NODE_ENV to production in release build (build react in prod mode) | const webpack = require("webpack");
const CURRENT_STYLE = process.env.INFOTV_STYLE || "desucon";
const outputFsPath = process.env.OUTPUT_PATH || `${__dirname}/../static/infotv`;
const outputPublicPath = process.env.PUBLIC_PATH || "/static/infotv";
const production = process.argv.indexOf("-p") !== -1;
const config = {... | const webpack = require("webpack");
const CURRENT_STYLE = process.env.INFOTV_STYLE || "desucon";
const outputFsPath = process.env.OUTPUT_PATH || `${__dirname}/../static/infotv`;
const outputPublicPath = process.env.PUBLIC_PATH || "/static/infotv";
module.exports = {
context: __dirname,
entry: "./src/main.js",... |
Print output on success/failure & catch exceptions. | <?php
namespace Northstar\Console\Commands;
use Carbon\Carbon;
use DoSomething\Gateway\Blink;
use Exception;
use Illuminate\Console\Command;
use Illuminate\Support\Collection;
use Northstar\Models\User;
class BackfillCustomerIoProfiles extends Command
{
/**
* The name and signature of the console command.
... | <?php
namespace Northstar\Console\Commands;
use Carbon\Carbon;
use DoSomething\Gateway\Blink;
use Illuminate\Console\Command;
use Illuminate\Support\Collection;
use Northstar\Models\User;
class BackfillCustomerIoProfiles extends Command
{
/**
* The name and signature of the console command.
*
* @v... |
Enable SSL communication for PubNub
This makes the communication with PubNub more secure. this update sends device info, including lng/lat coordinates, so its best to use SSL. | import EventEmitter from "events";
import PubNub from "pubnub";
export default class Subscriptions extends EventEmitter {
constructor() {
super();
this.subscribers = {};
}
getOrAddSubscriber(subscribeKey) {
if (!this.subscribers[subscribeKey]) {
this.subscribers[subscribeKey] = new PubNub({
... | import EventEmitter from "events";
import PubNub from "pubnub";
export default class Subscriptions extends EventEmitter {
constructor() {
super();
this.subscribers = {};
}
getOrAddSubscriber(subscribeKey) {
if (!this.subscribers[subscribeKey]) {
this.subscribers[subscribeKey] = new PubNub({
... |
Change teleop to drive with the new Gamepad class. | /*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of... | /*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of... |
Add ref to table element | var React = require('react');
var data = require('./data.full.js');
var options = {
rowHeight: 40
};
var ReactDataTable = React.createClass({
getInitialState: function() {
return {
rowsToDisplay: {
toHideAbove: 0,
toRender: 0,
toHideBelow: 0
}
};
},
render: function... | var React = require('react');
var data = require('./data.full.js');
var options = {
rowHeight: 40
};
var ReactDataTable = React.createClass({
getInitialState: function() {
return {
rowsToDisplay: {
toHideAbove: 0,
toRender: 0,
toHideBelow: 0
}
};
},
render: function... |
Fix missing synchronized read access | <?php
require dirname(__DIR__).'/vendor/autoload.php';
use Icicle\Concurrent\Forking\ForkContext;
use Icicle\Coroutine\Coroutine;
use Icicle\Loop;
class Test extends ForkContext
{
/**
* @synchronized
*/
public $data;
public function run()
{
print "Child sleeping for 4 seconds...\n";... | <?php
require dirname(__DIR__).'/vendor/autoload.php';
use Icicle\Concurrent\Forking\ForkContext;
use Icicle\Coroutine\Coroutine;
use Icicle\Loop;
class Test extends ForkContext
{
/**
* @synchronized
*/
public $data;
public function run()
{
print "Child sleeping for 4 seconds...\n";... |
Fix login test in Travis. | /*jshint quotmark: false */
"use strict";
var rio = require("../lib/rio"),
vows = require("vows"),
assert = require("assert");
var isEnablePlaybackMode = process.env.CI === "true";
vows.describe("Login tests").addBatch({
"login ok test": {
topic: function () {
rio.enablePlaybackMode(... | /*jshint quotmark: false */
"use strict";
var rio = require("../lib/rio"),
vows = require("vows"),
assert = require("assert");
var isEnablePlaybackMode = process.env.CI === "true";
vows.describe("Login tests").addBatch({
"login ok test": {
topic: function () {
rio.enablePlaybackMode(... |
Fix formSelect component's default option
When adding using the `default-option` directive you would need to have added a `length` property with a truthy value to successfully add the default option. This change fixes that by making sure there is a default option with a text and value property. | // import dependencies
import {uniqueId} from '../../utils/helpers.js'
import template from './form-select.html'
// export component object
export default {
template: template,
replace: true,
computed: {
allOptions(){
if (this.defaultOption.text && this.defaultOption.value) {
return [this... | // import dependencies
import {uniqueId} from '../../utils/helpers.js'
import template from './form-select.html'
// export component object
export default {
template: template,
replace: true,
computed: {
allOptions(){
if (this.defaultOption.length) {
return [this.defaultOption].concat(thi... |
Rename option to caseSensitive to avoid double negation | "use strict";
module.exports = {
rules: {
"sort-object-props": function(context) {
var caseSensitive = context.options[0].caseSensitive;
var ignoreMethods = context.options[0].ignoreMethods;
var MSG = "Property names in object literals should be sorted";
retu... | "use strict";
module.exports = {
rules: {
"sort-object-props": function(context) {
var ignoreCase = context.options[0].ignoreCase;
var ignoreMethods = context.options[0].ignoreMethods;
var MSG = "Property names in object literals should be sorted";
return {
... |
Remove duplicate version number and stability. | <?php
// Set the title for the main template
$parent->context->page_title = $context->name.' | pear2.php.net';
?>
<div class="package">
<div class="grid_8 left">
<h2>Package :: <?php echo $context->name; ?></h2>
<p><em><?php echo $context->summary; ?></em></p>
<p>
<?php
... | <?php
// Set the title for the main template
$parent->context->page_title = $context->name.' | pear2.php.net';
?>
<div class="package">
<div class="grid_8 left">
<h2>Package :: <?php echo $context->name; ?></h2>
<p><em><?php echo $context->summary; ?></em></p>
<p>
<?php
... |
Change the name to match the repo
And decent naming conventions, underscores are yuck for names :p | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
import os
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
Test... | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
import os
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
Test... |
Replace out of date library | requirejs.config({
paths: {
'text': '../lib/require/text',
'durandal':'../lib/durandal/js',
'plugins' : '../lib/durandal/js/plugins',
'transitions' : '../lib/durandal/js/transitions',
'knockout': '../lib/knockout/knockout-3.3.0',
'knockout-validation': '../lib/... | requirejs.config({
paths: {
'text': '../lib/require/text',
'durandal':'../lib/durandal/js',
'plugins' : '../lib/durandal/js/plugins',
'transitions' : '../lib/durandal/js/transitions',
'knockout': '../lib/knockout/knockout-3.1.0',
'bootstrap': '../lib/bootstrap/... |
Reduce number of DB calls in NowPlayingController | <?php
use \Entity\Station;
use \Entity\Song;
use \Entity\Schedule;
class Api_NowplayingController extends \PVL\Controller\Action\Api
{
public function indexAction()
{
$file_path_api = DF_INCLUDE_STATIC.'/api/nowplaying_api.json';
$np_raw = file_get_contents($file_path_api);
... | <?php
use \Entity\Station;
use \Entity\Song;
use \Entity\Schedule;
class Api_NowplayingController extends \PVL\Controller\Action\Api
{
public function indexAction()
{
$file_path_api = DF_INCLUDE_STATIC.'/api/nowplaying_api.json';
$np_raw = file_get_contents($file_path_api);
... |
Use English for UI by default | import React, { Component } from "react";
import Quiz from "./Quiz";
import "./App.css";
import questions from "./questions.json";
import strings from "./strings.json";
class LanguageChooser extends Component {
handleChoice(language, evt) {
this.props.reporter(language);
}
render() {
co... | import React, { Component } from "react";
import Quiz from "./Quiz";
import "./App.css";
import questions from "./questions.json";
import strings from "./strings.json";
class LanguageChooser extends Component {
handleChoice(language, evt) {
this.props.reporter(language);
}
render() {
co... |
Save the players array correctly when saving game stats | const mongoskin = require('mongoskin');
const logger = require('../log.js');
class GameRepository {
save(game, callback) {
var db = mongoskin.db('mongodb://127.0.0.1:27017/throneteki');
if(!game.id) {
db.collection('games').insert(game, function(err, result) {
if(err) {... | const mongoskin = require('mongoskin');
const logger = require('../log.js');
class GameRepository {
save(game, callback) {
var db = mongoskin.db('mongodb://127.0.0.1:27017/throneteki');
if(!game.id) {
db.collection('games').insert(game, function(err, result) {
if(err) {... |
Support 'none' as smtp encryption | <?php
namespace AppZap\PHPFramework\Mail;
use AppZap\PHPFramework\Configuration\Configuration;
class MailService {
/**
* @param MailMessage $message
*/
public function send(MailMessage $message) {
$transport = $this->createTransport();
$mailer = new \Swift_Mailer($transport);
$mailer->send($mes... | <?php
namespace AppZap\PHPFramework\Mail;
use AppZap\PHPFramework\Configuration\Configuration;
class MailService {
/**
* @param MailMessage $message
*/
public function send(MailMessage $message) {
$transport = $this->createTransport();
$mailer = new \Swift_Mailer($transport);
$mailer->send($mes... |
Make "to" not inclusive in widget
To avoid exceeding possible values. | #!/usr/bin/env python
# coding=utf-8
from decimal import Decimal
from django.utils.translation import ugettext_lazy as _
from django.forms.fields import Field, ValidationError
from tempo.django.widgets import ScheduleSetWidget
from tempo.schedule import Schedule
from tempo.scheduleset import ScheduleSet
class Sched... | #!/usr/bin/env python
# coding=utf-8
from decimal import Decimal
from django.utils.translation import ugettext_lazy as _
from django.forms.fields import Field, ValidationError
from tempo.django.widgets import ScheduleSetWidget
from tempo.schedule import Schedule
from tempo.scheduleset import ScheduleSet
class Sched... |
Fix description of time until re-enable clicks | const helpers = require('./support/helpers.js');
beforeAll(() => {
jest.useFakeTimers();
});
afterAll(() => {
require('./support/teardown.js');
});
describe('Prevent duplicate form submissions', () => {
let form;
let button;
let formSubmitSpy;
beforeEach(() => {
// set up DOM
document.body.inn... | const helpers = require('./support/helpers.js');
beforeAll(() => {
jest.useFakeTimers();
});
afterAll(() => {
require('./support/teardown.js');
});
describe('Prevent duplicate form submissions', () => {
let form;
let button;
let formSubmitSpy;
beforeEach(() => {
// set up DOM
document.body.inn... |
Fix rmtree call for deleting user's homedirs | from django.core.management.base import BaseCommand, CommandError
from purefap.core.models import FTPUser, FTPStaff, FTPClient
import shutil
from datetime import datetime
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--noop',
... | from django.core.management.base import BaseCommand, CommandError
from purefap.core.models import FTPUser, FTPStaff, FTPClient
import shutil
from datetime import datetime
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--noop',
... |
Add -p option to invoke Python profiler | import sys
import getopt
from compiler import compile, visitor
import profile
def main():
VERBOSE = 0
DISPLAY = 0
PROFILE = 0
CONTINUE = 0
opts, args = getopt.getopt(sys.argv[1:], 'vqdcp')
for k, v in opts:
if k == '-v':
VERBOSE = 1
visitor.ASTVisitor.VERBOSE =... | import sys
import getopt
from compiler import compile, visitor
##import profile
def main():
VERBOSE = 0
DISPLAY = 0
CONTINUE = 0
opts, args = getopt.getopt(sys.argv[1:], 'vqdc')
for k, v in opts:
if k == '-v':
VERBOSE = 1
visitor.ASTVisitor.VERBOSE = visitor.ASTVis... |
Remove template language hard initialization to dynamic initialization | <?php
namespace Uphp\web;
use \UPhp\ActionController\ActionController;
class Application
{
public static $appConfig = [];
public function __construct()
{
set_exception_handler("src\uphpExceptionHandler");
set_error_handler("src\uphpErrorHandler");
}
public function start($config)... | <?php
namespace Uphp\web;
use src\Inflection;
use \UPhp\ActionDispach\Routes as Route;
use \UPhp\ActionController\ActionController;
class Application
{
public static $appConfig = [];
public static $templateConfig = [];
public function __construct()
{
//set_exception_handler("src\uphpException... |
Update heading on Remote Selector to use imperative tone
Previously the heading looked like an "error" message, however, this is really just a regular state that the user can appear in, and in future revisions this screen could be used for changing the remote directly from within the Github package, therefore an imper... | import React from 'react';
import PropTypes from 'prop-types';
import {RemoteSetPropType, BranchPropType} from '../prop-types';
export default class RemoteSelectorView extends React.Component {
static propTypes = {
remotes: RemoteSetPropType.isRequired,
currentBranch: BranchPropType.isRequired,
selectRe... | import React from 'react';
import PropTypes from 'prop-types';
import {RemoteSetPropType, BranchPropType} from '../prop-types';
export default class RemoteSelectorView extends React.Component {
static propTypes = {
remotes: RemoteSetPropType.isRequired,
currentBranch: BranchPropType.isRequired,
selectRe... |
gluster: Return UNKNOWN status for GlusterTaskStatus
If the string value passed to GlusterTaskStatus is not
one of the enum options return UNKNOWN as the option
value.
Fixes 2 issues reported by coverity scan when converting
vdsm return value
GlusterAsyncTaskStatus.from((String)map.get(STATUS)).getJobExecutionStatus()... | package org.ovirt.engine.core.common.asynctasks.gluster;
import org.ovirt.engine.core.common.job.JobExecutionStatus;
/**
* This enum represents the gluster volume async task status values returned from VDSM
*/
public enum GlusterAsyncTaskStatus {
COMPLETED("COMPLETED"),
STARTED("STARTED"),
STOPPED("STOP... | package org.ovirt.engine.core.common.asynctasks.gluster;
import org.ovirt.engine.core.common.job.JobExecutionStatus;
/**
* This enum represents the gluster volume async task status values returned from VDSM
*/
public enum GlusterAsyncTaskStatus {
COMPLETED("COMPLETED"),
STARTED("STARTED"),
STOPPED("STOP... |
Highlight: Use lighter theme with good contrast. | // jscs:disable maximumLineLength
/**
* Highlight Module
*
*
* High Level API:
*
* api.init()
*
*
* Hooks To:
*
* 'document:loaded' ~> highlight.init();
*
*/
(function (global) {
function loadInitialScriptsAndStyles() {
var link =
document.createElement('link');
var mainScript =
... | // jscs:disable maximumLineLength
/**
* Highlight Module
*
*
* High Level API:
*
* api.init()
*
*
* Hooks To:
*
* 'document:loaded' ~> highlight.init();
*
*/
(function (global) {
function loadInitialScriptsAndStyles() {
var link =
document.createElement('link');
var mainScript =
... |
Remove quotes from tests in normalizeArgs | import normalizeArgs, { __RewireAPI__ as rewireAPI } from '../../../src/server/process/normalizeArgs';
describe('normalizeArgs', () => {
afterEach(() => {
rewireAPI.__ResetDependency__('process');
});
it('should normalize for Windows with no COMSPEC', () => {
rewireAPI.__Rewire__('process'... | import normalizeArgs, { __RewireAPI__ as rewireAPI } from '../../../src/server/process/normalizeArgs';
describe('normalizeArgs', () => {
afterEach(() => {
rewireAPI.__ResetDependency__('process');
});
it('should normalize for Windows with no COMSPEC', () => {
rewireAPI.__Rewire__('process'... |
Fix for php notice error | <?php
namespace Luracast\Restler\Format;
/**
* Javascript Object Notation Packaged in a method (JSONP)
*
* @category Framework
* @package Restler
* @subpackage format
* @author R.Arul Kumaran <arul@luracast.com>
* @copyright 2010 Luracast
* @license http://www.opensource.org/licenses/lgpl-license.... | <?php
namespace Luracast\Restler\Format;
/**
* Javascript Object Notation Packaged in a method (JSONP)
*
* @category Framework
* @package Restler
* @subpackage format
* @author R.Arul Kumaran <arul@luracast.com>
* @copyright 2010 Luracast
* @license http://www.opensource.org/licenses/lgpl-license.... |
Set $this->app to a variable so we can get the constants out | <?php
namespace Encore\Kernel;
class Timezone
{
public function __construct(Application $app, array $winTimezones)
{
$this->app = $app;
$this->timezones = $winTimezones;
}
public function set($timezone)
{
return date_default_timezone_set($timezone);
}
public funct... | <?php
namespace Encore\Kernel;
class Timezone
{
public function __construct(Application $app, array $winTimezones)
{
$this->app = $app;
$this->timezones = $winTimezones;
}
public function set($timezone)
{
return date_default_timezone_set($timezone);
}
public funct... |
Make daphne serving thread idle better | import logging
import time
from twisted.internet import reactor
from .http_protocol import HTTPFactory
logger = logging.getLogger(__name__)
class Server(object):
def __init__(self, channel_layer, host="127.0.0.1", port=8000, signal_handlers=True, action_logger=None):
self.channel_layer = channel_layer
... | import logging
import time
from twisted.internet import reactor
from .http_protocol import HTTPFactory
logger = logging.getLogger(__name__)
class Server(object):
def __init__(self, channel_layer, host="127.0.0.1", port=8000, signal_handlers=True, action_logger=None):
self.channel_layer = channel_layer
... |
Load innovation story page based on QR code result |
var DiscoverView = function() {
this.initialize = function() {
// 'div' wrapper to attach html and events to
this.el = $('<div/>');
};
this.render = function() {
if (!this.homeView) {
this.homeView = { enteredName: "" }
}
var discover_view = DiscoverView.template(... |
var DiscoverView = function() {
this.initialize = function() {
// 'div' wrapper to attach html and events to
this.el = $('<div/>');
};
this.render = function() {
if (!this.homeView) {
this.homeView = { enteredName: "" }
}
this.el.html(DiscoverView.template(th... |
Use defs instead of symbol in SVG sprite | import fs from 'fs';
import glob from 'glob';
import path from 'path';
import SVGSprite from 'svg-sprite';
import vinyl from 'vinyl';
function SVGCompilerPlugin(options) {
this.options = {baseDir: path.resolve(options.baseDir)};
}
SVGCompilerPlugin.prototype.apply = function(compiler) {
var baseDir = this.options... | import fs from 'fs';
import glob from 'glob';
import path from 'path';
import SVGSprite from 'svg-sprite';
import vinyl from 'vinyl';
function SVGCompilerPlugin(options) {
this.options = {baseDir: path.resolve(options.baseDir)};
}
SVGCompilerPlugin.prototype.apply = function(compiler) {
var baseDir = this.options... |
Remove Registration form name so the name does not form part of the register JSON request body. | <?php
namespace Ice\ExternalUserBundle\Form\Type;
use FOS\UserBundle\Form\Type\RegistrationFormType as BaseType;
use Symfony\Component\Form\FormBuilderInterface,
Symfony\Component\OptionsResolver\OptionsResolverInterface;
class RegistrationFormType extends BaseType
{
public function buildForm(FormBuilderInt... | <?php
namespace Ice\ExternalUserBundle\Form\Type;
use FOS\UserBundle\Form\Type\RegistrationFormType as BaseType;
use Symfony\Component\Form\FormBuilderInterface,
Symfony\Component\OptionsResolver\OptionsResolverInterface;
class RegistrationFormType extends BaseType
{
public function buildForm(FormBuilderInt... |
Update UI tests for the `SearchCommand` | package jfdi.test.ui;
import static org.junit.Assert.assertEquals;
import jfdi.ui.Constants;
public class TestSearch extends UiTest {
TestSearch(TestMain main) {
super(main);
}
@Override
void run() {
testSingleSearchDone();
testMultipleSearchDone();
}
/*
* Test... | package jfdi.test.ui;
import static org.junit.Assert.assertEquals;
import jfdi.ui.Constants;
public class TestSearch extends UiTest {
TestSearch(TestMain main) {
super(main);
}
@Override
void run() {
testSingleSearchDone();
testMultipleSearchDone();
}
/*
* Test... |
Revert back to version number | #!/usr/bin/env python
import subprocess
from setuptools import setup, find_packages
import os
def git_version():
def _minimal_ext_cmd(cmd):
# construct minimal environment
env = {}
for k in ['SYSTEMROOT', 'PATH']:
v = os.environ.get(k)
if v is not None:
... | #!/usr/bin/env python
import subprocess
from setuptools import setup, find_packages
import os
def git_version():
def _minimal_ext_cmd(cmd):
# construct minimal environment
env = {}
for k in ['SYSTEMROOT', 'PATH']:
v = os.environ.get(k)
if v is not None:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.