repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
gangadhar-kadam/verve_erp | refs/heads/v5.0 | erpnext/patches/v4_2/update_sales_order_invoice_field_name.py | 121 | from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doc('accounts', 'doctype', 'sales_invoice')
frappe.db.sql("""update `tabSales Invoice` set from_date = invoice_period_from_date,
to_date = invoice_period_to_date, is_recurring = convert_into_recurring_invoice""")
|
hryamzik/ansible | refs/heads/devel | lib/ansible/modules/storage/netapp/netapp_e_storagepool.py | 22 | #!/usr/bin/python
# (c) 2016, NetApp, Inc
# 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': ['preview'],
... |
837468220/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/turtledemo/two_canvases.py | 65 | #!/usr/bin/env python3
## DEMONSTRATES USE OF 2 CANVASES, SO CANNOT BE RUN IN DEMOVIEWER!
"""turtle example: Using TurtleScreen and RawTurtle
for drawing on two distinct canvases.
"""
from turtle import TurtleScreen, RawTurtle, TK
root = TK.Tk()
cv1 = TK.Canvas(root, width=300, height=200, bg="#ddffff")
cv2 = TK.Canva... |
guilload/pyisaac | refs/heads/master | tests/test_pyisaac.py | 1 | import unittest
import numpy as np
import pyisaac
from fixtures import RESULTS
class PyisaacTestCase(unittest.TestCase):
mytext = 'This is <i>not</i> the right mytext.'
mytext_seed = mytext + '\x00' * (1024 - len(mytext))
def setUp(self):
self.seed()
@classmethod
def seed(cls):
... |
bazz-erp/erpnext | refs/heads/master | erpnext/stock/doctype/serial_no/__init__.py | 37694 | from __future__ import unicode_literals
|
SimVascular/VTK | refs/heads/master | ThirdParty/Twisted/twisted/trial/runner.py | 28 | # -*- test-case-name: twisted.trial.test.test_runner -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
A miscellany of code used to run Trial tests.
Maintainer: Jonathan Lange
"""
__all__ = [
'TestSuite',
'DestructiveTestSuite', 'DryRunVisitor', 'ErrorHolder', 'LoggedSuite',
... |
vnsofthe/odoo | refs/heads/8.0 | addons/account/wizard/account_automatic_reconcile.py | 340 | # -*- 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... |
Aristocles/CouchPotatoServer | refs/heads/master | libs/suds/mx/basic.py | 212 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... |
markwal/OctoPrint | refs/heads/devel | src/octoprint/plugin/types.py | 2 | # coding=utf-8
"""
This module bundles all of OctoPrint's supported plugin implementation types as well as their common parent
class, :class:`OctoPrintPlugin`.
Please note that the plugin implementation types are documented in the section
:ref:`Available plugin mixins <sec-plugins-mixins>`.
.. autoclass:: OctoPrintPl... |
Stavitsky/nova | refs/heads/master | nova/tests/unit/pci/fakes.py | 79 | # Copyright (c) 2014 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 ... |
ptoraskar/django | refs/heads/master | django/db/migrations/operations/models.py | 290 | from __future__ import unicode_literals
from django.db import models
from django.db.migrations.operations.base import Operation
from django.db.migrations.state import ModelState
from django.db.models.options import normalize_together
from django.utils import six
from django.utils.functional import cached_property
cl... |
andrewyoung1991/abjad | refs/heads/master | abjad/tools/instrumenttools/PerformerInventory.py | 2 | # -*- encoding: utf-8 -*-
from abjad.tools.datastructuretools.TypedList import TypedList
class PerformerInventory(TypedList):
r'''Abjad model of an ordered list of performers.
Performer inventories implement the list interface and are mutable.
'''
### CLASS VARIABLES ###
__slots__ = (
)... |
thiagopa/django-mumblr | refs/heads/master | example/local_settings.py | 2 | import mongoengine
mongoengine.connect('mumblr-example')
import os
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
#MEDIA_ROOT = os.path.join(PROJECT_PATH, '..', 'mumblr', 'static')
SECRET_KEY = '$geoon8_ymg-k)!9wl3wloq4&30w$rhc1*zv%h6m_&nza(4)nk'
RECAPTCHA_PUBLIC_KEY = "6LfFgQoAAAAAABQTj4YjuPbccgKtZStoiWt... |
bitwiseman/js-beautify | refs/heads/master | python/jsbeautifier/unpackers/tests/testjavascriptobfuscator.py | 2 | #
# written by Stefano Sanfilippo <a.little.coder@gmail.com>
#
"""Tests for JavaScriptObfuscator unpacker."""
import unittest
from jsbeautifier.unpackers.javascriptobfuscator import unpack, detect, smartsplit
# pylint: disable=R0904
class TestJavascriptObfuscator(unittest.TestCase):
"""JavascriptObfuscator... |
DavidLutton/ElectronicEngineering | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'Click>=6.0',
# TODO: put pa... |
r-owen/stui | refs/heads/master | TUI/TUIPaths.py | 1 | #!/usr/bin/env python
"""Get paths to various TUI-related directories.
2004-07-09 ROwen
2005-07-11 ROwen Modified for changed RO.OS.getAppSuppDirs.
2005-09-22 ROwen Changed getAddPaths to getTUIPaths.
Added getResourceDir.
2007-01-19 ROwen Made getAddPaths compatible with pyinstaller.
2009... |
AlexOugh/horizon | refs/heads/master | openstack_dashboard/dashboards/project/firewalls/views.py | 1 | # Copyright 2013, Big Switch Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
hamzehd/edx-platform | refs/heads/master | common/djangoapps/cors_csrf/tests/test_views.py | 150 | """Tests for cross-domain request views. """
import json
from django.test import TestCase
from django.core.urlresolvers import reverse, NoReverseMatch
import ddt
from config_models.models import cache
from cors_csrf.models import XDomainProxyConfiguration
@ddt.ddt
class XDomainProxyTest(TestCase):
"""Tests for... |
vertcoin/electrum-vtc | refs/heads/master | lib/tests/test_account.py | 9 | import unittest
class Test_Account(unittest.TestCase):
def test_bip32_account(self):
self.assertTrue(True)
def test_old_account(self):
self.assertTrue(True)
|
svn2github/django | refs/heads/master | django/utils/feedgenerator.py | 83 | """
Syndication feed generation library -- used for generating RSS, etc.
Sample usage:
>>> from django.utils import feedgenerator
>>> feed = feedgenerator.Rss201rev2Feed(
... title=u"Poynter E-Media Tidbits",
... link=u"http://www.poynter.org/column.asp?id=31",
... description=u"A group Weblog by the shar... |
hahnicity/liason | refs/heads/master | liason/bootstrap.py | 1 | """
liason.bootstrap
~~~~~~~~~~~~~~~~
Setup postgresql on our machine. Create a database of our choosing and
grant privileges on that db to the current user.
"""
from subprocess import call
from liason.defaults import db
def install_postgres():
"""
Install the most recent version of PostGRESQL on our machin... |
emetsger/osf.io | refs/heads/develop | website/conferences/model.py | 11 | # -*- coding: utf-8 -*-
import bson
from modularodm import fields, Q
from modularodm.exceptions import ModularOdmException
from framework.mongo import StoredObject
from website.conferences.exceptions import ConferenceError
DEFAULT_FIELD_NAMES = {
'submission1': 'poster',
'submission2': 'talk',
'submissio... |
leorochael/odoo | refs/heads/8.0 | addons/stock_account/wizard/stock_return_picking.py | 342 | # -*- 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... |
xHeliotrope/injustice_dropper | refs/heads/master | env/lib/python3.4/site-packages/tests/test_sms_messages.py | 14 | from datetime import date
import unittest
from mock import Mock
from twilio.rest.resources import SmsMessages
DEFAULT = {
'From': None,
'DateSent<': None,
'DateSent>': None,
'DateSent': None,
}
class SmsTest(unittest.TestCase):
def setUp(self):
self.resource = SmsMessages("foo", ("sid"... |
nitinitprof/odoo | refs/heads/8.0 | openerp/addons/test_converter/tests/test_html.py | 257 | # -*- encoding: utf-8 -*-
import json
import os
import datetime
from lxml import etree
from openerp.tests import common
from openerp.tools import html_escape as e
from openerp.addons.base.ir import ir_qweb
directory = os.path.dirname(__file__)
class TestExport(common.TransactionCase):
_model = None
def set... |
rootfs/snapshot | refs/heads/master | vendor/k8s.io/kubernetes/third_party/htpasswd/htpasswd.py | 897 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2013 Edgewall Software
# Copyright (C) 2008 Eli Carter
# 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.edge... |
zeehio/django-haystack | refs/heads/master | test_haystack/multipleindex/models.py | 46 | # encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from django.db import models
class Foo(models.Model):
title = models.CharField(max_length=255)
body = models.TextField()
def __unicode__(self):
return self.title
class Bar(models.Model):
a... |
mollstam/UnrealPy | refs/heads/master | UnrealPyEmbed/Source/Python/Lib/python27/encodings/cp424.py | 593 | """ Python Character Mapping Codec cp424 generated from 'MAPPINGS/VENDORS/MISC/CP424.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,input,errors='... |
ol-loginov/intellij-community | refs/heads/master | python/testData/formatter/dictLiteral.py | 83 | map = {
'node':{
'key1':'key1value',
'key2':'key2value',
'key3':'key3value'
}
}
|
jhajek/euca2ools | refs/heads/master | euca2ools/commands/iam/getuserpolicy.py | 5 | # Copyright 2009-2015 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software 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 ... |
BT-rmartin/odoo | refs/heads/BT_2900 | openerp/report/render/rml2txt/utils.py | 443 | # -*- coding: 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... |
alanjw/GreenOpenERP-Win-X86 | refs/heads/7.0 | python/Lib/site-packages/simplejson/tests/test_encode_basestring_ascii.py | 147 | from unittest import TestCase
import simplejson.encoder
from simplejson.compat import b
CASES = [
(u'/\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\x08\x0c\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?', '"/\\\\\\"\\ucafe\\ubabe\\uab98\\ufcde\\ubcda\\uef4a\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?"'),
(u'\u0123\u4567\... |
dmonroy/spa | refs/heads/master | examples/simple_static.py | 2 | import spa
from spa.static import StaticHandler
routes = (
('/<path:filepath>', '', StaticHandler, {'directory': '.'}),
)
app = spa.App(routes)
spa.run(app)
# Now navigate to localhost:8000/simple_static.py and you should see this file
# served out to you.
|
lulufei/youtube-dl | refs/heads/master | youtube_dl/extractor/sexykarma.py | 42 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
unified_strdate,
parse_duration,
int_or_none,
)
class SexyKarmaIE(InfoExtractor):
IE_DESC = 'Sexy Karma and Watch Indian Porn'
_VALID_URL = r'https?://(?:www\.)?(?:sexykarma\... |
nanolearningllc/edx-platform-cypress | refs/heads/master | lms/djangoapps/courseware/tests/test_favicon.py | 125 | from django.conf import settings
from django.core.urlresolvers import clear_url_caches, resolve
from django.test import TestCase
from django.test.utils import override_settings
from mock import patch
from nose.plugins.attrib import attr
import sys
@attr('shard_1')
class FaviconTestCase(TestCase):
def setUp(se... |
friedrich420/Note-3-AEL-Kernel-SM-N9005_EUR_LL_Opensource_Update2. | refs/heads/master | scripts/build-all.py | 329 | #! /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
# ... |
bqbn/addons-server | refs/heads/master | src/olympia/reviewers/migrations/0006_auto_20200609_1655.py | 6 | # Generated by Django 2.2.13 on 2020-06-09 16:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('reviewers', '0005_remove_code_manager_waffle_flag'),
]
operations = [
migrations.AddField(
model_name='autoapprovalsummary',
... |
arogozhnikov/einops | refs/heads/master | tests/test_einsum.py | 1 | from . import collect_test_backends
import numpy as np
class Arguments:
def __init__(self, *args, **kargs):
self.args = args
self.kwargs = kargs
def __call__(self, function):
return function(*self.args, **self.kwargs)
test_cases = [
(
Arguments('b c_in h w -> w c_out h b... |
catchmrbharath/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_bytestring.py | 24 | # -*- coding: UTF-8 -*-
import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
interface TestByteString {
attribute ByteString bs;
attribute DOMString ds;
};
""")
results = parser.finish();
harness.ok(True, "TestByteString interface parsed without error... |
sankhesh/VTK | refs/heads/master | Examples/Graphics/Python/SegmentAndBrokenLineSources.py | 15 | #!/usr/bin/env python
############################################################
from vtk import *
############################################################
# Create sources
line1 = vtkLineSource()
line1.SetPoint1( 1, 0, 0 )
line1.SetPoint2( -1, 0, 0 )
line1.SetResolution( 32 )
points = vtkPoints()
points.Insert... |
azumimuo/family-xbmc-addon | refs/heads/master | plugin.video.specto/resources/lib/resolvers/daclips.py | 23 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any l... |
zoidbergwill/lint-review | refs/heads/master | lintreview/tools/sasslint.py | 2 | import functools
import logging
import os
from lintreview.tools import Tool
from lintreview.tools import run_command
from lintreview.utils import in_path
from lintreview.utils import npm_exists
log = logging.getLogger(__name__)
class Sasslint(Tool):
name = 'sasslint'
def check_dependencies(self):
... |
kapiziak/mtasa-blue | refs/heads/master | vendor/google-breakpad/src/tools/gyp/test/rules-rebuild/gyptest-all.py | 351 | #!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that a rule that generates multiple outputs rebuilds
correctly when the inputs change.
"""
import TestGyp
test = TestGyp.Test... |
cernops/keystone | refs/heads/master | keystone/tests/unit/ksfixtures/database.py | 1 | # 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
# distributed under the... |
SnappleCap/oh-mainline | refs/heads/master | vendor/packages/twisted/twisted/internet/test/test_base.py | 18 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.internet.base}.
"""
import socket
from Queue import Queue
from zope.interface import implements
from twisted.python.threadpool import ThreadPool
from twisted.python.util import setIDFunction
from twisted.internet.interfa... |
unnikrishnankgs/va | refs/heads/master | venv/lib/python3.5/site-packages/matplotlib/backend_managers.py | 10 | """
`ToolManager`
Class that makes the bridge between user interaction (key press,
toolbar clicks, ..) and the actions in response to the user inputs.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import warnings
import matplotlib.c... |
Akrog/cinder | refs/heads/master | cinder/tests/test_dellfc.py | 2 | # Copyright (c) 2014 Dell 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 a... |
woodscn/scipy | refs/heads/master | scipy/io/matlab/miobase.py | 125 | # Authors: Travis Oliphant, Matthew Brett
"""
Base classes for MATLAB file stream reading.
MATLAB is a registered trademark of the Mathworks inc.
"""
from __future__ import division, print_function, absolute_import
import sys
import operator
from scipy._lib.six import reduce
import numpy as np
if sys.version_info... |
nikhilraog/boto | refs/heads/develop | tests/integration/route53/domains/__init__.py | 113 | # Copyright (c) 2014 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 t... |
valdecdev/odoo | refs/heads/master | openerp/tests/addons/test_translation_import/tests/test_term_count.py | 46 | # -*- coding: utf-8 -*-
import openerp
from openerp.tests import common
class TestTermCount(common.TransactionCase):
def test_count_term(self):
"""
Just make sure we have as many translation entries as we wanted.
"""
openerp.tools.trans_load(self.cr, 'test_translation_import/i18n/... |
rds0751/colinkers | refs/heads/master | env/Lib/site-packages/django/contrib/gis/db/models/lookups.py | 48 | from __future__ import unicode_literals
import re
from django.core.exceptions import FieldDoesNotExist
from django.db.models.constants import LOOKUP_SEP
from django.db.models.expressions import Col, Expression
from django.db.models.lookups import Lookup, Transform
from django.db.models.sql.query import Query
from dja... |
terranodo/geonode | refs/heads/master | geonode/upload/tests/__init__.py | 18 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... |
VladimirTyrin/letsencrypt | refs/heads/master | letsencrypt-compatibility-test/docs/conf.py | 17 | # -*- coding: utf-8 -*-
#
# letsencrypt-compatibility-test documentation build configuration file, created by
# sphinx-quickstart on Sun Oct 18 13:40:53 2015.
#
# 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
# au... |
akhan7/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/performance/concatenation.py | 451 | from __future__ import absolute_import, division, unicode_literals
def f1():
x = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
y = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
z = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
x += y + z
def f2():
x = "ABCDEFGHIJKLMNOP... |
JioEducation/edx-platform | refs/heads/master | lms/djangoapps/oauth2_handler/__init__.py | 212 | from oauth2_handler.handlers import IDTokenHandler, UserInfoHandler
|
fxia22/ASM_xf | refs/heads/master | PythonD/site_python/twisted/python/compat.py | 2 | # -*- test-case-name: twisted.test.test_compat -*-
#
# Twisted, the Framework of Your Internet
# Copyright (C) 2001 Matthew W. Lefkowitz
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Softwa... |
kurtrwall/wagtail | refs/heads/master | wagtail/wagtailadmin/tests/test_privacy.py | 4 | from __future__ import absolute_import, unicode_literals
from django.core.urlresolvers import reverse
from django.test import TestCase
from wagtail.tests.testapp.models import SimplePage
from wagtail.tests.utils import WagtailTestUtils
from wagtail.wagtailcore.models import Page, PageViewRestriction
class TestSetPr... |
lepmik/nest-simulator | refs/heads/master | pynest/nest/tests/test_all.py | 3 | # -*- coding: utf-8 -*-
#
# test_all.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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
# ... |
Petr-Kovalev/nupic-win32 | refs/heads/master | py/nupic/swarming/HypersearchWorker.py | 1 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditio... |
nchammas/spark | refs/heads/master | python/pyspark/ml/tests/test_training_summary.py | 8 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
benthomasson/ansible | refs/heads/devel | lib/ansible/modules/network/avi/avi_alertconfig.py | 7 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
#
# 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... |
leeon/annotated-django | refs/heads/note | django/contrib/gis/geos/point.py | 105 | from ctypes import c_uint
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos import prototypes as capi
from django.utils import six
from django.utils.six.moves import xrange
class Point(GEOSGeometry):
_minlength = 2
_m... |
carnotweat/cpupimp | refs/heads/master | libs/chardet/big5freq.py | 3132 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
closeio/nylas | refs/heads/n17 | migrations/versions/208_drop_easuid_uniqueconstraint.py | 3 | """Drop EASUid UniqueConstraint
Revision ID: 1962d17d1c0a
Revises: 4b225df49747
Create Date: 2015-11-04 23:11:43.661200
"""
# revision identifiers, used by Alembic.
revision = '1962d17d1c0a'
down_revision = '4b225df49747'
from alembic import op
from sqlalchemy.sql import text
def upgrade():
conn = op.get_bind... |
Tdfrantz/myfirstrepository | refs/heads/master | Assignment4/js/utils/converters/obj/split_obj.py | 369 | """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 ... |
fjxhkj/Cactus | refs/heads/master | cactus/deployment/cloudfiles/engine.py | 9 | #coding:utf-8
import pyrax
from cactus.deployment.engine import BaseDeploymentEngine
from cactus.deployment.cloudfiles.auth import CloudFilesCredentialsManager
from cactus.deployment.cloudfiles.file import CloudFilesFile
class CloudFilesDeploymentEngine(BaseDeploymentEngine):
CredentialsManagerClass = CloudFile... |
srikantbmandal/ansible | refs/heads/devel | test/units/module_utils/facts/test_facts.py | 80 | # This file is part of Ansible
# -*- coding: utf-8 -*-
#
#
# 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 dis... |
100Shapes/wagtail | refs/heads/master | wagtail/wagtailadmin/views/tags.py | 7 | import json
from taggit.models import Tag
from django.http import HttpResponse
from django.contrib.auth.decorators import permission_required
@permission_required('wagtailadmin.access_admin')
def autocomplete(request):
term = request.GET.get('term', None)
if term:
tags = Tag.objects.filter(name__ist... |
mgraupe/acq4 | refs/heads/develop | acq4/pyqtgraph/WidgetGroup.py | 34 | # -*- coding: utf-8 -*-
"""
WidgetGroup.py - WidgetGroup class for easily managing lots of Qt widgets
Copyright 2010 Luke Campagnola
Distributed under MIT/X11 license. See license.txt for more infomation.
This class addresses the problem of having to save and restore the state
of a large group of widgets.
"""
from... |
mikedh/trimesh | refs/heads/master | trimesh/visual/texture.py | 1 | import numpy as np
from .base import Visuals
from . import color
from .. import util
from .. import caching
from .. import grouping
from .material import SimpleMaterial, PBRMaterial, empty_material # NOQA
class TextureVisuals(Visuals):
def __init__(self,
uv=None,
material=Non... |
Frulko/AutobahnPython | refs/heads/master | autobahn/autobahn/utf8validator.py | 9 | ###############################################################################
##
## Copyright 2011 Tavendo GmbH
##
## Note:
##
## This code is a Python implementation of the algorithm
##
## "Flexible and Economical UTF-8 Decoder"
##
## by Bjoern Hoehrmann
##
## bjoern@hoehrmann.de
##... |
bols-blue/ansible | refs/heads/devel | plugins/inventory/vbox.py | 111 | #!/usr/bin/env 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... |
Aloomaio/googleads-python-lib | refs/heads/master | examples/ad_manager/v201805/user_service/create_users.py | 1 | #!/usr/bin/env python
#
# Copyright 2015 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 requir... |
kepppu/electrum-n900 | refs/heads/master | ecdsa/ecdsa.py | 2 | #! /usr/bin/env python
"""
Implementation of Elliptic-Curve Digital Signatures.
Classes and methods for elliptic-curve signatures:
private keys, public keys, signatures,
NIST prime-modulus curves with modulus lengths of
192, 224, 256, 384, and 521 bits.
Example:
# (In real-life applications, you would probably wan... |
pedrobaeza/odoomrp-wip | refs/heads/8.0 | mrp_production_traceability/__init__.py | 4 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# 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 ... |
ProfessionalIT/professionalit-webiste | refs/heads/master | sdk/google_appengine/lib/django-1.4/django/utils/html_parser.py | 52 | import HTMLParser as _HTMLParser
import re
import sys
current_version = sys.version_info
use_workaround = (
(current_version < (2, 7, 3)) or
(current_version >= (3, 0) and current_version < (3, 2, 3))
)
if not use_workaround:
HTMLParser = _HTMLParser.HTMLParser
else:
class HTMLParser(_HTMLParser.HTML... |
wnt-zhp/hufce | refs/heads/master | django/contrib/auth/tests/views.py | 20 | from __future__ import with_statement
import os
import re
import urllib
from django.conf import settings
from django.contrib.sites.models import Site, RequestSite
from django.contrib.auth.models import User
from django.core import mail
from django.core.urlresolvers import reverse, NoReverseMatch
from django.http impor... |
amohanta/miasm | refs/heads/master | example/symbol_exec/single_instr.py | 6 | # Minimalist Symbol Exec example
from miasm2.core.bin_stream import bin_stream_str
from miasm2.arch.x86.arch import mn_x86
from miasm2.arch.x86.ira import ir_a_x86_32
from miasm2.arch.x86.regs import all_regs_ids, all_regs_ids_init
from miasm2.ir.sy... |
hexlism/css_platform | refs/heads/master | sleepyenv/lib/python2.7/site-packages/boto-2.38.0-py2.7.egg/boto/jsonresponse.py | 150 | # Copyright (c) 2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
#
# 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
# withou... |
MAD-GooZe/nautilus-mailru-cloud | refs/heads/master | mailru-cloud.py | 1 |
from gi.repository import Nautilus, GObject
import urllib
import lib_nautilus_mailru_cloud as lib_nmrc
class MailRuCloudExtension(GObject.GObject, Nautilus.MenuProvider):
def __init__(self):
pass
def menu_get_public_link(self, menu, file):
#print "menu_activate_cb",file
path = urlli... |
kiyoto/statsmodels | refs/heads/master | statsmodels/stats/tests/test_pairwise.py | 26 | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 28 15:34:18 2012
Author: Josef Perktold
"""
import warnings
from statsmodels.compat.python import BytesIO, asbytes, range
import numpy as np
from numpy.testing import (assert_almost_equal, assert_equal, assert_,
assert_raises, assert_allclose)
... |
hehongliang/tensorflow | refs/heads/master | tensorflow/contrib/eager/python/parameter_server.py | 10 | # Copyright 2018 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... |
noba3/KoTos | refs/heads/master | addons/script.module.hubparentalcontrol/lib/hubparentalcontrol/settings.py | 1 | import xbmc, xbmcaddon, xbmcgui, xbmcplugin
import os
ROOTADDON = xbmcaddon.Addon(id='plugin.video.xbmchubmaintenance')
ADDON = xbmcaddon.Addon(id='script.module.hubparentalcontrol')
DATA_PATH = os.path.join(xbmc.translatePath('special://profile/addon_data/script.module.hubparentalcontrol'), '')
ADDON_PATH = xbmc.tran... |
david-hoffman/scripts | refs/heads/master | thumbnail_generator.py | 1 | #! /usr/bin/env python
# -*- coding: utf-8 -*
import os
import glob
import textwrap
import Mrc
import warnings
import numpy as np
import matplotlib as mpl
import multiprocessing as mp
import tifffile as tif
from skimage.exposure import adjust_gamma
from dphplotting import display_grid
# TODO: we could make a subclass... |
ROAND/dota2herovoices | refs/heads/master | .buildozer/venv/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py | 1730 | from __future__ import absolute_import, division, unicode_literals
from . import _base
class Filter(_base.Filter):
def __init__(self, source, encoding):
_base.Filter.__init__(self, source)
self.encoding = encoding
def __iter__(self):
state = "pre_head"
meta_found = (self.enco... |
Kiv/poclbm | refs/heads/master | Miner.py | 4 | from Queue import Queue
from decimal import Decimal
from threading import Thread
from time import time
class Miner(object):
def __init__(self, device_index, options):
self.device_index = device_index
self.options = options
self.update_time_counter = 1
self.share_count = [0, 0]
self.work_queue = Queue()
... |
gdimitris/ChessPuzzlerBackend | refs/heads/master | Virtual_Environment/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langgreekmodel.py | 2762 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
D4wN/brickv | refs/heads/master | src/build_data/windows/OpenGL/raw/GL/SGIX/clipmap.py | 3 | '''OpenGL extension SGIX.clipmap
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_SGIX_clipmap'
_DEPRECATED = False
GL_LINEAR_CLIPMAP_LINEAR_SGI... |
saratang/servo | refs/heads/master | tests/wpt/css-tests/tools/pywebsocket/src/test/set_sys_path.py | 496 | # 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 of conditions and the f... |
cjlee112/socraticqs2 | refs/heads/master | mysite/ctms/migrations/0012_bestpractice_upload_file.py | 1 | # Generated by Django 2.1.11 on 2019-08-22 08:49
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ctms', '0011_bestpracticetemplate_summary'),
]
operations = [
migrations.AddField(
model_name='be... |
Nikoala/CouchPotatoServer | refs/heads/develop | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/videodetective.py | 148 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urlparse
from .internetvideoarchive import InternetVideoArchiveIE
class VideoDetectiveIE(InfoExtractor):
_VALID_URL = r'https?://www\.videodetective\.com/[^/]+/[^/]+/(?P<id>\d+)'
_TEST = {
'url': 'h... |
eLBati/server-tools | refs/heads/8.0 | disable_openerp_online/model/publisher_warranty_contract.py | 71 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
2ndy/RaspIM | refs/heads/master | usr/lib/python2.6/compiler/future.py | 264 | """Parser for future statements
"""
from compiler import ast, walk
def is_future(stmt):
"""Return true if statement is a well-formed future statement"""
if not isinstance(stmt, ast.From):
return 0
if stmt.modname == "__future__":
return 1
else:
return 0
class FutureParser:
... |
imironhead/ml_gans | refs/heads/master | began/cropper.py | 1 | """
"""
import glob
import os
import scipy.misc
import tensorflow as tf
tf.app.flags.DEFINE_string('source-dir-path', '', '')
tf.app.flags.DEFINE_string('target-dir-path', '', '')
tf.app.flags.DEFINE_integer('image-scale', 128, '')
FLAGS = tf.app.flags.FLAGS
def sanity_check():
"""
"""
if not os.path.... |
cardsurf/text-to-speech-applet | refs/heads/master | text-to-speech-applet@cardsurf/read_text_selection_clipboard.py | 1 | import sys
from gi.repository import Gtk, Gdk
clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
text = clipboard.wait_for_text()
if text == None:
print ""
else:
print text
sys.exit(0)
|
zrhans/pythonanywhere | refs/heads/master | .virtualenvs/django19/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/request.py | 853 | try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from .filepost import encode_multipart_formdata
__all__ = ['RequestMethods']
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen` method, such
as :class:`~urllib3.... |
iambibhas/django | refs/heads/master | tests/custom_methods/models.py | 66 | """
Giving models custom methods
Any method you add to a model will be available to instances.
"""
import datetime
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Article(models.Model):
headline = models.CharField(max_length=100)
... |
adelina-t/nova | refs/heads/master | nova/db/sqlalchemy/migrate_repo/versions/285_placeholder.py | 830 | # 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... |
stevehof/CouchPotatoServer | refs/heads/master | libs/gntp/shim.py | 123 | # Copyright: 2013 Paul Traylor
# These sources are released under the terms of the MIT license: see LICENSE
"""
Python2.5 and Python3.3 compatibility shim
Heavily inspirted by the "six" library.
https://pypi.python.org/pypi/six
"""
import sys
PY3 = sys.version_info[0] == 3
if PY3:
def b(s):
if isinstance(s, byt... |
vinicius5581/MavensMate-SublimeText | refs/heads/master | lib/server/lib/config.py | 3 | import logging
import os.path
import sys
import tempfile
import sublime
from logging.handlers import RotatingFileHandler
logger = None
def __get_base_path():
if hasattr(sys, 'frozen'):
return sys._MEIPASS
else:
return os.path.dirname(os.path.dirname(__file__))
def __get_is_frozen():
if h... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.