repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
darafferty/factor | refs/heads/master | docs/source/numfig.py | 17 | from docutils.nodes import figure, caption, Text, reference, raw, SkipNode, Element
from sphinx.roles import XRefRole
# Element classes
class page_ref(reference):
pass
class num_ref(reference):
pass
# Visit/depart functions
def skip_page_ref(self, node):
raise SkipNode
def latex_visit_page_ref(self,... |
huran2014/huran.github.io | refs/heads/master | wot_gateway/usr/lib/python2.7/encodings/mac_croatian.py | 593 | """ Python Character Mapping Codec mac_croatian generated from 'MAPPINGS/VENDORS/APPLE/CROATIAN.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_table)
def decode(self,inp... |
hehongliang/tensorflow | refs/heads/master | tensorflow/contrib/slim/python/slim/nets/resnet_utils.py | 69 | # 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... |
sudosurootdev/external_chromium_org | refs/heads/L5 | components/policy/tools/syntax_check_policy_template_json.py | 34 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''
Checks a policy_templates.json file for conformity to its syntax specification.
'''
import json
import optparse
import os
impo... |
allenp/odoo | refs/heads/9.0 | addons/account/models/account_bank_statement.py | 1 | # -*- coding: utf-8 -*-
from openerp import api, fields, models, _
from openerp.osv import expression
from openerp.tools import float_is_zero
from openerp.tools import float_compare, float_round
from openerp.tools.misc import formatLang
from openerp.exceptions import UserError, ValidationError
import time
import math... |
kbrock/FrameworkBenchmarks | refs/heads/master | frameworks/Python/historical/webware/app/Context/queries.py | 77 | import json
from random import randint
from functools import partial
from WebKit.HTTPContent import HTTPContent
from DbSession import Database
from World import World
import UrlHelper
class queries(HTTPContent):
def defaultAction(self):
self.response().clearHeaders()
self.response()._headers["Con... |
jammerful/buildbot | refs/heads/master | master/buildbot/test/unit/test_changes_changes.py | 10 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
affo/nova | refs/heads/master | nova/openstack/common/cliutils.py | 57 | # Copyright 2012 Red Hat, 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 agre... |
olemis/brython | refs/heads/master | www/src/Lib/xml/etree/cElementTree.py | 876 | # Deprecated alias for xml.etree.ElementTree
from xml.etree.ElementTree import *
|
hainm/scikit-learn | refs/heads/master | sklearn/utils/tests/test_sparsefuncs.py | 157 | import numpy as np
import scipy.sparse as sp
from scipy import linalg
from numpy.testing import assert_array_almost_equal, assert_array_equal
from sklearn.datasets import make_classification
from sklearn.utils.sparsefuncs import (mean_variance_axis,
inplace_column_scale,
... |
bthirion/scikit-learn | refs/heads/master | examples/applications/plot_topics_extraction_with_nmf_lda.py | 12 | """
========================================================
Topic extraction with Non-negative Matrix Factorization\
and Latent Dirichlet Allocation
========================================================
This is an example of applying :class:`sklearn.decomposition.NMF` and
:class:`sklearn.decomposition.LatentDirich... |
ueshin/apache-spark | refs/heads/master | python/pyspark/sql/pandas/serializers.py | 23 | #
# 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... |
OCA/sale-workflow | refs/heads/12.0 | sale_order_product_recommendation/models/sale_order.py | 1 | # Copyright 2020 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models
class SaleOrderLine(models.Model):
_inherit = "sale.order.line"
# Add database index to get last sale price query performance
product_id = fields.Many2one(index=Tru... |
Fusion-Rom/android_external_skia | refs/heads/lp5.1 | platform_tools/android/bin/gyp_to_android.py | 66 | #!/usr/bin/python
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Script for generating the Android framework's version of Skia from gyp
files.
"""
import os
import shutil
import sys
import tempfile
# Find the top of trunk
SCRI... |
Yinzhe-Qi/YuiOss | refs/heads/master | yui_oss/console.py | 1 | # -*- coding: utf-8 -*-
import argparse
from colorama import init, Fore
from argparse import ArgumentParser
from .manager import OssFileManager, VERSION
from .exception import *
import yaml
import sys
import os
class Yui:
path = sys.path[0]
if os.path.isfile(path):
path = os.path.dirname(path)
A... |
bostrick/tch.cowork | refs/heads/master | tch/__init__.py | 916 | # See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
|
sourcepole/kadas-albireo | refs/heads/master | tests/src/python/test_qgsrasterfilewriter.py | 11 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsRasterFileWriter.
.. note:: 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.
"... |
Aelshafei/a2lr | refs/heads/master | ua_parser/_regexes.py | 1 | ############################################
# NOTICE: This file is autogenerated from #
# regexes.yaml. Do not edit by hand, #
# instead, re-run `setup.py build_regexes` #
############################################
#from __future__ import absolute_import
from ua_parser.user_agent_parser import (
UserAgen... |
kangxu/crosswalk-test-suite | refs/heads/master | webapi/tct-csp-w3c-tests/csp-py/csp_media-src_corss-origin_audio_blocked_ext.py | 30 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
_CSP = "media-src http://www.... |
Yubico/python-pyhsm | refs/heads/master | pyhsm/stick.py | 2 | """
module for actually talking to the YubiHSM
"""
# Copyright (c) 2011 Yubico AB
# See the file COPYING for licence statement.
__all__ = [
# constants
# functions
'read',
'write',
'flush',
# classes
'YHSM_Stick',
]
import sys
import serial
import pyhsm.util
import pyhsm.exception
class... |
jcowley/python-openid | refs/heads/master | openid/yadis/constants.py | 179 | __all__ = ['YADIS_HEADER_NAME', 'YADIS_CONTENT_TYPE', 'YADIS_ACCEPT_HEADER']
from openid.yadis.accept import generateAcceptHeader
YADIS_HEADER_NAME = 'X-XRDS-Location'
YADIS_CONTENT_TYPE = 'application/xrds+xml'
# A value suitable for using as an accept header when performing YADIS
# discovery, unless the application... |
mozilla/stoneridge | refs/heads/master | python/src/Demo/tkinter/matt/canvas-with-scrollbars.py | 46 | from Tkinter import *
# This example program creates a scroling canvas, and demonstrates
# how to tie scrollbars and canvses together. The mechanism
# is analogus for listboxes and other widgets with
# "xscroll" and "yscroll" configuration options.
class Test(Frame):
def printit(self):
print "hi"
def... |
gsnbng/erpnext | refs/heads/develop | erpnext/healthcare/doctype/patient_assessment/test_patient_assessment.py | 3 | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestPatientAssessment(unittest.TestCase):
pass
|
MotionDogs/Lenzhound-dev-pre-release | refs/heads/master | tools/gtest/scripts/pump.py | 2471 | #!/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... |
home-assistant/home-assistant | refs/heads/dev | tests/components/advantage_air/test_sensor.py | 5 | """Test the Advantage Air Sensor Platform."""
from json import loads
from homeassistant.components.advantage_air.const import DOMAIN as ADVANTAGE_AIR_DOMAIN
from homeassistant.components.advantage_air.sensor import (
ADVANTAGE_AIR_SERVICE_SET_TIME_TO,
ADVANTAGE_AIR_SET_COUNTDOWN_VALUE,
)
from homeassistant.co... |
d40223223/608 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/result.py | 727 | """Test result object"""
import io
import sys
import traceback
from . import util
from functools import wraps
__unittest = True
def failfast(method):
@wraps(method)
def inner(self, *args, **kw):
if getattr(self, 'failfast', False):
self.stop()
return method(self, *args, **kw)
... |
ohgodscience/Python | refs/heads/master | mousetrackerproc/mousetracker_processing.py | 3 | import pandas as pd
import os
rootdir = 'C:/Users/Bryan/Desktop/MT_corrected'
def self_chips(line):
pid = ""
answer = ""
for i, char in enumerate(line):
if i <= 6:
pid = str(pid) + str(char)
if i > 63 and i < 67:
answer = answer + char
return [pid, answer]
def a... |
tudorvio/nova | refs/heads/master | nova/api/openstack/compute/plugins/v3/admin_actions.py | 33 | # Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
ake-koomsin/mapnik_nvpr | refs/heads/master | tests/visual_tests/test_python.py | 2 | #!/usr/bin/env python
import mapnik
import sys
import os.path
from compare import compare, summary
dirname = os.path.dirname(__file__)
class MyText(mapnik.FormattingNode):
def __init__(self):
mapnik.FormattingNode.__init__(self)
self.expr = mapnik.Expression("[name]")
self.expr_nr = mapnik... |
stevenbrichards/boto | refs/heads/develop | tests/integration/cognito/__init__.py | 112 | # Copyright (c) 2014 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 ... |
mganeva/mantid | refs/heads/master | qt/python/mantidqt/widgets/embedded_find_replace_dialog/test/__init__.py | 2 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2019 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
# This file is part of the mantidqt package
|
wylieswanson/agilepyfs | refs/heads/master | fs/expose/xmlrpc.py | 3 | """
fs.expose.xmlrpc
================
Server to expose an FS via XML-RPC
This module provides the necessary infrastructure to expose an FS object
over XML-RPC. The main class is 'RPCFSServer', a SimpleXMLRPCServer subclass
designed to expose an underlying FS.
If you need to use a more powerful server than SimpleXML... |
ronbelson/ghost-proxy-hebrew | refs/heads/master | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/styles/native.py | 364 | # -*- coding: utf-8 -*-
"""
pygments.styles.native
~~~~~~~~~~~~~~~~~~~~~~
pygments version of my "native" vim theme.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, ... |
ariff/robotframework-selenium2library | refs/heads/master | setup.py | 11 | #!/usr/bin/env python
import sys
from os.path import join, dirname
sys.path.append(join(dirname(__file__), 'src'))
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
execfile(join(dirname(__file__), 'src', 'Selenium2Library', 'version.py'))
DESCRIPTION = """
Selenium2Library is a web ... |
ivan-fedorov/intellij-community | refs/heads/master | python/testData/refactoring/move/namespacePackageUsedInMovedFunction/after/src/b.py | 79 | import nspkg
def func():
print(nspkg) |
hatwar/buyback-frappe | refs/heads/master | frappe/patches/v5_0/fix_email_alert.py | 61 | from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doctype("Email Alert")
for e in frappe.get_all("Email Alert"):
email_alert = frappe.get_doc("Email Alert", e.name)
if email_alert.event == "Date Change":
if email_alert.days_in_advance < 0:
email_alert.event = "Days After"... |
tiagofrepereira2012/tensorflow | refs/heads/master | tensorflow/contrib/labeled_tensor/__init__.py | 144 | # 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... |
ammarkhann/FinalSeniorCode | refs/heads/master | lib/python2.7/site-packages/IPython/core/completerlib.py | 7 | # encoding: utf-8
"""Implementations for various useful completers.
These are all loaded by default by IPython.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team.
#
# Distributed under the terms of the BSD License.
#
# The full ... |
aronparsons/spacewalk | refs/heads/master | backend/server/repomd/domain.py | 10 | #
# Copyright (c) 2008--2015 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... |
mikepea/fullerite | refs/heads/master | src/diamond/collectors/sqs/sqs.py | 56 | # coding=utf-8
"""
The SQS collector collects metrics for one or more Amazon AWS SQS queues
#### Configuration
Below is an example configuration for the SQSCollector.
You can specify an arbitrary amount of regions
```
enabled = True
interval = 60
[regions]
[[region-code]]
access_key_id = '...'
... |
berkeley-stat159/project-gamma | refs/heads/master | code/utils/kmeans.py | 2 | """
Wrapper for k-means clustering that takes cares of reshaping and generating labels.
"""
from __future__ import division
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import project_config
import sklearn.cluster
def perform_kMeans_clustering_analysis(feature_data, n_clusters):
""... |
aewhatley/scikit-learn | refs/heads/master | sklearn/manifold/tests/test_locally_linear.py | 232 | from itertools import product
from nose.tools import assert_true
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from scipy import linalg
from sklearn import neighbors, manifold
from sklearn.manifold.locally_linear import barycenter_kneighbors_graph
from sklearn.utils.testi... |
YOTOV-LIMITED/kuma | refs/heads/master | vendor/packages/translate/storage/omegat.py | 25 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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... |
samthor/intellij-community | refs/heads/master | python/testData/quickdoc/PropOldSetter.py | 83 | class A(object):
def __getX(self, x):
"Doc of getter"
self.__x = x
x = property(fset=__getX)
A().<the_ref>x = 1 |
shitolepriya/Saloon_erp | refs/heads/master | erpnext/manufacturing/doctype/bom/test_bom.py | 62 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from frappe.utils import cstr
test_records = frappe.get_test_records('BOM')
class TestBOM(unittest.TestCase):
def test... |
chriskmanx/qmole | refs/heads/master | QMOLEDEV/node/tools/scons/scons-local-1.2.0/SCons/Memoize.py | 12 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 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, including
# without limitation the... |
pinkra/neisse | refs/heads/master | src/agent/test/testComm.py | 1 | import sys, os
import re
__dir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(__dir + '/../model')
import unittest
from Comm import Comm
class TestComm(unittest.TestCase):
def test_comm(self):
comm = Comm('localhost')
comm.send('test')
self.assertTrue(True)
if __name__ =... |
zycdragonball/tensorflow | refs/heads/master | tensorflow/contrib/opt/python/training/delay_compensated_gradient_descent.py | 23 | # 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... |
mrkn/cuda-convnet2 | refs/heads/master | python_util/data.py | 180 | # 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... |
jgardner1/JGRPGTools | refs/heads/master | jgrpg/CreateItemPrototypeWidget.py | 1 | from PyQt5.uic import loadUiType
ui, base = loadUiType('ui/CreateItemPrototypeWidget.ui')
from PyQt5.QtCore import pyqtSignal, Qt
from jgrpg.model import ItemPrototypes
class CreateItemPrototypeWidget(base, ui):
def __init__(self, *, obj=None):
"""Creates an populates a Create / Edit Item Window.
... |
PaloAltoNetworks-BD/SplunkforPaloAltoNetworks | refs/heads/master | Splunk_TA_paloalto/bin/splunk_ta_paloalto/aob_py2/jsonschema/_version.py | 18 |
# This file is automatically generated by setup.py.
__version__ = '2.6.0'
__sha__ = 'gd16713a'
__revision__ = 'gd16713a'
|
sergeimoiseev/othodi_code | refs/heads/master | old2/test_tsp.py | 6 | import tsp
from math import sqrt
def test_rand_seq():
expected=range(100)
seq=list(tsp.rand_seq(100))
assert len(expected) == len(seq)
for n in expected:
assert n in seq
def test_all_pairs():
'''make sure we actually generate all pairs'''
expected=[(0,0),(0,1),(1,0),(1,1),(0,2),(... |
jank3/django | refs/heads/master | tests/migrations/test_migrations_backwards_deps_1/0002_second.py | 416 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [('migrations', '0001_initial')]
operations = []
|
WSDC-NITWarangal/django | refs/heads/master | django/contrib/gis/geos/coordseq.py | 374 | """
This module houses the GEOSCoordSeq object, which is used internally
by GEOSGeometry to house the actual coordinates of the Point,
LineString, and LinearRing geometries.
"""
from ctypes import byref, c_double, c_uint
from django.contrib.gis.geos import prototypes as capi
from django.contrib.gis.geos.base import... |
RydrDojo/Ridr_app | refs/heads/master | pylotVenv/lib/python2.7/site-packages/werkzeug/datastructures.py | 148 | # -*- coding: utf-8 -*-
"""
werkzeug.datastructures
~~~~~~~~~~~~~~~~~~~~~~~
This module provides mixins and classes with an immutable interface.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import sys
import cod... |
denys-duchier/kivy | refs/heads/master | examples/gestures/my_gestures.py | 29 | #!/usr/bin/env python
from kivy.gesture import GestureDatabase
gdb = GestureDatabase()
cross = gdb.str_to_gesture(
'eNq1l9tu3DYQhu/1It6bLjicE+cFtrcF/ACBYwv2Iqkt7G7a5u1DDqlT0lZ7I2Mxsj5JP2f4k'
'xR1OH85//X9+Npfb98uffd7Ow6hO7wM0D0+vD/92T90Q8z/5gN218eH6+3y8aW/5lPqDl8H7g'
'7/KvLot3WDFCnNzw8f5/dbeSyVx+w/Hvuj3NUN... |
elit3ge/SickRage | refs/heads/master | lib/babelfish/converters/name.py | 88 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2013 the BabelFish authors. All rights reserved.
# Use of this source code is governed by the 3-clause BSD license
# that can be found in the LICENSE file.
#
from __future__ import unicode_literals
from . import LanguageEquivalenceConverter
from ..language import LANGUAGE_MATRI... |
msingh172/youtube-dl | refs/heads/master | youtube_dl/extractor/tutv.py | 94 | from __future__ import unicode_literals
import base64
from .common import InfoExtractor
from ..compat import compat_parse_qs
class TutvIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tu\.tv/videos/(?P<id>[^/?]+)'
_TEST = {
'url': 'http://tu.tv/videos/robots-futbolistas',
'md5': '627c7c1... |
jrising/research-common | refs/heads/master | python/geogrid/geotiffgrid.py | 1 | import gdal
from spacegrid import SpatialGrid
class GeotiffGrid(SpatialGrid):
def __init__(self, filepath):
ds = gdal.Open(filepath)
x0_corner, sizex, zero1, y0_corner, zero2, sizey = ds.GetGeoTransform()
band = ds.GetRasterBand(1)
array = band.ReadAsArray()
self.array = ar... |
ashemedai/ansible | refs/heads/devel | lib/ansible/modules/web_infrastructure/ansible_tower/tower_label.py | 33 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
#
# 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 optio... |
eahneahn/free | refs/heads/master | lib/python2.7/site-packages/nose/__init__.py | 14 | from nose.core import collector, main, run, run_exit, runmodule
# backwards compatibility
from nose.exc import SkipTest, DeprecatedTest
from nose.tools import with_setup
__author__ = 'Jason Pellerin'
__versioninfo__ = (1, 3, 0)
__version__ = '.'.join(map(str, __versioninfo__))
__all__ = [
'main', 'run', 'run_exit... |
FrederichRiver/neutrino | refs/heads/master | applications/alkaid/alkaid/fundamental.py | 1 | #!/usr/bin/python3
from venus.stock_base import StockEventBase
from dev_global.env import GLOBAL_HEADER
class EventFundamental(StockEventBase):
def __init__(self, header):
super(EventFundamental, self).__init__(header)
def quarter_profit(self, stock_code, report_period):
result = self.mysql... |
hyperized/ansible | refs/heads/devel | lib/ansible/module_utils/postgres.py | 6 | # 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... |
stvoutsin/pyrothorn | refs/heads/master | pyrothorn/pyroquery/atpy/rechelper.py | 1 | import numpy as np
def append_field(rec, data, dtype=None, position='undefined'):
newdtype = rec.dtype.descr
if position == 'undefined':
newdtype.append(dtype)
else:
newdtype.insert(position, dtype)
newdtype = np.dtype(newdtype)
newrec = np.recarray(rec.shape, dtype=newdtype)
f... |
dhruvvyas90/RIOT | refs/heads/master | tests/posix_semaphore/tests/01-run.py | 5 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import sys
import ... |
Adai0808/scikit-learn | refs/heads/master | examples/cluster/plot_adjusted_for_chance_measures.py | 286 | """
==========================================================
Adjustment for chance in clustering performance evaluation
==========================================================
The following plots demonstrate the impact of the number of clusters and
number of samples on various clustering performance evaluation me... |
yan12125/youtube-dl | refs/heads/master | youtube_dl/extractor/nuevo.py | 51 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
float_or_none,
xpath_text
)
class NuevoBaseIE(InfoExtractor):
def _extract_nuevo(self, config_url, video_id, headers={}):
config = self._download_xml(
config_url, video_id,... |
ryancoleman/autodock-vina | refs/heads/master | boost_1_54_0/libs/mpi/test/python/all_reduce_test.py | 64 | # Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com>.
# Use, modification and distribution is subject to the Boost Software
# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Test all_reduce() collective.
import boost.parallel.mpi as mpi
fr... |
Tab3/android_kernel_samsung_lt02 | refs/heads/cm-12.1 | 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,... |
shenlong3030/asv-django-guestbook | refs/heads/master | djangoappengine/tests/__init__.py | 37 | from .backend import BackendTest
from .field_db_conversion import FieldDBConversionTest
from .field_options import FieldOptionsTest
from .filter import FilterTest
from .order import OrderTest
from .not_return_sets import NonReturnSetsTest
from .decimals import DecimalTest
|
NeblioTeam/neblio | refs/heads/master | test/functional/todo/feature_config_args.py | 1 | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test various command line arguments and configuration file parameters."""
import os
from test_framework.te... |
wwj718/edx-platform | refs/heads/master | common/djangoapps/util/tests/test_keyword_sub_utils.py | 130 | """
Tests for keyword_substitution.py
"""
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from ddt import ddt, file_data
from mock import patch
from util.date_utils import get_default_... |
quattor/aquilon | refs/heads/upstream | lib/aquilon/worker/commands/add_netgroup_whitelist.py | 1 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2014,2016,2017 Contributor
#
# 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... |
Werkov/PyQt4 | refs/heads/master | examples/opengl/hellogl.py | 17 | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2010 Riverbank Computing Limited.
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
##
## This file is part of the examples of PyQt.
##
## $QT_BEGIN_LICENS... |
InnovativeTravel/boto3facade | refs/heads/master | tests/test_iam.py | 14224 | # -*- coding: utf-8 -*-
|
sudheesh001/oh-mainline | refs/heads/master | vendor/packages/Django/django/test/html.py | 196 | """
Comparing two html documents.
"""
from __future__ import unicode_literals
import re
from django.utils.encoding import force_text
from django.utils.html_parser import HTMLParser, HTMLParseError
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
WHITESPACE = re.compile('\s+... |
glorizen/nupic | refs/heads/master | examples/opf/experiments/classification/category_TP_1/description.py | 32 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
skevy/django | refs/heads/master | tests/regressiontests/special_headers/views.py | 53 | # -*- coding:utf-8 -*-
from django.http import HttpResponse
from django.utils.decorators import decorator_from_middleware
from django.views.generic import View
from django.middleware.doc import XViewMiddleware
xview_dec = decorator_from_middleware(XViewMiddleware)
def xview(request):
return HttpResponse()
class ... |
guoxiaolongzte/spark | refs/heads/master | python/pyspark/mllib/stat/test.py | 155 | #
# 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... |
xlqian/navitia | refs/heads/dev | source/jormungandr/jormungandr/parking_space_availability/car/sytral.py | 3 | # encoding: utf-8
# Copyright (c) 2001-2019, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility ... |
rctay/satchmo-payment-dumb | refs/heads/master | processor.py | 1 | from decimal import Decimal
from django.utils.translation import ugettext_lazy as _
from livesettings import config_value, config_get_group
from payment.modules.base import HeadlessPaymentProcessor, ProcessorResult
config = config_get_group('PAYMENT_DUMB')
class PaymentProcessor(HeadlessPaymentProcessor):
def __... |
FennyFatal/i747_kernel_ics | refs/heads/master | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... |
annarev/tensorflow | refs/heads/master | tensorflow/python/ops/numpy_ops/np_utils.py | 3 | # Copyright 2020 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... |
tictakk/servo | refs/heads/ticbranch | tests/wpt/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/blank.py | 253 | def main(request, response):
return [("Content-Type", "text/html; charset=%s" % (request.GET['encoding']))], ""
|
alshedivat/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/estimators/tensor_signature_test.py | 137 | # 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... |
40223209/test111 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/this.py | 948 | s = """Gur Mra bs Clguba, ol Gvz Crgref
Ornhgvshy vf orggre guna htyl.
Rkcyvpvg vf orggre guna vzcyvpvg.
Fvzcyr vf orggre guna pbzcyrk.
Pbzcyrk vf orggre guna pbzcyvpngrq.
Syng vf orggre guna arfgrq.
Fcnefr vf orggre guna qrafr.
Ernqnovyvgl pbhagf.
Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf.
Nygubhtu cenpg... |
nikhilraog/boto | refs/heads/develop | tests/unit/utils/test_utils.py | 63 | # Copyright (c) 2010 Robert Mela
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# ... |
CallmeTorre/Idalia | refs/heads/master | ESCOM/SolicitarDocumento/urls.py | 1 | from django.conf.urls import url
import views as v_views
urlpatterns = [
url(r'^paso1/$', v_views.SolicitarDocumentoPaso1.as_view(), name='paso1SD'),
url(r'^paso2/$', v_views.SolicitarDocumentoPaso2.as_view(), name='paso2SD'),
url(r'^paso3/$', v_views.SolicitarDocumentoPaso3.as_view(), name='paso3SD'),
... |
utkarsh-goswami/erpnext | refs/heads/develop | erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.py | 121 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class PaymentReconciliationPayment(Document):
pass
|
b-carter/numpy | refs/heads/master | numpy/distutils/command/build_src.py | 40 | """ Build swig and f2py sources.
"""
from __future__ import division, absolute_import, print_function
import os
import re
import sys
import shlex
import copy
from distutils.command import build_ext
from distutils.dep_util import newer_group, newer
from distutils.util import get_platform
from distutils.errors import D... |
zorojean/scrapy | refs/heads/master | scrapy/utils/httpobj.py | 169 | """Helper functions for scrapy.http objects (Request, Response)"""
import weakref
from six.moves.urllib.parse import urlparse
_urlparse_cache = weakref.WeakKeyDictionary()
def urlparse_cached(request_or_response):
"""Return urlparse.urlparse caching the result, where the argument can be a
Request or Response... |
galengold/split70 | refs/heads/master | qmk_firmware/lib/googletest/googletest/test/gtest_break_on_failure_unittest.py | 2140 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
AustinRoy7/Pomodoro-timer | refs/heads/master | venv/Lib/encodings/hp_roman8.py | 85 | """ Python Character Mapping Codec generated from 'hp_roman8.txt' with gencodec.py.
Based on data from ftp://dkuug.dk/i18n/charmaps/HP-ROMAN8 (Keld Simonsen)
Original source: LaserJet IIP Printer User's Manual HP part no
33471-90901, Hewlet-Packard, June 1989.
(Used with permission)
"""#"
import co... |
zhhf/charging | refs/heads/master | charging/agent/linux/iptables_manager.py | 8 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Locaweb.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/license... |
jayceyxc/hue | refs/heads/master | desktop/core/ext-py/pysaml2-2.4.0/src/saml2/sigver.py | 8 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
""" Functions connected to signing and verifying.
Based on the use of xmlsec1 binaries and not the python xmlsec module.
"""
import base64
from binascii import hexlify
import hashlib
import logging
import random
import os
import ssl
from time import mktime
import urllib... |
kidmaple/CoolWall | refs/heads/nios2 | user/python/Lib/dos-8x3/test_ope.py | 10 | # Test to see if openpty works. (But don't worry if it isn't available.)
import os
from test_support import verbose, TestFailed, TestSkipped
try:
if verbose:
print "Calling os.openpty()"
master, slave = os.openpty()
if verbose:
print "(master, slave) = (%d, %d)"%(master, slave)
except Attr... |
suutari-ai/shoop | refs/heads/master | shuup_tests/utils/test_analog.py | 3 | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from django import VERSION
from shuup.testing.models import Pseud... |
detiber/lib_openshift | refs/heads/master | test/test_v1_deployment_config_rollback_spec.py | 2 | # coding: utf-8
"""
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
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
... |
uta-smile/smile-python | refs/heads/master | tests/python/test_flags.py | 1 | """Tests for our flags implementation."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import unittest
from smile import flags
flags.DEFINE_string("string_foo", "default_val", "HelpString")
flags.DEFINE_integer("int_foo", 42, "HelpString")
flags.DEFINE_... |
tensorflow/tensorflow | refs/heads/master | tensorflow/python/autograph/pyct/errors.py | 20 | # 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.