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 |
|---|---|---|---|---|---|---|---|---|
fcf0194a531f510303337f66e859774e16405608 | Update example | chfw/pyexcel,lordakshaya/pyexcel,lordakshaya/pyexcel,chfw/pyexcel,lordakshaya/pyexcel | examples/basics/write_excel_book.py | examples/basics/write_excel_book.py | """
write_excel_book.py
:copyright: (c) 2014-2015 by Onni Software Ltd.
:license: New BSD License, see LICENSE for more details
This shows how to use **Book** class to write a dictionary
to sheet spreadsheet.
"""
import pyexcel as pe
import pyexcel.ext.xls # import xls to support xls format
# the dictionary should lo... | """
read_excel_book.py
:copyright: (c) 2014-2015 by Onni Software Ltd.
:license: New BSD License, see LICENSE for more details
This shows how to use **Book** class to write a dictionary
to sheet spreadsheet.
"""
import pyexcel as pe
# the dictionary should look like the following:
# * key: a string typed key
# * va... | bsd-3-clause | Python |
0bbbfb4f165786acc072a266cf039ebec92d84f3 | fix path | jakeogh/anormbookmarker,jakeogh/anormbookmarker | anormbookmarker/cli/test.py | anormbookmarker/cli/test.py | #!/usr/bin/env python3
import click
from kcl.dirops import all_files
from kcl.printops import eprint
import os
import pkg_resources
TEST_PATH = pkg_resources.resource_filename('anormbookmarker', 'cli/tests')
@click.command()
def test():
eprint("TEST_PATH:", TEST_PATH)
os.system('sudo /home/cfg/database/post... | #!/usr/bin/env python3
import click
from kcl.dirops import all_files
from kcl.printops import eprint
import os
import pkg_resources
TEST_PATH = pkg_resources.resource_filename('anormbookmarker', 'cli/test/tests/')
@click.command()
def test():
eprint("TEST_PATH:", TEST_PATH)
os.system('sudo /home/cfg/databas... | mit | Python |
ae8bfb60ffa097a53a2ac4d0d4e646d10649851c | Add teams to test units in control tests | Tactique/game_engine,Tactique/game_engine | tests/engine_test/control_test.py | tests/engine_test/control_test.py | import unittest
from engine import unit, control, consts
class ControlTest(unittest.TestCase):
def oneVsOther(self, AttackUnit, DefendUnit, delta, start_damage=0):
attack_unit = AttackUnit(consts.RED)
attack_unit.health -= start_damage
expected_attack_unit = AttackUnit(consts.RED)
... | import unittest
from engine import unit, control
class ControlTest(unittest.TestCase):
def oneVsOther(self, AttackUnit, DefendUnit, delta, start_damage=0):
attack_unit = AttackUnit()
attack_unit.health -= start_damage
expected_attack_unit = AttackUnit()
expected_attack_unit.health... | mit | Python |
c99449c0f61a1a2610f4761e37970a0d0feab2ee | Remove whitespace | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/unit/modules/dig_test.py | tests/unit/modules/dig_test.py | # -*- coding: utf-8 -*-
'''
:codauthor: :email:`Nicole Thomas <nicole@saltstack.com>`
'''
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import MagicMock, patch, call
from salt.modules import dig
@skipIf(not dig.__virtual__(), 'Dig must be installed')
class DigTestCase(... | # -*- coding: utf-8 -*-
'''
:codauthor: :email:`Nicole Thomas <nicole@saltstack.com>`
'''
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import MagicMock, patch, call
from salt.modules import dig
@skipIf(not dig.__virtual__(), 'Dig must be installed')
class DigTestCase(... | apache-2.0 | Python |
6d89df3c9f35b05a1daa1fa65746873ed196d904 | reorder major commit | Woile/commitizen,Woile/commitizen | tests/test_bump_find_increment.py | tests/test_bump_find_increment.py | """
CC: Conventional commits
SVE: Semantic version at the end
"""
import pytest
from commitizen import bump
from commitizen.git import GitCommit
NONE_INCREMENT_CC = ["docs(README): motivation", "ci: added travis"]
PATCH_INCREMENTS_CC = [
"fix(setup.py): future is now required for every python version",
"docs... | """
CC: Conventional commits
SVE: Semantic version at the end
"""
import pytest
from commitizen import bump
from commitizen.git import GitCommit
NONE_INCREMENT_CC = ["docs(README): motivation", "ci: added travis"]
PATCH_INCREMENTS_CC = [
"docs(README): motivation",
"fix(setup.py): future is now required for ... | mit | Python |
01584b74adb86b54c2c1f1b7fd8253ec676e2480 | Fix isort check | solarissmoke/django-oscar,django-oscar/django-oscar,solarissmoke/django-oscar,django-oscar/django-oscar,django-oscar/django-oscar,django-oscar/django-oscar,solarissmoke/django-oscar,solarissmoke/django-oscar | tests/unit/customer/test_views.py | tests/unit/customer/test_views.py | from unittest.mock import Mock, patch
from django.test import Client, TestCase
from django.urls import reverse
from oscar.apps.customer.forms import EmailAuthenticationForm
class TestAccountAuthView(TestCase):
def setUp(self):
self.client = Client()
def test_request_is_passed_to_form(self):
... | from unittest.mock import patch, Mock
from django.test import TestCase, Client
from django.urls import reverse
from oscar.apps.customer.forms import EmailAuthenticationForm
class TestAccountAuthView(TestCase):
def setUp(self):
self.client = Client()
def test_request_is_passed_to_form(self):
... | bsd-3-clause | Python |
50118a012f28f4868e1a76e32f19ceba56a3eff0 | clarify exit instructions | adamlwgriffiths/Pyglet,seeminglee/pyglet64,niklaskorz/pyglet,seeminglee/pyglet64,seeminglee/pyglet64,niklaskorz/pyglet,adamlwgriffiths/Pyglet,niklaskorz/pyglet,adamlwgriffiths/Pyglet,niklaskorz/pyglet,adamlwgriffiths/Pyglet | tests/window/WINDOW_STYLE_TOOL.py | tests/window/WINDOW_STYLE_TOOL.py | #!/usr/bin/env python
'''Test that window style can be tool.
Expected behaviour:
One tool-styled window will be opened.
Close the window to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:04:10Z Alex.Holkner $'
import unittest
from pygl... | #!/usr/bin/env python
'''Test that window style can be tool.
Expected behaviour:
One tool-styled window will be opened.
Close the window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:04:10Z Alex.Holkner $'
import unitte... | bsd-3-clause | Python |
f61676eb803e2a7dc30fe9caab46bdec51d69503 | add onWindows() function | manu-chroma/schema_salad,common-workflow-language/schema_salad,common-workflow-language/schema_salad,common-workflow-language/schema_salad,common-workflow-language/schema_salad,common-workflow-language/schema_salad,manu-chroma/schema_salad,common-workflow-language/schema_salad,common-workflow-language/schema_salad | schema_salad/utils.py | schema_salad/utils.py | from __future__ import absolute_import
from typing import Any, Dict, List
def add_dictlist(di, key, val): # type: (Dict, Any, Any) -> None
if key not in di:
di[key] = []
di[key].append(val)
def aslist(l): # type: (Any) -> List
"""Convenience function to wrap single items and lists, and return... | from __future__ import absolute_import
from typing import Any, Dict, List
def add_dictlist(di, key, val): # type: (Dict, Any, Any) -> None
if key not in di:
di[key] = []
di[key].append(val)
def aslist(l): # type: (Any) -> List
"""Convenience function to wrap single items and lists, and return... | apache-2.0 | Python |
cfb56e39bb39caf9e86bfdcf5ef9d22838dba984 | bump version | rahul-c1/scrapy,elacuesta/scrapy,fontenele/scrapy,Cnfc19932/scrapy,rootAvish/scrapy,hyrole/scrapy,yusofm/scrapy,pombredanne/scrapy,Zephor5/scrapy,xiao26/scrapy,1yvT0s/scrapy,tagatac/scrapy,raphaelfruneaux/scrapy,zorojean/scrapy,dhenyjarasandy/scrapy,shaform/scrapy,fontenele/scrapy,johnardavies/scrapy,hansenDise/scrapy,... | scrapy/trunk/setup.py | scrapy/trunk/setup.py | from setuptools import setup, find_packages
import os, os.path, glob
def findfiles(pattern, base='.'):
matches = []
for root, _, _ in os.walk(base):
matches.extend(glob.glob(os.path.join(root, pattern)))
return matches
setup(
name = 'scrapy',
version = '0.8',
description = '',
lon... | from setuptools import setup, find_packages
import os, os.path, glob
def findfiles(pattern, base='.'):
matches = []
for root, _, _ in os.walk(base):
matches.extend(glob.glob(os.path.join(root, pattern)))
return matches
name = 'scrapy'
setup(
name = name,
version = '0.1',
description ... | bsd-3-clause | Python |
66c1455c915e35b9cfac1ebc2dcdb8f368f3f864 | Update create_gluster_cluster_sample_job.py | Tendrl/node-agent,Tendrl/node-agent,Tendrl/node_agent,Tendrl/node_agent,Tendrl/node-agent,r0h4n/node-agent,r0h4n/node-agent,r0h4n/node-agent | etc/create_gluster_cluster_sample_job.py | etc/create_gluster_cluster_sample_job.py | payload = {
"run": "tendrl.flows.CreateCluster",
"type": "node",
"created_from": "API",
"created_at": "2017-03-09T14:15:14Z",
"username": "admin",
"parameters": {
"Node[]": ["81720b6c-6732-49dd-ad32-15845f199c79",
"ab003bbc-00cd-4b74-b236-f19c2c33b96b"],
"Tendr... | payload = {
"integration_id": "89604c6b-2eff-4221-96b4-e41319240240",
"run": "tendrl.flows.CreateCluster",
"type": "node",
"created_from": "API",
"created_at": "2017-03-09T14:15:14Z",
"username": "admin",
"parameters": {
"Node[]": ["81720b6c-6732-49dd-ad32-15845f199c79",
... | lgpl-2.1 | Python |
3d56e7d875426c7eef9cfceaf6804cdd493e86bc | add newline | byteweaver/django-eca-catalogue | eca_catalogue/text/tests/models.py | eca_catalogue/text/tests/models.py | from eca_catalogue.text.abstract_models import *
class SellingPoint(AbstractSellingPoint):
pass
| from eca_catalogue.text.abstract_models import *
class SellingPoint(AbstractSellingPoint):
pass
| bsd-3-clause | Python |
5955feb3d94f04c92b41b7e0cc2f6994b2a0717b | update description | agrc/BEMS,agrc/BEMS,agrc/BEMS | scripts/BemsPallet.py | scripts/BemsPallet.py | #!/usr/bin/env python
# * coding: utf8 *
'''
BemsPallet.py
A module that contains a pallet to update the BEMS applicaiton
'''
from forklift.models import Pallet
from os.path import join
class BemsPallet(Pallet):
def __init__(self):
super(BemsPallet, self).__init__()
self.arcgis_services = [('B... | #!/usr/bin/env python
# * coding: utf8 *
'''
BemsPallet.py
A module that contains a pallet to update the querable layers behind our UTM basemaps
'''
from forklift.models import Pallet
from os.path import join
class BemsPallet(Pallet):
def __init__(self):
super(BemsPallet, self).__init__()
self... | mit | Python |
15c4e3a0d292d65ed88447679972be971ea22cc8 | Clean up some fields. | ViralTexts/vt-passim,ViralTexts/vt-passim,ViralTexts/vt-passim | scripts/hathi-load.py | scripts/hathi-load.py | from __future__ import print_function
import sys
from pyspark import SparkContext
from pyspark.sql import SQLContext
from pyspark.sql.functions import col, regexp_replace
def hathiRecord(r):
return dict([(f["@name"], f["#VALUE"]) for f in r.field])
if __name__ == "__main__":
if len(sys.argv) < 3:
pri... | from __future__ import print_function
import sys
from pyspark import SparkContext
from pyspark.sql import SQLContext
from pyspark.sql.functions import col
def hathiRecord(r):
return dict([(f["@name"], f["#VALUE"]) for f in r.field])
if __name__ == "__main__":
if len(sys.argv) < 3:
print("Usage: prett... | apache-2.0 | Python |
4601359727e5bb0ee2c65683120f32ee8874deef | Update Trade_Analysis_Example.py | Chandlercjy/OnePy | examples/Trade_Analysis_Example.py | examples/Trade_Analysis_Example.py | import OnePy as op
from OnePy.custom_module.cleaner_sma import SMA
class SmaStrategy(op.StrategyBase):
def __init__(self):
super().__init__()
self.sma1 = SMA(3, 40).calculate
self.sma2 = SMA(5, 40).calculate
def handle_bar(self):
for ticker in self.env.tickers:
i... | import OnePy as op
from OnePy.custom_module.cleaner_sma import SMA
class SmaStrategy(op.StrategyBase):
def __init__(self):
super().__init__()
self.sma1 = SMA(3, 40).calculate
self.sma2 = SMA(5, 40).calculate
def handle_bar(self):
for ticker in self.env.tickers:
i... | mit | Python |
e18468595e4b8ad09b28470b36f8cdd584ae2554 | check max_user_watches on startup of TestRunner | bbiskup/pytest-purkinje,bbiskup/pytest-purkinje | purkinje_pytest/testrunner.py | purkinje_pytest/testrunner.py | # -*- coding: utf-8 -*-
"""Automatic test execution"""
from __future__ import print_function
from watchdog.observers import Observer
import logging
import time
import os
from .handler import Handler
logger = logging.getLogger(__file__)
# Extensions of files to be watched
EXTENSIONS = ['.py']
class TestRunner:
... | # -*- coding: utf-8 -*-
"""Automatic test execution"""
from __future__ import print_function
from watchdog.observers import Observer
import logging
import time
from .hander import Handler
logger = logging.getLogger(__file__)
# Extensions of files to be watched
EXTENSIONS = ['.py']
class TestRunner:
"""Watche... | mit | Python |
0deec1f72b2d42282581197b148b7922a5462ffc | Send a ping message before listening. | Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server | pykeg/bin/kegboard_monitor.py | pykeg/bin/kegboard_monitor.py | #!/usr/bin/env python
#
# Copyright 2009 Mike Wakerly <opensource@hoho.com>
#
# This file is part of the Pykeg package of the Kegbot project.
# For more information on Pykeg or Kegbot, see http://kegbot.org/
#
# Pykeg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public... | #!/usr/bin/env python
#
# Copyright 2009 Mike Wakerly <opensource@hoho.com>
#
# This file is part of the Pykeg package of the Kegbot project.
# For more information on Pykeg or Kegbot, see http://kegbot.org/
#
# Pykeg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public... | mit | Python |
5fd25b11eac4725ca7da879082d9334481fa59b8 | Send `external` folder with crab jobs | cp3-llbb/GridIn,cp3-llbb/GridIn | python/default_crab_config.py | python/default_crab_config.py | __author__ = 'sbrochet'
def create_config(is_mc):
"""
Create a default CRAB configuration suitable to run the framework
:return:
"""
from CRABClient.UserUtilities import config, getUsernameFromSiteDB
config = config()
config.General.workArea = 'tasks'
config.General.transferOutputs = ... | __author__ = 'sbrochet'
def create_config(is_mc):
"""
Create a default CRAB configuration suitable to run the framework
:return:
"""
from CRABClient.UserUtilities import config, getUsernameFromSiteDB
config = config()
config.General.workArea = 'tasks'
config.General.transferOutputs = ... | mit | Python |
f494f6a555f2e42a19c3f4b9051b259a1a3aad8e | allow method chain on venv create | pythonanywhere/helper_scripts | pythonanywhere/virtualenvs.py | pythonanywhere/virtualenvs.py | import os
from pathlib import Path
import subprocess
from pythonanywhere.snakesay import snakesay
class Virtualenv:
def __init__(self, domain, python_version):
self.domain = domain
self.python_version = python_version
self.path = Path(os.environ['WORKON_HOME']) / domain
def __eq__(s... | import os
from pathlib import Path
import subprocess
from pythonanywhere.snakesay import snakesay
class Virtualenv:
def __init__(self, domain, python_version):
self.domain = domain
self.python_version = python_version
self.path = Path(os.environ['WORKON_HOME']) / domain
def __eq__(s... | mit | Python |
47d842a243d789b2675502cfdfc3a8b412c0fed5 | Fix up select | 5outh/evolve | continuous_optimization.py | continuous_optimization.py | from math import *
from random import *
"""
Population size: 10
Generations: 200
Selection: 3-way tournament
Mutation: Uniform
Recombination: Average one with alpha != 1/2
Replacement strategy: Replace worst
"""
def f(x, y):
return (abs(x) + abs(y)) * (1 + abs(sin(abs(x) * pi)) + abs(sin(abs(y) * pi)))
def unfit... | from math import *
from random import *
"""
Population size: 10
Generations: 200
Selection: 3-way tournament
Mutation: Uniform
Recombination: Average one with alpha != 1/2
Replacement strategy: Replace worst
"""
def f(x, y):
return (abs(x) + abs(y)) * (1 + abs(sin(abs(x) * pi)) + abs(sin(abs(y) * pi)))
def unfit... | mit | Python |
7e779eb8abc4035eca086691ec36c19e02e6409b | Integrate LLVM at llvm/llvm-project@4191de262f19 | tensorflow/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tens... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "4191de262f19a65e3e5690f9780753f26fc649c9"
LLVM_SHA256 = "c916ec0a7daea6e5e18e85b959bb0bf0fdc4465beff4e8648e426558bc729367"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "f011d32c3a625eb86d1e33a70100b0a031f5fcd4"
LLVM_SHA256 = "b3ec1a2253da80c473df9addacc6ff5b7cfc3a788043a1c59480a93fd0d6fe0e"
tf_http_archive(
... | apache-2.0 | Python |
037584e8a31b08f68c46909d22f4e8a2408e25f9 | Integrate LLVM at llvm/llvm-project@f46f93b47863 | yongtang/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow,yongtang/tensorflow,Intel-Corporation/tensorflow,paolodedios/tens... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "f46f93b4786377dd7ee704ef2beedadfe4f05adf"
LLVM_SHA256 = "7235b032f2dd06cfaeae625eaed1a75bee5a368859198a04c4f53daa176b851f"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "1d7fdbbc183aee2f1168425ae21e961164495466"
LLVM_SHA256 = "7a1e031a82626ca8461367c8e18b9091d867723141191a721e0f6173cf61973d"
tf_http_archive(
... | apache-2.0 | Python |
759d8d5731afc5d1735e0b2dc49cd03604d013cd | Integrate LLVM at llvm/llvm-project@7a550212e8ff | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "7a550212e8ff5552b0bd10d0c1af459a55c36234"
LLVM_SHA256 = "07411044261ca9fe7973295b86eb425640248cb8e3bdeafffe885d6caee3eec0"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "f7819ce166bcc472108cf7c05f86edcf4ee9e6cf"
LLVM_SHA256 = "46c1a4d23cc7a32cba19dbf2cd13b3f60c7382e9782c0ed12e2177d96620aeb6"
tfrt_http_archive(
... | apache-2.0 | Python |
6b699002b3594d2e5bd265682b67b2dadb96429b | Integrate LLVM at llvm/llvm-project@1209b9c2c2be | tensorflow/tensorflow,yongtang/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,yongtang/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,karllessard/tensorflow,Intel-tensorflow/tensorfl... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "1209b9c2c2bec5a5ffd68d6785015bfd222ecf00"
LLVM_SHA256 = "cf8dd3504067b4187ca60249ef64e7f1fd3e8b2583567e71191f3a6061960c5c"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "b10e508c19bfb4037be7d78a402c718a889f022d"
LLVM_SHA256 = "33545e07bfebee67c22b741eaf74f0cdc8e8de2df32e731d90d249edc551a7e2"
tf_http_archive(
... | apache-2.0 | Python |
0c733e8ef1b5a17d497ff250e189490c09fc4d07 | Integrate LLVM at llvm/llvm-project@f549176ad976 | tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-tensorflow/tensorflow,Intel-Corporation/tensorflow,karllessard/tensorflow,Intel-Corporation/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,tensorflow/tensorflow-experimental_link_stat... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "f549176ad976caa3e19edd036df9a7e12770af7c"
LLVM_SHA256 = "053407632f85e32ff7a1e15dbb9b09df0b75b510c35b1cefebdcb17de844d25a"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "80e166f81abd33d15ced8d6ab66cb4193e75b51e"
LLVM_SHA256 = "314954df93bdf1cd8a46c04f9470488adc20a8462745d6f2990e65d45fea28c2"
tf_http_archive(
... | apache-2.0 | Python |
07ad723e7c5090625f759818a2e8dba5ca9ecd08 | Integrate LLVM at llvm/llvm-project@4b33ea052ab7 | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "4b33ea052ab7fbceed4c62debf1145f80d66b0d7"
LLVM_SHA256 = "b6c61a6c81b1910cc34ccd9800fd18afc2dc1b9d76c640dd767f9e550f94c8d6"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "58a47508f03546b4fce668fad751102b94feacfd"
LLVM_SHA256 = "b3106ecc8ad56ecf9cd72c8a47117342e7641ef5889acb1d9093bcd0f2920d59"
tfrt_http_archive(
... | apache-2.0 | Python |
6e17350b046becec4504c13bab480c873deddc94 | Integrate LLVM at llvm/llvm-project@709e23a1c124 | tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,paolodedios/tensorflow,paolodedios/tensorflow,tensorflow/tenso... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "709e23a1c1245bc59d523f066de940bd51715125"
LLVM_SHA256 = "ad510982264e85b55f51b61ff7e0f5d200f7dc6132485d4d2e741fe7d33cf02a"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "dabb7514f562a3b5b8b9f360b8ca1f52cc5b741b"
LLVM_SHA256 = "84f2c6c5cf89d255ef7576f359ad308fb346be58a29825ee105e1050158726dd"
tf_http_archive(
... | apache-2.0 | Python |
db266d81b05e04a70b7f5097d859428df6e5ad23 | Integrate LLVM at llvm/llvm-project@5bbe50148f3b | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "5bbe50148f3b515c170be22209395b72890f5b8c"
LLVM_SHA256 = "ef8c3f61983f86b85b54306103000865f671ee0574cda36fd0f0ed8209d20b19"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "b927aa69bf2fd50ecf33e3f5ec853eb3c70312c5"
LLVM_SHA256 = "0b7e47bd9a62b7c14d6f4c4b1cf8fdb2fba5996e6b24917deb07d9f636f7ce36"
tfrt_http_archive(
... | apache-2.0 | Python |
6e698b2aa2c2af0e97fb1f5ca80be7f869dea859 | Integrate LLVM at llvm/llvm-project@494e77138c2e | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "494e77138c2e53961c43fe6957142d4f90034f98"
LLVM_SHA256 = "a1fb353141d25de395741ae8a5b8481a321dff6d17070dff72d286b8e901041a"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "535df472b04208d6ae88e017c8f1d831fb239346"
LLVM_SHA256 = "3df8652412f4801eb5ab63705092526fb55e8d4a1fe016c4269ab39436e94da5"
tfrt_http_archive(
... | apache-2.0 | Python |
fb9627f42d93a429760906313db883778c647d5c | Integrate LLVM at llvm/llvm-project@f984ac2715f7 | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "f984ac2715f71c38a7872fa2c2ad535b3d4fa285"
LLVM_SHA256 = "a4c93ba7af3484645c237505562192163e658f540f248ef1ae0e72ca54014cb6"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "345ace026b6e5cdbc38d207291e4b399d72e62ee"
LLVM_SHA256 = "23b2688eae6397483ee7522f3f7ae3f26a188d94b31847db7e2c954ad8f087d8"
tfrt_http_archive(
... | apache-2.0 | Python |
1fa88eb76390248a97896453afbb7bfb7ea068fc | Integrate LLVM at llvm/llvm-project@d9e46beace31 | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "d9e46beace3120fbc4810dda5c3ed88f93e862a4"
LLVM_SHA256 = "65f613519dbce76c768c0ee636d1a414c4c9e4e12806d9b6bf2d3af012f0714d"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "8b4afc5aef148aff26047ca7bad4cdcf58c35e25"
LLVM_SHA256 = "a6cae7c1bf28c3beb5faf50269cde007f0f256d74378175a3981fd586fdfb71a"
tfrt_http_archive(
... | apache-2.0 | Python |
b122d1ec549bd4ce69c046ba1ce17c94d6792d76 | Integrate LLVM at llvm/llvm-project@57dfa12e4ca8 | gautam1858/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "57dfa12e4ca8d8f5642a3c3a1e80040fd5cba3c9"
LLVM_SHA256 = "9f54c2946fa692c1fa699b782c240dd8a118c8acfd910624b208736c0024a35d"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "638dcea010cfc280f428d0cc13f4aa8578a1d69d"
LLVM_SHA256 = "38580afa46a4d1cc294012e044a3d74da45f135c8fbcee9ffbe1658749cdd608"
tf_http_archive(
... | apache-2.0 | Python |
337998a8c447dc326adf8a0d76de4ceef13d69ed | Integrate LLVM at llvm/llvm-project@577fea4e1a13 | yongtang/tensorflow,gautam1858/tensorflow,sarvex/tensorflow,yongtang/tensorflow,sarvex/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow,karllessard/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_li... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "577fea4e1a13319adf2b660f57bf570195a7f78d"
LLVM_SHA256 = "0ec4987b7af1ccf251ee0097b78e8921600c9c5d748d79709bad74df0f504a0e"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "9968896cd62a62b11ac61085534dd598c4bd3c60"
LLVM_SHA256 = "003be922b3caa2c53d9ab0acaa0e2e26022f8f0cda1d0b1775e254928cce9556"
tf_http_archive(
... | apache-2.0 | Python |
21f997fc9d09f3b6a6a37204abe42a221f3ea546 | Integrate LLVM at llvm/llvm-project@c2a849019343 | Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,tensorflow/tensorflow,gautam1858/tensorflow,yongtang/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,paolodedios/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_o... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "c2a84901934367e2148722bf3161846618bfaad3"
LLVM_SHA256 = "950d56ff03fb2a9d77c0053f7972a99370a2c96e6361ab79f0fa18aafee5e776"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "a48300aee570f8eea4ec0b03e2d176aab648afb0"
LLVM_SHA256 = "fca50e379394f9a6d4fc8ad28094512bfe1ba1ea84799a2de5f762f6c6c44a81"
tf_http_archive(
... | apache-2.0 | Python |
269065b581eee06b8285bb993a0d35d39f63f326 | update dev version after 0.18.0 tag [skip ci] | desihub/desitarget,desihub/desitarget | py/desitarget/_version.py | py/desitarget/_version.py | __version__ = '0.18.0.dev1446'
| __version__ = '0.18.0'
| bsd-3-clause | Python |
03c1819395c1d4f45fe52ff4b3992e37ef94ab08 | clean up test | akaihola/PyChecker,thomasvs/pychecker,akaihola/PyChecker,thomasvs/pychecker | pychecker2/tests/class.py | pychecker2/tests/class.py | import compiler
import compiler as one
import compiler.ast
import compiler.ast as two
from compiler import ast
from compiler import ast as three
from compiler.ast import Const
from compiler.ast import Con... | import compiler
import compiler as one
import compiler.ast
import compiler.ast as two
# import compiler.ast.Const
# import compiler.ast.Const as three
from compiler import ast
from compiler import ast ... | bsd-3-clause | Python |
dfe01bbf54b8ac4543b13301b0056a4030c8f24e | use different kinds of svms | juditacs/dsl,juditacs/dsl | dsl/representation/classifiers.py | dsl/representation/classifiers.py | from sklearn.naive_bayes import GaussianNB
from sklearn import svm
class BaseClassifier(object):
@staticmethod
def lookup_classifier(cl_name, *args, **kwargs):
if isinstance(cl_name, str):
if cl_name.lower() == 'naive_bayes':
return NaiveBayesClassifier()
if cl_... | from sklearn.naive_bayes import GaussianNB
from sklearn import svm
class BaseClassifier(object):
@staticmethod
def lookup_classifier(cl_name, *args, **kwargs):
if isinstance(cl_name, str):
if cl_name.lower() == 'naive_bayes':
return NaiveBayesClassifier()
if cl_... | mit | Python |
eb89dc4aa14a76b2fcfea63982013b4a853c6692 | Exit on bad status code for get response | supermitch/craigschart | craigschart/craigschart.py | craigschart/craigschart.py | import sys
from bs4 import BeautifulSoup
import requests
def get_html(url):
r = requests.get(url)
if r.status_code == 200:
return r.text
else:
print('Request returned status code {}'.format(r.status_code))
return None
def add_start(url, start):
parts = url.split('?')
ret... | from bs4 import BeautifulSoup
import requests
def get_html(url):
r = requests.get(url)
return r.text
def add_start(url, start):
parts = url.split('?')
return parts[0] + '?s={}'.format(start) + '&' + parts[1]
def main():
url = 'http://vancouver.craigslist.ca/search/cto?query=Expedition'
htm... | mit | Python |
b38043aa4a42169efa023278c327ea37b73ee5ef | change varibles from self.name to self.id and from self.start_value in self.value | develersrl/rooms,develersrl/rooms,develersrl/rooms,develersrl/rooms,develersrl/rooms,develersrl/rooms,develersrl/rooms | trunk/editor/structData/var.py | trunk/editor/structData/var.py | #!/usr/bin/env python
from origin import OriginData
class Var(OriginData):
tag_name = 'var'
def __init__(self, id, value):
super(Var, self).__init__()
self.id = id
self.value = value
| #!/usr/bin/env python
from origin import OriginData
class Var(OriginData):
tag_name = 'var'
def __init__(self, id, start_value):
super(Var, self).__init__()
self.name = id
self.start_value = start_value
| mit | Python |
0fd18788f2ffeb22c97bb57b7c38e28ee06e94b8 | Fix PEP8 issues. | ebenpack/laboratory,ebenpack/laboratory,ebenpack/laboratory | cribbage/cribbage/event.py | cribbage/cribbage/event.py | #TODO: Refactor events. Initialize w/ players?
class Event(object):
def discard(self):
pass
def play(self):
pass
def peg(self):
pass
def muggins(self):
pass
class OfflineEvent(Event):
def discard(self, player):
print("Your cards: {}".format(player.hand))... | class Event(object):
def discard(self):
pass
def play(self):
pass
def peg(self):
pass
class OfflineEvent(Event):
def discard(self, player):
print("Your cards: {}".format(player.hand))
discarded = []
for _ in range(2):
print("Player {}, Selec... | mit | Python |
b6e1411c1ee56a6b860554e9b917c32c2a77cba2 | fix typo | djmitche/remsh,djmitche/remsh,djmitche/remsh | remsh/slave/dispatcher.py | remsh/slave/dispatcher.py | #! python
# This file is part of remsh.
#
# remsh is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# remsh is distributed in the hope ... | #! python
# This file is part of remsh.
#
# remsh is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# remsh is distributed in the hope ... | mit | Python |
5a889dee78335d3c7d758c1df16d774160049b12 | Add an api view for the API root | bertrandvidal/stuff,bertrandvidal/stuff,bertrandvidal/stuff,bertrandvidal/stuff | djangoprojects/django_rest_framework/tutorial/snippets/views.py | djangoprojects/django_rest_framework/tutorial/snippets/views.py | from snippets.models import Snippet
from snippets.serializers import SnippetSerializer
from rest_framework import generics
from rest_framework import permissions
from django.contrib.auth.models import User
from snippets.serializers import UserSerializer
from snippets.permissions import IsOwnerOrReadOnly
from rest_frame... | from snippets.models import Snippet
from snippets.serializers import SnippetSerializer
from rest_framework import generics
from rest_framework import permissions
from django.contrib.auth.models import User
from snippets.serializers import UserSerializer
from snippets.permissions import IsOwnerOrReadOnly
class UserLis... | unlicense | Python |
78d0ae826f68bd7a859f035c01547b70636b6c4f | Update logger config | martindurant/conda-manager,spyder-ide/conda-manager,martindurant/conda-manager,spyder-ide/conda-manager | conda_manager/utils/logs.py | conda_manager/utils/logs.py | # -*- coding: utf-8 -*-
# Standard library imports
import logging.handlers
import os
# Local imports
from conda_manager.utils import get_conf_path
logfolder = os.path.join(get_conf_path(), 'logs')
logfile = os.path.join(logfolder, 'condamanager.log')
def setup():
if not os.path.isdir(logfolder):
os.mk... | # -*- coding: utf-8 -*-
# Standard library imports
import logging.handlers
import os
# Local imports
from conda_manager.utils import get_conf_path
path = get_conf_path()
logfile = os.path.join(path, 'condamanager.log')
def setup():
logger = logging.getLogger('navigator')
logger.setLevel(logging.DEBUG)
... | mit | Python |
1c087a0e293617da34248795cf764b508bfc3732 | Add doc string to ElectionSource model class | opencivicdata/python-opencivicdata-django,opencivicdata/python-opencivicdata,opencivicdata/python-opencivicdata-django,opencivicdata/python-opencivicdata,opencivicdata/python-opencivicdata-django | opencivicdata/elections/models/election.py | opencivicdata/elections/models/election.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Election-related models.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from opencivicdata.core.models.base import (
OCDBase,
IdentifierBase,
LinkBase,
OCDIDField,
)
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Election-related models.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from opencivicdata.core.models.base import (
OCDBase,
IdentifierBase,
LinkBase,
OCDIDField,
)
... | bsd-3-clause | Python |
8dde01ea03600d757f20daa33508854262f68678 | Fix type check. | mblayman/lcp,mblayman/lcp,mblayman/lcp | conductor/vendor/_google.py | conductor/vendor/_google.py | from typing import Dict
from apiclient import discovery
from google.oauth2.credentials import Credentials
from conductor.planner.models import Student
SCHEDULE_HEADER_ROW = [
"School",
"Application Platform",
"Plan",
"Out Due Date",
"Official Due Date",
"App Form Status",
"Essay List (wor... | from typing import List
from apiclient import discovery
from google.oauth2.credentials import Credentials
from conductor.planner.models import Student
SCHEDULE_HEADER_ROW = [
"School",
"Application Platform",
"Plan",
"Out Due Date",
"Official Due Date",
"App Form Status",
"Essay List (wor... | bsd-2-clause | Python |
a4c50c6207297884bc360e031478188ba8eb8aa0 | Add --watch argument to webpack command | mnieber/dodo_commands | dodo_commands/extra/webdev_commands/webpack.py | dodo_commands/extra/webdev_commands/webpack.py | """Run the webpack command."""
import argparse
from dodo_commands.extra.standard_commands import DodoCommand
from dodo_commands.framework.util import remove_trailing_dashes
class Command(DodoCommand): # noqa
decorators = ['docker']
docker_options = [
'--name=webpack',
]
def add_arguments_imp... | """Run the webpack command."""
import argparse
from dodo_commands.extra.standard_commands import DodoCommand
from dodo_commands.framework.util import remove_trailing_dashes
class Command(DodoCommand): # noqa
decorators = ['docker']
docker_options = [
'--name=webpack',
]
def add_arguments_imp... | mit | Python |
fdefba19dbc8ee91d95f26c986ff38a6d594e32f | change 023 to use a list comprehension | henry808/euler | 023/eul023.py | 023/eul023.py | #! /usr/bin/python
from __future__ import print_function
from math import sqrt
# Project Euler # 23
def proper_divisors(n):
results = [1]
for i in xrange(2, int(sqrt(n))+1):
if n % i == 0:
results.append(i)
if i != n/i:
results.append(n/i)
return results
if... | #! /usr/bin/python
from __future__ import print_function
from math import sqrt
# Project Euler # 23
def proper_divisors(n):
results = [1]
for i in xrange(2, int(sqrt(n))+1):
if n % i == 0:
results.append(i)
if i != n/i:
results.append(n/i)
return results
if... | mit | Python |
30c20f362e29980c3a6c3804009769afb2debe55 | Rewrite folder unittest tests to pytest style test functions (#41672) | soldag/home-assistant,sander76/home-assistant,Danielhiversen/home-assistant,adrienbrault/home-assistant,lukas-hetzenecker/home-assistant,FreekingDean/home-assistant,mezz64/home-assistant,tboyce1/home-assistant,balloob/home-assistant,tboyce1/home-assistant,aronsky/home-assistant,jawilson/home-assistant,partofthething/ho... | tests/components/folder/test_sensor.py | tests/components/folder/test_sensor.py | """The tests for the folder sensor."""
import os
from homeassistant.components.folder.sensor import CONF_FOLDER_PATHS
from homeassistant.setup import async_setup_component
CWD = os.path.join(os.path.dirname(__file__))
TEST_FOLDER = "test_folder"
TEST_DIR = os.path.join(CWD, TEST_FOLDER)
TEST_TXT = "mock_test_folder.t... | """The tests for the folder sensor."""
import os
import unittest
from homeassistant.components.folder.sensor import CONF_FOLDER_PATHS
from homeassistant.setup import setup_component
from tests.common import get_test_home_assistant
CWD = os.path.join(os.path.dirname(__file__))
TEST_FOLDER = "test_folder"
TEST_DIR = o... | apache-2.0 | Python |
ef7a4a59e0ab93ce42b4eed45031c21c9bb495c8 | remove print | cmu-delphi/operations,cmu-delphi/operations,cmu-delphi/operations | tests/database_metrics/test_parsers.py | tests/database_metrics/test_parsers.py | """Tests for parsers.py"""
import unittest
# py3tester coverage target
__test_target__ = 'delphi.operations.database_metrics.parsers'
class TestParser(unittest.TestCase):
def test_parse_db_size(self):
test_query_result = b'db\tsize_mb\nepidata\t7.79687500\ninformation_schema\t0.18750000\n'
self.... | """Tests for parsers.py"""
import unittest
# py3tester coverage target
__test_target__ = 'delphi.operations.database_metrics.parsers'
class TestParser(unittest.TestCase):
def test_parse_db_size(self):
test_query_result = b'db\tsize_mb\nepidata\t7.79687500\ninformation_schema\t0.18750000\n'
self.... | mit | Python |
1ae421f6bf2404baeba31a93a9a683f16360af09 | Update tests for #73 to remove EOF and to run non-failing test | igordejanovic/parglare,igordejanovic/parglare | tests/func/regressions/test_issue73.py | tests/func/regressions/test_issue73.py | # -*- coding: utf-8 -*-
# Tests for issue #73 (see https://github.com/igordejanovic/parglare/issues/73)
from __future__ import unicode_literals
import pytest
from parglare import Grammar, Parser
@pytest.mark.skip
def test_recursive_rule():
grammar = r"""
s: as;
as: as "a" | EMPTY;
"""
g = Grammar... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from parglare import Grammar, Parser
@pytest.mark.skip
def test_recursive_rule():
grammar = r"""
s: as EOF;
as: as "a" | EMPTY;
"""
g = Grammar.from_string(grammar)
parser = Parser(g)
parser.parse('aaa')
@pyte... | mit | Python |
e87a408dcdaf2b0bd65d86f541c036cd9a3c7093 | Correct license. | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/integration/states/virtualenv.py | tests/integration/states/virtualenv.py | # -*- coding: utf-8 -*-
"""
:copyright: ยฉ 2012 UfSoft.org - :email:`Pedro Algarvio (pedro@algarvio.me)`
:license: Apache 2.0, see LICENSE for more details
"""
# Import python libs
import os
import shutil
import integration
# Import salt libs
from saltunittest import skipIf, destructiveTest
class VirtualenvT... | # -*- coding: utf-8 -*-
# vim: sw=4 ts=4 fenc=utf-8
"""
:copyright: ยฉ 2012 UfSoft.org - :email:`Pedro Algarvio (pedro@algarvio.me)`
:license: BSD, see LICENSE for more details
"""
# Import python libs
import os
import shutil
import integration
# Import salt libs
from saltunittest import skipIf, destructiveTes... | apache-2.0 | Python |
35d4bc796f27bdf5aea7c3dea83c581260a4669a | Use patterns with explicit length | avanov/Rhetoric,avanov/Rhetoric | tests/testapp/testapp/blog/__init__.py | tests/testapp/testapp/blog/__init__.py | def includeme(config):
config.add_route('test.new.routes', '/test/new/routes/{param:[a-z]{1,}}')
config.add_route('blog.page', '/page/{page_slug}')
| def includeme(config):
config.add_route('test.new.routes', '/test/new/routes/{param:[a-z]+}')
config.add_route('blog.page', '/page/{page_slug}')
| mit | Python |
1b658ba0aaf24ba7d3aed6a55323ee41b5390cf1 | add some code | devlights/try-python | trypython/advanced/coroutine01.py | trypython/advanced/coroutine01.py | # coding: utf-8
"""
ใณใซใผใใณ (co-routine) ใซใคใใฆใฎใตใณใใซใงใใ
ๅ่:
http://postd.cc/python-generators-coroutines-native-coroutines-and-async-await/
https://docs.python.jp/3/library/asyncio-task.html
"""
from typing import Generator
from trypython.common.commoncls import SampleBase
from trypython.common.commonfunc import pr
... | # coding: utf-8
"""
ใณใซใผใใณ (co-routine) ใซใคใใฆใฎใตใณใใซใงใใ
"""
from trypython.common.commoncls import SampleBase
class Sample(SampleBase):
def exec(self):
pass
def go():
obj = Sample()
obj.exec()
if __name__ == '__main__':
go()
| mit | Python |
123366cd43f7f8c584ee8b4a71b05a8261e1c95b | Fix CI script | tableau/TabPy,tableau/TabPy,tableau/TabPy | CI/inc_ver.py | CI/inc_ver.py | '''
Update version (VERSION file in the repository root)
with commit number:
major.minor.commit
The script is only to be used in Travis CI,
see .travis.yml for more details.
The script uses Travis enviroment variables, see
https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
... | '''
Update version (VERSION file in the repository root)
with commit number:
major.minor.commit
The script is only to be used in Travis CI,
see .travis.yml for more details.
The script uses Travis enviroment variables, see
https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
... | mit | Python |
a2b10215b99544beac0d4c5c417f3442821b298c | apply python 3 except syntax | cedar101/twitter-korean-py | twitter_korean/_setup_hooks.py | twitter_korean/_setup_hooks.py | from __future__ import print_function
import os.path
from distutils import log
#from distutils.command import build_py
import setuptools
from twitter_korean import JAR_DIR
VERSION = '4.4'
def download_jar(cmdobj):
from maven.requestor import RequestException
from maven.artifact import Artifact
from mav... | from __future__ import print_function
import os.path
from distutils import log
#from distutils.command import build_py
import setuptools
from twitter_korean import JAR_DIR
VERSION = '4.4'
def download_jar(cmdobj):
from maven.requestor import RequestException
from maven.artifact import Artifact
from mav... | apache-2.0 | Python |
baceaf8d08e64bfe72bda639818332ab42b672c5 | Fix database creation. | PeterTheOne/ueberwachungspaket.at,PeterTheOne/ueberwachungspaket.at,PeterTheOne/ueberwachungspaket.at | ueberwachungspaket/__init__.py | ueberwachungspaket/__init__.py | from flask import Flask
from config import *
from database import init_db, db_session
from .representatives import Representatives
app = Flask(__name__)
app.config.from_pyfile("config.py")
app.config["TWILIO_NUMBERS"] = TWILIO_NUMBERS
reps = Representatives()
init_db()
if __name__ == "__main__":
app.run()
@app.t... | from flask import Flask
from config import *
from database import init_db, db_session
from .representatives import Representatives
app = Flask(__name__)
app.config.from_pyfile("config.py")
app.config["TWILIO_NUMBERS"] = TWILIO_NUMBERS
reps = Representatives()
if __name__ == "__main__":
app.run()
initdb()
@ap... | mit | Python |
d0aacc2bf53d6da34fe5f9c3574ee4364362c2d0 | add SYS_mmap2 for x86 | lunixbochs/usercorn,Grazfather/usercorn | usercorn/arch/x86/interrupt.py | usercorn/arch/x86/interrupt.py | from unicorn.x86_const import *
import os
import sys
def syscall(cls):
regs = [X86_REG_EAX, X86_REG_EBX, X86_REG_ECX, X86_REG_RDX, X86_REG_ESI, X86_REG_EDI, X86_REG_EBP]
num, a1, a2, a3, a4, a5, a6 = [cls.reg_read(r) for r in regs]
ret = 0
if num == 1: # SYS_exit
sys.exit(a1)
elif num == 2:... | from unicorn.x86_const import *
import os
import sys
def syscall(cls):
regs = [X86_REG_EAX, X86_REG_EBX, X86_REG_ECX, X86_REG_RDX, X86_REG_ESI, X86_REG_EDI, X86_REG_EBP]
num, a1, a2, a3, a4, a5, a6 = [cls.reg_read(r) for r in regs]
ret = 0
if num == 1: # SYS_exit
sys.exit(a1)
elif num == 2:... | mit | Python |
441a253020cb996bb55a3ddbe087a3fa977b73c5 | Update compute_errors.py | memmett/minipfasst,memmett/minipfasst,memmett/minipfasst | examples/navier-stokes/compute_errors.py | examples/navier-stokes/compute_errors.py | """Parse output (from stdout) of NS runs and plot enstrophy."""
import click
import re
import os
import multiprocessing
import subprocess
from collections import namedtuple
pftuple = namedtuple('pftuple', ['step', 'iteration', 'level', 'data'])
def read(dname):
"""Read output directory *dname* and return list o... | """Parse output (from stdout) of NS runs and plot enstrophy."""
import click
import numpy as np
import re
import os
import multiprocessing
from collections import namedtuple
pftuple = namedtuple('pftuple', ['step', 'iteration', 'level', 'data'])
def read(dname):
"""Read output directory *dname* and return list o... | bsd-2-clause | Python |
3f5149841163ab3e79fbd69990e53791281ec4a6 | Add validate published on templatetag get all articlebox | jeanmask/opps,opps/opps,jeanmask/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,YACOWS/opps,opps/opps,opps/opps,opps/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,YACOWS/opps,williamroot/opps,williamroot/opps | opps/articles/templatetags/article_tags.py | opps/articles/templatetags/article_tags.py | # -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from django.utils import timezone
from opps.articles.models import ArticleBox
register = template.Library()
@register.simple_tag
def get_articlebox(slug, channel_slug=None, template_name=None):
if channel_slug:
slug = s... | # -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from django.utils import timezone
from opps.articles.models import ArticleBox
register = template.Library()
@register.simple_tag
def get_articlebox(slug, channel_slug=None, template_name=None):
if channel_slug:
slug = s... | mit | Python |
c2d23cac7bbd1fa04565800ddd8d02aad8ab9ae9 | remove unused code (#1656) | N-Parsons/exercism-python,smalley/python,jmluy/xpython,exercism/python,exercism/xpython,exercism/python,behrtam/xpython,behrtam/xpython,exercism/xpython,N-Parsons/exercism-python,smalley/python,jmluy/xpython | exercises/pythagorean-triplet/example.py | exercises/pythagorean-triplet/example.py | from math import sqrt, ceil
try:
# Python 3
from math import gcd
except ImportError:
# Python 2
from fractions import gcd
def triplets_in_range(range_start, range_end):
for b in range(4, range_end + 1, 4):
for x, y, z in primitive_triplets(b):
a, b, c = (x, y, z)
wh... | from math import sqrt, ceil
try:
# Python 3
from math import gcd
except ImportError:
# Python 2
from fractions import gcd
def triplets_in_range(range_start, range_end):
for b in range(4, range_end + 1, 4):
for x, y, z in primitive_triplets(b):
a, b, c = (x, y, z)
wh... | mit | Python |
ff2bbb584f788c10649771db1a6b5a58cbe23e9c | Update views.py | zhounanshu/Flask-AppBuilder,zhounanshu/Flask-AppBuilder,rpiotti/Flask-AppBuilder,qpxu007/Flask-AppBuilder,qpxu007/Flask-AppBuilder,rpiotti/Flask-AppBuilder,rpiotti/Flask-AppBuilder,qpxu007/Flask-AppBuilder,zhounanshu/Flask-AppBuilder,dpgaspar/Flask-AppBuilder,rpiotti/Flask-AppBuilder,dpgaspar/Flask-AppBuilder,dpgaspar/... | skeleton/app/views.py | skeleton/app/views.py | from flask.ext.appbuilder.baseapp import BaseApp
from flask.ext.appbuilder.views import GeneralView
from app import app, db
baseapp = BaseApp(app)
| from flask.ext.appbuilder.baseapp import BaseApp
from flask.ext.appbuilder.views import GeneralView
baseapp = BaseApp(app)
| bsd-3-clause | Python |
b854477ea20916a770e5d633c69f41cdaf18722e | Comment non implemented subcommands | montefra/dodocs | dodocs/cmdline.py | dodocs/cmdline.py | """Command line parser
"""
import argparse as ap
from dodocs.venvs import venv_cmd_arguments
from dodocs import profiles
from dodocs import utils
DEF_FORMATTER = ap.ArgumentDefaultsHelpFormatter
def parse(argv=None):
"""Define the command line and returns the namespace
Parameters
----------
argv: ... | """Command line parser
"""
import argparse as ap
from dodocs.venvs import venv_cmd_arguments
from dodocs import profiles
from dodocs import utils
DEF_FORMATTER = ap.ArgumentDefaultsHelpFormatter
def parse(argv=None):
"""Define the command line and returns the namespace
Parameters
----------
argv: ... | mit | Python |
0c17713043802cddc1b9bc849f0ead421466311c | test update | jdhaines/PythonHardWay | ex25.py | ex25.py | def break_words(stuff):
"""This function will break up words for us."""
words = stuff.split(' ')
return words
def sort_words(words):
"""Sorts the words."""
return sorted(words)
def print_first_word(words):
"""Prints the first word after popping it off."""
word = words.pop(0)
print wor... | def break_words(stuff):
"""This function will break up words for us."""
words = stuff.split(' ')
return words
def sort_words(words):
"""Sorts the words."""
return sorted(words)
def print_first_word(words):
"""Prints the first word after popping it off."""
word = words.pop(0)
print word... | mit | Python |
1481ac38ad737592941e69ceafbc9d459be3182b | Fix __init__.py for Python 3 compatibility | ProgVal/Limnoria-test,Ban3/Limnoria,ProgVal/Limnoria-test,Ban3/Limnoria | sandbox/Debug/__init__.py | sandbox/Debug/__init__.py | ###
# Copyright (c) 2004, Jeremiah Fincher
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditi... | ###
# Copyright (c) 2004, Jeremiah Fincher
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditi... | bsd-3-clause | Python |
cc0cab0fcea999b588556ee80246c55827186430 | return the payload | gamechanger/dusty,gamechanger/dusty,gamechanger/dusty,gamechanger/dusty,gamechanger/dusty | dusty/cli/test.py | dusty/cli/test.py | """Allow you to run tests in an isolated container for an app or a lib.
If args are passed, default arguments are dropped
Usage:
test <app_or_lib_name> [<suite_name>] [<args>...] [--recreate]
Options:
<suite_name> Name of the test suite you would like to run
<args> A list of arguments to be passed to th... | """Allow you to run tests in an isolated container for an app or a lib.
If args are passed, default arguments are dropped
Usage:
test <app_or_lib_name> [<suite_name>] [<args>...] [--recreate]
Options:
<suite_name> Name of the test suite you would like to run
<args> A list of arguments to be passed to th... | mit | Python |
35c2ef889dacf2ef33192604b2a4ac6d0f65b9be | add file handling tests | neutrons/web_reflectivity,neutrons/web_reflectivity | web_reflectivity/fitting/tests.py | web_reflectivity/fitting/tests.py | import json
import tempfile
from django.test import TestCase
from django.test import Client
from django.contrib.auth.models import User
from .models import FitterOptions
class FileViewTestCase(TestCase):
def setUp(self):
# Every test needs a client.
self.client = Client()
user = User.objec... | from django.test import TestCase
from django.test import Client
from django.contrib.auth.models import User
class LocalStoreTestCase(TestCase):
def setUp(self):
# Every test needs a client.
self.client = Client()
user = User.objects.create_user('john', 'john@test.com', 'johnpassword')
... | apache-2.0 | Python |
54cb7685550c1c5238bb2f519306e4b5db5fc9f0 | Comment out some useless code in challenges | super1337/Super1337-CTF,super1337/Super1337-CTF,super1337/Super1337-CTF | webapp-django/challenges/views.py | webapp-django/challenges/views.py | from django.http import HttpResponse
from django.shortcuts import render
from .models import Challenge
def download(req):
response = HttpResponse(content_type='application/zip')
response['Content-Disposition'] = 'attachment; filename=myfile.zip'
return response
def index(request):
challenges = Chal... | from django.core.files.storage import FileSystemStorage
from django.shortcuts import render, redirect
from django.http import HttpResponse
from .models import Challenge
# from .forms import DocumentForm
def download(req):
response = HttpResponse(content_type='application/zip')
response['Content-Disposition']... | mit | Python |
5da5cf6f44222170af594f9c7422f5cf32930bc1 | fix bug if user guesses the wrong word | kymy86/hangman-cmd-game | game.py | game.py | #!/usr/bin/python3
from wordsloader import WordsLoader
from hangmanpic import pics
def run_game():
loader = WordsLoader()
pic = pics()
your_name = input("Enter your name\n")
print("{}, welcome in the Magic Hangman game.".format(your_name))
loader.build_word_dict()
print("\n")
word = loade... | #!/usr/bin/python3
from wordsloader import WordsLoader
from hangmanpic import pics
def run_game():
loader = WordsLoader()
pic = pics()
your_name = input("Enter your name\n")
print("{}, welcome in the Magic Hangman game. Press enter to continue\n".format(your_name))
loader.build_word_dict()
pr... | apache-2.0 | Python |
7cd4983972f7fc497f37c9b913d2e1665b401f96 | fix more nits | nacl-webkit/native_client,sbc100/native_client,nacl-webkit/native_client,nacl-webkit/native_client,sbc100/native_client,sbc100/native_client,nacl-webkit/native_client,sbc100/native_client,nacl-webkit/native_client,sbc100/native_client,sbc100/native_client | tools/llvm/setup_arm_cros_toolchain.py | tools/llvm/setup_arm_cros_toolchain.py | #!/usr/bin/python
# Copyright (c) 2011 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
#########################################################################
# EXPERIMENTAL
# this code is NOT active in the main N... | #!/usr/bin/python
# Copyright (c) 2011 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
#########################################################################
# EXPERIMENTAL
# this code is NOT active in the main N... | bsd-3-clause | Python |
69730d80b20d5da8bf163b40e58345016fb007cc | Replace voluptuous with JSONSchema to validate nop action | stackforge/watcher,openstack/watcher,stackforge/watcher,openstack/watcher | watcher/applier/actions/nop.py | watcher/applier/actions/nop.py | # -*- encoding: utf-8 -*-
# Copyright (c) 2015 b<>com
#
# Authors: Jean-Emile DARTOIS <jean-emile.dartois@b-com.com>
#
# 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/... | # -*- encoding: utf-8 -*-
# Copyright (c) 2015 b<>com
#
# Authors: Jean-Emile DARTOIS <jean-emile.dartois@b-com.com>
#
# 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/... | apache-2.0 | Python |
c0364b0a070e5b7734c3f5a3f7f1cfc35f48ace4 | Add License | pmeulen/saml-metadata-tools,pmeulen/saml-metadata-tools | scons-tools/xmlsectool.py | scons-tools/xmlsectool.py | # Copyright 2015 GIP RENATER
#
# 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, ... | import SCons.Action
def _detect(env) :
if (not 'XMLSECTOOLSH' in env) :
xmlsectool = env.WhereIs('xmlsectool.sh')
if (xmlsectool) :
env['XMLSECTOOLSH'] = xmlsectool
return None
# @param target signed file (output)
# @param source file to sign (input)
# @param keystore path to java... | apache-2.0 | Python |
2337ec170977134203364e26f48482038d443807 | Remove pymysql import | california-civic-data-coalition/django-calaccess-processed-data,california-civic-data-coalition/django-calaccess-processed-data | example/manage.py | example/manage.py | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| #!/usr/bin/env python
import os
import sys
try:
import pymysql
pymysql.install_as_MySQLdb()
except ImportError:
pass
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
from django.core.manag... | mit | Python |
c0d9b783fb6b49307f9d38ce4127143068f2a5e7 | update script | daftscience/Labrador,daftscience/Labrador,daftscience/Labrador,daftscience/Labrador | scripts/gpio_functions.py | scripts/gpio_functions.py | from gpiozero import Button
def update():
print("Update")
update = Button(17)
update.hold_time = 7
update.when_held = update
while True:
pass
# channel_list = [17, 22, 23, 27]
| from gpiozero import Button
def update():
print("Update")
update = Button(17)
update.hold_time = 7
update.when_held = update()
while True:
pass
# channel_list = [17, 22, 23, 27]
| bsd-3-clause | Python |
0e46f8de68c2c0d9cc2b49c535915cc104dd7cd2 | Fix sparcc_correls.py after refactor of sparcc | shafferm/SCNIC | scripts/sparcc_correls.py | scripts/sparcc_correls.py | __author__ = 'shafferm'
import argparse
from biom import load_table
from correl_nets.sparcc_correlations import sparcc_correlations_lowmem, sparcc_correlations_lowmem_multi
from correl_nets.general import print_delimited
if __name__ == '__main__':
"""main, takes argparser"""
parser = argparse.ArgumentParser()... | __author__ = 'shafferm'
import argparse
from biom import load_table
from correl_nets.module_maker import sparcc_correlations, sparcc_correlations_multi
from correl_nets.general import print_delimited
if __name__ == '__main__':
"""main, takes argparser"""
parser = argparse.ArgumentParser()
parser.add_argum... | bsd-3-clause | Python |
e0c61d2681bdff86a8b7706a97f8b6acf8cee801 | fix pep8 | randy3k/AlignTab | hist.py | hist.py | import sublime
import sublime_plugin
class History:
hist = []
index = None
def insert(self, user_input):
if not self.hist or (user_input != self.last() and user_input != "last_regex"):
self.hist.append(user_input)
self.index = None
def roll(self, backwards=False):
... | import sublime
import sublime_plugin
class History:
hist = []
index = None
def insert(self, user_input):
if not self.hist or (user_input != self.last()
and user_input != "last_regex"):
self.hist.append(user_input)
self.index = None
def rol... | mit | Python |
101d6f68e381eb2499e3804edffe3408b3756584 | Fix #4 Sphinx installation fails | timlinux/fabgis,timlinux/fabgis | fabgis/sphinx.py | fabgis/sphinx.py | # coding=utf-8
"""Tasks for setting up sphinx."""
import fabtools
from fabric.api import task, sudo, fastprint
from fabric.colors import green, blue
from fabtools.deb import is_installed
@task
def setup_latex():
"""Install latex and friends needed to generate sphinx PDFs."""
fastprint(blue('Setting up LaTeX\n'... | # coding=utf-8
"""Tasks for setting up sphinx."""
import fabtools
from fabric.api import task, sudo, fastprint
from fabric.colors import green, blue
@task
def setup_latex():
"""Install latex and friends needed to generate sphinx PDFs."""
fastprint(blue('Setting up LaTeX\n'))
fabtools.deb.update_index(quie... | lgpl-2.1 | Python |
033d23df86a6d96242cc7abe034093c4acbeebb2 | Refactor da task de upload | vmalavolta/fabix | fabix/project.py | fabix/project.py | import os
from datetime import datetime
from tempfile import mkdtemp
from cuisine import dir_ensure, mode_sudo
from fabric.context_managers import cd, lcd
from fabric.decorators import task
from fabric.operations import local, put, run, sudo
from fabric.utils import puts
INSTALL_DIR = '/data/sites'
@task
def create... | import os
from datetime import datetime
from fabric.api import cd
from fabric.decorators import task
from fabric.operations import local, put, run, sudo
from fabric.utils import puts
INSTALL_DIR = '/data/sites'
@task
def create_project_structure(site_name):
"""Create directory structure for project `site_name`.... | mit | Python |
dfcf6c674123fc447fb1017adefbda7f279301b9 | Normalize locale names. Close #103 | trtd/faker,yiliaofan/faker,venmo/faker,jaredculp/faker,HAYASAKA-Ryosuke/faker,xfxf/faker-python,meganlkm/faker,johnraz/faker,joke2k/faker,beetleman/faker,MaryanMorel/faker,xfxf/faker-1,ericchaves/faker,GLMeece/faker,danhuss/faker,thedrow/faker,joke2k/faker | faker/factory.py | faker/factory.py | from __future__ import unicode_literals
from __future__ import absolute_import
import locale as pylocale
import sys
from faker import DEFAULT_LOCALE, DEFAULT_PROVIDERS, AVAILABLE_LOCALES
from faker import Generator
from faker import providers as providers_mod
class Factory(object):
@classmethod
def create(cl... | from __future__ import unicode_literals
from __future__ import absolute_import
import sys
from faker import DEFAULT_LOCALE, DEFAULT_PROVIDERS, AVAILABLE_LOCALES
from faker import Generator
from faker import providers as providers_mod
class Factory(object):
@classmethod
def create(cls, locale=None, providers=... | mit | Python |
08ea7ca9f19a5ddcb0d3f15099a834c9aad8ef51 | bump version to 1.0 | scott-maddox/fdint | fdint/version.py | fdint/version.py | __version__ = '1.0'
| __version__ = '0.1'
| bsd-3-clause | Python |
c81be2749a325cab34f07c47b10288f440992cd9 | Use interactive shell in local_run | frigg/frigg-common | frigg/helpers.py | frigg/helpers.py | # -*- coding: utf8 -*-
import logging
import subprocess
logger = logging.getLogger(__name__)
def detect_test_runners(files):
if 'Makefile' in files:
return ['make test']
if 'tox.ini' in files:
return ['tox', 'flake8']
if 'setup.py' in files:
return ['python setup.py test', 'flake8... | # -*- coding: utf8 -*-
import logging
import subprocess
logger = logging.getLogger(__name__)
def detect_test_runners(files):
if 'Makefile' in files:
return ['make test']
if 'tox.ini' in files:
return ['tox', 'flake8']
if 'setup.py' in files:
return ['python setup.py test', 'flake8... | mit | Python |
e5e7ff349c090edcc76d5c2b44b3da3b42dfa77b | Simplify celery setup | fin/froide,stefanw/froide,fin/froide,fin/froide,stefanw/froide,fin/froide,stefanw/froide,stefanw/froide,stefanw/froide | froide/celery.py | froide/celery.py | from __future__ import absolute_import
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'froide.settings')
os.environ.setdefault("DJANGO_CONFIGURATION", "Dev")
from configurations import importer # noqa
importer.install(check_options=True)
from celery import Celery # noqa
from django.conf import settings... | from __future__ import absolute_import
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'froide.settings')
os.environ.setdefault("DJANGO_CONFIGURATION", "Dev")
from configurations import importer # noqa
importer.install(check_options=True)
from celery import Celery # noqa
from django.conf import settings... | mit | Python |
da1973a0383ddc8125702e74a88d3a35bbfcf06d | disable time range downloading | coreynicholson/youtube-dl,codesparkle/youtube-dl,malept/youtube-dl,mxamin/youtube-dl,Orochimarufan/youtube-dl,erikdejonge/youtube-dl,stannynuytkens/youtube-dl,mcepl/youtube-dl,longman694/youtube-dl,daeseokyoun/youtube-dl,pim89/youtube-dl,Tatsh/youtube-dl,aeph6Ee0/youtube-dl,Thor77/youtube-dl,jbuchbinder/youtube-dl,luce... | youtube_dl/downloader/__init__.py | youtube_dl/downloader/__init__.py | from __future__ import unicode_literals
from .common import FileDownloader
from .f4m import F4mFD
from .hls import HlsFD
from .http import HttpFD
from .rtmp import RtmpFD
from .dash import DashSegmentsFD
from .rtsp import RtspFD
from .external import (
get_external_downloader,
FFmpegFD,
)
from ..utils import ... | from __future__ import unicode_literals
from .common import FileDownloader
from .f4m import F4mFD
from .hls import HlsFD
from .http import HttpFD
from .rtmp import RtmpFD
from .dash import DashSegmentsFD
from .rtsp import RtspFD
from .external import (
get_external_downloader,
FFmpegFD,
)
from ..utils import ... | unlicense | Python |
3bfef17eb0c4004e3c36747baa6008fc8b10c962 | Update default_settings.py. | weijia/webmanager,weijia/webmanager,weijia/webmanager | webmanager/default_settings.py | webmanager/default_settings.py | INSTALLED_APPS += (
'simplemenu',
'webmanager',
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
)
AUTHENTICATION_BACKENDS += ('django.contrib.auth.backends.ModelBackend',
'guardian.backends.ObjectPermissionBackend')
ANONYMOUS_USER_ID = -1
| INSTALLED_APPS += (
'bootstrap3',
'django_admin_bootstrapped',
'django.contrib.admin',
'django.contrib.admindocs',
# 'south', # Do not work in SAE
# 'mptt',
# 'treenav',
# 'background_task',
# 'django_cron', # Do not work in SAE
'jquery_ui',
# 'provider',
# 'provider.oa... | bsd-3-clause | Python |
194f403267d2337b98960446bb176a6ff1aeb2cc | support paytm | GingerNinja23/bookbargain | init.py | init.py | from flipkart import flipkart
from amazon import amazon
from infibeam import infibeam
from uread import uread
from landmark import landmark
from crossword import crossword
from paytm import paytm
isbn = '9789380501932'
print 'Flipkart',flipkart(isbn)
print 'Amazon',amazon(isbn)
print 'Infibeam',infibeam(isbn)
print 'ur... | from flipkart import flipkart
from amazon import amazon
from infibeam import infibeam
from uread import uread
from landmark import landmark
from crossword import crossword
isbn = '9789380501932'
print 'Flipkart',flipkart(isbn)
print 'Amazon',amazon(isbn)
print 'Infibeam',infibeam(isbn)
print 'uread',uread(isbn)
print '... | mit | Python |
a385b1a3dee7569c590b37713e9b4fd6c00d7e33 | Add listener pieces | derwolfe/teiler,derwolfe/teiler | src/actions/client.py | src/actions/client.py | from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
from twisted.application.internet import MulticastServer
class MulticastClientUDP(DatagramProtocol):
def startProtocol(self):
self.transport.joinGroup('228.0.0.5')
def datagramReceived(self, datagram, addr... | from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
from twisted.application.internet import MulticastServer
class MulticastClientUDP(DatagramProtocol):
def datagramReceived(self, datagram, address):
print "Received:" + repr(datagram)
# Send multicast on 224.0.... | mit | Python |
09c5cbe38ed55337a47dacc901412e084f098383 | add student object initializer | madhav-datt/kgp-hms,madhav-datt/kgp-hms | src/actors/student.py | src/actors/student.py | class Student(object):
"""Contains details of Student
Attributes:
student_ID: An integer to uniquely identify student
password: A string hashed after adding salt
name: string
gender: string
address: string
contact_number: string
photograph: image
... | class Student(object):
"""Contains details of Student
Attributes:
student_ID: An integer to uniquely identify student
password: A string hashed after adding salt
name: string
gender: string
address: string
contact_number: string
photograph: image
... | mit | Python |
651a4e8547f592cc29b8753ceffe0173258e5326 | add DHCPServer class. | alyosha1879/ryu,alyosha1879/ryu,alyosha1879/ryu,alyosha1879/ryu | ryu/app/simple_dhcp_server.py | ryu/app/simple_dhcp_server.py | """
Simple DHCP Server
"""
class DHCPServer():
def handle_dhcp_request(self):
def handle_dhcp_offer(self):
def handle_dhcp_ack(self):
| """
Simple DHCP Server
"""
| apache-2.0 | Python |
d719dfd319a4e185abfbf3ab4bea1108cba67e52 | Add text module to file | RAPD/RAPD,RAPD/RAPD,RAPD/RAPD,RAPD/RAPD,RAPD/RAPD | src/control/rapd_control.py | src/control/rapd_control.py | """
RAPD - Automated data analysis for macromolecular crystallography
Copyright (C) 2009-2016, Cornell University
All rights reserved.
RAPD 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, version 3.
RAPD... | """
RAPD - Automated data analysis for macromolecular crystallography
Copyright (C) 2009-2016, Cornell University
All rights reserved.
RAPD 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, version 3.
RAPD... | agpl-3.0 | Python |
7cd3078478be35381bc833d8cc8d2d57ed2847a6 | Increase timeout on solr indexing | twhyte/openparliament,twhyte/openparliament,rhymeswithcycle/openparliament,rhymeswithcycle/openparliament,litui/openparliament,litui/openparliament,rhymeswithcycle/openparliament,twhyte/openparliament,litui/openparliament | parliament/search/management/commands/consume_indexing_queue.py | parliament/search/management/commands/consume_indexing_queue.py | import itertools
import logging
from django.conf import settings
from django.core.management.base import BaseCommand
from haystack import site
import pysolr
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = "Runs any queued-up search indexing tasks."
def handle(self, **options):
... | import itertools
import logging
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from haystack import site
import pysolr
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = "Runs any queued-up search indexing tasks."
def handle(self, **o... | agpl-3.0 | Python |
57e04bdafd571c0b8ce2c1706fb170629dea2840 | Fix gid not found bug | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/grains/minion_process.py | salt/grains/minion_process.py | # -*- coding: utf-8 -*-
'''
Set grains describing the minion process.
'''
from __future__ import absolute_import, print_function, unicode_literals
import os
# Import salt libs
import salt.utils.platform
try:
import pwd
except ImportError:
import getpass
pwd = None
try:
import grp
except ImportError... | # -*- coding: utf-8 -*-
'''
Set grains describing the minion process.
'''
from __future__ import absolute_import, print_function, unicode_literals
import os
# Import salt libs
import salt.utils.platform
try:
import pwd
except ImportError:
import getpass
pwd = None
try:
import grp
except ImportError... | apache-2.0 | Python |
f90d3b67d3f5e1c23575cca3463ddd81785dfdb7 | Fix relative import that does not work with py 3. | datacommonsorg/api-python,datacommonsorg/api-python | datacommons/datacommons.py | datacommons/datacommons.py | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | Python |
07a1a7d84da369dfc690cafe1ef74973a109ff47 | add a always_redirect_to using a callable | avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf | src/python/expedient/clearinghouse/permissionmgmt/utils.py | src/python/expedient/clearinghouse/permissionmgmt/utils.py | '''
Created on Aug 2, 2010
@author: jnaous
'''
from expedient.common.permissions.views import request_permission
def request_permission_wrapper(*args, **kwargs):
return request_permission(
always_redirect_to=\
lambda request: \
request.session.get("breadcrumbs", [(None ,"/")])[... | '''
Created on Aug 2, 2010
@author: jnaous
'''
from expedient.common.permissions.views import request_permission
def request_permission_wrapper(*args, **kwargs):
return request_permission(
template="permissionmgmt/request_permission.html")(*args, **kwargs)
| bsd-3-clause | Python |
b1b0c5c670870949c883b5b9fa3e203affa48a6c | Add more logging when setting headers. | tarzasai/Flexget,dsemi/Flexget,jawilson/Flexget,lildadou/Flexget,JorisDeRieck/Flexget,jawilson/Flexget,qk4l/Flexget,OmgOhnoes/Flexget,ZefQ/Flexget,poulpito/Flexget,jawilson/Flexget,cvium/Flexget,lildadou/Flexget,crawln45/Flexget,tobinjt/Flexget,tsnoam/Flexget,oxc/Flexget,qvazzler/Flexget,offbyone/Flexget,crawln45/Flexg... | flexget/plugins/modify/headers.py | flexget/plugins/modify/headers.py | from __future__ import unicode_literals, division, absolute_import
import logging
import urllib2
from flexget import plugin
from flexget.event import event
log = logging.getLogger('headers')
class HTTPHeadersProcessor(urllib2.BaseHandler):
# run first
handler_order = urllib2.HTTPHandler.handler_order - 10
... | from __future__ import unicode_literals, division, absolute_import
import logging
import urllib2
from flexget import plugin
from flexget.event import event
log = logging.getLogger('headers')
class HTTPHeadersProcessor(urllib2.BaseHandler):
# run first
handler_order = urllib2.HTTPHandler.handler_order - 10
... | mit | Python |
ec179b9cf6100a580a8e96171784eac1aff824a4 | Fix #1165 | vfrc2/Flexget,voriux/Flexget,tarzasai/Flexget,lildadou/Flexget,crawln45/Flexget,ibrahimkarahan/Flexget,gazpachoking/Flexget,spencerjanssen/Flexget,offbyone/Flexget,tobinjt/Flexget,drwyrm/Flexget,qk4l/Flexget,patsissons/Flexget,dsemi/Flexget,qvazzler/Flexget,tarzasai/Flexget,offbyone/Flexget,ianstalk/Flexget,qk4l/Flexge... | flexget/utils/sqlalchemy_utils.py | flexget/utils/sqlalchemy_utils.py | from sqlalchemy import ColumnDefault, Sequence
from sqlalchemy.types import AbstractType
from sqlalchemy.schema import Table, MetaData
from sqlalchemy.exc import NoSuchTableError
def table_exists(name, session):
"""Hack, return True if table_name exists """
try:
meta = MetaData(bind=session.connectio... | from sqlalchemy import ColumnDefault, Sequence
from sqlalchemy.types import AbstractType
from sqlalchemy.schema import Table, MetaData
from sqlalchemy.exc import NoSuchTableError
def table_exists(name, session):
"""Hack, return True if table_name exists """
try:
meta = MetaData(bind=session.connectio... | mit | Python |
ab62f082a3eb1baed4be5f4ffe92c4dd7caa0282 | solve level 4 | cjwfuller/python-challenge | level4.py | level4.py | import urllib
# urllib may help. DON'T TRY ALL NOTHINGS, since it will never
# end. 400 times is more than enough.
count = 0
url = 'http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing='
nothing = 12345
while count <= 400:
sock = urllib.urlopen(url + str(nothing))
content = sock.read()
print con... | import urllib
# urllib may help. DON'T TRY ALL NOTHINGS, since it will never
# end. 400 times is more than enough.
count = 0
url = 'http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=12345'
while count <= 400:
sock = urllib.urlopen(url)
content = sock.read()
# TODO probably keep looping until ... | mit | Python |
0900c81cd3144344bea4231619da6cbd55b51b2e | add text-alignment | Yokan-Study/study,Yokan-Study/study,Yokan-Study/study | 2018/04.24/python/hanname-excel.py | 2018/04.24/python/hanname-excel.py | from openpyxl import Workbook
from openpyxl.styles import Alignment
import sys
sys.path.append('C:/Users/์กฐ์์/Documents/GitHub/study/2018/04.10/python')
from jya_gAPIclass import GapiClass
# ์ด ํ์ผ๊ณผ ๋์ผํ ๊ฒฝ๋ก์ config.py ์ถ๊ฐ ์ํ๋ฉด ์ค๋ฅ๊ฐ ๋๋๋ฐ, ๋ชจ๋ ๋ถ๋ฌ์ฌ ๋ config.py๋ ๊ฐ์ด ์๋ถ๋ฌ์ค๋๋ด์??
wb = Workbook()
ws = wb.active
instance = GapiClass()
f... | from openpyxl import Workbook
import sys
sys.path.append('C:/Users/์กฐ์์/Documents/GitHub/study/2018/04.10/python')
from jya_gAPIclass import GapiClass
# ์ด ํ์ผ๊ณผ ๋์ผํ ๊ฒฝ๋ก์ config.py ์ถ๊ฐ ์ํ๋ฉด ์ค๋ฅ๊ฐ ๋๋๋ฐ, ๋ชจ๋ ๋ถ๋ฌ์ฌ ๋ config.py๋ ๊ฐ์ด ์๋ถ๋ฌ์ค๋๋ด์??
wb = Workbook()
ws = wb.active
instance = GapiClass()
field_name_list = ['๋ฒํธ', '์์ด๋', '์ด๋ฆ']
i... | mit | Python |
8b81da9751006724fea811c8556c494d215b3e6c | Add package doc | gVallverdu/pymatgen,gmatteo/pymatgen,fraricci/pymatgen,fraricci/pymatgen,davidwaroquiers/pymatgen,gVallverdu/pymatgen,fraricci/pymatgen,vorwerkc/pymatgen,richardtran415/pymatgen,gVallverdu/pymatgen,vorwerkc/pymatgen,richardtran415/pymatgen,davidwaroquiers/pymatgen,richardtran415/pymatgen,richardtran415/pymatgen,gmatteo... | pymatgen/analysis/chemenv/coordination_environments/coordination_geometries_files/__init__.py | pymatgen/analysis/chemenv/coordination_environments/coordination_geometries_files/__init__.py | """
Coordination geometry files.
"""
| mit | Python | |
2f660e61236ea89a65113d1abc625feea6723d3b | bump to 0.4 | tsuru/varnishapi,tsuru/varnishapi | feaas/__init__.py | feaas/__init__.py | # Copyright 2014 varnishapi authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
__version__ = "0.4"
| # Copyright 2014 varnishapi authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
__version__ = "0.3.3"
| bsd-3-clause | Python |
dcd25e9699ba8fb7b7d18df676db91347ba48194 | add daemon if not private. | stephrdev/brigitte | brigitte/repositories/gitolite.py | brigitte/repositories/gitolite.py | from brigitte.repositories.models import Repository
from brigitte.accounts.models import SshPublicKey
from brigitte.repositories.backends.base import ShellMixin
import os
def generate_gitolite_conf(file_path):
file_obj = open(file_path, 'w')
lines = [
'repo gitolite-admin\n',
'\tRW+ =... | from brigitte.repositories.models import Repository
from brigitte.accounts.models import SshPublicKey
from brigitte.repositories.backends.base import ShellMixin
import os
def generate_gitolite_conf(file_path):
file_obj = open(file_path, 'w')
lines = [
'repo gitolite-admin\n',
'\tRW+ =... | bsd-3-clause | Python |
70972479f11921363cdac6b5848d65c9cb65f131 | Fix pep8 failure | j2sol/giftwrap,blueboxjesse/giftwrap,j2sol/giftwrap,blueboxgroup/giftwrap,blueboxgroup/giftwrap,blueboxjesse/giftwrap | giftwrap/util.py | giftwrap/util.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014, John Dewey
# 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/lic... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014, John Dewey
# 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/lic... | apache-2.0 | Python |
e5b1eeab4486d2182396a7f8e64d0a05207a3f5f | Fix up imports in package. | amacd31/bom_data_parser,amacd31/bom_data_parser | bom_data_parser/__init__.py | bom_data_parser/__init__.py | from bom_data_parser.acorn_sat import read_acorn_sat_csv
from bom_data_parser.climate_data_online import read_climate_data_online_csv
from bom_data_parser.hrs import read_hrs_csv
from bom_data_parser.observations_json import read_obs_json
| from climate_data_online import read_climate_data_online_csv
from acorn_sat import read_acorn_sat_csv
from hrs import read_hrs_csv
from observations_json import read_obs_json
| bsd-3-clause | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.