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
9358060c648c0ee71498f173dcbf6fc839ba6ff8
Update expected release date
src/penn_chime/constants.py
src/penn_chime/constants.py
"""Constants.""" from datetime import date """ This reflects a date from which previously-run reports will no longer match current results, indicating when users should re-run their reports """ CHANGE_DATE = date(year=2020, month=4, day=8) VERSION = 'v1.1.3' DATE_FORMAT = "%b, %d" # see https://strftime.org DOCS_UR...
"""Constants.""" from datetime import date """ This reflects a date from which previously-run reports will no longer match current results, indicating when users should re-run their reports """ CHANGE_DATE = date(year=2020, month=4, day=6) VERSION = 'v1.1.3' DATE_FORMAT = "%b, %d" # see https://strftime.org DOCS_UR...
Python
0
da6c8157e688c8c721bd66e5779ce6f550a5a7e2
remove useless code in PathPayment
stellar_sdk/operation/path_payment.py
stellar_sdk/operation/path_payment.py
import warnings from decimal import Decimal from typing import List, Union from .path_payment_strict_receive import PathPaymentStrictReceive from ..asset import Asset class PathPayment(PathPaymentStrictReceive): """The :class:`PathPayment` object, which represents a PathPayment operation on Stellar's network...
import warnings from decimal import Decimal from typing import List, Union from .operation import Operation from ..asset import Asset from ..keypair import Keypair from ..xdr import Xdr from ..strkey import StrKey from .utils import check_ed25519_public_key, check_amount class PathPayment(Operation): """The :cla...
Python
0.000077
2de30c0acdbcc2560ee7c9c472df956441cb2bab
use better filterType
nvchecker_source/vsmarketplace.py
nvchecker_source/vsmarketplace.py
# MIT licensed # Copyright (c) 2013-2021 Th3Whit3Wolf <the.white.wolf.is.1337@gmail.com>, et al. from nvchecker.api import ( VersionResult, Entry, AsyncCache, KeyManager, TemporaryError, session, GetVersionError, ) API_URL = 'https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery' HEADERS = { ...
# MIT licensed # Copyright (c) 2013-2021 Th3Whit3Wolf <the.white.wolf.is.1337@gmail.com>, et al. from nvchecker.api import ( VersionResult, Entry, AsyncCache, KeyManager, TemporaryError, session, GetVersionError, ) API_URL = 'https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery' HEADERS = { ...
Python
0
355372ff51a84c0a6d7d86c0ef1fb12def341436
Add the score to Engine.chat return values
invada/engine.py
invada/engine.py
# -*- coding: utf-8 -*- class Engine: def __init__(self, response_pairs, knowledge={}): self.response_pairs = response_pairs self.knowledge = knowledge def chat(self, user_utterance, context): best_score = 0 best_response_pair = None ...
# -*- coding: utf-8 -*- class Engine: def __init__(self, response_pairs, knowledge={}): self.response_pairs = response_pairs self.knowledge = knowledge def chat(self, user_utterance, context): best_score = 0 best_response_pair = None ...
Python
0.000033
ef29e402c58751a938cb11cee480ac4f4e31aef5
Add warning
invoke/config.py
invoke/config.py
from .vendor.etcaetera.config import Config as EtcConfig from .vendor.etcaetera.adapter import File class Config(object): """ Invoke's primary configuration handling class. See :doc:`/concepts/configuration` for details on the configuration system this class implements, including the :ref:`configurat...
from .vendor.etcaetera.config import Config as EtcConfig from .vendor.etcaetera.adapter import File class Config(object): """ Invoke's primary configuration handling class. See :doc:`/concepts/configuration` for details on the configuration system this class implements, including the :ref:`configurat...
Python
0.000002
aa459c2db7f1995fda486ef80c30b541ff1895d8
Remove unnessesaty params
ocds/databridge/contrib/client.py
ocds/databridge/contrib/client.py
import requests import requests.adapters from gevent.pool import Pool import logging logger = logging.getLogger(__name__) class APIClient(object): def __init__(self, api_key, api_host, api_version, **options): self.base_url = "{}/api/{}".format(api_host, api_version) self.session = requests.S...
import requests import requests.adapters from gevent.pool import Pool import logging logger = logging.getLogger(__name__) class APIClient(object): def __init__(self, api_key, api_host, api_version, **options): self.base_url = "{}/api/{}".format(api_host, api_version) self.session = requests.S...
Python
0.000007
48cb3e901917c598294c5431c66efe6ed56e465a
set DEBUG to true
wsgi/settings.py
wsgi/settings.py
import os MONGO_HOST = os.getenv('OPENSHIFT_NOSQL_DB_HOST') MONGO_PORT = os.getenv('OPENSHIFT_NOSQL_DB_PORT') MONGO_USERNAME = os.getenv('OPENSHIFT_NOSQL_DB_USERNAME') MONGO_PASSWORD = os.getenv('OPENSHIFT_NOSQL_DB_PASSWORD') PRIV_KEY = os.getenv('OPENSHIFT_DATA_DIR') + '/server_private.pem' PUB_KEY = os.getenv('OPEN...
import os MONGO_HOST = os.getenv('OPENSHIFT_NOSQL_DB_HOST') MONGO_PORT = os.getenv('OPENSHIFT_NOSQL_DB_PORT') MONGO_USERNAME = os.getenv('OPENSHIFT_NOSQL_DB_USERNAME') MONGO_PASSWORD = os.getenv('OPENSHIFT_NOSQL_DB_PASSWORD') PRIV_KEY = os.getenv('OPENSHIFT_DATA_DIR') + '/server_private.pem' PUB_KEY = os.getenv('OPEN...
Python
0.999549
99f45d201b3513096bf8ebe7c877c836d8e6611a
Add logging to web client
clients/web/rewebclient/rewebclient.py
clients/web/rewebclient/rewebclient.py
from flask import Flask, request, render_template, flash, redirect, url_for from reclient.client import ReClient, ReClientException import os import logging DEBUG = False SECRET_KEY = 'CHANGE ME' app = Flask(__name__) app.config.from_object(__name__) app.config.from_envvar('REWEBCLIENT_SETTINGS', silent=True) app.c...
from flask import Flask, request, render_template, flash, redirect, url_for from reclient.client import ReClient, ReClientException import os DEBUG = False SECRET_KEY = 'CHANGE ME' app = Flask(__name__) app.config.from_object(__name__) app.config.from_envvar('REWEBCLIENT_SETTINGS', silent=True) app.config['RE_FRONT...
Python
0.000001
bffb0c7fb099039afb444cfc641ae7b1978c59f8
Exit main script when no observations found
ircelsos/main.py
ircelsos/main.py
# -*- coding: utf-8 -*- """ Created on Wed Apr 07 23:11:39 2015 @author: Joris Van den Bossche """ from __future__ import print_function def main(): import argparse parser = argparse.ArgumentParser( prog='ircelsos', description='Download air quality data from the SOS of IRCEL - CELINE.') ...
# -*- coding: utf-8 -*- """ Created on Wed Apr 07 23:11:39 2015 @author: Joris Van den Bossche """ from __future__ import print_function def main(): import argparse parser = argparse.ArgumentParser( prog='ircelsos', description='Download air quality data from the SOS of IRCEL - CELINE.') ...
Python
0
641c7da63b2d7255ed3039d5c26574faa060b333
Stop altering the glance API URL
openstack_dashboard/api/glance.py
openstack_dashboard/api/glance.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
Python
0.000011
e85e1021ae20ebecb344c592f60f2ad6607a1db1
refactor rename variables for clarity
src/main/python/pybuilder/plugins/filter_resources_plugin.py
src/main/python/pybuilder/plugins/filter_resources_plugin.py
# -*- coding: utf-8 -*- # # This file is part of PyBuilder # # Copyright 2011-2014 PyBuilder Team # # 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/l...
# -*- coding: utf-8 -*- # # This file is part of PyBuilder # # Copyright 2011-2014 PyBuilder Team # # 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/l...
Python
0.000002
ab49b0be58975156f96bd5340da8d06f5b8626a5
Change to batch_size = 64
tensorflow_examples/models/nmt_with_attention/distributed_test.py
tensorflow_examples/models/nmt_with_attention/distributed_test.py
# Copyright 2019 The TensorFlow Authors. 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 applica...
# Copyright 2019 The TensorFlow Authors. 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 applica...
Python
0.000689
a59ec3963e0726c291dbde0d26a5f3468e88966c
Add call to audit_orders from cli.py.
2017-code/cli.py
2017-code/cli.py
# cli.py # Ronald L. Rivest (with Karim Husayn Karimi) # July 22, 2017 # python3 """ Command-line parser and dispatch """ import argparse import multi import election_specification import ids import audit import reported ############################################################################## # Command-lin...
# cli.py # Ronald L. Rivest (with Karim Husayn Karimi) # July 22, 2017 # python3 """ Command-line parser and dispatch """ import argparse import multi import election_specification import ids import audit import reported ############################################################################## # Command-lin...
Python
0
ab22a41382f739313d8e5484b4f3d54745e0a888
Removed urllib2 import. should fix #1
BitcoinTicker.py
BitcoinTicker.py
import sublime import sublime_plugin try: from urllib.request import urlopen from urllib.parse import urlparse except ImportError: from urlparse import urlparse from urllib import urlopen import json import re class BitcoinTicker(sublime_plugin.EventListener): def check_for_calc(self): """ If en...
import sublime import sublime_plugin try: from urllib.request import urlopen from urllib.parse import urlparse import urllib2 except ImportError: from urlparse import urlparse from urllib import urlopen import json import re class BitcoinTicker(sublime_plugin.EventListener): def check_for_calc(self): ...
Python
0.999632
93ad5396bb1d574c86a6b3323199e75fe3bb34f4
implement protection for non existing directories
PyAnalysisTools/base/ShellUtils.py
PyAnalysisTools/base/ShellUtils.py
import shutil import os import subprocess def make_dirs(path): path = os.path.expanduser(path) if os.path.exists(path): return try: os.makedirs(path) except OSError as e: raise OSError def resolve_path_from_symbolic_links(symbolic_link, relative_path): def is_symbolic_lin...
import shutil import os import subprocess def make_dirs(path): path = os.path.expanduser(path) if os.path.exists(path): return try: os.makedirs(path) except OSError as e: raise OSError def resolve_path_from_symbolic_links(symbolic_link, relative_path): def is_symbolic_lin...
Python
0
188affe12f31973741ae9b429d8aed757fff0d85
Fixing timestamp = sec * 1000
rockmylight/rockmylight/rml/views.py
rockmylight/rockmylight/rml/views.py
from django.shortcuts import render from django.http import JsonResponse import time # Create your views here. def main(request): context = {} return render(request, 'rml/main.html', context) def jam(request): context = {} return render(request, 'rml/jam.html', context) # API part INTERVAL = 0.5 ...
from django.shortcuts import render from django.http import JsonResponse import time # Create your views here. def main(request): context = {} return render(request, 'rml/main.html', context) def jam(request): context = {} return render(request, 'rml/jam.html', context) # API part INTERVAL = 0.5 ...
Python
0.998776
632f70d64bac45365974db834a3a6ddcb16e13ad
Add GuardianModelMixin in users/models.py
feder/users/models.py
feder/users/models.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.contrib.auth.models import AbstractUser from django.utils.encoding import python_2_unicode_compatible from guardian.mixins import GuardianUserMixin @python_2_unicode_compatible class User(GuardianUserMixin, AbstractUser): ...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.contrib.auth.models import AbstractUser from django.utils.encoding import python_2_unicode_compatible # from django.db import models # from django.utils.translation import ugettext_lazy as _ @python_2_unicode_compatible cla...
Python
0
81b2519f575d35d2f1b735bcaef1901539ee06fa
refactor mgmt cmd update-toplist to use just CouchDB
mygpo/directory/management/commands/update-toplist.py
mygpo/directory/management/commands/update-toplist.py
from datetime import datetime from django.core.management.base import BaseCommand from mygpo.core.models import Podcast, SubscriberData from mygpo.users.models import PodcastUserState from mygpo.utils import progress from mygpo.decorators import repeat_on_conflict class Command(BaseCommand): def handle(self, *...
from datetime import datetime from django.core.management.base import BaseCommand from couchdbkit import ResourceConflict from mygpo.core.models import Podcast, SubscriberData from mygpo.users.models import PodcastUserState from mygpo.utils import progress, multi_request_view from mygpo.decorators import repeat_on_c...
Python
0
85761d00814d1835ace72adb13a43b07b1f5536d
Fix issue #18, don't follow symlinks by default
botbot/checker.py
botbot/checker.py
"""Base class for checking file trees""" import stat import os import time from botbot import problist as pl class Checker: """ Holds a set of checks that can be run on a file to make sure that it's suitable for the shared directory. Runs checks recursively on a given path. """ # checks is a ...
"""Base class for checking file trees""" import stat import os import time from botbot import problist as pl class Checker: """ Holds a set of checks that can be run on a file to make sure that it's suitable for the shared directory. Runs checks recursively on a given path. """ # checks is a ...
Python
0
48e09e446943b695cc7208bc2a7cad7e53437957
Bump to 0.1.1 since I apparently pushed 0.1.0 at some point =/
botox/__init__.py
botox/__init__.py
__version__ = "0.1.1"
__version__ = "0.1.0"
Python
0
b56eb07e06c41dd46d7adaeb0a9b9863c3e165c6
Fix mono
executors/mono_executor.py
executors/mono_executor.py
import sys import os import re import errno from collections import defaultdict from cptbox import CHROOTSecurity, ALLOW from cptbox.syscalls import * from .base_executor import CompiledExecutor from judgeenv import env CS_FS = ['.*\.so', '/proc/(?:self/|xen)', '/dev/shm/', '/proc/stat', '/usr/lib/mono', '/...
import sys import os import re import errno from collections import defaultdict from cptbox import CHROOTSecurity, ALLOW from cptbox.syscalls import * from .base_executor import CompiledExecutor from judgeenv import env CS_FS = ['.*\.so', '/proc/(?:self/|xen)', '/dev/shm/', '/proc/stat', '/usr/lib/mono', '/...
Python
0.000018
68b1b9d824da9225b8b568348a56d5770195d8f8
Fix method with classmethod
openassessment/xblock/openassesment_template_mixin.py
openassessment/xblock/openassesment_template_mixin.py
class OpenAssessmentTemplatesMixin(object): """ This helps to get templates for different type of assessment that is offered. """ @classmethod def templates(cls): """ Returns a list of dictionary field: value objects that describe possible templates. VALID_ASSESSMENT_TY...
class OpenAssessmentTemplatesMixin(object): """ This helps to get templates for different type of assessment that is offered. """ @classmethod def templates(cls): """ Returns a list of dictionary field: value objects that describe possible templates. VALID_ASSESSMENT_TY...
Python
0
fa0b16b46fe014be9009bc595bee719cc1fdcc31
don't divide by zero
apps/amo/management/commands/clean_redis.py
apps/amo/management/commands/clean_redis.py
import logging import os import socket import subprocess import sys import tempfile import time from django.core.management.base import BaseCommand import redisutils import redis as redislib log = logging.getLogger('z.redis') # We process the keys in chunks of size CHUNK. CHUNK = 3000 # Remove any sets with less th...
import logging import os import socket import subprocess import sys import tempfile import time from django.core.management.base import BaseCommand import redisutils import redis as redislib log = logging.getLogger('z.redis') # We process the keys in chunks of size CHUNK. CHUNK = 3000 # Remove any sets with less th...
Python
0.999407
69582dd80518ccc29fc8de9cf5bff54caf62468b
Truncate to exact length
src/sentry/utils/strings.py
src/sentry/utils/strings.py
""" sentry.utils.strings ~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import base64 import zlib def truncatechars(value, arg): """ Truncates a string after a certain number of chars. Argument: Number of ...
""" sentry.utils.strings ~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import base64 import zlib def truncatechars(value, arg): """ Truncates a string after a certain number of chars. Argument: Number of ...
Python
0.000002
a8fb92840ff487c61564175efbf637fec538b480
Add signup view to fix error
features/gestalten/urls.py
features/gestalten/urls.py
from allauth.socialaccount import views as socialaccount_views from allauth.socialaccount.providers.facebook import views as facebook_views from django.conf.urls import url from . import views urlpatterns = [ url( r'^stadt/gestalten/$', views.List.as_view(), name='gestalten'), url( ...
from allauth.socialaccount import views as socialaccount_views from allauth.socialaccount.providers.facebook import views as facebook_views from django.conf.urls import url from . import views urlpatterns = [ url( r'^stadt/gestalten/$', views.List.as_view(), name='gestalten'), url( ...
Python
0
1d52996a88eb5aed643fe61ee959bd88373401b3
Throw a linebreak in there upon completion
filebutler_upload/utils.py
filebutler_upload/utils.py
from datetime import datetime, timedelta import sys class ProgressBar(object): def __init__(self, filename, fmt): self.filename = filename self.fmt = fmt self.progress = 0 self.total = 0 self.time_started = datetime.now() self.time_updated = self.time_started d...
from datetime import datetime, timedelta import sys class ProgressBar(object): def __init__(self, filename, fmt): self.filename = filename self.fmt = fmt self.progress = 0 self.total = 0 self.time_started = datetime.now() self.time_updated = self.time_started d...
Python
0.000003
42eae4634f4bab5649298a65889a4b1a3149d586
Use new invalidate_many cache invalidation to invalidate the event_push_actions cache appropriately.
synapse/storage/event_push_actions.py
synapse/storage/event_push_actions.py
# -*- coding: utf-8 -*- # Copyright 2015 OpenMarket Ltd # # 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 la...
# -*- coding: utf-8 -*- # Copyright 2015 OpenMarket Ltd # # 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 la...
Python
0
07f96a22afe2d010809d03077d9cdd5ecb43d017
Update data source unique name migration to support another name of constraint
migrations/0020_change_ds_name_to_non_uniqe.py
migrations/0020_change_ds_name_to_non_uniqe.py
from redash.models import db import peewee from playhouse.migrate import PostgresqlMigrator, migrate if __name__ == '__main__': migrator = PostgresqlMigrator(db.database) with db.database.transaction(): # Change the uniqueness constraint on data source name to be (org, name): success = False ...
from redash.models import db from playhouse.migrate import PostgresqlMigrator, migrate if __name__ == '__main__': migrator = PostgresqlMigrator(db.database) with db.database.transaction(): # Change the uniqueness constraint on data source name to be (org, name): db.database.execute_sql("ALTER ...
Python
0
bc5621afa044a486ef7514e1654224102b3cfd54
Rename chunk list
RecordingApp/app/src/scripts/get_chunks.py
RecordingApp/app/src/scripts/get_chunks.py
""" Script to generate a json file containing book name, number of chapters, number of chunks """ import json import urllib.request import re RESULT_JSON_NAME = "chunks.json" with open("catalog.json") as file: DATA = json.load(file) OUTPUT = [] #skip obs for now, loop over all books for x in range(1, 67): ...
""" Script to generate a json file containing book name, number of chapters, number of chunks """ import json import urllib.request import re RESULT_JSON_NAME = "chunks.json" with open("catalog.json") as file: DATA = json.load(file) OUTPUT = [] #skip obs for now, loop over all books for x in range(1, 67): ...
Python
0.000004
d949c21c4b0a54a9a697a07bf12e22a98dc59ff1
Add `attach` method so we can wrap apps like WSGI middleware
flask_mustache/__init__.py
flask_mustache/__init__.py
# flask-mustache Flask plugin import os from jinja2 import Template from flask import current_app, Blueprint __all__ = ('FlaskMustache',) mustache_app = Blueprint('mustache', __name__, static_folder='static') class FlaskMustache(object): "Wrapper to inject Mustache stuff into Flask" def __init__(self, app=...
# flask-mustache Flask plugin import os from jinja2 import Template from flask import current_app, Blueprint __all__ = ('FlaskMustache',) mustache_app = Blueprint('mustache', __name__, static_folder='static') class FlaskMustache(object): "Wrapper to inject Mustache stuff into Flask" def __init__(self, app=...
Python
0
c1c5fbdc2d7cda67668df38d91a2becf546fa852
Update transform config in development
backdrop/transformers/config/development.py
backdrop/transformers/config/development.py
TRANSFORMER_AMQP_URL = 'amqp://transformer:notarealpw@localhost:5672/%2Ftransformations' STAGECRAFT_URL = 'http://localhost:3103' STAGECRAFT_OAUTH_TOKEN = 'development-oauth-access-token' BACKDROP_READ_URL = 'http://backdrop-read.dev.gov.uk/data' BACKDROP_WRITE_URL = 'http://backdrop-write.dev.gov.uk/data'
TRANSFORMER_AMQP_URL = 'amqp://transformer:notarealpw@localhost:5672/%2Ftransformations' STAGECRAFT_URL = 'http://localhost:3204' STAGECRAFT_OAUTH_TOKEN = 'development-oauth-access-token' BACKDROP_READ_URL = 'http://localhost:3038/data' BACKDROP_WRITE_URL = 'http://localhost:3039/data'
Python
0
13c74e663dd511f53e6c0b1bb37b5baa12bba016
add tokens for fco transaction buckets
backdrop/write/config/development_tokens.py
backdrop/write/config/development_tokens.py
TOKENS = { '_foo_bucket': '_foo_bucket-bearer-token', 'bucket': 'bucket-bearer-token', 'foo': 'foo-bearer-token', 'foo_bucket': 'foo_bucket-bearer-token', 'licensing': 'licensing-bearer-token', 'licensing_journey': 'licensing_journey-bearer-token', 'pay_legalisation_post_journey': 'pay_legal...
TOKENS = { '_foo_bucket': '_foo_bucket-bearer-token', 'bucket': 'bucket-bearer-token', 'foo': 'foo-bearer-token', 'foo_bucket': 'foo_bucket-bearer-token', 'licensing': 'licensing-bearer-token', 'licensing_journey': 'licensing_journey-bearer-token' }
Python
0
700af658169cdb861ff15341c3a03443f207c02e
Update __init__.py
tendrl/node_agent/manager/__init__.py
tendrl/node_agent/manager/__init__.py
import signal import threading from tendrl.commons import manager as commons_manager from tendrl.commons import TendrlNS from tendrl.commons.utils import log_utils as logger from tendrl.node_agent.provisioner.gluster.manager import \ ProvisioningManager as GlusterProvisioningManager from tendrl import node_agent ...
import signal import threading from tendrl.commons import manager as commons_manager from tendrl.commons import TendrlNS from tendrl.commons.utils import log_utils as logger from tendrl.node_agent.provisioner.gluster.manager import \ ProvisioningManager as GlusterProvisioningManager from tendrl import node_agent ...
Python
0.000072
7b27423bef813befe1bb9dd5cb14843d847bff42
Fix mailhog settings
backend/project_name/settings/local_base.py
backend/project_name/settings/local_base.py
from .base import * # noqa DEBUG = True HOST = "http://localhost:8000" SECRET_KEY = "secret" DATABASES = { "default": {"ENGINE": "django.db.backends.sqlite3", "NAME": base_dir_join("db.sqlite3"),} } STATIC_ROOT = base_dir_join("staticfiles") STATIC_URL = "/static/" MEDIA_ROOT = base_dir_join("mediafiles") M...
from .base import * # noqa DEBUG = True HOST = "http://localhost:8000" SECRET_KEY = "secret" DATABASES = { "default": {"ENGINE": "django.db.backends.sqlite3", "NAME": base_dir_join("db.sqlite3"),} } STATIC_ROOT = base_dir_join("staticfiles") STATIC_URL = "/static/" MEDIA_ROOT = base_dir_join("mediafiles") M...
Python
0
bce815a12a3ce18d23644c08beda5f97271e559e
update token
forge/tests/test_github.py
forge/tests/test_github.py
# Copyright 2017 datawire. 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 or agr...
# Copyright 2017 datawire. 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 or agr...
Python
0.000001
9722390c4fa1a6bb5b9e8d66a53219bcc2447b39
Use zoom 13 tiles for station tests, so that the station is more likely to not be the only one in the tile, which provides a better test of the rank.
test/507-routes-via-stop-positions.py
test/507-routes-via-stop-positions.py
stations = [ (13, 2412, 3078, 'Penn Station', 895371274L, 1, [ '2100-2297', # Acela Express '68-69', # Adirondack '50-51', # Cardinal '79-80', # Carolinian '19-20', # Crescent '230-296', # Empire Service '600-674', # Keystone Service '63', # Maple Leaf...
stations = [ (17, 38596, 49262, 'Penn Station', 895371274L, 1, [ '2100-2297', # Acela Express '68-69', # Adirondack '50-51', # Cardinal '79-80', # Carolinian '19-20', # Crescent '230-296', # Empire Service '600-674', # Keystone Service '63', # Maple Le...
Python
0
307e0c4bbd7e76c9a8becf39df539413fef20e60
Add line magic %cpp
bindings/pyroot/ROOTaaS/iPyROOT/cppmagic.py
bindings/pyroot/ROOTaaS/iPyROOT/cppmagic.py
import IPython.core.magic as ipym import ROOT import utils @ipym.magics_class class CppMagics(ipym.Magics): @ipym.line_cell_magic def cpp(self, line, cell=None): """Inject into root.""" if cell is None: # this is a line magic utils.processCppCode(line) else: util...
import IPython.core.magic as ipym import ROOT import utils @ipym.magics_class class CppMagics(ipym.Magics): @ipym.cell_magic def cpp(self, line, cell=None): """Inject into root.""" if cell: utils.processCppCode(cell) def load_ipython_extension(ipython): ipython.register_magics(...
Python
0.000003
0a3164a47854ed17765d567afc7fc6a05aa0fd21
Fix bug in commonsdownloader with argument names
commonsdownloader/commonsdownloader.py
commonsdownloader/commonsdownloader.py
#!/usr/bin/python # -=- encoding: latin-1 -=- """Download files from Wikimedia Commons.""" import os import logging import argparse from thumbnaildownload import download_file def get_file_names_from_textfile(textfile_handler): """Yield the file names and widths by parsing a given text fileahandler.""" for ...
#!/usr/bin/python # -=- encoding: latin-1 -=- """Download files from Wikimedia Commons.""" import os import logging import argparse from thumbnaildownload import download_file def get_file_names_from_textfile(textfile_handler): """Yield the file names and widths by parsing a given text fileahandler.""" for ...
Python
0
082cc2590f7b263e37fe214e3c4e6fc86039327a
correct pyunit
h2o-py/tests/testdir_algos/deeplearning/pyunit_tweedie_weightsDeeplearning.py
h2o-py/tests/testdir_algos/deeplearning/pyunit_tweedie_weightsDeeplearning.py
import sys sys.path.insert(1, "../../../") import h2o def tweedie_weights(ip,port): data = h2o.import_frame(h2o.locate("smalldata/glm_test/cancar_logIn.csv")) data["C1M3"] = (data["Class"] == 1 and data["Merit"] == 3).asfactor() data["C3M3"] = (data["Class"] == 3 and data["Merit"] == 3).asfactor() dat...
import sys sys.path.insert(1, "../../../") import h2o #def tweedie_weights(ip,port): h2o.init() data = h2o.import_frame(h2o.locate("smalldata/glm_test/cancar_logIn.csv")) data["C1M3"] = (data["Class"] == 1 and data["Merit"] == 3).asfactor() data["C3M3"] = (data["Class"] == 3 and data["Merit"] == 3).asfactor() data["C...
Python
0.998797
169dda227f85f77ac52a4295e8fb7acd1b3184f5
Make byte-separator mandatory in MAC addresses
core/observables/mac_address.py
core/observables/mac_address.py
from __future__ import unicode_literals import re from core.observables import Observable class MacAddress(Observable): regex = r'(?P<search>(([0-9A-Fa-f]{1,2}[.:-]){5,7}([0-9A-Fa-f]{1,2})))' exclude_fields = Observable.exclude_fields DISPLAY_FIELDS = Observable.DISPLAY_FIELDS @classmethod de...
from __future__ import unicode_literals import re from core.observables import Observable class MacAddress(Observable): regex = r'(?P<search>(([0-9A-Fa-f]{1,2}[.:-]?){5,7}([0-9A-Fa-f]{1,2})))' exclude_fields = Observable.exclude_fields DISPLAY_FIELDS = Observable.DISPLAY_FIELDS @classmethod d...
Python
0
a28f8fe4427c12c2523b16903325d0362b53123e
Drop version dependency
acme/setup.py
acme/setup.py
import sys from setuptools import setup from setuptools import find_packages version = '0.2.0.dev0' install_requires = [ # load_pem_private/public_key (>=0.6) # rsa_recover_prime_factors (>=0.8) 'cryptography>=0.8', 'ndg-httpsclient', # urllib3 InsecurePlatformWarning (#304) 'pyasn1', # urllib...
import sys from setuptools import setup from setuptools import find_packages version = '0.2.0.dev0' install_requires = [ # load_pem_private/public_key (>=0.6) # rsa_recover_prime_factors (>=0.8) 'cryptography>=0.8', 'ndg-httpsclient', # urllib3 InsecurePlatformWarning (#304) 'pyasn1', # urllib...
Python
0.000001
cf2af12d926370d83e909e0d38d2c774553e0408
Fix handshake
YamTorrent.py
YamTorrent.py
#!/usr/bin/env python3 import sys import requests import hashlib import bencodepy import struct import socket def DEBUG(*s): if debugging: print(*s) def ERROR(*s): print(*s) exit() def main(): # open file in binary try: torrentfile = open(sys.argv[1], "rb").read() except IOE...
#!/usr/bin/env python3 import sys import requests import hashlib import bencodepy import struct import socket def DEBUG(s): if debugging: print(s) def ERROR(s): print(s) exit() def main(): # open file in binary try: torrentfile = open(sys.argv[1], "rb").read() except IOError...
Python
0.000004
877a7ff09056ea7ca03f0b31eb4ef8e30ac9d3fa
Change names we expect in spreadsheet
openprescribing/pipeline/management/commands/import_pcns.py
openprescribing/pipeline/management/commands/import_pcns.py
from django.core.management import BaseCommand from django.db import transaction from frontend.models import PCN, Practice from openpyxl import load_workbook class Command(BaseCommand): help = "This command imports PCNs and PCN mappings" def add_arguments(self, parser): parser.add_argument("--filena...
from django.core.management import BaseCommand from django.db import transaction from frontend.models import PCN, Practice from openpyxl import load_workbook class Command(BaseCommand): help = "This command imports PCNs and PCN mappings" def add_arguments(self, parser): parser.add_argument("--filena...
Python
0
14cee1112f2a506f4ec547b80e897036f601ab6d
Fix tests/utils/http_requests.py
chroma-manager/tests/utils/http_requests.py
chroma-manager/tests/utils/http_requests.py
#!/usr/bin/env python # # ======================================================== # Copyright (c) 2012 Whamcloud, Inc. All rights reserved. # ======================================================== import json import requests from urlparse import urljoin class HttpRequests(object): def __init__(self, server_...
#!/usr/bin/env python # # ======================================================== # Copyright (c) 2012 Whamcloud, Inc. All rights reserved. # ======================================================== import json import requests from urlparse import urljoin class HttpRequests(object): def __init__(self, server_...
Python
0.000001
e7a632718f379fb1ede70d1086f55279e4251e11
fix geotag access - not an obj
cinder/scheduler/filters/geo_tags_filter.py
cinder/scheduler/filters/geo_tags_filter.py
# Copyright (c) 2014 Intel # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
# Copyright (c) 2014 Intel # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
Python
0.000001
16ab5dcf1f6e52f89435adccdfa7021ce24e29a8
fix formatting via make fix
tests/metal/contrib/test_baselines.py
tests/metal/contrib/test_baselines.py
import numpy as np import torch from metal.end_model import SparseLogisticRegression def test_sparselogreg(self): """Confirm sparse logreg can overfit, works on padded data""" F = 1000 # total number of possible features N = 50 # number of data points S = [10, 100] # range of features per data poi...
import numpy as np import torch from metal.end_model import SparseLogisticRegression def test_sparselogreg(self): """Confirm sparse logreg can overfit, works on padded data""" F = 1000 # total number of possible features N = 50 # number of data points S = [10, 100] # range of features per data po...
Python
0
0341c38dff42ae5e86353c6d53c2d30aabca555e
update py-jupyter-client and new setuptools dependency (#13425)
var/spack/repos/builtin/packages/py-jupyter-client/package.py
var/spack/repos/builtin/packages/py-jupyter-client/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyJupyterClient(PythonPackage): """Jupyter protocol client APIs""" homepage = "https:...
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyJupyterClient(PythonPackage): """Jupyter protocol client APIs""" homepage = "https:...
Python
0
79bf0829769e456750d7904866e65ae289f1cd46
add missing logfile write flushes
_log/dslog.py
_log/dslog.py
# -*- coding:utf8 -*- import io import os import sys import traceback LOG_STDOUT=sys.stdout LOG_STDERR=sys.stderr logging_to_file=True logfile="devsetup.log" def init(project_folder, write_to_log=True): global LOG_STDOUT global LOG_STDERR global logging_to_file global logfile # special case - we want to log di...
# -*- coding:utf8 -*- import io import os import sys import traceback LOG_STDOUT=sys.stdout LOG_STDERR=sys.stderr logging_to_file=True logfile="devsetup.log" def init(project_folder, write_to_log=True): global LOG_STDOUT global LOG_STDERR global logging_to_file global logfile # special case - we want to log di...
Python
0.000031
186c509f14968e9d51a6a7d3a7a23ed07eabc286
Enable spam bug detection in all products (#1106)
auto_nag/scripts/spambug.py
auto_nag/scripts/spambug.py
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. from auto_nag import people from auto_nag.bugbug_utils import get_bug_ids_classification from auto_nag.bzcleaner import ...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. from auto_nag import people from auto_nag.bugbug_utils import get_bug_ids_classification from auto_nag.bzcleaner import ...
Python
0
bbe835c8aa561d8db58e116f0e55a5b19c4f9ca4
Fix sitemap memory consumption during generation
firecares/sitemaps.py
firecares/sitemaps.py
from django.contrib import sitemaps from firecares.firestation.models import FireDepartment from django.db.models import Max from django.core.urlresolvers import reverse class BaseSitemap(sitemaps.Sitemap): protocol = 'https' def items(self): return ['media', 'models_performance_score', 'models_commu...
from django.contrib import sitemaps from firecares.firestation.models import FireDepartment from django.db.models import Max from django.core.urlresolvers import reverse class BaseSitemap(sitemaps.Sitemap): protocol = 'https' def items(self): return ['media', 'models_performance_score', 'models_commu...
Python
0
9c7d1deba7dbde9285e49cb2966b1d242ac8ddc2
Use sphinxapi if available
flask_sphinxsearch.py
flask_sphinxsearch.py
try: import sphinxapi as sphinxsearch except ImportError: import sphinxsearch from flask import current_app # Find the stack on which we want to store the database connection. # Starting with Flask 0.9, the _app_ctx_stack is the correct one, # before that we need to use the _request_ctx_stack. try: from fl...
import sphinxsearch from flask import current_app # Find the stack on which we want to store the database connection. # Starting with Flask 0.9, the _app_ctx_stack is the correct one, # before that we need to use the _request_ctx_stack. try: from flask import _app_ctx_stack as stack except ImportError: from fl...
Python
0
726fa619627f449371f8cdd6df266d4c92aaad5d
Fix flaky NL test
samples/snippets/ocr_nl/main_test.py
samples/snippets/ocr_nl/main_test.py
#!/usr/bin/env python # Copyright 2016 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...
#!/usr/bin/env python # Copyright 2016 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...
Python
0.999382
e959f849550fe4cfd2f2230c149a9bc0cb01bfe4
bump version
jose/__init__.py
jose/__init__.py
__version__ = "2.0.1" __author__ = 'Michael Davis' __license__ = 'MIT' __copyright__ = 'Copyright 2016 Michael Davis' from .exceptions import JOSEError from .exceptions import JWSError from .exceptions import ExpiredSignatureError from .exceptions import JWTError
__version__ = "2.0.0" __author__ = 'Michael Davis' __license__ = 'MIT' __copyright__ = 'Copyright 2016 Michael Davis' from .exceptions import JOSEError from .exceptions import JWSError from .exceptions import ExpiredSignatureError from .exceptions import JWTError
Python
0
7f38e297dcfc9a664af092f48a9dc596f5f6c27b
Fix PermissionError: [Errno 13] Permission denied on Windows
scipy/sparse/tests/test_matrix_io.py
scipy/sparse/tests/test_matrix_io.py
import os import numpy as np import tempfile from numpy.testing import assert_array_almost_equal, run_module_suite, assert_ from scipy.sparse import csc_matrix, csr_matrix, bsr_matrix, dia_matrix, coo_matrix, save_npz, load_npz def _save_and_load(matrix): fd, tmpfile = tempfile.mkstemp(suffix='.npz') os.clo...
import numpy as np import tempfile from numpy.testing import assert_array_almost_equal, run_module_suite, assert_ from scipy.sparse import csc_matrix, csr_matrix, bsr_matrix, dia_matrix, coo_matrix, save_npz, load_npz def _save_and_load(matrix): with tempfile.NamedTemporaryFile(suffix='.npz') as file: ...
Python
0
81b64f139dba88b744e6067f7a48ce1bdaff785c
Change variable names.
avenue/web.py
avenue/web.py
# -*- coding: utf-8 -*- # Copyright (c) 2012 Michael Babich # See LICENSE.txt or http://opensource.org/licenses/MIT '''Acts as an interface between what Flask serves and what goes on in the rest of the application. ''' from avenue import app, api from flask import render_template, make_response, redirect def url_gene...
# -*- coding: utf-8 -*- # Copyright (c) 2012 Michael Babich # See LICENSE.txt or http://opensource.org/licenses/MIT '''Acts as an interface between what Flask serves and what goes on in the rest of the application. ''' from avenue import app, api from flask import render_template, make_response, redirect def url_gene...
Python
0.000001
bc62bd28340d27fbfde164ea3c2f184922ddb9e9
add Spirent like profile
scripts/astf/http_manual_tunables.py
scripts/astf/http_manual_tunables.py
# Example for creating your program by specifying buffers to send, without relaying on pcap file from trex_astf_lib.api import * # we can send either Python bytes type as below: http_req = b'GET /3384 HTTP/1.1\r\nHost: 22.0.0.3\r\nConnection: Keep-Alive\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5....
# Example for creating your program by specifying buffers to send, without relaying on pcap file from trex_astf_lib.api import * # we can send either Python bytes type as below: http_req = b'GET /3384 HTTP/1.1\r\nHost: 22.0.0.3\r\nConnection: Keep-Alive\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5....
Python
0
b1277cd79102a30a894e370ab15773e6d86569ec
fix n/a causing issues for OT0010 ingest, sigh
scripts/ingestors/other/parse0010.py
scripts/ingestors/other/parse0010.py
"""ISU Agronomy Hall Vantage Pro 2 OT0010""" from __future__ import print_function import datetime import re import os import sys import pytz from pyiem.datatypes import speed, temperature, humidity from pyiem.observation import Observation from pyiem.meteorology import dewpoint from pyiem.util import get_dbconn def ...
"""ISU Agronomy Hall Vantage Pro 2 OT0010""" from __future__ import print_function import datetime import re import os import sys import pytz from pyiem.datatypes import speed, temperature, humidity from pyiem.observation import Observation from pyiem.meteorology import dewpoint from pyiem.util import get_dbconn def ...
Python
0
c7a79f81734f360a232b2f91630872ad56a1ffa4
clean up audio init
amen/audio.py
amen/audio.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import librosa from amen.timing_list import TimingList class Audio(object): """ Audio object: should wrap the output from libRosa. """ def __init__(self, file_path, convert_to_mono=False, sample_rate=22050): """ Opens a file path, loads i...
#!/usr/bin/env python # -*- coding: utf-8 -*- import librosa from amen.timing_list import TimingList class Audio(object): """ Audio object: should wrap the output from libRosa. """ def __init__(self, file_path, convert_to_mono=False, sample_rate=22050): """ Opens a file path, loads i...
Python
0.000025
4aca30e376b2310e2436fdb799bf3cae1c9a1d2b
Define global variables to clean up tests
dakota_utils/tests/test_file.py
dakota_utils/tests/test_file.py
#! /usr/bin/env python # # Tests for dakota_utils.file. # # Call with: # $ nosetests -sv # # Mark Piper (mark.piper@colorado.edu) from nose.tools import * import os import tempfile import shutil from dakota_utils.file import * nondir = 'vwbwguv00240cnwuncdsv' nonfile = nondir + '.pro' bname = 'delete_me' def setup...
#! /usr/bin/env python # # Tests for dakota_utils.file. # # Call with: # $ nosetests -sv # # Mark Piper (mark.piper@colorado.edu) from nose.tools import * import os import tempfile import shutil from dakota_utils.file import * def setup_module(): print('File tests:') os.environ['_test_tmp_dir'] = tempfile.m...
Python
0.000003
1c56aeb3d96dbb26da62203d690b4ff49b4b5c0e
bump version to 0.5.2
abstar/version.py
abstar/version.py
# Store the version here so: # 1) we don't load dependencies by storing it in __init__.py # 2) we can import it in setup.py for the same reason # 3) we can import it into your module module __version__ = '0.5.2'
# Store the version here so: # 1) we don't load dependencies by storing it in __init__.py # 2) we can import it in setup.py for the same reason # 3) we can import it into your module module __version__ = '0.5.1'
Python
0.000001
609cffb674ba0494bbe450d8ce7839168a3d5a0a
remove unnecessary code from forms
accounts/forms.py
accounts/forms.py
# -*- coding: utf-8 -*- from django.contrib.auth import get_user_model from django import forms from django.utils.translation import ugettext_lazy as _ User = get_user_model() class ProfileEditForm(forms.ModelForm): email = forms.RegexField(label=_("email"), max_length=75, regex=r"^[\w.@+-]+$") password1 = f...
# -*- coding: utf-8 -*- try: from django.contrib.auth import get_user_model except ImportError: from django.contrib.auth.models import User else: User = get_user_model() from django import forms from django.utils.translation import ugettext_lazy as _ class ProfileEditForm(forms.ModelForm): email = for...
Python
0.000007
67be76a3d65fa846c8888ef5415ec3df5ef9ab87
Add test for expired tokens
accounts/tests.py
accounts/tests.py
"""accounts app unittests """ import base64 from time import sleep from django.contrib.auth import get_user_model from django.test import TestCase from accounts.token import LoginTokenGenerator TEST_EMAIL = 'newvisitor@example.com' class WelcomePageTest(TestCase): """Tests relating to the welcome_page view. ...
"""accounts app unittests """ import base64 from time import sleep from django.contrib.auth import get_user_model from django.test import TestCase from accounts.token import LoginTokenGenerator TEST_EMAIL = 'newvisitor@example.com' class WelcomePageTest(TestCase): """Tests relating to the welcome_page view. ...
Python
0
5a4f05cb0f3a00a2d4faf828bd7850085c302541
Implement functionality to delete logs created by digital justice users
cla_backend/apps/cla_eventlog/management/commands/find_and_delete_old_cases.py
cla_backend/apps/cla_eventlog/management/commands/find_and_delete_old_cases.py
import sys from django.core.management.base import BaseCommand from dateutil.relativedelta import relativedelta from legalaid.models import Case from cla_eventlog.models import Log from cla_butler.tasks import DeleteOldData class FindAndDeleteCasesUsingCreationTime(DeleteOldData): def get_eligible_cases(self): ...
import sys from django.core.management.base import BaseCommand from dateutil.relativedelta import relativedelta from legalaid.models import Case from cla_butler.tasks import DeleteOldData class FindAndDeleteCasesUsingCreationTime(DeleteOldData): def get_eligible_cases(self): two_years = self.now - relati...
Python
0.002474
f5c5c7de8af6ae5251ac1d878569c2692e119a04
Set the login/logout URLs so authentication works.
adapt/settings.py
adapt/settings.py
""" Django settings for adapt project. Generated by 'django-admin startproject' using Django 1.8.5. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths ...
""" Django settings for adapt project. Generated by 'django-admin startproject' using Django 1.8.5. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths ...
Python
0
b9c953cffd0c9961c22c0c671648f5e5a3e4426c
Update server
alchemy_server.py
alchemy_server.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Apr 30 01:14:12 2017 @author: colm """ from flask import Flask, jsonify import os from models import Charity, Logo, Description from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker import pandas as pd app = Flask(__name__) app...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Apr 30 01:14:12 2017 @author: colm """ from flask import Flask, jsonify import os from models import Charity, Logo, Description from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker import pandas as pd app = Flask(__name__) app...
Python
0.000001
434e459059bba2a1e52e953813caae532a3cb16b
Update test_consume_4
test_wordcount.py
test_wordcount.py
import os.path import tempfile import wordcount_lib def _make_testfile(filename, data): "Make a temp file containing the given data; return full path to file." tempdir = tempfile.mkdtemp(prefix='wordcounttest_') testfile = os.path.join(tempdir, filename) with open(testfile, 'wt') as fp: ...
import os.path import tempfile import wordcount_lib def _make_testfile(filename, data): "Make a temp file containing the given data; return full path to file." tempdir = tempfile.mkdtemp(prefix='wordcounttest_') testfile = os.path.join(tempdir, filename) with open(testfile, 'wt') as fp: ...
Python
0.000003
2fa092add3508b774c58e880089c18c3275df840
Set block_align on target population if given
backend/populate_targets.py
backend/populate_targets.py
import django import os import yaml from backend.settings import BASE_DIR from django.db import IntegrityError os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings') django.setup() from breach.models import Target def create_target(target): method = '' for m in Target.METHOD_CHOICES: if...
import django import os import yaml from backend.settings import BASE_DIR from django.db import IntegrityError os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings') django.setup() from breach.models import Target def create_target(target): method = '' for m in Target.METHOD_CHOICES: if...
Python
0.000001
829941e9d4675645752fa207c461dd596da6264c
refactor html template selection
satchmo/apps/satchmo_store/mail.py
satchmo/apps/satchmo_store/mail.py
from django.conf import settings from django.template import loader, Context, TemplateDoesNotExist from livesettings import config_value import os.path from socket import error as SocketError import logging log = logging.getLogger('satchmo_store.mail') if "mailer" in settings.INSTALLED_APPS: from mailer import s...
from django.conf import settings from django.template import loader, Context, TemplateDoesNotExist from livesettings import config_value import os.path from socket import error as SocketError import logging log = logging.getLogger('satchmo_store.mail') if "mailer" in settings.INSTALLED_APPS: from mailer import s...
Python
0
abd2ad6098cb0bc827a8bebf12f21f1131dc83fa
Change version number
fluxghost/__init__.py
fluxghost/__init__.py
__version__ = "0.8.1" DEBUG = False
__version__ = "0.8.0" DEBUG = False
Python
0.000009
52eed6f6d771045b2c06a941db17665785e90b23
return an error exit code if tests failed
tests/__init__.py
tests/__init__.py
import sys import unittest import parse import extent def load_tests(): return unittest.TestSuite([parse.load_tests(), extent.load_tests()]) if __name__ == "__main__": result = unittest.TextTestRunner(verbosity=2).run(load_tests()) if not result.wasSuccessful(): sys.exit(1)
import unittest import parse import extent def load_tests(): return unittest.TestSuite([parse.load_tests(), extent.load_tests()]) if __name__ == "__main__": unittest.TextTestRunner(verbosity=2).run(load_tests())
Python
0.001138
a0d8be58248eaa3d314c624cd4150afc1d3dd203
Fix DereferrablePanelTestCase.tearDownClass
tests/__init__.py
tests/__init__.py
import sublime from textwrap import dedent from unittesting import DeferrableTestCase class DereferrablePanelTestCase(DeferrableTestCase): @classmethod def setUpClass(cls): """ Set up global test environment once for all tests owned by this class. """ cls.window = sublime.act...
import sublime from textwrap import dedent from unittesting import DeferrableTestCase class DereferrablePanelTestCase(DeferrableTestCase): @classmethod def setUpClass(cls): """ Set up global test environment once for all tests owned by this class. """ cls.window = sublime.act...
Python
0.000001
7c2f34990dc3bf5b4736541a6e9faf88a07581fa
remove useless import
tests/__init__.py
tests/__init__.py
import asynctest import logging import os from functools import wraps import shortuuid from typing import Generator, Any from yarl import URL from aio_pika import Connection, connect, Channel, Queue, Exchange log = logging.getLogger(__name__) for logger_name in ('pika.channel', 'pika.callback', 'pika.connection')...
import asyncio import asynctest import logging import os from functools import wraps import shortuuid from typing import Generator, Any from yarl import URL from aio_pika import Connection, connect, Channel, Queue, Exchange log = logging.getLogger(__name__) for logger_name in ('pika.channel', 'pika.callback', 'pi...
Python
0.000004
1858b0ae7f70798f3d11ecca1af55719a52def49
Fix downgrade in migration
neutron/db/migration/alembic_migrations/versions/2a6d0b51f4bb_cisco_plugin_cleanup.py
neutron/db/migration/alembic_migrations/versions/2a6d0b51f4bb_cisco_plugin_cleanup.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 OpenStack Foundation # # 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...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 OpenStack Foundation # # 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.00003
bb94d126ae9ff86efc00cfbda5f3fff375490e16
Add missing import to tests/__init__.py.
tests/__init__.py
tests/__init__.py
# -*- coding: utf-8 -*- # 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. # # OpenQuake is distributed in the hope that it will be ...
# -*- coding: utf-8 -*- # 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. # # OpenQuake is distributed in the hope that it will be ...
Python
0.999554
7bfabc008cf3f580a5d1adfd6ef7bb7142a706d0
Add checking of space permissions and kernel space unique ID
autotest/client/hardware_TPMCheck/hardware_TPMCheck.py
autotest/client/hardware_TPMCheck/hardware_TPMCheck.py
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging, os, re from autotest_lib.client.bin import test, utils from autotest_lib.client.common_lib import error def old_or_missing_firmware_v...
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os, re from autotest_lib.client.bin import test, utils from autotest_lib.client.common_lib import error def dict_from_command(command): di...
Python
0
3225abc4006378d0b9f1e861116aac8116d47ec0
fix wrong indent
monasca_notification/plugins/slack_notifier.py
monasca_notification/plugins/slack_notifier.py
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP # # 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 applica...
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP # # 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 applica...
Python
0.984856
4bafa90acca39a3d3fa5df0303d885c810244700
Add URL
lc034_find_first_and_last_position_of_element_in_sorted_array.py
lc034_find_first_and_last_position_of_element_in_sorted_array.py
"""Leetcode 34. Find First and Last Position of Element in Sorted Array Medium URL: https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value. Your algorithm's runtime...
"""Leetcode 34. Find First and Last Position of Element in Sorted Array Medium Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in the order of O(log n). If the target is not found in the array, retu...
Python
0.000001
f2dcee8364087209b7f160806a023ce2dc198466
Remove hidden keys
bdp/platform/frontend/src/bdp_fe/jobconf/views_util.py
bdp/platform/frontend/src/bdp_fe/jobconf/views_util.py
""" Utility functions for controllers. """ from random import choice from django.conf import settings from django.http import HttpResponseNotFound from django.shortcuts import get_object_or_404 from models import CustomJobModel from pymongo import Connection from pymongo.errors import AutoReconnect, ConnectionFailure...
""" Utility functions for controllers. """ from random import choice from django.conf import settings from django.http import HttpResponseNotFound from django.shortcuts import get_object_or_404 from models import CustomJobModel from pymongo import Connection from pymongo.errors import AutoReconnect, ConnectionFailure...
Python
0.000002
49c64731fab1de1fc08b61a70190930b829d70d3
Remove import for random
src/python/m5/internal/__init__.py
src/python/m5/internal/__init__.py
# Copyright (c) 2006 The Regents of The University of Michigan # 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 # notice, this list ...
# Copyright (c) 2006 The Regents of The University of Michigan # 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 # notice, this list ...
Python
0.000003
f3c7f0d488bcd41ed3fb19d83e78fa1436315a08
Add test for improved pretty printing behaviour
bindings/pyroot/pythonizations/test/pretty_printing.py
bindings/pyroot/pythonizations/test/pretty_printing.py
import unittest import ROOT class PrettyPrinting(unittest.TestCase): # Helpers def _print(self, obj): print("print({}) -> {}".format(repr(obj), obj)) # Tests def test_RVec(self): x = ROOT.ROOT.VecOps.RVec("float")(4) for i in range(x.size()): x[i] = i self....
import unittest import ROOT class PrettyPrinting(unittest.TestCase): # Helpers def _print(self, obj): print("print({}) -> {}".format(repr(obj), obj)) # Tests def test_RVec(self): x = ROOT.ROOT.VecOps.RVec("float")(4) for i in range(x.size()): x[i] = i self....
Python
0
01c88b514c64f001fc7824a30b8609a425d646ef
Set defaults for CI and DETERMINISTIC_TESTS. (#653)
tests/conftest.py
tests/conftest.py
# -*- coding: utf-8 -*- ''' General-purpose fixtures for vdirsyncer's testsuite. ''' import logging import os import click_log from hypothesis import HealthCheck, Verbosity, settings import pytest @pytest.fixture(autouse=True) def setup_logging(): click_log.basic_config('vdirsyncer').setLevel(logging.DEBUG) ...
# -*- coding: utf-8 -*- ''' General-purpose fixtures for vdirsyncer's testsuite. ''' import logging import os import click_log from hypothesis import HealthCheck, Verbosity, settings import pytest @pytest.fixture(autouse=True) def setup_logging(): click_log.basic_config('vdirsyncer').setLevel(logging.DEBUG) ...
Python
0
88bba8a6145f67fd65e4062123db295601c92000
Fix lint errors
tests/conftest.py
tests/conftest.py
# -*- encoding: utf-8 import os from hotchocolate import Site # TODO: Tidy this up, and don't duplicate code from cli.py curdir = os.path.abspath(os.curdir) os.chdir('tests/examplesite') site = Site.from_folder('content') site.build() os.chdir(curdir)
# -*- encoding: utf-8 import os from hotchocolate import Site import hotchocolate.cli as hcli # TODO: Tidy this up, and don't duplicate code from cli.py curdir = os.path.abspath(os.curdir) os.chdir('tests/examplesite') site = Site.from_folder('content') site.build() os.chdir(curdir)
Python
0.000396
8dc79a0a1b99d1742ae297db7da26a0404e5ec33
Fix pep8
tests/conftest.py
tests/conftest.py
import pytest from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from models import Base from config import create_new_sqla from helpers import get_video_douban_ids test_database_url = 'sqlite:///test.db' @pytest.fixture(scope='session') def session(request): sqla = create_new_sqla(test...
import pytest from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from models import Base from config import create_new_sqla from helpers import get_video_douban_ids test_database_url = 'sqlite:///test.db' @pytest.fixture(scope='session') def session(request): sqla = create_new_sqla(test...
Python
0.000001
ab81767d7504bc3016786780902d8c3997e37f64
Add option to use proxies in JiraHook
airflow/contrib/hooks/jira_hook.py
airflow/contrib/hooks/jira_hook.py
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
Python
0
423ec9d9b38be990ab7dca027877e1c12f3d07fe
add in django-registration update media url
imagr_site/settings.py
imagr_site/settings.py
""" Django settings for imagr_site project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...)...
""" Django settings for imagr_site project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...)...
Python
0
1675252b3442ff4e32881ce1c28f1753c521fb3f
Remove the main from the new file
code/spearmint-configs/dbnmnist/mnistdbn.py
code/spearmint-configs/dbnmnist/mnistdbn.py
"""Spearmint for the DBN module in pydeeplearn.""" __author__ = "Mihaela Rosca" __contact__ = "mihaela.c.rosca@gmail.com" import argparse from lib import deepbelief as db from lib.common import * from lib.activationfunctions import * from read import readmnist parser = argparse.ArgumentParser(description='digit re...
"""Spearmint for the DBN module in pydeeplearn.""" __author__ = "Mihaela Rosca" __contact__ = "mihaela.c.rosca@gmail.com" import argparse from lib import deepbelief as db from lib.common import * from lib.activationfunctions import * from read import readmnist parser = argparse.ArgumentParser(description='digit re...
Python
0.000002
ac754a6a711edc9b3628499ae18e74892efd7f98
Add recording interaction print statements
src/tdl/runner/recording_system.py
src/tdl/runner/recording_system.py
import unirest RECORDING_SYSTEM_ENDPOINT = "http://localhost:41375" class RecordingEvent: def __init__(self): pass ROUND_START = 'new' ROUND_SOLUTION_DEPLOY = 'deploy' ROUND_COMPLETED = 'done' class RecordingSystem: def __init__(self, recording_required): self._recording_requi...
import unirest RECORDING_SYSTEM_ENDPOINT = "http://localhost:41375" class RecordingEvent: def __init__(self): pass ROUND_START = 'new' ROUND_SOLUTION_DEPLOY = 'deploy' ROUND_COMPLETED = 'done' class RecordingSystem: def __init__(self, recording_required): self._recording_requi...
Python
0.000004
0b3247c23d37c372d3f3984391b976fa904d00c6
bump to v1.4.0 (#5975)
var/spack/repos/builtin/packages/miniamr/package.py
var/spack/repos/builtin/packages/miniamr/package.py
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
Python
0
779393e6c18539c97ff3bdaeb471253170645bc2
Update group.py
web-app/numeter_webapp/configuration/forms/group.py
web-app/numeter_webapp/configuration/forms/group.py
""" Group Form module. """ from django import forms from django.utils.translation import ugettext_lazy as _ from core.models import Group class Group_Form(forms.ModelForm): """Simple Group Form""" class Meta: model = Group widgets = { 'name': forms.TextInput({'placeholder':_('Name')...
""" Group Form module. """ from django import forms from django.utils.translation import ugettext_lazy as _ from djangular.forms.angular_model import NgModelFormMixin from core.models import Group class Group_Form(forms.ModelForm): """Simple Group Form""" class Meta: model = Group widgets = {...
Python
0
7ca6dd5cd84222845db331afd97fc2f314999cff
fix yaspin.compat module docstring
yaspin/compat.py
yaspin/compat.py
# -*- coding: utf-8 -*- """ yaspin.compat ~~~~~~~~~~~~~ Compatibility layer. """ import sys PY2 = sys.version_info[0] == 2 if PY2: builtin_str = str bytes = str str = unicode # noqa def iteritems(dct): return dct.iteritems() else: builtin_str = str bytes = bytes ...
# -*- coding: utf-8 -*- """ tests.compat ~~~~~~~~~~~~~ Compatibility layer. """ import sys PY2 = sys.version_info[0] == 2 if PY2: builtin_str = str bytes = str str = unicode # noqa def iteritems(dct): return dct.iteritems() else: builtin_str = str bytes = bytes ...
Python
0
739f72ae0bd873ac8d51789e90988d609b08a803
Add typos and nonsense to pass distribution plan
inpassing/pass_util.py
inpassing/pass_util.py
# Copyright (c) 2016 Luke San Antonio Bialecki # All rights reserved. from sqlalchemy.sql import and_, or_ from .models import Pass, PassRequest, db def get_user_passes(user_id): """Returns all owned, borrowed and requested passes of a user.""" # Find pending and successfull requests pending_requests = d...
# Copyright (c) 2016 Luke San Antonio Bialecki # All rights reserved. from sqlalchemy.sql import and_, or_ from .models import Pass, PassRequest, db def get_user_passes(user_id): """Returns all owned, borrowed and requested passes of a user.""" # Find pending and successfull requests pending_requests = d...
Python
0
b9fc0685b3adb05a5049cfa9b68676e00878d48a
Add .fillna(0)
instagram_collector.py
instagram_collector.py
import sys from settings import instgram_access_token from api import InstagramAPI, Alchemy import pandas as pd def following_users(api, user_name): instgram_user_id = api.user_id(user_name=user_name) following_users = api.follows_list(user_id=instgram_user_id) return following_users def userinfo_list(...
import sys from settings import instgram_access_token from api import InstagramAPI, Alchemy import pandas as pd def following_users(api, user_name): instgram_user_id = api.user_id(user_name=user_name) following_users = api.follows_list(user_id=instgram_user_id) return following_users def userinfo_list(...
Python
0.000001
1483b7946f929ee6dc8d5a8e972c712af35d4aea
Add capacity to save parsed objects to models in management command "process_xslt"
xml_json_import/management/commands/process_xslt.py
xml_json_import/management/commands/process_xslt.py
from django.core.management.base import BaseCommand from lxml import etree, html import urllib2 from os import path import importlib class Command(BaseCommand): help = 'Processes XSLT transformation on a fetched by URL resource and outputs the result' def add_arguments(self, parser): parser....
from django.core.management.base import BaseCommand from lxml import etree, html import urllib2 from os import path class Command(BaseCommand): help = 'Processes XSLT transformation on a fetched by URL resource and outputs the result' def add_arguments(self, parser): parser.add_argument('url'...
Python
0
5ac7bba7ba8f411ed8daaf2055fde56eda152b6c
Add missing context processor to test app
tests/runtests.py
tests/runtests.py
#!/usr/bin/env python import os import sys from optparse import OptionParser AVAILABLE_DATABASES = { 'psql': {'ENGINE': 'django.db.backends.postgresql_psycopg2'}, 'mysql': {'ENGINE': 'django.db.backends.mysql'}, 'sqlite': {'ENGINE': 'django.db.backends.sqlite3'}, } def main(): # Parse the command-lin...
#!/usr/bin/env python import os import sys from optparse import OptionParser AVAILABLE_DATABASES = { 'psql': {'ENGINE': 'django.db.backends.postgresql_psycopg2'}, 'mysql': {'ENGINE': 'django.db.backends.mysql'}, 'sqlite': {'ENGINE': 'django.db.backends.sqlite3'}, } def main(): # Parse the command-lin...
Python
0.000001
84cdde09d574d2a52446bd751445747407733b22
Remove print statement
tests/settings.py
tests/settings.py
import uuid import os.path from django.conf import global_settings, settings from oscar import OSCAR_MAIN_TEMPLATE_DIR, get_core_apps from oscar.defaults import * # noqa from accounts import TEMPLATE_DIR as ACCOUNTS_TEMPLATE_DIR DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', } } ...
import uuid import os.path from django.conf import global_settings, settings from oscar import OSCAR_MAIN_TEMPLATE_DIR, get_core_apps from oscar.defaults import * # noqa from accounts import TEMPLATE_DIR as ACCOUNTS_TEMPLATE_DIR DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', } } ...
Python
0.007015
26116bb984f7a970c67bcdc01ff026a3fc5f0905
create secondary parses
tests/test_ddl.py
tests/test_ddl.py
from pytest import fixture from cdm.ddl import parse_line, create_vertex, create_vertex_index,\ CreateVertex, \ CreateEdge, CreateProperty, CreateIndex, CreateGraph def test_create_graph(): s = "CREATE GRAPH jon" parsed = parse_line(s) assert isinstance(parsed, Crea...
from pytest import fixture from cdm.ddl import parse_line, create_vertex, create_vertex_index,\ CreateVertex, \ CreateEdge, CreateProperty, CreateIndex, CreateGraph def test_create_graph(): s = "CREATE GRAPH jon" parsed = parse_line(s) assert isinstance(parsed, Crea...
Python
0.000281
8802611f515df7b123f907efb6f7ffac9f11a42f
create mock ami and add test for ami list.
tests/test_ec2.py
tests/test_ec2.py
from __future__ import (absolute_import, print_function, unicode_literals) from acli.output.ec2 import (output_ec2_list, output_ec2_info) from acli.services.ec2 import (ec2_list, ec2_info, ec2_summary, ami_list) from acli.config import Config from moto import mock_ec2 import pytest from boto3.session import Session ses...
from __future__ import (absolute_import, print_function, unicode_literals) from acli.output.ec2 import (output_ec2_list, output_ec2_info) from acli.services.ec2 import (ec2_list, ec2_info, ec2_summary) from acli.config import Config from moto import mock_ec2 import pytest from boto3.session import Session session = Ses...
Python
0
581eb398360cff5de1488fa06890195c808f8d10
fix make requests test
tests/test_run.py
tests/test_run.py
# coding=utf-8 from os.path import join import pytest from xpaw.spider import Spider from xpaw.cmdline import main from xpaw.run import run_crawler, run_spider, make_requests from xpaw.http import HttpRequest, HttpResponse from xpaw.errors import ClientError, HttpError def test_run_crawler(tmpdir): proj_name =...
# coding=utf-8 from os.path import join import pytest from xpaw.spider import Spider from xpaw.cmdline import main from xpaw.run import run_crawler, run_spider, make_requests from xpaw.http import HttpRequest, HttpResponse from xpaw.errors import ClientError, HttpError def test_run_crawler(tmpdir): proj_name =...
Python
0.000002
4ba0a99a626e54cd7ca68692c5135bcd6b2f8d3a
Add test for STL vertex order
tests/test_stl.py
tests/test_stl.py
""" Check things related to STL files """ try: from . import generic as g except BaseException: import generic as g class STLTests(g.unittest.TestCase): def test_header(self): m = g.get_mesh('featuretype.STL') # make sure we have the right mesh assert g.np.isclose(m.volume, 11.627...
""" Check things related to STL files """ try: from . import generic as g except BaseException: import generic as g class STLTests(g.unittest.TestCase): def test_header(self): m = g.get_mesh('featuretype.STL') # make sure we have the right mesh assert g.np.isclose(m.volume, 11.627...
Python
0
f30b658275a62294593d31175e1e13118140abb7
Fix flake8 in test_vcs.py
tests/test_vcs.py
tests/test_vcs.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_vcs ------------ Tests for `cookiecutter.vcs` module. """ import locale import os import pytest import subprocess import unittest from cookiecutter import exceptions, utils, vcs from tests.skipif_markers import skipif_no_network try: no_network = os.enviro...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_vcs ------------ Tests for `cookiecutter.vcs` module. """ import locale import os import pytest import subprocess import unittest from cookiecutter.compat import patch from cookiecutter import exceptions, utils, vcs from tests.skipif_markers import skipif_no_ne...
Python
0.000001