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 |
|---|---|---|---|---|---|---|---|---|
e660953c1df2dc9de6b3038e4ddb1d77768b2b51 | Correct pyhande dependencies (broken for some time) | hande-qmc/hande,hande-qmc/hande,hande-qmc/hande,hande-qmc/hande,hande-qmc/hande | tools/pyhande/setup.py | tools/pyhande/setup.py | from distutils.core import setup
setup(
name='pyhande',
version='0.1',
author='HANDE developers',
packages=('pyhande',),
license='Modified BSD license',
description='Analysis framework for HANDE calculations',
long_description=open('README.rst').read(),
install_requires=['numpy', 'scipy... | from distutils.core import setup
setup(
name='pyhande',
version='0.1',
author='HANDE developers',
packages=('pyhande',),
license='Modified BSD license',
description='Analysis framework for HANDE calculations',
long_description=open('README.rst').read(),
requires=['numpy', 'pandas (>= 0.... | lgpl-2.1 | Python |
b277ca357728010c9d763c95cc459540821802c0 | Update dice loss | analysiscenter/dataset | dataset/models/tf/losses/__init__.py | dataset/models/tf/losses/__init__.py | """ Contains custom losses """
import tensorflow as tf
from ..layers import flatten
def dice(targets, predictions, weights=1.0, label_smoothing=0, scope=None,
loss_collection=tf.GraphKeys.LOSSES, reduction=tf.losses.Reduction.SUM_BY_NONZERO_WEIGHTS):
""" Dice coefficient
Parameters
----------
... | """ Contains custom losses """
import tensorflow as tf
from ..layers import flatten
def dice(targets, predictions):
""" Dice coefficient
Parameters
----------
targets : tf.Tensor
tensor with target values
predictions : tf.Tensor
tensor with predicted values
Returns
----... | apache-2.0 | Python |
4c9b47052c2c66671230f33ea84459e02b3b2f06 | Update Unit_Testing2.py | ZachMG/unit_testing | Unit_Testing2.py | Unit_Testing2.py | from unit_testing import *
import unittest
class UnitTests(unittest.TestCase):
def setUp(self):
print('setUp()...')
self.hash1 = Hash('1234')
self.email1 = Email('zmg@verizon.net')
def test(self):
print('testing hash...')
self.assertEqual(self.hash1, self.has... | from unit_testing import *
import unittest
class UnitTests(unittest.TestCase):
def setUp(self):
print('setUp()...')
self.hash1 = Hash('1234')
self.hash2 = Hash('1234')
self.hash3 = Hash('123')
self.email1 = Email('P@V')
def test(self):
print('testing... | mit | Python |
19def5d347a725b8200f1d29e1863e3d702bdc04 | hide some test fixtures from `spec` | tek/amino | unit/case_spec.py | unit/case_spec.py | from amino import ADT
from amino.case import CaseRec, Term
from amino.test.spec_spec import Spec
class _Num(ADT['_Num']):
pass
class _Int(_Num):
def __init__(self, i: int) -> None:
self.i = i
class _Float(_Num):
def __init__(self, f: float) -> None:
self.f = f
class _Prod(_Num):
... | from amino import ADT
from amino.case import CaseRec, Term
from amino.test.spec_spec import Spec
class Num(ADT['Num']):
pass
class Int(Num):
def __init__(self, i: int) -> None:
self.i = i
class Float(Num):
def __init__(self, f: float) -> None:
self.f = f
class Prod(Num):
def _... | mit | Python |
4089730950d6005e257c20e6926000073fd41b33 | Enable Tensor equality for 2.0 | tensorflow/tensorflow,cxxgtxy/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,karllessard/tensorflow,renyi533/tensorflow,jhseu/tensorflow,tensorflow/tensorflow-pywrap_saved_model,jhseu/tensorflow,tensorflow/tensorflow,paolodedios/tensorflow,yongtang/tensorflow,DavidNorman/te... | tensorflow/python/compat/v2_compat.py | tensorflow/python/compat/v2_compat.py | # Copyright 2018 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 2018 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... | apache-2.0 | Python |
e39c2e0c3dae39ee380a98a1aa662d14d1a1191e | Add new keyfile | Code4SA/mma-dexter,Code4SA/mma-dexter,Code4SA/mma-dexter | dexter/config/celeryconfig.py | dexter/config/celeryconfig.py | from celery.schedules import crontab
# uses AWS creds from the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY env variables
BROKER_URL = 'sqs://'
BROKER_TRANSPORT_OPTIONS = {
'region': 'eu-west-1',
'polling_interval': 15 * 1,
'queue_name_prefix': 'mma-dexter-',
'visibility_timeout': 3600*12,
}
# all ou... | from celery.schedules import crontab
# uses AWS creds from the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY env variables
BROKER_URL = 'sqs://'
BROKER_TRANSPORT_OPTIONS = {
'region': 'eu-west-1',
'polling_interval': 15 * 1,
'queue_name_prefix': 'mma-dexter-',
'visibility_timeout': 3600*12,
}
# all ou... | apache-2.0 | Python |
c4f7f2025a6089ec0ddcb190eaf4c020804b384b | make the call to core commands more explicit | eugenesvk/StatusBarExtendedF,kek91/StatusBarExtended | toggleselection/__init__.py | toggleselection/__init__.py | # Override commands that toggle item selection to automatically compute and instantly display
# combined filesize for selected files and the number of selected folders/files
from fman import DirectoryPaneCommand, DirectoryPaneListener, load_json, save_json, PLATFORM
from core.commands.util import is_hidden
from fman.u... | # Override commands that toggle item selection to automatically compute and instantly display
# combined filesize for selected files and the number of selected folders/files
from fman import DirectoryPaneListener, load_json
import json
from statusbarextended import StatusBarExtended
class CommandEmpty(): # to avoid d... | mit | Python |
9a4e2f88eba716ef607b8c476509cac5e58475f7 | Update mapper_lowercase.py | dragoon/kilogram,dragoon/kilogram,dragoon/kilogram | mapreduce/filter/mapper_lowercase.py | mapreduce/filter/mapper_lowercase.py | #!/usr/bin/env python
import sys
# Open just for read
dbpediadb = set(open('dbpedia_labels.txt').read().splitlines())
dbpediadb_lower = set(x.lower() for x in open('dbpedia_labels.txt').read().splitlines())
for line in sys.stdin:
# remove leading and trailing whitespace
line = line.strip()
# split the li... | #!/usr/bin/env python
import sys
# Open just for read
dbpediadb = set(open('dbpedia_labels.txt').read().splitlines())
dbpediadb_lower = set(x.lower() for x in open('dbpedia_labels.txt').read().splitlines())
for line in sys.stdin:
# remove leading and trailing whitespace
line = line.strip()
# split the li... | apache-2.0 | Python |
84ce27775b7e04955a15a0eb1e277db3e447b81f | fix SlidingCloth | Aiacos/DevPyLib | mayaLib/rigLib/utils/slidingCloth.py | mayaLib/rigLib/utils/slidingCloth.py | __author__ = 'Lorenzo Argentieri'
import pymel.core as pm
from mayaLib.rigLib.utils import skin
from mayaLib.rigLib.utils import deform
class SlidingCloth():
def __init__(self, mainSkinGeo, proxySkinGeo, mainClothGeo, proxyClothGeo, rigModelGrp=None):
"""
Setup Sliding Cloth deformation
:... | __author__ = 'Lorenzo Argentieri'
import pymel.core as pm
from mayaLib.rigLib.utils import skin
from mayaLib.rigLib.utils import deform
class SlidingCloth():
def __init__(self, mainSkinGeo, proxySkinGeo, mainClothGeo, proxyClothGeo):
"""
Setup Sliding Cloth deformation
:param mainSkinGeo:... | agpl-3.0 | Python |
f7060b65464b24bb16a8cf4704c68fa1348d655c | bump version | RaitoBezarius/crossbar,w1z2g3/crossbar,GoodgameStudios/crossbar,w1z2g3/crossbar,RaitoBezarius/crossbar,NinjaMSP/crossbar,RaitoBezarius/crossbar,erhuabushuo/crossbar,NinjaMSP/crossbar,GoodgameStudios/crossbar,GoodgameStudios/crossbar,RaitoBezarius/crossbar,erhuabushuo/crossbar,GoodgameStudios/crossbar,erhuabushuo/crossb... | crossbar/crossbar/__init__.py | crossbar/crossbar/__init__.py | ###############################################################################
##
## Copyright (C) 2011-2014 Tavendo GmbH
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU Affero General Public License, version 3,
## as published by the Free Software Founda... | ###############################################################################
##
## Copyright (C) 2011-2014 Tavendo GmbH
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU Affero General Public License, version 3,
## as published by the Free Software Founda... | agpl-3.0 | Python |
c0e09993facdd76e7b1dfbab97285464f83980bb | Update version | thismachinechills/cast_convert | cast_convert/__init__.py | cast_convert/__init__.py | #!/usr/bin/env python3
__version__ = '0.1.7.17'
from .cmd import cmd as command
from .watch import *
from . import *
from .convert import *
from .media_info import *
import click
@click.command(help="Print version")
def version():
print(__version__)
command.add_command(version)
| #!/usr/bin/env python3
__version__ = '0.1.7.11'
from .cmd import cmd as command
from .watch import *
from . import *
from .convert import *
from .media_info import *
import click
@click.command(help="Print version")
def version():
debug_print(__version__)
command.add_command(version)
| agpl-3.0 | Python |
b5cd4ff2b02151bca966c53b80dbea8911a7a6b2 | Upgrade celery.utils.encoding from kombu | ask/celery,cbrepo/celery,ask/celery,cbrepo/celery | celery/utils/encoding.py | celery/utils/encoding.py | """
celery.utils.encoding
====================
Utilities to encode text, and to safely emit text from running
applications without crashing with the infamous :exc:`UnicodeDecodeError`
exception.
"""
from __future__ import absolute_import
import sys
import traceback
__all__ = ["str_to_bytes", "bytes_to_str", "from_u... | """
celery.utils.encoding
=====================
Utilties to encode text, and to safely emit text from running
applications without crashing with the infamous :exc:`UnicodeDecodeError`
exception.
"""
from __future__ import absolute_import
import sys
import traceback
__all__ = ["str_to_bytes", "bytes_to_str", "from_... | bsd-3-clause | Python |
a0ff8cc15df5cd9668e11eba3b5e7406b33dcfc5 | fix RemovedInDjango19Warning on django.utils.importlib | roverdotcom/celery-haystack,iXioN/celery-haystack | celery_haystack/utils.py | celery_haystack/utils.py | from django.core.exceptions import ImproperlyConfigured
try:
from importlib import import_module
except ImportError:
from django.utils.importlib import import_module
from django.db import connection
from haystack.utils import get_identifier
from .conf import settings
def get_update_task(task_path=None):
... | from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
from django.db import connection
from haystack.utils import get_identifier
from .conf import settings
def get_update_task(task_path=None):
import_path = task_path or settings.CELERY_HAYSTACK_DEFAULT_TASK
... | bsd-3-clause | Python |
7d89c9c3229ebd7d8b56edf211e7020c3fad29a0 | add support for msgpack | SlimToolbox/SlimApi | utils/encoders.py | utils/encoders.py | # Copyright (C) 2015 SlimRoms Project
#
# 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... | # Copyright (C) 2015 SlimRoms Project
#
# 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... | apache-2.0 | Python |
745d3fae6b6055c731a47c13ef77e1faf1a4b7e5 | upgrade elasticsearch mining backends | chrisdamba/mining,mining/mining,jgabriellima/mining,AndrzejR/mining,seagoat/mining,chrisdamba/mining,mining/mining,seagoat/mining,jgabriellima/mining,avelino/mining,AndrzejR/mining,avelino/mining | mining/db/backends/melasticsearch.py | mining/db/backends/melasticsearch.py | # -*- coding: utf-8 -*-
import json
import requests
from elasticsearch import Elasticsearch as ES
from mining.utils.listc import listc_dict
class Elasticsearch(object):
def conn(self):
"""Open connection on Elasticsearch DataBase"""
conn = ES([
{"host": self.conf.get('host'),
... | # -*- coding: utf-8 -*-
import json
from elasticsearch import Elasticsearch as ES
class Elasticsearch(object):
def conn(self):
"""Open connection on Elasticsearch DataBase"""
conn = ES([
{"host": self.conf.get('host'),
"port": self.conf.get('port'),
"url_prefi... | mit | Python |
bc1e350dd19d91932bbfff73f863129ac94273c9 | bump version to 2.0.1 | alunduil/torment,kumoru/torment,doublerr/torment,swarren83/torment,devx/torment | torment/information.py | torment/information.py | # Copyright 2015 Alex Brandt
#
# 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 2015 Alex Brandt
#
# 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 |
90ad8e104c339b923d9291916647391572fbced1 | Bump version number | nabla-c0d3/nassl,nabla-c0d3/nassl,nabla-c0d3/nassl | nassl/__init__.py | nassl/__init__.py | # -*- coding: utf-8 -*-
__author__ = 'Alban Diquet'
__version__ = '0.16.0'
| # -*- coding: utf-8 -*-
__author__ = 'Alban Diquet'
__version__ = '0.15.1'
| agpl-3.0 | Python |
e51786c46ad4eb7310b1eaa0153253116f2c01bc | Update test bids | openprocurement/openprocurement.tender.esco,Scandie/openprocurement.tender.esco | openprocurement/tender/esco/tests/base.py | openprocurement/tender/esco/tests/base.py | # -*- coding: utf-8 -*-
import os
from copy import deepcopy
from openprocurement.tender.openeu.tests.base import (
BaseTenderWebTest,
test_features_tender_data as base_eu_test_features_data,
test_tender_data as base_eu_test_data,
test_lots as base_eu_lots,
test_bids as base_eu_bids,
)
test_tender... | # -*- coding: utf-8 -*-
import os
from copy import deepcopy
from openprocurement.tender.openeu.tests.base import (
BaseTenderWebTest,
test_features_tender_data as base_eu_test_features_data,
test_tender_data as base_eu_test_data,
test_lots as base_eu_lots,
test_bids as base_eu_bids,
)
test_tender... | apache-2.0 | Python |
7fabbbb6562f068690b7971c6ea1299172400d73 | fix `make run_importer_jobs` | StartupsPoleEmploi/labonneboite,StartupsPoleEmploi/labonneboite,StartupsPoleEmploi/labonneboite,StartupsPoleEmploi/labonneboite | labonneboite/importer/conf/development.py | labonneboite/importer/conf/development.py | # --- job 1/8 & 2/8 : check_etablissements & extract_etablissements
DISTINCT_DEPARTEMENTS_HAVING_OFFICES = 15
# --- job 5/8 : compute_scores
MINIMUM_OFFICES_REQUIRED_TO_TRAIN_MODEL = 0
RMSE_MAX = 20000
MAXIMUM_COMPUTE_SCORE_JOB_FAILURES = 94 # 96 departements == 2 successes + 94 failures
# --- job 6/8 : validate_sco... | # --- job 1/8 & 2/8 : check_etablissements & extract_etablissements
DISTINCT_DEPARTEMENTS_HAVING_OFFICES = 15
# --- job 5/8 : compute_scores
MINIMUM_OFFICES_REQUIRED_TO_TRAIN_MODEL = 0
RMSE_MAX = 5000
MAXIMUM_COMPUTE_SCORE_JOB_FAILURES = 94 # 96 departements == 2 successes + 94 failures
# --- job 6/8 : validate_scor... | agpl-3.0 | Python |
3cefa75b8e9012d828453a764c0b169ab169fae6 | fix google login names; associate with any user with same name | dougalsutherland/chips-with-friends,dougalsutherland/chips-with-friends,dougalsutherland/chips-with-friends | chip_friends/security.py | chip_friends/security.py | from __future__ import unicode_literals
import random
import string
from flask import render_template
from flask_security import Security, PeeweeUserDatastore
from flask_social import Social
from flask_social.datastore import PeeweeConnectionDatastore
from flask_social.utils import get_connection_values_from_oauth_res... | import random
import string
from flask import render_template
from flask_security import Security, PeeweeUserDatastore
from flask_social import Social
from flask_social.datastore import PeeweeConnectionDatastore
from flask_social.utils import get_connection_values_from_oauth_response
from flask_social.views import con... | mit | Python |
5836b48bbfa87ba706e6ddcb267dc375678695a8 | use str | syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin | test/functional/feature_asset_burn.py | test/functional/feature_asset_burn.py | #!/usr/bin/env python3
# Copyright (c) 2019-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import SyscoinTestFramework
from test_framework.util import assert_equ... | #!/usr/bin/env python3
# Copyright (c) 2019-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import SyscoinTestFramework
from test_framework.util import assert_equ... | mit | Python |
9d2766a7b6aae9e3ad3c94925bdde100a70f6150 | fix debug_view function | codercarl/psd-tools,vgatto/psd-tools,EvgenKo423/psd-tools,ssh-odoo/psd-tools,mitni455/psd-tools,kmike/psd-tools,vgatto/psd-tools,codercarl/psd-tools,codercarl/psd-tools,psd-tools/psd-tools,kmike/psd-tools,ssh-odoo/psd-tools,vovkasm/psd-tools,vovkasm/psd-tools,mitni455/psd-tools,EvgenKo423/psd-tools | src/psd_tools/debug.py | src/psd_tools/debug.py | # -*- coding: utf-8 -*-
"""
Assorted debug utilities
"""
from __future__ import absolute_import, print_function
import sys
from collections import namedtuple
try:
from IPython.lib.pretty import pprint
_PRETTY_ENABLED = True
except ImportError:
from pprint import pprint
_PRETTY_ENABLED = False
def debu... | # -*- coding: utf-8 -*-
"""
Assorted debug utilities
"""
from __future__ import absolute_import
import sys
from collections import namedtuple
try:
from IPython.lib.pretty import pprint
_PRETTY_ENABLED = True
except ImportError:
from pprint import pprint
_PRETTY_ENABLED = False
def debug_view(fp, txt="... | mit | Python |
5e991fd00d980884f9210cfd5f25d5e7d91aabfc | Fix race condition in #144 | ocelot-inc/tarantool,rtsisyk/tarantool,guard163/tarantool,ocelot-inc/tarantool,KlonD90/tarantool,Sannis/tarantool,ocelot-inc/tarantool,Sannis/tarantool,condor-the-bird/tarantool,vasilenkomike/tarantool,dkorolev/tarantool,dkorolev/tarantool,guard163/tarantool,Sannis/tarantool,Sannis/tarantool,vasilenkomike/tarantool,nvo... | test/replication/init_storage.test.py | test/replication/init_storage.test.py | import os
import glob
from lib.tarantool_server import TarantoolServer
# master server
master = server
master.admin('space = box.schema.create_space(\'test\', {id = 42})')
master.admin('space:create_index(\'primary\', \'hash\', {parts = { 0, \'num\' } })')
master.admin('for k = 1, 9 do space:insert(k, k*k) end')
f... | import os
import glob
from lib.tarantool_server import TarantoolServer
# master server
master = server
master.admin('space = box.schema.create_space(\'test\', {id = 42})')
master.admin('space:create_index(\'primary\', \'hash\', {parts = { 0, \'num\' } })')
master.admin('for k = 1, 9 do space:insert(k, k*k) end')
f... | bsd-2-clause | Python |
0ea32a2b51438b55130082e54f30fc9c97bd9d85 | Fix compatibility with oslo.db 12.1.0 | openstack/cloudkitty,openstack/cloudkitty | cloudkitty/db/__init__.py | cloudkitty/db/__init__.py | # -*- coding: utf-8 -*-
# Copyright 2014 Objectif Libre
#
# 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 ... | # -*- coding: utf-8 -*-
# Copyright 2014 Objectif Libre
#
# 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 |
cfe7de10ef9c6c1d8d5be71993e5f96ace58953d | Update Ansible release version to 2.6.0dev0. | thaim/ansible,thaim/ansible | lib/ansible/release.py | lib/ansible/release.py | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | mit | Python |
359f337d7cfd0dac2eec8ecce643af10588e3e6a | Fix i18n __radd__ bug | limodou/uliweb,wwfifi/uliweb,wwfifi/uliweb,wwfifi/uliweb,wwfifi/uliweb,limodou/uliweb,limodou/uliweb,limodou/uliweb | uliweb/i18n/lazystr.py | uliweb/i18n/lazystr.py | def lazy(func):
def f(message):
return LazyString(func, message)
return f
class LazyString(object):
"""
>>> from uliweb.i18n import gettext_lazy as _
>>> x = _('Hello')
>>> print repr(x)
"""
def __init__(self, func, message):
self._func = func
se... | def lazy(func):
def f(message):
return LazyString(func, message)
return f
class LazyString(object):
"""
>>> from uliweb.i18n import gettext_lazy as _
>>> x = _('Hello')
>>> print repr(x)
"""
def __init__(self, func, message):
self._func = func
se... | bsd-2-clause | Python |
ac985005f925c0d37ae337ada0bf88b50becaee6 | change scheduler | paulgessinger/coalics,paulgessinger/coalics,paulgessinger/coalics | coalics/schedule.py | coalics/schedule.py | import os.path
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import logging
from coalics import tasks, q, redis, app
from datetime import datetime
from datetime import datetime, timedelta
import time
# stream_handler = logging.StreamHandler()
# stream_handler.setLevel(logging.INFO)
# app... | import os.path
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import logging
from coalics import tasks, q, redis, app
from datetime import datetime
from datetime import datetime, timedelta
import time
# stream_handler = logging.StreamHandler()
# stream_handler.setLevel(logging.INFO)
# app... | mit | Python |
9b354f4dc00e3aef4cfceae71be60b1dc60a1927 | Add test for ticket #1559. | jorisvandenbossche/numpy,skymanaditya1/numpy,tacaswell/numpy,kirillzhuravlev/numpy,dch312/numpy,CMartelLML/numpy,argriffing/numpy,rhythmsosad/numpy,mindw/numpy,jschueller/numpy,jankoslavic/numpy,dwillmer/numpy,trankmichael/numpy,stuarteberg/numpy,naritta/numpy,felipebetancur/numpy,dch312/numpy,empeeu/numpy,kirillzhurav... | numpy/ma/tests/test_regression.py | numpy/ma/tests/test_regression.py | from numpy.testing import *
import numpy as np
rlevel = 1
class TestRegression(TestCase):
def test_masked_array_create(self,level=rlevel):
"""Ticket #17"""
x = np.ma.masked_array([0,1,2,3,0,4,5,6],mask=[0,0,0,1,1,1,0,0])
assert_array_equal(np.ma.nonzero(x),[[1,2,6,7]])
def test_masked... | from numpy.testing import *
import numpy as np
rlevel = 1
class TestRegression(TestCase):
def test_masked_array_create(self,level=rlevel):
"""Ticket #17"""
x = np.ma.masked_array([0,1,2,3,0,4,5,6],mask=[0,0,0,1,1,1,0,0])
assert_array_equal(np.ma.nonzero(x),[[1,2,6,7]])
def test_masked... | bsd-3-clause | Python |
813c478f06c175e36dc8334fd37195e403a42166 | update test_symbol_accuracy | vincentfpgarcia/tradingtool | test_symbol_accuracy.py | test_symbol_accuracy.py | from dataset import create_testing_data_for_symbol, get_symbol_list
from keras.models import load_model
import sys
INITIAL_CAPITAL = 10000.0
PERCENT_OF_CAPITAL_PER_TRANSACTION = 10.0
TRANSACTION_FEE = 0
def compare(x, y):
if x[3] < y[3]:
return 1
return -1
def main():
model = load_model(sys.argv[1])
symbols = ... | from dataset import create_testing_data_for_symbol, get_symbol_list
from keras.models import load_model
import sys
INITIAL_CAPITAL = 10000.0
PERCENT_OF_CAPITAL_PER_TRANSACTION = 10.0
TRANSACTION_FEE = 0
def compare(x, y):
if x[1] < y[1]:
return 1
return -1
def main():
model = load_model(sys.argv[1])
symbols = ... | mit | Python |
f61a4766ad3006bb2001df33d06feeb15352aa5a | Change Box user list request from raw API call to Box SDK make_request method | jcleblanc/box-examples,jcleblanc/box-examples,jcleblanc/box-examples,jcleblanc/box-examples,jcleblanc/box-examples,jcleblanc/box-examples,jcleblanc/box-examples | okta-integration/python/server.py | okta-integration/python/server.py | from flask import Flask, redirect, g, url_for
from flask_oidc import OpenIDConnect
from okta import UsersClient
from boxsdk import Client
from boxsdk import JWTAuth
import requests
import config
import json
app = Flask(__name__)
app.config.update({
'SECRET_KEY': config.okta_client_secret,
'OIDC_CLIENT_SECRETS': '.... | from flask import Flask, redirect, g, url_for
from flask_oidc import OpenIDConnect
from okta import UsersClient
from boxsdk import Client
from boxsdk import JWTAuth
import requests
import config
import json
app = Flask(__name__)
app.config.update({
'SECRET_KEY': config.okta_client_secret,
'OIDC_CLIENT_SECRETS': '.... | mit | Python |
72941398fd2e78cbf5d994b4bf8683c4bdefaab9 | Comment out semipar notebook in travis runner until pip build us updated. | grmToolbox/grmpy | utils/travis_runner.py | utils/travis_runner.py | #!/usr/bin/env python
"""This script manages all tasks for the TRAVIS build server."""
import os
import subprocess
if __name__ == "__main__":
os.chdir("promotion/grmpy_tutorial_notebook")
cmd = [
"jupyter",
"nbconvert",
"--execute",
"grmpy_tutorial_notebook.ipynb",
"--Ex... | #!/usr/bin/env python
"""This script manages all tasks for the TRAVIS build server."""
import os
import subprocess
if __name__ == "__main__":
os.chdir("promotion/grmpy_tutorial_notebook")
cmd = [
"jupyter",
"nbconvert",
"--execute",
"grmpy_tutorial_notebook.ipynb",
"--Ex... | mit | Python |
17dfc3faa45584200c8f67686b86b541a2ce01fe | Test for informal word | wiki-ai/revscoring,eranroz/revscoring,he7d3r/revscoring,aetilley/revscoring,ToAruShiroiNeko/revscoring | revscoring/languages/tests/test_hebrew.py | revscoring/languages/tests/test_hebrew.py | from nose.tools import eq_
from .. import language, hebrew
def test_language():
is_misspelled = hebrew.solve(language.is_misspelled)
assert is_misspelled("חטול")
assert not is_misspelled("חתול")
is_badword = hebrew.solve(language.is_badword)
assert is_badword("שרמוטה")
assert not is_badwo... | from nose.tools import eq_
from .. import language, hebrew
def test_language():
is_misspelled = hebrew.solve(language.is_misspelled)
assert is_misspelled("חטול")
assert not is_misspelled("חתול")
is_badword = hebrew.solve(language.is_badword)
assert is_badword("שרמוטה")
assert not is_badwo... | mit | Python |
eb71d45097e509273518b83113489911bf985e4a | clean up | cellcraft/cellcraft | mcpipy/test/builders/test_protein.py | mcpipy/test/builders/test_protein.py | import pandas as pd
from cellcraft.builders.protein import define_items_color_texture_protein, store_location_biological_prot_data
def test_define_items_color_texture_protein():
dict_chains = {"a": 1, "b": 2}
d_appearance = define_items_color_texture_protein(dict_chains)
assert len(d_appearance) == 2
... | import pandas as pd
from cellcraft.builders.protein import define_items_color_texture_protein, store_location_biological_prot_data
def test_define_items_color_texture_protein():
dict_chains = {"a": 1, "b": 2}
d_appearance = define_items_color_texture_protein(dict_chains)
assert len(d_appearance) == 2
... | mit | Python |
be929d518ff320ed8e16f57da55f0855800f7408 | Use mutli_reduce instead of reduce in enum file loading | Tactique/game_engine,Tactique/game_engine | src/engine/file_loader.py | src/engine/file_loader.py | import os
import json
from lib import contract, functional
data_dir = os.path.join(os.environ['PORTER'], 'data')
@contract.accepts(str)
@contract.returns(list)
def read_and_parse_json(data_type):
sub_dir = os.path.join(data_dir, data_type)
def full_path(file_name):
return os.path.join(sub_dir, file... | import os
import json
from lib import contract
data_dir = os.path.join(os.environ['PORTER'], 'data')
@contract.accepts(str)
@contract.returns(list)
def read_and_parse_json(data_type):
sub_dir = os.path.join(data_dir, data_type)
def full_path(file_name):
return os.path.join(sub_dir, file_name)
... | mit | Python |
1aa44c23e138fadd0b8fc604e5b9dac384901ce3 | sort dashboards dropdown | vimeo/graph-explorer,vimeo/graph-explorer,vimeo/graph-explorer,dbirchak/graph-explorer,dbirchak/graph-explorer,dbirchak/graph-explorer,vimeo/graph-explorer,dbirchak/graph-explorer | dashboards.py | dashboards.py | def list_dashboards():
import os
wd = os.getcwd()
os.chdir('templates/dashboards')
dashboards = []
for f in os.listdir("."):
if not f.endswith(".tpl"):
continue
dashboards.append(f[:-4])
os.chdir(wd)
return sorted(dashboards)
| def list_dashboards():
import os
wd = os.getcwd()
os.chdir('templates/dashboards')
dashboards = []
for f in os.listdir("."):
if not f.endswith(".tpl"):
continue
dashboards.append(f[:-4])
os.chdir(wd)
return dashboards
| apache-2.0 | Python |
1df66cc442e93d85fd8a8bbab2815574387a8952 | Remove print | villalonreina/dipy,beni55/dipy,FrancoisRheaultUS/dipy,sinkpoint/dipy,JohnGriffiths/dipy,mdesco/dipy,Messaoud-Boudjada/dipy,oesteban/dipy,FrancoisRheaultUS/dipy,matthieudumont/dipy,samuelstjean/dipy,rfdougherty/dipy,oesteban/dipy,demianw/dipy,nilgoyyou/dipy,Messaoud-Boudjada/dipy,StongeEtienne/dipy,samuelstjean/dipy,ben... | doc/examples/brain_extraction_dwi.py | doc/examples/brain_extraction_dwi.py | """
=================================================
Brain segmentation with dipy.segment.mask.
=================================================
We show how to extract brain information and mask from a b0 image using dipy's
segment.mask module.
First import the necessary modules:
"""
import os.path
import numpy as... | """
=================================================
Brain segmentation with dipy.segment.mask.
=================================================
We show how to extract brain information and mask from a b0 image using dipy's
segment.mask module.
First import the necessary modules:
"""
import os.path
import numpy as... | bsd-3-clause | Python |
51b716cc00efd0d0c93ffc11f4cd7242446bad88 | Remove unused pyrax import | nvbn/coviolations_web,nvbn/coviolations_web | nodes/management/commands/create_images.py | nodes/management/commands/create_images.py | from gevent import monkey
monkey.patch_all()
import gevent
import os
from django.core.management import BaseCommand
from django.conf import settings
from ...utils import connect_to_node, logger
class Command(BaseCommand):
help = 'create nodes images'
def handle(self, *args, **kwargs):
self._root = o... | from gevent import monkey
monkey.patch_all()
import gevent
import os
from django.core.management import BaseCommand
from django.conf import settings
from ...utils import connect_to_node, logger, pyrax
class Command(BaseCommand):
help = 'create nodes images'
def handle(self, *args, **kwargs):
self._r... | mit | Python |
9ca88c5cd7f52c6f064a1d5edb003471f6223a74 | Change lable on click | rituven/winston | Winston.py | Winston.py | import sys
from PyQt4.QtGui import *
#from PyQt4.QtWidgets import *
from PyQt4.QtCore import *
from core.Messenger import *
from core.Events import *
from alexa import AlexaService
class QTApp(QWidget):
def __init__(self):
super(QWidget, self).__init__()
self.title = 'Winston'
self.setWind... | import sys
from PyQt4.QtGui import *
#from PyQt4.QtWidgets import *
from PyQt4.QtCore import *
from core.Messenger import *
from core.Events import *
from alexa import AlexaService
class QTApp(QWidget):
def __init__(self):
super(QWidget, self).__init__()
self.title = 'Winston'
self.setWin... | apache-2.0 | Python |
2f31a1f0745214c2b06dadc1258926f7440d429f | Set datetime output format to ISO8601 | olinlibrary/ABE,olinlibrary/ABE,olinlibrary/ABE | abe/app.py | abe/app.py | #!/usr/bin/env python3
"""Main flask app"""
from flask import Flask, render_template, jsonify
from flask_restful import Api
from flask_cors import CORS
from flask_sslify import SSLify # redirect to https
from flask.json import JSONEncoder
from datetime import datetime
import os
import logging
FORMAT = "%(levelname)... | #!/usr/bin/env python3
"""Main flask app"""
from flask import Flask, render_template, jsonify
from flask_restful import Api
from flask_cors import CORS
from flask_sslify import SSLify # redirect to https
import os
import logging
FORMAT = "%(levelname)s:ABE: _||_ %(message)s"
logging.basicConfig(level=logging.DEBUG, ... | agpl-3.0 | Python |
ba1494afb962fb8fba84e306cfb4c26a83602b6d | update license | chuckhousley/DrinkMachine,chuckhousley/DrinkMachine,chuckhousley/DrinkMachine | drink.py | drink.py | # -*- coding: utf-8 -*-
import os
from server import app, db
import server.model
if __name__ == "__main__":
db.create_all()
app.run(debug=True) # host='10.10.56.190')
| # -*- coding: utf-8 -*-
"""
Copyright (C) 2014 Chuck Housley
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See the COPYING file for more details.
"""
import os
from server import app, db
import ser... | mit | Python |
1b726978e1604269c8c4d2728a6f7ce774e5d16d | Fix edit control assessment modal | kr41/ggrc-core,kr41/ggrc-core,vladan-m/ggrc-core,vladan-m/ggrc-core,vladan-m/ggrc-core,AleksNeStu/ggrc-core,josthkko/ggrc-core,VinnieJohns/ggrc-core,prasannav7/ggrc-core,andrei-karalionak/ggrc-core,andrei-karalionak/ggrc-core,jmakov/ggrc-core,AleksNeStu/ggrc-core,uskudnik/ggrc-core,uskudnik/ggrc-core,selahssea/ggrc-cor... | src/ggrc/models/control_assessment.py | src/ggrc/models/control_assessment.py | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
from ggrc import db
from .mixins import (
deferred, BusinessObject, Timeboxe... | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
from ggrc import db
from .mixins import (
deferred, BusinessObject, Timeboxe... | apache-2.0 | Python |
e7d9a67611b2dc443c1f2bc23506323837d79bda | fix test_mcp | radarsat1/siconos,fperignon/siconos,siconos/siconos-deb,radarsat1/siconos,fperignon/siconos,bremond/siconos,bremond/siconos,siconos/siconos-deb,siconos/siconos-deb,radarsat1/siconos,siconos/siconos,radarsat1/siconos,siconos/siconos-deb,fperignon/siconos,fperignon/siconos,siconos/siconos,bremond/siconos,radarsat1/sicono... | numerics/swig/tests/test_mcp.py | numerics/swig/tests/test_mcp.py | # Copyright (C) 2005, 2012 by INRIA
#!/usr/bin/env python
import numpy as np
import siconos.numerics as N
def mcp_function(z):
M = np.array([[2., 1.],
[1., 2.]])
q = np.array([-5., -6.])
return np.dot(M,z) + q
def mcp_Nablafunction(z):
M = np.array([[2., 1.],
[1.,... | # Copyright (C) 2005, 2012 by INRIA
#!/usr/bin/env python
import numpy as np
import siconos.numerics as N
def mcp_function (z) :
M = np.array([[2., 1.],
[1., 2.]])
q = np.array([-5., -6.])
return dot(M,z) + q
def mcp_Nablafunction (z) :
M = np.array([[2., 1.],
[1., 2.]]... | apache-2.0 | Python |
2fbdd9903fc9bf6e1fe797e92c0157abd67850ce | add robust tests for exec_command() | dimasad/numpy,rmcgibbo/numpy,endolith/numpy,ekalosak/numpy,pdebuyl/numpy,felipebetancur/numpy,njase/numpy,kiwifb/numpy,dch312/numpy,sigma-random/numpy,NextThought/pypy-numpy,Anwesh43/numpy,Srisai85/numpy,Eric89GXL/numpy,numpy/numpy,BMJHayward/numpy,mhvk/numpy,bringingheavendown/numpy,KaelChen/numpy,tacaswell/numpy,pbro... | numpy/distutils/tests/test_exec_command.py | numpy/distutils/tests/test_exec_command.py | import os
import sys
import StringIO
from numpy.distutils import exec_command
class redirect_stdout(object):
"""Context manager to redirect stdout for exec_command test."""
def __init__(self, stdout=None):
self._stdout = stdout or sys.stdout
def __enter__(self):
self.old_stdout = sys.std... | import sys
import StringIO
from numpy.distutils import exec_command
class redirect_stdout(object):
"""Context manager to redirect stdout for exec_command test."""
def __init__(self, stdout=None):
self._stdout = stdout or sys.stdout
def __enter__(self):
self.old_stdout = sys.stdout
... | bsd-3-clause | Python |
7138cd2fb7a5dc8a5044f15b19d3d53a1486dec3 | order by companies by name, helps when viewing adding companies to jobs entry form | berkerpeksag/pythondotorg,SujaySKumar/pythondotorg,lebronhkh/pythondotorg,fe11x/pythondotorg,berkerpeksag/pythondotorg,malemburg/pythondotorg,ahua/pythondotorg,Mariatta/pythondotorg,ahua/pythondotorg,Mariatta/pythondotorg,demvher/pythondotorg,malemburg/pythondotorg,fe11x/pythondotorg,fe11x/pythondotorg,proevo/pythondot... | companies/models.py | companies/models.py | from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from markupfield.fields import MarkupField
from cms.models import NameSlugModel
DEFAULT_MARKUP_TYPE = getattr(settings, 'DEFAULT_MARKUP_TYPE', 'restructuredtext')
class Company(NameSlugModel):
... | from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from markupfield.fields import MarkupField
from cms.models import NameSlugModel
DEFAULT_MARKUP_TYPE = getattr(settings, 'DEFAULT_MARKUP_TYPE', 'restructuredtext')
class Company(NameSlugModel):
... | apache-2.0 | Python |
10e7388eec8d16f5a69e5d4f3b9e6cf56a1c956e | Remove explicit byte string from migration 0003 (#298) | jazzband/silk,mtford90/silk,django-silk/silk,mtford90/silk,jazzband/silk,django-silk/silk,mtford90/silk,django-silk/silk,django-silk/silk,jazzband/silk,jazzband/silk,mtford90/silk | silk/migrations/0003_request_prof_file.py | silk/migrations/0003_request_prof_file.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-08 18:23
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('silk', '0002_auto_update_uuid4_id_field'),
]
operations = [
migrations.AddFi... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-08 18:23
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('silk', '0002_auto_update_uuid4_id_field'),
]
operations = [
migrations.AddFi... | mit | Python |
30452b9fe815a2b68826b739625d1c06886fb17e | Remove redundant isinstance() check | vmalloc/pact | pact/group.py | pact/group.py | import itertools
from .base import PactBase
class PactGroup(PactBase):
def __init__(self, pacts=None, lazy=True):
if pacts is None:
pacts = []
self._pacts = list(pacts)
self._finished_pacts = []
self._is_lazy = lazy
super(PactGroup, self).__init__()
def _... | import itertools
from .base import PactBase
class PactGroup(PactBase):
def __init__(self, pacts=None, lazy=True):
if pacts is None:
pacts = []
self._pacts = list(pacts)
self._finished_pacts = []
self._is_lazy = lazy
super(PactGroup, self).__init__()
def _... | bsd-3-clause | Python |
7dc9085bf0665efc3083b64c0b34cb7c8c92ae31 | update now drops duplicates | DepthDeluxe/dot11sniffer,DepthDeluxe/dot11sniffer,DepthDeluxe/dot11sniffer,DepthDeluxe/dot11sniffer,DepthDeluxe/dot11sniffer | dblib/dbUpdate.py | dblib/dbUpdate.py | import pymongo
import multiprocessing
import multiprocessing.connection
import time
SIZE = 128
NUM_NODES = 3
def recv_data(sock,dataQueue,cQueue):
connect = sock.accept()
cQueue.put("listen")
data = connect.recv()
dataQueue.put(data)
connect.close()
print("received data")
exit(0)
def db_s... | import pymongo
import multiprocessing
import multiprocessing.connection
import time
SIZE = 128
NUM_NODES = 3
def recv_data(sock,dataQueue,cQueue):
connect = sock.accept()
cQueue.put("listen")
data = connect.recv()
dataQueue.put(data)
connect.close()
print("received data")
exit(0)
def db_s... | mit | Python |
e76d6ad7a4670bfa47ba506343aff2e5f118f976 | fix rsync options for use in shared scenarios | uwescience/myria,jamesmarva/myria,jamesmarva/myria,uwescience/myria,bsalimi/myria,bsalimi/myria,uwescience/myria,bsalimi/myria,jamesmarva/myria | myriadeploy/update_myria_jar_only.py | myriadeploy/update_myria_jar_only.py | #!/usr/bin/env python
import myriadeploy
import subprocess
import sys
def host_port_list(workers):
return [str(worker[0]) + ':' + str(worker[1]) for worker in workers]
def get_host_port_path(node, default_path):
if len(node) == 2:
(hostname, port) = node
if default_path is None:
... | #!/usr/bin/env python
import myriadeploy
import subprocess
import sys
def host_port_list(workers):
return [str(worker[0]) + ':' + str(worker[1]) for worker in workers]
def get_host_port_path(node, default_path):
if len(node) == 2:
(hostname, port) = node
if default_path is None:
... | bsd-3-clause | Python |
afbef65bd28f0058edf39579125e2ccb35a72aee | Update test_multivariate.py to Python 3.4 | Chippers255/nb_twitter | nb_twitter/test/test_multivariate.py | nb_twitter/test/test_multivariate.py | # -*- coding: utf-8 -*-
# test_multivariate.py
# nb_twitter/nb_twitter/bayes
#
# Created by Thomas Nelson <tn90ca@gmail.com>
# Preston Engstrom <pe12nh@brocku.ca>
# Created..........................2015-06-29
# Modified.........................2015-06-30
#
# This script was developed for use as part of the ... | # -*- coding: utf-8 -*-
# test_multivariate.py
# nb_twitter/nb_twitter/bayes
#
# Created by Thomas Nelson <tn90ca@gmail.com>
# Preston Engstrom <pe12nh@brocku.ca>
# Created..........................2015-06-29
# Modified.........................2015-06-29
#
# This script was developed for use as part of the ... | mit | Python |
1b668fa59624bc1f73f5fceebecbbadfc0038156 | support arrow DictionaryType | maartenbreddels/vaex,maartenbreddels/vaex,maartenbreddels/vaex,maartenbreddels/vaex,maartenbreddels/vaex,maartenbreddels/vaex | packages/vaex-arrow/vaex_arrow/dataset.py | packages/vaex-arrow/vaex_arrow/dataset.py | __author__ = 'maartenbreddels'
import logging
import pyarrow as pa
import pyarrow.parquet as pq
import vaex.dataset
import vaex.file.other
from .convert import column_from_arrow_array
logger = logging.getLogger("vaex_arrow")
class DatasetArrow(vaex.dataset.DatasetLocal):
"""Implements storage using arrow"""
... | __author__ = 'maartenbreddels'
import logging
import pyarrow as pa
import pyarrow.parquet as pq
import vaex.dataset
import vaex.file.other
from .convert import column_from_arrow_array
logger = logging.getLogger("vaex_arrow")
class DatasetArrow(vaex.dataset.DatasetLocal):
"""Implements storage using arrow"""
... | mit | Python |
52239a9b6cd017127d52c29ac0e2a0d3818e7d9e | Add new lab_members fieldset_website to fieldsets for cms_lab_members | mfcovington/djangocms-lab-members,mfcovington/djangocms-lab-members | cms_lab_members/admin.py | cms_lab_members/admin.py | from django.contrib import admin
from cms.admin.placeholderadmin import PlaceholderAdminMixin
from lab_members.models import Scientist
from lab_members.admin import ScientistAdmin
class CMSScientistAdmin(PlaceholderAdminMixin, ScientistAdmin):
fieldsets = [
ScientistAdmin.fieldset_basic,
Scientist... | from django.contrib import admin
from cms.admin.placeholderadmin import PlaceholderAdminMixin
from lab_members.models import Scientist
from lab_members.admin import ScientistAdmin
class CMSScientistAdmin(PlaceholderAdminMixin, ScientistAdmin):
fieldsets = [
ScientistAdmin.fieldset_basic,
Scientist... | bsd-3-clause | Python |
dda3ebfcb9fff7f7304ee72c087dca9f8556fe6c | Update yadisk.py | haitaka/DroiTaka | cogs/utils/api/yadisk.py | cogs/utils/api/yadisk.py | import json
import requests
DEVICE_ID = '141f72b7-fd02-11e5-981a-00155d860f42'
DEVICE_NAME = 'DroiTaka'
CLIENT_ID = 'b12710fc26ee46ba82e34b97f08f2305'
CLIENT_SECRET = '4ff2284115644e04acc77c54526364d2'
class YaDisk(object):
def __init__(self, token):
self.session = requests.session()
self.session.headers.update... | import json
import requests
DEVICE_ID = '141f72b7-fd02-11e5-981a-00155d860f42'
DEVICE_NAME = 'DroiTaka'
CLIENT_ID = 'b12710fc26ee46ba82e34b97f08f2305'
CLIENT_SECRET = '4ff2284115644e04acc77c54526364d2'
class YaDisk(object):
def __init__(self, token):
self.session = requests.session()
self.session.headers.update... | mit | Python |
14043a783e2ebd6c4a27a38f08ca75e6e31dd5d8 | Add show admin panel | Cinemair/cinemair-server,Cinemair/cinemair-server | cinemair/shows/admin.py | cinemair/shows/admin.py | from django.contrib import admin
from . import models
class ShowsInline(admin.TabularInline):
model = models.Show
extra = 0
@admin.register(models.Show)
class Show(admin.ModelAdmin):
fieldsets = (
(None, {"fields": ("cinema", "movie", "datetime")}),
)
list_display = ("id", "cinema", "mo... | from django.contrib import admin
from . import models
class ShowsInline(admin.TabularInline):
model = models.Show
extra = 0
| mit | Python |
9e1b3893a676f0fff7d601245fd06ec5df7fb61f | bump version | kszlim/osu-replay-parser | circleparse/__init__.py | circleparse/__init__.py | from circleparse.replay import parse_replay_file, parse_replay
__version__ = "6.1.0"
| from circleparse.replay import parse_replay_file, parse_replay
__version__ = "6.0.0"
| mit | Python |
3026d78dc6e2a0f6f391819370f2369df94e77eb | Move Data Portal / Other to bottom of contact select | NaturalHistoryMuseum/ckanext-nhm,NaturalHistoryMuseum/ckanext-nhm,NaturalHistoryMuseum/ckanext-nhm | ckanext/nhm/settings.py | ckanext/nhm/settings.py | #!/usr/bin/env python
# encoding: utf-8
#
# This file is part of ckanext-nhm
# Created by the Natural History Museum in London, UK
from collections import OrderedDict
# the order here matters as the default option should always be first in the dict so that it is
# automatically selected in combo boxes that use this li... | #!/usr/bin/env python
# encoding: utf-8
#
# This file is part of ckanext-nhm
# Created by the Natural History Museum in London, UK
from collections import OrderedDict
# the order here matters as the default option should always be first in the dict so that it is
# automatically selected in combo boxes that use this li... | mit | Python |
2105143c63292ec225258b3ca129156d858cf972 | Use OrderParameterDistribution objects in wetting. | adamrall/coex | coex/wetting.py | coex/wetting.py | """Find the wetting properties of a direct or expanded ensemble
grand canonical simulation.
"""
import numpy as np
def get_cos_theta(s, d):
"""Calculate the cosine of the contact angle.
Args:
s: A float (or numpy array): the spreading coefficient.
d: A float (or numpy array): the drying coef... | """Find the wetting properties of a direct or expanded ensemble
grand canonical simulation.
"""
import numpy as np
def get_cos_theta(s, d):
"""Calculate the cosine of the contact angle.
Args:
s: A float (or numpy array): the spreading coefficient.
d: A float (or numpy array): the drying coef... | bsd-2-clause | Python |
a962e631b0fc997a6a5569244463c3f96da8b671 | add extra fwhm2sigma test | nipy/nipy-labs,arokem/nipy,nipy/nipy-labs,arokem/nipy,alexis-roche/nireg,nipy/nireg,arokem/nipy,arokem/nipy,alexis-roche/nipy,bthirion/nipy,alexis-roche/nipy,alexis-roche/nipy,alexis-roche/niseg,alexis-roche/register,bthirion/nipy,alexis-roche/nipy,nipy/nireg,alexis-roche/nireg,bthirion/nipy,bthirion/nipy,alexis-roche/... | lib/neuroimaging/fmri/tests/test_utils.py | lib/neuroimaging/fmri/tests/test_utils.py | import unittest
import numpy as N
import scipy
from neuroimaging.fmri.utils import CutPoly, WaveFunction, sigma2fwhm, fwhm2sigma
class utilTest(unittest.TestCase):
def test_CutPoly(self):
f = CutPoly(2.0)
t = N.arange(0, 10.0, 0.1)
y = f(t)
scipy.testing.assert_almost_equal(y,... | import unittest
import numpy as N
import scipy
from neuroimaging.fmri.utils import CutPoly, WaveFunction, sigma2fwhm, fwhm2sigma
class utilTest(unittest.TestCase):
def test_CutPoly(self):
f = CutPoly(2.0)
t = N.arange(0, 10.0, 0.1)
y = f(t)
scipy.testing.assert_almost_equal(y,... | bsd-3-clause | Python |
108763ace5f250922387aacffab4a668155cfe67 | deploy script changes | rootio/rootio_web,rootio/rootio_web,rootio/rootio_web,rootio/rootio_web | deploy/fabfile.py | deploy/fabfile.py | # -*- coding: utf-8 -*-
# http://docs.fabfile.org/en/1.5/tutorial.html
from __future__ import with_statement
from fabric.api import *
from contextlib import contextmanager as _contextmanager
@_contextmanager
def virtualenv():
with prefix(env.virtualenv_activate):
yield
env.hosts = ['176.58.125.166']
env.... | # -*- coding: utf-8 -*-
# http://docs.fabfile.org/en/1.5/tutorial.html
from __future__ import with_statement
from fabric.api import *
from contextlib import contextmanager as _contextmanager
@_contextmanager
def virtualenv():
with prefix(env.virtualenv_activate):
yield
env.hosts = ['176.58.125.166']
env.... | agpl-3.0 | Python |
34fa7433ea6f04089a420e0392605147669801d1 | Revert "added more crappy codes" | kp89/do-git | dummy.py | dummy.py | import os
def foo():
"""
This is crappy function. should be removed using git checkout
"""
return None
def main():
pass
if __name__ == '__main__':
main()
| import os
def foo():
"""
This is crappy function. should be removed using git checkout
"""
if True == True:
return True
else:
return False
def main():
pass
if __name__ == '__main__':
main()
| apache-2.0 | Python |
178bde1703bbb044f8af8c70a57517af4490a3c0 | Fix duplicate cookie issue and header parsing | sirex/databot,sirex/databot | databot/handlers/download.py | databot/handlers/download.py | import time
import requests
import bs4
import cgi
from databot.recursive import call
class DownloadErrror(Exception):
pass
def dump_response(response):
return {
'headers': dict(response.headers),
'cookies': response.cookies.get_dict(),
'status_code': response.status_code,
'e... | import time
import requests
import bs4
from databot.recursive import call
class DownloadErrror(Exception):
pass
def dump_response(response):
return {
'headers': dict(response.headers),
'cookies': dict(response.cookies),
'status_code': response.status_code,
'encoding': respon... | agpl-3.0 | Python |
32446090486db452342ec76606d28a05f6736e81 | Update tracking.py | joshwalawender/POCS,AstroHuntsman/POCS,AstroHuntsman/POCS,panoptes/POCS,panoptes/POCS,joshwalawender/POCS,joshwalawender/POCS,panoptes/POCS,AstroHuntsman/POCS,panoptes/POCS,AstroHuntsman/POCS | panoptes/state/states/default/tracking.py | panoptes/state/states/default/tracking.py | import time
def on_enter(event_data):
""" The unit is tracking the target. Proceed to observations. """
pan = event_data.model
pan.say("Checking our tracking")
next_state = 'parking'
try:
pan.say("I'm adjusting the tracking rate")
#pan.observatory.update_tracking()
next_st... | import time
def on_enter(event_data):
""" The unit is tracking the target. Proceed to observations. """
pan = event_data.model
pan.say("Checking our tracking")
next_state = 'parking'
try:
pan.say("I'm adjusting the tracking rate")
pan.observatory.update_tracking()
next_sta... | mit | Python |
cbae828ee9eb91a2373a415f1a1521fb5dee3100 | Add method to generate list of abscissa dicts | jrsmith3/datac,jrsmith3/datac | datac/main.py | datac/main.py | # -*- coding: utf-8 -*-
import copy
def init_abscissa(params, abscissae, abscissa_name):
"""
List of dicts to initialize object w/ calc method
This method generates a list of dicts; each dict is sufficient to initialize an object featuring a calculator method of interest. This list can be thought of as th... | # -*- coding: utf-8 -*-
import copy
| mit | Python |
cd5053ac36e13b57e95eeb1241032c97b48a4a85 | Drop try/catch that causes uncaught errors in the Observer to be silently ignored | wathsalav/xos,wathsalav/xos,wathsalav/xos,wathsalav/xos | planetstack/openstack_observer/backend.py | planetstack/openstack_observer/backend.py | import threading
import time
from observer.event_loop import PlanetStackObserver
from observer.event_manager import EventListener
from util.logger import Logger, logging
logger = Logger(level=logging.INFO)
class Backend:
def run(self):
# start the openstack observer
observer = PlanetS... | import threading
import time
from observer.event_loop import PlanetStackObserver
from observer.event_manager import EventListener
from util.logger import Logger, logging
logger = Logger(level=logging.INFO)
class Backend:
def run(self):
try:
# start the openstack observer
obser... | apache-2.0 | Python |
b725ef74f8e6f0887737e13783062b987fb3dd77 | bump to 7.0.3 final | eReuse/device-inventory,eReuse/workbench,eReuse/device-inventory,eReuse/workbench | device_inventory/__init__.py | device_inventory/__init__.py | VERSION = (7, 0, 3, 'final', 0)
def get_version():
"Returns a PEP 386-compliant version number from VERSION."
assert len(VERSION) == 5
assert VERSION[3] in ('alpha', 'beta', 'rc', 'final')
# Now build the two parts of the version number:
# main = X.Y[.Z]
# sub = .devN - for pre-alpha rele... | VERSION = (7, 0, 3, 'beta', 6)
def get_version():
"Returns a PEP 386-compliant version number from VERSION."
assert len(VERSION) == 5
assert VERSION[3] in ('alpha', 'beta', 'rc', 'final')
# Now build the two parts of the version number:
# main = X.Y[.Z]
# sub = .devN - for pre-alpha relea... | agpl-3.0 | Python |
584c2f69df66bd08ace0652da7337e8e71a72099 | Use bool for zero_mask. Requires pytorch 1.7+ | mrcslws/nupic.research,numenta/nupic.research,subutai/nupic.research,numenta/nupic.research,mrcslws/nupic.research,subutai/nupic.research | projects/transformers/models/sparse_embedding.py | projects/transformers/models/sparse_embedding.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2021, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2021, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 | Python |
37fa40a9b5260f8090adaa8c15d3767c0867574f | Create a list of messages that contain system time. | PointOneNav/fusion-engine-client,PointOneNav/fusion-engine-client,PointOneNav/fusion-engine-client | python/fusion_engine_client/messages/__init__.py | python/fusion_engine_client/messages/__init__.py | from .core import *
from . import ros
message_type_to_class = {
# Navigation solution messages.
PoseMessage.MESSAGE_TYPE: PoseMessage,
PoseAuxMessage.MESSAGE_TYPE: PoseAuxMessage,
GNSSInfoMessage.MESSAGE_TYPE: GNSSInfoMessage,
GNSSSatelliteMessage.MESSAGE_TYPE: GNSSSatelliteMessage,
# Sensor m... | from .core import *
from . import ros
message_type_to_class = {
# Navigation solution messages.
PoseMessage.MESSAGE_TYPE: PoseMessage,
PoseAuxMessage.MESSAGE_TYPE: PoseAuxMessage,
GNSSInfoMessage.MESSAGE_TYPE: GNSSInfoMessage,
GNSSSatelliteMessage.MESSAGE_TYPE: GNSSSatelliteMessage,
# Sensor m... | mit | Python |
d99dfa94a42d70900e31c36023602bea3e5efdfb | Bump forgotten version to 3.2 | nMustaki/debinterface,nMustaki/debinterface | debinterface/__init__.py | debinterface/__init__.py | # -*- coding: utf-8 -*-
"""Imports for easier use"""
from .adapter import NetworkAdapter
from .adapterValidation import NetworkAdapterValidation
from .dnsmasqRange import (DnsmasqRange,
DEFAULT_CONFIG as DNSMASQ_DEFAULT_CONFIG)
from .hostapd import Hostapd
from .interfaces import Interfaces
f... | # -*- coding: utf-8 -*-
"""Imports for easier use"""
from .adapter import NetworkAdapter
from .adapterValidation import NetworkAdapterValidation
from .dnsmasqRange import (DnsmasqRange,
DEFAULT_CONFIG as DNSMASQ_DEFAULT_CONFIG)
from .hostapd import Hostapd
from .interfaces import Interfaces
f... | bsd-3-clause | Python |
e9e6d5a6c42ff1522010f003fbed2cd324eab48e | Update cluster config | saketkc/rna-seq-snakemake,saketkc/rna-seq-snakemake,saketkc/rna-seq-snakemake | configs/config_cluster.py | configs/config_cluster.py | CDNA = '/home/cmb-panasas2/skchoudh/genomes/hg19/kallisto/hg19'
GENOMES_DIR='/home/cmb-panasas2/skchoudh/genomes'
OUT_DIR = '/home/cmb-panasas2/skchoudh/HuR_results/human/rna_seq_star_hg38_annotated'
SRC_DIR = '/home/cmb-panasas2/skchoudh/github_projects/clip_seq_pipeline/scripts'
RAWDATA_DIR ='/home/cmb-06/as/skchoudh... | CDNA = '/home/cmb-panasas2/skchoudh/genomes/hg19/kallisto/hg19'
GENOMES_DIR='/home/cmb-panasas2/skchoudh/genomes'
OUT_DIR = '/home/cmb-panasas2/skchoudh/HuR_results/analysis/rna_seq_star_hg38_annotated'
RAWDATA_DIR ='/home/cmb-06/as/skchoudh/data/HuR_Mouse_Human_liver/rna-seq/Penalva_L_08182016'
SAMPLES=['HepG2_CTRL1_S... | bsd-2-clause | Python |
79eb9241ac8ce36b14512287bc473a426db50cf1 | Use elif to make it faster. | Notulp/Pluton,Notulp/Pluton | Example/Pluton/Plugins/Example/Example.py | Example/Pluton/Plugins/Example/Example.py | import clr
import sys
clr.AddReferenceByPartialName("UnityEngine")
clr.AddReferenceByPartialName("Pluton")
import UnityEngine
import Pluton
from Pluton import InvItem
from System import *
from UnityEngine import *
class Example:
def On_PlayerConnected(self, player):
for p in Server.ActivePlayers:
if(p.Name != p... | import clr
import sys
clr.AddReferenceByPartialName("UnityEngine")
clr.AddReferenceByPartialName("Pluton")
import UnityEngine
import Pluton
from Pluton import InvItem
from System import *
from UnityEngine import *
class Example:
def On_PlayerConnected(self, player):
for p in Server.ActivePlayers:
if(p.Name != p... | mit | Python |
9af1cbe0676ca71edecfa6d44c66690a5a583b01 | Rewrite for clarity | louisswarren/hieretikz | constructive_hierarchy.py | constructive_hierarchy.py | '''Reason about a directed graph in which the (non-)existence of some edges
must be inferred by the disconnectedness of certain vertices. Collect (truthy)
evidence for boolean function return values.'''
def transitive_closure_dict(known_vertices, edges):
'''Find the transitive closure of a dict mapping vertices to... | '''Reason about a directed graph in which the (non-)existence of some edges
must be inferred by the disconnectedness of certain vertices. Collect (truthy)
evidence for boolean function return values.'''
def transitive_closure_dict(vertices, edges):
'''Find the transitive closure of a dict mapping vertices to their... | mit | Python |
7760d75bb5ca38d2c96924e0ea1d65485cdc5c6f | Update version 0.12.2 -> 0.12.3 | dwavesystems/dimod,dwavesystems/dimod | dimod/__init__.py | dimod/__init__.py | # Copyright 2018 D-Wave Systems 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... | # Copyright 2018 D-Wave Systems 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... | apache-2.0 | Python |
00b7cf15877dc17d07d591c893671decb6b869e2 | Enable touch events for smoothness tests. | littlstar/chromium.src,littlstar/chromium.src,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,markYoungH/chromium.src,Chilledheart/chromium,Fireblend/chromium-crosswalk,Jonekee/chromium.src,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,dushu1203/chromium.src,littlstar/chromium.src,fujunwei/chromium-crosswalk,ma... | tools/perf/measurements/smoothness.py | tools/perf/measurements/smoothness.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.
from metrics import power
from measurements import smoothness_controller
from telemetry.page import page_measurement
class Smoothness(page_measurement.... | # 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.
from metrics import power
from measurements import smoothness_controller
from telemetry.page import page_measurement
class Smoothness(page_measurement.... | bsd-3-clause | Python |
cf2004cec6e84cbec213f9e70dd8245327af541d | Update api.py | AlecAivazis/nautilus,aaivazis/nautilus,aaivazis/nautilus,AlecAivazis/nautilus,AlecAivazis/nautilus | example/services/api.py | example/services/api.py | # external imports
from nautilus import APIGateway
from graphene import Schema, ObjectType, String, Mutation, Boolean
from nautilus.api import ServiceObjectType
from nautilus.api.fields import Connection
from nautilus.network import dispatchAction
from nautilus.conventions import getCRUDAction
# local imports
from .rec... | # external imports
from nautilus import APIGateway
from graphene import Schema, ObjectType, String, Mutation, Boolean
from nautilus.api import ServiceObjectType
from nautilus.api.fields import Connection
from nautilus.network import dispatchAction
from nautilus.conventions import getCRUDAction
# local imports
from .rec... | mit | Python |
c4b83c9554ca0f501ac42c63a53394ff8b90c2af | bump version to 20190807 | AOSC-Dev/acbs,AOSC-Dev/acbs,AOSC-Dev/acbs,AOSC-Dev/acbs | acbs/__init__.py | acbs/__init__.py | __version__ = '20190807'
| __version__ = '20181007'
| lgpl-2.1 | Python |
2b20e803733db09ad4643be00b2af11ecea1eeb8 | Increase version to 0.11.0 (#394) | FabioRosado/opsdroid,jacobtomlinson/opsdroid,opsdroid/opsdroid | opsdroid/const.py | opsdroid/const.py | """Constants used by OpsDroid."""
import os
__version__ = "0.11.0"
DEFAULT_GIT_URL = "https://github.com/opsdroid/"
MODULES_DIRECTORY = "opsdroid-modules"
DEFAULT_ROOT_PATH = os.path.expanduser("~/.opsdroid")
DEFAULT_LOG_FILENAME = os.path.join(DEFAULT_ROOT_PATH, 'output.log')
DEFAULT_MODULES_PATH = os.path.join(DEFA... | """Constants used by OpsDroid."""
import os
__version__ = "0.10.0"
DEFAULT_GIT_URL = "https://github.com/opsdroid/"
MODULES_DIRECTORY = "opsdroid-modules"
DEFAULT_ROOT_PATH = os.path.expanduser("~/.opsdroid")
DEFAULT_LOG_FILENAME = os.path.join(DEFAULT_ROOT_PATH, 'output.log')
DEFAULT_MODULES_PATH = os.path.join(DEFA... | apache-2.0 | Python |
8f4f1e8cc45daa8cf49f050200ce17a48f008e5a | Fix process entity migration | jberci/resolwe,jberci/resolwe,genialis/resolwe,genialis/resolwe | resolwe/flow/migrations/0023_process_entity_2.py | resolwe/flow/migrations/0023_process_entity_2.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-10-01 03:15
from __future__ import unicode_literals
from django.db import migrations
def migrate_flow_collection(apps, schema_editor):
"""Migrate 'flow_collection' field to 'entity_type'."""
Process = apps.get_model('flow', 'Process')
Descript... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-10-01 03:15
from __future__ import unicode_literals
from django.db import migrations
def migrate_flow_collection(apps, schema_editor):
"""Migrate 'flow_collection' field to 'entity_type'."""
Process = apps.get_model('flow', 'Process')
Descript... | apache-2.0 | Python |
21b453946bfa35c7730d5ab15e62b48d299170ed | Update password loading test | betatim/osf-cli,betatim/osf-cli | osfclient/tests/test_listing.py | osfclient/tests/test_listing.py | """Test `osf ls` command"""
from unittest import mock
from unittest.mock import patch, MagicMock, PropertyMock, mock_open
from osfclient import OSF
from osfclient.cli import list_
from osfclient.tests.mocks import MockProject
@patch('osfclient.cli.OSF')
def test_anonymous_doesnt_use_password(MockOSF):
args = M... | """Test `osf ls` command"""
from unittest import mock
from unittest.mock import patch, MagicMock, PropertyMock, mock_open
from osfclient import OSF
from osfclient.cli import list_
from osfclient.tests.mocks import MockProject
@patch('osfclient.cli.OSF')
def test_anonymous_doesnt_use_password(MockOSF):
args = M... | bsd-3-clause | Python |
e9060c166987a18aa9faf3b790b80135b319ecca | Update example.py | bwipp/postscriptbarcode,bwipp/postscriptbarcode,bwipp/postscriptbarcode,bwipp/postscriptbarcode,bwipp/postscriptbarcode,bwipp/postscriptbarcode,bwipp/postscriptbarcode,bwipp/postscriptbarcode | libs/python/example.py | libs/python/example.py | #!/usr/bin/env python
import postscriptbarcode
c=postscriptbarcode.BWIPP("../../build/monolithic_package/barcode.ps")
c.get_version()
| #!/usr/bin/env python
import postscriptbarcode
c=postscriptbarcode.BWIPP("../barcode.ps")
c.get_version()
| mit | Python |
068a94a455448b3fc2ee552616658d9f980104ea | Add comment. | efiring/numpy-work,teoliphant/numpy-refactor,efiring/numpy-work,illume/numpy3k,jasonmccampbell/numpy-refactor-sprint,Ademan/NumPy-GSoC,efiring/numpy-work,Ademan/NumPy-GSoC,jasonmccampbell/numpy-refactor-sprint,jasonmccampbell/numpy-refactor-sprint,illume/numpy3k,teoliphant/numpy-refactor,teoliphant/numpy-refactor,chadn... | numpy/distutils/command/bdist_rpm.py | numpy/distutils/command/bdist_rpm.py | import os
import sys
from distutils.command.bdist_rpm import bdist_rpm as old_bdist_rpm
class bdist_rpm(old_bdist_rpm):
def _make_spec_file(self):
spec_file = old_bdist_rpm._make_spec_file(self)
# Replace hardcoded setup.py script name
# with the real setup script name.
setup_py =... | import os
import sys
from distutils.command.bdist_rpm import bdist_rpm as old_bdist_rpm
class bdist_rpm(old_bdist_rpm):
def _make_spec_file(self):
spec_file = old_bdist_rpm._make_spec_file(self)
setup_py = os.path.basename(sys.argv[0])
if setup_py == 'setup.py':
return spec_fil... | bsd-3-clause | Python |
6af3eacec303abfe6f260581687a38d89f7b7474 | Fix wavelength issue for QE65000 | ap--/python-oceanoptics | oceanoptics/spectrometers/QE65xxx.py | oceanoptics/spectrometers/QE65xxx.py | # tested
# ----------------------------------------------------------
from oceanoptics.base import OceanOpticsBase as _OOBase
from oceanoptics.base import OceanOpticsTEC as _OOTEC
import struct
#----------------------------------------------------------
class _QE65xxx(_OOBase, _OOTEC):
def _set_integration_time(... | # tested
# ----------------------------------------------------------
from oceanoptics.base import OceanOpticsBase as _OOBase
from oceanoptics.base import OceanOpticsTEC as _OOTEC
import struct
#----------------------------------------------------------
class _QE65xxx(_OOBase, _OOTEC):
def _set_integration_time(... | mit | Python |
56ac633029c9d7ef40415e1881d2cb3c18c83d7b | Bump to version 0.17.1 | reubano/ckanny,reubano/ckanny | ckanny/__init__.py | ckanny/__init__.py | # -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
ckanny
~~~~~~
Miscellaneous CKAN utility scripts
Examples:
literal blocks::
python example_google.py
Attributes:
module_level_variable1 (int): Module level variables may be documented in
"""
from __future__ import (
absolute_import, divisi... | # -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
ckanny
~~~~~~
Miscellaneous CKAN utility scripts
Examples:
literal blocks::
python example_google.py
Attributes:
module_level_variable1 (int): Module level variables may be documented in
"""
from __future__ import (
absolute_import, divisi... | mit | Python |
20ffbab08c244ec788e8a6114ccdbf38e39d97b6 | Fix unclassifiable problem | WangWenjun559/Weiss,WangWenjun559/Weiss,WangWenjun559/Weiss,WangWenjun559/Weiss,WangWenjun559/Weiss,WangWenjun559/Weiss,WangWenjun559/Weiss | classifier/demo.py | classifier/demo.py | """
This is a demo about how to use LibLINEAR to do the prediction
==============================================================
Usage: python demo.py
Author: Wenjun Wang
Date: June 18, 2015
"""
import pickle
import datetime
from liblinearutil import *
from feature import convert_query
# Read training file
#y, x ... | """
This is a demo about how to use LibLINEAR to do the prediction
==============================================================
Usage: python demo.py
Author: Wenjun Wang
Date: June 18, 2015
"""
import pickle
import datetime
from liblinearutil import *
from feature import convert_query
# Read training file
#y, x ... | apache-2.0 | Python |
c3951f942633438e91e43b523a814bf1a3528295 | Add impl to analyzer. | xanxys/shogi_recognizer,xanxys/shogi_recognizer | analyze.py | analyze.py | #!/bin/python
from __future__ import print_function, division
import cv
import cv2
import argparse
import preprocess
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description="""Analyze shogi board state in a photo""",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parse... | #!/bin/python
from __future__ import print_function, division
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description="""Analyze shogi board state in a photo""",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
args = parser.parse_args()
| mit | Python |
b5b40dc232b04a2cfa75438bb5143ffdb103a57c | split a method | alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,TaiSakuma/AlphaTwirl,alphatwirl/alphatwirl,TaiSakuma/AlphaTwirl | AlphaTwirl/EventReader/ProgressReporter.py | AlphaTwirl/EventReader/ProgressReporter.py | # Tai Sakuma <sakuma@fnal.gov>
import multiprocessing
import time
from ProgressReport import ProgressReport
##____________________________________________________________________________||
class ProgressReporter(object):
def __init__(self, queue, pernevents = 1000):
self.queue = queue
self.perneve... | # Tai Sakuma <sakuma@fnal.gov>
import multiprocessing
import time
from ProgressReport import ProgressReport
##____________________________________________________________________________||
class ProgressReporter(object):
def __init__(self, queue, pernevents = 1000):
self.queue = queue
self.perneve... | bsd-3-clause | Python |
ec013d194e2b26155949bf89a5cd03ef4a013cc5 | Add import unicode on csv_importer | marcwebbie/passpie,eiginn/passpie,scorphus/passpie,scorphus/passpie,marcwebbie/passpie,eiginn/passpie | passpie/importers/csv_importer.py | passpie/importers/csv_importer.py | import csv
from passpie.importers import BaseImporter
from passpie._compat import is_python2, unicode
def unicode_csv_reader(utf8_data, dialect=csv.excel, **kwargs):
csv_reader = csv.reader(utf8_data, dialect=dialect, **kwargs)
for row in csv_reader:
if is_python2():
yield [unicode(cell, '... | import csv
from passpie.importers import BaseImporter
from passpie._compat import is_python2
def unicode_csv_reader(utf8_data, dialect=csv.excel, **kwargs):
csv_reader = csv.reader(utf8_data, dialect=dialect, **kwargs)
for row in csv_reader:
if is_python2():
yield [unicode(cell, 'utf-8') f... | mit | Python |
8e536e4911ab18a5ac6e2e018fa041425a57a14b | Update serializers.py | Bugheist/website,Bugheist/website,Bugheist/website,Bugheist/website | website/serializers.py | website/serializers.py | from website.models import Issue, User , UserProfile,Points, Domain
from rest_framework import routers, serializers, viewsets, filters
import django_filters
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ('id','username')
class IssueSerializer(serializers.Mode... | from website.models import Issue, User , UserProfile,Points, Domain
from rest_framework import routers, serializers, viewsets, filters
import django_filters
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ('id','username')
class IssueSerializer(serializers.Mode... | agpl-3.0 | Python |
6f0c05ee4743528550dd083d9290b5be0074ff0e | Add commands args to runner and improve docs in it | zillolo/vsut-python | runner.py | runner.py | import argparse
import sys
from vsut.unit import CSVFormatter, TableFormatter, Unit
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Runs unit tests.")
parser.add_argument('units', metavar='Unit', type=str, nargs='+')
parser.add_argument(
'--format', help="Default: table; De... | import sys
from vsut.unit import CSVFormatter, TableFormatter
if __name__ == "__main__":
for i in range(1, len(sys.argv)):
try:
modName = sys.argv[i].split(".")[0:-1]
modName = ".".join(modName)
className = sys.argv[i].split(".")[-1]
module = __import__(modN... | mit | Python |
553cd68fb5d54be6ecbf3ca93c6d6c6be75afdb5 | Add EveLinkCache to evelink.appengine | ayust/evelink,Morloth1274/EVE-Online-POCO-manager,zigdon/evelink,FashtimeDotCom/evelink,bastianh/evelink | evelink/appengine/__init__.py | evelink/appengine/__init__.py | from evelink.appengine.api import AppEngineAPI
from evelink.appengine.api import AppEngineCache
from evelink.appengine.api import AppEngineDatastoreCache
from evelink.appengine.api import EveLinkCache
from evelink.appengine import account
from evelink.appengine import char
from evelink.appengine import corp
from evelin... | from evelink.appengine.api import AppEngineAPI
from evelink.appengine.api import AppEngineCache
from evelink.appengine.api import AppEngineDatastoreCache
from evelink.appengine import account
from evelink.appengine import char
from evelink.appengine import corp
from evelink.appengine import eve
from evelink.appengine i... | mit | Python |
68c4f723f5eea2802209862d323825f33a445154 | Fix url id to pk. | rg3915/wttd2,rg3915/wttd2,rg3915/wttd2,rg3915/wttd2 | eventex/subscriptions/urls.py | eventex/subscriptions/urls.py | from django.urls import path
import eventex.subscriptions.views as s
app_name = 'subscriptions'
urlpatterns = [
path('', s.new, name='new'),
path('<int:pk>/', s.detail, name='detail'),
path('json/donut/', s.paid_list_json, name='paid_list_json'),
path('json/column/', s.paid_column_json, name='paid_c... | from django.urls import path
import eventex.subscriptions.views as s
app_name = 'subscriptions'
urlpatterns = [
path('', s.new, name='new'),
path('<int:id>/', s.detail, name='detail'),
path('json/donut/', s.paid_list_json, name='paid_list_json'),
path('json/column/', s.paid_column_json, name='paid_c... | mit | Python |
ca625e22cb397905f859c826c6507b3977665a51 | Fix import | farizrahman4u/keras-contrib,keras-team/keras-contrib,stygstra/keras-contrib,keras-team/keras-contrib,keras-team/keras-contrib | examples/cifar10_ror.py | examples/cifar10_ror.py | '''
Trains a Residual-of-Residual Network (WRN-40-2) model on the CIFAR-10 Dataset.
Gets a 94.53% accuracy score after 150 epochs.
'''
import numpy as np
import sklearn.metrics as metrics
import keras.callbacks as callbacks
import keras.utils.np_utils as kutils
from keras.datasets import cifar10
from keras.preprocess... | '''
Trains a Residual-of-Residual Network (WRN-40-2) model on the CIFAR-10 Dataset.
Gets a 94.53% accuracy score after 150 epochs.
'''
import numpy as np
import sklearn.metrics as metrics
import keras.callbacks as callbacks
import keras.utils.np_utils as kutils
from keras.datasets import cifar10
from keras.preprocess... | mit | Python |
d458fb855df77dfb553ee3e95a8201f58aba169e | Increment version number | clippercard/clippercard-python,anthonywu/clippercard,clippercard/clippercard-python,anthonywu/clippercard | clippercard/__init__.py | clippercard/__init__.py | """
Copyright (c) 2012-2017 (https://github.com/clippercard/clippercard-python)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use,... | """
Copyright (c) 2012-2017 (https://github.com/clippercard/clippercard-python)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use,... | mit | Python |
6e663d4010f9a79d2816a212e504773a1745a8e6 | Fix project name! | LeastAuthority/txkube | src/txkube/__init__.py | src/txkube/__init__.py | # Copyright Least Authority Enterprises.
# See LICENSE for details.
"""
A Kubernetes client.
"""
__all__ = [
"version",
"IKubernetesClient",
"network_client", "memory_client",
]
from incremental import Version
from ._metadata import version_tuple as _version_tuple
version = Version("txkube", *_version_t... | # Copyright Least Authority Enterprises.
# See LICENSE for details.
"""
A Kubernetes client.
"""
__all__ = [
"version",
"IKubernetesClient",
"network_client", "memory_client",
]
from incremental import Version
from ._metadata import version_tuple as _version_tuple
version = Version("pykube", *_version_t... | mit | Python |
15faef8beb415211a04fd6dca976158343d8f77f | add abc to guid, fixed issues | grepme/cmput410-project,grepme/cmput410-project,grepme/cmput410-project,grepme/cmput410-project,grepme/cmput410-project | user_profile/models.py | user_profile/models.py | from django.db import models
from django.contrib.auth.models import User
import uuid
# Create your models here.
# using the guid model
from framework.models import GUIDModel
class Profile(GUIDModel):
author = models.ForeignKey(User)
display_name = models.CharField(max_length=55)
def as_dict(self):
... | from django.db import models
from django.contrib.auth.models import User
import uuid
# Create your models here.
# using the guid model
from framework.models import GUIDModel
class Profile(GUIDModel):
author = models.ForeignKey(User)
display_name = models.CharField(max_length=55)
# guid
guid = models... | apache-2.0 | Python |
127ad982617c2376c9378d1ef7e50b716a077428 | Replace imp with __import__ | shineyear/catawampus,ankurjimmy/catawampus,shineyear/catawampus,pombredanne/catawampus,ankurjimmy/catawampus,ultilix/catawampus,pombredanne/catawampus,ultilix/catawampus | dm_root.py | dm_root.py | #!/usr/bin/python
# Copyright 2012 Google Inc. All Rights Reserved.
#
# TR-069 has mandatory attribute names that don't comply with policy
#pylint: disable-msg=C6409
#pylint: disable-msg=W0404
#
"""The Device Model root, allowing specific platforms to populate it."""
__author__ = 'dgentry@google.com (Denton Gentry)'
... | #!/usr/bin/python
# Copyright 2012 Google Inc. All Rights Reserved.
#
# TR-069 has mandatory attribute names that don't comply with policy
#pylint: disable-msg=C6409
#pylint: disable-msg=W0404
#
"""The Device Model root, allowing specific platforms to populate it."""
__author__ = 'dgentry@google.com (Denton Gentry)'
... | apache-2.0 | Python |
e784227ae5da242d474bc02209289e1dabd2d3a2 | Test Spectral Reconstruction on Sin Wave | googleinterns/audio_synthesis | utils/spectral_test.py | utils/spectral_test.py | # Lint as: python3
"""Tests for spectral."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import os
import spectral
class SpectralTest(tf.test.TestCase):
def test_waveform_to_spectogram_shape(self):
... | # Lint as: python3
"""Tests for spectral."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import os
import spectral
class SpectralTest(tf.test.TestCase):
def test_waveform_to_spectogram_shape(self):
... | apache-2.0 | Python |
05939b0b797780ac1d265c8415f72f1ca44be53d | Modify return tag search data with tag_name | NA5G/coco-server-was,NA5G/coco-server-was,NA5G/coco-server-was | coco/dashboard/views.py | coco/dashboard/views.py | # -*- coding: utf-8 -*-
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from posts.models import Post, Tag
@login_required
def index(request):
context = {'posts': Post.objects.all()}
return render(request, 'dashboard/index.html', context)
@login_required
def tagg... | # -*- coding: utf-8 -*-
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from posts.models import Post, Tag
@login_required
def index(request):
context = {'posts': Post.objects.all()}
return render(request, 'dashboard/index.html', context)
@login_required
def tagg... | mit | Python |
d0de5476580b466d7b13cfc7668c267e62cb15f0 | create 32 bit integer var, not 64 (to allow test with NETCDF4_CLASSIC) | Unidata/netcdf4-python,Unidata/netcdf4-python,Unidata/netcdf4-python | examples/mpi_example.py | examples/mpi_example.py | # to run: mpirun -np 4 python mpi_example.py
from mpi4py import MPI
import numpy as np
from netCDF4 import Dataset
rank = MPI.COMM_WORLD.rank # The process ID (integer 0-3 for 4-process run)
nc = Dataset('parallel_test.nc', 'w', parallel=True, comm=MPI.COMM_WORLD,
info=MPI.Info(),format='NETCDF4_CLASSIC')
# be... | # to run: mpirun -np 4 python mpi_example.py
from mpi4py import MPI
import numpy as np
from netCDF4 import Dataset
rank = MPI.COMM_WORLD.rank # The process ID (integer 0-3 for 4-process run)
nc = Dataset('parallel_test.nc', 'w', parallel=True, comm=MPI.COMM_WORLD,
info=MPI.Info(),format='NETCDF4_CLASSIC')
# be... | mit | Python |
a53fae5b42e9b33774650e017967b865552870e9 | tag v0.7.4 | cihai/cihaidata-unihan | unihan_tabular/__about__.py | unihan_tabular/__about__.py | __title__ = 'unihan-tabular'
__package_name__ = 'unihan_tabular'
__description__ = 'Export UNIHAN to Python, Data Package, CSV, JSON and YAML'
__version__ = '0.7.4'
__author__ = 'Tony Narlock'
__email__ = 'cihai@git-pull.com'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013-2017 Tony Narlock'
| __title__ = 'unihan-tabular'
__package_name__ = 'unihan_tabular'
__description__ = 'Export UNIHAN to Python, Data Package, CSV, JSON and YAML'
__version__ = '0.7.3'
__author__ = 'Tony Narlock'
__email__ = 'cihai@git-pull.com'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013-2017 Tony Narlock'
| mit | Python |
4420892ad3e8c1797753e7893772e53785efb570 | add logfile handling | sassoftware/mirrorball,sassoftware/mirrorball | updatebot/cmdline/simple.py | updatebot/cmdline/simple.py | #
# Copyright (c) 2008 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.rpath.com/permanent/... | #
# Copyright (c) 2008 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.rpath.com/permanent/... | apache-2.0 | Python |
98cb673b358671211a0aa7fed0725dbb732200d0 | Fix edge cases due to artworkUrl100 being missing | fallenshell/coverpy | coverpy/coverpy.py | coverpy/coverpy.py | import os
import requests
from . import exceptions
class Result:
""" Parse an API result into an object format. """
def __init__(self, item):
""" Call the list parser. """
self.parse(item)
def parse(self, item):
""" Parse the given list into self variables. """
try:
self.artworkThumb = item['artworkUrl... | import os
import requests
from . import exceptions
class Result:
""" Parse an API result into an object format. """
def __init__(self, item):
""" Call the list parser. """
self.parse(item)
def parse(self, item):
""" Parse the given list into self variables. """
self.artworkThumb = item['artworkUrl100']
... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.