commit stringlengths 40 40 | subject stringlengths 4 1.73k | repos stringlengths 5 127k | old_file stringlengths 2 751 | new_file stringlengths 2 751 | new_contents stringlengths 1 8.98k | old_contents stringlengths 0 6.59k | license stringclasses 13
values | lang stringclasses 23
values |
|---|---|---|---|---|---|---|---|---|
c79736300e077b2d93c359fe5e24da7f288fc210 | Simplify create view and fix indents | zujko/manage-vm,zujko/manage-vm,zujko/manage-vm | main/views.py | main/views.py | from django.shortcuts import render
from .forms import *
from proxmoxer import ProxmoxAPI
from managevm import secrets
from .models import *
from django.shortcuts import get_object_or_404
def index(request):
return render(request, 'index.html')
def manage(request):
machines = VM.objects.all()
return rende... | from django.shortcuts import render
from .forms import *
from proxmoxer import ProxmoxAPI
from managevm import secrets
from .models import *
from django.shortcuts import get_object_or_404
def index(request):
return render(request, 'index.html')
def manage(request):
machines = VM.objects.all()
return render(requ... | mit | Python |
c4dd6502bc7b9d5970a659c57e6aa2d25cc00fe5 | Update timedelta_months docstring to be accurate | z123/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask | catwatch/lib/util_datetime.py | catwatch/lib/util_datetime.py | import datetime
def timedelta_months(months, compare_date=None):
"""
Return a new datetime with a month offset applied.
:param months: Amount of months to offset
:type months: int
:param compare_date: Date to compare at
:type compare_date: date
:return: datetime
"""
if compare_dat... | import datetime
def timedelta_months(months, compare_date=None):
"""
Return a JSON response.
:param months: Amount of months to offset
:type months: int
:param compare_date: Date to compare at
:type compare_date: date
:return: Flask response
"""
if compare_date is None:
co... | mit | Python |
4acc44476a8ecb84542113a9b5f39726c737d103 | Check input parameters | jmtrivial/cartel-generation | cartel-generation.py | cartel-generation.py | #!/usr/bin/python
import csv
import sys
import getopt
def help():
print 'cartel-generation.py -c <input-csv-file> -o <output-svg-file>'
def main(argv):
inputcsvfile = ''
outputsvgfile = ''
try:
opts, args = getopt.getopt(argv,"hi:o:",["icsv=","osvg="])
except getopt.GetoptError:
h... | #!/usr/bin/python
import csv
import sys
import getopt
def help():
print 'cartel-generation.py -c <input-csv-file> -o <output-svg-file>'
def main(argv):
inputfile = ''
outputfile = ''
try:
opts, args = getopt.getopt(argv,"hc:o:",["csv=","osvg="])
except getopt.GetoptError:
help()
sys... | mit | Python |
104e92afa6c5a6218e023387b647d1d4d0e4d7af | enable ui test fixture. | codito/pomito | tests/plugins/ui/test_task_widget.py | tests/plugins/ui/test_task_widget.py | # -*- coding: utf-8 -*-
"""Tests for task widget."""
import os
import pytest
from pomito.plugins.ui.qt.task_widget import TaskWindow
from pomito.test import PomitoTestFactory
@pytest.fixture(scope="function")
def task_window(qtbot):
factory = PomitoTestFactory()
use_trello = False
if use_trello:
... | # -*- coding: utf-8 -*-
"""Tests for task widget."""
import os
import pytest
# from pomito.plugins.ui.qt.task_widget import TaskWindow
from pomito.test import PomitoTestFactory
@pytest.fixture(scope="function")
def task_window(qtbot):
factory = PomitoTestFactory()
use_trello = False
if use_trello:
... | mit | Python |
fe5e9d22da95f0ce94b8feb9698aa38b3e589113 | Add docs for optimizer | onnx/onnx,onnx/onnx,onnx/onnx,onnx/onnx | onnx/optimizer.py | onnx/optimizer.py | """onnx optimizer
This enables users to optimize their models.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import onnx.onnx_cpp2py_export.optimizer as C
"""Apply the optimization on the serialized ModelProto.... | """onnx optimizer
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import onnx.onnx_cpp2py_export.optimizer as C
optimize = C.optimize
| apache-2.0 | Python |
d49baae6440fde3dc809448e76d5e580cc83782f | add STS test | botify-labs/moto,Brett55/moto,IlyaSukhanov/moto,gjtempleton/moto,spulec/moto,whummer/moto,dbfr3qs/moto,spulec/moto,heddle317/moto,ZuluPro/moto,Affirm/moto,2rs2ts/moto,rocky4570/moto,braintreeps/moto,ludia/moto,araines/moto,ZuluPro/moto,botify-labs/moto,pior/moto,andresriancho/moto,kefo/moto,okomestudio/moto,okomestudio... | tests/test_dynamodb/test_dynamodb.py | tests/test_dynamodb/test_dynamodb.py | import boto
import sure # flake8: noqa
from freezegun import freeze_time
import requests
from moto import mock_dynamodb
from moto.dynamodb import dynamodb_backend
from boto.dynamodb import condition
from boto.exception import DynamoDBResponseError
@mock_dynamodb
def test_list_tables():
name = 'TestTable'
d... | import boto
import sure # flake8: noqa
from freezegun import freeze_time
from moto import mock_dynamodb
from moto.dynamodb import dynamodb_backend
from boto.dynamodb import condition
from boto.exception import DynamoDBResponseError
@mock_dynamodb
def test_list_tables():
name = 'TestTable'
dynamodb_backend.... | apache-2.0 | Python |
9a11873286ccdfea0267fc6cf7db068d63c78a7a | Allow _ or - in tribe urls. | amarandon/pinax,amarandon/pinax,amarandon/pinax,amarandon/pinax,alex/pinax,alex/pinax,alex/pinax | apps/local_apps/tribes/urls.py | apps/local_apps/tribes/urls.py | from django.conf.urls.defaults import *
from tribes.models import Tribe
from wiki import models as wiki_models
from tribes.thing import TribeThing
# @@@ should qs really be here?
tt = TribeThing(Tribe.objects.filter(deleted=False))
wiki_args = {'group_slug_field': 'slug',
'group_qs': Tribe.objects.filte... | from django.conf.urls.defaults import *
from tribes.models import Tribe
from wiki import models as wiki_models
from tribes.thing import TribeThing
# @@@ should qs really be here?
tt = TribeThing(Tribe.objects.filter(deleted=False))
wiki_args = {'group_slug_field': 'slug',
'group_qs': Tribe.objects.filte... | mit | Python |
a511b10ae469706cc8695d808c8af41ab2eb0af6 | Add header to load_data.py | luispedro/waldo,luispedro/waldo | scripts/load_data.py | scripts/load_data.py | # -*- coding: utf-8 -*-
# Copyright (C) 2009-2010, Luis Pedro Coelho <lpc@cmu.edu>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
# License: MIT. See COPYING.MIT file in the Waldo distribution
#
import backend
import mgi.files
import mgi.load
import go.files
import go.load
import uniprot.files
import uniprot.load
c... | import backend
import mgi.files
import mgi.load
import go.files
import go.load
import uniprot.files
import uniprot.load
create_session = backend.create_session
go.load.load(go.files.inputfilename, create_session)
mgi.load.load(mgi.files.inputfilename, create_session)
uniprot.load.load(uniprot.files.inputfilename, cre... | mit | Python |
1f576dc47a16bafd8952b03c8b199a101eddb023 | Load goslim | luispedro/waldo,luispedro/waldo | scripts/load_data.py | scripts/load_data.py | # -*- coding: utf-8 -*-
# Copyright (C) 2009-2010, Luis Pedro Coelho <lpc@cmu.edu>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
# License: MIT. See COPYING.MIT file in the Waldo distribution
import waldo.mgi.load
import waldo.go.load
import waldo.goslim.load
import waldo.uniprot.load
import waldo.locate.load
impo... | # -*- coding: utf-8 -*-
# Copyright (C) 2009-2010, Luis Pedro Coelho <lpc@cmu.edu>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
# License: MIT. See COPYING.MIT file in the Waldo distribution
import waldo.mgi.load
import waldo.go.load
import waldo.uniprot.load
import waldo.locate.load
import waldo.hpa.load
modules... | mit | Python |
db27add3d14940a2ce44833d85538cb580ceffc6 | Set DEBUG=False for unittests | openmaraude/APITaxi,openmaraude/APITaxi | APITaxi/test_settings.py | APITaxi/test_settings.py | DEBUG = False
SECRET_KEY = 'super-secret'
SQLALCHEMY_DATABASE_URI = 'postgresql://apitaxi:vincent@localhost/odtaxi_test'
REDIS_URL = "redis://:@localhost:6379/0"
SQLALCHEMY_POOL_SIZE = 2
INFLUXDB_HOST = None
SECURITY_PASSWORD_HASH = 'plaintext'
NOW = 'time_test'
DEFAULT_MAX_RADIUS = 15*1000 #in meters
| DEBUG = True
SECRET_KEY = 'super-secret'
SQLALCHEMY_DATABASE_URI = 'postgresql://apitaxi:vincent@localhost/odtaxi_test'
REDIS_URL = "redis://:@localhost:6379/0"
SQLALCHEMY_POOL_SIZE = 2
INFLUXDB_HOST = None
SECURITY_PASSWORD_HASH = 'plaintext'
NOW = 'time_test'
DEFAULT_MAX_RADIUS = 15*1000 #in meters
| agpl-3.0 | Python |
79a91f0709cb119cec3451ccc122d7157683c4ca | Enable admin management of curricula | pbanaszkiewicz/amy,swcarpentry/amy,pbanaszkiewicz/amy,swcarpentry/amy,pbanaszkiewicz/amy,swcarpentry/amy | workshops/admin.py | workshops/admin.py | from django.contrib import admin
from .models import (
Tag,
AcademicLevel,
ComputingExperienceLevel,
DataAnalysisLevel,
Role,
Lesson,
KnowledgeDomain,
Badge,
TrainingRequirement,
TrainingRequest,
Curriculum,
)
class RoleAdmin(admin.ModelAdmin):
list_display = ('name', ... | from django.contrib import admin
from .models import (
Tag,
AcademicLevel,
ComputingExperienceLevel,
DataAnalysisLevel,
Role,
Lesson,
KnowledgeDomain,
Badge,
TrainingRequirement,
TrainingRequest,
)
class RoleAdmin(admin.ModelAdmin):
list_display = ('name', 'verbose_name')
... | mit | Python |
036da6146765359f3b372556f3f8f79bb59036a2 | add dry run option | semio/ddf_utils | scripts/runrecipe.py | scripts/runrecipe.py | #!/usr/bin/env python3
"""
command line utility for creating ddf from recipe
usage:
before running the script, environment variables should be set
$ export DDF_PATH='path_to_search_ddf'
$ export DICT_PATH='path_to_search_translation_dict'
Then you can run the script with:
$ runrecipe.py -i path_to_recipe -o outdi... | #!/usr/bin/env python3
"""
command line utility for creating ddf from recipe
usage:
before running the script, environment variables should be set
$ export DDF_PATH='path_to_search_ddf'
$ export DICT_PATH='path_to_search_translation_dict'
Then you can run the script with:
$ runrecipe.py -i path_to_recipe -o outdi... | mit | Python |
2a56260d5d3216fe53517731107a87354e951514 | Check for TrafficGen as part of memcheck regression | gem5/gem5,powerjg/gem5-ci-test,HwisooSo/gemV-update,powerjg/gem5-ci-test,powerjg/gem5-ci-test,sobercoder/gem5,HwisooSo/gemV-update,rallylee/gem5,SanchayanMaity/gem5,gedare/gem5,powerjg/gem5-ci-test,gem5/gem5,cancro7/gem5,SanchayanMaity/gem5,SanchayanMaity/gem5,rjschof/gem5,rjschof/gem5,sobercoder/gem5,Weil0ng/gem5,TUD-... | tests/configs/memcheck.py | tests/configs/memcheck.py | # Copyright (c) 2016 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | # Copyright (c) 2016 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause | Python |
767b2cf99f1ebe27f9e61b672a48ddbb2142bfed | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/ce5a10ece2fc414e8d27ef9853b2e92b8815bd76. | tensorflow/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,karllessard/tensorflow,gautam1858/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,gautam1858/tensorflow,gautam1858/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,tensorflow/tensorflow-pywra... | 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 = "ce5a10ece2fc414e8d27ef9853b2e92b8815bd76"
TFRT_SHA256 = "7e1565b8cc59d862ad1309cdce84... | """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 = "9e7129c09d1b1c7b3feb2b45ec70ca4678b57106"
TFRT_SHA256 = "f18df41d8aee99c86859357b778d... | apache-2.0 | Python |
b2d9ff3b1a40934b7c4668d41efb84c4297ff037 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/350a94f1d99d0a27964e7d0cc7582a9178852031. | paolodedios/tensorflow,karllessard/tensorflow,yongtang/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,ten... | 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 = "350a94f1d99d0a27964e7d0cc7582a9178852031"
TFRT_SHA256 = "211a5a41cf5c088fd8b830671dd1... | """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 = "8ecd790065d5c873d0198bf15061ca71f2bb01be"
TFRT_SHA256 = "e1f4a2549f32f52734f915a4e3c9... | apache-2.0 | Python |
8d4ca2c392a788371de36b34fb2610800e43ac51 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/2d8cc3afbc18b09bbd417aaa0bc101a6f304979f. | Intel-tensorflow/tensorflow,karllessard/tensorflow,tensorflow/tensorflow,gautam1858/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_sav... | 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 = "2d8cc3afbc18b09bbd417aaa0bc101a6f304979f"
TFRT_SHA256 = "9bf92a1527a3a6044395fb530f3c... | """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 = "7fb93ab3582d56873b07ba60e63025c1ff784816"
TFRT_SHA256 = "1eb22b7bd7214a69b0682502f647... | apache-2.0 | Python |
273ccba8b1fabff6e9aec6fe81adf372ac878506 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/f77807a28500bdbe19f9300acb5674a9c87d51c4. | frreiss/tensorflow-fred,Intel-Corporation/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,gautam1858/tensorflow,tensorflow/tensorflow,Intel-Corporation/tensorflow,Intel-Corporation/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensor... | 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 = "f77807a28500bdbe19f9300acb5674a9c87d51c4"
TFRT_SHA256 = "8411f4925648263ae632b57b288781a0c7c8b279a1ae80... | """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 = "47a1de40f17e70f901238edfe99dc510a5db797a"
TFRT_SHA256 = "87631491c3fdd34b4d00b6999274468b89a98f23113aea... | apache-2.0 | Python |
eba020e67a369df13e2a5290db57ec4a2dc4ea23 | Add test for verify_encryption_key | keybar/keybar | src/keybar/tests/utils/test_crypto.py | src/keybar/tests/utils/test_crypto.py | import os
import mock
import base64
import pytest
from keybar.utils.crypto import (
derive_encryption_key, verify_encryption_key,
encrypt, decrypt)
@pytest.mark.parametrize('salt,password,expected', (
(b'predictable salt', '漢語中文',
b's RU\xb4\x12S\xa7\x83\x1d\xa5\xc23U:`O\x14R\x92\xb30x\xbe{\xac\x... | import os
import mock
import base64
import pytest
from keybar.utils.crypto import (
derive_encryption_key, verify_encryption_key,
encrypt, decrypt)
@pytest.mark.parametrize('salt,password,expected', (
(b'predictable salt', '漢語中文',
b's RU\xb4\x12S\xa7\x83\x1d\xa5\xc23U:`O\x14R\x92\xb30x\xbe{\xac\x... | bsd-3-clause | Python |
e527971ef52c43b6c24b17f3356b50fd2487f8d2 | remove choices for int config option | smartbgp/yabgp,meidli/yabgp,meidli/yabgp,smartbgp/yabgp | yabgp/db/config.py | yabgp/db/config.py | # Copyright 2015 Cisco Systems, 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 requi... | # Copyright 2015 Cisco Systems, 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 requi... | apache-2.0 | Python |
967ff446aea5859a72983ab9cfe014281142b962 | Make syslog optional | plast-lab/llvm-datalog,plast-lab/cclyzer | src/main/cclyzer/cli/logging_utils.py | src/main/cclyzer/cli/logging_utils.py | import contextlib
import logging
import os
import sys
from logging import StreamHandler
from logging.handlers import RotatingFileHandler, SysLogHandler
from .. import runtime
from .. import settings
class CachelessFormatter(logging.Formatter):
def format(self, record):
# Disable the caching of the excepti... | import contextlib
import logging
import os
import sys
from logging import StreamHandler
from logging.handlers import RotatingFileHandler, SysLogHandler
from .. import runtime
from .. import settings
class CachelessFormatter(logging.Formatter):
def format(self, record):
# Disable the caching of the excepti... | mit | Python |
f31c8a7cc2eee2c51d571dd1de388ae8141c9351 | Test encrypted values | StackStorm/st2tests,StackStorm/st2tests,StackStorm/st2tests | packs/fixtures/actions/pythonactions/datastore_test_action.py | packs/fixtures/actions/pythonactions/datastore_test_action.py | import json
from st2actions.runners.pythonrunner import Action
from st2client.client import Client
from st2client.models import KeyValuePair
__all__ = [
'DatastoreTestAction'
]
class DatastoreTestAction(Action):
def run(self):
self._test_datastore_actions_via_client()
self._test_datastore_... | import json
from st2actions.runners.pythonrunner import Action
from st2client.client import Client
from st2client.models import KeyValuePair
__all__ = [
'DatastoreTestAction'
]
class DatastoreTestAction(Action):
def run(self):
self._test_datastore_actions_via_client()
self._test_datastore_... | apache-2.0 | Python |
f87ac17506c9ec47c973d7942a2951a3e953c2b5 | Make sure generated test order is stable | webcomics/dosage,webcomics/dosage | tests/modules/conftest.py | tests/modules/conftest.py | # SPDX-License-Identifier: MIT
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2022 Tobias Gruetzmacher
import re
import os
import pytest
from xdist.dsession import LoadScopeScheduling
from dosagelib.scraper import scrapers
def get_te... | # SPDX-License-Identifier: MIT
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2022 Tobias Gruetzmacher
import re
import os
import pytest
from xdist.dsession import LoadScopeScheduling
from dosagelib.scraper import scrapers
def get_te... | mit | Python |
71a1cf3f888d41036c5bc3e8ec98c2b0a99b5005 | Increment BQ DB-API thread safety. (#3693) | googleapis/python-bigquery,googleapis/python-bigquery | google/cloud/bigquery/dbapi/__init__.py | google/cloud/bigquery/dbapi/__init__.py | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | apache-2.0 | Python |
2f672e09e743fc2997258d39be2e68102fe9f1f8 | fix interval | N402/NoahsArk,N402/NoahsArk | ark/management/cal_score_sche.py | ark/management/cal_score_sche.py | # -*- coding: utf-8
import os
import time
from flask.ext.script import Command
from ark.exts import db
from ark.account.models import Account
from ark.goal.models import Goal
class ScoreSaver(object):
def __init__(self):
self.interval = 600
def refresh_account_score(self):
all_accounts = A... | # -*- coding: utf-8
import os
import time
from flask.ext.script import Command
from ark.exts import db
from ark.account.models import Account
from ark.goal.models import Goal
class ScoreSaver(object):
def __init__(self):
self.interval = 10
def refresh_account_score(self):
all_accounts = Ac... | mit | Python |
ef9f8ac181c2bfddb9c4efa5f1bddb3adc53276d | Format receiver | WheatonCS/Lexos,WheatonCS/Lexos,WheatonCS/Lexos | lexos/receivers/kmeans_receiver.py | lexos/receivers/kmeans_receiver.py | """This is the receiver for K-Means model."""
from enum import Enum
from typing import NamedTuple
from lexos.receivers.base_receiver import BaseReceiver
class KMeansVisualizationOption(Enum):
"""The typed tuple to hold K-Means Visualization method."""
PCA = "PCA"
Voronoi = "Voronoi"
class KMeansOption... | """This is the receiver for K-Means model."""
from enum import Enum
from typing import NamedTuple
from lexos.receivers.base_receiver import BaseReceiver
class KMeansVisualizationOption(Enum):
"""The typed tuple to hold K-Means Visualization method."""
PCA = "PCA"
Voronoi = "Voronoi"
class KMeansOption... | mit | Python |
4a528978e9a783b9fb4f25d31a32a2ca524d7ce1 | Change attributes order on constructor | samueldmq/infosystem | infosystem/subsystem/domain/resource.py | infosystem/subsystem/domain/resource.py | from infosystem.database import db
from infosystem.common.subsystem import entity
class Domain(entity.Entity, db.Model):
attributes = ['name', 'parent_id']
attributes += entity.Entity.attributes
name = db.Column(db.String(60), nullable=False, unique=True)
parent_id = db.Column(
db.CHAR(32), ... | from infosystem.database import db
from infosystem.common.subsystem import entity
class Domain(entity.Entity, db.Model):
attributes = ['name', 'parent_id']
attributes += entity.Entity.attributes
name = db.Column(db.String(60), nullable=False, unique=True)
parent_id = db.Column(
db.CHAR(32), ... | apache-2.0 | Python |
8291400f398dc5b651243c1612c6dd8dd6fe5157 | update pecan street adapter tests | dssg/wikienergy,dssg/wikienergy,dssg/wikienergy,dssg/wikienergy,dssg/wikienergy | tests/test_pecan_class.py | tests/test_pecan_class.py | import sys
sys.path.append('../')
from disaggregator import PecanStreetDatasetAdapter
import unittest
class PecanStreetDatasetAdapterTestCase(unittest.TestCase):
def setUp(self):
db_url = "postgresql://USERNAME:PASSWORD@db.wiki-energy.org:5432/postgres"
self.psda = PecanStreetDatasetAdapter(db_u... | import sys
sys.path.append('../')
from disaggregator import PecanStreetDatasetAdapter as pecan
import unittest
class PecanStreetDatasetAdapterTestCase(unittest.TestCase):
def setUp(self):
db_url = "postgresql://USERNAME:PASSWORD@db.wiki-energy.org:5432/postgres"
self.p = pecan(db_url)
def t... | mit | Python |
72c24df0ad96ddf9e1efb3228f8db88388f8b421 | Print out complete stack config in `status` command when verbosity>0 enhancement. | Kotaimen/awscfncli,Kotaimen/awscfncli | awscfncli/cli/commands/status.py | awscfncli/cli/commands/status.py | # -*- encoding: utf-8 -*-
import click
import botocore.exceptions
import yaml
from ..main import cfn_cli
from ..utils import boto3_exception_handler, ContextObject, echo_pair, \
STACK_STATUS_TO_COLOR
@cfn_cli.command()
@click.option('-d', '--dry-run', is_flag=True, default=False,
help='Don\'t ret... | # -*- encoding: utf-8 -*-
import click
import botocore.exceptions
from ..main import cfn_cli
from ..utils import boto3_exception_handler, ContextObject, echo_pair, \
STACK_STATUS_TO_COLOR
@cfn_cli.command()
@click.option('-d', '--dry-run', is_flag=True, default=False,
help='Don\'t retrieve stack ... | mit | Python |
cffa73ae51f63ec5e107d9df98b1eb5b44fa64b8 | Add country field to release serializer. | ThreeDRadio/playlists,ThreeDRadio/playlists,ThreeDRadio/playlists | backend/catalogue/serializers.py | backend/catalogue/serializers.py | from rest_framework import serializers
from .models import Release, Track, Comment
class CommentSerializer(serializers.ModelSerializer):
class Meta:
model = Comment
fields = ('id', 'comment')
class TrackSerializer(serializers.ModelSerializer):
cdid = serializers.StringRelatedField(
re... | from rest_framework import serializers
from .models import Release, Track, Comment
class CommentSerializer(serializers.ModelSerializer):
class Meta:
model = Comment
fields = ('id', 'comment')
class TrackSerializer(serializers.ModelSerializer):
cdid = serializers.StringRelatedField(
re... | mit | Python |
feefc1a8d523486eb275ef61a7f465fca8cd795d | Add unit test for print_hdf5 | PMEAL/OpenPNM | tests/unit/io/HDF5Test.py | tests/unit/io/HDF5Test.py | import py
import os
import numpy as np
import openpnm as op
class HDF5Test:
def setup_class(self):
ws = op.Workspace()
ws.settings['local_data'] = True
self.net = op.network.Cubic(shape=[2, 2, 2])
self.net['pore.boo'] = 1
self.net['throat.boo'] = 1
self.phase_1 = ... | import py
import os
import numpy as np
import openpnm as op
class HDF5Test:
def setup_class(self):
ws = op.Workspace()
ws.settings['local_data'] = True
self.net = op.network.Cubic(shape=[2, 2, 2])
self.net['pore.boo'] = 1
self.net['throat.boo'] = 1
self.phase_1 = ... | mit | Python |
d3841c8f473630093e24aff2fbd8a06976bbcb12 | Clean up core.views.index. | nathanielparke/huxley,nathanielparke/huxley,nathanielparke/huxley,bmun/huxley,nathanielparke/huxley,bmun/huxley,ctmunwebmaster/huxley,ctmunwebmaster/huxley,bmun/huxley,ctmunwebmaster/huxley,bmun/huxley,ctmunwebmaster/huxley | huxley/core/views.py | huxley/core/views.py | # Copyright (c) 2011-2014 Berkeley Model United Nations. All rights reserved.
# Use of this source code is governed by a BSD License (see LICENSE).
from huxley.utils.shortcuts import render_template
def index(request):
'''Render the appropriate base tempate.'''
if not request.user.is_authenticated():
... | # Copyright (c) 2011-2014 Berkeley Model United Nations. All rights reserved.
# Use of this source code is governed by a BSD License (see LICENSE).
from django.shortcuts import render_to_response
from django.template import RequestContext
from huxley.core.models import *
def index(request):
'''Render the appropr... | bsd-3-clause | Python |
6fd8c2609d75fec634a1538da1d02236b0bd67d9 | Test private bucket error handling in amazon view | PyBossa/pybossa,PyBossa/pybossa,geotagx/pybossa,Scifabric/pybossa,geotagx/pybossa,Scifabric/pybossa | test/test_amazon.py | test/test_amazon.py | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2016 SciFabric LTD.
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your op... | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2016 SciFabric LTD.
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your op... | agpl-3.0 | Python |
c13c72e8b10df2ea8aa665a511fa12961ee5be0f | Fix test | sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana | test/test_kraken.py | test/test_kraken.py | from sequana.kraken import *
from sequana import sequana_data, sequana_config_path
import os
import tempfile
import pytest
skiptravis = pytest.mark.skipif("TRAVIS_PYTHON_VERSION" in os.environ,
reason="On travis")
#@skiptravis
def run_kraken_taxon():
def download():
kd = KrakenDownload()
kd... | from sequana.kraken import *
from sequana import sequana_data, sequana_config_path
import os
import tempfile
import pytest
skiptravis = pytest.mark.skipif("TRAVIS_PYTHON_VERSION" in os.environ,
reason="On travis")
@skiptravis
def run_kraken_taxon():
def download():
kd = KrakenDownload()
kd.... | bsd-3-clause | Python |
774dc1f60a603c05217472a97021eb2949fcafe4 | use one show function | tlevine/mhdir | mhdir/show.py | mhdir/show.py | '''
show, prev, next
1. If a folder or message is specified, change the current message.
2. Open the current message with the email module.
3. Display the email in some reasonable way like how nmh does it.
4. Run whatnext
whatnext
'''
from pathlib import Path
from email import message_from_binary_file
from . import... | '''
show, prev, next
1. If a folder or message is specified, change the current message.
2. Open the current message with the email module.
3. Display the email in some reasonable way like how nmh does it.
4. Run whatnext
whatnext
'''
from pathlib import Path
from email import message_from_binary_file
from . import... | bsd-3-clause | Python |
34e98881b1c31bbff38c97ba9c72f0e1d4383022 | Fix failing test | jparyani/pycapnp,tempbottle/pycapnp,jparyani/pycapnp,tempbottle/pycapnp,SymbiFlow/pycapnp,tempbottle/pycapnp,jparyani/pycapnp,rcrowder/pycapnp,rcrowder/pycapnp,SymbiFlow/pycapnp,rcrowder/pycapnp,tempbottle/pycapnp,jparyani/pycapnp,SymbiFlow/pycapnp,rcrowder/pycapnp,SymbiFlow/pycapnp | test/test_struct.py | test/test_struct.py | import pytest
import capnp
import os
import tempfile
import sys
this_dir = os.path.dirname(__file__)
@pytest.fixture
def addressbook():
return capnp.load(os.path.join(this_dir, 'addressbook.capnp'))
@pytest.fixture
def all_types():
return capnp.load(os.path.join(this_dir, 'all_types.capnp'))
def test_whi... | import pytest
import capnp
import os
import tempfile
import sys
this_dir = os.path.dirname(__file__)
@pytest.fixture
def addressbook():
return capnp.load(os.path.join(this_dir, 'addressbook.capnp'))
@pytest.fixture
def all_types():
return capnp.load(os.path.join(this_dir, 'all_types.capnp'))
def test_whi... | bsd-2-clause | Python |
78e7c702ae4a18f17f7b1b55f86adffd74282cf6 | Strengthen system tests | leviroth/bernard | test/test_system.py | test/test_system.py | import pytest
from bernard.actors import (AutomodDomainWatcher, AutomodUserWatcher, Banner,
Notifier, Nuker, ToolboxNoteAdder)
from bernard.loader import load_yaml_config
from .helper import BJOTest
pytestmark = pytest.mark.system
class SystemTest(BJOTest):
def basic_test(self, test... | import pytest
from bernard.loader import load_yaml_config
from .helper import BJOTest
pytestmark = pytest.mark.system
class SystemTest(BJOTest):
def basic_test(self, test_name):
with self.recorder.use_cassette('Test{}.system'.format(test_name)):
browser = load_yaml_config(
s... | mit | Python |
08ad0360aa80f086ab4ab8964815e2bf9e653fd5 | Add ads_txt_view view | moshthepitt/shulezote,moshthepitt/shulezote,moshthepitt/shulezote | core/views.py | core/views.py | from django.views.generic.list import ListView
from django.conf import settings
from schools.models import School
from kcse.utils import get_last_year
ADS_TXT = getattr(settings, 'ADS_TEXT', '')
class HomePageView(ListView):
model = School
template_name = "home.html"
def get_queryset(self):
que... | from django.views.generic.list import ListView
from schools.models import School
from kcse.utils import get_last_year
class HomePageView(ListView):
model = School
template_name = "home.html"
def get_queryset(self):
queryset = super(HomePageView, self).get_queryset().order_by('?')
return ... | mit | Python |
fc9303cc34d17975b969cf332b5230940de736ad | Clean test_proxy | dincamihai/salt-toaster,dincamihai/salt-toaster | tests/test_proxy.py | tests/test_proxy.py | import os
import pytest
from utils import retry
from faker import Faker
from factories import ContainerFactory
PROXY_PORT = 8000
@pytest.fixture(scope="module")
def minion_id():
fake = Faker()
return u'{0}_{1}'.format(fake.word(), fake.word())
@pytest.fixture(scope="module")
def proxy_server(request, salt... | import os
import pytest
from utils import retry
from faker import Faker
from factories import ContainerFactory
@pytest.fixture(scope="module")
def minion_id():
fake = Faker()
return u'{0}_{1}'.format(fake.word(), fake.word())
@pytest.fixture(scope="module")
def proxy_config():
return {'port': 8000}
@p... | mit | Python |
64156366c78ea70f9595daf3c3eb295cf899bce7 | Modify tests/test_utils.py from unittest to pytest | eronde/py_word_suggest,eronde/py_word_suggest,eronde/vim_suggest,eronde/vim_suggest | tests/test_utils.py | tests/test_utils.py | from py_word_suggest.utils import *
import pytest
def test_is_empty():
"""utils, is_empty: Check if an object is empty or contains spaces
:returns: TODO
"""
assert is_empty('') == True
assert is_empty('test') == False
| import unittest
import re
# from ..util.utils import *
from py_word_suggest.utils import *
class utilsTest(unittest.TestCase):
"""Docstring for decorationsTest. """
def setUp(self):
""" decorators: setup
"""
pass
def tearDown(self):
pass
def test_is_empty(self):
... | mit | Python |
80e31e3bfb67fc5b0d1ce69d851426911e809cd6 | Add deep_chain_map test cases | gogoair/foremast,gogoair/foremast | tests/test_utils.py | tests/test_utils.py | # Foremast - Pipeline Tooling
#
# Copyright 2016 Gogo, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | # Foremast - Pipeline Tooling
#
# Copyright 2016 Gogo, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | apache-2.0 | Python |
fd96a9d24cb6045b88040a4ef2b9009e9a135ae3 | Fix import in atom.ext.crispy_forms.views | ad-m/django-atom | atom/ext/crispy_forms/views.py | atom/ext/crispy_forms/views.py | from __future__ import absolute_import
from django.contrib import messages
from django.forms.models import inlineformset_factory
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext as _
from .forms import BaseTableFormSet
class FormSetMixin(object):
inline_model = None
... | from __future__ import absolute_import
from django.contrib import messages
from django.forms.models import inlineformset_factory
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext as _
from .main import BaseTableFormSet
class FormSetMixin(object):
inline_model = None
... | bsd-3-clause | Python |
f18fb07e14e5164ef0429478eb5e1a7b7c142d29 | bump release version (#157) | F5Networks/f5-icontrol-rest-python,F5Networks/f5-icontrol-rest-python | icontrol/__init__.py | icontrol/__init__.py | __version__ = "1.3.9"
| __version__ = "1.3.8"
| apache-2.0 | Python |
844f2b76e4a12553e7658b39c034030bad444835 | Fix error message | walles/px,walles/px | px/px_install.py | px/px_install.py | import sys
import shutil
import os
def install(src, dest):
"""
Copy src (file) into dest (file) and make dest executable.
On trouble, prints message and exits with an error code.
"""
try:
_install(src, dest)
except Exception as e:
sys.stderr.write("Installing {} failed, pleas... | import sys
import shutil
import os
def install(src, dest):
"""
Copy src (file) into dest (file) and make dest executable.
On trouble, prints message and exits with an error code.
"""
try:
_install(src, dest)
except Exception as e:
sys.stderr.write("Installing {} failed, pleas... | mit | Python |
a7ed324cc043bfd5f9ef025032f2dd6ae1bb7acc | Increment version to 0.3.0 | dgwartney-io/import-io-api-python,dgwartney-io/import-io-api-python | importio2/version.py | importio2/version.py | #
# Copyright 2016 Import.io
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | #
# Copyright 2016 Import.io
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | Python |
810b69a39b17f223e1b5dd50d4946cf016cf895c | bump minor version | dswah/pyGAM | pygam/__init__.py | pygam/__init__.py | """
GAM toolkit
"""
from __future__ import absolute_import
from pygam.pygam import GAM
from pygam.pygam import LinearGAM
from pygam.pygam import LogisticGAM
from pygam.pygam import GammaGAM
from pygam.pygam import PoissonGAM
from pygam.pygam import InvGaussGAM
from pygam.pygam import ExpectileGAM
from pygam.terms im... | """
GAM toolkit
"""
from __future__ import absolute_import
from pygam.pygam import GAM
from pygam.pygam import LinearGAM
from pygam.pygam import LogisticGAM
from pygam.pygam import GammaGAM
from pygam.pygam import PoissonGAM
from pygam.pygam import InvGaussGAM
from pygam.pygam import ExpectileGAM
from pygam.terms im... | apache-2.0 | Python |
f26d8a0d181182b3654f358c1631fd7c5a8592dd | remove json dump camel casing. Names in JSON will be the same as in AST | zbraniecki/pyast | pyast/dump/js.py | pyast/dump/js.py | import json
import pyast
from collections import OrderedDict
import sys
if sys.version >= '3':
basestring = str
else:
pass
def _dump_node(node, name=None, indent=0):
if node is None:
return None
if isinstance(node, (int, bool, basestring)):
return node
struct = OrderedDict({'ty... | import json
import pyast
from collections import OrderedDict
import sys
if sys.version >= '3':
basestring = str
else:
pass
def _dump_node_name(node):
return node.__class__.__name__.lower()
def _dump_node(node, name=None, indent=0):
if node is None:
return None
if isinstance(node, (int, ... | bsd-3-clause | Python |
3ee00fad1965dae23f83da870d7df1cb37727c7a | Add HStore extension to initial migration. | carlohamalainen/django-struct-log | structlog/migrations/0001_initial.py | structlog/migrations/0001_initial.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-10 14:33
from __future__ import unicode_literals
from django.db import migrations
from django.contrib.postgres.operations import HStoreExtension
class Migration(migrations.Migration):
dependencies = [
]
operations = [
HStoreExten... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-10 14:33
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
]
| bsd-2-clause | Python |
7b399ce7657d5ddd4ae26c6194f3818acb3c8d81 | print on gmsh failure | nschloe/python4gmsh | pygmsh/helper.py | pygmsh/helper.py | # -*- coding: utf-8 -*-
#
import numpy
import sys
if sys.platform == 'darwin':
# likely there.
gmsh_executable = '/Applications/Gmsh.app/Contents/MacOS/gmsh'
else:
gmsh_executable = 'gmsh'
def rotation_matrix(u, theta):
'''Return matrix that implements the rotation around the vector :math:`u`
by... | # -*- coding: utf-8 -*-
#
import numpy
import sys
if sys.platform == 'darwin':
# likely there.
gmsh_executable = '/Applications/Gmsh.app/Contents/MacOS/gmsh'
else:
gmsh_executable = 'gmsh'
def rotation_matrix(u, theta):
'''Return matrix that implements the rotation around the vector :math:`u`
by... | bsd-3-clause | Python |
4fa65099de4e0f769cebb781bb3bacffee2066a2 | Break out collection functions for json usage | openstack/ironic,openstack/ironic | ironic/api/controllers/v1/collection.py | ironic/api/controllers/v1/collection.py | # Copyright 2013 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | # Copyright 2013 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | apache-2.0 | Python |
9252f5e2a830a70d6e5929b4ab0eab920d96e8b7 | Bump to version 0.1.1 | posterior/treecat,posterior/treecat | treecat/__init__.py | treecat/__init__.py | __version__ = '0.1.1'
| __version__ = '0.1.0'
| apache-2.0 | Python |
3ce4d2ce78f5d1b711f4c4961ab565a3a81bba0d | Update pysam version | kyleabeauchamp/pysam,pysam-developers/pysam,pysam-developers/pysam,kyleabeauchamp/pysam,pysam-developers/pysam,kyleabeauchamp/pysam,pysam-developers/pysam,kyleabeauchamp/pysam,kyleabeauchamp/pysam | pysam/version.py | pysam/version.py | # pysam versioning information
__version__ = "0.15.0"
# TODO: upgrade number
__samtools_version__ = "1.9"
# TODO: upgrade code and number
__bcftools_version__ = "1.9"
__htslib_version__ = "1.9"
| # pysam versioning information
__version__ = "0.14.1"
# TODO: upgrade number
__samtools_version__ = "1.7"
# TODO: upgrade code and number
__bcftools_version__ = "1.6"
__htslib_version__ = "1.7"
| mit | Python |
17655f2d236ad4414f538ff81243ca95398d7b94 | Fix use of rbtimer | rklancer/touchjoy,rklancer/touchjoy | rascal/server.py | rascal/server.py | class Motor:
SERIAL_SPEED = 115200
TIMEOUT_INTERVAL = 3
def __init__(self):
import time
self.last_command_string = ""
self.last_command_time = time.time()
self.timed_out = False
def send_command_string(self, command_string):
# import pytronics
self.last_command_string = command_s... | class Motor:
SERIAL_SPEED = 115200
TIMEOUT_INTERVAL = 3
def __init__(self):
import time
self.last_command_string = ""
self.last_command_time = time.time()
self.timed_out = False
def send_command_string(self, command_string):
# import pytronics
self.last_command_string = command_s... | mit | Python |
552851e44ba84a7853e1f44849129df250b175d5 | Update version.py | SRI-CSL/OCCAM,SRI-CSL/OCCAM,ashish-gehani/OCCAM,ashish-gehani/OCCAM,SRI-CSL/OCCAM,SRI-CSL/OCCAM,ashish-gehani/OCCAM,ashish-gehani/OCCAM,SRI-CSL/OCCAM | razor/version.py | razor/version.py | """
OCCAM
Copyright (c) 2011-2017, SRI International
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 of con... | """
OCCAM
Copyright (c) 2011-2017, SRI International
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 of con... | bsd-3-clause | Python |
b4112050f843c4be174969b5dbfaacc150ee01ef | Revert "disable 'svn init' for blink temporarily" | svn2github/chromium-depot-tools,svn2github/chromium-depot-tools,svn2github/chromium-depot-tools | recipes/blink.py | recipes/blink.py | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
# pylint: disable=F0401
import recipe_util
import sys
# pylint: disable=W0232
class Blink(recipe_util.Recipe):
"""Basic Recipe alias for B... | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# TOOD(dpranke): reenable import json
# pylint: disable=F0401
import recipe_util
import sys
# pylint: disable=W0232
class Blink(recipe_util.Recipe):
"... | bsd-3-clause | Python |
39898f189ea614fc1489cb631ac913f123b0f89a | Fix tiny typo | erikng/sal,erikng/sal,salopensource/sal,sheagcraig/sal,salopensource/sal,erikng/sal,erikng/sal,sheagcraig/sal,salopensource/sal,salopensource/sal,sheagcraig/sal,sheagcraig/sal | server/plugins/machinedetailsecurity/machinedetailsecurity.py | server/plugins/machinedetailsecurity/machinedetailsecurity.py | from yapsy.IPlugin import IPlugin
from yapsy.PluginManager import PluginManager
from django.template import loader, Context
from django.db.models import Count
from server.models import *
from django.shortcuts import get_object_or_404
import server.utils as utils
class MachineDetailSecurity(IPlugin):
def plugin_typ... | from yapsy.IPlugin import IPlugin
from yapsy.PluginManager import PluginManager
from django.template import loader, Context
from django.db.models import Count
from server.models import *
from django.shortcuts import get_object_or_404
import server.utils as utils
class MachineDetailSecurity(IPlugin):
def plugin_typ... | apache-2.0 | Python |
a0c9862c41c522ce1576608e395479e352f045e2 | Update rtconfig.py for QEMU. | hezlog/rt-thread,armink/rt-thread,FlyLu/rt-thread,igou/rt-thread,ArdaFu/rt-thread,armink/rt-thread,geniusgogo/rt-thread,weety/rt-thread,yongli3/rt-thread,FlyLu/rt-thread,AubrCool/rt-thread,weiyuliang/rt-thread,zhaojuntao/rt-thread,AubrCool/rt-thread,yongli3/rt-thread,hezlog/rt-thread,yongli3/rt-thread,weiyuliang/rt-thr... | bsp/qemu-vexpress-a9/rtconfig.py | bsp/qemu-vexpress-a9/rtconfig.py | import os
# toolchains options
ARCH='arm'
CPU='vexpress-a9'
CROSS_TOOL='gcc'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
PLATFORM = 'gcc'
EXEC_PATH = '/opt/gcc-arm-none-eabi-4_8-2014q1_gri/bin'
if os.getenv('RTT_EXEC_PATH'):
EXEC_PATH = os.getenv('RTT_EXEC_PATH')
BUILD = 'debug'
if PLATF... | import os
# toolchains options
ARCH='arm'
CPU='vexpress-a9'
CROSS_TOOL='gcc'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
EXEC_PATH = '/opt/gcc-arm-none-eabi-4_8-2014q1_gri/bin'
elif CROSS_TOOL == 'keil':
PLATFORM = 'armcc'
EXEC_PATH ... | apache-2.0 | Python |
1de586053695c19ee5861e7e6840847d22765286 | Remove redundant form fields | ltowarek/budget-supervisor | budgetsupervisor/budget/forms.py | budgetsupervisor/budget/forms.py | from django import forms
from django.conf import settings
from django.utils.dateparse import parse_datetime
import os
import json
from .models import Account, Category, Connection, Transaction
from decimal import Decimal
from django.shortcuts import redirect
from .models import Account, Connection
from django.contrib.a... | from django import forms
from django.conf import settings
from django.utils.dateparse import parse_datetime
import os
import json
from .models import Account, Category, Connection, Transaction
from decimal import Decimal
from django.shortcuts import redirect
from .models import Account, Connection
from django.contrib.a... | mit | Python |
27f92fbabb230537364f9bcd987bdae7b9664269 | Remove the unnecessary levels in log.py | dotamin/migmig | migmig/log.py | migmig/log.py | # migmig logger module
import logging
import sys
class logger():
def __init__(self, verbose, console = None):
'''
Python doc :
https://docs.python.org/2/library/logging.html#logrecord-attributes
Levels:
0: NOTSET - 0
1: DEBUG - 10
2: INFO - 20
3: WARNING - 30
4: ERROR - 40
5: CRITI... | # migmig logger module
import logging
import sys
class logger():
def __init__(self, verbose, console = None):
'''
Python doc :
https://docs.python.org/2/library/logging.html#logrecord-attributes
Levels:
0: NOTSET - 0
1: DEBUG - 10
2: INFO - 20
3: WARNING - 30
4: ERROR - 40
5: CRITI... | agpl-3.0 | Python |
ac35aae04c17a9595b5d195bcafcb3d7dae1c408 | Add tests for path_helpers | controversial/ui2 | ui2/path_helpers.py | ui2/path_helpers.py | import ui
import objc_util
def get_path_image(path):
""" Get an image of a path """
bounds = path.bounds
with ui.ImageContext(bounds.max_x, bounds.max_y) as ctx:
path.fill()
return ctx.get_image()
def copy_path(path):
""" Make a copy of a ui.Path and return it. Preserves all data. ""... | import ui
import objc_util
def get_path_image(path):
""" Get an image of a path """
bounds = path.bounds
with ui.ImageContext(bounds.max_x, bounds.max_y) as ctx:
path.fill()
return ctx.get_image()
def copy_path(path):
""" Make a copy of a ui.Path and return it. Preserves all data. ""... | mit | Python |
c6664b7e40b2668e6825ab605f57230787f177cf | Resolve Not available error | GingerNinja23/bookbargain | amazon.py | amazon.py | import urllib2
from bs4 import BeautifulSoup
import pyisbn
import re
import time
import mechanize
def amazon(isbn):
# isbn = '9789380501932'
if len(isbn) == 13:
a_link = "http://www.amazon.in/dp/"+pyisbn.Isbn(isbn).convert(code='978')
else:
a_link = "http://www.amazon.in/dp/"+isbn
br = mechanize.Browser()
#br.... | import urllib2
from bs4 import BeautifulSoup
import pyisbn
import re
import time
import mechanize
def amazon(isbn):
# isbn = '9789380501932'
if len(isbn) == 13:
a_link = "http://www.amazon.in/dp/"+pyisbn.Isbn(isbn).convert(code='978')
else:
a_link = "http://www.amazon.in/dp/"+isbn
br = mechanize.Browser()
#br.... | mit | Python |
046df1ce3fac6b89bd71d3013d423532afffbc09 | add order | wabarr/census-paleo,wabarr/census-paleo,wabarr/census-paleo | census_paleo/choices_taxonomy.py | census_paleo/choices_taxonomy.py | # #choices for upcoming taxonomy class
CHOICES_KINGDOM = (
("Animalia", "Animalia"),
)
CHOICES_PHYLUM = (
("Chordata", "Chordata"),
)
CHOICES_CLASS = (
("Mammalia", "Mammalia"),
("Reptilia", "Reptilia"),
("Pisces", "Pisces"),
("Aves", "Aves"),
("Amphibia", "Amphibia"),
)
CHOICES_ORDER = (
("AFROSORICIDA","AFROSORICI... | # #choices for upcoming taxonomy class
CHOICES_KINGDOM = (
("Animalia", "Animalia"),
)
CHOICES_PHYLUM = (
("Chordata", "Chordata"),
)
CHOICES_CLASS = (
("Mammalia", "Mammalia"),
("Reptilia", "Reptilia"),
("Pisces", "Pisces"),
("Aves", "Aves"),
("Amphibia", "Amphibia"),
)
CHOICES_ORDER = (
("ARTIODACTYLA", "ARTIODACT... | mit | Python |
4ef7b9d83a011ce822dc94e6c61fa06b740c4532 | remove not python2 syntax | di-unipi-socc/tosKer,di-unipi-socc/tosKer,di-unipi-socc/tosKer | tosker/protocol_helper.py | tosker/protocol_helper.py | """A set of functions to help the protocols implementation."""
from .helper import Logger
from .graph.nodes import Root
def can_execute(operation, component):
"""Check if an operation can be executed on a component."""
assert isinstance(operation, str)
assert isinstance(component, Root)
_log = Logger.g... | """A set of functions to help the protocols implementation."""
from .helper import Logger
from .graph.nodes import Root
def can_execute(operation:str, component:Root):
"""Check if an operation can be executed on a component."""
assert isinstance(operation, str)
assert isinstance(component, Root)
_log =... | mit | Python |
c246edee4ddc6fdf9e60f6c12576f51927b6eefe | Bump version | NaturalHistoryMuseum/inselect,NaturalHistoryMuseum/inselect | inselect/__init__.py | inselect/__init__.py | """Segmentation, validation and annotation of scanned images of museum objects
"""
__version__ = '0.1.10'
# distutils/version.py and win32/lib/win32versionstamp.py have different
# restrictions on the format of version numbers - both must be met.
# Three numbers separated by dots is a safe format.
| """Segmentation, validation and annotation of scanned images of museum objects
"""
__version__ = '0.1.9'
# distutils/version.py and win32/lib/win32versionstamp.py have different
# restrictions on the format of version numbers - both must be met.
# Three numbers separated by dots is a safe format.
| bsd-3-clause | Python |
960177725a52d9f945e3b9df52d3f09fd63227a8 | Add major to Player search fields in admin | kz26/uchicago-hvz,kz26/uchicago-hvz,kz26/uchicago-hvz | uchicagohvz/game/admin.py | uchicagohvz/game/admin.py | from django.contrib import admin
from django.conf import settings
from uchicagohvz.game.models import *
# Register your models here.
admin.site.register(Game)
class PlayerAdmin(admin.ModelAdmin):
list_filter = ('game__name', 'active', 'human', 'dorm', 'renting_gun', 'gun_returned')
readonly_fields = ('points',)
i... | from django.contrib import admin
from django.conf import settings
from uchicagohvz.game.models import *
# Register your models here.
admin.site.register(Game)
class PlayerAdmin(admin.ModelAdmin):
list_filter = ('game__name', 'active', 'human', 'dorm', 'renting_gun', 'gun_returned')
readonly_fields = ('points',)
i... | mit | Python |
cbbe3d7ba193243cceac8602b2a7be0de618b85c | test sentry | NaturalHistoryMuseum/ckanext-nhm,NaturalHistoryMuseum/ckanext-nhm,NaturalHistoryMuseum/ckanext-nhm | ckanext/nhm/controllers/about.py | ckanext/nhm/controllers/about.py |
import ckan.plugins as p
from ckan.common import _, g, c
import ckan.lib.helpers as h
from ckanext.stats import stats as stats_lib
class AboutController(p.toolkit.BaseController):
"""
Controller for displaying about pages
"""
def citation(self):
raise Exception('HEELOO')
return p.tool... |
import ckan.plugins as p
from ckan.common import _, g, c
import ckan.lib.helpers as h
from ckanext.stats import stats as stats_lib
class AboutController(p.toolkit.BaseController):
"""
Controller for displaying about pages
"""
def citation(self):
return p.toolkit.render('about/citation.html', ... | mit | Python |
0651b9270db201b4cfa5c40a53661e4ef19df9c0 | Bump version to 0.5.0c2 | smarkets/smk_python_sdk | smarkets/__init__.py | smarkets/__init__.py | "Smarkets API package"
# Copyright (C) 2011 Smarkets Limited <support@smarkets.com>
#
# This module is released under the MIT License:
# http://www.opensource.org/licenses/mit-license.php
import inspect
import os
if 'READTHEDOCS' in os.environ:
from mock import Mock
import sys
eto = seto = \
sys.m... | "Smarkets API package"
# Copyright (C) 2011 Smarkets Limited <support@smarkets.com>
#
# This module is released under the MIT License:
# http://www.opensource.org/licenses/mit-license.php
import inspect
import os
if 'READTHEDOCS' in os.environ:
from mock import Mock
import sys
eto = seto = \
sys.m... | mit | Python |
f5abc04176b9635da963ca701f643acde5da24dc | Update bucket_sort.py (#821) | TheAlgorithms/Python | sorts/bucket_sort.py | sorts/bucket_sort.py | #!/usr/bin/env python
# Author: OMKAR PATHAK
# This program will illustrate how to implement bucket sort algorithm
# Wikipedia says: Bucket sort, or bin sort, is a sorting algorithm that works by distributing the
# elements of an array into a number of buckets. Each bucket is then sorted individually, either using
# a... | #!/usr/bin/env python
# Author: OMKAR PATHAK
# This program will illustrate how to implement bucket sort algorithm
# Wikipedia says: Bucket sort, or bin sort, is a sorting algorithm that works by distributing the
# elements of an array into a number of buckets. Each bucket is then sorted individually, either using
# a... | mit | Python |
b5303d6dab26335ffbd3c289e9ff7cf84227ddd5 | print needs parenthesis | macbre/mobify | mobify/cli.py | mobify/cli.py | """mobify
Download a web page (set of web pages) as an e-book.
Usage:
mobify URL ...
mobify (-h | --help)
mobify --version
Options:
URL Space-separated list of URLs to fetch.
-h --help Show this screen.
--version Show version.
"""
import logging
import subprocess
from docopt import do... | """mobify
Download a web page (set of web pages) as an e-book.
Usage:
mobify URL ...
mobify (-h | --help)
mobify --version
Options:
URL Space-separated list of URLs to fetch.
-h --help Show this screen.
--version Show version.
"""
import logging
import subprocess
from docopt import do... | mit | Python |
0b9c3ce5abc71af960b1f630db655bcd0eece40f | Update modCreator.py | OscarEReyes/Modding-Tool | modCreator.py | modCreator.py | from lxml import etree
import softwareModClasses as modClasses
def create_mod(spinbox, mod_name, combobox):
"""
* Create an etree Element. (The root of the xml tree)
* Create the expected tags. (Executes create_tags method)
* Add features (The number depending form user input)
* Save move... | from lxml import etree
import softwareModClasses as smc
def create_mod(number_of_features, mod_name, combobox):
root = etree.Element("SoftwareType")
create_tags(root)
add_features(root, number_of_features, combobox)
save_mod(root, mod_name)
def create_tags(root):
field_list = [
... | mit | Python |
c6fef5df42b0d8dd28dcd780724ce5572a76e424 | Add git_path to task. | fi-ksi/web-backend,fi-ksi/web-backend | model/task.py | model/task.py | import datetime
from sqlalchemy import Column, Integer, String, DateTime, Text, ForeignKey, Boolean
from sqlalchemy.orm import relationship
from . import Base
class Task(Base):
__tablename__ = 'tasks'
__table_args__ = {
'mysql_engine': 'InnoDB',
'mysql_charset': 'utf8'
}
id = Column(Integer, primary_key=Tru... | import datetime
from sqlalchemy import Column, Integer, String, DateTime, Text, ForeignKey, Boolean
from sqlalchemy.orm import relationship
from . import Base
class Task(Base):
__tablename__ = 'tasks'
__table_args__ = {
'mysql_engine': 'InnoDB',
'mysql_charset': 'utf8'
}
id = Column(Integer, primary_key=Tru... | mit | Python |
f1352498008b15fd41e1e4d6b31a8290686c4981 | create a ConfigParser helper for cephdeploy confs | SUSE/ceph-deploy,jumpstarter-io/ceph-deploy,ceph/ceph-deploy,alfredodeza/ceph-deploy,isyippee/ceph-deploy,Vicente-Cheng/ceph-deploy,codenrhoden/ceph-deploy,ddiss/ceph-deploy,rtulke/ceph-deploy,osynge/ceph-deploy,alfredodeza/ceph-deploy,osynge/ceph-deploy,ddiss/ceph-deploy,SUSE/ceph-deploy,branto1/ceph-deploy,codenrhode... | ceph_deploy/conf/cephdeploy.py | ceph_deploy/conf/cephdeploy.py | from ConfigParser import SafeConfigParser, NoSectionError, NoOptionError
import os
from os import path
cd_conf_template = """
#
# ceph-deploy configuration file
#
[ceph-deploy-global]
# Overrides for some of ceph-deploy's global flags, like verbosity or cluster
# name
[ceph-deploy-install]
# Overrides for some of c... | from ConfigParser import SafeConfigParser
import os
from os import path
cd_conf_template = """
#
# ceph-deploy configuration file
#
[ceph-deploy-global]
# Overrides for some of ceph-deploy's global flags, like verbosity or cluster
# name
[ceph-deploy-install]
# Overrides for some of ceph-deploy's install flags, lik... | mit | Python |
8ecf9d95cf7f085b0245b07422ccda007937a5c6 | Add `@dca.dataclass_array` decorator to customize dca params. Change default values | google-research/visu3d | visu3d/array_dataclass.py | visu3d/array_dataclass.py | # Copyright 2022 The visu3d Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | # Copyright 2022 The visu3d Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | apache-2.0 | Python |
963b03e6fd99894f314d3644c571a5f42eb231dc | Add generator demo. | precompiler/python-101 | mastering-python/ch06/Generator.py | mastering-python/ch06/Generator.py | def numbers():
yield 1
yield 2
yield 3
for i in numbers():
print(i)
it = numbers()
print(next(it))
print(next(it))
print(next(it))
# next(it)
def ls():
yield "where"
yield "what"
yield "www"
yield "dummy"
yield "when"
def grep(seq, target_str):
for item in seq:
if t... | def numbers():
yield 1
yield 2
yield 3
for i in numbers():
print(i)
it = numbers()
print(next(it))
print(next(it))
print(next(it))
# next(it)
def ls():
yield "where"
yield "what"
yield "www"
yield "dummy"
yield "when"
def grep(seq, target_str):
for item in seq:
if t... | apache-2.0 | Python |
fb10e4b8ae37f1442bdb643c27ea0b984da6a374 | Rewrite httputil test module via pytest | cherrypy/cherrypy,Safihre/cherrypy,Safihre/cherrypy,cherrypy/cherrypy | cherrypy/test/test_httputil.py | cherrypy/test/test_httputil.py | """Tests for ``cherrypy.lib.httputil``."""
import pytest
from cherrypy.lib import httputil
class TestUtility(object):
@pytest.mark.parametrize(
'script_name,path_info,expected_url',
[
('/sn/', '/pi/', '/sn/pi/'),
('/sn/', '/pi', '/sn/pi'),
('/sn/', '/', '/sn/')... | """Tests for cherrypy/lib/httputil.py."""
import unittest
from cherrypy.lib import httputil
class UtilityTests(unittest.TestCase):
def test_urljoin(self):
# Test all slash+atom combinations for SCRIPT_NAME and PATH_INFO
self.assertEqual(httputil.urljoin('/sn/', '/pi/'), '/sn/pi/')
self.a... | bsd-3-clause | Python |
3b2c091ba380dd319d9c03df5a242d0d6514f9cf | allow timer wait to run at least once no matter the timeout | lmtierney/watir-snake | watir_snake/wait/timer.py | watir_snake/wait/timer.py | from time import sleep, time
class Timer(object):
def __init__(self, timeout=None):
self.end_time = time() + timeout if timeout else None
def wait(self, timeout, method, interval=0, object=None, expected=True):
"""
Executes the given method until it returns True or exceeds the timeout... | from time import sleep, time
class Timer(object):
def __init__(self, timeout=None):
self.end_time = time() + timeout if timeout else None
def wait(self, timeout, method, interval=0, object=None, expected=True):
"""
Executes the given method until it returns True or exceeds the timeout... | mit | Python |
8275efdf5ed5d87f7e04e8ba6dc061b1516d0e89 | use pytest.approx when comparing unarchived models (#172) | nafitzgerald/allennlp,nafitzgerald/allennlp,allenai/allennlp,allenai/allennlp,allenai/allennlp,allenai/allennlp,nafitzgerald/allennlp,nafitzgerald/allennlp | tests/service/predictors/srl_test.py | tests/service/predictors/srl_test.py | # pylint: disable=no-self-use,invalid-name
import os
from unittest import TestCase
from allennlp.models.archival import load_archive
from allennlp.service.predictors import Predictor
import pytest
class TestSrlPredictor(TestCase):
def test_uses_named_inputs(self):
inputs = {
"sentence": "... | # pylint: disable=no-self-use,invalid-name
import os
from unittest import TestCase
from allennlp.models.archival import load_archive
from allennlp.service.predictors import Predictor
import pytest
class TestSrlPredictor(TestCase):
def test_uses_named_inputs(self):
inputs = {
"sentence": "... | apache-2.0 | Python |
0269b03b4b7a696342f6167186f1d30713ad7eec | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/00a8a7990d4ebe94a3f283eada4407e21e030b9e. | tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,gautam1858/tensorflow,gautam1858/tensorflow,yongtang/tensorflow,tensorflow/tensorflow,gautam1858/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,yongtang/t... | 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 = "00a8a7990d4ebe94a3f283eada4407e21e030b9e"
TFRT_SHA256 = "afcad8d9ae3d9171bb604bfba474... | """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 = "0066ca2ff4fed6fe843ad54b57617d6c1bc482f1"
TFRT_SHA256 = "3809a6d92f058d3b8d838f04ffab... | apache-2.0 | Python |
1daa5831cca3d992d8793d6dedf90a79872fe728 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/0bcc39832f2b0e08862cc5b56d610053f7afd02d. | paolodedios/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,Intel-Corporation/tensorflow,sarvex/tensorflow,yongtang/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_tf_optimizer,frreiss/tensorflow-fred,karllessard/tensorflow,yongtang/tensorflow,tensorflow/tens... | 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 = "0bcc39832f2b0e08862cc5b56d610053f7afd02d"
TFRT_SHA256 = "0e53d84b4bec0847f85d3f204e4724eb185b5a63644b07... | """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 = "0c3fa9828b39821e190c54ba18e2295a9f324385"
TFRT_SHA256 = "6f6d3e293564a483ffb735bd89f055619a7eef27005616... | apache-2.0 | Python |
d80e5c50342a771340299f6e833cd80cc444f250 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/c358e8ef87edb6e50f2ebc489bf704ea7892b5ce. | paolodedios/tensorflow,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow,paolodedios/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,paolod... | 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 = "c358e8ef87edb6e50f2ebc489bf704ea7892b5ce"
TFRT_SHA256 = "ba47ae7c5251d72ccf716b493845... | """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 = "faf354fbad3aa5f2764e24d189f9c818c4b9f883"
TFRT_SHA256 = "e6589149309e66331aaa034acf34... | apache-2.0 | Python |
10158ad7be4f9134900ba8337446dc08211f13ae | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/451f5d4f655cd7cabe409f4fa163d7122e593306. | yongtang/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,frreiss/tensorflow-fred,tensor... | 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 = "451f5d4f655cd7cabe409f4fa163d7122e593306"
TFRT_SHA256 = "8893e398fc630c5d74ab30289d66e431f477c87e9b05a0... | """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 = "fbea0c8b4bc09c835c14b8538ef273fe0f80b380"
TFRT_SHA256 = "d3f2c8dd24045ec2c9c16190f1918d56878d45385cecde... | apache-2.0 | Python |
4e2c71afaa4564d4b218a03bb291d4fd420e9675 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/cb3e41d0a2287bfb4be909dd924368d45321fdc4. | tensorflow/tensorflow-pywrap_saved_model,gautam1858/tensorflow,frreiss/tensorflow-fred,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,paolodedios/tensorflow,tensorflow/tensorfl... | 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 = "cb3e41d0a2287bfb4be909dd924368d45321fdc4"
TFRT_SHA256 = "013e9e9cc6136cac3221b25f8f2a5b62925c8a01194a35... | """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 = "f53f67c9faee8e197afb335d28f32913b0ba2a47"
TFRT_SHA256 = "5bf38f856f1fa83bf6be9847d2f61e72f5ebfedff94354... | apache-2.0 | Python |
aae463f88acdd9f1b5bf8af9492b3004337df0f9 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/a4c4935cba04c557195218f2d4d1a6738141590a. | Intel-Corporation/tensorflow,karllessard/tensorflow,frreiss/tensorflow-fred,Intel-tensorflow/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-Corporation/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorfl... | 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 = "a4c4935cba04c557195218f2d4d1a6738141590a"
TFRT_SHA256 = "87b36aa1125c13c4cf336836919aa9f9ed4b1f30c15bda... | """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 = "25987cd238045b8185091b59808f04e7ca03299c"
TFRT_SHA256 = "64b32a5be2d11eb4e5f4de9006625853ec1951f01db7e4... | apache-2.0 | Python |
daa6bf7040524b0a8ce56ed20d6d94e439290ecc | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/db9b478d4cf4dcbc396797594e214df3089f33db. | tensorflow/tensorflow-experimental_link_static_libraries_once,frreiss/tensorflow-fred,gautam1858/tensorflow,gautam1858/tensorflow,sarvex/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-experimental_link_stati... | 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 = "db9b478d4cf4dcbc396797594e214df3089f33db"
TFRT_SHA256 = "f6ee6259773b4d1dd259df7240c2ceff4c05fdafa7e0d4... | """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 = "89f53cff21bbc3e3d7d528c8f497ece049b2a42a"
TFRT_SHA256 = "c50f8faffb7c7a719a0558c7a422d1461102596d8513f8... | apache-2.0 | Python |
e017cc1dc6e4d24f07cff1add4580bec54e8d23c | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/d1caeb8bdba1851194baf06c28ea09b5b67e5623. | karllessard/tensorflow,karllessard/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,paolodedios/tenso... | 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 = "d1caeb8bdba1851194baf06c28ea09b5b67e5623"
TFRT_SHA256 = "e480ad7451b9e3ce45da61d71079... | """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 = "026d864357ba1614a43d756bdf4ca04eb391faef"
TFRT_SHA256 = "d39dd0f06729d9ce94c3b7106472... | apache-2.0 | Python |
638d7f38a0e22f72680437372b873d69ead973b1 | Allow env vars for RUN_DISTUTILS | CauldronDevelopmentLLC/cbang,CauldronDevelopmentLLC/cbang,CauldronDevelopmentLLC/cbang,CauldronDevelopmentLLC/cbang | config/run_distutils/__init__.py | config/run_distutils/__init__.py | from SCons.Script import *
import os
def generate(env):
env.SetDefault(RUN_DISTUTILS = 'python')
env.SetDefault(RUN_DISTUTILSOPTS = 'build')
if 'RUN_DISTUTILS' in os.environ:
env['RUN_DISTUTILS'] = os.environ['RUN_DISTUTILS']
if 'RUN_DISTUTILSOPTS' in os.environ:
env['RUN_DISTUTILSOPT... | from SCons.Script import *
def generate(env):
env.SetDefault(RUN_DISTUTILS = 'python')
env.SetDefault(RUN_DISTUTILSOPTS = 'build')
env['RUN_DISTUTILS'] = 'python'
env['RUN_DISTUTILSOPTS'] = 'build'
bld = Builder(action = '$RUN_DISTUTILS $SOURCE $RUN_DISTUTILSOPTS')
env.Append(BUILDERS = {'Ru... | lgpl-2.1 | Python |
4da79cbec5880da6fb16b5a474786247a820d09c | Return error instead of if/else | kshvmdn/nowplaying | nowplaying.py | nowplaying.py | #!/usr/bin/env python
from termcolor import colored
from appscript import *
from track import Track
def main():
print(get_song())
def get_song():
itunes_open = bool(app('System Events').processes[its.name == 'iTunes'].count())
if itunes_open: # check if application open
itunes = app('iTunes')
... | #!/usr/bin/env python
from termcolor import colored
from appscript import *
from track import Track
def main():
print(get_song())
def get_song():
itunes_open = bool(app('System Events').processes[its.name == 'iTunes'].count())
if itunes_open: # check if application open
itunes = app('iTunes')
... | mit | Python |
e767d4f01f13882a7493248daeb7a2b24f524d0c | Update capwatch_conf.py | ifrguy/NHWG-MIMS,ifrguy/NHWG-MIMS,ifrguy/NHWG-MIMS,ifrguy/NHWG-MIMS | src/capwatch_conf.py | src/capwatch_conf.py |
# CAPWATCH downloader config variables
# ID for eServices account Login
UID = ''
# eServices password
PASSWD = ''
# Unit default
UNIT = 'NER-NH-001'
# Fully qualified path name for downloaded CAPWATCH zipfile
DL_FILEPATH = ''
# Timeout value for download - how long to wait for file exsits
TIMEOUT = 5
# How long ... |
# CAPWATCH downloader config variables
# ID for eServices account Login
UID = ''
# eServices password
PASSWD = ''
# Unit default
UNIT = 'NER-NH-001'
# Fully qualified path name for downloaded CAPWATCH zipfile
DL_FILEPATH = ''
# Timeout value for download - how long to wait for file exsits
TIMEOUT = 5
# How long ... | apache-2.0 | Python |
ebbb632344cf4efb8f01b0e2501aac04e47b6312 | remove init_path | Tosta-Mixta/CourierToDovecot,Tosta-Mixta/CourierToDovecot | CourierToDovecot.py | CourierToDovecot.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# -----------------------
# Author : jgo
# Execute a perl script into all mailbox newly created,
# on the Dovecot server.
# -----------------------
import subprocess
import os
import logging
from logging.handlers import RotatingFileHandler
## [Config VARS] -----------... | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# -----------------------
# Author : jgo
# Execute a perl script into all mailbox newly created,
# on the Dovecot server.
# -----------------------
import subprocess
import os
import logging
from logging.handlers import RotatingFileHandler
## [Config VARS] -----------... | apache-2.0 | Python |
13de473ac12a3ef16446b07820f32b38df45d9cb | Fix #26 | internetwache/GitTools,internetwache/GitTools | Finder/gitfinder.py | Finder/gitfinder.py | #!/usr/bin/env python3
'''
Finder is part of https://github.com/internetwache/GitTools
Developed and maintained by @gehaxelt from @internetwache
Use at your own risk. Usage might be illegal in certain circumstances.
Only for educational purposes!
'''
import argparse
from functools import partial
from multiprocessin... | #!/usr/bin/env python3
'''
Finder is part of https://github.com/internetwache/GitTools
Developed and maintained by @gehaxelt from @internetwache
Use at your own risk. Usage might be illegal in certain circumstances.
Only for educational purposes!
'''
import argparse
from functools import partial
from multiprocessin... | mit | Python |
6591447dff2a95d5ae1b9908a274691fd934e442 | Update ToDataFrameTransformer | MaxHalford/xam | xam/preprocessing/base.py | xam/preprocessing/base.py | import numpy as np
import pandas as pd
from sklearn.base import BaseEstimator
from sklearn.base import TransformerMixin
from sklearn.utils import as_float_array
from sklearn.utils import check_array
class ColumnSelector(BaseEstimator, TransformerMixin):
def __init__(self, columns=()):
self.columns = colu... | import numpy as np
import pandas as pd
from sklearn.base import BaseEstimator
from sklearn.base import TransformerMixin
from sklearn.utils import as_float_array
from sklearn.utils import check_array
class ColumnSelector(BaseEstimator, TransformerMixin):
def __init__(self, columns=()):
self.columns = colu... | mit | Python |
083f468ce628ee53a79df0bc4e9affbc7d9ba8d8 | Add exception case to session.firefox.load() | ma8ma/yanico | yanico/session/firefox.py | yanico/session/firefox.py | """Handle Firefox session."""
# Copyright 2015-2016 Masayuki Yamamoto
#
# 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 requi... | """Handle Firefox session."""
# Copyright 2015-2016 Masayuki Yamamoto
#
# 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 requi... | apache-2.0 | Python |
b570dc035110ca8b27af30fde78d2bb6e364417f | Use assertEqual instead of assertEquals | iconpin/anser | test/basic.py | test/basic.py | import unittest
from anser import Anser, Client
class BasicAnserTest(unittest.TestCase):
def test_creation(self):
server = Anser(__file__)
self.assertEqual(server.name, __file__)
def test_creation_explicit_no_debug(self):
server = Anser(__file__, debug=False)
self.assertFalse... | import unittest
from anser import Anser, Client
class BasicAnserTest(unittest.TestCase):
def test_creation(self):
server = Anser(__file__)
self.assertEquals(server.name, __file__)
def test_creation_explicit_no_debug(self):
server = Anser(__file__, debug=False)
self.assertFals... | mit | Python |
abd78ea8d3646be5d086c6e86b2a25c6d6aca5fb | Fix import order | django-blog-zinnia/zinnia-spam-checker-mollom | zinnia_mollom/__init__.py | zinnia_mollom/__init__.py | """Mollom spam checker backend for Zinnia"""
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.encoding import smart_str
try:
from Mollom import MollomAPI
from Mollom import MollomFault
except ImportError:
raise ImproperlyConfigured('pymollom module ... | """Mollom spam checker backend for Zinnia"""
from django.conf import settings
from django.utils.encoding import smart_str
from django.core.exceptions import ImproperlyConfigured
try:
from Mollom import MollomAPI
from Mollom import MollomFault
except ImportError:
raise ImproperlyConfigured('pymollom module ... | bsd-3-clause | Python |
c8cf23f58e30b362637d08bf405c0abc2a601559 | work on sky modelling | ZwickyTransientFacility/ztf_sim | ztf_sim/sky_brightness.py | ztf_sim/sky_brightness.py | import sklearn
from sklearn import cross_validation, ensemble, preprocessing, pipeline
from sklearn_pandas import DataFrameMapper, cross_val_score
from sklearn.externals import joblib
import pandas as pd
import numpy as np
def train_sky_model():
df = pd.read_csv('../data/ptf-iptf_diq.csv.gz')
# note that thi... | import sklearn
from sklearn import cross_validation, ensemble
import pandas as pd
def train_sky_model():
df = pd.read_csv('../data/ptf-iptf_diq.csv.gz')
# note that this is by pid, so there are multiple entries per image...
# delete uninformative columns:
for col in [u'Unnamed: 0', u'pid', u'mjd', u... | bsd-3-clause | Python |
30f7e8327c8ff9ce129b4dce42b79ba5969afe23 | Modify tests | cheral/orange3,cheral/orange3,cheral/orange3,cheral/orange3,cheral/orange3,cheral/orange3 | Orange/widgets/classify/tests/test_owadaboostclassification.py | Orange/widgets/classify/tests/test_owadaboostclassification.py | # Test methods with long descriptive names can omit docstrings
# pylint: disable=missing-docstring
from Orange.classification import TreeLearner, KNNLearner
from Orange.widgets.classify.owadaboost import OWAdaBoostClassification
from Orange.widgets.tests.base import (WidgetTest, WidgetLearnerTestMixin,
... | # Test methods with long descriptive names can omit docstrings
# pylint: disable=missing-docstring
from PyQt4 import QtGui
from Orange.widgets.tests.base import WidgetTest
from Orange.widgets.classify.owadaboost import OWAdaBoostClassification
class TestOWAdaBoostClassification(WidgetTest):
def setUp(self):
... | bsd-2-clause | Python |
efc7134bceeacc6c3a66b4800c791cf5b4b1d39d | Update Heapify.py | UmassJin/Leetcode | LintCode/Heapify.py | LintCode/Heapify.py | '''
Given an integer array, heapify it into a min-heap array.
For a heap array A, A[0] is the root of heap, and for each A[i], A[i * 2 + 1] is the left child of A[i] and A[i * 2 + 2] is the right child of A[i].
Have you met this question in a real interview? Yes
Example
Given [3,2,1,4,5], return [1,2,3,4,5] or any leg... | '''
Given an integer array, heapify it into a min-heap array.
For a heap array A, A[0] is the root of heap, and for each A[i], A[i * 2 + 1] is the left child of A[i] and A[i * 2 + 2] is the right child of A[i].
Have you met this question in a real interview? Yes
Example
Given [3,2,1,4,5], return [1,2,3,4,5] or any leg... | mit | Python |
0ad67996eb5f1913fdcfaa946430daf428be41c3 | Add test for back end | ggiuffre/DBNsim,ggiuffre/DBNsim,ggiuffre/DBNsim | DBNsite/testing_DBNlogic/sets_test.py | DBNsite/testing_DBNlogic/sets_test.py | import pytest
import os
import numpy as np
import sys
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.join(myPath, '..'))
from DBNlogic.sets import exists, full, DataSet, MNIST, SmallerMNIST
def test_existsTrue():
"""The function `exists` returns True if
given the path of an ex... | import pytest
import os
import numpy as np
import sys
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.join(myPath, '..'))
from DBNlogic.sets import exists, full, DataSet, MNIST, SmallerMNIST
def test_existsTrue():
"""The function `exists` returns True if
given the path of an ex... | mit | Python |
49527b1386cbb094ba9e9280dbfb22e7e07917eb | Check for the appid | AmeBel/opencog,shujingke/opencog,ruiting/opencog,yantrabuddhi/opencog,andre-senna/opencog,andre-senna/opencog,andre-senna/opencog,shujingke/opencog,shujingke/opencog,AmeBel/opencog,AmeBel/opencog,shujingke/opencog,inflector/opencog,shujingke/opencog,AmeBel/opencog,misgeatgit/opencog,misgeatgit/opencog,ruiting/opencog,s... | opencog/nlp/chatbot-psi/wolframalpha.py | opencog/nlp/chatbot-psi/wolframalpha.py | import urllib2
import xml.etree.ElementTree as ET
def call_wolframalpha(qq, aid):
if aid == '':
raise ValueError('AppID for Wolfram|Alpha Webservice API is missing!')
appid = aid
# Avoid HTTP Error 400: Bad Request
# query = qq.name.replace(' ', '+')
# XXX
query = qq.replace(' ', '+')... | import urllib2
import xml.etree.ElementTree as ET
def call_wolframalpha(qq):
# Enter your own key here!
appid = ''
# Avoid HTTP Error 400: Bad Request
# query = qq.name.replace(' ', '+')
# XXX
query = qq.replace(' ', '+')
url_1 = 'http://api.wolframalpha.com/v2/query?appid='
url_2 = '... | agpl-3.0 | Python |
962093ea0149128f35533dee84f30d6927e8a2ab | update test_hello | daveg999/automation_class | test_hello.py | test_hello.py | print "hello world!"
print "git is different from github!"
print "test SSH key access"
for i in range(10):
print i
| print "hello world!"
print "git is different from github!"
print "test SSH key access"
| apache-2.0 | Python |
14b2fcab73eb1eba86ab83347aaca47daea6bb8d | Fix test. | alexandrevicenzi/pycompat | tests/test.py | tests/test.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pycompat import python as py
from pycompat import system
import sys
import unittest
class TestPyCompat(unittest.TestCase):
def setUp(self):
pass
def test_python_is_64bits(self):
self.assertEqual(py.is_64bits, not py.is_32bits)
# Is fai... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pycompat import python as py
from pycompat import system
import sys
import unittest
class TestPyCompat(unittest.TestCase):
def setUp(self):
pass
def test_python_is_64bits(self):
self.assertEqual(python.is_64bits, not python.is_32bits)
... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.