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 |
|---|---|---|---|---|---|---|---|---|
3ac069cf60206ca913c0ecb891ffaf2f365118eb | Fix problem with too long classpath while starting scala repl: python part | mateor/pants,15Dkatz/pants,lahosken/pants,tdyas/pants,landism/pants,UnrememberMe/pants,gmalmquist/pants,UnrememberMe/pants,gmalmquist/pants,benjyw/pants,ity/pants,dturner-tw/pants,wisechengyi/pants,pombredanne/pants,wisechengyi/pants,pantsbuild/pants,twitter/pants,ity/pants,benjyw/pants,foursquare/pants,lahosken/pants,... | src/python/pants/backend/jvm/tasks/scala_repl.py | src/python/pants/backend/jvm/tasks/scala_repl.py | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.j... | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.j... | apache-2.0 | Python |
7e0d848735d4df570d2efab0541b3e14c693e6e4 | make demo start/stoppable, avoids unneccessary load on browser/demoserver | rctk/demos | rctkdemos/controls_image.py | rctkdemos/controls_image.py | from rctkdemos.demos import serve_demo, standalone
from rctk.widgets import Image, Button
from rctk.resourceregistry import addResource, FileResource
class Demo(object):
title = "Image"
description = "Demonstrates the Image control"
def build(self, tk, parent):
self.running = False
resour... | import os
from rctkdemos.demos import serve_demo, standalone
from rctk.widgets import Image
from rctk.resourceregistry import addResource, FileResource
class Demo(object):
title = "Image"
description = "Demonstrates the Image control"
def build(self, tk, parent):
resources = [
addRes... | bsd-2-clause | Python |
4173ae3480794e9b85563ee736fff073ecf7619c | Update hash_utils.py | rishubhjain/commons,Tendrl/commons,r0h4n/commons | tendrl/commons/utils/hash_utils.py | tendrl/commons/utils/hash_utils.py | import hashlib
import json
def generate_obj_hash(etcd_obj):
if hasattr(etcd_obj, "hash"):
del etcd_obj.hash
if hasattr(etcd_obj, "updated_at"):
del etcd_obj.updated_at
_obj_str = "".join(sorted(etcd_obj.json))
return hashlib.md5(_obj_str).hexdigest()
| import hashlib
import json
def generate_obj_hash(etcd_obj):
_obj = json.loads(etcd_obj.json)
_obj.pop("hash", None)
_obj.pop("updated_at", None)
_obj_str = "".join(sorted(json.dumps(_obj)))
return hashlib.md5(_obj_str).hexdigest()
| lgpl-2.1 | Python |
69f0b40ba9176b957a27c28d0df19b35059bf6d6 | Set database_index when db is not 0 | open-telemetry/opentelemetry-python-contrib,open-telemetry/opentelemetry-python-contrib,open-telemetry/opentelemetry-python-contrib | instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py | instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py | # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | apache-2.0 | Python |
361ad68ec32fcd704e543c06b08b430fe4ba0c62 | Bump app version number. | joyxu/kernelci-backend,joyxu/kernelci-backend,kernelci/kernelci-backend,kernelci/kernelci-backend,joyxu/kernelci-backend | app/handlers/__init__.py | app/handlers/__init__.py | __version__ = "2015.5.1"
__versionfull__ = __version__
| __version__ = "2015.5"
__versionfull__ = __version__
| agpl-3.0 | Python |
03d123b3d04dea647d8ad4c41359fdae29982ae1 | Test error conditions on SpinBasisKet | mabuchilab/QNET | tests/algebra/test_spin_algebra.py | tests/algebra/test_spin_algebra.py | """Test the spin algebra"""
import pytest
from qnet import SpinSpace, SpinBasisKet, LocalSpace
def test_spin_basis_ket():
"""Test the properties of BasisKet for the example of a spin system"""
hs = SpinSpace('s', spin=(3, 2))
ket_lowest = SpinBasisKet(-3, 2, hs=hs)
assert ket_lowest.index == 0
as... | """Test the spin algebra"""
import pytest
from qnet import SpinSpace, SpinBasisKet
def test_spin_basis_ket():
"""Test the properties of BasisKet for the example of a spin system"""
hs = SpinSpace('s', spin=(3, 2))
ket_lowest = SpinBasisKet(-3, 2, hs=hs)
assert ket_lowest.index == 0
assert ket_low... | mit | Python |
01976204d1d56804a31c8e6899491a781f0796ca | Fix PyLint C0103 on `salt.runners.network` + PEP8. Refs #1775. | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/runners/network.py | salt/runners/network.py | '''
Network tools to run from the Master
'''
# Import python libs
import socket
# Import salt libs
import salt.utils
def wollist(maclist, bcast='255.255.255.255', destport=9):
'''
Send a "Magic Packet" to wake up a list of Minions.
This list must contain one MAC hardware address per line
CLI Exampl... | '''
Network tools to run from the Master
'''
# Import python libs
import socket
# Import salt libs
import salt.utils
def wollist(maclist, bcast='255.255.255.255', destport=9):
'''
Send a "Magic Packet" to wake up a list of Minions.
This list must contain one MAC hardware address per line
CLI Exampl... | apache-2.0 | Python |
c872b9991ec1a80d03906cebfb43e71335ba9c26 | Fix a CPython comparison test in CPython 3.3 which was apparently fixed only in 3.4 and later. | cython/cython,cython/cython,da-woods/cython,scoder/cython,cython/cython,scoder/cython,scoder/cython,cython/cython,da-woods/cython,da-woods/cython,scoder/cython,da-woods/cython | tests/run/generator_frame_cycle.py | tests/run/generator_frame_cycle.py | # mode: run
# tag: generator
import cython
import sys
def test_generator_frame_cycle():
"""
>>> test_generator_frame_cycle()
("I'm done",)
"""
testit = []
def whoo():
try:
yield
except:
yield
finally:
testit.append("I'm done")
g ... | # mode: run
# tag: generator
import cython
import sys
def test_generator_frame_cycle():
"""
>>> test_generator_frame_cycle()
("I'm done",)
"""
testit = []
def whoo():
try:
yield
except:
yield
finally:
testit.append("I'm done")
g ... | apache-2.0 | Python |
a90eafa386d750e1746dbcbec940eb8ec964bd00 | Update api | hs-hannover/salt-observer,hs-hannover/salt-observer,hs-hannover/salt-observer | salt_observer/cherry.py | salt_observer/cherry.py | import requests
from getpass import getpass
class SaltCherrypyApi(object):
BASE_URL = 'http://localhost:8989'
def __init__(self, username, password):
''' Log in every time an instance is created '''
self.token = self.obtain_auth_token(username, password)
def obtain_auth_token(self, user... | import requests
#from salt_observer.models import Minion
BASE_URL = 'localhost:8888'
def obtain_auth_token(username, password):
return requests.post(BASE_URL+'/login', headers={'Accept': 'application/json'}, data={
'username': username,
'password': password,
'eauth': 'pam'
}).json().... | mit | Python |
df93eb4220e143158014c776fc54d88d738928e4 | write scan_cols to return an analyzed list | IanDCarroll/xox | source/facilitator_credentials.py | source/facilitator_credentials.py | from math import sqrt
class Facilitator(object):
def scan_board(self, board):
analyzed_list = []
analyzed_list.extend(self.scan_rows(board))
analyzed_list.extend(self.scan_cols(board))
return analyzed_list
def scan_rows(self, board):
analyzed_rows = []
board_si... | from math import sqrt
class Facilitator(object):
def scan_board(self, board):
analyzed_list = []
analyzed_list.extend(self.scan_rows(board))
return analyzed_list
def scan_rows(self, board):
analyzed_rows = []
board_size = self.get_board_size(board)
start_index ... | mit | Python |
28545862a1b1ec406fb99d617ec8041f8ba10dbe | bump version | vmalloc/backslash-python,slash-testing/backslash-python | backslash/__version__.py | backslash/__version__.py | __version__ = "2.18.0"
| __version__ = "2.17.2"
| bsd-3-clause | Python |
66e5591eb9e459f36cec43d4c9e1d8dba82d6cff | Fix typos in scrapy/commands/setting.py | yidongliu/scrapy,IvanGavran/scrapy,kashyap32/scrapy,liyy7/scrapy,songfj/scrapy,nguyenhongson03/scrapy,johnardavies/scrapy,Geeglee/scrapy,eliasdorneles/scrapy,Lucifer-Kim/scrapy,Slater-Victoroff/scrapy,ssh-odoo/scrapy,starrify/scrapy,zackslash/scrapy,taito/scrapy,URXtech/scrapy,hyrole/scrapy,Bourneer/scrapy,rahulsharma1... | scrapy/commands/settings.py | scrapy/commands/settings.py | from __future__ import print_function
from scrapy.commands import ScrapyCommand
class Command(ScrapyCommand):
requires_project = False
default_settings = {'LOG_ENABLED': False}
def syntax(self):
return "[options]"
def short_desc(self):
return "Get settings values"
def add_option... | from __future__ import print_function
from scrapy.commands import ScrapyCommand
class Command(ScrapyCommand):
requires_project = False
default_settings = {'LOG_ENABLED': False}
def syntax(self):
return "[options]"
def short_desc(self):
return "Get settings values"
def add_option... | bsd-3-clause | Python |
4f6ce0558e95b00229727d2f2373b6536ae74d0e | Make ErrorNotification map-initializable | sherlocke/pywatson | pywatson/answer/error_notification.py | pywatson/answer/error_notification.py | from pywatson.util.map_initializable import MapInitializable
class ErrorNotification(MapInitializable):
def __init__(self, error, text):
self.error = error
self.text = text
@classmethod
def from_mapping(cls, error_mapping):
return cls(error=error_mapping['error'],
... | class ErrorNotification(object):
def __init__(self, error, text):
self.error = error
self.text = text
@classmethod
def from_mapping(cls, error_mapping):
return cls(error=error_mapping['error'],
text=error_mapping['text'])
| mit | Python |
589f62975f52e02ce01a9debb2ffa82ebe6ed699 | Fix PhJS re-trying | platformio/platformio-web,orgkhnargh/platformio-web,orgkhnargh/platformio-web,platformio/platformio-web,orgkhnargh/platformio-web | seo/escaped_fragment/app.py | seo/escaped_fragment/app.py | # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
from time import sleep
from subprocess import check_output, CalledProcessError
from urllib import unquote
class PhJSFailedException(Exception):
pass
def application(env, start_response):
status = "200 OK"
response = ""
qs = ... | # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
from time import sleep
from subprocess import check_output, CalledProcessError
from urllib import unquote
def application(env, start_response):
status = "200 OK"
response = ""
qs = env.get("QUERY_STRING", None)
if not qs or no... | apache-2.0 | Python |
4a1804a49be7be55964f1e7dc7a3a9417df1f37b | Create EvidenceRequest constructor | sherlocke/pywatson | pywatson/question/evidence_request.py | pywatson/question/evidence_request.py | class EvidenceRequest(object):
"""Include this with a Question to request evidence from Watson"""
def __init__(self, items=3, profile=False):
self.items = items
self.profile = profile
def __eq__(self, other):
return False
| class EvidenceRequest:
pass
| mit | Python |
1da55d2dbd66bcada18585ac96b9b54532609fd9 | Use host networking on docker runs to enable network access on AWS VPCs | alexandrucoman/bcbio-nextgen-vm,brainstorm/bcbio-nextgen-vm,fw1121/bcbio-nextgen-vm,alexandrucoman/bcbio-nextgen-vm,guillermo-carrasco/bcbio-nextgen-vm,guillermo-carrasco/bcbio-nextgen-vm,brainstorm/bcbio-nextgen-vm,fw1121/bcbio-nextgen-vm,chapmanb/bcbio-nextgen-vm,chapmanb/bcbio-nextgen-vm | bcbiovm/docker/manage.py | bcbiovm/docker/manage.py | """Manage stopping and starting a docker container for running analysis.
"""
from __future__ import print_function
import grp
import operator
import os
import pwd
import subprocess
from bcbio.provenance import do
def run_bcbio_cmd(image, mounts, bcbio_nextgen_args, ports=None):
"""Run command in docker container ... | """Manage stopping and starting a docker container for running analysis.
"""
from __future__ import print_function
import grp
import operator
import os
import pwd
import subprocess
from bcbio.provenance import do
def run_bcbio_cmd(image, mounts, bcbio_nextgen_args, ports=None):
"""Run command in docker container ... | mit | Python |
d1a108d49a89dd01abbd859a9add5b8bf5266de3 | Add CAN_DETECT | mr-karan/coala-bears,naveentata/coala-bears,coala/coala-bears,seblat/coala-bears,coala-analyzer/coala-bears,SanketDG/coala-bears,yash-nisar/coala-bears,shreyans800755/coala-bears,srisankethu/coala-bears,vijeth-aradhya/coala-bears,kaustubhhiware/coala-bears,shreyans800755/coala-bears,aptrishu/coala-bears,damngamerz/coal... | bears/lua/LuaLintBear.py | bears/lua/LuaLintBear.py | from coalib.bearlib.abstractions.Linter import linter
@linter(executable='luacheck',
use_stdin=True,
output_format='regex',
output_regex=r'stdin:(?P<line>\d+):(?P<column>\d+)-'
r'(?P<end_column>\d+): '
r'\((?P<severity>[WE])(?P<origin>\d+)\) (?P<messag... | from coalib.bearlib.abstractions.Linter import linter
@linter(executable='luacheck',
use_stdin=True,
output_format='regex',
output_regex=r'stdin:(?P<line>\d+):(?P<column>\d+)-'
r'(?P<end_column>\d+): '
r'\((?P<severity>[WE])(?P<origin>\d+)\) (?P<messag... | agpl-3.0 | Python |
d59560fc91a46017105dcc5db649c0b283a0b0c1 | configure log output | tschaefer/beets-store,tschaefer/beets-store | beetsplug/store/utils.py | beetsplug/store/utils.py | # -*- coding: utf-8 -*-
import beets
import flask
import os
from logging.config import dictConfig
dictConfig({
'version': 1,
'formatters': {'default': {
'format': '%(message)s',
}},
'handlers': {'wsgi': {
'class': 'logging.StreamHandler',
'stream': 'ext://flask.logging.wsgi_e... | # -*- coding: utf-8 -*-
import beets
import flask
import os
def request_is_json():
best = flask.request.accept_mimetypes.best_match(
["application/json", "text/html"]
)
return (
best == "application/json"
and flask.request.accept_mimetypes[best]
> flask.request.accept_mime... | bsd-3-clause | Python |
fc3fd9fc86c17d49366fa19c5de039aced2b06fe | fix over enthusiastic code cleanup | caktus/rapidsms,catalpainternational/rapidsms,catalpainternational/rapidsms,lsgunth/rapidsms,caktus/rapidsms,eHealthAfrica/rapidsms,lsgunth/rapidsms,ehealthafrica-ci/rapidsms,lsgunth/rapidsms,catalpainternational/rapidsms,lsgunth/rapidsms,peterayeni/rapidsms,ehealthafrica-ci/rapidsms,peterayeni/rapidsms,peterayeni/rapi... | rapidsms/contrib/messagelog/models.py | rapidsms/contrib/messagelog/models.py | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
from django.db import models
from django.core.exceptions import ValidationError
from rapidsms.models import Contact, Connection
DIRECTION_CHOICES = (
("I", "Incoming"),
("O", "Outgoing"))
class Message(models.Model):
contact = models.ForeignKey(Contac... | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
from django.db import models
from django.core.exceptions import ValidationError
from rapidsms.models import Contact, Connection
DIRECTION_CHOICES = (
("I", "Incoming"),
("O", "Outgoing"))
class Message(models.Model):
contact = models.ForeignKey(Contac... | bsd-3-clause | Python |
d549855e9ba23d5a1a76773b7600d381028bc0e5 | Fix unicode csv issue | vineetm/dl4mt-material,vineetm/dl4mt-material,vineetm/dl4mt-material,vineetm/dl4mt-material,vineetm/dl4mt-material | session2/generate_report.py | session2/generate_report.py | import argparse, logging, codecs
import unicodecsv as csv
from translation_model import TranslationModel
def setup_args():
parser = argparse.ArgumentParser()
parser.add_argument('model', help='trained model')
parser.add_argument('input', help='input text file')
parser.add_argument('gold', help='gold s... | import argparse, logging, csv, codecs
from translation_model import TranslationModel
def setup_args():
parser = argparse.ArgumentParser()
parser.add_argument('model', help='trained model')
parser.add_argument('input', help='input text file')
parser.add_argument('gold', help='gold standard for input fi... | bsd-3-clause | Python |
7a83a32d321bff64bca1f8c60bca8df29066f1f5 | Update cybergis-script-geoshape-configure.py | state-hiu/cybergis-scripts,state-hiu/cybergis-scripts | bin/cybergis-script-geoshape-configure.py | bin/cybergis-script-geoshape-configure.py | #!/usr/bin/python
from base64 import b64encode
from optparse import make_option
import json
import urllib
import urllib2
import argparse
import time
import os
import sys
import subprocess
#==#
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'lib', 'cybergis')))
import geoshape._geoshape_co... | #!/usr/bin/python
from base64 import b64encode
from optparse import make_option
import json
import urllib
import urllib2
import argparse
import time
import os
import sys
import subprocess
#==#
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'lib', 'cybergis')))
import geoshape._geoshape_co... | mit | Python |
362641f08eaca3683ed9da5822e154169deb6e1c | disable pylint eval warnings | OpenPymeMx/account-financial-tools,acsone/account-financial-tools,OpenPymeMx/account-financial-tools,acsone/account-financial-tools,acsone/account-financial-tools,OpenPymeMx/account-financial-tools | currency_rate_update/services/currency_getter.py | currency_rate_update/services/currency_getter.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009 CamptoCamp. All rights reserved.
# @author Nicolas Bessi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Publi... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009 CamptoCamp. All rights reserved.
# @author Nicolas Bessi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Publi... | agpl-3.0 | Python |
5056218318c631f303c0f327fec6fcad44263e4e | fix yahoo dataset (#1551) | pytorch/text,pytorch/text,pytorch/text,pytorch/text | torchtext/datasets/yahooanswers.py | torchtext/datasets/yahooanswers.py | from torchtext._internal.module_utils import is_module_available
from typing import Union, Tuple
if is_module_available("torchdata"):
from torchdata.datapipes.iter import FileOpener, GDriveReader, IterableWrapper
from torchtext.data.datasets_utils import (
_wrap_split_argument,
_add_docstring_header,
... | from torchtext._internal.module_utils import is_module_available
from typing import Union, Tuple
if is_module_available("torchdata"):
from torchdata.datapipes.iter import FileOpener, GDriveReader, IterableWrapper
from torchtext.data.datasets_utils import (
_wrap_split_argument,
_add_docstring_header,
... | bsd-3-clause | Python |
9e0ed917fc76fbd450fdfb86b010de246da28b2c | fix balance dataet | Zhenxingzhang/kaggle-cdiscount-classification,Zhenxingzhang/kaggle-cdiscount-classification | src/data_preparation/balance_dataset.py | src/data_preparation/balance_dataset.py | import argparse
import bson
from tqdm import tqdm
import random
from bson import BSON
from random import shuffle
def random_keep_n_product(prod_list, r_size):
if len(prod_list) > r_size:
return [prod_list[i] for i in sorted(random.sample(xrange(len(prod_list)), r_size))]
else:
return prod_list... | import argparse
import bson
from tqdm import tqdm
import random
from bson import BSON
from random import shuffle
def random_keep_n_product(prod_list, r_size):
if len(prod_list) > r_size:
return [prod_list[i] for i in sorted(random.sample(xrange(len(prod_list)), r_size))]
else:
return prod_list... | apache-2.0 | Python |
e07db6a58217baf555b424d66f8996ec4bc7a02f | Drop json, bump copyright and Python version for intersphinx | edgedb/edgedb,edgedb/edgedb,edgedb/edgedb | edgedb/lang/common/doc/sphinx/default_conf.py | edgedb/lang/common/doc/sphinx/default_conf.py | ##
# Copyright (c) 2011 Sprymix Inc.
# All rights reserved.
#
# See LICENSE for details.
##
"""Default Sphinx configuration file for metamagic projects"""
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo',
'sphinx.ext.coverage', 'sphinx.ext.viewcode',
'sphinx.ext.intersphinx']
temp... | ##
# Copyright (c) 2011 Sprymix Inc.
# All rights reserved.
#
# See LICENSE for details.
##
"""Default Sphinx configuration file for metamagic projects"""
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo',
'sphinx.ext.coverage', 'sphinx.ext.viewcode',
'sphinx.ext.intersphinx']
temp... | apache-2.0 | Python |
bfafbd761448ffbea0c042db42435e5cde9bbfbf | Replace ftp.pcre.org with a different source for pcre 8.44 now that it is no longer available. | hdl/bazel_rules_hdl,hdl/bazel_rules_hdl,hdl/bazel_rules_hdl,hdl/bazel_rules_hdl | dependency_support/org_pcre_ftp/org_pcre_ftp.bzl | dependency_support/org_pcre_ftp/org_pcre_ftp.bzl | # Copyright 2021 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, ... | # Copyright 2021 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, ... | apache-2.0 | Python |
d701831fb8835ccd4095ed0e00e7c97dc5df98a9 | Print previous, current states when terminating | vasiliykochergin/euca2ools,nagyistoce/euca2ools,vasiliykochergin/euca2ools,jhajek/euca2ools,jhajek/euca2ools,gholms/euca2ools,gholms/euca2ools,nagyistoce/euca2ools | euca2ools/commands/euca/terminateinstances.py | euca2ools/commands/euca/terminateinstances.py | # Software License Agreement (BSD License)
#
# Copyright (c) 20092011, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
# without modification, are permitted provided that the following conditions
# are met:
#
# Redistributions of source c... | # Software License Agreement (BSD License)
#
# Copyright (c) 20092011, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
# without modification, are permitted provided that the following conditions
# are met:
#
# Redistributions of source c... | bsd-2-clause | Python |
70ce7e209906e80b53248944410e6aea0202a0a0 | add version 4.12.0 (#6388) | LLNL/spack,LLNL/spack,krafczyk/spack,EmreAtes/spack,LLNL/spack,matthiasdiener/spack,EmreAtes/spack,tmerrick1/spack,LLNL/spack,mfherbst/spack,iulian787/spack,matthiasdiener/spack,iulian787/spack,matthiasdiener/spack,krafczyk/spack,krafczyk/spack,matthiasdiener/spack,tmerrick1/spack,mfherbst/spack,mfherbst/spack,EmreAtes... | var/spack/repos/builtin/packages/meme/package.py | var/spack/repos/builtin/packages/meme/package.py | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | Python |
dae596dfa6eee7d5adfec8ad6f67dbd28323dfd5 | fix oops | mono/bockbuild,mono/bockbuild,BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild | packages/mono-master.py | packages/mono-master.py | import os
class MonoMasterPackage(Package):
def __init__(self):
Package.__init__(self, 'mono', os.getenv('MONO_VERSION'),
sources = [os.getenv('MONO_REPOSITORY') or 'git://github.com/mono/mono.git'],
revision = os.getenv('MONO_BUILD_REVISION'),
configure_flags = [
'--enable-nls=no',
'--with-ikvm=y... | import os
class MonoMasterPackage(Package):
def __init__(self):
Package.__init__(self, 'mono', os.getenv('MONO_VERSION'),
sources = [os.getenv('MONO_REPOSITORY') or 'git://github.com/mono/mono.git'],
revision = os.getenv('MONO_BUILD_REVISION'),
configure_flags = [
'--enable-nls=no',
'--with-ikvm=y... | mit | Python |
5b5d471cacbe6cdeeb5ff243a56ea7eb67774cb4 | fix error constractor parameter | nakagami/minipg | minipg/err.py | minipg/err.py | class Error(Exception):
def __init__(self, *args):
super(Error, self).__init__(*args)
if len(args) > 0:
self.message = args[0]
else:
self.message = b'Database Error'
if len(args) > 1:
self.code = args[1]
else:
self.code = ''
... | class Error(Exception):
def __init__(self, *args):
super(Error, self).__init__(*args)
if len(args) > 0:
self.message = args[0]
else:
self.message = b'Database Error'
if len(args) > 1:
self.code = args[1]
else:
self.code = ''
... | mit | Python |
c2edc7a7ac831186b0922539dfb15e9123e43c1f | add somes changes | Mickaelh51/wazo-admin-ui-jitsi-meet,Mickaelh51/wazo-admin-ui-jitsi-meet,Mickaelh51/wazo-admin-ui-jitsi-meet | wazo_plugind_admin_ui_jitsi_meet_mickael/view.py | wazo_plugind_admin_ui_jitsi_meet_mickael/view.py | # -*- coding: utf-8 -*-
# Copyright 2017 The HUBERT Mickael (see the AUTHORS file)
# SPDX-License-Identifier: MIT
from __future__ import unicode_literals
from flask_menu.classy import classy_menu_item
from wazo_admin_ui.helpers.classful import BaseView, IndexAjaxViewMixin
from .form import JitsiMeetForm
class Ji... | # -*- coding: utf-8 -*-
# Copyright 2017 The HUBERT Mickael (see the AUTHORS file)
# SPDX-License-Identifier: MIT
from __future__ import unicode_literals
from flask_menu.classy import classy_menu_item
from wazo_admin_ui.helpers.classful import BaseView, IndexAjaxViewMixin
class JitsiMeetView(IndexAjaxViewMixin, B... | mit | Python |
2376a753b0710430fc26119f940c7c1a85972f19 | fix regular expression | sdpython/pymyinstall,sdpython/pymyinstall,sdpython/pymyinstall,sdpython/pymyinstall | src/pymyinstall/installhelper/install_cmd_regex.py | src/pymyinstall/installhelper/install_cmd_regex.py | """
@file
@brief Regular expressions to extract version numbers
"""
regex_wheel_version = "[-]([0-9]+[.][abc0-9]+([.][0-9])?([.][0-9abdevcr]+)?)([+][a-z]+)?([+]cuda[0-9]{2,5})?([+]sdl[0-9])?([+.]post[0-9]{1,2})?[-]"
| """
@file
@brief Regular expressions to extract version numbers
"""
regex_wheel_version = "[-]([0-9]+[.][abc0-9]+([.][0-9])?([.][0-9abdevcr]+)?)([+]contrib)?([+]mkl)?([+]openblas)?([+]cuda[0-9]{2,5})?([+]sdl[0-9])?([+.]post[0-9]{1,2})?[-]"
| mit | Python |
1fb69dfcc7cb0370ad28a51d797e5c8d4ab027c1 | add black reformatting | llazzaro/django-scheduler,llazzaro/django-scheduler,llazzaro/django-scheduler | schedule/migrations/0008_gfk_index.py | schedule/migrations/0008_gfk_index.py | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("contenttypes", "0002_remove_content_type_name"),
("schedule", "0007_merge_text_fields"),
]
operations = [
migrations.AlterField(
model_name="calendarrelation",
... | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("contenttypes", "0002_remove_content_type_name"),
("schedule", "0007_merge_text_fields"),
]
operations = [
migrations.AlterField(
model_name="calendarrelation",
... | bsd-3-clause | Python |
88f699690a48bc9e204c561443a53ca03dcf1ae6 | Add fuzz calls for SBType::IsPointerType(void *opaque_type). | llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb | test/python_api/default-constructor/sb_type.py | test/python_api/default-constructor/sb_type.py | """
Fuzz tests an object after the default construction to make sure it does not crash lldb.
"""
import sys
import lldb
def fuzz_obj(obj):
obj.GetName()
obj.GetByteSize()
#obj.GetEncoding(5)
obj.GetNumberChildren(True)
member = lldb.SBTypeMember()
obj.GetChildAtIndex(True, 0, member)
obj.G... | """
Fuzz tests an object after the default construction to make sure it does not crash lldb.
"""
import sys
import lldb
def fuzz_obj(obj):
obj.GetName()
obj.GetByteSize()
#obj.GetEncoding(5)
obj.GetNumberChildren(True)
member = lldb.SBTypeMember()
obj.GetChildAtIndex(True, 0, member)
obj.G... | apache-2.0 | Python |
4636c9394138534fc39cc5bdac373b97919ffd01 | Modify django orm filter, add only | istommao/codingcatweb,istommao/codingcatweb,istommao/codingcatweb | server/info/services.py | server/info/services.py | """info services."""
from info.models import Article, News, Column
def get_column_object(uid):
"""Get column object."""
try:
obj = Column.objects.get(uid=uid)
except Column.DoesNotExist:
obj = None
return obj
def get_articles_by_column(uid):
"""Get_articles_by_column."""
quer... | """info services."""
from info.models import Article, News, Column
def get_column_object(uid):
"""Get column object."""
try:
obj = Column.objects.get(uid=uid)
except Column.DoesNotExist:
obj = None
return obj
def get_articles_by_column(uid):
"""Get_articles_by_column."""
quer... | mit | Python |
b46727a6bf8c1d85e0f9f8828954440bc489f247 | Change User.avatar to be a property | zooniverse/panoptes-python-client | panoptes_client/user.py | panoptes_client/user.py | from __future__ import absolute_import, division, print_function
from panoptes_client.panoptes import PanoptesObject, LinkResolver
class User(PanoptesObject):
_api_slug = 'users'
_link_slug = 'users'
_edit_attributes = ()
@property
def avatar(self):
return User.http_get('{}/avatar'.forma... | from __future__ import absolute_import, division, print_function
from panoptes_client.panoptes import PanoptesObject, LinkResolver
class User(PanoptesObject):
_api_slug = 'users'
_link_slug = 'users'
_edit_attributes = ()
def avatar(self):
return User.http_get('{}/avatar'.format(self.id))[0]... | apache-2.0 | Python |
23d857181af141f2a264585f01d63b0a01d2e77c | Fix Flask local resource relative path (#2605) | GoogleCloudPlatform/python-docs-samples,GoogleCloudPlatform/python-docs-samples,GoogleCloudPlatform/python-docs-samples,GoogleCloudPlatform/python-docs-samples | codelabs/functions/python_powered/main.py | codelabs/functions/python_powered/main.py | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 | Python |
5758822bc9f9cae019fe787967d919d11f7a7520 | Improve `generate` command test coverage | igordejanovic/textX,igordejanovic/textX,igordejanovic/textX | tests/functional/registration/test_generate.py | tests/functional/registration/test_generate.py | """
Tests for `generate` command.
"""
import os
import pytest
from textx.cli import textx
from click.testing import CliRunner
this_folder = os.path.abspath(os.path.dirname(__file__))
@pytest.fixture
def model_file():
os.remove(os.path.join(this_folder,
'projects', 'flow_dsl', 'tests',
... | """
Tests for `generate` command.
"""
import os
from textx.cli import textx
from click.testing import CliRunner
this_folder = os.path.abspath(os.path.dirname(__file__))
def test_generator_registered():
"""
That that generator from flow to PlantUML is registered
"""
runner = CliRunner()
result = r... | mit | Python |
557ae64d51f4b53eb7836b9b56b0a536836b3c55 | Fix cube compiler configuration | tmerrick1/spack,skosukhin/spack,lgarren/spack,matthiasdiener/spack,mfherbst/spack,skosukhin/spack,iulian787/spack,tmerrick1/spack,mfherbst/spack,iulian787/spack,matthiasdiener/spack,matthiasdiener/spack,iulian787/spack,lgarren/spack,skosukhin/spack,matthiasdiener/spack,lgarren/spack,krafczyk/spack,mfherbst/spack,mfherb... | var/spack/packages/cube/package.py | var/spack/packages/cube/package.py | # FIXME: Add copyright statement
#
from spack import *
from contextlib import closing
class Cube(Package):
"""Cube the profile viewer for Score-P and Scalasca profiles. It
displays a multi-dimensional performance space consisting
of the dimensions (i) performance metric, (ii) call path,
and... | # FIXME: Add copyright statement
#
from spack import *
class Cube(Package):
"""Cube the profile viewer for Score-P and Scalasca profiles. It
displays a multi-dimensional performance space consisting
of the dimensions (i) performance metric, (ii) call path,
and (iii) system resource."""
... | lgpl-2.1 | Python |
22230205402f7de77049da9c0f716d4fdc3099c3 | Check if build number exists | devopsconsulting/vdt.versionplugin.wheel | vdt/versionplugin/wheel/package.py | vdt/versionplugin/wheel/package.py | from glob import glob
import imp
import logging
import os
import subprocess
import mock
from setuptools import setup as _setup
from vdt.versionplugin.wheel.shared import parse_version_extra_args
from vdt.versionplugin.wheel.utils import WheelRunningDistribution
logger = logging.getLogger(__name__)
def build_packa... | from glob import glob
import imp
import logging
import os
import subprocess
import mock
from setuptools import setup as _setup
from vdt.versionplugin.wheel.shared import parse_version_extra_args
from vdt.versionplugin.wheel.utils import WheelRunningDistribution
logger = logging.getLogger(__name__)
def build_packa... | bsd-3-clause | Python |
8065ea82a2a06cac73719925e7c7b0119dbb9b86 | handle values greater than max_time | antljones/physics | velocity_and_distance_from_rest.py | velocity_and_distance_from_rest.py | import sys
import argparse
import math
heavenly_body = {'mercury' : 3.7,
'venus' : 8.87,
'earth' : 9.8,
'mars' : 3.71,
'jupiter' : 24.79,
'saturn' : 10.44,
'uranus' : 8.87,
'neptune' : 11.15,
'moon' : 1.624
}
#Set the argument parser and comm... | import sys
import argparse
import math
heavenly_body = {'mercury' : 3.7,
'venus' : 8.87,
'earth' : 9.8,
'mars' : 3.71,
'jupiter' : 24.79,
'saturn' : 10.44,
'uranus' : 8.87,
'neptune' : 11.15,
'moon' : 1.624
}
#Set the argument parser and comm... | apache-2.0 | Python |
6d88ac6cc8141af181cf6f54e56ebd0f62999ac3 | Allow br tags | ScorpionResponse/freelancefinder,ScorpionResponse/freelancefinder,ScorpionResponse/freelancefinder | freelancefinder/jobs/templatetags/markdown.py | freelancefinder/jobs/templatetags/markdown.py | """Markdown template filter."""
from django import template
from django.utils.safestring import mark_safe
import bleach
import markdown
register = template.Library()
ADDITIONAL_TAGS = ['p', 'br']
@register.filter(name='markdown')
def markdown_filter(value):
"""Convert markdown value to html."""
rendered_h... | """Markdown template filter."""
from django import template
from django.utils.safestring import mark_safe
import bleach
import markdown
register = template.Library()
@register.filter(name='markdown')
def markdown_filter(value):
"""Convert markdown value to html."""
rendered_html = markdown.markdown(value)
... | bsd-3-clause | Python |
d528cf8c1e357208d3fb1a0f510dc40d9d6ee5b2 | Test all country template's reforms on WebAPI | openfisca/openfisca-core,openfisca/openfisca-core | tests/web_api/case_with_reform/test_reforms.py | tests/web_api/case_with_reform/test_reforms.py | import http
import pytest
from openfisca_core import scripts
from openfisca_web_api import app
TEST_COUNTRY_PACKAGE_NAME = "openfisca_country_template"
TEST_REFORMS_PATHS = [
f"{TEST_COUNTRY_PACKAGE_NAME}.reforms.add_dynamic_variable.add_dynamic_variable",
f"{TEST_COUNTRY_PACKAGE_NAME}.reforms.add_new_tax.add... | import http
import pytest
from openfisca_core import scripts
from openfisca_web_api import app
TEST_COUNTRY_PACKAGE_NAME = "openfisca_country_template"
TEST_REFORMS_PATHS = [
f"{TEST_COUNTRY_PACKAGE_NAME}.reforms.add_dynamic_variable.add_dynamic_variable",
f"{TEST_COUNTRY_PACKAGE_NAME}.reforms.add_new_tax.add... | agpl-3.0 | Python |
810f5497cec4fe82cdfab0eb352f74195b2829a2 | Improve grep regexp by using lookbehind and lookahead to have non-capturing character groups for quotation marks and spaces. | peterhil/prism | prism/grep.py | prism/grep.py | #!/usr/bin/env python -u
# encoding: utf-8
#
# Copyright (c) 2012, Peter Hillerström <peter.hillerstrom@gmail.com>
# All rights reserved. This software is licensed under 3-clause BSD license.
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
... | #!/usr/bin/env python -u
# encoding: utf-8
#
# Copyright (c) 2012, Peter Hillerström <peter.hillerstrom@gmail.com>
# All rights reserved. This software is licensed under 3-clause BSD license.
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
... | bsd-3-clause | Python |
6216f8b396ed2f09779b781aaf9caedd090be90c | Handle Refs without values. | vrtsystems/hszinc,vrtsystems/hszinc | src/hszinc/datatypes.py | src/hszinc/datatypes.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Zinc data types
# (C) 2016 VRT Systems
#
# vim: set ts=4 sts=4 et tw=78 sw=4 si:
class Quantity(object):
'''
A quantity is a scalar value (floating point) with a unit.
'''
def __init__(self, value, unit):
self.value = value
self.unit = unit
... | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Zinc data types
# (C) 2016 VRT Systems
#
# vim: set ts=4 sts=4 et tw=78 sw=4 si:
class Quantity(object):
'''
A quantity is a scalar value (floating point) with a unit.
'''
def __init__(self, value, unit):
self.value = value
self.unit = unit
... | bsd-2-clause | Python |
70d76387d941f493fd25b5da1a93c1da6d744bff | Update downloadable clang to r334100. | snnn/tensorflow,dongjoon-hyun/tensorflow,ppwwyyxx/tensorflow,xzturn/tensorflow,ageron/tensorflow,lukeiwanski/tensorflow,benoitsteiner/tensorflow-xsmm,chemelnucfin/tensorflow,tensorflow/tensorflow,DavidNorman/tensorflow,arborh/tensorflow,manipopopo/tensorflow,Intel-Corporation/tensorflow,yongtang/tensorflow,DavidNorman/... | third_party/clang_toolchain/download_clang.bzl | third_party/clang_toolchain/download_clang.bzl | """ Helpers to download a recent clang release."""
def _get_platform_folder(os_name):
os_name = os_name.lower()
if os_name.startswith('windows'):
return 'Win'
if os_name.startswith('mac os'):
return 'Mac'
if not os_name.startswith('linux'):
fail('Unknown platform')
return 'Linux_x64'
def _downlo... | """ Helpers to download a recent clang release."""
def _get_platform_folder(os_name):
os_name = os_name.lower()
if os_name.startswith('windows'):
return 'Win'
if os_name.startswith('mac os'):
return 'Mac'
if not os_name.startswith('linux'):
fail('Unknown platform')
return 'Linux_x64'
def _downlo... | apache-2.0 | Python |
8b241df500faf0e7bbe27e62f1fee34acd955799 | Update urls file to the Django 1.8 template | linovia/cookiecutter-django-linovia | {{cookiecutter.repo_name}}/{{cookiecutter.project_name}}/urls.py | {{cookiecutter.repo_name}}/{{cookiecutter.project_name}}/urls.py | """{{cookiecutter.project_name}} URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, ... | from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
# Examples:
# url(r'^$', '{{cookiecutter.project_name}}.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
]
| mit | Python |
0069ff1d0ca5152a4c9d45c863b7a09905a99ac8 | add a type | fengkaicnic/traffic,fengkaicnic/traffic | traffic/api/openstack/compute/viewer/tqdisc.py | traffic/api/openstack/compute/viewer/tqdisc.py |
import itertools
from traffic.api.openstack import common
from traffic import flags
from traffic.openstack.common import log as logging
FLAGS = flags.FLAGS
LOG = logging.getLogger(__name__)
class ViewBuilder(common.ViewBuilder):
_collection_name = 'tqdisc'
def basic(self, request, tr... |
import itertools
from traffic.api.openstack import common
from traffic import flags
from traffic.openstack.common import log as logging
FLAGS = flags.FLAGS
LOG = logging.getLogger(__name__)
class ViewBuilder(common.ViewBuilder):
_collection_name = 'tqdisc'
def basic(self, request, tr... | apache-2.0 | Python |
baaa613e445f8a00baf22efe61e8e16a3ee87591 | Update wx to 3.1.0 (#2641) | lgarren/spack,iulian787/spack,EmreAtes/spack,krafczyk/spack,EmreAtes/spack,LLNL/spack,TheTimmy/spack,mfherbst/spack,lgarren/spack,krafczyk/spack,iulian787/spack,EmreAtes/spack,matthiasdiener/spack,mfherbst/spack,TheTimmy/spack,TheTimmy/spack,mfherbst/spack,skosukhin/spack,tmerrick1/spack,lgarren/spack,LLNL/spack,skosuk... | var/spack/repos/builtin/packages/wx/package.py | var/spack/repos/builtin/packages/wx/package.py | ##############################################################################
# Copyright (c) 2013-2016, 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-2016, 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 |
86277a417ce563bf2cb21d6f38b6f46d77109853 | Add db logging to local conf | sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer | config/settings/local.py | config/settings/local.py | """
Local settings
- Run in Debug mode
- Use console backend for emails
- Add Django Debug Toolbar
- Add django-extensions as app
"""
from .base import * # noqa
# DEBUG
# ------------------------------------------------------------------------------
DEBUG = env.bool('DJANGO_DEBUG', default=True)
TEMPLATES[0]['OPT... | """
Local settings
- Run in Debug mode
- Use console backend for emails
- Add Django Debug Toolbar
- Add django-extensions as app
"""
from .base import * # noqa
# DEBUG
# ------------------------------------------------------------------------------
DEBUG = env.bool('DJANGO_DEBUG', default=True)
TEMPLATES[0]['OPT... | mit | Python |
dd0ba5d4486983bd2c498efc46e7b3aa244935e8 | Fix track import for package | ollien/playserver,ollien/playserver,ollien/playserver | playserver/webserver.py | playserver/webserver.py | import flask
from . import track
app = flask.flask(__name__)
@app.route("/")
def root():
return "{} by {} - {}"
| import flask
import track
app = flask.flask(__name__)
@app.route("/")
def root():
return "{} by {} - {}"
| mit | Python |
c2e5f630c4da60851aff4540b46c40de9b156271 | remove demo param | samedder/azure-cli,QingChenmsft/azure-cli,samedder/azure-cli,yugangw-msft/azure-cli,BurtBiel/azure-cli,samedder/azure-cli,samedder/azure-cli,yugangw-msft/azure-cli,QingChenmsft/azure-cli,QingChenmsft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,QingChenmsft/azure-cli,yugangw-msft/azure... | src/azure/cli/commands/storage.py | src/azure/cli/commands/storage.py | from ..main import SESSION
from .._logging import logger
from .._util import TableOutput
from ..commands import command, description, option
from .._profile import Profile
@command('storage account list')
@description(_('List storage accounts'))
@option('--resource-group -g <resourceGroup>', _('the resource group name... | from ..main import SESSION
from .._logging import logger
from .._util import TableOutput
from ..commands import command, description, option
from .._profile import Profile
@command('storage account list')
@description(_('List storage accounts'))
@option('--foo -f <bar>', _('fake'), required=True)
@option('--resource-g... | mit | Python |
a583f83474b083537b53d760b0a2add1584bd14a | allow spidermanager to instantiate a custom spider class | asa1253/portia,amikey/portia,flip111/portia,pombredanne/portia,hmilywb/portia,chennqqi/portia,PrasannaVenkadesh/portia,SouthStar/portia,naveenvprakash/portia,NicoloPernigo/portia,NoisyText/portia,CENDARI/portia,Suninus/portia,NoisyText/portia,lodow/portia-proxy,amikey/portia,flip111/portia,livepy/portia,pombredanne/por... | slybot/spidermanager.py | slybot/spidermanager.py | import os, json, tempfile, shutil, atexit
from zipfile import ZipFile
from zope.interface import implements
from scrapy.interfaces import ISpiderManager
from scrapy.utils.misc import load_object
from slybot.spider import IblSpider
class SlybotSpiderManager(object):
implements(ISpiderManager)
def __init__(s... | import os, json, tempfile, shutil, atexit
from zipfile import ZipFile
from zope.interface import implements
from scrapy.interfaces import ISpiderManager
from slybot.spider import IblSpider
class SlybotSpiderManager(object):
implements(ISpiderManager)
def __init__(self, datadir):
self.datadir = data... | bsd-3-clause | Python |
3701ab721b456fe292e3585753e2e415c863c85b | Add missing data | CompassionCH/compassion-switzerland,eicher31/compassion-switzerland,eicher31/compassion-switzerland,eicher31/compassion-switzerland,CompassionCH/compassion-switzerland,CompassionCH/compassion-switzerland | sms_939/__manifest__.py | sms_939/__manifest__.py | ##############################################################################
#
# ______ Releasing children from poverty _
# / ____/___ ____ ___ ____ ____ ___________(_)___ ____
# / / / __ \/ __ `__ \/ __ \/ __ `/ ___/ ___/ / __ \/ __ \
# / /___/ /_/ / / / / / / /_/ / /_/ (__ |__ ) / /_/... | ##############################################################################
#
# ______ Releasing children from poverty _
# / ____/___ ____ ___ ____ ____ ___________(_)___ ____
# / / / __ \/ __ `__ \/ __ \/ __ `/ ___/ ___/ / __ \/ __ \
# / /___/ /_/ / / / / / / /_/ / /_/ (__ |__ ) / /_/... | agpl-3.0 | Python |
96b6d66c89356d73e90500a140c2376d1bda065f | Fix Live backend | drxos/python-social-auth,MSOpenTech/python-social-auth,jameslittle/python-social-auth,wildtetris/python-social-auth,nirmalvp/python-social-auth,ariestiyansyah/python-social-auth,rsteca/python-social-auth,henocdz/python-social-auth,JJediny/python-social-auth,joelstanner/python-social-auth,contracode/python-social-auth,w... | social/backends/live.py | social/backends/live.py | """
MSN Live Connect oAuth 2.0
Settings:
LIVE_CLIENT_ID
LIVE_CLIENT_SECRET
LIVE_EXTENDED_PERMISSIONS (defaults are: wl.basic, wl.emails)
References:
* oAuth http://msdn.microsoft.com/en-us/library/live/hh243649.aspx
* Scopes http://msdn.microsoft.com/en-us/library/live/hh243646.aspx
* REST http://msdn.microsoft.co... | """
MSN Live Connect oAuth 2.0
Settings:
LIVE_CLIENT_ID
LIVE_CLIENT_SECRET
LIVE_EXTENDED_PERMISSIONS (defaults are: wl.basic, wl.emails)
References:
* oAuth http://msdn.microsoft.com/en-us/library/live/hh243649.aspx
* Scopes http://msdn.microsoft.com/en-us/library/live/hh243646.aspx
* REST http://msdn.microsoft.co... | bsd-3-clause | Python |
437ed5ee5e919186eabd1d71b0c1949adc1cf378 | Call default.brlUpdateText instead of brlUpdateText (which was undefined) | GNOME/orca,h4ck3rm1k3/orca-sonar,pvagner/orca,h4ck3rm1k3/orca-sonar,GNOME/orca,pvagner/orca,h4ck3rm1k3/orca-sonar,chrys87/orca-beep,chrys87/orca-beep,pvagner/orca,pvagner/orca,chrys87/orca-beep,GNOME/orca,chrys87/orca-beep,GNOME/orca | src/orca/gnome-terminal.py | src/orca/gnome-terminal.py | # gnome-terminal script
import a11y
import speech
import default
def onTextInserted (e):
if e.source.role != "terminal":
return
speech.say ("default", e.any_data)
def onTextDeleted (event):
"""Called whenever text is deleted from an object.
Arguments:
- event: the Event
"""
... | # gnome-terminal script
import a11y
import speech
def onTextInserted (e):
if e.source.role != "terminal":
return
speech.say ("default", e.any_data)
def onTextDeleted (event):
"""Called whenever text is deleted from an object.
Arguments:
- event: the Event
"""
# Ignore t... | lgpl-2.1 | Python |
4cb6a99603c28671cc4ee6a7bcdf8975383ab38c | Update studious_student_sorted_spec.py | eferro/kata_studiousstudent | specs/studious_student_sorted_spec.py | specs/studious_student_sorted_spec.py | # -*- coding: utf-8 -*-
from expects import *
from hamcrest import *
from doublex import *
from studiousstudents import studiousstudents
with describe('studious students'):
with describe('sorter'):
with it('base examples'):
expect(studiousstudents.StudiousStudentsSorter().sort('6 facebook hac... | # -*- coding: utf-8 -*-
from aleacli import connectors, protocols, login, exceptions
from ops_inventory import inventory, constants
from expects import *
from hamcrest import *
from doublex import *
from studiousstudents import studiousstudents
with describe('studious students'):
with describe('sorter'):
... | mit | Python |
13ee8dca4e2024209b4ce2e8bc22ee6d9ba86e16 | Update NoticiasPeriodico.py | HackLab-Almeria/clubpythonalm-taller-bots-telegram | 03-RSSTelegram/NoticiasPeriodico.py | 03-RSSTelegram/NoticiasPeriodico.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Ejemplo: Leer Noticias RSS en Telegram (I)
Libreria: pyTelegramBotAPI 1.4.2 [ok]
Libreria: pyTelegramBotAPI 2.0 [ok]
Python: 3.5.1
"""
import telebot
import time
import sys
import signal
import feedparser
import time
import datetime
try:
if sys.version_info.major... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Ejemplo: Leer Noticias RSS en Telegram (I)
Libreria: pyTelegramBotAPI 1.4.2
Python: 3.5.1
"""
import telebot
import time
import sys
import signal
import feedparser
import time
import datetime
try:
if sys.version_info.major < 3:
raise Exception ("Python 3.x mejor... | mit | Python |
b1428fee677f93d22c78e4d3202e2b471ed5557f | bump version | hobson/pug-ann,hobson/pug-ann | pug/ann/package_info.py | pug/ann/package_info.py | # Explicitly declare some header/meta information (about `pug`)
# rather than allowing python to populate header info automatically.
# This allows simple parsers (in setup.py) to extract them
# without importing this file or __init__.py
__namespace_package__ = 'pug'
__subpackage__ = 'ann'
__doc__ = "{}.{} -- Artifici... | # Explicitly declare some header/meta information (about `pug`)
# rather than allowing python to populate header info automatically.
# This allows simple parsers (in setup.py) to extract them
# without importing this file or __init__.py
__namespace_package__ = 'pug'
__subpackage__ = 'ann'
__doc__ = "{}.{} -- Artifici... | mit | Python |
f28f7629f1ff39aef8b755f3649400fed3474ffd | bump version | hobson/pug-nlp,hobson/pug-nlp,hobson/pug-nlp | pug/nlp/package_info.py | pug/nlp/package_info.py | # Explicitly declare some header/meta information (about `pug`)
# rather than allowing python to populate header info automatically.
# This allows simple parsers (in setup.py) to extract them
# without importing this file or __init__.py
__namespace_package__ = 'pug'
__subpackage__ = 'nlp'
__doc__ = "{}.{} -- Natural ... | # Explicitly declare some header/meta information (about `pug`)
# rather than allowing python to populate header info automatically.
# This allows simple parsers (in setup.py) to extract them
# without importing this file or __init__.py
__namespace_package__ = 'pug'
__subpackage__ = 'nlp'
__doc__ = "{}.{} -- Natural ... | mit | Python |
6736944fc0058bb6888cbd7df0376577259a19de | Handle adding/removing workers | broxtronix/distributed,dask/distributed,mrocklin/distributed,mrocklin/distributed,amosonn/distributed,dask/distributed,dask/distributed,dask/distributed,amosonn/distributed,mrocklin/distributed,broxtronix/distributed,amosonn/distributed,broxtronix/distributed,blaze/distributed,blaze/distributed | distributed/diagnostics/worker_monitor.py | distributed/diagnostics/worker_monitor.py | from collections import defaultdict
from itertools import chain
from ..utils import ignoring
with ignoring(ImportError):
from bokeh.plotting import figure
from bokeh.models import ColumnDataSource, Range1d
def resource_profile_plot(width=600, height=400):
names = ['times','workers', 'cpu', 'memory-percen... | from collections import defaultdict
from ..utils import ignoring
with ignoring(ImportError):
from bokeh.plotting import figure
from bokeh.models import ColumnDataSource, Range1d
def resource_profile_plot(width=600, height=400):
names = ['times','workers', 'cpu', 'memory-percent']
source = ColumnDataS... | bsd-3-clause | Python |
262e67aedcb498efc49033a5e7d95ca4d0b86795 | Add note about change in TNC's url | PyThaiNLP/pythainlp | pythainlp/corpus/tnc.py | pythainlp/corpus/tnc.py | # -*- coding: utf-8 -*-
"""
Thai National Corpus word frequency
Credit: Korakot Chaovavanich
https://www.facebook.com/photo.php?fbid=363640477387469&set=gm.434330506948445&type=3&permPage=1
"""
import re
from typing import List, Tuple
import requests
from pythainlp.corpus import get_corpus
__all__ = ["word_freq", "... | # -*- coding: utf-8 -*-
"""
Thai National Corpus word frequency
Credit: Korakot Chaovavanich
https://www.facebook.com/photo.php?fbid=363640477387469&set=gm.434330506948445&type=3&permPage=1
"""
import re
from typing import List, Tuple
import requests
from pythainlp.corpus import get_corpus
__all__ = ["word_freq", "... | apache-2.0 | Python |
10273a0288854184443c34d8936a6fb4742287ab | Update setup.py | dmlc/xgboost,dmlc/xgboost,dmlc/xgboost,dmlc/xgboost,dmlc/xgboost,dmlc/xgboost | python-package/setup.py | python-package/setup.py | # pylint: disable=invalid-name
"""Setup xgboost package."""
from __future__ import absolute_import
import sys
from setuptools import setup, find_packages
import subprocess
sys.path.insert(0, '.')
#build on the fly
build_sh = subprocess.Popen(['sh', 'xgboost/build-python.sh'])
build_sh.wait()
output = build_sh.communic... | # pylint: disable=invalid-name
"""Setup xgboost package."""
from __future__ import absolute_import
import sys
from setuptools import setup, find_packages
import subprocess
sys.path.insert(0, '.')
#build on the fly
build_sh = subprocess.Popen(['sh', 'xgboost/build-python.sh'])
build_sh.wait()
output = build_sh.communic... | apache-2.0 | Python |
f44d189978702ea950c675fcddd0866045e487a2 | Update every second | DarkAce65/rpi-led-matrix,DarkAce65/rpi-led-matrix | python/animationBase.py | python/animationBase.py | #!/usr/bin/env python
from rgbmatrix import RGBMatrix
import sys, time
from ball import Ball
rows = 16
chains = 1
parallel = 1
ledMatrix = RGBMatrix(rows, chains, parallel)
numRows = 16
height = ledMatrix.height
width = ledMatrix.width
ball = Ball()
try:
print "Press Ctrl + C to stop executing"
while True:
nextF... | #!/usr/bin/env python
from rgbmatrix import RGBMatrix
import sys, time
from ball import Ball
rows = 16
chains = 1
parallel = 1
ledMatrix = RGBMatrix(rows, chains, parallel)
numRows = 16
height = ledMatrix.height
width = ledMatrix.width
ball = Ball()
prevTime = time.clock()
try:
print "Press Ctrl + C to stop executi... | mit | Python |
1befaad8b013209aff58145d006d8d047359797e | Fix assert error when flashing release (#717) | commaai/panda,commaai/panda,commaai/panda,commaai/panda | python/flash_release.py | python/flash_release.py | #!/usr/bin/env python3
import sys
import time
import requests
import json
import io
def flash_release(path=None, st_serial=None):
from panda import Panda, PandaDFU
from zipfile import ZipFile
def status(x):
print("\033[1;32;40m" + x + "\033[00m")
if st_serial is not None:
# look for Panda
panda_... | #!/usr/bin/env python3
import sys
import time
import requests
import json
import io
def flash_release(path=None, st_serial=None):
from panda import Panda, PandaDFU
from zipfile import ZipFile
def status(x):
print("\033[1;32;40m" + x + "\033[00m")
if st_serial is not None:
# look for Panda
panda_... | mit | Python |
d6fcfe75e8c5caa2c2dc040860c025df82e31389 | Add ConnectionDone error to list for retrying | wrapp/txwebretry | txwebretry.py | txwebretry.py | ''' txwebretry - retry mechanisms for web requests.
Utilities for automatically retrying web requests made with twisted.web.client.
Usage:
>>> # GET localhost:8080 up to 3 times with exponential backoff
>>> d = retry3_exponential(treq.get, 'http://localhost:8080')
>>> # GET localhost:8080 up to 5 times without dela... | ''' txwebretry - retry mechanisms for web requests.
Utilities for automatically retrying web requests made with twisted.web.client.
Usage:
>>> # GET localhost:8080 up to 3 times with exponential backoff
>>> d = retry3_exponential(treq.get, 'http://localhost:8080')
>>> # GET localhost:8080 up to 5 times without dela... | mit | Python |
1aef601506729fb9cdef57b4dd306dccab0b522f | Make onchange private | OCA/social,OCA/social,OCA/social | mail_show_follower/models/res_config_settings.py | mail_show_follower/models/res_config_settings.py | from odoo import api, fields, models
class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"
show_internal_users_cc = fields.Boolean(
related="company_id.show_internal_users_cc",
readonly=False,
)
show_followers_message_sent_to = fields.Text(
related="... | from odoo import api, fields, models
class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"
show_internal_users_cc = fields.Boolean(
related="company_id.show_internal_users_cc",
readonly=False,
)
show_followers_message_sent_to = fields.Text(
related="... | agpl-3.0 | Python |
3bf2b5ee5d2ec09c4f7acf03647b12e9a20f180f | Add test_ctrl_bbb.py | mcdeoliveira/pyctrl,mcdeoliveira/pyctrl,mcdeoliveira/ctrl,mcdeoliveira/beaglebone,mcdeoliveira/beaglebone,mcdeoliveira/pyctrl,mcdeoliveira/ctrl | python/test_ctrl_bbb.py | python/test_ctrl_bbb.py | import time
from ctrl.bbb import Controller
from ctrl.algo import *
def main():
Ts = 0.01 # s
a = 17 # 1/s
k = 0.163 # cycles/s duty
controller = Controller(Ts, 1)
controller.set_logger(2)
# open loop controller
print('> OPEN LOOP CONTROL (REFE... | import ctrl.bbb
from ctrl.algo import *
def main():
Ts = 0.01 # s
a = 17 # 1/s
k = 0.163 # cycles/s duty
controller = Controller(Ts, 1)
controller.set_logger(2)
# open loop controller
print('> OPEN LOOP CONTROL (REFERENCE)')
controller.start... | apache-2.0 | Python |
ba37ce3024416596bc02cbe0629ebdd15f25b60f | add storage describe | Kotaimen/georest | georest/view/__init__.py | georest/view/__init__.py | # -*- encoding: utf-8 -*-
__author__ = 'pp'
"""
georest.view
~~~~~~~~~~~~~
Restful resources
"""
import platform
import flask
from flask import current_app
from flask.json import jsonify
from georest import __version__, geo
from .feature import Features, Geometry, Properties
from .operations import Ope... | # -*- encoding: utf-8 -*-
__author__ = 'pp'
"""
georest.view
~~~~~~~~~~~~~
Restful resources
"""
import platform
import flask
from flask import current_app
from flask.views import MethodView
from flask.json import jsonify
from georest import __version__, geo
from .feature import Features, Geometry, Pro... | bsd-2-clause | Python |
e6e5d60b758632eaa7f947d535a39f1a038a4d03 | debug sessions | justinwp/croplands,justinwp/croplands | gfsad/views/api/tiles.py | gfsad/views/api/tiles.py | from flask import request, session
from gfsad import api
from gfsad.models import Tile, TileClassification
from gfsad.tasks.classifications import compute_tile_classification_statistics
import uuid
from werkzeug.exceptions import BadRequest
def update_tile_classification_statistics(result=None, **kwarg):
compute_... | from flask import request, session
from gfsad import api
from gfsad.models import Tile, TileClassification
from gfsad.tasks.classifications import compute_tile_classification_statistics
import uuid
from werkzeug.exceptions import BadRequest
def update_tile_classification_statistics(result=None, **kwarg):
compute_... | mit | Python |
e1cce049656cbaeafae108d4bfc00390272922a5 | Fix migration (NC-627) | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | nodeconductor/logging/migrations/0003_hook.py | nodeconductor/logging/migrations/0003_hook.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
import django.utils.timezone
from django.conf import settings
import model_utils.fields
import uuidfield.fields
class Migration(migrations.Migration):
dependencies = [
migrati... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
import django.utils.timezone
from django.conf import settings
import model_utils.fields
import uuidfield.fields
class Migration(migrations.Migration):
dependencies = [
migrati... | mit | Python |
de2d94f21b79381d092f4931c56f7210c9fefec2 | add shot serializer | h1ds/h1ds,h1ds/h1ds,h1ds/h1ds,h1ds/h1ds,h1ds/h1ds,h1ds/h1ds | h1ds_core/serializers.py | h1ds_core/serializers.py | import numpy as np
from rest_framework import serializers
from h1ds_core.models import Node, Filter, Shot
#class NodeSerializer(serializers.ModelSerializer):
class NodeSerializer(serializers.HyperlinkedModelSerializer):
# parent
# children
# slug ?
# data (optional depending on ?show_data query string... | import numpy as np
from rest_framework import serializers
from h1ds_core.models import Node, Filter
#class NodeSerializer(serializers.ModelSerializer):
class NodeSerializer(serializers.HyperlinkedModelSerializer):
# parent
# children
# slug ?
# data (optional depending on ?show_data query string
p... | mit | Python |
aab5953333b5d7a1bbae1060c548ed289bf482cc | Remove unnecessary directory creation | joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue | hoomd/pytest/test_dcd.py | hoomd/pytest/test_dcd.py | import hoomd
import pytest
import numpy as np
def test_attach(simulation_factory, two_particle_snapshot_factory, tmp_path):
filename = tmp_path / "temporary_test_file.dcd"
sim = simulation_factory(two_particle_snapshot_factory())
dcd_dump = hoomd.write.DCD(filename, hoomd.trigger.Periodic(1))
sim.oper... | import hoomd
import pytest
import numpy as np
def test_attach(simulation_factory, two_particle_snapshot_factory, tmp_path):
d = tmp_path / "sub"
d.mkdir()
filename = d / "temporary_test_file.dcd"
sim = simulation_factory(two_particle_snapshot_factory())
dcd_dump = hoomd.write.DCD(filename, hoomd.t... | bsd-3-clause | Python |
45b3fc7babfbd922bdb174e5156f54c567a66de4 | Add some :tiger2:s for `graph_objs_tools.py`. | plotly/plotly.py,plotly/python-api,plotly/plotly.py,plotly/python-api,plotly/plotly.py,plotly/python-api | plotly/tests/test_core/test_graph_objs/test_graph_objs_tools.py | plotly/tests/test_core/test_graph_objs/test_graph_objs_tools.py | from __future__ import absolute_import
from unittest import TestCase
from plotly.graph_objs import graph_objs as go
from plotly.graph_objs import graph_objs_tools as got
class TestGetRole(TestCase):
def test_get_role_no_value(self):
# this is a bit fragile, but we pick a few stable values
# t... | from __future__ import absolute_import
from unittest import TestCase
| mit | Python |
a209bb30c35a1befb8779322c6a16999b5c7beff | Revert "Use rackspace for tempest check tests" | anbangr/osci-project-config,citrix-openstack/project-config,dongwenjuan/project-config,anbangr/osci-project-config,citrix-openstack/project-config,openstack-infra/project-config,openstack-infra/project-config,open-switch/infra_project-config,Tesora/tesora-project-config,osrg/project-config,osrg/project-config,coolsvap/... | modules/openstack_project/files/zuul/openstack_functions.py | modules/openstack_project/files/zuul/openstack_functions.py | # Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | # Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 | Python |
8cdd7a89ad6115b80ae57ed6cbb0d41abce09816 | Improve handling of remote test drivers | Flamacue/pretix,Flamacue/pretix,lab2112/pretix,Unicorn-rzl/pretix,Unicorn-rzl/pretix,Flamacue/pretix,akuks/pretix,akuks/pretix,awg24/pretix,awg24/pretix,akuks/pretix,awg24/pretix,lab2112/pretix,lab2112/pretix,awg24/pretix,akuks/pretix,Unicorn-rzl/pretix,Flamacue/pretix,Unicorn-rzl/pretix,lab2112/pretix | src/tests/base/__init__.py | src/tests/base/__init__.py | import os
import sys
import time
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.conf import settings
from selenium import webdriver
# could use Chrome, Firefox, etc... here
BROWSER = os.environ.get('TEST_BROWSER', 'PhantomJS')
class BrowserTest(StaticLiveServerTestCase):
d... | import os
import sys
import time
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.conf import settings
from selenium import webdriver
# could use Chrome, Firefox, etc... here
BROWSER = os.environ.get('TEST_BROWSER', 'PhantomJS')
class BrowserTest(StaticLiveServerTestCase):
d... | apache-2.0 | Python |
fe98c8353e19f56e6af302d5deb40f2279d48485 | Bump to version 0.61.1 | nerevu/riko,nerevu/riko | riko/__init__.py | riko/__init__.py | # -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
riko
~~~~
Provides functions for analyzing and processing streams of structured data
Examples:
basic usage::
>>> from itertools import chain
>>> from functools import partial
>>> from riko.modules import itembuilder, strreplace
... | # -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
riko
~~~~
Provides functions for analyzing and processing streams of structured data
Examples:
basic usage::
>>> from itertools import chain
>>> from functools import partial
>>> from riko.modules import itembuilder, strreplace
... | mit | Python |
b06c2d32c565f59bc420d7014f243afa50482f1d | change example to be clearer | RaymondKlass/entity-extract | entity_extract/examples/pos_extraction.py | entity_extract/examples/pos_extraction.py |
#from entity_extract.extractor.extractors import PosExtractor
from entity_extract.extractor.utilities import SentSplit, Tokenizer
from entity_extract.extractor.extractors import PosExtractor
from entity_extract.extractor.pos_tagger import PosTagger
from entity_extract.extractor.parsers import ChunkParser
# Initialize... |
#from entity_extract.extractor.extractors import PosExtractor
from entity_extract.extractor.utilities import SentSplit, Tokenizer
from entity_extract.extractor.extractors import PosExtractor
from entity_extract.extractor.pos_tagger import PosTagger
from entity_extract.extractor.parsers import ChunkParser
# Initialize... | mit | Python |
34a7f8a835e279bf58e981259242abd767d81a00 | update setting django settings for postgresql | ioannisstenos/e-science,KPetsas/e-science,ibyron/e-science,grnet/e-science,ibyron/e-science,ioannisstenos/e-science,VFoteinos/e-science,ioannisstenos/e-science,VFoteinos/e-science,ibyron/e-science,VFoteinos/e-science,grnet/e-science,VFoteinos/e-science,VFoteinos/e-science,KPetsas/e-science,ioannisstenos/e-science,KPets... | esciencedjango/esciencedjango/settings.py | esciencedjango/esciencedjango/settings.py | """
Django settings for esciencedjango project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ... | """
Django settings for esciencedjango project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ... | agpl-3.0 | Python |
bb834e1b4d0d3507611b3f62ca9e384788663b40 | Fix the empty stem bug in the greek stemmer | miso-belica/sumy,miso-belica/sumy | sumy/nlp/stemmers/greek.py | sumy/nlp/stemmers/greek.py | """The code of the stem_word function relies on the greek stemmer found in this python module
greek-stemmer-pos (https://pypi.org/project/greek-stemmer-pos/).
"""
_TOTAL_TAGS = frozenset({
'DDT', 'IDT', 'NNM', 'NNF', 'NNN', 'NNSM', 'NNSF', 'NNSN', 'NNPM', 'NNPF',
'NNPN', 'NNPSM', 'NNPSF', 'NNPSN', 'VB', 'VBD',... | """The code of the stem_word function relies on the greek stemmer found in this python module
greek-stemmer-pos (https://pypi.org/project/greek-stemmer-pos/).
"""
_TOTAL_TAGS = frozenset({
'DDT', 'IDT', 'NNM', 'NNF', 'NNN', 'NNSM', 'NNSF', 'NNSN', 'NNPM', 'NNPF',
'NNPN', 'NNPSM', 'NNPSF', 'NNPSN', 'VB', 'VBD',... | apache-2.0 | Python |
770781d3ce55a91926b91579e11d79ebb3edf47e | Tweak to migration in order to accomodate old names for data fields and allow for if data fields were not present | edx-solutions/edx-platform,edx-solutions/edx-platform,edx-solutions/edx-platform,edx-solutions/edx-platform | lms/djangoapps/api_manager/management/commands/migrate_orgdata.py | lms/djangoapps/api_manager/management/commands/migrate_orgdata.py | import json
from django.contrib.auth.models import Group
from django.core.management.base import BaseCommand
from api_manager.models import GroupProfile, Organization
class Command(BaseCommand):
"""
Migrates legacy organization data and user relationships from older Group model approach to newer concrete Org... | import json
from django.contrib.auth.models import Group
from django.core.management.base import BaseCommand
from api_manager.models import GroupProfile, Organization
class Command(BaseCommand):
"""
Migrates legacy organization data and user relationships from older Group model approach to newer concrete Org... | agpl-3.0 | Python |
e6f81f1c89cc6656abd59b89675abae2ef910509 | bump version --> 0.2.0 | wolcomm/rptk,wolcomm/rptk | rptk/__meta__.py | rptk/__meta__.py | #!/usr/bin/env python
# Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved.
#
# The contents of this file are licensed under the Apache License version 2.0
# (the "License"); you may not use this file except in compliance with the
# License.
#
# Unless required by applicable law or agreed to in... | #!/usr/bin/env python
# Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved.
#
# The contents of this file are licensed under the Apache License version 2.0
# (the "License"); you may not use this file except in compliance with the
# License.
#
# Unless required by applicable law or agreed to in... | apache-2.0 | Python |
1c6378b8a3404a6871a892ad785d07c8f3d628f3 | switch log level from degub to warning | ImmobilienScout24/afp-alppaca,ImmobilienScout24/alppaca,ImmobilienScout24/alppaca,ImmobilienScout24/afp-alppaca | src/main/python/alppaca/util.py | src/main/python/alppaca/util.py | from __future__ import print_function, absolute_import, unicode_literals, division
import logging
import sys
import yamlreader
def _get_item_from_module(module_name, item_name):
"""Load classes/modules/functions/... from given config"""
try:
module = __import__(module_name, fromlist=[item_name])
... | from __future__ import print_function, absolute_import, unicode_literals, division
import logging
import sys
import yamlreader
def _get_item_from_module(module_name, item_name):
"""Load classes/modules/functions/... from given config"""
try:
module = __import__(module_name, fromlist=[item_name])
... | apache-2.0 | Python |
51c50eaaf2e7374f3d6797b82df9604126f6000d | Add the server | pahumadad/raspi-relay-api | relay_api/api/server.py | relay_api/api/server.py | from flask import Flask, jsonify, abort
server = Flask(__name__)
def get_relays(relays):
return jsonify({"relays": relays})
def get_relay(relays, relay_id):
relay = [relay for relay in relays if relay["id"] == relay_id]
if len(relay) == 0:
abort(404)
return jsonify({"relay": relay[0]})
| mit | Python | |
0e90ebc45972df67f3b927620f12ed1906df513b | Use default of $HOME | gogoair/foremast,gogoair/foremast | src/foremast/pipeline/__main__.py | src/foremast/pipeline/__main__.py | """Create Spinnaker Pipeline."""
import argparse
import logging
from ..args import add_debug
from ..consts import LOGGING_FORMAT
from .create_pipeline import SpinnakerPipeline
def main():
"""Run newer stuffs."""
logging.basicConfig(format=LOGGING_FORMAT)
log = logging.getLogger(__name__)
parser = ar... | """Create Spinnaker Pipeline."""
import argparse
import logging
from ..args import add_debug
from ..consts import LOGGING_FORMAT
from .create_pipeline import SpinnakerPipeline
def main():
"""Run newer stuffs."""
logging.basicConfig(format=LOGGING_FORMAT)
log = logging.getLogger(__name__)
parser = ar... | apache-2.0 | Python |
cc7f93d93cb2d7e4aed0329ce41785e419b07a92 | Fix incorrect reference to opts dict | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/__init__.py | salt/__init__.py | '''
Make me some salt!
'''
# Import python libs
import os
import optparse
# Import salt libs
import salt.master
import salt.minion
import salt.utils
class Master(object):
'''
Creates a master server
'''
class Minion(object):
'''
Create a minion server
'''
def __init__(self):
self.... | '''
Make me some salt!
'''
# Import python libs
import os
import optparse
# Import salt libs
import salt.master
import salt.minion
import salt.utils
class Master(object):
'''
Creates a master server
'''
class Minion(object):
'''
Create a minion server
'''
def __init__(self):
self.... | apache-2.0 | Python |
5d19302e1831adc069ae2f53216dedabda658749 | Add redirect for anyone with a cached redirect. | wuvt/wuvt-site,wuvt/wuvt-site,wuvt/wuvt-site,wuvt/wuvt-site | wuvt/views.py | wuvt/views.py | from flask import abort, flash, jsonify, render_template, redirect, \
request, url_for, Response
from sqlalchemy import desc
from wuvt import app
from wuvt import db
from wuvt import login_manager
from wuvt import sse
from wuvt.models import User, Page
from wuvt.blog.models import Article, Category
from wuvt.bl... | from flask import abort, flash, jsonify, render_template, redirect, \
request, url_for, Response
from sqlalchemy import desc
from wuvt import app
from wuvt import db
from wuvt import login_manager
from wuvt import sse
from wuvt.models import User, Page
from wuvt.blog.models import Article, Category
from wuvt.bl... | agpl-3.0 | Python |
22c5fe48f303bf1431758f259b6ae6a68da0d6ff | add octet string tests | JoelBender/bacpypes,JoelBender/bacpypes | tests/test_primitive_data/test_octet_string.py | tests/test_primitive_data/test_octet_string.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test Primitive Data Octet String
--------------------------------
"""
import unittest
import struct
from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob
from bacpypes.primitivedata import OctetString, Tag
# some debugging
_debug = 0
_log = ModuleLog... | mit | Python | |
b1033e52142a0071b6a81969e1e387ea940f6cd6 | Update __init__.py | aam-at/tensorflow,aam-at/tensorflow,apark263/tensorflow,jart/tensorflow,gojira/tensorflow,chemelnucfin/tensorflow,theflofly/tensorflow,allenlavoie/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,seanli9jan/tensorflow,jalexvig/tensorflow,AnishShah/tensorflow,jalexvig/tensorflow,xodus7/tensorflow... | tensorflow/contrib/tensorrt/__init__.py | tensorflow/contrib/tensorrt/__init__.py | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 | Python |
0a6c9c52efadf4a66dfb53c34d207c23daeea161 | Remove dead code | kr41/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,josthkko/ggrc-core,andrei-karalionak/ggrc-core,kr41/ggrc-core,andrei-karalionak/ggrc-core,VinnieJohns/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,j0gurt/ggrc-core,selahssea/ggrc-core,kr41/ggrc-co... | src/ggrc/models/track_object_state.py | src/ggrc/models/track_object_state.py | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from sqlalchemy import event
from ggrc import db
from sqlalchemy.ext.declarative import declared_attr
from ggrc.models.deferred import deferred
from ggrc.models.reflection import PublishOnly
class HasObje... | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from sqlalchemy import event
from ggrc import db
from sqlalchemy.ext.declarative import declared_attr
from ggrc.models.deferred import deferred
from .reflection import PublishOnly
class HasObjectState(obj... | apache-2.0 | Python |
eab72b615d7889daaf8aa805aae029cdc431989c | Add Department, Degree, Language Model. | leyyin/university-SE,leyyin/university-SE,leyyin/university-SE | school/models.py | school/models.py | """
General project models used.
These may get moved to a blueprint/package at any time
"""
from school.extensions import db
from sqlalchemy import Column, Integer, String, ForeignKey, \
Date, SmallInteger, Boolean, PrimaryKeyConstraint
class Course(db.Model):
__tablename__ = "courses"
id = Column(Intege... | """
General project models used.
These may get moved to a blueprint/package at any time
"""
from school.extensions import db
from sqlalchemy import Column, Integer, String, ForeignKey, Boolean, PrimaryKeyConstraint
class Course(db.Model):
__tablename__ = "courses"
id = Column(Integer, primary_key=True)
n... | mit | Python |
dcb1c1170b834b23a2afad51ef39f5bb501a7a47 | Add accidentally removed lines | StrellaGroup/frappe,yashodhank/frappe,vjFaLk/frappe,frappe/frappe,saurabh6790/frappe,adityahase/frappe,mhbu50/frappe,adityahase/frappe,StrellaGroup/frappe,adityahase/frappe,vjFaLk/frappe,vjFaLk/frappe,mhbu50/frappe,yashodhank/frappe,vjFaLk/frappe,frappe/frappe,almeidapaulopt/frappe,saurabh6790/frappe,saurabh6790/frappe... | frappe/core/doctype/report/test_report.py | frappe/core/doctype/report/test_report.py | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe, json, os
import unittest
test_records = frappe.get_test_records('Report')
class TestReport(unittest.TestCase):
def test_report_builder(self):
if frappe.db.exists('Report', ... | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe, json, os
import unittest
test_records = frappe.get_test_records('Report')
class TestReport(unittest.TestCase):
def test_report_builder(self):
if frappe.db.exists('Report', ... | mit | Python |
34a50a976dd1d23a744d6100dfe97462b464fe0f | modify to list as set is unhashable for signedimmediatesyftmessagewithoutreply | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | packages/syft/src/syft/core/node/common/action/unfinished_task.py | packages/syft/src/syft/core/node/common/action/unfinished_task.py | # stdlib
from typing import List as TypeList
from uuid import UUID
# relative
from .....lib.python import List
from ....common import UID
from ....common.message import SignedImmediateSyftMessageWithoutReply
from ....store.storeable_object import StorableObject
from ...abstract.node import AbstractNode
from .exception... | # stdlib
from typing import Set as TypeSet
from uuid import UUID
# relative
from .....lib.python import Set
from ....common import UID
from ....common.message import SignedImmediateSyftMessageWithoutReply
from ....store.storeable_object import StorableObject
from ...abstract.node import AbstractNode
from .exceptions i... | apache-2.0 | Python |
63e29ddde02c5db96d88315099fae770a96bcca3 | allow log level to be set by environment | cocrawler/cocrawler,cocrawler/cocrawler,cocrawler/cocrawler | scripts/crawl.py | scripts/crawl.py | #!/usr/bin/env python
'''
CoCrawler web crawler, main program
'''
import sys
import resource
import os
import argparse
import asyncio
import logging
import cocrawler
import cocrawler.conf as conf
import cocrawler.stats as stats
import cocrawler.timer as timer
import cocrawler.webserver as webserver
ARGS = argparse.... | #!/usr/bin/env python
'''
CoCrawler web crawler, main program
'''
import sys
import resource
import argparse
import asyncio
import logging
import cocrawler
import cocrawler.conf as conf
import cocrawler.stats as stats
import cocrawler.timer as timer
import cocrawler.webserver as webserver
ARGS = argparse.ArgumentPa... | apache-2.0 | Python |
f2a4441e26b2f5c95c5201d511da8819828b8cfa | Add heuristics for identifying old dendrogram files | stscieisenhamer/glue,saimn/glue,saimn/glue,stscieisenhamer/glue | glue/core/data_factories/dendro_loader.py | glue/core/data_factories/dendro_loader.py | """
Load files created by the astrodendro package.
astrodendro must be installed in order to use this loader
"""
import numpy as np
from astrodendro import Dendrogram
from ..data import Data
from .gridded import is_fits, is_hdf5
__all__ = ['load_dendro']
def load_dendro(file):
"""
Load a dendrogram saved b... | """
Load files created by the astrodendro package.
astrodendro must be installed in order to use this loader
"""
import numpy as np
from astrodendro import Dendrogram
from ..data import Data
from .gridded import is_fits, is_hdf5
__all__ = ['load_dendro']
def load_dendro(file):
"""
Load a dendrogram saved b... | bsd-3-clause | Python |
e8580a7ab45ac9dbd203937ad362d658ccf1a95f | change tuples to lists | avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf | src/python/expedient/clearinghouse/defaultsettings/expedient.py | src/python/expedient/clearinghouse/defaultsettings/expedient.py | '''Expedient-specific settings.
Created on Aug 19, 2010
@author: jnaous
'''
BASIC_AUTH_URLS = [
r'^/dummyom/.*',
]
'''List of URL regular expressions that accept HTTP Basic Authentication.
This is used to enable some tests to work.
'''
SITE_LOCKDOWN_EXCEPTIONS = [
r'^/accounts/register/.*$',
r'^/accou... | '''Expedient-specific settings.
Created on Aug 19, 2010
@author: jnaous
'''
BASIC_AUTH_URLS = (
r'^/dummyom/.*',
)
'''List of URL regular expressions that accept HTTP Basic Authentication.
This is used to enable some tests to work.
'''
SITE_LOCKDOWN_EXCEPTIONS = (
r'^/accounts/register/.*$',
r'^/accou... | bsd-3-clause | Python |
b7dd4d1e0567898c0858d876747908bbf7dc68bb | test modification of an existing group to a non-unique gid | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/pytests/unit/states/test_group.py | tests/pytests/unit/states/test_group.py | import pytest
import salt.states.group as group
from tests.support.mock import MagicMock, patch
__context__ = {}
def ping():
...
@pytest.fixture
def configure_loader_modules():
return {group: {"__salt__": {"test.ping": ping}, "__opts__": {"test": False}}}
def test_present_with_non_unique_gid():
with... | import pytest
import salt.states.group as group
from tests.support.mock import MagicMock, patch
__context__ = {}
def ping():
...
@pytest.fixture
def configure_loader_modules():
return {group: {"__salt__": {"test.ping": ping}, "__opts__": {"test": False}}}
def test_present_with_non_unique_gid():
with... | apache-2.0 | Python |
679466e9e6186814085f70bfa54a8cf9fa12c9b6 | Fix bug in sorting eigen vectors and selecting normal vector. | eEcoLiDAR/eEcoLiDAR | laserchicken/feature_extractor/eigenvals_feature_extractor.py | laserchicken/feature_extractor/eigenvals_feature_extractor.py | import numpy as np
from laserchicken.feature_extractor.abc import AbstractFeatureExtractor
from laserchicken.utils import get_xyz
class EigenValueVectorizeFeatureExtractor(AbstractFeatureExtractor):
is_vectorized = True
@classmethod
def requires(cls):
return []
@classmethod
def provides... | import numpy as np
from laserchicken.feature_extractor.abc import AbstractFeatureExtractor
from laserchicken.utils import get_xyz
class EigenValueVectorizeFeatureExtractor(AbstractFeatureExtractor):
is_vectorized = True
@classmethod
def requires(cls):
return []
@classmethod
def provides... | apache-2.0 | Python |
ff5ea66db71048d476329744f32a685d4e49647f | fix bugs | sing1ee/scrapy-top | scrapy_top/scrapy_top.py | scrapy_top/scrapy_top.py | import telnetlib
import datetime
from prettytable import PrettyTable
import os
import time
import sys
import getopt
def main():
HOST = 'localhost'
PORT = 6023
INTERVAL = 2
opts, args = getopt.getopt(sys.argv[1:], "i:h:p:")
print opts
for op, value in opts:
if op == "-i":
IN... | import telnetlib
import datetime
from prettytable import PrettyTable
import os
import time
import sys
import getopt
HOST = 'localhost'
PORT = 6023
INTERVAL = 2
def main():
opts, args = getopt.getopt(sys.argv[1:], "i:h:p:")
for op, value in opts:
if op == "-i":
INTERVAL = int(value)
... | apache-2.0 | Python |
0221bc28c1c5c6e7a228674e5ad26395e03cc08e | Update image_styles.py | devalfrz/django-image-styles,devalfrz/django-image-styles,devalfrz/django-image-styles,devalfrz/django-image-styles | image_styles/templatetags/image_styles.py | image_styles/templatetags/image_styles.py | from django import template
from django.conf import settings
import shutil,os
from ..models import *
register = template.Library()
@register.filter
def style(orig_image,style_name):
try:
style = Style.objects.get(name=style_name)
except Style.DoesNotExist:
return orig_image
try:
im... | from django import template
from django.conf import settings
import shutil,os
from image_styles.models import *
register = template.Library()
@register.filter
def style(orig_image,style_name):
try:
style = Style.objects.get(name=style_name)
except Style.DoesNotExist:
return orig_image
try:... | bsd-2-clause | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.