repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
minhphung171093/GreenERP_V9 | refs/heads/master | openerp/addons/base/module/wizard/base_module_configuration.py | 46 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.osv import osv
from openerp.tools.translate import _
class base_module_configuration(osv.osv_memory):
_name = "base.module.configuration"
def start(self, cr, uid, ids, context=None):
todo_... |
dmsimard/ara | refs/heads/master | ara/ui/templatetags/datetime_formatting.py | 1 | # Copyright (c) 2019 Red Hat, Inc.
#
# This file is part of ARA Records Ansible.
#
# ARA 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 v... |
coffenbacher/askbot-devel | refs/heads/master | askbot/management/commands/askbot_update_index.py | 9 | import sys
from optparse import make_option
from django.core.management import get_commands, load_command_class
from django.utils.translation import activate as activate_language
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
try:
from haystack.management.comman... |
cjh1/VTK | refs/heads/master | Rendering/Core/Testing/Python/cameraWarpedCone.py | 28 | #!/usr/bin/env python
import vtk
# create a rendering window and renderer
ren = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren)
renWin.SetSize(300,300)
# create an actor and give it cone geometry
cone = vtk.vtkConeSource()
cone.SetResolution(8)
coneMapper = vtk.vtkPolyDataMapper()
coneMapper... |
poojavade/Genomics_Docker | refs/heads/master | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/radical.utils-0.7.7-py2.7.egg/radical/utils/test_config.py | 5 |
__author__ = "Radical.Utils Development Team (Andre Merzky, Ole Weidner)"
__copyright__ = "Copyright 2013, RADICAL@Rutgers"
__license__ = "MIT"
import radical.utils.testing as rut
# ------------------------------------------------------------------------------
#
class TestConfig (rut.TestConfig):
#-----... |
CalthorpeAnalytics/urbanfootprint | refs/heads/master | footprint/client/configuration/scag_dm/config_entity/scag_dm_project.py | 1 |
# UrbanFootprint v1.5
# Copyright (C) 2017 Calthorpe Analytics
#
# This file is part of UrbanFootprint version 1.5
#
# UrbanFootprint is distributed under the terms of the GNU General
# Public License version 3, as published by the Free Software Foundation. This
# code is distributed WITHOUT ANY WARRANTY, without impl... |
olavvatne/CNN | refs/heads/master | elements/convpool.py | 1 | import theano
from theano import tensor as T
from theano.tensor.nnet import conv
from theano.sandbox.cuda import dnn
from theano.tensor.signal import pool
import numpy as np
from elements.util import BaseLayer
class ConvPoolLayer(BaseLayer):
'''
This class initialize a convolutional layer. Parameters supplied ... |
jrjang/mbed | refs/heads/master | workspace_tools/host_tests/host_tests_plugins/host_test_plugins.py | 92 | """
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... |
SlimRoms/android_external_chromium_org | refs/heads/lp5.0 | ppapi/native_client/tools/browser_tester/browsertester/__init__.py | 176 | # 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.
# Empty but necessary
|
KyleJamesWalker/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_nics_facts.py | 26 | #!/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
#... |
eric-haibin-lin/mxnet | refs/heads/master | tools/ipynb2md.py | 11 | #!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... |
brian-yang/mozillians | refs/heads/master | vendor-local/lib/python/celery/tests/test_backends/test_amqp.py | 14 | from __future__ import absolute_import
from __future__ import with_statement
import socket
import sys
from datetime import timedelta
from Queue import Empty, Queue
from celery import current_app
from celery import states
from celery.app import app_or_default
from celery.backends.amqp import AMQPBackend
from celery.d... |
aruizramon/alec_erpnext | refs/heads/master | erpnext/hr/doctype/earning_type/earning_type.py | 66 | # 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.model.document import Document
class EarningType(Document):
pass |
Akhavi/bigcouch | refs/heads/master | couchjs/scons/scons-local-2.0.1/SCons/Tool/sunlink.py | 61 | """SCons.Tool.sunlink
Tool-specific initialization for the Sun Solaris (Forte) linker.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2... |
habnabit/divmod-sine | refs/heads/master | sine/test/historic/stub_sipDispatcherService2to3.py | 2 | # -*- test-case-name: sine.test.historic.test_sipDispatcher2to3 -*-
from axiom.test.historic.stubloader import saveStub
from axiom.dependency import installOn
from sine.sipserver import SIPDispatcherService
def createDatabase(s):
installOn(SIPDispatcherService(store=s), s)
if __name__ == '__main__':
saveStu... |
mancoast/CPythonPyc_test | refs/heads/master | cpython/275_test_difflib.py | 87 | import difflib
from test.test_support import run_unittest, findfile
import unittest
import doctest
import sys
class TestWithAscii(unittest.TestCase):
def test_one_insert(self):
sm = difflib.SequenceMatcher(None, 'b' * 100, 'a' + 'b' * 100)
self.assertAlmostEqual(sm.ratio(), 0.995, places=3)
... |
sh4wn/vispy | refs/heads/master | examples/basics/scene/shared_context.py | 17 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -------------------------------------------------------------------------... |
noba3/KoTos | refs/heads/master | addons/plugin.video.netzkino_de/resources/lib/kodion/constants/__init__.py | 6 | __all__ = []
import const_settings as setting
import const_log as log
import const_localize as localize
import const_sort_methods as sort_method
import const_content_types as content_type
import const_paths as paths |
matrixise/odoo | refs/heads/8.0 | openerp/addons/base/tests/test_xmlrpc.py | 90 | # -*- coding: utf-8 -*-
import openerp.tests.common
DB = openerp.tests.common.DB
class test_xmlrpc(openerp.tests.common.HttpCase):
at_install = False
post_install = True
def test_01_xmlrpc_login(self):
""" Try to login on the common service. """
uid = self.xmlrpc_common.login(DB, 'admin',... |
pidydx/grr | refs/heads/master | grr/lib/rdfvalues/standard.py | 2 | #!/usr/bin/env python
"""Standard RDFValues."""
import re
import urlparse
from grr.lib import config_lib
from grr.lib import rdfvalue
from grr.lib import type_info
from grr.lib.rdfvalues import structs as rdf_structs
from grr.proto import jobs_pb2
from grr.proto import sysinfo_pb2
class RegularExpression(rdfvalue.... |
DarkRebel/myrobotlab | refs/heads/master | src/resource/Python/examples/Tracking.safe.modified.worky.py | 5 | # a safe tracking script - servos are created seperately
# and their limits are programmed, they are then "bound" to
# the tracking service
tracker = Runtime.create("tracker","Tracking")
# create servos BEFORE starting the tracking service
# so we can specify values for the servos and specify names
# before it starts... |
Bachaco-ve/odoo | refs/heads/8.0 | addons/website_gengo/controllers/main.py | 350 | # -*- coding: utf-8 -*-
import openerp
from openerp import http, SUPERUSER_ID
from openerp.http import request
import time
GENGO_DEFAULT_LIMIT = 20
class website_gengo(http.Controller):
@http.route('/website/get_translated_length', type='json', auth='user', website=True)
def get_translated_length(self, tran... |
starvingprogrammer/pynag | refs/heads/master | examples/Parsers/get_contactgroup.py | 3 | #!/usr/bin/python
import sys
if len(sys.argv) != 2:
sys.stderr.write("Usage: %s 'Contactgroup Name'\n" % (sys.argv[0]))
sys.exit(2)
## This is for the custom nagios module
sys.path.insert(1, '../')
from pynag.Parsers import config
target_item = sys.argv[1]
## Create the plugin option
nc = config('/etc/nagi... |
trg1984/kooditunti | refs/heads/master | public/blockly-games/appengine/storage.py | 3 | """Blockly Games: Storage
Copyright 2012 Google Inc.
https://github.com/google/blockly-games
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 re... |
CWVanderReyden/originalMyHomeNet | refs/heads/master | Lib/encodings/mac_cyrillic.py | 593 | """ Python Character Mapping Codec mac_cyrillic generated from 'MAPPINGS/VENDORS/APPLE/CYRILLIC.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,inp... |
Symmetry-Innovations-Pty-Ltd/Python-2.7-for-QNX6.5.0-x86 | refs/heads/master | usr/pkg/lib/python2.7/__phello__.foo.py | 516 | # This file exists as a helper for the test.test_frozen module.
|
codrut3/tensorflow | refs/heads/master | tensorflow/python/ops/distributions/bijector_test_util.py | 81 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
rockyzhang/zhangyanhit-python-for-android-mips | refs/heads/master | python3-alpha/python3-src/Lib/ctypes/test/test_stringptr.py | 50 | import unittest
from ctypes import *
import _ctypes_test
lib = CDLL(_ctypes_test.__file__)
class StringPtrTestCase(unittest.TestCase):
def test__POINTER_c_char(self):
class X(Structure):
_fields_ = [("str", POINTER(c_char))]
x = X()
# NULL pointer access
self.assertR... |
gpetretto/pymatgen | refs/heads/master | pymatgen/entries/exp_entries.py | 7 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
"""
This module defines Entry classes for containing experimental data.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Proj... |
chuchiperriman/FolderFilesAnalyzer | refs/heads/master | test_liten2.py | 2 | import unittest
#!/usr/bin/env python
"""
Tests for Liten2
"""
import unittest
import sqlite3
from time import strftime
import os
import liten2
class TestWalk(unittest.TestCase):
def test_findthis(self):
path = os.getcwd()
size = 1048576
walk = liten2.Walk(path, size)
walk.find... |
BackupGGCode/python-for-android | refs/heads/master | python3-alpha/extra_modules/gdata/tlslite/utils/compat.py | 48 | """Miscellaneous functions to mask Python version differences."""
import sys
import os
if sys.version_info < (2,2):
raise AssertionError("Python 2.2 or later required")
if sys.version_info < (2,3):
def enumerate(collection):
return list(zip(list(range(len(collection))), collection))
class Set:
... |
syaiful6/django | refs/heads/master | tests/auth_tests/test_forms.py | 228 | from __future__ import unicode_literals
import datetime
import re
from django import forms
from django.contrib.auth.forms import (
AdminPasswordChangeForm, AuthenticationForm, PasswordChangeForm,
PasswordResetForm, ReadOnlyPasswordHashField, ReadOnlyPasswordHashWidget,
SetPasswordForm, UserChangeForm, Use... |
Jgarcia-IAS/localizacion | refs/heads/master | openerp/addons-extra/odoo-pruebas/odoo-server/addons/event_sale/event_sale.py | 48 | # -*- 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... |
curtisstpierre/django | refs/heads/master | tests/i18n/sampleproject/update_catalogs.py | 344 | #!/usr/bin/env python
"""
Helper script to update sampleproject's translation catalogs.
When a bug has been identified related to i18n, this helps capture the issue
by using catalogs created from management commands.
Example:
The string "Two %% Three %%%" renders differently using trans and blocktrans.
This issue i... |
StealthMicro/OctoPi-Makerbot | refs/heads/master | env/Lib/site-packages/pip/_vendor/distlib/scripts.py | 163 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from io import BytesIO
import logging
import os
import re
import struct
import sys
from .compat import sysconfig, fsencode, detect_encoding, ... |
geopython/pycsw | refs/heads/master | tests/functionaltests/conftest.py | 4 | # =================================================================
#
# Authors: Ricardo Garcia Silva <ricardo.garcia.silva@gmail.com>
#
# Copyright (c) 2016 Ricardo Garcia Silva
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the... |
axbaretto/beam | refs/heads/master | sdks/python/.tox/lint/lib/python2.7/site-packages/pylint/test/input/func_w0401_package/thing2.py | 15 | """The second thing."""
# pylint: disable=no-absolute-import
from .all_the_things import THING1
__revision__ = None
THING2 = "I am thing2"
THING1_PLUS_THING2 = "%s, plus %s" % (THING1, THING2)
|
anirudhjayaraman/Dato-Core | refs/heads/master | src/unity/python/graphlab/data_structures/gframe.py | 13 | '''
Copyright (C) 2015 Dato, Inc.
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the DATO-PYTHON-LICENSE file for details.
'''
from graphlab.data_structures.sframe import SFrame
from graphlab.data_structures.sframe import SArray
from graphlab.cython.context i... |
HopeFOAM/HopeFOAM | refs/heads/master | ThirdParty-0.1/ParaView-5.0.1/VTK/Filters/Core/Testing/Python/TestFlyingEdgesPlaneCutter.py | 5 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
useFECutter = 1
res = 100
# Create the RenderWindow, Renderer and both Actors
#
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.SetMultiSamples(0)
renWin.AddRenderer(r... |
spock1104/android_kernel_zte_msm8960 | refs/heads/master | Documentation/target/tcm_mod_builder.py | 4981 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... |
ihsanudin/odoo | refs/heads/8.0 | addons/auth_crypt/auth_crypt.py | 179 | import logging
from passlib.context import CryptContext
import openerp
from openerp.osv import fields, osv
from openerp.addons.base.res import res_users
res_users.USER_PRIVATE_FIELDS.append('password_crypt')
_logger = logging.getLogger(__name__)
default_crypt_context = CryptContext(
# kdf which can be verified... |
jicruz/heroku-bot | refs/heads/master | lib/youtube_dl/extractor/curiositystream.py | 32 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
urlencode_postdata,
compat_str,
ExtractorError,
)
class CuriosityStreamBaseIE(InfoExtractor):
_NETRC_MACHINE = 'curiositystream'
_auth_token = None
_API_... |
11craft/immercv | refs/heads/master | immercv/contrib/__init__.py | 14224 | # -*- coding: utf-8 -*-
|
disruptek/boto | refs/heads/develop | boto/ec2/spotpricehistory.py | 152 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# 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, modi... |
int19h/PTVS | refs/heads/master | Python/Tests/TestData/VirtualEnv/env/Lib/genericpath.py | 246 | """
Path operations common to more than one OS
Do not use directly. The OS specific modules import the appropriate
functions from this module themselves.
"""
import os
import stat
__all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime',
'getsize', 'isdir', 'isfile']
# Does a path exist?
#... |
mzizzi/ansible | refs/heads/devel | lib/ansible/modules/monitoring/sensu_subscription.py | 17 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Anders Ingemann <aim@secoya.dk>
#
# 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 Licen... |
postla/e2-gui | refs/heads/master | lib/python/Components/ResourceManager.py | 33 | class ResourceManager:
def __init__(self):
self.resourceList = {}
def addResource(self, name, resource):
print "adding Resource", name
self.resourceList[name] = resource
print "resources:", self.resourceList
def getResource(self, name):
if not self.hasResource(name):
return None
return self.r... |
jjscarafia/odoo | refs/heads/master | addons/marketing_campaign_crm_demo/__init__.py | 450 | # Debian packaging removes blank files, so this comment is added.
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
mattf-horton/metron | refs/heads/master | build_utils/verify_license.py | 25 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may n... |
BigBrother-International/gst-cerbero | refs/heads/master | setup.py | 19 | import os
import sys
import shutil
from setuptools import setup, find_packages
from cerbero.utils import shell
sys.path.insert(0, './cerbero')
# Utility function to read the README file.
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
# Utility function to parse directories
... |
splunk/splunk-webframework-toolkit | refs/heads/master | splunk_wftoolkit/django/splunk_wftoolkit/forms.py | 1 | from splunkdj.setup import forms # (1): NOT from django import forms
class SetupForm(forms.Form):
email = forms.EmailField(
endpoint='configs/conf-setup', entity='auth', field='email', # (2)
max_length=100)
password = forms.CharField(
endpoint='configs/conf-setup', entity='auth', ... |
kpgriffith/kubernetes | refs/heads/master | translations/extract.py | 136 | #!/usr/bin/env python
# Copyright 2017 The Kubernetes Authors.
#
# 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 appli... |
jcoady9/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/urllib/robotparser.py | 55 | """ robotparser.py
Copyright (C) 2000 Bastian Kleineidam
You can choose between two licenses when using this package:
1) GNU GPLv2
2) PSF license for Python 2.2
The robots.txt Exclusion Protocol is implemented as specified in
http://info.webcrawler.com/mak/projects/robots/norobots-rfc.html
"... |
be-cloud-be/horizon-addons | refs/heads/9.0 | server-tools/datetime_formatter/__openerp__.py | 2 | # -*- coding: utf-8 -*-
# © 2015 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis
# © 2016 Tecnativa, S.L. - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Date & Time Formatter",
"summary": "Helper functions to give correct format to date[time] fields",... |
ccomb/OpenUpgrade | refs/heads/master | openerp/addons/base/tests/test_db_cursor.py | 175 | # -*- coding: utf-8 -*-
import unittest2
import openerp
from openerp.tools.misc import mute_logger
from openerp.tests import common
DB = common.DB
ADMIN_USER_ID = common.ADMIN_USER_ID
def registry():
return openerp.modules.registry.RegistryManager.get(DB)
class test_cr_execute(unittest2.TestCase):
""" Try... |
grace-/opencv-3.0.0-cvpr | refs/heads/master | opencv/samples/python2/color_histogram.py | 8 | #!/usr/bin/env python
import numpy as np
import cv2
from time import clock
import sys
import video
if __name__ == '__main__':
hsv_map = np.zeros((180, 256, 3), np.uint8)
h, s = np.indices(hsv_map.shape[:2])
hsv_map[:,:,0] = h
hsv_map[:,:,1] = s
hsv_map[:,:,2] = 255
hsv_map = cv2.cvtColor(hsv... |
tchellomello/home-assistant | refs/heads/dev | homeassistant/components/fan/device_trigger.py | 9 | """Provides device automations for Fan."""
from typing import List
import voluptuous as vol
from homeassistant.components.automation import AutomationActionType
from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA
from homeassistant.components.homeassistant.triggers import state as state_trigger... |
WesternStar/tilinux | refs/heads/master | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | 4653 | # EventClass.py
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
#
# Currently there are just a few classes defined for examples,
# PerfEvent is the base class for all perf event sample, PebsEvent
# is a HW base Intel x86 PEBS event, and use... |
simonpatrick/bite-project | refs/heads/master | deps/gdata-python-client/src/gdata/Crypto/PublicKey/__init__.py | 273 | """Public-key encryption and signature algorithms.
Public-key encryption uses two different keys, one for encryption and
one for decryption. The encryption key can be made public, and the
decryption key is kept private. Many public-key algorithms can also
be used to sign messages, and some can *only* be used for sig... |
miaoski/shadowsocks | refs/heads/master | shadowsocks/tcprelay.py | 922 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 b... |
dpiers/coderang-meteor | refs/heads/master | public/jsrepl/extern/python/closured/lib/python2.7/distutils/extension.py | 250 | """distutils.extension
Provides the Extension class, used to describe C/C++ extension
modules in setup scripts."""
__revision__ = "$Id$"
import os, string, sys
from types import *
try:
import warnings
except ImportError:
warnings = None
# This class is really only used by the "build_ext" command, so it mig... |
CoDEmanX/ArangoDB | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32/lib/win32con.py | 21 | # Generated by h2py from commdlg.h (plus modifications 4jan98)
WINVER = 1280
WM_USER = 1024
PY_0U = 0
OFN_READONLY = 1
OFN_OVERWRITEPROMPT = 2
OFN_HIDEREADONLY = 4
OFN_NOCHANGEDIR = 8
OFN_SHOWHELP = 16
OFN_ENABLEHOOK = 32
OFN_ENABLETEMPLATE = 64
OFN_ENABLETEMPLATEHANDLE = 128
OFN_NOVALIDATE = 256
OFN_ALLOWMULTISELECT =... |
dagbldr/dagbldr | refs/heads/master | dagbldr/externals/scripts/get_objgraph.py | 4 | #!/usr/bin/env python
#
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 2008-2015 California Institute of Technology.
# License: 3-clause BSD. The full license text is available at:
# - http://trac.mystic.cacr.caltech.edu/project/pathos/browser/dill/LICENSE
"""
use objgraph to plot the re... |
akras14/cs-101 | refs/heads/master | coursera/stanford-algo/median-maintenance/load.py | 1 | """Load test data"""
import math
import heap
def shouldBalance(left, right):
"""Check if 2 heaps are more than 1 node apart"""
return math.fabs(left.size() - right.size()) > 1
def balance(left, right):
"""Balance two heaps that are off by 1 value"""
if left.size() > right.size():
temp = left.r... |
lyoniionly/django-cobra | refs/heads/master | src/cobra/apps/accounts/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import cobra.models.fields.bounded
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='User',
... |
mrquim/mrquimrepo | refs/heads/master | plugin.program.indigo/libs/requests/certs.py | 516 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
requests.certs
~~~~~~~~~~~~~~
This module returns the preferred default CA certificate bundle.
If you are packaging Requests, e.g., for a Linux distribution or a managed
environment, you can change the definition of where() to return a separately
packaged CA bundle.
... |
firerszd/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_osx_env.py | 112 | """
Test suite for OS X interpreter environment variables.
"""
from test.support import EnvironmentVarGuard, run_unittest
import subprocess
import sys
import sysconfig
import unittest
@unittest.skipUnless(sys.platform == 'darwin' and
sysconfig.get_config_var('WITH_NEXT_FRAMEWORK'),
... |
demon-ru/iml-crm | refs/heads/master | addons/marketing_crm/__init__.py | 378 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP SA (http://www.openerp.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
hryamzik/ansible | refs/heads/devel | lib/ansible/module_utils/database.py | 108 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... |
ayepezv/GAD_ERP | refs/heads/master | addons/calendar/models/ir_http.py | 2 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo
from odoo import models, SUPERUSER_ID
from odoo.http import request
from odoo.api import Environment
from werkzeug.exceptions import BadRequest
class IrHttp(models.AbstractModel):
_inherit = 'ir.http'... |
osm-fr/osmose-backend | refs/heads/master | plugins/TagFix_Area.py | 4 | #-*- coding: utf-8 -*-
###########################################################################
## ##
## Copyrights Frédéric Rodrigo 2014 ##
## ... |
dparks1134/CompareM | refs/heads/master | comparem/amino_acid_usage.py | 1 | ###############################################################################
# #
# 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 ... |
nortikin/sverchok | refs/heads/master | nodes/generators_extended/hilbert.py | 2 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 program is distrib... |
devanshdalal/scikit-learn | refs/heads/master | sklearn/isotonic.py | 10 | # Authors: Fabian Pedregosa <fabian@fseoane.net>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Nelle Varoquaux <nelle.varoquaux@gmail.com>
# License: BSD 3 clause
import numpy as np
from scipy import interpolate
from scipy.stats import spearmanr
from .base import BaseEstimator, TransformerMixi... |
CiscoDevNet/coding-skills-sample-code | refs/heads/master | coding102-REST-python-dcloud/create-ticket.py | 1 | # import requests library
import requests
#import json library
import json
# put the ip address or dns of your apic-em controller in this url
url = 'https://198.18.129.100/api/v1/ticket'
#the username and password to access the APIC-EM Controller
payload = {"username":"admin","password":"C1sco12345"}
#Content t... |
molobrakos/home-assistant | refs/heads/master | homeassistant/components/yamaha/__init__.py | 36 | """The yamaha component."""
|
suutari-ai/shoop | refs/heads/master | shuup_tests/utils/test_namemixin.py | 3 | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from shuup.core.utils.name_mixin import NameMixin
class Ahnuld(N... |
seanli9jan/tensorflow | refs/heads/master | tensorflow/tools/docs/parser_test.py | 22 | # 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... |
sumpfgottheit/pdu1800_data_provider | refs/heads/master | pygame32/pygame/tests/test_utils/arrinter.py | 18 | import sys
import ctypes
from ctypes import *
import unittest
__all__ = ['PAI_CONTIGUOUS', 'PAI_FORTRAN', 'PAI_ALIGNED',
'PAI_NOTSWAPPED', 'PAI_WRITEABLE', 'PAI_ARR_HAS_DESCR',
'ArrayInterface',]
try:
c_ssize_t # Undefined in early Python versions
except NameError:
if sizeof(c_uint) == ... |
PetePriority/home-assistant | refs/heads/dev | homeassistant/components/mysensors/light.py | 5 | """
Support for MySensors lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.mysensors/
"""
from homeassistant.components import mysensors
from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_HS_COLOR, ATTR_WHITE_VALUE, DOMAIN... |
xbmc/xbmc-antiquated | refs/heads/master | xbmc/lib/libPython/Python/Lib/test/test_socket.py | 5 | #!/usr/bin/env python
import unittest
from test import test_support
import socket
import select
import time
import thread, threading
import Queue
import sys
from weakref import proxy
PORT = 50007
HOST = 'localhost'
MSG = 'Michael Gilfix was here\n'
class SocketTCPTest(unittest.TestCase):
def setUp(self):
... |
ZerpaTechnology/AsenZor | refs/heads/master | apps/votSys/user/vistas/widgets/previewImg-marco.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
print '''<div><style> .thumb { height: 150px; border: 1px solid #000; margin: 10px 5px 0 0; }</style><output id="'''+str(data['output'])+'''"></output></div>''' |
vrsys/avangong | refs/heads/master | avango-menu/python/avango/menu/widget/_PushButton.py | 6 | # -*- Mode:Python -*-
##########################################################################
# #
# This file is part of AVANGO. #
# ... |
luo66/scikit-learn | refs/heads/master | examples/linear_model/plot_sgd_comparison.py | 77 | """
==================================
Comparing various online solvers
==================================
An example showing how different online solvers perform
on the hand-written digits dataset.
"""
# Author: Rob Zinkov <rob at zinkov dot com>
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot a... |
alfa-addon/addon | refs/heads/master | plugin.video.alfa/channels/playview.py | 1 | # -*- coding: utf-8 -*-
# -*- Channel Playview -*-
# -*- Created for Alfa-addon -*-
# -*- By the Alfa Develop Group -*-
import sys
PY3 = False
if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int
import re
from channelselector import get_thumb
from core import httptools
from ... |
mlavin/django | refs/heads/master | tests/admin_changelist/models.py | 42 | from django.db import models
class Event(models.Model):
# Oracle can have problems with a column named "date"
date = models.DateField(db_column="event_date")
class Parent(models.Model):
name = models.CharField(max_length=128)
class Child(models.Model):
parent = models.ForeignKey(Parent, models.SET... |
rohanp/scikit-learn | refs/heads/master | sklearn/utils/metaestimators.py | 283 | """Utilities for meta-estimators"""
# Author: Joel Nothman
# Andreas Mueller
# Licence: BSD
from operator import attrgetter
from functools import update_wrapper
__all__ = ['if_delegate_has_method']
class _IffHasAttrDescriptor(object):
"""Implements a conditional property using the descriptor protocol.
... |
phac-nml/bioconda-recipes | refs/heads/master | recipes/phylip/drawgram.py | 59 | #!/usr/bin/env python
#
# Wrapper script for Java Conda packages that ensures that the java runtime
# is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128).
#
# Program Parameters
#
import os
import s... |
sajuptpm/manila | refs/heads/master | contrib/tempest/tempest/api/share/test_limits.py | 2 | # Copyright 2014 Mirantis 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... |
antoviaque/edx-platform | refs/heads/master | openedx/core/djangoapps/user_api/tests/test_constants.py | 121 | # -*- coding: utf-8 -*-
"""Constants used in the test suite. """
SORTED_COUNTRIES = [
(u"AF", u"Afghanistan"),
(u"AX", u"Åland Islands"),
(u"AL", u"Albania"),
(u"DZ", u"Algeria"),
(u"AS", u"American Samoa"),
(u"AD", u"Andorra"),
(u"AO", u"Angola"),
(u"AI", u"Anguilla"),
(u"AQ", u"Ant... |
eneldoserrata/marcos_openerp | refs/heads/master | addons/report_geraldo/lib/geraldo/site/newsite/site-geraldo/django/conf/app_template/views.py | 6027 | # Create your views here.
|
coco-team/Ikos-Api | refs/heads/master | PyIkos/ikos/api.py | 1 | #################################################################################
#
# Low-level API for IKOS
#
# Author: Maxime Arthaud (maxime@arthaud.me)
#
# Copyright (c) 2014 Carnegie Mellon University
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated... |
Gadal/sympy | refs/heads/master | sympy/combinatorics/testutil.py | 51 | from __future__ import print_function, division
from sympy.core.compatibility import range
from sympy.combinatorics.util import _distribute_gens_by_base
from sympy.combinatorics import Permutation
rmul = Permutation.rmul
def _cmp_perm_lists(first, second):
"""
Compare two lists of permutations as sets.
... |
RicardoJohann/frappe | refs/heads/develop | frappe/core/doctype/report/__init__.py | 1829 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
|
hitszxp/scikit-learn | refs/heads/master | examples/cluster/plot_dbscan.py | 346 | # -*- coding: utf-8 -*-
"""
===================================
Demo of DBSCAN clustering algorithm
===================================
Finds core samples of high density and expands clusters from them.
"""
print(__doc__)
import numpy as np
from sklearn.cluster import DBSCAN
from sklearn import metrics
from sklearn... |
dotmagic/python-fu | refs/heads/master | kaleidosix.py | 1 | #!/usr/bin/env python
# Copyright (C) 2005 Werner Hartnagel <info@dotmagic.de>
# based on Perl plugin from Magnus Enger
#
# 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 versi... |
RamezIssac/django-sitetree | refs/heads/master | sitetree/south_migrations/0005_auto__add_field_treeitem_access_guest.py | 5 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'TreeItem.access_guest'
db.add_column('sitetree_treeitem', 'access_guest',
... |
ad-m/django-atom | refs/heads/master | atom/ext/guardian/views.py | 1 | from braces.views import LoginRequiredMixin # django.contrib.auth.mixins lack of redirect_unauthenticated_users
from guardian.mixins import PermissionRequiredMixin
class RaisePermissionRequiredMixin(LoginRequiredMixin, PermissionRequiredMixin):
"""Mixin to verify object permission with preserve correct status co... |
peiwei/zulip | refs/heads/master | zilencer/models.py | 126 | from django.db import models
import zerver.models
def get_deployment_by_domain(domain):
return Deployment.objects.get(realms__domain=domain)
class Deployment(models.Model):
realms = models.ManyToManyField(zerver.models.Realm, related_name="_deployments")
is_active = models.BooleanField(default=True)
... |
ecoPlanos/SputnikRedeSensores | refs/heads/master | Arduino/Temp_HR/Central_Temp_HR/lib/Arduino-master/tests/device/test_http_server/test_http_server.py | 11 | from mock_decorators import setup, teardown
from threading import Thread
from poster.encode import MultipartParam
from poster.encode import multipart_encode
from poster.streaminghttp import register_openers
import urllib2
import urllib
def http_test(res, url, get=None, post=None):
response = ''
try:
if... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.