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 |
|---|---|---|---|---|---|---|---|---|
b56cd5c8b9c15d93b4c4039016b74a8838e8c3a4 | Correct license declaration in setup.py | max-k/flask-multi-redis | setup.py | setup.py | #!/usr/bin/env python3
import io
from setuptools import setup
with io.open('README.rst', encoding='utf-8') as f:
README = f.read()
with io.open('HISTORY.rst', encoding='utf-8') as f:
HISTORY = f.read()
DESC = "MultiThreaded and MultiServers Redis Extension for Flask Applications"
LICENSE = "GNU Affero Genera... | #!/usr/bin/env python3
import io
from setuptools import setup
with io.open('README.rst', encoding='utf-8') as f:
README = f.read()
with io.open('HISTORY.rst', encoding='utf-8') as f:
HISTORY = f.read()
DESC = "MultiThreaded and MultiServers Redis Extension for Flask Applications"
setup(
name='Flask-Mult... | agpl-3.0 | Python |
19339bfd504a2383c21048f80803c2a8318455d6 | Improve description | NitorCreations/nitor-deploy-tools,NitorCreations/nitor-deploy-tools,NitorCreations/nitor-deploy-tools | setup.py | setup.py | # Copyright 2016-2017 Nitor Creations Oy
#
# 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 ... | # Copyright 2016-2017 Nitor Creations Oy
#
# 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 ... | apache-2.0 | Python |
f2deb1a401e559cf468b228b54b9cdfb014fd304 | Add an examples dependency on tensorflow_datasets | keras-team/keras-nlp,keras-team/keras-nlp | setup.py | setup.py | # Copyright 2021 The KerasNLP 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | # Copyright 2021 The KerasNLP 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 | Python |
ac29d773e2d046f92c6d07215496aed069cbb1e7 | Update setup | mjtorn/wadofstuff-django-serializers | setup.py | setup.py | from distutils.core import setup
import wadofstuff.django.serializers
README = open('README').read().strip() + "\n\n"
ChangeLog = \
"What's new\n" + \
"==========\n" + \
"\n" + \
open('ChangeLog').read().strip()
LONG_DESCRIPTION = README + ChangeLog
setup(
name='wadofstuff-django-serializers',... | from distutils.core import setup
import wadofstuff.django.serializers
README = open('README').read().strip() + "\n\n"
ChangeLog = \
"What's new\n" + \
"==========\n" + \
"\n" + \
open('ChangeLog').read().strip()
LONG_DESCRIPTION = README + ChangeLog
setup(
name='wadofstuff-django-serializers',... | bsd-3-clause | Python |
b3c948ee79678efa1ba5bce103c4dd7c5ab8560d | Correct classifiers | spasticVerbalizer/fortune | setup.py | setup.py | #!/usr/bin/env python
#
# EasyInstall setup script for paragrep
#
# $Id$
# ---------------------------------------------------------------------------
from setuptools import setup, find_packages
import sys
import os
import imp
# Load the long description
def load_info():
import re
# Look for identifiers be... | #!/usr/bin/env python
#
# EasyInstall setup script for paragrep
#
# $Id$
# ---------------------------------------------------------------------------
from setuptools import setup, find_packages
import sys
import os
import imp
# Load the long description
def load_info():
import re
# Look for identifiers be... | bsd-3-clause | Python |
9ff1af266edfe7eb30d17a49dde197360761cd61 | bump PyPI version number | briney/abstar | setup.py | setup.py | import os
try:
from setuptools import setup
except ImportError:
sys.exit('ERROR: setuptools is required.\n')
try:
from pip.req import parse_requirements
except ImportError:
sys.exit('ERROR: pip is required.\n')
if os.environ.get('READTHEDOCS', None):
# Set empty install_requires to get install t... | import os
try:
from setuptools import setup
except ImportError:
sys.exit('ERROR: setuptools is required.\n')
try:
from pip.req import parse_requirements
except ImportError:
sys.exit('ERROR: pip is required.\n')
if os.environ.get('READTHEDOCS', None):
# Set empty install_requires to get install t... | mit | Python |
e1f1cdce41558b2631f93d4e5bef42103a414474 | Bump version to 0.2 | lordmauve/chopsticks,lordmauve/chopsticks | setup.py | setup.py | from setuptools import setup
setup(
name='chopsticks',
description='Chopsticks is an orchestration library: it lets you manage ' +
'and configure remote hosts over SSH.',
long_description=open('README.rst').read(),
version=0.2,
author='Daniel Pope',
author_email='mauve@mauveweb.... | from setuptools import setup
setup(
name='chopsticks',
description='Chopsticks is an orchestration library: it lets you manage ' +
'and configure remote hosts over SSH.',
long_description=open('README.rst').read(),
version=0.1,
author='Daniel Pope',
author_email='mauve@mauveweb.... | apache-2.0 | Python |
9fadf621751b3c304627d8494a73f6c5753ba00d | Cut v0.5.1 release | textbook/bulrush,textbook/bulrush | setup.py | setup.py | from os import path
from setuptools import setup
here = path.abspath(path.dirname(__file__))
with open('{}/README.md'.format(here)) as readme:
long_description = readme.read()
setup(
author='Jonathan Sharpe',
author_email='mail@jonrshar.pe',
classifiers=[
'Development Status :: 4 - Beta',
... | from os import path
from setuptools import setup
here = path.abspath(path.dirname(__file__))
with open('{}/README.md'.format(here)) as readme:
long_description = readme.read()
setup(
author='Jonathan Sharpe',
author_email='mail@jonrshar.pe',
classifiers=[
'Development Status :: 4 - Beta',
... | isc | Python |
2aa45429730671e40f6e1eca02ab4761ba361b20 | Use ranges for dependencies | relekang/rmoq | setup.py | setup.py | import re
import sys
import codecs
from os import path
from setuptools import find_packages, setup
def read(*parts):
file_path = path.join(path.dirname(__file__), *parts)
return codecs.open(file_path, encoding='utf-8').read()
with open('rmoq/__init__.py', 'r') as fd:
version = re.search(
r'^__ve... | import re
import sys
import codecs
from os import path
from setuptools import find_packages, setup
def read(*parts):
file_path = path.join(path.dirname(__file__), *parts)
return codecs.open(file_path, encoding='utf-8').read()
with open('rmoq/__init__.py', 'r') as fd:
version = re.search(
r'^__ve... | mit | Python |
ab7b0eea43054f587124e43b97dbf812c2cb4292 | update setup change dependency_links | openego/eTraGo | setup.py | setup.py | __copyright__ = "Flensburg University of Applied Sciences, Europa-Universität Flensburg, Centre for Sustainable Energy Systems, DLR-Institute for Networked Energy Systems"
__license__ = "GNU Affero General Public License Version 3 (AGPL-3.0)"
__author__ = "mariusves"
from setuptools import find_packages, setup
import ... | __copyright__ = "Flensburg University of Applied Sciences, Europa-Universität Flensburg, Centre for Sustainable Energy Systems, DLR-Institute for Networked Energy Systems"
__license__ = "GNU Affero General Public License Version 3 (AGPL-3.0)"
__author__ = "mariusves"
from setuptools import find_packages, setup
import ... | agpl-3.0 | Python |
6da722e5acc02b194120a3cd333e2f76af65b7b0 | Add more package metadata | alekstorm/pygravatar,alekstorm/pygravatar | setup.py | setup.py | #!/usr/bin/env python
import distutils.core
import sys
# Importing setuptools adds some features like "setup.py develop", but
# it's optional so swallow the error if it's not there.
try:
import setuptools
except ImportError:
pass
kwargs = {}
major, minor = sys.version_info[:2]
if major >= 3:
import setu... | #!/usr/bin/env python
import distutils.core
import sys
# Importing setuptools adds some features like "setup.py develop", but
# it's optional so swallow the error if it's not there.
try:
import setuptools
except ImportError:
pass
kwargs = {}
major, minor = sys.version_info[:2]
if major >= 3:
import setu... | mit | Python |
827cf4e82a192d8d2db1d70d7c48f69aa1823a61 | Add whip-cli console entry point to setup.py script | wbolster/whip | setup.py | setup.py | from setuptools import find_packages, setup
setup(
name='Whip',
version='0.1',
packages=find_packages(exclude=['tests']),
entry_points={
'console_scripts': [
'whip-cli = whip.cli:main',
],
}
)
|
from setuptools import find_packages, setup
setup(
name='Whip',
version='0.1',
packages=find_packages(exclude=['tests']),
)
| bsd-3-clause | Python |
5fac69d305659a8f5dfd6e199e697a282f3dfe8d | Bump minimum 'api_core' version for all GAPIC libs to 1.4.1. (#6391) | googleapis/python-asset,googleapis/python-asset | setup.py | setup.py | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | Python |
ca81802c83c46360a2b41d8be937309eeb961a1e | modify tornado requires to 4.0 stable | OctavianLee/thriftpy,adsharma/flattools,duydb2/thriftpy,itnihao/thriftpy,importcjj/thriftpy,misakwa/thriftpy,misakwa/thriftpy,itnihao/thriftpy,mariusvniekerk/thriftpy,dan-blanchard/thriftpy,halfcrazy/thriftpy,misakwa/thriftpy,duydb2/thriftpy,OctavianLee/thriftpy,adsharma/flattools,mariusvniekerk/thriftpy,keitheis/thrif... | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from setuptools.extension import Extension
install_requires = [
"pyparsing==2.0.2",
]
tornado_requires = [
"tornado>=4.0",
"toro"
]
dev_requires = [
"cython>=0.20.2",
"flake8>=2.2.2",
"nose>=1.3.3",
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from setuptools.extension import Extension
install_requires = [
"pyparsing==2.0.2",
]
dev_requires = [
"cython>=0.20.2",
"flake8>=2.2.2",
"nose>=1.3.3",
"sphinx-rtd-theme>=0.1.6",
"sphinx>=1.2.2",
]
tr... | mit | Python |
b890765d567235f915dc45efdef157e0e6331505 | Bump version to 0.2 | messense/images2video | setup.py | setup.py | #!/usr/bin/env python
from __future__ import with_statement
import os
from setuptools import setup, find_packages
readme = 'README.md'
if os.path.exists('README.rst'):
readme = 'README.rst'
with open(readme) as f:
long_description = f.read()
setup(
name='images2video',
version='0.2',
author='messe... | #!/usr/bin/env python
from __future__ import with_statement
import os
from setuptools import setup, find_packages
readme = 'README.md'
if os.path.exists('README.rst'):
readme = 'README.rst'
with open(readme) as f:
long_description = f.read()
setup(
name='images2video',
version='0.1',
author='messe... | mit | Python |
bf7e43dfd23105b88660af8a9484d5791d8eef04 | add long_description to package (#61) | swilly22/redisgraph-py | setup.py | setup.py | from setuptools import setup, find_packages
import io
def read_all(f):
with io.open(f, encoding="utf-8") as I:
return I.read()
requirements = map(str.strip, open("requirements.txt").readlines())
setup(
name='redisgraph',
version='2.1',
description='RedisGraph Python Client',
long_... | from setuptools import setup, find_packages
setup(
name='redisgraph',
version='2.1',
description='RedisGraph Python Client',
url='https://github.com/redislabs/redisgraph-py',
packages=find_packages(),
install_requires=['redis', 'PTable'],
classifiers=[
'Intended Audience :: Develope... | bsd-2-clause | Python |
1268c81d696a0570eef8ebd31e847f6165f20c9f | bump version | awentzonline/image-analogies | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
from setuptools import find_packages
setup(
name='neural-image-analogies',
version='0.0.7',
description='Generate image analogies with a deep neural network.',
author='Adam Wentz',
author_email='adam@adamwentz.com',
url='https://github.com/... | #!/usr/bin/env python
from distutils.core import setup
from setuptools import find_packages
setup(
name='neural-image-analogies',
version='0.0.6',
description='Generate image analogies with a deep neural network.',
author='Adam Wentz',
author_email='adam@adamwentz.com',
url='https://github.com/... | mit | Python |
cee88f62a9e4924c55212348b75339e127a935d4 | add build increment to package version | buildtimetrend/python-lib | setup.py | setup.py | #!/usr/bin/env python
# vim: set expandtab sw=4 ts=4:
from setuptools import setup, find_packages
setup(
name="buildtimetrend",
version="0.2-dev-build1",
packages=find_packages(),
install_requires=['keen', 'lxml', 'pyyaml', 'python-dateutil'],
tests_require=['nose', 'coveralls'],
extras_requi... | #!/usr/bin/env python
# vim: set expandtab sw=4 ts=4:
from setuptools import setup, find_packages
setup(
name="buildtimetrend",
version="0.2-dev",
packages=find_packages(),
install_requires=['keen', 'lxml', 'pyyaml', 'python-dateutil'],
tests_require=['nose', 'coveralls'],
extras_require={
... | agpl-3.0 | Python |
ae3215eb694503282c9c5e4263aaace6a145c129 | Include URL in setup.py metadata | peterjc/backports.lzma,peterjc/backports.lzma,r3m0t/backports.lzma | setup.py | setup.py | #!/usr/bin/python -u
#
# Python Bindings for XZ/LZMA backported from Python 3.3.0
#
# This file copyright (c) 2012 Peter Cock, p.j.a.cock@googlemail.com
# See other files for separate copyright notices.
import sys, os
from warnings import warn
from distutils import log
from distutils.command.build_ext import build_ex... | #!/usr/bin/python -u
#
# Python Bindings for XZ/LZMA backported from Python 3.3.0
#
# This file copyright (c) 2012 Peter Cock, p.j.a.cock@googlemail.com
# See other files for separate copyright notices.
import sys, os
from warnings import warn
from distutils import log
from distutils.command.build_ext import build_ex... | bsd-3-clause | Python |
812b56a22b4d09e75bd647542f2453f4a5d3dac0 | Use find_packages() | MizukiSonoko/iroha-cli,MizukiSonoko/iroha-cli | setup.py | setup.py | #!/usr/bin/env python
import distutils
from distutils.extension import Extension
import sys
import os
import subprocess
from distutils.command.build_py import build_py as _build_py
from distutils.core import setup
from setuptools import find_packages
def exec_generate_proto(source):
protoc_command = ["python3",... | #!/usr/bin/env python
import distutils
from distutils.extension import Extension
import sys
import os
import subprocess
from distutils.command.build_py import build_py as _build_py
from distutils.core import setup
def exec_generate_proto(source):
protoc_command = ["python3", "-m", "grpc_tools.protoc", "-I.", "-... | apache-2.0 | Python |
ce2deceefdd5ccd0c0e26613decc0db4ef1bad38 | Remove setuptools default | asmeurer/conda-env,conda/conda-env,dan-blanchard/conda-env,isaac-kit/conda-env,conda/conda-env,mikecroucher/conda-env,dan-blanchard/conda-env,ESSS/conda-env,nicoddemus/conda-env,mikecroucher/conda-env,phobson/conda-env,isaac-kit/conda-env,nicoddemus/conda-env,phobson/conda-env,ESSS/conda-env,asmeurer/conda-env | setup.py | setup.py | #!/usr/bin/env python
import sys
if 'develop' in sys.argv:
from setuptools import setup
using_setuptools = True
else:
from distutils.core import setup
using_setuptools = False
if sys.version_info[:2] < (2, 7):
sys.exit("conda is only meant for Python 2.7, with experimental support "
"... | #!/usr/bin/env python
import sys
if 'develop' in sys.argv:
from setuptools import setup
using_setuptools = True
else:
from distutils.core import setup
using_setuptools = False
from setuptools import setup
if sys.version_info[:2] < (2, 7):
sys.exit("conda is only meant for Python 2.7, with experi... | bsd-3-clause | Python |
160816990afff975cab84c794e1bb51b1a9c2fa6 | Make use of setuptools explicit and required in setup.py. | tiddlyweb/tiddlywebwiki,tiddlyweb/tiddlywebwiki,tiddlyweb/tiddlywebwiki | setup.py | setup.py | from setuptools import setup, find_packages
from tiddlywebwiki import __version__ as VERSION
setup(name = 'tiddlywebwiki',
version = VERSION,
description = 'A TiddlyWeb plugin to provide a multi-user TiddlyWiki environment.',
author = 'FND',
author_email = 'FNDo@gmx.net',
pack... | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from tiddlywebwiki import __version__ as VERSION
setup(name = 'tiddlywebwiki',
version = VERSION,
description = 'A TiddlyWeb plugin to provide a multi-user TiddlyWiki environment.',
author = 'Chris ... | bsd-3-clause | Python |
3bcaa18f8d18d743ec217b4c1daccc035a0ad169 | Read config from setup.cfg | bootandy/imps | shell.py | shell.py | from __future__ import absolute_import, division, print_function
import argparse
import os
import configparser
from imps.core import Sorter, Style
def get_style(s):
if s in ('s', 'smarkets'):
return Style.SMARKETS
elif s in ('g', 'google'):
return Style.GOOGLE
elif s in ('c', 'crypto', ... | from __future__ import absolute_import, division, print_function
import argparse
import os
from imps.core import Sorter, Style
def get_style(s):
if s in ('s', 'smarkets'):
return Style.SMARKETS
elif s in ('g', 'google'):
return Style.GOOGLE
elif s in ('c', 'cryptography'):
return... | apache-2.0 | Python |
ae1cf07cc703d85f3d3c77eab76c83baec17a74d | Add standard Ansible exception handling | timraasveld/ansible-string-split-filter,ypid/ansible-string-split-filter | split.py | split.py | from ansible import errors
import re
def split_string(string, seperator=' '):
try:
return string.split(seperator)
except Exception, e:
raise errors.AnsibleFilterError('split plugin error: %s, string=%s' % str(e),str(string) )
def split_regex(string, seperator_pattern):
try:
return ... | import re
def split_string(string, seperator=' '):
return string.split(seperator)
def split_regex(string, seperator_pattern):
return re.split(seperator_pattern, string)
class FilterModule(object):
''' A filter to split a string into a list. '''
def filters(self):
return {
'split'... | cc0-1.0 | Python |
336ab2d29460e00e3e45f48ad549db9d2878f598 | bump flask in /python/flask_tox_pytest_helloworld | xmementoit/practiseSamples,xmementoit/practiseSamples,xmementoit/practiseSamples,xmementoit/practiseSamples,xmementoit/practiseSamples,xmementoit/practiseSamples,xmementoit/practiseSamples,xmementoit/practiseSamples | python/flask_tox_pytest_helloworld/setup.py | python/flask_tox_pytest_helloworld/setup.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 damian <damian@C-DZ-E5500>
#
# Distributed under terms of the MIT license.
'''
setup config for Flask helloworld app
'''
import sys
import os
from setuptools import setup
from setuptools.command.test import test as TestCommand
insta... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 damian <damian@C-DZ-E5500>
#
# Distributed under terms of the MIT license.
'''
setup config for Flask helloworld app
'''
import sys
import os
from setuptools import setup
from setuptools.command.test import test as TestCommand
insta... | apache-2.0 | Python |
ac3bc0693263183f7ec083940dbf89b65bfa9763 | Fix hackertarget data output. | vesche/scanless | scanners/hackertarget.py | scanners/hackertarget.py | #
# scanless hackertarget module
# https://github.com/vesche/scanless
#
import bs4
import requests
BASE_URL = 'https://hackertarget.com'
SCAN_LOC = '/nmap-online-port-scanner/'
OUTPUT = '''
------- hackertarget -------
{}
----------------------------'''
def scan(target):
url = '{}{}'.format(BASE_URL, SCAN_LOC)
... | #
# scanless hackertarget module
# https://github.com/vesche/scanless
#
import bs4
import requests
BASE_URL = 'https://hackertarget.com'
SCAN_LOC = '/nmap-online-port-scanner/'
OUTPUT = '''
------- hackertarget -------
{}
----------------------------'''
def scan(target):
url = '{}{}'.format(BASE_URL, SCAN_LOC)
... | unlicense | Python |
d31d6474d30aacc76c51731ceec0cbce2324c531 | use `npm ci` instead of `npm install` (#42) | googleapis/nodejs-dataproc,googleapis/nodejs-dataproc | synth.py | synth.py | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 | Python |
36006159820e5f36f5ed238dd85e43f52e77d430 | exclude sample directory generation from synth.py (#2488) | googleapis/java-bigtable-hbase,googleapis/java-bigtable-hbase,googleapis/java-bigtable-hbase | synth.py | synth.py | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 | Python |
2c0beb633b2085e2afafae9d2d7e132f699e3d1c | enable context aware commits (#109) | googleapis/java-kms,googleapis/java-kms,googleapis/java-kms | synth.py | synth.py | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 | Python |
b507aa44938cb42428f0e62d8ace63c2f6a0ba3e | bump on master | wooyek/django-tasker | tasks.py | tasks.py | # coding=utf-8
# Copyright (C) 2015 Janusz Skonieczny
#
# This program 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.
#
... | # coding=utf-8
# Copyright (C) 2015 Janusz Skonieczny
#
# This program 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.
#
... | mit | Python |
89f2397cc9a7125f8d978d25754849140d9af835 | add test sound | qszhuan/raspberry-pi,qszhuan/raspberry-pi,qszhuan/raspberry-pi | tasks.py | tasks.py | from celery import Celery
import os
import shutil
import random
from celery.exceptions import SoftTimeLimitExceeded
import subprocess
import datetime
from logger import logger
app = Celery('tasks')
app.config_from_object('celeryconfig')
#
# @app.on_after_configure.connect
# def setup_periodic_tasks(sender, **kwargs):
... | from celery import Celery
import os
import shutil
import random
from celery.exceptions import SoftTimeLimitExceeded
import subprocess
import datetime
from logger import logger
app = Celery('tasks')
app.config_from_object('celeryconfig')
#
# @app.on_after_configure.connect
# def setup_periodic_tasks(sender, **kwargs):
... | mit | Python |
82da4200bdfb99f4e9980dc5dbec2b3a894daf21 | Configure changelog re: release tasks | fabric/patchwork | tasks.py | tasks.py | from importlib import import_module
from invocations import docs, travis
from invocations.checks import blacken
from invocations.packaging import release
from invocations.pytest import test, coverage
from invoke import Collection, task
@task
def sanity(c):
"""
Quick sanity check to ensure we're installed su... | from importlib import import_module
from invocations import docs, travis
from invocations.checks import blacken
from invocations.packaging import release
from invocations.pytest import test, coverage
from invoke import Collection, task
@task
def sanity(c):
"""
Quick sanity check to ensure we're installed su... | bsd-2-clause | Python |
e4818d03b93f914017cba5fe9a6847c7e7ab95b2 | Fix release command | chmp/ipytest | tasks.py | tasks.py | import pathlib
from invoke import task
from packaging import version
@task()
def format(c):
"""Format the code."""
c.run("black ipytest tests setup.py tasks.py")
@task()
def test(c):
"""Execute unit tests."""
c.run("py.test tests")
@task()
def integration(c):
"""Test ipytest - ipython integra... | import pathlib
from invoke import task
from packaging import version
@task()
def format(c):
"""Format the code."""
c.run("black ipytest tests setup.py tasks.py")
@task()
def test(c):
"""Execute unit tests."""
c.run("py.test tests")
@task()
def integration(c):
"""Test ipytest - ipython integra... | mit | Python |
2fa858461decf43ec0af94cb54c1b51915948180 | Fix lottery task | CocoaPods/sotu.cocoapods.org,CocoaPods/sotu.cocoapods.org | tasks.py | tasks.py | import os
from tempfile import NamedTemporaryFile
import peewee
from rivr import serve
from invoke import task, run
from sotu.models import Entrant, Invitation
from sotu.middleware import middleware
from sotu.email import send_invitation
@task
def migrate():
Entrant.create_table()
Invitation.create_table()
... | import os
from tempfile import NamedTemporaryFile
import peewee
from rivr import serve
from invoke import task, run
from sotu.models import Entrant, Invitation
from sotu.middleware import middleware
from sotu.email import send_invitation
@task
def migrate():
Entrant.create_table()
Invitation.create_table()
... | mit | Python |
06e8de270362dff594eec30abc9b7aed431918a9 | Refactor Window: remove unnecessary code | BogyMitutoyoCTL/CalculatorCV | Window.py | Window.py | import cv2
import Settings
class Window:
def __init__(self, settings: Settings, window_name):
self.settings = settings
self.window_name = window_name
cv2.namedWindow(window_name)
self.image_width_px = 1080
def show_picture(self, picture):
cv2.imshow(self.window_name, p... | import cv2
import Settings
class Window:
def __init__(self, settings: Settings, window_name):
self.settings = settings
self.window_name = window_name
cv2.namedWindow(window_name)
self.image_width_px = 1080
def show_picture(self, picture):
cv2.imshow(self.window_name, p... | mit | Python |
66c28487a80074cb506c083c777c0cd7fcb920e2 | Add support for MPJson in vis_structure. | sonium0/pymatgen,yanikou19/pymatgen,Dioptas/pymatgen,Bismarrck/pymatgen,Bismarrck/pymatgen,Bismarrck/pymatgen,migueldiascosta/pymatgen,migueldiascosta/pymatgen,sonium0/pymatgen,sonium0/pymatgen,ctoher/pymatgen,Bismarrck/pymatgen,Bismarrck/pymatgen,rousseab/pymatgen,yanikou19/pymatgen,ctoher/pymatgen,yanikou19/pymatgen,... | scripts/vis_structure.py | scripts/vis_structure.py | #!/usr/bin/env python
'''
Simple structure visualizer script.
'''
from __future__ import division
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyue@mit.edu"
__date__ = "Nov 29, 2011"
import argparse
import r... | #!/usr/bin/env python
'''
Simple structure visualizer script.
'''
from __future__ import division
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyue@mit.edu"
__date__ = "Nov 29, 2011"
import argparse
from py... | mit | Python |
1808513cf024e9f33dc8bb073edf11f77cf6993b | Update exceptions: use class name in TimeoutError repr | botify-labs/simpleflow,botify-labs/simpleflow | simpleflow/exceptions.py | simpleflow/exceptions.py | class ExecutionBlocked(Exception):
pass
class TaskException(Exception):
"""
Wrap an exception raised by a task.
"""
def __init__(self, exception):
"""
:param exception: raised by a task.
:type exception: TaskFailed.
"""
self.exception = exception
def... | class ExecutionBlocked(Exception):
pass
class TaskException(Exception):
"""
Wrap an exception raised by a task.
"""
def __init__(self, exception):
"""
:param exception: raised by a task.
:type exception: TaskFailed.
"""
self.exception = exception
def... | mit | Python |
cfe77bd4fd40b58678fa56ec08b5f862d9f1781c | Modify created_at and updated_at to millisecond | otknoy/michishiki_api_server | post.py | post.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import cgi
import sqlite3
import time
import config
def valid(qs):
required_keys = ['title', 'comment', 'posted_by', 'localite', 'latitude', 'longitude']
return all([qs.has_key(k) for k in required_keys])
def post(title, comment, posted_by, localite, latitude, lo... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import cgi
import sqlite3
import time
import config
def valid(qs):
required_keys = ['title', 'comment', 'posted_by', 'localite', 'latitude', 'longitude']
return all([qs.has_key(k) for k in required_keys])
def post(title, comment, posted_by, localite, latitude, lo... | mit | Python |
bdb82a823f965a195d721a0f23e9b584fd94bf83 | Work on staging | PaulOlteanu/PVCS | pvcs.py | pvcs.py | import os
import sys
import click
from lib import file_helpers
@click.group()
def cli(args=sys.argv):
"""A simple, easy-to-use version control system
"""
pass
@cli.command("init")
def initialize():
try:
os.mkdir(".pvcs")
os.mkdir(".pvcs/revisions")
except FileExistsError:
p... | import os
import sys
import click
from lib import file_helpers
@click.group()
def cli(args=sys.argv):
"""A simple, easy-to-use version control system
"""
pass
@cli.command("init")
def initialize():
try:
os.mkdir(".pvcs")
os.mkdir(".pvcs/revisions")
except FileExistsError:
p... | mit | Python |
5bb9b2c9d5df410c85f4736c17224aeb2f05dd33 | Update print result to use "," instead of "+" for context text | alexmilesyounger/ds_basics | s2v3.py | s2v3.py | from s2v2 import *
def calculate_sum(data_sample):
total = 0
for row in data_sample[1:]: # slice to start at row two, but I think we should only skip row 1 if we're importing the full csv (data_from_csv), but if we use the data w/ the header (my_csv) we'll be skipping a row that we're not supposed to skip (the actu... | from s2v2 import *
def calculate_sum(data_sample):
total = 0
for row in data_sample[1:]: # slice to start at row two, but I think we should only skip row 1 if we're importing the full csv (data_from_csv), but if we use the data w/ the header (my_csv) we'll be skipping a row that we're not supposed to skip (the actu... | mit | Python |
bbc7a0a6ec3e5d1f4e59752ea89ae7add429dc1d | Update blinky.py | merbok/RaspberryPi-FullStack,MerbokIT/RaspberryPi-FullStack_new,futureshocked/RaspberryPi-FullStack,futureshocked/RaspberryPi-FullStack,futureshocked/RaspberryPi-FullStack,merbok/RaspberryPi-FullStack,futureshocked/RaspberryPi-FullStack,futureshocked/RaspberryPi-FullStack,MerbokIT/RaspberryPi-FullStack_new | blinky.py | blinky.py | /*
FILE NAME
blinky.py
1. WHAT IT DOES
Makes an LED blink using a Raspberry Pi.
2. REQUIRES
* Any Raspberry Pi
* A 5mm LED
* A 1KOhm resistor
* Jumper wires
3. ORIGINAL WORK
Raspberry Full stack 2015, Peter Dalmaris
4. HARDWARE
D07: LED
5. SOFTWARE
Command line terminal
Simple text editor
Libraries:
import RPi.G... | import RPi.GPIO as GPIO ## Import GPIO Library
import time ## Import 'time' library (for 'sleep')
pin = 7 ## We're working with pin 7
GPIO.setmode(GPIO.BOARD) ## Use BOARD pin numbering
GPIO.setup(pin, GPIO.OUT) ## Set pin 7 to OUTPUT
for i in range (0... | mit | Python |
f3c56bd47e10d7da34e4021d9cdcf62b7aed2209 | correct issue-delete processing to include issue list updating | jgarzik/smartcoin | scdb.py | scdb.py | #
# scdb.py
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import gdbm
import codec_pb2
class SCDb(object):
def __init__(self, dbfilename, log):
self.log = log
self.dbm = gdbm.open(dbfilename, 'cs')
self.issues = ... | #
# scdb.py
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import gdbm
import codec_pb2
class SCDb(object):
def __init__(self, dbfilename, log):
self.log = log
self.dbm = gdbm.open(dbfilename, 'cs')
self.issues = ... | mit | Python |
f1335688daf0e0a74797a63e0b713fc91bac1101 | Use raw_input when running in Python2 | Katee/quietnet,richo/quietnet | send.py | send.py | import sys
import pyaudio
import quietnet
import options
import psk
FORMAT = pyaudio.paInt16
CHANNELS = options.channels
RATE = options.rate
FREQ = options.freq
FREQ_OFF = 0
FRAME_LENGTH = options.frame_length
DATASIZE = options.datasize
p = pyaudio.PyAudio()
stream = p.open(format=FORMAT, channels=CHANNELS, rate=RAT... | import pyaudio
import quietnet
import options
import psk
FORMAT = pyaudio.paInt16
CHANNELS = options.channels
RATE = options.rate
FREQ = options.freq
FREQ_OFF = 0
FRAME_LENGTH = options.frame_length
DATASIZE = options.datasize
p = pyaudio.PyAudio()
stream = p.open(format=FORMAT, channels=CHANNELS, rate=RATE, output=T... | mit | Python |
8a84232bedf7309148ae7ac76f24f2774d78e9dd | Make app more OOish | mattdeckard/wherewithal | budget.py | budget.py | #!/usr/bin/env python
import sys
from PySide import QtGui
class MainApp(QtGui.QWidget) :
def __init__(self) :
super(MainApp, self).__init__()
self.initUI()
def initUI(self) :
self.setGeometry(300, 300, 250, 150)
self.setWindowTitle('Budget')
self.show()
def main() :... | #!/usr/bin/env python
import sys
from PySide import QtGui
app = QtGui.QApplication(sys.argv)
wid = QtGui.QWidget()
wid.resize(250, 150)
wid.setWindowTitle('Simple')
wid.show()
sys.exit(app.exec_())
| apache-2.0 | Python |
1df5fedceaa19f9ed3285abaace592b4eaeba856 | fix task | nricklin/gdal-gbdx-task | task.py | task.py | import os, subprocess, json, glob2
outdir = '/mnt/work/output/data'
indir = '/mnt/work/input/data'
input_data = json.load(open('/mnt/work/input/ports.json'))
filetype = input_data.get('filetype')
cmd = input_data['command']
execution_strategy = input_data.get('execution_strategy')
if execution_strategy == 'runonce... | import os, subprocess, json, glob2
outdir = '/mnt/work/output/data'
indir = '/mnt/work/input/data'
input_data = json.load(open('/mnt/work/input/ports.json'))
filetype = input_data.get('filetype')
cmd = input_data['command']
execution_strategy = input_data.get('execution_strategy')
if execution_strategy == 'runonce... | mit | Python |
7b422b2432bc8db3034e39073d2efa0bd69ec35f | Add try statement to cleanup pins and invert pull/up down | adampiskorski/lpr_poc | test.py | test.py | import time
import urllib
import RPi.GPIO as GPIO
# GPIO input pin to use
LPR_PIN = 3
# URL to get image from
SOURCE = 'http://192.168.0.13:8080/photoaf.jpg'
# Path to save image locally
FILE = 'img.jpg'
# Use GPIO pin numbers
GPIO.setmode(GPIO.BCM)
# Disable "Ports already in use" warning
GPIO.setwarnings(False)
# ... | import time
import urllib
import RPi.GPIO as GPIO
# GPIO input pin to use
LPR_PIN = 3
# URL to get image from
SOURCE = 'http://192.168.0.13:8080/photoaf.jpg'
# Path to save image locally
FILE = 'img.jpg'
# Use GPIO pin numbers
GPIO.setmode(GPIO.BCM)
# Disable "Ports already in use" warning
GPIO.setwarnings(False)
# ... | mit | Python |
42e6317a7197ab8291781737922df9844aac6556 | fix test for py27, long is converted to long | dmartin35/python-cpp-wrapper,dmartin35/python-cpp-wrapper | test.py | test.py | import demo
def test_echo():
msg = 'This is a simple message!'
echoed = demo.echo(msg)
assert type(echoed) == str
assert echoed == msg
def test_now():
today = demo.now()
assert type(today) == dict
def test_addition():
sum = demo.addition(5, 6)
assert type(sum) in (int, long)
as... | import demo
def test_echo():
msg = 'This is a simple message!'
echoed = demo.echo(msg)
assert type(echoed) == str
assert echoed == msg
def test_now():
today = demo.now()
assert type(today) == dict
def test_addition():
sum = demo.addition(5, 6)
assert type(sum) == int
assert sum... | mit | Python |
75f6963082ed686f4d91ec8df3961048d9428c6b | Test if default rotor encodes forward properly | ranisalt/enigma | test.py | test.py | import unittest
from enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen
class RotorTestCase(unittest.TestCase):
def test_rotor_encoding(self):
rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q')
self.assertEqual('E', rotor.encode('A'))
def run_tests():
runner = unittest.Text... | import unittest
from enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen
class RotorTestCase(unittest.TestCase):
pass
def run_tests():
runner = unittest.TextTestRunner()
suite = unittest.TestLoader().loadTestsFromTestCase(RotorTestCase)
runner.run(suite)
if __name__ == '__main__': # pragma: ... | mit | Python |
96c9301d872292acab8aa2b9f35940b62d8e61ae | Add detailed information on test.py | mustafagezen/python-bring | test.py | test.py | from lib.bring import Bring
def main():
# Bring object
bring = Bring()
# Tracking test
tracking = bring.tracking("TESTPACKAGE-AT-PICKUPPOINT")
# You can get this information: (WEIGHT_KG, STATUS, CITY, DESCRIPTION, COUNTRY, COUNTRY_CODE, UNIT_TYPE, POSTAL_CODE, SIGNATURE)
print tracking.CITY
... | from lib.bring import Bring
def main():
bring = Bring()
tracking = bring.tracking("TESTPACKAGE-AT-PICKUPPOINT")
print tracking.CITY
postal = bring.postal("NO", 5055)
print postal.RESULT
if __name__ == "__main__":
main()
| mit | Python |
bad61e0384273a6b934a7070511d0175e2f5bad2 | Test !!! | microy/MeshToolkit,microy/PyMeshToolkit,microy/PyMeshToolkit,microy/MeshToolkit | test.py | test.py | #! /usr/bin/env python
# -*- coding:utf-8 -*-
from Core.Mesh import CheckMesh
from Core.Normal import UpdateNormals
from Core.Neighbor import UpdateNeighborhood, CheckNeighborhood
from Core.Curvature import GetNormalCurvature
from Core.Color import Array2Color
from Core.Vrml import ReadVrml, WriteVrml
from numpy imp... | #! /usr/bin/env python
# -*- coding:utf-8 -*-
from Core.Mesh import CheckMesh
from Core.Normal import UpdateNormals
from Core.Neighbor import UpdateNeighborhood, CheckNeighborhood
from Core.Curvature import GetNormalCurvature
from Core.Color import Array2Color
from Core.Vrml import ReadVrml, WriteVrml
from numpy imp... | mit | Python |
8a122641fa278bfd3da2ad768940411344ab28c4 | Make token valid for 30 minutes | patklaey/ZermattReservationAPI | DB/User.py | DB/User.py | from main import db, app
from passlib.apps import custom_app_context as pwd_context
from itsdangerous import (TimedJSONWebSignatureSerializer
as Serializer, BadSignature, SignatureExpired)
class User(db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True)
... | from main import db, app
from passlib.apps import custom_app_context as pwd_context
from itsdangerous import (TimedJSONWebSignatureSerializer
as Serializer, BadSignature, SignatureExpired)
class User(db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True)
... | mit | Python |
73d7ea61e77399ada1b55c9faf09d5d5847956b4 | Create tests for edit and log commands | trimailov/timeflow | tests.py | tests.py | import os
import shutil
import subprocess
import unittest
from unittest import mock
from timeflow import helpers
from timeflow.parser import parse_args
class TestParser(unittest.TestCase):
def setUp(self):
self.test_dir = os.path.dirname(os.path.realpath(__file__)) + '/test_dir/'
helpers.LOG_FIL... | import unittest
from timeflow.parser import parse_args
class TestParser(unittest.TestCase):
def test_log(self):
args = parse_args(['log'])
def test_edit(self):
args = parse_args(['edit'])
def test_edit_e(self):
args = parse_args(['edit', '-e', 'vim'])
def test_edit_editor(s... | mit | Python |
a95c139168ce641fa880f823cf3c44fe5a4719b6 | add file_opener tests | pydanny/simplicity | tests.py | tests.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import sys
import unittest
import simplicity
# Python 3 compatibility
P3K = sys.version > '3'
STRING_TYPE = str if P3K else unicode
MULTILINE_STRING_TEST = """A fun programming language.
Used to build simplicity!"""
class Rst2Json(unittest.TestCase):
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import sys
import unittest
from simplicity import rst_to_json, file_opener
# Python 3 compatibility
P3K = sys.version > '3'
STRING_TYPE = str if P3K else unicode
MULTILINE_STRING_TEST = """A fun programming language.
Used to build simplicity!"""
class Rs... | bsd-3-clause | Python |
1fc433a5fe28e703faf21b1c617ff3fa920929f6 | Complete first version of scraper | technocore-redux/youcanhireus,technocore-redux/youcanhireus,technocore-redux/youcanhireus | scrape.py | scrape.py | import datetime
import json
import requests
import sys
from bs4 import BeautifulSoup
url = "https://news.ycombinator.com/item?id=14460779"
req = None
results = {}
now = datetime.datetime.now()
# Fetch the site data
try:
req = requests.get(url)
req.raise_for_status()
except Exception as e:
print("Error w... | mit | Python | |
6891f5ebaa6c8a778ce815882f80336416adb2bf | use curses raw mode | mode89/editor | screen.py | screen.py | import curses
class Screen:
def __init__(self):
self.stdscr = curses.initscr()
curses.raw()
curses.noecho()
self.stdscr.keypad(True)
curses.curs_set(1)
def __del__(self):
self.release()
def release(self):
curses.noraw()
self.stdscr.keypad(F... | import curses
class Screen:
def __init__(self):
self.stdscr = curses.initscr()
curses.noecho()
curses.cbreak()
self.stdscr.keypad(True)
curses.curs_set(1)
def __del__(self):
self.release()
def release(self):
curses.nocbreak()
self.stdscr.ke... | mit | Python |
eabdb66ba7f0d08577a2d639c83421d808c74132 | Update documentation | pybel/pybel-tools,pybel/pybel-tools,pybel/pybel-tools | src/pybel_tools/visualization/visualization.py | src/pybel_tools/visualization/visualization.py | # -*- coding: utf-8 -*-
"""
This module provides functions for making HTML visualizations of BEL Graphs. Because the :class:`pybel.BELGraph`
inherits from :class:`networkx.MultiDiGraph`, it can also be visualized using :mod:`networkx`
`library <https://networkx.github.io/documentation/latest/reference/drawing.html>`_... | # -*- coding: utf-8 -*-
"""
This module provides functions for making HTML visualizations of BEL Graphs
"""
from __future__ import print_function
import json
import os
from pybel.io import to_jsons
from .utils import render_template, default_color_map
from ..mutation import add_canonical_names
__all__ = ['to_htm... | mit | Python |
0767800e11d2d9ce1f38cb08be564eb210e6f09c | Add risk endpoint | joelklabo/risk | server.py | server.py | #!/usr/bin/env python3
from flask import Flask
from flask import request
# Import from the 21 Bitcoin Develper Library
#from two1.lib.wallet import Wallet
#from two1.lib.bitserv.flask import Payment
PORT = 5000
# Configure the app
app = Flask(__name__)
#wallet = Wallet()
#payment = Payment(app, wallet)
@app.route(... | #!/usr/bin/env python3
from flask import Flask
from flask import request
# Import from the 21 Bitcoin Develper Library
#from two1.lib.wallet import Wallet
#from two1.lib.bitserv.flask import Payment
PORT = 5000
# Configure the app
app = Flask(__name__)
#wallet = Wallet()
#payment = Payment(app, wallet)
if __name__... | mit | Python |
996c505c72f7aac44c728e1e70684ce9d2beb106 | Add src test | max-andr/deepanswer,max-andr/deepanswer,max-andr/deepanswer | src/qa.py | src/qa.py | # test | apache-2.0 | Python | |
c9d554ca3ef0b2bee9d81b8c1fcf62c073fb132c | Fix things | james9909/IntroCTF,james9909/IntroCTF,james9909/IntroCTF,james9909/IntroCTF,james9909/IntroCTF,james9909/IntroCTF | problem-static/Intro-Eval/admin/eval.py | problem-static/Intro-Eval/admin/eval.py | #!/usr/bin/python2.7
import sys
# No sus things :)
del __builtins__.__dict__['__import__']
del __builtins__.__dict__['reload']
del __builtins__.__dict__['open']
del __builtins__.__dict__['file']
del __builtins__.__dict__['execfile']
del __builtins__.__dict__['eval']
flag = "eval_is_fun"
# Ignore this, just used to ... | #!/usr/bin/python2.7
import sys
# No sus things :)
del __builtins__.__dict__['__import__']
del __builtins__.__dict__['reload']
del __builtins__.__dict__['open']
del __builtins__.__dict__['file']
del __builtins__.__dict__['execfile']
del __builtins__.__dict__['eval']
flag = "eval_is_fun"
# Ignore this, just used to ... | mit | Python |
ba707752ece254adcb0dcbb2e55c87ea235e3107 | set l10n_br_data_account_product as installable | thinkopensolutions/l10n-brazil,thinkopensolutions/l10n-brazil,rvalyi/l10n-brazil,odoo-brazil/l10n-brazil-wip,rvalyi/l10n-brazil,odoo-brazil/l10n-brazil-wip | l10n_br_data_account_product/__openerp__.py | l10n_br_data_account_product/__openerp__.py | # -*- coding: utf-8 -*-
###############################################################################
# #
# Copyright (C) 2009 Renato Lima - Akretion #
# ... | # -*- coding: utf-8 -*-
###############################################################################
# #
# Copyright (C) 2009 Renato Lima - Akretion #
# ... | agpl-3.0 | Python |
875a66dbefac3d733a3904d7b49857f1c2ee383f | Update best-time-to-buy-and-sell-stock-ii.py | jaredkoontz/leetcode,kamyu104/LeetCode,githubutilities/LeetCode,kamyu104/LeetCode,jaredkoontz/leetcode,yiwen-luo/LeetCode,githubutilities/LeetCode,yiwen-luo/LeetCode,yiwen-luo/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,jaredkoontz/leetcode,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCod... | Python/best-time-to-buy-and-sell-stock-ii.py | Python/best-time-to-buy-and-sell-stock-ii.py | # Time: O(n)
# Space: O(1)
#
# Say you have an array for which the ith element is
# the price of a given stock on day i.
#
# Design an algorithm to find the maximum profit.
# You may complete as many transactions as you like
# (ie, buy one and sell one share of the stock multiple times).
# However, you may not eng... | # Time: O(n)
# Space: O(1)
#
# Say you have an array for which the ith element is
# the price of a given stock on day i.
#
# Design an algorithm to find the maximum profit.
# You may complete as many transactions as you like
# (ie, buy one and sell one share of the stock multiple times).
# However, you may not eng... | mit | Python |
b4e6ce402687fd006e7177266e45652d2d3342e9 | add new config option to mock test | mick-d/nipype,mick-d/nipype,mick-d/nipype,mick-d/nipype | nipype/pipeline/plugins/tests/test_base.py | nipype/pipeline/plugins/tests/test_base.py | # -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Tests for the engine module
"""
import numpy as np
import scipy.sparse as ssp
import re
import mock
import nipype.pipeline.plugins.base as pb
def test_scipy_sparse():
foo ... | # -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Tests for the engine module
"""
import numpy as np
import scipy.sparse as ssp
import re
import mock
import nipype.pipeline.plugins.base as pb
def test_scipy_sparse():
foo ... | bsd-3-clause | Python |
fea8dd08fcb458cd4e91f8409519dbe361a62769 | Enhance dataset tests (#25876) | ray-project/ray,ray-project/ray,ray-project/ray,ray-project/ray,ray-project/ray,ray-project/ray,ray-project/ray,ray-project/ray | python/ray/workflow/tests/test_dataset.py | python/ray/workflow/tests/test_dataset.py | from ray.tests.conftest import * # noqa
import pytest
import ray
from ray import workflow
@ray.remote
def gen_dataset():
return ray.data.range(1000).map(lambda x: x)
@ray.remote
def gen_dataset_1():
return ray.data.range(1000)
@ray.remote
def gen_dataset_2():
return ray.data.range_table(1000)
@ra... | from ray.tests.conftest import * # noqa
import pytest
import ray
from ray import workflow
@ray.remote
def gen_dataset():
# TODO(ekl) seems checkpointing hangs with nested refs of
# LazyBlockList.
return ray.data.range(1000).map(lambda x: x)
@ray.remote
def transform_dataset(in_data):
return in_da... | apache-2.0 | Python |
92ca855f5cebb843a612a7ac59dca931bd80d499 | allow for ?next=path for handling the post-login success url redirect | sleekslush/social-account | social/views/__init__.py | social/views/__init__.py | import oauth2
from django.conf import settings
from django.contrib.auth import authenticate, login
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.views.generic.base import View
SOCIAL_LOGIN_SUCCESS_KEY = 'social_login_success_url'
def reset_next_url(request):
... | import oauth2
from django.conf import settings
from django.contrib.auth import authenticate, login
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.views.generic.base import View
class OAuth2View(View):
def __init__(self):
self.client = oauth2.Client2(se... | bsd-3-clause | Python |
f771ccb9e7f9831a0048cc09f4bb0e3f9ffcfb28 | make kivy recipe depend on certifi, for https to work (#2055) | kivy/python-for-android,kronenpj/python-for-android,kronenpj/python-for-android,germn/python-for-android,rnixx/python-for-android,germn/python-for-android,PKRoma/python-for-android,kivy/python-for-android,PKRoma/python-for-android,germn/python-for-android,kivy/python-for-android,kivy/python-for-android,rnixx/python-for... | pythonforandroid/recipes/kivy/__init__.py | pythonforandroid/recipes/kivy/__init__.py | from pythonforandroid.recipe import CythonRecipe
from pythonforandroid.toolchain import current_directory, shprint
from os.path import exists, join, basename
import sh
import glob
class KivyRecipe(CythonRecipe):
version = '1.11.1'
url = 'https://github.com/kivy/kivy/archive/{version}.zip'
name = 'kivy'
... | from pythonforandroid.recipe import CythonRecipe
from pythonforandroid.toolchain import current_directory, shprint
from os.path import exists, join, basename
import sh
import glob
class KivyRecipe(CythonRecipe):
version = '1.11.1'
url = 'https://github.com/kivy/kivy/archive/{version}.zip'
name = 'kivy'
... | mit | Python |
931f84957eac7aad900a72e878bffd5a0a6d75ee | switch to the real agent | brohrer/becca,matt2000/becca | tester.py | tester.py | """
Created on Jan 11, 2012
@author: brandon_rohrer
A main test harness for a general reinforcement learning agent.
"""
import sys
import argparse
import logging
"""
selects the World that the Agent will be placed in
"""
from worlds.grid_1D import Grid_1D as worldcreator
#from worlds.grid_1D_ms import Grid_1D_m... | """
Created on Jan 11, 2012
@author: brandon_rohrer
A main test harness for a general reinforcement learning agent.
"""
import sys
import argparse
import logging
"""
selects the World that the Agent will be placed in
"""
#from worlds.grid_1D import Grid_1D as worldcreator
#from worlds.grid_1D_ms import Grid_1D_... | mit | Python |
7b6e67f95d36f11dd3dbee18dfc711fff3f7a1dc | bump version | sikuli/sieveable-tools,sieveable/sieveable-tools | Play-Listing-Scraper/playlistingscraper/__init__.py | Play-Listing-Scraper/playlistingscraper/__init__.py | __version__ = '0.4.2'
| __version__ = '0.4'
| mit | Python |
3ba5b6491bf61e2d2919f05bbf5cef088a754aeb | Add nologin in expected user shell test | infOpen/ansible-role-vsftpd | molecule/default/tests/test_installation.py | molecule/default/tests/test_installation.py | """
Role tests
"""
import os
import pytest
from testinfra.utils.ansible_runner import AnsibleRunner
testinfra_hosts = AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize('name', [
('vsftpd'),
('db5.3-util'),
])
def test_installed_packages(host, name):
"""
... | """
Role tests
"""
import os
import pytest
from testinfra.utils.ansible_runner import AnsibleRunner
testinfra_hosts = AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize('name', [
('vsftpd'),
('db5.3-util'),
])
def test_installed_packages(host, name):
"""
... | mit | Python |
373b6c3a9553470a706b4693239b39b2386585e2 | Stop prompting users to logout | siggame/webserver,siggame/webserver,siggame/webserver | webserver/urls.py | webserver/urls.py | from django.conf.urls.defaults import patterns, url, include
from django.contrib.auth.views import logout_then_login
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
# Webserver urls
url(r'^', include('webserver.home.urls')),
url(r'^'... | from django.conf.urls.defaults import patterns, url, include
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
# Webserver urls
url(r'^', include('webserver.home.urls')),
url(r'^', include('webserver.profiles.urls')),
url(r'^', inc... | bsd-3-clause | Python |
11edf71bf5f0f3e5b8097f67d3c15a19c6b45dd3 | set default width | xai/scripts,xai/scripts,xai/scripts | wrap.py | wrap.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 Olaf Lessenich <xai@linux.com>
#
# Distributed under terms of the MIT license.
import argparse
import textwrap
import os
from pathlib import Path
def wrap(inputfile, width):
content = Path(inputfile).read_text()
dedented_tex... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 Olaf Lessenich <xai@linux.com>
#
# Distributed under terms of the MIT license.
import argparse
import textwrap
import os
from pathlib import Path
def wrap(inputfile, width):
content = Path(inputfile).read_text()
dedented_tex... | mit | Python |
5c3683ae8630eed021ad5b4cf0f514e9c0517fa3 | Fix order of imports on wsgi | alphagov/notifications-admin,gov-cjwaszczuk/notifications-admin,alphagov/notifications-admin,gov-cjwaszczuk/notifications-admin,alphagov/notifications-admin,gov-cjwaszczuk/notifications-admin,gov-cjwaszczuk/notifications-admin,alphagov/notifications-admin | wsgi.py | wsgi.py | from credstash import getAllSecrets
import os
default_env_file = '/home/ubuntu/environment'
environment = 'live'
if os.path.isfile(default_env_file):
with open(default_env_file, 'r') as environment_file:
environment = environment_file.readline().strip()
# on aws get secrets and export to env
os.environ.... | import os
from credstash import getAllSecrets
from app import create_app
from config import configs
default_env_file = '/home/ubuntu/environment'
environment = 'live'
if os.path.isfile(default_env_file):
with open(default_env_file, 'r') as environment_file:
environment = environment_file.readline().stri... | mit | Python |
b81ce4092ea22c5c0a75db087878e68433ed9920 | Simplify the query by using filter_by | openstack/networking-odl,openstack/networking-odl,openstack/networking-odl | networking_odl/tests/unit/db/test_sqlite.py | networking_odl/tests/unit/db/test_sqlite.py | # Copyright 2016 Intel Corporation.
# Copyright 2016 Isaku Yamahata <isaku.yamahata at intel com>
# <isaku.yamahata at gmail com>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the Licen... | # Copyright 2016 Intel Corporation.
# Copyright 2016 Isaku Yamahata <isaku.yamahata at intel com>
# <isaku.yamahata at gmail com>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the Licen... | apache-2.0 | Python |
66d94e8c5464a42e28cde244e608e4ed808f81d0 | Update numba/tests/test_unpickle_without_module.py | numba/numba,numba/numba,cpcloud/numba,numba/numba,cpcloud/numba,cpcloud/numba,cpcloud/numba,numba/numba,cpcloud/numba,numba/numba | numba/tests/test_unpickle_without_module.py | numba/tests/test_unpickle_without_module.py | import unittest
import pickle
import sys
import tempfile
from pathlib import Path
class TestUnpickleDeletedModule(unittest.TestCase):
def test_loading_pickle_with_no_module(self):
"""Create a module that uses Numba, import a function from it.
Then delete the module and pickle the function. The fun... | import unittest
import pickle
import sys
import tempfile
from pathlib import Path
class TestUnpickleDeletedModule(unittest.TestCase):
def test_loading_pickle_with_no_module(self):
"""Create a module that uses Numba, import a function from it.
Then delete the module and pickle the function. The fun... | bsd-2-clause | Python |
3506c2cf31785145699bfc8638840c5ce0a13bda | fix flake 8 | sloria/osf.io,saradbowman/osf.io,erinspace/osf.io,brianjgeiger/osf.io,CenterForOpenScience/osf.io,chennan47/osf.io,saradbowman/osf.io,Johnetordoff/osf.io,Johnetordoff/osf.io,TomBaxter/osf.io,mfraezz/osf.io,adlius/osf.io,baylee-d/osf.io,HalcyonChimera/osf.io,leb2dg/osf.io,chennan47/osf.io,mfraezz/osf.io,laurenrevere/osf... | osf/management/commands/file_view_counts.py | osf/management/commands/file_view_counts.py | from __future__ import unicode_literals
import logging
import django
django.setup()
import json
import requests
import urllib
from django.core.management.base import BaseCommand
from django.db import transaction
from osf.models import BaseFileNode, PageCounter
from website import settings
from scripts import utils ... | from __future__ import unicode_literals
import logging
import django
django.setup()
import json
import requests
import urllib
from django.core.management.base import BaseCommand
from django.db import transaction
from osf.models import BaseFileNode, PageCounter
from website import settings
from keen import KeenClient... | apache-2.0 | Python |
3e18463fb0d754ac45e3c63d87d5751f9a0679a6 | use numexpr in metricize | micah541/Ricci,micah541/Ricci,micah541/Ricci,siudej/Ricci,siudej/Ricci,micah541/Ricci,siudej/Ricci,siudej/Ricci | tools.py | tools.py | """ Other helpful functions. """
import timeit
import numpy as np
import numexpr as ne
from numba import jit
def test(f, args_string):
""" Test the speed of a function. """
print f.__name__
t = timeit.repeat("%s(%s)" % (f.__name__, args_string),
repeat=5, number=1,
... | """ Other helpful functions. """
import timeit
import numpy as np
def test(f, args_string):
""" Test the speed of a function. """
print f.__name__
t = timeit.repeat("%s(%s)" % (f.__name__, args_string),
repeat=5, number=1,
setup="from __main__ import %s, %s" % ... | bsd-3-clause | Python |
3c9a8baef26940d28c1eb467e61013ddd7c7ad9c | fix ident bug | gtt116/rabbitclient | client.py | client.py | import json
import pprint
from kombu.messaging import Producer
from kombu import Exchange, Queue, Connection
exchange_name = 'neutron'
routing_key = 'neutron_notifications.info'
amqp_connection = 'amqp://guest:ntse@localhost'
conn = Connection(amqp_connection)
# get message
def get_mesage():
exchange = Exchange(... | import json
import pprint
from kombu.messaging import Producer
from kombu import Exchange, Queue, Connection
exchange_name = 'neutron'
routing_key = 'neutron_notifications.info'
amqp_connection = 'amqp://guest:ntse@localhost'
conn = Connection(amqp_connection)
# get message
def get_mesage():
exchange = Exchange(... | apache-2.0 | Python |
6f209daf1a5b42aa65d4bdcc0b5c5e77ed31937e | adjust integer_to_ascending_system_number: system from 1 | huiyiqun/permutation-algorithms | common.py | common.py | ###
# Common functions to be used by other script
###
def integer_to_ascending_system_number(integer):
'''
covert number integer to this kind of number,
whose system is ascending.
'''
assert type(integer) is int
def _itasn(integer):
system = 1
while integer:
yield i... | ###
# Common functions to be used by other script
###
def integer_to_ascending_system_number(integer):
'''
covert number integer to this kind of number,
whose system is ascending.
'''
assert type(integer) is int
def _itasn(integer):
system = 2
while integer:
yield i... | mit | Python |
e784d8b95205fc558c33e56ec66f687b8f198aca | Add copyright notice to common.py. | wt/repo-digg-dev-hackbuilder,wt/repo-digg-dev-hackbuilder | common.py | common.py | # Copyright 2012 Ooyala, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | DEFAULT_SOURCE_DIR = 'hack-source'
DEFAULT_BUILD_DIR = 'hack-build'
DEFAULT_PACKAGE_DIR = 'hack-packages'
| apache-2.0 | Python |
90a07c9ff98a2925085af04d6d5f74a406db7285 | Update _config.py | mattparrilla/wxGIF,mattparrilla/wxGIF | _config.py | _config.py | APP_KEY = ''
APP_SECRET = ''
twitter_keys = {
}
BASE_URL = 'http://radar.weather.gov/ridge/Conus/RadarImg/'
SAVE_TO_DIR = 'gif'
| APP_KEY = ''
APP_SECRET = ''
OAUTH_TOKEN = ''
OAUTH_TOKEN_SECRET = ''
| apache-2.0 | Python |
d626ddd5ca1ac345a5bd079d51dd1f11c58a55a7 | fix more errors in Human | IanDCarroll/xox | source/player_chair.py | source/player_chair.py | class Player(object):
def get_legal_moves(self, board):
legal_moves = []
for i in range(0, len(board)):
if board[i] == 0:
legal_moves.append(i)
return legal_moves
class Human(Player):
id = 'human'
def move(self, board):
square = raw_input("Whic... | class Player(object):
def get_legal_moves(self, board):
legal_moves = []
for i in range(0, len(board)):
if board[i] == 0:
legal_moves.append(i)
return legal_moves
class Human(Player):
id = 'human'
def move(self, board):
square = raw_input("Whic... | mit | Python |
a8d873e178d45024db9c0ef6a25c6867424785f7 | Add some paths where to find test binary | chubbymaggie/asap,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,ch... | bindings/python/llvm/tests/base.py | bindings/python/llvm/tests/base.py | import os.path
import unittest
POSSIBLE_TEST_BINARIES = [
'libreadline.so.5',
'libreadline.so.6',
]
POSSIBLE_TEST_BINARY_PATHS = [
'/usr/lib/debug',
'/lib',
'/usr/lib',
'/usr/local/lib',
'/lib/i386-linux-gnu',
]
class TestBase(unittest.TestCase):
def get_test_binary(self):
"""... | import os.path
import unittest
POSSIBLE_TEST_BINARIES = [
'libreadline.so.5',
'libreadline.so.6',
]
POSSIBLE_TEST_BINARY_PATHS = [
'/lib',
'/usr/lib',
'/usr/local/lib',
]
class TestBase(unittest.TestCase):
def get_test_binary(self):
"""Helper to obtain a test binary for object file te... | bsd-2-clause | Python |
8f6c1a0f913e31cbd53a7957595f295396092913 | rewrite read & write diary func | bambooom/OMOOC2py,bambooom/OMOOC2py | _src/om2py5w/5wex0/index.wsgi | _src/om2py5w/5wex0/index.wsgi | # -*- coding: utf-8 -*-
#!/usr/bin/env python
# author: bambooom
'''
MyDiary Web Application
Open web browser and access http://bambooomdiary.sinaapp.com/
You can read the old diary and input new diary
'''
from bottle import Bottle, request, route, run, template
import sae
import sae.kvdb
from time import localtime, s... | # -*- coding: utf-8 -*-
#!/usr/bin/env python
# author: bambooom
'''
MyDiary Web Application
Open web browser and access http://bambooomdiary.sinaapp.com/
You can read the old diary and input new diary
'''
from bottle import Bottle, request, route, run, template
import sae
import sae.kvdb
from time import localtime, s... | mit | Python |
b15872bff28628c468d3d485eae2f79efba41160 | Fix a misspelled variable name | girder/girder_worker,girder/girder_worker,girder/girder_worker | worker/server/constants.py | worker/server/constants.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | apache-2.0 | Python |
31c3e02f679567a0ebe334d804531435134ed730 | Cover all | kevinjqiu/mailchute,kevinjqiu/mailchute | mailchute/smtpd/mailchute.py | mailchute/smtpd/mailchute.py | import datetime
import smtpd
from email.parser import Parser
from mailchute import db
from mailchute import settings
from mailchute.model import RawMessage, IncomingEmail
from logbook import Logger
logger = Logger(__name__)
class MessageProcessor(object):
def _should_persist(self, recipient):
allowed_re... | import datetime
import smtpd
from email.parser import Parser
from mailchute import db
from mailchute import settings
from mailchute.model import RawMessage, IncomingEmail
from logbook import Logger
logger = Logger(__name__)
class MessageProcessor(object):
def _should_persist(self, recipient):
allowed_re... | bsd-3-clause | Python |
c1b9854fbac4d40309d15dd47af30a3a39237eea | Add time_as_datetime for debugging. | ericdill/databroker,ericdill/datamuxer,tacaswell/dataportal,danielballan/datamuxer,NSLS-II/datamuxer,NSLS-II/dataportal,danielballan/dataportal,ericdill/datamuxer,danielballan/datamuxer,danielballan/dataportal,tacaswell/dataportal,ericdill/databroker,NSLS-II/dataportal | databroker/broker/struct.py | databroker/broker/struct.py | import mongoengine
import datetime
class BrokerStruct(object):
"""
Copy the data out of a mongoengine.Document, including nested Documents,
but do not copy any of the mongo-specific methods or attributes.
"""
def __init__(self, mongo_document):
"""
Parameters
----------
... | import mongoengine
class BrokerStruct(object):
"""
Copy the data out of a mongoengine.Document, including nested Documents,
but do not copy any of the mongo-specific methods or attributes.
"""
def __init__(self, mongo_document):
"""
Parameters
----------
mongo_docum... | bsd-3-clause | Python |
2836216d33e95f8d85df30326f819f153aedc7c2 | fix script name | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/notification/tasks.py | dbaas/notification/tasks.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.conf import settings
import os
import logging
from celery import states
from celery.utils.log import get_task_logger
from celery.exceptions import SoftTimeLimitExceeded
from dbaas.celery import app
from util import call_script
from .util impo... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.conf import settings
import os
import logging
from celery import states
from celery.utils.log import get_task_logger
from celery.exceptions import SoftTimeLimitExceeded
from dbaas.celery import app
from util import call_script
from .util impo... | bsd-3-clause | Python |
76c0cc9cee1be14d34e64a8f5f81f65daaa2be86 | fix wall posting | olneyhymn/opc-history | tweet.py | tweet.py | import re
import datetime as dt
import twitter as tw
import os
def update_facebook(title, url):
import facebook
api = facebook.GraphAPI(os.environ["FACEBOOK_SECRET"].strip())
try:
api.put_object(
parent_object="me",
connection_name="feed",
message=f"Today in OP... | import re
import datetime as dt
import twitter as tw
import os
def update_facebook(title, url):
import facebook
api = facebook.GraphAPI(os.environ["FACEBOOK_SECRET"].strip())
try:
api.put_wall_post("", attachment={"link": url, "name": title})
return "Successfully posted to Facebook"
e... | unlicense | Python |
5ceff8fb1085308b610212150fafefc3cee0179e | Fix setup command | Tomcuzz/OctaHomeAutomation,Tomcuzz/OctaHomeAutomation,Tomcuzz/OctaHomeAutomation,Tomcuzz/OctaHomeAutomation | Core/management/commands/SetupDatabaseObjects.py | Core/management/commands/SetupDatabaseObjects.py | from django.core.management.base import BaseCommand, CommandError
from Account.models import *
from Weather.views import *
class Command(BaseCommand):
help = "This initialises a user account and weather locations"
def handle(self, *args, **options):
updateLocations()
user = CustomUser.objects.create_... | from django.core.management.base import BaseCommand, CommandError
#from Account.models import *
from Weather.views import *
class SetUpDatabase(BaseCommand):
help = "This initialises a user account and weather locations"
def add_arguments(self, parser):
parser.add_argument('Setup', nargs='+', type=i... | mit | Python |
b4c9b76d132668695b77d37d7db3071e629fcba7 | Allow to clear useless instances | atiberghien/makerscience-server,atiberghien/makerscience-server | makerscience_admin/models.py | makerscience_admin/models.py | # -*- coding: utf-8 -*-
from django.db import models
from django.db.models.signals import post_delete
from solo.models import SingletonModel
from accounts.models import ObjectProfileLink
from makerscience_forum.models import MakerSciencePost
class MakerScienceStaticContent (SingletonModel):
about = models.TextF... | # -*- coding: utf-8 -*-
from django.db import models
from solo.models import SingletonModel
class MakerScienceStaticContent (SingletonModel):
about = models.TextField(null=True, blank=True)
about_team = models.TextField(null=True, blank=True)
about_contact = models.TextField(null=True, blank=True)
abou... | agpl-3.0 | Python |
6aea257f9dac47206ffe55aefaae9d97edaf6d6a | Update mummy.py | airtonix/django-mummy-command | management/commands/mummy.py | management/commands/mummy.py | from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from model_mommy import mommy
class Command(BaseCommand):
args = '<modelpath modelpath:count ...>'
help = 'Generate model instances using model-mommy'
def handle(self, *args, **options):
for modelp... | """
1. Install model-mommy
`pip install model-mommy`
2. Use the command
`./manage mummy someotherapp.HilariousModelName:9000 yetanotherapp.OmgTheseModelNamesLawl:1`
"""
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from model_mommy import mommy
class ... | mit | Python |
760cb94fb83ee7038bfa10ae288b5e4a3ebf6752 | Fix StatusPage checker | marcopaz/is-service-up,marcopaz/is-service-up,marcopaz/is-service-up | isserviceup/services/models/statuspage.py | isserviceup/services/models/statuspage.py | import requests
from bs4 import BeautifulSoup
from isserviceup.services.models.service import Service, Status
class StatusPagePlugin(Service):
def get_status(self):
r = requests.get(self.status_url)
if r.status_code != 200:
return Status.unavailable
b = BeautifulSoup(r.conte... | import requests
from bs4 import BeautifulSoup
from isserviceup.services.models.service import Service, Status
class StatusPagePlugin(Service):
def get_status(self):
r = requests.get(self.status_url)
if r.status_code != 200:
return Status.unavailable
b = BeautifulSoup(r.conte... | apache-2.0 | Python |
c48f7c4f1c0d58ee6e4c2bdd9cb964fea33362c0 | Create tomato.py | itsKaspar/tomato,KasparRavel/tomato | tomato.py | tomato.py | #!/bin/python3
import argparse
import re
import random
import struct
from itertools import chain
#################
### ARGUMENTS ###
#################
parser = argparse.ArgumentParser(add_help=True)
parser.add_argument("file", help="input file")
parser.add_argument("-o", "--output", help="output file")
parser.add_ar... | #!/bin/python3
import argparse
import re
import random
import struct
from itertools import chain
#################
### ARGUMENTS ###
#################
parser = argparse.ArgumentParser(description="whatever baby")
parser.add_argument("file", help="input file")
parser.add_argument("-o", "--output", help="output file")... | mit | Python |
989a1d75a81da5bf889f7dae2d22a4afd6acc9ae | Fix sample run_summit_client.py script | josephl/summit-python | samples/twilio-sms/run_summit_backup.py | samples/twilio-sms/run_summit_backup.py | """
This sample application sends an SMS message to a recipient via a POST request.
Similar to Twilio's example, but uses the Summit API as a fallback if the
Twilio request fails.
To test, create a config file with account information in config.ini:
---------------------------------------------------------------------... | """
This sample application sends an SMS message to a recipient via a POST request.
Similar to Twilio's example, but uses the Summit API as a fallback if the
Twilio request fails.
To test, create a config file with account information in config.ini:
---------------------------------------------------------------------... | mit | Python |
321134a9527cc9a0c752f55f71f2f49c99a210a7 | fix model import | deepchem/deepchem,peastman/deepchem,peastman/deepchem,deepchem/deepchem | deepchem/models/__init__.py | deepchem/models/__init__.py | """
Gathers all models in one place for convenient imports
"""
# flake8: noqa
from deepchem.models.models import Model
try:
from deepchem.models.keras_model import KerasModel
from deepchem.models.multitask import SingletaskToMultitask
from deepchem.models.callbacks import ValidationCallback
from deepchem.model... | """
Gathers all models in one place for convenient imports
"""
# flake8: noqa
try:
from deepchem.models.models import Model
from deepchem.models.keras_model import KerasModel
from deepchem.models.multitask import SingletaskToMultitask
from deepchem.models.callbacks import ValidationCallback
from deepchem.mod... | mit | Python |
6ef4c4bdb34b07eb0af603d5a222c02c8600aab6 | fix path for importing MACCSKeysFingerprint | deepchem/deepchem,lilleswing/deepchem,peastman/deepchem,lilleswing/deepchem,peastman/deepchem,lilleswing/deepchem,deepchem/deepchem | deepchem/feat/molecule_featurizers/__init__.py | deepchem/feat/molecule_featurizers/__init__.py | # flake8: noqa
from deepchem.feat.molecule_featurizers.atomic_coordinates import AtomicCoordinates
from deepchem.feat.molecule_featurizers.bp_symmetry_function_input import BPSymmetryFunctionInput
from deepchem.feat.molecule_featurizers.circular_fingerprint import CircularFingerprint
from deepchem.feat.molecule_featuri... | # flake8: noqa
from deepchem.feat.molecule_featurizers.atomic_coordinates import AtomicCoordinates
from deepchem.feat.molecule_featurizers.bp_symmetry_function_input import BPSymmetryFunctionInput
from deepchem.feat.molecule_featurizers.circular_fingerprint import CircularFingerprint
from deepchem.feat.molecule_featuri... | mit | Python |
9fa296bfad85b42c04c325f1dfdd1caaa31bbd1b | Add modify code Google News Crawer | KuChanTung/Python | NSYSU.py | NSYSU.py | #test code
cast=["Cleese","Palin","Jones","Idle"]
print(cast)
cast.pop()
print(cast)
cast.extend(["Gillan","Chanpman"])
print(cast) | cast=["Cleese","Palin","Jones","Idle"]
print(cast)
cast.pop()
print(cast)
cast.extend(["Gillan","Chanpman"])
print(cast) | epl-1.0 | Python |
e3fe576ffde7309da0e84bc7370f9b6a9cce5fbf | Use int type for interval | mariusor/tlcal,lpbm/tlcal | tooter.py | tooter.py | from sys import argv
from argparse import ArgumentParser
from mastodon import Mastodon
from persist.mongowrapper import MongoWrapper
from datetime import datetime, timedelta
from liquid.scraper.html import Html as liquid_Html
from plusfw.scraper.html import Html as plusfw_Html
try:
from credentials import get_cred... | from sys import argv
from argparse import ArgumentParser
from mastodon import Mastodon
from persist.mongowrapper import MongoWrapper
from datetime import datetime, timedelta
from liquid.scraper.html import Html as liquid_Html
from plusfw.scraper.html import Html as plusfw_Html
try:
from credentials import get_cred... | mit | Python |
c3e81aee9852a94befdec9d9b2d3f9cd3d7914e2 | Change task to create a taskHistory object | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/system/tasks.py | dbaas/system/tasks.py | # -*- coding: utf-8 -*-
from dbaas.celery import app
from util.decorators import only_one
from models import CeleryHealthCheck
from notification.models import TaskHistory
import logging
LOG = logging.getLogger(__name__)
@app.task(bind=True)
@only_one(key="celery_healthcheck_last_update", timeout=20)
def set_celery_... | # -*- coding: utf-8 -*-
from dbaas.celery import app
from util.decorators import only_one
from models import CeleryHealthCheck
#from celery.utils.log import get_task_logger
#LOG = get_task_logger(__name__)
import logging
LOG = logging.getLogger(__name__)
@app.task(bind=True)
def set_celery_healthcheck_last_update... | bsd-3-clause | Python |
6270950097250c42f07f78616431545885ae014c | Fix comment in MCTS agent. | deepmind/open_spiel,deepmind/open_spiel,deepmind/open_spiel,deepmind/open_spiel,deepmind/open_spiel,deepmind/open_spiel | open_spiel/python/algorithms/mcts_agent.py | open_spiel/python/algorithms/mcts_agent.py | # Copyright 2022 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | # Copyright 2022 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | apache-2.0 | Python |
1e8837f08c0101d38116a852dd474dd49d754ea4 | Exclude build as well. | buddyup/dewey,buddyup/dewey | dewey/commands/bootstrap.py | dewey/commands/bootstrap.py | import subprocess
from clint.textui import puts, indent, colored
from .base import DeweyCommand
from dewey.util import suppress_stdout_stderr
class Command(DeweyCommand):
def pre_default(self, *args, **kwargs):
return "boot2docker init && boot2docker start --vbox-share=disable"
pass
def run... | import subprocess
from clint.textui import puts, indent, colored
from .base import DeweyCommand
from dewey.util import suppress_stdout_stderr
class Command(DeweyCommand):
def pre_default(self, *args, **kwargs):
return "boot2docker init && boot2docker start --vbox-share=disable"
pass
def run... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.