commit stringlengths 40 40 | subject stringlengths 1 3.25k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | old_contents stringlengths 0 26.3k | lang stringclasses 3
values | proba float64 0 1 | diff stringlengths 0 7.82k |
|---|---|---|---|---|---|---|---|
d1b8ab844d153a240c3f71965c0258b91613ea0f | Move test for adding devices to cache of nonexistent pool | tests/whitebox/integration/pool/test_init_cache.py | tests/whitebox/integration/pool/test_init_cache.py | # Copyright 2020 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | Python | 0 | @@ -598,16 +598,93 @@
'.%0A%22%22%22%0A%0A
+# isort: FIRSTPARTY%0Afrom dbus_client_gen import DbusClientUniqueResultError%0A%0A
# isort:
@@ -2737,32 +2737,495 @@
line, _ERROR)%0A%0A%0A
+class InitCacheFail3TestCase(SimTestCase):%0A %22%22%22%0A Test 'init-cache' for a non-existant pool.%0A %22%22%22%0A%0A ... |
332be5e6959a3254aaa269a8a4c6d26a2a18c492 | Remove redundant tests | tests/whack_cli_test.py | tests/whack_cli_test.py | import os
import subprocess
import contextlib
from nose.tools import istest, assert_equal
import mock
import testing
from whack.tempdir import create_temporary_dir
from whack.cli import main
import whack.config
@istest
def application_is_installed_by_running_build_then_install_scripts():
with create_temporary_di... | Python | 0.003433 | @@ -2402,270 +2402,8 @@
est%0A
-def http_cache_url_is_none_if_not_explicitly_set():%0A argv = %5B%22whack%22, %22install%22, %22hello%22, %22apps/hello%22%5D%0A caching_config = whack.config.caching_config(enabled=True, http_cache_url=None)%0A _test_install_arg_parse(argv, caching=caching_config)%0A %0A@is... |
12cc5e752f9aa4700b57e3647c3676aba70bb996 | use valid exception for Python 2.7 | tests/whitelist_test.py | tests/whitelist_test.py | # -*- coding: utf-8 -*-
import pytest
from riprova import ErrorWhitelist, NotRetriableError
def test_error_whitelist():
whitelist = ErrorWhitelist()
assert type(ErrorWhitelist.WHITELIST) is set
assert len(whitelist._whitelist) > 4
assert type(whitelist._whitelist) is set
assert whitelist._whiteli... | Python | 0.000122 | @@ -533,28 +533,29 @@
ist.add(
-TimeoutError
+BaseException
, System
@@ -661,20 +661,21 @@
-TimeoutError
+BaseException
, Sy
|
f000504c624e3b07a0df4c823a2f422dc1294ed9 | fix test case | testss/test_training.py | testss/test_training.py | import os
from unittest import TestCase
from mlimages.model import LabelFile, ImageProperty
import testss.env as env
class TestLabel(TestCase):
def test_make_mean(self):
lf = self.get_label_file()
mean_image_file = os.path.join(os.path.dirname(lf.path), "mean_image.png")
imp = ImageProper... | Python | 0.000022 | @@ -63,19 +63,8 @@
port
- LabelFile,
Ima
@@ -74,16 +74,59 @@
roperty%0A
+from mlimages.training import TrainingData%0A
import t
@@ -202,34 +202,34 @@
(self):%0A
-lf
+td
= self.get_labe
@@ -220,34 +220,32 @@
= self.get_
-label_file
+testdata
()%0A m
@@ -282,34 +282,45 @@
os.path.dirname(
-lf
+... |
69ba0847bde12b4da61502076f633eee856ec728 | Improve get_user and get_netmask method | netadmin/shortcuts.py | netadmin/shortcuts.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Adriano Monteiro Marques
#
# Author: Piotrek Wasilewski <wasilewski.piotrek@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Sof... | Python | 0.000001 | @@ -102,46 +102,26 @@
or:
-Piotrek Wasilewski %3Cwasilewski.piotrek
+Amit Pal %3Camix.pal
@gma
@@ -2862,33 +2862,19 @@
-id_
user
- = user.id%0A obj
+_object
= U
@@ -2905,56 +2905,40 @@
d =
-id_
user
+.id
)%0A
-timezone = obj.timezone%0A return
+return user_object.
time
@@ -2979,39 +2979,49 @... |
4b2ec461badcfcc7f25ec66856b8cfc4fa064106 | Fix BrowserTest on content shell. | tools/telemetry/telemetry/core/browser_unittest.py | tools/telemetry/telemetry/core/browser_unittest.py | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import unittest
from telemetry.core import browser_finder
from telemetry.test import options_for_unittests
class BrowserTest(un... | Python | 0.000635 | @@ -2534,24 +2534,150 @@
teBrowser()%0A
+ if not b.supports_tab_control:%0A logging.warning('Browser does not support tab control, skipping test.')%0A return%0A
existing
@@ -3510,32 +3510,158 @@
CreateBrowser()%0A
+ if not b.supports_tab_control:%0A logging.warning('Browser does not support ... |
eadec2e53404407a7f40df483d1f3d75b599a667 | Fix PID location | cax/main.py | cax/main.py | from cax.tasks import checksum, clear, copy
import os
import sys
import logging
import time
from cax.config import password
import daemonocle
def main2():
password() # Check password specified
logging.basicConfig(filename='example.log',
level=logging.DEBUG,
fo... | Python | 0.000004 | @@ -880,16 +880,106 @@
pidfile=
+os.path.join(os.path.expanduser(%22~%22),%0A
'cax.pid
@@ -980,16 +980,17 @@
ax.pid')
+)
%0A dae
|
61cb2f72d94e8bd771e3130d68f753513e5818d5 | Add lstrip, rstrip, strip methods | ansi_str.py | ansi_str.py | import re
_ansi_re = re.compile('\033\[((?:\d|;)*)([a-zA-Z])')
def strip_ansi(value):
return _ansi_re.sub('', value)
def len_exclude_ansi(value):
return len(strip_ansi(value))
class ansi_str(str):
"""A str subclass, specialized for strings containing ANSI escapes.
When you call the ``len`` metho... | Python | 0 | @@ -1125,16 +1125,251 @@
self)%0A%0A
+ def lstrip(self):%0A return ansi_str(super(ansi_str, self).lstrip())%0A%0A def rstrip(self):%0A return ansi_str(super(ansi_str, self).rstrip())%0A%0A def strip(self):%0A return ansi_str(super(ansi_str, self).strip())%0A%0A
%0Aif __na
|
bc2c1a9d4c060242db1273e9608c629b2e0243cc | Fix _version.py | thermostate/_version.py | thermostate/_version.py | """The version of thermohw."""
from typing import Tuple
__version_info__: Tuple[int, int, int, str] = (0, 4, 1, 'dev0')
__version__ = '.'.join([str(v) for v in __version_info__ if str(v)])
| Python | 0.998479 | @@ -28,50 +28,53 @@
%22%22%22%0A
-from typing import Tuple%0A%0A__version_info__
+%0A__version_info__ = (0, 4, 1, 'dev0') # type
: Tu
@@ -96,36 +96,16 @@
nt, str%5D
- = (0, 4, 1, 'dev0')
%0A__versi
|
556e0e3474e379427a08e1646274f596c7e4e5ef | Remove unused but circular import | angular_flask/models.py | angular_flask/models.py | from datetime import datetime
from angular_flask import db
from angular_flask import app
class Wig(db.Model):
id = db.Column(db.Integer, primary_key=True)
span = db.Column(db.String)
def __repr__(self):
return "Wig: {}".format(self.id)
class WigValue(db.Model):
id = db.Column(db.Integer, pr... | Python | 0 | @@ -2,93 +2,31 @@
rom
-datetime import datetime%0A%0Afrom angular_flask import db%0Afrom angular_flask import app%0A
+angular_flask import db
%0A%0Acl
|
1b9fe5a4c138c9d4a1f4b2cf231f52d51310acb9 | Update exit code when no datasets specified | cchecker.py | cchecker.py | #!/usr/bin/env python
from __future__ import print_function
import argparse
import sys
from compliance_checker.runner import ComplianceChecker, CheckSuite
from compliance_checker.cf.util import download_cf_standard_name_table
from compliance_checker import __version__
def main():
# Load all available checker cla... | Python | 0 | @@ -4617,25 +4617,25 @@
return
-0
+1
%0A%0A # Chec
|
01674bb349e9850b26aeae212ad77aa992f18ab5 | bump version | lava_scheduler_app/__init__.py | lava_scheduler_app/__init__.py | # Copyright (C) 2011 Linaro Limited
#
# Author: Michael Hudson-Doyle <michael.hudson@linaro.org>
#
# This file is part of LAVA Scheduler.
#
# LAVA Scheduler is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License version 3 as
# published by the Free Software... | Python | 0 | @@ -742,17 +742,17 @@
_ = (0,
-3
+4
, 0, %22fi
|
cb5a8ac1b74cdeeea5901bb22d8600ace8f5b6e1 | Allow parsing lists of dictionaries as well as dictionaries in JSON structures | tools/json_extractor.py | tools/json_extractor.py | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Copyright (c) 2013-2016 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without ... | Python | 0.000003 | @@ -1604,30 +1604,386 @@
-result = result%5Bfield%5D
+if type(result) == dict:%0A result = result%5Bfield%5D%0A elif type(result) == list:%0A field_parts = field.split('=')%0A field_name = field_parts%5B0%5D%0A field_value = field_parts%5B1%5D%0A for e... |
df35ebdcebc8704f964d3301004fcaf88e70336f | fix filereader cd:/ replacement | tools/lib/filereader.py | tools/lib/filereader.py | import os
from tools.lib.url_file import URLFile
DATA_PREFIX = os.getenv("DATA_PREFIX", "http://data-raw.internal/")
def FileReader(fn, debug=False):
if fn.startswith("cd:/"):
fn.replace("cd:/", DATA_PREFIX)
if fn.startswith("http://") or fn.startswith("https://"):
return URLFile(fn, debug=debug)
return... | Python | 0 | @@ -176,16 +176,21 @@
/%22):%0A
+ fn =
fn.repl
|
2bf8f7beac5ee32e7cb3085da392055603ab88d6 | Fix request method | users/tests/test_api.py | users/tests/test_api.py | from django.core.urlresolvers import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from ..models import User
class UserTest(APITestCase):
"""Tests for /users/ API endpoints."""
def test_view_user_logged_out(self):
user = User.objects.create(name="Trey", email... | Python | 0.000001 | @@ -2493,10 +2493,9 @@
nt.p
-os
+u
t(ur
|
8c759f531e6a3cdc0e2b40321153147a7ec00b40 | update docstrings to reflect recent AcademicDatabase refactoring | angular_flask/classtime/academic_calendar.py | angular_flask/classtime/academic_calendar.py | import sys
import re
from academic_databases.abstract_academicdb import AcademicDatabase
class AcademicCalendar(object):
"""
Gives access to academic calendar data contained in
an LDAP server
"""
def __init__(self, institution_name):
"""
Initialize the Calendar with a database conn... | Python | 0 | @@ -132,23 +132,15 @@
-Gives access to
+Manages
aca
@@ -158,44 +158,188 @@
dar
-data contained in%0A an LDAP server
+information, including%0A terms, courses and sections.%0A%0A Connects to an institution's course database using any %0A implementation of the AcademicDatabase abstract base class.
... |
cbe7791a0276538416556a6b34769b96071e6115 | fix wfgen fail on windows | lbworkflow/flowgen/__init__.py | lbworkflow/flowgen/__init__.py | import inspect
import os
import shutil
import stat
from jinja2 import Environment
from jinja2 import FileSystemLoader
__all__ = (
'FlowAppGenerator', 'clean_generated_files'
)
def clean_generated_files(model_class):
folder_path = os.path.dirname(inspect.getfile(model_class))
for path, dirs, files in os.... | Python | 0 | @@ -4769,16 +4769,270 @@
tx=%7B%7D):%0A
+ if os.path.sep != '/':%0A # https://github.com/pallets/jinja/issues/767%0A # Jinja template names are not fileystem paths. They always use forward slashes so this is working as intended.%0A src = src.replace('%5C%5C', '/')%0A
|
2d99310234e06e8d8b2b42703e107c251e6758ad | deal with new groups being added to a user | ansible/roles/lib_zabbix/library/zbx_user.py | ansible/roles/lib_zabbix/library/zbx_user.py | #!/usr/bin/env python
'''
ansible module for zabbix users
'''
# vim: expandtab:tabstop=4:shiftwidth=4
#
# Zabbix user ansible module
#
#
# Copyright 2015 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ma... | Python | 0 | @@ -5908,56 +5908,342 @@
-if not all(%5B_ in value for _ in zab_results%5Bkey%5D
+# if the current zabbix group list is not all in the%0A # provided group list%0A # or the provided group list is not all in the current zabbix%0A # group list%0A if not all... |
ab78bf2c47a8bec5c1d0c5a7951dba1c98f5c28e | Revert file to moneymanager master branch. | check_gm.py | check_gm.py | #!/usr/bin/env python3
# vi:tabstop=4:expandtab:shiftwidth=4:softtabstop=4:autoindent:smarttab
import os, sys
import sqlite3
import urllib.request
err = False
for version in range (7, 14):
fname = 'tables_v1.sql' if version < 12 else 'tables.sql'
url = 'https://cdn.jsdelivr.net/gh/moneymanagerex/database@v%i/... | Python | 0 | @@ -1030,8 +1030,9 @@
.exit(1)
+%0A
|
40b2c9a74b8d97edec5d643de7f2c8b8d8bf08fa | Revise to class SolutionSortAndBinarySearch | lc480_sliding_window_median.py | lc480_sliding_window_median.py | """Leetcode 480. Sliding Window Median
Hard
URL: https://leetcode.com/problems/sliding-window-median/
Median is the middle value in an ordered integer list.
If the size of the list is even, there is no middle value.
So the median is the mean of the two middle value.
Examples:
[2,3,4] , the median is 3
[2,3], the ... | Python | 0 | @@ -3438,16 +3438,31 @@
tionSort
+AndBinarySearch
(object)
|
81bd4c6a7b94803e57a64f47bacbf3d5059282bd | add node | checkbst.py | checkbst.py | """
This is a very common interview question.
Given a binary tree, check whether it’s a binary
search tree or not. Simple as that..
http://www.ardendertat.com/2011/10/10/programming-interview-questions-7-binary-search-tree-check/
"""
| Python | 0.000001 | @@ -231,8 +231,111 @@
k/%0A%22%22%22%0A%0A
+class Node:%0A def __init__(self, val=None):%0A self.left, self.right, self.val = None, None, val
|
3a5b96d5d666521a97598fe9d30b8e007242f8aa | swap from published/test:compile to published/compile in CI to try and speed things up a little | ci/build.py | ci/build.py | #!/usr/bin/env python
import os
from subprocess import check_call, check_output
import json
import sys
is_master_commit = (
os.environ['TRAVIS_PULL_REQUEST'] == "false" and
os.environ['TRAVIS_BRANCH'] == "master"
)
all_versions = [
"2.10.4", "2.10.5", "2.10.6",
"2.11.3", "2.11.4", "2.11.5", "2.11.6",... | Python | 0 | @@ -2836,13 +2836,8 @@
hed/
-test:
comp
|
175bbd2f181d067712d38beeca9df4063654103a | Update script to remove extension from filename | nlppln/frog_to_saf.py | nlppln/frog_to_saf.py | #!/usr/bin/env python
import click
import os
import codecs
import json
from xtas.tasks._frog import parse_frog, frog_to_saf
@click.command()
@click.argument('input_files', nargs=-1, type=click.Path(exists=True))
@click.argument('output_dir', nargs=1, type=click.Path())
def frog2saf(input_files, output_dir):
if n... | Python | 0.000002 | @@ -615,16 +615,76 @@
plit(fi)
+%0A fname = tail.replace(os.path.splitext(tail)%5B1%5D, '')
%0A%0A
@@ -738,20 +738,21 @@
.format(
-tail
+fname
))%0A
|
5bd7d5d25b279dcc4e30673c8789f9636a546731 | Remove trailing semicolons. | tools/test_migration.py | tools/test_migration.py | #!/usr/bin/env python
import os
import re
import subprocess
import sys
db_admin_user = 'postgres'
original_db = 'original'
def info(message):
print message
def quiet_check_call(*args, **kwargs):
try:
with open('/tmp/subprocess.out', 'w') as out:
subprocess.check_call(*args,
... | Python | 0.00016 | @@ -2978,17 +2978,16 @@
t = line
-;
%0A
@@ -3231,17 +3231,16 @@
e = True
-;
%0A
|
b3426bcd217c336f8807a5474b47dea72a994eb9 | Rename `op`-parameter to `request`. | ioctl/__init__.py | ioctl/__init__.py | import ctypes
import fcntl
import sys
# In Python 2, the bytearray()-type does not support the buffer interface,
# and can therefore not be used in ioctl().
# This creates a couple of helper functions for converting to and from
if sys.version_info < (3, 0):
import array
def _to_bytearray(value):
retur... | Python | 0 | @@ -546,26 +546,31 @@
ctl_int(fd,
-op
+request
, value=0):%0A
@@ -673,18 +673,23 @@
:param
-op
+request
: The io
@@ -916,34 +916,39 @@
fcntl.ioctl(fd,
-op
+request
, res)%0A retur
@@ -977,26 +977,31 @@
_size_t(fd,
-op
+request
, value=0):%0A
@@ -1098,34 +1098,39 @@
on.%0A :param
-op
+request
: io... |
afc7429ea84a301e49d7d8ec810f3434aef16533 | Add default config | cli/main.py | cli/main.py | #! /usr/bin/python
import sys
import argparse
from cli.built_in_commands import BuildInCommand
from cli.commands import CommandList
from cli.crypto import KeyPair
from cli.exception import CliException
from cli.network import generateTransaction, sendTx, generateQuery, sendQuery
import cli.file_io as file_io
from cli... | Python | 0.000002 | @@ -5285,16 +5285,190 @@
nfig'))%0A
+%0A #%0A # if not set --config. load current directory's config.yml%0A #%0A if not self.context.loaded:%0A self.context = Context('config.yml')%0A%0A
|
e8748e5fdad15e73a363cc769858fdd420149d37 | Add missing dependencies for app_unittests for Linux (this CL is almost similar to http://codereview.chromium.org/669158, but for other testing binary. We also don't need to fix the Mac dependencies) | app/app.gyp | app/app.gyp | # Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
# TODO: remove this helper when we have loops in GYP
'apply_locales_cmd': ['python', '<(DEPTH)/build/apply_locales.py',],
... | Python | 0.000025 | @@ -2149,24 +2149,77 @@
m.gyp:gtk',%0A
+ '../chrome/chrome.gyp:packed_resources',%0A
|
0ac4fe1431fd04aa2645a4afc3d4d2fbfb21bb90 | Update plone profile: copy of black, plus three settings. | isort/profiles.py | isort/profiles.py | """Common profiles are defined here to be easily used within a project using --profile {name}"""
from typing import Any, Dict
black = {
"multi_line_output": 3,
"include_trailing_comma": True,
"force_grid_wrap": 0,
"use_parentheses": True,
"ensure_newline_before_comments": True,
"line_length": 8... | Python | 0 | @@ -883,30 +883,65 @@
,%0A%7D%0Aplone =
-%7B%0A
+black.copy()%0Aplone.update(%0A %7B%0A
+
%22force_alpha
@@ -953,32 +953,36 @@
al_sort%22: True,%0A
+
%22force_singl
@@ -992,32 +992,36 @@
ine%22: True,%0A
+
+
%22lines_after_imp
@@ -1038,29 +1038,11 @@
-%22line_length%22: 200,%0A... |
df7b391d3c02471a2095170ee83c9de4586930e7 | Fix lint | torchtext/data/field.py | torchtext/data/field.py | from collections import Counter, OrderedDict
import six
import torch
from torch.autograd import Variable
from .dataset import Dataset
from .pipeline import Pipeline
from .utils import get_tokenizer
from ..vocab import Vocab
class Field(object):
"""Defines a datatype together with instructions for converting to T... | Python | 0.000032 | @@ -4318,17 +4318,16 @@
and not
-
%0A
|
0a4da4bc40813362b9d6c67c2fb02f33a807f3fe | fix error on tax view | l10n_it_account/__openerp__.py | l10n_it_account/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2010-2013 Associazione OpenERP Italia
# (<http://www.openerp-italia.org>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero ... | Python | 0 | @@ -2166,34 +2166,32 @@
ew.xml',%0A
- #
'account/accoun
|
87c2cf3f8f8ea2e890aa648d33e93e051632e86d | change billets | totvserprm/financial.py | totvserprm/financial.py | # -*- coding: utf-8 -*-
from datetime import datetime
from baseapi import BaseApi
class Client(BaseApi):
dataservername = 'FinCFODataBR'
def create(self,**kwargs):
# codigo de coligada para o contexto, diferente do dataset
codcoligada_contexto = kwargs.get('codcoligada_contexto')
if no... | Python | 0.000001 | @@ -171,241 +171,8 @@
s):%0A
- # codigo de coligada para o contexto, diferente do dataset%0A codcoligada_contexto = kwargs.get('codcoligada_contexto')%0A if not codcoligada_contexto:%0A codcoligada_contexto = kwargs.get('codcoligada')%0A%0A
@@ -1555,32 +1555,44 @@
GADA=%7B%7D'.f... |
9cce47d37f6e2d08a66b9deedfc6f2f74b02720a | add int validator | tpl/prompt/validator.py | tpl/prompt/validator.py | # -*- coding:utf-8 -*-
from prompt_toolkit.validation import Validator, ValidationError
class StrValidator(Validator):
def validate(self, document):
pass
| Python | 0.00002 | @@ -164,10 +164,290 @@
pass%0A%0A%0A
+class IntValidator(Validator):%0A def validate(self, document):%0A text = document.text%0A for index, char in enumerate(text):%0A if not char.isdigit():%0A raise ValidationError(message='Input contains non-numeric char', cursor_position=... |
c72db8781d2ca5968a9f09dff467d1f7fcd1aa34 | Fix compatibility with Python 2 | matplotlib_scalebar/dimension.py | matplotlib_scalebar/dimension.py | """"""
# Standard library modules.
from operator import itemgetter
import bisect
# Third party modules.
# Local modules.
# Globals and constants variables.
_PREFIXES_FACTORS = {'Y': 1e24, 'Z': 1e21, 'E': 1e18, 'P': 1e15, 'T': 1e12,
'G': 1e9, 'M': 1e6, 'k': 1e3, 'd': 1e-1, 'c': 1e-2,
... | Python | 0.000067 | @@ -2385,32 +2385,55 @@
:%0A super(
+SILengthDimension, self
).__init__('m')%0A
@@ -2432,16 +2432,16 @@
__('m')%0A
-
@@ -2731,32 +2731,65 @@
:%0A super(
+SILengthReciprocalDimension, self
).__init__('1/m'
@@ -3127,32 +3127,32 @@
__init__(self):%0A
-
super().
@@ -3149,16 +3149,45 @... |
4f73601c843ff9507064b85ddd33179af9fed653 | Raise stderr message | utils/unfiltered_pbf.py | utils/unfiltered_pbf.py | # -*- coding: utf-8 -*-
import logging
import os
from string import Template
from subprocess import PIPE, Popen
from .artifact import Artifact
from .osm_xml import OSM_XML
LOG = logging.getLogger(__name__)
class InvalidOsmXmlException(Exception):
pass
class UnfilteredPBF(object):
name = 'full_pbf'
de... | Python | 0.00001 | @@ -1130,147 +1130,8 @@
rr:%0A
- LOG.warn('Failed: %25s', stderr)%0A with open(self.input_xml, 'rb') as fd:%0A sample = fd.readlines(8)%0A
@@ -1172,13 +1172,13 @@
on(s
-ample
+tderr
)%0A%0A
|
aaee820075b150b641e511dbdb45e6d1ff3da529 | Update description of function attibute in class SchemaIndicatorType | api/schema_indicator.py | api/schema_indicator.py | from database.model_indicator import ModelIndicatorType, ModelIndicator, ModelIndicatorParameterType, ModelIndicatorParameter, ModelIndicatorResult
from graphene_sqlalchemy import SQLAlchemyObjectType
import graphene
import logging
# Load logging configuration
log = logging.getLogger(__name__)
class AttributeIndicat... | Python | 0 | @@ -3589,16 +3589,33 @@
ion
+of the framework
used to
exec
@@ -3610,20 +3610,20 @@
used to
-exec
+comp
ute this
@@ -3627,16 +3627,8 @@
his
-type of
indi
@@ -3628,24 +3628,29 @@
is indicator
+ type
.%22)%0A%0A%0Aclass
|
451e20818c7fbcc0b45500c71c5c5beee96eb316 | update jaxlib | jaxlib/version.py | jaxlib/version.py | # Copyright 2019 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 0 | @@ -593,7 +593,7 @@
.1.1
-6
+7
%22%0A
|
1c15d302c2a1df22b4dd89f3215decf141a4c20e | return None if there is an error during scan | abilian/services/antivirus/__init__.py | abilian/services/antivirus/__init__.py | # coding=utf-8
"""
"""
from __future__ import absolute_import
try:
import clamd
cd = clamd.ClamdUnixSocket()
CLAMD_AVAILABLE = True
except ImportError:
CLAMD_AVAILABLE = False
from abilian.core.models.blob import Blob
from ..base import Service
class AntiVirusService(Service):
"""
Antivirus service
""... | Python | 0.998415 | @@ -1342,16 +1342,34 @@
repr(e))
+%0A return None
%0A%0A if
|
8e10657f94023a69967345114ee221c8d579c05d | Fix error with new issue while not login. | trackit/issues/views.py | trackit/issues/views.py | from django.shortcuts import render, get_object_or_404, redirect
from .models import Ticket, Label, User, Comment
import hashlib
# Create your views here.
def home(request):
issue = Ticket.objects.filter().order_by('-id')
readit = []
for i in issue:
issue_get = {}
issue_get['id'] = i.id
... | Python | 0 | @@ -1266,32 +1266,43 @@
ST':%0A if
+'login' in
request.session%5B
@@ -1296,33 +1296,24 @@
uest.session
-%5B'login'%5D
:%0A
|
bb295c5235a6d938ae5f1228c663ba84c3b35205 | Use named parameters for redis setex | authmodules/apache2/privacyidea_apache.py | authmodules/apache2/privacyidea_apache.py | # -*- coding: utf-8 -*-
#
# 2015-06-04 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# Initial writeup
#
# (c) Cornelius Kölbel
# Info: http://www.privacyidea.org
#
# This code is free software; you can redistribute it and/or
# modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
# Licens... | Python | 0.000001 | @@ -2202,32 +2202,38 @@
rd.setex(key,
+value=
_generate_digest
@@ -2236,32 +2236,37 @@
gest(password),
+time=
TIMEOUT)%0A
@@ -3056,16 +3056,22 @@
ex(key,
+value=
_generat
@@ -3090,16 +3090,21 @@
sword),
+time=
TIMEOUT)
|
7e4b66fe3df07afa431201de7a5a76d2eeb949a1 | Fix django custom template tag importing | app/main.py | app/main.py | #!/usr/bin/env python
from env_setup import setup_django
setup_django()
from env_setup import setup
setup()
from webapp2 import RequestHandler, Route, WSGIApplication
from agar.env import on_production_server
from agar.config import Config
from agar.django.templates import render_template
class MainApplicationConf... | Python | 0.000001 | @@ -16,20 +16,22 @@
python%0A%0A
-from
+import
env_set
@@ -36,29 +36,39 @@
etup
- import setup_django%0A
+; env_setup.setup(); env_setup.
setu
@@ -82,42 +82,95 @@
o()%0A
+%0A
from
-env_setup import setup%0Asetup(
+django.template import add_to_builtins%0Aadd_to_builtins('agar.django.templatetags'
)%0A%0Af
|
3c6a6e3a8f99f580d10366307e34031aa81ac344 | Exclude disabled widgets from bundles | app/main.py | app/main.py | #!/usr/bin/env python
import json
import logging
import os
import Queue
import SocketServer
from apscheduler.scheduler import Scheduler
from datetime import datetime, timedelta
from flask import Flask, render_template, Response, request, abort
from flask.ext.assets import Environment, Bundle
from flask.templating impo... | Python | 0 | @@ -1137,16 +1137,182 @@
_path):%0A
+ if not _is_enabled(widget):%0A app.logger.info('Excluding disabled widget from bundle: %25s',%0A widget)%0A continue%0A
|
b8d3a008dfb8203b7cda276f03148bf34daf20be | store the job after changing the state | account_move_batch_validate/account.py | account_move_batch_validate/account.py | # -*- coding: utf-8 -*-
###############################################################################
# #
# Author: Leonardo Pistone
# Copyright 2014 Camptocamp SA
# ... | Python | 0.000005 | @@ -3809,16 +3809,51 @@
))
+%0A storage.store(job)
%0A%0A de
|
35c52ecbe34611f003d8f647dafdb15c00d70212 | update doc | python/git_pull_codedir/git_pull_codedir.py | python/git_pull_codedir/git_pull_codedir.py | # -*- coding: utf-8 -*-
#!/usr/bin/python
##-------------------------------------------------------------------
## @copyright 2017 DennyZhang.com
## Licensed under MIT
## https://raw.githubusercontent.com/DennyZhang/devops_public/master/LICENSE
##
## File : git_pull_codedir.py
## Author : Denny <denny@dennyzhang.com>... | Python | 0 | @@ -401,17 +401,17 @@
03-2
-4 15:51:0
+7 18:10:4
4%3E%0A#
@@ -1298,24 +1298,16 @@
hon
-perform_
git_pull
.py
@@ -1302,16 +1302,24 @@
git_pull
+_codedir
.py --co
|
6039be54e9fd79ac3916a50de6ab554aa1355bde | disable debug mode | sources/opsagent/config.py | sources/opsagent/config.py | '''
VisualOps agent configuration manager class
(c) 2014 - MadeiraCloud LTD.
@author: Thibault BRONCHAIN
'''
# System imports
import ConfigParser
from ConfigParser import SafeConfigParser
from copy import deepcopy
import sys
import os
import re
# Custon imports
from opsagent.exception import ConfigFileFormatExcepti... | Python | 0.000001 | @@ -1504,17 +1504,16 @@
'root',%0A
-#
@@ -1534,16 +1534,17 @@
'INFO',%0A
+#
|
3ab5586ec4ac9ff3ac3fd7583bc9a71c7b5cd27a | fix lockedNormal, use MItMeshPolygon instead of MItMeshVertex, fix Fix() fucntion | python/medic/plugins/Tester/lockedNormal.py | python/medic/plugins/Tester/lockedNormal.py | from medic.core import testerBase
from maya import OpenMaya
class LockedNormal(testerBase.TesterBase):
Name = "LockedNormal"
Description = "vertex(s) which has locked normal"
Fixable = True
def __init__(self):
super(LockedNormal, self).__init__()
def Match(self, node):
return nod... | Python | 0 | @@ -457,30 +457,31 @@
Maya.MItMesh
-Vertex
+Polygon
(node.object
@@ -597,325 +597,269 @@
-result = False%0A%0A comp = OpenMaya.MFnSingleIndexedComponent()%0A comp_obj = comp.create(OpenMaya.MFn.kMeshVertComponent)%0A%0A while (not it.isDone()):%0A normal_indices = OpenMaya.MIntAr... |
e74b4867f9067e28686aecd19eb6f1d352ee28bf | fix imports | game.py | game.py | import random
from characters import guests as people
from adventurelib import Item, Bag, when, start
import rooms
import characters
from sys import exit
murder_config_people = list(people)
random.shuffle(murder_config_people)
murder_location = random.choice(list(rooms.rooms))
murderer = random.choice(list(people))
... | Python | 0.000002 | @@ -75,19 +75,8 @@
port
- Item, Bag,
whe
@@ -101,26 +101,8 @@
oms%0A
-import characters%0A
from
@@ -120,17 +120,16 @@
exit%0A%0A%0A
-%0A
murder_c
|
38f682604b7ed69799cc795eaead631dbd384c7e | allow ttl of 0 | nsone/rest/records.py | nsone/rest/records.py | #
# Copyright (c) 2014 NSONE, Inc.
#
# License under The MIT License (MIT). See LICENSE in project root.
from . import resource
class Records(resource.BaseResource):
ROOT = 'zones'
def _buildBody(self, zone, domain, type, answers, ttl=None):
body = {}
body['zone'] = zone
body['domai... | Python | 0.002377 | @@ -394,32 +394,44 @@
s%0A if ttl
+ is not None
:%0A bo
|
aaba085cd2e97c8c23e6724da3313d42d12798f0 | Make sure request.user is a user | app/grandchallenge/annotations/validators.py | app/grandchallenge/annotations/validators.py | from rest_framework import serializers
from django.conf import settings
def validate_grader_is_current_retina_user(grader, context):
"""
This method checks if the passed grader equals the request.user that is passed in the context.
Only applies to users that are in the retina_graders group.
"""
re... | Python | 0.999944 | @@ -351,23 +351,90 @@
%0A if
-request
+(%0A request is not None%0A and request.user is not None%0A
and req
@@ -459,16 +459,22 @@
nticated
+%0A )
:%0A
|
445740ee2630eca017b4899b96fef8ffeda0e7ea | update gist extension | gist.py | gist.py | """
This is the gist share button,
and a %gist magic, as a Python extension.
You can also get just the gist button without this extension by adding
the contents of gist.js to static/js/custom.js in your profile.
This code requires that you have the jist rubygem installed and properly configured.
"""
gist_js = r"""
... | Python | 0 | @@ -2293,11 +2293,10 @@
play
-, J
+_j
avas
@@ -2324,34 +2324,34 @@
''):%0A display
-(J
+_j
avascript(%22IPyth
@@ -2373,17 +2373,26 @@
ebook()%22
-)
+, raw=True
)%0A%0Adef l
@@ -2433,10 +2433,10 @@
play
-(J
+_j
avas
@@ -2448,17 +2448,26 @@
(gist_js
-)
+, raw=True
)%0A ip
|
9108f24183b2743647a8ed3ab354673e945d5f2a | Update release number | mailparser_version/__init__.py | mailparser_version/__init__.py | __version__ = "1.0.0"
| Python | 0.000001 | @@ -10,13 +10,13 @@
__ = %221.
-0
+1
.0%22%0A
|
7634094e838cb3ac8241519016727f339e7905be | change timezone to Asia/Seoul | django/ams2/settings.py | django/ams2/settings.py | """
Django settings for ams2 project.
Generated by 'django-admin startproject' using Django 1.11.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
im... | Python | 0.012527 | @@ -4917,11 +4917,18 @@
= '
-UTC
+Asia/Seoul
'%0A%0AU
|
7e457272b4e9d3b0de1bb0fc0cbf8b6bae4dc911 | add test scrip | test_rsn.py | test_rsn.py | #!/usr/bin/env python
import argparse
import logging
from prettytable import PrettyTable
from dns.flags import DO
from dns.resolver import query, Resolver
class RsnServer(object):
def __init__(self, server):
self.logger = logging.getLogger('RsnServer')
self.server = server
... | Python | 0.000001 | @@ -232,21 +232,16 @@
er
-
= loggin
@@ -290,21 +290,16 @@
er
-
= server
@@ -316,37 +316,32 @@
elf.ipv4
-
-
= query(self.ser
@@ -386,21 +386,16 @@
-
= query(
@@ -451,21 +451,16 @@
lver
-
= Resolv
@@ -463,16 +463,45 @@
solver()
+%0A self.round_tr... |
8128791c5b4cb8d185ceb916df2b6aa896f17453 | add test for custom ylabels | test_run.py | test_run.py | #! /usr/bin/env python
# Load Libraries
import matplotlib as mpl
mpl.use('SVG')
import matplotlib.pyplot as plt
# %matplotlib inline
import seaborn as sns
sns.set(style='ticks',context='talk')
import bootstrap_contrast as bsc
import pandas as pd
import numpy as np
import scipy as sp
# Dummy dataset
dataset=list()
f... | Python | 0 | @@ -1176,16 +1176,109 @@
t=True,%0A
+ swarm_label='my swarm',%0A contrast_label='contrast',%0A
|
0ca45e92a92e71d080af6e2104f4f625e31559f0 | Tweak mysql query string in test. | blaze/compute/tests/test_mysql_compute.py | blaze/compute/tests/test_mysql_compute.py | from __future__ import absolute_import, print_function, division
from getpass import getuser
import pytest
sa = pytest.importorskip('sqlalchemy')
pytest.importorskip('pymysql')
from odo import odo, drop, discover
import pandas as pd
import numpy as np
from blaze import symbol, compute
from blaze.utils import exam... | Python | 0 | @@ -1281,27 +1281,8 @@
%3C %25
-(passenger_count_1)
s) a
|
20d9128d48a1a1f157a02ffe0bea9a5796f69242 | fix fleet-enable fleet-disable | jsb/plugs/core/fleet.py | jsb/plugs/core/fleet.py | # jsb/plugs/fleet.py
#
#
"""
The fleet makes it possible to run multiple bots in one running instance.
It is a list of bots.
"""
## jsb imports
from jsb.lib.config import Config
from jsb.lib.threads import start_new_thread
from jsb.lib.fleet import getfleet, FleetBotAlreadyExists
from jsb.lib.commands impo... | Python | 0.000076 | @@ -1246,32 +1246,295 @@
-fleet.enable(bot, ievent
+cfg = Config('fleet' + os.sep + stripname(botname) + os.sep + 'config')%0A cfg%5B'disable'%5D = 0%0A cfg.save()%0A bot = fleet.makebot(cfg.type, cfg.name, cfg)%0A ievent.reply('enabled and started %25s bot' %25 name)%0... |
a6c4540877e00df93fb5de3ce76e3a7393c1c587 | Change notes. | timegaps.py | timegaps.py | # -*- coding: utf-8 -*-
# Copyright 2014 Jan-Philip Gehrcke. See LICENSE file for details.
"""
Feature brainstorm:
- reference implementation with cmdline interface
- comprehensive API for systematic unit testing and library usage
- remove or move or noop mode
- extensive logging
- parse mtime fro... | Python | 0 | @@ -494,39 +494,230 @@
din%0A
-%0ATODO:%0A - rename to timegaps
+ - add a mode where time-encoding nullchar-separated strings are read as%0A input and then filtered. The output is a set of rejected strings (no%0A involvement of the file system at all, just timestamp filtering)%0A
%0A%22%22%22
|
ede42576daca2f4ea3ede8fa92852c623ede5196 | fix typo - do not try to catch socket.errno :) | lib/exaproxy/network/poller.py | lib/exaproxy/network/poller.py | #!/usr/bin/env python
# encoding: utf-8
"""
server.py
Created by Thomas Mangin on 2011-11-30.
Copyright (c) 2011 Exa Networks. All rights reserved.
"""
# http://code.google.com/speed/articles/web-metrics.html
import os
import struct
import time
import socket
import errno
import select
from exaproxy.util.logger impo... | Python | 0 | @@ -2042,35 +2042,79 @@
xcept socket.err
-no:
+or:%0A%09%09%09%09print %22CANNOT POLL (read): %25s%22 %25 str(f)
%0A%09%09%09%09logger.erro
@@ -2241,11 +2241,56 @@
.err
-no:
+or:%0A%09%09%09%09print %22CANNOT POLL (write): %25s%22 %25 str(f)
%0A%09%09%09
|
b30854cb21e10f1d9496750737250da7ad02ad38 | add 'list' function | datapath/vhd/tapdisk.py | datapath/vhd/tapdisk.py | #!/usr/bin/env python
import os
import signal
import xapi
import commands
def log(txt):
print >>sys.stderr, txt
# [run dbg cmd] executes [cmd], throwing a BackendError if exits with
# a non-zero exit code.
def run(dbg, cmd):
code, output = commands.getstatusoutput(cmd)
if code <> 0:
log("%s: %s e... | Python | 0 | @@ -876,16 +876,19 @@
nor, pid
+, f
):%0A
@@ -932,16 +932,35 @@
d = pid%0A
+ self.f = f%0A
def
@@ -1043,32 +1043,86 @@
nor, self.pid))%0A
+ run(dbg, %22tap-ctl free -m %25d%22 %25 (self.minor))%0A
def close(se
@@ -1198,24 +1198,46 @@
self.pid))%0A
+ self.f = None%0A
def o... |
4bc436ac4d441987d602b3af10517125c78c56e0 | remove use of BeautifulSoup from parse_paragraph_as_list | lib/parse_paragraph_as_list.py | lib/parse_paragraph_as_list.py | from bs4 import BeautifulSoup
def parse_paragraph_as_list(string_with_br):
strings = BeautifulSoup(string_with_br, 'html.parser').strings
splitted = [' '.join(s.split()).strip() for s in strings]
return [s for s in splitted if s]
| Python | 0.000006 | @@ -1,36 +1,4 @@
-from bs4 import BeautifulSoup%0A%0A%0A
def
@@ -46,131 +46,108 @@
-strings = BeautifulSoup(string_with_br, 'html.parser').strings%0A splitted = %5B' '.join(s.split()).strip() for s in strings
+paragraph = ' '.join(string_with_br.split())%0A lines = %5Bs.strip() for s in paragraph.split('%... |
ac6ce056e6b05531d81c550ae3e1e1d688ece4a0 | Make serializer commet more clear | jwt_auth/serializers.py | jwt_auth/serializers.py | from .models import User
from rest_framework import serializers
class UserSerializer(serializers.ModelSerializer):
password = serializers.CharField(max_length=20, min_length=8, trim_whitespace=False, write_only=True)
class Meta:
model = User
fields = ('id', 'nickname', 'username', 'email', 'pa... | Python | 0.000001 | @@ -328,16 +328,29 @@
)%0A%0A #
+ serializer's
default
@@ -366,16 +366,21 @@
method
+will
call %60mo
@@ -394,24 +394,30 @@
ects.create%60
+%0A #
method to c
@@ -434,22 +434,17 @@
instance
-%0A #
+,
overrid
@@ -461,32 +461,33 @@
e user correctly
+.
%0A def create(
|
b7a84ce7f0049229693fe12bf7a8bb1a7177d3b6 | convert values to float before multiplying with pi | django_geo/distances.py | django_geo/distances.py | import math
class distances:
@staticmethod
def geographic_distance(lat1, lng1, lat2, lng2):
lat1 = (lat1 * math.pi) / 180
lng1 = (lng1 * math.pi) / 180
lat2 = (lat2 * math.pi) / 180
lng2 = (lng2 * math.pi) / 180
a = (math.sin(lat1)*math.sin(lat2))+(math.cos(lat1)*math.cos(lat2)*math.cos(lng2 - lng1))
retu... | Python | 0.000001 | @@ -87,16 +87,124 @@
lng2):%0A
+ lat1 = float(lat1)%0A lng1 = float(lng1)%0A lat2 = float(lat2)%0A lng2 = float(lng2)%0A
%09%09lat1 =
|
fdd74bdf3d41ee8c54b5590669e3bb96a195df88 | Normalize URI from configuration keys. | aversion.py | aversion.py | # Copyright 2013 Rackspace
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | Python | 0 | @@ -618,16 +618,57 @@
cense.%0A%0A
+import re%0A%0A%0ASLASH_RE = re.compile('/+')%0A%0A
%0Aclass T
@@ -3955,16 +3955,368 @@
ion'))%0A%0A
+ @staticmethod%0A def _uri_normalize(uri):%0A %22%22%22%0A Normalize a URI. Multiple slashes are collapsed into a single%0A '/', a leading '/' is added... |
9dfb1fb01054b689e53b5f76a16c469a21bcf8e5 | Update bias.py | bcn/bias.py | bcn/bias.py | """Bias generation.
Notes
-----
Defines two classes that can generate different types of bias and a bias guess function.
"""
from __future__ import division, absolute_import
import numpy as np
from skimage.transform import resize
from skimage.io import imread
from sklearn.datasets import make_checkerboard
from pyman... | Python | 0.000001 | @@ -3592,18 +3592,16 @@
X =
-im
resize(X
|
0d5f4a62e1e2bbe49f7148801f11130686da1c37 | Update sge.py | libsubmit/providers/sge/sge.py | libsubmit/providers/sge/sge.py | import os
import pprint
import math
import json
import time
import logging
import atexit
from datetime import datetime, timedelta
from string import Template
from libsubmit.providers.provider_base import ExecutionProvider
from libsubmit.launchers import Launchers
from libsubmit.error import *
from libsubmit.providers.a... | Python | 0.000001 | @@ -351,25 +351,8 @@
ring
-%0Aimport xmltodict
%0A%0Alo
@@ -403,19 +403,30 @@
import
-os%0A
+xmltodict%0A
%0Aexcept
|
4259019196c473431d4291f2910ab0164e319ffb | update simu.py for 0.3.0. | bin/simu.py | bin/simu.py | #!/usr/bin/env python3
import sys
import os
import traceback
import logging
import profile
from subprocess import call, check_call, check_output
ROOT_DIR = './'
TEST_DIR = ROOT_DIR+'tests'
TMP_DIR = ROOT_DIR+'.tmp'
sys.path.append(ROOT_DIR)
from polyphony.compiler.__main__ import compile_main, logging_setting
from po... | Python | 0 | @@ -65,101 +65,75 @@
ort
-logging%0Aimport profile%0Afrom subprocess import call, check_call, check_output%0A%0AROOT_DIR = './'
+subprocess%0A%0AIVERILOG_PATH = 'iverilog'%0AROOT_DIR = '.' + os.path.sep
%0ATES
@@ -148,17 +148,19 @@
ROOT_DIR
-+
+ +
'tests'%0A
@@ -178,17 +178,19 @@
ROOT_DIR
-+
+ +
'.tmp'%0As
@@ ... |
fd9a553868ce46ceef2b23e79347dd262b63ebae | fix build instructions on Linux | binding.gyp | binding.gyp | { "targets": [ {
"target_name": "bindings",
"variables": {
"raptor_prefix": "/usr/local"
},
"include_dirs": [
"<(raptor_prefix)/include/raptor2"
],
"sources": [
"src/bindings.cc",
"src/parser.cc",
"src/parser_wrapper.cc",
"src/serializer.cc",
... | Python | 0.000001 | @@ -45,72 +45,8 @@
s%22,%0A
- %22variables%22: %7B%0A %22raptor_prefix%22: %22/usr/local%22%0A %7D,%0A
@@ -427,101 +427,8 @@
%5D,%0A
- %22cflags!%22: %5B %22-fno-exceptions%22 %5D,%0A %22cflags_cc!%22: %5B %22-std=c++11%22, %22-fno-exceptions%22 %5D,%0A
@@ -509,26 +509,24 @@
ions%22: ... |
2f924fc35d0724e7638e741fd466228649077e10 | Update action_after_build destination | binding.gyp | binding.gyp | {
'includes': [ 'deps/common-libzip.gypi' ],
'variables': {
'shared_libzip%':'false',
'shared_libzip_includes%':'/usr/lib',
'shared_libzip_libpath%':'/usr/include'
},
'targets': [
{
'target_name': 'node_zipfile',
'conditions': [
['shared_libzip == "false"', {
... | Python | 0.000002 | @@ -995,24 +995,32 @@
on': './lib/
+binding/
'%0A
|
2f23ce76bfc32022cea41d675d762dfbbde3fed7 | Fix a typo | home.py | home.py | #!/usr/bin/env python
import time
import sys
import json
import types
import thread
from messenger import Messenger
import config
import led
import dht
import stepper_motor
def turn_on_living_light(freq, dc):
print('turn_on_living_light: %d, %d' % (freq, dc))
led.turn_on(config.LED_LIVING, freq, dc)
def turn... | Python | 1 | @@ -2360,24 +2360,33 @@
report_ht(
+messenger
)%0A ti
|
c2ed0cbbbd2d88e9db56c03da30533fff8018539 | Fix key error in case submitter is not set. | document/models.py | document/models.py | from django.db import models
import scraper.documents
class Dossier(models.Model):
dossier_id = models.CharField(max_length=100, blank=True, unique=True)
def __str__(self):
return str(self.dossier_id)
def documents(self):
return Document.objects.filter(dossier=self)
def kamerstukke... | Python | 0 | @@ -3830,16 +3830,105 @@
shed'%5D%0A%0A
+ if 'submitter' not in metadata:%0A metadata%5B'submitter'%5D = 'undefined'%0A%0A
|
c2f563215fcc62d6e595446f5acbd1969484ddb7 | move end timer command to the correct location | clean_db.py | clean_db.py | import MySQLdb, config, urllib, cgi, datetime, time
sql = MySQLdb.connect(host="localhost",
user=config.username,
passwd=config.passwd,
db=config.db)
sql.query("SELECT `id` FROM `feedurls`")
db_feed_query=sql.store_result()
rss_urls=d... | Python | 0.000001 | @@ -1028,16 +1028,62 @@
TAB);%22%0A
+ sql.query(query)%0A sql.commit()%0A
@@ -1141,54 +1141,8 @@
0))%0A
- sql.query(query)%0A sql.commit()%0A
|
505cee00e483b8899e910c7a7312928a5be840c2 | change some names | clusters.py | clusters.py | import numpy as np
import pandas as pd
from astropy.cosmology import Planck13 as cosmo
from astropy import units
import sys
sys.path.insert(1,'/Users/jesford/astrophysics/cofm') #temporary path adjust
from cofm import c_DuttonMaccio
try:
from IPython.display import display
notebook_display = True
except:
... | Python | 0.027908 | @@ -435,17 +435,24 @@
Cluster
-s
+Ensemble
():%0A
@@ -3212,11 +3212,11 @@
def
-vie
+sho
w(se
|
710dba5196fbd419c23de74e9177185e212736a1 | Update according to changes in config | tmt/util.py | tmt/util.py | import yaml
import json
import os
import re
'''Utility functions for filename and path routines.'''
def regex_from_format_string(format_string):
'''
Convert a format string of the sort "{name}_bla/something_{number}"
to a named regular expression a la "P<name>.*_bla/something_P<number>\d+".
Paramete... | Python | 0.000001 | @@ -1617,498 +1617,8 @@
)%0A%0A%0A
-def load_shift_descriptor(filename):%0A '''%0A Load shift description from JSON file.%0A%0A Parameters%0A ----------%0A filename: str%0A name of the shift descriptor file%0A%0A Returns%0A -------%0A dict%0A JSON content%0A%0A Raises%0A ---... |
dcdd4040f45546472ff012dd4830e51804a1b9e5 | Disable merchant debugging per default (to prevent logging and save disk space) | merchant_sdk/MerchantServer.py | merchant_sdk/MerchantServer.py | import json
from typing import Type
from flask import Flask, request, Response
from flask_cors import CORS
from .MerchantBaseLogic import MerchantBaseLogic
from .models import SoldOffer
def json_response(obj):
js = json.dumps(obj)
resp = Response(js, status=200, mimetype='application/json')
return resp
... | Python | 0 | @@ -506,19 +506,20 @@
debug':
-Tru
+Fals
e%0A
|
f5421cb76103bf6da4b6dce74f2ae372c892067a | Add write_revision method to Metadata | onitu/api/metadata.py | onitu/api/metadata.py | class Metadata(object):
"""The Metadata class represent the metadata of any file in Onitu.
This class should be instantiated via the
:func:`Metadata.get_by_id` or :func:`Metadata.get_by_filename`
class methods.
The PROPERTIES class property represent each property found in the
metadata common ... | Python | 0.000001 | @@ -2410,31 +2410,42 @@
lue
-will
+is
only
-be
save
+d
when
+either%0A
:fun
@@ -2455,23 +2455,57 @@
Meta
+data
.write
-%60 will be
+_revision%60 or :func:%60Metadata.write%60 is
%0A
@@ -2561,16 +2561,274 @@
value%0A%0A
+ def write_revision(self):%0A if not self._revision:%0A ... |
10b21dc62875003d33949c25b917709e1f384a65 | add memey alias for delete | cogs/tag.py | cogs/tag.py | #!/bin/env python
import discord
import asyncpg
from datetime import datetime
from discord.ext import commands
class Tag:
def __init__(self, bot):
self.bot = bot
self.pg_con = bot.pg_con
async def get_tag(self, server_id: int, tag_name: str):
""" Returns tag value or None """
qu... | Python | 0 | @@ -2321,16 +2321,25 @@
s=%5B'del'
+, 'delet'
%5D)%0A a
|
db1df21b584b4b68e74b6775932c427f04692074 | Fix comic filename. | dosagelib/comic.py | dosagelib/comic.py | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
import urllib2
import os
import locale
import rfc822
import time
from .output import out
from .util import urlopen, saneDataSize, normaliseURL
from .progress import progressBar, OperationComplete
from .events import handler
c... | Python | 0.000001 | @@ -979,24 +979,29 @@
e(self.name,
+ url,
self.parent
@@ -1004,21 +1004,16 @@
rentUrl,
- url,
filenam
@@ -1071,16 +1071,21 @@
f, name,
+ url,
referre
@@ -1086,21 +1086,16 @@
eferrer,
- url,
filenam
@@ -1281,16 +1281,19 @@
plit('/'
+, 1
)%5B1%5D%0A
@@ -2243,16 +2243,39 @@
ubtype()
+.replace('jpeg', 'jp... |
3ee4d2f80f58cb0068eaeb3b7f5c4407ce8e60d0 | add text information about progress of downloading | vk-photos-downloader.py | vk-photos-downloader.py | #!/usr/bin/python3.5
#-*- coding: UTF-8 -*-
import vk, os, time
from urllib.request import urlretrieve
token = input("Enter a token: ")
#Authorization
session = vk.Session(access_token=str(token))
vk_api = vk.API(session)
count = 0 # count of down. photos
perc = 0 # percent of down. photos
breaked =... | Python | 0 | @@ -136,16 +136,28 @@
oken: %22)
+ # vk token
%0D%0A%0D%0A#Aut
@@ -538,16 +538,72 @@
hoto%0D%0A%0D%0A
+print(%22-------------------------------------------%22)%0D%0A%0D%0A
owner_id
@@ -1071,110 +1071,137 @@
%0A%0D%0Ap
-hotos_link = %5B%5D # photos link%0D%0A%0D%0Afor i in p
+rint(%22A title of album - %7B%7D%22... |
b674bc4c369139926710311f1a3fc6ad39da9f0a | optimize code | app/xsbk.py | app/xsbk.py | # 抓取嗅事百科的段子
from cobweb.downloader import *
from cobweb.parser import *
import time
import re
def parse_joke(self):
data = self.soup.find_all('div', class_='article block untagged mb15')
self.content = []
for d in data:
soup_d = BeautifulSoup(str(d), 'html.parser', from_encoding='utf8')
# ... | Python | 0.999117 | @@ -186,16 +186,102 @@
mb15')%0A
+ content_pattern = re.compile(%22%3Cdiv.*?content%5C%22%3E(.*?)%3C!--(.*?)--%3E.*?%3C/div%3E%22, re.S)%0A
self
@@ -611,96 +611,22 @@
-pattern = re.compile(%22%3Cdiv.*?content%5C%22%3E(.*?)%3C!--(.*?)--%3E.*?%3C/div%3E%22, re.S)%0A re1 =
+re1 = content_
patt
@@ ... |
cc894ecf36a95d18fc84a4866c5a1902d291ccbe | Use non-lazy `gettext` where sufficient | byceps/blueprints/site/ticketing/forms.py | byceps/blueprints/site/ticketing/forms.py | """
byceps.blueprints.site.ticketing.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from flask import g
from flask_babel import lazy_gettext
from wtforms import StringField
from wtforms.validators import InputRequired,... | Python | 0.000092 | @@ -222,16 +222,25 @@
l import
+ gettext,
lazy_ge
@@ -245,16 +245,16 @@
gettext%0A
-
from wtf
@@ -755,37 +755,32 @@
ValidationError(
-lazy_
gettext('Unknown
@@ -887,21 +887,16 @@
onError(
-lazy_
gettext(
@@ -1325,16 +1325,16 @@
nError(%0A
+
@@ -1329,37 +1329,32 @@
or(%0A
-lazy_
gettext... |
862885b5ea2b4d04c8980c257d3cdf644dd60f0c | Set the version to 0.1.6 final | king_phisher/version.py | king_phisher/version.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/version.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this lis... | Python | 0.003887 | @@ -1792,20 +1792,16 @@
abel = '
-beta
'%0A%22%22%22A v
|
751daadea9a6946ea52db3ed48560f5afa9bfb9a | Change user_info api url | api/urls.py | api/urls.py | from django.conf.urls import url
from django.views.decorators.csrf import csrf_exempt
from rest_framework.routers import DefaultRouter
from api import views
router = DefaultRouter()
# share routes
router.register(r'extras', views.ExtraDataViewSet, base_name=views.ExtraDataViewSet.serializer_class.Meta.model._meta.mo... | Python | 0.000002 | @@ -3534,17 +3534,16 @@
l(r'user
-_
info/?',
|
2ac05a8ccc9d7a9ab4f455f18355d80af9e13c84 | add temp file context | tpl/path.py | tpl/path.py | # -*- coding:utf-8 -*-
import os
import uuid
HOME = os.path.abspath(os.path.expanduser('~'))
WORK_DIR = os.path.abspath(os.getcwd())
CWD = WORK_DIR
class TempDir(object):
pass
class TempFile(object):
pass
class TempPipe(object):
def __init__(self):
self.pipe_path = '/tmp/{}.pipe'.format(str... | Python | 0.000001 | @@ -200,36 +200,578 @@
le(object):%0A
-pass
+def __init__(self, name=None, suffix='tmp'):%0A self.path = '/tmp/%7B%7D.%7B%7D'.format(name or str(uuid.uuid4()), suffix)%0A self._fd = None%0A self._close = False%0A%0A @property%0A def fd(self):%0A if self._fd is None:%0A ... |
7c8d7a456634d15f8c13548e2cfd6be9440f7c65 | Add handler for 403 forbidden (User does not have Atmosphere access, but was correctly authenticated) | troposphere/__init__.py | troposphere/__init__.py | import logging
from flask import Flask
from flask import render_template, redirect, url_for, request
import requests
from troposphere import settings
from troposphere.cas import (cas_logoutRedirect, cas_loginRedirect,
cas_validateTicket)
from troposphere.oauth import generate_access_token... | Python | 0 | @@ -94,16 +94,23 @@
request
+, abort
%0Aimport
@@ -2029,16 +2029,29 @@
.read()%0A
+ try:%0A
toke
@@ -2087,16 +2087,20 @@
, user)%0A
+
logg
@@ -2127,24 +2127,28 @@
token)%0A
+
+
return redir
@@ -2165,30 +2165,61 @@
ck)%0A
-%0A@app.route('/no_user'
+ except:%0A abort(403)%... |
b7be60eff8e0c82741dda674824aa748e33e7fdd | convert pui.py to pywiki framework | trunk/toolserver/pui.py | trunk/toolserver/pui.py | #!usr/bin/python
# -*- coding: utf-8 -*
#
# (C) Legoktm 2008-2009, MIT License
#
import re, sys, os
sys.path.append(os.environ['HOME'] + '/pyenwiki')
import wikipedia
site = wikipedia.getSite()
page = wikipedia.Page(site, 'Wikipedia:Possibly unfree images')
wikitext = state0 = page.get()
wikitext = re.compile(r'\... | Python | 0.999999 | @@ -93,17 +93,8 @@
t re
-, sys, os
%0Asys
@@ -131,18 +131,16 @@
%5D + '/py
-en
wiki')%0Ai
@@ -153,40 +153,8 @@
wiki
-pedia%0Asite = wikipedia.getSite()
%0Apag
@@ -165,25 +165,14 @@
wiki
-pedia
.Page(
-site,
'Wik
@@ -416,21 +416,16 @@
ll'%0Awiki
-pedia
.showDif
@@ -448,37 +448,8 @@
xt)%0A
-wikipedia.setActi... |
7b3fd535b7622a9c4253aa80276e05ed83f8177e | Fix app name error | txmoney/rates/models.py | txmoney/rates/models.py | # coding=utf-8
from __future__ import absolute_import, unicode_literals
from datetime import date
from decimal import Decimal
from django.db import models
from django.utils.functional import cached_property
from ..settings import txmoney_settings as settings
from .exceptions import RateDoesNotExist
class RateSourc... | Python | 0.000009 | @@ -544,32 +544,67 @@
class Meta:%0A
+ app_label = 'txmoneyrates'%0A
unique_t
@@ -1956,32 +1956,67 @@
class Meta:%0A
+ app_label = 'txmoneyrates'%0A
unique_t
|
d6029a7b2e39ff6222ca3d6788d649b14bbf35e3 | add smoother to denominator as well | trending.py | trending.py | import googleanalytics as ga
import collections
import numpy
import datetime
SMOOTHER = 20
WINDOW = 8
GROWTH_THRESHOLD = 0.03
def trend(counts) :
X, Y = zip(*counts)
X = numpy.array([x.toordinal() for x in X])
X -= datetime.date.today().toordinal()
A = numpy.array([numpy.ones(len(X)), X])
Y = nu... | Python | 0.000001 | @@ -122,9 +122,9 @@
0.0
-3
+2
%0A%0Ade
@@ -1171,16 +1171,17 @@
OOTHER)/
+(
totals%5Bd
@@ -1180,24 +1180,36 @@
totals%5Bdate%5D
+ + SMOOTHER)
%0A%0Afor counts
@@ -1326,16 +1326,17 @@
MOOTHER/
+(
totals%5Bd
@@ -1339,16 +1339,28 @@
ls%5Bdate%5D
+ + SMOOTHER)
%0A%0Afor pa
|
656c0f44c27f64d14dde7cbbfdec31906dab4c51 | Add params to request docs. | treq/api.py | treq/api.py | from treq.client import HTTPClient
def head(url, **kwargs):
"""
Make a ``HEAD`` request.
See :py:func:`treq.request`
"""
return _client(**kwargs).head(url, **kwargs)
def get(url, headers=None, **kwargs):
"""
Make a ``GET`` request.
See :py:func:`treq.request`
"""
return _cl... | Python | 0 | @@ -1218,32 +1218,279 @@
eaders or None%0A%0A
+ :param params: Optional paramters to be append as the query string to%0A the URL, any query string parameters in the URL already will be%0A preserved.%0A%0A :type params: dict w/ str or list of str values, list of 2-tuples, or None.%0A%0A
:param ... |
5af3ba58fcaf35e22925b3b7cf8c935e19a10038 | Split up configuration-getting logic. | dreamssh/config.py | dreamssh/config.py | from ConfigParser import SafeConfigParser
import os
from zope.interface import moduleProvides
from dreamssh import meta
from dreamssh.sdk import interfaces
moduleProvides(interfaces.IConfig)
class Config(object):
pass
# Main
main = Config()
main.config = Config()
main.config.userdir = os.path.expanduser("~/... | Python | 0.000001 | @@ -2388,16 +2388,268 @@
gFile)%0A%0A
+ def getConfig(self):%0A configFile = self.getConfigFile()%0A if not os.path.exists(configFile):%0A self.writeDefaults()%0A return%0A config = SafeConfigParser()%0A config.read(configFile)%0A return config%0A
%0A def... |
0ba512b0e8eb6b5055261afb2962d3bfc5e2fda5 | Add some playback stream headers | src/playback.py | src/playback.py | # -*- coding: utf-8 -*-
import mimetypes
import os
from flask import Response, request
import audiotranscode
from tables import Song
import config
def stream_audio():
song = Song.get_one(id=request.args.get('id'))
# A hack to get my local dev env working
path = song.path
if config.DEBUG:
c... | Python | 0 | @@ -86,30 +86,112 @@
est%0A
-import audiotranscode%0A
+from werkzeug.datastructures import Headers%0Aimport audiotranscode%0A%0Afrom utils import generate_random_key
%0Afro
@@ -756,16 +756,204 @@
io/mpeg%22
+%0A ext = '.mp3'%0A%0A # Send some extra headers%0A headers = Headers()%0A headers.add('Conte... |
ecb3779a653791b0f5f172fea52ae49326e705e1 | Update auth.py file with printing on start of authentication. | app/lib/twitter/auth.py | app/lib/twitter/auth.py | # -*- coding: utf-8 -*-
"""
Setup authentication so tweepy package can access Twitter API.
Usage:
$ python -m lib.twitter.auth --help
Based on
https://github.com/tweepy/tweepy/blob/master/examples/oauth.py
http://docs.tweepy.org/en/latest/code_snippet.html
"""
import webbrowser
import tweepy
from lib.con... | Python | 0 | @@ -2675,44 +2675,133 @@
-auth = generateUserToken()%0A else:
+print 'Generating user API token...'%0A auth = generateUserToken()%0A else:%0A print 'Generating app API token...'
%0A
|
e6487a2c623638b540b707c895a97eac1fc31979 | Update connection_test.py to work with Python3.7 | server/integration-tests/connection_test.py | server/integration-tests/connection_test.py | #!/usr/bin/env python2.7
from __future__ import absolute_import, division, unicode_literals
import json
import requests
import websocket
# 1. Put some data into icepeak over HTTP
new_data = {'status': 'freezing'}
requests.put('http://localhost:3000/so/cool',
json.dumps(new_data))
# 2. Get the data back over a we... | Python | 0.000001 | @@ -18,79 +18,215 @@
thon
-2.7%0Afrom __future__ import absolute_import, division, unicode_literals%0A
+3.7%0A%22%22%22%0ATest PUTing some data into Icepeak and getting it back over a websocket.%0A%0ARequires a running Icepeak instance.%0A%0ARequirements can be installed with: pip install requests websockets%0A%22%22%... |
2fe5fc8c53142b5661bf176441e246d48cdb0799 | fix a typo | Functions/Sed.py | Functions/Sed.py | '''
Created on Feb 14, 2014
@author: Tyranic-Moron
'''
from IRCMessage import IRCMessage
from IRCResponse import IRCResponse, ResponseType
from Function import Function
from GlobalVars import *
import re
# matches a sed-style regex pattern (taken from https://github.com/mossblaser/BeardBot/blob/master/modules/sed.p... | Python | 0.999999 | @@ -2065,16 +2065,17 @@
else
+:
%0A
|
69b9c641f144633b94aca47212af446971286454 | add tests | server_common/test_modules/test_autosave.py | server_common/test_modules/test_autosave.py | import unittest
class TestAutosave(unittest.TestCase):
def setUp(self):
pass
| Python | 0 | @@ -1,92 +1,1395 @@
-import unittest%0A%0A%0Aclass TestAutosave(unittest.TestCase):%0A def setUp(self):%0A pass%0A
+from __future__ import unicode_literals, absolute_import, print_function, division%0Aimport unittest%0Aimport shutil%0Aimport os%0A%0Afrom server_common.autosave import AutosaveFile%0A%0A%0ATEMP... |
a79b7d2f0a712bfbc60e4ea3b34aa0331675519d | Add OpenSlideError exception class | openslide/lowlevel.py | openslide/lowlevel.py | #
# openslide-python - Python bindings for the OpenSlide library
#
# Copyright (c) 2010-2011 Carnegie Mellon University
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of version 2.1 of the GNU Lesser General Public License
# as published by the Free Software Foundation.
#
... | Python | 0 | @@ -1147,16 +1147,59 @@
color'%0A%0A
+class OpenSlideError(Exception):%0A pass%0A%0A
# valida
@@ -1742,14 +1742,16 @@
ise
-Runtim
+OpenSlid
eErr
|
6a4f4031b0aac1c8859424703088df903746a6c8 | change command doc string | dvc/command/get.py | dvc/command/get.py | import argparse
import logging
from .base import append_doc_link
from .base import CmdBaseNoRepo
from dvc.exceptions import DvcException
logger = logging.getLogger(__name__)
class CmdGet(CmdBaseNoRepo):
def run(self):
from dvc.repo import Repo
try:
Repo.get(
self.ar... | Python | 0.000002 | @@ -781,17 +781,17 @@
es from
-g
+G
it repos
|
b92c1b5a6a814761d018f9e4d715fb1c2eca4f8b | fix z projection | spindle_tracker/tracking/tracker.py | spindle_tracker/tracking/tracker.py | import logging
import os
from dateutil import parser
from sktracker.io import TiffFile
from sktracker.io import StackIO
from sktracker.io import ObjectsIO
from sktracker.detection import peak_detector
from sktracker.io.trackmate import trackmate_peak_import
from ..utils.path import check_extension
log = logging.get... | Python | 0.000001 | @@ -6405,16 +6405,72 @@
.copy()%0A
+ metadata%5B'Shape'%5D = list(metadata%5B'Shape'%5D)%0A
|
5ab7d4af67abb20a87f9b963e9ae53df65eea42f | fix self deleter | cogs/fun.py | cogs/fun.py | import asyncio
import discord
from discord.ext import commands
class Fun:
"""
Fun and useful stuff
"""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True)
async def marco(self, ctx):
"""
Says "polo"
"""
await self.bot.say(self... | Python | 0.000003 | @@ -1662,16 +1662,24 @@
rom(ctx.
+message.
channel,
|
f5d6bc2ff2abf53c6fcf7de5d74ffc50b5d7673d | Fix python environment in test (#1305) | frameworks/helloworld/tests/test_soak.py | frameworks/helloworld/tests/test_soak.py | import pytest
import shakedown
import time
import json
import os
import sdk_cmd as cmd
import sdk_install
import sdk_plan
import sdk_tasks
import sdk_marathon
import sdk_test_upgrade
from tests.config import (
PACKAGE_NAME,
DEFAULT_TASK_COUNT
)
FRAMEWORK_NAME = "secrets/hello-world"
NUM_HELLO = 2
NUM_WORLD = ... | Python | 0.000005 | @@ -316,16 +316,45 @@
LD = 3%0A%0A
+# check environment first...%0A
if %22FRAM
@@ -411,17 +411,17 @@
.environ
-(
+%5B
%22FRAMEWO
@@ -428,17 +428,17 @@
RK_NAME%22
-)
+%5D
%0Aif %22NUM
@@ -482,25 +482,25 @@
= os.environ
-(
+%5B
%22NUM_HELLO%22)
@@ -498,17 +498,17 @@
M_HELLO%22
-)
+%5D
%0Aif %22NUM
@@ -556,17 +5... |
7e6d2ab61667bd3be246a2efe2a31212dbdef079 | Fix how rangelist is generated in orgviz.randomnodes | orgviz/randomnodes.py | orgviz/randomnodes.py | import random
import datetime
from .utils.date import timedeltastr
class RandomDatetime(object):
def __init__(self, pre_days=30, post_days=30, hour_min=6, hour_max=21):
self.pre_days = pre_days
self.post_days = post_days
self.hour_min = hour_min
self.hour_max = hour_max
s... | Python | 0.001507 | @@ -60,16 +60,31 @@
deltastr
+, total_seconds
%0A%0A%0Aclass
@@ -866,16 +866,398 @@
)%5B:3%5D)%0A%0A
+ def datetimerange(self, **kwds):%0A return self._start_end(self.datetime(**kwds), self.datetime(**kwds))%0A%0A def daterange(self, **kwds):%0A return self._start_end(self.datetime(**kwds), self.... |
b0c83624004ebda4ea23f597d109d89ec319f1cf | fix tut2.py | doc/source/code/tut2.py | doc/source/code/tut2.py | from netpyne import specs, sim
# Network parameters
netParams = specs.NetParams() # object of class NetParams to store the network parameters
## Population parameters
netParams.popParams['S'] = {'cellType': 'PYR', 'numCells': 20, 'cellModel': 'HH'}
netParams.popParams['M'] = {'cellType': 'PYR', 'numCells': 20, 'cell... | Python | 0.000001 | @@ -1418,22 +1418,25 @@
s%0A%09'
-divergence': 9
+probability': 0.5
, %09%09
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.