repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ansible/ansible-modules-extras | refs/heads/devel | monitoring/datadog_monitor.py | 22 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Sebastian Kornehl <[email protected]>
#
# 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 versi... |
GPCsolutions/mod-webui | refs/heads/master | module/plugins/problems/__init__.py | 288 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2012:
# Gabes Jean, [email protected]
# Gerhard Lausser, [email protected]
# Gregory Starck, [email protected]
# Hartmut Goebel, [email protected]
#
# This file is part of Shinken.
#
# Shinken is free software: you can redis... |
HerlanAssis/Django-AulaOsvandoSantana | refs/heads/master | lib/python2.7/site-packages/setuptools/tests/test_packageindex.py | 377 | """Package Index Tests
"""
import sys
import os
import unittest
import pkg_resources
from setuptools.compat import urllib2, httplib, HTTPError, unicode, pathname2url
import distutils.errors
import setuptools.package_index
from setuptools.tests.server import IndexServer
class TestPackageIndex(unittest.TestCase):
d... |
kalikaneko/euler | refs/heads/master | 003/primefactor.py | 1 | import math
def is_prime(x):
d = 2
while d * d <= x:
if x % d == 0:
return False
d += 1
return x > 1
def factors(x):
yield 1
for i in xrange(2, int(math.sqrt(x))):
if x % i == 0:
yield i
yield x/i
yield x
print max(filter(is_prime,... |
pombredanne/django-rest-swagger | refs/heads/master | tests/compat/mock.py | 2 | # pylint: disable=W0614,W0401
from __future__ import absolute_import
try:
from unittest.mock import *
except ImportError:
from mock import *
|
UWPCE-PythonCert/IntroPython2016 | refs/heads/master | students/spencer_mcghin/session5/Exception_Lab.py | 3 | def safe_input(input_string=""):
try:
n = input(input_string)
return n
except (KeyboardInterrupt, EOFError):
return None
if __name__ == "__main__":
n = safe_input("Provide a string: ")
if n is None:
print("Program terminated by user.")
else:
print("User resp... |
apache/incubator-metron | refs/heads/master | metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/service_check.py | 11 | #!/usr/bin/env python
"""
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");... |
PlayUAV/MissionPlanner | refs/heads/master | Lib/encodings/cp865.py | 93 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP865.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors=... |
smallyear/linuxLearn | refs/heads/master | salt/salt/daemons/test/test_raetkey.py | 3 | # -*- coding: utf-8 -*-
'''
Tests to try out salt key.RaetKey Potentially ephemeral
'''
from __future__ import absolute_import
# pylint: skip-file
# pylint: disable=C0103
import sys
from salt.ext.six.moves import map
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
import os
im... |
fxfitz/ansible | refs/heads/devel | test/units/plugins/connection/test_winrm.py | 3 | # -*- coding: utf-8 -*-
# (c) 2018, Jordan Borean <[email protected]>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import pytest
from io import Strin... |
Gutier14/CAAFinder | refs/heads/master | tests/test.py | 1 | # -*- coding: utf-8 -*-
from caafinder.database import database
from caafinder.workspace import *
import os
if __name__=='__main__':
print("Hello CAA Developer")
# db = database()
# db.initDatabase('~/Developer/CAAFinderffffff')
# print(len(db))
# print(db.querryByHeader('CATBoolean.h'))
# ... |
Akasurde/virt-manager | refs/heads/master | virtinst/idmap.py | 5 | #
# Copyright 2014 Fujitsu Limited.
# Chen Hanxiao <chenhanxiao at cn.fujitsu.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; either version 2 of the License, or
# (at your option) any la... |
Pinecast/pinecast | refs/heads/master | dashboard/migrations/0006_auto_20170209_1712.py | 3 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-02-09 17:12
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0005_collabor... |
CJ8664/servo | refs/heads/master | tests/wpt/web-platform-tests/fetch/api/resources/method.py | 161 | def main(request, response):
headers = []
if "cors" in request.GET:
headers.append(("Access-Control-Allow-Origin", "*"))
headers.append(("Access-Control-Allow-Credentials", "true"))
headers.append(("Access-Control-Allow-Methods", "GET, POST, PUT, FOO"))
headers.append(("Access-Co... |
Amechi101/concepteur-market-app | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/pkg_resources.py | 160 | """
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path operations to manipul... |
doismellburning/django | refs/heads/master | tests/template_backends/test_dummy.py | 14 | # coding: utf-8
from __future__ import unicode_literals
from django.http import HttpRequest
from django.middleware.csrf import CsrfViewMiddleware, get_token
from django.template import TemplateDoesNotExist, TemplateSyntaxError
from django.template.backends.dummy import TemplateStrings
from django.test import SimpleTe... |
jacklee0810/QMarkdowner | refs/heads/master | dpkt/smb.py | 15 | # $Id: smb.py 23 2006-11-08 15:45:33Z dugsong $
"""Server Message Block."""
import dpkt
class SMB(dpkt.Packet):
__hdr__ = [
('proto', '4s', ''),
('cmd', 'B', 0),
('err', 'I', 0),
('flags1', 'B', 0),
('flags2', 'B', 0),
('pad', '6s', ''),
('tid', 'H', 0),
('pid', 'H', 0),
('uid... |
GbalsaC/bitnamiP | refs/heads/master | venv/lib/python2.7/site-packages/pygments/lexers/html.py | 72 | # -*- coding: utf-8 -*-
"""
pygments.lexers.html
~~~~~~~~~~~~~~~~~~~~
Lexers for HTML, XML and related markup.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, ExtendedRegexLexer, inclu... |
geekaia/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/tests/test_conditional.py | 37 | import json
import unittest
from fs.memoryfs import MemoryFS
from mock import Mock, patch
from xblock.field_data import DictFieldData
from xblock.fields import ScopeIds
from xmodule.error_module import NonStaffErrorDescriptor
from opaque_keys.edx.locations import SlashSeparatedCourseKey, Location
from xmodule.modules... |
RackHD-Mirror/RackHD | refs/heads/master | test/tests/rackhd20/test_rackhd20_api_lookups.py | 13 | '''
Copyright 2016, EMC, Inc.
Author(s):
George Paulos
'''
import fit_path # NOQA: unused import
import os
import sys
import subprocess
import fit_common
# Select test group here using @attr
from nose.plugins.attrib import attr
@attr(all=True, regression=True, smoke=True)
class rackhd20_api_lookups(fit_common.unit... |
lj020326/cloudify3-plugin-test | refs/heads/master | plugin/__init__.py | 1 | __author__ = 'Lee' |
dimroc/tensorflow-mnist-tutorial | refs/heads/master | lib/python3.6/site-packages/tensorflow/examples/tutorials/mnist/input_data.py | 165 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
wanggang3333/scikit-learn | refs/heads/master | sklearn/covariance/tests/test_graph_lasso.py | 272 | """ Test the graph_lasso module.
"""
import sys
import numpy as np
from scipy import linalg
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_less
from sklearn.covariance import (graph_lasso, GraphLasso, GraphLassoCV,
empirical_... |
eval1749/elang | refs/heads/master | testing/PRESUBMIT.py | 134 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for testing.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmit API ... |
bdrung/audacity | refs/heads/master | lib-src/libsndfile/src/binheader_writef_check.py | 41 | #!/usr/bin/python
# Copyright (C) 2006-2011 Erik de Castro Lopo <[email protected]>
#
# 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 ... |
toontownfunserver/Panda3D-1.9.0 | refs/heads/master | samples/Solar-System/Tut-Step-5-Complete-Solar-System.py | 3 | # Author: Shao Zhang and Phil Saltzman
# Last Updated: 4/19/2005
#
# This tutorial is intended as a initial panda scripting lesson going over
# display initialization, loading models, placing objects, and the scene graph.
#
# Step 5: Here we put the finishing touches on our solar system model by
# making the planets m... |
balister/GNU-Radio | refs/heads/adap | gr-video-sdl/python/video_sdl/qa_video_sdl.py | 57 | #!/usr/bin/env python
#
# Copyright 2006,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your optio... |
tenggyut/PicScrapy | refs/heads/master | tutorial/items.py | 1 | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class JdPicture(scrapy.Item):
title = scrapy.Field()
image_urls = scrapy.Field()
catalog = scrapy.Field()
|
Fiware/ops.Sla-dashboard | refs/heads/master | manage.py | 3 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sladashboard.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
alimony/django | refs/heads/master | django/contrib/auth/migrations/0004_alter_user_username_opts.py | 134 | from django.contrib.auth import validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('auth', '0003_alter_user_email_max_length'),
]
# No database changes; modifies validators and error_messages (#13147).
operations = [
migration... |
michaelaye/scikit-image | refs/heads/master | skimage/transform/hough_transform.py | 7 | import numpy as np
from scipy import ndimage as ndi
from .. import measure, morphology
from ._hough_transform import _hough_circle
def hough_line_peaks(hspace, angles, dists, min_distance=9, min_angle=10,
threshold=None, num_peaks=np.inf):
"""Return peaks in hough transform.
Identifies m... |
MartinEnder/erpnext-de | refs/heads/develop | erpnext/selling/doctype/campaign/test_campaign.py | 121 | # 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
test_records = frappe.get_test_records('Campaign') |
jmacmahon/invenio | refs/heads/elasticsearch_logging | modules/websearch/lib/websearch_external_collections.py | 2 | # -*- coding: utf-8 -*-
# This file is part of Invenio.
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN.
#
# Invenio 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
# Lic... |
shakamunyi/neutron-vrrp | refs/heads/master | neutron/plugins/opencontrail/contrail_plugin.py | 10 | # Copyright 2014 Juniper Networks. 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... |
rrrichter/ufrgs | refs/heads/master | biologia_computacional/assignment7/e7-1a.py | 1 | import numpy as np
import copy
amountOfNodes = 0
class Node:
def __init__(self):
self.children = []
global amountOfNodes
self.id = amountOfNodes-1
amountOfNodes += 1
self.distanceFromParent = 0
# Initiate distance Mat
def initDistMat():
distMat = np.zeros((5,5))
distMat[0][1] = 0.189
distMat[0][2] =... |
helldorado/ansible | refs/heads/devel | lib/ansible/module_utils/alicloud_ecs.py | 66 | # 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... |
shahbazn/neutron | refs/heads/master | neutron/cmd/netns_cleanup.py | 24 | # Copyright (c) 2012 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... |
mega-sanke/mega-snake-python | refs/heads/master | src/notification.py | 1 | import globals
def __notify__(user, type, *message):
"""
This function send a notifications for the user
:param user: the user whom this function notify
:type user: globals.User
:param type: the type of the message
:type type: str
:param message: the contact for the message
:type message: list[str]
... |
rlbabyuk/integration_tests | refs/heads/master | fixtures/parallelizer/__init__.py | 1 | """Parallel testing, supporting arbitrary collection ordering
The Workflow
------------
- Master py.test process starts up, inspects config to decide how many slave to start, if at all
- env['parallel_base_urls'] is inspected first
- py.test config.option.appliances and the related --appliance cmdline flag are u... |
tempbottle/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/ctypes/test/test_byteswap.py | 71 | import sys, unittest, struct, math, ctypes
from binascii import hexlify
from ctypes import *
def bin(s):
return hexlify(memoryview(s)).decode().upper()
# Each *simple* type that supports different byte orders has an
# __ctype_be__ attribute that specifies the same type in BIG ENDIAN
# byte order, and a __ctype_l... |
rafaeltomesouza/frontend-class1 | refs/heads/master | aula2/a13/linkedin/client/.gradle/nodejs/node-v7.5.0-darwin-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py | 2779 | # Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""gypsh output module
gypsh is a GYP shell. It's not really a generator per se. All it does is
fire up an interactive Python session with a few local variables... |
sserrot/champion_relationships | refs/heads/master | venv/Lib/site-packages/win32comext/adsi/__init__.py | 1 | import win32com
import win32com.client
if type(__path__)==type(''):
# For freeze to work!
import sys
try:
from . import adsi
sys.modules['win32com.adsi.adsi'] = adsi
except ImportError:
pass
else:
# See if we have a special directory for the binaries (for developers)
win32com.__PackageSupportBuildPath__(__... |
LighthouseHPC/lighthouse | refs/heads/master | src/lighthouseProject/dojango/decorators.py | 6 | from django import VERSION as django_version
if django_version >= (1, 5, 0):
import json
else:
from django.utils import simplejson as json
from django.http import HttpResponseNotAllowed, HttpResponseServerError
from util import to_json_response
from util import to_dojo_data
try:
from functools import wrap... |
ContinuumIO/blaze | refs/heads/master | blaze/compute/tests/test_url_csv_compute.py | 2 | import pytest
import os
from blaze import data, compute
from blaze.utils import raises
from odo import URL, CSV
import pandas as pd
import pandas.util.testing as tm
from functools import partial
try:
from urllib2 import urlopen
from urllib2 import HTTPError, URLError
except ImportError:
from urllib.req... |
DailyActie/Surrogate-Model | refs/heads/master | 01-codes/scikit-learn-master/benchmarks/bench_plot_ward.py | 1 | """
Benchmark scikit-learn's Ward implement compared to SciPy's
"""
import time
import numpy as np
import pylab as pl
from scipy.cluster import hierarchy
from sklearn.cluster import AgglomerativeClustering
ward = AgglomerativeClustering(n_clusters=3, linkage='ward')
n_samples = np.logspace(.5, 3, 9)
n_features = np... |
khosrow/metpx | refs/heads/master | sarracenia/sarra/sr_shovel.py | 1 | #!/usr/bin/python3
#
# This file is part of sarracenia.
# The sarracenia suite is Free and is proudly provided by the Government of Canada
# Copyright (C) Her Majesty The Queen in Right of Canada, Environment Canada, 2008-2015
#
# Questions or bugs report: [email protected]
# sarracenia repository: git://git.code.sf.... |
jemekite/Dougpool | refs/heads/master | p2pool/test/bitcoin/test_getwork.py | 275 | import unittest
from p2pool.bitcoin import getwork, data as bitcoin_data
class Test(unittest.TestCase):
def test_all(self):
cases = [
{
'target': '0000000000000000000000000000000000000000000000f2b944000000000000',
'midstate': '5982f893102dec03e374b472647c4f19b1b... |
peastman/deepchem | refs/heads/master | deepchem/feat/tests/test_atomic_coordinates.py | 2 | """
Test atomic coordinates and neighbor lists.
"""
import os
import logging
import numpy as np
import unittest
from deepchem.utils import conformers
from deepchem.feat import AtomicCoordinates
from deepchem.feat import NeighborListAtomicCoordinates
from deepchem.feat import NeighborListComplexAtomicCoordinates
logger... |
Jgarcia-IAS/SAT | refs/heads/master | openerp/addons-extra/odoo-pruebas/odoo-server/addons/account/tests/test_search.py | 204 | from openerp.tests.common import TransactionCase
class TestSearch(TransactionCase):
"""Tests for search on name_search (account.account)
The name search on account.account is quite complexe, make sure
we have all the correct results
"""
def setUp(self):
super(TestSearch, self).setUp()
... |
chros73/rtorrent-ps-ch | refs/heads/master | tasks.py | 2 | # -*- coding: utf-8 -*-
#
# Project Tasks
#
from __future__ import print_function, unicode_literals
import os
import re
import time
import glob
import shutil
import subprocess
from invoke import task
SPHINX_AUTOBUILD_PORT = 8340
def watchdog_pid(ctx):
"""Get watchdog PID via ``netstat``."""
result = ctx.ru... |
cloudcopy/seahub | refs/heads/master | seahub/signals.py | 5 | import django.dispatch
# Use org_id = -1 if it's not an org repo
repo_created = django.dispatch.Signal(providing_args=["org_id", "creator", "repo_id", "repo_name"])
repo_deleted = django.dispatch.Signal(providing_args=["org_id", "usernames", "repo_owner", "repo_id", "repo_name"])
share_file_to_user_successful = djang... |
kawamon/hue | refs/heads/master | apps/filebrowser/src/filebrowser/templatetags/__init__.py | 646 | #!/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... |
hnakamur/saklient.python | refs/heads/master | saklient/cloud/facility.py | 1 | # -*- coding:utf-8 -*-
from .models.model_region import Model_Region
from .client import Client
from ..util import Util
import saklient
# module saklient.cloud.facility
class Facility:
## 設備情報にアクセスするためのモデルを集めたクラス。
# (instance field) _region
## @return {saklient.cloud.models.model_region.Model_R... |
alpayOnal/flj | refs/heads/master | flj/settings.py | 2 | """
Django settings for flj project.
Generated by 'django-admin startproject' using Django 1.9.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# Bui... |
sgallagher/reviewboard | refs/heads/master | reviewboard/reviews/urls.py | 2 | from __future__ import unicode_literals
from django.conf.urls import include, patterns, url
from reviewboard.reviews.views import (ReviewsDiffFragmentView,
ReviewsDiffViewerView,
ReviewsDownloadPatchErrorBundleView)
download_diff_urls = p... |
ict-felix/stack | refs/heads/master | vt_manager_kvm/src/python/vt_manager_kvm/communication/sfa/methods/Remove.py | 1 | from vt_manager_kvm.communication.sfa.util.xrn import Xrn
from vt_manager_kvm.communication.sfa.util.method import Method
from vt_manager_kvm.communication.sfa.trust.credential import Credential
from vt_manager_kvm.communication.sfa.util.parameter import Parameter, Mixed
class Remove(Method):
"""
Remove an o... |
mikeing2001/LoopDetection | refs/heads/master | pox/forwarding/l3_learning.py | 3 | # Copyright 2011,2012 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 d... |
nikitabiradar/student_registration | refs/heads/master | janastu/lib/python2.7/site-packages/setuptools/command/test.py | 20 | from distutils.errors import DistutilsOptionError
from unittest import TestLoader
import sys
from pkg_resources import (resource_listdir, resource_exists, normalize_path,
working_set, _namespace_packages,
add_activation_listener, require, EntryPoint)
from setuptool... |
apache/bloodhound | refs/heads/trunk | bloodhound_multiproduct/tests/db/cursor.py | 2 | # -*- coding: utf-8 -*-
#
# 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 (... |
toshywoshy/ansible | refs/heads/devel | lib/ansible/module_utils/json_utils.py | 89 | # 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... |
rrmelcer/swissatest-analysis | refs/heads/master | gui/__init__.py | 7 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# -----------------------------------------------
# ----> Computer Aided Optical Analysis <----
# -----------------------------------------------
# (c) 2015 by Swissatest Testmaterialien AG
# http://www.swissatest.ch
# -----------------------------------------------
# Devel... |
cloudy064/googletest | refs/heads/master | test/gtest_env_var_test.py | 2408 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
x1101/nikola | refs/heads/master | nikola/plugins/command/new_page.py | 4 | # -*- coding: utf-8 -*-
# Copyright © 2012-2016 Roberto Alsina, Chris Warrick and others.
# 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... |
leifos/ifind | refs/heads/master | ifind/search/engines/googlecse.py | 1 | import json
import requests
from ifind.search.engine import Engine
from ifind.search.response import Response
from ifind.search.exceptions import EngineAPIKeyException, QueryParamException, EngineConnectionException
# TODO: Bug fix - utils and utils.encoding do not exist
# from ifind.utils.encoding import encode_symbo... |
weritos666/kernel_L7_II_KK | refs/heads/master | scripts/tracing/draw_functrace.py | 14679 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <[email protected]>
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 ... |
a4tech/dvbapp2-gui | refs/heads/master | lib/python/Components/InputDevice.py | 9 | from os import listdir, open as os_open, close as os_close, write as os_write, O_RDWR, O_NONBLOCK
from fcntl import ioctl
from boxbranding import getBoxType, getBrandOEM
import struct
from config import config, ConfigSubsection, ConfigInteger, ConfigYesNo, ConfigText, ConfigSlider
from Tools.Directories import pathExi... |
BackupGGCode/sphinx | refs/heads/master | sphinx/util/smartypants.py | 4 | r"""
This is based on SmartyPants.py by `Chad Miller`_.
Copyright and License
=====================
SmartyPants_ license::
Copyright (c) 2003 John Gruber
(http://daringfireball.net/)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitt... |
donkirkby/django | refs/heads/master | django/core/serializers/json.py | 320 | """
Serialize data to/from JSON
"""
# Avoid shadowing the standard library json module
from __future__ import absolute_import, unicode_literals
import datetime
import decimal
import json
import sys
import uuid
from django.core.serializers.base import DeserializationError
from django.core.serializers.python import (
... |
atheed/servo | refs/heads/master | tests/wpt/web-platform-tests/fetch/api/resources/method.py | 161 | def main(request, response):
headers = []
if "cors" in request.GET:
headers.append(("Access-Control-Allow-Origin", "*"))
headers.append(("Access-Control-Allow-Credentials", "true"))
headers.append(("Access-Control-Allow-Methods", "GET, POST, PUT, FOO"))
headers.append(("Access-Co... |
Vishluck/sympy | refs/heads/master | sympy/series/tests/test_lseries.py | 121 | from sympy import sin, cos, exp, tanh, E, S, Order
from sympy.abc import x, y
def test_sin():
e = sin(x).lseries(x)
assert next(e) == x
assert next(e) == -x**3/6
assert next(e) == x**5/120
def test_cos():
e = cos(x).lseries(x)
assert next(e) == 1
assert next(e) == -x**2/2
assert next... |
yuanagain/seniorthesis | refs/heads/master | venv/lib/python2.7/site-packages/numpy/f2py/tests/util.py | 66 | """
Utility functions for
- building and importing modules on test time, using a temporary location
- detecting if compilers are present
"""
from __future__ import division, absolute_import, print_function
import os
import sys
import subprocess
import tempfile
import shutil
import atexit
import textwrap
import re
im... |
dzbarsky/servo | refs/heads/master | tests/wpt/web-platform-tests/websockets/cookies/support/set-cookie.py | 249 | import urllib
def main(request, response):
response.headers.set('Set-Cookie', urllib.unquote(request.url_parts.query))
return [("Content-Type", "text/plain")], ""
|
danieldanciu/schoggi | refs/heads/master | tests/functional/student_answers.py | 6 | # Copyright 2014 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 ... |
mediatum/mediatum | refs/heads/master | web/admin/views/__init__.py | 1 | # -*- coding: utf-8 -*-
"""
web.admin.views
~~~~~~~~~~~~~~~~~~
this package is part of mediatum - a multimedia content repository
:copyright: (c) 2016 by the mediaTUM authors
:license: GPL3, see COPYING for details
"""
from __future__ import absolute_import
from core import db
from flask_admin.cont... |
shechque/python-web-fundation | refs/heads/master | twistedserver2.py | 1 |
from twisted.internet import reactor
from twisted.internet.protocol import Factory
from twisted.protocols.basic import LineReceiver
class SimpleLogger(LineReceiver):
def connectionMade(self):
print 'Got connection from',self.transport.client
def connectionLost(self,reason):
print self.transport.client,'disconn... |
immenz/pyload | refs/heads/stable | module/lib/thrift/server/TNonblockingServer.py | 83 | #
# 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 u... |
ntkrnl/yacoin-p2pool | refs/heads/master | p2pool/bitcoin/height_tracker.py | 45 | from twisted.internet import defer, task
from twisted.python import log
import p2pool
from p2pool.bitcoin import data as bitcoin_data
from p2pool.util import deferral, forest, jsonrpc, variable
class HeaderWrapper(object):
__slots__ = 'hash previous_hash'.split(' ')
@classmethod
def from_header(cls, ... |
tonycao/IntroToHadoopAndMR__Udacity_Course | refs/heads/master | ProblemStatement2/Python/P2Q1_Reducer.py | 12 | #!/usr/bin/python
# Write a MapReduce program which will display the number of hits for each different file on the Web site.
import sys
countTotal = 0
oldKey = None
# Loop around the data
# It will be in the format key\tval
#
for line in sys.stdin:
data_mapped = line.strip().split("\t")
if len(data_mapped... |
doismellburning/django | refs/heads/master | tests/migrations/test_migrations_run_before/0003_third.py | 427 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
"""
This is a wee bit crazy, but it's just to show that run_before works.
"""
dependencies = [
("migrations", "0001_initial"),
]
run_before... |
cirrusone/phantom2 | refs/heads/master | src/breakpad/src/tools/gyp/test/module/gyptest-default.py | 158 | #!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies simple build of a "Hello, world!" program with loadable modules. The
default for all platforms should be to output the loadable... |
aniversarioperu/twython-django | refs/heads/master | twython_django_oauth/models.py | 3 | from django.db import models
from django.contrib.auth.models import User
class TwitterProfile(models.Model):
"""
An example Profile model that handles storing the oauth_token and
oauth_secret in relation to a user. Adapt this if you have a current
setup, there's really nothing special goin... |
nmercier/linux-cross-gcc | refs/heads/master | win32/bin/Lib/aifc.py | 2 | """Stuff to parse AIFF-C and AIFF files.
Unless explicitly stated otherwise, the description below is true
both for AIFF-C files and AIFF files.
An AIFF-C file has the following structure.
+-----------------+
| FORM |
+-----------------+
| <size> |
+----+------------+
| ... |
jk1/intellij-community | refs/heads/master | python/testData/completion/qualifiedAssignment.after.py | 83 | def foo(a):
woo = []
a.words = {}
for x in woo
|
nicobustillos/odoo | refs/heads/8.0 | addons/mail/mail_vote.py | 439 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
neutrongenious/xrt | refs/heads/master | X-Art Parser/beautifulsoup4-4.3.1/bs4/tests/test_htmlparser.py | 433 | """Tests to ensure that the html.parser tree builder generates good
trees."""
from bs4.testing import SoupTest, HTMLTreeBuilderSmokeTest
from bs4.builder import HTMLParserTreeBuilder
class HTMLParserTreeBuilderSmokeTest(SoupTest, HTMLTreeBuilderSmokeTest):
@property
def default_builder(self):
return ... |
avneesh91/django | refs/heads/master | django/conf/locale/ka/formats.py | 65 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'l, j F, Y'
TIME_FORMAT = 'h:i a'
DATETIME_FORMAT = 'j F, Y h:i a'
YEAR_MONTH_FORMAT = 'F, Y'
MONTH_D... |
m-a-d-n-e-s-s/madness-seprep | refs/heads/master | src/madness/tensor/new_mtxmq/codegen/mtxm.py | 5 | """ Codegen for mtxm
A I
+-------------+
K | a b ....... |
| ... |
+-------------+
B J
+-------------+
K | i j k l ... |
| ... |
+-------------+
C J
+-------------+
I | w x y z ... |
| ... |
+-------------+
# Complex Complex
w += a i - b j
x += a j + b i
y += a k - b ... |
iulian787/spack | refs/heads/develop | lib/spack/external/py/_builtin.py | 259 | import sys
try:
reversed = reversed
except NameError:
def reversed(sequence):
"""reversed(sequence) -> reverse iterator over values of the sequence
Return a reverse iterator
"""
if hasattr(sequence, '__reversed__'):
return sequence.__reversed__()
if not hasa... |
MichaelAquilina/restructured-preview | refs/heads/master | lib/docutils/utils/code_analyzer.py | 86 | #!/usr/bin/python
# coding: utf-8
"""Lexical analysis of formal languages (i.e. code) using Pygments."""
# :Author: Georg Brandl; Felix Wiemann; Günter Milde
# :Date: $Date: 2011-12-20 15:14:21 +0100 (Die, 20. Dez 2011) $
# :Copyright: This module has been placed in the public domain.
from docutils import Applicatio... |
wimnat/ansible | refs/heads/devel | test/integration/targets/module_utils_urls/library/test_peercert.py | 29 | #!/usr/bin/python
# Copyright: (c) 2020, Ansible Project
# 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
DOCUMENTATION = r'''
---
module: test_perrcert
short_description: Test getting t... |
moble/scri | refs/heads/main | scri/asymptotic_bondi_data/bms_charges.py | 1 | # Copyright (c) 2020, Michael Boyle
# See LICENSE file for details: <https://github.com/moble/scri/blob/master/LICENSE>
### NOTE: The functions in this file are intended purely for inclusion in the AsymptoticBondData
### class. In particular, they assume that the first argument, `self` is an instance of
### Asymptoti... |
Coelhon/MasterRepo.repository | refs/heads/master | plugin.video.motorreplays/resources/libs/net.py | 15 | '''
common XBMC Module
Copyright (C) 2011 t0mm0
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 your option) any later version.
Th... |
openplans/shareabouts-clatsop | refs/heads/master | src/sa_web/config.py | 60 | import yaml
import os.path
import urllib2
from contextlib import closing
from django.conf import settings
from django.utils.translation import ugettext as _
def get_shareabouts_config(path_or_url):
if path_or_url.startswith('http://') or path_or_url.startswith('https://'):
return ShareaboutsRemoteConfig(p... |
anksp21/Community-Zenpacks | refs/heads/master | ZenPacks.community.Gentoo/ZenPacks/community/Gentoo/tests/plugindata/linux/server1/uname.py | 3 | {"gentoo_uname_a":
dict(
snmpDescr = 'Linux gentoovmware 2.6.29-gentoo-r5 #1 SMP Sun Jun 7 01:18:09 EDT 2009 i686 Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz GenuineIntel GNU/Linux',
setHWProductKey = 'Linux',
snmpSysName = 'gentoovmware',
setOSProductKey = ('L... |
JingJunYin/tensorflow | refs/heads/master | tensorflow/python/grappler/tf_optimizer.py | 43 | # 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... |
linjoahow/W16_test1 | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/logging/config.py | 739 | # Copyright 2001-2013 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... |
dragondjf/musicplayer | refs/heads/master | config/constants.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
MainWindow_Width = 905
MainWindow_Height = 600
SimpleWindow_Width = 300
SimpleWindow_Height = 600
TitleBar_Height = 25
LeftBar_Width = 60
Bottom_Height = 100
Simple_Bottom_Height = 200
|
xiaoyaozi5566/DynamicCache | refs/heads/master | src/python/m5/util/region.py | 64 | # Copyright (c) 2006 Nathan Binkert <[email protected]>
# 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 condi... |
ytoyama/yans_chainer_hackathon | refs/heads/master | cupy/binary/packing.py | 17 | # flake8: NOQA
# "flake8: NOQA" to suppress warning "H104 File contains nothing but comments"
# TODO(okuta): Implement packbits
# TODO(okuta): Implement unpackbits
|
Hybrid-Cloud/cinder | refs/heads/master | cinder/message/resource_types.py | 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.