repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
markeldigital/design-system
refs/heads/master
vendor/ruby/2.0.0/gems/pygments.rb-0.6.3/vendor/pygments-main/tests/test_qbasiclexer.py
29
# -*- coding: utf-8 -*- """ Tests for QBasic ~~~~~~~~~~~~~~~~ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import glob import os import unittest from pygments.token import Token from pygments.lexers.qbasic import QBasicLexer class QBa...
skiselev/upm
refs/heads/master
examples/python/hm11.py
7
#!/usr/bin/python # Author: Zion Orent <zorent@ics.com> # Copyright (c) 2015 Intel Corporation. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limi...
gvb/odoo
refs/heads/8.0
openerp/addons/test_new_api/tests/test_related.py
247
# # test cases for related fields, etc. # import unittest from openerp.osv import fields from openerp.tests import common class TestRelatedField(common.TransactionCase): def setUp(self): super(TestRelatedField, self).setUp() self.partner = self.registry('res.partner') self.company = self....
mahak/ansible
refs/heads/devel
test/support/integration/plugins/modules/sefcontext.py
18
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Dag Wieers (@dagwieers) <dag@wieers.com> # 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_ve...
tempbottle/rethinkdb
refs/heads/next
external/v8_3.30.33.16/testing/gtest/test/gtest_list_tests_unittest.py
1898
#!/usr/bin/env python # # Copyright 2006, 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...
dancingdan/tensorflow
refs/heads/master
tensorflow/contrib/nearest_neighbor/python/kernel_tests/hyperplane_lsh_probes_test.py
25
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
intgr/django
refs/heads/master
django/contrib/auth/hashers.py
45
import base64 import binascii import functools import hashlib import importlib import warnings from collections import OrderedDict from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.signals import setting_changed from django.dispatch import receiver from django.ut...
frdb194/django
refs/heads/master
django/contrib/postgres/forms/ranges.py
393
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange from django import forms from django.core import exceptions from django.forms.widgets import MultiWidget from django.utils.translation import ugettext_lazy as _ __all__ = ['IntegerRangeField', 'FloatRangeField', 'DateTimeRangeField', 'DateRangeField...
wmvanvliet/mne-python
refs/heads/master
tutorials/source-modeling/plot_eeg_mri_coords.py
10
# -*- coding: utf-8 -*- """ .. _tut-eeg-mri-coords: EEG source localization given electrode locations on an MRI =========================================================== This tutorial explains how to compute the forward operator from EEG data when the electrodes are in MRI voxel coordinates. """ # Authors: Eric La...
pwoodworth/intellij-community
refs/heads/master
python/testData/mover/simple.py
83
a =<caret> 1 b = 2
joshzarrabi/e-mission-server
refs/heads/master
emission/analysis/modelling/tour_model/tour_model.py
2
# Our imports import emission.simulation.markov_model_counter as esmmc ## A File meant to represent tour models for individual users ## A tour model is a week of each users most popular travel destinations # Monday # >>> home_start_mon = Location("home", 0, 0) # >>> work_1_mon = Location("work_1", 8, 0) # >>> cof...
imrehg/physicspy
refs/heads/master
setup.py
1
#!/usr/bin/env python """Physicspy: physics calculations in Python """ DOCLINES = __doc__.split("\n") import os from distutils.core import setup # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly # update it when the contents of directories change. if os.path.exists('MANIFEST'): os.remove('MA...
GoogleCloudPlatform/training-data-analyst
refs/heads/master
courses/machine_learning/deepdive2/building_production_ml_systems/labs/taxifare/trainer/task.py
4
import argparse from trainer import model if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument( "--batch_size", help="Batch size for training steps", type=int, default=32 ) parser.add_argument( "--eval_data_path", help="GCS ...
alexanderturner/ansible
refs/heads/devel
lib/ansible/inventory/script.py
26
# (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...
lisongmin/pies
refs/heads/develop
pies/overrides.py
2
"""pies/overrides.py. Overrides Python syntax to conform to the Python3 version as much as possible using a '*' import Copyright (C) 2013 Timothy Edmund Crosley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal ...
impowski/servo
refs/heads/master
tests/wpt/css-tests/tools/html5lib/html5lib/filters/lint.py
979
from __future__ import absolute_import, division, unicode_literals from gettext import gettext _ = gettext from . import _base from ..constants import cdataElements, rcdataElements, voidElements from ..constants import spaceCharacters spaceCharacters = "".join(spaceCharacters) class LintError(Exception): pass ...
mbauskar/Das_frappe
refs/heads/develop
frappe/core/doctype/userrole/__init__.py
1829
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals
XeryusTC/rotd
refs/heads/master
recipes/migrations/0007_auto_20150904_1819.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('recipes', '0006_ingredient'), ] operations = [ migrations.AlterField( model_name='ingredient', name=...
chandlercr/aima-python
refs/heads/master
submissions/Kinley/drugs.py
15
''' Hello student. Thank you for downloading a CORGIS library. However, you do not need to open this library. Instead you should use the following: import drugs If you opened the file because you are curious how this library works, then well done! We hope that you find it a useful learning experience. However...
prvnkumar/powerline
refs/heads/develop
powerline/renderers/shell/zsh.py
38
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) from powerline.renderers.shell import ShellRenderer class ZshPromptRenderer(ShellRenderer): '''Powerline zsh prompt segment renderer.''' escape_hl_start = '%{' escape_hl_end = '%}' character_transl...
mattesno1/Sick-Beard
refs/heads/master
sickbeard/providers/nzbclub.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Nic Wolfe <nic@wolfeden.ca> # 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 # t...
kalahbrown/HueBigSQL
refs/heads/master
desktop/core/ext-py/cx_Oracle-5.1.2/test/TestEnv.py
34
"""Define test environment.""" import cx_Oracle import os import sys import unittest def GetValue(name, label): value = os.environ.get("CX_ORACLE_" + name) if value is None: value = raw_input(label + ": ") if hasattr(cx_Oracle, "UNICODE") or sys.version_info[0] >= 3: return value retur...
ernw/dizzy
refs/heads/master
dizzy/functions/length.py
1
# length.py # # Copyright 2017 Daniel Mende <mail@c0decafe.de> # # 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 ...
Eforcers/inbox-cleaner
refs/heads/master
src/lib/dateutil/rrule.py
254
""" Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net> This module offers extensions to the standard python 2.3+ datetime module. """ __author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>" __license__ = "PSF License" import itertools import datetime import calendar import thread import sys __all__ = ["...
Qgap/zulip
refs/heads/master
api/integrations/trac/zulip_trac_config.py
121
# -*- coding: utf-8 -*- # # Copyright © 2012 Zulip, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify,...
clouserw/zamboni
refs/heads/master
mkt/__init__.py
19
import threading from mkt.constants import (categories, comm, platforms, iarc_mappings, # noqa ratingsbodies) from mkt.constants.applications import * # noqa from mkt.constants.base import * # noqa from mkt.constants.payments import * # noqa from mkt.constants.platforms import * # noqa ...
Daniex/horizon
refs/heads/stable/kilo
openstack_dashboard/dashboards/settings/password/tests.py
26
# Copyright 2013 Centrin Data Systems Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
Jorge-Rodriguez/ansible
refs/heads/devel
test/integration/targets/module_utils/module_utils/a/b/c/d/e/f/g/h/__init__.py
298
data = 'abcdefgh'
harikrishnakanchi/jeeves
refs/heads/master
segregator/segregator.py
1
from core.strategies import strategies from grammifier.grammifier import Grammifier from strategist.strategist import Strategist from datetime import datetime from utils.say import say import nltk times = { "morning": xrange(0, 12), "afternoon": xrange(12, 16), "evening": xrange(16, 20), "night": xran...
ali-salman/Aspose.Slides-for-Java
refs/heads/master
Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FindShape.py
1
from asposeslides import Settings from com.aspose.slides import Presentation from com.aspose.slides import SaveFormat from com.aspose.slides import XpsOptions class FindShape: def __init__(self): dataDir = Settings.dataDir + 'WorkingWithShapes/FindShape/' # Create an i...
Drooids/erpnext
refs/heads/develop
erpnext/accounts/doctype/journal_entry/journal_entry.py
10
# 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 cstr, flt, fmt_money, formatdate, getdate, date_diff from frappe import msgprint, _, scrub from erpnext.setup.uti...
avsd/django-allauth
refs/heads/master
allauth/socialaccount/providers/foursquare/views.py
71
import requests from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, OAuth2LoginView, OAuth2CallbackView) from .provider import FoursquareProvider class FoursquareOAuth2Adapter(OAu...
itzzshirlayyy/Online_Ordering
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/compat.py
317
try: from urllib.parse import urljoin except ImportError: from urlparse import urljoin try: import cPickle as pickle except ImportError: import pickle from pip._vendor.requests.packages.urllib3.response import HTTPResponse from pip._vendor.requests.packages.urllib3.util import is_fp_closed
hohoins/ml
refs/heads/master
hunkim/ml_lab_05.py
1
# 참고자료 # 모두를 위한 머신러닝/딥러닝 강의 # 홍콩과기대 김성훈 # http://hunkim.github.io/ml import tensorflow as tf import numpy as np # Data xy = np.loadtxt('ml_lab_05.txt', unpack=True, dtype='float32') x_data = xy[0:-1] y_data = xy[-1] X = tf.placeholder(tf.float32) Y = tf.placeholder(tf.float32) # variable W = tf.Variable(tf.random_u...
rbaindourov/v8-inspector
refs/heads/master
Source/chrome/tools/telemetry/telemetry/story/__init__.py
5
# Copyright 2015 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. # TODO (aiolos): replace with user_story/__init__.py in subsequent cl.
apigee/henchman
refs/heads/master
modules/curl/curl/requests/requests/packages/chardet/compat.py
2942
######################## BEGIN LICENSE BLOCK ######################## # Contributor(s): # Ian Cordasco - port to Python # # This library 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 # versio...
junhuac/MQUIC
refs/heads/master
depot_tools/third_party/boto/cacerts/__init__.py
260
# Copyright 2010 Google Inc. # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merg...
vsoch/docfish
refs/heads/master
docfish/apps/main/urls/collaborate.py
1
''' Copyright (c) 2017 Vanessa Sochat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute...
SujaySKumar/django
refs/heads/master
tests/max_lengths/models.py
438
from django.db import models class PersonWithDefaultMaxLengths(models.Model): email = models.EmailField() vcard = models.FileField(upload_to='/tmp') homepage = models.URLField() avatar = models.FilePathField() class PersonWithCustomMaxLengths(models.Model): email = models.EmailField(max_length=2...
Qwaz/solved-hacking-problem
refs/heads/master
Codegate/2017 Quals/2d-life/solver.py
1
from base64 import b64decode, b64encode import urllib import os import sys import requests # Filters: ' _ in (( pro or and group # Columns: no, rank URL = 'http://110.10.212.147:24135/?p=secret_login' cookie = 'QUWBPscLRhg%3D%7CKTwXZ6BPHP%2FSLTJWZnvk3OScLSc5%2F29PdAaCwsI5DmssvUiJtPmnjPNJGRmvLRccEFf3UKu4bklun1%2BCG0M...
mattrobenolt/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. """ ...
zhuwenping/python-for-android
refs/heads/master
python3-alpha/python3-src/Tools/scripts/dutree.py
112
#! /usr/bin/env python3 # Format du output in a tree shape import os, sys, errno def main(): p = os.popen('du ' + ' '.join(sys.argv[1:]), 'r') total, d = None, {} for line in p.readlines(): i = 0 while line[i] in '0123456789': i = i+1 size = eval(line[:i]) while line[i] in ...
SickGear/SickGear
refs/heads/master
lib/enzyme/core.py
2
# -*- coding: utf-8 -*- # enzyme - Video metadata parser # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # Copyright 2003-2006 Thomas Schueppel <stain@acm.org> # Copyright 2003-2006 Dirk Meyer <dischi@freevo.org> # # This file is part of enzyme. # # enzyme is free software; you can redistribute it and/or mod...
hectord/lettuce
refs/heads/master
tests/integration/lib/Django-1.3/tests/regressiontests/urlpatterns_reverse/included_named_urls.py
55
from django.conf.urls.defaults import * from views import empty_view urlpatterns = patterns('', url(r'^$', empty_view, name="named-url3"), url(r'^extra/(?P<extra>\w+)/$', empty_view, name="named-url4"), url(r'^(?P<one>\d+)|(?P<two>\d+)/$', empty_view), (r'^included/', include('regressiontests.urlpatter...
grilo/ansible-1
refs/heads/devel
lib/ansible/modules/cloud/amazon/rds.py
5
#!/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 distributed...
bd339/servo
refs/heads/master
tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/text-decor-3/support/generate-text-emphasis-line-height-tests.py
829
#!/usr/bin/env python # - * - coding: UTF-8 - * - """ This script generates tests text-emphasis-line-height-001 ~ 004 except 001z. They test the line height expansion in different directions. This script outputs a list of all tests it generated in the format of Mozilla reftest.list to the stdout. """ from __future__ ...
jjas0nn/solvem
refs/heads/master
tensorflow/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py
422
#------------------------------------------------------------------- # tarfile.py #------------------------------------------------------------------- # Copyright (C) 2002 Lars Gustaebel <lars@gustaebel.de> # All rights reserved. # # Permission is hereby granted, free of charge, to any person # obtaining a copy ...
frankvdp/django
refs/heads/master
django/contrib/sessions/management/commands/clearsessions.py
729
from importlib import import_module from django.conf import settings from django.core.management.base import BaseCommand class Command(BaseCommand): help = ( "Can be run as a cronjob or directly to clean out expired sessions " "(only with the database backend at the moment)." ) def handl...
d-plaindoux/fluent-rest
refs/heads/master
fluent_rest/spec/__init__.py
1
# Copyright (C)2016 D. Plaindoux. # # This program 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 2, or (at your option) any # later version. from fluent_rest.spec.rest import *
googleapis/python-workflows
refs/heads/master
google/cloud/workflows_v1/services/workflows/async_client.py
1
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
ybroze/trading-with-python
refs/heads/master
nautilus/nautilus.py
77
''' Created on 26 dec. 2011 Copyright: Jev Kuznetsov License: BSD ''' from PyQt4.QtCore import * from PyQt4.QtGui import * from ib.ext.Contract import Contract from ib.opt import ibConnection from ib.ext.Order import Order import tradingWithPython.lib.logger as logger from tradingWithPython.lib.eve...
CamDavidsonPilon/lifelines
refs/heads/master
lifelines/fitters/log_normal_fitter.py
1
# -*- coding: utf-8 -*- from scipy.special import erfinv import autograd.numpy as np from autograd.scipy.stats import norm from lifelines.fitters import KnownModelParametricUnivariateFitter from lifelines.utils import CensoringType class LogNormalFitter(KnownModelParametricUnivariateFitter): r""" This class ...
BridgeCityBicycleCoop/workstand
refs/heads/master
core/migrations/0002_auto_20170101_2054.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2017-01-01 20:54 from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('core', '0001_initial'), ] operations = [ migrat...
flisoldf/flisol-inscricoes
refs/heads/master
controllers/atividades.py
1
# -*- coding: utf-8 -*- @auth.requires_membership('Palestrante') def index(): """ Exibe a lista de atividades submetidas """ # Se não houver argumentos na URL, redireciona para a página inicial # O objetivo dessa verificação é não permitir que um palestrante visualize atividades de outro if no...
harmy/kbengine
refs/heads/master
kbe/src/lib/python/Lib/test/test_codecmaps_jp.py
57
#!/usr/bin/env python3 # # test_codecmaps_jp.py # Codec mapping tests for Japanese encodings # from test import support from test import test_multibytecodec_support import unittest class TestCP932Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'cp932' mapf...
Team-Blackout/mecha-3.0.xx
refs/heads/master
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 ...
wqshi/test
refs/heads/master
scipy_central/tagging/admin.py
5
from django.contrib import admin from models import Tag class TagAdmin(admin.ModelAdmin): list_display = ('slug', 'name', 'tag_type', 'description', 'id') list_display_links = ('slug',) list_per_page = 1000 ordering = ('slug',) admin.site.register(Tag, TagAdmin)
MER-GROUP/intellij-community
refs/heads/master
python/lib/Lib/hashlib.py
82
# $Id: hashlib.py 66095 2008-08-31 16:36:21Z gregory.p.smith $ # # Copyright (C) 2005 Gregory P. Smith (greg@electricrain.com) # Licensed to PSF under a Contributor Agreement. # __doc__ = """hashlib module - A common interface to many hash functions. new(name, string='') - returns a new hash object implementing t...
PetePriority/home-assistant
refs/heads/dev
homeassistant/helpers/icon.py
19
"""Icon helper methods.""" from typing import Optional def icon_for_battery_level(battery_level: Optional[int] = None, charging: bool = False) -> str: """Return a battery icon valid identifier.""" icon = 'mdi:battery' if battery_level is None: return icon + '-unknown' ...
upadhyay-prashant/puppet-rjil
refs/heads/master
files/tests/ceph_health.py
31
#!/usr/bin/env python # # Copyright (c) 2013 SWITCH http://www.switch.ch # # 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 re...
Voltir/django-guardian
refs/heads/master
docs/exts.py
109
def setup(app): app.add_crossref_type( directivename = "admin", rolename = "admin", indextemplate = "pair: %s; admin", ) app.add_crossref_type( directivename = "command", rolename = "command", indextemplate = "pair: %s; command", ) app.add_c...
aio-libs/aiohttp_session
refs/heads/master
setup.py
1
from setuptools import setup import os import re with open(os.path.join(os.path.abspath(os.path.dirname( __file__)), 'aiohttp_session', '__init__.py'), 'r', encoding='latin1') as fp: try: version = re.findall(r"^__version__ = '([^']+)'$", fp.read(), re.M)[0] except IndexError: raise Ru...
IllusionRom-deprecated/android_platform_tools_idea
refs/heads/master
python/testData/inspections/PyTypeCheckerInspection/RightOperators.py
53
class C(object): pass def test_right_operators(): o = C() xs = [ <warning descr="Expected type 'Integral', got 'C' instead">o</warning> * [], ]
PeterWangIntel/chromium-crosswalk
refs/heads/master
build/android/pylib/utils/device_temp_file_test.py
51
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the contents of device_temp_file.py. """ import logging import os import sys import unittest from pylib import con...
nvoron23/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/tests/admin_scripts/custom_templates/project_template/additional_dir/extra.py
701
# this file uses the {{ extra }} variable
BackupTheBerlios/espressopp
refs/heads/master
contrib/mpi4py/mpi4py-1.3/demo/reductions/reductions.py
3
from mpi4py import MPI class Intracomm(MPI.Intracomm): """ Intracommunicator class with scalable, point-to-point based implementations of global reduction operations. """ def __new__(cls, comm=None): return super(Intracomm, cls).__new__(cls, comm) def reduce(self, sendobj=None, recvob...
elky/django
refs/heads/master
tests/gis_tests/test_fields.py
36
import copy from django.contrib.gis.db.models.sql import AreaField, DistanceField from django.test import SimpleTestCase class FieldsTests(SimpleTestCase): def test_area_field_deepcopy(self): field = AreaField(None) self.assertEqual(copy.deepcopy(field), field) def test_distance_field_deepc...
detiber/ansible
refs/heads/devel
lib/ansible/modules/cloud/centurylink/clc_publicip.py
70
#!/usr/bin/python # # Copyright (c) 2015 CenturyLink # # 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 la...
coolbombom/CouchPotato
refs/heads/master
library/hachoir_parser/video/mpeg_video.py
86
""" Moving Picture Experts Group (MPEG) video version 1 and 2 parser. Information: - http://www.mpucoder.com/DVD/ - http://dvd.sourceforge.net/dvdinfo/ - http://www.mit.jyu.fi/mweber/leffakone/software/parsempegts/ - http://homepage.mac.com/rnc/EditMpegHeaderIFO.html - http://standards.iso.org/ittf/PubliclyAvailableSt...
hackerbot/DjangoDev
refs/heads/master
django/core/handlers/wsgi.py
339
from __future__ import unicode_literals import cgi import codecs import logging import sys from io import BytesIO from threading import Lock from django import http from django.conf import settings from django.core import signals from django.core.handlers import base from django.core.urlresolvers import set_script_pr...
Carreau/pip
refs/heads/develop
tests/data/src/compilewheel/setup.py
54
#!/usr/bin/env python from setuptools import setup, find_packages setup(name='compilewheel', version='1.0', packages=find_packages() )
NoahFlowa/CTC_Projects
refs/heads/master
Osterhout_Python/Osterhout_OairedActivities.py
1
# Programmer: Noah Osterhout # Date: October 11th 2016 1:01PM EST # Project: Osterhout_OairedActivities.py # Activities 1 steve_jobs = "If today were the last day of my life, would I want to do what I\'m about to do today. And whenever that answer has been 'no' for too many days in a row, I know I need to chan...
NoYouShutup/CryptMeme
refs/heads/master
CryptMeme/apps/sam/Demos/rawTests/samIn.py
1
#!/usr/bin/python # create a SAM datagram session that writes incoming messages on its master session stream # and a listen forever # usage : ./samIn.py [session name] import socket import sys if len(sys.argv)==2 : name = sys.argv[1] else : name = "rawSamIn" sess = socket.socket( socket.AF_INET, socket.SOCK...
PeterWangIntel/blink-crosswalk
refs/heads/master
Tools/Scripts/webkitpy/common/net/layouttestresults_unittest.py
37
# Copyright (c) 2010, Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the...
jcsp/manila
refs/heads/master
manila/tests/share/drivers/test_generic.py
2
# Copyright (c) 2014 NetApp, Inc. # Copyright (c) 2015 Mirantis, 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/license...
gangadhar-kadam/mtn-erpnext
refs/heads/master
website/doctype/top_bar_item/top_bar_item.py
483
# ERPNext - web based ERP (http://erpnext.com) # Copyright (C) 2012 Web Notes Technologies Pvt Ltd # # 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 yo...
Pluto-tv/chromium-crosswalk
refs/heads/master
tools/perf/core/project_config.py
2
# Copyright (c) 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys sys.path.append(os.path.join( os.path.dirname(__file__), os.pardir, os.pardir, 'telemetry')) from telemetry import benchmark_ru...
GhostThrone/django
refs/heads/master
django/contrib/sessions/backends/base.py
298
from __future__ import unicode_literals import base64 import logging import string from datetime import datetime, timedelta from django.conf import settings from django.contrib.sessions.exceptions import SuspiciousSession from django.core.exceptions import SuspiciousOperation from django.utils import timezone from dj...
jonkrohn/study-group
refs/heads/master
neural-networks-and-deep-learning/fig/misleading_gradient_contours.py
4
""" misleading_gradient_contours ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Plots the contours of the function from misleading_gradient.py""" #### Libraries # Third party libraries import matplotlib.pyplot as plt import numpy X = numpy.arange(-1, 1, 0.02) Y = numpy.arange(-1, 1, 0.02) X, Y = numpy.meshgrid(X, Y) Z =...
Gaia3D/QGIS
refs/heads/master
python/plugins/processing/algs/lidar/lastools/lasoverlap.py
9
# -*- coding: utf-8 -*- """ *************************************************************************** lasoverlap.py --------------------- Date : September 2013 Copyright : (C) 2013 by Martin Isenburg Email : martin near rapidlasso point com **************...
kdaily/cloudbiolinux
refs/heads/master
cloudbio/utils.py
10
"""Utilities for logging and progress tracking. """ import logging import os import sys from fabric.main import load_settings from fabric.colors import yellow, red, green, magenta from fabric.api import settings, hide, cd, run from fabric.contrib.files import exists from cloudbio.distribution import _setup_distributi...
ionelmc/django-admin-customizer
refs/heads/master
tests/test_app/models.py
1
from django import VERSION from admin_customizer.fields import OrderPreservingManyToManyField from django.db import models class Author(models.Model): name = models.CharField(max_length=100) class Book(models.Model): name = models.CharField(max_length=100) created = models.DateTimeField(auto_now_add=True)...
klim-iv/phantomjs-qt5
refs/heads/qt5
src/breakpad/src/tools/gyp/pylib/gyp/common.py
137
#!/usr/bin/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. import errno import filecmp import os.path import re import tempfile import sys def ExceptionAppend(e, msg): """Append a message to the given...
MartinThoma/algorithms
refs/heads/master
sorting/dask-sort.py
1
import dask import dask.dataframe as dd input_file = "numbers-large.txt" output_file = "numbers-large-sorted-dask.txt" blocksize = 1_000_000 print("Create ddf") ddf = dd.read_csv(input_file, header=None, blocksize=blocksize) print("Sort") ddf_sorted = ddf.set_index(0) print("Write") fut = ddf_sorted.to_csv(output_f...
googleinterns/power-data-graphing-intern-2020
refs/heads/master
backend/level_slice_test.py
1
# Copyright 2020 Google LLC # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
happyleavesaoc/home-assistant
refs/heads/dev
homeassistant/components/binary_sensor/ffmpeg_motion.py
10
""" Provides a binary sensor which is a collection of ffmpeg tools. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/binary_sensor.ffmpeg_motion/ """ import asyncio import logging import voluptuous as vol from homeassistant.core import callback import ho...
flashycud/timestack
refs/heads/master
django/conf/project_template/settings.py
5
# Django settings for {{ project_name }} project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. ...
MjAbuz/watchdog
refs/heads/master
vendor/webpy/test/application.py
3
import webtest import time import web import urllib data = """ import web urls = ("/", "%(classname)s") app = web.application(urls, globals(), autoreload=True) class %(classname)s: def GET(self): return "%(output)s" """ urls = ( "/iter", "do_iter", ) app = web.application(urls, globals()) class d...
narken/p2pool-altcoins
refs/heads/master
p2pool/test/util/test_expiring_dict.py
287
from twisted.internet import defer from twisted.trial import unittest from p2pool.util import deferral, expiring_dict class Test(unittest.TestCase): @defer.inlineCallbacks def test_expiring_dict1(self): e = expiring_dict.ExpiringDict(3, get_touches=True) e[1] = 2 yield deferral.sleep(1...
yebrahim/pydatalab
refs/heads/master
datalab/stackdriver/monitoring/_resource.py
5
# 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 agreed...
devendermishrajio/MITx-Foundations-of-Computer-Science
refs/heads/master
6.00.1x.Introduction-to-Computer-Science-and-Programming-Using-Python/Lecture Code/lectureCode_lec3.3.3.py
2
# lecture 3.3, slide 3 # Find the cube root of a perfect cube x = int(raw_input('Enter an integer: ')) for ans in range(0, abs(x)+1): if ans**3 == abs(x): break if ans**3 != abs(x): print(str(x) + ' is not a perfect cube') else: if x < 0: ans = -ans print('Cube root of ' + str(x) + ' is...
jeffery-do/Vizdoombot
refs/heads/master
doom/lib/python3.5/site-packages/scipy/linalg/tests/test_matfuncs.py
24
#!/usr/bin/env python # # Created by: Pearu Peterson, March 2002 # """ Test functions for linalg.matfuncs module """ from __future__ import division, print_function, absolute_import import random import warnings import functools import numpy as np from numpy import array, matrix, identity, dot, sqrt, double from num...
liangz0707/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) ...
WhySoGeeky/DroidPot
refs/heads/master
venv/lib/python2.7/site-packages/django/core/mail/backends/smtp.py
477
"""SMTP email backend class.""" import smtplib import ssl import threading from django.conf import settings from django.core.mail.backends.base import BaseEmailBackend from django.core.mail.message import sanitize_address from django.core.mail.utils import DNS_NAME class EmailBackend(BaseEmailBackend): """ A...
lumig242/Hue-Integration-with-CDAP
refs/heads/pull3
desktop/libs/liboauth/src/liboauth/conf.py
35
#!/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...
yanchen036/tensorflow
refs/heads/master
tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py
26
# 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...
rapidsms/rapidsms-legacy
refs/heads/master
apps/bednets/tests.py
4
from rapidsms.tests.scripted import TestScript from form.models import * from reporters.models import * import reporters.app as reporter_app import supply.app as supply_app import form.app as form_app import default.app as default_app from app import App from django.core.management.commands.dumpdata import Command impo...
PeterWangIntel/chromium-crosswalk
refs/heads/master
third_party/cython/src/Cython/Compiler/Tests/TestTreeFragment.py
131
from Cython.TestUtils import CythonTest from Cython.Compiler.TreeFragment import * from Cython.Compiler.Nodes import * from Cython.Compiler.UtilNodes import * import Cython.Compiler.Naming as Naming class TestTreeFragments(CythonTest): def test_basic(self): F = self.fragment(u"x = 4") T = F.copy()...
dhocker/ahps_web
refs/heads/master
ahps_web/views/view_exception.py
1
# # AHPS Web - web server for managing an AtHomePowerlineServer instance # Copyright (C) 2014, 2015 Dave Hocker (email: AtHomeX10@gmail.com) # # 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, ve...
Mariaanisimova/pythonintask
refs/heads/master
BITs/2014/Abdrahmanova_G_I/task_9_1.py
1
#Задача 9. Вариант 1. #Создайте игру, в которой компьютер выбирает какое-либо слово, а игрок должен его отгадать. Компьютер сообщает игроку, сколько букв в слове, и дает пять попыток узнать, есть ли какая-либо буква в слове, причем программа может отвечать только "Да" и "Нет". Вслед за тем игрок должен попробовать отга...