repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
pombredanne/drf_tada | drf_tada/urls.py | 2 | 1698 | from django.conf.urls import patterns, include, url
from django.contrib import admin
from user.views import (UserDetailApiView, UserListApiView,
UserChangePasswordApiView)
from todo.views import (TodoBucketListApiView, TodoBucketDetailApiView)
from task.views import (TaskListApiView, TaskDetai... | bsd-3-clause |
gangadharkadam/smrterp | erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py | 8 | 3806 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt
from frappe.model.document import Document
from erpnext.stock.utils import get_valuation_met... | agpl-3.0 |
haripradhan/MissionPlanner | Lib/site-packages/numpy/lib/benchmarks/bench_arraysetops.py | 65 | 1615 | import numpy as np
import time
from numpy.lib.arraysetops import *
def bench_unique1d( plot_results = False ):
exponents = np.linspace( 2, 7, 9 )
ratios = []
nItems = []
dt1s = []
dt2s = []
for ii in exponents:
nItem = 10 ** ii
print 'using %d items:' % nItem
a = np.fix... | gpl-3.0 |
Salat-Cx65/python-for-android | python3-alpha/python3-src/Lib/msilib/schema.py | 48 | 81587 | from . import Table
_Validation = Table('_Validation')
_Validation.add_field(1,'Table',11552)
_Validation.add_field(2,'Column',11552)
_Validation.add_field(3,'Nullable',3332)
_Validation.add_field(4,'MinValue',4356)
_Validation.add_field(5,'MaxValue',4356)
_Validation.add_field(6,'KeyTable',7679)
_Validation.add_field... | apache-2.0 |
fiji-flo/servo | tests/wpt/web-platform-tests/tools/third_party/pluggy/testing/benchmark.py | 43 | 1328 | """
Benchmarking and performance tests.
"""
import pytest
from pluggy import (_multicall, _legacymulticall, HookImpl, HookspecMarker,
HookimplMarker)
hookspec = HookspecMarker("example")
hookimpl = HookimplMarker("example")
def MC(methods, kwargs, callertype, firstresult=False):
hookfuncs = [... | mpl-2.0 |
3dfxmadscientist/odoo_vi | addons/sale_mrp/__init__.py | 445 | 1062 | # -*- 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 |
odejesush/tensorflow | tensorflow/contrib/graph_editor/tests/util_test.py | 154 | 6110 | # 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 |
benfinke/ns_python | build/lib/nssrc/com/citrix/netscaler/nitro/resource/config/vpn/vpnepaprofile.py | 3 | 7146 | #
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | apache-2.0 |
rrampage/rethinkdb | external/v8_3.30.33.16/testing/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... | agpl-3.0 |
hujiajie/chromium-crosswalk | tools/telemetry/third_party/typ/typ/arg_parser.py | 33 | 13928 | # Copyright 2014 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 by applicable law or ag... | bsd-3-clause |
yangming85/lettuce | tests/integration/lib/Django-1.3/django/contrib/localflavor/fr/fr_department.py | 314 | 3326 | # -*- coding: utf-8 -*-
DEPARTMENT_ASCII_CHOICES = (
('01', '01 - Ain'),
('02', '02 - Aisne'),
('03', '03 - Allier'),
('04', '04 - Alpes-de-Haute-Provence'),
('05', '05 - Hautes-Alpes'),
('06', '06 - Alpes-Maritimes'),
('07', '07 - Ardeche'),
('08', '08 - Ardennes'),
('09', '09 - Ar... | gpl-3.0 |
gae-init/gae-init-debug | main/auth/microsoft.py | 8 | 1734 | # coding: utf-8
import flask
import auth
import config
import model
import util
from main import app
microsoft_config = dict(
access_token_method='POST',
access_token_url='https://login.live.com/oauth20_token.srf',
authorize_url='https://login.live.com/oauth20_authorize.srf',
base_url='https://apis.live.net... | mit |
tangyiyong/odoo | addons/l10n_th/__init__.py | 893 | 1045 | # -*- 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 |
pricingassistant/mrq | tests/test_subpool.py | 1 | 3033 | from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import range
from bson import ObjectId
import urllib.request, urllib.error, urllib.parse
import json
import time
import os
import pytest
@pytest.mark.parametrize(["use_worker"], [[False], [True]]... | mit |
willingc/oh-mainline | vendor/packages/twisted/doc/core/examples/wxacceptance.py | 19 | 3217 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Acceptance tests for wxreactor.
Please test on Linux, Win32 and OS X:
1. Startup event is called at startup.
2. Scheduled event is called after 2 seconds.
3. Shutdown takes 3 seconds, both when quiting from menu and when closing
window (e.... | agpl-3.0 |
takeshineshiro/swift | test/unit/common/test_daemon.py | 12 | 3492 | # Copyright (c) 2010-2012 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 or agree... | apache-2.0 |
redraw/freshbook | freshbook/cli.py | 1 | 2178 | #!/usr/bin/env python
"""
Freshbooks logger tool.
Usage:
freshbook init
freshbook commit [-d DATE] [--hours HOURS] [-m MESSAGE]
freshbook list [--since SINCE] [--until UNTIL]
freshbook -h | --help
Commands:
list List time entries. (defaults today)
commit Co... | mit |
kaustubhhiware/coala-bears | bears/coffee_script/CoffeeLintBear.py | 16 | 15115 | import json
from coalib.bearlib import deprecate_settings
from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.NpmRequirement import NpmRequirement
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
from coalib.results.Result import Result
from coala_utils.param_convers... | agpl-3.0 |
chengjunjian/vnpy | vn.strategy/strategydemo/demoApi.py | 88 | 35262 | # encoding: UTF-8
"""
该文件中包含的是交易平台的底层接口相关的部分,
主要对API进行了一定程度的简化封装,方便开发。
"""
import os
from vnctpmd import MdApi
from vnctptd import TdApi
from eventEngine import *
from ctp_data_type import defineDict
#----------------------------------------------------------------------
def print_dict(d):
"""打印API收到的字典,该函数主要用于... | mit |
michalliu/chromium-depot_tools | third_party/pylint/checkers/similar.py | 19 | 12641 | # pylint: disable=W0622
# Copyright (c) 2004-2006 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# 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 ver... | bsd-3-clause |
hexlism/xx_net | gae_proxy/server/lib/yaml/composer.py | 120 | 4226 |
__all__ = ['Composer', 'ComposerError']
from error import MarkedYAMLError
from events import *
from nodes import *
class ComposerError(MarkedYAMLError):
pass
class Composer(object):
def __init__(self):
self.anchors = {}
def check_node(self):
# Drop the STREAM-START event.
if se... | bsd-2-clause |
grandamp/certificate-transparency | python/ct/serialization/tls_message.py | 35 | 10820 | """TLS serialization."""
import math
from ct.proto import tls_options_pb2 as options
from google.protobuf import descriptor
class Error(Exception):
pass
class TLSDecodingError(Error):
"""Decoding failed."""
pass
class TLSEncodingError(Error):
"""Encoding failed."""
pass
class TLSReader(obj... | apache-2.0 |
JulienMcJay/eclock | windows/Python27/Lib/site-packages/pywin32-218-py2.7-win32.egg/pywin/Demos/ocx/ocxtest.py | 34 | 5473 | # OCX Tester for Pythonwin
#
# This file _is_ ready to run. All that is required is that the OCXs being tested
# are installed on your machine.
#
# The .py files behind the OCXs will be automatically generated and imported.
from pywin.mfc import dialog, window, activex
import win32ui, win32uiole
import win32con
impor... | gpl-2.0 |
resmo/ansible | lib/ansible/modules/cloud/cloudstack/cs_physical_network.py | 24 | 14589 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, Netservers Ltd. <support@netservers.co.uk>
# 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'],
'supported_by': '... | gpl-3.0 |
jamesandariese/dd-agent | resources/processes.py | 25 | 3135 | # stdlib
from collections import namedtuple
import subprocess
# project
from resources import (
agg,
ResourcePlugin,
SnapshotDescriptor,
SnapshotField,
)
class Processes(ResourcePlugin):
RESOURCE_KEY = "processes"
FLUSH_INTERVAL = 1 # in minutes
def describe_snapshot(self):
ret... | bsd-3-clause |
postlund/home-assistant | tests/components/minio/test_minio.py | 2 | 5241 | """Tests for Minio Hass related code."""
import asyncio
import json
from unittest.mock import MagicMock
from asynctest import call, patch
import pytest
from homeassistant.components.minio import (
CONF_ACCESS_KEY,
CONF_HOST,
CONF_LISTEN,
CONF_LISTEN_BUCKET,
CONF_PORT,
CONF_SECRET_KEY,
CONF... | apache-2.0 |
mtlchun/edx | lms/djangoapps/courseware/model_data.py | 8 | 16048 | """
Classes to provide the LMS runtime data storage to XBlocks
"""
import json
from collections import defaultdict
from itertools import chain
from .models import (
StudentModule,
XModuleUserStateSummaryField,
XModuleStudentPrefsField,
XModuleStudentInfoField
)
import logging
from opaque_keys.edx.keys ... | agpl-3.0 |
denfromufa/mipt-course | pysandbox/math_expr_evaluation_test.py | 1 | 19448 | # Copyright (c) 2012 Timur Iskhodzhanov and MIPT students. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import math
import operator
import unittest
import re
class Token(object):
def to_test_string(self):
return str(self)
cl... | bsd-3-clause |
mcsosa121/cafa | cafaenv/lib/python2.7/site-packages/django/contrib/auth/checks.py | 374 | 2098 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import apps
from django.conf import settings
from django.core import checks
def check_user_model(**kwargs):
errors = []
cls = apps.get_model(settings.AUTH_USER_MODEL)
# Check that REQUIRED_FIELDS is a list
if not isins... | mit |
oVirt/ovirt-host-deploy | src/plugins/ovirt-host-deploy/vdsm/software.py | 1 | 2249 | #
# ovirt-host-deploy -- ovirt host deployer
# Copyright (C) 2012-2013 Red Hat, Inc.
#
# 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 License, or (at your opt... | lgpl-2.1 |
vladimir-ipatov/ganeti | lib/utils/x509.py | 6 | 12570 | #
#
# Copyright (C) 2006, 2007, 2010, 2011, 2012 Google Inc.
#
# 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 License, or
# (at your option) any later version.
#
# This... | gpl-2.0 |
lanfker/vPRKS | .waf-1.6.7-0a94702c61504c487a251b8d0a04ca9a/waflib/Tools/fc.py | 4 | 4398 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/svn/docs/wafbook/single.html#_obtaining_the_waf_file
import sys
if sys.hexversion < 0x020400f0: from sets import Set as set
import re
from waflib import Utils,Task,TaskGen,Logs
from waflib.Tools import ccroot,fc_config,fc_scan
f... | gpl-2.0 |
q437634645/three.js | utils/converters/obj/split_obj.py | 369 | 12687 | """Split single OBJ model into mutliple OBJ files by materials
-------------------------------------
How to use
-------------------------------------
python split_obj.py -i infile.obj -o outfile
Will generate:
outfile_000.obj
outfile_001.obj
...
outfile_XXX.obj
-------------------------------------
Parser based ... | mit |
Pluto-tv/chromium-crosswalk | tools/telemetry/third_party/webpagereplay/proxyshaper_test.py | 31 | 4988 | #!/usr/bin/env python
# Copyright 2012 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... | bsd-3-clause |
imclab/datashape | docs/source/conf.py | 1 | 8044 | # -*- coding: utf-8 -*-
#
# DataShape documentation build configuration file, created by
# sphinx-quickstart on Thu Dec 12 15:38:28 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | bsd-2-clause |
seanwestfall/django | tests/forms_tests/tests/test_error_messages.py | 169 | 11182 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms import (
BooleanField, CharField, ChoiceField, DateField, DateTimeField,
DecimalField, EmailField, FileField, FloatField, Form,
GenericIPAddressField, IntegerField... | bsd-3-clause |
HyperBaton/ansible | lib/ansible/modules/network/fortios/fortios_wireless_controller_hotspot20_h2qp_wan_metric.py | 7 | 11983 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... | gpl-3.0 |
shubhdev/edxOnBaadal | lms/djangoapps/courseware/tests/test_microsites.py | 42 | 10298 | """
Tests related to the Microsites feature
"""
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from nose.plugins.attrib import attr
from courseware.tests.helpers import LoginEnrollmentTestCase
from course_modes.models import CourseMode
from... | agpl-3.0 |
davjohnst/fundamentals | fundamentals/recursion/copy_paste.py | 1 | 2597 | #!/usr/bin/env python
from fundamentals.adv_python.context_management.cm_examples import time_print
"""
You have four keys at your disposal.
You can type keys 'n' times.
You want to maximize the number of characters in your 'text editor'
Keys:
- type an 'a'
- select all
- copy
- append paste buffer
"""
# recurs... | apache-2.0 |
xuxiao19910803/edx-platform | common/test/acceptance/pages/studio/html_component_editor.py | 115 | 1139 | from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from component_editor import ComponentEditorView
class HtmlComponentEditorView(ComponentEditorView):
"""
Represents the rendered view of an HTML component editor.
"""
def set_content_and_sa... | agpl-3.0 |
EmadMokhtar/Django | tests/auth_tests/test_decorators.py | 13 | 4143 | from django.conf import settings
from django.contrib.auth import models
from django.contrib.auth.decorators import login_required, permission_required
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
from django.test import TestCase, override_settings
from django.test.client impo... | mit |
Krossom/python-for-android | python3-alpha/extra_modules/gdata/exif/__init__.py | 45 | 6980 | # -*-*- encoding: utf-8 -*-*-
#
# This is gdata.photos.exif, implementing the exif namespace in gdata
#
# $Id: __init__.py 81 2007-10-03 14:41:42Z havard.gulldahl $
#
# Copyright 2007 Håvard Gulldahl
# Portions copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not... | apache-2.0 |
mhugo/QGIS | python/plugins/processing/algs/qgis/voronoi.py | 4 | 29796 | # -*- coding: utf-8 -*-
"""
***************************************************************************
voronoi.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*******************************... | gpl-2.0 |
google/airdialogue | airdialogue/prepro/standardize_data_lib.py | 1 | 4706 | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
shaftoe/home-assistant | homeassistant/components/sensor/fitbit.py | 2 | 15144 | """
Support for the Fitbit API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.fitbit/
"""
import os
import json
import logging
import datetime
import time
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.compo... | apache-2.0 |
kawasaki2013/python-for-android-x86 | python-modules/twisted/twisted/python/compat.py | 59 | 5773 | # -*- test-case-name: twisted.test.test_compat -*-
#
# Copyright (c) 2001-2007 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Compatibility module to provide backwards compatibility for useful Python
features.
This is mainly for use of internal Twisted code. We encourage you to use
the latest version of... | apache-2.0 |
Linkid/fofix | fofix/tests/game/test_menu.py | 3 | 1568 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# FoFiX
# Copyright (C) 2017 FoFiX team
#
# 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 License, or
# (at your option) any la... | gpl-2.0 |
Immortalin/python-for-android | python3-alpha/python3-src/Lib/xml/etree/ElementPath.py | 785 | 9477 | #
# ElementTree
# $Id: ElementPath.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xpath support for element trees
#
# history:
# 2003-05-23 fl created
# 2003-05-28 fl added support for // etc
# 2003-08-27 fl fixed parsing of periods in element names
# 2007-09-10 fl new selection engine
# 2007-09-12 fl fix... | apache-2.0 |
leiferikb/bitpop-private | chrome/test/functional/chromeos_onc.py | 4 | 4794 | #!/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.
import os
import pyauto_functional # must come before pyauto.
import policy_base
import pyauto
class ChromeosONC(policy_base.Po... | bsd-3-clause |
KaiRo-at/socorro | socorro/unittest/external/postgresql/test_server_status.py | 2 | 6792 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import datetime
import os
import socorro
from nose.tools import eq_
from socorro.external.postgresql import server_stat... | mpl-2.0 |
arifgursel/pyglet | pyglet/canvas/win32.py | 26 | 3425 | #!/usr/bin/python
# $Id:$
from base import Display, Screen, ScreenMode, Canvas
from pyglet.libs.win32 import _kernel32, _user32, types, constants
from pyglet.libs.win32.constants import *
from pyglet.libs.win32.types import *
class Win32Display(Display):
def get_screens(self):
screens = []
... | bsd-3-clause |
117111302/jenkinsapi | jenkinsapi_tests/unittests/test_node.py | 6 | 2352 | import mock
# To run unittests on python 2.6 please use unittest2 library
try:
import unittest2 as unittest
except ImportError:
import unittest
from jenkinsapi.node import Node
class TestNode(unittest.TestCase):
DATA = {"actions": [],
"displayName": "bobnit",
"executors": [{}],
... | mit |
Khan/git-bigfile | vendor/boto/rds/optiongroup.py | 180 | 15665 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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 limitation the rights... | mit |
damonkohler/sl4a | python/src/Demo/rpc/xdr.py | 42 | 5047 | # Implement (a subset of) Sun XDR -- RFC1014.
try:
import struct
except ImportError:
struct = None
Long = type(0L)
class Packer:
def __init__(self):
self.reset()
def reset(self):
self.buf = ''
def get_buf(self):
return self.buf
def pack_uint(self, x):
se... | apache-2.0 |
bikong2/scikit-learn | sklearn/mixture/tests/test_dpgmm.py | 261 | 4490 | import unittest
import sys
import numpy as np
from sklearn.mixture import DPGMM, VBGMM
from sklearn.mixture.dpgmm import log_normalize
from sklearn.datasets import make_blobs
from sklearn.utils.testing import assert_array_less, assert_equal
from sklearn.mixture.tests.test_gmm import GMMTester
from sklearn.externals.s... | bsd-3-clause |
wouwei/PiLapse | picam/picamEnv/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py | 353 | 3380 | from __future__ import absolute_import
import socket
try:
from select import poll, POLLIN
except ImportError: # `poll` doesn't exist on OSX and other platforms
poll = False
try:
from select import select
except ImportError: # `select` doesn't exist on AppEngine.
select = False
def is... | apache-2.0 |
danceos/dosek | generator/statistics.py | 1 | 3355 | import pprint
class Statistics:
def __init__(self, root):
self.tree = self.__new_node(root)
self.idx = {id(root): self.tree}
def __new_node(self, item):
return {"_id": id(item), "_type": item.__class__.__name__,
"_name": repr(item)}
def __stringify(self, obj):
... | lgpl-3.0 |
egaxegax/django-dbcartajs | django/contrib/gis/gdal/layer.py | 219 | 8758 | # Needed ctypes routines
from ctypes import c_double, byref
# Other GDAL imports.
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.envelope import Envelope, OGREnvelope
from django.contrib.gis.gdal.error import OGRException, OGRIndexError, SRSException
from django.contrib.gis.gdal.feature... | gpl-2.0 |
mxia/engine | build/android/pylib/remote/device/appurify_sanitized.py | 51 | 1146 | # 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.
import contextlib
import logging
import os
import sys
from pylib import constants
sys.path.append(os.path.join(
constants.DIR_SOURCE_ROOT, 'third_party... | bsd-3-clause |
hyperized/ansible | lib/ansible/modules/network/fortios/fortios_switch_controller_storm_control.py | 13 | 10044 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... | gpl-3.0 |
jemekite/youtube-dl | youtube_dl/extractor/pornhub.py | 51 | 5647 | from __future__ import unicode_literals
import os
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_unquote,
compat_urllib_parse_unquote_plus,
compat_urllib_parse_urlparse,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
str_to_int,
)
from ..... | unlicense |
tiagormk/gem5-hmp | src/arch/x86/isa/insts/simd64/floating_point/arithmetic/reciprocal_estimation.py | 91 | 2172 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# 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 implemen... | bsd-3-clause |
chauhanhardik/populo | common/djangoapps/course_modes/migrations/0006_expiration_date_to_datetime.py | 173 | 2009 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
from datetime import datetime
for course_mode in orm.CourseMode.objects.all():
if course_mode.expirat... | agpl-3.0 |
CMSS-BCRDB/RDS | trove/version.py | 7 | 1392 | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
inviwo/inviwo | tools/converters/update_itf.py | 2 | 1918 | #requires lxml, and beautifulsoup4
#To install lxml
#Install lxml on Windows: https://pypi.python.org/pypi/lxml/3.3.3
#To install beautifulsoup4
#In Windows, run cmd as admin"
#Run "python get-pip.py" script to install pip
#Navigate to "PythonPath/Scripts"
#Run "pip install beautifulsoup4"
import sys
import os
impor... | bsd-2-clause |
openstack/oslo.utils | oslo_utils/tests/test_eventletutils.py | 1 | 8513 | # Copyright 2012, Red Hat, 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 agr... | apache-2.0 |
manashmndl/scikit-learn | sklearn/feature_selection/variance_threshold.py | 238 | 2594 | # Author: Lars Buitinck <L.J.Buitinck@uva.nl>
# License: 3-clause BSD
import numpy as np
from ..base import BaseEstimator
from .base import SelectorMixin
from ..utils import check_array
from ..utils.sparsefuncs import mean_variance_axis
from ..utils.validation import check_is_fitted
class VarianceThreshold(BaseEstim... | bsd-3-clause |
codekaki/odoo | addons/stock/partner.py | 57 | 1890 | # -*- 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 |
boedy1996/SPARC | geonode/catalogue/backends/pycsw_local.py | 3 | 6015 | #########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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
#... | gpl-3.0 |
msabramo/ansible | lib/ansible/modules/remote_management/hpilo/hponcfg.py | 66 | 2841 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Dag Wieers <dag@wieers.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, ... | gpl-3.0 |
adrienbrault/home-assistant | tests/components/aprs/test_device_tracker.py | 10 | 10449 | """Test APRS device tracker."""
from unittest.mock import Mock, patch
import aprslib
import homeassistant.components.aprs.device_tracker as device_tracker
from homeassistant.const import EVENT_HOMEASSISTANT_START
from tests.common import get_test_home_assistant
DEFAULT_PORT = 14580
TEST_CALLSIGN = "testcall"
TEST_... | mit |
lthurlow/Network-Grapher | proj/external/matplotlib-1.2.1/build/lib.linux-i686-2.7/matplotlib/backends/tkagg.py | 6 | 1063 | from __future__ import print_function
from matplotlib.backends import _tkagg
import Tkinter as Tk
def blit(photoimage, aggimage, bbox=None, colormode=1):
tk = photoimage.tk
if bbox is not None:
bbox_array = bbox.__array__()
else:
bbox_array = None
try:
tk.call("PyAggImagePhoto"... | mit |
dschien/tasks-backup | apiclient/ext/appengine.py | 52 | 4139 | # Copyright (C) 2010 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 writ... | apache-2.0 |
ArcherSys/ArcherSys | Lib/site-packages/twisted/protocols/loopback.py | 4 | 11925 | # -*- test-case-name: twisted.test.test_loopback -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Testing support for protocols -- loopback between client and server.
"""
from __future__ import division, absolute_import
# system imports
import tempfile
from zope.interface import imple... | mit |
peterfpeterson/mantid | Testing/SystemTests/tests/framework/MultiThreadedLoadNeXusTest.py | 3 | 3078 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2020 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
impo... | gpl-3.0 |
slank/ansible | lib/ansible/modules/cloud/ovirt/ovirt_hosts_facts.py | 12 | 3407 | #!/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 |
danielru/pySDC | pySDC/implementations/datatype_classes/mesh.py | 1 | 8383 | import numpy as np
import copy as cp
from pySDC.core.Errors import DataError
class mesh(object):
"""
Mesh data type with arbitrary dimensions
This data type can be used whenever structured data with a single unknown per point in space is required
Attributes:
values (np.ndarray): contains th... | bsd-2-clause |
cloudenvy/cloudenvy | setup.py | 1 | 1039 | try:
from setuptools import setup
except:
from distutils.core import setup
import cloudenvy.metadata
def parse_requirements(requirements_filename='requirements.txt'):
requirements = []
with open(requirements_filename) as requirements_file:
for requirement in requirements_file:
req... | apache-2.0 |
beezee/GAE-Django-site | django/contrib/gis/db/backends/spatialite/models.py | 403 | 1847 | """
The GeometryColumns and SpatialRefSys models for the SpatiaLite backend.
"""
from django.db import models
from django.contrib.gis.db.backends.base import SpatialRefSysMixin
class GeometryColumns(models.Model):
"""
The 'geometry_columns' table from SpatiaLite.
"""
f_table_name = models.CharField(ma... | bsd-3-clause |
direvus/ansible | lib/ansible/parsing/utils/jsonify.py | 124 | 1233 | # (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 |
jussimalinen/robotframework-selenium2library | src/Selenium2Library/locators/elementfinder.py | 32 | 6478 | from Selenium2Library import utils
class ElementFinder(object):
def __init__(self):
self._strategies = {
'identifier': self._find_by_identifier,
'id': self._find_by_id,
'name': self._find_by_name,
'xpath': self._find_by_xpath,
'dom': self._find_b... | apache-2.0 |
CaeruleusAqua/OpenDaVINCI-python-interface | setup.py | 1 | 4249 | """A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from codecs import open
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
#... | gpl-2.0 |
ShoRit/shipping-costs-sample | v2/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.py | 536 | 9371 | # -*- coding: utf-8 -*-
"""
lockfile.py - Platform-independent advisory file locks.
Requires Python 2.5 unless you apply 2.4.diff
Locking is done on a per-thread basis instead of a per-process basis.
Usage:
>>> lock = LockFile('somefile')
>>> try:
... lock.acquire()
... except AlreadyLocked:
... print 'some... | apache-2.0 |
mozilla/firefox-flicks | vendor-local/lib/python/celery/app/amqp.py | 1 | 14390 | # -*- coding: utf-8 -*-
"""
celery.app.amqp
~~~~~~~~~~~~~~~
Sending and receiving messages using Kombu.
"""
from __future__ import absolute_import
from datetime import timedelta
from weakref import WeakValueDictionary
from kombu import Connection, Consumer, Exchange, Producer, Queue
from kombu.common im... | bsd-3-clause |
ar4s/django | tests/template_tests/test_unicode.py | 6 | 1357 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import TestCase
from django.template import Template, TemplateEncodingError, Context
from django.utils.safestring import SafeData
from django.utils import six
class UnicodeTests(TestCase):
def test_template(self):
# Templates ... | bsd-3-clause |
open-synergy/server-tools | password_security/tests/test_password_security_home.py | 11 | 11224 | # -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
import mock
from contextlib import contextmanager
from openerp.tests.common import TransactionCase
from openerp.http import Response
from ..controllers import main
IMPORT = 'openerp.addons.pa... | agpl-3.0 |
luotao1/Paddle | python/paddle/fluid/tests/unittests/dygraph_to_static/test_for_enumerate.py | 2 | 12869 | # Copyright (c) 2020 PaddlePaddle 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 app... | apache-2.0 |
vijayendrabvs/hap | neutron/plugins/mlnx/agent/utils.py | 8 | 5692 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 Mellanox Technologies, Ltd
#
# 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 |
daviddupont69/CouchPotatoServer | libs/chardet/langhebrewmodel.py | 235 | 11340 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Simon Montagu
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved... | gpl-3.0 |
dulems/hue | desktop/core/ext-py/Babel-0.9.6/babel/messages/plurals.py | 67 | 7207 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007 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.
#
# This software cons... | apache-2.0 |
internaphosting/fake-switches | fake_switches/brocade/command_processor/enabled.py | 4 | 18515 | # Copyright 2015-2016 Internap.
#
# 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 writin... | apache-2.0 |
pczerkas/tempest | tempest/services/messaging/json/messaging_client.py | 17 | 6586 | # Copyright (c) 2014 Rackspace, 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 wr... | apache-2.0 |
hmen89/odoo | addons/account_asset/__openerp__.py | 122 | 2168 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
MicroMagnum/MicroMagnum | src/magnum/micromagnetics/world/body.py | 1 | 1780 | # Copyright 2012, 2013 by the Micromagnum authors.
#
# This file is part of MicroMagnum.
#
# MicroMagnum 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) a... | gpl-3.0 |
blancha/abcngspipelines | sra/getsra.py | 1 | 2427 | #!/usr/bin/env python3
# Author Alexis Blanchet-Cohen
# Date: 09/06/2014
import argparse
import os
import os.path
import pandas
import subprocess
import util
# Read the command line arguments.
parser = argparse.ArgumentParser(description="Generates scripts to download SRA files.")
parser.add_argument("-s", "--scrip... | gpl-3.0 |
fyfcauc/android_external_chromium-org | net/tools/testserver/asn1.py | 180 | 3751 | # 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 file implements very minimal ASN.1, DER serialization.
import types
def ToDER(obj):
'''ToDER converts the given object into DER encoding'''
... | bsd-3-clause |
BrotherPhil/django | django/contrib/postgres/fields/jsonb.py | 341 | 2994 | import json
from psycopg2.extras import Json
from django.contrib.postgres import forms, lookups
from django.core import exceptions
from django.db.models import Field, Transform
from django.utils.translation import ugettext_lazy as _
__all__ = ['JSONField']
class JSONField(Field):
empty_strings_allowed = False
... | bsd-3-clause |
mosbasik/buzhug | javasrc/lib/Jython/Lib/test/test_coercion.py | 19 | 11217 | import copy
import sys
import warnings
import unittest
from test.test_support import run_unittest, TestFailed
# Fake a number that implements numeric methods through __coerce__
class CoerceNumber:
def __init__(self, arg):
self.arg = arg
def __repr__(self):
return '<CoerceNumber %s>' % repr(sel... | bsd-3-clause |
hidenori-t/chainer | tests/cupy_tests/creation_tests/test_from_data.py | 11 | 2084 | import unittest
import numpy
import cupy
from cupy import testing
@testing.gpu
class TestFromData(unittest.TestCase):
_multiprocess_can_split_ = True
@testing.for_all_dtypes()
@testing.numpy_cupy_array_equal()
def test_array(self, xp, dtype):
return xp.array([[1, 2, 3], [2, 3, 4]], dtype=d... | mit |
azatoth/scons | test/QT/moc-from-cpp.py | 5 | 2889 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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 limitation the rights to use, copy, modify, merge, publish,
... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.