repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
redebian/documentation | refs/heads/master | django/contrib/gis/admin/__init__.py | 637 | # Getting the normal admin routines, classes, and `site` instance.
from django.contrib.admin import autodiscover, site, AdminSite, ModelAdmin, StackedInline, TabularInline, HORIZONTAL, VERTICAL
# Geographic admin options classes and widgets.
from django.contrib.gis.admin.options import GeoModelAdmin
from django.contri... |
dga4654dan/UTM-Demo | refs/heads/master | V_1_0_2_1/UtmDemo_Sfs_2.9.0/UtmDemo_Sfs_2.9.0_Server/lib/Lib/test/test_string.py | 7 | from test_support import *
import string, sys
print_test('string (test_string.py)', 1)
names = {}
def test(name, input, output, *args):
if not names.has_key(name):
print_test(name, 2)
names[name] = 1
f = getattr(string, name)
try:
value = apply(f, (input,) + args)
except:
... |
zedr/django | refs/heads/master | tests/modeladmin/tests.py | 6 | from __future__ import unicode_literals
from datetime import date
import warnings
from django import forms
from django.contrib.admin.options import (ModelAdmin, TabularInline,
HORIZONTAL, VERTICAL)
from django.contrib.admin.sites import AdminSite
from django.contrib.admin.widgets import AdminDateWidget, AdminRad... |
saurabh6790/ON-RISLIB | refs/heads/master | website/doctype/web_page/templates/generators/web_page.py | 36 | doctype = "Web Page"
condition_field = "published" |
bigfootproject/sahara | refs/heads/spark-plugin | sahara/tests/unit/service/test_direct_engine.py | 7 | # Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
AtScaleInc/Impala | refs/heads/master | tests/verifiers/__init__.py | 186 | # This file is needed to make the files in this directory a python module
|
LevinJ/CodeSamples | refs/heads/master | python/Installation_logs_analysis/calfailureCategory.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os.path
import sys
import shutil
import os
import glob
import re
import rebootstatistics
import os, os.path
from optparse import OptionParser
from openpyxl import Workbook
def parse_arguments():
parser ... |
HyperBaton/ansible | refs/heads/devel | lib/ansible/modules/windows/win_chocolatey_facts.py | 18 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Simon Baerlocher <s.baerlocher@sbaerlocher.ch>
# Copyright: (c) 2018, ITIGO AG <opensource@itigo.ch>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {... |
rikadederika/pychess | refs/heads/master | lib/pychess/Players/ICPlayer.py | 20 | from collections import defaultdict
from pychess.compat import Queue
from pychess.Players.Player import Player, PlayerIsDead, TurnInterrupt
from pychess.Utils.Move import parseSAN, toAN
from pychess.Utils.lutils.lmove import ParsingError
from pychess.Utils.Offer import Offer
from pychess.Utils.const import *
from pych... |
AndroidOpenDevelopment/android_external_chromium_org | refs/heads/lp | build/android/pylib/device/device_list.py | 114 | # 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.
"""A module to keep track of devices across builds."""
import os
LAST_DEVICES_FILENAME = '.last_devices'
LAST_MISSING_DEVICES_FILENAME = '.last_missing'
... |
hchen1202/django-react | refs/heads/master | virtualenv/lib/python3.6/site-packages/django/db/models/functions/base.py | 75 | """
Classes that represent database functions.
"""
from django.db.models import Func, Transform, Value, fields
class Cast(Func):
"""
Coerce an expression to a new field type.
"""
function = 'CAST'
template = '%(function)s(%(expressions)s AS %(db_type)s)'
mysql_types = {
fields.CharFie... |
sipak/MaidSafe | refs/heads/master | src/third_party_libs/googlemock/gtest/test/gtest_shuffle_test.py | 3023 | #!/usr/bin/env python
#
# Copyright 2009 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... |
Rewardcoin/p2pool | refs/heads/master | wstools/WSDLTools.py | 292 | # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISC... |
Fale/ansible | refs/heads/devel | test/lib/ansible_test/_internal/powershell_import_analysis.py | 31 | """Analyze powershell import statements."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import re
from .io import (
read_text_file,
)
from .util import (
display,
)
from .util_common import (
resolve_csharp_ps_util,
)
from .data import (
data_co... |
Cazomino05/Test1 | refs/heads/master | vendor/google-breakpad/src/tools/gyp/pylib/gyp/msvs_emulation.py | 36 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
import sys
im... |
duyet-website/api.duyet.net | refs/heads/master | lib/boto/cloudtrail/layer1.py | 125 | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates. 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 ... |
libracore/erpnext | refs/heads/v12 | erpnext/regional/india/__init__.py | 6 | from __future__ import unicode_literals
states = [
'',
'Andaman and Nicobar Islands',
'Andhra Pradesh',
'Arunachal Pradesh',
'Assam',
'Bihar',
'Chandigarh',
'Chhattisgarh',
'Dadra and Nagar Haveli',
'Daman and Diu',
'Delhi',
'Goa',
'Gujarat',
'Haryana',
'Himachal Pradesh',
'Jammu and Kashmir',
'Jharkh... |
bOOm-X/spark | refs/heads/master | examples/src/main/python/ml/bucketed_random_projection_lsh_example.py | 51 | #
# 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 us... |
EdibleEd/vacbooru | refs/heads/master | VAB_upload.py | 1 | # TAKES a set of tupples of the form
# {source_url, source_hash, [tags]}
# OPTIONALLY TAKES
# RETURNS return code
import VAB_scraper
import argparse
import Utility as utl
import requests
from requests.auth import HTTPBasicAuth
from bs4 import BeautifulSoup
import os
import sys
# Actually builds the post request, the... |
jlmadurga/django-oscar | refs/heads/master | tests/integration/catalogue/reviews/form_tests.py | 40 | from django.test import TestCase
from oscar.apps.catalogue.reviews import forms
from oscar.test.factories import create_product, UserFactory
class TestReviewForm(TestCase):
def setUp(self):
self.product = create_product()
self.reviewer = UserFactory()
self.data = {
'title': '... |
xiangel/hue | refs/heads/master | desktop/core/ext-py/python-openid-2.2.5/openid/yadis/services.py | 167 | # -*- test-case-name: openid.test.test_services -*-
from openid.yadis.filters import mkFilter
from openid.yadis.discover import discover, DiscoveryFailure
from openid.yadis.etxrd import parseXRDS, iterServices, XRDSError
def getServiceEndpoints(input_url, flt=None):
"""Perform the Yadis protocol on the input URL ... |
javachengwc/hue | refs/heads/master | desktop/core/ext-py/pyformance-0.3.2/pyformance/meters/meter.py | 33 | import time
from threading import Lock
from ..stats.moving_average import ExpWeightedMovingAvg
class Meter(object):
"""
A meter metric which measures mean throughput and one-, five-, and fifteen-minute
exponentially-weighted moving average throughputs.
"""
def __init__(self, clock=time):
... |
breunigs/beets | refs/heads/master | beets/__init__.py | 1 | # This file is part of beets.
# Copyright 2013, Adrian Sampson.
#
# 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, ... |
tomchristie/django | refs/heads/master | django/contrib/auth/migrations/0006_require_contenttypes_0002.py | 134 | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('auth', '0005_alter_user_last_login_null'),
('contenttypes', '0002_remove_content_type_name'),
]
operations = [
# Ensure the contenttypes migration is applied before sending
# post_m... |
megaserg/pants | refs/heads/master | tests/python/pants_test/tasks/task_test_base.py | 3 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import sub... |
TNT-Samuel/Coding-Projects | refs/heads/master | DNS Server/Source/Lib/site-packages/dask/array/tests/test_gufunc.py | 2 | from __future__ import absolute_import, division, print_function
from distutils.version import LooseVersion
import pytest
from numpy.testing import assert_equal
import dask.array as da
from dask.array.utils import assert_eq
import numpy as np
from dask.array.core import Array
from dask.array.gufunc import _parse_gufu... |
KSanthanam/rethinkdb | refs/heads/next | test/common/rdb_unittest.py | 5 | #!/usr/bin/env python
# Copyright 2015 RethinkDB, all rights reserved.
import itertools, os, random, shutil, sys, unittest, warnings
import driver, utils
def main():
unittest.main(argv=[sys.argv[0]])
class RdbTestCase(unittest.TestCase):
# -- settings
servers = None # defaults to shards * repl... |
izhukov/ansible | refs/heads/devel | lib/ansible/runner/lookup_plugins/file.py | 153 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.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) any lat... |
ProjectX-Android/kernel_htc_msm8974 | refs/heads/lollipop-5.1 | 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 ... |
liyichao/spark | refs/heads/master | python/pyspark/mllib/stat/distribution.py | 137 | #
# 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 us... |
reviewboard/ReviewBot | refs/heads/master | docs/releasenotes/conf.py | 1 | # -*- coding: utf-8 -*-
#
# Release Notes documentation build configuration file, created by
# sphinx-quickstart on Mon Mar 27 18:32:43 2017.
#
# 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.... |
vnsofthe/odoo | refs/heads/8.0 | addons/web_kanban_gauge/__openerp__.py | 428 | {
'name': 'Gauge Widget for Kanban',
'category': 'Hidden',
'description': """
This widget allows to display gauges using justgage library.
""",
'version': '1.0',
'depends': ['web_kanban'],
'data' : [
'views/web_kanban_gauge.xml',
],
'qweb': [
],
'auto_install': True,
}
|
drogenlied/qudi | refs/heads/master | logic/simple_data_logic.py | 1 | # -*- coding: utf-8 -*-
"""
Buffer for simple data
Qudi 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.
Qudi is distributed in the hope tha... |
motatoes/rainbowstream | refs/heads/master | setup.py | 6 | from setuptools import setup, find_packages
import os
import os.path
# Bumped version
version = '1.3.1'
# Require
install_requires = [
"python-dateutil",
"arrow",
"requests==2.5.3",
"pyfiglet",
"twitter",
"Pillow",
"PySocks"
]
# Copy default config if not exists
default = os.path.expandus... |
MediaMath/Diamond | refs/heads/master | src/collectors/mmcassandra/mmcassandra.py | 1 | import subprocess, socket, math
import diamond.collector
def parse_line(line):
metric_name, rhs = line.strip().split(':', 1)
rhs = rhs.strip()
if ' ' in rhs:
str_value, units = rhs.split(' ', 1)
if units not in ('ms', 'ms.'):
raise ValueError("Cannot parse " + repr(line))
... |
CiscoSystems/tempest | refs/heads/master | tempest/api/compute/images/test_list_image_filters_negative.py | 5 | # Copyright 2014 NEC Corporation. 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 ... |
stack-of-tasks/rbdlpy | refs/heads/master | tutorial/lib/python2.7/site-packages/OpenGL/GL/ARB/texture_query_lod.py | 9 | '''OpenGL extension ARB.texture_query_lod
This module customises the behaviour of the
OpenGL.raw.GL.ARB.texture_query_lod to provide a more
Python-friendly API
Overview (from the spec)
This extension provides a new set of fragment shader texture
functions (textureLOD) that return the results of automatic
level... |
abloomston/sympy | refs/heads/master | sympy/strategies/core.py | 94 | """ Generic SymPy-Independent Strategies """
from __future__ import print_function, division
from sympy.core.compatibility import get_function_name
identity = lambda x: x
def exhaust(rule):
""" Apply a rule repeatedly until it has no effect """
def exhaustive_rl(expr):
new, old = rule(expr), expr
... |
Workday/OpenFrame | refs/heads/master | build/android/incremental_install/__init__.py | 57 | # 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.
|
zhukaixy/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/test_glob.py | 84 | import glob
import os
import shutil
import sys
import unittest
from test.support import (run_unittest, TESTFN, skip_unless_symlink,
can_symlink, create_empty_file)
class GlobTests(unittest.TestCase):
def norm(self, *parts):
return os.path.normpath(os.path.join(self.tempdir, *pa... |
dataxu/ansible | refs/heads/dx-stable-2.5 | lib/ansible/plugins/cache/base.py | 232 | # (c) 2017, ansible by Red Hat
#
# 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... |
geekboxzone/lollipop_external_chromium_org | refs/heads/geekbox | third_party/closure_linter/closure_linter/gjslint.py | 95 | #!/usr/bin/env python
# Copyright 2007 The Closure Linter 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
#
#... |
Aravinthu/odoo | refs/heads/master | addons/account_payment/controllers/payment.py | 3 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from werkzeug import url_encode
from odoo import http, _
from odoo.http import request, route
class PaymentPortal(http.Controller):
@route('/invoice/pay/<int:invoice_id>/form_tx', type='json', auth="public", webs... |
Bashar/django | refs/heads/master | 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
|
darkserver/darkadmin | refs/heads/master | src/modules/nginx.py | 1 | import json, os, subprocess, re
from log import *
cfg = {}
user = None
def process(args, config, userdata):
global cfg, user
cfg = config
user = userdata
return {
'enable' : site_enable,
'disable' : site_disable,
'list' : list_sites,
'add' : site_add,
'del' : site_remove,
}.get(args[1], hel... |
FireWRT/OpenWrt-Firefly-Libraries | refs/heads/master | staging_dir/host/lib/scons-2.3.1/SCons/Options/PathOption.py | 11 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 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 Software without restriction... |
h4/fuit-webdev | refs/heads/master | examples/lesson2/3.2/2.3.1.py | 1 | # -*- encoding: utf-8 -*-
"""
Логическое И
"""
print 'a' and 'b'
print '' and 'b'
print 'a' and 'b' and 'c'
|
emon10005/sympy | refs/heads/master | sympy/parsing/__init__.py | 135 | """Used for translating a string into a SymPy expression. """
|
shanil-puri/mase | refs/heads/master | src/smoteok.py | 10 | from __future__ import print_function, division
from ok import *
import sys
sys.dont_write_bytecode = True
from smote import *
@ok
def _some():
rseed(1)
s = Some(16)
for i in xrange(100000):
s += i
assert sorted(s.any)== [ 5852, 24193, 28929, 38266,
41764, 42926, 51310, 52203,
... |
olexiim/edx-platform | refs/heads/master | common/djangoapps/external_auth/tests/test_shib.py | 7 | # -*- coding: utf-8 -*-
"""
Tests for Shibboleth Authentication
@jbau
"""
import unittest
from ddt import ddt, data
from django.conf import settings
from django.http import HttpResponseRedirect
from django.test import TestCase
from django.test.client import RequestFactory, Client as DjangoTestClient
from django.test.u... |
widowild/messcripts | refs/heads/master | exercice/python2/solutions/exercice_10_18.py | 1 | #! /usr/bin/env python
# -*- coding:Utf-8 -*-
def voyelle(cu):
"teste si le caractère unicode <cu> est une voyelle"
if cu in u"AEIOUYÀÉÈÊËÎÏÔÛÙaeiouyàéèêëîïôûù":
return 1
else:
return 0
# Test :
if __name__ == '__main__':
print voyelle(u"g"), voyelle(u"O"), voyelle(u"à"), voyelle(u"É")... |
abligh/xen | refs/heads/master | tools/python/xen/xend/XendDPCI.py | 44 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... |
40223212/2015cd_midterm2 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/xml/etree/cElementTree.py | 876 | # Deprecated alias for xml.etree.ElementTree
from xml.etree.ElementTree import *
|
KickAssCoin/P2Pool-KIK | refs/heads/master | p2pool/bitcoin/script.py | 282 | from p2pool.util import math, pack
def reads_nothing(f):
return None, f
def protoPUSH(length):
return lambda f: pack.read(f, length)
def protoPUSHDATA(size_len):
def _(f):
length_str, f = pack.read(f, size_len)
length = math.string_to_natural(length_str[::-1].lstrip(chr(0)))
data, f... |
Vixionar/django | refs/heads/master | django/shortcuts.py | 135 | """
This module collects helper functions and classes that "span" multiple levels
of MVC. In other words, these functions/classes introduce controlled coupling
for convenience's sake.
"""
import warnings
from django.core import urlresolvers
from django.db.models.base import ModelBase
from django.db.models.manager imp... |
sukeesh/Jarvis | refs/heads/master | jarviscli/__main__.py | 2 | # -*- coding: utf-8 -*-
import Jarvis
import colorama
import sys
def check_python_version():
return sys.version_info[0] == 3
def main():
# enable color on windows
colorama.init()
# start Jarvis
jarvis = Jarvis.Jarvis()
command = " ".join(sys.argv[1:]).strip()
jarvis.executor(command)
i... |
rhosqeauto/InfraRed | refs/heads/master | plugins/virsh/filter_plugins/wirehosts.py | 3 |
from __future__ import print_function
from ansible import errors
def create_ifaces(source_node, target_node, bridge_pattern, iface):
for dst_cnt in range(int(target_node.get('num', 1))):
source_iface = iface.copy()
source_iface['model'] = source_iface['src_model']
for key in ['src_model'... |
tonysyu/deli | refs/heads/master | deli/utils/data_structures.py | 1 | from __future__ import absolute_import
from traits.api import Dict, Event, HasStrictTraits
class NoisyDict(HasStrictTraits):
""" Dict-like object that fires an event when keys are added or changed.
"""
#: Event fired when a new key is added or changed.
updated = Event
# The actual dictionary da... |
maddabini/robotframework-selenium2library | refs/heads/master | test/lib/mockito/spying.py | 70 | #!/usr/bin/env python
# coding: utf-8
'''Spying on real objects.'''
from invocation import RememberedProxyInvocation, VerifiableInvocation
from mocking import TestDouble
__author__ = "Serhiy Oplakanets <serhiy@oplakanets.com>"
__copyright__ = "Copyright 2009-2010, Mockito Contributors"
__license__ = "MIT"
__maintain... |
srijanmishra/RouteFlow | refs/heads/master | pox/pox/lib/packet/llc.py | 27 | # Copyright 2013 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is distri... |
mosra/m.css | refs/heads/master | documentation/test_python/content_parse_docstrings/content_parse_docstrings.py | 1 | """This module has a *serious* docstring. And a :ref:`Class`.
And module **details** as well."""
import enum
class Class:
"""This class has a *serious* docstring.
With a multi-line summary. Relative reference to :ref:`a_property` works
even from a summary.
And class **details** as well."""
@pro... |
chirilo/kitsune | refs/heads/master | kitsune/questions/tests/test_utils.py | 16 | from nose.tools import eq_
from kitsune.questions.models import Question, Answer
from kitsune.questions.tests import question, answer
from kitsune.questions.utils import (
num_questions, num_answers, num_solutions, mark_content_as_spam)
from kitsune.sumo.tests import TestCase
from kitsune.users.tests import user
... |
nozuono/calibre-webserver | refs/heads/master | src/tinycss/token_data.py | 19 | # coding: utf8
"""
tinycss.token_data
------------------
Shared data for both implementations (Cython and Python) of the tokenizer.
:copyright: (c) 2012 by Simon Sapin.
:license: BSD, see LICENSE for more details.
"""
from __future__ import unicode_literals
import re
import sys
import operator
i... |
jblackburne/scikit-learn | refs/heads/master | examples/covariance/plot_sparse_cov.py | 300 | """
======================================
Sparse inverse covariance estimation
======================================
Using the GraphLasso estimator to learn a covariance and sparse precision
from a small number of samples.
To estimate a probabilistic model (e.g. a Gaussian model), estimating the
precision matrix, t... |
frouty/odoo_oph | refs/heads/dev_70 | 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 ... |
vmindru/ansible | refs/heads/devel | lib/ansible/modules/system/known_hosts.py | 29 | #!/usr/bin/python
# Copyright: (c) 2014, Matthew Vernon <mcv21@cam.ac.uk>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
RoyFerry/mecha-2.6.35-gb-mr | 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 ... |
Jaiglissechef-i9100/f4ktion_kernel | refs/heads/lp-5.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 ... |
xfumihiro/powerline | refs/heads/develop | powerline/bindings/pdb/__init__.py | 34 | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import sys
import pdb
from powerline.pdb import PDBPowerline
from powerline.lib.encoding import get_preferred_output_encoding
from powerline.lib.unicode import unicode
if sys.version_info < (3,):
# XX... |
amarzavery/AutoRest | refs/heads/master | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyArray/auto_rest_swagger_bat_array_service/exceptions.py | 687 | # 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 ... |
gauribhoite/personfinder | refs/heads/master | env/google_appengine/lib/django-1.4/django/utils/regex_helper.py | 86 | """
Functions for reversing a regular expression (used in reverse URL resolving).
Used internally by Django and not intended for external use.
This is not, and is not intended to be, a complete reg-exp decompiler. It
should be good enough for a large class of URLS, however.
"""
# Mapping of an escape character to a r... |
Outernet-Project/rpi-linux | refs/heads/outernet-3.18.y | tools/perf/scripts/python/sctop.py | 1996 | # 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,... |
nnethercote/servo | refs/heads/master | tests/wpt/web-platform-tests/service-workers/service-worker/resources/redirect.py | 158 | def main(request, response):
if 'Status' in request.GET:
status = int(request.GET["Status"])
else:
status = 302
headers = []
url = request.GET['Redirect']
headers.append(("Location", url))
if "ACAOrigin" in request.GET:
for item in request.GET["ACAOrigin"].split(","):
... |
zmeda/web-summit-2015-recap-zalando | refs/heads/master | node_modules/grunt-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py | 383 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
r"""Code to validate and convert settings of the Microsoft build tools.
This file contains code to validate and convert settings of the Microsoft
build tools. Th... |
devopservices/ansible | refs/heads/devel | lib/ansible/module_utils/gce.py | 305 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... |
ericfc/django | refs/heads/master | tests/test_client/auth_backends.py | 315 | from django.contrib.auth.backends import ModelBackend
class TestClientBackend(ModelBackend):
pass
|
ramitsurana/boto | refs/heads/develop | tests/unit/emr/test_connection.py | 34 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates.
# 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 right... |
renpytom/python-for-android | refs/heads/master | src/buildlib/jinja2.egg/jinja2/filters.py | 199 | # -*- coding: utf-8 -*-
"""
jinja2.filters
~~~~~~~~~~~~~~
Bundled jinja filters.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import math
from random import choice
from operator import itemgetter
from itertools import imap, groupby
from jinja2.... |
tmpgit/intellij-community | refs/heads/master | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/__main__.py | 466 | import sys
from .main import main
sys.exit(main("lib2to3.fixes"))
|
menpo/menpo | refs/heads/master | menpo/__init__.py | 2 | from . import base
from . import feature
from . import image
from . import io
from . import landmark
from . import math
from . import model
from . import shape
from . import transform
from . import visualize
from ._version import __version__
|
wdzhou/mantid | refs/heads/master | scripts/test/SANSCommandInterfaceTest.py | 3 | from __future__ import (absolute_import, division, print_function)
import unittest
import mantid
import os
import isis_instrument as instruments
import ISISCommandInterface as command_iface
from reducer_singleton import ReductionSingleton
import isis_reduction_steps as reduction_steps
from mantid.simpleapi import *
fro... |
nbeaver/numpy | refs/heads/master | numpy/distutils/__init__.py | 87 | from __future__ import division, absolute_import, print_function
import sys
from .__version__ import version as __version__
# Must import local ccompiler ASAP in order to get
# customized CCompiler.spawn effective.
from . import ccompiler
from . import unixccompiler
from .info import __doc__
from .npy_pkg_config imp... |
rebstar6/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_callback_interface.py | 142 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
callback interface TestCallbackInterface {
attribute boolean bool;
};
""")
results = parser.finish()
iface = results[0]
harness.ok(iface.isCallback(), "Interface should be a callback")
parser = parser.... |
beeftornado/sentry | refs/heads/master | src/sentry/runner/initializer.py | 1 | from __future__ import absolute_import, print_function
import click
import logging
import os
import six
from django.conf import settings
from sentry.utils import metrics, warnings
from sentry.utils.sdk import configure_sdk
from sentry.utils.warnings import DeprecatedSettingWarning
from sentry.utils.compat import map... |
ltowarek/budget-supervisor | refs/heads/dependabot/pip/django-3.1.10 | budgetsupervisor/budget/tests/test_views.py | 1 | import base64
import datetime
import json
from typing import Callable, Dict
import OpenSSL.crypto
import pytest
import swagger_client as saltedge_client
import swagger_client.rest
from budget.models import Account, Category, Connection, Transaction
from budget.views import verify_signature
from django.contrib.messages... |
onitake/ansible | refs/heads/devel | lib/ansible/modules/clustering/consul_acl.py | 32 | #!/usr/bin/python
#
# (c) 2015, Steve Gargan <steve.gargan@gmail.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_version': '1.1',
'... |
edcast-inc/edx-platform-edcast | refs/heads/master | lms/djangoapps/instructor_analytics/tests/test_basic.py | 32 | """
Tests for instructor.basic
"""
import json
from student.models import CourseEnrollment, CourseEnrollmentAllowed
from django.core.urlresolvers import reverse
from mock import patch
from student.roles import CourseSalesAdminRole
from student.tests.factories import UserFactory, CourseModeFactory
from shoppingcart.mod... |
xaviercobain88/framework-python | refs/heads/master | build/lib.linux-i686-2.7/openerp/addons/l10n_ve/__openerp__.py | 51 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
##############################################################################
# Modu... |
elbeardmorez/quodlibet | refs/heads/widgetbars_all | quodlibet/quodlibet/ext/playlist/shuffle.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2014,2016 Nick Boultbee
#
# 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 2 of the License, or
# (at your option) any later version.
from quod... |
Moe-Team/MysteryOnline | refs/heads/master | MysteryOnline/__init__.py | 1 | dev = False
PREFIX = "v"
MAJOR = 1
MINOR = 3
REVISION = 4
SUFFIX = " stable"
def set_dev(value: bool):
global dev
dev = value
def get_dev() -> bool:
return dev
def get_version() -> str:
return "{0}{1}.{2}.{3}{4}".format(PREFIX, MAJOR, MINOR, REVISION, SUFFIX)
|
umglurf/juleol | refs/heads/master | migrations/versions/c8fd9f1d6ba9_add_tasting_lock.py | 1 | # SPDX-FileCopyrightText: 2020 Håvard Moen <post@haavard.name>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""add tasting lock
Revision ID: c8fd9f1d6ba9
Revises: 8eb7162afee7
Create Date: 2020-11-08 10:13:30.894263
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revisi... |
pim89/youtube-dl | refs/heads/master | youtube_dl/extractor/roxwel.py | 73 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import unified_strdate, determine_ext
class RoxwelIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?roxwel\.com/player/(?P<filename>.+?)(\.|\?|$)'
_TEST = {
'url': 'http://www.roxwel.com/player/passi... |
aavanian/bokeh | refs/heads/master | sphinx/source/docs/user_guide/examples/interaction_toggle_button.py | 16 | from bokeh.io import output_file, show
from bokeh.layouts import widgetbox
from bokeh.models.widgets import Toggle
output_file("toggle.html")
toggle = Toggle(label="Foo", button_type="success")
show(widgetbox(toggle))
|
wang1352083/pythontool | refs/heads/master | python-2.7.12-lib/cProfile.py | 169 | #! /usr/bin/env python
"""Python interface for the 'lsprof' profiler.
Compatible with the 'profile' module.
"""
__all__ = ["run", "runctx", "help", "Profile"]
import _lsprof
# ____________________________________________________________
# Simple interface
def run(statement, filename=None, sort=-1):
"""Run s... |
caphrim007/ansible | refs/heads/devel | test/units/modules/network/netscaler/test_netscaler_lb_monitor.py | 18 |
# Copyright (c) 2017 Citrix Systems
#
# 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.
#
# ... |
sbktechnology/trufil-frappe | refs/heads/develop | frappe/utils/make_random.py | 30 | import frappe, random
settings = frappe._dict(
prob = {
"default": { "make": 0.6, "qty": (1,5) },
}
)
def add_random_children(doc, fieldname, rows, randomize, unique=None):
nrows = rows
if rows > 1:
nrows = random.randrange(1, rows)
for i in xrange(nrows):
d = {}
for key, val in randomize.items():
if... |
ccrook/Quantum-GIS | refs/heads/master | python/plugins/processing/algs/grass7/ext/r_li_edgedensity.py | 5 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_edgedensity.py
-------------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
********************... |
KaranToor/MA450 | refs/heads/master | google-cloud-sdk/.install/.backup/lib/surface/bigtable/__init__.py | 2 | # 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 ag... |
robclark/chromium | refs/heads/master | third_party/tlslite/tlslite/SessionCache.py | 358 | """Class for caching TLS sessions."""
import thread
import time
class SessionCache:
"""This class is used by the server to cache TLS sessions.
Caching sessions allows the client to use TLS session resumption
and avoid the expense of a full handshake. To use this class,
simply pass a SessionCache ins... |
treeform/pystorm | refs/heads/master | tests/basic/for_step.py | 5 |
for x in xrange(19,342,13):
print x
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.