repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
syci/OCB
refs/heads/9.0
addons/crm_partner_assign/crm_lead.py
46
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.osv import osv from openerp.tools.translate import _ from openerp.tools.safe_eval import safe_eval as eval from openerp.exceptions import UserError class crm_lead(osv.osv): _inherit = 'crm.lead' d...
evanv/simhash-db-py
refs/heads/master
bench.py
2
#! /usr/bin/env python '''This is a utility to run a benchmark against a backend''' import os import time import psutil import random import argparse from simhash_db import Client, GeneralException parser = argparse.ArgumentParser(description='Run benchmarks on simhash_db') parser.add_argument('--count', type=int, d...
Elico-Corp/odoo_OCB
refs/heads/9.0
addons/sale_stock/company.py
44
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp import fields, models class company(models.Model): _inherit = 'res.company' security_lead = fields.Float('Sales Safety Days', required=True, default = 0.0, help="Margin of error for dates p...
repotvsupertuga/tvsupertuga.repository
refs/heads/master
instal/script.module.liveresolver/lib/js2py/constructors/jsarray.py
31
from js2py.base import * @Js def Array(): if len(arguments)==0 or len(arguments)>1: return arguments.to_list() a = arguments[0] if isinstance(a, PyJsString): length = a.to_uint32() if length!=a.value: raise MakeError('RangeError', 'Invalid array length') temp = J...
h3biomed/ansible
refs/heads/h3
contrib/inventory/rackhd.py
52
#!/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 distri...
efeguney/gemmlowp
refs/heads/master
meta/generators/streams_arm_32.py
7
# Copyright 2016 The Gemmlowp 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 applicable...
petxo/clitellum
refs/heads/master
clitellum/core/bus.py
1
# author = sbermudel # package description from datetime import date import datetime class Context: def __init__(self): pass _instance = None @classmethod def create(cls): cls._instance = Context() @classmethod def instance(cls): if cls._instance is None: ...
theguardian/headphones
refs/heads/master
lib/html5lib/treeadapters/sax.py
1835
from __future__ import absolute_import, division, unicode_literals from xml.sax.xmlreader import AttributesNSImpl from ..constants import adjustForeignAttributes, unadjustForeignAttributes prefix_mapping = {} for prefix, localName, namespace in adjustForeignAttributes.values(): if prefix is not None: pre...
lahosken/pants
refs/heads/master
src/python/pants/backend/docgen/register.py
15
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.backend.d...
sanyaade-teachings/gyp
refs/heads/master
test/msvs/config_attrs/gyptest-config_attrs.py
34
#!/usr/bin/env python # 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. """ Verifies that msvs_configuration_attributes and msbuild_configuration_attributes are applied by using them to set the OutputDirectory. "...
ojengwa/oh-mainline
refs/heads/master
vendor/packages/Django/tests/regressiontests/multiple_database/models.py
109
from __future__ import absolute_import from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class R...
amitsaha/learning
refs/heads/master
python/graphs/task_ordering.py
1
''' Find the task ordering from a set of dependency rules: Example rules: 3 -> 1 5 2 -> 5 3 4 -> 3 5 -> 1 ''' from __future__ import print_function class Node: def __init__(self, label, neighbors=[]): self.label = label self.neighbors = neighbors def __str__(self): r...
DARKPOP/external_chromium_org
refs/heads/dark-5.1
chrome/common/extensions/PRESUBMIT.py
56
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Presubmit script for changes affecting extensions. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about...
AhmadHamzeei/Amir-Accounting
refs/heads/master
amir/dbconfig.py
1
import database from share import share config = share.config ## \defgroup Controller ## @{ class dbConfig: data = { 'co-name' :'Enter Company name', 'co-logo' :'', 'custSubject' : '4', 'bank' : '1', 'cash' :'14', 'buy' :'1...
GoSteven/Diary
refs/heads/master
django/contrib/admindocs/models.py
12
# Empty models.py to allow for specifying admindocs as a test label.
googleapis/googleapis-gen
refs/heads/master
google/cloud/gkehub/v1beta1/gkehub-v1beta1-py/google/cloud/gkehub_v1beta1/services/gke_hub_membership_service/pagers.py
1
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
whitehorse-io/encarnia
refs/heads/master
pyenv/lib/python2.7/site-packages/twisted/trial/test/test_output.py
18
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for the output generated by trial. """ from __future__ import absolute_import, division, print_function import os from twisted.python.compat import NativeStringIO, _PY3 from twisted.scripts import trial from twisted.trial import runn...
abramhindle/UnnaturalCodeFork
refs/heads/master
python/testdata/launchpad/lib/lp/blueprints/model/specificationsearch.py
1
# Copyright 2013 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Helper methods to search specifications.""" __metaclass__ = type __all__ = [ 'get_specification_filters', 'get_specification_active_product_filter', 'get_specificat...
DarkPhoenix6/My_Libraries
refs/heads/master
Python/AES/StateArray.py
1
from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * from future import standard_library standard_library.install_aliases() import os from AES.matrix import Matrix, MISSING from AES.gen_key_schedule import get_round_keys, set_key from AES i...
paulproteus/django
refs/heads/master
tests/modeltests/get_latest/tests.py
89
from __future__ import absolute_import from datetime import datetime from django.test import TestCase from .models import Article, Person class LatestTests(TestCase): def test_latest(self): # Because no Articles exist yet, latest() raises ArticleDoesNotExist. self.assertRaises(Article.DoesNotEx...
enormandeau/Scripts
refs/heads/master
fastq_correct.py
2
#!/usr/bin/env python """Add sequence name before quality string if missing. Usage: %program <input_file> <output_file>""" import sys try: in_file = sys.argv[1] out_file = sys.argv[2] except: print __doc__ sys.exit(0) with open(in_file) as f: with open(out_file, "w") as out_f: for l...
johnkit/vtk-dev
refs/heads/master
Rendering/Core/Testing/Python/PickerWithLocator.py
21
#!/usr/bin/env python import vtk from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # # Do picking with a locator to speed things up # # renderer and interactor ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) iren = vtk.vtkRenderWindowInteractor() iren.SetRend...
fertozudo/umatoo
refs/heads/master
lib/django/core/handlers/wsgi.py
339
from __future__ import unicode_literals import cgi import codecs import logging import sys from io import BytesIO from threading import Lock from django import http from django.conf import settings from django.core import signals from django.core.handlers import base from django.core.urlresolvers import set_script_pr...
vickenty/ookoobah
refs/heads/master
pyglet-c9188efc2e30/pyglet/libs/x11/xf86vmode.py
46
'''Wrapper for Xxf86vm Generated with: tools/genwrappers.py xf86vmode Do not modify this file. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import ctypes from ctypes import * import pyglet.lib _lib = pyglet.lib.load_library('Xxf86vm') _int_types = (c_int16, c_int32) if hasattr(ctypes, 'c_int64'):...
kbdick/RecycleTracker
refs/heads/gh-pages
recyclecollector/scrap/gdata-2.0.18/build/lib.linux-x86_64-2.7/gdata/tlslite/utils/PyCrypto_RSAKey.py
361
"""PyCrypto RSA implementation.""" from cryptomath import * from RSAKey import * from Python_RSAKey import Python_RSAKey if pycryptoLoaded: from Crypto.PublicKey import RSA class PyCrypto_RSAKey(RSAKey): def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0): if not d: ...
swannapa/erpnext
refs/heads/develop
erpnext/hr/doctype/leave_allocation/leave_allocation.py
33
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import flt, date_diff, formatdate from frappe import _ from frappe.model.document import Document from erpnext.hr.utils ...
int19h/PTVS
refs/heads/master
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.py
13
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from enum import Enum from six.moves import range from cryptography imp...
bbozhev/flask-test
refs/heads/master
flask/lib/python2.7/site-packages/whoosh/analysis/__init__.py
96
# Copyright 2007 Matt Chaput. 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 the...
xianjunzhengbackup/code
refs/heads/master
http/REST/Building-RESTful-Python-Web-Services-master/Chapter 4/restful_python_chapter_04_01/gamesapi/gamesapi/wsgi.py
15
""" WSGI config for gamesapi project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SET...
evangeline97/localwiki-backend-server
refs/heads/master
localwiki/regions/tests/__init__.py
12
from .test_main import * from .test_api import *
UQ-UQx/edx-platform_lti
refs/heads/master
lms/djangoapps/dashboard/models.py
12
"""Models for dashboard application""" import mongoengine from xmodule.modulestore.mongoengine_fields import CourseKeyField class CourseImportLog(mongoengine.Document): """Mongoengine model for git log""" # pylint: disable=incomplete-protocol course_id = CourseKeyField(max_length=128) # NOTE: this l...
vdmann/cse-360-image-hosting-website
refs/heads/master
lib/python2.7/site-packages/south/management/commands/convert_to_south.py
129
""" Quick conversion command module. """ from __future__ import print_function from optparse import make_option import sys from django.core.management.base import BaseCommand from django.core.management.color import no_style from django.conf import settings from django.db import models from django.core import manage...
40223220/2015cc
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/pydoc_data/topics.py
694
# -*- coding: utf-8 -*- # Autogenerated by Sphinx on Sat Mar 23 15:42:31 2013 topics = {'assert': '\nThe ``assert`` statement\n************************\n\nAssert statements are a convenient way to insert debugging assertions\ninto a program:\n\n assert_stmt ::= "assert" expression ["," expression]\n\nThe simple form,...
matthewfranglen/spark
refs/heads/master
examples/src/main/python/ml/bisecting_k_means_example.py
31
# # 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...
adamchainz/ansible
refs/heads/devel
test/integration/targets/module_utils/module_utils/spam4/ham/bacon.py
298
data = 'spam4'
addition-it-solutions/project-all
refs/heads/master
addons/mass_mailing/models/mass_mailing.py
4
# -*- coding: utf-8 -*- from datetime import datetime from dateutil import relativedelta import random import re from openerp import tools from openerp import models, api, _ from openerp import SUPERUSER_ID from openerp.exceptions import UserError from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT from ope...
jfterpstra/bluebottle
refs/heads/develop
bluebottle/accounting/migrations/0001_initial.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-05-23 13:25 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='BankAcc...
Markus-Goetz/CDS-Invenio-Authorlist
refs/heads/master
modules/webaccess/lib/collection_restrictions_migration_kit.py
35
## This file is part of Invenio. ## Copyright (C) 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any ...
carolFrohlich/nipype
refs/heads/master
nipype/interfaces/spm/tests/test_auto_ApplyInverseDeformation.py
2
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from ....testing import assert_equal from ..utils import ApplyInverseDeformation def test_ApplyInverseDeformation_inputs(): input_map = dict(bounding_box=dict(field='comp{1}.inv.comp{1}.sn2def.bb', ), deformation=dict(field='comp{1}.inv.comp{1}.sn2def....
m-weigand/ccd_tools
refs/heads/master
lib/lib_dd/io/io_general.py
1
import lib_dd.io.ascii as ascii import lib_dd.io.ascii_audit as ascii_audit def _make_list(obj): """make sure the provided object is a list, if not, enclose it in one """ if not isinstance(obj, list): return [obj, ] else: return obj def save_fit_results(data, NDobj): """ Save...
subutai/nupic.research
refs/heads/master
projects/whydense/cifar/cifar_tune.py
3
# Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2019, 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 program is free software: you can redistribute it and/or modify # it unde...
mcella/django
refs/heads/master
django/db/migrations/recorder.py
478
from __future__ import unicode_literals from django.apps.registry import Apps from django.db import models from django.db.utils import DatabaseError from django.utils.encoding import python_2_unicode_compatible from django.utils.timezone import now from .exceptions import MigrationSchemaMissing class MigrationRecor...
shitizadmirer/unimap.ns-3noc
refs/heads/master
bindings/python/apidefs/gcc-LP64/callbacks_list.py
5
callback_classes = [ ['void', 'ns3::Ptr<ns3::Packet const>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ...
nickburlett/feincms
refs/heads/master
feincms/module/page/extensions/navigation.py
1
""" Extend or modify the navigation with custom entries. This extension allows the website administrator to select an extension which processes, modifies or adds subnavigation entries. The bundled ``feincms_nav`` template tag knows how to collect navigation entries, be they real Page instances or extended navigation e...
muffinresearch/addons-server
refs/heads/master
apps/access/helpers.py
22
import jinja2 from jingo import register import acl @register.function @jinja2.contextfunction def check_ownership(context, object, require_owner=False, require_author=False, ignore_disabled=True): return acl.check_ownership(context['request'], object, require_o...
Carlosmr/WhooshSearcher
refs/heads/master
searcher/wsgi.py
1
""" WSGI config for searcher project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION``...
abdulhaq-e/django-rest-framework
refs/heads/master
rest_framework/filters.py
9
""" Provides generic filtering backends that can be used to filter the results returned by list views. """ from __future__ import unicode_literals import operator from functools import reduce from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import models from dja...
user-none/calibre
refs/heads/master
src/calibre/utils/linux_trash.py
14
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import (unicode_literals, division, absolute_import, print_function) # Copyright 2010 Hardcoded Software (http://www.hardcoded.net) # This software is licensed under the "BSD" License as described in the ...
shahankhatch/scikit-learn
refs/heads/master
sklearn/covariance/graph_lasso_.py
10
"""GraphLasso: sparse inverse covariance estimation with an l1-penalized estimator. """ # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause # Copyright: INRIA import warnings import operator import sys import time import numpy as np from scipy import linalg from .empirical_covariance_ im...
sameerparekh/pants
refs/heads/master
tests/python/pants_test/android/tasks/test_aapt_gen.py
15
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from pant...
BayanGroup/sentry
refs/heads/master
src/sentry/templatetags/sentry_status.py
23
from __future__ import absolute_import, print_function from django import template from sentry import status_checks register = template.Library() @register.inclusion_tag('sentry/partial/system-status.html', takes_context=True) def show_system_status(context): problems, _ = status_checks.check_all() return...
odejesush/tensorflow
refs/heads/master
venv/lib/python2.7/site-packages/flask/_compat.py
121
# -*- coding: utf-8 -*- """ flask._compat ~~~~~~~~~~~~~ Some py2/py3 compatibility support based on a stripped down version of six so we don't have to depend on a specific version of it. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import sys PY...
smirnoffs/karsender
refs/heads/master
opencart/tests.py
1
# -*- coding: utf-8 -*- import datetime from unittest.mock import patch from karsender import Config from opencart.services import get_last_success_import, get_last_orders from karsender.database import get_collection __author__ = 'Sergey Smirnov <smirnoffs@gmail.com>' import unittest class MockConfig(Config): ...
unnikrishnankgs/va
refs/heads/master
venv/lib/python3.5/site-packages/tensorflow/python/util/tf_should_use.py
13
# 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...
jasonbot/django
refs/heads/master
tests/servers/views.py
384
from django.http import HttpResponse from .models import Person def example_view(request): return HttpResponse('example view') def model_view(request): people = Person.objects.all() return HttpResponse('\n'.join(person.name for person in people)) def create_model_instance(request): person = Perso...
overtherain/scriptfile
refs/heads/master
software/googleAppEngine/lib/django_0_96/django/utils/autoreload.py
48
# Autoreloading launcher. # Borrowed from Peter Hunt and the CherryPy project (http://www.cherrypy.org). # Some taken from Ian Bicking's Paste (http://pythonpaste.org/). # # Portions copyright (c) 2004, CherryPy Team (team@cherrypy.org) # All rights reserved. # # Redistribution and use in source and binary forms, with ...
harnash/sparrow
refs/heads/master
apps/results/migrations/0003_auto_20150529_1146.py
2
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import jsonfield.fields class Migration(migrations.Migration): dependencies = [ ('results', '0002_testrawresult'), ] operations = [ migrations.AlterField( model_name='tes...
anhstudios/swganh
refs/heads/develop
data/scripts/templates/object/building/player/shared_player_city_capitol_corellia_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 = Building() result.template = "object/building/player/shared_player_city_capitol_corellia_style_01.iff" result.att...
Vrturo/FrontEndLabz
refs/heads/master
techTutorials/gulp/node_modules/node-gyp/gyp/pylib/gyp/common_test.py
2542
#!/usr/bin/env python # 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. """Unit tests for the common.py file.""" import gyp.common import unittest import sys class TestTopologicallySorted(unittest.TestCase): ...
amitgroup/parts-net
refs/heads/master
scripts/train_parts.py
1
from __future__ import division, print_function, absolute_import import numpy as np import amitgroup as ag import pnet import pnet.data if __name__ == '__main__': ag.set_verbose(True) import argparse parser = argparse.ArgumentParser() parser.add_argument('size', metavar='<part size>', type=int) pa...
tgalal/python-axolotl
refs/heads/master
axolotl/state/storageprotos_pb2.py
1
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: LocalStorageProtocol.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflect...
dbdd4us/compose
refs/heads/master
tests/unit/config/sort_services_test.py
19
from __future__ import absolute_import from __future__ import unicode_literals import pytest from compose.config.errors import DependencyError from compose.config.sort_services import sort_service_dicts from compose.config.types import VolumeFromSpec class TestSortService(object): def test_sort_service_dicts_1(...
vrenaville/hr
refs/heads/8.0
__unported__/hr_emergency_contact/__init__.py
25
# -*- coding:utf-8 -*- # # # Copyright (C) 2011 Michael Telahun Makonnen <mmakonnen@gmail.com>. # All Rights Reserved. # # 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 Free Software Foundation, eit...
liuhb/hdfs-gress
refs/heads/master
src/main/python/sample-python.py
2
#!/usr/bin/python import sys, os, re # read the local file from standard input input_file=sys.stdin.readline() # extract the filename from the file filename = os.path.basename(input_file) # extract the date from the filename match=re.search(r'([0-9]{4})([0-9]{2})([0-9]{2})', filename) year=match.group(1) mon=match...
rleadbetter/Sick-Beard
refs/heads/anime
lib/hachoir_parser/common/win32_lang_id.py
186
""" Windows 2000 - List of Locale IDs and Language Groups Original data table: http://www.microsoft.com/globaldev/reference/win2k/setup/lcid.mspx """ LANGUAGE_ID = { 0x0436: u"Afrikaans", 0x041c: u"Albanian", 0x0401: u"Arabic Saudi Arabia", 0x0801: u"Arabic Iraq", 0x0c01: u"Arabic Egypt", 0x10...
FHannes/intellij-community
refs/heads/master
python/testData/debug/test_step_over_yield.py
29
def generator2(): for i in range(4): yield i def generator(): a = 42 #breakpoint yield from generator2() return a sum = 0 for i in generator(): sum += i print("The end")
Nikoala/CouchPotatoServer
refs/heads/develop
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/ringtv.py
22
from __future__ import unicode_literals import re from .common import InfoExtractor class RingTVIE(InfoExtractor): _VALID_URL = r'(?:http://)?(?:www\.)?ringtv\.craveonline\.com/(?P<type>news|videos/video)/(?P<id>[^/?#]+)' _TEST = { "url": "http://ringtv.craveonline.com/news/310833-luis-collazo-says-...
sofmonk/aima-python
refs/heads/branch
tests/test_utils.py
1
import pytest from utils import * # noqa def test_removeall_list(): assert removeall(4, []) == [] assert removeall(4, [1, 2, 3, 4]) == [1, 2, 3] assert removeall(4, [4, 1, 4, 2, 3, 4, 4]) == [1, 2, 3] def test_removeall_string(): assert removeall('s', '') == '' assert removeall('s', 'This is a ...
inveniosoftware/invenio-circulation
refs/heads/master
invenio_circulation/mappings/v7/__init__.py
1
# -*- coding: utf-8 -*- # # Copyright (C) 2019 CERN. # Copyright (C) 2019 RERO. # # Invenio-Circulation is free software; you can redistribute it and/or modify # it under the terms of the MIT License; see LICENSE file for more details. """Invenio module for the circulation of ES mappings."""
sam-m888/gprime
refs/heads/master
gprime/filters/rules/repository/__init__.py
1
# # gPrime - A web-based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your optio...
cdrooom/odoo
refs/heads/master
addons/website_google_map/__openerp__.py
354
{ 'name': 'Website Google Map', 'category': 'Hidden', 'summary': '', 'version': '1.0', 'description': """ OpenERP Website Google Map ========================== """, 'author': 'OpenERP SA', 'depends': ['base_geolocalize', 'website_partner', 'crm_partner_assign'], 'data': [ ...
4bic/grano
refs/heads/master
grano/alembic/versions/4d7168864daa_log_entry_models.py
5
"""log entry models Revision ID: 4d7168864daa Revises: 32a25698e4bb Create Date: 2014-04-06 21:42:28.317694 """ # revision identifiers, used by Alembic. revision = '4d7168864daa' down_revision = '32a25698e4bb' from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql def upgrade(): ...
our-city-app/oca-backend
refs/heads/master
src/solutions/common/models/properties.py
1
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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 appl...
kerel-fs/skylines
refs/heads/master
tests/schemas/schemas/test_club.py
1
import pytest from marshmallow import ValidationError from skylines.schemas import ClubSchema def test_deserialization_fails_for_empty_name(): with pytest.raises(ValidationError) as e: ClubSchema(only=('name',)).load(dict(name='')) errors = e.value.messages assert 'name' in errors assert 'M...
benlangmuir/swift
refs/heads/master
utils/android/adb_test_runner/main.py
65
# main.py - Push executables and run them on an Android device -*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt...
agogear/python-1
refs/heads/master
Jimmy66/0009/0009.py
34
#!/bin/env python # -*- coding: utf-8 -*- #也不清楚这里说的链接是什么定义,是指a标签还是所有href的链接,这里取后者 #导入模块 import re import urllib2 #读取文件 def file_read(filename): #因为用之前文件方法打开html不行,貌似涉及到编码问题,所以想了个抖机灵的方法,编码坑还是要填啊,在XML里面也要用到 Req = urllib2.Request("file:./Yixiaohan show-me-the-code.html") r = urllib2.urlopen(Req) html...
tristan0x/hpcbench
refs/heads/master
hpcbench/toolbox/spack.py
1
from subprocess import check_call, check_output from .process import find_executable class SpackCmd: @property def spack(self): return find_executable('spack', required=False) def install(self, *args): self.cmd('install', '--show-log-on-error', '--verbose', *args) def install_dir(se...
GinnyN/Team-Fortress-RPG-Generators
refs/heads/master
build/lib/django/contrib/sites/managers.py
491
from django.conf import settings from django.db import models from django.db.models.fields import FieldDoesNotExist class CurrentSiteManager(models.Manager): "Use this to limit objects to those associated with the current site." def __init__(self, field_name=None): super(CurrentSiteManager, self).__ini...
nikolas/lettuce
refs/heads/master
tests/integration/lib/Django-1.3/django/contrib/gis/geos/error.py
641
""" This module houses the GEOS exceptions, specifically, GEOSException and GEOSGeometryIndexError. """ class GEOSException(Exception): "The base GEOS exception, indicates a GEOS-related error." pass class GEOSIndexError(GEOSException, KeyError): """ This exception is raised when an invalid index is...
h3llrais3r/Auto-Subliminal
refs/heads/master
lib/markdown/extensions/smart_strong.py
8
''' Smart_Strong Extension for Python-Markdown ========================================== This extention adds smarter handling of double underscores within words. See <https://Python-Markdown.github.io/extensions/smart_strong> for documentation. Original code Copyright 2011 [Waylan Limberg](http://achinghead.com) A...
RoyalTS/econ-project-templates
refs/heads/python
.mywaflib/waflib/Tools/intltool.py
3
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006-2010 (ita) """ Support for translation tools such as msgfmt and intltool Usage:: def configure(conf): conf.load('gnu_dirs intltool') def build(bld): # process the .po files into .gmo files, and install them in LOCALEDIR bld(features='intltool_po', ...
Plain-Andy-legacy/android_external_chromium_org
refs/heads/lp-5.1r1
build/android/pylib/base/test_dispatcher_unittest.py
33
# 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. """Unittests for test_dispatcher.py.""" # pylint: disable=R0201 # pylint: disable=W0212 import os import sys import unittest sys.path.append(os.path.join(o...
CiscoSystems/neutron
refs/heads/master
neutron/agent/linux/ip_link_support.py
5
# Copyright 2014 Mellanox Technologies, Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
yeming233/horizon
refs/heads/master
openstack_dashboard/dashboards/project/stacks/tables.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 th...
rmcgibbo/scipy
refs/heads/master
scipy/optimize/tests/test_lbfgsb_hessinv.py
100
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_, TestCase, run_module_suite, assert_allclose import scipy.linalg from scipy.optimize import minimize def test_1(): def f(x): return x**4, 4*x**3 for gtol in [1e-8, 1e-12, 1e-20]: ...
frewsxcv/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/pytest/doc/en/example/costlysetup/sub1/test_quick.py
235
def test_quick(setup): pass
frankiecjunle/yunblog
refs/heads/master
venv/lib/python2.7/site-packages/requests/packages/charade/euctwfreq.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...
cleech/linux
refs/heads/master
scripts/gdb/linux/proc.py
313
# # gdb helper commands and functions for Linux kernel debugging # # Kernel proc information reader # # Copyright (c) 2016 Linaro Ltd # # Authors: # Kieran Bingham <kieran.bingham@linaro.org> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb from linux import constants from linux impor...
mindw/shapely
refs/heads/xy
shapely/geometry/collection.py
19
"""Multi-part collections of geometries """ from ctypes import c_void_p from shapely.geos import lgeos from shapely.geometry.base import BaseGeometry from shapely.geometry.base import BaseMultipartGeometry from shapely.geometry.base import HeterogeneousGeometrySequence from shapely.geometry.base import geos_geom_from...
erikrose/pip
refs/heads/develop
pip/_vendor/html5lib/treeadapters/sax.py
1835
from __future__ import absolute_import, division, unicode_literals from xml.sax.xmlreader import AttributesNSImpl from ..constants import adjustForeignAttributes, unadjustForeignAttributes prefix_mapping = {} for prefix, localName, namespace in adjustForeignAttributes.values(): if prefix is not None: pre...
vgrem/SharePointOnline-REST-Python-Client
refs/heads/master
tests/test_sharepoint_comminication_site.py
1
import uuid from unittest import TestCase from office365.runtime.auth.authentication_context import AuthenticationContext from office365.sharepoint.client_context import ClientContext from office365.sharepoint.portal.SPSiteCreationRequest import SPSiteCreationRequest from office365.sharepoint.portal.SPSiteManager impo...
jaysonmuyot/Final-project
refs/heads/master
tailbone/files/__init__.py
34
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
invisiblek/android_kernel_oneplus_msm8974
refs/heads/cm-12.0
scripts/tracing/draw_functrace.py
14679
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
vrv/tensorflow
refs/heads/master
tensorflow/contrib/learn/python/learn/dataframe/transforms/batch.py
82
# 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...
stanford-mast/nn_dataflow
refs/heads/master
nn_dataflow/tests/loop_blocking_test/test_loop_blocking_solver.py
1
""" $lic$ Copyright (C) 2016-2020 by Tsinghua University and The Board of Trustees of Stanford University This program is free software: you can redistribute it and/or modify it under the terms of the Modified BSD-3 License as published by the Open Source Initiative. This program is distributed in the hope that it wi...
openxc/openxc-python
refs/heads/master
openxc/sources/bluetooth.py
1
"""A Bluetooth data source.""" import logging from openxc.controllers.base import Controller from .socket import SocketDataSource from .base import DataSourceError LOG = logging.getLogger(__name__) try: import bluetooth except ImportError: LOG.debug("pybluez library not installed, can't use bluetooth inter...
FNCS/ns-3.22
refs/heads/master
src/visualizer/visualizer/plugins/olsr.py
182
import gtk import ns.core import ns.network import ns.internet import ns.olsr from visualizer.base import InformationWindow class ShowOlsrRoutingTable(InformationWindow): ( COLUMN_DESTINATION, COLUMN_NEXT_HOP, COLUMN_INTERFACE, COLUMN_NUM_HOPS, ) = range(4) def __init...
jonfoster/pyxb2
refs/heads/master
pyxb/binding/basis.py
3
# -*- coding: utf-8 -*- # Copyright 2009-2013, Peter A. Bigot # # 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...
webmedic/booker
refs/heads/master
src/gdata/tlslite/utils/Python_AES.py
48
"""Pure-Python AES implementation.""" from .cryptomath import * from .AES import * from .rijndael import rijndael def new(key, mode, IV): return Python_AES(key, mode, IV) class Python_AES(AES): def __init__(self, key, mode, IV): AES.__init__(self, key, mode, IV, "python") self.rijndael = rij...
vicky2135/lucious
refs/heads/master
oscar/lib/python2.7/site-packages/django/test/utils.py
28
import logging import re import sys import time import warnings from contextlib import contextmanager from functools import wraps from unittest import TestCase, skipIf, skipUnless from xml.dom.minidom import Node, parseString from django.apps import apps from django.apps.registry import Apps from django.conf import Us...