commit
stringlengths
40
40
subject
stringlengths
1
1.49k
old_file
stringlengths
4
311
new_file
stringlengths
4
311
new_contents
stringlengths
1
29.8k
old_contents
stringlengths
0
9.9k
lang
stringclasses
3 values
proba
float64
0
1
90597ba2e70ce73a7531a27f851bdbb27424d04f
Update nbtest.py
newB_in_progress/test/arj/nbtest.py
newB_in_progress/test/arj/nbtest.py
#.*.F means function #see line 28 adding to dict not working #resolved just wrong debug import re operators = ['+','-'] conditionals = ['if','when'] #then replaces the : as in if x=3 : with open('txt.nub','r+') as f: filecontent = f.read()+' <EOF> ' values={} #global so as to be accessible from funcs def parseF(t...
#.*.F means function #see line 28 adding to dict not working import re operators = ['+','-'] conditionals = ['if','when'] #then replaces the : as in if x=3 : with open('txt.nub','r+') as f: filecontent = f.read()+' <EOF> ' values={} #global so as to be accessible from funcs def parseF(textlist): data=textlist i...
Python
0.000001
49ad9b8162a9113f3c4c69818553de2cb6bf66df
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/da541333433f74881d8f44947369756d40d5e7fe.
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "da541333433f74881d8f44947369756d40d5e7fe" TFRT_SHA256 = "df492c902908141405e88af81c4b...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "bdb99de6e7e5fcd5a7e55895bb1c658ea0336136" TFRT_SHA256 = "a251c274cf0bbd805e221677cf49...
Python
0.000001
be0e9cf9a195f44a033bb8b3aeb13febf3cea9cf
Remove check in token credential (#14134)
src/azure-cli/azure/cli/command_modules/storage/oauth_token_util.py
src/azure-cli/azure/cli/command_modules/storage/oauth_token_util.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
Python
0
a8a0e24d9ee90676601a52c564eadb7ff264d5cd
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/356740e3a2bf884abd27b2ca362fe8108a7cd257.
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "356740e3a2bf884abd27b2ca362fe8108a7cd257" TFRT_SHA256 = "c5c806b5f5acb345eca8db4bc49053df60d0b368193f5b...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "b570a1921c9e55ac53c8972bd2bfd37cd0eb510d" TFRT_SHA256 = "01295fc2a90aa2d665890adbe8701e2ae2372028d3b826...
Python
0.000003
ce977d24d49b7e03b6db5b5590e8fc0ddf8e9127
fix the deploy order in the daemon. closes #862
fabfile/daemons.py
fabfile/daemons.py
#!/usr/bin/env python from time import sleep, time from fabric.api import execute, task, env import app_config import sys import traceback def safe_execute(*args, **kwargs): """ Wrap execute() so that all exceptions are caught and logged. """ try: execute(*args, **kwargs) except: ...
#!/usr/bin/env python from time import sleep, time from fabric.api import execute, task, env import app_config import sys import traceback def safe_execute(*args, **kwargs): """ Wrap execute() so that all exceptions are caught and logged. """ try: execute(*args, **kwargs) except: ...
Python
0.000201
7e95e0b8adb4315c8f8a0c5aa8c6ccc588cbee18
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/0d8bae2de531db2e4e4efd3a4e168b39795458b9.
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "0d8bae2de531db2e4e4efd3a4e168b39795458b9" TFRT_SHA256 = "fa7cd1e72eec99562bf916e07122...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "4b2fe81ea82e4c33783b5b62973fbe84dbc6f484" TFRT_SHA256 = "f0e6e0fd3e5245d993cd4146d824...
Python
0.000001
e2d066811a5e943600c170aba0cf797c104d1588
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/5f6e52142a3592d0cfa058dbfd140cad49ed451a.
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "5f6e52142a3592d0cfa058dbfd140cad49ed451a" TFRT_SHA256 = "8e1efbd7df0fdeb5186b178d7c8b...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "736eeebfb56c6d0de138f4a29286140d8c26d927" TFRT_SHA256 = "b584ee5ce5ecaadf289b0997987d...
Python
0
9f47b0cf3d7e26339aaf51dce912db30cc50c587
Debug values
promgen/prometheus.py
promgen/prometheus.py
import collections import json import logging import subprocess import tempfile import requests from django.conf import settings from django.template.loader import render_to_string from promgen import models logger = logging.getLogger(__name__) def check_rules(rules): with tempfile.NamedTemporaryFile(mode='w',...
import collections import json import logging import subprocess import tempfile import requests from django.conf import settings from django.template.loader import render_to_string from promgen import models logger = logging.getLogger(__name__) def check_rules(rules): with tempfile.NamedTemporaryFile(mode='w',...
Python
0.000001
a70e0abdf409d770ddbb9faf3cc66c26fc03b076
fix fbproject tests following new pystan version
tests/test_fbprophet.py
tests/test_fbprophet.py
import unittest import numpy as np import pandas as pd from fbprophet import Prophet class TestFbProphet(unittest.TestCase): def test_fit(self): train = pd.DataFrame({ 'ds': np.array(['2012-05-18', '2012-05-20']), 'y': np.array([38.23, 21.25]) }) forecaster = Prop...
import unittest import numpy as np import pandas as pd from fbprophet import Prophet class TestFbProphet(unittest.TestCase): def test_fit(self): train = pd.DataFrame({ 'ds': np.array(['2012-05-18', '2012-05-20']), 'y': np.array([38.23, 21.25]) }) forecaster = Prop...
Python
0
768d4fa324826d9c96a96be66ea4049a0eb120ed
Move public comment tags into this app from template_utils
comment_utils/templatetags/comment_utils.py
comment_utils/templatetags/comment_utils.py
""" Template tags designed to work with applications which use comment moderation. """ from django import template from django.core.exceptions import ObjectDoesNotExist from django.db.models import get_model from django.contrib.comments.models import Comment, FreeComment from django.contrib.comments.templatetags imp...
Python
0.000002
7461c7b6b729c38194ebb5e88b33e7bcc73b4c9c
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/53604b1779bdbea70bed75fe1695b503e06be323.
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "53604b1779bdbea70bed75fe1695b503e06be323" TFRT_SHA256 = "b2ce14585f2707ec56b013323fde0ff10ddecdf608854d...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "1c915c952cea8e5d290d241b3a0178856a9ec35b" TFRT_SHA256 = "97f8ad0010b924f8489ca04e8e5aa5aea4a69013293e65...
Python
0.000002
0fe76a38aff965aca9f672b48ed4a4933ee10161
add an argument taskid to EventLoopProgressReportWriter.write()
AlphaTwirl/EventReader/EventLoopProgressReportWriter.py
AlphaTwirl/EventReader/EventLoopProgressReportWriter.py
# Tai Sakuma <tai.sakuma@cern.ch> from AlphaTwirl.ProgressBar import ProgressReport ##____________________________________________________________________________|| class EventLoopProgressReportWriter(object): def write(self, taskid, component, event): return ProgressReport( name = component.na...
# Tai Sakuma <tai.sakuma@cern.ch> from AlphaTwirl.ProgressBar import ProgressReport ##____________________________________________________________________________|| class EventLoopProgressReportWriter(object): def write(self, component, event): return ProgressReport(name = component.name, done = event.iEve...
Python
0.000001
662cc443f7c32182aaef89e5b61e90797b7e3e58
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/81d27bd006f86cc3fd3d78a7193583ab9d18367a.
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "81d27bd006f86cc3fd3d78a7193583ab9d18367a" TFRT_SHA256 = "f7cafc8d2b512ff3be61dc5a3d8a3a5bcc3e749b213c1a...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "bd4c5dc54997aaffe6f37a802b106c3ac88f150f" TFRT_SHA256 = "a3ee3c259c5d7ea631177a75195b35bbfb695d69ad70ad...
Python
0.000002
f0d76cae236cded0bfa6cc0f6486efb04daeb133
convert latency to int before posting to cbmonitor
cbagent/collectors/secondary_latency.py
cbagent/collectors/secondary_latency.py
import os.path from cbagent.collectors import Collector class SecondaryLatencyStats(Collector): COLLECTOR = "secondaryscan_latency" def _get_secondaryscan_latency(self): stats = {} if os.path.isfile(self.secondary_statsfile): with open(self.secondary_statsfile, 'rb') as fh: ...
import os.path from cbagent.collectors import Collector class SecondaryLatencyStats(Collector): COLLECTOR = "secondaryscan_latency" def _get_secondaryscan_latency(self): stats = {} if os.path.isfile(self.secondary_statsfile): with open(self.secondary_statsfile, 'rb') as fh: ...
Python
0
69c9322827ed95ce845b49119bc58aa4f36d82bb
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/ecf8607212b519546828e3fcc66f68985597a622.
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "ecf8607212b519546828e3fcc66f68985597a622" TFRT_SHA256 = "545c097a241ff80701e54d1e088762f27a7494980f01c0...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "078534d79809852ea069d23bbacd2483ade18c11" TFRT_SHA256 = "55905ff389c5294ac1ce4be5e3f0af2d171e6061aa886f...
Python
0.000002
66284e57accec5977d606fc91a0b28177b352eb4
Add end-to-end integration testing for all compression types
test/test_producer.py
test/test_producer.py
import pytest from kafka import KafkaConsumer, KafkaProducer from test.conftest import version from test.testutil import random_string @pytest.mark.skipif(not version(), reason="No KAFKA_VERSION set") @pytest.mark.parametrize("compression", [None, 'gzip', 'snappy', 'lz4']) def test_end_to_end(kafka_broker, compressi...
import pytest from kafka import KafkaConsumer, KafkaProducer from test.conftest import version from test.testutil import random_string @pytest.mark.skipif(not version(), reason="No KAFKA_VERSION set") def test_end_to_end(kafka_broker): connect_str = 'localhost:' + str(kafka_broker.port) producer = KafkaProdu...
Python
0
7c12b82cb410540dfa3b65150ce39924b5793bce
handle package.json exceptions
python_package_manager/utils/package_json.py
python_package_manager/utils/package_json.py
import os import json def get_dependencies(): package_file_path = os.path.join(os.getcwd(), 'package.json') try: with open(package_file_path, 'r') as infile: package_dict = json.load(infile) dependencies = package_dict.get("pythonDependencies", []) dependencies_dev = package_dict.get("pythonDevDependencie...
import os import json def get_dependencies(): package_file_path = os.path.join(os.getcwd(), 'package.json') with open(package_file_path, 'r') as infile: package_dict = json.load(infile) dependencies = package_dict.get("pythonDependencies", []) dependencies_dev = package_dict.get("pythonDevDependencies", []) r...
Python
0.000003
b0dd18d4e4e18dafae9d93848f633afc396c91b4
remove outdated/misguided meta __variables__, https://mail.python.org/pipermail/python-dev/2001-March/013328.html
fastly/__init__.py
fastly/__init__.py
from fastly import *
""" """ from fastly import * __author__ = 'Tyler McMullen <tbmcmullen@gmail.com>' __copyright__ = 'Copyright (c) 2012 Fastly Inc' __license__ = 'BSD' __version__ = '0.0.1' __url__ = 'http://www.fastly.com/docs/fastly-py'
Python
0.000065
bc02e845f4a8b726f7474efa77753c7de6fe600b
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/300e7ac61cda0eb2ddb13b7f2ad850d80646adcd.
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "300e7ac61cda0eb2ddb13b7f2ad850d80646adcd" TFRT_SHA256 = "2b79ada8dbacd5de1b868121822ffde58564a1f8749c4f...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "ed6f666ac14b939d7303607c950b88b7d5607c46" TFRT_SHA256 = "b99fed746abe39cb0b072e773af53a4c7189056737fc01...
Python
0.000001
42a147b0dcc24ea51207cca020d2bfc6fa7bde46
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/926650aa8e303d62814e45f709d16673501d96bc.
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "926650aa8e303d62814e45f709d16673501d96bc" TFRT_SHA256 = "f178d137127c3a67962362f596b8...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "d50aae4b79fb4aa5a3c4dd280004313c7f1fda51" TFRT_SHA256 = "3d02021cbd499d749eeb4e3e6bdc...
Python
0
4cbbe7c3ab891a11492f368d780a1416d37358ff
Change the method of generating content of GUID element
feedzilla/syndication.py
feedzilla/syndication.py
# -*- coding: utf-8 -*- # Copyright: 2011, Grigoriy Petukhov # Author: Grigoriy Petukhov (http://lorien.name) # License: BSD from django.contrib.syndication.views import Feed from django.conf import settings from feedzilla.models import Post class PostFeed(Feed): title_template = 'feedzilla/feed/post_title.html...
# -*- coding: utf-8 -*- # Copyright: 2011, Grigoriy Petukhov # Author: Grigoriy Petukhov (http://lorien.name) # License: BSD from django.contrib.syndication.views import Feed from django.conf import settings from feedzilla.models import Post class PostFeed(Feed): title_template = 'feedzilla/feed/post_title.html...
Python
0.000003
4e942272c00c943eb2402a94b86f2c5a0c778ac0
update post_sync tests
tests/test_post_sync.py
tests/test_post_sync.py
import pytest from user_sync.post_sync.manager import PostSyncData @pytest.fixture def example_user(): return { 'type': 'federatedID', 'username': 'user@example.com', 'domain': 'example.com', 'email': 'user@example.com', 'firstname': 'Example', 'lastname': 'User', ...
import pytest from user_sync.post_sync import manager PostSyncManager = manager.PostSyncManager @pytest.fixture def example_user(): return { 'identity_type': 'federatedID', 'username': 'user@example.com', 'domain': 'example.com', 'email': 'user@example.com', 'firstname': 'E...
Python
0
7744aca1edc6afd263ac386efa9a1e92a41c30aa
Add variable PY2
file_metadata/_compat.py
file_metadata/_compat.py
# -*- coding: utf-8 -*- """ Provides utilities to handle the python2 and python3 differences. """ from __future__ import (division, absolute_import, unicode_literals, print_function) import json import re import subprocess import sys try: # Python 3 from urllib.request import urlopen # ...
# -*- coding: utf-8 -*- """ Provides utilities to handle the python2 and python3 differences. """ from __future__ import (division, absolute_import, unicode_literals, print_function) import json import re import subprocess try: # Python 3 from urllib.request import urlopen # flake8: noq...
Python
0.000272
20dc4b6d80842579740ed91ebb848446a0cecdbf
fix test_settings
test_settings.py
test_settings.py
from settings import * __import__('dev-settings', globals(), locals(), ['*'], -1) ROOT_URLCONF = 'urls' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': rel('mirosubs.sqlite3'), } } INSTALLED_APPS += ('django_nose', ) INSTALLED_APPS = list(INSTALLED_APPS) INSTALLED_...
from settings import * ROOT_URLCONF = 'urls' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': rel('mirosubs.sqlite3'), } } INSTALLED_APPS += ('django_nose', ) INSTALLED_APPS = list(INSTALLED_APPS) INSTALLED_APPS.remove('mirosubs') TEST_RUNNER = 'django_nose.NoseTest...
Python
0.000002
555981d288b1e3970e2cb9432db3e72f57ba48b4
deal with zero args corner case and return correct type
finat/pyop2_interface.py
finat/pyop2_interface.py
try: from pyop2.pyparloop import Kernel except: Kernel = None from .interpreter import evaluate def pyop2_kernel(kernel, kernel_args, interpreter=False): """Return a :class:`pyop2.Kernel` from the recipe and kernel data provided. :param kernel: The :class:`~.utils.Kernel` to map to PyOP2. :pa...
try: from pyop2.pyparloop import Kernel except: Kernel = None from .interpreter import evaluate def pyop2_kernel(kernel, kernel_args, interpreter=False): """Return a :class:`pyop2.Kernel` from the recipe and kernel data provided. :param kernel: The :class:`~.utils.Kernel` to map to PyOP2. :pa...
Python
0
dfff8bf474663d4efc02fdd3344054e20a6385ca
Update test_smoothing.py
tests/test_smoothing.py
tests/test_smoothing.py
try: from . import generic as g except BaseException: import generic as g class SmoothTest(g.unittest.TestCase): def test_smooth(self): """ Load a collada scene with pycollada. """ m = g.trimesh.creation.icosahedron() m.vertices, m.faces = g.trimesh.remesh.subdivide...
try: from . import generic as g except BaseException: import generic as g class SmoothTest(g.unittest.TestCase): def test_smooth(self): """ Load a collada scene with pycollada. """ m = g.trimesh.creation.icosahedron() m.vertices, m.faces = g.trimesh.remesh.subdivide...
Python
0.000001
3f85183da738e337d51a8523524eb992e2dd29bf
Reorder tests
tests/test_tictactoe.py
tests/test_tictactoe.py
import unittest from games import TicTacToe class TestTicTacToe(unittest.TestCase): def setUp(self): self.game = TicTacToe() def test_copy(self): self.game.make_moves([1, 3, 2]) clone = self.game.copy() self.assertItemsEqual(self.game.legal_moves(), clone.legal_moves()) ...
import unittest from games import TicTacToe class TestTicTacToe(unittest.TestCase): def setUp(self): self.game = TicTacToe() def test_cur_player_start(self): self.assertEqual(self.game.cur_player, 0) def test_cur_player_after_one_move(self): self.game.make_move(3) self.a...
Python
0
379822ab16229174071172792132cbb549c5f841
celery task for requests
ekanalyzer.py
ekanalyzer.py
import os from flask import Flask from flask import render_template from flask import request, redirect, url_for from werkzeug import secure_filename import hashlib from pymongo import Connection import dpkt import sys import socket from celery import Celery from requests import Request, Session # FIXME: move to ...
import os from flask import Flask from flask import render_template from flask import request, redirect, url_for from werkzeug import secure_filename import hashlib from pymongo import Connection import dpkt import sys import socket from celery import Celery from requests import Request, Session # FIXME: move to ...
Python
0.999885
337f6d67bce331a26b44e65671c63f223f0c5ebc
add help
ckstyle/command/ConsoleCommandParser.py
ckstyle/command/ConsoleCommandParser.py
#/usr/bin/python #encoding=utf-8 import sys import os import getopt import string from ckstyle.doCssCheck import checkFile, checkDir, checkDirRecursively import CommandFileParser def usage(): print ''' [Usage] ckstyle -h / ckstyle --help ckstyle ckstyle file.css ckstyle dir ckstyle -r dir ...
import sys import os import getopt import string from ckstyle.doCssCheck import checkFile, checkDir, checkDirRecursively import CommandFileParser def usage(): print ''' [Usage] ckstyle -h / ckstyle --help ckstyle file.css ckstyle dir ckstyle -r dir ckstyle -p file.css ckstyle -p -r dir ...
Python
0
12a85a17194610f81c9ff0c73ea69f4adfc2b307
remove old routine
floss/render/sanitize.py
floss/render/sanitize.py
import string def sanitize_string_for_printing(s: str) -> str: """ Return sanitized string for printing to cli. """ sanitized_string = s.replace("\\\\", "\\") # print single backslashes sanitized_string = "".join(c for c in sanitized_string if c in string.printable) return sanitized_string
import string def sanitize_string_for_printing(s: str) -> str: """ Return sanitized string for printing to cli. """ sanitized_string = s.replace("\\\\", "\\") # print single backslashes sanitized_string = "".join(c for c in sanitized_string if c in string.printable) return sanitized_string ...
Python
0.000654
8379d56ac1be68c9c1d255893644813df8300ed8
add verbose name
awesomepose/categories/models/category.py
awesomepose/categories/models/category.py
from django.db import models from mptt.models import MPTTModel, TreeForeignKey class Category(MPTTModel): name = models.CharField(max_length=50, unique=True) parent = TreeForeignKey('self', null=True, blank=True, related_name="children", db_index=True) class MPTTMeta: order_insertion_by = ['name'...
from django.db import models from mptt.models import MPTTModel, TreeForeignKey class Category(models.Model): name = models.CharField(max_length=50, unique=True) parent = TreeForeignKey('self', null=True, blank=True, related_name="children", db_index=True) class MPTTMeta: order_insertion_by = ['na...
Python
0.999996
bcd8d27194131e48d73d843bdae9930e6720130f
Update Vartype
dimod/vartypes.py
dimod/vartypes.py
""" Enumeration of valid variable types for binary quadratic models. Examples: This example shows easy access to different Vartypes, which are in the main namespace. >>> vartype = dimod.SPIN >>> print(vartype) Vartype.SPIN >>> vartype = dimod.BINARY >>> print(vartype) Vartype.BINARY ...
""" Vartype is an enumeration of the valid types for variables in a binary quadratic models. Examples: >>> vartype = dimod.Vartype.SPIN >>> print(vartype) Vartype.SPIN >>> isinstance(vartype, dimod.Vartype) True Access can also be by value or name. >>> print(dimod.Vartype({0, 1})) Var...
Python
0
8ed7b3e4367f5ed43a901fee048228c6e6aeeb8c
fix for edge case with invalid user logged in
backend/unpp_api/apps/management/views.py
backend/unpp_api/apps/management/views.py
from django.db.models import Q from django_filters.rest_framework import DjangoFilterBackend from rest_framework.generics import CreateAPIView, ListAPIView, UpdateAPIView from account.models import User from agency.models import AgencyOffice from agency.permissions import AgencyPermission from common.pagination import...
from django.db.models import Q from django_filters.rest_framework import DjangoFilterBackend from rest_framework.generics import CreateAPIView, ListAPIView, UpdateAPIView from account.models import User from agency.models import AgencyOffice from agency.permissions import AgencyPermission from common.pagination import...
Python
0
0cb9b65fc0030922fea122a82451fef0d6d3653b
update version 1.0.0
flyingpigeon/__init__.py
flyingpigeon/__init__.py
from .wsgi import application from .demo import main __version__ = "1.0.0"
from .wsgi import application from .demo import main __version__ = "0.11.0"
Python
0.000001
cfc6083c58d151934403ccf55444b122fec46604
Resolve here
takeyourmeds/utils/test.py
takeyourmeds/utils/test.py
from django.test import TestCase from django.shortcuts import resolve_url from django.contrib.auth import get_user_model User = get_user_model() class TestCase(TestCase): def setUp(self): self.user = self.create_user('testuser') def assertStatusCode(self, status_code, fn, urlconf, *args, **kwargs): ...
from django.test import TestCase from django.shortcuts import resolve_url from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse User = get_user_model() class TestCase(TestCase): def setUp(self): self.user = self.create_user('testuser') def assertStatusCode(self, ...
Python
0
d9ca3d7113423a84026ad59e1369321baa54d532
Add a simple neutron_hanler
drcontroller/replication/controller/neutron_handler.py
drcontroller/replication/controller/neutron_handler.py
import logging import base_handler class NeutronHandler(base_handler.BaseHandler): def __init__(self, set_conf, handle_type): ''' set_conf: the configuration file path of keystone authorization handle_type: the handle service type, eg, glance, nova, neutron ''' self.logger =...
import logging def post_handle(message): pass def delete_handle(message): pass def put_handle(mesage): pass class NeutronHandler(object): def __init__(self): self.logger = logging.getLogger("NeutronHandler") self.logger.info('Init NeutronHandler') def accept(self, *req, **kwarg...
Python
0.999996
ca8622f5af66ef01c9c185065f2e77fca30bef79
Remove unused update method
irctk/nick.py
irctk/nick.py
import re class Nick(object): IRC_USERHOST_REGEX = re.compile(r'^(.*)!(.*)@(.*)$') @classmethod def parse(cls, client, userhost): m = cls.IRC_USERHOST_REGEX.match(userhost) if m: return cls(client, m.group(1), m.group(2), m.group(3)) return cls(client, host=userhost) ...
import re class Nick(object): IRC_USERHOST_REGEX = re.compile(r'^(.*)!(.*)@(.*)$') @classmethod def parse(cls, client, userhost): m = cls.IRC_USERHOST_REGEX.match(userhost) if m: return cls(client, m.group(1), m.group(2), m.group(3)) return cls(client, host=userhost) ...
Python
0.000001
52c17672d73a9461771c3ec09465d91992160fc5
Fix quota init migration
src/nodeconductor_saltstack/exchange/migrations/0004_init_quotas.py
src/nodeconductor_saltstack/exchange/migrations/0004_init_quotas.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from uuid import uuid4 from django.contrib.contenttypes.models import ContentType from django.db import models, migrations GLOBAL_MAILBOX_SIZE_QUOTA = 'global_mailbox_size' USER_COUNT_QUOTA = 'user_count' def convert_mailbox_size_to_mb(apps, schema_e...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from uuid import uuid4 from django.contrib.contenttypes.models import ContentType from django.db import models, migrations GLOBAL_MAILBOX_SIZE_QUOTA = 'global_mailbox_size' USER_COUNT_QUOTA = 'user_count' def convert_mailbox_size_to_mb(apps, schema_e...
Python
0.000002
e91eb6aaad52010b7441595cc55695e6ee21b360
Add support for setting login_service
oauthenticator/azuread.py
oauthenticator/azuread.py
""" Custom Authenticator to use Azure AD with JupyterHub """ import json import jwt import os import urllib from tornado.auth import OAuth2Mixin from tornado.log import app_log from tornado.httpclient import HTTPRequest, AsyncHTTPClient from jupyterhub.auth import LocalAuthenticator from traitlets import Unicode, ...
""" Custom Authenticator to use Azure AD with JupyterHub """ import json import jwt import os import urllib from tornado.auth import OAuth2Mixin from tornado.log import app_log from tornado.httpclient import HTTPRequest, AsyncHTTPClient from jupyterhub.auth import LocalAuthenticator from traitlets import Unicode, ...
Python
0
edebc05d3df68faadc6c0547de7cc06f1469915e
make click example do stuff
fosscon2015/cli_click.py
fosscon2015/cli_click.py
#!/usr/bin/env python import click import json try: from collections import Counter except ImportError: # backport_collections needed for python 2.6 compatibility from backport_collections import Counter @click.command() @click.argument('infile', type=click.File('r'), default='-') @click.argument('outfi...
import click @click.command() def cli(): click.echo("I'm a click CLI.") if __name__ == '__main__': cli()
Python
0.000001
514c6c145e6e2f2c327fb89cfe780eb196508f79
change absolute site url
publishconf.py
publishconf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os import sys sys.path.append(os.curdir) from pelicanconf import * SITEURL = 'http://blog.3strandcode.com/' RELATIVE_URLS =...
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os import sys sys.path.append(os.curdir) from pelicanconf import * SITEURL = 'http://3-strand-code.github.io/3sc-blog/' REL...
Python
0.000001
ca863134d20cda67c6e7f4abf1df595d5d549952
Fix agent changelog command (#3233)
datadog_checks_dev/datadog_checks/dev/tooling/commands/agent/common.py
datadog_checks_dev/datadog_checks/dev/tooling/commands/agent/common.py
# (C) Datadog, Inc. 2019 # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) from semver import parse_version_info from ...git import git_tag_list def get_agent_tags(since, to): """ Return a list of tags from integrations-core representing an Agent release, sorted by more re...
# (C) Datadog, Inc. 2019 # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) from ...git import git_tag_list def get_agent_tags(since, to): """ Return a list of tags from integrations-core representing an Agent release, sorted by more recent first. """ agent_tags = gi...
Python
0
2988d50cdef4a2c617f20817911826f2f7863f0e
Fix string comparison in the fedimg proc.
fedmsg_meta_fedora_infrastructure/fedimg.py
fedmsg_meta_fedora_infrastructure/fedimg.py
# This file is part of fedmsg. # Copyright (C) 2014 Red Hat, Inc. # # fedmsg is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. #...
# This file is part of fedmsg. # Copyright (C) 2014 Red Hat, Inc. # # fedmsg is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. #...
Python
0.000266
7b585baab70e85e4d28f8827a11c0be9c6cc2938
fix travis
_unittests/ut_cli/test_pymy_install_cli_tool.py
_unittests/ut_cli/test_pymy_install_cli_tool.py
# coding: latin-1 """ @brief test log(time=1s) """ import sys import os import unittest import warnings try: import src except ImportError: path = os.path.normpath( os.path.abspath( os.path.join( os.path.split(__file__)[0], "..", "..")))...
# coding: latin-1 """ @brief test log(time=1s) """ import sys import os import unittest try: import src except ImportError: path = os.path.normpath( os.path.abspath( os.path.join( os.path.split(__file__)[0], "..", ".."))) if path not...
Python
0.000002
07e12dd0942329aadc8fb3ed47b6f088779800b9
fix logcollector
src/bots/outputs/logcollector/logcollector.py
src/bots/outputs/logcollector/logcollector.py
import sys import time import socket from lib.bot import * from lib.utils import * from lib.event import * class LogCollectorBot(Bot): def process(self): event = self.receive_message() if event: data = '' for key, value in event.items(): data...
import sys import time import socket from lib.bot import * from lib.utils import * from lib.event import * try: import simplejson as json except ImportError: import json class LogCollectorBot(Bot): def process(self): event = self.receive_message() if event: dat...
Python
0.000002
cc1d72d68fb46cccdf22e08d416a49b18e4a39b2
Disable cache during CLI tests
tests/whack_cli_test.py
tests/whack_cli_test.py
import os import subprocess import contextlib from nose.tools import istest, assert_equal from whack import cli from whack.sources import SourceTarball from . import whack_test @istest def params_are_passed_to_install_command_as_dict(): argv = [ "whack", "install", "hello=1", "apps/hello", "-p",...
import os import subprocess import contextlib from nose.tools import istest, assert_equal from whack import cli from whack.sources import SourceTarball from . import whack_test @istest def params_are_passed_to_install_command_as_dict(): argv = [ "whack", "install", "hello=1", "apps/hello", "-p",...
Python
0.000001
3ba71de7d03b99376b70cd40de6dfcd45f1d35c0
replace distutils with which
tmscoring/tests/test.py
tmscoring/tests/test.py
from __future__ import division import subprocess import tmscoring import numpy as np from numpy.testing import assert_almost_equal, TestCase from nose.exc import SkipTest from shutil import which class TestAligningBase(TestCase): def test_matrix(self): align_object = tmscoring.Aligning('pdb1.pdb', 'pdb2...
from __future__ import division import subprocess import distutils import tmscoring import numpy as np from numpy.testing import assert_almost_equal, TestCase from nose.exc import SkipTest class TestAligningBase(TestCase): def test_matrix(self): align_object = tmscoring.Aligning('pdb1.pdb', 'pdb2.pdb')...
Python
0.000011
d451814584318ac45cdefa9702c72eb5c15fe690
Fix Flakes Errors: openspending/ui/controllers/home.py
openspending/ui/controllers/home.py
openspending/ui/controllers/home.py
import logging import os import subprocess from pylons import request, tmpl_context as c from pylons.controllers.util import redirect from pylons.i18n import _ from openspending.model import Dataset from openspending.lib.solr_util import dataset_entries from openspending.ui.i18n import set_session_locale from openspe...
import logging import os import random import subprocess from datetime import datetime from pylons import request, response, tmpl_context as c, url, config from pylons.controllers.util import redirect from pylons.decorators.cache import beaker_cache from pylons.i18n import _ from openspending.model import Dataset fro...
Python
0.000013
7db11fa7aad4b53a1f50988e83de2abfbae61dde
Fix the senddeletionnotices command to take into account the new default SMS limit.
hc/accounts/management/commands/senddeletionnotices.py
hc/accounts/management/commands/senddeletionnotices.py
from datetime import timedelta import time from django.conf import settings from django.core.management.base import BaseCommand from django.utils.timezone import now from hc.accounts.models import Profile, Member from hc.api.models import Ping from hc.lib import emails class Command(BaseCommand): help = """Send ...
from datetime import timedelta import time from django.conf import settings from django.core.management.base import BaseCommand from django.utils.timezone import now from hc.accounts.models import Profile, Member from hc.api.models import Ping from hc.lib import emails class Command(BaseCommand): help = """Send ...
Python
0
43ab753c4a9892c55f115a4dd5345e94c4bb5d41
Fix auth initialization logging
opwen_email_server/services/auth.py
opwen_email_server/services/auth.py
from ast import literal_eval from os import environ from typing import Callable from typing import Mapping from opwen_email_server.utils.log import LogMixin class EnvironmentAuth(LogMixin): def __init__(self, client_to_domain: Mapping[str, str]=None, envgetter: Callable[[str, str], str]=environ...
from ast import literal_eval from os import environ from typing import Callable from typing import Mapping from opwen_email_server.utils.log import LogMixin class EnvironmentAuth(LogMixin): def __init__(self, client_to_domain: Mapping[str, str]=None, envgetter: Callable[[str, str], str]=environ...
Python
0.000004
5118104dad921128e4dec0cd1ea00aa7d854c0a9
fix token create params to match new keystone - this change will need to be ported to novaclient
openstackx/auth/tokens.py
openstackx/auth/tokens.py
from openstackx.api import base class Tenant(base.Resource): def __repr__(self): return "<Tenant %s>" % self._info @property def id(self): return self._info['id'] @property def description(self): return self._info['description'] @property def enabled(self): ...
from openstackx.api import base class Tenant(base.Resource): def __repr__(self): return "<Tenant %s>" % self._info @property def id(self): return self._info['id'] @property def description(self): return self._info['description'] @property def enabled(self): ...
Python
0
180b7810cdc9a2a17a13c184fc2143f9a5f10cd6
change var name article to container (opps 0.2) in sitemap generator class
opps/sitemaps/sitemaps.py
opps/sitemaps/sitemaps.py
# -*- coding: utf-8 -*- from django.contrib.sitemaps import GenericSitemap as DjangoGenericSitemap from django.contrib.sitemaps import Sitemap as DjangoSitemap from django.utils import timezone from opps.containers.models import Container def InfoDisct(googlenews=False): container = Container.objects.filter(date...
# -*- coding: utf-8 -*- from django.contrib.sitemaps import GenericSitemap as DjangoGenericSitemap from django.contrib.sitemaps import Sitemap as DjangoSitemap from django.utils import timezone from opps.containers.models import Container def InfoDisct(googlenews=False): article = Container.objects.filter(date_a...
Python
0
ba92d4b5854f31b97255c98b83d8dfb8874c8668
Fix arg list for thumbnailpath override
frontend/src/indexing.py
frontend/src/indexing.py
#!/usr/bin/env python from pymongo import MongoClient #from subprocess import Popen, PIPE import FindVid as fv from sys import argv, exit import hashlib import os def hashFile(filename, blocksize): hash = hashlib.sha1() with open(filename, 'rb') as f: buffer = f.read(blocksize) while len(buffer) > 0: hash.upd...
#!/usr/bin/env python from pymongo import MongoClient #from subprocess import Popen, PIPE import FindVid as fv from sys import argv, exit import hashlib import os def hashFile(filename, blocksize): hash = hashlib.sha1() with open(filename, 'rb') as f: buffer = f.read(blocksize) while len(buffer) > 0: hash.upd...
Python
0.000002
0d01756c1db9a6c19d263edadeda775adf5291af
Add unit tests on the sphinxext indent function
oslo_policy/tests/test_sphinxext.py
oslo_policy/tests/test_sphinxext.py
# Copyright 2017 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 writin...
# Copyright 2017 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 writin...
Python
0.000029
f127f0e9bb0b8778feafbdbc1fa68e79a923d639
Update product listing test to use product ids rather than index
whats_fresh/whats_fresh_api/tests/views/entry/test_list_products.py
whats_fresh/whats_fresh_api/tests/views/entry/test_list_products.py
from django.test import TestCase from django.core.urlresolvers import reverse from whats_fresh_api.models import * from django.contrib.gis.db import models import json class ListProductTestCase(TestCase): fixtures = ['test_fixtures'] def test_url_endpoint(self): url = reverse('entry-list-products') ...
from django.test import TestCase from django.core.urlresolvers import reverse from whats_fresh_api.models import * from django.contrib.gis.db import models import json class ListProductTestCase(TestCase): fixtures = ['test_fixtures'] def test_url_endpoint(self): url = reverse('entry-list-products') ...
Python
0
266ee5a6798c1fe09e9c6b36ee5831a1060b4624
Fix lust.py
python/lust.py
python/lust.py
#!/usr/bin/env python class LustObject(object): # executes the command def handle(self, arguments): pass def print_help(self): pass class FactorialCommand(LustObject): def handle(self, arguments): try: argument = int(arguments[0]) except (ValueError, IndexError): print("fact: could not read inte...
#!/usr/bin/env python class LustObject(object): # executes the command def handle(self, arguments): pass def print_help(self): pass class FactorialCommand(LustObject): def handle(self, arguments): try: argument = int(arguments[0]) except (ValueError, IndexError): print("fact: could not read inte...
Python
0.000004
0c0613f8b5719e396d6a053201c32482f95bdb7f
simplified the dict merging. small fix
qface/utils.py
qface/utils.py
def merge(a, b): "merges b into a recursively if a and b are dicts" for key in b: if isinstance(a.get(key), dict) and isinstance(b.get(key), dict): merge(a[key], b[key]) else: a[key] = b[key] return a
def merge(a, b, path=None): "merges b into a" # import pdb; pdb.set_trace() path = path or [] for key in b: if key in a: if isinstance(a[key], dict) and isinstance(b[key], dict): merge(a[key], b[key], path + [str(key)]) else: a[key] = b[k...
Python
0.999987
12b34fc09baa5060495e25e57680d1f6170559c5
Enable estimation reports for FPBŻ
addons/bestja_configuration_fpbz/__openerp__.py
addons/bestja_configuration_fpbz/__openerp__.py
# -*- coding: utf-8 -*- { 'name': "Bestja: FBŻ", 'summary': "Installation configuration for FPBŻ", 'description': "Installation configuration for Federacja Polskich Banków Żywności", 'author': "Laboratorium EE", 'website': "http://www.laboratorium.ee", 'version': '0.1', 'category': 'Specific...
# -*- coding: utf-8 -*- { 'name': "Bestja: FBŻ", 'summary': "Installation configuration for FPBŻ", 'description': "Installation configuration for Federacja Polskich Banków Żywności", 'author': "Laboratorium EE", 'website': "http://www.laboratorium.ee", 'version': '0.1', 'category': 'Specific...
Python
0
a0b488490ad32f7251e0ec2a35607a78c3022695
FIx Entity.save signature in alias loader.
grano/service/aliases.py
grano/service/aliases.py
import logging from unicodecsv import DictReader, DictWriter from grano.core import db from grano.model import Entity, Schema log = logging.getLogger(__name__) ## Import commands def import_aliases(path): with open(path, 'r') as fh: reader = DictReader(fh) for row in reader: data = {...
import logging from unicodecsv import DictReader, DictWriter from grano.core import db from grano.model import Entity, Schema log = logging.getLogger(__name__) ## Import commands def import_aliases(path): with open(path, 'r') as fh: reader = DictReader(fh) for row in reader: data = {...
Python
0
d7b27052db97aafe920530a2b40db571cef495ff
add locking to config file
tools/lib/configfile.py
tools/lib/configfile.py
# # Configuration file parser (a wrapper around SafeConfigParser class) # # Note: characters "[]," are interpreted as meta-symbols and cannot be part of config values! import ConfigParser, threading class ConfigFile(object): def __init__(self, filename, defaults = {}, automaticSections = False): self.cfg...
# # Configuration file parser (a wrapper around SafeConfigParser class) # # Note: characters "[]," are interpreted as meta-symbols and cannot be part of config values! import ConfigParser class ConfigFile(object): def __init__(self, filename, defaults = {}, automaticSections = False): self.cfg = ConfigPa...
Python
0.000001
7856a9f7e63c6a5146dc6976686e22420155f80c
if heroku debug=False
app.py
app.py
from flask import Flask, render_template, jsonify, request from get_solution import Solution import os app = Flask(__name__) @app.route('/') @app.route('/index') def index(): return render_template('base.html', title="Codeforces Solution by Handle Name") @app.route('/get_solution', methods=['POST', 'GET']) def get...
from flask import Flask, render_template, jsonify, request from get_solution import Solution app = Flask(__name__) @app.route('/') @app.route('/index') def index(): return render_template('base.html', title="Codeforces Solution by Handle Name") @app.route('/get_solution', methods=['POST', 'GET']) def get_solution(...
Python
0.999999
2dc3e7eb3e6e5b32347d24d5353f9a5f0f6915c2
Create app.py
app.py
app.py
#!/usr/bin/env python import urllib import json import os import time from flask import Flask from flask import request from flask import make_response from datetime import datetime # Flask app should start in global layout app = Flask(__name__) @app.route('/webhook', methods=['POST']) def webhook(): req = req...
#!/usr/bin/env python import urllib import json import os import time from flask import Flask from flask import request from flask import make_response from datetime import datetime # Flask app should start in global layout app = Flask(__name__) @app.route('/webhook', methods=['POST']) def webhook(): req = req...
Python
0.000003
cb5aa965254c6abe3a865747e823fbe90f894a2c
return addresses as 'items'
app.py
app.py
from flask import Flask, Response, url_for, request, json import os import urllib2 import datetime app = Flask(__name__) @app.route('/hello') def hello(): return 'Hello world' @app.route('/') def index(): response_data = json.dumps({ 'closures_href': url_for('closures') }) response = Response(response_data, st...
from flask import Flask, Response, url_for, request, json import os import urllib2 import datetime app = Flask(__name__) @app.route('/hello') def hello(): return 'Hello world' @app.route('/') def index(): response_data = json.dumps({ 'closures_href': url_for('closures') }) response = Response(response_data, st...
Python
0.999977
32cb09df8f8c62bdc2ba5331b46b217abed49705
Falling back to batch mode should be a WARNING not ERROR
rootpy/logger/roothandler.py
rootpy/logger/roothandler.py
import ctypes import logging import re import sys from . import root_logger, log from .magic import DANGER, set_error_handler, re_execute_with_exception class SHOWTRACE: enabled = False SANE_REGEX = re.compile("^[^\x80-\xFF]*$") class Initialized: value = False ABORT_LEVEL = log.ERROR def fixup_msg(lvl, m...
import ctypes import logging import re import sys from . import root_logger, log from .magic import DANGER, set_error_handler, re_execute_with_exception class SHOWTRACE: enabled = False SANE_REGEX = re.compile("^[^\x80-\xFF]*$") class Initialized: value = False ABORT_LEVEL = log.ERROR def python_logging_e...
Python
0.999601
070589ee7dba86dd3d0a8928ebdd331d4faaa0c6
Remove pdf_file field from plugin
addons/plugin_thunderbird/plugin_thunderbird.py
addons/plugin_thunderbird/plugin_thunderbird.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
Python
0
8dbe0a3f0b9371ef63b099389fc2a8e12b2632c6
test button
app.py
app.py
#!/usr/bin/env python from urllib.parse import urlparse, urlencode from urllib.request import urlopen, Request from urllib.error import HTTPError import json import os from flask import Flask from flask import request from flask import make_response # Flask app should start in global layout app = Flask(__name__) ...
#!/usr/bin/env python from __future__ import print_function from future.standard_library import install_aliases install_aliases() from urllib.parse import urlparse, urlencode from urllib.request import urlopen, Request from urllib.error import HTTPError import json import os from flask import Flask from flask impor...
Python
0.000002
052dc22a82267d381636f5f5fbbf4b5149ffb518
check if the values are empty before adding the data
gui/specieslistdialog.py
gui/specieslistdialog.py
# -*- coding: utf8 -*- from PyQt4 import QtGui, QtCore class speciesListDialog(QtGui.QDialog): _tableview = None def __init__(self, parent, app): QtGui.QDialog.__init__(self, parent) self._app = app self._parent = parent self.initUI() self.setWindowTitle('List species') self.show() def initUI(self):...
# -*- coding: utf8 -*- from PyQt4 import QtGui, QtCore class speciesListDialog(QtGui.QDialog): _tableview = None def __init__(self, parent, app): QtGui.QDialog.__init__(self, parent) self._app = app self._parent = parent self.initUI() self.setWindowTitle('List species') self.show() def initUI(self):...
Python
0.000005
ffe23433056e0a710f81bb22a9161cdaf3ff2c12
fix format call for python 2.6
moban/filters/repr.py
moban/filters/repr.py
from moban.extensions import JinjaFilter @JinjaFilter('repr') def repr_function(string): if isinstance(string, list): return ["'{0}'".format(str(element)) for element in string] else: return "'{0}'".format(str(string))
from moban.extensions import JinjaFilter @JinjaFilter('repr') def repr_function(string): if isinstance(string, list): return ["'{}'".format(str(element)) for element in string] else: return "'{}'".format(str(string))
Python
0.000003
9255fd2c34a403b14b423628f47b7a7419c0d526
update language lexer translations
packages/wakatime/wakatime/stats.py
packages/wakatime/wakatime/stats.py
# -*- coding: utf-8 -*- """ wakatime.stats ~~~~~~~~~~~~~~ Stats about files :copyright: (c) 2013 Alan Hamlett. :license: BSD, see LICENSE for more details. """ import logging import os import sys if sys.version_info[0] == 2: sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__f...
# -*- coding: utf-8 -*- """ wakatime.stats ~~~~~~~~~~~~~~ Stats about files :copyright: (c) 2013 Alan Hamlett. :license: BSD, see LICENSE for more details. """ import logging import os import sys if sys.version_info[0] == 2: sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__f...
Python
0
b91c15f745d18bba4a884666cd3bd7eb87f82943
Bind to 0.0.0.0.
bot.py
bot.py
import functools import os from bottle import Bottle, request, jinja2_view view = functools.partial(jinja2_view, template_lookup=['templates']) app = Bottle() @app.get('/') @view('home.html') def instructions(): return {} @app.post('/') def do_correlation(): data = request.json print data return "H...
import functools import os from bottle import Bottle, request, jinja2_view view = functools.partial(jinja2_view, template_lookup=['templates']) app = Bottle() @app.get('/') @view('home.html') def instructions(): return {} @app.post('/') def do_correlation(): data = request.json print data return "H...
Python
0.997724
324cae7bc3d8d758205a0760dffd8d78ce611d48
Increase tweet length
bot.py
bot.py
#!/usr/bin/python # -*- coding: utf-8 -*- import tweepy import datetime import os import os.path import requests import json from models import Aufmacher, Author, Image, TweetJob from config import db from playhouse.shortcuts import model_to_dict from secrets import twitter_secrets def tweet(tweetjob): href = t...
#!/usr/bin/python # -*- coding: utf-8 -*- import tweepy import datetime import os import os.path import requests import json from models import Aufmacher, Author, Image, TweetJob from config import db from playhouse.shortcuts import model_to_dict from secrets import twitter_secrets def tweet(tweetjob): href = t...
Python
0.998431
afc1c7331e683aeffe05a914780a5ec60cdbf81b
use 4GB RAM for garmin
conversion_service/converters/converter.py
conversion_service/converters/converter.py
import os import shutil import subprocess import time from converters import garmin_converter from converters import gis_converter from converters.gis_converter.bootstrap import bootstrap from utils import chg_dir_with class Conversion(object): def __init__(self, formats, output_dir, osm_pbf_path, basename='osma...
import os import shutil import subprocess import time from converters import garmin_converter from converters import gis_converter from converters.gis_converter.bootstrap import bootstrap from utils import chg_dir_with class Conversion(object): def __init__(self, formats, output_dir, osm_pbf_path, basename='osma...
Python
0.000001
22c9ac7807ad493e9b2b0b97f4299cc87b316ada
Fix copy_resources overwrite.
modelmanager/utils.py
modelmanager/utils.py
"""All handy, general utility functionality used throughout the package.""" import os import os.path as osp import fnmatch import shutil def load_module_path(name, path): """Load a python module source file python version aware.""" if True: # PY==27 import imp m = imp.load_source(name, path)...
"""All handy, general utility functionality used throughout the package.""" import os import os.path as osp import fnmatch import shutil def load_module_path(name, path): """Load a python module source file python version aware.""" if True: # PY==27 import imp m = imp.load_source(name, path)...
Python
0
3d52eca5b9a7cddcd1d2b67547c22c28847aa085
fix print format for python3
tools/run_tests/start_port_server.py
tools/run_tests/start_port_server.py
#!/usr/bin/env python2.7 # Copyright 2017 gRPC 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 l...
#!/usr/bin/env python2.7 # Copyright 2017 gRPC 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 l...
Python
0.000027
6561ea0b329b2f42126dc23eab59676de305dd73
remove unused imports
flask_wtf/forms.py
flask_wtf/forms.py
from __future__ import absolute_import import jinja2 from flask import request, session, current_app from wtforms.ext.csrf.session import SessionSecureForm from wtforms.fields import HiddenField class Form(SessionSecureForm): "Implements a SessionSecureForm using app.SECRET_KEY and flask.session obj" def __i...
from __future__ import absolute_import import jinja2 import wtforms from flask import request, session, current_app from wtforms.ext.csrf.session import SessionSecureForm from wtforms.fields import HiddenField class Form(SessionSecureForm): "Implements a SessionSecureForm using app.SECRET_KEY and flask.session o...
Python
0.000001
413057374d55d851fa4717a66a0975f29b131f4f
Fix bytes output
cli.py
cli.py
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Created on Wed Dec 30 13:58:24 2015 @author: mdurant """ import argparse import hdfs import sys import inspect parser = argparse.ArgumentParser(description='HDFS commands') parser.add_argument("command", help="filesystem command to run") parser.add_argument("par1", ...
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Created on Wed Dec 30 13:58:24 2015 @author: mdurant """ import argparse import hdfs import sys import inspect parser = argparse.ArgumentParser(description='HDFS commands') parser.add_argument("command", help="filesystem command to run") parser.add_argument("par1", ...
Python
0
a55a7162de4e237b4079c0517367ef23b7aa8b01
PodcastList.by_rating() should return a list
mygpo/share/models.py
mygpo/share/models.py
from random import random from couchdbkit.ext.django.schema import * from django.template.defaultfilters import slugify from mygpo.core.proxy import DocumentABCMeta from mygpo.users.models import RatingMixin from mygpo.cache import cache_result class PodcastList(Document, RatingMixin): """ A list of Podcasts ...
from random import random from couchdbkit.ext.django.schema import * from django.template.defaultfilters import slugify from mygpo.core.proxy import DocumentABCMeta from mygpo.users.models import RatingMixin from mygpo.cache import cache_result class PodcastList(Document, RatingMixin): """ A list of Podcasts ...
Python
0.999999
72fa091716e1e0d40a8219701da94bee6d49c58b
remove debugging
csw.py
csw.py
#!/usr/bin/python -u # -*- coding: iso-8859-15 -*- # ================================================================= # # $Id$ # # Authors: Tom Kralidis <tomkralidis@hotmail.com> # # Copyright (c) 2010 Tom Kralidis # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and ...
#!/usr/bin/python -u # -*- coding: iso-8859-15 -*- # ================================================================= # # $Id$ # # Authors: Tom Kralidis <tomkralidis@hotmail.com> # # Copyright (c) 2010 Tom Kralidis # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and ...
Python
0.000065
82bf7fbf5c92c29f058df06ba3828002322f6bf3
Add Qantas 94 Heavy to privileged Tavern users
globalvars.py
globalvars.py
import os from datetime import datetime from ChatExchange.chatexchange.client import Client import HTMLParser import md5 class GlobalVars: false_positives = [] whitelisted_users = [] blacklisted_users = [] ignored_posts = [] auto_ignored_posts = [] startup_utc = datetime.utcnow().strftime("%H:...
import os from datetime import datetime from ChatExchange.chatexchange.client import Client import HTMLParser import md5 class GlobalVars: false_positives = [] whitelisted_users = [] blacklisted_users = [] ignored_posts = [] auto_ignored_posts = [] startup_utc = datetime.utcnow().strftime("%H:...
Python
0
0b600e96f4778ea7f82f357cdadfd97967ecbe86
Add PeterJ to privileged Tavern users
globalvars.py
globalvars.py
import os from datetime import datetime from ChatExchange.chatexchange.client import Client import HTMLParser import md5 class GlobalVars: false_positives = [] whitelisted_users = [] blacklisted_users = [] ignored_posts = [] auto_ignored_posts = [] startup_utc = datetime.utcnow().strftime("%H:...
import os from datetime import datetime from ChatExchange.chatexchange.client import Client import HTMLParser import md5 class GlobalVars: false_positives = [] whitelisted_users = [] blacklisted_users = [] ignored_posts = [] auto_ignored_posts = [] startup_utc = datetime.utcnow().strftime("%H:...
Python
0
1c068004b9e1831bde30be527f20b0d2835c467c
fix multigpu bug
train_policy/trainer.py
train_policy/trainer.py
#!/usr/bin/python3 #-*-coding:utf-8-*- #$File: trainer.py #$Date: Sat May 7 11:00:10 2016 #$Author: Like Ma <milkpku[at]gmail[dot]com> from config import Config from dataset import load_data from model import get_model import tensorflow as tf import argparse def train(args): device = args.device load_path...
#!/usr/bin/python3 #-*-coding:utf-8-*- #$File: trainer.py #$Date: Sat May 7 11:00:10 2016 #$Author: Like Ma <milkpku[at]gmail[dot]com> from config import Config from dataset import load_data from model import get_model import tensorflow as tf import argparse def train(load_path=None): # load data train_da...
Python
0.000001
b666228405e9b23e65d6d631968a7f6f334b6b46
change string for utf8 translation (#48)
translation/samples/snippets/snippets_test.py
translation/samples/snippets/snippets_test.py
# -*- coding: utf-8 -*- # Copyright 2016 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 ...
# -*- coding: utf-8 -*- # Copyright 2016 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 ...
Python
0
19acfbad5db83c20f6e6459f35b63600203ba09c
Test to make sure that the cinder-volumes vg exists
packstack/plugins/cinder_250.py
packstack/plugins/cinder_250.py
""" Installs and configures Cinder """ import logging import packstack.installer.engine_validators as validate from packstack.installer import basedefs import packstack.installer.common_utils as utils from packstack.modules.ospluginutils import getManifestTemplate, appendManifestFile # Controller object will be ini...
""" Installs and configures Cinder """ import logging import packstack.installer.engine_validators as validate from packstack.installer import basedefs import packstack.installer.common_utils as utils from packstack.modules.ospluginutils import getManifestTemplate, appendManifestFile # Controller object will be ini...
Python
0
3b4d8d6ecae3ee1f57dd71af990bb480e6c82d6c
clearly indentify git-checkout as dev version
mitmproxy/version.py
mitmproxy/version.py
IVERSION = (3, 0, 0, 'dev') VERSION = ".".join(str(i) for i in IVERSION) PATHOD = "pathod " + VERSION MITMPROXY = "mitmproxy " + VERSION if __name__ == "__main__": print(VERSION)
IVERSION = (3, 0, 0) VERSION = ".".join(str(i) for i in IVERSION) PATHOD = "pathod " + VERSION MITMPROXY = "mitmproxy " + VERSION if __name__ == "__main__": print(VERSION)
Python
0.999986
7db97dd21b7896f624f37ef44f72445965a65123
provide urls for bug reports. refs #20
h1ds_configdb/version.py
h1ds_configdb/version.py
""" Current h1ds_configdb version constant plus version pretty-print method. Code copied from Fabric: https://github.com/bitprophet/fabric/raw/master/fabric/version.py This functionality is contained in its own module to prevent circular import problems with ``__init__.py`` (which is loaded by setup.py during inst...
""" Current h1ds_configdb version constant plus version pretty-print method. Code copied from Fabric: https://github.com/bitprophet/fabric/raw/master/fabric/version.py This functionality is contained in its own module to prevent circular import problems with ``__init__.py`` (which is loaded by setup.py during inst...
Python
0.999556
833cd8342385fc095181afc3306ce04414bfd447
Add work around for destroying models too quickly.
perfscale_mass_model_destruction.py
perfscale_mass_model_destruction.py
#!/usr/bin/env python """Perfscale test measuring adding and destroying a large number of models. Steps taken in this test: - Bootstraps a provider - Creates x amount of models and waits for them to be ready - Delete all the models at once. """ import argparse from datetime import datetime import logging import...
#!/usr/bin/env python """Perfscale test measuring adding and destroying a large number of models. Steps taken in this test: - Bootstraps a provider - Creates x amount of models and waits for them to be ready - Delete all the models at once. """ import argparse from datetime import datetime import logging import...
Python
0
f29ff5eaa24b0671066f145d76b53e534a574119
Set "text/javascript" type if given a callback
freegeoip/geoip.py
freegeoip/geoip.py
#!/usr/bin/env python # coding: utf-8 # # Copyright 2010 Alexandre Fiori # freegeoip.net # # 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 # #...
#!/usr/bin/env python # coding: utf-8 # # Copyright 2010 Alexandre Fiori # freegeoip.net # # 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 # #...
Python
0.999994
827661e790bd407c29f4d109e428c8f36d44f537
Update ReferralFollow test_form's build_form to allow True, False, None for has_appointment.
pttrack/test_forms.py
pttrack/test_forms.py
'''Module for testing the various custom forms used in Osler.''' import datetime from django.test import TestCase from . import forms from . import models from . import followup_models # pylint: disable=invalid-name class TestReferralFollowupForms(TestCase): ''' Test the validation and behavior of the form...
'''Module for testing the various custom forms used in Osler.''' import datetime from django.test import TestCase from . import forms from . import models from . import followup_models # pylint: disable=invalid-name class TestReferralFollowupForms(TestCase): ''' Test the validation and behavior of the form...
Python
0
c9917b3dc54290bb3fc7c977e8c1db76ac60cf82
Update project queries
polyaxon/api/projects/queries.py
polyaxon/api/projects/queries.py
from django.db.models import Count, Q from db.models.projects import Project projects = Project.objects.select_related('user') projects_details = projects.select_related('repo').annotate( Count('experiments', distinct=True), Count('jobs', distinct=True), Count('build_jobs', distinct=True), Count('exp...
from django.db.models import Count, Q from db.models.projects import Project projects = Project.objects.select_related('user') projects_details = projects.select_related('repo').annotate( Count('experiments', distinct=True), Count('jobs', distinct=True), Count('build_jobs', distinct=True), Count('expe...
Python
0
086b7a7de994e30d2e5defa214eca846862aec59
update default configuration in config
nova/common/config.py
nova/common/config.py
# Copyright 2016 Hewlett Packard Enterprise Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
# Copyright 2016 Hewlett Packard Enterprise Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
Python
0.000001
bc224499e2f4f663a1fe5e41cbfad691e7c04de4
Drop unused import
turbine/code/py/turbine_helpers.py
turbine/code/py/turbine_helpers.py
# Copyright 2013 University of Chicago and Argonne National Laboratory # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
# Copyright 2013 University of Chicago and Argonne National Laboratory # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
Python
0
63cb9a8b3acb78be155bbc770cdd1d06170eccc1
Fix customer filter field.
src/nodeconductor_assembly_waldur/invoices/filters.py
src/nodeconductor_assembly_waldur/invoices/filters.py
import django_filters from django.conf import settings from django.core import exceptions from django.db.models import Q from django import forms from django.utils import timezone from nodeconductor.core import filters as core_filters from nodeconductor.structure import filters as structure_filters from . import model...
import django_filters from django.conf import settings from django.core import exceptions from django.db.models import Q, BooleanField from django.utils import timezone from nodeconductor.core import filters as core_filters from nodeconductor.structure import filters as structure_filters from . import models class I...
Python
0
881a27ab3d4ee0f9f988a7f183bdd0a76b517526
Add additional activation tests.
panda/tests/test_views.py
panda/tests/test_views.py
#!/usr/bin/env python from django.contrib.auth import authenticate from django.test import TransactionTestCase from django.test.client import Client from django.utils import simplejson as json from panda.models import User from panda.tests import utils class TestLogin(TransactionTestCase): fixtures = ['init_pand...
#!/usr/bin/env python from django.contrib.auth import authenticate from django.test import TransactionTestCase from django.test.client import Client from django.utils import simplejson as json from panda.models import User from panda.tests import utils class TestLogin(TransactionTestCase): fixtures = ['init_pand...
Python
0
2e4837721a22985894f932536c45989aaec8006b
Stop printing the exception object.
code/daemon/transporters/transporter.py
code/daemon/transporters/transporter.py
"""transporter.py Transporter class for daemon""" __author__ = "Wim Leers (work@wimleers.com)" __version__ = "$Rev$" __date__ = "$Date$" __license__ = "GPL" import sys import os sys.path.append(os.path.abspath('../dependencies')) from django.core.files.storage import Storage from django.core.files import File # ...
"""transporter.py Transporter class for daemon""" __author__ = "Wim Leers (work@wimleers.com)" __version__ = "$Rev$" __date__ = "$Date$" __license__ = "GPL" import sys import os sys.path.append(os.path.abspath('../dependencies')) from django.core.files.storage import Storage from django.core.files import File # ...
Python
0
fc75f5843af70c09e0d63284277bf88689cbb06d
Add apidoc to doc building
invocations/docs.py
invocations/docs.py
import os from invoke.tasks import task from invoke.runner import run docs_dir = 'docs' build = os.path.join(docs_dir, '_build') @task def clean_docs(): run("rm -rf %s" % build) @task def browse_docs(): run("open %s" % os.path.join(build, 'index.html')) @task def api_docs(target, output="api", exclude=...
import os from invoke.tasks import task from invoke.runner import run docs_dir = 'docs' build = os.path.join(docs_dir, '_build') @task def clean_docs(): run("rm -rf %s" % build) @task def browse_docs(): run("open %s" % os.path.join(build, 'index.html')) @task def docs(clean=False, browse=False): if...
Python
0
0a07f6ac82f099d836eb5276063adab245979258
rename `recall` to `call`
chainer/training/triggers/once_trigger.py
chainer/training/triggers/once_trigger.py
class OnceTrigger(object): """Trigger based on the starting point of the iteration. This trigger accepts only once at starting point of the iteration. There are two ways to specify the starting point: only starting point in whole iteration or called again when training resumed. Args: call...
class OnceTrigger(object): """Trigger based on the starting point of the iteration. This trigger accepts only once at starting point of the iteration. There are two ways to specify the starting point: only starting point in whole iteration or recalled when training resumed. Args: recall_o...
Python
0.002129
2d6906bc58275b18102b4523a4faa5078a6e74f1
fix wrong description (all?)
chainercv/transforms/image/random_crop.py
chainercv/transforms/image/random_crop.py
import random import six def random_crop(img, output_shape, return_slices=False, copy=False): """Crop array randomly into `output_shape`. The input image is cropped by a randomly selected region whose shape is :obj:`output_shape`. Args: img (~numpy.ndarray): An image array to be cropped. Thi...
import random import six def random_crop(img, output_shape, return_slices=False, copy=False): """Crop array randomly into `output_shape`. All arrays will be cropped by the same region randomly selected. The output will all be in shape :obj:`output_shape`. Args: img (~numpy.ndarray): An image...
Python
0.000377
57e177e47bcc54683654e5d0de81af6e0cbd803d
update version
pimat_web/version.py
pimat_web/version.py
__version__ = '0.6.18'
__version__ = '0.6.17'
Python
0
e3b6b9864376f2dabe42b6d80d4a5db65cb85d30
Update docs for 'prep_command()'
src/python/pants/backend/core/targets/prep_command.py
src/python/pants/backend/core/targets/prep_command.py
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.base.payl...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.base.payl...
Python
0.000001
a9ac098ec492739f37005c9bd6278105df0261c5
Add fields to save question url and annexure links
parliamentsearch/items.py
parliamentsearch/items.py
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html import scrapy class MemberofParliament(scrapy.Item): """ Data structure to define Member of Parliament information """ mp_id = scrapy.Field() mp_name = scrapy.F...
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html import scrapy class MemberofParliament(scrapy.Item): """ Data structure to define Member of Parliament information """ mp_id = scrapy.Field() mp_name = scrapy.F...
Python
0