repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
eino-makitalo/mezzanine | mezzanine/blog/management/commands/import_rss.py | 34 | 2878 | from __future__ import unicode_literals
from datetime import timedelta
from optparse import make_option
from time import timezone
try:
from urllib.request import urlopen
from urllib.parse import urljoin
except ImportError:
from urllib import urlopen
from urlparse import urljoin
from django.core.manage... | bsd-2-clause |
Lujeni/ansible | lib/ansible/plugins/filter/gcp_kms_filters.py | 21 | 3679 | # (c) 2019, Eric Anderson <eric.sysmin@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Usage:
# vars:
# encrypted_myvar: "{{ var | b64encode | gcp_kms_encrypt(auth_kind='serviceaccount',
# service_account_file='gcp_service_account_file', p... | gpl-3.0 |
ESOedX/edx-platform | openedx/core/djangoapps/credentials/signals.py | 1 | 6507 | """
This file contains signal handlers for credentials-related functionality.
"""
from __future__ import absolute_import
from logging import getLogger
from django.contrib.sites.models import Site
from course_modes.models import CourseMode
from lms.djangoapps.certificates.models import CertificateStatuses, GeneratedC... | agpl-3.0 |
krasin/qemu-counter | scripts/tracetool/backend/ftrace.py | 92 | 1500 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Ftrace built-in backend.
"""
__author__ = "Eiichi Tsukata <eiichi.tsukata.xh@hitachi.com>"
__copyright__ = "Copyright (C) 2013 Hitachi, Ltd."
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajnoczi"
__email__ ... | gpl-2.0 |
dfunckt/django | docs/conf.py | 3 | 12624 | # -*- coding: utf-8 -*-
#
# Django documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 27 09:06:53 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't picklabl... | bsd-3-clause |
vjmac15/Lyilis | lib/youtube_dl/extractor/giantbomb (VJ Washington's conflicted copy 2017-08-29).py | 30 | 2928 | from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
qualities,
unescapeHTML,
)
class GiantBombIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?giantbomb\.com/videos/(?P<display_id>[^/]+)/(?P<id>\d+-... | gpl-3.0 |
lahwaacz/qutebrowser | scripts/asciidoc2html.py | 1 | 10901 | #!/usr/bin/env python3
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... | gpl-3.0 |
wenhuizhang/neutron | neutron/tests/unit/scheduler/test_l3_agent_scheduler.py | 2 | 75328 | # Copyright (c) 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 ... | apache-2.0 |
igordejanovic/textX | tests/functional/regressions/test_issue_80_object_processors.py | 1 | 1738 | from __future__ import unicode_literals
from textx.metamodel import metamodel_from_str
call_counter = 0
grammar1 = """
foo:
'foo' m_formula = Formula
;
Formula:
( values=FormulaExpression values='+' ( values=FormulaExpression)* )
;
FormulaExpression:
values=bar
;
bar:
m_id=/[a-f0-9]+/
;
"""
grammar... | mit |
ppwwyyxx/tensorflow | tensorflow/examples/speech_commands/generate_streaming_test_wav.py | 23 | 11074 | # 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 |
pothosware/gnuradio | gr-digital/python/digital/qa_clock_recovery_mm.py | 45 | 5378 | #!/usr/bin/env python
#
# Copyright 2011-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 optio... | gpl-3.0 |
TheTimmy/spack | var/spack/repos/builtin/packages/easybuild/package.py | 3 | 1703 | ##############################################################################
# Copyright (c) 2017, Kenneth Hoste
#
# This file is part of Spack.
# Created by Kenneth Hoste, kenneth.hoste@gmail.com
#
# For details, see https://github.com/llnl/spack
# Please also see the NOTICE and LICENSE files for our notice and the ... | lgpl-2.1 |
apark263/tensorflow | tensorflow/python/training/session_manager_test.py | 11 | 33665 | # 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 |
jj0hns0n/geonode | scripts/cloud/demo_site.py | 24 | 3716 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
tinloaf/home-assistant | tests/components/test_system_log.py | 1 | 9023 | """Test system log component."""
import logging
from unittest.mock import MagicMock, patch
from homeassistant.core import callback
from homeassistant.bootstrap import async_setup_component
from homeassistant.components import system_log
_LOGGER = logging.getLogger('test_logger')
BASIC_CONFIG = {
'system_log': {
... | apache-2.0 |
wraiden/spacewalk | client/rhel/rhn-client-tools/src/actions/hardware.py | 3 | 1142 | #!/usr/bin/python
# Copyright (c) 1999--2016 Red Hat, Inc. Distributed under GPLv2.
#
# Author: Adrian Likins <alikins@redhat.com>
# imports are a bit weird here to avoid name collions on "harware"
import sys
sys.path.append("/usr/share/rhn/")
from up2date_client import hardware
from up2date_client import up2dateA... | gpl-2.0 |
risicle/django | tests/managers_regress/models.py | 245 | 3566 | """
Various edge-cases for model managers.
"""
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import force_text, python_2_unicode_compatible
class OnlyFred(mo... | bsd-3-clause |
bverburg/CouchPotatoServer | couchpotato/core/media/_base/providers/torrent/hdbits.py | 45 | 4648 | import re
import json
import traceback
from couchpotato.core.helpers.variable import tryInt, getIdentifier
from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.providers.torrent.base import TorrentProvider
log = CPLog(__name__)
class Base(TorrentProvider):
urls = {
'test': 'http... | gpl-3.0 |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/contracts/testing/utils.py | 3 | 1693 | from ..interface import (ContractSyntaxError, describe_value,
ContractNotRespected)
from ..main import parse_contract_string, check_contracts
def check_contracts_ok(contract, value):
if isinstance(contract, str):
contract = [contract]
value = [value]
context = check_co... | agpl-3.0 |
splav/servo | tests/wpt/web-platform-tests/webdriver/tests/element_click/interactability.py | 20 | 3922 | import pytest
from tests.support.asserts import assert_error, assert_success
from tests.support.inline import inline
def element_click(session, element):
return session.transport.send(
"POST", "session/{session_id}/element/{element_id}/click".format(
session_id=session.session_id,
... | mpl-2.0 |
tedi3231/openerp | build/lib/openerp/addons/report_webkit/webkit_report.py | 4 | 14795 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Nicolas Bessi (Camptocamp)
# Contributor(s) : Florent Xicluna (Wingo SA)
#
# WARNING: This program as such is intended... | agpl-3.0 |
yCanta/yCanta | regen_db.py | 1 | 3115 | #!/usr/bin/env python
from webapp.model import Song, Songbook, hub
try: # try c version for speed then fall back to python
import xml.etree.cElementTree as ET
except ImportError:
import xml.etree.ElementTree as ET
import xml.parsers.expat
import webapp.c_utilities as c
from posixpath import *
import turbogears
impo... | unlicense |
Cinntax/home-assistant | homeassistant/components/opengarage/cover.py | 1 | 5524 | """Platform for the opengarage.io cover component."""
import logging
import requests
import voluptuous as vol
from homeassistant.components.cover import (
CoverDevice,
DEVICE_CLASS_GARAGE,
PLATFORM_SCHEMA,
SUPPORT_OPEN,
SUPPORT_CLOSE,
)
from homeassistant.const import (
CONF_NAME,
STATE_CL... | apache-2.0 |
y12uc231/edx-platform | common/djangoapps/monitoring/signals.py | 172 | 4584 | """
Add receivers for django signals, and feed data into the monitoring system.
If a model has a class attribute 'METRIC_TAGS' that is a list of strings,
those fields will be retrieved from the model instance, and added as tags to
the recorded metrics.
"""
from django.db.models.signals import post_save, post_delete,... | agpl-3.0 |
gundalow/ansible-modules-extras | cloud/cloudstack/cs_instance.py | 10 | 36881 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
alon/servo | tests/wpt/css-tests/css-text-3_dev/xhtml1print/support/generate-segment-break-transformation-rules-tests.py | 324 | 4862 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests segment-break-transformation-rules-001 ~ 049 which
cover all possible combinations of characters at two sides of segment breaks.
More specifically, there are seven types of characters involve in these rules:
1. East Asian Full-width (F)... | mpl-2.0 |
lausser/coshsh | tests/test_application_mysql.py | 1 | 3116 | import unittest
import sys
import os
import logging
sys.dont_write_bytecode = True
sys.path.insert(0, os.path.abspath(".."))
#sys.path.insert(0, os.path.abspath(os.path.join("..", "coshsh")))
import coshsh
from coshsh.generator import Generator
#from datasource import Datasource
from coshsh.host import Host
from cosh... | agpl-3.0 |
danielvdao/facebookMacBot | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py | 327 | 6557 | # urllib3/_collections.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from collections import Mapping, MutableMapping
try:
from threading import RLock
excep... | mit |
jwhui/openthread | tools/harness-automation/cases/leader_5_6_6.py | 18 | 1877 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# notic... | bsd-3-clause |
drxaero/calibre | src/calibre/ebooks/metadata/sources/covers.py | 13 | 5969 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import time
f... | gpl-3.0 |
hongliang5623/sentry | src/sentry/api/endpoints/project_search_details.py | 23 | 2463 | from __future__ import absolute_import
from rest_framework import serializers
from rest_framework.response import Response
from sentry.api.bases.project import ProjectEndpoint
from sentry.api.exceptions import ResourceDoesNotExist
from sentry.api.serializers import serialize
from sentry.models import SavedSearch
cl... | bsd-3-clause |
abhattad4/Digi-Menu | django/template/loader_tags.py | 100 | 9868 | from collections import defaultdict
from django.template.base import (
Library, Node, Template, TemplateSyntaxError, TextNode, Variable,
token_kwargs,
)
from django.utils import six
from django.utils.safestring import mark_safe
register = Library()
BLOCK_CONTEXT_KEY = 'block_context'
class ExtendsError(Exc... | bsd-3-clause |
JioCloud/tempest | tempest/api/image/v2/test_images.py | 6 | 10418 | # Copyright 2013 OpenStack Foundation
# Copyright 2013 IBM Corp
# 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/LICE... | apache-2.0 |
mlundblad/telepathy-gabble | tests/twisted/vcard/disconnect-during-pep.py | 2 | 1199 | """
Regression test for https://bugs.freedesktop.org/show_bug.cgi?id=31412
"""
import dbus
from servicetest import call_async, EventPattern, sync_dbus
from gabbletest import (exec_test, make_result_iq, acknowledge_iq,
disconnect_conn)
import constants as cs
def test(q, bus, conn, stream):
event = q.expec... | lgpl-2.1 |
indictranstech/fbd_erpnext | erpnext/accounts/report/financial_statements.py | 1 | 7760 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, _dict
from frappe.utils import (flt, getdate, get_first_day, get_last_day,
add_months, add_days, formatdate)
def g... | agpl-3.0 |
bmotlaghFLT/FLT_PhantomJS | src/breakpad/src/tools/gyp/test/generator-output/gyptest-copies.py | 151 | 1694 | #!/usr/bin/env python
# Copyright (c) 2009 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 file copies using an explicit build target of 'all'.
"""
import TestGyp
test = TestGyp.TestGyp()
test.writable(test.workpath... | bsd-3-clause |
Shouqun/node-gn | tools/depot_tools/third_party/boto/pyami/scriptbase.py | 90 | 1422 | import os
import sys
from boto.utils import ShellCommand, get_ts
import boto
import boto.utils
class ScriptBase:
def __init__(self, config_file=None):
self.instance_id = boto.config.get('Instance', 'instance-id', 'default')
self.name = self.__class__.__name__
self.ts = get_ts()
if ... | mit |
dlodato/AliPhysics | PWGJE/EMCALJetTasks/Tracks/analysis/Draw/DrawClusters.py | 41 | 5445 | #**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... | bsd-3-clause |
JennyChi/Script-helper | BAT/nonclustering/DC/size_simple_event.py | 3 | 1771 | ## file_simple_event.py
# Author: Chen-Ning (Jenny) Chi
# Date: 2011 Sep
###########################################################
## The program will generate & input simple event.
# Support files & directory.
# Could specify the new file to create the specified size events.
# Could specify how many events are ... | apache-2.0 |
moritz-wundke/Concurrent | concurrent/core/transport/pyjsonrpc/http.py | 1 | 8216 | #!/usr/bin/env python
# coding: utf-8
import sys
import urllib2
import base64
import BaseHTTPServer
import SocketServer
import httplib
import urllib
import urlparse
from StringIO import StringIO
import gzip
import rpcrequest
import rpcresponse
import rpcerror
import rpclib
from rpcjson import json
def http_request(u... | mit |
angelman/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/factory.py | 118 | 5888 | # Copyright (C) 2010 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 ... | bsd-3-clause |
pierky/ripe-atlas-tools | tests/commands/measure.py | 1 | 34634 | # -*- coding: UTF-8 -*-
# Copyright (c) 2015 RIPE NCC
#
# 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 progra... | gpl-3.0 |
Prash88/my-wedding | node_modules/node-gyp/gyp/tools/graphviz.py | 2679 | 2878 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Using the JSON dumped by the dump-dependency-json generator,
generate input suitable for graphviz to render a dependency graph of
targets... | mit |
Liuqian0501/elements-of-programming-interview | 09-binary-tree/9-1-Test if a binary tree is height-balanced/python/balanced_binary_tree.py | 2 | 1774 | from binary_tree_prototype import BinaryTreeNode
import collections
# @include
def is_balanced_binary_tree(tree):
BalancedStatusWithHeight = collections.namedtuple(
'BalancedStatusWithHeight', ('balanced', 'height'))
# First value of the return value indicates if tree is balanced, and if
# balanc... | mit |
tomchristie/django | django/views/generic/dates.py | 4 | 25236 | import datetime
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.http import Http404
from django.utils import timezone
from django.utils.functional import cached_property
from django.utils.translation import gettext as _
from django.views... | bsd-3-clause |
alirizakeles/tendenci | tendenci/apps/directories/tests.py | 1 | 1387 | """
This file demonstrates two different styles of tests (one doctest and one
unittest). These will both pass when you run "manage.py test".
Replace these with more appropriate tests for your application.
"""
from django.test import TestCase, Client
from django.contrib.auth.models import User
from tendenci.apps.direc... | gpl-3.0 |
jkibele/OpticalRS | OpticalRS/DepthEstimator.py | 1 | 9986 | # -*- coding: utf-8 -*-
"""
DepthEstimator
==============
Code for handling required data and producing depth estimates from multispectral
satellite imagery. KNN (Kibele and Shears, In Review) and linear methods
(Lyzenga et al., 2006) are currently supported.
References
----------
Kibele, J., Shears, N.T., In Press.... | bsd-3-clause |
marcusramberg/dotfiles | link/hammerspoon/hs/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py | 1558 | 4945 | # Copyright (c) 2011 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.
import re
import os
def XmlToString(content, encoding='utf-8', pretty=False):
""" Writes the XML content to disk, touching the file only if it has changed.
... | mit |
liu21st/masterfirefoxos | masterfirefoxos/base/middleware.py | 2 | 2023 | from django.conf import settings
from django.http import HttpResponseRedirect
class NonExistentLocaleRedirectionMiddleware(object):
"""Redirect to the 'en' version of a page if translation does not exist.
This middleware redirects requests to pages with locale other than
'en' to their 'en' version. The m... | mpl-2.0 |
mcltn/ansible-modules-extras | monitoring/nagios.py | 39 | 36108 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is largely copied from the Nagios module included in the
# Func project. Original copyright follows:
#
# func-nagios - Schedule downtime and enables/disable notifications
# Copyright 2011, Red Hat, Inc.
# Tim Bielawa <tbielawa@redhat.com>
#
# This software may be ... | gpl-3.0 |
xq262144/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/messages/tests/urls.py | 119 | 2470 | from django.conf.urls import patterns, url
from django.contrib import messages
from django.core.urlresolvers import reverse
from django import forms
from django.http import HttpResponseRedirect, HttpResponse
from django.template import RequestContext, Template
from django.template.response import TemplateResponse
from ... | apache-2.0 |
ddboline/pylearn2 | pylearn2/costs/tests/test_term_1_0_l1_penalty.py | 33 | 2673 | """
Test term_1_0_l1_penalty
"""
import numpy as np
from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix
from pylearn2.models.mlp import MLP, Sigmoid
from pylearn2.train import Train
from pylearn2.training_algorithms.sgd import SGD, ExponentialDecay
from pylearn2.termination_criteria import And, EpochCou... | bsd-3-clause |
TEAM-Gummy/platform_external_chromium_org | chrome/browser/extensions/PRESUBMIT.py | 57 | 12404 | # 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.
"""Chromium presubmit script for src/chrome/browser/extensions.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more det... | bsd-3-clause |
xen0l/ansible | lib/ansible/plugins/netconf/default.py | 79 | 2030 | #
# (c) 2017 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
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
dhruvg/luigi | luigi/db_task_history.py | 50 | 8720 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | apache-2.0 |
wjb/mx-common | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
TechBK/horizon-dev | openstack_dashboard/dashboards/project/routers/views.py | 36 | 8431 | # Copyright 2012, Nachi Ueno, NTT MCL, Inc.
# Copyright 2013, Big Switch Networks, 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... | apache-2.0 |
softlayer/softlayer-python | SoftLayer/CLI/dedicatedhost/list.py | 4 | 2313 | """List dedicated servers."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import columns as column_helper
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
from SoftLayer.CLI import helpers
COLUMNS = [
column_helper.Column('datacenter',... | mit |
gfyoung/numpy | numpy/lib/tests/test_packbits.py | 17 | 12851 | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import assert_array_equal, assert_equal, assert_raises
def test_packbits():
# Copied from the docstring.
a = [[[1, 0, 1], [0, 1, 0]],
[[1, 1, 0], [0, 0, 1]]]
for dt in '?bBhHiIlLqQ':
ar... | bsd-3-clause |
Eric89GXL/mne-python | mne/externals/tqdm/_tqdm/std.py | 14 | 55471 | """
Customisable progressbar decorator for iterators.
Includes a default (x)range iterator printing to stderr.
Usage:
>>> from tqdm import trange[, tqdm]
>>> for i in trange(10): #same as: for i in tqdm(xrange(10))
... ...
"""
from __future__ import absolute_import, division
# compatibility functions and uti... | bsd-3-clause |
mbauskar/omnitech-demo-erpnext | erpnext/setup/doctype/global_defaults/global_defaults.py | 55 | 2227 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
"""Global Defaults"""
import frappe
import frappe.defaults
from frappe.utils import cint
from frappe.custom.doctype.property_setter.property_setter impo... | agpl-3.0 |
quixoten/ansible | lib/ansible/plugins/inventory/aggregate.py | 237 | 2266 | # (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 |
jmaas/cobbler | cobbler/items/item.py | 1 | 18656 | """
Copyright 2006-2009, Red Hat, Inc and Others
Michael DeHaan <michael.dehaan AT gmail>
This software may be freely redistributed under the terms of the GNU
general public license.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundatio... | gpl-2.0 |
inteos/IBAdmin | restore/models.py | 1 | 1062 | # -*- coding: UTF-8 -*-
#
# Copyright (c) 2015-2019 by Inteos Sp. z o.o.
# All rights reserved. See LICENSE file for details.
#
from __future__ import unicode_literals
from django.db import models
"""
class Permissions(models.Model):
class Meta:
managed = False
permissions = (
('rest... | agpl-3.0 |
daivietpda/sense-l | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
revpoint/prefs-n-perms | prefs_n_perms/sections.py | 1 | 1192 | from prefs_n_perms.client import db
from prefs_n_perms.permissions import Permissions
from prefs_n_perms.preferences import Preferences
from prefs_n_perms.settings import preference_settings
class Section(object):
prefix = preference_settings.SECTIONS_PREFIX
def __init__(self, name, **kwargs):
self.n... | mit |
adrienbrault/home-assistant | tests/components/trace/test_utils.py | 2 | 1169 | """Test trace helpers."""
from datetime import timedelta
from homeassistant import core
from homeassistant.components import trace
from homeassistant.util import dt as dt_util
def test_json_encoder(hass):
"""Test the Trace JSON Encoder."""
ha_json_enc = trace.utils.TraceJSONEncoder()
state = core.State("... | mit |
bfirsh/django-old | django/contrib/gis/db/models/sql/query.py | 379 | 5314 | from django.db import connections
from django.db.models.query import sql
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.sql import aggregates as gis_aggregates
from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField
from django.contri... | bsd-3-clause |
miipl-naveen/optibizz | addons/stock_picking_wave/wizard/picking_to_wave.py | 382 | 1624 | ##############################################################################
#
# 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 Affero General Public L... | agpl-3.0 |
keedio/hue | desktop/core/ext-py/python-openid-2.2.5/setup.py | 56 | 1682 | import sys
import os
from distutils.core import setup
if 'sdist' in sys.argv:
os.system('./admin/makedoc')
version = '[library version:2.2.5]'[17:-1]
setup(
name='python-openid',
version=version,
description='OpenID support for servers and consumers.',
long_description='''This is a set of Python... | apache-2.0 |
numerigraphe/stock-logistics-warehouse | __unported__/stock_available_immediately/__openerp__.py | 5 | 1363 | # -*- coding: utf-8 -*-
#
#
# Author: Guewen Baconnier
# Copyright 2010-2012 Camptocamp SA
# Copyright (C) 2011 Akretion Sébastien BEAU <sebastien.beau@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
#... | agpl-3.0 |
acquia/Diamond | src/collectors/onewire/onewire.py | 53 | 2416 | # coding=utf-8
"""
The OneWireCollector collects data from 1-Wire Filesystem
You can configure which sensors are read in two way:
- add section [scan] with attributes and aliases,
(collector will scan owfs to find attributes)
or
- add sections with format id:$SENSOR_ID
See also: http://owfs.org/
Author: Tomas... | mit |
LiaoPan/scikit-learn | sklearn/neighbors/tests/test_nearest_centroid.py | 305 | 4121 | """
Testing for the nearest centroid module.
"""
import numpy as np
from scipy import sparse as sp
from numpy.testing import assert_array_equal
from numpy.testing import assert_equal
from sklearn.neighbors import NearestCentroid
from sklearn import datasets
from sklearn.metrics.pairwise import pairwise_distances
# t... | bsd-3-clause |
jpaalasm/pyglet | pyglet/font/freetype.py | 26 | 13163 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | bsd-3-clause |
HiSPARC/station-software | user/python/Lib/nntplib.py | 92 | 21470 | """An NNTP client class based on RFC 977: Network News Transfer Protocol.
Example:
>>> from nntplib import NNTP
>>> s = NNTP('news')
>>> resp, count, first, last, name = s.group('comp.lang.python')
>>> print 'Group', name, 'has', count, 'articles, range', first, 'to', last
Group comp.lang.python has 51 articles, rang... | gpl-3.0 |
rwesterlund/pysteam | pysteam/tests/test_user.py | 1 | 1232 | #!/usr/bin/env python
# encoding: utf-8
"""
test_user.py
Created by Scott on 2013-12-29.
Copyright (c) 2013 Scott Rice. All rights reserved.
"""
import sys
import os
import mock
import shutil
import tempfile
import unittest
from pysteam import steam
from pysteam import user
class TestUser(unittest.TestCase):
... | mit |
dgouldin/django-socialite | socialite/apps/myspace/helper.py | 1 | 1221 | import oauth2 as oauth
import urlparse
from django.conf import settings
from django.contrib.auth.models import User
from django.core.cache import cache
from django.utils import simplejson
from socialite.apps.base.oauth import helper as oauth_helper
from socialite.apps.base.oauth20.utils import get_mutable_query_dict
... | mit |
htwenhe/DJOA | env/Lib/site-packages/django/template/loader_tags.py | 115 | 12330 | import logging
from collections import defaultdict
from django.utils import six
from django.utils.safestring import mark_safe
from .base import (
Node, Template, TemplateSyntaxError, TextNode, Variable, token_kwargs,
)
from .library import Library
register = Library()
BLOCK_CONTEXT_KEY = 'block_context'
logger... | mit |
jholloman/node-gyp | gyp/pylib/gyp/easy_xml.py | 1049 | 4803 | # Copyright (c) 2011 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.
import re
import os
def XmlToString(content, encoding='utf-8', pretty=False):
""" Writes the XML content to disk, touching the file only if it has changed.
... | mit |
qrkourier/ansible | lib/ansible/modules/windows/win_pagefile.py | 42 | 3966 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2017, Liran Nisanov <lirannis@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA = {'metadata_vers... | gpl-3.0 |
kidburglar/youtube-dl | youtube_dl/extractor/crooksandliars.py | 64 | 2061 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
qualities,
)
class CrooksAndLiarsIE(InfoExtractor):
_VALID_URL = r'https?://embed\.crooksandliars\.com/(?:embed|v)/(?P<id>[A-Za-z0-9]+)'
_TESTS = [{
'url': 'https://embed.crooksandliar... | unlicense |
auready/django | tests/db_functions/models.py | 11 | 1699 | """
Tests for built in Function expressions.
"""
from django.db import models
class Author(models.Model):
name = models.CharField(max_length=50)
alias = models.CharField(max_length=50, null=True, blank=True)
goes_by = models.CharField(max_length=50, null=True, blank=True)
age = models.PositiveSmallInt... | bsd-3-clause |
sonuyos/couchpotato | libs/suds/mx/typer.py | 203 | 4116 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 the hope that it will ... | gpl-3.0 |
ubc/edx-platform | lms/djangoapps/shoppingcart/processors/__init__.py | 215 | 2574 | """
Public API for payment processor implementations.
The specific implementation is determined at runtime using Django settings:
CC_PROCESSOR_NAME: The name of the Python module (in `shoppingcart.processors`) to use.
CC_PROCESSOR: Dictionary of configuration options for specific processor implementations,
... | agpl-3.0 |
Zhongqilong/mykbengineer | kbe/res/scripts/common/Lib/site-packages/pip/_vendor/requests/packages/chardet/big5prober.py | 2931 | 1684 | ######################## 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... | lgpl-3.0 |
whitepyro/debian_server_setup | lib/MultipartPostHandler.py | 62 | 3557 | #!/usr/bin/python
####
# 06/2010 Nic Wolfe <nic@wolfeden.ca>
# 02/2006 Will Holcomb <wholcomb@gmail.com>
#
# This library 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 2.1 of the Li... | gpl-3.0 |
MSeifert04/astropy | astropy/visualization/scripts/fits2bitmap.py | 2 | 7795 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from distutils.version import LooseVersion
from astropy.visualization.mpl_normalize import simple_norm
from astropy import log
from astropy.io.fits import getdata
def fits2bitmap(filename, ext=0, out_fn=None, stretch='linear',
... | bsd-3-clause |
neilLasrado/frappe | frappe/core/page/background_jobs/background_jobs.py | 17 | 1197 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from rq import Queue, Worker
from frappe.utils.background_jobs import get_redis_conn
from frappe.utils import format_datetime, cint
colors = {
'queued': 'orange',... | mit |
aricchen/openHR | openerp/addons/base_gengo/__init__.py | 57 | 1104 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Openerp sa (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | agpl-3.0 |
Jet-Streaming/gyp | build/lib/gyp/MSVSUserFile.py | 8 | 5241 | # 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.
"""Visual Studio user preferences file writer."""
import os
import re
import socket # for gethostname
import gyp.common
import gyp.easy_xml as easy_xm... | bsd-3-clause |
jessrosenfield/pants | src/python/pants/backend/core/tasks/target_filter_task_mixin.py | 7 | 1504 | # 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 pants.backend.c... | apache-2.0 |
bigswitch/neutron | neutron/tests/unit/callbacks/test_manager.py | 5 | 8124 | # Copyright 2015 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
valentin-krasontovitsch/ansible | lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment.py | 1 | 15372 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
alexlo03/ansible | contrib/inventory/brook.py | 27 | 9611 | #!/usr/bin/env python
# Copyright 2016 Doalitic.
#
# 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 ve... | gpl-3.0 |
kingofsystem/django-allauth | allauth/socialaccount/providers/flickr/views.py | 65 | 1666 | import json
from django.utils.http import urlencode
from allauth.socialaccount.providers.oauth.client import OAuth
from allauth.socialaccount.providers.oauth.views import (
OAuthAdapter,
OAuthLoginView,
OAuthCallbackView)
from .provider import FlickrProvider
class FlickrAPI(OAuth):
api_url = 'https... | mit |
educreations/django-ormcache | ormcache/managers.py | 1 | 2096 | from django.db.models.signals import class_prepared, post_delete, post_save
from django.utils.functional import cached_property
from ormcache.queryset import CachedQuerySet
class CachedManagerMixin(object):
@cached_property
def __cache_enabled(self):
return getattr(self.model, "cache_enabled", False... | mit |
wkrzemien/DIRAC | TransformationSystem/Agent/TransformationAgentsUtilities.py | 7 | 3139 | """ Utility Class for threaded agents (e.g. TransformationAgent)
Mostly for logging
"""
import time
from DIRAC import gLogger
__RCSID__ = "$Id$"
AGENT_NAME = ''
class TransformationAgentsUtilities(object):
""" logging utilities for threaded TS agents
"""
def __init__(self):
""" c'tor
"""
sel... | gpl-3.0 |
MounirMesselmeni/django | tests/gis_tests/geos_tests/test_geos.py | 5 | 46748 | from __future__ import unicode_literals
import ctypes
import json
import random
import unittest
from binascii import a2b_hex, b2a_hex
from io import BytesIO
from unittest import skipUnless
from django.contrib.gis import gdal
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import (
HAS_GE... | bsd-3-clause |
glennbarrett/sslstrip | sslstrip/URLMonitor.py | 60 | 2839 | # Copyright (c) 2004-2009 Moxie Marlinspike
#
# 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 distri... | gpl-3.0 |
Majed6/kodi-habitica | script.habitica/addon.py | 1 | 6718 | #! python3
# -*- coding: utf-8 -*-
import os
import xbmcaddon
import xbmcgui
import datetime
import resources.lib.httplib2 as httplib2
import urllib
import json
addon = xbmcaddon.Addon()
dialog = xbmcgui.Dialog()
http = httplib2.Http()
class Habitica(xbmcgui.Window):
def __init__(self):
self.background = xbmcgui.C... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.