repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
gurneyalex/odoo
refs/heads/13.0-improve_sale_coupon_perf
addons/website_crm/controllers/main.py
2
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import http from odoo.http import request from odoo.addons.website_form.controllers.main import WebsiteForm class WebsiteForm(WebsiteForm): def _get_country(self): country_code = request.session....
lgeiger/ide-python
refs/heads/master
lib/debugger/VendorLib/vs-py-debugger/pythonFiles/experimental/ptvsd/ptvsd/_vendored/pydevd/_pydev_bundle/pydev_log.py
26
import sys from _pydevd_bundle.pydevd_constants import DebugInfoHolder from _pydev_imps._pydev_saved_modules import threading currentThread = threading.currentThread import traceback WARN_ONCE_MAP = {} def stderr_write(message): sys.stderr.write(message) sys.stderr.write("\n") def debug(message): if D...
eivantsov/flask
refs/heads/master
lib/werkzeug/contrib/cache.py
306
# -*- coding: utf-8 -*- """ werkzeug.contrib.cache ~~~~~~~~~~~~~~~~~~~~~~ The main problem with dynamic Web sites is, well, they're dynamic. Each time a user requests a page, the webserver executes a lot of code, queries the database, renders templates until the visitor gets the page he sees. ...
songyi199111/sentry
refs/heads/master
tests/sentry/tasks/test_beacon.py
11
from __future__ import absolute_import, print_function import json import sentry from mock import patch from sentry import options from sentry.testutils import TestCase from sentry.tasks.beacon import BEACON_URL, send_beacon class SendBeaconTest(TestCase): @patch('sentry.tasks.beacon.safe_urlopen') @patch(...
gautam1858/tensorflow
refs/heads/master
tensorflow/python/grappler/tf_optimizer_test.py
9
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
akretion/odoo
refs/heads/12-patch-paging-100-in-o2m
addons/bus/models/ir_autovacuum.py
21
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, models class AutoVacuum(models.AbstractModel): _inherit = 'ir.autovacuum' @api.model def power_on(self, *args, **kwargs): self.env['bus.bus'].gc() return super(AutoVacuu...
ankurjimmy/catawampus
refs/heads/master
google3.py
6
#!/usr/bin/python # Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
steamboating/Arduino
refs/heads/master
arduino-core/src/processing/app/i18n/python/requests/hooks.py
1891
# -*- coding: utf-8 -*- """ requests.hooks ~~~~~~~~~~~~~~ This module provides the capabilities for the Requests hooks system. Available hooks: ``response``: The response generated from a Request. """ HOOKS = ['response'] def default_hooks(): hooks = {} for event in HOOKS: hooks[event] = []...
Fusion-Rom/android_external_chromium_org_third_party_WebKit
refs/heads/lp5.1
Tools/Scripts/webkitpy/common/system/fileset.py
161
# Copyright (C) 2010 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: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and th...
stevekuznetsov/ansible
refs/heads/devel
test/integration/targets/module_utils/module_utils/baz2/one.py
298
data = 'baz2'
sandeepgupta2k4/tensorflow
refs/heads/master
tensorflow/contrib/factorization/python/ops/factorization_ops_test_utils.py
116
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
tvibliani/odoo
refs/heads/8.0
addons/hr_attendance/hr_attendance.py
250
# -*- 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...
stephen144/odoo
refs/heads/9.0
addons/web_settings_dashboard/models/res_users.py
41
# -*- coding: utf-8 -*- from openerp import models, api class Users(models.Model): _inherit = 'res.users' @api.model def web_dashboard_create_users(self, emails): # Reactivate already existing users if needed deactivated_users = self.with_context(active_test=False).search([('active', '=...
Kazade/NeHe-Website
refs/heads/master
google_appengine/lib/django-1.3/tests/regressiontests/utils/text.py
51
import unittest from django.utils import text class TestUtilsText(unittest.TestCase): def test_truncate_words(self): self.assertEqual(u'The quick brown fox jumped over the lazy dog.', text.truncate_words(u'The quick brown fox jumped over the lazy dog.', 10)) self.assertEqual(u'The qui...
tedelhourani/ansible
refs/heads/devel
lib/ansible/modules/cloud/openstack/os_server_facts.py
25
#!/usr/bin/python # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # 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', ...
apel/apel
refs/heads/dev
test/test_schemas.py
3
import os from subprocess import call, Popen, PIPE import unittest if os.name == 'nt': os.environ['PATH'] += ';C:/Program Files/MySQL/MySQL Server 5.1/bin/' class SchemaTest(unittest.TestCase): # These test cases require a local MySQL db server with no password on root def setUp(self): query = (...
home-assistant/home-assistant
refs/heads/dev
script/translations/upload.py
21
#!/usr/bin/env python3 """Merge all translation sources into a single JSON file.""" import json import os import pathlib import re import subprocess from .const import CLI_2_DOCKER_IMAGE, CORE_PROJECT_ID, INTEGRATIONS_DIR from .error import ExitApp from .util import get_current_branch, get_lokalise_token FILENAME_FOR...
rynomad/CCNx-Federated-Wiki-Prototype
refs/heads/master
server/express/node_modules/npm/node_modules/node-gyp/gyp/PRESUBMIT.py
127
# Copyright (c) 2012 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. """Top-level presubmit script for GYP. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmit API built...
csrocha/OpenUpgrade
refs/heads/8.0
addons/account/wizard/account_fiscalyear_close.py
81
# -*- 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...
kosgroup/odoo
refs/heads/10.0
addons/website_mail_channel/controllers/__init__.py
48
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import main
dcroc16/skunk_works
refs/heads/master
google_appengine/lib/django-1.2/django/utils/simplejson/__init__.py
324
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`simplejson` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is the externally maintained version of ...
jbedorf/tensorflow
refs/heads/master
tensorflow/contrib/factorization/python/kernel_tests/clustering_ops_test.py
25
# 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 applic...
devendermishrajio/nova_test_latest
refs/heads/master
nova/api/metadata/password.py
66
# Copyright 2012 Nebula, 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 ...
JPFrancoia/scikit-learn
refs/heads/master
doc/sphinxext/numpy_ext/docscrape.py
108
"""Extract reference documentation from the NumPy source tree. """ import inspect import textwrap import re import pydoc from warnings import warn # Try Python 2 first, otherwise load from Python 3 try: from StringIO import StringIO except: from io import StringIO class Reader(object): """A line-based s...
40223221/0622w17
refs/heads/master
static/Brython3.1.3-20150514-095342/Lib/sre_constants.py
692
# # Secret Labs' Regular Expression Engine # # various symbols used by the regular expression engine. # run this script to update the _sre include files! # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support modul...
hinerm/ITK
refs/heads/master
Wrapping/Generators/Python/Tests/GeodesicActiveContourImageFilter.py
13
#========================================================================== # # Copyright Insight Software Consortium # # 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...
MatthewWilkes/django-oscar
refs/heads/master
tests/functional/basket_tests.py
41
from decimal import Decimal as D from django.utils.six.moves import http_client import datetime from django.conf import settings from django.test import TestCase, Client from django.core.urlresolvers import reverse from oscar.test.factories import create_product from oscar.core.compat import get_user_model from oscar...
wbg-optronix-lab/emergence-lab
refs/heads/master
core/forms/sample.py
2
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django import forms from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ from betterforms import multiform from crispy_forms import helper, layout, bootstrap from core.models im...
nkurihar/pulsar
refs/heads/master
tests/docker-images/latest-version-image/python-examples/producer_schema.py
6
#!/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 # "...
Stanford-Online/edx-analytics-pipeline
refs/heads/master
edx/analytics/tasks/monitor/performance.py
2
import luigi from edx.analytics.tasks.common.mapreduce import MapReduceJobTask from edx.analytics.tasks.common.pathutil import EventLogSelectionMixin from edx.analytics.tasks.util.url import get_target_from_url class ParseEventLogPerformanceTask(EventLogSelectionMixin, MapReduceJobTask): """ This represents...
frastlin/PyAudioGame
refs/heads/master
pyaudiogame/event_handler.py
1
from pyaudiogame import global_keymap def _run_on_callbacks(self, name): def returned_func(event): try: self.__dict__['_' + name](event) except KeyError: pass object.__getattribute__(self, name)(event) return returned_func class EventTemplate(object): def __init__(self, event=None, input_types=['key', ...
sreidy/roboticsclub.org
refs/heads/master
robocrm/migrations/0043_auto_20150210_0934.py
2
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.core.validators class Migration(migrations.Migration): dependencies = [ ('robocrm', '0042_auto_20150210_0811'), ] operations = [ migrations.AlterField( mode...
sxpert/ansible-modules-core
refs/heads/devel
cloud/vmware/vsphere_guest.py
45
#!/usr/bin/python # -*- coding: utf-8 -*- # 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. #...
showgood/YCM_windows
refs/heads/master
third_party/bottle/test/test_resources.py
46
from bottle import ResourceManager import os.path import unittest class TestResourceManager(unittest.TestCase): def test_path_normalize(self): tests = ('/foo/bar/', '/foo/bar/baz', '/foo/baz/../bar/blub') for test in tests: rm = ResourceManager() rm.add_path(test) ...
ales-erjavec/orange
refs/heads/master
docs/extend-widgets/rst/OWDataSamplerA.py
6
""" <name>Data Sampler</name> <description>Randomly selects a subset of instances from the data set</description> <icon>icons/DataSamplerA.svg</icon> <priority>10</priority> """ # [start-snippet-1] import Orange from OWWidget import * import OWGUI class OWDataSamplerA(OWWidget): def __init__(self, parent=None, si...
arderyp/scotuswebcites
refs/heads/master
discovery/views.py
6445
from django.shortcuts import render # Create your views here.
SwagColoredKitteh/servo
refs/heads/master
tests/wpt/harness/wptrunner/wptmanifest/backends/conditional.py
188
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import operator from ..node import NodeVisitor, DataNode, ConditionalNode, KeyValueNode, ListNode, ValueNode from ..par...
yanheven/horizon
refs/heads/master
horizon/test/test_dashboards/dogs/puppies/panel.py
102
# 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 t...
agry/NGECore2
refs/heads/master
scripts/object/tangible/deed/event_perk/fenced_enclosure_deed.py
85615
import sys def setup(core, object): return
ldgarcia/django-allauth
refs/heads/master
allauth/socialaccount/providers/bitly/provider.py
75
from allauth.socialaccount import providers from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider class BitlyAccount(ProviderAccount): def get_profile_url(self): return self.account.extra_data.get('profile_url') def...
thesuperzapper/tensorflow
refs/heads/master
tensorflow/contrib/keras/api/keras/datasets/cifar10/__init__.py
57
# 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...
hakjimmy/cngame
refs/heads/master
process_sounds.py
6
import process_operations as po import module_sounds def process_sounds(processor, txt_file): unique_sound_files = {} sound_files_list = [] sounds_list = [] last_sound_no = 0 for sound in module_sounds.sounds: sound_flags = sound[1] sound_files = sound[2] sounds_list.append("snd_%s %d %d " % (sou...
altalang/pisa
refs/heads/master
sx/w3c/css.py
17
#!/usr/bin/env python ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ##~ Copyright (C) 2002-2004 TechGame Networks, LLC. ##~ ##~ This library is free software; you can redistribute it and/or ##~ modify it under the terms of the BSD style License as found in the ##~ LICENSE file included with this distrib...
jeanpimentel/contents
refs/heads/master
contents/__init__.py
1
#!/usr/bin/env python # coding: utf-8 # # <contents - Put a table of contents in your files!> # Copyright (C) 2013 Jean Pimentel <contato@jeanpimentel.com.br> # # 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 Softw...
10clouds/edx-platform
refs/heads/dev
common/test/acceptance/tests/lms/test_learner_profile.py
3
# -*- coding: utf-8 -*- """ End-to-end tests for Student's Profile Page. """ from contextlib import contextmanager from datetime import datetime from bok_choy.web_app_test import WebAppTest from nose.plugins.attrib import attr from ...pages.common.logout import LogoutPage from ...pages.lms.account_settings import Acc...
andreaso/ansible
refs/heads/devel
lib/ansible/utils/module_docs_fragments/auth_basic.py
152
# 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 in the hope that ...
anirudhSK/chromium
refs/heads/master
media/PRESUBMIT.py
55
# Copyright 2013 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. """Top-level presubmit script for Chromium media component. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details abo...
zhyang-liu/ZhihuMaintenance
refs/heads/master
zhModels.py
1
# !/usr/local/bin/python3 # -*- coding: utf-8 -*- import json import re from urllib.parse import urlencode import requests from bs4 import BeautifulSoup as BS zhUrl = lambda x: 'http://www.zhihu.com' + ("/{}".format(x.strip('/')) if x is not None else '') me = None class ZhModelException(Exception): pass c...
lakshayg/tensorflow
refs/heads/master
tensorflow/contrib/text/python/ops/__init__.py
102
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Rob2B/Cherry-enseirb
refs/heads/master
app/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py
2485
# This file comes from # https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py # Do not edit! Edit the upstream one instead. """Python module for generating .ninja files. Note that this is emphatically not a required piece of Ninja; it's just a helpful utility for build-file-generation systems that alr...
rkq/cxxexp
refs/heads/master
third-party/src/protobuf-2.5.0/examples/add_person.py
432
#! /usr/bin/python # See README.txt for information and build instructions. import addressbook_pb2 import sys # This function fills in a Person message based on user input. def PromptForAddress(person): person.id = int(raw_input("Enter person ID number: ")) person.name = raw_input("Enter name: ") email = raw_...
github-account-because-they-want-it/django
refs/heads/master
django/utils/numberformat.py
431
from __future__ import unicode_literals from decimal import Decimal from django.conf import settings from django.utils import six from django.utils.safestring import mark_safe def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='', force_grouping=False): """ Gets a number (...
geminy/aidear
refs/heads/master
oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/net/data/verify_certificate_chain_unittest/generate-basic-constraints-pathlen-0-self-issued.py
5
#!/usr/bin/python # Copyright (c) 2015 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. """Certificate chain with 2 intermediates. The first intermediate has a basic constraints path length of 0. The second one is self-issu...
ankit318/appengine-mapreduce
refs/heads/master
python/src/mapreduce/mapper_pipeline.py
23
#!/usr/bin/env python # Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
jonhadfield/ansible-modules-core
refs/heads/devel
cloud/amazon/ec2_metric_alarm.py
25
#!/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...
sivel/ansible
refs/heads/devel
test/integration/targets/gathering_facts/library/file_utils.py
35
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import sys from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.facts.utils import ( get_file_content, get_file_lines, get_mount_size, ) def main(): module = AnsibleModule( ...
SnabbCo/neutron
refs/heads/master
neutron/plugins/ml2/common/exceptions.py
68
# Copyright (c) 2013 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 ...
ohtaman/pynm
refs/heads/master
docs/conf.py
1
# -*- coding: utf-8 -*- # # pynm documentation build configuration file, created by # sphinx-quickstart on Mon Nov 17 09:59:25 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All ...
aral/isvat
refs/heads/master
django/contrib/gis/forms/fields.py
107
from __future__ import unicode_literals from django import forms from django.utils.translation import ugettext_lazy as _ # While this couples the geographic forms to the GEOS library, # it decouples from database (by not importing SpatialBackend). from django.contrib.gis.geos import GEOSException, GEOSGeometry class...
GoogleCloudPlatform/sap-deployment-automation
refs/heads/master
third_party/github.com/ansible/awx/awx/main/tests/functional/analytics/test_core.py
1
import importlib import json import os import tarfile from unittest import mock import pytest from django.conf import settings from awx.main.analytics import gather, register @register('example', '1.0') def example(since): return {'awx': 123} @register('bad_json', '1.0') def bad_json(since): return set() ...
cosurgi/trunk
refs/heads/master
examples/test/periodic-geom-compare.py
9
# coding: utf-8 # 2009 © Václav Šmilauer <eudoxos@arcig.cz> "Test and demonstrate use of PeriTriaxController." from yade import pack O.periodic=True O.cell.setBox(.1,.1,.1) O.cell.trsf=Matrix3().Identity; sp=pack.SpherePack() radius=5e-3 num=sp.makeCloud(Vector3().Zero,O.cell.refSize,radius,.6,-1,periodic=True) # min,...
40223225/2015cd_midterm
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/multiprocessing/__init__.py
693
# # Package analogous to 'threading.py' but using processes # # multiprocessing/__init__.py # # This package is intended to duplicate the functionality (and much of # the API) of threading.py but uses processes instead of threads. A # subpackage 'multiprocessing.dummy' has the same API but is a simple # wrapper for 't...
Nexenta/s3-tests
refs/heads/master
virtualenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/sjisprober.py
1182
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
dsprenkels/servo
refs/heads/master
tests/wpt/css-tests/tools/html5lib/html5lib/tests/test_treeadapters.py
451
from __future__ import absolute_import, division, unicode_literals from . import support # flake8: noqa import html5lib from html5lib.treeadapters import sax from html5lib.treewalkers import getTreeWalker def test_to_sax(): handler = support.TracingSaxHandler() tree = html5lib.parse("""<html xml:lang="en">...
pedrobaeza/odoomrp-wip
refs/heads/8.0
project_events_copy/wizard/__init__.py
2
# -*- encoding: utf-8 -*- ############################################################################## # # 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 Licen...
Fedik/gramps
refs/heads/master
gramps/gen/utils/maclocale.py
5
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2011 John Ralls, Fremont, CA # # 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 yo...
cyanna/edx-platform
refs/heads/master
lms/djangoapps/course_wiki/utils.py
204
""" Utility functions for course_wiki. """ from django.core.exceptions import ObjectDoesNotExist from xmodule import modulestore import courseware def user_is_article_course_staff(user, article): """ The root of a course wiki is /<course_number>. This means in case there are two courses which have the sa...
Austin503/pyglet
refs/heads/master
tests/window/EVENT_SEQUENCE_CREATE_FULLSCREEN.py
33
#!/usr/bin/env python # $Id: $ import unittest from pyglet import window import base_event_sequence __noninteractive = True class TEST_CLASS(base_event_sequence.BaseEventSequence): last_sequence = 3 def on_resize(self, width, height): self.check_sequence(1, 'on_resize') def on_show(self): ...
w1ll1am23/home-assistant
refs/heads/dev
homeassistant/components/hassio/handler.py
2
"""Handler for Hass.io.""" import asyncio import logging import os import aiohttp from homeassistant.components.http import ( CONF_SERVER_HOST, CONF_SERVER_PORT, CONF_SSL_CERTIFICATE, ) from homeassistant.const import HTTP_BAD_REQUEST, HTTP_OK, SERVER_PORT from .const import X_HASSIO _LOGGER = logging.g...
mancoast/CPythonPyc_test
refs/heads/master
cpython/266_test_glob.py
58
import unittest from test.test_support import run_unittest, TESTFN import glob import os import shutil class GlobTests(unittest.TestCase): def norm(self, *parts): return os.path.normpath(os.path.join(self.tempdir, *parts)) def mktemp(self, *parts): filename = self.norm(*parts) base, f...
shabab12/edx-platform
refs/heads/master
openedx/core/djangoapps/credit/api/provider.py
25
""" API for initiating and tracking requests for credit from a provider. """ import datetime import logging import uuid import pytz from django.db import transaction from lms.djangoapps.django_comment_client.utils import JsonResponse from edx_proctoring.api import get_last_exam_completion_date from openedx.core.djan...
jnerin/ansible
refs/heads/devel
lib/ansible/modules/cloud/cloudstack/cs_instancegroup.py
49
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # 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 Lice...
stefan-caraiman/python-lab
refs/heads/master
python/solutii/vlad_cristia_avram/paranteze.py
5
"""Rezolvarea pentru problema paranteze""" from __future__ import print_function def verifica_expresia(paranteze): """Functia de verificare""" mesaj = [] try: for element in paranteze: if element == "[" or element == "(": mesaj.append(element) elif element =...
ckuethe/gr-chancoding
refs/heads/master
python/qa_chancoding_rm_decoder_vii.py
2
#!/usr/bin/env python # # Copyright 2011 Communications Engineering Lab, KIT # # This file is part of GNU Radio # # GNU Radio 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, or (at your opt...
slobberchops/rop
refs/heads/master
art/rotate.py
1
from _baseclass import ArtBaseClass from math import sqrt from random import random from opc.hue import getColorGen SCALE = 4 class Art(ArtBaseClass): description = "Demo image rotation" def __init__(self, matrix, config): self.hue = getColorGen(0.006) self.margin = sqrt(matrix.numpix) * ...
archen/django-oauth2-provider
refs/heads/master
provider/compat/__init__.py
21
from django.conf import settings user_model_label = getattr(settings, 'AUTH_USER_MODEL', 'auth.User') try: from django.contrib.auth.tests.utils import skipIfCustomUser except ImportError: def skipIfCustomUser(wrapped): return wrapped
wimnat/ansible
refs/heads/devel
test/integration/targets/module_utils/library/test_env_override.py
35
#!/usr/bin/python # Most of these names are only available via PluginLoader so pylint doesn't # know they exist # pylint: disable=no-name-in-module from __future__ import absolute_import, division, print_function __metaclass__ = type from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.json_u...
endisd/samba
refs/heads/master
lib/subunit/python/testtools/tests/test_testsuite.py
1
# Copyright (c) 2009 Jonathan M. Lange. See LICENSE for details. """Test ConcurrentTestSuite and related things.""" __metaclass__ = type import unittest from testtools import ( ConcurrentTestSuite, iterate_tests, TestCase, ) from testtools.matchers import ( Equals, ) from testtools.tests.hel...
sahiljain/catapult
refs/heads/master
third_party/google-endpoints/cachetools/rr.py
8
import random from .cache import Cache class RRCache(Cache): """Random Replacement (RR) cache implementation.""" def __init__(self, maxsize, choice=random.choice, missing=None, getsizeof=None): Cache.__init__(self, maxsize, missing, getsizeof) self.__choice = choice @pr...
captainpete/rethinkdb
refs/heads/next
external/v8_3.30.33.16/testing/gtest/scripts/release_docs.py
1167
#!/usr/bin/env python # # Copyright 2013 Google Inc. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of...
khagler/boto
refs/heads/develop
boto/ec2/elb/healthcheck.py
185
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 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 wi...
skinzor/henkate_kernel_j5-stock
refs/heads/lp-5.1.1
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
seandavi/SDST
refs/heads/master
SDST/seqvcf.py
2
from SDST.snpeff import effNames,snpEffEffects import itertools import vcf import math import fisher def vcfMelt(reader,outfile,samplename=None,includeGenotypes=False): """Melt a VCF file into a tab-delimited text file :param reader: a vcf.Reader object (from the pyvcf package) :param outfile: a stream to...
shaform/scrapy
refs/heads/master
tests/test_feedexport.py
5
from __future__ import absolute_import import os import csv import json from io import BytesIO import tempfile import shutil 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 import Crawle...
freeflightsim/ffs-app-engine
refs/heads/master
google_appengine/google/net/proto/ProtocolBuffer.py
8
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
jadonk/debexpo
refs/heads/master
debexpo/tests/test_filesystem.py
2
# -*- coding: utf-8 -*- # # test_filesystem.py — CheckFiles class test cases # # This file is part of debexpo - https://alioth.debian.org/projects/debexpo/ # # Copyright © 2012 Nicolas Dandrimont <nicolas.dandrimont@crans.org> # # Permission is hereby granted, free of charge, to any person # obtaining a copy ...
gsmartway/odoo
refs/heads/8.0
addons/edi/__init__.py
437
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
GoelDeepak/dcos
refs/heads/master
packages/adminrouter/extra/src/test-harness/tests/open/test_master.py
4
# Copyright (C) Mesosphere, Inc. See LICENSE file for details. import logging import pytest import requests from generic_test_code.common import overridden_file_content from mocker.endpoints.mesos import AGENT1_ID log = logging.getLogger(__name__) authed_endpoints = [ '/acs/api/v1/reflect/me', '/capabiliti...
JCA-Developpement/Odoo
refs/heads/master
openerp/addons/test_inherit/__init__.py
2074
# -*- coding: utf-8 -*- import models # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
toumorokoshi/web-transmute
refs/heads/master
transmute_core/frameworks/aiohttp/__init__.py
2
from transmute_core import * from .url_dispatcher import TransmuteUrlDispatcher from .swagger import add_swagger_api_route, create_swagger_json_handler, add_swagger from .route import add_route route = add_route
t3dev/odoo
refs/heads/master
odoo/release.py
3
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. RELEASE_LEVELS = [ALPHA, BETA, RELEASE_CANDIDATE, FINAL] = ['alpha', 'beta', 'candidate', 'final'] RELEASE_LEVELS_DISPLAY = {ALPHA: ALPHA, BETA: BETA, RELEASE_CANDIDATE...
petemounce/ansible
refs/heads/devel
lib/ansible/modules/packaging/language/bower.py
70
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Michael Warkentin <mwarkentin@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 ...
krikru/tensorflow-opencl
refs/heads/master
tensorflow/contrib/distributions/python/kernel_tests/bijector_test.py
5
# 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...
kyroskoh/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/file_lock_integrationtest.py
124
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above co...
sagar30051991/ozsmart-erp
refs/heads/master
erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
9
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import unittest import frappe import frappe.defaults from frappe.utils import cint, flt, cstr from erpnext.stock.doctype.purchase_receipt.purchase_rece...
SamYaple/neutron
refs/heads/master
neutron/services/l3_router/brocade/l3_router_plugin.py
42
# Copyright 2014 Brocade Communications System, 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 # #...
jhayworth/config
refs/heads/master
.emacs.d/elpy/rpc-venv/local/lib/python2.7/site-packages/jedi/inference/lazy_value.py
2
from jedi.inference.base_value import ValueSet, NO_VALUES from jedi.common.utils import monkeypatch class AbstractLazyValue(object): def __init__(self, data): self.data = data def __repr__(self): return '<%s: %s>' % (self.__class__.__name__, self.data) def infer(self): raise NotI...
Mirodin/paperwork
refs/heads/stable
src/paperwork/frontend/mainwindow/scan.py
2
# Paperwork - Using OCR to grep dead trees the easy way # Copyright (C) 2014 Jerome Flesch # # Paperwork 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 # ...
kokushozero/mifsaDBProject
refs/heads/master
web2py/applications/admin/languages/nl.py
17
# -*- coding: utf-8 -*- { '!langcode!': 'nl', '!langname!': 'Nederlands', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is een optionele expressie zoals "veld1=\'nieuwewaarde\'". Je kan de resultaten van een JOIN niet updaten of verwijderen...
Manuel4131/youtube-dl
refs/heads/master
youtube_dl/extractor/fivetv.py
139
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import int_or_none class FiveTVIE(InfoExtractor): _VALID_URL = r'''(?x) http:// (?:www\.)?5-tv\.ru/ (?: ...