repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
pyduan/amazonaccess
refs/heads/master
classifier.py
3
#!/usr/bin/env python """Amazon Access Challenge This is my part of the code that produced the winning solution to the Amazon Employee Access Challenge. See README.md for more details. Author: Paul Duan <email@paulduan.com> """ from __future__ import division import argparse import logging from sklearn import met...
saydulk/horizon
refs/heads/master
openstack_dashboard/api/rest/keystone.py
17
# Copyright 2014, Rackspace, US, 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 w...
studentisgss/booking
refs/heads/master
authentication/views.py
1
from django.views.generic import TemplateView from django.http import Http404, HttpResponseRedirect from django.contrib.auth.mixins import AccessMixin from django.contrib.auth import views as auth_views from django.shortcuts import render from booking.settings import LOGIN_REDIRECT_URL class NotShibbolethMixin(Acce...
open-synergy/opnsynid-stock-logistics-warehouse
refs/heads/8.0
stock_inventory_revaluation_extend/models/__init__.py
1
# -*- coding: utf-8 -*- # Copyright 2017 OpenSynergy Indonesia # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import stock_inventory_revaluation_monkeypatch from . import stock_inventory_revaluation
fevxie/odoo
refs/heads/8.0
addons/sale_margin/sale_margin.py
172
############################################################################## # # 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...
EverlastingFire/PyLC
refs/heads/master
pylc-client/radar.py
1
## # This file is part of PyLC - Python LAN Chat # # (c) Copyright 2010 PyLC Development Team # # PyLC is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as published # by the Free Software Foundation; either version 3 of the License, # or (at your option) an...
LumPenPacK/NetworkExtractionFromImages
refs/heads/master
win_build/nefi2_win_amd64_msvc_2015/site-packages/networkx/__init__.py
40
""" NetworkX ======== NetworkX (NX) is a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks. https://networkx.lanl.gov/ Using ----- Just write in Python >>> import networkx as nx >>> G=nx.Graph() >>> G.add_edge(1,2) ...
nitroglycerine33/kernel_asus_grouper
refs/heads/jb42
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
rockneurotiko/django
refs/heads/master
tests/user_commands/management/commands/leave_locale_alone_false.py
428
from django.core.management.base import BaseCommand from django.utils import translation class Command(BaseCommand): can_import_settings = True leave_locale_alone = False def handle(self, *args, **options): return translation.get_language()
ea4862/boeffla41_e210k
refs/heads/jb41
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
ShassAro/ShassAro
refs/heads/master
Bl_project/blVirtualEnv/lib/python2.7/site-packages/django/contrib/flatpages/urls.py
383
from django.conf.urls import patterns urlpatterns = patterns('django.contrib.flatpages.views', (r'^(?P<url>.*)$', 'flatpage'), )
lpantano/recipes
refs/heads/master
recipes/rdkit/2016.03.3/run_test.py
31
# plot a simple molecule; requires pillow from rdkit import Chem from rdkit.Chem import AllChem from rdkit.Chem import Draw comp = Chem.MolFromSmiles('CN1C=NC2=C1C(=O)N(C)C(=O)N2C') comp.UpdatePropertyCache(strict=False) AllChem.Compute2DCoords(comp) Draw.MolToFile(comp, 'test_pillow_caffeine.png')
390910131/Misago
refs/heads/master
misago/forums/tests/test_lists.py
8
from misago.acl.testutils import override_acl from misago.users.testutils import AuthenticatedUserTestCase from misago.forums.lists import get_forums_list, get_forum_path from misago.forums.models import Forum class ForumsListsTests(AuthenticatedUserTestCase): def setUp(self): super(ForumsListsTests, sel...
ewongbb/stem
refs/heads/master
stem/util/proc.py
1
# Copyright 2011-2017, Damian Johnson and The Tor Project # See LICENSE for licensing information """ Helper functions for querying process and system information from the /proc contents. Fetching information this way provides huge performance benefits over lookups via system utilities (ps, netstat, etc). For instance...
jupyterlab/jupyterlab-git
refs/heads/master
jupyterlab_git/tests/test_branch.py
1
from pathlib import Path from unittest.mock import call, patch import pytest from jupyterlab_git.git import Git from .testutils import maybe_future @pytest.mark.parametrize( "branch,expected", [ ("refs/heads/feature-foo", False), ("refs/heads/master", False), ("refs/remotes/origin/f...
duqiao/django
refs/heads/master
tests/template_tests/filter_tests/test_force_escape.py
352
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.template.defaultfilters import force_escape from django.test import SimpleTestCase from django.utils.safestring import SafeData from ..utils import setup class ForceEscapeTests(SimpleTestCase): """ Force_escape is applied immediatel...
browseinfo/odoo_saas3_nicolas
refs/heads/master
addons/website_sale_delivery/controllers/main.py
1
# -*- coding: utf-8 -*- from openerp.addons.website_sale.controllers.main import Ecommerce from openerp.addons.web import http from openerp.addons.web.http import request from openerp import SUPERUSER_ID class Ecommerce(Ecommerce): @http.route(['/shop/payment/'], type='http', auth="public", website=True, multila...
nathanbjenx/cairis
refs/heads/master
cairis/core/CodeParameters.py
2
# 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...
samnazarko/vero2-linux
refs/heads/master
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
munyirik/python
refs/heads/develop
cpython/Doc/includes/sqlite3/adapter_point_1.py
96
import sqlite3 class Point: def __init__(self, x, y): self.x, self.y = x, y def __conform__(self, protocol): if protocol is sqlite3.PrepareProtocol: return "%f;%f" % (self.x, self.y) con = sqlite3.connect(":memory:") cur = con.cursor() p = Point(4.0, -3.2) cur.execute("select ?",...
wujuguang/sentry
refs/heads/master
src/sentry/api/endpoints/organization_projects.py
11
from __future__ import absolute_import from rest_framework.response import Response from sentry.api.base import DocSection from sentry.api.bases.organization import OrganizationEndpoint from sentry.api.serializers import serialize from sentry.models import Project, Team class OrganizationProjectsEndpoint(Organizati...
klonage/nlt-gcs
refs/heads/master
Lib/imaplib.py
55
"""IMAP4 client. Based on RFC 2060. Public class: IMAP4 Public variable: Debug Public functions: Internaldate2tuple Int2AP ParseFlags Time2Internaldate """ # Author: Piers Lauder <piers@cs.su.oz.au> December 19...
luotao1/Paddle
refs/heads/develop
python/paddle/fluid/tests/unittests/test_dist_sparse_load_ps1.py
2
# Copyright (c) 2020 PaddlePaddle 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 app...
ravindrapanda/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/as_string_op_test.py
119
# 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...
ritchyteam/odoo
refs/heads/master
addons/account_asset/account_asset_invoice.py
193
# -*- encoding: 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 G...
simone-campagna/zirkon
refs/heads/master
tests/unit/test_macro_numeric.py
2
# -*- coding: utf-8 -*- import collections import pytest from zirkon.toolbox.macro import \ Macro, \ MRepr, MStr, MAnd, MOr, MNot, \ MConst ## unary _unary_int_operands = [1, -4, 0] @pytest.fixture(params=_unary_int_operands, ids=[str(o) for o in _unary_int_operands]) def ival1(request): return req...
KyleJamesWalker/ansible
refs/heads/devel
lib/ansible/modules/windows/win_ping.py
32
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others # # 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 ...
Vassy/odoo
refs/heads/master
addons/website_sale/controllers/main.py
9
# -*- coding: utf-8 -*- import werkzeug from openerp import SUPERUSER_ID from openerp.addons.web import http from openerp.addons.web.http import request from openerp.tools.translate import _ from openerp.addons.website.models.website import slug PPG = 20 # Products Per Page PPR = 4 # Products Per Row class table_co...
firstjob/python-social-auth
refs/heads/master
examples/django_example/example/settings.py
50
import sys from os.path import abspath, dirname, join sys.path.insert(0, '../..') DEBUG = True TEMPLATE_DEBUG = DEBUG ROOT_PATH = abspath(dirname(__file__)) ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3',...
chemelnucfin/tensorflow
refs/heads/master
tensorflow/python/client/device_lib_test.py
49
# 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...
xodus7/tensorflow
refs/heads/master
tensorflow/python/training/checkpoint_utils.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...
srluge/SickRage
refs/heads/master
lib/hachoir_parser/misc/pifv.py
95
""" EFI Platform Initialization Firmware Volume parser. Author: Alexandre Boeglin Creation date: 08 jul 2007 """ from hachoir_parser import Parser from hachoir_core.field import (FieldSet, UInt8, UInt16, UInt24, UInt32, UInt64, Enum, CString, String, PaddingBytes, RawBytes, NullBytes) from hachoir_core.endian...
templetontsai/nexus7-grouper-kernel
refs/heads/master
tools/perf/scripts/python/check-perf-trace.py
11214
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
avistel/cyckotron
refs/heads/master
partdb/tables.py
1
import django_tables2 as tables from .models import Part class PartTable(tables.Table): class Meta: model = Part attrs = {'class': 'table-bordered'} exclude = {'schlib', 'pcblib', 'datasheet'}
barseghyanartur/python-social-auth
refs/heads/master
social/tests/actions/test_disconnect.py
58
import requests from httpretty import HTTPretty from social.actions import do_disconnect from social.exceptions import NotAllowedToDisconnect from social.utils import parse_qs from social.tests.models import User, TestUserSocialAuth from social.tests.actions.actions import BaseActionTest class DisconnectActionTest...
CeltonMcGrath/TACTIC
refs/heads/master
3rd_party/CherryPy/cherrypy/lib/cptools.py
6
"""Functions for builtin CherryPy tools.""" import logging try: # Python 2.5+ from hashlib import md5 except ImportError: from md5 import new as md5 import re try: set except NameError: from sets import Set as set import cherrypy from cherrypy.lib import httputil as _httputil # ...
asm-products/movie-database-service
refs/heads/master
ani/lib/python2.7/site-packages/coverage/results.py
160
"""Results of coverage measurement.""" import os from coverage.backward import iitems, set, sorted # pylint: disable=W0622 from coverage.misc import format_lines, join_regex, NoSource from coverage.parser import CodeParser class Analysis(object): """The results of analyzing a code unit.""" def __init...
vvv1559/intellij-community
refs/heads/master
python/testData/completion/heavyStarPropagation/lib/_pkg1/_pkg1_0/_pkg1_0_0/_pkg1_0_0_0/_pkg1_0_0_0_1/_mod1_0_0_0_1_4.py
30
name1_0_0_0_1_4_0 = None name1_0_0_0_1_4_1 = None name1_0_0_0_1_4_2 = None name1_0_0_0_1_4_3 = None name1_0_0_0_1_4_4 = None
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/draft_schematic/clothing/clothing_jacket_casual_05.py
85615
import sys def setup(core, object): return
fengzhe29888/gnuradio-old
refs/heads/master
gr-fec/python/fec/__init__.py
47
# # Copyright 2012,2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version...
blaggacao/odoo
refs/heads/master
addons/account_followup/__openerp__.py
64
# -*- 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...
williamfeng323/py-web
refs/heads/master
flask/lib/python3.6/site-packages/chardet/cp949prober.py
289
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
Ashaba/rms
refs/heads/master
rmslocalenv/lib/python2.7/site-packages/django/contrib/messages/context_processors.py
705
from django.contrib.messages.api import get_messages from django.contrib.messages.constants import DEFAULT_LEVELS def messages(request): """ Returns a lazy 'messages' context variable. """ return { 'messages': get_messages(request), 'DEFAULT_MESSAGE_LEVELS': DEFAULT_LEVELS, }
ressu/SickGear
refs/heads/master
sickbeard/name_parser/regexes.py
1
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickGear. # # SickGear 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,...
sumihai-tekindo/account_sicepat
refs/heads/master
account_extra_report/__init__.py
1
import models import reports
ryfeus/lambda-packs
refs/heads/master
Opencv_pil/source36/numpy/fft/__init__.py
9
from __future__ import division, absolute_import, print_function # To get sub-modules from .info import __doc__ from .fftpack import * from .helper import * from numpy._pytesttester import PytestTester test = PytestTester(__name__) del PytestTester
davenovak/mtasa-blue
refs/heads/master
vendor/google-breakpad/src/tools/gyp/test/win/gyptest-quoting-commands.py
344
#!/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. """ Make sure batch files run as actions. Regression test for previously missing trailing quote on command line. cmd typically will implicit...
davidvoler/social-language-learning-platform
refs/heads/master
src/lesson/lesson_handler.py
1
""" loads a list of lesson in learning mode for current user. """ import logging from bson.objectid import ObjectId from bson.json_util import dumps, loads from slugify import slugify from base_handler import BaseHandler from utils import get_mongodb_connection, get_logger from tornado.options import options class Les...
Huluzai/DoonSketch
refs/heads/master
inkscape-0.48.5/share/extensions/test/whirl.test.py
8
#!/usr/bin/env python # This is only the automatic generated test file for ../whirl.py # This must be filled with real tests and this commentary # must be cleared. # If you want to help, read the python unittest documentation: # http://docs.python.org/library/unittest.html import sys sys.path.append('..') # this line...
akennedy-adtran/linux_mmc_2.6.32.9
refs/heads/master
scripts/rt-tester/rt-tester.py
904
#!/usr/bin/env python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # 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 Foundation. # import os import sys import getopt impor...
was4444/chromium.src
refs/heads/nw15
build/android/gyp/jar.py
16
#!/usr/bin/env python # # 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. import optparse import os import sys from util import build_utils def Jar(class_files, classes_dir, jar_path, manifest_file=None):...
kylelwm/ponus
refs/heads/master
venv/build/django/django/utils/image.py
98
# -*- coding: utf-8 -*- """ To provide a shim layer over Pillow/PIL situation until the PIL support is removed. Combinations To Account For =========================== * Pillow: * never has ``_imaging`` under any Python * has the ``Image.alpha_composite``, which may aid in detection * PIL * CPython 2....
gurneyalex/odoo
refs/heads/13.0-improve_sale_coupon_perf
addons/payment/tests/common.py
22
# -*- coding: utf-8 -*- from odoo.addons.account.tests.account_test_classes import AccountingTestCase class PaymentAcquirerCommon(AccountingTestCase): def setUp(self): super(PaymentAcquirerCommon, self).setUp() self.currency_euro = self.env['res.currency'].search([('name', '=', 'EUR')], limit=1...
paulfitz/phantomjs
refs/heads/master
src/qt/qtbase/src/3rdparty/freetype/src/tools/chktrcmp.py
381
#!/usr/bin/env python # # Check trace components in FreeType 2 source. # Author: suzuki toshiya, 2009 # # This code is explicitly into the public domain. import sys import os import re SRC_FILE_LIST = [] USED_COMPONENT = {} KNOWN_COMPONENT = {} SRC_FILE_DIRS = [ "src" ] TRACE_DEF_FILES = [ "include/freetype/in...
RockchipOpensourceCommunity/popmetal-android-kernel-3.10
refs/heads/master
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
boundary/tsi-lab
refs/heads/master
labs/lab-6/ex6-2.weather.py
2
#!/usr/bin/env python # Copyright 2014-2015 Boundary, 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 ...
Pablo126/SSBW
refs/heads/master
Tarea1y2/flask_1/flask1/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/latin1prober.py
1777
######################## 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...
JioCloud/tempest-lib
refs/heads/master
tempest_lib/cmd/skip_tracker.py
6
#!/usr/bin/env python2 # 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/LICENS...
mickele77/FreeCAD
refs/heads/master
src/Mod/OpenSCAD/ply/lex.py
482
# ----------------------------------------------------------------------------- # ply: lex.py # # Copyright (C) 2001-2011, # David M. Beazley (Dabeaz LLC) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions ar...
poojavade/Genomics_Docker
refs/heads/master
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/ipython-2.2.0-py2.7.egg/IPython/core/tests/tclass.py
33
"""Simple script to be run *twice*, to check reference counting bugs. See test_run for details.""" from __future__ import print_function import sys # We want to ensure that while objects remain available for immediate access, # objects from *previous* runs of the same script get collected, to avoid # accumulating m...
jlobaton/namebench
refs/heads/master
libnamebench/site_connector.py
175
# Copyright 2010 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 ...
hylthink/Sample_Lua
refs/heads/master
frameworks/cocos2d-x/tools/cocos2d-console/plugins/plugin_jscompile/__init__.py
11
#!/usr/bin/python # ---------------------------------------------------------------------------- # cocos "jscompile" plugin # # Copyright 2013 (C) Intel # # License: MIT # ---------------------------------------------------------------------------- ''' "jscompile" plugin for cocos command line tool ''' __docformat__ =...
wietsefranssen/VIC
refs/heads/master
tests/test_image_driver.py
6
#!/usr/bin/env python ''' VIC Image Driver testing ''' import os import re import xarray as xr import pandas as pd import numpy as np import numpy.testing as npt import glob import warnings def test_image_driver_no_output_file_nans(fnames, domain_file): ''' Test that all VIC image driver output files have th...
manojhirway/ExistingImagesOnNFS
refs/heads/master
cinder/db/sqlalchemy/migrate_repo/versions/010_add_transfers_table.py
20
# 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...
TomBaxter/osf.io
refs/heads/develop
admin/common_auth/views.py
5
from __future__ import absolute_import, unicode_literals from django.core.urlresolvers import reverse, reverse_lazy from django.http import Http404 from django.shortcuts import redirect from django.utils.decorators import method_decorator from django.views.decorators.cache import never_cache from django.views.decorato...
falkolab/titanium_mobile
refs/heads/master
support/plugin/all/plugin.py
37
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Titanium Compiler plugin # __PROJECT_ID__ # def compile(config): print "[INFO] __PROJECT_ID__ plugin loaded"
rspavel/spack
refs/heads/develop
var/spack/repos/builtin/packages/py-protobuf/package.py
2
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyProtobuf(PythonPackage): """Protocol buffers are Google's language-neutral, platform-neu...
okfish/django-oscar
refs/heads/master
src/oscar/apps/dashboard/reports/app.py
10
from django.conf.urls import url from oscar.core.application import DashboardApplication from oscar.core.loading import get_class class ReportsApplication(DashboardApplication): name = None default_permissions = ['is_staff', ] index_view = get_class('dashboard.reports.views', 'IndexView') def get_u...
rusucosmin/courses
refs/heads/master
ubb/fop/lab01/helloworld.py
10
print('Hello world')
openconnectome/open-connectome
refs/heads/master
scripts/ingest/rhoana/katccanno.py
2
# Copyright 2014 NeuroData (http://neurodata.io) # # 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...
jgoclawski/django
refs/heads/master
tests/invalid_models_tests/test_custom_fields.py
348
from django.db import models from .base import IsolatedModelsTestCase class CustomFieldTest(IsolatedModelsTestCase): def test_none_column(self): class NoColumnField(models.AutoField): def db_type(self, connection): # None indicates not to create a column in the database. ...
einarnn/ncclient
refs/heads/master
ncclient/devices/csr.py
4
""" Handler for Cisco CSR device specific information. Note that for proper import, the classname has to be: "<Devicename>DeviceHandler" ...where <Devicename> is something like "Default", "Nexus", etc. All device-specific handlers derive from the DefaultDeviceHandler, which implements the generic information ne...
mne-tools/mne-tools.github.io
refs/heads/main
0.16/_downloads/plot_topo_customized.py
13
""" ======================================== Plot custom topographies for MEG sensors ======================================== This example exposes the `iter_topography` function that makes it very easy to generate custom sensor topography plots. Here we will plot the power spectrum of each channel on a topographic la...
gnulinooks/sympy
refs/heads/master
sympy/functions/special/polynomials.py
5
""" This module mainly implements special orthogonal polynomials. See also functions.combinatorial.numbers which contains some combinatorial polynomials. """ from sympy.core.basic import Basic, S, C from sympy.core import Rational, Symbol from sympy.core.function import Function from sympy.utilities.memoization impo...
deryfebriantara/cimahi-city
refs/heads/master
node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py
2354
# Unmodified from http://code.activestate.com/recipes/576693/ # other than to add MIT license header (as specified on page, but not in code). # Linked from Python documentation here: # http://docs.python.org/2/library/collections.html#collections.OrderedDict # # This should be deleted once Py2.7 is available on all bot...
Gustry/inasafe
refs/heads/develop
safe/metadata/provenance/__init__.py
11
# -*- coding: utf-8 -*- """ InaSAFE Disaster risk assessment tool developed by AusAid - **metadata module.** Contact : ole.moller.nielsen@gmail.com .. 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 Sof...
molobrakos/home-assistant
refs/heads/master
homeassistant/components/prowl/__init__.py
36
"""The prowl component."""
glwu/python-for-android
refs/heads/master
python3-alpha/python3-src/Mac/Tools/Doc/setup.py
48
# Build and install an Apple Help Viewer compatible version of the Python # documentation into the framework. # Code by Bill Fancher, with some modifications by Jack Jansen. # # You must run this as a two-step process # 1. python setupDocs.py build # 2. Wait for Apple Help Indexing Tool to finish # 3. python setupDocs....
alcemirfernandes/pynguin
refs/heads/master
lib/pynguin/conf.py
3
version = 'pynguin-0.16' bug_url = 'http://code.google.com/p/pynguin/issues/list' LOG_FILENAME = 'logfile.log' BACKUP_FILENAME = 'pynguin_backup~%s.pyn' default_bgcolor = '#8282a0' default_color = 4294967295 # white default_fillcolor = 4284800110 # (100, 220, 110, 255)
JianyuWang/nova
refs/heads/master
nova/tests/functional/db/test_host_mapping.py
44
# 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...
scoky/python-tools
refs/heads/master
curve/curve_fit.py
2
#!/usr/bin/env python import os import sys import argparse import traceback import numpy as np from math import factorial from group import Group,UnsortedInputGrouper from scipy.optimize import curve_fit as cfit import scipy.stats as ss #import scipy.special def first_degree(xdata, a, b): return a * xdata + b de...
jvkops/django
refs/heads/master
django/db/backends/postgresql/schema.py
202
import psycopg2 from django.db.backends.base.schema import BaseDatabaseSchemaEditor class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_alter_column_type = "ALTER COLUMN %(column)s TYPE %(type)s USING %(column)s::%(type)s" sql_create_sequence = "CREATE SEQUENCE %(sequence)s" sql_delete_sequence =...
Arthaey/anki
refs/heads/master
anki/importing/noteimp.py
19
# -*- coding: utf-8 -*- # Copyright: Damien Elmes <anki@ichi2.net> # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import cgi from anki.consts import NEW_CARDS_RANDOM from anki.lang import _ from anki.utils import fieldChecksum, guid64, timestampID, \ joinFields, intTime, splitField...
blakedewey/nipype
refs/heads/master
nipype/interfaces/mipav/tests/test_auto_JistLaminarROIAveraging.py
9
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.mipav.developer import JistLaminarROIAveraging def test_JistLaminarROIAveraging_inputs(): input_map = dict(args=dict(argstr='%s', ), environ=dict(nohash=True, usedefault=True, ), ...
elimence/edx-platform
refs/heads/master
common/djangoapps/service_status/views.py
188
""" Django Views for service status app """ import json import time from django.http import HttpResponse from dogapi import dog_stats_api from service_status import tasks from djcelery import celery from celery.exceptions import TimeoutError def index(_): """ An empty view """ return HttpResponse(...
ygol/odoo
refs/heads/8.0
addons/web_diagram/__openerp__.py
423
{ 'name': 'OpenERP Web Diagram', 'category': 'Hidden', 'description': """ Openerp Web Diagram view. ========================= """, 'version': '2.0', 'depends': ['web'], 'data' : [ 'views/web_diagram.xml', ], 'qweb': [ 'static/src/xml/*.xml', ], 'auto_install': Tr...
jantman/python-mcollective
refs/heads/master
tests/unit/test_config.py
1
'''Tets for the configuration class''' import pytest from pymco import config as _config from pymco import exc from pymco.test import ctxt from pymco.test.utils import mock def test_init_configfile(): '''Tests :py:method:`Config.from_configfile` static method.''' conf = _config.Config.from_configfile(configf...
purushothamc/myibitsolutions
refs/heads/master
sorting/insertion_sort.py
1
#!/bin/env/python sample_list = [5, 2, 6, 9, 3, 1, 8, 4, 7, 0] def insertion_sort(sl, ln): """ In insertion sort, we run a loop over list and in each iteration, we pick current element and place it in its correct position in elements before it. example: [3, 1, 4, 5, 2] 1st iteration: 3 picked, we...
luotao1/Paddle
refs/heads/develop
python/paddle/fluid/tests/unittests/test_spawn_and_init_parallel_env.py
1
# Copyright (c) 2020 PaddlePaddle 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 app...
anentropic/django-oscar
refs/heads/master
src/oscar/templatetags/product_tags.py
21
from django import template from django.template.loader import select_template register = template.Library() @register.simple_tag(takes_context=True) def render_product(context, product): """ Render a product snippet as you would see in a browsing display. This templatetag looks for different templates ...
Endika/OpenUpgrade
refs/heads/8.0
addons/resource/tests/__init__.py
261
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
reyrodrigues/EU-SMS
refs/heads/master
temba/msgs/migrations/0036_auto_20151103_1014.py
3
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('msgs', '0035_broadcast_expressions'), ] operations = [ migrations.AlterField( model_name='exportmessagestask', ...
beardbig/bandsharing
refs/heads/master
tests/bandsharing_tests.py
1
#!/usr/bin/env python #::::::::::::::::::::::::::::::::::::::::::::::::::::: #Author: Damiano Barboni <damianobarboni@gmail.com> #Version: 0.1 #Description: Script used to test bandsharing.py #Changelog: Wed Jun 11 12:07:33 CEST 2014 # First test version # #::::::::...
ayumilong/rethinkdb
refs/heads/next
external/v8_3.30.33.16/build/gyp/test/rules-dirname/gyptest-dirname.py
134
#!/usr/bin/env python # Copyright (c) 2011 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 simple rules when using an explicit build target of 'all'. """ import TestGyp import os test = TestGyp.TestGyp(formats=['make...
X-DataInitiative/tick
refs/heads/master
tick/prox/tests/prox_slope_test.py
2
# License: BSD 3 clause import unittest import numpy as np from scipy.stats import norm as normal from tick.prox import ProxSlope from tick.prox.tests.prox import TestProx class ProxSlopeTest(object): def get_coeffs_weak(self, n_coeffs): return (-1) ** np.arange(n_coeffs) * \ np.sqrt(2 * np...
guschmue/tensorflow
refs/heads/master
tensorflow/python/ops/nn.py
21
# Copyright 2015 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...
gregmedlock/Medusa
refs/heads/development
medusa/test/test_flux_balance.py
1
from cobra.test import create_test_model from medusa.core.ensemble import Ensemble from medusa.flux_analysis.flux_balance import optimize_ensemble def construct_textbook_ensemble(): # create two identical models and make an ensemble model1 = create_test_model("textbook") model1.remove_reactions(model1.re...
emonty/ansible
refs/heads/devel
docs/docsite/_extensions/pygments_lexer.py
36
# -*- coding: utf-8 -*- # pylint: disable=no-self-argument # # Copyright 2006-2017 by the Pygments team, see AUTHORS at # https://bitbucket.org/birkenfeld/pygments-main/raw/7941677dc77d4f2bf0bbd6140ade85a9454b8b80/AUTHORS # Copyright by Norman Richards (original author of JSON lexer). # # Licensed under BSD license: # ...
dimagol/trex-core
refs/heads/master
scripts/automation/regression/stateless_tests/stl_ipv6_test.py
1
#!/usr/bin/python from .stl_general_test import CStlGeneral_Test from trex_stl_lib.api import * class STLIPv6_Test(CStlGeneral_Test): """Tests for IPv6 scan6/ping_ip """ def setUp(self): CStlGeneral_Test.setUp(self) if self.is_vdev: self.skip("We don't know what to expect with vdev...
franciscoBarrientos/compuMovilInstag
refs/heads/master
plugins/ti.alloy/plugin.py
1729
import os, sys, subprocess, hashlib import subprocess def check_output(*popenargs, **kwargs): r"""Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. >>> check_output(['/usr/bin/python', '--version']) Python 2.6....