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 |
|---|---|---|---|---|---|
rcgee/oq-hazardlib | openquake/hazardlib/tests/geo/surface/gc2_test.py | 1 | 12206 | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# The Hazard Library
# Copyright (C) 2013-2016 GEM Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either ... | agpl-3.0 |
udrg/crazyflie-clients-python | lib/cfclient/ui/__init__.py | 32 | 1342 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | gpl-2.0 |
asimshankar/tensorflow | tensorflow/python/client/virtual_gpu_test.py | 6 | 9651 | # 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 |
cetic/ansible | lib/ansible/utils/module_docs_fragments/dellos10.py | 303 | 2451 | #
# (c) 2015, Peter Sprygada <psprygada@ansible.com>
#
# Copyright (c) 2016 Dell 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 Licens... | gpl-3.0 |
kubaszostak/gdal-dragndrop | osgeo/apps/Python27/Lib/site-packages/numpy/lib/twodim_base.py | 2 | 27339 | """ Basic functions for manipulating 2d arrays
"""
from __future__ import division, absolute_import, print_function
import functools
from numpy.core.numeric import (
absolute, asanyarray, arange, zeros, greater_equal, multiply, ones,
asarray, where, int8, int16, int32, int64, empty, promote_types, diagonal,
... | mit |
yuantw/DataCollecting | spider/SpiderQYer.py | 1 | 6919 | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@author: Tengwei Yuan
1. Get all links of summary pages - from start search page result
2. From each summary page get all links of detail product pages
3. From each detail product page get basic information and the number of review pages
4. From each review page get review ... | mit |
thaim/ansible | lib/ansible/modules/cloud/docker/docker_network.py | 3 | 25612 | #!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
# 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',
'status': ['prev... | mit |
sdaftuar/bitcoin | qa/rpc-tests/invalidtxrequest.py | 108 | 2576 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import ComparisonTestFramework
from test_framework.comptool import Tes... | mit |
SujaySKumar/django | tests/auth_tests/test_validators.py | 229 | 7546 | from __future__ import unicode_literals
import os
from django.contrib.auth.models import User
from django.contrib.auth.password_validation import (
CommonPasswordValidator, MinimumLengthValidator, NumericPasswordValidator,
UserAttributeSimilarityValidator, get_default_password_validators,
get_password_val... | bsd-3-clause |
cfenoy/easybuild-easyblocks | easybuild/easyblocks/j/java.py | 12 | 1652 | ##
# Copyright 2012-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | gpl-2.0 |
defionscode/ansible | lib/ansible/modules/storage/infinidat/infini_host.py | 70 | 3806 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Gregory Shulov (gregory.shulov@gmail.com)
# 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': '... | gpl-3.0 |
dynm/miasm | miasm2/analysis/disasm_cb.py | 7 | 3953 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
from miasm2.expression.expression import ExprInt, ExprId, ExprMem, MatchExpr
from miasm2.expression.simplifications import expr_simp
from miasm2.core.asmbloc \
import asm_symbol_pool, asm_constraint_next, asm_constraint_to
from miasm2.core.utils import upck32
# from mias... | gpl-2.0 |
CTSRD-CHERI/u-boot | doc/sphinx/cdomain.py | 296 | 5596 | # -*- coding: utf-8; mode: python -*-
# pylint: disable=W0141,C0113,C0103,C0325
u"""
cdomain
~~~~~~~
Replacement for the sphinx c-domain.
:copyright: Copyright (C) 2016 Markus Heiser
:license: GPL Version 2, June 1991 see Linux/COPYING for details.
List of customizations:
* Moved th... | gpl-2.0 |
jvassev/dd-agent | tests/core/test_flare.py | 24 | 4408 | # stdlib
import os.path
import unittest
# 3p
import mock
from nose.plugins.attrib import attr
# project
from utils.flare import Flare
def get_mocked_config():
return {
'api_key': 'APIKEY',
'dd_url': 'https://app.datadoghq.com',
}
def get_mocked_version():
return '6.6.6'
def get_mocke... | bsd-3-clause |
benhoff/simpleyapsy | pluginmanager/file_filters/with_info_file.py | 2 | 3952 |
import os
from pluginmanager import util
from pluginmanager.compat import ConfigParser, FILE_ERROR
from . import PLUGIN_FORBIDDEN_NAME
class WithInfoFileFilter(object):
"""
Only gets files that have configuration files ending with specific
extensions, nominally 'yapsy-plugin'
"""
def __init__(sel... | gpl-3.0 |
jumpojoy/neutron | neutron/plugins/ml2/drivers/openvswitch/agent/openflow/ovs_ofctl/ofswitch.py | 17 | 4026 | # Copyright (C) 2014,2015 VA Linux Systems Japan K.K.
# Copyright (C) 2014,2015 YAMAMOTO Takashi <yamamoto at valinux co jp>
# 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 t... | apache-2.0 |
gonboy/sl4a | python/src/PC/VS8.0/build_ssl.py | 32 | 9154 | # Script for building the _ssl and _hashlib modules for Windows.
# Uses Perl to setup the OpenSSL environment correctly
# and build OpenSSL, then invokes a simple nmake session
# for the actual _ssl.pyd and _hashlib.pyd DLLs.
# THEORETICALLY, you can:
# * Unpack the latest SSL release one level above your main Python ... | apache-2.0 |
cybojenix/SlimBot | disabled_stuff/rdio.py | 6 | 4696 | import urllib
import json
import re
import oauth2 as oauth
from util import hook
def getdata(inp, types, api_key, api_secret):
consumer = oauth.Consumer(api_key, api_secret)
client = oauth.Client(consumer)
response = client.request('http://api.rdio.com/1/', 'POST',
urllib.u... | gpl-3.0 |
fly19890211/edx-platform | lms/djangoapps/instructor_task/tasks_helper.py | 26 | 65045 | """
This file contains tasks that are designed to perform background operations on the
running state of a course.
"""
import json
import re
from collections import OrderedDict
from datetime import datetime
from django.conf import settings
from eventtracking import tracker
from itertools import chain
from time import t... | agpl-3.0 |
jonasjberg/autonameow | autonameow/vendor/unidecode/x016.py | 252 | 4140 | data = (
'kka', # 0x00
'kk', # 0x01
'nu', # 0x02
'no', # 0x03
'ne', # 0x04
'nee', # 0x05
'ni', # 0x06
'na', # 0x07
'mu', # 0x08
'mo', # 0x09
'me', # 0x0a
'mee', # 0x0b
'mi', # 0x0c
'ma', # 0x0d
'yu', # 0x0e
'yo', # 0x0f
'ye', # 0x10
'yee', # 0x11
'yi', # 0x12
'ya... | gpl-2.0 |
kaichogami/scikit-learn | examples/linear_model/plot_sgd_iris.py | 286 | 2202 | """
========================================
Plot multi-class SGD on the iris dataset
========================================
Plot decision surface of multi-class SGD on iris dataset.
The hyperplanes corresponding to the three one-versus-all (OVA) classifiers
are represented by the dashed lines.
"""
print(__doc__)
... | bsd-3-clause |
jjmleiro/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/tests/relatedapp/models.py | 121 | 1801 | from django.contrib.gis.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Location(models.Model):
point = models.PointField()
objects = models.GeoManager()
def __str__(self): return self.point.wkt
@python_2_unicode_compatible
class City(model... | apache-2.0 |
petemounce/ansible | test/units/module_utils/basic/test_log.py | 63 | 10557 | # -*- coding: utf-8 -*-
# (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, ... | gpl-3.0 |
bhaskar24/ns-3_RARED | examples/realtime/realtime-udp-echo.py | 195 | 3526 | #
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public License version 2 as
# * published by the Free Software Foundation;
# *
# * This program is distributed in the hope that it will be useful,
# * but WITHOUT ANY WARRANTY; without even the implied w... | gpl-2.0 |
prarthitm/edxplatform | common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py | 19 | 35039 | """
Unit tests for the Mongo modulestore
"""
# pylint: disable=protected-access
# pylint: disable=no-name-in-module
# pylint: disable=bad-continuation
from nose.tools import assert_equals, assert_raises, \
assert_not_equals, assert_false, assert_true, assert_greater, assert_is_instance, assert_is_none
# pylint: ena... | agpl-3.0 |
kernsuite-debian/obit | python/testObit.py | 1 | 1061 | import OErr, OSystem, Image, InfoList, FArray
err=OErr.OErr()
ObitSys=OSystem.OSystem ("Python", 1, 103, 1, ["None"], 1, ["../PythonData/"], 1, 0, err)
OErr.printErrMsg(err, "Error with Obit startup")
# for debugging
#OErr.Bomb()
list = InfoList.InfoList();
dim = [1,0,0,0,0]
InfoList.PPutLong (list, "longItem", dim,... | gpl-2.0 |
cfg2015/EPT-2015-2 | doc/_themes/odoodoc/html_domain.py | 129 | 4109 | # -*- coding: utf-8 -*-
from docutils import nodes, utils
from docutils.parsers.rst import Directive, directives, docutils
from docutils.parsers.rst.directives.body import LineBlock
import sphinx.roles
from sphinx.domains import Domain
def setup(app):
app.add_domain(HtmlDomain)
app.add_node(div, html=(
... | agpl-3.0 |
gomowjames/angular-barrettj.co | node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py | 2767 | 2174 | # 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.
"""Applies a fix to CR LF TAB handling in xml.dom.
Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293
Working around this: http://bugs.python.or... | mit |
aimejeux/enigma2 | lib/python/Components/RecordingConfig.py | 23 | 1313 | from config import ConfigSelectionNumber, ConfigYesNo, ConfigSubsection, ConfigSelection, config
def InitRecordingConfig():
config.recording = ConfigSubsection()
# actually this is "recordings always have priority". "Yes" does mean: don't ask. The RecordTimer will ask when value is 0.
config.recording.asktozap = Co... | gpl-2.0 |
deepsrd/android_kernel_nx507j | scripts/build-all.py | 1474 | 10189 | #! /usr/bin/env python
# Copyright (c) 2009-2013, The Linux Foundation. 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
# ... | gpl-2.0 |
zlsun/XX-Net | code/default/smart_router/local/pipe_socks.py | 1 | 7876 | import threading
import select
import time
import utils
import global_var as g
from xlog import getLogger
xlog = getLogger("smart_router")
class PipeSocks(object):
def __init__(self, buf_size=16*1024):
self.buf_size = buf_size
self.sock_dict = {}
self.read_set = []
self.write_se... | bsd-2-clause |
vipmike007/avocado-vt | virttest/libvirt_xml/devices/input.py | 24 | 1517 | """
input device support class(es)
http://libvirt.org/formatdomain.html#elementsInput
"""
from virttest.libvirt_xml import accessors
from virttest.libvirt_xml.devices import base, librarian
class Input(base.TypedDeviceBase):
__slots__ = ('input_bus', 'address')
def __init__(self, type_name, virsh_instance=... | gpl-2.0 |
likelyzhao/mxnet | example/image-classification/benchmark.py | 16 | 9452 | from __future__ import print_function
import logging
import argparse
import os
import time
import sys
import shutil
import csv
import re
import subprocess, threading
import pygal
import importlib
import collections
import threading
import copy
'''
Setup Logger and LogLevel
'''
def setup_logging(log_loc):
if os.path... | apache-2.0 |
kobolabs/calibre | src/calibre/gui2/store/search/results_view.py | 9 | 1392 | # -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import, print_function)
__license__ = 'GPL 3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
from functools import partial
from PyQt4.Qt import (pyqtSignal, QMenu, QTreeView)
fro... | gpl-3.0 |
atosorigin/ansible | lib/ansible/plugins/inventory/__init__.py | 2 | 20585 | # (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 |
SEL-Columbia/commcare-hq | corehq/apps/hqwebapp/templatetags/hq_shared_tags.py | 1 | 6328 | from datetime import datetime, timedelta
import json
from django import template
from django.conf import settings
from django.core.urlresolvers import reverse
from django.template.loader import render_to_string
from django.utils.datastructures import SortedDict
from django.utils.safestring import mark_safe
from django.... | bsd-3-clause |
oxtopus/nupic | nupic/data/CategoryFilter.py | 17 | 2279 | #! /usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions... | gpl-3.0 |
abhattad4/Digi-Menu | build/lib.linux-x86_64-2.7/django/contrib/gis/db/backends/base/operations.py | 100 | 3924 | class BaseSpatialOperations(object):
"""
This module holds the base `BaseSpatialBackend` object, which is
instantiated by each spatial database backend with the features
it has.
"""
truncate_params = {}
# Quick booleans for the type of this spatial backend, and
# an attribute for the sp... | bsd-3-clause |
Qalthos/ansible | docs/bin/dump_config.py | 52 | 2360 | #!/usr/bin/env python
import optparse
import os
import sys
import yaml
from jinja2 import Environment, FileSystemLoader
from ansible.module_utils._text import to_bytes
from ansible.utils._build_helpers import update_file_if_different
DEFAULT_TEMPLATE_FILE = 'config.rst.j2'
def generate_parser():
p = optparse.O... | gpl-3.0 |
ASlave2Audio/Restaurant-App | mingw/bin/lib/warnings.py | 265 | 14044 | """Python part of the warnings subsystem."""
# Note: function level imports should *not* be used
# in this module as it may cause import lock deadlock.
# See bug 683658.
import linecache
import sys
import types
__all__ = ["warn", "showwarning", "formatwarning", "filterwarnings",
"resetwarnings", "catch_war... | mit |
onedata/helpers | test/integration/key_value_canonical_test_base.py | 1 | 10786 | """This module contains test for KeyValue helpers with canonical paths
and blockSize set to 0."""
__author__ = "Bartek Kryza"
__copyright__ = """(C) 2019 ACK CYFRONET AGH,
This software is released under the MIT license cited in 'LICENSE.txt'."""
from test_common import *
from common_test_base import *
from posix_... | mit |
willemneal/Docky | lib/unidecode/x028.py | 253 | 5069 | data = (
' ', # 0x00
'a', # 0x01
'1', # 0x02
'b', # 0x03
'\'', # 0x04
'k', # 0x05
'2', # 0x06
'l', # 0x07
'@', # 0x08
'c', # 0x09
'i', # 0x0a
'f', # 0x0b
'/', # 0x0c
'm', # 0x0d
's', # 0x0e
'p', # 0x0f
'"', # 0x10
'e', # 0x11
'3', # 0x12
'h', # 0x13
'9', # ... | mit |
victorbriz/rethinkdb | external/v8_3.30.33.16/testing/gtest/test/gtest_output_test.py | 496 | 12051 | #!/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... | agpl-3.0 |
UnicronNL/vyos-kernel-clearfog | scripts/gdb/linux/utils.py | 630 | 4267 | #
# gdb helper commands and functions for Linux kernel debugging
#
# common utilities
#
# Copyright (c) Siemens AG, 2011-2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
class CachedType:
def __init__(self, name):
s... | gpl-2.0 |
Moriadry/tensorflow | tensorflow/python/framework/errors_test.py | 83 | 3683 | # 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 |
adrianholovaty/django | django/contrib/gis/db/backends/spatialite/introspection.py | 401 | 2112 | from django.contrib.gis.gdal import OGRGeomType
from django.db.backends.sqlite3.introspection import DatabaseIntrospection, FlexibleFieldLookupDict
class GeoFlexibleFieldLookupDict(FlexibleFieldLookupDict):
"""
Sublcass that includes updates the `base_data_types_reverse` dict
for geometry field types.
... | bsd-3-clause |
tgsd96/gargnotes | venv/lib/python2.7/site-packages/setuptools/tests/test_test.py | 148 | 2329 | # -*- coding: UTF-8 -*-
from __future__ import unicode_literals
import os
import site
import pytest
from setuptools.command.test import test
from setuptools.dist import Distribution
from .textwrap import DALS
from . import contexts
SETUP_PY = DALS("""
from setuptools import setup
setup(name='foo',
... | mit |
versae/DH2304 | data/arts1.py | 1 | 1038 | import numpy as np
import pandas as pd
arts = pd.DataFrame()
# Clean the dates so you only see numbers.
def clean_years(value):
result = value
chars_to_replace = ["c.", "©", ", CARCC", "no date", "n.d.", " SODRAC", ", CA", " CARCC", ""]
chars_to_split = ["-", "/"]
if isinstance(result, str):
... | mit |
ItsAGeekThing/namebench | namebench.py | 171 | 2390 | #!/usr/bin/env python
# Copyright 2009 Google 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 required... | apache-2.0 |
openstates/openstates | openstates/nh/bills.py | 1 | 15203 | import re
import datetime as dt
from collections import defaultdict
import pytz
from pupa.scrape import Scraper, Bill, VoteEvent as Vote
from openstates.nh.legacyBills import NHLegacyBillScraper
body_code = {"lower": "H", "upper": "S"}
bill_type_map = {
"B": "bill",
"R": "resolution",
"CR": "concurrent ... | gpl-3.0 |
paul99/clank | tools/grit/grit/node/io.py | 4 | 3001 | #!/usr/bin/python2.4
# Copyright (c) 2006-2008 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.
'''The <output> and <file> elements.
'''
import os
import re
import grit.format.rc_header
from grit.node import base
from gri... | bsd-3-clause |
john5223/airflow | airflow/hooks/hive_hooks.py | 17 | 14064 | from __future__ import print_function
from builtins import zip
from past.builtins import basestring
import csv
import logging
import subprocess
from tempfile import NamedTemporaryFile
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from hive_ser... | apache-2.0 |
regisb/babel | scripts/dump_data.py | 55 | 1500 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# ... | bsd-3-clause |
EmanueleCannizzaro/scons | src/engine/SCons/Tool/RCS.py | 3 | 2283 | """SCons.Tool.RCS.py
Tool-specific initialization for RCS.
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 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, t... | mit |
sysadminmatmoz/odoo-clearcorp | account_move_no_filter/__init__.py | 21 | 1030 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Addons modules by CLEARCORP S.A.
# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
#
# This program is free software: you can redistribute... | agpl-3.0 |
gautam1858/tensorflow | third_party/toolchains/preconfig/ubuntu14.04/gcc-nvcc-cuda10.0/windows/msvc_wrapper_for_nvcc.py | 3 | 6689 | #!/usr/bin/env python
# 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
#
# Unle... | apache-2.0 |
jrjang/mbed | workspace_tools/export/__init__.py | 1 | 7502 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | apache-2.0 |
brutkin/commons | tests/python/twitter/common/zookeeper/group/test_group.py | 13 | 5257 | # ==================================================================================================
# Copyright 2013 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | apache-2.0 |
nicholedwight/nichole-theme | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/styles/perldoc.py | 364 | 2175 | # -*- coding: utf-8 -*-
"""
pygments.styles.perldoc
~~~~~~~~~~~~~~~~~~~~~~~
Style similar to the style used in the `perldoc`_ code blocks.
.. _perldoc: http://perldoc.perl.org/
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from... | mit |
pombreda/androguard | apkviewer.py | 38 | 3150 | #!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard 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,... | apache-2.0 |
makinacorpus/odoo | addons/account/project/report/inverted_analytic_balance.py | 358 | 5760 | # -*- 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 |
andymckay/zamboni | lib/es/management/commands/fixup_mkt_index.py | 21 | 1143 | """
A Marketplace only command that finds apps missing from the search index and
adds them.
"""
import sys
import elasticsearch
from django.core.management.base import BaseCommand
from mkt.webapps.indexers import WebappIndexer
from mkt.webapps.models import Webapp
class Command(BaseCommand):
help = 'Fix up Mar... | bsd-3-clause |
ammaradil/fibonacci | Lib/site-packages/django/conf/__init__.py | 59 | 6888 | """
Settings and configuration for Django.
Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global settings file for
a list of all possible variables.
"""
import importlib
import os
import time
from django.conf import... | mit |
jaimeMF/youtube-dl | youtube_dl/extractor/brightcove.py | 9 | 22826 | # encoding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import (
compat_etree_fromstring,
compat_parse_qs,
compat_str,
compat_urllib_parse,
compat_urllib_parse_urlparse,
compat_urlparse,
compat_xml_parse_error,
)
from ... | unlicense |
thinkopensolutions/l10n-brazil | financial/wizards/report_xlsx_financial_defaults_wizard.py | 4 | 1360 | # -*- coding: utf-8 -*-
#
# Copyright 2017 KMEE INFORMATICA LTDA
# Luiz Felipe do Divino <luiz.divino@kmee.com.br>
# License AGPL-3 or later (http://www.gnu.org/licenses/agpl)
#
from __future__ import division, print_function, unicode_literals
from datetime import datetime
from openerp import fields, models, api, ... | agpl-3.0 |
tinkerthaler/odoo | addons/stock_landed_costs/stock_landed_costs.py | 56 | 18361 | # -*- 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 |
projectcalico/calico-neutron | neutron/plugins/oneconvergence/plugin.py | 3 | 17259 | # Copyright 2014 OneConvergence, 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 requir... | apache-2.0 |
OpenUpgrade-dev/OpenUpgrade | addons/portal_project/tests/__init__.py | 170 | 1124 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
oldstylejoe/pychess-timed | lib/pychess/System/ping.py | 22 | 2950 | from __future__ import print_function
# -*- coding: UTF-8 -*-
from gi.repository import GObject
from pychess.System.Log import log
from pychess.System.SubProcess import SubProcess, searchPath
import re
class Pinger (GObject.GObject):
""" The recieved signal contains the time it took to get response from the
... | gpl-3.0 |
dafrito/trac-mirror | trac/mimeview/rst.py | 1 | 11299 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2004-2009 Edgewall Software
# Copyright (C) 2004 Oliver Rutherfurd
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wi... | bsd-3-clause |
balloob/home-assistant | script/hassfest/dependencies.py | 15 | 8331 | """Validate dependencies."""
import ast
from pathlib import Path
from typing import Dict, Set
from homeassistant.requirements import DISCOVERY_INTEGRATIONS
from .model import Integration
class ImportCollector(ast.NodeVisitor):
"""Collect all integrations referenced."""
def __init__(self, integration: Integ... | apache-2.0 |
saurabh6790/medsynaptic-app | startup/event_handlers.py | 15 | 2631 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt"
from __future__ import unicode_literals
import webnotes
import home
def on_login_post_session(login_manager):
"""
called after login
update login_from and delete parallel sessions
... | agpl-3.0 |
deepakselvaraj/federated-horizon | openstack_dashboard/dashboards/project/containers/tables.py | 3 | 8834 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... | apache-2.0 |
arne-cl/alt-mulig | elasticsearch/generate_json_documents.py | 1 | 21510 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# original author: Marko Drotschmann
# changes: Arne Neumann
import json
import hashlib
'''
# an example document for a 'celebrity'
{
# Alter
"age": ,
# ausgedachtes Rating von 1.0 bis 5.0
"rating": 0.0,
# Geburtstag, Format yyyy-mm-dd
"birthday": "",
# Vorname
"firstnam... | gpl-3.0 |
unreal666/outwiker | plugins/source/source/pygments/lexers/forth.py | 4 | 7179 | # -*- coding: utf-8 -*-
"""
pygments.lexers.forth
~~~~~~~~~~~~~~~~~~~~~
Lexer for the Forth language.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups
from pygments.to... | gpl-3.0 |
mikalstill/nova | nova/tests/unit/compute/test_compute_xen.py | 3 | 3052 | # 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 |
hootnot/postcode-api-wrapper | postcodepy/postcodepy.py | 1 | 8659 | """Postcode API module."""
import json
import requests
class EndpointsMixin(object):
"""EndpointsMixin - API endpoints for the API class.
each endpoint of the API has a representative method in EndpointsMixin
Parameters that apply to the API url just need to be passed
as a keyword argument.
"""
... | mit |
rstebbing/powerlifting-meet-manager | table.py | 1 | 24349 | ##########################################
# File: table.py #
# Copyright Richard Stebbing 2014. #
# Distributed under the MIT License. #
# (See accompany file LICENSE or copy at #
# http://opensource.org/licenses/MIT) #
##########################################
# Imports
from PyQ... | mit |
ilya-epifanov/ansible-modules-core | inventory/add_host.py | 154 | 2000 | # -*- 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 |
gnufede/sqjobs | sqjobs/brokers/base.py | 1 | 1413 | from abc import ABCMeta, abstractmethod
from six import add_metaclass
from uuid import uuid4
@add_metaclass(ABCMeta)
class Broker(object):
@abstractmethod
def add_job(self, job_class, *args, **kwargs):
"""
Add a job to the broker
:param job_class: python class of the payload job
... | bsd-3-clause |
kawamon/hue | desktop/libs/librdbms/java/query.py | 2 | 1577 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
fparrel/vigicrues_tools | chcantabrico_scrap.py | 1 | 1262 | #!/usr/bin/env python
import json
import requests
import datetime
from serialize import saveValues, loadStations
from chcantabrico_get_stations import getFlow4Level
def parseLine(line):
d, v = line.split(';')
return datetime.datetime.strptime(d,"%d/%m/%Y %H:%M:%S"),float(v)
def main():
flow4level_updated... | gpl-3.0 |
mariosky/evo-drawings | venv/lib/python2.7/site-packages/django/views/decorators/cache.py | 129 | 2286 | from functools import wraps
from django.utils.decorators import decorator_from_middleware_with_args, available_attrs
from django.utils.cache import patch_cache_control, add_never_cache_headers
from django.middleware.cache import CacheMiddleware
def cache_page(*args, **kwargs):
"""
Decorator for views that tri... | agpl-3.0 |
FabianWe/foodle | foodle/foodle_polls/filters.py | 1 | 1306 | # The MIT License (MIT)
#
# Copyright (c) 2016 Fabian Wenzelmann <fabianwenzelmann@posteo.de>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitati... | mit |
seanli9jan/tensorflow | tensorflow/contrib/receptive_field/python/util/graph_compute_order.py | 47 | 7500 | # 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 |
shahbaz17/zamboni | sites/prod/settings_mkt.py | 8 | 4322 | from mkt.settings import * # noqa
from settings_base import * # noqa
from .. import splitstrip
import private_mkt
SERVER_EMAIL = 'zmarketplaceprod@addons.mozilla.org'
SECRET_KEY = private_mkt.SECRET_KEY
DOMAIN = getattr(private_mkt, 'DOMAIN', 'marketplace.firefox.com')
SITE_URL = getattr(private_mkt, 'SITE_URL', '... | bsd-3-clause |
odyaka341/pyglet | tests/resource/RES_LOAD_IMAGE.py | 32 | 2593 | #!/usr/bin/python
# $Id:$
import os
import sys
import unittest
from pyglet.gl import *
from pyglet import image
from pyglet import resource
from pyglet import window
__noninteractive = True
# Test image is laid out
# M R
# B G
# In this test the image is sampled at four points from top-right cloc... | bsd-3-clause |
KiranJKurian/XScheduler | venv/lib/python2.7/site-packages/pip/_vendor/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 |
Bysmyyr/chromium-crosswalk | third_party/WebKit/LayoutTests/http/tests/websocket/permessage-deflate-manual_wsh.py | 43 | 4707 | # Copyright 2013, 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 fo... | bsd-3-clause |
unho/pootle | pootle/core/models/revision.py | 11 | 2038 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from ..cache import get_cache
cache = get_... | gpl-3.0 |
jtg-gg/skia | platform_tools/android/gyp_gen/vars_dict_lib.py | 146 | 4422 | #!/usr/bin/python
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
import types
# The goal of this class is to store a set of unique items in the order in
# which they are inserted. This is important for the final ... | bsd-3-clause |
uri-mog/dreampie | dreampielib/gui/file_dialogs.py | 3 | 4605 | # Copyright 2010 Noam Yorav-Raphael
#
# This file is part of DreamPie.
#
# DreamPie 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.
# ... | gpl-3.0 |
a4fr/my_nerd_bot | GoogleAppEngine/lib/requests/packages/urllib3/util/url.py | 553 | 5836 | 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... | apache-2.0 |
vitmod/enigma2-test | lib/python/Components/FanControl.py | 35 | 4097 | import os
from Components.config import config, ConfigSubList, ConfigSubsection, ConfigSlider
from Tools.BoundFunction import boundFunction
import NavigationInstance
from enigma import iRecordableService, pNavigation
from boxbranding import getBoxType
class FanControl:
# ATM there's only support for one fan
def __... | gpl-2.0 |
TeamEOS/external_chromium_org | net/tools/testserver/backoff_server.py | 189 | 2760 | #!/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.
"""This is a simple HTTP server for manually testing exponential
back-off functionality in Chrome.
"""
import BaseHTTPServer
impo... | bsd-3-clause |
bogde/xbmc.serialepenet.ro | bs4/builder/_lxml.py | 446 | 8661 | __all__ = [
'LXMLTreeBuilderForXML',
'LXMLTreeBuilder',
]
from io import BytesIO
from StringIO import StringIO
import collections
from lxml import etree
from bs4.element import Comment, Doctype, NamespacedAttribute
from bs4.builder import (
FAST,
HTML,
HTMLTreeBuilder,
PERMISSIVE,
Parse... | mit |
valentin-krasontovitsch/ansible | lib/ansible/playbook/base.py | 1 | 25893 | # Copyright: (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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_import, division, print_function)
__metaclass__ = type
import itertools
import oper... | gpl-3.0 |
gentunian/tellapic | src/client/python/pyqt/main_test.py | 2 | 14074 | from PyQt4 import QtCore, QtGui
#from waiting import Ui_Waiting
from main import Ui_Main
import pytellapic
import select
import time
import Queue
import threading
import signal
import os
class MainTest(QtGui.QDialog):
ctl = { pytellapic.CTL_CL_FILEASK : 'CTL_CL_FILEASK',
pytellapic.CTL_CL_FILEOK :... | gpl-3.0 |
partofthething/home-assistant | homeassistant/components/deconz/switch.py | 7 | 2449 | """Support for deCONZ switches."""
from homeassistant.components.switch import DOMAIN, SwitchEntity
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .const import NEW_LIGHT, POWER_PLUGS, SIRENS
from .deconz_device import DeconzDevice
from .gateway impor... | mit |
pu239ppy/carbon | lib/carbon/tests/test_cache.py | 5 | 9322 | from unittest import TestCase
from mock import Mock, PropertyMock, patch
from carbon.cache import _MetricCache, DrainStrategy, MaxStrategy, RandomStrategy, SortedStrategy
class MetricCacheTest(TestCase):
def setUp(self):
settings = {
'MAX_CACHE_SIZE': float('inf'),
'CACHE_SIZE_LOW_WATERMARK': float(... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.