repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
hbldh/pymetawear | pymetawear/client.py | 1 | 5352 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Main module for PyMetaWear
.. moduleauthor:: hbldh <henrik.blidh@nedomkull.com>
Created on 2016-03-30
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
from mbientlab.metawear import Met... | mit |
bjmc/oauthlib | tests/oauth1/rfc5849/test_signatures.py | 10 | 15058 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
try:
from urllib import quote
except ImportError:
from urllib.parse import quote
from oauthlib.oauth1.rfc5849.signature import collect_parameters
from oauthlib.oauth1.rfc5849.signature import construct_base_string
from oauthlib.o... | bsd-3-clause |
zerkrx/zerkbox | lib/youtube_dl/extractor/thesun.py | 45 | 1067 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .ooyala import OoyalaIE
class TheSunIE(InfoExtractor):
_VALID_URL = r'https://(?:www\.)?thesun\.co\.uk/[^/]+/(?P<id>\d+)'
_TEST = {
'url': 'https://www.thesun.co.uk/tvandshowbiz/2261604/orlando-bloom-and-katy-pe... | gpl-3.0 |
rdmorganiser/rdmo | rdmo/options/migrations/0018_data_migration.py | 2 | 1112 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2019-03-13 11:22
from __future__ import unicode_literals
from django.db import migrations
def set_null_to_blank(queryset, fields):
for element in queryset:
for field in fields:
value = getattr(element, field)
if value is Non... | apache-2.0 |
xebitstudios/Kayak | examples/poisson_glm.py | 3 | 1224 | import numpy as np
import numpy.random as npr
import matplotlib.pyplot as plt
import sys
sys.path.append('..')
import kayak
N = 10000
D = 5
P = 1
learn = 0.00001
batch_size = 500
# Random inputs.
X = npr.randn(N,D)
true_W = npr.randn(D,P)
lam = np.exp(np.dot(X, true_W))
Y = npr.poisson(lam)
kyk_batcher = k... | mit |
xifle/greensc | tools/scons/scons-local-2.0.1/SCons/Tool/ipkg.py | 61 | 2498 | """SCons.Tool.ipkg
Tool-specific initialization for ipkg.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
The ipkg tool calls the ipkg-build. Its only argument should be the
packages fake_root.
"""
#
# Copyrigh... | gpl-3.0 |
fuselock/odoo | addons/portal_project/project.py | 285 | 1809 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-TODAY OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
hmen89/odoo | addons/l10n_fr_hr_payroll/__openerp__.py | 374 | 2165 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
MikkCZ/kitsune | kitsune/sumo/tests/test_form_fields.py | 5 | 4151 | from django.core.exceptions import ValidationError
from django.utils import translation
from nose.tools import eq_
from kitsune.sumo.form_fields import _format_decimal, TypedMultipleChoiceField
from kitsune.sumo.tests import TestCase
class TestFormatDecimal(TestCase):
def test_default_locale(self):
"""... | bsd-3-clause |
HAZARDU5/sgdialer | src/nz/co/hazardmedia/sgdialer/config/Config.py | 1 | 4698 | __author__ = 'Michael Andrew michael@hazardmedia.co.nz'
class Config(object):
""" Config class """
sound_path = 'assets/sounds' #path from src folder to sound assets
point_of_origin_code = 0 #index of the point of origin
address_data_file_path = "data/addresses.xml" #path from src folder to data file... | mit |
40223149/2015springcda | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/color.py | 603 | 4330 | ## pygame - Python Game Library
## Copyright (C) 2000-2003 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (... | gpl-3.0 |
chainer/chainer | examples/memnn/train_memnn.py | 6 | 4288 | #!/usr/bin/env python
import argparse
import collections
import warnings
import chainer
from chainer.training import extensions
import numpy
import babi
import memnn
def train(train_data_path, test_data_path, args):
device = chainer.get_device(args.device)
device.use()
vocab = collections.defaultdict... | mit |
atiti/crashcollector | crashcollector.py | 1 | 11865 | #!/usr/bin/env python
from wsgiref.simple_server import make_server
import os, os.path, sys
import cgi, urlparse
import random, string
import subprocess
import time
site_name = 'http://crashes.sirikata.com'
id_file = 'data/__id'
def str_to_bool(v):
return not (len(v) == 0 or v.lower() in ['no', 'false', '0'])
d... | gpl-2.0 |
nachandr/cfme_tests | cfme/tests/candu/test_candu_manual.py | 2 | 11375 | """Manual tests"""
import pytest
from cfme import test_requirements
pytestmark = [
pytest.mark.manual,
]
@test_requirements.bottleneck
@pytest.mark.tier(2)
def test_bottleneck_datastore():
"""
Verify bottleneck events from host
Polarion:
assignee: gtalreja
casecomponent: Optimize
... | gpl-2.0 |
ptisserand/ansible | lib/ansible/modules/network/netscaler/netscaler_save_config.py | 67 | 4872 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Citrix Systems
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
jnerin/ansible | lib/ansible/modules/files/archive.py | 58 | 17351 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Ben Doherty <bendohmv@gmail.com>
# Sponsored by Oomph, Inc. http://www.oomphinc.com
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_impor... | gpl-3.0 |
timokoola/timoechobot | docutils/parsers/rst/languages/ja.py | 128 | 3863 | # -*- coding: utf-8 -*-
# $Id: ja.py 7119 2011-09-02 13:00:23Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two file... | apache-2.0 |
McNetic/CouchPotatoServer-de | couchpotato/core/media/movie/providers/info/omdbapi.py | 1 | 5734 | import json
import re
import traceback
from couchpotato import Env
from couchpotato.core.event import addEvent, fireEvent
from couchpotato.core.helpers.encoding import tryUrlencode
from couchpotato.core.helpers.variable import tryInt, tryFloat, splitString
from couchpotato.core.logger import CPLog
from couchpotato.cor... | gpl-3.0 |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/edx_management_commands/management_commands/management/commands/manage_group.py | 52 | 4853 | """
Management command `manage_group` is used to idempotently create Django groups
and set their permissions by name.
"""
from django.apps import apps
from django.contrib.auth.models import Group, Permission
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ValidationError
f... | agpl-3.0 |
mariusbaumann/pyload | module/plugins/hoster/FilesMailRu.py | 1 | 3878 | # -*- coding: utf-8 -*-
import re
from module.network.RequestFactory import getURL
from module.plugins.Hoster import Hoster
from module.plugins.Plugin import chunks
def getInfo(urls):
result = []
for chunk in chunks(urls, 10):
for url in chunk:
html = getURL(url)
if r'<div cl... | gpl-3.0 |
duqiao/django | tests/timezones/tests.py | 165 | 57662 | from __future__ import unicode_literals
import datetime
import re
import sys
import warnings
from unittest import SkipTest, skipIf
from xml.dom.minidom import parseString
from django.contrib.auth.models import User
from django.core import serializers
from django.core.exceptions import ImproperlyConfigured
from django... | bsd-3-clause |
sudosurootdev/external_chromium_org | tools/gyp-explain.py | 153 | 3035 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Prints paths between gyp targets.
"""
import json
import os
import sys
import time
from collections import deque
def usage():... | bsd-3-clause |
podemos-info/odoo | addons/hr_timesheet_sheet/__openerp__.py | 9 | 2992 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
aldanor/pytest-benchmark | src/pytest_benchmark/histogram.py | 1 | 3331 | from pytest_benchmark.utils import time_unit
try:
from pygal.graph.box import Box
from pygal.graph.box import is_list_like
from pygal.style import DefaultStyle
except ImportError as exc:
raise ImportError(exc.args, "Please install pygal and pygaljs or pytest-benchmark[histogram]")
class Plot(Box):
... | bsd-2-clause |
zhaochl/python-utils | verify_code/Imaging-1.1.7/build/lib.linux-x86_64-2.7/TiffTags.py | 44 | 4641 | #
# The Python Imaging Library.
# $Id$
#
# TIFF tags
#
# This module provides clear-text names for various well-known
# TIFF tags. the TIFF codec works just fine without it.
#
# Copyright (c) Secret Labs AB 1999.
#
# See the README file for information on usage and redistribution.
#
##
# This module provides constant... | apache-2.0 |
surgebiswas/poker | PokerBots_2017/Johnny/scipy/stats/tests/test_mstats_extras.py | 126 | 4761 | # pylint: disable-msg=W0611, W0612, W0511,R0201
"""Tests suite for maskedArray statistics.
:author: Pierre Gerard-Marchant
:contact: pierregm_at_uga_dot_edu
"""
from __future__ import division, print_function, absolute_import
__author__ = "Pierre GF Gerard-Marchant ($Author: backtopop $)"
import numpy as np
import ... | mit |
thaim/ansible | lib/ansible/modules/cloud/azure/azure_rm_mysqlconfiguration_info.py | 20 | 6543 | #!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski, (@zikalino)
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | mit |
Tatsh-ansible/ansible | lib/ansible/modules/cloud/amazon/s3_website.py | 50 | 11115 | #!/usr/bin/python
#
# This is a 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.
#
# This Ansible library is distributed in the hope that i... | gpl-3.0 |
DaveA50/lbry | lbrynet/dht/protocol.py | 1 | 14824 | #!/usr/bin/env python
#
# This library is free software, distributed under the terms of
# the GNU Lesser General Public License Version 3, or any later version.
# See the COPYING file included in this archive
#
# The docstrings in this module contain epytext markup; API documentation
# may be created by processing this... | mit |
yamt/neutron | quantum/openstack/common/timeutils.py | 39 | 5543 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation.
# 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.apac... | apache-2.0 |
abhishekgahlot/youtube-dl | youtube_dl/extractor/dreisat.py | 107 | 3259 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
unified_strdate,
)
class DreiSatIE(InfoExtractor):
IE_NAME = '3sat'
_VALID_URL = r'(?:http://)?(?:www\.)?3sat\.de/mediathek/(?:index\.php|mediathek\.php)?\?(?:(?:mode|display)=[^... | unlicense |
lmazuel/azure-sdk-for-python | azure-mgmt-scheduler/tests/test_scheduler_patch.py | 3 | 1458 | # coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------------... | mit |
Solinea/horizon | openstack_dashboard/dashboards/router/nexus1000v/forms.py | 35 | 10255 | # 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, software
# d... | apache-2.0 |
microcom/microcom-runbot | runbot/res_config.py | 1 | 2935 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
nin042/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/cmake.py | 123 | 7236 | # Copyright (C) 2012 Intel Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
cvmfs/cvmfs | cvmfs/webapi/test_cvmfs_geo.py | 2 | 5214 | from __future__ import print_function
import unittest
import socket
import cvmfs_geo
from cvmfs_geo import distance_on_unit_sphere
from cvmfs_geo import addr_geoinfo
from cvmfs_geo import name_geoinfo
from cvmfs_geo import geosort_servers
###
# Simulate a small geo IP database, since we can't always
# expect a full ... | bsd-3-clause |
rohanp/scikit-learn | sklearn/neighbors/tests/test_neighbors.py | 23 | 45330 | from itertools import product
import pickle
import numpy as np
from scipy.sparse import (bsr_matrix, coo_matrix, csc_matrix, csr_matrix,
dok_matrix, lil_matrix)
from sklearn import metrics
from sklearn.model_selection import train_test_split
from sklearn.model_selection import cross_val_scor... | bsd-3-clause |
amenonsen/ansible | lib/ansible/module_utils/network/nxos/config/vlans/vlans.py | 4 | 8762 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The nxos_vlans class
It is in this file where the current configuration (as dict)
is compared to the provided configuration (as dict) and the command set
necessary to bri... | gpl-3.0 |
tux-00/ansible | lib/ansible/module_utils/f5_utils.py | 9 | 10277 | #
# Copyright 2016 F5 Networks Inc.
#
# This file is part of Ansible
#
# Ansible 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.
#
# An... | gpl-3.0 |
karyon/django | tests/forms_tests/tests/tests.py | 16 | 16737 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db import models
from django.forms import (
CharField, FileField, Form, ModelChoiceField, ModelForm,
)
from django.forms.models import ModelFormMetaclass
from d... | bsd-3-clause |
alqfahad/odoo | addons/mrp_byproduct/__openerp__.py | 259 | 1819 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
DistrictDataLabs/django-data-product | irisfinder/views.py | 1 | 1948 | from django.shortcuts import render
import datetime
from models import Iris, SVMModels
from forms import UserIrisData
import sklearn
from sklearn import svm
from sklearn.cross_validation import train_test_split
import numpy as np
from django.conf import settings
import cPickle
import scipy
from pytz import timezone
imp... | apache-2.0 |
albertrdixon/CouchPotatoServer | libs/CodernityDB/rr_cache.py | 82 | 3673 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.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/licenses/L... | gpl-3.0 |
linux-shield/kernel | tools/perf/scripts/python/syscall-counts-by-pid.py | 1996 | 2105 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
tarsqi/ttk | docmodel/docstructure_parser.py | 1 | 3957 | """Document Structure Parser.
This module contains a minimal document structure parser. It is meant as a
temporary default and will be replaced by more sophisticated parsers and these
parsers will act more like the other tarsqi components.
The main goal of the parser is to add docelement tags to the tag repository on... | apache-2.0 |
KaiRo-at/socorro | socorro/unittest/external/es/base.py | 2 | 29371 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import mock
import random
import uuid
from distutils.version import LooseVersion
from functools import wraps
from elast... | mpl-2.0 |
crossbridge-community/avmplus | test/performance/runtests.py | 5 | 53768 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- Mode: Python; indent-tabs-mode: nil; tab-width: 4 -*-
# vi: set ts=4 sw=4 expandtab: (add to ~/.vimrc: set modeline modelines=5)
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this... | mpl-2.0 |
andnovar/kivy | kivy/adapters/adapter.py | 44 | 5525 | '''
Adapter
=======
.. versionadded:: 1.5
.. warning::
This code is still experimental, and its API is subject to change in a
future version.
An :class:`~kivy.adapters.adapter.Adapter` is a bridge between data and
an :class:`~kivy.uix.abstractview.AbstractView` or one of its subclasses, such
as a :class:`~k... | mit |
dahlstrom-g/intellij-community | python/helpers/pydev/_pydev_imps/_pydev_BaseHTTPServer.py | 14 | 22563 | """HTTP server base class.
Note: the class in this module doesn't implement any HTTP request; see
SimpleHTTPServer for simple implementations of GET, HEAD and POST
(including CGI scripts). It does, however, optionally implement HTTP/1.1
persistent connections, as of version 0.3.
Contents:
- BaseHTTPRequestHandler: ... | apache-2.0 |
amitdeutsch/oppia | core/domain/user_jobs_one_off_test.py | 1 | 24075 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
jnishi/chainer | tests/chainer_tests/functions_tests/array_tests/test_copy.py | 4 | 3409 | import unittest
import numpy
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
def _to_gpu(x, device_id):
if device_id >= 0:
return cuda.to_gpu(x, device_id)
else:
re... | mit |
groovecoder/kuma | vendor/packages/pygments/lexers/factor.py | 72 | 17864 | # -*- coding: utf-8 -*-
"""
pygments.lexers.factor
~~~~~~~~~~~~~~~~~~~~~~
Lexers for the Factor language.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, default, words
from ... | mpl-2.0 |
dreispt/project-service | project_issue_reassign/__openerp__.py | 7 | 1411 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013 Daniel Reis
#
# 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... | agpl-3.0 |
Jmainguy/ansible-modules-core | utilities/logic/pause.py | 35 | 2321 | # -*- mode: python -*-
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distr... | gpl-3.0 |
Edraak/edraak-platform | openedx/core/djangoapps/content/course_structures/management/commands/generate_course_structure.py | 13 | 2300 | """
Django Management Command: Generate Course Structure
Generates and stores course structure information for one or more courses.
"""
import logging
from django.core.management.base import BaseCommand
from opaque_keys.edx.keys import CourseKey
from six import text_type
from openedx.core.djangoapps.content.course_s... | agpl-3.0 |
yongshengwang/hue | build/env/lib/python2.7/site-packages/pip/_vendor/progress/bar.py | 404 | 2707 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS P... | apache-2.0 |
gautamMalu/linux-samsung-arndale-xen | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
mafagafogigante/scripts | docdist.py | 1 | 1991 | #!/usr/bin/env python3
import argparse
import collections
import string
def make_punctuation_translation_table():
# It is safer to replace punctuation by spaces as it prevents merging incorrectly separated words together.
return str.maketrans(string.punctuation, ' ' * len(string.punctuation))
def count_wor... | bsd-2-clause |
android-ia/platform_external_chromium_org | tools/deep_memory_profiler/lib/sorter.py | 100 | 14314 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import cStringIO
import json
import logging
import os
import re
from lib.ordered_dict import OrderedDict
LOGGER = logging.getLogger('dmprof')
BASE_PATH =... | bsd-3-clause |
3dfxmadscientist/odoo_vi | openerp/tools/amount_to_text_en.py | 441 | 5103 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
pfmoore/invoke | invoke/platform.py | 1 | 5500 | """
Platform-specific code lives here.
This is its own module to abstract away what would otherwise be distracting
logic-flow interruptions.
"""
from contextlib import contextmanager
import select
import sys
# TODO: move in here? They're currently platform-agnostic...
from .util import has_fileno, isatty
WINDOWS =... | bsd-2-clause |
ity/pants | contrib/android/tests/python/pants_test/contrib/android/test_android_base.py | 14 | 5335 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import tex... | apache-2.0 |
vincent-tr/rpi-js-os | ext/libcxx-5.0/libcxx/utils/libcxx/sym_check/extract.py | 8 | 6392 | # -*- Python -*- vim: set syntax=python tabstop=4 expandtab cc=80:
#===----------------------------------------------------------------------===##
#
# The LLVM Compiler Infrastructure
#
# This file is dual licensed under the MIT and the University of Illinois Open
# Source Licenses. See LICENSE.TXT ... | gpl-3.0 |
praemdonck/micropython | tests/basics/int_big_and3.py | 61 | 2185 | # test - +
print( -97989513389222316022151446562729620153292831887555425160965597396
& 23716683549865351578586448630079789776107310103486834795830390982)
print( -53817081128841898634258263553430908085326601592682411889506742059
& 37042558948907407488299113387826240429667200950043601129661240876)
print( -2... | mit |
resmo/ansible | test/units/modules/cloud/linode_v4/test_linode_v4.py | 59 | 9814 | from __future__ import (absolute_import, division, print_function)
import json
import os
import sys
import pytest
linode_apiv4 = pytest.importorskip('linode_api4')
mandatory_py_version = pytest.mark.skipif(
sys.version_info < (2, 7),
reason='The linode_api4 dependency requires python2.7 or higher'
)
from li... | gpl-3.0 |
HydrelioxGitHub/home-assistant | homeassistant/components/bloomsky/__init__.py | 10 | 2243 | """Support for BloomSky weather station."""
from datetime import timedelta
import logging
from aiohttp.hdrs import AUTHORIZATION
import requests
import voluptuous as vol
from homeassistant.const import CONF_API_KEY
from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as cv
from h... | apache-2.0 |
peiyuwang/pants | src/python/pants/build_graph/intermediate_target_factory.py | 5 | 2572 | # coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from hashlib import ... | apache-2.0 |
projectcalico/calico-nova | nova/api/openstack/compute/plugins/v3/server_groups.py | 6 | 6218 | # Copyright (c) 2014 Cisco Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | apache-2.0 |
matthew-brett/pyblio | Pyblio/ConfDir/GnomeUI.py | 2 | 1944 | from Pyblio import Config, Fields
from Pyblio.GnomeUI import Utils, Editor
import gtk
Config.define ('gnomeui/default', """ Graphical description of the
default field. """)
Config.define ('gnomeui/monospaced', """ A monospaced font, for native edition """)
def _text_get ():
v = Config.get ('base/fields').data
... | gpl-2.0 |
ndardenne/pymatgen | pymatgen/io/abinit/tasks.py | 2 | 166549 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""This module provides functions and classes related to Task objects."""
from __future__ import division, print_function, unicode_literals, absolute_import
import os
import time
import datetime
import shutil
i... | mit |
QuLogic/iris | lib/iris/tests/unit/analysis/cartography/test__quadrant_area.py | 6 | 5433 | # (C) British Crown Copyright 2014 - 2017, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | gpl-3.0 |
sorenk/ansible | lib/ansible/plugins/lookup/password.py | 20 | 12097 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2013, Javier Candeira <javier@candeira.com>
# (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, divisio... | gpl-3.0 |
stdweird/aquilon | lib/python2.6/aquilon/worker/commands/show_dns_domain_dns_domain.py | 2 | 1383 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2013 Contributor
#
# 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 t... | apache-2.0 |
gunzy83/ansible-modules-extras | network/wakeonlan.py | 28 | 3882 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Dag Wieers <dag@wieers.com>
#
# This file is part of Ansible
#
# Ansible 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, ... | gpl-3.0 |
ivanprjcts/equinox-spring16-API | makesdks/swagger_reader.py | 1 | 1557 | import os
import json
from sdklib.util.urlvalidator import urlsplit
class SwaggerReader(object):
def __init__(self, folder):
files = os.listdir(folder)
self.apis = []
for file_elem in files:
print '%s/%s' % (folder, file_elem)
f = open('%s/%s' % (folder, file_el... | lgpl-3.0 |
braingram/pysump | sump/interface.py | 1 | 10286 | #!/usr/bin/env python
# import sys
import logging
import struct
import serial
from . import errors
from . import fio
from . import ops
# import settings this as settings_module to avoid name conflicts
from . import settings as settings_module
logger = logging.getLogger(__name__)
logger.addHandler(logging.StreamHan... | gpl-3.0 |
vmalloc/dessert | tests/test_dessert.py | 1 | 3611 | from _pytest.assertion.rewrite import AssertionRewritingHook as PytestRewriteHook
import os
import shutil
import sys
from contextlib import contextmanager
from tempfile import mkdtemp
import emport
import dessert
import pytest
def test_dessert(module):
with pytest.raises(AssertionError) as error:
module... | mit |
wpoa/wiki-imports | lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/langbulgarianmodel.py | 2965 | 12784 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
oculusstorystudio/kraken | Python/kraken/plugins/canvas_plugin/graph_manager.py | 1 | 20242 | """Kraken Canvas - Canvas Graph Manager module.
Classes:
GraphManager -- Node management.
"""
import json
from kraken.core.kraken_system import ks
# import FabricEngine.Core as core
class GraphManager(object):
"""Manager object for taking care of all low level Canvas tasks"""
__dfgHost = None
__dfgBi... | bsd-3-clause |
timsnyder/bokeh | bokeh/util/tests/test_compiler.py | 1 | 7783 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bsd-3-clause |
i-maravic/ns-3 | src/buildings/doc/source/conf.py | 175 | 7083 | # -*- coding: utf-8 -*-
#
# ns-3 documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 14 09:00:39 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All co... | gpl-2.0 |
coronary/RandomEpisode | depends/Lib/site-packages/requests/utils.py | 618 | 21334 | # -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import cgi
import codecs
import collections
import io
import os
import platform
import re
import sys
import socket
import struct
import wa... | mit |
Volvagia356/pixiv-downloader | pixivdl-gui.py | 1 | 8165 | #!/usr/bin/env python
import os,sys
import pickle
import threading
from Queue import Queue
from pixiv_api import Pixiv
import pixivdl
import Tkinter
import ttk
import tkFileDialog
import tkMessageBox
class Application(Tkinter.Frame):
def __init__(self,master=None):
Tkinter.Frame.__init__(self,master)
... | bsd-3-clause |
YongseopKim/crosswalk-test-suite | webapi/tct-download-tizen-tests/inst.wgt.py | 294 | 6758 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=... | bsd-3-clause |
mbayon/TFG-MachineLearning | vbig/lib/python2.7/site-packages/numpy/linalg/tests/test_regression.py | 50 | 5414 | """ Test functions for linalg module
"""
from __future__ import division, absolute_import, print_function
import warnings
import numpy as np
from numpy import linalg, arange, float64, array, dot, transpose
from numpy.testing import (
TestCase, run_module_suite, assert_equal, assert_array_equal,
assert_array_a... | mit |
yury-s/v8-inspector | Source/chrome/tools/gyp/test/hello/gyptest-regyp-output.py | 202 | 1077 | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that Makefiles get rebuilt when a source gyp file changes and
--generator-output is used.
"""
import TestGyp
# Regenerating b... | bsd-3-clause |
aronsky/home-assistant | homeassistant/components/light/mqtt_template.py | 3 | 14398 | """
Support for MQTT Template lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.mqtt_template/
"""
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components import mqtt
from homeassistant.co... | apache-2.0 |
s0930342674/pyload | module/lib/Getch.py | 43 | 2048 | class Getch:
"""
Gets a single character from standard input. Does not echo to
the screen.
"""
def __init__(self):
try:
self.impl = _GetchWindows()
except ImportError:
try:
self.impl = _GetchMacCarbon()
except(AttributeError, Impo... | gpl-3.0 |
mquandalle/rethinkdb | external/v8_3.30.33.16/build/gyp/test/win/gyptest-link-restat-importlib.py | 218 | 1219 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Make sure we don't cause unnecessary builds due to import libs appearing
to be out of date.
"""
import TestGyp
import sys
import time
... | agpl-3.0 |
mikebrevard/UnixAdministration | deliverables/Extra Credit/etc/data/genData/venv/lib/python3.4/site-packages/pip/_vendor/distlib/markers.py | 1261 | 6282 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Parser for the environment markers micro-language defined in PEP 345."""
import ast
import os
import sys
import platform
from .compa... | mit |
nicproulx/mne-python | mne/realtime/client.py | 3 | 10948 | # Authors: Christoph Dinh <chdinh@nmr.mgh.harvard.edu>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
from __future__ import print_function
import socket
import time
from ..externals.six.moves import StringIO
import threading
i... | bsd-3-clause |
savi-dev/quantum | quantum/plugins/cisco/nova/quantum_port_aware_scheduler.py | 1 | 4417 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache... | apache-2.0 |
piquadrat/django | tests/admin_inlines/tests.py | 17 | 44526 | from django.contrib.admin import ModelAdmin, TabularInline
from django.contrib.admin.helpers import InlineAdminForm
from django.contrib.admin.tests import AdminSeleniumTestCase
from django.contrib.auth.models import Permission, User
from django.contrib.contenttypes.models import ContentType
from django.test import Requ... | bsd-3-clause |
dmlux/UZLMathLib | gtest-1.7.0/xcode/Scripts/versiongenerate.py | 3088 | 4536 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
ol-loginov/intellij-community | python/lib/Lib/site-packages/django/conf/locale/ka/formats.py | 329 | 1888 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'l, j F, Y'
TIME_FORMAT = 'h:i:s a'
DATETIME_FORMAT = 'j F, Y h:i:s a'
YEA... | apache-2.0 |
zsdonghao/tensorlayer | tensorlayer/models/mobilenetv1.py | 1 | 7772 | #! /usr/bin/python
# -*- coding: utf-8 -*-
"""MobileNet for ImageNet."""
import os
import tensorflow as tf
from tensorlayer import logging
from tensorlayer.layers import Layer
from tensorlayer.layers import BatchNormLayer
from tensorlayer.layers import Conv2d
from tensorlayer.layers import DepthwiseConv2d
from tens... | apache-2.0 |
alikins/func-alikins-devel | test/unittest/test_groups_api.py | 4 | 16987 | from func.overlord.groups import Groups,get_hosts_spec
from certmaster.config import read_config, CONFIG_FILE
from certmaster.commonconfig import CMConfig
import os
import fnmatch
from func.overlord.group.conf_backend import ConfBackend
from func.overlord.group.sqlite_backend import SqliteBackend
TEST_DB_FILE... | gpl-2.0 |
babble/babble | include/jython/Lib/test/test_platform.py | 19 | 1883 | import unittest
from test import test_support
import platform
class PlatformTest(unittest.TestCase):
def test_architecture(self):
res = platform.architecture()
def test_machine(self):
res = platform.machine()
def test_node(self):
res = platform.node()
def test_platform(self):... | apache-2.0 |
CPFDSoftware-Tony/gmv | utils/Mesa/Mesa-7.8.2/src/gallium/drivers/svga/svgadump/svga_dump.py | 50 | 11879 | #!/usr/bin/env python
'''
Generates dumper for the SVGA 3D command stream using pygccxml.
Jose Fonseca <jfonseca@vmware.com>
'''
copyright = '''
/**********************************************************
* Copyright 2009 VMware, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any p... | gpl-3.0 |
silly-wacky-3-town-toon/SOURCE-COD | Panda3D-1.10.0/python/Lib/curses/ascii.py | 396 | 2607 | """Constants and membership tests for ASCII characters"""
NUL = 0x00 # ^@
SOH = 0x01 # ^A
STX = 0x02 # ^B
ETX = 0x03 # ^C
EOT = 0x04 # ^D
ENQ = 0x05 # ^E
ACK = 0x06 # ^F
BEL = 0x07 # ^G
BS = 0x08 # ^H
TAB = 0x09 # ^I
HT = 0x09 # ^I
LF = 0x0a # ^J
NL =... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.