repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
tungvx/deploy
refs/heads/master
.google_appengine/lib/django_1_2/django/contrib/admindocs/utils.py
314
"Misc. utility functions/classes for admin documentation generator." import re from email.Parser import HeaderParser from email.Errors import HeaderParseError from django.utils.safestring import mark_safe from django.core.urlresolvers import reverse from django.utils.encoding import smart_str try: import docutils....
anryko/ansible
refs/heads/devel
lib/ansible/modules/packaging/os/homebrew.py
9
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Andrew Dunham <andrew@du.nham.ca> # (c) 2013, Daniel Jaouen <dcj24@cornell.edu> # (c) 2015, Indrajit Raychaudhuri <irc+code@indrajit.com> # # Based on macports (Jimmy Tang <jcftang@gmail.com>) # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org...
mhvk/astropy
refs/heads/placeholder
astropy/nddata/tests/test_ccddata.py
5
# Licensed under a 3-clause BSD style license - see LICENSE.rst import textwrap import numpy as np import pytest from astropy.io import fits from astropy.nddata.nduncertainty import ( StdDevUncertainty, MissingDataAssociationException, VarianceUncertainty, InverseVariance) from astropy import units as u from...
manisandro/QGIS
refs/heads/master
python/plugins/processing/algs/gdal/PointsAlongLines.py
5
# -*- coding: utf-8 -*- """ *************************************************************************** PointsAlongLines.py --------------------- Date : Janaury 2015 Copyright : (C) 2015 by Giovanni Manghi Email : giovanni dot manghi at naturalgis dot pt **...
xxxVxxx/troposphere
refs/heads/master
troposphere/elasticache.py
9
# Copyright (c) 2013, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, Ref, GetAtt from .validators import boolean, integer, network_port class CacheCluster(AWSObject): resource_type = "AWS::ElastiCache::CacheCluster" props = { 'AutoMin...
lmazuel/azure-sdk-for-python
refs/heads/master
azure-servicefabric/azure/servicefabric/models/monitoring_policy_description.py
1
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
vrenaville/ngo-addons-backport
refs/heads/master
addons/note/tests/test_note.py
427
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
am2012/android_kernel_motorola_msm8610
refs/heads/cm-12.0
scripts/tracing/draw_functrace.py
14679
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
levkar/odoo
refs/heads/10.0
addons/hr_maintenance/models/equipment.py
31
# -*- coding: utf-8 -*- from odoo import api, fields, models, tools class MaintenanceEquipment(models.Model): _inherit = 'maintenance.equipment' employee_id = fields.Many2one('hr.employee', string='Assigned to Employee', track_visibility='onchange') department_id = fields.Many2one('hr.department', strin...
kenygia/xy-vsfilter
refs/heads/master
src/thirdparty/gtest/test/gtest_env_var_test.py
2408
#!/usr/bin/env python # # Copyright 2008, 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...
40223108/w18
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/decimal.py
623
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz <aahz at pobox.com> # and Tim Peters # This module should be kept in sync with ...
madj4ck/ansible
refs/heads/devel
lib/ansible/playbook/vars_file.py
7690
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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 License, or # (at your option) an...
FHannes/intellij-community
refs/heads/master
python/helpers/python-skeletons/py/error.py
36
from errno import *
bolster/django-bloom
refs/heads/master
bloom/share/urls.py
4
# Share URLs for Bloom # # Kevin Tom # Copyright 2008 Handi Mobility # www.handimobility.ca from django.conf.urls.defaults import * urlpatterns = patterns('bloom.share.views', (r'^lookup/(?P<slug>[A-Za-z0-9]+)/$', 'lookup_view'), # (r'^email/$', 'share_by_email_view'), # (r'^sms/$', 'share_by_sms_view'), )
tuedtran/blox
refs/heads/dev
deploy/demo-cli/blox-create-deployment.py
1
#!/usr/bin/env python import json, os, sys import common def main(argv): # Command Line Arguments args = [{'arg':'--apigateway', 'dest':'apigateway', 'default':None, 'type':'boolean', 'help':'Call API Gateway endpoint'}] if '--apigateway' in argv: args.extend([{'arg':'--stack', 'dest':'stack', 'default':None, 'he...
ChenJunor/hue
refs/heads/master
desktop/core/src/desktop/settings.py
1
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
IlyaLab/CombiningDependentPvaluesUsingEBM
refs/heads/master
Python/PathwayParser.py
1
# -*- coding: utf-8 -*- """ Copyright 2015, Institute for Systems Biology. 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 ...
pridemusvaire/youtube-dl
refs/heads/master
youtube_dl/extractor/aol.py
145
from __future__ import unicode_literals import re from .common import InfoExtractor class AolIE(InfoExtractor): IE_NAME = 'on.aol.com' _VALID_URL = r'''(?x) (?: aol-video:| http://on\.aol\.com/ (?: video/.*-| playlist/(?P<playlist_d...
JakeLowey/HackRPI2
refs/heads/master
django/contrib/staticfiles/handlers.py
85
import urllib from urlparse import urlparse from django.conf import settings from django.core.handlers.wsgi import WSGIHandler from django.contrib.staticfiles import utils from django.contrib.staticfiles.views import serve class StaticFilesHandler(WSGIHandler): """ WSGI middleware that intercepts calls to th...
StefanRijnhart/odoomrp-wip
refs/heads/8.0
mrp_bom_component_change/__openerp__.py
2
# -*- encoding: utf-8 -*- ############################################################################## # # Daniel Campos (danielcampos@avanzosc.es) Date: 02/10/2014 # # 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...
ReganBell/QReview
refs/heads/master
build/lib/networkx/algorithms/cluster.py
29
# -*- coding: utf-8 -*- """Algorithms to characterize the number of triangles in a graph.""" from itertools import combinations import networkx as nx from networkx import NetworkXError __author__ = """\n""".join(['Aric Hagberg <aric.hagberg@gmail.com>', 'Dan Schult (dschult@colgate.edu)', ...
pizzapanther/Django-Pizza
refs/heads/master
pizza/calendar/migrations/0001_initial.py
1
# -*- 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 'Category' db.create_table(u'calendar_category', ( (u'id', self.gf('django.db.mod...
idea4bsd/idea4bsd
refs/heads/idea4bsd-master
python/testData/refactoring/rename/renameInheritors_after.py
83
class A: def qu(self): pass class B(A): def qu(self): pass
absoludity/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/html5lib/html5lib/__init__.py
426
""" HTML parsing library based on the WHATWG "HTML5" specification. The parser is designed to be compatible with existing HTML found in the wild and implements well-defined error recovery that is largely compatible with modern desktop web browsers. Example usage: import html5lib f = open("my_document.html") tree = ht...
FX31337/FX-BT-Scripts
refs/heads/master
bstruct.py
1
# -*- coding: utf-8 -*- import struct import datetime import binascii def get_fields_size(spec): # Prepend an endianness mark to prevent calcsize to insert padding bytes fmt_str = "=" + "".join(x[1] for x in spec) return struct.calcsize(fmt_str) class BStruct: def __init__(self, buf, offset=0): ...
inklesspen/endpoints-management-python
refs/heads/master
test/test_label_descriptor.py
3
# Copyright 2016 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 agree...
glorotxa/SME
refs/heads/master
FB15k_Tri.py
5
from FB15k_exp import * from FB15k_evaluation import * savepath='FB15k_Tri' datapath='data/' launch(op='Tri', ndim=50, marge=0.25, rhoL=5, lremb=0.01, nbatches=150, dataset='FB', totepochs=500, test_all=500, neval=1000, savepath=savepath, datapath=datapath) print "\n##### EVALUATION #####\n" MR, T10 = Ranking...
elancom/elasticsearch
refs/heads/master
dev-tools/create_bwc_index_with_some_ancient_segments.py
217
import create_bwc_index import logging import os import random import shutil import subprocess import sys import tempfile def fetch_version(version): logging.info('fetching ES version %s' % version) if subprocess.call([sys.executable, os.path.join(os.path.split(sys.argv[0])[0], 'get-bwc-version.py'), version]) != ...
CodeForPhilly/chime
refs/heads/dependabot/pip/urllib3-1.26.5
src/chime_dash/app/pages/sidebar.py
1
"""components/sidebar Initializes the side bar containing the various inputs for the model #! _SIDEBAR_ELEMENTS should be considered for moving else where """ from collections import OrderedDict from datetime import date, datetime from typing import List from dash.development.base_component import ComponentMeta from ...
msdgwzhy6/enjarify
refs/heads/master
enjarify/jvm/writeir.py
2
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
ytoyama/yans_chainer_hackathon
refs/heads/master
tests/cupy_tests/math_tests/test_misc.py
11
import unittest import numpy from cupy import testing @testing.gpu class TestMisc(unittest.TestCase): _multiprocess_can_split_ = True @testing.for_all_dtypes() @testing.numpy_cupy_allclose(atol=1e-5) def check_unary(self, name, xp, dtype, no_bool=False): if no_bool and numpy.dtype(dtype).c...
Piasy/proxy-searcher
refs/heads/master
site-packages/django/db/backends/oracle/creation.py
29
import sys import time from django.db.backends.creation import BaseDatabaseCreation TEST_DATABASE_PREFIX = 'test_' PASSWORD = 'Im_a_lumberjack' class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated Oracle column # types, as strings. Column-type strings can cont...
CCS-Lab/hBayesDM
refs/heads/master
Python/hbayesdm/models/_bandit4arm_lapse.py
1
from typing import Sequence, Union, Any from collections import OrderedDict from numpy import Inf, exp import pandas as pd from hbayesdm.base import TaskModel from hbayesdm.preprocess_funcs import bandit4arm_preprocess_func __all__ = ['bandit4arm_lapse'] class Bandit4ArmLapse(TaskModel): def __init__(self, **k...
dsajkl/123
refs/heads/master
common/djangoapps/cache_toolbox/relation.py
239
""" Caching instances via ``related_name`` -------------------------------------- ``cache_relation`` adds utility methods to a model to obtain ``related_name`` instances via the cache. Usage ~~~~~ :: from django.db import models from django.contrib.auth.models import User class Foo(models.Model): ...
angstwad/ansible
refs/heads/devel
test/units/plugins/test_plugins.py
104
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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 License, or # (at your option) an...
chagn/chagn.github.com
refs/heads/master
node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/styles/trac.py
364
# -*- coding: utf-8 -*- """ pygments.styles.trac ~~~~~~~~~~~~~~~~~~~~ Port of the default trac highlighter design. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, Na...
donovanmuller/FrameworkBenchmarks
refs/heads/master
frameworks/Python/AsyncIO/yocto_http/hello/servers/__init__.py
79
from . import yocto_http
h4ck3rm1k3/pywikibot-core
refs/heads/master
scripts/archive/featured.py
4
#!/usr/bin/python # -*- coding: utf-8 -*- """ Manage featured/good article/list status template. This script understands various command-line arguments: Task commands: -featured use this script for featured articles. Default task if no task command is specified -good use this ...
isandlaTech/cohorte-demos
refs/heads/dev
led/dump/led-demo-yun/cohorte/dist/cohorte-1.0.0-20141216.234517-57-python-distribution/repo/sleekxmpp/stanza/rootstanza.py
11
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2010 Nathanael C. Fritz This file is part of SleekXMPP. See the file LICENSE for copying permission. """ import logging from sleekxmpp.exceptions import XMPPError, IqError, IqTimeout from sleekxmpp.stanza import Error from sleekxmpp.xmlstream impor...
pavel-odintsov/shogun
refs/heads/develop
applications/easysvm/scripts/easysvm.py
31
#!/usr/bin/env python ############################################################################################# # # # This program is free software; you can redistribute it and/or modify # # it under t...
tunneln/CarnotKE
refs/heads/master
jyhton/lib-python/2.7/test/test_unittest.py
130
import unittest.test from test import test_support def test_main(): test_support.run_unittest(unittest.test.suite()) test_support.reap_children() if __name__ == "__main__": test_main()
CLVsol/odoo_addons
refs/heads/8.0
clv_address/seq/clv_address_seq.py
1
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
Yong-Lee/decode-Django
refs/heads/master
Django-1.5.1/tests/regressiontests/queries/tests.py
18
from __future__ import absolute_import,unicode_literals import datetime from operator import attrgetter import pickle import sys from django.conf import settings from django.core.exceptions import FieldError from django.db import DatabaseError, connection, connections, DEFAULT_DB_ALIAS from django.db.models import Co...
fegran/astrotools
refs/heads/master
select_var.py
1
from __future__ import division import matplotlib.pyplot as plt from astropy.io import ascii import numpy as np import warnings import sys import os if len(sys.argv) < 2: os.system('clear') print '\n' print 'How to run this script:\t python %s info_file.dat' %sys.argv[0] print 'Output of this script:\t...
souravbadami/zulip
refs/heads/master
zerver/migrations/0035_realm_message_retention_period_days.py
40
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('zerver', '0034_userprofile_enable_online_push_notifications'), ] operations = [ migrations.AddField( model_name=...
smarr/SOMns
refs/heads/release
docs/conf.py
2
from recommonmark.parser import CommonMarkParser source_parsers = { '.md': CommonMarkParser, } source_suffix = ['.md'] html_theme = 'sphinx_rtd_theme'
melon-li/openstack-dashboard
refs/heads/master
openstack_dashboard/dashboards/project/networks/subnets/workflows.py
19
# Copyright 2013 NEC Corporation # # 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 ag...
ettm2012/MissionPlanner
refs/heads/master
Lib/site-packages/numpy/core/tests/test_shape_base.py
54
from numpy.testing import * from numpy.core import array, atleast_1d, atleast_2d, atleast_3d, vstack, \ hstack, newaxis class TestAtleast1d(TestCase): def test_0D_array(self): a = array(1); b = array(2); res=map(atleast_1d,[a,b]) desired = [array([1]),array([2])] assert_arra...
wdzhou/mantid
refs/heads/master
Framework/PythonInterface/test/python/plugins/algorithms/CalculateSampleTransmissionTest.py
3
from __future__ import (absolute_import, division, print_function) import unittest import numpy as np from mantid.simpleapi import CalculateSampleTransmission class CalculateSampleTransmissionTest(unittest.TestCase): def test_sample_transmission_calculation(self): """ Test a basic transmission ca...
maartenq/ansible
refs/heads/devel
test/runner/lib/sanity/__init__.py
18
"""Execute Ansible sanity tests.""" from __future__ import absolute_import, print_function import abc import glob import json import os import re import sys from lib.util import ( ApplicationError, SubprocessError, display, run_command, import_plugins, load_plugins, parse_to_dict, ABC,...
egafford/sahara
refs/heads/master
sahara/plugins/spark/edp_engine.py
3
# Copyright (c) 2014 Mirantis Inc. # Copyright (c) 2015 ISPRAS # # 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...
syhost/android_kernel_pantech_ef51l
refs/heads/jb-org
scripts/gcc-wrapper.py
501
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, Code Aurora Forum. 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 a...
CMTaylor/robotframework-autoitlibrary
refs/heads/master
src/AutoItLibrary/Counter.py
3
""" Package: AutoItLibrary Module: Counter Purpose: Defines a Counter class from which other classes can inherit the ability to initialize a counter at class instantiation and get the next number in the sequence with a _next method. Copyright (c) 2009 Texas Instruments Licensed under the A...
patilsangram/erpnext
refs/heads/develop
erpnext/hooks.py
1
from __future__ import unicode_literals from frappe import _ app_name = "erpnext" app_title = "ERPNext" app_publisher = "Frappe Technologies Pvt. Ltd." app_description = """ERP made simple""" app_icon = "fa fa-th" app_color = "#e74c3c" app_email = "info@erpnext.com" app_license = "GNU General Public License (v3)" sour...
CSC301H-Fall2013/JuakStore
refs/heads/master
site-packages/tests/regressiontests/file_uploads/uploadhandler.py
151
""" Upload handlers to test the upload API. """ from django.core.files.uploadhandler import FileUploadHandler, StopUpload class QuotaUploadHandler(FileUploadHandler): """ This test upload handler terminates the connection if more than a quota (5MB) is uploaded. """ QUOTA = 5 * 2**20 # 5 MB ...
muffins-on-dope/bakery
refs/heads/master
bakery/auth/views.py
1
from django.core.urlresolvers import reverse from django.views.generic import TemplateView, RedirectView from django.contrib import auth from bakery.auth.models import BakeryUser class LoginErrorView(TemplateView): template_name = 'error.html' login_error = LoginErrorView.as_view() class LogoutView(RedirectVi...
Jgarcia-IAS/SAT
refs/heads/master
openerp/addons-extra/stock_foreign_trade/stock_foreign_trade.py
6
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014 Interconsulting S.A e Innovatecsa SAS. # (<http://www.interconsulting.com.co). # # This program is free software: you can redistribute it...
Novasoft-India/OperERP-AM-Motors
refs/heads/master
openerp/addons/account/res_config.py
7
# -*- 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 o...
bvermeer/WTH_Hackathon_Singapore_2017
refs/heads/master
Examples/PyGame_Examples/PyGame_Ball.py
1
#!/usr/bin/python2.7 ''' Description: This is a simple GUI app which creates a bouncing ball animation. Created: September 15, 2017 Author: Blake Vermeer ''' import sys, pygame, os os.putenv('DISPLAY', ':0') pygame.init() size = width, height = 320, 240 speed = [1, 1] black = 0, 0, 0 screen = pygame.display.set_...
mrnamingo/enigma2-test
refs/heads/master
lib/python/Screens/LanguageSelection.py
1
from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.ActionMap import ActionMap from Components.Language import language from Components.config import config from Components.Sources.List import List from Components.Label import Label from Components.Sources.StaticText import Stati...
ofgulban/scikit-image
refs/heads/ncut-rag-options
skimage/morphology/_skeletonize.py
28
""" Algorithms for computing the skeleton of a binary image """ import numpy as np from scipy import ndimage as ndi from ._skeletonize_cy import _fast_skeletonize, _skeletonize_loop, _table_lookup_index # --------- Skeletonization by morphological thinning --------- def skeletonize(image): """Return the skeleto...
openstack/nova
refs/heads/master
nova/tests/functional/db/test_security_group.py
9
# 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...
amitjamadagni/sympy
refs/heads/master
doc/ext/numpydoc.py
66
""" ======== numpydoc ======== Sphinx extension that handles docstrings in the Numpy standard format. [1] It will: - Convert Parameters etc. sections to field lists. - Convert See Also section to a See also entry. - Renumber references. - Extract the signature from the docstring, if it can't be determined otherwis...
earshel/PokeyPySnipe
refs/heads/master
POGOProtos/Networking/Requests/Messages/DownloadSettingsMessage_pb2.py
16
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Networking/Requests/Messages/DownloadSettingsMessage.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 _...
AdamIsrael/PerfKitBenchmarker
refs/heads/master
perfkitbenchmarker/linux_packages/zlib.py
6
# Copyright 2015 PerfKitBenchmarker 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 appli...
etuna-SBF-kog/Stadsparken
refs/heads/master
env/lib/python2.7/site-packages/django/db/models/fields/files.py
88
import datetime import os from django import forms from django.db.models.fields import Field from django.core.files.base import File from django.core.files.storage import default_storage from django.core.files.images import ImageFile from django.db.models import signals from django.utils.encoding import force_unicode,...
rec/DMXIS
refs/heads/master
Macros/Colours/Purple/Purple.py
1
#=============================================================== # DMXIS Macro (c) 2010 db audioware limited #=============================================================== RgbColour(128,0,128)
almeidapaulopt/erpnext
refs/heads/develop
erpnext/hr/doctype/leave_allocation/leave_allocation.py
33
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import flt, date_diff, formatdate from frappe import _ from frappe.model.document import Document from erpnext.hr.utils ...
jeffreyliu3230/osf.io
refs/heads/develop
scripts/tests/test_migrate_was_invited.py
62
# -*- coding: utf-8 -*- from nose.tools import * # noqa from tests.base import fake from tests.base import OsfTestCase from tests.factories import UserFactory from tests.factories import NodeFactory from tests.factories import UnconfirmedUserFactory from framework.auth.core import Auth from scripts.migrate_was_inv...
cstan11/Sick-Beard
refs/heads/torrent_1080_subtitles
sickbeard/webapi.py
2
# Author: Dennis Lutter <lad1337@gmail.com> # Author: Jonathon Saine <thezoggy@gmail.com> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Fr...
druids/django-chamber
refs/heads/master
chamber/shortcuts.py
1
from datetime import date, datetime, time from django.http.response import Http404 from django.shortcuts import _get_queryset from django.utils import timezone from django.core.exceptions import ValidationError def get_object_or_none(klass, *args, **kwargs): queryset = _get_queryset(klass) try: retur...
Denisolt/IEEE-NYIT-MA
refs/heads/master
local/lib/python2.7/site-packages/unidecode/x1d6.py
248
data = ( 's', # 0x00 't', # 0x01 'u', # 0x02 'v', # 0x03 'w', # 0x04 'x', # 0x05 'y', # 0x06 'z', # 0x07 'A', # 0x08 'B', # 0x09 'C', # 0x0a 'D', # 0x0b 'E', # 0x0c 'F', # 0x0d 'G', # 0x0e 'H', # 0x0f 'I', # 0x10 'J', # 0x11 'K', # 0x12 'L', # 0x13 'M', # 0...
Benniphx/server-tools
refs/heads/8.0
fetchmail_notify_error_to_sender/fetchmail.py
35
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 Lorenzo Battistini <lorenzo.battistini@agilebg.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Licens...
350dotorg/Django
refs/heads/master
tests/modeltests/m2m_signals/models.py
130
from django.db import models class Part(models.Model): name = models.CharField(max_length=20) class Meta: ordering = ('name',) def __unicode__(self): return self.name class Car(models.Model): name = models.CharField(max_length=20) default_parts = models.ManyToManyField(Part) ...
samabhi/pstHealth
refs/heads/master
venv/lib/python2.7/site-packages/PIL/ImageFile.py
15
# # The Python Imaging Library. # $Id$ # # base class for image file handlers # # history: # 1995-09-09 fl Created # 1996-03-11 fl Fixed load mechanism. # 1996-04-15 fl Added pcx/xbm decoders. # 1996-04-30 fl Added encoders. # 1996-12-14 fl Added load helpers # 1997-01-11 fl Use encode_to_file where possibl...
wiltonlazary/arangodb
refs/heads/devel
3rdParty/V8/V8-5.0.71.39/build/gyp/test/defines/gyptest-define-override.py
239
#!/usr/bin/env python # Copyright (c) 2009 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 a default gyp define can be overridden. """ import os import TestGyp test = TestGyp.TestGyp() # CMake loudly warns abou...
lhopps/grit-i18n
refs/heads/master
grit/format/data_pack_unittest.py
49
#!/usr/bin/env python # 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. '''Unit tests for grit.format.data_pack''' import os import sys if __name__ == '__main__': sys.path.append(os.path.join(os.path...
nashve/mythbox
refs/heads/master
resources/lib/twisted/twisted/trial/test/test_doctest.py
61
# Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Test twisted's doctest support. """ from twisted.trial import itrial, runner, unittest, reporter from twisted.trial.test import mockdoctest class TestRunners(unittest.TestCase): """ Tests for Twisted's doctest support. ...
mahendra-r/edx-platform
refs/heads/master
cms/djangoapps/contentstore/features/pages.py
66
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name # pylint: disable=unused-argument from lettuce import world, step from nose.tools import assert_equal, assert_in # pylint: disable=no-name-in-module CSS_FOR_TAB_ELEMENT = "li[data-tab-id='{0}'] input.toggle-checkbox" @step(u'I go to the pa...
MattsFleaMarket/python-for-android
refs/heads/master
python3-alpha/python3-src/android-scripts/pip_console.py
47
import os,os.path,sys,readline def modcmd(arg): os.system(sys.executable+" "+sys.prefix+"/bin/"+arg) if not(os.path.exists(sys.prefix+"/bin/pip")): print("You need to install pip first.") print("Input pip commands, ie: pip install {module}") while(True): cmd=input("-->") if (cmd==""): break; modcmd(cmd)
markand/duktape
refs/heads/master
tests/perf/test-base64-decode.py
4
import math import random def test(): tmp1 = [] tmp2 = [] print('build') for i in xrange(1024): tmp1.append('%x' % math.floor(random.random() * 16)) tmp1 = ''.join(tmp1) for i in xrange(1024): tmp2.append(tmp1) tmp2 = ''.join(tmp2) tmp2 = tmp2.encode('base64') prin...
ssanderson/numpy
refs/heads/master
numpy/lib/tests/test_shape_base.py
3
from __future__ import division, absolute_import, print_function import numpy as np from numpy.lib.shape_base import ( apply_along_axis, apply_over_axes, array_split, split, hsplit, dsplit, vsplit, dstack, column_stack, kron, tile ) from numpy.testing import ( run_module_suite, TestCase, assert_, asser...
hellofreedom/ansible-modules-core
refs/heads/devel
database/postgresql/postgresql_privs.py
144
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. #...
suvitorg/suvit-odoo
refs/heads/10.0
suvit_database_cleanup/wizards/__init__.py
1
from . import purge_fields from . import database_all_cleanup
vipins/ccccms
refs/heads/master
env/Lib/site-packages/easy_thumbnails/engine.py
4
import os try: from cStringIO import StringIO except ImportError: from StringIO import StringIO try: from PIL import Image except ImportError: import Image from easy_thumbnails import utils from easy_thumbnails.conf import settings def _use_default_options(options): if not settings.THUMBNAIL_DEF...
edx-solutions/edx-platform
refs/heads/master
common/djangoapps/third_party_auth/tests/test_settings.py
4
"""Unit tests for settings.py.""" import unittest from mock import patch from third_party_auth import provider, settings from third_party_auth.tests import testutil _ORIGINAL_AUTHENTICATION_BACKENDS = ['first_authentication_backend'] _ORIGINAL_INSTALLED_APPS = ['first_installed_app'] _ORIGINAL_MIDDLEWARE_CLASSES = ...
kcarnold/counterfactual-lm
refs/heads/master
code/simulation.py
1
import pickle import numpy as np from scipy.optimize import minimize import matplotlib.pyplot as plt import string import pandas as pd import seaborn as sns import tqdm from joblib import Memory import util import decoder from paths import paths from util import logsumexp from counterfactual import get_features, Objec...
davidyezsetz/kuma
refs/heads/master
vendor/packages/Babel/babel/messages/tests/data/project/file2.py
63
# -*- coding: utf-8 -*- # file2.py for tests from gettext import ngettext def foo(): # Note: This will have the TRANSLATOR: tag but shouldn't # be included on the extracted stuff print ngettext('foobar', 'foobars', 1)
Stryn/citationhunt
refs/heads/fin
chstrings/__init__.py
1
import flask import os import json def _link(url, title): return flask.Markup( '<a target="_blank" href=%s>%s</a>' % (url, title)) def _preprocess_variables(config, strings): strings['in_page'] = \ flask.Markup(strings['in_page']) % _link('%s', '%s') if config.lead_section_policy_link: ...
areski/django
refs/heads/master
django/contrib/staticfiles/apps.py
473
from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ class StaticFilesConfig(AppConfig): name = 'django.contrib.staticfiles' verbose_name = _("Static Files")
siosio/intellij-community
refs/heads/master
python/testData/inspections/PyUnresolvedReferencesInspection/comprehensionScope27.py
83
xs = [x for x in range(10)] x #pass
kohout/djangocms-getaweb-personlist
refs/heads/master
djangocms_personlist/cms_app.py
1
from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from django.utils.translation import ugettext_lazy as _ from .menu import TeamsMenu class TeamApp(CMSApp): name = _('Team Module') urls = ['djangocms_personlist.urls'] app_name = 'khw-team' menus = [TeamsMenu] apphook_pool.regi...
chyeh727/django
refs/heads/master
tests/template_tests/syntax_tests/test_list_index.py
521
from django.test import SimpleTestCase from ..utils import setup class ListIndexTests(SimpleTestCase): @setup({'list-index01': '{{ var.1 }}'}) def test_list_index01(self): """ List-index syntax allows a template to access a certain item of a subscriptable object. """ ...
MicroWorldwide/namebench
refs/heads/master
nb_third_party/dns/rdtypes/ANY/RP.py
248
# Copyright (C) 2003-2007, 2009, 2010 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 ...
elviejo79/scrum_developer
refs/heads/master
practicas/lettuce/myCalculatorApp/tests/features/steps.py
1
from lettuce import * from nose.tools import assert_equals from calculator import Calculator @step(u'Given: I am using the calculator') def i_am_using_the_calculator(step): print ('Attempting to use calculator...') world.calc = Calculator() #Scenario: Calculate 2 plus 2 on our calculator (verbose) @step('Gi...
nilmini20s/gem5-2016-08-13
refs/heads/master
src/mem/slicc/ast/OperatorExprAST.py
30
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
skoslowski/gnuradio
refs/heads/master
grc/core/blocks/dummy.py
1
# Copyright 2016 Free Software Foundation, Inc. # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later # from __future__ import absolute_import from . import Block, register_build_in from ._build import build_params @register_build_in class DummyBlock(Block): is_dummy_block = True ...
Edraak/edx-platform
refs/heads/master
common/test/acceptance/pages/lms/course_wiki.py
146
""" Wiki tab on courses """ from .course_page import CoursePage from ...pages.studio.utils import type_in_codemirror class CourseWikiPage(CoursePage): """ Course wiki navigation and objects. """ url_path = "wiki" def is_browser_on_page(self): """ Browser is on the wiki page if t...
bnaul/scikit-learn
refs/heads/master
sklearn/model_selection/_split.py
2
""" The :mod:`sklearn.model_selection._split` module includes classes and functions to split the data based on a preset strategy. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org>, # Olivier Grisel <olivier.grisel@ensta.org> # Ragha...
gcode-mirror/audacity
refs/heads/master
lib-src/lv2/sratom/waflib/Task.py
148
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,shutil,re,tempfile from waflib import Utils,Logs,Errors NOT_RUN=0 MISSING=1 CRASHED=2 EXCEPTION=3 SKIPPED=8 SUCCESS=9 ASK_LATER=-1 SKIP_ME=-2 RUN_ME=-3 COMPILE_TEMPL...