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 |
|---|---|---|---|---|---|---|---|
29c36b24a81607eec5275e84f4c6f3d33a318511 | Add ow2_asm license | tools_webrtc/libs/generate_licenses.py | tools_webrtc/libs/generate_licenses.py | #!/usr/bin/env python
# Copyright 2016 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All... | Python | 0 | @@ -2001,16 +2001,35 @@
m': %5B%5D,%0A
+ 'ow2_asm': %5B%5D,%0A
%7D%0A%0ASCRIP
|
d1568f2420322a19041dbdde734964ea39e66943 | content-length should be a string. | VMBackup/main/snapshotter.py | VMBackup/main/snapshotter.py | #!/usr/bin/env python
#
# VM Backup extension
#
# Copyright 2014 Microsoft Corporation
#
# 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... | Python | 0.999987 | @@ -1,8 +1,9 @@
+%EF%BB%BF
#!/usr/b
@@ -2131,17 +2131,19 @@
gth%22%5D =
-0
+'0'
%0D%0A
|
42110ae58a799c7cbb4152f091e2d53a26049839 | Add regression test for #2 | sasstests.py | sasstests.py | from __future__ import with_statement
from attest import assert_hook
import collections
import os.path
import re
import shutil
import tempfile
from attest import Tests, raises
from werkzeug.test import Client
from werkzeug.wrappers import Response
import sass
from sassutils.builder import Manifest, build_directory
f... | Python | 0.000013 | @@ -5475,8 +5475,365 @@
ss_dir)%0A
+%0A%0Aregression = Tests()%0A%0A%0A@regression.test%0Adef regression_issue_2():%0A actual = sass.compile(string='''%0A @media (min-width: 980px) %7B%0A a %7B%0A color: red;%0A %7D%0A %7D%0A ''')%0A normalized = re.sub(r'%5C... |
cf439125f2350597f66796c89a088cd443ed77cd | Fix search results disappearing after they are viewed | igd_exporter/exporter.py | igd_exporter/exporter.py | import cgi
import socket
import urllib
import wsgiref.util
import prometheus_client
from . import igd
def wsgi_app(environ, start_response):
'''
Base WSGI application that routes requests to other applications.
'''
name = wsgiref.util.shift_path_info(environ)
if name == '':
return front(e... | Python | 0 | @@ -1006,16 +1006,21 @@
rgets =
+list(
igd.sear
@@ -1024,16 +1024,17 @@
earch(5)
+)
%0A%0A re
|
50d2bb0908ea3b45d1ab6da494953a88362a67d4 | add value summary | save_func.py | save_func.py | import tensorflow as tf
import time
def add_train_var():
""" add all trainable variable to summary"""
for var in tf.trainable_variables():
tf.histogram_summary(var.op.name, var)
def add_loss(loss_scope = 'losses'):
""" add all losses to summary """
for l in tf.get_collection(loss_scope):
tf.scalar_summary(l.o... | Python | 0.000001 | @@ -1072,20 +1072,192 @@
e(sess, model_name)%0A
+%0Adef add_value_sum(summary_writer, value, name):%0A%09%22%22%22 add python value to tensorboard %22%22%22%0A%09return tf.Summary(value = %5Btf.Summary.Value(tag = name, simple_value = value)%5D)%09%0A
|
191cd180e74b6854cddd64348b96dc20cbc8cbba | add dataset to base validator | jobrunner/validators.py | jobrunner/validators.py | import bmds
import json
import jsonschema
base_schema = {
'type': 'object',
'properties': {
'bmds_version': {
'enum': list(bmds.VERSIONS.keys())
},
'dataset_type': {
'enum': list(bmds.constants.DTYPES),
},
},
'required': ['bmds_version', 'dataset... | Python | 0.000001 | @@ -264,16 +264,102 @@
%7D,%0A
+ 'datasets': %7B%0A 'minItems': 1,%0A 'type': 'array'%0A %7D
%0A %7D,%0A
@@ -405,16 +405,28 @@
et_type'
+, 'datasets'
%5D%0A%7D%0A%0Acon
|
4f682e83af711b66581eb275b5b6ffa057960b28 | Simplify the calculation of scores | prediction/explorer.py | prediction/explorer.py | from . import support
from . import tuner
from .learner import Learner
from .random import Random
from .session import Session
import json
import numpy as np
import os
import threading
class Agent:
def __init__(self, session, semaphore, config):
self.session = session
self.semaphore = semaphore
... | Python | 0.999995 | @@ -1847,16 +1847,23 @@
-err
+sc
or
+e
=
+np.sum(
self
@@ -1898,125 +1898,8 @@
SE'%5D
-%0A decay = np.reshape(np.exp(-np.arange(len(error))), error.shape)%0A score = np.sum(error * decay
)%0A
|
1279b1c087e98717a6c0802c6a7aceca4a27a0b2 | fix copyright header on test file | app/tests/base/tests_exception_handling.py | app/tests/base/tests_exception_handling.py | # Copyright 2014 Google Inc. 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 applicable law ... | Python | 0 | @@ -14,18 +14,19 @@
014
-Google Inc
+rehabstudio
. Al
|
f2145ab158cc1eb0d9568c4a89b9f221085287bc | add volume labels to context disks; ssh disks to correct machine (#32) | core/src/main/python/stratuslab/tm/TMContext.py | core/src/main/python/stratuslab/tm/TMContext.py | #!/usr/bin/env python
#
# Copyright (c) 2012, Centre National de la Recherche Scientifique (CNRS)
#
# 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-... | Python | 0 | @@ -800,17 +800,22 @@
execute
+, scp
%0A
-
from str
@@ -1709,120 +1709,8 @@
e)%0A%0A
- # hack to remove the node from the destination%0A contextDiskFile = contextDiskFile.split(':')%5B1%5D%0A%0A
@@ -3557,16 +3557,37 @@
kisofs%22,
+ %22-V%22, %22_STRATUSLAB%22,
%22-o%22, i
@@ -3792,160 +3792,... |
0c628c0bf88f98899e371fcf7d11a1af6fcf7bd7 | use proper setter | corehq/apps/app_manager/tests/test_case_meta.py | corehq/apps/app_manager/tests/test_case_meta.py | from django.test.testcases import SimpleTestCase
from mock import patch
from nose.tools import nottest
from corehq.apps.app_manager.models import Application, Module, OpenCaseAction, ParentSelect, OpenSubCaseAction, \
AdvancedModule, LoadUpdateAction, AdvancedOpenCaseAction, CaseIndex
from corehq.apps.app_manager.... | Python | 0.00094 | @@ -4780,13 +4780,8 @@
nces
-_data
= %7B
|
6126d9e2ad6ed01c26d7f3c029f231ab19765685 | Remove get/post/handler from ContentView | feincms/module/mixins.py | feincms/module/mixins.py | import re
from django.db import models
from django.http import Http404
from django.template import Template
from django.utils.cache import add_never_cache_headers
from django.utils.datastructures import SortedDict
from django.views.generic import TemplateView
from feincms import settings
class ContentMixin(object):... | Python | 0 | @@ -1671,357 +1671,8 @@
t'%0A%0A
- def get(self, request, *args, **kwargs):%0A return self.handler(request, *args, **kwargs)%0A%0A def post(self, request, *args, **kwargs):%0A return self.handler(request, *args, **kwargs)%0A%0A def handler(self, request, *args, **kwargs):%0A self.page = P... |
f707a366f887bdadcec6ef4da0525bd784e65aee | Make sure we don't overlap reinvite transactions. | test_cases/reinv_onhold.py | test_cases/reinv_onhold.py | # Copyright (c) 2016 Sippy Software, Inc. All rights reserved.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
... | Python | 0 | @@ -2805,32 +2805,153 @@
-if len(self.sched) %3E 0:%0A
+return rval%0A%0A def on_reinvite_connected(self, ua):%0A if len(self.sched) %3E 0:%0A if self.onhold_count %3E self.offhold_count:%0A
@@ -2996,16 +2996,20 @@
t later%0A
+
@@ -3064,35 +3064,153 @@
ua)%0A ... |
d67249d0efb074ebcf5e5b20c5f21d92ffe81dae | Bump version to 0.1.7 | openkongqi/__init__.py | openkongqi/__init__.py | # -*- coding: utf-8 -*-
__version__ = '0.1.6'
__author__ = "Stefan Berder"
__contact__ = 'stefan@measureofqualty.com'
| Python | 0.000001 | @@ -42,9 +42,9 @@
0.1.
-6
+7
'%0A__
|
e8cae50b026f9136b9b5afc35a92a74f33937205 | Update 1482-maritime_boundary-buffered_land.py | integration-test/1482-maritime_boundary-buffered_land.py | integration-test/1482-maritime_boundary-buffered_land.py | from . import FixtureTest
# Adds tests for OSM features (but not NE features)
class MaritimeBoundary(FixtureTest):
def test_usa_canada_country_boundary(self):
# country boundary of USA and Canada
self.load_fixtures([
'https://www.openstreetmap.org/relation/148838',
'https:... | Python | 0 | @@ -356,16 +356,135 @@
28125',%0A
+ 'file://integration-test/fixtures/buffered_land/'%0A '1482-buffered_land-usa-can-wash-idaho.shp',%0A
@@ -635,36 +635,594 @@
try%22
-, %22maritime_boundary%22: false
+%7D)%0A %0A def test_usa_canada_country_boundary_not_maritime_boundary(sel... |
37b8ee356968efbc9d78d65ba7b31352b2b01ee2 | Fix parameter file writing | workflows/common/python/runner_utils.py | workflows/common/python/runner_utils.py | import numpy as np
import json, os
try:
basestring
except NameError:
basestring = str
DATA_TYPES = {type(np.float16): 'f16', type(np.float32): 'f32', type(np.float64): 'f64'}
def write_output(result, instance_directory):
with open('{}/result.txt'.format(instance_directory), 'w') as f_out:
f_out.write... | Python | 0.000004 | @@ -1578,16 +1578,29 @@
nt_dir)%0A
+ montr=%5B%5D%0A
with
@@ -1645,25 +1645,28 @@
write(%22%5B
-parameter
+Global Param
s%5D%5Cn%22)%0A
@@ -1860,55 +1860,417 @@
(v)%0A
- f_out.write(%22%7B%7D=%7B%7D%5Cn%22.format(k, v))
+%0A if(k =='solr_root' or k == 'timeout' ):%0A # this... |
c4aff416299f91b53f5dca1a76ed16c8a0d51a8f | fix some error by handle TypeError | unzip.py | unzip.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Last modified: 2010 Dec 15 06:43:11 PM CST
#
# LICENSE:
# Copyright (c) 2010 Tzeng, Yi-Feng
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the... | Python | 0 | @@ -63,27 +63,27 @@
201
-0 Dec 15 06:43:11 P
+1 Oct 21 10:49:20 A
M CS
@@ -136,19 +136,16 @@
i-Feng%0A#
-
%0A# Per
@@ -599,19 +599,16 @@
tions:%0A#
-
%0A# The
@@ -736,19 +736,16 @@
tware.%0A#
-
%0A# THE
@@ -1962,16 +1962,78 @@
ord='%5D%0A%0A
+ if len(sys.argv) %3C 2:%0A usage()%0A ... |
5cf2e157da810dfe9e0436f9e76f5f339444031a | Add doxygen to the linux bootstrap | cerbero/bootstrap/linux.py | cerbero/bootstrap/linux.py | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | Python | 0.000001 | @@ -1669,16 +1669,27 @@
-config'
+, 'doxygen'
%5D%0A%0A%0Aclas
|
85516e56cf60337af51ddbf0fef95763a1dcc2d4 | Remove extra 's' | bouncer-plumbing/collector-to-mlab/getconfig.py | bouncer-plumbing/collector-to-mlab/getconfig.py | #!/usr/bin/env python
# This script builds the portion of the bouncer.yaml config file for the Ooni
# collector and test helpers running on an M-Lab slice. To use it, run `python
# getconfig.py`, and if all goes well, the YAML portion will be printed to
# stdout. If something goes wrong, an error message will be print... | Python | 0.001651 | @@ -3513,17 +3513,16 @@
t-helper
-s
': test_
|
54fcc052ca5b6d0c6ee7d4c6fd1e5dedb5c7bd20 | Handle empty models in the string representation | openprovider/models.py | openprovider/models.py | # coding=utf-8
"""
Wrapper classes for API models. Most of these are thin wrappers over lxml
objectified versions of API responses.
"""
import datetime
import lxml.etree
from openprovider.util import camel_to_snake, snake_to_camel
class Model(object):
"""
Superclass for all models. Delegates attribute acces... | Python | 0.000001 | @@ -2312,16 +2312,48 @@
f._obj))
+ if self._obj else 'Empty model'
%0A%0A%0Adef s
|
92ce590174265c4ac6701a2d11fe65465ececcc6 | Add deploy key uploading to the command line | doctr/__main__.py | doctr/__main__.py | """
doctr
A tool to automatically deploy docs to GitHub pages from Travis CI.
The doctr command is two commands in one. To use, first run
doctr
on your local machine. This will prompt for your GitHub credentials and the
name of the repo you want to deploy docs for. This will generate a secure key,
which you should ... | Python | 0.000001 | @@ -737,16 +737,46 @@
pt_file,
+%0A upload_GitHub_deploy_key,
generat
@@ -1833,16 +1833,197 @@
ng.%22%22%22)%0A
+%0A parser.add_argument(%22--no-upload-key%22, action=%22store_false%22, default=True,%0A dest=%22upload_key%22, help=%22%22%22Don't automatically upload the deploy key%0A to GitHub.%... |
0543774cffde0ad6eafe4bebc77df04c03027cf7 | Remove container specific import from __init__.py (#14) | testcontainers/__init__.py | testcontainers/__init__.py | from testcontainers.selenium import BrowserWebDriverContainer
from testcontainers.mysql import MySqlContainer
from testcontainers.postgres import PostgresContainer
from testcontainers.oracle import OracleDbContainer
from testcontainers.core.generic import GenericContainer
from testcontainers.core.waiting_utils import w... | Python | 0.000001 | @@ -1,220 +1,4 @@
-from testcontainers.selenium import BrowserWebDriverContainer%0Afrom testcontainers.mysql import MySqlContainer%0Afrom testcontainers.postgres import PostgresContainer%0Afrom testcontainers.oracle import OracleDbContainer%0A
from
|
00cc8c249dddea91b778e3623b36187969d89012 | Fix bug in _CustomOperation | hoomd/custom_operation.py | hoomd/custom_operation.py | from hoomd.operation import _TriggeredOperation
from hoomd.parameterdicts import ParameterDict
from hoomd.custom_action import CustomAction
from hoomd.typeconverter import OnlyType
from hoomd.trigger import Trigger
from hoomd.logger import LoggerQuantity
from hoomd import _hoomd
class _CustomOperation(_TriggeredOpera... | Python | 0 | @@ -1789,11 +1789,11 @@
s =
-lis
+dic
t(ac
|
4f2040f001a083db02633164dc063a7ac46e5602 | use ordered dicts | ophiuchus/data/core.py | ophiuchus/data/core.py | # coding: utf-8
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Third-party
import astropy.coordinates as coord
import astropy.units as u
from astropy.utils.data import get_pkg_data_filename
import numpy as np
import numexpr
import gary.coordinates as gc
from gary.obs... | Python | 0.000001 | @@ -106,16 +106,72 @@
.edu%3E%22%0A%0A
+# Standard library%0Afrom collections import OrderedDict%0A%0A
# Third-
@@ -1668,25 +1668,32 @@
coord_err =
-d
+OrderedD
ict(%0A
@@ -2138,17 +2138,24 @@
veloc =
-d
+OrderedD
ict(%0A
@@ -2372,17 +2372,24 @@
c_err =
-d
+OrderedD
ict(%0A
|
9553dca666dcf751977bffb21415f8b43811ce02 | Add album on post extend article, on article | opps/article/models.py | opps/article/models.py | # -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
from tagging.fields import TagField
from googl.short import GooglUrlShort
from opps.core.models import Publishable
from opps.image.models import Image
from opps.source.models import Source
from opps.channel.mo... | Python | 0 | @@ -2066,32 +2066,177 @@
gh='PostImage')%0A
+ album = models.ForeignKey('Album', verbose_name=_(u'Album'), null=True,%0A blank=True, on_delete=models.SET_NULL)%0A
%0A%0Aclass Album(Ar
|
fef8eb920ccd24cade6430361f638eb46f609151 | Replace deprecated get_all_field_names reference | organizations/utils.py | organizations/utils.py | # -*- coding: utf-8 -*-
# Copyright (c) 2012-2015, Ben Lopatin and contributors
# All rights reserved.
#
# 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 ... | Python | 0.00001 | @@ -1374,35 +1374,454 @@
rom
-.models import Organization
+itertools import chain%0A%0Afrom .models import Organization%0A%0A%0Adef model_field_names(model):%0A %22%22%22%0A Returns a list of field names in the model%0A%0A Direct from Django upgrade migration guide.%0A %22%22%22%0A return list(set(chai... |
05f782b7544c6639049e6c83d5f26d28189924a7 | I think it time to 0.1.0 | blog/__init__.py | blog/__init__.py | VERSION = (0, 1, 'pre')
__version__ = ".".join(map(str, VERSION))
| Python | 0.999978 | @@ -14,13 +14,9 @@
1,
-'pre'
+0
)%0A__
|
60bec2ee0e1aa131cc47f350ae02b6aeadf93b4b | Bump Biogrid version to 4.2.192 (Nov 25 2020) | indra/sources/biogrid.py | indra/sources/biogrid.py | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import os
import re
import csv
import logging
import itertools
import requests
from io import BytesIO, StringIO
from zipfile import ZipFile
from collections import namedtuple
from indra.util import read_unicode_csv
f... | Python | 0 | @@ -593,23 +593,23 @@
BIOGRID-
-3.4.158
+4.2.192
/BIOGRID
@@ -617,15 +617,15 @@
ALL-
-3.4.158
+4.2.192
.tab
|
45c74931323aa250486e96e943b6f820aca20ec5 | Update user serializer to use full rather than simple | lims/users/views.py | lims/users/views.py | from django.contrib.auth.models import User, Group
from django.conf import settings
from rest_framework import parsers, renderers
from rest_framework.authtoken.models import Token
from rest_framework.authtoken.serializers import AuthTokenSerializer
from rest_framework.response import Response
from rest_framework.views... | Python | 0 | @@ -3939,32 +3939,49 @@
@list_route(
+methods=%5B'get'%5D,
permission_class
@@ -4042,38 +4042,32 @@
serializer =
-Simple
UserSerializer(r
|
2ef6fdf4bf3f3bf4257238c36835d697ba9307d3 | Add one more test for gene normalization | indra/tests/test_gnbr.py | indra/tests/test_gnbr.py | import os
from indra.sources.gnbr.processor import *
import indra.sources.gnbr.api as api
from indra.statements.validate import assert_valid_statements
def test_standardize_agent():
agent = get_std_gene('xxx', '673')
assert isinstance(agent[0], Agent)
assert agent[0].name == 'BRAF'
assert agent[0].db... | Python | 0.000001 | @@ -441,16 +441,360 @@
1097'%0A%0A%0A
+def test_multiple_genes():%0A agents = get_std_gene('Erk1/2', '5594;5595')%0A assert agents%5B0%5D.name == 'MAPK1'%0A assert agents%5B1%5D.name == 'MAPK3'%0A assert agents%5B0%5D.db_refs%5B'TEXT'%5D == 'Erk1/2'%0A assert agents%5B1%5D.db_refs%5B'TEXT'%5D == 'Erk1/2... |
99b2b3609e86568690c9be130e2ebad21a4fe846 | Change qid_or_uuid -> qid and update Document2.DoesNotExist try/except | desktop/core/src/desktop/lib/botserver/views.py | desktop/core/src/desktop/lib/botserver/views.py | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | Python | 0 | @@ -3192,24 +3192,16 @@
ype, qid
-_or_uuid
= urlsp
@@ -3335,32 +3335,24 @@
s.get(id=qid
-_or_uuid
)%0A elif
@@ -3462,32 +3462,24 @@
ent(uuid=qid
-_or_uuid
)%0A else
@@ -3534,19 +3534,205 @@
link%22))%0A
-%0A
+ except Document2.DoesNotExist:%0A msg = %22Document with %7Bkey%7D=%7Bvalue%7D doe... |
3c54116f4c31a7e7392bdd7fd8fdc6773621d9f6 | fix bad fix of sync contrib-base branch :-P (#9088) | Utils/contribution_sync/sync_contrib_base.py | Utils/contribution_sync/sync_contrib_base.py | #!/usr/bin/env python3
import os
import sys
import urllib3
from github import Github, enable_console_debug_logging
from github.Repository import Repository
from typing import List
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
def get_master_commit_sha(repo: Repository) -> str: # noqa: E999
... | Python | 0 | @@ -1076,16 +1076,104 @@
es = %5B%5D%0A
+ open_prs_head_refs = %7Bopen_pr.head.ref for open_pr in repo.get_pulls(state='OPEN')%7D%0A
for
@@ -1393,163 +1393,52 @@
%3E= 1
-:%0A prs_with_branch_as_head = repo.get_pulls(state='OPEN', head=branch.name)%0A if prs_with_branch_as_head.t... |
48e4abf450b63eb61bef72fa9dcd0217641f3777 | fix for review comments | acos_client/v30/nat.py | acos_client/v30/nat.py | # Copyright 2015, A10 Networks
#
# 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 agre... | Python | 0 | @@ -1746,30 +1746,24 @@
rn self.get(
-self,
name)%0A
|
8fd28c81ae1e590e8ec9cb04097b36c4e088101d | Improve spaces replacement with slugify | core/internals.py | core/internals.py | import os
import sys
from core import const
log = const.log
try:
from slugify import SLUG_OK, slugify
except ImportError:
log.error('Oops! `unicode-slugify` was not found.')
log.info('Please remove any other slugify library and install `unicode-slugify`')
sys.exit(5)
formats = { 0 : 'track_name',
... | Python | 0.000011 | @@ -3104,62 +3104,20 @@
lse,
-%0A spaces=(not const.args.no_spaces)
+ spaces=True
)%0A
|
315c3bc1e2961dc9de5d77fed5d232f106e59968 | improve a couple of comments | users.py | users.py | '''
working with gitlab's users
'''
from crud import Crud
from utils import filter_dict
import random
class Users (Crud):
def __init__(self):
Crud.__init__(self, 'users', lambda x: x['username'])
# generate random password
rand_pass = lambda s, l = 10: ''.join(chr(random.randint(64, 122)) for x in xrange(l))
... | Python | 0.001666 | @@ -599,11 +599,12 @@
for
-sav
+reus
ing
@@ -931,19 +931,105 @@
o a
-users' dict
+top level of the users' dict%0A%09%09# ('cause POST API call to /users works with only one extern_uuid)
%0A%09%09d
@@ -1448,14 +1448,12 @@
uild
-ing of
+ the
cac
@@ -1482,18 +1482,8 @@
user
- is needed
%0A%09%09_
|
0364831c22dbc73e523aeadcb9c0016e207f8447 | Remove version-added on name field. | lib/ansible/modules/cloud/openstack/os_networks_facts.py | lib/ansible/modules/cloud/openstack/os_networks_facts.py | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | Python | 0 | @@ -1203,34 +1203,8 @@
lse%0A
- version_added: %222.2%22%0A
f
|
c63681e6fc3d5e336a13698a473f4aaf61fdb9b1 | Remove width and x arguments until fixed positioning. | center_dmenu.py | center_dmenu.py | #!/usr/bin/env python2
# Copyright 2013 Ryan McGowan
#
# 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... | Python | 0 | @@ -2283,26 +2283,8 @@
rgs%7D
- -w %7Bwidth%7D -x %7Bx%7D
-y
|
999ae0c40a7a101672c735a552a7e79fcc6e9f96 | Add desk_update url to admin urls | admin/common_auth/urls.py | admin/common_auth/urls.py | from __future__ import absolute_import
from django.conf.urls import url
from django.core.urlresolvers import reverse_lazy
from django.contrib.auth.views import password_change, password_change_done
from admin.common_auth import views
urlpatterns = [
url(r'^login/?$', views.LoginView.as_view(), name='login'),
... | Python | 0.000001 | @@ -792,16 +792,22 @@
DeskUser
+Create
FormView
@@ -832,10 +832,107 @@
desk'),%0A
+ url(r'%5Esettings/desk/update/$', views.DeskUserUpdateFormView.as_view(), name='desk_update'),%0A
%5D%0A
|
bce0c2853e6c7901280c9989893e6230ec29dbe4 | Allow util.retry to return result of task coroutine | aiorchestra/core/utils.py | aiorchestra/core/utils.py | # Author: Denys Makogon
#
# 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 t... | Python | 0.000499 | @@ -1134,16 +1134,23 @@
return
+ result
%0A
|
6b90e0e0131d2bf0f0e5efb472b1c1af8abab5b7 | fix PEP8 error | aiortc/rtcicetransport.py | aiortc/rtcicetransport.py | import asyncio
import attr
from aioice import Candidate, Connection
from pyee import EventEmitter
@attr.s
class RTCIceCandidate:
component = attr.ib()
foundation = attr.ib()
ip = attr.ib()
port = attr.ib()
priority = attr.ib()
protocol = attr.ib()
type = attr.ib()
sdpMLineIndex = attr... | Python | 0.000002 | @@ -1,20 +1,4 @@
-import asyncio%0A%0A
impo
|
32f185e31ba5ccfd589c2db94c7d213b78cccd2a | Remove __init__ redefinition for module | alignak/objects/module.py | alignak/objects/module.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, ei... | Python | 0.000086 | @@ -2693,323 +2693,8 @@
%7B%7D%0A%0A
- def __init__(self, params=None, parsing=True):%0A %22%22%22%0A This function is useful because of the unit tests suite. Without this module initialisation%0A some tests are broken%0A :param params:%0A :param parsing:%0A %22%22%22%0A ... |
274f05a3178109bbcb119be802e0f30c161090d4 | Remove pointless tearDown | allegedb/allegedb/test.py | allegedb/allegedb/test.py | import unittest
from copy import deepcopy
import allegedb
testkvs = [0, 1, 10, 10**10, 10**10**4, 'spam', 'eggs', 'ham', '💧', '🔑', '𐦖',('spam', 'eggs', 'ham')]
testvs = [['spam', 'eggs', 'ham'], {'foo': 'bar', 0: 1, '💧': '🔑'}]
testdata = []
for k in testkvs:
for v in testkvs:
testdata.append((k, v))... | Python | 0.000098 | @@ -664,61 +664,8 @@
h)%0A%0A
- def tearDown(self):%0A self.engine.close()%0A%0A
%0Acla
|
160987b75c0fd31f9385d0cc4a66b43b89748517 | Update ephemeral_dataproc_spark_dag.py | examples/cloud-composer-examples/composer_http_post_example/ephemeral_dataproc_spark_dag.py | examples/cloud-composer-examples/composer_http_post_example/ephemeral_dataproc_spark_dag.py | # Copyright 2018 Google 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 | @@ -4665,43 +4665,8 @@
=2,%0A
- num_preemptible_workers=2,%0A
|
be812bc91fed48f679900732f5ee4cc3c9dc97a7 | Use the default login for superuser. | devilry/project/common/default_urls.py | devilry/project/common/default_urls.py | from django.conf.urls import include
from django.conf.urls import url
from django.contrib import admin
from django.core.urlresolvers import reverse
from django.http import HttpResponseBadRequest, HttpResponsePermanentRedirect
from devilry.devilry_frontpage.views import frontpage
admin.autodiscover()
def redirecto_to... | Python | 0 | @@ -96,16 +96,74 @@
t admin%0A
+from django.contrib.auth.decorators import login_required%0A
from dja
@@ -336,27 +336,59 @@
ge%0A%0A
+%0A
admin.
-autodiscover(
+site.login = login_required(admin.site.login
)%0A%0A%0A
|
54c18ae0c6372922fbf108e4ad659fa81ec66284 | Fix test on Win | tests/commands/pkg/test_exec.py | tests/commands/pkg/test_exec.py | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | Python | 0.000001 | @@ -1870,16 +1870,17 @@
match=(
+r
%22openocd
@@ -1881,16 +1881,17 @@
penocd:
+(
unrecogn
@@ -1890,24 +1890,33 @@
unrecognized
+%7Cunknown)
option%22),%0A
|
ab13d8157090e452c1cffec2b917800cd9c5ed56 | Fix whitespace problem and always replace window['title'] None, with empty string | py3status/modules/window_title.py | py3status/modules/window_title.py | # -*- coding: utf-8 -*-
"""
Display the current window title.
Configuration parameters:
cache_timeout: How often we refresh this module in seconds (default 0.5)
format: display format for window_title (default '{title}')
max_width: If width of title is greater, shrink it and add '...'
(default 120)... | Python | 0.025603 | @@ -1295,16 +1295,84 @@
ree())%0A%0A
+ if window%5B'name'%5D is None:%0A window%5B'name'%5D = ''%0A%0A
@@ -1469,100 +1469,8 @@
le:%0A
- if window%5B'name'%5D is None:%0A window%5B'name'%5D = ''%0A %0A
|
ffc2d143df572a6835789205cc079ac6f3b5707c | Fix FTP directory download | pubrunner/getresource.py | pubrunner/getresource.py |
import pubrunner
import sys
import argparse
import os
import git
import tempfile
import shutil
import logging
import traceback
import yaml
import json
import subprocess
import shlex
import wget
import gzip
import hashlib
import six
import six.moves.urllib as urllib
import time
from six.moves import reload_module
impor... | Python | 0.000001 | @@ -1829,16 +1829,20 @@
th.join(
+out,
basename
@@ -1843,16 +1843,49 @@
sename)%0A
+%09%09if not os.path.isdir(newOut):%0A%09
%09%09os.mak
@@ -1913,11 +1913,8 @@
hild
-ren
in
|
b4c5073bcd46cf80905c56e499093f16109df109 | Fix query for information_schema | pyathenajdbc/sqlalchemy_athena.py | pyathenajdbc/sqlalchemy_athena.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import re
from sqlalchemy.engine.default import DefaultDialect
from sqlalchemy.sql.compiler import IdentifierPreparer, SQLCompiler
from sqlalchemy.sql.sqltypes import (BIGINT, BINARY, BOOLEAN, DATE, DECIMAL, FLOAT,
... | Python | 0.999978 | @@ -3033,32 +3033,105 @@
ma=None, **kw):%0A
+ schema = schema if schema else connection.connection.schema_name%0A
query =
@@ -3295,57 +3295,8 @@
hema
- if schema else connection.connection.schema_name
)%0A
@@ -3665,42 +3665,351 @@
-query = %22%22%22%0A SELECT
+# information_sc... |
252eeac29bd7f5c1237a0868059fab5577b401ac | Use total bytes values to calculate rates | checks.d/iis.py | checks.d/iis.py | '''
Check the performance counters from IIS
'''
from checks import AgentCheck
class IIS(AgentCheck):
METRICS = [
('iis.uptime', 'gauge', 'ServiceUptime'),
# Network
('iis.net.bytes_sent', 'gauge', 'BytesSentPerSec'),
('iis.net.bytes_rcvd', 'gauge', 'BytesReceivedPerSec'),
(... | Python | 0.000001 | @@ -208,33 +208,37 @@
tes_sent', '
-gaug
+rat
e', '
+Total
BytesSentPer
@@ -234,22 +234,16 @@
ytesSent
-PerSec
'),%0A
@@ -266,33 +266,37 @@
tes_rcvd', '
-gaug
+rat
e', '
+Total
BytesReceive
@@ -296,22 +296,16 @@
Received
-PerSec
'),%0A
@@ -337,33 +337,37 @@
', '
-gaug
+rat
e', '
+Total
BytesT
-otal... |
508fb5e0ca53995d90baa4b500bf4ab0f3f3fb50 | Add more types to SQLAlchemy type conversion | pyathenajdbc/sqlalchemy_athena.py | pyathenajdbc/sqlalchemy_athena.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import re
from sqlalchemy.engine import reflection
from sqlalchemy.engine.default import DefaultDialect
from sqlalchemy.sql.compiler import IdentifierPreparer, SQLCompiler
from sqlalchemy.sql.sqltypes import (BIGINT,... | Python | 0 | @@ -1105,24 +1105,48 @@
APPINGS = %7B%0A
+ 'BOOLEAN': BOOLEAN,%0A
'REAL':
@@ -1189,24 +1189,48 @@
LE': FLOAT,%0A
+ 'TINYINT': INTEGER,%0A
'SMALLIN
@@ -1251,124 +1251,122 @@
'
-BOOLEAN': BOOLEAN,%0A 'INTEGER': INTEGER,%0A 'VARCHAR': STRINGTYPE,%0A 'TINYINT': INTEGER,%0A 'DECIMAL': DECI... |
efe2e46c36501afa6072e0bb984ee737caeaeb13 | order APi is instant not a progress | chiphub/urls.py | chiphub/urls.py | """chiphub URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | Python | 0.000001 | @@ -2288,19 +2288,16 @@
ey/order
-ing
/$', dig
|
39824268150fb5b9cb86c599dad81b18f7ef7142 | Add the Award and AwardGrant models to the init set | pyforge/pyforge/model/__init__.py | pyforge/pyforge/model/__init__.py | # -*- coding: utf-8 -*-
"""The application's model objects"""
from .session import ProjectSession
from .project import Theme, Neighborhood, NeighborhoodFile, Project, ProjectFile, AppConfig, SearchConfig, ScheduledMessage
from .discuss import Discussion, Thread, PostHistory, Post, Attachment
from .artifact import Arti... | Python | 0 | @@ -382,16 +382,35 @@
ce, Feed
+, Award, AwardGrant
%0Afrom .a
|
804402572ca664b7a1bd3ed21de277210fe5c74e | Use importlib instead of django.utils.importlib | src/decorator_include/__init__.py | src/decorator_include/__init__.py | """
A replacement for ``django.conf.urls.include`` that takes a decorator,
or an iterable of view decorators as the first argument and applies them, in
reverse order, to all views in the included urlconf.
"""
from __future__ import unicode_literals
from builtins import object, str
from django.core.exceptions import Imp... | Python | 0.000001 | @@ -202,16 +202,17 @@
nf.%0A%22%22%22%0A
+%0A
from __f
@@ -403,16 +403,107 @@
esolver%0A
+%0Atry:%0A from importlib import import_module%0Aexcept ImportError:%0A # For python 2.6%0A
from dja
|
803368f1741a9558ea84092dc975c1a10f51fa79 | Change url in dashboard administrador | administracion/urls.py | administracion/urls.py | from django.conf.urls import url
from .views import admin_main_dashboard, admin_users_dashboard, \
admin_users_create, admin_users_edit, admin_users_edit_form, \
admin_users_delete_modal, admin_users_delete, list_studies
app_name = 'administracion'
# Urls en espanol
urlpatterns =... | Python | 0.000001 | @@ -337,16 +337,17 @@
incipal/
+$
', admin
|
b488b884cf802546a795b0084003a9200e0d646b | Implement update_cmd in cli | cibopath/cli.py | cibopath/cli.py | # -*- coding: utf-8 -*-
import logging
import click
from cibopath import __version__
from cibopath.user_config import UserConfig
from cibopath.log import create_logger
@click.group()
@click.pass_context
@click.option(
'-v', '--verbose',
is_flag=True, help='Print debug information'
)
@click.option(
'-c'... | Python | 0.000001 | @@ -164,16 +164,96 @@
_logger%0A
+from cibopath.scraper import load_templates%0Afrom cibopath.templates import dump%0A
%0A%0A@click
@@ -1548,16 +1548,198 @@
)%0A )%0A
+ templates = load_templates(username, token)%0A%0A logger.debug('Found %7B%7D templates'.format(len(templates)))%0A dump(templates)%0A ... |
e80c6520c6b44327dbb880b4c4b3d4162744bef7 | Set user's permissions when create him/her | administrator/admin.py | administrator/admin.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as Admin
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import Group
from django.utils.translation import uge... | Python | 0.000001 | @@ -1099,32 +1099,72 @@
taff(user.role)%0A
+ user.set_permissions(user.role)%0A
if commi
@@ -2245,273 +2245,8 @@
%22%22%0A%0A
- %22%22%22def queryset(self, request):%0A qs = super(UserAdmin, self).queryset(request)%0A%0A # If super-user, show all comments%0A if request.user.rol... |
225b49d12771dc76a21d1f7e2836c13e84a4868e | fix CronTrigger.get_next_fire_time() bug: calculate start_date problem | apscheduler/triggers/cron/__init__.py | apscheduler/triggers/cron/__init__.py | from datetime import datetime, timedelta
from tzlocal import get_localzone
import six
from apscheduler.triggers.base import BaseTrigger
from apscheduler.triggers.cron.fields import BaseField, WeekField, DayOfMonthField, DayOfWeekField, DEFAULT_VALUES
from apscheduler.util import datetime_ceil, convert_to_datetime, da... | Python | 0.000001 | @@ -5175,26 +5175,26 @@
art_date = m
-ax
+in
(now, previo
@@ -5275,18 +5275,18 @@
date = m
-ax
+in
(now, se
|
487a94c844dc28cab0b9fe490ed28c749953e745 | Improve error reporting of PluginRegistry | Cura/PluginRegistry.py | Cura/PluginRegistry.py | from Cura.PluginError import PluginError, PluginNotFoundError, InvalidMetaDataError
import imp
import os
## A central object to dynamically load modules as plugins.
#
# The PluginRegistry class can load modules dynamically and use
# them as plugins. Each plugin module is expected to be a directory with
# and `... | Python | 0 | @@ -5334,33 +5334,86 @@
print(
-e
+%22Import error when importing %7B0%7D: %7B1%7D%22.format(name, e)
)%0A re
@@ -5541,33 +5541,86 @@
print(
-e
+%22Import error loading module %7B0%7D: %7B1%7D%22.format(name, e)
)%0A re
|
30230a29ea8ee40121a83bb5a3203f80a296cf0e | Bump to v0.5.0 | setup.py | setup.py | """
----------------
Flask-Mustache
----------------
`Mustache`__ integration for Flask.
__ http://mustache.github.com/
Flask-Mustache adds template helpers and context processors to assist
Flask developers with integrating the Mustache library into their
development process.
"""
from setuptools import setup
se... | Python | 0 | @@ -366,11 +366,11 @@
='0.
-4.9
+5.0
',%0A
|
f61c82152042197d03d49b3ba9a141d025edf1c9 | Add cp.get_url test | tests/integration/modules/cp.py | tests/integration/modules/cp.py | # Import python libs
import os
# Import salt libs
import integration
class CPModuleTest(integration.ModuleCase):
'''
Validate the test module
'''
def test_get_file(self):
'''
cp.get_file
'''
tgt = os.path.join(integration.TMP, 'scene33')
self.run_function(
... | Python | 0.000001 | @@ -1658,12 +1658,555 @@
l', '36')))%0A
+%0A def test_get_url(self):%0A '''%0A cp.get_url%0A '''%0A # We should add a %22if the internet works download some files%22%0A tgt = os.path.join(integration.TMP, 'scene33')%0A self.run_function(%0A 'cp.get_url',%0A ... |
5d9cea1b0cefaeb38dd86623e05144aa3b91ff9e | Update mangaChapterDownload.py | comic_dl/manga_eden/mangaChapterDownload.py | comic_dl/manga_eden/mangaChapterDownload.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import cfscrape
import requests
import json
import sys
import os
import globalFunctions
class MangaChapterDownload():
def __init__(self, page_id, download_directory, **kwargs):
self.page_id = str(page_id).strip()
self.manga_name = str(kwargs.get("mang... | Python | 0 | @@ -48,23 +48,27 @@
import c
-f
+loud
scrape
+r
%0Aimport
@@ -2598,15 +2598,19 @@
= c
-f
+loud
scrape
+r
.cre
|
b617b778d2e442d8e2ab6a2098f7799bfb83bf85 | Bump version to 0.8.1 | setup.py | setup.py | #!/usr/bin/env python
"""Setup ACAPI package."""
import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__name__), "README.md")) as f:
long_description = f.read()
setup(
name="acapi",
version="0.8.0",
description="Acquia Cloud API client.",
long_description=long_descriptio... | Python | 0 | @@ -229,17 +229,17 @@
on=%220.8.
-0
+1
%22,%0A d
|
c7db3806a57935921c733609a265e505654ab601 | Add Korean language | Cura/util/resources.py | Cura/util/resources.py | #coding:utf8
"""
Helper module to get easy access to the path where resources are stored.
This is because the resource location is depended on the packaging method and OS
"""
__copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License"
import os
import sys
import glob
import gettext
... | Python | 0.999998 | @@ -2098,24 +2098,44 @@
'French'%5D,%0A
+%09%09%5B'ko', 'Korean'%5D,%0A
%09%09# %5B'zh', '
|
d2b08f37fce58cd5fedabe17430dc172a8b0c7d7 | fix broken setup :-( | setup.py | setup.py | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from coherence import __version__
setup(
name="Coherence",
version=__version__,
description="""Coherence - DLNA/UPnP framework for the digital living""",
long_description="""Coherence is a framework written in Python,
providing a var... | Python | 0 | @@ -98,16 +98,68 @@
sion__%0A%0A
+packages = find_packages()%0Apackages.append('misc')%0A%0A
setup(%0A
@@ -1716,28 +1716,16 @@
ges=
-%5B'coherence','misc'%5D
+packages
,%0A
|
562f28a37d5187f1813545ca5a18f56b8a7d1e51 | Linear interpolation | audio_to_img_to_audio/img_to_audio.py | audio_to_img_to_audio/img_to_audio.py | #!/usr/bin/env python
import struct
import sys
import wave
from PIL import Image
width = None
height = None
sampleRate = 48000
duration = 3
frequency = 440.0
with Image.open(sys.argv[1]) as img:
# convert image to 1-bit B&W image
bw_image = img.convert()
(width, height) = bw_image.size
min_max = []
for w... | Python | 0.999927 | @@ -1291,52 +1291,83 @@
-value = min_val if idx %25 2 == 0 else
+scaled_min = scale_value(min_val)%0A scaled_max = scale_value(
max_val
+)
%0A
@@ -1375,107 +1375,132 @@
-scaled_value = scale_value(value)%0A # we repeat that same value 'wave_frame' time in the file
+per_frame_diff = int((... |
b5d679b7dd10f928d487a43ba5e233598eeb6dfa | Renamed daily_prepost_onset() to daily_rel2onset(). Housekeeping | utils.py | utils.py | import sys
sys.path.append('/home/jwalker/dynamics/python/atmos-tools')
sys.path.append('/home/jwalker/dynamics/python/atmos-read')
import numpy as np
import xray
import matplotlib.pyplot as plt
import atmos as atm
import merra
# ----------------------------------------------------------------------
def daily_prepos... | Python | 0.999999 | @@ -188,16 +188,35 @@
t as plt
+%0Aimport collections
%0A%0Aimport
@@ -330,16 +330,12 @@
ily_
-p
re
-post_
+l2
onse
@@ -1838,16 +1838,26 @@
ed(ndays
+, offset=0
):%0A %22
@@ -1928,30 +1928,348 @@
-Output days are day of
+Parameters%0A ----------%0A ndays : int%0A Number of days to average i... |
d9db045fda3607fb1d9ff6d5949f301d40491d9c | add timing steps for open / sync / close | commands/sync_benchmark/rps_detach_audit.py | commands/sync_benchmark/rps_detach_audit.py | import clr
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import OpenOptions, SynchronizeWithCentralOptions, DetachFromCentralOption, RelinquishOptions
from Autodesk.Revit.DB import TransactWithCentralOptions
from Autodesk.Revit.DB import FilePath
from Autodesk.Revit.DB import WorksetConfiguration, WorksetConfigur... | Python | 0.000001 | @@ -1878,32 +1878,75 @@
datetime.now()%0A%0A
+ print(%22 start: %7B%7D%22.format(start))%0A
doc = ap
@@ -1996,74 +1996,249 @@
-doc.SynchronizeWithCentral(trans_opt, sync_opt)%0A doc.Close(
+print(%22 openend: %7B%7D%22.format(str(datetime.now())))%0A doc.SynchronizeWithCentral(tra... |
a164a1afa5c39847b629b4acf5dddb0180e7480c | version bump | setup.py | setup.py | """
mipsy setup.py
"""
from distutils.core import setup
setup(
name='mipsy',
version='0.1.0',
author='Nick Miller',
author_email='ngmiller@iastate.edu',
packages=['mipsy'],
scripts=['bin/mipsy'],
url='https://github.com/ngmiller/mips-assembler',
license='LICENSE',
description='MIPS... | Python | 0.000001 | @@ -93,17 +93,17 @@
on='0.1.
-0
+1
',%0A a
|
966fd550508577d58e2002f2317d8190d1b31374 | correct bug in writing static instead of host routes | autonetkit/compilers/device/ubuntu.py | autonetkit/compilers/device/ubuntu.py | from autonetkit.compilers.device.server_base import ServerCompiler
import autonetkit.log as log
class UbuntuCompiler(ServerCompiler):
def compile(self, node):
super(UbuntuCompiler, self).compile(node)
# up route add -net ${route.network} gw ${router.gw} dev ${route.interface}
self.static_r... | Python | 0.000001 | @@ -4095,38 +4095,36 @@
r entry in node.
+ho
st
-atic
_routes_v4:%0A
|
7c0d9a7972f04ae9e6ff62be46030753fbc59c2e | remove useless comment | benchbuild/projects/polybench/polybench.py | benchbuild/projects/polybench/polybench.py | from os import path
from benchbuild.project import Project
from benchbuild.settings import CFG
from benchbuild.utils.compiler import lt_clang
from benchbuild.utils.downloader import Wget
from benchbuild.utils.run import run
from benchbuild.utils.cmd import tar, cp
class PolyBenchGroup(Project):
DOMAIN = 'polybenc... | Python | 0.000003 | @@ -2748,22 +2748,8 @@
%5D)%0A%0A
-# Datamining%0A%0A
%0Acla
|
697ac96146aa1996e9e50aeb89703a2bb8eb5219 | update compact-couchdb management command | mygpo/maintenance/management/commands/compact-couchdb.py | mygpo/maintenance/management/commands/compact-couchdb.py | import sys
from datetime import datetime
from time import sleep
from couchdbkit import Database
from django.core.management.base import BaseCommand
from django.conf import settings
from mygpo.decorators import repeat_on_conflict
from mygpo.core.models import SanitizingRule
from mygpo.utils import progress
class Co... | Python | 0 | @@ -56,16 +56,46 @@
rt sleep
+%0Afrom urlparse import urlparse
%0A%0Afrom c
@@ -120,16 +120,46 @@
atabase%0A
+from restkit import BasicAuth%0A
from dja
@@ -536,18 +536,39 @@
db_url
+s
=
+ set(db%5B1%5D for db in
setting
@@ -590,15 +590,266 @@
ASES
-%5B0%5D%5B1%5D%0A
+)%0A%0A filters = %5B%5D%0A%0A ... |
ff8b7ddbea7980c8464957880a1ae07afed49c64 | Update antibody_lot.py | src/encoded/audit/antibody_lot.py | src/encoded/audit/antibody_lot.py | from ..auditor import (
AuditFailure,
audit_checker,
)
@audit_checker('antibody_lot')
def audit_antibody_lot_target(value, system):
'''
Antibody lots should not have associated characterizations
for different target labels
'''
if value['status'] in ['not pursued', 'deleted']:
retur... | Python | 0 | @@ -631,24 +631,54 @@
ccession'%5D,%0A
+ char%5B'uuid'%5D,%0A
@@ -704,17 +704,16 @@
'label'%5D
-,
%0A
@@ -721,28 +721,16 @@
-char%5B'uuid'%5D
)%0A
|
9cd0098b4e353cfaaa0723ac28a797d7400188b4 | Use jasperpath in brain.py | client/brain.py | client/brain.py | # -*- coding: utf-8-*-
import logging
import os
import pkgutil
import importlib
def logError():
logger = logging.getLogger('jasper')
fh = logging.FileHandler('jasper.log')
fh.setLevel(logging.WARNING)
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
fh.setFormatter(formatter)... | Python | 0.000003 | @@ -73,16 +73,34 @@
portlib%0A
+import jasperpath%0A
%0A%0Adef lo
@@ -1318,58 +1318,30 @@
= %5B
-os.path.join(os.path.dirname(__file__), 'modules')
+jasperpath.PLUGIN_PATH
%5D%0A
|
b0dd91b60c95b6a22f12b785e6cd686d97c2c689 | Clean log configuration after cache_gc tests. | tests/cache_gc_unittest.py | tests/cache_gc_unittest.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2011, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenQuak... | Python | 0.000056 | @@ -948,16 +948,65 @@
tokens%0A%0A
+from tests.utils.helpers import cleanup_loggers%0A%0A
%0Aclass C
@@ -1342,24 +1342,123 @@
RENT_JOBS)%0A%0A
+ def setUp(self):%0A cleanup_loggers()%0A%0A def tearDown(self):%0A cleanup_loggers()%0A%0A
def test
|
763689a72d9453813a8be25f568cce11ba119a2a | Remove old settings from tests module | aldryn_search/tests.py | aldryn_search/tests.py | from django.template import Template
from django.test import TestCase
from django.test.utils import override_settings
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from cms.models.placeholdermodel import Placeholder
from cms.models import CMSPlugin
from aldryn_search.search_indexes... | Python | 0.000001 | @@ -67,56 +67,52 @@
ase%0A
+%0A
from
-django.test.utils import override_settings%0A
+cms.api import create_page, add_plugin
%0Afro
@@ -390,319 +390,8 @@
t%0A%0A%0A
-test_settings = %7B%0A 'ALLOWED_HOSTS': %5B'localhost'%5D,%0A 'CMS_LANGUAGES': %7B1: %5B%7B'code': 'en', 'name': 'English'%7D%5D%7D,%0A 'CMS_... |
bff7cf3d3cc2b636fb46a37b1edb60f7935e646e | Update consultants model | radar/radar/models/consultants.py | radar/radar/models/consultants.py | from sqlalchemy import Integer, Column, String
from sqlalchemy.orm import relationship
from radar.database import db
class Consultant(db.Model):
__tablename__ = 'consultants'
id = Column(Integer, primary_key=True)
first_name = Column(String, nullable=False)
last_name = Column(String, nullable=False)... | Python | 0 | @@ -215,24 +215,67 @@
_key=True)%0A%0A
+ title = Column(String, nullable=False)%0A
first_na
@@ -356,16 +356,114 @@
e=False)
+%0A email = Column(String)%0A telephone_number = Column(String)%0A gmc_number = Column(Integer)
%0A%0A or
|
d650b8798f3f6cb02038206bf41d8e56d4cff420 | Use the option index instead of 'Yes' or 'No'. | src/epiweb/apps/survey/example.py | src/epiweb/apps/survey/example.py | # -*- coding: utf-8 -*-
from epiweb.apps.survey import definitions as d
_ = lambda x: x
class RepQ01(d.Question):
question = _('Did you have one or more of the following symptoms since your last visit?')
type = 'option-multiple'
blank = True
options = (
_('Runny nose'),
_('Stuffy nose'... | Python | 0.001779 | @@ -3944,37 +3944,33 @@
ne'), 'is-not',
-'Yes'
+1
) : (%0A
@@ -4058,21 +4058,17 @@
s-not',
-'Yes'
+1
) : (%0A
|
c26dc22512e9b36a497930df544891cd0d96310b | Remove useless function | utils.py | utils.py | import string
import random
from werkzeug.security import generate_password_hash, check_password_hash
from flask import current_app as app, url_for, redirect, session
from functools import wraps
def hash_password(s):
return generate_password_hash(s)
def check_password(hashed_password, try_password):
return ch... | Python | 0.000904 | @@ -1059,237 +1059,4 @@
ion%0A
-%0Adef convert(dictionary):%0A %22%22%22Recursively converts dictionary keys to strings.%22%22%22%0A if not isinstance(dictionary, dict):%0A return dictionary%0A return dict((str(k), convert(v))%0A for k, v in dictionary.items())%0A
|
8833c91a0292a9fe241d7f47d3a8aa387d23709f | Version up to 3.2.0 | setup.py | setup.py | #!/usr/bin/env python
"""
Sentry
======
Sentry is a realtime event logging and aggregation platform. It specializes
in monitoring errors and extracting all the information needed to do a proper
post-mortem without any of the hassle of the standard user feedback loop.
Sentry is a Server
------------------
The Sentry ... | Python | 0.000001 | @@ -1334,19 +1334,19 @@
sion='3.
-1.4
+2.0
',%0A a
|
c077fb38cc01e38418adf3bf1281074ed6fa80cd | allow empty error messages | utils.py | utils.py | import datetime
import pickle
# extjs special encoder
from django.http import Http404, HttpResponse, HttpResponseRedirect
def set_cookie(response, key, value, days_expire = 7):
if days_expire is None:
max_age = 365*24*60*60 #one year
else:
max_age = days_expire*24*60*60
expires... | Python | 0.000003 | @@ -2470,16 +2470,21 @@
or(error
+ = ''
):%0A r
|
3450712ec629c1720b6a6af28835d95a91b8fce7 | Use classifiers to specify the license. | setup.py | setup.py | #!/usr/bin/python
import os
import re
from setuptools import setup
from m2r import parse_from_file
import restructuredtext_lint
# Parser README.md into reStructuredText format
rst_readme = parse_from_file('README.md')
# Validate the README, checking for errors
errors = restructuredtext_lint.lint(rst_readme)
# Raise ... | Python | 0 | @@ -1330,11 +1330,85 @@
%5D,%0A %7D
+,%0A classifiers=%5B%0A 'License :: OSI Approved :: MIT License'%0A %5D
%0A)%0A
|
22cb94902f5bbe32d636009c2599eae7aa66282c | fix extraction(closes #4319) | youtube_dl/extractor/stretchinternet.py | youtube_dl/extractor/stretchinternet.py | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import int_or_none
class StretchInternetIE(InfoExtractor):
_VALID_URL = r'https?://portal\.stretchinternet\.com/[^/]+/portal\.htm\?.*?\beventId=(?P<id>\d+)'
_TEST = {
'url': 'https://portal.stretchinternet.com/umar... | Python | 0 | @@ -205,22 +205,31 @@
m/%5B%5E/%5D+/
+(?:
portal
+%7Cfull)
%5C.htm%5C?.
@@ -343,22 +343,22 @@
eventId=
-313900
+573272
&streamT
@@ -415,14 +415,14 @@
': '
-313900
+573272
',%0A
@@ -472,122 +472,51 @@
': '
-Augustana (S.D.) Baseball vs University of Mary',%0A 'description': 'md5:7578478614aae3bdd4a90... |
8c9ea5084d85ee26ce7ce04cb75c96edda1979e3 | fix gust being a peice of json | alexBot/cogs/flight.py | alexBot/cogs/flight.py | from datetime import datetime, timezone
import logging
import aiohttp
import discord
import humanize
from discord.ext import commands
log = logging.getLogger(__name__)
from alexBot.tools import Cog, get_json, get_xml
class Flight(Cog):
@commands.command()
async def metar(self, ctx: commands.Context, *, st... | Python | 0.000004 | @@ -5280,16 +5280,24 @@
d_gust'%5D
+%5B'repr'%5D
%7D(True)%5C
@@ -5380,16 +5380,24 @@
d_gust'%5D
+%5B'repr'%5D
%7D%22%0A
|
2b8535c34d92089fe84203f1f06e82472397eaea | Update version number | core/context_processors.py | core/context_processors.py | from django.conf import settings
def common(request=None):
return {'logo_url': settings.LOGO_URL,
'parent_site_url': settings.PARENT_SITE_URL,
'version': '1.3',
'GOOGLE_API_KEY': settings.GOOGLE_API_KEY,
'demo_mode': settings.DEMO}
| Python | 0.000002 | @@ -183,9 +183,9 @@
'1.
-3
+4
',%0A
|
62ccee03efd3fb5d53139f89ae974708d3a82e32 | Add switches for cProfiling and verbosity output | tests/example_peninsula.py | tests/example_peninsula.py | from parcels import NEMOGrid, Particle, ParticleSet
from argparse import ArgumentParser
def pensinsula_example(filename, npart, degree=3):
"""Example configuration of particle flow around an idealised Peninsula
:arg filename: Basename of the input grid file set
:arg npart: Number of particles to intialis... | Python | 0 | @@ -131,16 +131,31 @@
degree=3
+, verbose=False
):%0A %22
@@ -630,16 +630,36 @@
=lat))%0A%0A
+ if verbose:%0A
prin
@@ -682,32 +682,36 @@
cle positions:%22%0A
+
for p in pse
@@ -716,32 +716,36 @@
set._particles:%0A
+
print p%0A
@@ -887,16 +887,36 @@
dt=dt)%0A%0A
+ if verbose... |
2de9eab0a0ed390b6c13d63ba4beaaa70fe8c195 | Normalize matrix log command docstring quotation mark type | Discord/cogs/matrix.py | Discord/cogs/matrix.py |
from discord.ext import commands
import ast
import numpy
import scipy
from utilities import checks
async def setup(bot):
await bot.add_cog(Matrix())
class Matrix(commands.Cog):
# TODO: move to converters file
class Matrix(commands.Converter):
async def convert(self, ctx, argument):
try:
return ast.li... | Python | 0.000001 | @@ -2327,19 +2327,19 @@
rix):%0A%09%09
-'''
+%22%22%22
Compute
@@ -2354,19 +2354,19 @@
ogarithm
-'''
+%22%22%22
%0A%09%09await
|
d5ed783c7dc691d7d0b847aa243989b626d90e9b | Add return None | alg_decimal_to_base.py | alg_decimal_to_base.py | from __future__ import print_function
from ds_stack import Stack
def convert_decimal_to_base2(dec_num):
"""Convert decimal number to binary number."""
rem_stack = Stack()
while dec_num > 0:
rem = dec_num % 2
rem_stack.push(rem)
dec_num = dec_num // 2
bin_str = ''
whil... | Python | 0.999999 | @@ -1086,16 +1086,37 @@
m_stack)
+%0A %0A return None
%0A%0Adef co
@@ -1309,17 +1309,16 @@
_stack)%0A
-%0A
bin_
@@ -1406,17 +1406,16 @@
k.pop()%0A
-%0A
retu
|
0205e519c2662bf33b59e20668f90a17a50c29e1 | Add github URL to setup.py | setup.py | setup.py | # Copyright 2020 The ML Collections Authors.
#
# 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... | Python | 0.000001 | @@ -1199,74 +1199,8 @@
%0A
- # TODO(mohitreddy): Uncomment once private repo is created.%0A #
url
@@ -1498,72 +1498,8 @@
'),%0A
- # TODO(mohitreddy): Double check python versions supported.%0A
|
3419b45d481be416d30abfecdadb26e144bcbcb7 | Correct spelling of template | aiohttp_admin/admin.py | aiohttp_admin/admin.py | from aiohttp_jinja2 import render_template
from aiohttp_security import remember, forget
from yarl import URL
from .consts import TEMPLATE_APP_KEY
from .exceptions import JsonValidaitonError
from .security import authorize
from .utils import json_response, validate_payload, LoginForm
__all__ = ['AdminHandler', 'setu... | Python | 0.000085 | @@ -544,25 +544,25 @@
self._tem
-a
+p
late = templ
@@ -799,25 +799,25 @@
rn self._tem
-a
+p
late%0A%0A @p
@@ -1004,17 +1004,17 @@
elf._tem
-a
+p
late%0A
|
f2b796b94ea1cd9c71500521404ef39d10ca091d | improve to_big_endian_binary function | utils.py | utils.py | from binascii import unhexlify
def to_big_endian_binary(val):
# one (1) hex digit per four (4) bits
width = val.bit_length()
# unhexlify wants an even multiple of eight (8) bits, but we don't
# want more digits than we need (hence the ternary-ish 'or')
width += 8 - ((width % 8) or 8)
# format... | Python | 0.998572 | @@ -1,36 +1,4 @@
-from binascii import unhexlify%0A%0A
def
@@ -32,430 +32,85 @@
-# one (1) hex digit per four (4) bits%0A width = val.bit_length()%0A%0A # unhexlify wants an even multiple of eight (8) bits, but we don't%0A # want more digits than we need (hence the ternary-ish 'or')%0A width += 8 - ... |
4d85b334298bcfc58c9bfd2bdfae123302caa48e | Bump coveralls from 2.1.0 to 2.1.1 (#18) | setup.py | setup.py | #!/usr/bin/env python3
from os import path
from setuptools import setup, find_packages
from ogn.client.settings import PACKAGE_VERSION
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f... | Python | 0 | @@ -1576,9 +1576,9 @@
2.1.
-0
+1
',%0A
|
8fc2e0ebf9fe8f753f7e9cdc6ad67ed22604e022 | support img src attr too | interlinks/interlinks.py | interlinks/interlinks.py | # -*- coding: utf-8 -*-
"""
Interlinks
=========================
This plugin allows you to include "interwiki" or shortcuts links into the blog, as keyword>rest_of_url
"""
from bs4 import BeautifulSoup
from pelican import signals
import re
interlinks = {}
def getSettings (generator):
global interlinks
interl... | Python | 0 | @@ -1002,16 +1002,282 @@
f'%5D = hi
+%0A%09%09if 'img' in content:%0A%09%09%09for img in text.find_all('img', src=re.compile(%22(.+?)%3E%22)):%0A%09%09%09%09url = img.get('src')%0A%09%09%09%09m = re.search(r%22(.+?)%3E%22, url).groups()%0A%09%09%09%09name = m%5B0%5D%0A%09%09%09%09if name in interlinks:%0A%09%09%09%09%... |
24f93c560c2fa19c512d2d88b8e1219690e2db68 | Bump the version up to 0.8 for release | setup.py | setup.py | #!/usr/bin/env python
## Copyright 2014 Cognitect. 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... | Python | 0.000084 | @@ -788,17 +788,17 @@
sion=%220.
-1
+8
.%22+revis
|
f6a2a21d91e06d417da8cd93fb2a28f28385ed19 | fix test | tests/test_coding/test_algos.py | tests/test_coding/test_algos.py | # coding=UTF-8
from __future__ import print_function, absolute_import, division
import six
import unittest
from satella.coding import merge_dicts
class TestMergeDicts(unittest.TestCase):
def test_merge_dicts(self):
tak = merge_dicts({'kupujemy': 'tak'}, {'kupujemy': 'nie'})
nie = merge_dicts({'ku... | Python | 0.000002 | @@ -599,16 +599,28 @@
(set(tak
+%5B'kupujemy'%5D
), set(%5B
|
b09197a38ebbf32abe45a787c475ae6706beaa53 | set ignore property | pyamg/relaxation/info.py | pyamg/relaxation/info.py | """
Relaxation methods
------------------
The multigrid cycle is formed by two complementary procedures: relaxation and
coarse-grid correction. The role of relaxation is to rapidly damp oscillatory
(high-frequency) errors out of the approximate solution. When the error is
smooth, it can then be accurately represent... | Python | 0.000002 | @@ -1189,16 +1189,105 @@
methods.
+%0A#TODO: explain why each class of methods exist (parallel vs. serial, SPD vs. indefinite)
%0A%0Apostpo
|
be8625d983f147385956079c1c1b4bbc2b3ccb17 | fix flake8 | aioresponses/compat.py | aioresponses/compat.py | # -*- coding: utf-8 -*-
import asyncio # noqa: F401
import sys
from typing import Dict, Optional, Tuple, Union # noqa
from urllib.parse import parse_qsl, urlencode
from aiohttp import __version__ as aiohttp_version, StreamReader
from multidict import MultiDict
from pkg_resources import parse_version
from yarl import... | Python | 0 | @@ -1513,16 +1513,29 @@
_init__(
+%0A
self, ur
@@ -1583,16 +1583,25 @@
url: str
+%0A
):%0A
|
5eabe658d3c20f25fa78d1fc4fe2d2d692390e75 | Make requests.get(...) a bit more robust | PowerToThePeople.py | PowerToThePeople.py | #!/usr/bin/env python
import serial
from requests import get
from time import time, strftime, asctime
from sys import stdout
from subprocess import check_output
try:
from config import *
except ImportError:
from defaults import *
print 'Warning! copy defaults.py to config.py and edit that file!'
PVOUTPUT_INTERVAL... | Python | 0 | @@ -55,16 +55,73 @@
ort get%0A
+from requests.exceptions import Timeout, ConnectionError%0A
from tim
@@ -940,16 +940,24 @@
, watt)%0A
+%09%09try:%0A%09
%09%09r = ge
@@ -970,17 +970,17 @@
p://
-localhost
+127.0.0.1
:808
@@ -1001,16 +1001,29 @@
' %25 watt
+, timeout=1.0
)%09#updat
@@ -1032,16 +1032,77 @@
webcach... |
20db5eb25162665e817bef993ea84bbd1b9e3a45 | Update setup.py | setup.py | setup.py | # -*- coding: utf-8 -*-
"""
@author: uwe
"""
import sys
import os
from setuptools import setup
setup(name='feedinlib',
version='0.0.12',
description='Creating time series from pv or wind power plants.',
url='http://github.com/oemof/feedinlib',
author='oemof developer group',
author_email... | Python | 0.000001 | @@ -1,50 +1,4 @@
-# -*- coding: utf-8 -*-%0A%22%22%22%0A@author: uwe%0A%22%22%22%0A%0A
impo
@@ -513,9 +513,9 @@
= 0.
-5
+6
.0',
@@ -558,19 +558,19 @@
ib %3E= 0.
-0.6
+2.0
',%0A
|
888f2ee4c423e18a40cbcaec3eb9f4f29f993e44 | add mock payment as default for OrderPaymentFactory | bluebottle/test/factory_models/payments.py | bluebottle/test/factory_models/payments.py | import factory
from bluebottle.payments.models import Payment, OrderPayment
from bluebottle.payments_logger.models import PaymentLogEntry
from .orders import OrderFactory
class OrderPaymentFactory(factory.DjangoModelFactory):
FACTORY_FOR = OrderPayment
amount = 100
order = factory.SubFactory(OrderFactor... | Python | 0 | @@ -250,24 +250,52 @@
derPayment%0A%0A
+ payment_method = 'mock'%0A
amount =
|
ed13a4d6ea21842568d1ef63797d50169b6dd040 | Add rpath | recipes/py2app/fix_macos_rpath.py | recipes/py2app/fix_macos_rpath.py | """
Tool for initial rpath fix for prebuilt binaries
"""
from __future__ import absolute_import, division, print_function
import os
import glob
from subprocess import CalledProcessError, check_output
# =============================================================================
if __name__ == '__main__':
main_fil... | Python | 0.000002 | @@ -926,16 +926,23 @@
@rpath',
+ 'lib',
lib.spl
@@ -1217,8 +1217,165 @@
ut(cmd)%0A
+ cmd = %5B'install_name_tool', '-add_rpath', os.getenv('PREFIX'), bin_file%5D%0A print(' '.join(cmd))%0A output = check_output(cmd)%0A
|
8ae98e37fbd558f87428255456cc1fa4b5e98a90 | fix for #5 | flaskext/wtf/__init__.py | flaskext/wtf/__init__.py | # -*- coding: utf-8 -*-
"""
flaskext.wtf
~~~~~~~~~~~~
Flask-WTF extension
:copyright: (c) 2010 by Dan Jacob.
:license: BSD, see LICENSE for more details.
"""
import warnings
import uuid
from wtforms.fields import BooleanField, DecimalField, DateField, \
DateTimeField, FieldList, FloatField, ... | Python | 0 | @@ -1529,20 +1529,21 @@
lidation
-F
+Err
or
-m
',%0A
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.