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 |
|---|---|---|---|---|---|---|---|---|
ddda6188b2078120029f95eede9ba67450ecfc6d | update utils | dssg/wikienergy,dssg/wikienergy,dssg/wikienergy,dssg/wikienergy,dssg/wikienergy | disaggregator/utils.py | disaggregator/utils.py | import appliance
import pandas
def concatenate_traces(traces, metadata=None, how="strict"):
'''
Given a list of appliance traces, returns a single concatenated
trace. With how="strict" option, must be sampled at the same rate and
consecutive, without overlapping datapoints.
'''
if not metadata:... | from ApplianceTrace import ApplianceTrace
from ApplianceInstance import ApplianceInstance
from ApplianceType import ApplianceType
from ApplianceSet import ApplianceSet
from pandas import concat
def concatenate_traces(traces, metadata=None, how="strict"):
'''
Given a list of appliance traces, returns a single c... | mit | Python |
c7491a85f261932e41326e51b484db1251de86b7 | update numpy in utils | dssg/wikienergy,dssg/wikienergy,dssg/wikienergy,dssg/wikienergy,dssg/wikienergy | disaggregator/utils.py | disaggregator/utils.py | import appliance
import pandas as pd
import numpy as np
def concatenate_traces(traces, metadata=None, how="strict"):
'''
Given a list of appliance traces, returns a single concatenated
trace. With how="strict" option, must be sampled at the same rate and
consecutive, without overlapping datapoints.
... | import appliance
import pandas
def concatenate_traces(traces, metadata=None, how="strict"):
'''
Given a list of appliance traces, returns a single concatenated
trace. With how="strict" option, must be sampled at the same rate and
consecutive, without overlapping datapoints.
'''
if not metadata:... | mit | Python |
94351de43d13da233efe967433ece470537e7509 | fix 'ConnectionError' object has no attribute 'status_code' | iserko/sentry-auth-github,getsentry/sentry-auth-github,iserko/sentry-auth-github,getsentry/sentry-auth-github | sentry_auth_github/client.py | sentry_auth_github/client.py | from __future__ import absolute_import, print_function
from requests.exceptions import RequestException
from sentry import http
from sentry.utils import json
from .constants import API_DOMAIN
class GitHubApiError(Exception):
def __init__(self, message='', status=0):
super(GitHubApiError, self).__init__(... | from __future__ import absolute_import, print_function
from requests.exceptions import RequestException
from sentry import http
from sentry.utils import json
from .constants import API_DOMAIN
class GitHubApiError(Exception):
def __init__(self, message='', status=None):
super(GitHubApiError, self).__init... | apache-2.0 | Python |
64db57e51ecffd6521de6440aa9cc82cd5442432 | Complete recur dfs sol | bowen0701/algorithms_data_structures | lc0559_maximum_depth_of_n-ary_tree.py | lc0559_maximum_depth_of_n-ary_tree.py | """Leetcode 559. Maximum Depth of N-ary Tree
Easy
URL: https://leetcode.com/problems/maximum-depth-of-n-ary-tree/
Given a n-ary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node
down to the farthest leaf node.
For example, given a 3-ary tree:
1
... | """Leetcode 559. Maximum Depth of N-ary Tree
Easy
URL: https://leetcode.com/problems/maximum-depth-of-n-ary-tree/
Given a n-ary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node
down to the farthest leaf node.
For example, given a 3-ary tree:
1
... | bsd-2-clause | Python |
1c9a6490dc57649eb6947f35f6a259806bf96c7e | Fix encoding. | faneshion/MatchZoo,faneshion/MatchZoo | matchzoo/datasets/toy/__init__.py | matchzoo/datasets/toy/__init__.py | from pathlib import Path
from matchzoo import pack, embedding
CURR_DIR = Path(__file__).parent
def load_data(path, include_label):
def scan_file():
with open(path, encoding='utf-8') as in_file:
next(in_file) # skip header
for l in in_file:
yield l.strip().split('... | from pathlib import Path
from matchzoo import pack, embedding
CURR_DIR = Path(__file__).parent
def load_data(path, include_label):
def scan_file():
with open(path) as in_file:
next(in_file) # skip header
for l in in_file:
yield l.strip().split('\t')
if inclu... | apache-2.0 | Python |
84dcb911196783cde209b095acc26d4089a24200 | Change test to remove missed branch | pre-commit/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit | tests/color_test.py | tests/color_test.py | from __future__ import unicode_literals
import os
import sys
import mock
import pytest
from pre_commit.color import format_color
from pre_commit.color import GREEN
from pre_commit.color import InvalidColorSetting
from pre_commit.color import use_color
@pytest.mark.parametrize(
('in_text', 'in_color', 'in_use_c... | from __future__ import unicode_literals
import os
import sys
import mock
import pytest
from pre_commit.color import format_color
from pre_commit.color import GREEN
from pre_commit.color import InvalidColorSetting
from pre_commit.color import use_color
@pytest.mark.parametrize(
('in_text', 'in_color', 'in_use_c... | mit | Python |
dc1efd1e4a957acf6fa6db68652c080b8ab912cb | fix test | nschloe/voropy | tests/lloyd_test.py | tests/lloyd_test.py | # -*- coding: utf-8 -*-
#
from helpers import download_mesh
import meshio
import voropy
import numpy
def test_pacman_lloyd():
filename = download_mesh(
'pacman.msh',
'2da8ff96537f844a95a83abb48471b6a'
)
X, cells, _, _, _ = meshio.read(filename)
mesh = voropy.smoothing... | # -*- coding: utf-8 -*-
#
from helpers import download_mesh
import meshio
import voropy
import numpy
def test_pacman_lloyd():
filename = download_mesh(
'pacman.msh',
'2da8ff96537f844a95a83abb48471b6a'
)
X, cells, _, _, _ = meshio.read(filename)
mesh = voropy.smoothing... | mit | Python |
6fc5a47efbd4b760672b13292c5c4886842fbdbd | Add test for LocalShell.run with update_env | mwilliamson/spur.py | tests/local_test.py | tests/local_test.py | from nose.tools import istest, assert_equal
from spur import LocalShell
shell = LocalShell()
@istest
def output_of_run_is_stored():
result = shell.run(["echo", "hello"])
assert_equal("hello\n", result.output)
@istest
def cwd_of_run_can_be_set():
result = shell.run(["pwd"], cwd="/")
assert_equal("/\n... | from nose.tools import istest, assert_equal
from spur import LocalShell
shell = LocalShell()
@istest
def output_of_run_is_stored():
result = shell.run(["echo", "hello"])
assert_equal("hello\n", result.output)
@istest
def cwd_of_run_can_be_set():
result = shell.run(["pwd"], cwd="/")
assert_equal("/\n... | bsd-2-clause | Python |
9873b09dea5e2436b6db513828acc4d66b5d0fb4 | test set_predecessors() by using empty list and list of integers. Need to add list of Agents | chendaniely/multi-agent-neural-network,chendaniely/multi-agent-neural-network | tests/test_agent.py | tests/test_agent.py | #! /usr/bin/env python
import nose
import sys
import io
from mann import agent
# def setup_lens_agent():
# print('Setting up LENS agent')
# test_lens_agent = agent.LensAgent(10)
# @with_setup(setup_lens_agent)
# def test_write_agent_state_to_ex():
# test_file = 'write_agent_state_to_ex.test'
# asse... | #! /usr/bin/env python
import nose
import sys
import io
from mann import agent
# def setup_lens_agent():
# print('Setting up LENS agent')
# test_lens_agent = agent.LensAgent(10)
# @with_setup(setup_lens_agent)
# def test_write_agent_state_to_ex():
# test_file = 'write_agent_state_to_ex.test'
# asse... | mit | Python |
c78f9aed1d843880f06bbe22dc8078e779a41cce | Rename the test. | clalancette/pycdlib,clalancette/pyiso | tests/test_basic.py | tests/test_basic.py | import pytest
import subprocess
import os
import sys
prefix = '.'
for i in range(0,3):
if os.path.exists(os.path.join(prefix, 'pyiso.py')):
sys.path.insert(0, prefix)
break
else:
prefix = '../' + prefix
import pyiso
def test_parse_nofiles(tmpdir):
# First set things up, and genera... | import pytest
import subprocess
import os
import sys
prefix = '.'
for i in range(0,3):
if os.path.exists(os.path.join(prefix, 'pyiso.py')):
sys.path.insert(0, prefix)
break
else:
prefix = '../' + prefix
import pyiso
def test_nofiles(tmpdir):
# First set things up, and generate the... | lgpl-2.1 | Python |
aa0d3e2b17a4e5ae43598967bb3824be36a574f7 | Update test_basic.py | jeansaad/hello_world | tests/test_basic.py | tests/test_basic.py | from hello_world import hello_world
from unittest import TestCase
class BasicTest(TestCase):
def test_basic_hello_world(self):
"""
Test basic hello world messaging
"""
self.assertEqual(hello_world(), 'Hello, World!')
| from hello_world import hello_world
from unittest import TestCase
class BasicTest(TestCase):
def test_basic_hello_world(self):
"""
Test basic hello world messaging
"""
self.assertEqual(hello_world(), 'Hello, World!')
| mit | Python |
bf1ebe532df6809471e32205fe06688b9b3a9540 | set central version | wtayyeb/django-template-theming,wtayyeb/django-template-theming | theming/__init__.py | theming/__init__.py |
__VERSION__ = (0, 7, 0)
__version__ = '.'.join(__VERSION__)
| mit | Python | |
c7e97b320bf46cd93133685b9e3035766d71e2a0 | Bump to 5.0.0rc2 | MaTriXy/thumbor,fanhero/thumbor,camargoanderso/thumbor,abaldwin1/thumbor,fanhero/thumbor,thumbor/thumbor,gi11es/thumbor,aaxx/thumbor,aaxx/thumbor,lfalcao/thumbor,2947721120/thumbor,camargoanderso/thumbor,adeboisanger/thumbor,aaxx/thumbor,jiangzhonghui/thumbor,gi11es/thumbor,MaTriXy/thumbor,wking/thumbor,gselva/thumbor,... | thumbor/__init__.py | thumbor/__init__.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
'''This is the main module in thumbor'''
__version__ = "5.0.0rc2"
| #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
'''This is the main module in thumbor'''
__version__ = "5.0.0rc1"
| mit | Python |
a35f5ada833b88b6b3cc8d2f0a85476730790752 | Return a possibility to completely override app settings | trilan/lemon-tinymce,trilan/lemon-tinymce | tinymce/settings.py | tinymce/settings.py | from django.conf import settings
CONFIG = {
'convert_urls': False,
'height': '350',
'theme': 'advanced',
'plugins': 'advimage,advlink,fullscreen,media,safari,table,paste',
'theme_advanced_toolbar_location': 'top',
'theme_advanced_buttons1': 'fullscreen,|,bold,italic,underline,'
... | from django.conf import settings
DEFAULT_CONFIG = {
'convert_urls': False,
'height': '350',
'theme': 'advanced',
'plugins': 'advimage,advlink,fullscreen,media,safari,table,paste',
'theme_advanced_toolbar_location': 'top',
'theme_advanced_buttons1': 'fullscreen,|,bold,italic,underline,'
... | mit | Python |
5f18cfaf7a67a29753e8ff7eff760d22f9d6180c | Include number of frames in video_info | escorciav/video-utils,escorciav/video-utils | tools/video_info.py | tools/video_info.py | #!/usr/bin/env python
"""
Python program to dump CSV with duration and frame rate of many videos
"""
import argparse
import os
import pandas as pd
from joblib import Parallel, delayed
from okvideo.ffmpeg import get_duration, get_frame_rate, get_num_frames
def video_stats(filename):
stats = []
stats.append... | #!/usr/bin/env python
"""
Python program to dump CSV with duration and frame rate of many videos
"""
import argparse
import numpy as np
import pandas as pd
from joblib import Parallel, delayed
from okvideo.ffmpeg import get_duration, get_frame_rate
def video_stats(filename):
stats = []
stats.append(get_du... | mit | Python |
e5588880d58b5482b37ad9785a08a71c7cbe7abe | Fix setuptools dependency in py-snowballstemmer (#13844) | LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack | var/spack/repos/builtin/packages/py-snowballstemmer/package.py | var/spack/repos/builtin/packages/py-snowballstemmer/package.py | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PySnowballstemmer(PythonPackage):
"""This package provides 16 stemmer algorithms (15 + Poe... | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PySnowballstemmer(PythonPackage):
"""This package provides 16 stemmer algorithms (15 + Poe... | lgpl-2.1 | Python |
cbf9b32da19dec437b939a22daf47d6bf7d72c25 | Update version number for new estimator release 2.11.0 | tensorflow/estimator,tensorflow/estimator | tensorflow_estimator/tools/pip_package/setup.py | tensorflow_estimator/tools/pip_package/setup.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 |
16eb7232c3bf8470ca37c5e67d1af7d86b5c7b14 | Check the copy model for failure | analyst-collective/dbt,analyst-collective/dbt | test/integration/022_bigquery_test/test_bigquery_copy_failing_models.py | test/integration/022_bigquery_test/test_bigquery_copy_failing_models.py | from test.integration.base import DBTIntegrationTest, use_profile
import textwrap
import yaml
class TestBigqueryCopyTableFails(DBTIntegrationTest):
@property
def schema(self):
return "bigquery_test_022"
@property
def models(self):
return "copy-failing-models"
@property
def p... | from test.integration.base import DBTIntegrationTest, use_profile
import textwrap
import yaml
class TestBigqueryCopyTableFails(DBTIntegrationTest):
@property
def schema(self):
return "bigquery_test_022"
@property
def models(self):
return "copy-failing-models"
@property
def p... | apache-2.0 | Python |
c110db045805866c12c9494ebb2bb3ac51437b10 | use random | tkerola/chainer,wkentaro/chainer,okuta/chainer,niboshi/chainer,chainer/chainer,keisuke-umezawa/chainer,niboshi/chainer,okuta/chainer,chainer/chainer,chainer/chainer,wkentaro/chainer,keisuke-umezawa/chainer,wkentaro/chainer,niboshi/chainer,hvy/chainer,hvy/chainer,wkentaro/chainer,pfnet/chainer,niboshi/chainer,okuta/chai... | tests/chainer_tests/dataset_tests/tabular_tests/test_tabular_dataset.py | tests/chainer_tests/dataset_tests/tabular_tests/test_tabular_dataset.py | import numpy as np
import unittest
from chainer import testing
from chainer.dataset import TabularDataset
class DummyDataset(TabularDataset):
def __init__(self, mode, callback=None):
self._mode = mode
self._callback = callback
self.data = np.random.uniform(size=(3, 10))
def __len__... | import numpy as np
import unittest
from chainer import testing
from chainer.dataset import TabularDataset
class DummyDataset(TabularDataset):
def __init__(self, mode, callback=None):
self._mode = mode
self._callback = callback
self.data = np.array([
[3, 1, 4, 1, 5, 9, 2, 6, ... | mit | Python |
08d1db2f6031d3496309ae290e4d760269706d26 | Print tracebacks that happened in tasks | liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin | meinberlin/config/settings/dev.py | meinberlin/config/settings/dev.py | from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
for template_engine in TEMPLATES:
template_engine['OPTIONS']['debug'] = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'qid$h1o8&wh#p(j)lifis*5-rf@lbiy8%^3l4x%@b$z(tli@ab'
try... | from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
for template_engine in TEMPLATES:
template_engine['OPTIONS']['debug'] = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'qid$h1o8&wh#p(j)lifis*5-rf@lbiy8%^3l4x%@b$z(tli@ab'
try... | agpl-3.0 | Python |
4e4fd37ca7e7c52dee2480e157523759bb288129 | update versions to 0.6-prerelease | histogrammar/histogrammar-python,histogrammar/histogrammar-python | histogrammar/version.py | histogrammar/version.py | #!/usr/bin/env python
# Copyright 2016 Jim Pivarski
#
# 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 la... | #!/usr/bin/env python
# Copyright 2016 Jim Pivarski
#
# 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 la... | apache-2.0 | Python |
d17a18175f1262630fe5dc07e22fed6d1155aed6 | update struct | aliciawyy/dmining | models/struct.py | models/struct.py | from sklearn import model_selection
import xgboost as xgb
import dm_common
def get_bootstrap_sample(x, y, random_state=0):
# x should be of type pandas DataFrame
x_bootstrap = x.sample(len(x), random_state=random_state, replace=True)
return x_bootstrap, y[x_bootstrap.index]
class Problem(dm_common.Strin... | from sklearn import model_selection
import dm_common
def get_bootstrap_sample(x, y, random_state=0):
# x should be of type pandas DataFrame
x_bootstrap = x.sample(len(x), random_state=random_state, replace=True)
return x_bootstrap, y[x_bootstrap.index]
class Problem(dm_common.StringMixin):
def __ini... | apache-2.0 | Python |
f75be4062ea45f239f7cad1572d133e5e6323c60 | Update default config. | google/flax,google/flax | linen_examples/wmt/configs/default.py | linen_examples/wmt/configs/default.py | # Copyright 2020 The Flax 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 wri... | # Copyright 2020 The Flax 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 wri... | apache-2.0 | Python |
f55d590004874f9ec64c041b5630321e686bf6f9 | Extend ID validator to lookdev | mindbender-studio/core,MoonShineVFX/core,mindbender-studio/core,getavalon/core,MoonShineVFX/core,getavalon/core,pyblish/pyblish-mindbender | mindbender/plugins/validate_id.py | mindbender/plugins/validate_id.py | import pyblish.api
class ValidateMindbenderID(pyblish.api.InstancePlugin):
"""All models must have an ID attribute"""
label = "Mindbender ID"
order = pyblish.api.ValidatorOrder
hosts = ["maya"]
families = ["mindbender.model", "mindbender.lookdev"]
def process(self, instance):
from ma... | import pyblish.api
class ValidateMindbenderID(pyblish.api.InstancePlugin):
"""All models must have an ID attribute"""
label = "Mindbender ID"
order = pyblish.api.ValidatorOrder
hosts = ["maya"]
families = ["mindbender.model"]
def process(self, instance):
from maya import cmds
... | mit | Python |
7e3bbb6792b1be83e2bed5415c7acdbef4548554 | correct naming | theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs | tests/contributions/test_contributions_tasks.py | tests/contributions/test_contributions_tasks.py | import mock
from django.contrib.auth import get_user_model
from bulbs.contributions.tasks import (
check_and_update_freelanceprofiles, check_and_run_send_byline_email
)
from bulbs.utils.test import make_content, BaseIndexableTestCase
from example.testcontent.models import TestContentObj
User = get_user_model()... | import mock
from django.contrib.auth import get_user_model
from bulbs.contributions.tasks import check_and_update_freelanceprofiles, run_send_byline_email
from bulbs.utils.test import make_content, BaseIndexableTestCase
from example.testcontent.models import TestContentObj
User = get_user_model()
class BylineTas... | mit | Python |
49dde81581fd34569b50071587daa71eaf9e4546 | Bump to 3.3.6 | pypa/setuptools,pypa/setuptools,pypa/setuptools | __init__.py | __init__.py | """distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
# Distutils version
#
# Updated automatically by the Python release process.
#
#--start constants--
__version__ = "3.3.6"
#--end constants--
| """distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
# Distutils version
#
# Updated automatically by the Python release process.
#
#--start constants--
__version__ = "3.3.6rc1"
#--end constants--
| mit | Python |
f55c9567b396913a642bf3786f8aae085f436c7e | Fix CurrentView | PressLabs/gitfs,rowhit/gitfs,ksmaheshkumar/gitfs,PressLabs/gitfs,bussiere/gitfs | gitfs/views/current.py | gitfs/views/current.py | import re
import os
from gitfs.filesystems.passthrough import PassthroughFuse, STATS
from .view import View
class CurrentView(View, PassthroughFuse):
def __init__(self, *args, **kwargs):
super(CurrentView, self).__init__(*args, **kwargs)
self.root = self.repo_path
def rename(self, old, new... | import re
import os
from gitfs.filesystems.passthrough import PassthroughFuse
from .view import View
class CurrentView(View, PassthroughFuse):
def __init__(self, *args, **kwargs):
super(CurrentView, self).__init__(*args, **kwargs)
self.root = self.repo_path
def rename(self, old, new):
... | apache-2.0 | Python |
d1b2e9d0f61e92b864daabcb372b2f5117c4ee6c | Add KmsKeyId Attribute to LogGroup (#1931) | cloudtools/troposphere,cloudtools/troposphere | troposphere/logs.py | troposphere/logs.py | from . import AWSObject, AWSProperty
from .constants import LOGS_ALLOWED_RETENTION_DAYS as RETENTION_DAYS
from .validators import integer_list_item
class Destination(AWSObject):
resource_type = "AWS::Logs::Destination"
props = {
"DestinationName": (str, True),
"DestinationPolicy": (str, True)... | from . import AWSObject, AWSProperty
from .constants import LOGS_ALLOWED_RETENTION_DAYS as RETENTION_DAYS
from .validators import integer_list_item
class Destination(AWSObject):
resource_type = "AWS::Logs::Destination"
props = {
"DestinationName": (str, True),
"DestinationPolicy": (str, True)... | bsd-2-clause | Python |
74acd20a8859cab1e738aff3812befd0d2e08a1b | Update EditMesh module | minoue/miExecutor | module/Modeling/EditMesh.py | module/Modeling/EditMesh.py | import maya.cmds as cmds
import maya.mel as mel
# class name must be 'Commands'
class Commands(object):
commandDict = {}
# Components -------------------------------
def _PolyBevel(self):
cmds.polyBevel()
commandDict['PolyBevel'] = 'polyBevel.png'
def _PolyBridge(self):
mel.eva... | import maya.cmds as cmds
import maya.mel as mel
# class name must be 'Commands'
class Commands(object):
commandDict = {}
def _mergeComponents(self):
mel.eval("performPolyMerge 0")
commandDict['mergeComponents'] = 'polyMerge.png'
def _mergeComponentsOptions(self):
cmds.PolyMergeOptio... | mit | Python |
fd53b0df273490ec9f37ffd3ad5af153abc905d3 | update exercise7-7 | MagicForest/Python | src/training/Core2/Chapter7MappingAndSetTypes/exercise_7_7.py | src/training/Core2/Chapter7MappingAndSetTypes/exercise_7_7.py | def invert_dict(src_dict):
return dict([(src_dict[key], key) for key in src_dict]) | def invert_dict(src_dict):
return dict([ (src_dict[key], key) for key in src_dict ]) | apache-2.0 | Python |
1dd76593ff13cdda86edc9659aade47bfbf28796 | add support for mtv81 | fffonion/you-get,power12317/you-get,j4s0nh4ck/you-get,flwh/you-get,xyuanmu/you-get,xyuanmu/you-get,specter4mjy/you-get,lilydjwg/you-get,tigerface/you-get,cnbeining/you-get,runningwolf666/you-get,dream1986/you-get,zmwangx/you-get,chares-zhang/you-get,shanyimin/you-get,qzane/you-get,pastebt/you-get,FelixYin66/you-get,CzB... | src/you_get/extractor/mtv81.py | src/you_get/extractor/mtv81.py | #!/usr/bin/env python
__all__ = ['mtv81_download']
from ..common import *
from html.parser import unescape
from xml.dom.minidom import parseString
def mtv81_download(url, output_dir='.', merge=True, info_only=False):
html = get_content(url)
title = unescape(
"|".join(match1(html, r"<title>(.*?)</tit... | #!/usr/bin/env python
__all__ = ['mtv81_download']
from ..common import *
from html.parser import unescape
from xml.dom.minidom import parseString
def mtv81_download(url, output_dir = '.', merge = True, info_only = False):
html=get_content(url)
title=unescape("|".join(match1(html,r"<title>(.*?)</title>").spl... | mit | Python |
1c77183f8d1a9e52e5b506526c7e4c806b3ec359 | remove common folder | qiansl127/HiBench,arijitt/HiBench,nareshgundla/HiBench,samklr/HiBench,maismail/HiBench,Acidburn0zzz/HiBench,nareshgundla/HiBench,maismail/HiBench,nsabharwal/HiBench,bit1129/HiBench,nareshgundla/HiBench,ConeyLiu/HiBench,cemsbr/HiBench,nsabharwal/HiBench,nareshgundla/HiBench,Acidburn0zzz/HiBench,cemsbr/HiBench,lvsoft/HiB... | kmeans/python/kmeans.py | kmeans/python/kmeans.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 | Python |
8f1d502811004f4b5c322be601d2626fb28050cc | fix testdata | caot/intellij-community,apixandru/intellij-community,fitermay/intellij-community,TangHao1987/intellij-community,caot/intellij-community,alphafoobar/intellij-community,Distrotech/intellij-community,clumsy/intellij-community,izonder/intellij-community,diorcety/intellij-community,blademainer/intellij-community,signed/inte... | python/testData/completion/importItself.after.py | python/testData/completion/importItself.after.py | from package1.submodule2 import <caret> | from package1.submodule2 | apache-2.0 | Python |
e3ca46ea3ca2e50369fee796b840439a7345b2ab | Make sure we migrate the ormq sqlite db during startup. | mrpau/kolibri,66eli77/kolibri,aronasorman/kolibri,66eli77/kolibri,MingDai/kolibri,jamalex/kolibri,aronasorman/kolibri,benjaoming/kolibri,jonboiser/kolibri,rtibbles/kolibri,66eli77/kolibri,christianmemije/kolibri,aronasorman/kolibri,mrpau/kolibri,indirectlylit/kolibri,learningequality/kolibri,jtamiace/kolibri,aronasorma... | kolibri/utils/server.py | kolibri/utils/server.py | import os
import cherrypy
from django.conf import settings
from django.core.management import call_command
from kolibri.content.utils import paths
from kolibri.content.utils.annotation import update_channel_metadata_cache
from kolibri.deployment.default.wsgi import application
def start():
# TODO(aronasorman): ... | import os
import cherrypy
from django.conf import settings
from django.core.management import call_command
from kolibri.content.utils import paths
from kolibri.content.utils.annotation import update_channel_metadata_cache
from kolibri.deployment.default.wsgi import application
def start():
# TODO(aronasorman): ... | mit | Python |
95125fe184daa5c38e518956a086d8c630ec56d8 | Add imports in util.__init__.py | PyThaiNLP/pythainlp | pythainlp/util/__init__.py | pythainlp/util/__init__.py | # -*- coding: utf-8 -*-
"""
Utility functions, like date conversion and digit conversion
"""
__all__ = [
"Trie",
"arabic_digit_to_thai_digit",
"bahttext",
"collate",
"countthai",
"delete_tone",
"dict_trie",
"digit_to_text",
"eng_to_thai",
"find_keyword",
"is_native_thai",
... | # -*- coding: utf-8 -*-
"""
Utility functions, like date conversion and digit conversion
"""
__all__ = [
"Trie",
"arabic_digit_to_thai_digit",
"bahttext",
"collate",
"countthai",
"delete_tone",
"dict_trie",
"digit_to_text",
"eng_to_thai",
"find_keyword",
"is_native_thai",
... | apache-2.0 | Python |
d5bc3ec8abe31fe5c5fb447190dc7b3818b7d988 | Update version.py | dpressel/baseline,dpressel/baseline,dpressel/baseline,dpressel/baseline | python/baseline/version.py | python/baseline/version.py | __version__ = "1.5.4"
| __version__ = "1.5.3"
| apache-2.0 | Python |
09be419960d208967771d93025c4f86b80ebe4e9 | Revert "use utf-8 by default" | aldebaran/qibuild,aldebaran/qibuild,aldebaran/qibuild,aldebaran/qibuild | python/qibuild/__init__.py | python/qibuild/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2018 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" This module contains a few functions for running CMake and building projects. """
from __future__ import absolute_impor... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2018 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" This module contains a few functions for running CMake and building projects. """
from __future__ import absolute_impor... | bsd-3-clause | Python |
d4ef6ee924daf9503cb21ce4b8f52c9b409e905e | Test load_config | AlexanderFabisch/cythonwrapper,AlexanderFabisch/cythonwrapper | pywrap/test/test_cython.py | pywrap/test/test_cython.py | import os
from pywrap.cython import make_cython_wrapper, TypeInfo, load_config
from nose.tools import (assert_raises_regexp, assert_false, assert_equal,
assert_is_not_none)
def test_missing_file():
assert_raises_regexp(ValueError, "does not exist", make_cython_wrapper,
... | import os
from pywrap.cython import make_cython_wrapper, TypeInfo, load_config
from nose.tools import assert_raises_regexp, assert_false, assert_equal
def test_missing_file():
assert_raises_regexp(ValueError, "does not exist", make_cython_wrapper,
"missing.hpp", [])
assert_false(os.pa... | bsd-3-clause | Python |
9b0981fd9bcca8c3fba244835dcdfb8cf3777e26 | Fix test | ppinard/pyxray,openmicroanalysis/pyxray,openmicroanalysis/pyxray | pyxray/parser/test_jeol.py | pyxray/parser/test_jeol.py | #!/usr/bin/env python
""" """
# Standard library modules.
import unittest
import logging
# Third party modules.
# Local modules.
from pyxray.parser.jeol import JEOLTransitionParser
# Globals and constants variables.
class TestJEOLTransitionParser(unittest.TestCase):
def setUp(self):
unittest.TestCase.... | #!/usr/bin/env python
""" """
# Standard library modules.
import unittest
import logging
# Third party modules.
# Local modules.
from pyxray.parser.jeol import JEOLTransitionParser
# Globals and constants variables.
class TestJEOLTransitionParser(unittest.TestCase):
def setUp(self):
unittest.TestCase.... | mit | Python |
8d43536f2f6d3dd61a1541ff3b6eec004e29a61d | watch for disconnected joystick and handle gracefully | SeneCameras/qr-w100s | qr-w100s/input/joystick.py | qr-w100s/input/joystick.py | #!/usr/bin/env python
import pygame
import sys
import multiprocessing
import Queue #needed separately for the Empty exception
import time, datetime
class JoystickProcess(multiprocessing.Process):
def __init__(self, outputqueue):
multiprocessing.Process.__init__(self)
self.outputqueue = outputqueue
... | #!/usr/bin/env python
import pygame
import sys
import multiprocessing
import Queue #needed separately for the Empty exception
import time, datetime
class JoystickProcess(multiprocessing.Process):
def __init__(self, outputqueue):
multiprocessing.Process.__init__(self)
self.outputqueue = outputqueue
... | mit | Python |
35429a07f3a350a1450575d5ac9f98ceb13402b7 | Fix default path | davidgasquez/kaggle-airbnb | notebooks/utils/data_loading.py | notebooks/utils/data_loading.py | """Wrappers to simplify data loading."""
import pandas as pd
# Set default path
DEFAULT_PATH = '../data/raw/'
def load_users_data(path=DEFAULT_PATH, preprocessed=False):
"""Load users data into train and test users.
Parameters
----------
path: str
Path of the folder containing the data.
... | """Wrappers to simplify data loading."""
import pandas as pd
# Set default path
DEFAULT_PATH = '../data/raw/'
def load_users_data(path=DEFAULT_PATH, preprocessed=False):
"""Load users data into train and test users.
Parameters
----------
path: str
Path of the folder containing the data.
... | mit | Python |
b6737da3ac04094a1136459bd0023c05111841bd | remove erroneous comment (#17) | googleapis/python-speech,googleapis/python-speech | samples/v1/speech_transcribe_enhanced_model.py | samples/v1/speech_transcribe_enhanced_model.py | # -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | # -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 | Python |
d71f08c4927028bd27a25a6ef2ded22a04fead02 | Use new TroposphereType syntax | remind101/stacker_blueprints,remind101/stacker_blueprints | stacker_blueprints/dynamodb.py | stacker_blueprints/dynamodb.py | from stacker.blueprints.base import Blueprint
from stacker.blueprints.variables.types import TroposphereType
from troposphere import (
dynamodb2,
Ref,
GetAtt,
Output,
)
class DynamoDB(Blueprint):
"""Manages the creation of DynamoDB tables.
Example::
- name: users
class_path: s... | from stacker.blueprints.base import Blueprint
from stacker.blueprints.variables.types import TroposphereType
from troposphere import (
dynamodb2,
Ref,
GetAtt,
Output,
)
class DynamoDB(Blueprint):
"""Manages the creation of DynamoDB tables.
Example::
- name: users
class_path: s... | bsd-2-clause | Python |
0ed4ccd304e781fc188505f73ab900a254257b90 | remove comments | yarden-livnat/regulus | regulus/measures/linear.py | regulus/measures/linear.py | import numpy as np
from sklearn import linear_model as lm
# def cache_key(*args):
# if len(args) == 1:
# return args[0].id
# return f'{args[0].id}:{args[1].id}'
#
#
# def cached(name, key=cache_key):
# def named(factory):
# def wrapper(*args):
# cache = args[-1][name]
# ... | import numpy as np
from sklearn import linear_model as lm
# def cache_key(*args):
# if len(args) == 1:
# return args[0].id
# return f'{args[0].id}:{args[1].id}'
#
#
# def cached(name, key=cache_key):
# def named(factory):
# def wrapper(*args):
# cache = args[-1][name]
# ... | bsd-3-clause | Python |
633da6e3d64621c117ce2ae5f9d4f27088bdf89f | remove main function from script | AmosGarner/PyInventory | updateCollection.py | updateCollection.py | from DataObjects.Collection import Collection
from ObjectFactories.ItemFactory import ItemFactory
import json
def getCollection(fileName):
collectionFile = open(fileName, 'r')
fileData = json.loads(collectionFile.read())
collectionFile.close()
collectionType = fileData['collectionType']
collection... | from DataObjects.Collection import Collection
from ObjectFactories.ItemFactory import ItemFactory
from collections import OrderedDict
import json
def main():
collectionFileName = 'collections/agarner_collections/agarner_Item_collection.dat'
item = ItemFactory.factory('item', [0, 'someItem', 'date', 'date'])
... | apache-2.0 | Python |
c7cb6c1441bcfe359a9179858492044591e80007 | Make the personal condor config world readable | efajardo/osg-test,efajardo/osg-test | osgtest/tests/test_10_condor.py | osgtest/tests/test_10_condor.py | from os.path import join
import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.condor as condor
import osgtest.library.osgunittest as osgunittest
import osgtest.library.service as service
personal_condor_config = '''
DAEMON_LIST = COLLECTOR, MASTER, NEGOTIATOR, SCHEDD, START... | from os.path import join
import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.condor as condor
import osgtest.library.osgunittest as osgunittest
import osgtest.library.service as service
personal_condor_config = '''
DAEMON_LIST = COLLECTOR, MASTER, NEGOTIATOR, SCHEDD, START... | apache-2.0 | Python |
619dc41d83f2e780af8b4bc8ae88a07dc9648d5d | update client | osspeak/osspeak,osspeak/osspeak,osspeak/osspeak | osspeak/communication/client.py | osspeak/communication/client.py | import asyncio
import functools
import threading
import json
import socket
import aiohttp
import time
import sys
from user.settings import user_settings
from communication import messages, common
class RemoteEngineClient:
def __init__(self):
self.server_address = user_settings['server_address']
se... | import asyncio
import functools
import threading
import json
import socket
import aiohttp
import time
import sys
from user.settings import user_settings
from communication import messages, common
class RemoteEngineClient:
def __init__(self):
self.server_address = user_settings['server_address']
se... | mit | Python |
61ca9a777993198542ee89905eee5c292c39bdf7 | enable slots | fedora-conary/conary,fedora-conary/conary,fedora-conary/conary,fedora-conary/conary,fedora-conary/conary | repository/filecontents.py | repository/filecontents.py | #
# Copyright (c) 2004 Specifix, Inc.
# All rights reserved
#
import os
import versioned
SEEK_SET=0
SEEK_CUR=1
SEEK_END=2
class FileContents(object):
__slots__ = ()
def __init__(self):
if self.__class__ == FileContents:
raise NotImplementedError
class FromRepository(FileContents):
__slots__ = (... | #
# Copyright (c) 2004 Specifix, Inc.
# All rights reserved
#
import os
import versioned
SEEK_SET=0
SEEK_CUR=1
SEEK_END=2
class FileContents:
def __init__(self):
if self.__class__ == FileContents:
raise NotImplementedError
class FromRepository(FileContents):
def get(self):
return self.repos.pullFil... | apache-2.0 | Python |
bf4e495e482caac02c6b204feef82396cba3cbc8 | Fix `is` comparison with a literal | agdsn/sipa,agdsn/sipa,agdsn/sipa,agdsn/sipa | sipa/blueprints/news.py | sipa/blueprints/news.py | # -*- coding: utf-8 -*-
"""
Blueprint providing features regarding the news entries.
"""
from operator import attrgetter
from flask import Blueprint, abort, current_app, render_template, request
bp_news = Blueprint('news', __name__, url_prefix='/news')
@bp_news.route("/")
def show():
"""Get all markdown files ... | # -*- coding: utf-8 -*-
"""
Blueprint providing features regarding the news entries.
"""
from operator import attrgetter
from flask import Blueprint, abort, current_app, render_template, request
bp_news = Blueprint('news', __name__, url_prefix='/news')
@bp_news.route("/")
def show():
"""Get all markdown files ... | mit | Python |
d8b477083866a105947281ca34cb6e215417f44d | Make distinction between local and runner action payload templates. Added small description for sanitizing the NetAPI payload for logging. | pidah/st2contrib,StackStorm/st2contrib,psychopenguin/st2contrib,lmEshoo/st2contrib,armab/st2contrib,StackStorm/st2contrib,pearsontechnology/st2contrib,digideskio/st2contrib,digideskio/st2contrib,armab/st2contrib,tonybaloney/st2contrib,pearsontechnology/st2contrib,lmEshoo/st2contrib,tonybaloney/st2contrib,psychopenguin/... | packs/salt/actions/lib/utils.py | packs/salt/actions/lib/utils.py | # pylint: disable=line-too-long
import yaml
from .meta import actions
runner_action_meta = {
"name": "",
"parameters": {
"action": {
"type": "string",
"immutable": True,
"default": ""
},
"kwargs": {
"type": "object",
"required... | import yaml
action_meta = {
"name": "",
"parameters": {
"action": {
"type": "string",
"immutable": True,
"default": ""
},
"kwargs": {
"type": "object",
"required": False
}
},
"runner_type": "run-python",
"de... | apache-2.0 | Python |
b1c06af38cc92cd07c72180f76a43fe522bd7c87 | Clarify doc | ravenac95/virtstrap-core,ravenac95/virtstrap-core | virtstrap/runner.py | virtstrap/runner.py | import sys
from optparse import OptionParser
from virtstrap.log import logger, setup_logger
from virtstrap.loaders import CommandLoader
from virtstrap.commands import registry
from virtstrap.registry import CommandDoesNotExist
from virtstrap.config import VirtstrapConfig
EXIT_FAIL = 1
EXIT_OK = 0
class VirtstrapRunne... | import sys
from optparse import OptionParser
from virtstrap.log import logger, setup_logger
from virtstrap.loaders import CommandLoader
from virtstrap.commands import registry
from virtstrap.registry import CommandDoesNotExist
from virtstrap.config import VirtstrapConfig
EXIT_FAIL = 1
EXIT_OK = 0
class VirtstrapRunne... | mit | Python |
7511816b8df88e4bfb7f9c61270d3828966b7d76 | add docstrings to the main interface | qtux/instmatcher | instmatcher/__init__.py | instmatcher/__init__.py | # Copyright 2016 Matthias Gazzari
#
# 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 writ... | # Copyright 2016 Matthias Gazzari
#
# 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 writ... | apache-2.0 | Python |
60625877a23e26e66c2c97cbeb4f139ede717eda | Use numpy for readin and add errorbars. | bixel/python-introduction | B.py | B.py | #! /usr/bin/env python3
# coding: utf-8
from collections import namedtuple
import matplotlib.pyplot as plt
import numpy as np
BCand = namedtuple('BCand', ['m', 'merr', 'pt', 'p'])
bs = [BCand(*b) for b in np.genfromtxt('B.txt', skip_header=1, delimiter=',')]
masses = [b.m for b in bs]
ns, bins, _ = plt.hist(masses... | #! /usr/bin/env python3
# coding: utf-8
from collections import namedtuple
import matplotlib.pyplot as plt
BCand = namedtuple('BCand', ['m', 'merr', 'pt', 'p'])
bs = []
with open('B.txt') as f:
for line in f.readlines()[1:]:
bs.append(BCand(*[float(v) for v in line.strip().split(',')]))
masses = [b.m f... | mit | Python |
33aac561ccf3a99af6445a55c251a1ccd7465260 | Update version. | pmaigutyak/mp-config,pmaigutyak/mp-config | site_config/__init__.py | site_config/__init__.py |
from django.apps import apps, AppConfig
from django.utils.translation import ugettext_lazy as _
class SiteConfigApp(AppConfig):
name = 'site_config'
verbose_name = _("Settings")
class SiteConfig(object):
def __getattr__(self, name):
if name.startswith('_'):
return super(SiteConfig,... |
from django.apps import apps, AppConfig
from django.utils.translation import ugettext_lazy as _
class SiteConfigApp(AppConfig):
name = 'site_config'
verbose_name = _("Settings")
class SiteConfig(object):
def __getattr__(self, name):
if name.startswith('_'):
return super(SiteConfig,... | isc | Python |
2dcb159bdd826ceeb68658cc3760c97dae04289e | Add args to exception to display the correct message in the UI. | BT-ojossen/partner-contact,Ehtaga/partner-contact,BT-fgarbely/partner-contact,acsone/partner-contact,BT-jmichaud/partner-contact,charbeljc/partner-contact,sergiocorato/partner-contact,Antiun/partner-contact,raycarnes/partner-contact,idncom/partner-contact,Endika/partner-contact,gurneyalex/partner-contact,QANSEE/partner... | partner_firstname/exceptions.py | partner_firstname/exceptions.py | # -*- encoding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... | # -*- encoding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... | agpl-3.0 | Python |
eba9b1cc7077b6a24e4849d146770fe703d8f8d6 | Add 10.py, plus prime method. | bm5w/pychal | 10.py | 10.py | """Python challenge #10:
http://www.pythonchallenge.com/pc/return/bull.html"""
def main(n=50):
a = [1, 11, 21, 1211, 111221]
while len(a) <= 50:
index = len(a)-1
temp_a = len(str(a[index-1]))
temp_b = len(str(a[index]))
y = temp_a + temp_b
x = 10**(y-1)
a.append... | """Python challenge #10:
http://www.pythonchallenge.com/pc/return/bull.html"""
def main():
pass
if __name__ == "__main__":
main()
| mit | Python |
885a5db3875ca04dce6daf62e4a3204b5c0913b4 | Change function status to ap status, and add TIMEOUT | JohnSounder/AP-API,JohnSounder/AP-API,kuastw/AP-API,kuastw/AP-API | ap.py | ap.py | #-*- encoding=utf-8 -*-
import requests
from lxml import etree
ap_login_url = "http://140.127.113.227/kuas/perchk.jsp"
fnc_url = "http://140.127.113.227/kuas/fnc.jsp"
query_url = "http://140.127.113.227/kuas/%s_pro/%s.jsp?"
RANDOM_ID = "AG009"
LOGIN_TIMEOUT = 1.0
QUERY_TIMEOUT = 1.0
RANDOM_TIMEOUT = 1.0
def stat... | #-*- encoding=utf-8 -*-
from lxml import etree
import requests
ap_login_url = "http://140.127.113.231/kuas/perchk.jsp"
fnc_url = "http://140.127.113.231/kuas/fnc.jsp"
query_url = "http://140.127.113.231/kuas/%s_pro/%s.jsp?"
RANDOM_ID = "AG009"
LOGIN_TIMEOUT = 1.0
QUERY_TIMEOUT = 1.0
RANDOM_TIMEOUT = 1.0
def logi... | mit | Python |
c3a249683cfaae81030954f2f8b72554fdc6fa51 | add test for <BACKSPACE> binding to delete 4 spaces | crate/crash,crate/crash | src/crate/crash/test_keybinding.py | src/crate/crash/test_keybinding.py | # Licensed to CRATE Technology GmbH ("Crate") under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. Crate licenses
# this file to you under the Apache License, Version 2.0 (the "License");
# you may not use this f... | # Licensed to CRATE Technology GmbH ("Crate") under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. Crate licenses
# this file to you under the Apache License, Version 2.0 (the "License");
# you may not use this f... | apache-2.0 | Python |
45852616a3f02a2a6ab4d49f58ad013a98b1f2fd | Fix text in English | mogproject/easy-alert | src/easy_alert/i18n/messages_en.py | src/easy_alert/i18n/messages_en.py | # -*- coding: utf-8 -*-
EMAIL_ENCODING = 'utf-8'
MSG_DEBUG = u"DEBUG"
MSG_INFO = u"INFO"
MSG_WARN = u"WARN"
MSG_ERROR = u"ERROR"
MSG_CRITICAL = u"CRITICAL"
MSG_PROC_NOT_RUNNING = u'not running'
MSG_PROC_RUNNING = u'%(count)d process(es) are running'
MSG_PROC_STATUS_FORMAT = u'[%(level)s] %(name)s: %(count)s (not "%(... | # -*- coding: utf-8 -*-
EMAIL_ENCODING = 'utf-8'
MSG_DEBUG = u"DEBUG"
MSG_INFO = u"INFO"
MSG_WARN = u"WARN"
MSG_ERROR = u"ERROR"
MSG_CRITICAL = u"CRITICAL"
MSG_PROC_NOT_RUNNING = u'not running'
MSG_PROC_RUNNING = u'%(count)d process(es) are running'
MSG_PROC_STATUS_FORMAT = u'[%(level)s] %(name)s: %(count)s (not "%(... | apache-2.0 | Python |
2271255ff8d69f2a62b20042c94e49c6a4bd02bd | save rendered files | hdknr/Gel,hdknr/Gel | src/gel/management/commands/gel.py | src/gel/management/commands/gel.py | # -*- coding: utf-8 -*-
'''
.. todo::
Find project root directroy
'''
from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
import os
import shutil
DEFAULT_DIR = "../www"
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_optio... | # -*- coding: utf-8 -*-
'''
.. todo::
Find project root directroy
'''
from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
import os
import shutil
DEFAULT_DIR = "../www"
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_optio... | bsd-2-clause | Python |
3318e31a2f55327f49215b9cf421f9c71274f15c | Fix #3137 | vuolter/pyload,vuolter/pyload,vuolter/pyload | module/plugins/accounts/UptoboxCom.py | module/plugins/accounts/UptoboxCom.py | # -*- coding: utf-8 -*-
import time
import re
import urlparse
from ..internal.misc import json
from ..internal.XFSAccount import XFSAccount
class UptoboxCom(XFSAccount):
__name__ = "UptoboxCom"
__type__ = "account"
__version__ = "0.23"
__status__ = "testing"
__description__ = """Uptobox.com acc... | # -*- coding: utf-8 -*-
import time
import re
import urlparse
from ..internal.misc import json
from ..internal.XFSAccount import XFSAccount
class UptoboxCom(XFSAccount):
__name__ = "UptoboxCom"
__type__ = "account"
__version__ = "0.22"
__status__ = "testing"
__description__ = """Uptobox.com acc... | agpl-3.0 | Python |
a52c16b5e50e67d533aae42be9f78789d1752fe6 | create different context at different process.. hope i am correct | PyOCL/OpenCLGA,PyOCL/TSP,PyOCL/oclGA,PyOCL/TSP,PyOCL/oclGA,PyOCL/OpenCLGA,PyOCL/OpenCLGA,PyOCL/oclGA,PyOCL/oclGA | ocl_ga_client.py | ocl_ga_client.py | #!/usr/bin/python3
import pyopencl as cl
import time
from multiprocessing import Process
from ocl_ga import OpenCLGA
# note: we can use multiprocessing.Queue or multiprocessing.Value to exchange data
class OpenCLGAWorker(Process):
def __init__(self, platform_index, device_index):
super().__init__()
... | #!/usr/bin/python3
import pyopencl as cl
from ocl_ga import OpenCLGA
class OpenCLGAClient():
def __init__(self, ip, port=12345):
self.__server_ip = ip
self.__server_port = port
self.__contexts = self.__create_cl(self.__list_devices()))
#TODO: try to fork as more as possible process ... | mit | Python |
82099deac6c09639910084c202120be40ca68535 | Fix error messages | deanishe/bundler-icon-server,deanishe/bundler-icon-server,deanishe/bundler-icon-server,deanishe/bundler-icon-server | iconserver/__init__.py | iconserver/__init__.py | from flask import Flask
import config
app = Flask(__name__)
app.config.from_object('config')
from iconserver import views
if not app.debug:
import logging
from logging.handlers import RotatingFileHandler, SMTPHandler
if config.USE_LOCAL_MAIL:
import subprocess
class MailHandler(loggin... | from flask import Flask
import config
app = Flask(__name__)
app.config.from_object('config')
from iconserver import views
if not app.debug:
import logging
from logging.handlers import RotatingFileHandler, SMTPHandler
if config.USE_LOCAL_MAIL:
import subprocess
class MailHandler(loggin... | mit | Python |
d4909d063bd808971a75ef6ba56723b1a0fa7105 | update guards for adding encrypted | mtagle/airflow,sekikn/incubator-airflow,NielsZeilemaker/incubator-airflow,jlowin/airflow,zoyahav/incubator-airflow,stverhae/incubator-airflow,redengineer/airflow,wndhydrnt/airflow,asnir/airflow,cswaroop/airflow,LilithWittmann/airflow,jhsenjaliya/incubator-airflow,john5223/airflow,wangtuanjie/airflow,alexvanboxel/airflo... | airflow/migrations/versions/1507a7289a2f_create_is_encrypted.py | airflow/migrations/versions/1507a7289a2f_create_is_encrypted.py | """create is_encrypted
Revision ID: 1507a7289a2f
Revises: e3a246e0dc1
Create Date: 2015-08-18 18:57:51.927315
"""
# revision identifiers, used by Alembic.
revision = '1507a7289a2f'
down_revision = 'e3a246e0dc1'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy.eng... | """create is_encrypted
Revision ID: 1507a7289a2f
Revises: e3a246e0dc1
Create Date: 2015-08-18 18:57:51.927315
"""
# revision identifiers, used by Alembic.
revision = '1507a7289a2f'
down_revision = 'e3a246e0dc1'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy.eng... | apache-2.0 | Python |
93c8c3a8cf47c18724f1bf07ad5af4840ecb6eea | remove unused property | jeffreyliu3230/scrapi,felliott/scrapi,fabianvf/scrapi,fabianvf/scrapi,ostwald/scrapi,icereval/scrapi,CenterForOpenScience/scrapi,erinspace/scrapi,mehanig/scrapi,erinspace/scrapi,alexgarciac/scrapi,mehanig/scrapi,CenterForOpenScience/scrapi,felliott/scrapi | scrapi/base/transformer.py | scrapi/base/transformer.py | from __future__ import unicode_literals
import abc
import logging
from copy import deepcopy
from functools import partial
logger = logging.getLogger(__name__)
class BaseTransformer(object):
__metaclass__ = abc.ABCMeta
def __init__(self, schema):
self.schema = deepcopy(schema)
def transform(se... | from __future__ import unicode_literals
import abc
import logging
from copy import deepcopy
from functools import partial
logger = logging.getLogger(__name__)
class BaseTransformer(object):
__metaclass__ = abc.ABCMeta
def __init__(self, schema):
self.schema = deepcopy(schema)
def transform(se... | apache-2.0 | Python |
b3c13fcb651e98be245fb3981c137e905e964099 | use single qoutes across the url file | philanthropy-u/edx-platform,philanthropy-u/edx-platform,philanthropy-u/edx-platform,philanthropy-u/edx-platform | openedx/features/partners/urls.py | openedx/features/partners/urls.py | from django.conf.urls import url
from .views import dashboard, login_user, performance_dashboard, register_user, reset_password_view
PARTNERS_SLUG_PARAM = '(?P<slug>[0-9a-z_-]+)'
urlpatterns = [
# Please keep the `partners/reset_password/` on top
url(r'^partners/reset_password/$', reset_password_view, name='... | from django.conf.urls import url
from .views import dashboard, login_user, performance_dashboard, register_user, reset_password_view
PARTNERS_SLUG_PARAM = '(?P<slug>[0-9a-z_-]+)'
urlpatterns = [
# Please keep the `partners/reset_password/` on top
url(r'^partners/reset_password/$', reset_password_view, name='... | agpl-3.0 | Python |
9c9c6f095cb06055ca3d36d76210cb29aad7017b | Bump version to 0.9.0 | lpomfrey/django-taggit-machinetags | taggit_machinetags/__init__.py | taggit_machinetags/__init__.py | # -*- coding: utf-8 -*-
from distutils import version
__version__ = '0.9.0'
version_info = version.StrictVersion(__version__).version
| # -*- coding: utf-8 -*-
from distutils import version
__version__ = '0.8.1'
version_info = version.StrictVersion(__version__).version
| bsd-2-clause | Python |
5dea7eff0cb86cd57e7d29f7e0d45af1c308ee38 | remove an accidentally submitted DO NOT SUBMIT (#1716) | tensorflow/tensorboard,tensorflow/tensorboard,tensorflow/tensorboard,tensorflow/tensorboard,tensorflow/tensorboard,tensorflow/tensorboard,tensorflow/tensorboard | tensorboard/compat/__init__.py | tensorboard/compat/__init__.py | # Copyright 2017 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 2017 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 |
590988339a07555617a759cf0502cf5836da1c81 | Add actor with a manual event loop | waltermoreira/tartpy | rt.py | rt.py | import queue
import threading
import eventloop
def initial_behavior(f):
f.initial_behavior = True
return f
class MetaActor(type):
def __new__(mcls, name, bases, dict):
for meth in list(dict.values()):
if getattr(meth, 'initial_behavior', False):
dict['behavi... | import queue
import threading
import eventloop
def initial_behavior(f):
f.initial_behavior = True
return f
class MetaActor(type):
def __new__(mcls, name, bases, dict):
for meth in list(dict.values()):
if getattr(meth, 'initial_behavior', False):
dict['behavi... | mit | Python |
a990489849bdffae0085fb64a1f57cee3acd745c | add import | Autoplectic/dit,dit/dit,dit/dit,Autoplectic/dit,Autoplectic/dit,Autoplectic/dit,Autoplectic/dit,dit/dit,dit/dit,dit/dit | dit/multivariate/tests/test_common_informations.py | dit/multivariate/tests/test_common_informations.py | """
Tests for the various common informations.
"""
import pytest
from hypothesis import given
from dit.multivariate import (gk_common_information as K,
caekl_mutual_information as J,
dual_total_correlation as B,
wyner_common_in... | """
Tests for the various common informations.
"""
import pytest
from dit.multivariate import (gk_common_information as K,
caekl_mutual_information as J,
dual_total_correlation as B,
wyner_common_information as C,
... | bsd-3-clause | Python |
3df76437a5f772488a156ee0601153c5c4cabe74 | fix write() method in project_task class | elego/tkobr-addons,elego/tkobr-addons,thinkopensolutions/tkobr-addons,thinkopensolutions/tkobr-addons,elego/tkobr-addons,thinkopensolutions/tkobr-addons,thinkopensolutions/tkobr-addons,elego/tkobr-addons | tko_project_task_dates_control/project_task.py | tko_project_task_dates_control/project_task.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# ThinkOpen Solutions Brasil
# Copyright (C) Thinkopen Solutions <http://www.tkobr.com>.
#
# This... | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# ThinkOpen Solutions Brasil
# Copyright (C) Thinkopen Solutions <http://www.tkobr.com>.
#
# This... | agpl-3.0 | Python |
4d38177b603e0076691151997d2a5b094a139bd8 | Throw ConfigError if multiple resources have reverse=True | danrex/django-riv,danrex/django-riv | api.py | api.py | from django.conf.urls import patterns
from riv.exceptions import ConfigurationError
class Api(object):
"""
The Api class is used to bind together different resources
that form a full API. This is necessary to perform url
resolution for related objects.
It also allows to register the same resource w... | from django.conf.urls import patterns
from riv.exceptions import ConfigurationError
class Api(object):
"""
The Api class is used to bind together different resources
that form a full API. This is necessary to perform url
resolution for related objects.
It also allows to register the same resource w... | mit | Python |
4719c1b2756e663369a4887f878ca053df2bae06 | Improve white spacing | misterwilliam/gae-channels-sample,misterwilliam/gae-channels-sample,misterwilliam/gae-channels-sample | api.py | api.py | import webapp2
from google.appengine.api import channel
from google.appengine.api import users
import models.models as models
open_channels = set()
previousChannels = models.Channel.query().fetch()
print "Retrieved: %s" % previousChannels
for _channel in previousChannels:
open_channels.add(_channel.channelId)
c... | import webapp2
from google.appengine.api import channel
from google.appengine.api import users
import models.models as models
open_channels = set()
previousChannels = models.Channel.query().fetch()
print "Retrieved: %s" % previousChannels
for _channel in previousChannels:
open_channels.add(_channel.channelId)
c... | mit | Python |
7181e8f6fef090c41cb2c02ba12d78cf8cb2383d | add unit test for methods of list that remove things | Shawn1874/CodeSamples,Shawn1874/CodeSamples,Shawn1874/CodeSamples,Shawn1874/CodeSamples | CodeSamplesPython/PythonSamples/PythonCollections/UnitTests.py | CodeSamplesPython/PythonSamples/PythonCollections/UnitTests.py | #!/usr/bin/env python3
import unittest
class CollectionTests(unittest.TestCase):
"""Test of string methods"""
def test_lists(self):
value = ["hello", "world"]
self.assertEqual(len(value), 2)
def test_append(self):
anotherFruit = "peaches"
container = ["grapes", "apples", "... | #!/usr/bin/env python3
import unittest
class CollectionTests(unittest.TestCase):
"""Test of string methods"""
def test_lists(self):
value = ["hello", "world"]
self.assertEqual(len(value), 2)
def test_append(self):
anotherFruit = "peaches"
container = ["grapes", "apples", "... | mit | Python |
eeb800aa1e09e942f3d1bd3dc33f14a9016c4854 | Optimize testrunner. | extertioner/django-modeltranslation,SideStudios/django-modeltranslation,akheron/django-modeltranslation,nanuxbe/django-modeltranslation,yoza/django-modeltranslation,SideStudios/django-modeltranslation,deschler/django-modeltranslation,yoza/django-modeltranslation,vstoykov/django-modeltranslation,vstoykov/django-modeltra... | runtests.py | runtests.py | #!/usr/bin/env python
import os
import sys
from django.conf import settings
from django.core.management import call_command
def runtests():
if not settings.configured:
# Choose database for settings
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
... | #!/usr/bin/env python
import os
import sys
from django.conf import settings
from django.core.management import call_command
def runtests():
if not settings.configured:
# Choose database for settings
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
... | bsd-3-clause | Python |
392fe828415bb4ba59ee8347cbd03c2137543e9a | move data to git repo. | michaelyin/im2markup-prep,michaelyin/im2markup-prep | net/wyun/tests/basic/test_ocr_perf.py | net/wyun/tests/basic/test_ocr_perf.py | import numpy as np
from scipy import stats
def print_stats(time_list):
lst = map(int, time_list)
np_a = np.asarray(lst)
print 'max:', max(lst), ', mean: ', sum(lst)/len(lst), ', min: ', min(lst), ', 98%: ', np.percentile(np_a, 98), ', 50%: ', \
np.percentile(np_a, 50), ', 2 sec. percentile: ', s... | import numpy as np
from scipy import stats
def print_stats(time_list):
lst = map(int, time_list)
np_a = np.asarray(lst)
print 'max:', max(lst), ', mean: ', sum(lst)/len(lst), ', min: ', min(lst), ', 98%: ', np.percentile(np_a, 98), ', 50%: ', \
np.percentile(np_a, 50), ', 2 sec. percentile: ', s... | apache-2.0 | Python |
5b7abf91e0814f1626bc594bb9f302ffb13b7a83 | update rank build tests | wegamekinglc/alpha-mind,wegamekinglc/alpha-mind,wegamekinglc/alpha-mind | alphamind/tests/portfolio/test_rankbuild.py | alphamind/tests/portfolio/test_rankbuild.py | # -*- coding: utf-8 -*-
"""
Created on 2017-4-27
@author: cheng.li
"""
import unittest
import numpy as np
import pandas as pd
from alphamind.portfolio.rankbuilder import rank_build
class TestRankBuild(unittest.TestCase):
def test_rank_build(self):
n_samples = 3000
n_included = 300
n_p... | # -*- coding: utf-8 -*-
"""
Created on 2017-4-27
@author: cheng.li
"""
import unittest
import numpy as np
import pandas as pd
from alphamind.portfolio.rankbuilder import rank_build
class TestRankBuild(unittest.TestCase):
def test_rank_build(self):
n_samples = 3000
n_included = 300
x =... | mit | Python |
6d4ca5ce44b1d2605ca7d8b0ae7211d172c40154 | Update NPI test data in medical_pharmacy_us | laslabs/vertical-medical,laslabs/vertical-medical | medical_pharmacy_us/tests/test_medical_pharmacy.py | medical_pharmacy_us/tests/test_medical_pharmacy.py | # -*- coding: utf-8 -*-
# © 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.tests.common import TransactionCase
from openerp.exceptions import ValidationError
class TestMedicalPharmacy(TransactionCase):
def setUp(self,):
super(TestMedicalPharmacy, self... | # -*- coding: utf-8 -*-
# © 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.tests.common import TransactionCase
from openerp.exceptions import ValidationError
class TestMedicalPharmacy(TransactionCase):
def setUp(self,):
super(TestMedicalPharmacy, self... | agpl-3.0 | Python |
8783cd1ad40dd99b68e64166bc694291ed70bebd | fix csp rule error | crazyguitar/pysheeet | app.py | app.py | """This is a simple cheatsheet webapp."""
import os
from flask import Flask, abort, send_from_directory
from flask_sslify import SSLify
from flask_seasurf import SeaSurf
from flask_talisman import Talisman
DIR = os.path.dirname(os.path.realpath(__file__))
ROOT = os.path.join(DIR, "docs", "_build", "html")
def find... | """This is a simple cheatsheet webapp."""
import os
from flask import Flask, abort, send_from_directory
from flask_sslify import SSLify
from flask_seasurf import SeaSurf
from flask_talisman import Talisman
DIR = os.path.dirname(os.path.realpath(__file__))
ROOT = os.path.join(DIR, "docs", "_build", "html")
def find... | mit | Python |
b0cc054844ef6eaeb09bcc62c297eda069048821 | Fix typo | NerdHerd91/Spacewalls,NerdHerd91/Spacewalls,NerdHerd91/Spacewalls | app.py | app.py | from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.heroku import Heroku
app = Flask(__name__)
heroku = Heroku(app)
db = SQLAlchemy(app)
# database model
class Wallpapers(db.Model):
__tablename__ = 'wallpapers'
id = db.Column(db.Integer, primary_key=True)
path = db.Column(db.String... | from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flast.ext.heroku import Heroku
app = Flask(__name__)
heroku = Heroku(app)
db = SQLAlchemy(app)
# database model
class Wallpapers(db.Model):
__tablename__ = 'wallpapers'
id = db.Column(db.Integer, primary_key=True)
path = db.Column(db.String... | mit | Python |
6f4f2680f19f54597753ac277d7b0e4549435200 | update code | RyouZhang/nori,RyouZhang/noir | app.py | app.py | import os
import json
import asyncio
from urllib.parse import urlparse, parse_qsl
from aiohttp import web
import router
import rule
import service
import entry
async def parser_request(request):
args = {}
if request.method == 'GET':
pairs = parse_qsl(request.query_string)
elif request.method == '... | import os
import asyncio
from aiohttp import web
import router
import rule
import service
import entry
async def handler(request):
return web.Response(body = b'hello world')
# api, params, context = await parser_request(request)
# result, err = await rule.ruleManager.check_api_rule(api, params, context)... | mit | Python |
a7804e3087f1c88b3d964c73e7fc1c1e334f346d | Update ipc_lista1.11.py | any1m1c/ipc20161 | lista1/ipc_lista1.11.py | lista1/ipc_lista1.11.py | #ipc_lista1.11
#Professor: Jucimar Junior
#Any Mendes Carvalho
#
#
#
#
#Faça um programa que peça 2 numeros inteiros e um numero real. Calcule e mostre:
#a- o produto do dobro do primeiro com metade do segundo.
#b- a soma do triplo do primeiro com o terceiro.
#c- o terceiro elevado ao cubo.
import math
num1 = input("... | #ipc_lista1.11
#Professor: Jucimar Junior
#Any Mendes Carvalho
#
#
#
#
#Faça um programa que peça 2 numeros inteiros e um numero real. Calcule e mostre:
#a- o produto do dobro do primeiro com metade do segundo.
#b- a soma do triplo do primeiro com o terceiro.
#c- o terceiro elevado ao cubo.
import math
num1 = input("... | apache-2.0 | Python |
c6eabb19d99d989e7a78c039a081175ca32e211d | Update ipc_lista1.15.py | any1m1c/ipc20161 | lista1/ipc_lista1.15.py | lista1/ipc_lista1.15.py | #ipc_lista1.15
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#
qHora = input("Quanto você ganha por hora: ")
hT = input("Quantas horas você trabalhou: ")
SalBruto = qHora
ir = (11/100.0 * salBruto)
inss = (8/100.0m* SalBruto)
sindicato = (5/100.0 * SalBruto)
vT = ir + sindicato
SalLiq = SalBru... | #ipc_lista1.15
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#
qHora = input("Quanto você ganha por hora: ")
hT = input("Quantas horas você trabalhou: ")
SalBruto = qHora
ir = (11/100.0 * salBruto)
inss = (8/100.0m* SalBruto)
sindicato = (5/100.0 * SalBruto)
vT = ir + sindicato
SalLiq = SalBru... | apache-2.0 | Python |
32b3cc9d2afec4bc4a9674409b1ade26e42b3943 | Update ipc_lista2.02.py | any1m1c/ipc20161 | lista2/ipc_lista2.02.py | lista2/ipc_lista2.02.py | #ipc_lista2.02
#Professor: Jucimar
| #ipc_lista2.02
#Professor:
| apache-2.0 | Python |
ccb66a4ceae869557fb58b116db460344a2e73b8 | Update ipc_lista2.02.py | any1m1c/ipc20161 | lista2/ipc_lista2.02.py | lista2/ipc_lista2.02.py | #ipc_lista2.02
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que peça um valor e mostre na tela se o valor é positivo ou negativo.
valor = float(input("Informe um numero
| #ipc_lista2.02
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que peça um valor e mostre na tela se o valor é positivo ou negativo.
valor = float(input
| apache-2.0 | Python |
729bc3f89f689d511602565676e19757a75681d9 | Update ipc_lista2.03.py | any1m1c/ipc20161 | lista2/ipc_lista2.03.py | lista2/ipc_lista2.03.py | #ipc_lista2.03
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que verifique se uma letra digitada é "F" ou "M"
sexo
sexo = raw_input("Informe seu sexo F para Feminino e M para Masculino: ")
| #ipc_lista2.03
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que verifique se uma letra digitada é "F" ou "M"
sexo
sexo = raw_input("Informe seu sexo F para Feminino e M para Masculino
| apache-2.0 | Python |
56ca220f00bfbb55cecf43ff4b11b4dfc87b94f6 | set blueprint url prefix to match eve | pavlovicnemanja/superdesk,superdesk/superdesk-aap,superdesk/superdesk,sivakuna-aap/superdesk,darconny/superdesk,hlmnrmr/superdesk,pavlovicnemanja/superdesk,mdhaman/superdesk-aap,hlmnrmr/superdesk,superdesk/superdesk,vied12/superdesk,pavlovicnemanja92/superdesk,darconny/superdesk,pavlovicnemanja92/superdesk,marwoodandre... | app.py | app.py | import os
import eve
import settings
import superdesk
from superdesk import signals
from eve.io.mongo import MongoJSONEncoder
from superdesk.auth import SuperdeskTokenAuth
from superdesk.validator import SuperdeskValidator
from superdesk.desk_media_storage import SuperdeskGridFSMediaStorage
from eve.render import send_... | import os
import eve
import settings
import superdesk
from superdesk import signals
from eve.io.mongo import MongoJSONEncoder
from superdesk.auth import SuperdeskTokenAuth
from superdesk.validator import SuperdeskValidator
from superdesk.desk_media_storage import SuperdeskGridFSMediaStorage
from eve.render import send_... | agpl-3.0 | Python |
88286b5d5887fc00b1885e4b7ffb8f56a52594e4 | Add blank line for neatness. | agdhruv/cs101-matrices,agdhruv/cs101-matrices,agdhruv/cs101-matrices | app.py | app.py | from flask import Flask, render_template, request, abort, redirect, url_for, jsonify
from main import *
app = Flask(__name__)
@app.route('/')
def index():
return render_template("index.html")
@app.route('/twoByTwo/')
def twoByTwo():
return render_template("twoByTwo.html")
@app.route('/threeByThree/')
def three... | from flask import Flask, render_template, request, abort, redirect, url_for, jsonify
from main import *
app = Flask(__name__)
@app.route('/')
def index():
return render_template("index.html")
@app.route('/twoByTwo/')
def twoByTwo():
return render_template("twoByTwo.html")
@app.route('/threeByThree/')
def three... | mit | Python |
7572df6e558479ebbe1c78f5671dc92450310330 | Add add bucket list feature | mkiterian/bucket-list-app,mkiterian/bucket-list-app,mkiterian/bucket-list-app | app.py | app.py | import json
from user import User
from flask import (Flask, render_template, url_for,
redirect, request, make_response, jsonify)
app = Flask(__name__)
def get_saved_data():
try:
data = json.loads(request.cookies.get('user'))
except TypeError:
data = {}
return data
@app.route('/'... | from flask import Flask, render_template, url_for, redirect, request
app = Flask(__name__)
@app.route('/')
def index():
return render_template('login.html')
@app.route('/save', methods=['POST'])
def save():
import pdb; pdb.set_trace()
return redirect(url_for('index'))
if __name__ == '__main__':
... | mit | Python |
85490a498fcb20f2ca555fd9fd901d90d286f4f7 | update app.py for falcon update | eit/jieba-web-service,eit/jieba-web-service | app.py | app.py | # jieba app
import falcon
import seg
import tag
api = application = falcon.API()
api.req_options.auto_parse_form_urlencoded = True
seg = seg.Resource()
api.add_route('/jieba', seg)
tag = tag.Resource()
api.add_route('/jieba/tag', tag)
| # jieba app
import falcon
import seg
import tag
api = application = falcon.API()
seg = seg.Resource()
api.add_route('/jieba', seg)
tag = tag.Resource()
api.add_route('/jieba/tag', tag)
| mit | Python |
00b5a27311914fca60bab4a289252b443c3f2ab4 | 更新 simsimi 屏蔽关键词 | 15klli/WeChat-Clone,paicha/gxgk-wechat-server,15klli/WeChat-Clone,paicha/gxgk-wechat-server,15klli/WeChat-Clone,paicha/gxgk-wechat-server | main/plugins/simsimi.py | main/plugins/simsimi.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import random
from .. import app, celery
from . import wechat_custom
default_answer = [u'么么哒', u'说啥呢……', u'叫我干嘛', u'我不听我不听', u'=。=']
def bad_word_filter(answer):
for word in ['撸', '微', '胸', '屌', '插', '叼', '操', '草', '舔',
'骚', '逼', '淫'... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import random
from .. import app, celery
from . import wechat_custom
default_answer = [u'么么哒', u'说啥呢……', u'叫我干嘛', u'纳尼……', u'=。=']
def bad_word_filter(answer):
for word in ['撸', '微', '胸', '屌', '插', '叼', '操', '草', '舔',
'骚', '逼', '淫', ... | mit | Python |
487a0241eeb61907e816991f2e37a63dc87ceafe | Fix NPM release phase | kylef/maintain,kylef/maintain,kylef/maintain | maintain/release/npm.py | maintain/release/npm.py | import os
import json
import collections
from semantic_version import Version
from maintain.release.base import Releaser
from maintain.process import invoke
class NPMReleaser(Releaser):
@classmethod
def detect(cls):
return os.path.exists('package.json')
def determine_current_version(self):
... | import os
import json
import collections
from semantic_version import Version
from maintain.release.base import Releaser
from maintain.process import invoke
class NPMReleaser(Releaser):
@classmethod
def detect(cls):
return os.path.exists('package.json')
def determine_current_version(self):
... | bsd-2-clause | Python |
3c045d2a85866780317b76a81f22c59987fc51ad | fix dependence | iw3hxn/LibrERP,iw3hxn/LibrERP,iw3hxn/LibrERP,iw3hxn/LibrERP,iw3hxn/LibrERP | project_extended/__openerp__.py | project_extended/__openerp__.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013-2016 Didotech SRL
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the F... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013-2016 Didotech SRL
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the F... | agpl-3.0 | Python |
da3454b5aa78272858c32fbe84a514d2165613a5 | set voulume | yangroro/upgrade-complete | bot.py | bot.py | import os
from pygame import mixer
from flask import Flask
app = Flask(__name__)
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
print(ROOT_DIR)
@app.route("/upgrade")
def hello():
mixer.init()
mixer.music.load(os.path.join(ROOT_DIR, 'upgrade_complete.mp3'))
mixer.music.set_volume(0.7)
mixer.... | import os
from pygame import mixer
from flask import Flask
app = Flask(__name__)
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
print(ROOT_DIR)
@app.route("/upgrade")
def hello():
mixer.init()
mixer.music.load(os.path.join(ROOT_DIR, 'upgrade_complete.mp3'))
mixer.music.play()
return "OK"
if... | mit | Python |
60e92f0a085bf7f4cb9f326085e3d4aba11f3594 | Add actual things that do real stuff | datamade/semabot,datamade/semabot | bot.py | bot.py | import json
import requests
from flask import Flask, request
from flow import Flow
from config import ORG_ID, CHANNEL_ID
flow = Flow('botbotbot')
app = Flask(__name__)
@app.route('/')
def index():
flow.send_message(ORG_ID, CHANNEL_ID, 'botbotbot')
return 'foo'
@app.route('/deployments/', methods=['POST'... | from flask import Flask
from flow import Flow
from config import ORG_ID, CHANNEL_ID
flow = Flow('botbotbot')
app = Flask(__name__)
@app.route('/')
def index():
flow.send_message(ORG_ID, CHANNEL_ID, 'botbotbot')
return 'foo'
if __name__ == "__main__":
app.run()
| mit | Python |
d89f1b89f89184d1648db7f28cf670bbb0d2c490 | Fix minor syntax | apranav19/pydirections | pydirections/route_requester.py | pydirections/route_requester.py | from .exceptions import InvalidModeError, InvalidAPIKeyError, InvalidAlternativeError
class ParamContainer(object):
"""
The purpose of this class is to simply validate any pre-defined parameters
such as: possible modes, route restriction params
"""
__ACCEPTABLE_MODES = set(["driving", "walking", "bicycling", "t... | from .exceptions import InvalidModeError, InvalidAPIKeyError, InvalidAlternativeError
class ParamContainer(object):
"""
The purpose of this class is to simply validate any pre-defined parameters
such as: possible modes, route restriction params
"""
__ACCEPTABLE_MODES = set(["driving", "walking", "bicycling", "t... | apache-2.0 | Python |
08f21b7b295b9889807df7bdd7d46775b1af0d58 | fix install prefix | PolyJIT/buildbot | polyjit/buildbot/builders/superbuild.py | polyjit/buildbot/builders/superbuild.py | import sys
from polyjit.buildbot.builders import register
from polyjit.buildbot import slaves
from polyjit.buildbot.utils import (builder, define, git, cmd, compile,
s_sbranch, s_force, s_trigger, mkdir)
from polyjit.buildbot.repos import make_cb, make_new_cb, codebases
from buildbo... | import sys
from polyjit.buildbot.builders import register
from polyjit.buildbot import slaves
from polyjit.buildbot.utils import (builder, define, git, cmd, compile,
s_sbranch, s_force, s_trigger, mkdir)
from polyjit.buildbot.repos import make_cb, make_new_cb, codebases
from buildbo... | mit | Python |
b0b29abc7c757cf9af2889084c00c756ccd7a07c | fix pagination count | makinacorpus/django-mapentity,makinacorpus/django-mapentity,makinacorpus/django-mapentity | mapentity/pagination.py | mapentity/pagination.py | from rest_framework_datatables.pagination import DatatablesPageNumberPagination
class MapentityDatatablePagination(DatatablesPageNumberPagination):
""" Custom datatable pagination for Mapentity list views. """
def get_count_and_total_count(self, queryset, view):
""" Handle count for all filters """
... | from rest_framework_datatables.pagination import DatatablesPageNumberPagination
class MapentityDatatablePagination(DatatablesPageNumberPagination):
""" Custom datatable pagination for Mapentity list views. """
pass
# def get_count_and_total_count(self, queryset, view):
# """ Handle count for all f... | bsd-3-clause | Python |
12a12793f5f1722679b1c816a8ab2371a790da69 | Mark version as final. | mlavin/django-meetup-auth | meetup_auth/__init__.py | meetup_auth/__init__.py | """
django-meetup-auth is an extension to django-social-auth which adds a backend for Meetup.com.
"""
__version_info__ = {
'major': 0,
'minor': 1,
'micro': 0,
'releaselevel': 'final',
}
def get_version():
"""
Return the formatted version information
"""
vers = ["%(major)i.%(minor)i" % ... | """
django-meetup-auth is an extension to django-social-auth which adds a backend for Meetup.com.
"""
__version_info__ = {
'major': 0,
'minor': 1,
'micro': 0,
'releaselevel': 'beta',
}
def get_version():
"""
Return the formatted version information
"""
vers = ["%(major)i.%(minor)i" % _... | bsd-2-clause | Python |
c9252f251345e1e79b28ccbc780bb5d4843aef9e | Print parentheses | Lingotek/translation-utility,Lingotek/filesystem-connector,Lingotek/filesystem-connector,Lingotek/client,Lingotek/translation-utility,Lingotek/client | tests/test_actions/__init__.py | tests/test_actions/__init__.py | from ltk.constants import CONF_DIR, CONF_FN
import os
import shutil
import time
def create_config():
"""
create config folder and file to initialize without auth
"""
conf_path = os.path.join(os.getcwd(), CONF_DIR)
try:
os.mkdir(conf_path)
except OSError:
pass
new_config_file... | from ltk.constants import CONF_DIR, CONF_FN
import os
import shutil
import time
def create_config():
"""
create config folder and file to initialize without auth
"""
conf_path = os.path.join(os.getcwd(), CONF_DIR)
try:
os.mkdir(conf_path)
except OSError:
pass
new_config_file... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.