repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
SUSE/azurectl
azurectl/utils/filetype.py
1
1367
# Copyright (c) 2015 SUSE Linux GmbH. 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 la...
apache-2.0
osvalr/odoo
addons/product_visible_discount/__init__.py
433
1054
############################################################################## # # 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 GNU Affero General Public L...
agpl-3.0
pontiflex/trustme
CA/ca/deprecated/protocols/rfc5280_implicit.py
1
21441
""" Copyright 2012 Pontiflex, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
apache-2.0
jambolo/bitcoin
test/functional/p2p_permissions.py
5
8155
#!/usr/bin/env python3 # Copyright (c) 2015-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test p2p permission message. Test that permissions are correctly calculated and applied """ from test...
mit
sachintaware/sublime-wakatime
packages/wakatime/packages/requests/__init__.py
151
1861
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> ...
bsd-3-clause
ktsitsikas/odemis
src/odemis/driver/test/tmcm_test.py
1
13915
# -*- coding: utf-8 -*- ''' Created on 21 May 2014 @author: Éric Piel Copyright © 2014 Éric Piel, Delmic This file is part of Odemis. Odemis is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. Odemis is...
gpl-2.0
britodasilva/pyspike
pyspike/intanutil/data_to_result.py
2
2165
#! /bin/env python # # Michael Gibson 27 April 2015 def data_to_result(header, data, data_present): """Moves the header and data (if present) into a common object.""" result = {} result['notes'] = header['notes'] result['frequency_parameters'] = header['frequency_parameters'] if header['num_ampli...
mit
1013553207/django
django/db/migrations/autodetector.py
140
56583
from __future__ import unicode_literals import datetime import re from itertools import chain from django.conf import settings from django.db import models from django.db.migrations import operations from django.db.migrations.migration import Migration from django.db.migrations.operations.models import AlterModelOpti...
bsd-3-clause
frank-y-liu/gatk
src/main/resources/org/broadinstitute/hellbender/tools/copynumber/case_denoising_calling.py
3
9289
import os # set theano flags os.environ["THEANO_FLAGS"] = "device=cpu,floatX=float64,optimizer=fast_run,compute_test_value=ignore,openmp=true" import logging import argparse import gcnvkernel import shutil import json from typing import Dict, Any logger = logging.getLogger("case_denoising_calling") parser = argpars...
bsd-3-clause
piotroxp/scibibscan
scib/lib/python3.5/site-packages/astropy/io/ascii/tests/test_fixedwidth.py
1
14453
# Licensed under a 3-clause BSD style license - see LICENSE.rst # TEST_UNICODE_LITERALS try: from cStringIO import StringIO except ImportError: from io import StringIO from ... import ascii from ..core import InconsistentTableError from .common import (assert_equal, assert_almost_equal, ...
mit
lecaoquochung/ddnb.django
django/templatetags/future.py
45
2665
import warnings from django.template import Library from django.template import defaulttags from django.utils.deprecation import RemovedInDjango19Warning, RemovedInDjango20Warning register = Library() @register.tag def ssi(parser, token): warnings.warn( "Loading the `ssi` tag from the `future` library i...
bsd-3-clause
rhdedgar/openshift-tools
openshift/installer/vendored/openshift-ansible-3.2.13/filter_plugins/oo_filters.py
9
38540
#!/usr/bin/python # -*- coding: utf-8 -*- # vim: expandtab:tabstop=4:shiftwidth=4 """ Custom filters for use in openshift-ansible """ from ansible import errors from collections import Mapping from distutils.version import LooseVersion from operator import itemgetter import OpenSSL.crypto import os import pdb import p...
apache-2.0
fdupoux/ansible
contrib/inventory/zone.py
138
1466
#!/usr/bin/env python # (c) 2015, Dagobert Michelsen <dam@baltic-online.de> # # 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 # ...
gpl-3.0
DazWorrall/ansible
lib/ansible/modules/network/netvisor/pn_vrouterbgp.py
29
15104
#!/usr/bin/python """ PN-CLI vrouter-bgp-add/vrouter-bgp-remove/vrouter-bgp-modify """ # # 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...
gpl-3.0
tensorflow/tensorflow
tensorflow/python/ops/ragged/ragged_dispatch_test.py
3
34315
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
simartin/servo
tests/wpt/web-platform-tests/tools/third_party/aioquic/examples/doq_client.py
15
5225
import argparse import asyncio import json import logging import pickle import ssl from typing import Optional, cast from dnslib.dns import QTYPE, DNSQuestion, DNSRecord from aioquic.asyncio.client import connect from aioquic.asyncio.protocol import QuicConnectionProtocol from aioquic.quic.configuration import QuicCo...
mpl-2.0
konstruktoid/ansible-upstream
lib/ansible/modules/cloud/smartos/imgadm.py
43
9827
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, 2017 Jasper Lievisse Adriaanse <j@jasper.la> # 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'...
gpl-3.0
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/eggs/sqlalchemy_migrate-0.7.2-py2.7.egg/migrate/tests/versioning/test_schema.py
36
6770
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import shutil from migrate import exceptions from migrate.versioning.schema import * from migrate.versioning import script, schemadiff from sqlalchemy import * from migrate.tests import fixture class TestControlledSchema(fixture.Pathed, fixture.DB): # Tr...
gpl-3.0
takeflight/wagtail
wagtail/core/tests/test_page_privacy.py
2
5633
from django.contrib.auth.models import Group from django.test import TestCase from wagtail.core.models import Page, PageViewRestriction from wagtail.tests.utils import WagtailTestUtils class TestPagePrivacy(TestCase, WagtailTestUtils): fixtures = ['test.json'] def setUp(self): self.secret_plans_page...
bsd-3-clause
eLBati/account-financial-tools
__unported__/account_credit_control_dunning_fees/model/run.py
6
1666
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publi...
agpl-3.0
GammaC0de/pyload
src/pyload/plugins/decrypters/ShareLinksBiz.py
1
10712
# -*- coding: utf-8 -*- import base64 import re from cryptography.fernet import Fernet from pyload.core.utils.misc import eval_js from ..base.decrypter import BaseDecrypter class ShareLinksBiz(BaseDecrypter): __name__ = "ShareLinksBiz" __type__ = "decrypter" __version__ = "1.29" __status__ = "test...
agpl-3.0
Johnzero/erp
openerp/pychart/log_coord.py
15
1541
# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # # Jockey 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, or (at your option) any # later vers...
agpl-3.0
ostinelli/pyopenspime
lib/dns/tokenizer.py
1
14700
# Copyright (C) 2003-2007 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND ...
gpl-3.0
Chilledheart/chromium
third_party/google_input_tools/builder.py
52
6720
#!/usr/bin/python # Copyright 2014 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. """Closure builder for Javascript.""" import argparse import json import os import re _BASE_REGEX_STRING = r'^\s*goog\.%s\(\s*[\'"](.+)[\...
bsd-3-clause
mcking49/apache-flask
Python/Lib/site-packages/pylint/interfaces.py
4
2773
# Copyright (c) 2003-2016 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/master/COPYING """Interfaces for Pylint objects""" from collections import n...
mit
koll00/Gui_SM
SMlib/SMGui.py
1
58964
import sys, os sys.path.append('..' + os.path.sep) import os.path as osp import atexit import socket import shutil import threading import errno # Test if IPython v0.13+ is installed to eventually switch to PyQt API #2 from SMlib.utils.programs import is_module_installed from SMlib.config import CONF, EDIT_...
mit
Titan-C/sympy
sympy/deprecated/class_registry.py
26
1309
from sympy.core.decorators import deprecated from sympy.core.core import BasicMeta, Registry, all_classes class ClassRegistry(Registry): """ Namespace for SymPy classes This is needed to avoid problems with cyclic imports. To get a SymPy class, use `C.<class_name>` e.g. `C.Rational`, `C.Add`. Fo...
bsd-3-clause
joomel1/phantomjs
src/qt/qtwebkit/Tools/QueueStatusServer/model/queues.py
120
3658
# 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: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the...
bsd-3-clause
luca-vercelli/odoo-modules
l10n_it_export_ts/models/partner.py
1
2226
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2016 luca Vercelli # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as...
gpl-3.0
jnishi/chainer
chainer/utils/conv_nd_kernel.py
13
9790
import functools import six from chainer.backends import cuda def mulexp(xs, init=None): if init is not None: return functools.reduce('{} * {}'.format, xs, init) else: return functools.reduce('{} * {}'.format, xs) def andexp(xs, init=None): if init is not None: return functools...
mit
ksakloth/KnowledgeNetworks
doc/technology review/web_of_science.py
1
2189
#!/usr/bin/env python # -*- coding: utf-8 -*- from suds.client import Client from suds.transport.http import HttpTransport import urllib2 class HTTPSudsPreprocessor(urllib2.BaseHandler): def __init__(self, SID): self.SID = SID def http_request(self, req): req.add_header('cookie', 'SID="'+self...
mit
askhl/ase
ase/io/cif.py
9
12115
"""Module to read and write atoms in cif file format. See http://www.iucr.org/resources/cif/spec/version1.1/cifsyntax for a description of the file format. STAR extensions as save frames, global blocks, nested loops and multi-data values are not supported. """ import shlex import re import numpy as np from ase.par...
gpl-2.0
amol-mandhane/konnactivity
login/migrations/0001_initial.py
1
10586
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'City' db.create_table(u'login_city', ( (u'id', self.gf('django.db.models.fields....
mit
vganapath/rally
tests/unit/test_test_ddt.py
8
1460
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
BehavioralInsightsTeam/edx-platform
lms/djangoapps/lms_migration/management/commands/create_user.py
10
5175
#!/usr/bin/python # # File: create_user.py # # Create user. Prompt for groups and ExternalAuthMap import datetime import json import os import readline import string import sys from getpass import getpass from random import choice from django.contrib.auth.models import Group, User from django.core.management.base ...
agpl-3.0
salewski/kubernetes
hack/boilerplate/boilerplate_test.py
629
1362
#!/usr/bin/env python # Copyright 2016 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
TansyArron/pants
src/python/pants/option/help_formatter.py
4
2589
# coding=utf-8 # Copyright 2015 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 textwrap import...
apache-2.0
shawnsi/ansible-modules-extras
monitoring/rollbar_deployment.py
138
3898
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2014, Max Riveiro, <kavu13@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...
gpl-3.0
Drooids/odoo
openerp/addons/base/module/wizard/base_export_language.py
269
3648
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2004-2012 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
theguardian/JIRA-APPy
cherrypy/test/test_virtualhost.py
22
4072
import os curdir = os.path.join(os.getcwd(), os.path.dirname(__file__)) import cherrypy from cherrypy.test import helper class VirtualHostTest(helper.CPWebCase): def setup_server(): class Root: def index(self): return "Hello, world" index.exposed = True ...
gpl-2.0
schlueter/ansible
lib/ansible/plugins/lookup/keyring.py
82
1968
# (c) 2016, Samuel Boucher <boucher.samuel.c@gmail.com> # (c) 2017 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 DOCUMENTATION = """ lookup: keyring author: ...
gpl-3.0
tedye/leetcode
tools/leetcode.092.Reverse Linked List II/leetcode.092.Reverse Linked List II.submission0.py
1
1051
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def reverseBetween(self, head, m, n): """ :type head: ListNode :type m: int :type n: int :rtype: ListNode ...
mit
thaim/ansible
lib/ansible/modules/network/enos/enos_command.py
102
6472
#!/usr/bin/python # -*- coding: utf-8 -*- # # (C) 2017 Red Hat Inc. # Copyright (C) 2017 Lenovo. # # GNU General Public License v3.0+ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE...
mit
bsipocz/statsmodels
statsmodels/base/tests/test_data.py
17
35047
import numpy as np from numpy.testing import assert_equal, assert_, assert_raises import pandas import pandas.util.testing as ptesting from statsmodels.base import data as sm_data from statsmodels.formula import handle_formula_data #class TestDates(object): # @classmethod # def setupClass(cls): # nrows =...
bsd-3-clause
sivertkh/gtrackcore
gtrackcore/input/wrappers/GEDependentAttributesHolder.py
2
3392
from gtrackcore.input.wrappers.GESourceWrapper import GESourceWrapper, PausedAtCountsGESourceWrapper from gtrackcore.util.CustomExceptions import InvalidFormatError, NotIteratedYetError class GEDependentAttributesHolder(GESourceWrapper): def __init__(self, geSource): GESourceWrapper.__init__(self, geSo...
gpl-3.0
grap/OCB
addons/product_manufacturer/__init__.py
82
1051
############################################################################## # # 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 GNU Affero General Public L...
agpl-3.0
40223102/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/html/entities.py
814
75240
"""HTML character entity references.""" # maps the HTML entity name to the Unicode codepoint name2codepoint = { 'AElig': 0x00c6, # latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1 'Aacute': 0x00c1, # latin capital letter A with acute, U+00C1 ISOlat1 'Acirc': 0x00c2, # latin capit...
gpl-3.0
sbhowmik89/oppia
extensions/interactions/ImageClickInput/ImageClickInput.py
17
1623
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
henry-zhuang/show-me-the-code
Python/0067/main.py
3
1577
try: # see if Swampy is installed as a package from swampy.TurtleWorld import * except ImportError: # otherwise see if the modules are on the PYTHONPATH from TurtleWorld import * import math class PieTurtle(Turtle): def draw_pie(self, n, length): """Draws a pie, then moves into position t...
gpl-2.0
mpasternak/pyglet-fix-issue-518-522
tests/text/EMPTY.py
28
1136
#!/usr/bin/env python '''Test that an empty document doesn't break. ''' __docformat__ = 'restructuredtext' __noninteractive = True import unittest from pyglet import gl from pyglet import graphics from pyglet.text import document from pyglet.text import layout from pyglet import window class TestWindow(window.Win...
bsd-3-clause
usgin/NGDSDataExplorer
static/lib/ol2-master/tools/toposort.py
305
1086
""" toposort.py Sorts dictionary keys based on lists of dependencies. """ class MissingDependency(Exception): """Exception raised when a listed dependency is not in the dictionary.""" class Sorter(object): def __init__(self, dependencies): self.dependencies = dependencies self.visited = set() ...
mit
NeuralEnsemble/neuroConstruct
lib/jython/Lib/encodings/bz2_codec.py
501
2993
""" Python 'bz2_codec' Codec - bz2 compression encoding Unlike most of the other codecs which target Unicode, this codec will return Python string objects for both encode and decode. Adapted by Raymond Hettinger from zlib_codec.py which was written by Marc-Andre Lemburg (mal@lemburg.com). """ import ...
gpl-2.0
be-cloud-be/horizon-addons
server/setup/package.py
30
21190
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import optparse import os import pexpect import shutil import signal import subprocess import tempfile import time import xmlrpclib from contextlib import contextmanager from glob import glob from ...
agpl-3.0
Jon-ICS/upm
examples/python/ppd42ns.py
7
2270
#!/usr/bin/python # Author: Zion Orent <zorent@ics.com> # Copyright (c) 2015 Intel Corporation. # # 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 limi...
mit
yongshengwang/builthue
desktop/core/ext-py/Django-1.4.5/django/contrib/admin/templatetags/admin_modify.py
98
2293
from django import template register = template.Library() @register.inclusion_tag('admin/prepopulated_fields_js.html', takes_context=True) def prepopulated_fields_js(context): """ Creates a list of prepopulated_fields that should render Javascript for the prepopulated fields for both the admin form and in...
apache-2.0
chugunovyar/factoryForBuild
env/lib/python2.7/site-packages/django/db/models/base.py
33
74455
from __future__ import unicode_literals import copy import inspect import warnings from itertools import chain from django.apps import apps from django.conf import settings from django.core import checks from django.core.exceptions import ( NON_FIELD_ERRORS, FieldDoesNotExist, FieldError, MultipleObjectsReturned,...
gpl-3.0
joyaether/zxing
cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/intelc.py
34
19357
"""SCons.Tool.icl Tool-specific initialization for the Intel C/C++ compiler. Supports Linux and Windows compilers, v7 and up. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 200...
apache-2.0
pdellaert/ansible
lib/ansible/modules/crypto/acme/acme_account_info.py
5
9676
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018 Felix Fontein <felix@fontein.de> # 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', ...
gpl-3.0
koomik/CouchPotatoServer
libs/pyutil/scripts/memdump2dot.py
106
1589
#!/usr/bin/env python import bindann bindann.install_exception_handler() import sys inf = open(sys.argv[1], "r") outf = open(sys.argv[1]+".dot", "w") outf.write("digraph %s {\n" % sys.argv[1].replace(".","")) def parse_netstring(l, i): try: j = l.find(':', i) if j == -1: return (Non...
gpl-3.0
mekkablue/Glyphs-Scripts
Paths/Remove Stray Points.py
1
1891
#MenuTitle: Remove Stray Points # -*- coding: utf-8 -*- from __future__ import division, print_function, unicode_literals __doc__=""" Deletes stray points (single node paths) in selected glyphs. Careful: a stray point can be used as a quick hack to disable automatic alignment. """ thisFont = Glyphs.font # frontmost fo...
apache-2.0
abhishekgahlot/compbio
compbio/blast.py
2
12417
# python imports import os # rasmus imports from rasmus import util # compbio imports from . import fasta # NCBI BLASTALL 2.2.10 -m 8 tab-delimited output # Fields: # 0. Query id, # 1. Subject id, # 2. % identity, # 3. alignment length, # 4. mismatches, # 5. gap openings, # 6. q. start, # 7. q. end, # 8. s. start, ...
mit
juanalfonsopr/odoo
addons/website_sale_options/controllers/main.py
236
3610
# -*- coding: utf-8 -*- from openerp import SUPERUSER_ID from openerp.addons.web import http from openerp.addons.web.http import request from openerp.addons.website_sale.controllers.main import website_sale class website_sale_options(website_sale): @http.route(['/shop/product/<model("product.template"):product>'...
agpl-3.0
hefen1/chromium
tools/telemetry/telemetry/results/html_output_formatter_unittest.py
15
7922
# Copyright 2014 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. import os import StringIO import unittest from telemetry import benchmark from telemetry import page as page_module from telemetry.page import page_set from ...
bsd-3-clause
sunlightlabs/regulations-scraper
one_offs/lightsquared/extract_text.py
1
1087
from optparse import OptionParser arg_parser = OptionParser() def run(options, args): import json, os from regscrape_lib.extraction import serial_bulk_extract if len(args) > 1: metadata_path = args[0] out_path = args[1] else: print "Specify files" sys.exit(0) i...
bsd-3-clause
diagramsoftware/odoo
addons/purchase/edi/purchase_order.py
439
9703
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
danny88br/cjdns
node_build/dependencies/libuv/build/gyp/pylib/gyp/win_tool.py
24
11672
#!/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. """Utility functions for Windows builds. These functions are executed via gyp-win-tool when using the ninja generator. """ import os impor...
gpl-3.0
rdmorganiser/rdmo
rdmo/projects/migrations/0046_project_mptt.py
1
2061
# Generated by Django 2.2.16 on 2020-12-04 12:46 from __future__ import unicode_literals import django.db.models.deletion import mptt.fields from django.db import migrations, models from mptt import managers, register def rebuild_tree(apps, schema_editor): Project = apps.get_model('projects', 'Project') ma...
apache-2.0
CiscoSystems/vespa
neutron/plugins/nec/drivers/trema.py
9
11933
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 NEC Corporation. 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...
apache-2.0
vergil1874/ardupilot
mk/PX4/Tools/genmsg/test/test_genmsg_gentools.py
215
9526
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2008, Willow Garage, 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...
gpl-3.0
40223236/w16b_test
static/Brython3.1.1-20150328-091302/Lib/test/test_re.py
718
56009
# FIXME: brython: implement test.support #from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \ # cpython_only verbose = True # FIXME: brython: Not used in this module ? #import io import re # FIXME: brython: implement re.Scanner #from re import Scanner import sre_constants import sys...
agpl-3.0
strk/QGIS
tests/src/python/test_qgspanelwidget.py
45
1707
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsPanelWidget. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ __...
gpl-2.0
agat63/AGAT_G3_kernel
scripts/tracing/draw_functrace.py
14676
3560
#!/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 ...
gpl-2.0
beni55/Empire
lib/modules/management/spawn.py
20
3387
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Spawn', 'Author': ['@harmj0y'], 'Description': ('Spawns a new agent in a new powershell.exe process.'), 'Background' : False, 'Outpu...
bsd-3-clause
Livit/Livit.Learn.EdX
common/djangoapps/student/views.py
1
109663
""" Student Views """ import datetime import logging import uuid import json import warnings from collections import defaultdict from urlparse import urljoin, urlsplit, parse_qs, urlunsplit from django.views.generic import TemplateView from pytz import UTC from requests import HTTPError from ipware.ip import get_ip i...
agpl-3.0
devoid/nova
nova/cmd/api_ec2.py
3
1337
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
apache-2.0
agx/calypso
calypso.py
1
4897
#!/usr/bin/python # -*- coding: utf-8 -*- # # This file is part of Calypso - CalDAV/CardDAV/WebDAV Server # Copyright © 2011 Keith Packard # Copyright © 2008-2011 Guillaume Ayoub # Copyright © 2008 Nicolas Kandel # Copyright © 2008 Pascal Halter # # This library is free software: you can redistribute it and/or modify #...
gpl-3.0
shurain/archiver
archiver/sink.py
1
4439
# -*- coding: utf-8 -*- import hashlib import binascii from thrift.transport.THttpClient import THttpClient from thrift.protocol.TBinaryProtocol import TBinaryProtocol from evernote.edam.userstore import UserStore from evernote.edam.notestore import NoteStore import evernote.edam.type.ttypes as Types import evernote....
mit
cwolferh/heat-scratch
heat/rpc/client.py
1
39222
# # Copyright 2012, Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
binoculars/osf.io
osf/migrations/0069_skippable_created_modified.py
22
20135
# -*- coding: utf-8 -*- # Note: # This migration is skippable if `scripts/premigrate_created_modified.py` # is utilized. It allows the larger of these tables to be updated asynchronously without downtime. # It requires not releasing these model changes until the beat tasks are approximately complete. from __future__ im...
apache-2.0
beck/django
tests/utils_tests/test_encoding.py
288
5732
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import datetime import unittest from django.utils import six from django.utils.encoding import ( escape_uri_path, filepath_to_uri, force_bytes, force_text, iri_to_uri, smart_text, uri_to_iri, ) from django.utils.functional import SimpleLazyObje...
bsd-3-clause
Elbagoury/odoo
addons/mrp/report/price.py
56
11687
# -*- 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...
agpl-3.0
m-weigand/ccd_tools
lib/lib_dd/io/ascii_audit.py
1
7424
import json import datetime import uuid import numpy as np import lib_dd.interface as lDDi import lib_dd.version as version import lib_dd.io.helper as helper def _get_header(): """Return a header string that can be added to each output file """ uuidstr = str(uuid.uuid4()) datetimestr = datetime.dat...
gpl-3.0
AlvaroRQ/prototipo
ownLibraries/object_detection/object_detection/protos/string_int_label_map_pb2.py
2
4387
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: object_detection/protos/string_int_label_map.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...
gpl-3.0
polyaxon/polyaxon
sdks/python/http_client/v1/polyaxon_sdk/models/v1_average_stopping_policy.py
1
3959
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
apache-2.0
jarmoni/ansible-modules-core
cloud/openstack/os_subnets_facts.py
25
4664
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # This module 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 late...
gpl-3.0
bowlofstew/bii-server
test/find/constraint_satisfaction_test.py
2
2171
import unittest from biicode.server.find.constraint_satisfaction import BaseCSPElem, CSPExact from biicode.common.utils.bii_logging import logger class CSPElem(BaseCSPElem): def __init__(self, value, is_invalid=False): self.value = value self.invalid = is_invalid # If True cannot make part of s...
mit
yantrabuddhi/opencog
opencog/python/utility/tree.py
34
19074
#try: from opencog.atomspace import AtomSpace, Atom, get_type, types, TruthValue #except ImportError: # from atomspace_remote import AtomSpace, Atom, get_type, types from copy import copy, deepcopy from functools import * import sys from itertools import permutations from util import * from collections import name...
agpl-3.0
robk5uj/invenio
modules/bibformat/lib/elements/bfe_title_brief.py
34
2175
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2006, 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 ## ...
gpl-2.0
bikong2/django
django/contrib/sessions/backends/cached_db.py
231
2861
""" Cached, database-backed sessions. """ import logging from django.conf import settings from django.contrib.sessions.backends.db import SessionStore as DBStore from django.core.cache import caches from django.core.exceptions import SuspiciousOperation from django.utils import timezone from django.utils.encoding imp...
bsd-3-clause
greenoaktree/MissionPlanner
Lib/runpy.py
53
10976
"""runpy.py - locating and running Python code using the module namespace Provides support for locating and running Python scripts using the Python module namespace instead of the native filesystem. This allows Python code to play nicely with non-filesystem based PEP 302 importers when locating support scripts ...
gpl-3.0
looker/sentry
src/sentry/south_migrations/0058_auto__add_useroption__add_unique_useroption_user_project_key.py
5
28187
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'UserOption' db.create_table( 'sentry_useroption', ( ( ...
bsd-3-clause
PegasusWang/mezzanine
mezzanine/utils/models.py
27
7863
from __future__ import unicode_literals from functools import partial from future.utils import with_metaclass from django.apps import apps from django.conf import settings from django.contrib.auth import get_user_model from django.core.exceptions import ImproperlyConfigured from django.db.models import Model, Field fr...
bsd-2-clause
jswope00/griffinx
lms/djangoapps/shoppingcart/migrations/0005_auto__add_paidcourseregistrationannotation__add_field_orderitem_report.py
114
9808
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'PaidCourseRegistrationAnnotation' db.create_table('shoppingcart_paidcourseregistrationannota...
agpl-3.0
yanil3500/data-structures
src/test_que_.py
1
3375
"""Test que_.py""" import pytest ENQUEUE_TABLE = [ ([10, 50, 100, 5000], 10000, 5), ([1, 2, 3], 99, 4), (['one', 'two', 'three', 'four'], 88822, 5), ([], 'one', 1) ] @pytest.fixture def empty_que(): """The empty_que funciton returns an empty queue as a fixture.""" from que_ import Queue r...
mit
hipnusleo/laserjet
resource/pypi/cryptography-1.7.1/src/cryptography/hazmat/backends/openssl/x509.py
1
16239
# 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 import operator import warnings from cryptography import utils,...
apache-2.0
hrashk/sympy
sympy/mpmath/libmp/libhyper.py
47
36564
""" This module implements computation of hypergeometric and related functions. In particular, it provides code for generic summation of hypergeometric series. Optimized versions for various special cases are also provided. """ import operator import math from .backend import MPZ_ZERO, MPZ_ONE, BACKEND, xrange, exec_...
bsd-3-clause
chyeh727/django
django/conf/locale/de_CH/formats.py
504
1445
# -*- 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 from __future__ import unicode_literals DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATE...
bsd-3-clause
shearern/rsync-usb
src/rsync_usb_tests/ChunkLocationTests.py
1
4596
import unittest from rsync_usb.ChunkLocation import ChunkLocation class ChunkLocationTests(unittest.TestCase): '''Test TargetHashesWriter and TargetHashesReader''' def testProperties(self): pos = ChunkLocation('dummy', 100, 10) self.assertEqual(pos.path, 'dummy') self....
gpl-2.0
MwanzanFelipe/rockletonfortune
lib/django/contrib/gis/db/backends/base/operations.py
106
4863
class BaseSpatialOperations(object): """ This module holds the base `BaseSpatialBackend` object, which is instantiated by each spatial database backend with the features it has. """ truncate_params = {} # Quick booleans for the type of this spatial backend, and # an attribute for the sp...
bsd-3-clause
chengdh/openerp-ktv
openerp/addons/ktv_sale/room_opens.py
1
2022
# -*- coding: utf-8 -*- import logging from osv import osv,fields from room import room import decimal_precision as dp import ktv_helper _logger = logging.getLogger(__name__) class room_opens(osv.osv): ''' 包厢开房对象,包括预定转开房和空置转开房 ''' _name = "ktv.room_opens" _description = "开房信息" _columns = { ...
agpl-3.0