repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
llvm-mirror/llvm
refs/heads/master
utils/lit/lit/display.py
5
import sys import lit.ProgressBar def create_display(opts, tests, total_tests, workers): if opts.quiet: return NopProgressDisplay() of_total = (' of %d' % total_tests) if (tests != total_tests) else '' header = '-- Testing: %d%s tests, %d workers --' % (tests, of_total, workers) progress_bar...
isenseDev/Teaching
refs/heads/master
ExampleCode/Python/OldReferenceCode/GET/Get_ProjFields.py
2
""" This script will be a test of getting a project's fields """ import requests, json, sys # This function will loop until the user tells it to quit. def loop_user(): print "***************************" print "* GET FIELDS Script *" print "***************************" # Get a project I...
rayjim/hadoop_design_pattern
refs/heads/master
contrib/hod/hodlib/__init__.py
364
#Licensed to the Apache Software Foundation (ASF) under one #or more contributor license agreements. See the NOTICE file #distributed with this work for additional information #regarding copyright ownership. The ASF licenses this file #to you under the Apache License, Version 2.0 (the #"License"); you may not use thi...
idem2lyon/persomov
refs/heads/master
libs/pyutil/scripts/passphrase.py
92
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse, math, random from pyutil.mathutil import div_ceil from pkg_resources import resource_stream def recursive_subset_sum(entropy_needed, wordlists): # Pick a minimalish set of numbers which sum to at least # entropy_needed. # Okay now what's th...
ncleaton/indumpco
refs/heads/master
tests/tutil.py
1
import tempfile, shutil, os, sys from nose.tools import assert_equals import indumpco class IndumpcoUnderTest(object): def __init__(self, input_data, reuse_dumpdirs=[], remote_segs=None): self.basedir = tempfile.mkdtemp() self.tmpdir = os.path.join(self.basedir, 'tmp') os.mkdir(self.tmpdir...
cheerss/Fast-Style-Combination
refs/heads/master
vgg.py
3
# Copyright (c) 2015-2017 Anish Athalye. Released under GPLv3. import tensorflow as tf import numpy as np import scipy.io VGG19_LAYERS = ( 'conv1_1', 'relu1_1', 'conv1_2', 'relu1_2', 'pool1', 'conv2_1', 'relu2_1', 'conv2_2', 'relu2_2', 'pool2', 'conv3_1', 'relu3_1', 'conv3_2', 'relu3_2', 'conv3_3', ...
UDOOboard/Arduino
refs/heads/udoo-1.5.8
app/src/processing/app/i18n/python/requests/packages/charade/langthaimodel.py
206
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 Ri...
blairconrad/LibraryHippo
refs/heads/master
App/utils/soup.py
2
#!/usr/bin/env python from BeautifulSoup import Comment def remove_comments(element): comments = element.findAll(text=lambda text: isinstance(text, Comment)) [comment.extract() for comment in comments] def text(element): if isinstance(element, unicode): return element.strip() return [e.stri...
bufferapp/buffer-django-nonrel
refs/heads/master
django/contrib/flatpages/templatetags/flatpages.py
246
from django import template from django.conf import settings from django.contrib.flatpages.models import FlatPage register = template.Library() class FlatpageNode(template.Node): def __init__(self, context_name, starts_with=None, user=None): self.context_name = context_name if starts_with: ...
prakritish/ansible
refs/heads/devel
lib/ansible/utils/__init__.py
2520
# (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...
texastribune/newsapps-django-template
refs/heads/master
project_name/project_name/settings/local.py
1
################## # LOCAL SETTINGS # ################## import os import dj_database_url from .base import * ####################### # DEBUG CONFIGURATION # ####################### # https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#debug DEBUG = True # https://docs.djangoproject.com/en/{{ docs...
leansoft/edx-platform
refs/heads/master
cms/djangoapps/contentstore/views/tests/test_credit_eligibility.py
121
""" Unit tests for credit eligibility UI in Studio. """ import mock from contentstore.tests.utils import CourseTestCase from contentstore.utils import reverse_course_url from xmodule.modulestore.tests.factories import CourseFactory from openedx.core.djangoapps.credit.api import get_credit_requirements from openedx.c...
eahneahn/free
refs/heads/master
lib/python2.7/site-packages/pygments/lexers/_mapping.py
68
# -*- coding: utf-8 -*- """ pygments.lexers._mapping ~~~~~~~~~~~~~~~~~~~~~~~~ Lexer mapping defintions. This file is generated by itself. Everytime you change something on a builtin lexer defintion, run this script from the lexers folder to update it. Do not alter the LEXERS dictionary by hand...
hujiajie/chromium-crosswalk
refs/heads/master
net/data/verify_certificate_chain_unittest/generate-intermediary-lacks-signing-key-usage.py
16
#!/usr/bin/python # 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. """Certificate chain with 1 intermediary and a trusted root. The intermediary contains a keyUsage extension, HOWEVER it does not contai...
silenceli/nova
refs/heads/master
nova/tests/unit/api/openstack/compute/contrib/test_block_device_mapping_v1.py
2
# Copyright (c) 2014 IBM Corp. # 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...
xijunlee/leetcode
refs/heads/master
462.py
1
#!/usr/bin/env python # coding=utf-8 class Solution(object): def minMoves2(self, nums): """ :type nums: List[int] :rtype: int """ nums.sort() ret = 0 mid = len(nums)/2 for i in range(len(nums)): ret += abs(nums[i] - nums[mid]) retu...
bdh1011/cupeye
refs/heads/master
venv/lib/python2.7/site-packages/passlib/handlers/windows.py
21
"""passlib.handlers.nthash - Microsoft Windows -related hashes""" #============================================================================= # imports #============================================================================= # core from binascii import hexlify import re import logging; log = logging.getLogger(...
shiblon/pytour
refs/heads/master
static/js/pypyjs/pypy-nojit.js-0.3.1/lib/modules/logging/config.py
8
# Copyright 2001-2014 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
mapnik/python-mapnik
refs/heads/master
test/python_tests/mapnik_logger_test.py
5
#!/usr/bin/env python from nose.tools import eq_ import mapnik from .utilities import run_all def test_logger_init(): eq_(mapnik.severity_type.Debug, 0) eq_(mapnik.severity_type.Warn, 1) eq_(mapnik.severity_type.Error, 2) eq_(getattr(mapnik.severity_type, "None"), 3) default = mapnik.logger.get_...
naritta/numpy
refs/heads/master
numpy/polynomial/tests/test_polynomial.py
123
"""Tests for polynomial module. """ from __future__ import division, absolute_import, print_function import numpy as np import numpy.polynomial.polynomial as poly from numpy.testing import ( TestCase, assert_almost_equal, assert_raises, assert_equal, assert_, run_module_suite) def trim(x): return poly.p...
cytec/Sick-Beard
refs/heads/master
lib/sqlalchemy/dialects/mysql/pyodbc.py
17
# mysql/pyodbc.py # Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Support for the MySQL database via the pyodbc adapter. pyodbc is available at: ...
Make-O-Matic/MOM-Platform
refs/heads/master
platform/views/errors.py
1
# Copyright (c) 2016-2017 Enproduktion GmbH & Laber's Lab e.U. (FN 394440i, Austria) # 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 rig...
juharris/tensorflow
refs/heads/master
tensorflow/contrib/distributions/python/ops/operator_test_util.py
10
# 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...
Tinche/cattrs
refs/heads/master
src/cattr/preconf/pyyaml.py
1
"""Preconfigured converters for pyyaml.""" from datetime import datetime from .._compat import FrozenSetSubscriptable from ..converters import GenConverter from . import validate_datetime def configure_converter(converter: GenConverter): """ Configure the converter for use with the pyyaml library. * fro...
person142/scipy
refs/heads/master
scipy/signal/tests/test_signaltools.py
1
# -*- coding: utf-8 -*- import sys from decimal import Decimal from itertools import product from math import gcd import warnings import pytest from pytest import raises as assert_raises from numpy.testing import ( assert_equal, assert_almost_equal, assert_array_equal, assert_array_almost_equal, assert_al...
ZeusbaseWeb/zeusbasePHP
refs/heads/master
frameworks/PHPWord-0.12.0/docs/conf.py
33
# -*- coding: utf-8 -*- # # PhpWord documentation build configuration file, created by # sphinx-quickstart on Fri Mar 14 23:09:26 2014. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
stopstalk/stopstalk-deployment
refs/heads/master
private/scripts/todays_contest_logs.py
1
""" Copyright (c) 2015-2020 Raj Patel(raj454raj@gmail.com), StopStalk 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 ...
bugaevc/thefuck
refs/heads/master
tests/rules/test_python_execute.py
17
import pytest from thefuck.rules.python_execute import match, get_new_command from tests.utils import Command @pytest.mark.parametrize('command', [ Command(script='python foo'), Command(script='python bar')]) def test_match(command): assert match(command, None) @pytest.mark.parametrize('command, new_com...
houzhenggang/hiwifi-openwrt-HC5661-HC5761
refs/heads/master
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/lib2to3/pgen2/token.py
353
#! /usr/bin/env python """Token constants (from "token.h").""" # Taken from Python (r53757) and modified to include some tokens # originally monkeypatched in by pgen2.tokenize #--start constants-- ENDMARKER = 0 NAME = 1 NUMBER = 2 STRING = 3 NEWLINE = 4 INDENT = 5 DEDENT = 6 LPAR = 7 RPAR = 8 LSQB = 9 RSQB = 10 C...
kundancool/android_kernel_xiaomi_msm8974
refs/heads/cm-13.0
tools/perf/scripts/python/sctop.py
11180
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
alaski/nova
refs/heads/master
nova/conf/network.py
1
# needs:fix_opt_description # needs:check_deprecation_status # needs:check_opt_group_and_type # needs:fix_opt_description_indentation # needs:fix_opt_registration_consistency # Copyright 2016 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # ...
ryano144/intellij-community
refs/heads/master
python/testData/refactoring/extractsuperclass/moveExtendsCheckReference/source_module.after.py
320
from dest_module import NewParent class MyClass(NewParent): pass
aptrishu/coala
refs/heads/master
coalib/settings/FunctionMetadata.py
27
from collections import OrderedDict from copy import copy from inspect import getfullargspec, ismethod from coala_utils.decorators import enforce_signature from coalib.settings.DocstringMetadata import DocstringMetadata class FunctionMetadata: str_nodesc = 'No description given.' str_optional = "Optional, de...
vrenaville/ngo-addons-backport
refs/heads/master
addons/mail/wizard/__init__.py
438
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
ramdesh/vesuvius_installer
refs/heads/master
tools/pfmon/pfparse.py
10
# pfparse.py # Author: Owen Royall-Kahin (oroyallkahin@gmail.com) # Reads off of a person finder feed, saves the data into a database, # and sends out an email if any new items are added to the feed. ####### Imports ####### import sys, re, shutil, smtplib, urllib, datetime import elementtree.ElementTree as ET from e...
malishevg/edugraph
refs/heads/master
cms/djangoapps/contentstore/features/signup.py
46
# pylint: disable=C0111 # pylint: disable=W0621 from lettuce import world, step @step('I fill in the registration form$') def i_fill_in_the_registration_form(step): def fill_in_reg_form(): register_form = world.css_find('form#register_form') register_form.find_by_name('email').fill('robot+studio@...
unioslo/cerebrum
refs/heads/master
Cerebrum/modules/no/uit/Constants.py
1
# -*- coding: utf-8 -*- # Copyright 2002-2019 University of Oslo, Norway # # This file is part of Cerebrum. # # Cerebrum is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (a...
django-json-api/rest_framework_ember
refs/heads/master
docs/conf.py
2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Django REST Framework JSON API documentation build configuration file, created by # sphinx-quickstart on Fri Jul 24 23:31:15 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values a...
hyrole/scrapy
refs/heads/master
scrapy/contrib/downloadermiddleware/httpcompression.py
144
import warnings from scrapy.exceptions import ScrapyDeprecationWarning warnings.warn("Module `scrapy.contrib.downloadermiddleware.httpcompression` is deprecated, " "use `scrapy.downloadermiddlewares.httpcompression` instead", ScrapyDeprecationWarning, stacklevel=2) from scrapy.downloadermid...
cjdelisle/cjdns
refs/heads/master
node_build/dependencies/libuv/build/gyp/test/actions/gyptest-generated-header.py
187
#!/usr/bin/env python # Copyright (c) 2013 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 dependencies on generated headers work, even if the header has a mixed-case file name. """ import TestGyp test = TestGyp...
tokyo-jesus/tamactiluya
refs/heads/master
tamactiluya/models.py
3
# -*- coding: utf-8 -*- from flask_login import UserMixin from tembodb import TemboDB, FileType from tembodb.metadata import Text, Date, Password from tembodb.metadata import Payload, RevisionNumber, Extension db = TemboDB() db.use_locks = True @db.register_file_type('user') class User(FileType, UserMixin): un...
krez13/scikit-learn
refs/heads/master
sklearn/metrics/pairwise.py
14
# -*- coding: utf-8 -*- # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Robert Layton <robertlayton@gmail.com> # Andreas Mueller <amueller@ais.uni-bonn.de> # Philippe Gervais <philippe.gervais@inria.fr> # Lars Buitinck ...
analyseuc3m/ANALYSE-v1
refs/heads/master
openedx/core/djangoapps/programs/migrations/0003_auto_20151120_1613.py
83
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('programs', '0002_programsapiconfig_cache_ttl'), ] operations = [ migrations.AddField( model_name='programsapicon...
xxsergzzxx/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/test/test_pty.py
48
from test.support import verbose, run_unittest, import_module, reap_children #Skip these tests if either fcntl or termios is not available fcntl = import_module('fcntl') import_module('termios') import errno import pty import os import sys import signal import unittest TEST_STRING_1 = b"I wish to buy a fish license....
nirmeshk/oh-mainline
refs/heads/master
vendor/packages/gdata/src/gdata/Crypto/PublicKey/__init__.py
273
"""Public-key encryption and signature algorithms. Public-key encryption uses two different keys, one for encryption and one for decryption. The encryption key can be made public, and the decryption key is kept private. Many public-key algorithms can also be used to sign messages, and some can *only* be used for sig...
dvliman/jaikuengine
refs/heads/master
.google_appengine/lib/django-1.5/tests/regressiontests/model_fields/models.py
47
import os import tempfile # Try to import PIL in either of the two ways it can end up installed. # Checking for the existence of Image is enough for CPython, but for PyPy, # you need to check for the underlying modules. try: from PIL import Image, _imaging except ImportError: try: import Image, _imagi...
methane/uwsgi
refs/heads/master
plugins/graylog2/uwsgiplugin.py
21
NAME = 'graylog2' CFLAGS = [] LDFLAGS = [] LIBS = ['-lz'] GCC_LIST = ['graylog2_plugin']
aidanlister/django
refs/heads/master
tests/model_formsets/test_uuid.py
466
from django.forms.models import inlineformset_factory from django.test import TestCase from .models import ( AutoPKChildOfUUIDPKParent, AutoPKParent, ChildRelatedViaAK, ChildWithEditablePK, ParentWithUUIDAlternateKey, UUIDPKChild, UUIDPKChildOfAutoPKParent, UUIDPKParent, ) class InlineFormsetTests(TestCa...
rendermotion/RMMel
refs/heads/master
creators/loft.py
2
from RMPY import nameConvention from RMPY.core import config import pymel.core as pm from RMPY.creators import creatorsBase from RMPY.creators import curve from RMPY.creators import spaceLocator class Creator(creatorsBase.Creator): def __init__(self, *args, **kwargs): super(Creator, self).__init__(*args,...
moyogo/robofontmechanic
refs/heads/master
Mechanic.roboFontExt/lib/mechanic/ui/text.py
6
from AppKit import NSFontAttributeName, NSFont, NSMutableAttributedString, \ NSAttributedString class Text(object): """Convenience class for returning NSAttributedStrings.""" @staticmethod def regular(size): return {NSFontAttributeName: NSFont.systemFontOfSize_(size)} @stat...
heytcass/homeassistant-config
refs/heads/master
deps/fuzzywuzzy/StringMatcher.py
17
#!/usr/bin/env python # encoding: utf-8 """ StringMatcher.py ported from python-Levenshtein [https://github.com/miohtama/python-Levenshtein] License available here: https://github.com/miohtama/python-Levenshtein/blob/master/COPYING """ from Levenshtein import * from warnings import warn class StringMatcher: """...
GageGaskins/osf.io
refs/heads/develop
scripts/osfstorage/settings/__init__.py
105
# encoding: utf-8 from .defaults import * try: from .local import * except ImportError as error: pass
fabian4/ceilometer
refs/heads/master
ceilometer/tests/functional/api/v2/test_statistics_scenarios.py
7
# # Copyright 2012 New Dream Network, LLC (DreamHost) # # 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...
jxs/servo
refs/heads/master
tests/wpt/css-tests/css-fonts-3_dev/xhtml1print/reference/support/fonts/makegsubfonts.py
1616
import os import textwrap from xml.etree import ElementTree from fontTools.ttLib import TTFont, newTable from fontTools.misc.psCharStrings import T2CharString from fontTools.ttLib.tables.otTables import GSUB,\ ScriptList, ScriptRecord, Script, DefaultLangSys,\ FeatureList, FeatureRecord, Feature,\ LookupLi...
Bernardinhouessou/Projets_Autres
refs/heads/master
Python-Projects/Scripts/Algorithms-master/sorting and basics/binary_search.py
2
from sorting import mergesort def search(arr, item): """Performs binary search on an array with the given item and returns True or False. >>> search([5, 4, 1, 6, 2, 3, 9, 7], 2) True >>> search([5, 4, 1, 6, 2, 3, 9, 7], 8) False """ arr = mergesort(arr) first = 0 last = len(arr...
davechallis/gensim
refs/heads/develop
gensim/test/test_ldamodel.py
8
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Automated tests for checking transformation algorithms (the models package). """ import logging import unittest import os import o...
pathawks/pygments
refs/heads/master
pygments/formatters/terminal.py
363
# -*- coding: utf-8 -*- """ pygments.formatters.terminal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for terminal output with ANSI sequences. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys from pygments.formatter import Format...
cad-lab/blog
refs/heads/gh-pages
plugin/liquid_tags/gram.py
271
""" Instagram Image Tag ------------------- By `Tom Spalding <https://github.com/digitalvapor>`_ You can see a working example at `antivapor.net/instagram-tag.html <http://antivapor.net/instagram-tag.html>`_. Based on `Liquid Image Tag <https://github.com/getpelican/pelican-plugins/blob/master/liquid_tags/img.py>`_ ...
nburn42/tensorflow
refs/heads/master
tensorflow/contrib/tensor_forest/python/kernel_tests/scatter_add_ndim_op_test.py
114
# 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...
willmarkley/valumodel.com
refs/heads/master
scripts/dcf.py
1
#!/usr/bin/python import sys sys.path.append('/var/www/html/valumodel.com/scripts/dcf') from calc_dcf import calc_dcf def create_dcf(req, tax_rate, growth_rate_1_year_out, sga_of_sales, da_of_sales, capex_of_sales, nwc_of_sales, levered_beta, current_yield, exit_multiple, ticker): assumptions = {} try: assumption...
jjmleiro/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/django/contrib/sessions/exceptions.py
931
from django.core.exceptions import SuspiciousOperation class InvalidSessionKey(SuspiciousOperation): """Invalid characters in session key""" pass class SuspiciousSession(SuspiciousOperation): """The session may be tampered with""" pass
gabbayo/git-repo
refs/heads/master
editor.py
2
# -*- coding:utf-8 -*- # # Copyright (C) 2008 The Android Open Source Project # # 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...
philsch/ansible
refs/heads/devel
lib/ansible/modules/cloud/openstack/os_port_facts.py
29
#!/usr/bin/python # Copyright (c) 2016 IBM # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This software is distri...
GenericStudent/home-assistant
refs/heads/dev
homeassistant/components/yamaha/__init__.py
36
"""The yamaha component."""
errx/django
refs/heads/master
django/contrib/contenttypes/views.py
74
from __future__ import unicode_literals from django import http from django.apps import apps from django.contrib.contenttypes.models import ContentType from django.contrib.sites.requests import RequestSite from django.core.exceptions import ObjectDoesNotExist from django.utils.translation import ugettext as _ def sh...
titilambert/alignak
refs/heads/develop
alignak/objects/servicedependency.py
2
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors # # This file is part of Alignak. # # Alignak is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, eit...
brson/servo
refs/heads/master
src/components/script/dom/bindings/codegen/parser/tests/test_union.py
134
import WebIDL import itertools import string # We'd like to use itertools.chain but it's 2.6 or higher. def chain(*iterables): # chain('ABC', 'DEF') --> A B C D E F for it in iterables: for element in it: yield element # We'd like to use itertools.combinations but it's 2.6 or higher. def c...
40223117cda/cda
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/xml/etree/__init__.py
1200
# $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $ # elementtree package # -------------------------------------------------------------------- # The ElementTree toolkit is # # Copyright (c) 1999-2008 by Fredrik Lundh # # By obtaining, using, and/or copying this software and/or its # associated documentation, you ...
ryokbys/nap
refs/heads/master
nappy/vasp/potcar.py
1
#!/bin/env python from __future__ import print_function import re def read_POTCAR(fname='POTCAR'): species=[] valence=[] encut=[] isp=0 with open(fname,'r') as f: lines= f.readlines() for iline in range(len(lines)): line= lines[iline] if (re.match(r'^\s+US ...
athompso/ansible-modules-core
refs/heads/devel
cloud/google/gce_lb.py
130
#!/usr/bin/python # Copyright 2013 Google Inc. # # 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 vers...
bowen0701/algorithms_data_structures
refs/heads/master
lc0013_roman_to_integer.py
1
"""Leetcode 13. Roman to Integer Easy URL: https://leetcode.com/problems/roman-to-integer/ Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 F...
pyladieshre/pyladies
refs/heads/master
harare/settings.py
1
""" Django settings for harare project. Generated by 'django-admin startproject' using Django 1.10.3. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os ...
Comunitea/OCB
refs/heads/8.0
addons/event/report/__init__.py
435
# -*- 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...
pdellaert/ansible
refs/heads/devel
lib/ansible/module_utils/network/ios/argspec/lldp_global/lldp_global.py
19
# # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ############################################# # WARNING # ############################################# # # This file is auto generated by ...
asnorkin/sentiment_analysis
refs/heads/master
site/lib/python2.7/site-packages/sklearn/utils/_scipy_sparse_lsqr_backport.py
378
"""Sparse Equations and Least Squares. The original Fortran code was written by C. C. Paige and M. A. Saunders as described in C. C. Paige and M. A. Saunders, LSQR: An algorithm for sparse linear equations and sparse least squares, TOMS 8(1), 43--71 (1982). C. C. Paige and M. A. Saunders, Algorithm 583; LSQR: Sparse...
ninuxorg/nodeshot
refs/heads/master
nodeshot/conf/urls.py
5
from django.conf.urls import patterns, include, url from django.conf import settings from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)) ) if 'smuggler' in settings.INSTALLED_APPS: # smuggler must be before admin urlpatterns = pattern...
aidora/linux
refs/heads/master
Documentation/target/tcm_mod_builder.py
4981
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
Big-B702/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/curses/__init__.py
45
"""curses The main package for curses support for Python. Normally used by importing the package, and perhaps a particular module inside it. import curses from curses import textpad curses.initwin() ... """ from _curses import * from curses.wrapper import wrapper import os as _os import sys as _sys # ...
Jorge-Rodriguez/ansible-modules-core
refs/heads/devel
packaging/os/apt.py
7
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Flowroute LLC # Written by Matthew Williams <matthew@flowroute.com> # Based on yum module written by Seth Vidal <skvidal at fedoraproject.org> # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lic...
samabhi/pstHealth
refs/heads/master
venv/lib/python2.7/site-packages/setuptools/package_index.py
301
"""PyPI and direct package downloading""" import sys import os import re import shutil import socket import base64 import hashlib from functools import wraps from pkg_resources import ( CHECKOUT_DIST, Distribution, BINARY_DIST, normalize_path, SOURCE_DIST, require, Environment, find_distributions, safe_name, s...
camptocamp/QGIS
refs/heads/master
python/plugins/processing/gui/BatchOutputSelectionPanel.py
1
# -*- coding: utf-8 -*- """ *************************************************************************** BatchOutputSelectionPanel.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *************...
spinellic/Mission-Planner
refs/heads/master
Lib/site-packages/scipy/stats/tests/test_fit.py
53
# NOTE: contains only one test, _est_cont_fit, that is renamed so that # nose doesn't run it # I put this here for the record and for the case when someone wants to # verify the quality of fit # with current parameters: relatively small sample size, default starting values # Ran 84 tests in 401.797s # ...
boyuegame/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/test/test_cmd.py
74
""" Test script for the 'cmd' module Original by Michael Schneider """ import cmd import sys import re import unittest import io from test import support class samplecmdclass(cmd.Cmd): """ Instance the sampleclass: >>> mycmd = samplecmdclass() Test for the function parseline(): >>> mycmd.parseli...
jgmize/kuma
refs/heads/master
kuma/wiki/feeds.py
1
"""Feeds for documents""" import datetime import json from django.conf import settings from django.contrib.syndication.views import Feed from django.db.models import F from django.utils.feedgenerator import (Atom1Feed, Rss201rev2Feed, SyndicationFeed) from django.utils.html impo...
im-infamou5/volatility
refs/heads/master
volatility/plugins/addrspaces/vboxelf.py
44
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # Copyright (C) 2005,2006,2007 4tphi Research # # Authors: # {npetroni,awalters}@4tphi.net (Nick Petroni and AAron Walters) # phil@teuwen.org (Philippe Teuwen) # # This file is part of Volatility. # # Volatility is free software; you can redistribute it and/...
pyfa-org/Pyfa
refs/heads/master
eos/db/saveddata/miscData.py
4
# =============================================================================== # Copyright (C) 2011 Anton Vorobyov # # This file is part of eos. # # eos 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...
vmanoria/bluemix-hue-filebrowser
refs/heads/master
hue-3.8.1-bluemix/desktop/core/ext-py/Django-1.6.10/django/conf/app_template/models.py
10644
from django.db import models # Create your models here.
siosio/intellij-community
refs/heads/master
python/testData/formatter/blankLinesAroundFirstMethod.py
24
class C1: # comment 1 # comment 2 def __init__(self): pass class C2: # comment 2 def __init__(self): pass class C3: def __init__(self): pass class C4: """Docstring.""" # comment 1 # comment 2 def __init__(self): pass class C5: """Docs...
adviti/melange
refs/heads/master
tests/app/soc/logic/helper/test_timeline.py
1
#!/usr/bin/env python2.5 # # Copyright 2011 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
sivel/ansible
refs/heads/devel
lib/ansible/parsing/yaml/__init__.py
2520
# (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...
zzqcn/wireshark
refs/heads/zzqcn
tools/generate-sysdig-event.py
2
#!/usr/bin/env python3 # # Wireshark - Network traffic analyzer # By Gerald Combs <gerald@wireshark.org> # Copyright 1998 Gerald Combs # # SPDX-License-Identifier: GPL-2.0-or-later # '''\ Generate Sysdig event dissector sections from the sysdig sources. Reads driver/event_table.c and driver/ppm_events_public.h and gen...
balloob/home-assistant
refs/heads/dev
tests/components/asuswrt/test_device_tracker.py
13
"""The tests for the ASUSWRT device tracker platform.""" from homeassistant.components.asuswrt import ( CONF_DNSMASQ, CONF_INTERFACE, DATA_ASUSWRT, DOMAIN, ) from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME from homeassistant.setup import async_setup_component from tests.async_m...
UrLab/incubator
refs/heads/main
events/tests/test_forms.py
1
from events.forms import EventForm from datetime import datetime import pytest from users.models import User @pytest.fixture(scope='function') def user(): user = User.objects.create(username="test", email="test@test.be", first_name="Test", last_name="Test") return user.id @pytest.mark.django_db def test_onl...
fedora-conary/conary
refs/heads/master
scripts/migration/tablelist.py
1
#!/usr/bin/env python # # Copyright (c) SAS Institute 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...
shakamunyi/neutron-vrrp
refs/heads/master
neutron/tests/unit/sriovnicagent/test_sriov_neutron_agent.py
16
# Copyright 2014 Mellanox Technologies, 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 law or agreed t...
waseem18/oh-mainline
refs/heads/master
vendor/packages/docutils/test/test_parsers/test_rst/test_directives/test_unknown.py
19
#! /usr/bin/env python # $Id: test_unknown.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Tests for unknown directives. """ from __init__ import DocutilsTestSupport def suite(): s = DocutilsTestSupport.Parser...
pressbooks/trellis
refs/heads/master
lib/trellis/utils/__init__.py
673
# Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type
cournape/numscons
refs/heads/master
numscons/scons-local/scons-local-1.2.0/SCons/Tool/packaging/zip.py
1
"""SCons.Tool.Packaging.zip The zip SRC packager. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # 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 S...
bckwltn/SickRage
refs/heads/master
lib/unidecode/x096.py
252
data = ( 'Fa ', # 0x00 'Ge ', # 0x01 'He ', # 0x02 'Kun ', # 0x03 'Jiu ', # 0x04 'Yue ', # 0x05 'Lang ', # 0x06 'Du ', # 0x07 'Yu ', # 0x08 'Yan ', # 0x09 'Chang ', # 0x0a 'Xi ', # 0x0b 'Wen ', # 0x0c 'Hun ', # 0x0d 'Yan ', # 0x0e 'E ', # 0x0f 'Chan ', # 0x10 'Lan ', ...
obi-two/Rebelion
refs/heads/master
data/scripts/templates/object/tangible/ship/crafted/capacitor/shared_energy_saver_battery_mk2.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/ship/crafted/capacitor/shared_energy_saver_battery_mk2.iff" result....