repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
insiderr/insiderr-app
refs/heads/master
ios-patches/basemodules/twisted/web/rewrite.py
83
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. # from twisted.web import resource class RewriterResource(resource.Resource): def __init__(self, orig, *rewriteRules): resource.Resource.__init__(self) self.resource = orig self.rewriteRules = list(rewriteRules) ...
graphql-python/graphql-core
refs/heads/main
tests/utilities/test_find_breaking_changes.py
1
from graphql.type import ( GraphQLSchema, GraphQLDeprecatedDirective, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLSpecifiedByDirective, ) from graphql.utilities import ( BreakingChangeType, DangerousChangeType, build_schema, find_breaking_changes, find_dangerous_changes...
AJudge-team/AJudge
refs/heads/master
tests/resources/server.py
1
import socket con = socket.socket(socket.AF_INET, socket.SOCK_STREAM) con.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) DEFAULT_CONTAINER_PORT = 50000 server_address = ("0.0.0.0", DEFAULT_CONTAINER_PORT) con.bind(server_address) con.listen(1) connection, client_address = con.accept() try: data = connect...
Ali-aqrabawi/ezclinic
refs/heads/master
lib/django/contrib/gis/gdal/feature.py
54
from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import GDALException, OGRIndexError from django.contrib.gis.gdal.field import Field from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType from django.contrib.gis.gdal.prototypes import ds as capi, geom as geom_api fro...
retomerz/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/gis/db/models/aggregates.py
512
from django.db.models import Aggregate from django.contrib.gis.db.models.sql import GeomField class Collect(Aggregate): name = 'Collect' class Extent(Aggregate): name = 'Extent' class Extent3D(Aggregate): name = 'Extent3D' class MakeLine(Aggregate): name = 'MakeLine' class Union(Aggregate): nam...
jeffmcnd/tfrs
refs/heads/master
APISpec/gen/models/Role.py
2
""" REST API Documentation for the NRS TFRS Credit Trading Application The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewable & Low Carbon Fuel Requirements Regulation. OpenAPI spec version: v1 ...
ultrabug/py3status
refs/heads/master
py3status/modules/emerge_status.py
1
r""" Display information about the currently running emerge process. Configuration parameters: cache_timeout: how often we refresh this module in second. NOTE: when emerge is running, we will refresh this module every second. (default 30) emerge_log_file: path to the emerge log file. (d...
humanlongevity/luigi
refs/heads/master
test/create_packages_archive_root/package/submodule_with_absolute_import.py
55
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
Zord13appdesa/python-for-android
refs/heads/master
python-build/python-libs/gdata/build/lib/atom/mock_http_core.py
135
#!/usr/bin/env python # # Copyright (C) 2009 Google 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 ...
vcoin-project/v
refs/heads/master
contrib/devtools/symbol-check.py
1
#!/usr/bin/python2 # Copyright (c) 2014 Wladimir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' A script to check that the (Linux) executables produced by gitian only contain allowed gcc, glibc and libstdc++ ve...
cyberark-bizdev/ansible
refs/heads/devel
lib/ansible/modules/storage/zfs/zfs.py
33
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Johan Wiren <johan.wiren.se@gmail.com> # Copyright: (c) 2017, 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__ = t...
CLOUGH/info3180-project-2
refs/heads/master
lib/jinja2/debug.py
620
# -*- coding: utf-8 -*- """ jinja2.debug ~~~~~~~~~~~~ Implements the debug interface for Jinja. This module does some pretty ugly stuff with the Python traceback system in order to achieve tracebacks with correct line numbers, locals and contents. :copyright: (c) 2010 by the Jinja Team. :...
Plantain/sms-mailinglist
refs/heads/master
lib/requests/packages/chardet/gb2312prober.py
2993
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
akhilari7/pa-dude
refs/heads/master
lib/python2.7/site-packages/requests/packages/urllib3/exceptions.py
196
from __future__ import absolute_import # Base Exceptions class HTTPError(Exception): "Base exception used by this module." pass class HTTPWarning(Warning): "Base warning used by this module." pass class PoolError(HTTPError): "Base exception for errors caused within a pool." def __init__(se...
follow99/django
refs/heads/master
tests/forms_tests/tests/test_validators.py
119
from __future__ import unicode_literals import re from unittest import TestCase from django import forms from django.core import validators from django.core.exceptions import ValidationError class UserForm(forms.Form): full_name = forms.CharField( max_length=50, validators=[ validato...
StudyExchange/Udacity
refs/heads/master
MachineLearning(Advanced)/p4_smartcab/visuals.py
17
########################################### # Suppress matplotlib user warnings # Necessary for newer version of matplotlib import warnings warnings.filterwarnings("ignore", category = UserWarning, module = "matplotlib") ########################################### # # Display inline matplotlib plots with IPython from I...
MebiusHKU/flask-web
refs/heads/master
flask/lib/python2.7/site-packages/sqlalchemy/dialects/mssql/pymssql.py
48
# mssql/pymssql.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: mssql+pymssql :name: pymssql :dbapi: pymssql :connects...
u2009cf/spark-radar
refs/heads/master
examples/src/main/python/ml/estimator_transformer_param_example.py
123
# # 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...
ff-kbu/openwrt-aa
refs/heads/master
target/linux/rdc/image/mkimg_bifferboard.py
561
#!/usr/bin/env python """ Create firmware for 4/8MB Bifferboards, suitable for uploading using either bb_upload8.py or bb_eth_upload8.py """ import struct, sys # Increase the kmax value if the script gives errors about the kernel being # too large. You need to set the Biffboot kmax value to the same value yo...
mitsei/dlkit
refs/heads/master
dlkit/primordium/locale/types/coordinate_format.py
1
"""Enumerators for coordinate format types""" # -*- coding: utf-8 -*- from dlkit.abstract_osid.osid.errors import NotFound JEFFS_COORDINATE_FORMAT_TYPES = { 'DMS': 'Degree/Minute/Second' } TYPE_SET = { 'JCRDFT': JEFFS_COORDINATE_FORMAT_TYPES } def get_type_data(name): """Return dictionary representatio...
riseofthetigers/letsencrypt
refs/heads/master
acme/acme/jose/b64.py
66
"""JOSE Base64. `JOSE Base64`_ is defined as: - URL-safe Base64 - padding stripped .. _`JOSE Base64`: https://tools.ietf.org/html/draft-ietf-jose-json-web-signature-37#appendix-C .. Do NOT try to call this module "base64", as it will "shadow" the standard library. """ import base64 import six def b6...
huiren/ece511
refs/heads/master
src/cpu/simple/probes/SimPoint.py
53
# Copyright (c) 2012-2014 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functiona...
jbenden/ansible
refs/heads/devel
lib/ansible/modules/cloud/vmware/vmware_cluster.py
4
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.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.0', ...
saltduck/OpenBazaar-Server
refs/heads/master
keys/bip32utils.py
6
__author__ = 'chris' import bitcointools from binascii import unhexlify def derive_childkey(key, chaincode, prefix=bitcointools.MAINNET_PUBLIC): """ Given a 33 byte public key and 32 byte chaincode (both in hex) derive the first child key. """ master_key = bitcointools.bip32_serialize((prefix, 0, b'\...
googlei18n/TachyFont
refs/heads/master
run_time/src/gae_server/third_party/old-fonttools-master/Lib/fontTools/ttLib/tables/DefaultTable.py
11
from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * from fontTools.ttLib import getClassTag class DefaultTable(object): dependencies = [] def __init__(self, tag=None): if tag is None: tag = getClassTag(self.__class__) self.tableTag = Tag(tag) def decompile...
adamcandy/QGIS-Meshing
refs/heads/master
plugins/mesh_surface/testengine.py
1
#!/usr/bin/env python ########################################################################## # # QGIS-meshing plugins. # # Copyright (C) 2012-2013 Imperial College London and others. # # Please see the AUTHORS file in the main source directory for a # full list of copyright holders. # # Dr Adam S. Can...
angadgill/ML-Graph-Isomorphism
refs/heads/master
scripts/graphScripts/random_graph_pairs.py
1
import networkx as nx import random import pickle from scripts.model import features from scripts.model import graph_pair_class from scripts.model import permute_graph from scripts.graphScripts import ping # List of features used in this model feature_list = [features.CompareNumOfNodes, features.CompareNumOfEdges, f...
adieu/allbuttonspressed
refs/heads/master
docutils/core.py
6
# $Id: core.py 7070 2011-07-05 10:13:17Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Calling the ``publish_*`` convenience functions (or instantiating a `Publisher` object) with component names will result in default behavior. For custom beha...
UOWPhysSoc/Barnes-Hutt-Simulation--James-MattG-
refs/heads/master
Distributions/test.py
1
from math import * from random import gauss, uniform import time def P(R, z, a, b): numerator = R*(a*R**2 + (a + 3*sqrt(z**2 + b**2))*(a + sqrt(z**2 + b**2))**2) # R added denominator = (R**2 + (a + sqrt(z**2 + b**2))**2)**(5/2) * (z**2 + b**2)**(3/2) return numerator / denominator def gauss_...
boa19861105/android_444_KitKat_kernel_htc_B2_UHL
refs/heads/master
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
ProfessionalIT/professionalit-webiste
refs/heads/master
sdk/google_appengine/lib/django-1.3/django/utils/termcolors.py
417
""" termcolors.py """ color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white') foreground = dict([(color_names[x], '3%s' % x) for x in range(8)]) background = dict([(color_names[x], '4%s' % x) for x in range(8)]) RESET = '0' opt_dict = {'bold': '1', 'underscore': '4', 'blink': '5', 'rever...
ctozlm/Dato-Core
refs/heads/master
src/unity/python/graphlab/meta/asttools/visitors/pysourcegen.py
13
''' Created on Jul 15, 2011 @author: sean ''' from __future__ import print_function import _ast from graphlab.meta.asttools import Visitor from string import Formatter import sys from graphlab.meta.utils import py3op, py2op if sys.version_info.major < 3: from StringIO import StringIO else: from io import Stri...
ChangYeoun/Kite_Stock
refs/heads/master
tools/perf/scripts/python/futex-contention.py
11261
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
apixandru/intellij-community
refs/heads/master
python/helpers/py2only/docutils/parsers/rst/languages/fi.py
128
# -*- coding: utf-8 -*- # $Id: fi.py 7119 2011-09-02 13:00:23Z milde $ # Author: Asko Soukka <asko.soukka@iki.fi> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files ...
arulkumarkandasamy/clictest
refs/heads/master
clictest/common/exception.py
1
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
lsqtongxin/django
refs/heads/master
django/conf/locale/fi/formats.py
504
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. E Y' TIME_FORMAT = 'G.i' DATET...
elijah513/django
refs/heads/master
tests/m2m_recursive/models.py
410
""" Many-to-many relationships between the same two tables In this example, a ``Person`` can have many friends, who are also ``Person`` objects. Friendship is a symmetrical relationship - if I am your friend, you are my friend. Here, ``friends`` is an example of a symmetrical ``ManyToManyField``. A ``Person`` can als...
krzysztof/zenodo
refs/heads/master
zenodo/modules/records/serializers/legacyjson.py
6
# -*- coding: utf-8 -*- # # This file is part of Zenodo. # Copyright (C) 2016 CERN. # # Zenodo 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 v...
GoogleCloudPlatform/professional-services
refs/heads/main
tools/agile-machine-learning-api/codes/trainer/models.py
2
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
vmthunder/nova
refs/heads/master
nova/ipv6/api.py
40
# Copyright (c) 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 ...
Northrend/mxnet
refs/heads/master
tools/caffe_converter/caffe_proto_utils.py
53
# 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...
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/tangible/wearables/backpack/fannypack_s01.py
2
import sys def setup(core, object): object.setStfFilename('static_item_n') object.setStfName('item_fannypack_04_01') object.setDetailFilename('static_item_d') object.setDetailName('item_fannypack_04_01') object.setIntAttribute('cat_stat_mod_bonus.@stat_n:constitution_modified', 50) object.setIntAttribute('cat_s...
kool79/intellij-community
refs/heads/master
python/testData/completion/selfMethod.after.py
83
class A: def method(self): pass def test(self): self.method()
bjoshua/ansible
refs/heads/devel
lib/ansible/plugins/lookup/sequence.py
37
# (c) 2013, Jayson Vantuyl <jayson@aggressive.ly> # # 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 v...
kaizengliu/sitebase
refs/heads/master
sitebase/slex.py
2
#!/usr/bin/env python # -*- mode: python -*- # A simple lex parser from collections import namedtuple __all__ = ["parse", "lex", "ParseError", "TOKEN_PARENTHESIS", "TOKEN_LOGIC", "TOKEN_OPER", "TOKEN_VALUE"] TOKEN_PARENTHESIS = 3 TOKEN_LOGIC =...
shannonturner/python-lessons
refs/heads/master
section_05_(loops)/while_menu.py
6
instructions = """Type a one-letter command and hit enter: A to add a name to your list R to remove a name from your list S to show the names in your list Q to quit >""" allowed_commands = ['a', 'r', 's', 'q'] names = [] command = raw_input(instructions) while command.lower() in allowed_commands: if comm...
shusenl/scikit-learn
refs/heads/master
examples/exercises/plot_cv_diabetes.py
231
""" =============================================== Cross-validation on diabetes Dataset Exercise =============================================== A tutorial exercise which uses cross-validation with linear models. This exercise is used in the :ref:`cv_estimators_tut` part of the :ref:`model_selection_tut` section of ...
nagyistoce/netzob
refs/heads/master
src/netzob/Common/Functions/RenderingFunction.py
1
# -*- coding: utf-8 -*- #+---------------------------------------------------------------------------+ #| 01001110 01100101 01110100 01111010 01101111 01100010 | #| | #| Netzob : Inferring communication protocol...
mbauskar/frappe
refs/heads/develop
frappe/desk/treeview.py
6
# 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, json from frappe import _ @frappe.whitelist() def get_all_nodes(tree_method, tree_args, parent): '''Recursively gets all data from tree...
ibinti/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/utils/module_loading.py
112
import imp import os import sys def module_has_submodule(package, module_name): """See if 'module' is in 'package'.""" name = ".".join([package.__name__, module_name]) if name in sys.modules: return True for finder in sys.meta_path: if finder.find_module(name): return True ...
Elbandi/PyMunin
refs/heads/master
pymunin/plugins/ntphostoffsets.py
2
#! /usr/bin/env python """ntphostoffsets - Munin Plugin to monitor time offset of multiple remote hosts using NTP. Requirements - Requires ntpd running on remote hosts and access to NTP on remote host. - Requires ntpdate utility on local host. Wild Card Plugin - No Multigraph Plugin - Graph St...
auduny/home-assistant
refs/heads/dev
tests/components/coinmarketcap/__init__.py
29
"""Tests for the coinmarketcap component."""
Gimpneek/exclusive-raid-gym-tracker
refs/heads/master
exclusive_raid_tracker/urls.py
1
"""exclusive_raid_tracker URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='...
cedricpradalier/vrep_ros_ws
refs/heads/master
src/robot_control_base/nodes/goto_xytheta.py
1
#!/usr/bin/env ipython import roslib roslib.load_manifest('robot_control_base') import rospy import tf from geometry_msgs.msg import Twist, PoseStamped, PointStamped from visualization_msgs.msg import Marker import message_filters from math import atan2, hypot, pi, cos, sin, pi, fmod, exp from tf.transformations impor...
guorendong/iridium-browser-ubuntu
refs/heads/ubuntu/precise
tools/gyp/test/generator-output/gyptest-mac-bundle.py
223
#!/usr/bin/env python # 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. """ Verifies mac bundles work with --generator-output. """ import TestGyp import sys if sys.platform == 'darwin': test = TestGyp.TestGy...
V1sk/android_kernel_sony_msm8960
refs/heads/master
tools/perf/scripts/python/check-perf-trace.py
11214
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
meidli/yabgp
refs/heads/master
yabgp/message/attribute/linkstate/link/peer_node_sid.py
2
# Copyright 2015-2018 Cisco Systems, 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 req...
loli/sklearn-ensembletrees
refs/heads/master
examples/linear_model/plot_ols.py
45
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Linear Regression Example ========================================================= This example uses the only the first feature of the `diabetes` dataset, in order to illustrate a two-dimensional plot of this regre...
ArcherSys/ArcherSys
refs/heads/master
Lib/site-packages/construct/tests/unit.py
1
import sys from construct import * from construct.text import * # some tests require doing bad things... import warnings warnings.filterwarnings("ignore", category = DeprecationWarning) # declarative to the bitter end! tests = [ # # constructs # [MetaArray(lambda ctx: 3, UBInt8("metaarray")).parse, ...
mathemage/h2o-3
refs/heads/master
h2o-py/tests/testdir_parser/pyunit_separator.py
6
from builtins import str import sys sys.path.insert(1,"../../") import h2o from tests import pyunit_utils def separator_test(): """Test parsing of csv files having different separator characters.""" # Test tab separated files by giving separator argument path_tab = "smalldata/parser/tabs.tsv" tab_test...
himanshuo/osf.io
refs/heads/develop
tests/framework_tests/test_render.py
6
import mock import time import unittest from nose.tools import * # noqa from framework.render import core from framework.render import exceptions class TestRenderIsHappening(unittest.TestCase): @mock.patch('framework.render.core.os.path.isfile') def test_cache_exists_is_true(self, mock_isfile): moc...
SivagnanamCiena/robotframework
refs/heads/master
src/robot/libdocpkg/model.py
18
# Copyright 2008-2015 Nokia Solutions and Networks # # 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 l...
programadorjc/django
refs/heads/master
tests/m2m_multiple/tests.py
228
from __future__ import unicode_literals from datetime import datetime from django.test import TestCase from .models import Article, Category class M2MMultipleTests(TestCase): def test_multiple(self): c1, c2, c3, c4 = [ Category.objects.create(name=name) for name in ["Sports", "N...
Immortalin/python-for-android
refs/heads/master
python-build/python-libs/gdata/tests/atom_tests/data_test.py
87
#!/usr/bin/python # -*-*- encoding: utf-8 -*-*- # # Copyright (C) 2006 Google 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 # # Unle...
bettse/viewtome
refs/heads/master
.sencha_backup/2.0.0/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/jasmine-reporters/test/pyphantomjs-plugins/saveToFile/__init__.py
20578
tyagiarpit/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_http_header_util.py
496
#!/usr/bin/env python # # Copyright 2011, 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...
pyfisch/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/wptserve/wptserve/utils.py
15
import socket import sys def invert_dict(dict): rv = {} for key, values in dict.items(): for value in values: if value in rv: raise ValueError rv[value] = key return rv class HTTPException(Exception): def __init__(self, code, message=""): self.c...
catapult-project/catapult
refs/heads/master
experimental/PRESUBMIT.py
4
# 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. def CheckChangeOnUpload(input_api, output_api): return _CommonChecks(input_api, output_api) def CheckChangeOnCommit(input_api, output_api): return _Co...
ApoorvaJ/BlenderSFM
refs/heads/master
osmbundler/features/__init__.py
5
__all__ = ["siftvlfeat", "siftlowe"]
X-DataInitiative/tick-datasets
refs/heads/master
lib/hawkes.py
1
import os from collections import OrderedDict import numpy as np from lib.dataset_analysis import print_characteristics # name, path, number of realization, number of nodes, end_time hawkes_datasets = [ ('Bund', '../hawkes/bund/bund.npz', 20, 4, 50400) ] def iterate_hawkes_dataset_path(): for name, path, *a...
NullSoldier/django
refs/heads/master
tests/i18n/project_dir/app_no_locale/models.py
449
from django.utils.translation import ugettext as _ string = _("This app has no locale directory")
simbha/mAngE-Gin
refs/heads/master
lib/django/contrib/gis/gdal/libgdal.py
31
from __future__ import unicode_literals import logging import os import re from ctypes import c_char_p, c_int, CDLL, CFUNCTYPE from ctypes.util import find_library from django.contrib.gis.gdal.error import OGRException from django.core.exceptions import ImproperlyConfigured logger = logging.getLogger('django.contrib...
ehiggs/hanythingondemand
refs/heads/master
hod/config/__init__.py
2
## # Copyright 2009-2013 Ghent University # # This file is part of hanythingondemand # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundati...
eezee-it/addons-yelizariev
refs/heads/8.0
mail_wall_widgets/models.py
16
from openerp.osv import osv,fields as old_fields from openerp import api, models, fields, tools from openerp.tools.safe_eval import safe_eval try: from openerp.addons.email_template.email_template import mako_template_env except ImportError: try: from openerp.addons.mail.mail_template import mako_templa...
Shrhawk/edx-platform
refs/heads/master
common/djangoapps/util/keyword_substitution.py
148
""" keyword_substitution.py Contains utility functions to help substitute keywords in a text body with the appropriate user / course data. Supported: LMS: - %%USER_ID%% => anonymous user id - %%USER_FULLNAME%% => User's full name - %%COURSE_DISPLAY_NAME%% => display name of the course ...
scottbateman/mce
refs/heads/master
public/js/lib/ace/static.py
71
#!/usr/bin/env python """static - A stupidly simple WSGI way to serve static (or mixed) content. (See the docstrings of the various functions and classes.) Copyright (C) 2006-2009 Luke Arno - http://lukearno.com/ This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesse...
mike-seeber/Character
refs/heads/master
code/model_step2_run5.py
1
from keras import backend as K from keras.callbacks import EarlyStopping from keras.layers import Conv2D, Dense, Flatten, MaxPool2D from keras.models import Sequential from keras.preprocessing.image import ImageDataGenerator import os import pandas as pd import time from model_step0_functions import pickle_rw, architec...
tempbottle/h-store
refs/heads/master
tools/killstragglers.py
9
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import re import commands import logging import getopt #from pprint import pprint LOG_FORMAT = "%(asctime)s [%(funcName)s:%(lineno)03d] %(levelname)-5s: %(message)s" LOG_DATEFMT = "%m-%d-%Y %H:%M:%S" logging.basicConfig(level = logging.INFO, format=LO...
ronekko/chainer
refs/heads/master
chainer/functions/loss/decov.py
3
import numpy from chainer.backends import cuda from chainer import function from chainer import utils from chainer.utils import type_check class DeCov(function.Function): """DeCov loss (https://arxiv.org/abs/1511.06068)""" def __init__(self, reduce='half_squared_sum'): self.h_centered = None ...
mtanski/samba
refs/heads/master
python/samba/tests/core.py
38
# Unix SMB/CIFS implementation. # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2008 # # 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 opti...
mbauskar/helpdesk-frappe
refs/heads/master
frappe/patches/v4_2/print_with_letterhead.py
73
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe def execute(): frappe.reload_doc("core", "doctype", "print_settings") print_settings = frappe.get_doc("Print Settings") print_settings.with_letterhead = 1 print...
Paulius-Maruska/pyhex
refs/heads/master
pyhex/format.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2013 Paulius Maruška from helper import split_string, hex_string, safe_string def pyhex_format(string, start_address): """ Generator function that yields individual lines formatted as hexview lines. :param string: string to be represented in hexvi...
kumar303/addons-server
refs/heads/master
src/olympia/users/admin.py
2
import functools from django.conf.urls import url from django.contrib import admin, messages from django.contrib.admin.utils import unquote from django.db.utils import IntegrityError from django.http import ( Http404, HttpResponseForbidden, HttpResponseNotAllowed, HttpResponseRedirect) from django.utils.encodi...
ga7g08/sympy
refs/heads/master
sympy/geometry/tests/test_point.py
3
from __future__ import division from sympy import (Abs, I, Dummy, Rational, Float, S, Symbol, cos, oo, pi, simplify, sin, sqrt, symbols, Derivative, asin, acos) from sympy.geometry import (Circle, Curve, Ellipse, GeometryError, Line, Point, Polygon, Ray, RegularPolygon, S...
awgreene/311InYourNeighborhood
refs/heads/master
setup.py
1
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='311InYourNeighborhood', version='1.0.0', description='311InYourN...
GunoH/intellij-community
refs/heads/master
python/testData/editing/py254.after.py
166
class Foo(object): def foo(bar): pass def bar(foo): pass
NeovaHealth/odoo
refs/heads/8.0
addons/project_timesheet/report/task_report.py
336
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
Nashenas88/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/py/testing/path/test_svnwc.py
162
import py import os, sys import pytest from py._path.svnwc import InfoSvnWCCommand, XMLWCStatus, parse_wcinfotime from py._path import svnwc as svncommon from svntestbase import CommonSvnTests def test_make_repo(path1, tmpdir): repo = tmpdir.join("repo") py.process.cmdexec('svnadmin create %s' % repo) if s...
chrisdunelm/grpc
refs/heads/master
src/python/grpcio/commands.py
7
# Copyright 2015 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
timchenxiaoyu/kubernetes
refs/heads/master
hack/boilerplate/boilerplate.py
52
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
cmjatai/cmj
refs/heads/master
cmj/sigad/migrations/0024_classe_tipo_doc_padrao.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.11.8 on 2017-12-18 18:36 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sigad', '0023_auto_20171217_2344'), ] operations = [ migrations.AddField( ...
0sc0d3r/enigma2
refs/heads/master
lib/python/Plugins/SystemPlugins/VideoTune/plugin.py
43
from Plugins.Plugin import PluginDescriptor def videoFinetuneMain(session, **kwargs): from VideoFinetune import VideoFinetune session.open(VideoFinetune) def startSetup(menuid): if menuid != "video_menu": return [ ] return [(_("Testscreens"), videoFinetuneMain, "video_finetune", 10)] def Plugins(**kwargs): r...
vortex-ape/scikit-learn
refs/heads/master
examples/svm/plot_iris.py
65
""" ================================================== Plot different SVM classifiers in the iris dataset ================================================== Comparison of different linear SVM classifiers on a 2D projection of the iris dataset. We only consider the first 2 features of this dataset: - Sepal length - Se...
mrkm4ntr/incubator-airflow
refs/heads/master
tests/providers/samba/hooks/__init__.py
5130
# # 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...
shdowofdeath/rally
refs/heads/master
tests/unit/plugins/common/sla/test_iteration_time.py
14
# Copyright 2014: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
divya-csekar/flask-microblog-server
refs/heads/master
flask/Lib/site-packages/werkzeug/wrappers.py
146
# -*- coding: utf-8 -*- """ werkzeug.wrappers ~~~~~~~~~~~~~~~~~ The wrappers are simple request and response objects which you can subclass to do whatever you want them to do. The request object contains the information transmitted by the client (webbrowser) and the response object contains al...
blackzw/openwrt_sdk_dev1
refs/heads/master
staging_dir/host/lib/python2.7/sqlite3/test/regression.py
15
#-*- coding: ISO-8859-1 -*- # pysqlite2/test/regression.py: pysqlite regression tests # # Copyright (C) 2006-2007 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any dama...
patrickcurl/ztruck
refs/heads/master
dj/lib/python2.7/site-packages/localflavor/pk/models.py
6
from django.db.models.fields import CharField from django.utils.translation import ugettext_lazy as _ from . import forms from .pk_states import STATE_CHOICES class PKStateField(CharField): """ A model field that is represented with :data:`~localflavor.pk.pk_states.STATE_CHOICES`` choices and stores ...
gonboy/sl4a
refs/heads/master
python-modules/pybluez/examples/advanced/read-local-bdaddr.py
20
import os import sys import struct import _bluetooth as _bt def read_local_bdaddr(hci_sock): old_filter = hci_sock.getsockopt( _bt.SOL_HCI, _bt.HCI_FILTER, 14) flt = _bt.hci_filter_new() opcode = _bt.cmd_opcode_pack(_bt.OGF_INFO_PARAM, _bt.OCF_READ_BD_ADDR) _bt.hci_filter_set_ptype(flt, _b...
willrp/willbuyer
refs/heads/master
backend/util/safe_url/__init__.py
1
from flask import has_request_context, request from urllib.parse import urlparse, urljoin def is_safe_url(target_url): if has_request_context(): ref_url = urlparse(request.host_url) test_url = urlparse(urljoin(request.host_url, target_url)) return test_url.scheme in ('http', 'https') and r...