repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
pkill-nine/qutebrowser
refs/heads/qutebrowser-custom
qutebrowser/misc/split.py
2
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
phamelin/ardupilot
refs/heads/master
Tools/FilterTestTool/FilterTest.py
30
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ArduPilot IMU Filter Test Class This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later versi...
aktech/sympy
refs/heads/master
sympy/utilities/tests/test_timeutils.py
122
"""Tests for simple tools for timing functions' execution. """ import sys from sympy.utilities.timeutils import timed def test_timed(): result = timed(lambda: 1 + 1, limit=100000) assert result[0] == 100000 and result[3] == "ns" result = timed("1 + 1", limit=100000) assert result[0] == 100000 and re...
tritemio/FRETBursts
refs/heads/master
fretbursts/fit/test_exp_fitting.py
2
""" Unittest for exp_fitting.py """ from __future__ import print_function import pytest import numpy as np import scipy.stats as SS from fretbursts.fit.exp_fitting import expon_fit, expon_fit_cdf, expon_fit_hist sample_size = 5000 sample_tau = 3. sample_min = 2. max_relative_error = 0.05 @pytest.fixture(scope="m...
germn/python-for-android
refs/heads/master
pythonforandroid/recipes/android/src/android/broadcast.py
3
# ------------------------------------------------------------------- # Broadcast receiver bridge from jnius import autoclass, PythonJavaClass, java_method from android.config import JAVA_NAMESPACE, JNI_NAMESPACE class BroadcastReceiver(object): class Callback(PythonJavaClass): __javainterfaces__ = [JNI...
jmartinezchaine/OpenERP
refs/heads/master
openerp/pychart/afm/__init__.py
15
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
billyhunt/osf.io
refs/heads/develop
tests/framework_tests/test_email.py
5
# -*- coding: utf-8 -*- import unittest import smtplib import mock from nose.tools import * # flake8: noqa (PEP8 asserts) import sendgrid from framework.email.tasks import send_email, _send_with_sendgrid from website import settings from tests.base import fake # Check if local mail server is running SERVER_RUNNING ...
michael-ball/sublime-text
refs/heads/master
sublime-text-3/Packages/Python PEP8 Autoformat/libs/py33/lib2to3/fixes/fix_intern.py
69
# Copyright 2006 Georg Brandl. # Licensed to PSF under a Contributor Agreement. """Fixer for intern(). intern(s) -> sys.intern(s)""" # Local imports from .. import pytree from .. import fixer_base from ..fixer_util import Name, Attr, touch_import class FixIntern(fixer_base.BaseFix): BM_compatible = True or...
BhupeshGupta/frappe
refs/heads/develop
frappe/installer.py
15
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # called from wnf.py # lib/wnf.py --install [rootpassword] [dbname] [source] from __future__ import unicode_literals import os, json import frappe import frappe.database import getpass import importlib from frappe....
NeCTAR-RC/horizon
refs/heads/nectar/stein
horizon/test/test_dashboards/cats/kittens/views.py
7
# 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 u...
AltSchool/django-allauth
refs/heads/master
allauth/account/management/commands/account_unsetmultipleprimaryemails.py
10
from django.core.management.base import BaseCommand from django.db.models import Count from allauth.account.models import EmailAddress from allauth.account.utils import user_email from allauth.utils import get_user_model class Command(BaseCommand): def handle(self, *args, **options): for user in self.get...
shanot/imp
refs/heads/develop
modules/core/test/expensive_test_ev_restraint.py
2
from __future__ import print_function import IMP import IMP.test import IMP.core import IMP.container class ExcludedVolumeRestraintTests(IMP.test.TestCase): """Tests for excluded volume restraints""" def _create_rigid_body(self, m, n, r): ls = IMP.algebra.Sphere3D(IMP.algebra.Vector3D(0, 0, 0), r) ...
yoer/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/tests/tablespaces/models.py
150
from django.db import models # Since the test database doesn't have tablespaces, it's impossible for Django # to create the tables for models where db_tablespace is set. To avoid this # problem, we mark the models as unmanaged, and temporarily revert them to # managed during each test. We also set them to use the same...
ajvpot/CTFd
refs/heads/master
CTFd/api/v1/helpers/schemas.py
2
from typing import Container, Dict, Type from pydantic import BaseModel, create_model from sqlalchemy.inspection import inspect from sqlalchemy.orm.properties import ColumnProperty def sqlalchemy_to_pydantic( db_model: Type, *, include: Dict[str, type] = None, exclude: Container[str] = None ) -> Type[BaseModel]:...
temasek/android_external_chromium_org
refs/heads/cm-11.0
third_party/protobuf/python/google/protobuf/message.py
227
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
lucychambers/lucychambers.github.io
refs/heads/master
.bundle/ruby/2.0.0/gems/pygments.rb-0.6.0/vendor/simplejson/simplejson/tests/test_check_circular.py
414
from unittest import TestCase import simplejson as json def default_iterable(obj): return list(obj) class TestCheckCircular(TestCase): def test_circular_dict(self): dct = {} dct['a'] = dct self.assertRaises(ValueError, json.dumps, dct) def test_circular_list(self): lst = [...
rx2130/Leetcode
refs/heads/master
python/280 Wiggle Sort.py
1
class Solution(object): # Op1: O(n log(n)) def wiggleSort(self, nums): """ :type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead. """ s = sorted(nums) l, r = 0, len(s) - 1 i = 0 while i < len(nums): nu...
Maccimo/intellij-community
refs/heads/master
plugins/hg4idea/testData/bin/mercurial/streamclone.py
88
# streamclone.py - streaming clone server support for mercurial # # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. import util, error from i18n import _ from mercurial import ...
indictranstech/fbd_frappe
refs/heads/develop
frappe/desk/form/__init__.py
1829
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals
eeshangarg/oh-mainline
refs/heads/master
vendor/packages/distribute/setuptools/tests/server.py
62
"""Basic http server for tests to simulate PyPI or custom indexes """ import urllib2 import sys from threading import Thread from BaseHTTPServer import HTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler class IndexServer(HTTPServer): """Basic single-threaded http server simulating a package index ...
pozdnyakov/chromium-crosswalk
refs/heads/master
build/android/pylib/base/sharded_tests_queue.py
11
# 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. """A module that contains a queue for running sharded tests.""" import multiprocessing class ShardedTestsQueue(object): """A queue for managing pen...
oursu/Gem_code
refs/heads/master
inputs/prepare_input_for_SAMNet.py
1
from optparse import OptionParser import os import networkx as nx import sys ''' Author:Oana Ursu ''' def main(): parser=OptionParser() parser.add_option('--input',dest='input',help='Input') parser.add_option('--input_type',dest='input_type',help='Input type. Can be phen or DE') parser.add_option('--PP...
wrh3c/Maslow-GroundControl
refs/heads/master
UIElements/viewMenu.py
1
from kivy.uix.gridlayout import GridLayout from UIElements.loadDialog import LoadDialog from UIElements.pageableTextPopup import PageableTextPopup from kivy.uix.popup import Popup import re from DataStructures.makesmithIni...
vivekanand1101/neutron
refs/heads/master
neutron/services/service_base.py
16
# Copyright 2012 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 req...
lucafavatella/intellij-community
refs/heads/cli-wip
python/helpers/profiler/thrift/transport/TSSLSocket.py
9
# # 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 u...
TangXT/edx-platform
refs/heads/master
lms/djangoapps/instructor/tests/test_api.py
8
# -*- coding: utf-8 -*- """ Unit tests for instructor.api methods. """ # pylint: disable=E1111 import unittest import json import requests import datetime import ddt import random from urllib import quote from django.test import TestCase from nose.tools import raises from mock import Mock, patch from django.conf import...
TwilioDevEd/api-snippets
refs/heads/master
rest/usage-triggers/list-post-example-1/list-post-example-1.6.x.py
1
# Download the Python helper library from twilio.com/docs/python/install import os from twilio.rest import Client # Your Account Sid and Auth Token from twilio.com/user/account # To set up environmental variables, see http://twil.io/secure account_sid = os.environ['TWILIO_ACCOUNT_SID'] auth_token = os.environ['TWILIO_...
amith01994/intellij-community
refs/heads/master
python/testData/copyPaste/singleLine/Indent11.dst.py
747
class C: def foo(self): <caret>y = 2
ArcherSys/ArcherSys
refs/heads/master
skulpt/test/run/t230.py
1
def f(n): for i in range(n): yield i g = f(5) print g.next() print g.next() print g.next() print g.next()
pcn/graphite-web
refs/heads/add_kairosdb_support
webapp/graphite/metrics/urls.py
8
"""Copyright 2009 Chris Davis 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 ...
alsrgv/tensorflow
refs/heads/master
tensorflow/python/ops/distributions/normal.py
8
# 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...
aboutsajjad/Bridge
refs/heads/master
app_packages/werkzeug/wrappers.py
84
# -*- coding: utf-8 -*- """ werkzeug.wrappers ~~~~~~~~~~~~~~~~~ The wrappers are simple request and response objects which you can subclass to do whatever you want them to do. The request object contains the information transmitted by the client (webbrowser) and the response object contains al...
Immortalin/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/subprocess.py
43
# subprocess - Subprocesses with accessible I/O streams # # For more information about this module, see PEP 324. # # Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se> # # Licensed to PSF under a Contributor Agreement. # See http://www.python.org/2.4/license for licensing details. r"""subprocess - Subpr...
vipins/ccccms
refs/heads/master
env/Lib/site-packages/setuptools/script template.py
486
# EASY-INSTALL-SCRIPT: %(spec)r,%(script_name)r __requires__ = """%(spec)r""" import pkg_resources pkg_resources.run_script("""%(spec)r""", """%(script_name)r""")
jabbalaci/jabbapylib
refs/heads/master
tests/text/test_utils.py
1
# -*- coding: utf-8 -*- from jabbapylib.text import utils def test_inc_string(): assert utils.inc_string('a') == 'b' assert utils.inc_string('f') == 'g' assert utils.inc_string('z') == 'aa' assert utils.inc_string('zz') == 'aaa' assert utils.inc_string('af') == 'ag' assert utils.inc_string('a...
dfalt974/SickRage
refs/heads/master
lib/future/types/newrange.py
56
""" Nearly identical to xrange.py, by Dan Crosta, from https://github.com/dcrosta/xrange.git This is included here in the ``future`` package rather than pointed to as a dependency because there is no package for ``xrange`` on PyPI. It is also tweaked to appear like a regular Python 3 ``range`` object rather than ...
pkexcellent/luigi
refs/heads/master
test/contrib/_webhdfs_test.py
22
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
tashaxe/Red-DiscordBot
refs/heads/develop
lib/websockets/test_client_server.py
8
import asyncio import logging import os import ssl import unittest import unittest.mock from .client import * from .exceptions import ConnectionClosed, InvalidHandshake from .http import USER_AGENT, read_response from .server import * # Avoid displaying stack traces at the ERROR logging level. logging.basicConfig(le...
gwind/YWeb
refs/heads/master
yweb/yweb/utils/markup.py
1
# coding: utf-8 from markdown import Markdown import docutils.core # 系统中要安装 python-pygments YMK = Markdown( extensions=['fenced_code', 'tables', 'codehilite'], extension_configs={ 'codehilite': [ # ('force_linenos', True), ], ...
obi-two/Rebelion
refs/heads/master
data/scripts/templates/object/tangible/furniture/all/shared_frn_all_lamp_tbl_s02.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 = Tangible() result.template = "object/tangible/furniture/all/shared_frn_all_lamp_tbl_s02.iff" result.attribute_tem...
unreal666/outwiker
refs/heads/master
plugins/externaltools/externaltools/controller.py
3
# -*- coding: utf-8 -*- from outwiker.gui.preferences.preferencepanelinfo import PreferencePanelInfo from outwiker.pages.wiki.wikipage import WikiWikiPage from outwiker.pages.wiki.defines import MENU_WIKI from outwiker.utilites.actionsguicontroller import (ActionsGUIController, ...
jobscore/sync-engine
refs/heads/master
migrations/versions/010_store_raw_contact_data.py
11
"""Store raw contact data. Revision ID: 3b511977a01f Revises: 169cac0cd87e Create Date: 2014-04-16 15:36:22.188971 """ # revision identifiers, used by Alembic. revision = '3b511977a01f' down_revision = '169cac0cd87e' from alembic import op import sqlalchemy as sa def upgrade(): op.add_column('contact', sa.Col...
ytmimi/Thesis2017
refs/heads/refactor
setup.py
1
from setuptools import setup setup(name='ma_option_vol', version='1.0.6', #project desctiption description='Thesis Code', long_description='Code to help with the collection and analysis of data for my Fall 2017 Grossman School of Business Honors Thesis', #author info author=...
Pafcholini/emotion_kernel_tw_p
refs/heads/master
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
4653
# EventClass.py # # This is a library defining some events types classes, which could # be used by other scripts to analyzing the perf samples. # # Currently there are just a few classes defined for examples, # PerfEvent is the base class for all perf event sample, PebsEvent # is a HW base Intel x86 PEBS event, and use...
jorik041/glances
refs/heads/master
glances/exports/glances_statsd.py
11
# -*- coding: utf-8 -*- # # This file is part of Glances. # # Copyright (C) 2015 Nicolargo <nicolas@nicolargo.com> # # Glances is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
jimi-c/ansible
refs/heads/devel
test/integration/targets/plugin_loader/override/filter_plugins/core.py
147
# Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type def do_flag(myval): return 'flagged' class FilterModule(object): ''' Ansible core jinja2 filters ''' def filters(self): return { # jinja2 overrides 'fla...
chrisxue815/leetcode_python
refs/heads/master
problems/test_0027_swap.py
1
import unittest class Solution: def removeElement(self, nums, val): """ :type nums: List[int] :type val: int :rtype: int """ lo = 0 hi = len(nums) - 1 while lo <= hi: if nums[lo] == val: nums[lo], nums[hi] = nums[hi], nums...
woozzu/pylearn2
refs/heads/master
pylearn2/utils/tests/test_general.py
45
""" Tests for pylearn2.utils.general functions. """ from pylearn2.utils import contains_nan, contains_inf, isfinite import numpy as np def test_contains_nan(): """ Tests that pylearn2.utils.contains_nan correctly identifies `np.nan` values in an array. """ arr = np.random.random(100) assert no...
Lekanich/intellij-community
refs/heads/master
python/testData/findUsages/ClassUsages.py
83
class C<caret>ow: def __init__(self): pass c = Cow()
Celthi/youtube-dl-GUI
refs/heads/master
youtube_dl/extractor/comedycentral.py
20
from __future__ import unicode_literals import re from .mtv import MTVServicesInfoExtractor from ..compat import ( compat_str, compat_urllib_parse, ) from ..utils import ( ExtractorError, float_or_none, unified_strdate, ) class ComedyCentralIE(MTVServicesInfoExtractor): _VALID_URL = r'''(?x)...
trishnaguha/ansible
refs/heads/devel
lib/ansible/modules/network/f5/bigip_sys_daemon_log_tmm.py
14
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
plotly/python-api
refs/heads/master
packages/python/plotly/plotly/validators/indicator/gauge/step/line/__init__.py
24
import sys if sys.version_info < (3, 7): from ._width import WidthValidator from ._color import ColorValidator else: from _plotly_utils.importers import relative_import __all__, __getattr__, __dir__ = relative_import( __name__, [], ["._width.WidthValidator", "._color.ColorValidator"] )
Schizo/MediaBrowser
refs/heads/master
python/Temp/sandboxShit.py
1
#!/usr/bin/env python ############################################################################ # # Copyright (C) 2004-2005 Trolltech AS. All rights reserved. # # This file is part of the example classes of the Qt Toolkit. # # This file may be used under the terms of the GNU General Public # License version ...
The-Compiler/pytest-qt
refs/heads/master
src/pytestqt/__init__.py
2
# _version is automatically generated by setuptools_scm from pytestqt._version import version __version__ = version
nviennot/rethinkdb
refs/heads/next
lib/retester/cloud_retester.py
4
# Copyright 2010-2012 RethinkDB, all rights reserved. import subprocess, shlex, signal, os, time, shutil, tempfile, sys, traceback, types, gitroot, random, atexit, stat base_directory = os.path.dirname(os.path.join(os.getcwd(), sys.argv[0])) + "/../test" use_local_retester = os.getenv("USE_CLOUD", "false") == "false" ...
djabber/Dashboard
refs/heads/master
bottle/dash/lib/python2.7/encodings/gb18030.py
816
# # gb18030.py: Python Unicode Codec for GB18030 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_cn, codecs import _multibytecodec as mbc codec = _codecs_cn.getcodec('gb18030') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteInc...
kaplun/invenio
refs/heads/master
modules/websubmit/lib/websubmit_icon_creator.py
3
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2008, 2009, 2010, 2011, 2012 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 ## Licens...
tchernomax/ansible
refs/heads/devel
lib/ansible/plugins/lookup/conjur_variable.py
28
# (c) 2018, Jason Vanderhoof <jason.vanderhoof@cyberark.com>, Oren Ben Meir <oren.benmeir@cyberark.com> # (c) 2018 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type ANSIBLE...
umlfri/umlfri2
refs/heads/master
umlfri2/types/geometry/line.py
1
from .point import Point class Line: def __init__(self, x1, y1, x2, y2): self.__x1 = x1 self.__y1 = y1 self.__x2 = x2 self.__y2 = y2 @staticmethod def from_point_point(p1, p2): return Line(p1.x, p1.y, p2.x, p2.y) @property def first(self): ...
chanceraine/nupic
refs/heads/master
tests/unit/nupic/regions/knn_anomaly_classifier_region_test.py
35
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
WatanabeYasumasa/edx-platform
refs/heads/gacco2/master
cms/urls_dev.py
201
""" URLconf for development-only views. This gets imported by urls.py and added to its URLconf if we are running in development mode; otherwise, it is ignored. """ from django.conf.urls import url urlpatterns = ( url(r'^dev_mode$', 'contentstore.views.dev.dev_mode', name='dev_mode'), url(r'^template/(?P<templa...
moijes12/treeherder
refs/heads/master
tests/webapp/api/test_bug_job_map_api.py
11
import json import random from time import time from django.contrib.auth.models import User from django.core.urlresolvers import reverse from rest_framework.test import APIClient def test_create_bug_job_map_no_auth(eleven_jobs_stored, jm): """ test creating a single note via endpoint """ client = API...
Beauhurst/django
refs/heads/master
django/contrib/flatpages/models.py
86
from django.contrib.sites.models import Site from django.db import models from django.urls import get_script_prefix from django.utils.encoding import iri_to_uri from django.utils.translation import gettext_lazy as _ class FlatPage(models.Model): url = models.CharField(_('URL'), max_length=100, db_index=True) ...
okwasi/gyp
refs/heads/master
test/same-gyp-name/gyptest-default.py
318
#!/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. """ Build a .gyp that depends on 2 gyp files with the same name. """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('all.gyp', chdi...
alzeih/ava
refs/heads/master
manage.py
5
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ava.settings.base") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
dgzurita/odoo
refs/heads/8.0
addons/stock_dropshipping/wizard/stock_invoice_onshipping.py
270
# -*- 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...
ebu/PlugIt
refs/heads/master
tests/service_external/__init__.py
1
"""Test the simple service from an external point of view (Using HTTP requests)""" from test_service_from_http import *
IIIIIIIIll/sdy_notes_liaoxf
refs/heads/master
LiaoXueFeng/Advanced_properties/List_Comprehensions.py
1
L=list(range(1, 11)) print(L) L=[] for x in range(1,11): L.append(x*x) print(L) print([x * x for x in range(1, 11) if x % 2 == 0])
MuzammilKhan/Ventriloquy
refs/heads/master
mysite/wordclips/utils/inputparser.py
1
class InputParser: """ Class for parsing a string of words separated by a delimiter """ def __init__(self, delim): self.delim = delim def parse(self, s): """ Parsing the string using the delimiter Parameters ------ s -- a string of tokens to be...
sovietspy2/uzletiProject
refs/heads/master
python/Lib/MimeWriter.py
67
"""Generic MIME writer. This module defines the class MimeWriter. The MimeWriter class implements a basic formatter for creating MIME multi-part files. It doesn't seek around the output file nor does it use large amounts of buffer space. You must write the parts out in the order that they should occur in the fi...
anderson7ru/bienestarues
refs/heads/master
cuentas_usuarioapp/admin.py
1
from django.contrib import admin from cuentas_usuarioapp.models import UsuarioEmpleado # Register your models here. class UsuarioAdmin(admin.ModelAdmin): list_display = ('codigoEmpleado','codigoUsuario') admin.site.register(UsuarioEmpleado,UsuarioAdmin)
ice9js/servo
refs/heads/master
tests/wpt/css-tests/tools/html5lib/html5lib/treewalkers/pulldom.py
1729
from __future__ import absolute_import, division, unicode_literals from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \ COMMENT, IGNORABLE_WHITESPACE, CHARACTERS from . import _base from ..constants import voidElements class TreeWalker(_base.TreeWalker): def __iter__(self): ignore_until = None...
JackDanger/sentry
refs/heads/master
src/sentry/web/frontend/group_plugin_action.py
6
from __future__ import absolute_import, division from django.http import Http404, HttpResponseRedirect from django.shortcuts import get_object_or_404 from sudo.utils import is_safe_url from sentry.models import Group, GroupMeta from sentry.plugins import plugins from sentry.web.frontend.base import ProjectView clas...
xin3liang/platform_external_chromium_org_tools_gyp
refs/heads/master
test/mac/gyptest-app-error.py
164
#!/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 invalid strings files cause the build to fail. """ import TestCmd import TestGyp import sys if sys.platform == 'darwin'...
openhatch/oh-mainline
refs/heads/master
vendor/packages/docutils/test/functional/tests/standalone_rst_pseudoxml.py
18
exec(open('functional/tests/_standalone_rst_defaults.py').read()) # Source and destination file names. test_source = "standalone_rst_pseudoxml.txt" test_destination = "standalone_rst_pseudoxml.txt" # Keyword parameters passed to publish_file. writer_name = "pseudoxml" # Settings # enable INFO-level system messages i...
siosio/intellij-community
refs/heads/master
python/helpers/py2only/docutils/transforms/misc.py
183
# $Id: misc.py 6314 2010-04-26 10:04:17Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Miscellaneous transforms. """ __docformat__ = 'reStructuredText' from docutils import nodes from docutils.transforms import Transform, TransformError clas...
Universal-Model-Converter/UMC3.0a
refs/heads/master
data/Python/x86/Lib/site-packages/scipy/sparse/linalg/eigen/arpack/setup.py
3
#!/usr/bin/env python from __future__ import division, print_function, absolute_import from os.path import join from scipy._build_utils import needs_g77_abi_wrapper def configuration(parent_package='',top_path=None): from numpy.distutils.system_info import get_info, NotFoundError from numpy.distutils.misc_ut...
victorbergelin/scikit-learn
refs/heads/master
sklearn/preprocessing/tests/test_function_transformer.py
176
from nose.tools import assert_equal import numpy as np from sklearn.preprocessing import FunctionTransformer def _make_func(args_store, kwargs_store, func=lambda X, *a, **k: X): def _func(X, *args, **kwargs): args_store.append(X) args_store.extend(args) kwargs_store.update(kwargs) ...
valexandersaulys/prudential_insurance_kaggle
refs/heads/master
venv/lib/python2.7/site-packages/sklearn/linear_model/tests/test_ridge.py
6
import numpy as np import scipy.sparse as sp from scipy import linalg from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_a...
GoogleCloudPlatform/training-data-analyst
refs/heads/master
courses/machine_learning/deepdive2/structured/solutions/serving/application/lib/pyasn1/compat/dateandtime.py
26
# # This file is part of pyasn1 software. # # Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com> # License: http://snmplabs.com/pyasn1/license.html # import time from datetime import datetime from sys import version_info __all__ = ['strptime'] if version_info[:2] <= (2, 4): def strptime(text, dateFormat)...
dvitme/odoo-addons
refs/heads/8.0
partner_credit_limit/__init__.py
40
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from . import sale
dionisos2/python_libs
refs/heads/master
checking.py
1
def is_all_instance(iterable, aclass): ok = True for element in iterable: ok &= isinstance(element, aclass) return ok
andrewleech/SickRage
refs/heads/master
lib/requests/packages/chardet/constants.py
3007
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
ryfeus/lambda-packs
refs/heads/master
Tensorflow_Pandas_Numpy/source3.6/tensorflow/contrib/learn/python/learn/estimators/run_config.py
33
# 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...
aiorchestra/aiorchestra-openstack-plugin
refs/heads/master
openstack_plugin/compute/instances.py
1
# Author: Denys Makogon # # 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...
karandesai-96/joblib
refs/heads/master
joblib/test/test_numpy_pickle_compat.py
8
"""Test the old numpy pickler, compatibility version.""" import random # numpy_pickle is not a drop-in replacement of pickle, as it takes # filenames instead of open files as arguments. from joblib import numpy_pickle_compat def test_z_file(tmpdir): # Test saving and loading data with Zfiles. filename = tmp...
dansimau/coke
refs/heads/master
docs/conf.py
1
# -*- coding: utf-8 -*- # # Coke documentation build configuration file, created by # sphinx-quickstart on Tue Nov 26 23:26:59 2013. # # 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 co...
joshuajan/odoo
refs/heads/master
addons/mrp/wizard/change_production_qty.py
53
# -*- 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...
osuripple/pep.py
refs/heads/master
constants/slotStatuses.py
1
FREE = 1 LOCKED = 2 NOT_READY = 4 READY = 8 NO_MAP = 16 PLAYING = 32 OCCUPIED = 124 PLAYING_QUIT = 128
helldorado/ansible
refs/heads/devel
lib/ansible/modules/network/cloudengine/ce_evpn_bgp_rr.py
26
#!/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 distribut...
holmes/intellij-community
refs/heads/master
python/helpers/profiler/prof_util.py
45
__author__ = 'traff' import threading import os import tempfile from _prof_imports import Stats, FuncStat, Function class ProfDaemonThread(threading.Thread): def __init__(self): super(ProfDaemonThread, self).__init__() self.setDaemon(True) self.killReceived = False def run(self): ...
awemulya/fieldsight-kobocat
refs/heads/master
onadata/apps/fsforms/viewsets/SiteFormsViewset.py
1
from __future__ import unicode_literals from rest_framework import viewsets from rest_framework import serializers from onadata.apps.fsforms.models import FieldSightXF from onadata.apps.fsforms.serializers.FieldSightXFormApiSerializer import FSXFormListSerializer class SiteFormViewSet(viewsets.ReadOnlyModelViewSet):...
UIKit0/Radicale
refs/heads/master
radicale/auth/__init__.py
10
# -*- coding: utf-8 -*- # # This file is part of Radicale Server - Calendar Server # Copyright © 2008 Nicolas Kandel # Copyright © 2008 Pascal Halter # Copyright © 2008-2013 Guillaume Ayoub # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as...
whoi-acomms/pyacomms
refs/heads/master
bin/plotter.py
1
""" This demo demonstrates how to embed a matplotlib (mpl) plot into a PyQt4 GUI application, including: * Using the navigation toolbar * Adding data to the plot * Dynamically modifying the plot's properties * Processing mpl events * Saving the plot to a file from a menu The main goal is to serve as a basi...
wemanuel/smry
refs/heads/master
server-auth/ls/google-cloud-sdk/lib/googlecloudapis/container/v1beta1/__init__.py
11
"""Common imports for generated container client library.""" # pylint:disable=wildcard-import import pkgutil from googlecloudapis.apitools.base.py import * from googlecloudapis.container.v1beta1.container_v1beta1_client import * from googlecloudapis.container.v1beta1.container_v1beta1_messages import * __path__ = pk...
ratelle/cpuset
refs/heads/master
cpuset/main.py
3
"""Front end command line tool for Linux cpusets """ __copyright__ = """ Copyright (C) 2007-2010 Novell Inc. Author: Alex Tsariounov <alext@novell.com> This program 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 ...
ojengwa/oh-mainline
refs/heads/master
vendor/packages/Pygments/pygments/formatters/img.py
268
# -*- coding: utf-8 -*- """ pygments.formatters.img ~~~~~~~~~~~~~~~~~~~~~~~ Formatter for Pixmap output. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys from pygments.formatter import Formatter from pygments.util import ge...
havard024/prego
refs/heads/master
venv/lib/python2.7/site-packages/django/utils/translation/trans_null.py
113
# These are versions of the functions in django.utils.translation.trans_real # that don't actually do anything. This is purely for performance, so that # settings.USE_I18N = False can use this module rather than trans_real.py. from django.conf import settings from django.utils.encoding import force_text from django.ut...
kawasaki2013/python-for-android-x86
refs/heads/master
python3-alpha/python3-src/Doc/includes/sqlite3/connect_db_2.py
139
import sqlite3 con = sqlite3.connect(":memory:")
luxnovalabs/enjigo_door
refs/heads/master
web_interface/dbindexer/compiler.py
21
from .resolver import resolver from django.utils.importlib import import_module def __repr__(self): return '<%s, %s, %s, %s>' % (self.alias, self.col, self.field.name, self.field.model.__name__) from django.db.models.sql.where import Constraint Constraint.__repr__ = __repr__ # TODO: manipulate a copy of ...