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 |
|---|---|---|---|---|---|
andy-sweet/fcdiff | doc/drawio.py | 1 | 1945 | #!/usr/bin/python
import os
import subprocess as sp
import shutil as sh
import argparse
parser = argparse.ArgumentParser(
description = 'Copies and converts drawio XML and PDF files from Dropbox'
)
parser.add_argument('-s', '--src_dir',
help = 'The src directory containing the drawio XML and PDF files',
d... | mit |
saurabh6790/test_final_med_lib | core/page/messages/messages.py | 18 | 3265 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import webnotes
@webnotes.whitelist()
def get_list(arg=None):
"""get list of messages"""
webnotes.form_dict['limit_start'] = int(webnotes.form_dict['limit_start'])
webnotes... | mit |
dbentley/pants | src/python/pants/core_tasks/targets_help.py | 17 | 1576 | # coding=utf-8
# Copyright 2015 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 colors import b... | apache-2.0 |
sebrandon1/tempest | tempest/api/compute/admin/test_keypairs_v210.py | 5 | 3464 | # Copyright 2016 NEC Corporation.
# 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... | apache-2.0 |
zaclimon/android_kernel_samsung_palladio | tools/perf/scripts/python/failed-syscalls-by-pid.py | 944 | 1869 | # failed 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 failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
mdworks2016/work_development | Python/05_FirstPython/Chapter9_WebApp/fppython_develop/lib/python3.7/site-packages/pip/_vendor/progress/__init__.py | 24 | 3188 | # 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 PROVIDED "AS IS" AND THE A... | apache-2.0 |
crimsonthunder/morfic_n4 | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
tijptjik/thegodsproject | plugins/pelican_comment_system/avatars.py | 43 | 2663 | # -*- coding: utf-8 -*-
"""
Author: Bernhard Scheirle
"""
from __future__ import unicode_literals
import logging
import os
import hashlib
logger = logging.getLogger(__name__)
_log = "pelican_comment_system: avatars: "
try:
from . identicon import identicon
_identiconImported = True
except ImportError as e:... | mit |
alzamer2/crunchy-xml-decoder | crunchy-xml-decoder-old/crunchy-xml-decoder/requests/packages/urllib3/util/url.py | 82 | 4402 | from collections import namedtuple
from ..exceptions import LocationParseError
url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment']
class Url(namedtuple('Url', url_attrs)):
"""
Datastructure for representing an HTTP URL. Used as a return value for
:func:`parse_url`.
"""
s... | gpl-2.0 |
fpy171/django | tests/foreign_object/models/empty_join.py | 97 | 3211 | from django.db import models
from django.db.models.fields.related import (
ForeignObjectRel, ReverseManyToOneDescriptor,
)
from django.db.models.lookups import StartsWith
from django.db.models.query_utils import PathInfo
from django.utils.encoding import python_2_unicode_compatible
class CustomForeignObjectRel(Fo... | bsd-3-clause |
nhenezi/kuma | vendor/packages/nose/setup3lib.py | 10 | 5392 | import sys
from setuptools import setup as _setup
py3_args = ['use_2to3', 'convert_2to3_doctests', 'use_2to3_fixers', 'test_dirs', 'test_build_dir', 'doctest_exts', 'pyversion_patching']
if sys.version_info < (3,):
# Remove any Python-3.x-only arguments (so they don't generate complaints
# from 2.x setuptools... | mpl-2.0 |
cloudbase/nova-virtualbox | nova/cells/filters/image_properties.py | 61 | 2516 | # Copyright (c) 2012-2013 Rackspace Hosting
# 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
#
# Unles... | apache-2.0 |
citrix-openstack-build/nova | nova/servicegroup/api.py | 13 | 5760 | # Copyright 2012 IBM Corp.
# Copyright (c) AT&T Labs Inc. 2012 Yun Mao <yunmao@gmail.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/LICENSE-2.0
#
#... | apache-2.0 |
sridevikoushik31/openstack | nova/network/floating_ips.py | 7 | 32059 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (t... | apache-2.0 |
smartforceplus/SmartForceplus | addons/payment_paypal/models/res_company.py | 422 | 1752 | # -*- coding: utf-8 -*-
from openerp.osv import fields, osv
class ResCompany(osv.Model):
_inherit = "res.company"
def _get_paypal_account(self, cr, uid, ids, name, arg, context=None):
Acquirer = self.pool['payment.acquirer']
company_id = self.pool['res.users'].browse(cr, uid, uid, context=co... | agpl-3.0 |
gspilio/nova | nova/api/openstack/compute/contrib/console_output.py | 3 | 3349 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
# Copyright 2011 Grid Dynamics
# Copyright 2011 Eldar Nugaev, Kirill Shileev, Ilya Alekseyev
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You... | apache-2.0 |
sillvan/hyperspy | hyperspy/model.py | 1 | 78500 | # -*- coding: utf-8 -*-
# Copyright 2007-2011 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | gpl-3.0 |
cysnake4713/account-financial-tools | account_asset_management/wizard/account_asset_change_duration.py | 35 | 5353 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
#
# This program is ... | agpl-3.0 |
darkwing/kuma | kuma/search/tests/test_utils.py | 22 | 2612 | from __future__ import absolute_import
from nose.tools import eq_, ok_
from kuma.core.tests import KumaTestCase
from ..store import referrer_url
from ..utils import QueryURLObject
class URLTests(KumaTestCase):
def test_pop_query_param(self):
original = 'http://example.com/?spam=eggs'
url = Quer... | mpl-2.0 |
frouty/odoogoeen | addons/document_page/__init__.py | 55 | 1090 | # -*- 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... | agpl-3.0 |
40223148/2015cda_g5 | static/Brython3.1.0-20150301-090019/Lib/browser/markdown.py | 623 | 13060 | # -*- coding: utf-8 -*-
try:
import _jsre as re
except:
import re
import random
import time
letters = 'abcdefghijklmnopqrstuvwxyz'
letters += letters.upper()+'0123456789'
class URL:
def __init__(self,src):
elts = src.split(maxsplit=1)
self.href = elts[0]
self.alt = ''
if ... | gpl-3.0 |
kingctan/oppia | core/domain/rule_domain.py | 5 | 7797 | # 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 |
justingrayston/jaikuengine | common/test/notification.py | 30 | 24050 | # Copyright 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
nazo/ansible | lib/ansible/modules/network/cumulus/_cl_interface.py | 49 | 15168 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.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... | gpl-3.0 |
mrbox/django | tests/null_queries/tests.py | 36 | 2939 | from __future__ import unicode_literals
from django.core.exceptions import FieldError
from django.test import TestCase
from .models import Choice, Inner, OuterA, OuterB, Poll
class NullQueriesTests(TestCase):
def test_none_as_null(self):
"""
Regression test for the use of None as a query value.... | bsd-3-clause |
Warvito/DeepLearningTutorials | code/logistic_sgd.py | 36 | 17006 | """
This tutorial introduces logistic regression using Theano and stochastic
gradient descent.
Logistic regression is a probabilistic, linear classifier. It is parametrized
by a weight matrix :math:`W` and a bias vector :math:`b`. Classification is
done by projecting data points onto a set of hyperplanes, the distance... | bsd-3-clause |
jbarcia/weevely3 | core/channels/stegaref/formatters.py | 13 | 5118 | import random
import urlparse
import string
import urllib
import utils
from core import messages
class FirstRefererFormat:
def __init__(self, url):
self.url = url
self.chunks_sizes = []
def target_name(self):
parsed_url = urlparse.urlparse(self.url)
if parsed_url.netloc:
... | gpl-3.0 |
JASONews/centinel | centinel/primitives/tls.py | 3 | 4560 | # Dependencies: install M2Crypto with sudo apt-get install
# python-m2crypto
import logging
try:
import M2Crypto
m2crypto_imported = True
except ImportError:
logging.warning("M2Crypto could not be imported. "
"TLS fingerprinting will be disabled.")
m2crypto_imported = False
import... | mit |
kvar/ansible | lib/ansible/modules/windows/win_eventlog_entry.py | 38 | 2212 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Andrew Saraceni <andrew.saraceni@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'suppo... | gpl-3.0 |
slohse/ansible | lib/ansible/plugins/terminal/dellos10.py | 125 | 2767 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Copyright (c) 2017 Dell Inc.
#
# 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) an... | gpl-3.0 |
ckuethe/gnuradio | gr-qtgui/apps/plot_spectrogram_base.py | 40 | 5607 | #!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... | gpl-3.0 |
CourseTalk/edx-platform | openedx/core/djangolib/tests/test_markup.py | 2 | 2513 | # -*- coding: utf-8 -*-
"""
Tests for openedx.core.djangolib.markup
"""
import unittest
import ddt
from django.utils.translation import ugettext as _, ungettext
from mako.template import Template
from openedx.core.djangolib.markup import Text, HTML
@ddt.ddt
class FormatHtmlTest(unittest.TestCase):
"""Test that... | agpl-3.0 |
devops2014/djangosite | django/contrib/gis/gdal/raster/band.py | 99 | 1860 | from ctypes import byref, c_int
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.prototypes import raster as capi
from django.utils.encoding import force_text
from .const import GDAL_PIXEL_TYPES
class GDALBand(GDALBase):
"""
Wraps a GDAL raster band, needs to be obtained from a... | bsd-3-clause |
torresj/practica-3 | Código/tiposCafes.py | 1 | 18836 | /*
Esta archivo pertenece a la aplicación "practica 3" bajo licencia GPLv2.
Copyright (C) 2014 Jaime Torres Benavente.
Este programa es software libre. Puede redistribuirlo y/o modificarlo bajo los términos
de la Licencia Pública General de GNU según es publicada por la Free Software Foundation,
bien de l... | gpl-2.0 |
supersven/intellij-community | python/lib/Lib/email/Message.py | 92 | 30220 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Basic message object for the email package object model."""
__all__ = ['Message']
import re
import uu
import binascii
import warnings
from cStringIO import StringIO
# Intrapackage imports
import email.char... | apache-2.0 |
overtherain/scriptfile | software/googleAppEngine/lib/django_1_3/django/conf/locale/id/formats.py | 355 | 1818 | # -*- 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 = 'j N Y'
DATETIME_FORMAT = "j N Y, G.i.s"
TIME_FORMAT = 'G.i.s'
YEAR_MONTH_... | mit |
huiyiqun/check_mk | tests/pylint/test_pylint_inventory_plugins.py | 1 | 1622 | #!/usr/bin/python
# encoding: utf-8
import os
import sys
from testlib import repo_path
import testlib.pylint_cmk as pylint_cmk
def test_pylint_inventory_plugins(pylint_test_dir):
f = file(pylint_test_dir + "/cmk-inventory-plugins.py", "w")
# Fake data structures where checks register (See cmk_base/checks.py)... | gpl-2.0 |
qtekfun/htcDesire820Kernel | external/chromium/chrome/common/extensions/docs/examples/apps/hello-python/httplib2/__init__.py | 451 | 51082 | from __future__ import generators
"""
httplib2
A caching http interface that supports ETags and gzip
to conserve bandwidth.
Requires Python 2.3 or later
Changelog:
2007-08-18, Rick: Modified so it's able to use a socks proxy if needed.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyrigh... | gpl-2.0 |
xen0l/ansible | lib/ansible/plugins/callback/profile_tasks.py | 29 | 6396 | # (C) 2016, Joel, https://github.com/jjshoe
# (C) 2015, Tom Paine, <github@aioue.net>
# (C) 2014, Jharrod LaFon, @JharrodLaFon
# (C) 2012-2013, Michael DeHaan, <michael.dehaan@gmail.com>
# (C) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make codin... | gpl-3.0 |
p990-slimrom/platform_external_chromium | testing/gtest/test/gtest_help_test.py | 2968 | 5856 | #!/usr/bin/env python
#
# Copyright 2009, 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 |
sleepinghungry/wwif | basic_game/basic_game_engine.py | 1 | 5705 | from basic_game.descriptors import Descriptor
from basic_game.directions import directions
from basic_game.language import list_prefix, normalize_input, get_noun, prepositions
from basic_game.objects import Container
from basic_game.writer import DEBUG, ConsoleWriter
from basic_game.verbs import BaseVerb
class BasicGa... | mit |
scs/uclinux | user/python/python-2.4.4/Lib/timeit.py | 19 | 10246 | #! /usr/bin/env python
"""Tool for measuring execution time of small code snippets.
This module avoids a number of common traps for measuring execution
times. See also Tim Peters' introduction to the Algorithms chapter in
the Python Cookbook, published by O'Reilly.
Library usage: see the Timer class.
Command line ... | gpl-2.0 |
youprofit/NewsBlur | apps/reader/migrations/0009_drop_user_story.py | 18 | 9757 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'UserStory', fields ['user', 'feed', 'story']
db.delete_unique('reader_use... | mit |
AICP/external_chromium_org | tools/telemetry/telemetry/unittest/tab_test_case.py | 9 | 1988 | # Copyright 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.
import os
import unittest
from telemetry.core import browser_finder
from telemetry.core import util
from telemetry.unittest import options_for_unittests
c... | bsd-3-clause |
zstyblik/infernal-twin | build/pillow/build/lib.linux-i686-2.7/PIL/DcxImagePlugin.py | 26 | 1975 | #
# The Python Imaging Library.
# $Id$
#
# DCX file handling
#
# DCX is a container file format defined by Intel, commonly used
# for fax applications. Each DCX file consists of a directory
# (a list of file offsets) followed by a set of (usually 1-bit)
# PCX files.
#
# History:
# 1995-09-09 fl Created
# 1996-03-20 ... | gpl-3.0 |
tobegit3hub/deep_cnn | java_predict_client/src/main/proto/tensorflow/python/kernel_tests/sparse_ops_test.py | 10 | 30954 | # Copyright 2015 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 |
Ares42/Guidebox | Flask/flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/mbcsgroupprober.py | 2769 | 1967 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
benhylau/cjdns | node_build/dependencies/libuv/build/gyp/test/msvs/list_excluded/gyptest-all.py | 347 | 1292 | #!/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.
"""
Verifies that msvs_list_excluded_files=0 doesn't list files that would
normally be in _excluded_files, and that if that flag is not set,... | gpl-3.0 |
cloudera-labs/kafka | system_test/utils/kafka_system_test_utils.py | 2 | 118704 | # 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 u... | apache-2.0 |
jhawkesworth/ansible-modules-extras | messaging/rabbitmq_user.py | 65 | 10113 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Chatham Financial <oss@chathamfinancial.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... | gpl-3.0 |
mahak/ansible | test/units/module_utils/basic/test_set_mode_if_different.py | 14 | 6869 | # -*- coding: utf-8 -*-
# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com>
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ =... | gpl-3.0 |
thinkopensolutions/l10n-brazil | financial_account/models/inherited_financial_move.py | 2 | 12735 | # -*- coding: utf-8 -*-
# Copyright 2017 KMEE
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from __future__ import division, print_function, unicode_literals
from odoo import api, fields, models, exceptions, _
from odoo.addons.financial.constants import (
FINANCIAL_DEBT_2PAY,
FINANCIAL_DEBT_... | agpl-3.0 |
tahmid-tanzim/youtube-dl | youtube_dl/extractor/sbs.py | 105 | 1867 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .common import InfoExtractor
class SBSIE(InfoExtractor):
IE_DESC = 'sbs.com.au'
_VALID_URL = r'https?://(?:www\.)?sbs\.com\.au/(?:ondemand|news)/video/(?:single/)?(?P<id>[0-9]+)'
_TESTS = [{
# Original URL is handled by the gen... | unlicense |
j-carpentier/nova | nova/objects/volume_usage.py | 41 | 2570 | # 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 |
MoisesTedeschi/python | Scripts-Python/Modulos-Diversos/python-com-scrapy/Lib/encodings/rot_13.py | 39 | 2448 | #!/usr/bin/env python
""" Python Character Mapping Codec for ROT13.
This codec de/encodes from str to str.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self, input, errors='strict'):
return (str.translate(input, rot13_map), len(... | gpl-3.0 |
ardydedase/httpie | httpie/context.py | 48 | 2652 | import sys
from httpie.compat import is_windows
from httpie.config import DEFAULT_CONFIG_DIR, Config
class Environment(object):
"""
Information about the execution context
(standard streams, config directory, etc).
By default, it represents the actual environment.
All of the attributes can be ov... | bsd-3-clause |
desihub/desitarget | py/desitarget/train/data_collection/sweep_meta.py | 1 | 2600 | #!/usr/bin/env python
import sys
import subprocess
import numpy as np
import astropy.io.fits as fits
def sweep_meta(release, outfits):
if (release == 'dr3'):
sweepdir = '/global/project/projectdirs/cosmo/data/legacysurvey/dr3/sweep/3.1'
if (release == 'dr4'):
sweepdir = '/global/p... | bsd-3-clause |
steedos/odoo | addons/hr_timesheet_sheet/__init__.py | 434 | 1127 | # -*- 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... | agpl-3.0 |
drawks/ansible | lib/ansible/modules/cloud/ovirt/ovirt_tag_facts.py | 55 | 4848 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, 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
#... | gpl-3.0 |
moxon6/chemlab | build/lib.win32-3.4/chemlab/core/spacegroup/cell.py | 7 | 3424 | # Copyright (C) 2010, Jesper Friis
# (see accompanying license files for details).
import numpy as np
from numpy import pi, sin, cos, tan, arcsin, arccos, arctan, sqrt
from numpy import dot
from numpy.linalg import norm
__all__ = ['cell_to_cellpar', 'cellpar_to_cell', 'metric_from_cell']
def unit_vector(x):
""... | gpl-3.0 |
hos7ein/firewalld | src/firewall/core/fw_icmptype.py | 3 | 2840 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2016 Red Hat, Inc.
#
# Authors:
# Thomas Woerner <twoerner@redhat.com>
#
# This program 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 2 of the Li... | gpl-2.0 |
generia/plugin.video.zdf_de_2016 | de/generia/kodi/plugin/frontend/zdf/AbstractPage.py | 1 | 3319 | from de.generia.kodi.plugin.frontend.base.Pagelet import Item
from de.generia.kodi.plugin.frontend.base.Pagelet import Action
from de.generia.kodi.plugin.frontend.base.Pagelet import Pagelet
from de.generia.kodi.plugin.frontend.zdf.Constants import Constants
class AbstractPage(Pagelet):
... | gpl-2.0 |
jinzekid/codehub | python/test_gui/TaskManager/TaskManager.py | 1 | 2820 | # Author: Jason Lu
import _thread as thread, time
import threading
from MyWindow import Ui_MainWindow as MainWindow
from PyQt5.QtCore import QThread, pyqtSignal, QObject, QDateTime
import LYUtils as utils
# 单例模式
# 使用__new__方法
class Singleton(object):
def __new__(cls, *args, **kwargs):
if not hasattr(cls, ... | gpl-3.0 |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/python2.7/dummy_threading.py | 321 | 2804 | """Faux ``threading`` version using ``dummy_thread`` instead of ``thread``.
The module ``_dummy_threading`` is added to ``sys.modules`` in order
to not have ``threading`` considered imported. Had ``threading`` been
directly imported it would have made all subsequent imports succeed
regardless of whether ``thread`` wa... | gpl-2.0 |
pratikmallya/hue | desktop/core/ext-py/Django-1.6.10/tests/reverse_lookup/tests.py | 150 | 1687 | from __future__ import absolute_import
from django.core.exceptions import FieldError
from django.test import TestCase
from .models import User, Poll, Choice
class ReverseLookupTests(TestCase):
def setUp(self):
john = User.objects.create(name="John Doe")
jim = User.objects.create(name="Jim Bo")
... | apache-2.0 |
junwucs/h2o-3 | h2o-py/h2o/expr.py | 3 | 2578 | import h2o
import math
class ExprNode:
""" Composable Expressions: This module contains code for the lazy expression DAG. """
def __init__(self,op,*args):
self._op=op # unary/binary/prefix op
self._children=[ExprNode._arg_to_expr(a) for a in args] # a list of ExprNode instances; the child... | apache-2.0 |
azumimuo/family-xbmc-addon | script.module.youtube.dl/lib/youtube_dl/extractor/gdcvault.py | 27 | 6692 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
HEADRequest,
sanitized_Request,
urlencode_postdata,
)
class GDCVaultIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?gdcvault\.com/play/(?P<id>\d+)/(?P<name>(\w|-)+)?'
_NETRC_MACHINE = '... | gpl-2.0 |
helldorado/ansible | lib/ansible/modules/network/avi/avi_systemconfiguration.py | 31 | 6594 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | gpl-3.0 |
qizenguf/MLC-STT | src/arch/arm/kvm/KvmGic.py | 9 | 2269 | # Copyright (c) 2015, 2017 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the function... | bsd-3-clause |
adamgf/zxing_iphone_pdf_417 | cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/f90.py | 34 | 2039 | """engine.SCons.Tool.f90
Tool-specific initialization for the generic Posix f90 Fortran compiler.
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.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2... | apache-2.0 |
judaba13/GenrePredictor | hdf5_descriptors.py | 1 | 3890 | """
This file is used to define classes that hold data for reading from the HDF5 files for MSD
This code was provided by the MSD distributors to read the data.
Thierry Bertin-Mahieux (2010) Columbia University
tb2332@columbia.edu
This code contains descriptors used to create HDF5 files
for the Million Song Database Pr... | apache-2.0 |
mkai/django-storages | examples/s3project/tests.py | 33 | 5146 | """
=================
Django S3 storage
=================
Usage
=====
Settings
--------
``DEFAULT_FILE_STORAGE``
~~~~~~~~~~~~~~~~~~~~~~~~
This setting store the path to the S3 storage class, the first part correspond
to the filepath and the second the name of the class, if you've got
``example.com`` in your ``PYTHO... | bsd-3-clause |
tobegit3hub/cinder_docker | cinder/brick/local_dev/lvm.py | 1 | 30594 | # Copyright 2013 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.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
yanchen036/tensorflow | tensorflow/examples/learn/text_classification_character_rnn.py | 38 | 4036 | # Copyright 2016 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 appl... | apache-2.0 |
halflings/receval | receval/metrics.py | 1 | 6033 | """
Metrics used to evaluate recommendations.
Shamelessly copied from bwhite's gist:
https://gist.github.com/bwhite/3726239
"""
import numpy as np
def reciprocal_rank(r):
"""Score is reciprocal of the rank of the first relevant item
First element is 'rank 1'. Relevance is binary (nonzero is relev... | apache-2.0 |
goliate/sarakha63-persomov | couchpotato/core/notifications/xmpp_.py | 96 | 2910 | from time import sleep
import traceback
from couchpotato.core.logger import CPLog
from couchpotato.core.notifications.base import Notification
import xmpp
log = CPLog(__name__)
autoload = 'Xmpp'
class Xmpp(Notification):
def notify(self, message = '', data = None, listener = None):
if not data: data ... | gpl-3.0 |
Antiun/bank-statement-reconcile | account_statement_transactionid_completion/statement.py | 15 | 7700 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Joel Grand-Guillaume
# Copyright 2011-2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... | agpl-3.0 |
ludmilamarian/invenio | invenio/ext/assets/__init__.py | 22 | 1989 | # -*- coding: utf-8 -*-
# This file is part of Invenio.
# Copyright (C) 2012, 2013, 2014, 2015 CERN.
#
# Invenio 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 2 of the
# License, or (at your o... | gpl-2.0 |
meh/servo | tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/mux.py | 636 | 71218 | # Copyright 2012, 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 of conditions and the f... | mpl-2.0 |
timqian/sms-tools | lectures/5-Sinusoidal-model/plots-code/sineModelAnal-flute.py | 24 | 1179 | import numpy as np
import matplotlib.pyplot as plt
import sys, os, time
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import stft as STFT
import sineModel as SM
import utilFunctions as UF
(fs, x) = UF.wavread(os.path.join(os.path.dirname(os.path.realpath(__fi... | agpl-3.0 |
tudennis/LeetCode---kamyu104-11-24-2015 | Python/repeated-dna-sequences.py | 2 | 1578 | from __future__ import print_function
# Time: O(n)
# Space: O(n)
# All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T,
# for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to identify repeated sequences within the DNA.
#
# Write a function to find all the 10-letter-long seq... | mit |
brandon-rhodes/numpy | numpy/polynomial/tests/test_polyutils.py | 202 | 3094 | """Tests for polyutils module.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import numpy.polynomial.polyutils as pu
from numpy.testing import (
TestCase, assert_almost_equal, assert_raises,
assert_equal, assert_, run_module_suite)
class TestMisc(TestCase):
def... | bsd-3-clause |
mythos234/SimplKernel-LL-BOFJ | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
juliantaylor/scipy | scipy/sparse/linalg/dsolve/umfpack/setup.py | 5 | 1070 | #!/usr/bin/env python
# 05.12.2005, c
# last change: 27.03.2006
from __future__ import division, print_function, absolute_import
def configuration(parent_package='',top_path=None):
import numpy
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info, dict_appen... | bsd-3-clause |
wengpingbo/linux | tools/perf/scripts/python/compaction-times.py | 958 | 7950 | # report time spent in compaction
# Licensed under the terms of the GNU GPL License version 2
# testing:
# 'echo 1 > /proc/sys/vm/compact_memory' to force compaction of all zones
import os
import sys
import re
import signal
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
usage = "usage: perf script report compaction-... | gpl-2.0 |
sodexis/odoo | addons/hr_payroll_account/__init__.py | 433 | 1116 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
Projjol/Fracktal | printrun/rpc.py | 17 | 2711 | # This file is part of the Printrun suite.
#
# Printrun 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.
#
# Printrun is distributed in ... | gpl-3.0 |
proxysh/Safejumper-for-Mac | buildlinux/env64/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/retry.py | 360 | 10664 | from __future__ import absolute_import
import time
import logging
from ..exceptions import (
ConnectTimeoutError,
MaxRetryError,
ProtocolError,
ReadTimeoutError,
ResponseError,
)
from ..packages import six
log = logging.getLogger(__name__)
class Retry(object):
""" Retry configuration.
... | gpl-2.0 |
tumbl3w33d/ansible | lib/ansible/plugins/cache/memory.py | 159 | 1272 | # (c) 2014, Brian Coca, Josh Drake, et al
# (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, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
cache: memory
short_description: RAM ba... | gpl-3.0 |
weichen2046/algorithm-study | algorithms/python/test/unit/sorting/test_insertion_sort.py | 1 | 1255 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
from utils.read_data_file import read_int_array
from sorting.insertion_sort import sort
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
class InsertionSortTester(unittest.TestCase):
# Test sort in default order, i.e., in ascending ... | mit |
guschmue/tensorflow | tensorflow/python/util/deprecation.py | 28 | 17200 | # Copyright 2016 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 |
indashnet/InDashNet.Open.UN2000 | android/external/chromium_org/third_party/protobuf/python/google/protobuf/internal/api_implementation.py | 229 | 3438 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | apache-2.0 |
arun6582/django | tests/view_tests/urls.py | 7 | 3556 | from functools import partial
from os import path
from django.conf.urls import include, url
from django.conf.urls.i18n import i18n_patterns
from django.utils.translation import gettext_lazy as _
from django.views import defaults, i18n, static
from . import views
base_dir = path.dirname(path.abspath(__file__))
media_... | bsd-3-clause |
zeroSteiner/AdvancedHTTPServer | examples/demo.py | 1 | 3045 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# demo.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions ... | bsd-3-clause |
nickgzzjr/sublime-gulp | cross_platform_codecs.py | 1 | 1500 | import sublime
import sys
import re
class CrossPlaformCodecs():
@classmethod
def decode_line(self, line):
line = line.rstrip()
decoded_line = self.force_decode(line) if sys.version_info >= (3, 0) else line
decoded_line = re.sub(r'\033\[(\d{1,2}m|\d\w)', '', str(decoded_line))
re... | mit |
zoni/errbot | setup.py | 2 | 4841 | #!/usr/bin/env python
# This program 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.
#
# This program is distributed in... | gpl-3.0 |
Eddy0402/Environment | vim/ycmd/cpp/ycm/tests/gmock/test/gmock_leak_test.py | 779 | 4384 | #!/usr/bin/env python
#
# Copyright 2009, 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... | gpl-3.0 |
TeamTwisted/external_skia | tools/skp/page_sets/skia_ugamsolutions_desktop.py | 30 | 1252 | # Copyright 2014 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.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesk... | bsd-3-clause |
msabramo/ansible | lib/ansible/parsing/yaml/objects.py | 27 | 4196 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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, or
# (at your option) an... | gpl-3.0 |
qnub/django-cms | cms/south_migrations/0019_public_table_renames.py | 1680 | 20032 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.