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 |
|---|---|---|---|---|---|---|---|---|
1ed7db3d84b9cd07fcf391d7f891fbe524ae1a68 | Automate nginx configuration reloading | hans-t/sg-bus-arrival,hans-t/sg-bus-arrival,hans-t/sg-bus-arrival,hans-t/sg-bus-arrival | deployment/fabfile.py | deployment/fabfile.py | import os.path
from fabric.api import cd
from fabric.api import env
from fabric.api import run
from fabric.api import sudo
from fabric.api import local
from fabric.context_managers import shell_env
env.use_ssh_config = True
ROOT_DIR = os.path.join(os.path.expanduser('~'), 'sites', '{host}')
SOURCE_DIR = os.path.join... | import os.path
from fabric.api import cd
from fabric.api import env
from fabric.api import run
from fabric.api import sudo
from fabric.api import local
from fabric.context_managers import shell_env
env.use_ssh_config = True
def update_source():
with cd('source'):
branch = 'dev' if env.host == 'localhos... | mit | Python |
1c6fe63a041953810600681bece5d66996798817 | Update __init__.py | ankurankan/pgmpy,liquidmetal/pgmpy,ankurankan/pgmpy,jhonatanoliveira/pgmpy,abinashpanda/pgmpy,pgmpy/pgmpy,kris-singh/pgmpy,khalibartan/pgmpy,abinashpanda/pgmpy,liquidmetal/pgmpy,khalibartan/pgmpy,sandeepkrjha/pgmpy,pgmpy/pgmpy,sandeepkrjha/pgmpy,kris-singh/pgmpy,anaviltripathi/pgmpy,anaviltripathi/pgmpy,yashu-seth/pgmp... | pgmpy/inference/__init__.py | pgmpy/inference/__init__.py | from .base import Inference
from .ExactInference import VariableElimination
from .ExactInference import BeliefPropagation
from .Sampling import BayesianModelSampling
from .dbn_inference import DBNInference
__all__ = ['Inference',
'VariableElimination',
'DBNInference',
'BeliefPropagatio... | from .base import Inference
from .ExactInference import VariableElimination
from .ExactInference import BeliefPropagation
from .Sampling import BayesianModelSampling
from .mplp import Mplp
__all__ = ['Inference',
'VariableElimination',
'BeliefPropagation',
'BayesianModelSampling',
... | mit | Python |
5ac102dcc91e0452755f9fb504c8d198471c2726 | Fix edit plan with persistence | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/physical/forms/plan_admin.py | dbaas/physical/forms/plan_admin.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import logging
from django.utils.translation import ugettext_lazy as _
from django import forms
from .. import models
from ckeditor.widgets import CKEditorWidget
log = logging.getLogger(__name__)
class PlanForm(forms.ModelForm):
des... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import logging
from django.utils.translation import ugettext_lazy as _
from django import forms
from .. import models
from ckeditor.widgets import CKEditorWidget
log = logging.getLogger(__name__)
class PlanForm(forms.ModelForm):
des... | bsd-3-clause | Python |
3da21250407c6fc16621ba52e3ce574fc6e012b6 | Add support for 'verify' endpoint. | cache-rules/email_hunter_python,tipsqueal/email_hunter_python | email_hunter/email_hunter_client.py | email_hunter/email_hunter_client.py | # Copyright 2015 Alan Vezina. All rights reserved.
import requests
class EmailHunterClient:
def __init__(self, api_key, api_version='v1'):
self.api_key = api_key
self.api_version = api_version
self.base_url = 'https://api.emailhunter.co/{}/'.format(api_version)
def _make_request(self,... | # Copyright 2015 Alan Vezina. All rights reserved.
import requests
class EmailHunterClient:
def __init__(self, api_key, api_version='v1'):
self.api_key = api_key
self.api_version = api_version
self.base_url = 'https://api.emailhunter.co/{}/'.format(api_version)
def _make_request(self,... | mit | Python |
0a049e4bc712822465329607666318fce29e756f | remove check for unicode | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/test/test_getargs.py | Lib/test/test_getargs.py | """
Test the internal getargs.c implementation
PyArg_ParseTuple() is defined here.
The test here is not intended to test all of the module, just the
single case that failed between 2.1 and 2.2a2.
"""
# marshal.loads() uses PyArg_ParseTuple(args, "s#:loads")
# The s code will cause a Unicode conversion to occur. Th... | """
Test the internal getargs.c implementation
PyArg_ParseTuple() is defined here.
The test here is not intended to test all of the module, just the
single case that failed between 2.1 and 2.2a2.
"""
# marshal.loads() uses PyArg_ParseTuple(args, "s#:loads")
# The s code will cause a Unicode conversion to occur. Th... | mit | Python |
6d13e02704c2b48237d7b34674bf59fe58bdbe45 | Update examples to include cdata access | stchris/untangle | examples.py | examples.py | #!/usr/bin/env python
import untangle
def access():
o = untangle.parse('<node id="5">This is cdata<subnode value="abc"/></node>')
return ("Node id = %s, subnode value = %s" %
(o.node['id'], o.node.subnode['value']))
def siblings_list():
o = untangle.parse('''
<root>
<chi... | #!/usr/bin/env python
import untangle
def access():
o = untangle.parse('<node id="5"><subnode value="abc"/></node>')
return ("Node id = %s, subnode value = %s" %
(o.node['id'], o.node.subnode['value']))
def siblings_list():
o = untangle.parse('''
<root>
<child name="chil... | mit | Python |
02540edd589c51cdd20bb330174fb45cc58d7cc9 | Copy purchase price information across in the data migration | SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree | InvenTree/stock/migrations/0064_auto_20210621_1724.py | InvenTree/stock/migrations/0064_auto_20210621_1724.py | # Generated by Django 3.2.4 on 2021-06-21 07:24
from django.db import migrations
def extract_purchase_price(apps, schema_editor):
"""
Find instances of StockItem which do *not* have a purchase price set,
but which point to a PurchaseOrder where there *is* a purchase price set.
Then, assign *that* pu... | # Generated by Django 3.2.4 on 2021-06-21 07:24
from django.db import migrations
def extract_purchase_price(apps, schema_editor):
"""
Find instances of StockItem which do *not* have a purchase price set,
but which point to a PurchaseOrder where there *is* a purchase price set.
Then, assign *that* pu... | mit | Python |
ba48050685b88f0b14dd30f3f0162b211860c362 | bump up xenbus version to 113 | OwenSmith/win-installer,OwenSmith/win-installer,xenserver/win-installer,xenserver/win-installer,OwenSmith/win-installer,xenserver/win-installer,xenserver/win-installer,xenserver/win-installer,OwenSmith/win-installer,OwenSmith/win-installer | manifestspecific.py | manifestspecific.py | # Copyright (c) Citrix Systems Inc.
# 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 conditions a... | # Copyright (c) Citrix Systems Inc.
# 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 conditions a... | bsd-2-clause | Python |
fa63b6e40bd0fa008a1b995bc3dcb544f1f13397 | Tweak to dynamic argument handler. | OpenTrons/opentrons_sdk,OpenTrons/opentrons-api,OpenTrons/opentrons-api,OpenTrons/opentrons-api,OpenTrons/opentrons-api,Opentrons/labware,OpenTrons/opentrons-api | labsuite/compilers/compiler.py | labsuite/compilers/compiler.py | #!/usr/bin/env python
"""
Allows you to use the command line to compile scripts for any of the
compiler modules in this directory.
For example, you can do:
python compiler.py pfusx NI NG NI HD HD NN NG HD NG NG NI NG NG NG NI
It works because there's a pfusx.py file with a compile method.
Compilers are design... | #!/usr/bin/env python
"""
Allows you to use the command line to compile scripts for any of the
compiler modules in this directory.
For example, you can do:
python compiler.py pfusx NI NG NI HD HD NN NG HD NG NG NI NG NG NG NI
It works because there's a pfusx.py file with a compile method.
Compilers are design... | apache-2.0 | Python |
b39dcbd12164cdd682aea2d39e298fe968dcf38e | Correct bounds and boolean selector. | pypa/setuptools,pypa/setuptools,pypa/setuptools | pkg_resources/py31compat.py | pkg_resources/py31compat.py | import os
import errno
import sys
def _makedirs_31(path, exist_ok=False):
try:
os.makedirs(path)
except OSError as exc:
if not exist_ok or exc.errno != errno.EEXIST:
raise
# rely on compatibility behavior until mode considerations
# and exists_ok considerations are disentangled.... | import os
import errno
import sys
def _makedirs_31(path, exist_ok=False):
try:
os.makedirs(path)
except OSError as exc:
if not exist_ok or exc.errno != errno.EEXIST:
raise
# rely on compatibility behavior until mode considerations
# and exists_ok considerations are disentangled.... | mit | Python |
212883ea06e493ed263d9334391d193f85d14cf3 | Update atomic/__init__.py | StanczakDominik/PlasmaPy | plasmapy/atomic/__init__.py | plasmapy/atomic/__init__.py | """Physical and mathematical constants for use within PlasmaPy."""
from .atomic import (atomic_symbol,
isotope_symbol,
atomic_number,
is_isotope_stable,
half_life,
mass_number,
element_name,
... | """Physical and mathematical constants for use within PlasmaPy."""
from .atomic import atomic_symbol, isotope_symbol, atomic_number, is_isotope_stable, half_life, mass_number, element_name, standard_atomic_weight, isotope_mass, ion_mass, known_isotopes, common_isotopes, stable_isotopes, isotopic_abundance, charge_state... | bsd-3-clause | Python |
d57205224cb7eee7bee0cb6424f3178c525382c3 | change commission for backtester | joequant/sptrader,joequant/sptrader,joequant/sptrader,joequant/sptrader,joequant/sptrader | sptrader/spbacktester.py | sptrader/spbacktester.py | import spstore
from backtrader.metabase import MetaParams
from backtrader.utils.py3 import with_metaclass
from backtrader.brokers.bbroker import BackBroker
from backtrader.comminfo import CommInfoBase
class MetaSharpPointBackTester(MetaParams):
def __init__(cls, name, bases, dct):
'''Class has already been... | import spstore
from backtrader.metabase import MetaParams
from backtrader.utils.py3 import with_metaclass
from backtrader.brokers.bbroker import BackBroker
class MetaSharpPointBackTester(MetaParams):
def __init__(cls, name, bases, dct):
'''Class has already been created ... register'''
# Initialize... | bsd-2-clause | Python |
b6ad2a53aaf1a6684e4a47f454b1e7e8b09a929d | Update version in makeRelease | AdaptivePELE/AdaptivePELE,AdaptivePELE/AdaptivePELE,AdaptivePELE/AdaptivePELE,AdaptivePELE/AdaptivePELE | AdaptivePELE/makeRelease.py | AdaptivePELE/makeRelease.py | """
Only for developers.
Change releaseName to build a new release.
"""
import glob
import shutil
import os
releaseName = "v1.4"
# releaseFolder = "/gpfs/projects/bsc72/adaptiveSampling/bin"
releaseFolder = "/data2/bsc72/AdaptiveSampling/bin"
toOmit = ["tests", "runAllTests.py", "os", "sys", "TODO.txt", "Data... | """
Only for developers.
Change releaseName to build a new release.
"""
import glob
import shutil
import os
releaseName = "v1.3"
# releaseFolder = "/gpfs/projects/bsc72/adaptiveSampling/bin"
releaseFolder = "/data2/bsc72/AdaptiveSampling/bin"
toOmit = ["pyemma", "tests", "runAllTests.py", "os", "sys", "TODO.t... | mit | Python |
521b834f1c980930c2d4465362f58ca1f8c67691 | fix name type | rackerlabs/deuce | deuce/tests/db_mocking/__init__.py | deuce/tests/db_mocking/__init__.py | import os
from unittest import TestCase
from pecan import set_config
import pecan
import os
import shutil
from deuce.tests.db_mocking.sqlite_mocking import Connection
import deuce.tests.db_mocking.mongodb_mocking
| import os
from unittest import TestCase
from pecan import set_config
import pecan
import os
import shutil
from deuce.tests.db_mocking.sqlite_mocking import Connection
from deuce.tests.db_mocking.mongodb_mocking import pymongo
| apache-2.0 | Python |
0ee2b337b61155044a66ae1f6f173492a51c1150 | Modify Fluorophore for more convenient coordinates. | talonchandler/dipsim,talonchandler/dipsim | dipsim/fluorophore.py | dipsim/fluorophore.py | import numpy as np
class Fluorophore:
"""A fluorophore is specified by its orientation (in theta and phi spherical
coordinates), it distribution (using a kappa watson distribution), and a
constant (c) proportional to the fluorohphore's brightness.
"""
def __init__(self, theta=np.pi/2, phi=0, kappa=... | import numpy as np
class Fluorophore:
"""A single fluorophore is specified by its 3D position, (unit) absorption
dipole moment (theta, phi), and (unit) emission dipole moment (theta, phi).
"""
def __init__(self, position=np.array([0, 0, 0]),
mu_abs=np.array([0, 0]),
mu... | mit | Python |
79e5cab2908c26ff80ae5c5e4b37ced9765a952c | Fix database infra save method | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/physical/forms/database_infra.py | dbaas/physical/forms/database_infra.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import logging
from django import forms
from .. import models
log = logging.getLogger(__name__)
class DatabaseInfraForm(forms.ModelForm):
class Meta:
model = models.DatabaseInfra
def __init__(self, *args, **kwargs):
... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import logging
from django import forms
from .. import models
log = logging.getLogger(__name__)
class DatabaseInfraForm(forms.ModelForm):
class Meta:
model = models.DatabaseInfra
def __init__(self, *args, **kwargs):
... | bsd-3-clause | Python |
1e264b61d82b009778780926ca730b5dc990a635 | Allow importing even when not compiled. | youprofit/scikit-image,bsipocz/scikit-image,bennlich/scikit-image,WarrenWeckesser/scikits-image,ajaybhat/scikit-image,bennlich/scikit-image,paalge/scikit-image,chintak/scikit-image,rjeli/scikit-image,ofgulban/scikit-image,almarklein/scikit-image,pratapvardhan/scikit-image,rjeli/scikit-image,newville/scikit-image,vighne... | scikits/image/analysis/__init__.py | scikits/image/analysis/__init__.py | try:
from spath import shortest_path
except ImportError:
print """*** The shortest path extension has not been compiled. Run
python setup.py build_ext -i
in the source directory to build in-place. Please refer to INSTALL.txt
for further detail."""
| from spath import shortest_path
| bsd-3-clause | Python |
c854dcf71f71d631013a65cf5517555845bf5eef | Update test_jenkins.py | sdpython/ensae_teaching_cs,sdpython/ensae_teaching_cs,sdpython/ensae_teaching_cs,sdpython/ensae_teaching_cs,sdpython/ensae_teaching_cs,sdpython/ensae_teaching_cs | _unittests/ut_automation/test_jenkins.py | _unittests/ut_automation/test_jenkins.py | # -*- coding: utf-8 -*-
"""
@brief test log(time=60s)
"""
import sys
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import ExtTestCase
from pyquickhelper.jenkinshelper import JenkinsExt
from ensae_teaching_cs.automation.jenkins_helper import (
setup_jenkins_server, default_j... | # -*- coding: utf-8 -*-
"""
@brief test log(time=60s)
"""
import sys
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.jenkinshelper import JenkinsExt
from ensae_teaching_cs.automation.jenkins_helper import setup_jenkins_server, default_jenkins_jobs
class TestJenkins(unittest.TestCase):... | mit | Python |
f663e7d00402106bbbcf0e0b111ca84689686ad6 | Remove trailing whitespace | gibbons/scikit-rf,hohe/scikit-rf,aerialist/scikit-rf,temmeand/scikit-rf,hohe/scikit-rf,willhaines/scikit-rf,scikit-rf/scikit-rf,Ttl/scikit-rf,Ttl/scikit-rf,scikit-rf/scikit-rf,aerialist/scikit-rf,hohe/scikit-rf,Ttl/scikit-rf,gibbons/scikit-rf,jhillairet/scikit-rf,jhillairet/scikit-rf,Ttl/scikit-rf,temmeand/scikit-rf,te... | skrf/io/__init__.py | skrf/io/__init__.py |
'''
.. module:: skrf.io
========================================
io (:mod:`skrf.io`)
========================================
This Package provides functions and objects for input/output.
The general functions :func:`~general.read` and :func:`~general.write`
can be used to read and write [almost] any skrf object to... |
'''
.. module:: skrf.io
========================================
io (:mod:`skrf.io`)
========================================
This Package provides functions and objects for input/output.
The general functions :func:`~general.read` and :func:`~general.write`
can be used to read and write [almost] any skrf object ... | bsd-3-clause | Python |
f6b4f638c27a669a00f47dd36a9f60407d221e4e | Update version to 0.7.4 for release | ayust/evelink | evelink/__init__.py | evelink/__init__.py | """EVELink - Python bindings for the EVE API."""
import logging
from evelink import account
from evelink import api
from evelink import char
from evelink import constants
from evelink import corp
from evelink import eve
from evelink import map
from evelink import server
__version__ = "0.7.4"
# Implement NullHandler... | """EVELink - Python bindings for the EVE API."""
import logging
from evelink import account
from evelink import api
from evelink import char
from evelink import constants
from evelink import corp
from evelink import eve
from evelink import map
from evelink import server
__version__ = "0.7.3"
# Implement NullHandler... | mit | Python |
ea57be49106307cfdbbcd1c435f9c062e22ab891 | Bump version | thombashi/sqliteschema | sqliteschema/__version__.py | sqliteschema/__version__.py | # encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright {}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.12.1"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| # encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright {}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.12.0"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| mit | Python |
890d95e071e48cfa19b1a1abdf3a26522b8e8293 | bump version | docker/python-dockercloud,docker/python-dockercloud,penkin/python-dockercloud,penkin/python-dockercloud | dockercloud/__init__.py | dockercloud/__init__.py | import base64
import logging
import os
import requests
from future.standard_library import install_aliases
install_aliases()
from dockercloud.api import auth
from dockercloud.api.service import Service
from dockercloud.api.container import Container
from dockercloud.api.repository import Repository
from dockercloud.... | import base64
import logging
import os
import requests
from future.standard_library import install_aliases
install_aliases()
from dockercloud.api import auth
from dockercloud.api.service import Service
from dockercloud.api.container import Container
from dockercloud.api.repository import Repository
from dockercloud.... | apache-2.0 | Python |
05270b71950b24338bf9a949910145e6cb32bd6a | Fix bibtex url | egonw/citeulike,egonw/citeulike,egonw/citeulike,egonw/citeulike,egonw/citeulike | plugins/python/jstatsoft.py | plugins/python/jstatsoft.py | #!/usr/bin/python
# parse a JstatSoft URL for CiteULike.org
# URL is expected to be of the form http:\/\/www\.jstatsoft\.org\/[a-z][0-9]+\/[a-z][0-9]+
# Append /bibtex to the url, parse out the bibtex and pass it on.
# Also parses the abstract if any and linkouts to the pdf and the original paper.
# C.Ladroue
import u... | #!/usr/bin/python
# parse a JstatSoft URL for CiteULike.org
# URL is expected to be of the form http:\/\/www\.jstatsoft\.org\/[a-z][0-9]+\/[a-z][0-9]+
# Append /bibtex to the url, parse out the bibtex and pass it on.
# Also parses the abstract if any and linkouts to the pdf and the original paper.
# C.Ladroue
import u... | bsd-3-clause | Python |
ab20fb46cf1afb4b59d40a7bd8aba6a29cdebb64 | Make pydoc quieter on error. | ahamilton/vigil,ahamilton/vigil,ahamilton/vigil,ahamilton/vigil,ahamilton/vigil,ahamilton/vigil,ahamilton/vigil,ahamilton/vigil,ahamilton/vigil | eris/pydoc_color.py | eris/pydoc_color.py | #!/usr/bin/env python3.7
# Copyright (C) 2019 Andrew Hamilton. All rights reserved.
# Licensed under the Artistic License 2.0.
import pydoc
import sys
import eris.termstr
class TermDoc(pydoc.TextDoc):
def bold(self, text):
return str(eris.termstr.TermStr(text).bold())
def main():
path = sys.arg... | #!/usr/bin/env python3.7
# Copyright (C) 2019 Andrew Hamilton. All rights reserved.
# Licensed under the Artistic License 2.0.
import pydoc
import sys
import eris.termstr
class TermDoc(pydoc.TextDoc):
def bold(self, text):
return str(eris.termstr.TermStr(text).bold())
def main():
path = sys.arg... | artistic-2.0 | Python |
312a65b14e2e12bc349876bdf32d9323d5a36d2e | Update notebooknets.py | picklecai/OMOOC2py,picklecai/OMOOC2py | _src/om2py3w/3wex0/notebooknets.py | _src/om2py3w/3wex0/notebooknets.py | # _*_coding:utf-8_*_
# 服务器端程序
from socket import *
import time
from os.path import exists
def main():
BUF_SIZE = 65565
ss = socket(AF_INET, SOCK_DGRAM)
ss_addr = ('127.0.0.1', 8800)
ss.bind(ss_addr)
while True:
print "waiting for data"
data, cs = ss.recvfrom(BUF_SIZE)... | # _*_coding:utf-8_*_
from socket import *
import time
from os.path import exists
def main():
BUF_SIZE = 65565
ss = socket(AF_INET, SOCK_DGRAM)
ss_addr = ('127.0.0.1', 8800)
ss.bind(ss_addr)
while True:
print "waiting for data"
data, cs = ss.recvfrom(BUF_SIZE)
pr... | mit | Python |
d1b5997cf731e9e331eb3339fa4327168568504b | Expand weighted classification example. | devdoer/theanets,lmjohns3/theanets,chrinide/theanets | examples/weighted-classification.py | examples/weighted-classification.py | import climate
import numpy as np
import sklearn.datasets
import sklearn.metrics
import theanets
climate.enable_default_logging()
samples, labels = sklearn.datasets.make_classification(
n_samples=10000,
n_features=100,
n_informative=30,
n_redundant=30,
n_repeated=0,
n_classes=2,
n_clusters... | import climate
import numpy as np
import sklearn.datasets
import theanets
climate.enable_default_logging()
samples, labels = sklearn.datasets.make_classification(
n_samples=1000,
n_features=20,
n_informative=10,
n_redundant=2,
n_repeated=0,
n_classes=2,
n_clusters_per_class=1,
weights=... | mit | Python |
97867e6d758f56690e6692660a3576a5bde50ae9 | Fix up migration | rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org | readthedocs/builds/migrations/0003_add-cold-storage.py | readthedocs/builds/migrations/0003_add-cold-storage.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.12 on 2017-10-04 17:27
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('builds', '0002_build_command_initial'),
]
operations = [
migrations.AddFiel... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.12 on 2017-10-04 17:27
from __future__ import unicode_literals
from django.db import migrations, models
import readthedocs.builds.version_slug
class Migration(migrations.Migration):
dependencies = [
('builds', '0002_build_command_initial'),
]
op... | mit | Python |
53bf3adf9d35f46b7cad88835a5f6047972bde58 | update example file | SiLab-Bonn/pyBAR_mimosa26_interpreter | examples/example.py | examples/example.py | '''Example how to use the M26 data interpreter. A hit table is created from raw data, additionally events are build using the TLU data words.
'''
import logging
from multiprocessing import Pool
from pyBAR_mimosa26_interpreter import data_interpreter
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(na... | ''' Example how to interpret raw data and how to histogram the hits.
'''
from pyBAR_mimosa26_interpreter import data_interpreter
raw_data_file = r''
# Example: How to use the interpretation class to convert a raw data tabe
with data_interpreter.DataInterpreter(raw_data_file) as raw_data_analysis:
raw_data_analys... | bsd-3-clause | Python |
3f2b81436735c75ab45dc8111969fba606307864 | Rewrite example code using the new contextmanager syntax | bjodah/PyLaTeX,ovaskevich/PyLaTeX,ovaskevich/PyLaTeX,JelteF/PyLaTeX,jendas1/PyLaTeX,jendas1/PyLaTeX,bjodah/PyLaTeX,sebastianhaas/PyLaTeX,votti/PyLaTeX,sebastianhaas/PyLaTeX,votti/PyLaTeX,JelteF/PyLaTeX | examples/example.py | examples/example.py | #!/usr/bin/python
import numpy as np
from pylatex import Document, Section, Subsection, Table, Math, TikZ, Axis, \
Plot, Figure, Package
from pylatex.numpy import Matrix
from pylatex.utils import italic, escape_latex
doc = Document()
doc.packages.append(Package('geometry', options=['tmargin=1cm',
... | #!/usr/bin/python
import numpy as np
from pylatex import Document, Section, Subsection, Table, Math, TikZ, Axis, \
Plot
from pylatex.numpy import Matrix
from pylatex.utils import italic
doc = Document()
section = Section('Yaay the first section, it can even be ' + italic('italic'))
section.append('Some regular ... | mit | Python |
f9f7b6fd3a723b841c34b2bb4d7f5ea199440b6d | add socket import | hepix-virtualisation/vmcaster | vmcasterpub/downloader_http.py | vmcasterpub/downloader_http.py | import downloader_base
import base64
import httplib
import socket
class downloader(downloader_base.downloader):
def __init__(self):
downloader_base.downloader.__init__(self)
self.port_default = 80
def requestAsString(self):
output = {'code' : 0}
auth = base64.standard_b64encode... | import downloader_base
import base64
import httplib
class downloader(downloader_base.downloader):
def __init__(self):
downloader_base.downloader.__init__(self)
self.port_default = 80
def requestAsString(self):
output = {'code' : 0}
auth = base64.standard_b64encode("%s:%s" % (se... | apache-2.0 | Python |
59152e38e79a5d109c55c7ed5215f852c564f8e3 | address needs to listen on 0.0.0.0 not 127.0.0.1 for docker | rafaeldelucena/waterbutler,chrisseto/waterbutler,RCOSDP/waterbutler,hmoco/waterbutler,cosenal/waterbutler,Johnetordoff/waterbutler,CenterForOpenScience/waterbutler,Ghalko/waterbutler,felliott/waterbutler,icereval/waterbutler,TomBaxter/waterbutler,kwierman/waterbutler,rdhyee/waterbutler | waterbutler/server/settings.py | waterbutler/server/settings.py | import hashlib
try:
from waterbutler.settings import SERVER_CONFIG
except ImportError:
SERVER_CONFIG = None
config = SERVER_CONFIG or {}
ADDRESS = config.get('ADDRESS', '0.0.0.0')
PORT = config.get('PORT', 7777)
DEBUG = config.get('DEBUG', True)
CHUNK_SIZE = config.get('CHUNK_SIZE', 65536) # 64KB
IDENTIT... | import hashlib
try:
from waterbutler.settings import SERVER_CONFIG
except ImportError:
SERVER_CONFIG = None
config = SERVER_CONFIG or {}
ADDRESS = config.get('ADDRESS', '127.0.0.1')
PORT = config.get('PORT', 7777)
DEBUG = config.get('DEBUG', True)
CHUNK_SIZE = config.get('CHUNK_SIZE', 65536) # 64KB
IDENT... | apache-2.0 | Python |
36fbbb8277a47b797bc98cb023db89ca3d009e17 | Rename Aldryn to Divio Cloud | aldryn/aldryn-client,aldryn/aldryn-client | divio_cli/messages.py | divio_cli/messages.py | SESSION_EXPIRED = 'Session expired. Please log in again.'
NETWORK_ERROR_MESSAGE = (
'Network error. Please check your connection and try again.'
)
AUTH_SERVER_ERROR = (
'A problem occured while trying to authenticate with divio.com. '
'Please try again later'
)
SERVER_ERROR = (
'A problem occured while ... | SESSION_EXPIRED = 'Session expired. Please log in again.'
NETWORK_ERROR_MESSAGE = (
'Network error. Please check your connection and try again.'
)
AUTH_SERVER_ERROR = (
'A problem occured while trying to authenticate with divio.com. '
'Please try again later'
)
SERVER_ERROR = (
'A problem occured while ... | bsd-3-clause | Python |
5a86986462e79da08c536b3a7e800650b2506640 | Add test | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/motech/tests/test_simple_post.py | corehq/motech/tests/test_simple_post.py | import logging
from unittest.mock import patch
import requests
from nose.tools import assert_equal
from corehq.motech.auth import BasicAuthManager
from corehq.motech.const import REQUEST_TIMEOUT
from corehq.motech.models import RequestLog
from corehq.motech.requests import Requests, simple_post
TEST_DOMAIN = 'pet-sh... | import logging
from unittest.mock import patch
import requests
from nose.tools import assert_equal
from corehq.motech.auth import BasicAuthManager
from corehq.motech.const import REQUEST_TIMEOUT
from corehq.motech.models import RequestLog
from corehq.motech.requests import simple_post
TEST_DOMAIN = 'pet-shop'
TEST_A... | bsd-3-clause | Python |
3144fac7e9bc938f9eabc3f90fac6acdbaa89ab1 | Fix bug in chain creation | dpaleino/pollirio,dpaleino/pollirio | pollirio/reactors/markov.py | pollirio/reactors/markov.py | # -*- coding: utf-8 -*-
from pollirio.reactors import expose
from pollirio import conf, choose_dest
import random
def create_chains(lines):
markov_chain = {}
has_prev = False
for line in lines:
for cur_word in line.split():
if cur_word != '':
cur_word = cur_word.lower(... | # -*- coding: utf-8 -*-
from pollirio.reactors import expose
from pollirio import conf, choose_dest
import random
def create_chains(lines):
markov_chain = {}
hasPrev = False
for line in lines:
for curword in line.split():
if curword != '':
curword = curword.lower()
... | mit | Python |
5a972cb0888a42eb4741c3131e97465c14401785 | Fix fonts URL/route | cuducos/findaconf,koorukuroo/findaconf,cuducos/findaconf,koorukuroo/findaconf,cuducos/findaconf,koorukuroo/findaconf | findaconf/blueprints/files/views.py | findaconf/blueprints/files/views.py | # coding: utf-8
from cairosvg import svg2png
from colour import Color
from flask import (
abort, Blueprint, send_from_directory, render_template, Response
)
from findaconf import app
from random import choice, randrange
files_blueprint = Blueprint('file_routes', __name__, static_folder='')
@files_blueprint.rou... | # coding: utf-8
from cairosvg import svg2png
from colour import Color
from flask import (
abort, Blueprint, send_from_directory, render_template, Response
)
from findaconf import app
from random import choice, randrange
files_blueprint = Blueprint('file_routes', __name__, static_folder='')
@files_blueprint.rou... | mit | Python |
1fda9aacc2ad966697a444d4e09e8064d2b03f46 | fix textbox example | lawsie/guizero,lawsie/guizero,lawsie/guizero | examples/textbox.py | examples/textbox.py | from guizero import App, TextBox, PushButton, Text, info
from tkinter.font import Font
def go():
info("hi", "hi " + textbox.value)
def key_pressed(key):
print("key pressed {}".format(key))
print("value = {}".format(textbox.value))
app = App()
text = Text(app, text="Enter your name")
textbox = TextBox(app... | from guizero import App, TextBox, PushButton, Text, alerts
from tkinter.font import Font
def go():
alerts.info("hi", "hi " + textbox.value)
def key_pressed(key):
print("key pressed {}".format(key))
print("value = {}".format(textbox.value))
app = App()
text = Text(app, text="Enter your name")
textbox = Te... | bsd-3-clause | Python |
ccaebf9059fac3e79575d33b618ba397a9c26a22 | update caps test | bird-house/flyingpigeon | flyingpigeon/tests/test_wps_caps.py | flyingpigeon/tests/test_wps_caps.py | import pytest
from pywps import Service
from pywps.tests import assert_response_success
from .common import client_for
from flyingpigeon.processes import processes
def test_caps():
client = client_for(Service(processes=processes))
resp = client.get(service='wps', request='getcapabilities', version='1.0.0')
... | import pytest
from pywps import Service
from pywps.tests import assert_response_success
from .common import client_for
from flyingpigeon.processes import processes
def test_caps():
client = client_for(Service(processes=processes))
resp = client.get(service='wps', request='getcapabilities', version='1.0.0')
... | apache-2.0 | Python |
325283be47a2ae8bc3ab86c72b17f6222520ad4b | Fix linting issues | masschallenge/django-accelerator,masschallenge/django-accelerator | accelerator/migrations/0019_add_deferred_user_role.py | accelerator/migrations/0019_add_deferred_user_role.py | # Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = apps.get_model('... | # Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = apps.get_model('... | mit | Python |
e9bfe96cb3463fe99f08305aab44bd3d7556825a | Add managed roles to serializer | renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar | api/radar_api/serializers/group_users.py | api/radar_api/serializers/group_users.py | from radar_api.serializers.groups import GroupReferenceField
from radar_api.serializers.meta import MetaSerializerMixin
from radar_api.serializers.user_mixins import UserSerializerMixin
from radar.models.groups import GroupUser
from radar.roles import ROLE, ROLE_NAMES
from radar.serializers.fields import ListField, Str... | from radar_api.serializers.groups import GroupReferenceField
from radar_api.serializers.meta import MetaSerializerMixin
from radar_api.serializers.user_mixins import UserSerializerMixin
from radar.models.groups import GroupUser
from radar.roles import ROLE, ROLE_NAMES
from radar.serializers.fields import ListField, Str... | agpl-3.0 | Python |
2498d5bb6e041ecb8947c4d75e640133aaf9b7a4 | Remove "to" field from summary command | Gentux/imap-cli,Gentux/imap-cli | examples/summary.py | examples/summary.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Use IMAP CLI to gt a summary of IMAP account state."""
import argparse
import getpass
import logging
import os
import sys
from imap_cli import config
from imap_cli.imap import connection
from imap_cli.imap import directories
from imap_cli.imap import search
from im... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Use IMAP CLI to gt a summary of IMAP account state."""
import argparse
import getpass
import logging
import os
import sys
from imap_cli import config
from imap_cli.imap import connection
from imap_cli.imap import directories
from imap_cli.imap import search
from im... | mit | Python |
a5cea50d7a14e14323ac57246b200a1cc763dc0b | Add class for language and reference to it from Exercise | rolandgeider/wger,petervanderdoes/wger,kjagoo/wger_stark,kjagoo/wger_stark,DeveloperMal/wger,kjagoo/wger_stark,rolandgeider/wger,kjagoo/wger_stark,DeveloperMal/wger,petervanderdoes/wger,rolandgeider/wger,petervanderdoes/wger,wger-project/wger,DeveloperMal/wger,wger-project/wger,wger-project/wger,DeveloperMal/wger,rolan... | exercises/models.py | exercises/models.py | # This file is part of Workout Manager.
#
# Foobar 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 option) any later version.
#
# Workout Manager is dist... | # This file is part of Workout Manager.
#
# Foobar 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 option) any later version.
#
# Workout Manager is dist... | agpl-3.0 | Python |
d348a0e7bddf74d74a72bf536c126b7774d9e027 | fix bug in forna_db where young entries are deleted. also make some entries static by hand | pkerpedjiev/forna,pkerpedjiev/forna,pkerpedjiev/forna | forna_db.py | forna_db.py | #!/usr/bin/python
"""forna_db.py: A script for storing forna sessions in a database and retrieve
a unique hash for sharing via link."""
__author__ = "Stefan Hammer"
__copyright__ = "Copyright 2015"
__version__ = "0.1"
__maintainer__ = "Stefan Hammer"
__email__ = "jango@tbi.univie.ac.at"
import uuid
import sqlite3
im... | #!/usr/bin/python
"""forna_db.py: A script for storing forna sessions in a database and retrieve
a unique hash for sharing via link."""
__author__ = "Stefan Hammer"
__copyright__ = "Copyright 2015"
__version__ = "0.1"
__maintainer__ = "Stefan Hammer"
__email__ = "jango@tbi.univie.ac.at"
import json
import math
impor... | apache-2.0 | Python |
bddc4cf3ef288fa093141b55d6e68ddf95f17918 | Enforce SSL verification, abort if certificates are not valid. | painfulcranium/dnsmadeeasy_ddns_updater,wyrmiyu/ddns-tools | dnsmadeeasy/update_ddns_dnsmadeeasy.py | dnsmadeeasy/update_ddns_dnsmadeeasy.py | #!/usr/bin/env python
#
# Script to update dynamic DNS records at Dnsmadeeasy with HTTPS support.
# Change globs to reflect your settings and set to run from cron.
#
# Requires following non-core modules;
# * python-requests, https://pypi.python.org/pypi/requests/
# * python-dns, https://pypi.python.org/pypi/dnspytho... | #!/usr/bin/env python
#
# Script to update dynamic DNS records at Dnsmadeeasy with HTTPS support.
# Change globs to reflect your settings and set to run from cron.
#
# Requires following non-core modules;
# * python-requests, https://pypi.python.org/pypi/requests/
# * python-dns, https://pypi.python.org/pypi/dnspytho... | mit | Python |
7ed5702b2f144919d1955edfe7b63c5e51cc34b4 | Create the library directory at need, should make publishing more reliable. re #537 | NProfileAnalysisComputationalTool/npact,victor-lin/npact,NProfileAnalysisComputationalTool/npact,NProfileAnalysisComputationalTool/npact,NProfileAnalysisComputationalTool/npact,victor-lin/npact,victor-lin/npact,NProfileAnalysisComputationalTool/npact,victor-lin/npact,victor-lin/npact | spatweb/__init__.py | spatweb/__init__.py | import logging
import os.path
from django.conf import settings
logger = logging.getLogger(__name__)
logger.info("Starting the main spat site.")
def library_root() :
abspath = getabspath("library",False)
if not os.path.exists(abspath):
logger.info("Creating library root at %s", abspath)
os.... | import logging
import os.path
from django.conf import settings
logger = logging.getLogger(__name__)
logger.info("Starting the main spat site.")
def library_root() :
return getabspath("library")
def getrelpath(abspath):
return os.path.relpath(abspath, settings.MEDIA_ROOT)
def is_clean_path(path) :
r... | bsd-3-clause | Python |
835c9b45f3fdb03aba77f488fcd43d9b2b348f57 | Fix another import for 3.2 | cnelsonsic/cardscript | cardscript/__init__.py | cardscript/__init__.py | from .cardscript import *
| from cardscript import *
| agpl-3.0 | Python |
701cc98043982ab23f038ce9b5bce4fbda73e8f7 | Update __init__.py | celery/cell,celery/cell | cell/utils/__init__.py | cell/utils/__init__.py | """cl.utils"""
from __future__ import absolute_import
import operator
from collections import namedtuple
from kombu.five import map, zip
from kombu.utils import cached_property, symbol_by_name # noqa
__all__ = ['force_list', 'flatten',
'instantiate', 'cached_property']
def enum(**alt):
keys, valu... | """cl.utils"""
from __future__ import absolute_import
import operator
from collections import namedtuple
from kombu.five import map, filter, zip
from kombu.utils import cached_property, symbol_by_name # noqa
__all__ = ['force_list', 'flatten',
'instantiate', 'cached_property']
def enum(**alt):
ke... | bsd-3-clause | Python |
3776eccc4b3ed9cc8dfe493954ef0472f56bb98e | add a new version, 1.0rc2 (#12966) | iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack | var/spack/repos/builtin/packages/bolt/package.py | var/spack/repos/builtin/packages/bolt/package.py | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Bolt(CMakePackage):
"""BOLT targets a high-performing OpenMP implementation,
especiall... | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Bolt(CMakePackage):
"""BOLT targets a high-performing OpenMP implementation,
especiall... | lgpl-2.1 | Python |
27de2a42d9d3b0f572c37a6ce1612b7df9855240 | Update Flex to 2.6.0 | mfherbst/spack,lgarren/spack,TheTimmy/spack,EmreAtes/spack,tmerrick1/spack,EmreAtes/spack,skosukhin/spack,matthiasdiener/spack,lgarren/spack,krafczyk/spack,TheTimmy/spack,matthiasdiener/spack,iulian787/spack,iulian787/spack,iulian787/spack,tmerrick1/spack,skosukhin/spack,EmreAtes/spack,LLNL/spack,mfherbst/spack,LLNL/sp... | var/spack/repos/builtin/packages/flex/package.py | var/spack/repos/builtin/packages/flex/package.py | from spack import *
class Flex(Package):
"""Flex is a tool for generating scanners."""
homepage = "http://flex.sourceforge.net/"
url = "http://download.sourceforge.net/flex/flex-2.5.39.tar.gz"
version('2.6.0', '5724bcffed4ebe39e9b55a9be80859ec')
version('2.5.39', 'e133e9ead8ec0a58d81166b4612... | from spack import *
class Flex(Package):
"""Flex is a tool for generating scanners."""
homepage = "http://flex.sourceforge.net/"
url = "http://download.sourceforge.net/flex/flex-2.5.39.tar.gz"
version('2.5.39', 'e133e9ead8ec0a58d81166b461244fde')
def install(self, spec, prefix):
con... | lgpl-2.1 | Python |
95ca99bbdd8edb059801b31b0ddeb9522c4de7b3 | add version 2.2.0 (#9086) | iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack | var/spack/repos/builtin/packages/htop/package.py | var/spack/repos/builtin/packages/htop/package.py | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | Python |
e2da68086bfc2b8b8ef6b9e3906879fdbef22a0a | Use DJANGO_SETTINGS_MODULE if it is defined by the environment. | PrecisionMojo/pm-www,PrecisionMojo/pm-www | fabfile/settings.py | fabfile/settings.py | """Settings used throughout the fabfile."""
import os
from fabric.api import abort, cd
from fabric.contrib import django
_fabfile_root = os.path.dirname(os.path.abspath(__file__))
def _find_site_root(project_root):
for entry in os.listdir(project_root):
site_root = os.path.join(project_root, entry)
... | """Settings used throughout the fabfile."""
import os
from fabric.api import abort, cd
from fabric.contrib import django
_fabfile_root = os.path.dirname(os.path.abspath(__file__))
def _find_site_root(project_root):
for entry in os.listdir(project_root):
site_root = os.path.join(project_root, entry)
... | mit | Python |
6cc877c7228289bdde3bef246cfd55e902c8c624 | Update all drivers | benchalmers/win-installer,benchalmers/win-installer,OwenSmith/win-installer,benchalmers/win-installer,kostaslamda/win-installer,xenserver/win-installer,kostaslamda/win-installer,OwenSmith/win-installer,kostaslamda/win-installer,benchalmers/win-installer,xenserver/win-installer,xenserver/win-installer,OwenSmith/win-inst... | manifestspecific.py | manifestspecific.py | # Copyright (c) Citrix Systems Inc.
# 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 conditions a... | # Copyright (c) Citrix Systems Inc.
# 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 conditions a... | bsd-2-clause | Python |
ec2da8ffb0edb17a1c0e18f5492339aca5c9d7e8 | Set developer mutator when you really are a developer and not vice versa. | SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange | app/soc/modules/gsoc/views/base.py | app/soc/modules/gsoc/views/base.py | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange 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 applic... | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange 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 applic... | apache-2.0 | Python |
9b4ef6a11d6a9dd9d25d85f2613260e25547afae | Revert 7.2 drivers - return to 7.1 WHQL driverset | OwenSmith/win-installer,OwenSmith/win-installer,xenserver/win-installer,xenserver/win-installer,xenserver/win-installer,xenserver/win-installer,OwenSmith/win-installer,OwenSmith/win-installer,OwenSmith/win-installer,xenserver/win-installer | manifestspecific.py | manifestspecific.py | # Copyright (c) Citrix Systems Inc.
# 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 conditions a... | # Copyright (c) Citrix Systems Inc.
# 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 conditions a... | bsd-2-clause | Python |
e6dad90b8b411f9c23637492cee622e741df79e1 | bump version for alpha2 | printedheart/micropsi2,ianupright/micropsi2,printedheart/micropsi2,ianupright/micropsi2,ianupright/micropsi2,printedheart/micropsi2 | configuration.py | configuration.py | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
"""
Contains basic configuration information, especially path names to resource files
"""
__author__ = 'joscha'
__date__ = '03.12.12'
import os
import configparser
import warnings
try:
config = configparser.ConfigParser()
config.read_file(open('config.ini'))
e... | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
"""
Contains basic configuration information, especially path names to resource files
"""
__author__ = 'joscha'
__date__ = '03.12.12'
import os
import configparser
import warnings
try:
config = configparser.ConfigParser()
config.read_file(open('config.ini'))
e... | mit | Python |
ed4817b86914260b3b5948cbb81e4ba3d5b1d0e6 | Add basic time tracking functions | bnose/cli | bnose.py | bnose.py | import stat
import os
import click
import requests
BOTTLENOSE_API_URL = 'http://127.0.0.1:8000/api/'
def has_valid_permissions(path):
perm = oct(stat.S_IMODE(os.lstat(path).st_mode))
return perm == oct(0o600)
def get_token():
try:
tokenfile = os.path.join(os.environ['HOME'], '.bnose')
... | import click
import requests
BOTTLENOSE_AUTH_TOKEN = '5a5da3a959fa2cf23105d0fe24efe5fb3116aee4' # test token
BOTTLENOSE_API_URL = 'http://127.0.0.1:8000/api/'
headers = {
'Authorization': f'Token {BOTTLENOSE_AUTH_TOKEN}'
}
print(headers)
@click.group()
def cli():
pass
@cli.command()
def login():
clic... | apache-2.0 | Python |
8145f922aa5569f667252453c8509d9e116745f6 | Add log_errors flag to _execute | miki725/flake8-diff,dealertrack/flake8-diff | flake8diff/utils.py | flake8diff/utils.py | from __future__ import unicode_literals, print_function
import logging
import subprocess
logger = logging.getLogger(__name__)
def _execute(cmd, strict=False, log_errors=True):
"""
Make executing a command locally a little less painful
"""
logger.debug("executing {0}".format(cmd))
process = subpr... | from __future__ import unicode_literals, print_function
import logging
import subprocess
logger = logging.getLogger(__name__)
def _execute(cmd, strict=False):
"""
Make executing a command locally a little less painful
"""
logger.debug("executing {0}".format(cmd))
process = subprocess.Popen(cmd,
... | mit | Python |
f01841e5b3fb9fe6a4f30b15dbf12146971d1b6f | Use app request context directly rather than hacking with a test client | ramnes/flask-aggregator | flask_aggregator.py | flask_aggregator.py | import json
from flask import request, Request, Response
from werkzeug.exceptions import BadRequest
from werkzeug.test import EnvironBuilder
class Aggregator(object):
def __init__(self, app=None, endpoint=None):
self.url_map = {}
self.endpoint = endpoint or "/aggregator"
if app:
... | import json
from flask import request as current_request, Response
from werkzeug.exceptions import BadRequest
class Aggregator(object):
def __init__(self, app=None, endpoint=None):
self.url_map = {}
self.endpoint = endpoint or "/aggregator"
if app:
self.init_app(app)
def... | mit | Python |
c5db08ed34eede9d0b1c059386acaa98b078f1a7 | Revert "Fixed Graph: prepare function should work without semiring" | char-lie/mfm,char-lie/patterns_recognition,char-lie/mfm,char-lie/mfm,char-lie/patterns_recognition | classes/graph/Graph.py | classes/graph/Graph.py | from Edge import Edge
from Vertex import Vertex
class Graph(object):
def __init__(self, V, E):
if isinstance(V, Vertex):
V = set([V])
elif not isinstance(V, set):
V = set(V)
if isinstance(E, Edge):
E = set([E])
elif not isinstance(E, set):
... | from Edge import Edge
from Vertex import Vertex
class Graph(object):
def __init__(self, V, E):
if isinstance(V, Vertex):
V = set([V])
elif not isinstance(V, set):
V = set(V)
if isinstance(E, Edge):
E = set([E])
elif not isinstance(E, set):
... | mit | Python |
47e21574576224ce988d8f9b69a7bd7b61e15248 | Prepare v2.18.14.dev | Flexget/Flexget,Flexget/Flexget,JorisDeRieck/Flexget,tobinjt/Flexget,malkavi/Flexget,Flexget/Flexget,gazpachoking/Flexget,Flexget/Flexget,Danfocus/Flexget,Danfocus/Flexget,gazpachoking/Flexget,JorisDeRieck/Flexget,crawln45/Flexget,tobinjt/Flexget,Danfocus/Flexget,ianstalk/Flexget,JorisDeRieck/Flexget,tobinjt/Flexget,cr... | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
9cd7fc1f4f612620822e778011dd948e2eae8e86 | Prepare v2.3.1.dev | qk4l/Flexget,tobinjt/Flexget,Danfocus/Flexget,dsemi/Flexget,jawilson/Flexget,crawln45/Flexget,malkavi/Flexget,Flexget/Flexget,drwyrm/Flexget,LynxyssCZ/Flexget,JorisDeRieck/Flexget,OmgOhnoes/Flexget,malkavi/Flexget,JorisDeRieck/Flexget,Flexget/Flexget,ianstalk/Flexget,jawilson/Flexget,LynxyssCZ/Flexget,jacobmetrick/Flex... | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
22310fd2dd02abc4af884c067373ca6df664c567 | remove downward movement check from is_moving_towards_our_goal | RoboJackets/robocup-software,JNeiger/robocup-software,JNeiger/robocup-software,RoboJackets/robocup-software,JNeiger/robocup-software,JNeiger/robocup-software,RoboJackets/robocup-software,JNeiger/robocup-software,RoboJackets/robocup-software | soccer/gameplay/tests/test_ball.py | soccer/gameplay/tests/test_ball.py | import unittest
import main
import robocup
import evaluation.field
import constants
class Moc_Ball:
def __init__(self, x, y):
self.pos = robocup.Point(x, y)
self.vel = robocup.Point(0, 0)
def set_pos(self, x, y):
self.pos = robocup.Point(x, y)
def set_vel(self, x, y):
self.vel = robocup.Point(x, y)
class... | import unittest
import main
import robocup
import evaluation.field
import constants
class Moc_Ball:
def __init__(self, x, y):
self.pos = robocup.Point(x, y)
self.vel = robocup.Point(x, y)
def set_pos(self, x, y):
self.pos = robocup.Point(x, y)
def set_vel(self, x, y):
self.vel = robocup.Point(x, y)
class... | apache-2.0 | Python |
b80d14c4de2f76fd0ee2fcdb5040dc9de8a842e8 | format plaintext emails as html | exsodus3249/kite,exsodus3249/kite,exsodus3249/kite,exsodus3249/kite,exsodus3249/kite | src/back/kite/maildir.py | src/back/kite/maildir.py | import mailbox
import quopri
import email.utils
import lxml.html.clean
import re
def read_mail(path):
mdir = mailbox.Maildir(path)
return mdir
def extract_email_headers(msg):
"""Extract headers from email"""
msg_obj = {}
msg_obj["from"] = {}
from_field = msg.getheaders('From')[0]
msg_obj[... | import mailbox
import quopri
import email.utils
import lxml.html.clean
import re
def read_mail(path):
mdir = mailbox.Maildir(path)
return mdir
def extract_email_headers(msg):
"""Extract headers from email"""
msg_obj = {}
msg_obj["from"] = {}
from_field = msg.getheaders('From')[0]
msg_obj[... | bsd-3-clause | Python |
f17921e4565bb16a09d88b5b8dfcef9ec25f5bbc | Remove InstallCommand from setup.in.py. | hsorby/libcellml,nickerso/libcellml,nickerso/libcellml,cellml/libcellml,hsorby/libcellml,cellml/libcellml,cellml/libcellml,nickerso/libcellml,nickerso/libcellml,hsorby/libcellml,cellml/libcellml,hsorby/libcellml | src/bindings/python/setup.in.py | src/bindings/python/setup.in.py | """ libCellML Library: A library for the parsing, printing, and manipulation
of CellML 2.0 compliant models.
"""
classifiers = """\
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
Intended Audience :: Education
Intended Audience :: Science/Research
License :: OSI Approved :: Apache Softwar... | """ libCellML Library: A library for the parsing, printing, and manipulation
of CellML 2.0 compliant models.
"""
classifiers = """\
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
Intended Audience :: Education
Intended Audience :: Science/Research
License :: OSI Approved :: Apache Softwar... | apache-2.0 | Python |
6385a0d1e94f412b7d36b8f8b8609da6ac1ba19d | return on shlex split failure | fsufitch/discord-boar-bot,fsufitch/discord-boar-bot | src/boarbot/common/botmodule.py | src/boarbot/common/botmodule.py | import discord
import shlex
from abc import ABCMeta, abstractmethod
from boarbot.common.events import EventType
from boarbot.common.log import LOGGER
class BotModule(metaclass=ABCMeta):
def __init__(self, client: discord.Client):
self.client = client
@abstractmethod
async def handle_event(self, e... | import discord
import shlex
from abc import ABCMeta, abstractmethod
from boarbot.common.events import EventType
from boarbot.common.log import LOGGER
class BotModule(metaclass=ABCMeta):
def __init__(self, client: discord.Client):
self.client = client
@abstractmethod
async def handle_event(self, e... | mit | Python |
37b8b19c3429cdbdd83b6e02cb323a01829a1200 | Fix "remote in target" | anthraxx/pwndbg,chubbymaggie/pwndbg,pwndbg/pwndbg,0xddaa/pwndbg,cebrusfs/217gdb,anthraxx/pwndbg,disconnect3d/pwndbg,cebrusfs/217gdb,disconnect3d/pwndbg,pwndbg/pwndbg,pwndbg/pwndbg,cebrusfs/217gdb,anthraxx/pwndbg,0xddaa/pwndbg,0xddaa/pwndbg,pwndbg/pwndbg,zachriggle/pwndbg,anthraxx/pwndbg,disconnect3d/pwndbg,chubbymaggie... | pwndbg/remote.py | pwndbg/remote.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Information about whether the debuggee is local (under GDB) or remote
(under GDBSERVER or QEMU stub).
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import gdb
d... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Information about whether the debuggee is local (under GDB) or remote
(under GDBSERVER or QEMU stub).
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import gdb
d... | mit | Python |
892a9249a9f3f4574485b5625532242ef87edf78 | Remove comments from pwny/__init__.py | sigma-random/pwnypack,edibledinos/pwnypack,sigma-random/pwnypack,edibledinos/pwnypack | pwny/__init__.py | pwny/__init__.py | from pwnypack.target import *
from pwnypack.packing import *
from pwnypack.util import *
from pwnypack.flow import *
from pwnypack.asm import *
from pwnypack.elf import *
from pwnypack.codec import *
from pwnypack.shell import *
from pwnypack.rop import *
| # Convenience package that imports useful stuff into
# a single namespace.
from pwnypack.target import *
from pwnypack.packing import *
from pwnypack.util import *
from pwnypack.flow import *
from pwnypack.asm import *
from pwnypack.elf import *
from pwnypack.codec import *
from pwnypack.shell import *
from pwnypack.r... | mit | Python |
69baf68b436255eca71ec63578a2fdef4bc03165 | Add function which divide text to paragraphs | sanchopanca/reader,sanchopanca/reader | books.py | books.py | import falcon
def get_paragraphs(pathname):
result = []
with open(pathname) as f:
for line in f.readlines():
if line != '\n':
result.append(line[:-1])
return result
class BooksResource:
def on_get(self, req, resp):
resp.status = falcon.HTTP_200
res... | import falcon
class BooksResource:
def on_get(self, req, resp):
resp.status = falcon.HTTP_200
resp.body = open('/home/sanchopanca/Documents/thunder.txt').read()
app = falcon.API()
books = BooksResource()
app.add_route('/books', books)
| agpl-3.0 | Python |
5c8780c1f4ba914f20f0dc022cc26becb381f2f1 | Revert "Allow widget overwriting on form field" | moccu/django-markymark,moccu/django-markymark,moccu/django-markymark | markymark/fields.py | markymark/fields.py | from django import forms
from django.db import models
from .widgets import MarkdownTextarea
class MarkdownFormField(forms.fields.CharField):
def __init__(self, *args, **kwargs):
kwargs['widget'] = MarkdownTextarea
super(MarkdownFormField, self).__init__(*args, **kwargs)
class MarkdownField(mode... | from django import forms
from django.db import models
from .widgets import MarkdownTextarea
class MarkdownFormField(forms.fields.CharField):
def __init__(self, *args, **kwargs):
kwargs['widget'] = kwargs.pop('widget', MarkdownTextarea)
super(MarkdownFormField, self).__init__(*args, **kwargs)
cl... | mit | Python |
3330678d6474a876e2d18edce995bd82ba027472 | Handle symbolic refs in .git/HEAD | xmms2/xmms2-stable,dreamerc/xmms2,oneman/xmms2-oneman,xmms2/xmms2-stable,chrippa/xmms2,theefer/xmms2,oneman/xmms2-oneman-old,six600110/xmms2,mantaraya36/xmms2-mantaraya36,mantaraya36/xmms2-mantaraya36,mantaraya36/xmms2-mantaraya36,chrippa/xmms2,theeternalsw0rd/xmms2,krad-radio/xmms2-krad,theeternalsw0rd/xmms2,oneman/xm... | gittools.py | gittools.py | import os
import sha
def gitsha(path):
h = sha.sha()
data = file(path).read()
h.update("blob %d\0" % len(data))
h.update(data)
return h.hexdigest()
def git_info():
commithash = file('.git/HEAD').read().strip()
if commithash.startswith("ref: "):
commithash = file(commithash[5:]).rea... | import os
import sha
def gitsha(path):
h = sha.sha()
data = file(path).read()
h.update("blob %d\0" % len(data))
h.update(data)
return h.hexdigest()
def git_info():
commithash = file('.git/HEAD').read().strip()
if os.getuid() == os.stat(".git/index").st_uid:
os.system('git-update-in... | lgpl-2.1 | Python |
944a74046d1d7072dd13fb774023c2721024d017 | bump version | ImmobilienScout24/cfn-sphere,cfn-sphere/cfn-sphere,marco-hoyer/cfn-sphere,cfn-sphere/cfn-sphere,cfn-sphere/cfn-sphere | build.py | build.py | from pybuilder.core import use_plugin, init, Author
use_plugin("python.core")
use_plugin("python.unittest")
use_plugin("python.integrationtest")
use_plugin("python.install_dependencies")
use_plugin("python.flake8")
use_plugin("python.coverage")
use_plugin("python.distutils")
use_plugin('copy_resources')
name = "cfn-s... | from pybuilder.core import use_plugin, init, Author
use_plugin("python.core")
use_plugin("python.unittest")
use_plugin("python.integrationtest")
use_plugin("python.install_dependencies")
use_plugin("python.flake8")
use_plugin("python.coverage")
use_plugin("python.distutils")
use_plugin('copy_resources')
name = "cfn-s... | apache-2.0 | Python |
25b8199d7d2b53efb5eb83b2e80e5a41353454a8 | refactor init package | Aiacos/DevPyLib | mayaLib/__init__.py | mayaLib/__init__.py | import mayaLib.guiLib
import mayaLib.rigLib
import mayaLib.shaderLib
import mayaLib.utility | import guiLib
import rigLib
import shaderLib
import utility | agpl-3.0 | Python |
03671a01cb5ea359c22e954a8381bbfd30bce094 | Complete naive solution by nested for loops | bowen0701/algorithms_data_structures | lc560_subarray_sum_equals_k.py | lc560_subarray_sum_equals_k.py | """560. Subarray Sum Equals K
Medium
Given an array of integers and an integer k, you need to find the total
number of continuous subarrays whose sum equals to k.
Example 1:
Input: nums = [1,1,1], k = 2
Output: 2
Note:
The length of the array is in range [1, 20,000].
The range of numbers in the array is [-1000, 100... | """560. Subarray Sum Equals K
Medium
Given an array of integers and an integer k, you need to find the total
number of continuous subarrays whose sum equals to k.
Example 1:
Input: nums = [1,1,1], k = 2
Output: 2
Note:
The length of the array is in range [1, 20,000].
The range of numbers in the array is [-1000, 100... | bsd-2-clause | Python |
5888c3aa5e6116dbb8b3ab17c1b4eec3dd95b0b6 | fix test util | biojppm/cmany,biojppm/cmany,biojppm/cmany | src/c4/cmany/test/test00util.py | src/c4/cmany/test/test00util.py | #!/usr/bin/env python3
import unittest as ut
import c4.cmany.util as util
import sys
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------... | #!/usr/bin/env python3
import unittest as ut
import c4.cmany.util as util
import sys
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------... | mit | Python |
66f5b41555fa054601a5228a8b1df331a178f565 | Set version to 0.3.0 | toirl/cointrader | cointrader/__init__.py | cointrader/__init__.py | # -*- coding: utf-8 -*-
import sqlalchemy as sa
from sqlalchemy.ext.declarative import declarative_base
__author__ = """Torsten Irländer"""
__email__ = 'torsten.irlaender@googlemail.com'
__version__ = '0.3.0'
Base = declarative_base()
engine = sa.create_engine('sqlite:///cointrader.db')
Session = sa.orm.sessionmaker... | # -*- coding: utf-8 -*-
import sqlalchemy as sa
from sqlalchemy.ext.declarative import declarative_base
__author__ = """Torsten Irländer"""
__email__ = 'torsten.irlaender@googlemail.com'
__version__ = '0.1.0'
Base = declarative_base()
engine = sa.create_engine('sqlite:///cointrader.db')
Session = sa.orm.sessionmaker... | mit | Python |
4d4544f6b7f35e6e66c57d335a8feafae8a8a0b9 | Remove import error. | soasme/flask-perm,soasme/flask-perm,soasme/flask-perm | flask_perm/admin.py | flask_perm/admin.py | # -*- coding: utf-8 -*-
from flask import Blueprint, render_template, current_app, url_for, redirect, request, flash
bp = Blueprint('perm-admin', __name__, template_folder='templates', static_folder='static')
@bp.route('/')
def index():
if not bp.perm.has_perm_admin_logined():
return redirect(url_for('pe... | # -*- coding: utf-8 -*-
from flask import Blueprint, render_template, current_app, abort, url_for, redirect, request, flash
from flask_login import login_user, logout_user
bp = Blueprint('perm-admin', __name__, template_folder='templates', static_folder='static')
@bp.route('/')
def index():
if not bp.perm.has_pe... | mit | Python |
fac5c8c6df2831f0af4558bf2e885989451f30c8 | Prepare v2.3.40.dev | ianstalk/Flexget,poulpito/Flexget,sean797/Flexget,tobinjt/Flexget,Danfocus/Flexget,qk4l/Flexget,malkavi/Flexget,Flexget/Flexget,JorisDeRieck/Flexget,qk4l/Flexget,LynxyssCZ/Flexget,drwyrm/Flexget,JorisDeRieck/Flexget,tobinjt/Flexget,poulpito/Flexget,ianstalk/Flexget,LynxyssCZ/Flexget,Danfocus/Flexget,JorisDeRieck/Flexge... | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
402f6fb9410c5878f6177d8ed12166f273eab6d0 | 修复在virtualenv环境下无法通过./cobra.py执行的问题 | wufeifei/cobra,40huo/cobra,LiGhT1EsS/cobra,40huo/cobra,40huo/cobra,LiGhT1EsS/cobra,braveghz/cobra,wufeifei/cobra,40huo/cobra,braveghz/cobra,wufeifei/cobra,wufeifei/cobra,40huo/cobra,LiGhT1EsS/cobra,wufeifei/cobra,braveghz/cobra,40huo/cobra,wufeifei/cobra,braveghz/cobra,braveghz/cobra,LiGhT1EsS/cobra,LiGhT1EsS/cobra,bra... | cobra.py | cobra.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import sys
from cobra import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
| #!/usr/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from cobra import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
| mit | Python |
5b32aedd6598273d4220b00724e57dcb0c5629b8 | Prepare v1.2.487.dev | JorisDeRieck/Flexget,OmgOhnoes/Flexget,oxc/Flexget,qk4l/Flexget,antivirtel/Flexget,jacobmetrick/Flexget,oxc/Flexget,poulpito/Flexget,LynxyssCZ/Flexget,qvazzler/Flexget,tarzasai/Flexget,crawln45/Flexget,tobinjt/Flexget,Flexget/Flexget,crawln45/Flexget,tobinjt/Flexget,Pretagonist/Flexget,LynxyssCZ/Flexget,LynxyssCZ/Flexg... | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
07eae42a52ad5b9ed9a60b9addae08c3e8d72ba4 | Prepare v2.1.14.dev | sean797/Flexget,malkavi/Flexget,malkavi/Flexget,poulpito/Flexget,tarzasai/Flexget,malkavi/Flexget,ianstalk/Flexget,ianstalk/Flexget,tobinjt/Flexget,Danfocus/Flexget,qk4l/Flexget,oxc/Flexget,dsemi/Flexget,LynxyssCZ/Flexget,malkavi/Flexget,jawilson/Flexget,crawln45/Flexget,qk4l/Flexget,jacobmetrick/Flexget,drwyrm/Flexget... | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
671435804a070828ddcf6f4b674b7fc064927daf | Prepare v2.9.8.dev | Flexget/Flexget,tobinjt/Flexget,ianstalk/Flexget,qk4l/Flexget,Flexget/Flexget,jawilson/Flexget,poulpito/Flexget,OmgOhnoes/Flexget,crawln45/Flexget,LynxyssCZ/Flexget,JorisDeRieck/Flexget,ianstalk/Flexget,ianstalk/Flexget,Danfocus/Flexget,Flexget/Flexget,JorisDeRieck/Flexget,qk4l/Flexget,tobinjt/Flexget,Danfocus/Flexget,... | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
0b1d09023e685acb654f1fdfbcfb081751bb77a9 | Fix typo in mongo query | xenx/recommendation_system,xenx/recommendation_system | models/nmf_model.py | models/nmf_model.py | from collections import Counter
import datetime
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.utils import shuffle
from models.features.topics import topics_similarity
clf = RandomForestClassifier()
def generate_features(data, val=None):
features = []
for raw in data:
... | from collections import Counter
import datetime
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.utils import shuffle
from models.features.topics import topics_similarity
clf = RandomForestClassifier()
def generate_features(data, val=None):
features = []
for raw in data:
... | mit | Python |
6dec0ddaf34194390b180285295f5c5a2f39157d | mark version in dev mode | fsimkovic/pyjob | pyjob/version.py | pyjob/version.py | """The version number of pyjob is recorded here"""
# Maintain sematantic versioning. Further information can
# be found here [http://semver.org/]
__version_info__ = (0, 1, "2dev1")
# ======================================================
# Do __NOT__ change anything below here
__version__ = '.'.join(str(v) for v in _... | """The version number of pyjob is recorded here"""
# Maintain sematantic versioning. Further information can
# be found here [http://semver.org/]
__version_info__ = (0, 1, 2)
# ======================================================
# Do __NOT__ change anything below here
__version__ = '.'.join(str(v) for v in __versi... | mit | Python |
1ae29efddbf477c0ddffd026b4c39ac4fd34f423 | fix up logging for heroku | Jaza/colorsearchtest,Jaza/colorsearchtest,Jaza/colorsearchtest | colorsearchtest/app.py | colorsearchtest/app.py | # -*- coding: utf-8 -*-
"""The app module, containing the app factory function."""
from flask import Flask, render_template
from colorsearchtest.settings import ProdConfig
from colorsearchtest.assets import assets
from colorsearchtest.extensions import (
cache,
db,
migrate,
debug_toolbar,
)
from colors... | # -*- coding: utf-8 -*-
"""The app module, containing the app factory function."""
from flask import Flask, render_template
from colorsearchtest.settings import ProdConfig
from colorsearchtest.assets import assets
from colorsearchtest.extensions import (
cache,
db,
migrate,
debug_toolbar,
)
from colors... | apache-2.0 | Python |
d6d942c45dbdbde7c16817a607d81dca16062544 | Update version number #16 | 7pairs/pyny,7pairs/pyny | pyny/__init__.py | pyny/__init__.py | # -*- coding: utf-8 -*-
#
# Copyright 2015 Jun-ya HASEBA
#
# 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 ... | # -*- coding: utf-8 -*-
#
# Copyright 2015 Jun-ya HASEBA
#
# 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 ... | apache-2.0 | Python |
a52a47657e102aed0cf3bcd862c6b995dae460f8 | Bump version | asvetlov/bloggertool | lib/bloggertool/__version__.py | lib/bloggertool/__version__.py | # __version__.py
# Copyright (C) 2011-2012 Andrew Svetlov
# andrew.svetlov@gmail.com
#
# This module is part of BloggerTool and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
__version__ = '0.4a0'
| # __version__.py
# Copyright (C) 2011-2012 Andrew Svetlov
# andrew.svetlov@gmail.com
#
# This module is part of BloggerTool and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
__version__ = '0.3dev'
| mit | Python |
5bee061849b9e48d097b2aba3613e38f7282f36b | Bump version | ujjwal96/mitmproxy,ParthGanatra/mitmproxy,mhils/mitmproxy,dwfreed/mitmproxy,gzzhanghao/mitmproxy,zlorb/mitmproxy,dufferzafar/mitmproxy,jvillacorta/mitmproxy,cortesi/mitmproxy,Kriechi/pathod,MatthewShao/mitmproxy,laurmurclar/mitmproxy,ParthGanatra/mitmproxy,ddworken/mitmproxy,mitmproxy/mitmproxy,mosajjal/mitmproxy,mosaj... | libpathod/version.py | libpathod/version.py | IVERSION = (0, 12, 2)
VERSION = ".".join(str(i) for i in IVERSION)
MINORVERSION = ".".join(str(i) for i in IVERSION[:2])
NAME = "pathod"
NAMEVERSION = NAME + " " + VERSION
NEXT_MINORVERSION = list(IVERSION)
NEXT_MINORVERSION[1] += 1
NEXT_MINORVERSION = ".".join(str(i) for i in NEXT_MINORVERSION[:2])
| IVERSION = (0, 12, 1)
VERSION = ".".join(str(i) for i in IVERSION)
MINORVERSION = ".".join(str(i) for i in IVERSION[:2])
NAME = "pathod"
NAMEVERSION = NAME + " " + VERSION
NEXT_MINORVERSION = list(IVERSION)
NEXT_MINORVERSION[1] += 1
NEXT_MINORVERSION = ".".join(str(i) for i in NEXT_MINORVERSION[:2])
| mit | Python |
57f8a674737da47455538e5234545b5ffdcf20db | Fix yaml generation | huntxu/fuel-library,ddepaoli3/fuel-library-dev,Metaswitch/fuel-library,SmartInfrastructures/fuel-library-dev,zhaochao/fuel-library,SmartInfrastructures/fuel-library-dev,stackforge/fuel-library,huntxu/fuel-library,eayunstack/fuel-library,slystopad/fuel-lib,slystopad/fuel-lib,zhaochao/fuel-library,stackforge/fuel-library... | fuel_test/astute.py | fuel_test/astute.py | __author__ = 'vic'
import yaml
class Astute(object):
@classmethod
def config(cls, use_case, controllers, computes=None, storages=None,
proxies=None,
quantums=None):
if not quantums: quantums = []
if not proxies: proxies = []
if not storages: storages = []
... | __author__ = 'vic'
import yaml
class Astute(object):
@classmethod
def config(cls, use_case, controllers, computes=None, storages=None,
proxies=None,
quantums=None):
if not quantums: quantums = []
if not proxies: proxies = []
if not storages: storages = []
... | apache-2.0 | Python |
a6d8d70fea9a6cf25580c8e2d6f1c0654751d3b3 | update system encoding | antoine-tran/Wikisearch-example | python/search.py | python/search.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interface to ElasticSearch for serving search requests
#
# Tuan Tran (ttran@l3s.de)
#
import sys
from sys import argv
from conn import connect,close as es_close
QUERY = { "query":{ "multi_match" : {"query": "%s", "fields": [ "text", "title", "contributor" ]}}}
def si... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interface to ElasticSearch for serving search requests
#
# Tuan Tran (ttran@l3s.de)
#
import sys
from sys import argv
from conn import connect,close as es_close
QUERY = { "query":{ "multi_match" : {"query": "%s", "fields": [ "text", "title", "contributor" ]}}}
def si... | apache-2.0 | Python |
df2831b207ee1b07f0a66b562e29bc8c0a08fe82 | Update square.py | Kaceykaso/design_by_roomba,Kaceykaso/design_by_roomba | python/square.py | python/square.py | #! /usr/bin/env python
# Square script
# Executed when asked to draw a square by the user
# Draws a 12 inch square
import serial
import create
from time import strftime
# Create robot
robot = create.Create("/dev/ttyUSB0")
robot.toFullMode()
# Record current position, at start of drawing
pose = robot.getPose()
now = ... | # Square script
# Executed when asked to draw a square by the user
# Draws a 12 inch square
import serial
import create
from time import strftime
# Create robot
robot = create.Create("/dev/ttyUSB0")
robot.toFullMode()
# Record current position, at start of drawing
pose = robot.getPose()
now = strftime("%H:%M:%S %m-%... | mit | Python |
10a714f4b67f08e59f5ee6d618ae21dd35e602f9 | update food | BillBillBillBill/Take-out,BillBillBillBill/Take-out,BillBillBillBill/Take-out,BillBillBillBill/Take-out | backend/takeout/bussiness/models/food.py | backend/takeout/bussiness/models/food.py | # coding: utf-8
from django.db import models
from bussiness.models.store import Store
from lib.models.image import ImageStore
from lib.utils.misc import get_timestamp_from_datetime
class Food(models.Model):
name = models.CharField(max_length=20)
description = models.CharField(max_length=200)
price = model... | # coding: utf-8
from django.db import models
from bussiness.models.store import Store
from lib.models.image import ImageStore
from lib.utils.misc import get_timestamp_from_datetime
class Food(models.Model):
name = models.CharField(max_length=20)
description = models.CharField(max_length=200)
price = model... | mit | Python |
5c4807d53082f6be25432ad00009f2ae555dab2f | Rewrite code for efficiency | ugaliguy/HackerRank,ugaliguy/HackerRank,ugaliguy/HackerRank | Algorithms/Implementation/non-divisible-subset.py | Algorithms/Implementation/non-divisible-subset.py | # Enter your code here. Read input from STDIN. Print output to STDOUT
n,k = [int(i) for i in raw_input().split()]
numbers = [int(i) for i in raw_input().split()]
counts = [0] * k
for number in numbers:
counts[number % k] += 1
count = min(counts[0], 1)
for i in range(1, k//2+1):
if i != k - i:
... | # Enter your code here. Read input from STDIN. Print output to STDOUT
n,k = [int(i) for i in raw_input().split()]
numbers = [int(i) for i in raw_input().split()]
# This code has a bug in it - Fix it!
mod_k = {j:[] for j in range(k)}
for i in range(n):
mod_k[numbers[i]%k].append(numbers[i])
coun... | mit | Python |
d2350380685d7331d94de639c8d36b13a4555e88 | update local ip address | praekelt/molo-gem,praekelt/molo-gem,praekelt/molo-gem | gem/settings/dev.py | gem/settings/dev.py | from .base import * # noqa
ALLOWED_HOSTS = [
'localhost',
'.localhost',
'127.0.0.1'
]
DEBUG = True
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
try:
from .local import * # noqa
except ImportError:
pass
try:
from secrets import * # noqa
except ImportError:
pass
... | from .base import * # noqa
ALLOWED_HOSTS = [
'localhost',
'.localhost',
'127.0.0.1',
'172.30.1.133'
]
DEBUG = True
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
try:
from .local import * # noqa
except ImportError:
pass
try:
from secrets import * # noqa
except Imp... | bsd-2-clause | Python |
2994592f315e5472ed32488f6d8aa618f4f3d020 | Handle self link shown in test output | django-json-api/rest_framework_ember,Instawork/django-rest-framework-json-api,abdulhaq-e/django-rest-framework-json-api,pombredanne/django-rest-framework-json-api,django-json-api/django-rest-framework-json-api,leo-naeka/django-rest-framework-json-api,django-json-api/django-rest-framework-json-api | example/tests/integration/test_meta.py | example/tests/integration/test_meta.py | from datetime import datetime
from django.core.urlresolvers import reverse
import pytest
from example.tests.utils import dump_json, redump_json
pytestmark = pytest.mark.django_db
def test_top_level_meta_for_list_view(blog, client):
expected = {
"data": [{
"type": "blogs",
"id": ... | from datetime import datetime
from django.core.urlresolvers import reverse
import pytest
from example.tests.utils import dump_json, redump_json
pytestmark = pytest.mark.django_db
def test_top_level_meta_for_list_view(blog, client):
expected = {
"data": [{
"type": "blogs",
"id": ... | bsd-2-clause | Python |
f287e77cff56d97633c7c7f69a17304980e1e5f2 | fix PuZheng/TheGenuine-Client#139 | PuZheng/lejian-backend,PuZheng/lejian-backend,PuZheng/lejian-backend,PuZheng/lejian-backend | genuine_ap/index.py | genuine_ap/index.py | # -*- coding: UTF-8 -*-
from flask import redirect, url_for, render_template, request, abort
from flask.ext.babel import _
from flask.ext.login import login_required, current_user
from .basemain import app
from genuine_ap.models import SKU
@app.route('/')
@login_required
def index():
return redirect(current_user.... | # -*- coding: UTF-8 -*-
from flask import redirect, url_for, render_template
from flask.ext.babel import _
from flask.ext.login import login_required, current_user
from .basemain import app
@app.route('/')
@login_required
def index():
return redirect(current_user.default_url)
@app.route("/download/<filename>")
... | mit | Python |
481fa2160d71d905e08b61f8ec1f9603c287e230 | add docstring to ngsw_config rule | alexeagle/rules_nodejs,alexeagle/rules_nodejs,bazelbuild/rules_nodejs,alexeagle/rules_nodejs,bazelbuild/rules_nodejs,alexeagle/rules_nodejs,bazelbuild/rules_nodejs,bazelbuild/rules_nodejs,bazelbuild/rules_nodejs | examples/angular/tools/ngsw_config.bzl | examples/angular/tools/ngsw_config.bzl | "Angular service worker support (credits: https://github.com/marcus-sa)"
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")
def ngsw_config(name, config, index_html, src, out = None, **kwargs):
"Creates ngsw.json with service worker configuration and hashes for all source files"
if not out:
... | "Angular service worker support (credits: https://github.com/marcus-sa)"
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")
def ngsw_config(name, config, index_html, src, out = None, **kwargs):
if not out:
out = name
ngsw_config_name = "%s_bin" % name
nodejs_binary(
name = ng... | apache-2.0 | Python |
a1db0664137e53e6459b196bacb8d36c83ac0ae2 | Add quick replies (#140) | ZuZuD/JARVIS-on-Messenger,jaskaransarkaria/JARVIS-on-Messenger,swapagarwal/JARVIS-on-Messenger,edadesd/JARVIS-on-Messenger | modules/src/joke.py | modules/src/joke.py | import requests
from templates.text import TextTemplate
from templates.quick_replies import add_quick_reply
from random import choice
import json
import config
def process(input, entities=None):
output = {}
try:
'''
r = requests.get('http://tambal.azurewebsites.net/joke/random')
data = ... | import requests
from templates.text import TextTemplate
from random import choice
import json
import config
def process(input, entities=None):
output = {}
try:
'''
r = requests.get('http://tambal.azurewebsites.net/joke/random')
data = r.json()
output['input'] = input
out... | mit | Python |
66168140679f4f5f6bf2e7284c188f92f7868051 | Bump to 0.12.2 | flomotlik/formica | formica/__init__.py | formica/__init__.py | import logging
import sys
__version__ = "0.12.2"
CHANGE_SET_FORMAT = "{stack}-change-set"
logger = logging.getLogger("formica")
handler = logging.StreamHandler(sys.stdout)
formatter = logging.Formatter("%(message)s")
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.setLevel(logging.INFO)
| import logging
import sys
__version__ = "0.12.1"
CHANGE_SET_FORMAT = "{stack}-change-set"
logger = logging.getLogger("formica")
handler = logging.StreamHandler(sys.stdout)
formatter = logging.Formatter("%(message)s")
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.setLevel(logging.INFO)
| mit | Python |
60e2f33a8d20b931664ebc0736a48c834093c74c | rename in views | novafloss/django-formidable | formidable/views.py | formidable/views.py | # -*- coding: utf-8 -*-
from django.db.models import Prefetch
from rest_framework.views import APIView
from rest_framework.generics import (
RetrieveUpdateAPIView, CreateAPIView,
RetrieveAPIView,
)
from rest_framework.response import Response
from formidable.models import Formidable, Field
from formidable.se... | # -*- coding: utf-8 -*-
from django.db.models import Prefetch
from rest_framework.views import APIView
from rest_framework.generics import (
RetrieveUpdateAPIView, CreateAPIView,
RetrieveAPIView,
)
from rest_framework.response import Response
from formidable.models import Formidable, Fieldidable
from formida... | mit | Python |
12a1c83948051d9584b4a7059d02c901d507ee60 | Fix infinite recursion in PersistentWid (#39) | zero-db/zerodb,zerodb/zerodb,zero-db/zerodb,zerodb/zerodb | zerodb/catalog/indexes/pwid.py | zerodb/catalog/indexes/pwid.py | import persistent
from zope.index.text import widcode
class PersistentWid(persistent.Persistent):
"""
Behaves like a string, but stored as a lazy-loaded persistent object.
Can be encoded from word ids
"""
def __init__(self, s):
self.s = s
@classmethod
def encode_wid(cls, l):
... | import persistent
from zope.index.text import widcode
class PersistentWid(persistent.Persistent):
"""
Behaves like a string, but stored as a lazy-loaded persistent object.
Can be encoded from word ids
"""
def __init__(self, s):
self.s = s
@classmethod
def encode_wid(cls, l):
... | agpl-3.0 | Python |
8a497a5976ca5a0c3aa0827e247c5d5a01db031f | use compilers in env variable | jgsogo/queryset-cpp,jgsogo/queryset-cpp,jgsogo/queryset-cpp | build.py | build.py |
import os
from conan.packager import ConanMultiPackager
from conanfile import QuerysetCPP
username = os.getenv("CONAN_USERNAME", "jgsogo")
reference = os.getenv("CONAN_REFERENCE", "{}/{}".format(QuerysetCPP.name, QuerysetCPP.version))
if __name__ == "__main__":
builder = ConanMultiPackager(username=username,
... |
import os
from conan.packager import ConanMultiPackager
from conanfile import QuerysetCPP
username = os.getenv("CONAN_USERNAME", "jgsogo")
reference = os.getenv("CONAN_REFERENCE", "{}/{}".format(QuerysetCPP.name, QuerysetCPP.version))
if __name__ == "__main__":
builder = ConanMultiPackager(username=username,
... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.