repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
Livit/Livit.Learn.EdX
refs/heads/labster/develop
common/lib/xmodule/xmodule/stringify.py
275
# -*- coding: utf-8 -*- from lxml import etree def stringify_children(node): ''' Return all contents of an xml tree, without the outside tags. e.g. if node is parse of "<html a="b" foo="bar">Hi <div>there <span>Bruce</span><b>!</b></div><html>" should return "Hi <div>there <span>Bruce...
dkubiak789/OpenUpgrade
refs/heads/8.0
addons/hw_scale/__openerp__.py
59
# -*- 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...
grilo/ansible-1
refs/heads/devel
lib/ansible/modules/cloud/vmware/vmware_host.py
5
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
hatwar/focal-erpnext
refs/heads/develop
erpnext/selling/doctype/sales_bom_item/__init__.py
37694
from __future__ import unicode_literals
lokirius/python-for-android
refs/heads/master
python3-alpha/extra_modules/gdata/tlslite/utils/Cryptlib_TripleDES.py
48
"""Cryptlib 3DES implementation.""" from .cryptomath import * from .TripleDES import * if cryptlibpyLoaded: def new(key, mode, IV): return Cryptlib_TripleDES(key, mode, IV) class Cryptlib_TripleDES(TripleDES): def __init__(self, key, mode, IV): TripleDES.__init__(self, key, mod...
sergey-shandar/autorest
refs/heads/master
src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/Paging/fixtures/__init__.py
13048
__import__('pkg_resources').declare_namespace(__name__)
mantidproject/mantid
refs/heads/master
docs/sphinxext/mantiddoc/directives/sourcelink.py
2
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 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...
Varriount/Colliberation
refs/heads/master
libs/twisted/lore/_version.py
1
# This is an auto-generated file. Do not edit it. from twisted.python import versions version = versions.Version('twisted.lore', 12, 1, 0)
radjkarl/dataArtist
refs/heads/master
dataArtist/figures/image/tools/calibrate/LensDistortion.py
1
# coding=utf-8 import numpy as np import os from qtpy import QtGui, QtWidgets, QtCore from fancytools.os.PathStr import PathStr from dataArtist.widgets.Tool import Tool import dataArtist PATTERN_FILE = PathStr( dataArtist.__file__).dirname().join( 'media', 'camera_calibration_patterns.pdf') del dataArtis...
agustinhenze/docopt.debian
refs/heads/master
examples/odd_even_example.py
17
"""Usage: odd_even_example.py [-h | --help] (ODD EVEN)... Example, try: odd_even_example.py 1 2 3 4 Options: -h, --help """ from docopt import docopt if __name__ == '__main__': arguments = docopt(__doc__) print(arguments)
bop/foundation
refs/heads/master
lib/python2.7/site-packages/django/conf/locale/mn/formats.py
433
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd F Y' TIME_FORMAT = 'g:i:s A' # DATETIME_FORMAT = # YEAR_MONTH_FORMAT = ...
petebachant/scipy
refs/heads/master
scipy/constants/tests/test_constants.py
71
from __future__ import division, print_function, absolute_import from numpy.testing import run_module_suite, assert_equal import scipy.constants as sc def test_fahrenheit_to_celcius(): assert_equal(sc.F2C(32), 0) assert_equal(sc.F2C([32, 32]), [0, 0]) def test_celcius_to_kelvin(): assert_equal(sc.C2K([...
savioabuga/phoenix-template
refs/heads/master
config/settings/production.py
1
# -*- coding: utf-8 -*- ''' Production Configurations - Use djangosecure - Use Amazon's S3 for storing static files and uploaded media - Use sendgrid to send emails - Use MEMCACHIER on Heroku ''' from __future__ import absolute_import, unicode_literals from boto.s3.connection import OrdinaryCallingFormat from django...
andyfaff/scipy
refs/heads/master
scipy/fft/_debug_backends.py
28
import numpy as np class NumPyBackend: """Backend that uses numpy.fft""" __ua_domain__ = "numpy.scipy.fft" @staticmethod def __ua_function__(method, args, kwargs): kwargs.pop("overwrite_x", None) fn = getattr(np.fft, method.__name__, None) return (NotImplemented if fn is None ...
guillaume-philippon/aquilon
refs/heads/master
upgrade/1.4.5/aquilon/aqdb/model/personality_service_list_item.py
4
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2009,2013 Contributor # # 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 #...
tanmaykm/edx-platform
refs/heads/master
lms/djangoapps/notification_prefs/tests.py
26
import json from django.contrib.auth.models import AnonymousUser from django.core.exceptions import PermissionDenied from django.core.urlresolvers import reverse from django.http import Http404 from django.test import TestCase from django.test.client import RequestFactory from django.test.utils import override_setting...
OpenMined/PySyft
refs/heads/master
packages/grid/apps/domain/src/main/core/model_centric/syft_assets/protocol_manager.py
1
# grid relative from ...exceptions import ProtocolNotFoundError from ...manager.database_manager import DatabaseManager from .protocol import Protocol class ProtocolManager(DatabaseManager): schema = Protocol def __init__(self, database): self.db = database self._schema = ProtocolManager.sche...
dongpf/hadoop-0.19.1
refs/heads/rsc
contrib/hod/hodlib/ServiceRegistry/serviceRegistry.py
182
#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 use thi...
scrollback/kuma
refs/heads/master
vendor/packages/translate-toolkit/translate/storage/test_oo.py
7
#!/usr/bin/env python # -*- coding: utf-8 -*- from translate.storage import oo from translate.misc import wStringIO import warnings def test_makekey(): """checks the makekey function for consistency""" assert oo.makekey(('project', r'path\to\the\sourcefile.src', 'resourcetype', 'GROUP_ID', 'LOCAL_ID', 'platfo...
tulikavijay/vms
refs/heads/develop
vms/registration/models.py
4
# Django from django.db import models # Create your models here.
dls-controls/pymalcolm
refs/heads/master
tests/test_modules/test_dtacq/test_dtacq_blocks.py
1
from mock import Mock from malcolm.modules.dtacq.blocks import dtacq_runnable_block from malcolm.testutil import ChildTestCase class TestXmapBlocks(ChildTestCase): def test_xmap_detector_manager_block(self): c = self.create_child_block( dtacq_runnable_block, Mock(), mr...
vnc-biz/openerp-web
refs/heads/master
addons/web_diagram/__init__.py
597
from . import controllers
cristiana214/cristianachavez214-cristianachavez
refs/heads/master
python/src/Lib/test/test_genericpath.py
58
import unittest from test import test_support import os import genericpath class AllCommonTest(unittest.TestCase): def assertIs(self, a, b): self.assert_(a is b) def test_commonprefix(self): self.assertEqual( genericpath.commonprefix([]), "" ) self.asse...
josherick/bokeh
refs/heads/master
examples/plotting/file/image.py
45
import numpy as np from bokeh.plotting import figure, show, output_file N = 1000 x = np.linspace(0, 10, N) y = np.linspace(0, 10, N) xx, yy = np.meshgrid(x, y) d = np.sin(xx)*np.cos(yy) output_file("image.html", title="image.py example") p = figure(x_range=[0, 10], y_range=[0, 10]) p.image(image=[d], x=[0], y=[0],...
mjudsp/Tsallis
refs/heads/master
examples/linear_model/plot_sgd_separating_hyperplane.py
84
""" ========================================= SGD: Maximum margin separating hyperplane ========================================= Plot the maximum margin separating hyperplane within a two-class separable dataset using a linear Support Vector Machines classifier trained using SGD. """ print(__doc__) import numpy as n...
RanadeepPolavarapu/kuma
refs/heads/master
kuma/actioncounters/migrations/0001_initial.py
22
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0001_initial'), ] operations = [ migrations.CreateModel( name='ActionCounterUnique', ...
farhi-naz/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/queuestest.py
124
# Copyright (C) 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...
anhstudios/swganh
refs/heads/develop
data/scripts/templates/object/static/structure/tatooine/shared_stair_tatooine_small_style_01.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Static() result.template = "object/static/structure/tatooine/shared_stair_tatooine_small_style_01.iff" result.att...
kmcminn/rails_survey
refs/heads/master
vendor/gems/nokogiri-1.6.0/ext/nokogiri/tmp/x86_64-linux-gnu/ports/libxslt/1.1.26/libxslt-1.1.26/python/tests/basic.py
24
#!/usr/bin/python -u import sys import libxml2 # Memory debug specific libxml2.debugMemory(1) import libxslt styledoc = libxml2.parseFile("test.xsl") style = libxslt.parseStylesheetDoc(styledoc) doc = libxml2.parseFile("test.xml") result = style.applyStylesheet(doc, None) style.saveResultToFilename("foo", result, 0)...
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/draft_schematic/droid/component/chassis_droid_magnaguard.py
85615
import sys def setup(core, object): return
Adel-Magebinary/odoo
refs/heads/8.0
addons/event_sale/__openerp__.py
306
# -*- 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...
fnouama/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/middleware/doc.py
311
from django.conf import settings from django import http class XViewMiddleware(object): """ Adds an X-View header to internal HEAD requests -- used by the documentation system. """ def process_view(self, request, view_func, view_args, view_kwargs): """ If the request method is HEAD and ...
jonathan-beard/edx-platform
refs/heads/master
lms/djangoapps/certificates/tests/test_support_views.py
43
""" Tests for certificate app views used by the support team. """ import json import ddt from django.core.urlresolvers import reverse from django.test import TestCase from opaque_keys.edx.keys import CourseKey from student.tests.factories import UserFactory from student.models import CourseEnrollment from student.ro...
Qix-/better-exceptions
refs/heads/master
test/test_util/__init__.py
2
# DO NOT ADD AS setup.py MODULE!
jwalgran/otm-core
refs/heads/develop
opentreemap/treemap/migrations/0014_change_empty_multichoice_values.py
7
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from treemap.udf import UDFDictionary def set_empty_multichoice_values_to_none(apps, schema_editor): UserDefinedFieldDefinition = apps.get_model( 'treemap', 'UserDefinedFieldDefinition') udfds = (...
Stanford-Online/edx-platform
refs/heads/master
scripts/xsslint/xsslint/rules.py
20
class Rule(object): def __init__(self, rule_id): self.rule_id = rule_id def __eq__(self, other): return self.rule_id == other.rule_id class RuleSet(object): def __init__(self, **kwargs): self.rules = {} for k, v in kwargs.items(): self.rules[k] = Rule(v) d...
wtgme/labeldoc2vec
refs/heads/master
gensim/models/setup.py
1
from distutils.core import setup from distutils.extension import Extension from Cython.Build import cythonize extensions = [ Extension("labeldoc2vec_inner", ["labeldoc2vec_inner.pyx"]) ] setup( ext_modules = cythonize(extensions) )
sbbm/llvm
refs/heads/sbbm
utils/lit/tests/shtest-format.py
56
# Check the various features of the ShTest format. # # RUN: not %{lit} -j 1 -v %{inputs}/shtest-format > %t.out # RUN: FileCheck < %t.out %s # # END. # CHECK: -- Testing: # CHECK: PASS: shtest-format :: argv0.txt # CHECK: FAIL: shtest-format :: external_shell/fail.txt # CHECK-NEXT: *** TEST 'shtest-format :: external...
vfiebig/rpaas
refs/heads/master
rpaas/ssl_plugins/__init__.py
1
# -*- coding: utf-8 -*- from os.path import dirname, basename, isfile import glob from abc import ABCMeta, abstractmethod class BaseSSLPlugin(object): __metaclass__ = ABCMeta @abstractmethod def __init__(self, domain, *args, **kwargs): pass @abstractmethod def upload_csr(self, *args, **k...
pap/nupic
refs/heads/master
tests/swarming/nupic/swarming/experiments/oneField/description.py
32
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
EliotBerriot/django-dynamic-preferences
refs/heads/develop
dynamic_preferences/types.py
1
""" You'll find here the final, concrete classes of preferences you can use in your own project. """ from django import forms from django.db.models.signals import pre_delete from django.core.files.storage import default_storage from .preferences import AbstractPreference, Section from .exceptions import MissingModel...
miguelparaiso/PracticaOdoo
refs/heads/master
addons/website/controllers/main.py
24
# -*- coding: utf-8 -*- import cStringIO import datetime from itertools import islice import json import xml.etree.ElementTree as ET import logging import re import werkzeug.utils import urllib2 import werkzeug.wrappers from PIL import Image import openerp from openerp.addons.web.controllers.main import WebClient fr...
OmarIthawi/edx-platform
refs/heads/master
cms/djangoapps/contentstore/views/tests/test_group_configurations.py
8
""" Group Configuration Tests. """ import json from mock import patch from contentstore.utils import reverse_course_url, reverse_usage_url from contentstore.views.component import SPLIT_TEST_COMPONENT_TYPE from contentstore.views.course import GroupConfiguration from contentstore.tests.utils import CourseTestCase from ...
pepetreshere/odoo
refs/heads/patch-2
addons/survey/controllers/survey_session_manage.py
2
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import datetime import json import werkzeug from dateutil.relativedelta import relativedelta from werkzeug.exceptions import NotFound from odoo import fields, http from odoo.http import request from odoo.tools import i...
mcallaghan/tmv
refs/heads/master
BasicBrowser/tmv_app/management/commands/optimal_K.py
1
from django.core.management.base import BaseCommand, CommandError from scoping.models import * from tmv_app.models import * from tmv_app.tasks import * import os, time import re, nltk from nltk.stem import SnowballStemmer class Command(BaseCommand): help = 'collect bigrams from a query' def add_arguments(sel...
KohlsTechnology/ansible
refs/heads/devel
lib/ansible/modules/network/f5/bigip_irule.py
11
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks 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', ...
cryptobanana/ansible
refs/heads/devel
lib/ansible/modules/network/mlnxos/mlnxos_l2_interface.py
1
#!/usr/bin/python # # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
stxnext/intranet-open
refs/heads/master
src/intranet3/intranet3/models/config.py
1
import datetime from sqlalchemy import Column from sqlalchemy.types import DateTime, String, Integer from sqlalchemy.schema import ForeignKey from sqlalchemy.dialects import postgresql from intranet3 import memcache from intranet3.utils.encryption import encrypt, decrypt from intranet3.models import Base, DBSession, ...
schlizbaeda/yamuplay
refs/heads/master
pyudev/tests/test_pypi.py
2
# -*- coding: utf-8 -*- # Copyright (C) 2010, 2011, 2012, 2013 Sebastian Wiesner <lunaryorn@gmail.com> # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the # Free Software Foundation; either version 2.1 of the License, ...
intel/intel-iot-refkit
refs/heads/master
meta-iotqa/lib/oeqa/runtime/multimedia/opencv/files/cv_detect_shape.py
5
''' This test case tests that OpenCV python interface can detect triangle shape from an image using the funtions from the OpenCV CV component. ''' import os import cv2 as cv import numpy as np file = '/tmp/pic5.png' if not os.path.exists(file): raise Exception('OpenCV: Failed to find image file (%s).' % file) ...
hdinsight/hue
refs/heads/master
desktop/core/ext-py/cx_Oracle-5.1.2/test/IntervalVar.py
33
"""Module for testing interval variables.""" import datetime class TestIntervalVar(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.rawData = [] self.dataByKey = {} for i in range(1, 11): delta = datetime.timedelta(days = i, hours = i, minutes = i * 2, ...
reinbach/django-machina
refs/heads/master
machina/apps/forum_feeds/app.py
2
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf.urls import url from django.utils.translation import ugettext_lazy as _ from machina.core.app import Application from machina.core.loading import get_class class FeedsApp(Application): name = 'forum_feeds' latest_topics_feed ...
maestro-hybrid-cloud/heat
refs/heads/master
heat/tests/test_structured_config.py
2
# # 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 # ...
sbyoun/i-mapreduce
refs/heads/master
src/contrib/hod/testing/__init__.py
1638
#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 use thi...
erinn/ansible
refs/heads/devel
v1/tests/TestFilters.py
107
''' Test bundled filters ''' import os.path import unittest, tempfile, shutil from ansible import playbook, inventory, callbacks import ansible.runner.filter_plugins.core import ansible.runner.filter_plugins.mathstuff INVENTORY = inventory.Inventory(['localhost']) BOOK = ''' - hosts: localhost vars: var: { a: ...
HarborYuan/cashier
refs/heads/master
env/Lib/encodings/utf_32_le.py
744
""" Python 'utf-32-le' Codec """ import codecs ### Codec APIs encode = codecs.utf_32_le_encode def decode(input, errors='strict'): return codecs.utf_32_le_decode(input, errors, True) class IncrementalEncoder(codecs.IncrementalEncoder): def encode(self, input, final=False): return codecs.utf_32_le_en...
kalvdans/scipy
refs/heads/master
scipy/constants/tests/test_constants.py
38
from __future__ import division, print_function, absolute_import import warnings from numpy.testing import run_module_suite, assert_equal, assert_allclose import scipy.constants as sc def test_convert_temperature(): assert_equal(sc.convert_temperature(32, 'f', 'Celsius'), 0) assert_equal(sc.convert_temperat...
dynm/miasm
refs/heads/master
example/ida/depgraph.py
6
import sys import os import tempfile from idaapi import GraphViewer from miasm2.core.bin_stream_ida import bin_stream_ida from miasm2.core.asmbloc import * from miasm2.expression import expression as m2_expr from miasm2.expression.simplifications import expr_simp from miasm2.analysis.machine import Machine from miasm...
cliu-aa/flask
refs/heads/master
flask/__main__.py
321
# -*- coding: utf-8 -*- """ flask.__main__ ~~~~~~~~~~~~~~ Alias for flask.run for the command line. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ if __name__ == '__main__': from .cli import main main(as_module=True)
vaygr/ansible
refs/heads/devel
lib/ansible/executor/stats.py
48
# (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...
carborgar/metropol
refs/heads/master
metropol_abogados/management/commands/populate_db.py
1
# -*- coding: utf-8 -*- from django.contrib.auth.models import Permission, User from django.contrib.contenttypes.models import ContentType from django.core.management.base import BaseCommand class Command(BaseCommand): args = '<foo bar ...>' help = 'our help string comes here' @staticmethod def inser...
kennedyshead/home-assistant
refs/heads/dev
homeassistant/components/nightscout/sensor.py
2
"""Support for Nightscout sensors.""" from __future__ import annotations from asyncio import TimeoutError as AsyncIOTimeoutError from datetime import timedelta import logging from aiohttp import ClientError from py_nightscout import Api as NightscoutAPI from homeassistant.components.sensor import SensorEntity from h...
b-carter/numpy
refs/heads/master
numpy/distutils/fcompiler/ibm.py
45
from __future__ import division, absolute_import, print_function import os import re import sys from numpy.distutils.fcompiler import FCompiler from numpy.distutils.exec_command import exec_command, find_executable from numpy.distutils.misc_util import make_temp_file from distutils import log compilers = ['IBMFCompi...
google-research/google-research
refs/heads/master
kws_streaming/layers/conv2d_test.py
1
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
dezynetechnologies/odoo
refs/heads/8.0
addons/account_bank_statement_extensions/wizard/__init__.py
442
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under ...
adamgreig/Pyph
refs/heads/master
resize.py
1
# Pyph Resize # Resize an image # Copyright 2011 Adam Greig # Released under the simpified BSD license, see LICENSE import Image import numpy as np def do_resize(infile, outfile, c): """Resize infile, saving the result to outfile, going by sizes in c.""" img = np.asarray(Image.open(infile)) old_h = img.s...
apixandru/intellij-community
refs/heads/master
python/testData/paramInfo/ReassignedInstanceMethod.py
83
class Foo: def moo(self, a, b, c): pass foo = Foo() qoo = foo qoo.moo(<arg1>1, <arg2>2, <arg3>"bamboo")
whereismyjetpack/ansible
refs/heads/devel
lib/ansible/modules/cloud/rackspace/rax_keypair.py
50
#!/usr/bin/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 distributed...
trademob/boto
refs/heads/develop
boto/glacier/layer2.py
153
# -*- coding: utf-8 -*- # Copyright (c) 2012 Thomas Parslow http://almostobsolete.net/ # # 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 th...
dc3-plaso/plaso
refs/heads/master
tests/lib/plist.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for the plist library functions.""" import unittest from plaso.lib import plist from tests import test_lib as shared_test_lib class PlistTests(shared_test_lib.BaseTestCase): """Class to test the plist file.""" @shared_test_lib.skipUnlessHasTestFile([u'com.app...
daschwa/dupy
refs/heads/master
send2trash/__init__.py
78
# Copyright 2013 Hardcoded Software (http://www.hardcoded.net) # This software is licensed under the "BSD" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/bsd_license import sys if sys.platform == 'darwin'...
codefisher/tbutton_web
refs/heads/master
tbutton_votes/models.py
1
from django.db import models from django.contrib.auth.models import User from upvotes.models import AbstractRequest, AbstractRequestComment from djangopress.core.format.library import format_markdown class TbuttonRequest(AbstractRequest): APPLICATIONS = ( ('FX', 'Firefox'), ('TB', 'Thunderbird...
Ziqi-Li/bknqgis
refs/heads/master
bokeh/sphinx/source/docs/user_guide/examples/tools_position_toolbar_clash.py
63
from bokeh.plotting import figure, output_file, show output_file("toolbar.html") # create a new plot with the toolbar below p = figure(plot_width=400, plot_height=400, title=None, toolbar_location="below") p.circle([1, 2, 3, 4, 5], [2, 5, 8, 2, 7], size=10) show(p)
bverburg/CouchPotatoServer
refs/heads/master
libs/CodernityDB/indexcreator.py
81
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2011-2013 Codernity (http://codernity.com) # # 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/L...
suncycheng/intellij-community
refs/heads/master
python/helpers/pydev/tests_pydevd_python/_debugger_case4.py
91
import time if __name__ == '__main__': for i in range(10): print('here %s' % i) time.sleep(1) print('TEST SUCEEDED')
vlasov7777/blacksmith-bot
refs/heads/master
extensions/remote-ctrl.py
3
# BS mark.1-55 # /* coding: utf-8 */ # BlackSmith plugin # remote_ctrl_plugin.py # Coded by: WitcherGeralt (WitcherGeralt@jabber.ru) # http://witcher-team.ucoz.ru/ def handler_remote_control(type, source, body): confs = GROUPCHATS.keys() confs.sort() if body: args = body.split() if len(args) >= 3: item =...
haad/ansible
refs/heads/devel
lib/ansible/modules/database/influxdb/influxdb_database.py
46
#!/usr/bin/python # (c) 2016, Kamil Szczygiel <kamil.szczygiel () intel.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
openSUSE/libstorage-bgl-eval
refs/heads/master
integration-tests/filesystems/create-vfat.py
3
#!/usr/bin/python3 # requirements: disk /dev/sdc with msdos partition table and partition /dev/sdc1 from storage import * from storageitu import * set_logger(get_logfile_logger()) environment = Environment(False) storage = Storage(environment) storage.probe() staging = storage.get_staging() print(staging) par...
bebby520/essay_devel
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/url.py
552
from collections import namedtuple from ..exceptions import LocationParseError url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'] class Url(namedtuple('Url', url_attrs)): """ Datastructure for representing an HTTP URL. Used as a return value for :func:`parse_url`. """ s...
zjuwangg/scrapy
refs/heads/master
tests/test_feedexport.py
112
from __future__ import absolute_import import os import csv import json from io import BytesIO import tempfile import shutil import six from six.moves.urllib.parse import urlparse from zope.interface.verify import verifyObject from twisted.trial import unittest from twisted.internet import defer from scrapy.crawler im...
reverieinc/RevCode
refs/heads/master
revcode/mappings/rev_to_marathi.py
1
# -*- coding: utf-8 -*- offset = 0x0900 rev_code = { "M" : 0x901, # ँ "x" : 0x902, # ं "X" : 0x903, # ः "a" : 0x905, # अ "A" : 0x906, # आ "i" : 0x907, # इ "I" : 0x908, # ई "u" : 0x909, # उ "U" : 0x90A, # ऊ "WR" : 0x90B, # ऋ "WD" : 0x90C, # "WA" : 0x90D, # ऍ ...
indefini/linux
refs/heads/master
scripts/gdb/linux/cpus.py
997
# # gdb helper commands and functions for Linux kernel debugging # # per-cpu tools # # Copyright (c) Siemens AG, 2011-2013 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb from linux import tasks, utils MAX_CPUS = 4096 def get_cu...
akhan7/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/py/py/_log/__init__.py
278
""" logging API ('producers' and 'consumers' connected via keywords) """
mastizada/kuma
refs/heads/master
vendor/packages/translate-toolkit/translate/convert/moz2po.py
7
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2004-2006 Zuza Software Foundation # # This file is part of translate. # # translate 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...
shrimpboyho/git.js
refs/heads/master
emscript/python/2.7.5.1_32bit/Lib/site-packages/win32com/demos/trybag.py
18
import pythoncom from win32com.server import util from win32com.server import exception VT_EMPTY = pythoncom.VT_EMPTY class Bag: _public_methods_ = [ 'Read', 'Write' ] _com_interfaces_ = [ pythoncom.IID_IPropertyBag ] def __init__(self): self.data = { } def Read(self, propName, varType, errorLog): p...
onceuponatimeforever/oh-mainline
refs/heads/master
vendor/packages/python-social-auth/social/tests/actions/test_disconnect.py
22
import requests from httpretty import HTTPretty from social.actions import do_disconnect from social.exceptions import NotAllowedToDisconnect from social.utils import parse_qs from social.tests.models import User from social.tests.actions.actions import BaseActionTest class DisconnectActionTest(BaseActionTest): ...
OmeGak/indico
refs/heads/master
indico/modules/rb/tasks.py
2
# This file is part of Indico. # Copyright (C) 2002 - 2019 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import print_function, unicode_literals from datetime import date, datetime from itertool...
asedunov/intellij-community
refs/heads/master
python/testData/console/indent6.py
83
class Foo: def x(self): b = "x".format("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") if b: pass
DominoTree/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/pywebsocket/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...
cuescience/goat
refs/heads/master
goat/matcher.py
1
import inspect from goat import string from collections import OrderedDict from behave import matchers try: from behave.model import Argument as Argument_ from behave.model import Match as Match_ except ImportError: from behave.model_core import Argument as Argument_ from behave.matchers import Match ...
jmesteve/medical
refs/heads/master
openerp/addons/l10n_es_account_asset/__openerp__.py
6
# -*- 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...
regular/pyglet-avbin-optimizations
refs/heads/avbin-speedups
tests/image/DDS_RGBA_DXT5_LOAD.py
29
#!/usr/bin/env python '''Test DXT5 compressed RGBA load from a DDS file. You should see the rgba_dxt5.dds image on a checkboard background. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest import base_load from pyglet.image.codecs.dds import DDSImageDecoder class TEST_DDS_...
assemblio/project-nastradin
refs/heads/master
nastradini/views/browse/internalpositions.py
1
from flask import render_template from flask.views import MethodView from nastradini import mongo class BrowseInternalPositions(MethodView): methods = ['GET'] def get(self): # Render the templates. results = mongo.db.positions.find() return render_template('browse/internal-positions....
bitcommoditiz/P2Pool
refs/heads/master
wstools/TimeoutSocket.py
293
"""Based on code from timeout_socket.py, with some tweaks for compatibility. These tweaks should really be rolled back into timeout_socket, but it's not totally clear who is maintaining it at this point. In the meantime, we'll use a different module name for our tweaked version to avoid any confusion. T...
tmroeder/cloudproxy
refs/heads/master
src/third_party/googlemock/test/gmock_output_test.py
986
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
braintree/braintree_python
refs/heads/master
braintree/subscription_details.py
5
from braintree.attribute_getter import AttributeGetter class SubscriptionDetails(AttributeGetter): pass
flaviocpontes/ffmpymedia
refs/heads/master
tests/test_media_functional.py
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import unittest from os.path import join as joinpath import ffmpymedia from tests import TEST_FILE_PATH class TestMediaUse(unittest.TestCase): def test_compare_two_files(self): # User1 wants to compare two media files to see if their stream layouts are t...
okwow123/djangol2
refs/heads/master
example/env/lib/python2.7/site-packages/django/core/management/commands/inspectdb.py
58
from __future__ import unicode_literals import keyword import re from collections import OrderedDict from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections from django.db.models.constants import LOOKUP_SEP from django.utils.encoding import force_text cl...
veltzer/demos-python
refs/heads/master
src/examples/short/meta_programming/reflection_simple.py
1
#!/usr/bin/env python """ This example just shows how to do reflection in python and see the class of each object and the list of stuff you can request of it. """ class A: def __init__(self): self.myfield = 7 def my_method(self): print('Hello') a = A() print(a.__dict__) print(a.__class__) ...
nilmini20s/gem5-2016-08-13
refs/heads/master
src/sim/DVFSHandler.py
55
# Copyright (c) 2013-2014 ARM Limited # 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 implementation of the functiona...