repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
jiaphuan/models | refs/heads/master | research/differential_privacy/dp_sgd/dp_optimizer/dp_pca.py | 16 | # 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... |
rew4332/tensorflow | refs/heads/rew4332-patch-1 | tensorflow/contrib/losses/python/losses/loss_ops_test.py | 4 | # 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... |
Maximilian-Reuter/SickRage-1 | refs/heads/master | lib/sqlalchemy/connectors/__init__.py | 79 | # connectors/__init__.py
# Copyright (C) 2005-2014 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
class Connector(object):
pass
|
anushray/django-sass-processor | refs/heads/master | sass_processor/templatetags/sass_tags.py | 4 | # -*- coding: utf-8 -*-
import os
import json
import sass
from django.conf import settings
from django.core.files.base import ContentFile
from django.template import Library, Context
from django.template.base import Node, TemplateSyntaxError
from django.utils.encoding import iri_to_uri
from django.utils.six.moves.urlli... |
tinkhaven-organization/odoo | refs/heads/8.0 | addons/account/project/report/__init__.py | 427 | # -*- 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... |
kermitfr/kermit-webui | refs/heads/master | src/webui/agent/templatetags/split.py | 1 | from django import template
from django.utils.safestring import mark_safe, SafeData
from django.template.defaultfilters import stringfilter
register = template.Library()
class SplitNode(template.Node):
def __init__(self, name, value):
self.name = name
self.value = value
def render(sel... |
mgarg1/ecg | refs/heads/master | ecg_visualizer_arduino_PC/galry/visuals/framebuffer_visual.py | 7 | from visual import Visual
import numpy as np
class FrameBufferVisual(Visual):
def initialize(self, shape=None, ntextures=1, coeffs=None, display=True):
if shape is None:
shape = (600, 600)
for i in xrange(ntextures):
self.add_texture('fbotex%d' % i, ncomponents=3, n... |
madelynfreed/rlundo | refs/heads/master | venv/lib/python2.7/site-packages/IPython/utils/io.py | 4 | # encoding: utf-8
"""
IO related utilities.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.... |
jsmartin/shade | refs/heads/master | shade/tests/unit/test_keypair.py | 1 | #
# 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
# distributed under the ... |
simvisage/oricreate | refs/heads/master | docs/howtos/ex07_sim_task/sim03_map_pattern_to_target_face_plot.py | 1 | r'''
Construct a general crease pattern configuration,
used in the examples below demonstrating the evaluation of goal functions
and constraints.
'''
from .sim03_map_pattern_to_target_face import create_sim_step
if __name__ == '__main__':
import mayavi.mlab as m
sim_step = create_sim_step()
cp = sim_step... |
sadleader/odoo | refs/heads/master | addons/l10n_tr/__openerp__.py | 259 | # -*- 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... |
alikhil/pcms-standing-parser | refs/heads/master | analytics.py | 1 | import pandas as pd
def get_analytics(submissions, data_type="month"):
dataframe = pd.DataFrame.from_records([s.__dict__ for s in submissions])
success_counts = dataframe[data_type][dataframe["status"] == "success"].value_counts()
submissions_counts = dataframe[data_type].value_counts()
return {"all":... |
thaumos/ansible | refs/heads/devel | test/units/modules/network/ios/test_ios_bgp.py | 38 | #
# (c) 2019, Ansible by Red Hat, inc
# 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
from ansible.module_utils.network.ios.providers.cli.config.bgp.process import Provider
from ansib... |
pedrobaeza/website | refs/heads/8.0 | website_signup_legal_page_required/__init__.py | 14 | # -*- coding: utf-8 -*-
# © 2015 Antiun Ingeniería, S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import controllers, models
|
Senseg/Py4A | refs/heads/master | python-modules/twisted/twisted/trial/test/mockcustomsuite3.py | 87 | # Copyright (c) 2006 Twisted Matrix Laboratories. See LICENSE for details
"""
Mock test module that contains both a C{test_suite} and a C{testSuite} method.
L{runner.TestLoader} should load the tests from the C{testSuite}, not from the
C{Foo} C{TestCase} nor from the C{test_suite} method.
See {twisted.trial.test.test... |
chongtianfeiyu/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_structseq.py | 84 | import os
import time
import unittest
from test import support
class StructSeqTest(unittest.TestCase):
def test_tuple(self):
t = time.gmtime()
self.assertIsInstance(t, tuple)
astuple = tuple(t)
self.assertEqual(len(t), len(astuple))
self.assertEqual(t, astuple)
# ... |
mlodz/theghostacademy | refs/heads/master | scripts/run.py | 1 | import sys
import os.path
sys.path.append(
os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
)
from models import parser
from models import facts
from models import terran
def main():
# Setup Facts
units = parser.parse_dependency_file('data/HotS/terran_units.csv')
buildings = ... |
pierg75/pier-sosreport | refs/heads/master | sos/plugins/nfsganesha.py | 2 | # 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.
# This program is distributed in the hope that it will be useful,
# but... |
foobarbazblarg/stayclean | refs/heads/master | stayclean-2020-december/venv/lib/python3.8/site-packages/pip/_vendor/requests/__version__.py | 9 | # .-. .-. .-. . . .-. .-. .-. .-.
# |( |- |.| | | |- `-. | `-.
# ' ' `-' `-`.`-' `-' `-' ' `-'
__title__ = 'requests'
__description__ = 'Python HTTP for Humans.'
__url__ = 'https://requests.readthedocs.io'
__version__ = '2.25.0'
__build__ = 0x022500
__author__ = 'Kenneth Reitz'
__author_email__ = 'me@kennethrei... |
rmboggs/django | refs/heads/master | tests/admin_views/forms.py | 339 | from django import forms
from django.contrib.admin.forms import AdminAuthenticationForm
class CustomAdminAuthenticationForm(AdminAuthenticationForm):
class Media:
css = {'all': ('path/to/media.css',)}
def clean_username(self):
username = self.cleaned_data.get('username')
if username ... |
Perferom/android_external_chromium_org | refs/heads/android-4.4 | tools/site_compare/scrapers/firefox/__init__.py | 179 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Selects the appropriate scraper for Firefox."""
def GetScraper(version):
"""Returns the scraper module for the given version... |
bkirui/odoo | refs/heads/8.0 | addons/stock_picking_wave/__openerp__.py | 312 | # -*- 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... |
rocopartners/django-oscar | refs/heads/master | src/oscar/apps/shipping/migrations/0002_auto_20150604_1450.py | 61 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('shipping', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='orderanditemcharges',
... |
mbelmadani/motifgp | refs/heads/master | motifgp/utils.py | 1 | # Generator to create multiple patterns from a regex
import altschulEriksonDinuclShuffle #dinuclShuffle
import re
import sys
class Utils():
def __init__(self):
self.complement = {'A': 'T',
'C': 'G',
'G': 'C',
'T': 'A',... |
ntymtsiv/tempest | refs/heads/master | tempest/api/compute/images/test_images.py | 1 | # Copyright 2012 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 ... |
VaneCloud/horizon | refs/heads/stable/kilo | openstack_dashboard/test/integration_tests/pages/project/data_processing/imageregistrypage.py | 37 | # 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... |
mr-justdoit/tweetanalyzer | refs/heads/master | tweetanalyzer.py | 1 | #!/usr/bin/python
# coding: utf-8
from __future__ import absolute_import, print_function
import tweepy
import json
import sys
import getopt
import pyaml
import textmining
with open('data.json') as data_file:
data = json.load(data_file)
def twitter_auth(consumer_key, consumer_secret, access_token,
... |
kjung/scikit-learn | refs/heads/master | sklearn/mixture/tests/test_gmm.py | 48 | import unittest
import copy
import sys
from nose.tools import assert_true
import numpy as np
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_raises)
from scipy import stats
from sklearn import mixture
from sklearn.datasets.samples_generator import make_spd_ma... |
fighterCui/L4ReFiascoOC | refs/heads/master | l4/pkg/python/contrib/Lib/xml/parsers/expat.py | 230 | """Interface to the Expat non-validating XML parser."""
__version__ = '$Revision: 17640 $'
from pyexpat import *
|
adedayo/intellij-community | refs/heads/master | python/testData/refactoring/pushdown/multiple.after.py | 79 | class Foo:
pass
class Zope(Foo):
def _mine(self):
print "zope"
def foo(self):
print("a")
class Boo(Foo):
def boo(self):
print "rrrrr"
def foo(self):
print("a")
|
eclipse-ease-addons/engines | refs/heads/master | jython/org.jython/Lib/ensurepip/__init__.py | 4 | #!/usr/bin/env python2
from __future__ import print_function
import os
import os.path
import pkgutil
import shutil
import sys
import tempfile
__all__ = ["version", "bootstrap"]
_SETUPTOOLS_VERSION = "14.3.2"
_PIP_VERSION = "1.6"
# pip currently requires ssl support, so we try to provide a nicer
# error message w... |
pelletier/django-parallelized_querysets | refs/heads/master | parallelized_querysets/__init__.py | 1 | __version_tuple__ = (0, 0, 4)
__version__ = ".".join(map(str, __version_tuple__))
def parallelized_multiple_querysets(querysets, *args, **kwargs):
from parallelized_querysets.core import parallelized_multiple_querysets
return parallelized_multiple_querysets(querysets, *args, **kwargs)
def parallelized_quer... |
esten/StoriTell | refs/heads/master | StoriTell/tastypie/fields.py | 2 | from dateutil.parser import parse
import re
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.utils import datetime_safe, importlib
from tastypie.bundle import Bundle
from tastypie.exceptions import ApiFieldError, NotFound
from tastypie.utils imp... |
jvkops/django | refs/heads/master | django/contrib/auth/forms.py | 100 | from __future__ import unicode_literals
from django import forms
from django.contrib.auth import (
authenticate, get_user_model, password_validation,
)
from django.contrib.auth.hashers import (
UNUSABLE_PASSWORD_PREFIX, identify_hasher,
)
from django.contrib.auth.models import User
from django.contrib.auth.tok... |
lukw00/shogun | refs/heads/develop | examples/undocumented/python_modular/features_binned_dot_modular.py | 26 | #!/usr/bin/env python
import numpy
matrix=numpy.array([[-1.0,0,1],[2,3,4],[5,6,7]])
bins=numpy.array([[0.0, 0.0, 0.0],[1.0,1.0,1.0],[2.0,2.0,2.0],[3.0,3.0,3.0],[4.0,4.0,4.0]])
parameter_list = [(matrix,bins)]
def features_binned_dot_modular (matrix, bins):
from modshogun import RealFeatures, BinnedDotFeatures
rf=... |
avorio/rdflib | refs/heads/master | rdflib/plugins/parsers/pyRdfa/transform/metaname.py | 26 | # -*- coding: utf-8 -*-
"""
Simple transfomer: C{meta} element is extended with a C{property} attribute, with a copy of the
C{name} attribute values.
@author: U{Ivan Herman<a href="http://www.w3.org/People/Ivan/">}
@license: This software is available for use under the
U{W3C® SOFTWARE NOTICE AND LICENSE<href="http://w... |
oVirt/ovirt-node | refs/heads/master | src/ovirt/node/setup/ipmi/ipmi_page.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# cim_page.py - Copyright (C) 2012 Red Hat, Inc.
# Written by Ryan Barry <rbarry@redhat.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; version... |
thresholdsoftware/asylum | refs/heads/master | openerp/addons/portal_hr_employees/__init__.py | 53 | # -*- 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... |
lucabe72/linux-reclaiming | refs/heads/master | scripts/tracing/draw_functrace.py | 14679 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... |
tumbl3w33d/ansible | refs/heads/devel | test/units/modules/storage/netapp/test_na_ontap_cluster_peer.py | 37 | ''' unit tests ONTAP Ansible module: na_ontap_cluster_peer '''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch, Mock
from ansible.module_utils import basic
from ansible.module_utils._text import to_bytes
import ansible.module_utils.... |
mikeibrahim/rpi-dice | refs/heads/master | on.py | 1 | #!/usr/bin/env python
#
# Author: Mike Ibrahim
# Date: 10/01/2016
# Version: 1.0
#
# Repository: https://github.com/mikeibrahim/rpi-dice
#
# on.py
#
# This is to test all the lights one by one
# to make sure they all work
#
# Import Libraries needed
import time
import RPi.GPIO as GPIO
# Initialize sett... |
dubourg/openturns | refs/heads/master | python/test/t_DickeyFullerTest_std.py | 3 | #! /usr/bin/env python
from __future__ import print_function
import openturns as ot
size = 100
# ARMA parameters
arcoefficients = ot.ARMACoefficients([0.3])
macoefficients = ot.ARMACoefficients(0)
timeGrid = ot.RegularGrid(0.0, 0.1, size)
# White noise ==> gaussian
whiteNoise = ot.WhiteNoise(ot.Normal(), timeGrid)
... |
devs1991/test_edx_docmode | refs/heads/master | venv/lib/python2.7/site-packages/pygments/lexers/ruby.py | 72 | # -*- coding: utf-8 -*-
"""
pygments.lexers.ruby
~~~~~~~~~~~~~~~~~~~~
Lexers for Ruby and related languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, ... |
KodiColdkeys/coldkeys-addons | refs/heads/master | repository/plugin.video.white.devil/resources/lib/sources/moviexk_mv_tv.py | 6 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 l... |
ariegg/webiopi-drivers | refs/heads/master | chips/clock/dsrtc/dsrtc.py | 1 | # Copyright 2014-2016 Andreas Riegg - t-h-i-n-x.net
#
# 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... |
davgibbs/django | refs/heads/master | django/contrib/sessions/management/commands/clearsessions.py | 729 | from importlib import import_module
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = (
"Can be run as a cronjob or directly to clean out expired sessions "
"(only with the database backend at the moment)."
)
def handl... |
shermanng10/superathletebuilder | refs/heads/master | env/lib/python2.7/site-packages/psycopg2/tz.py | 72 | """tzinfo implementations for psycopg2
This module holds two different tzinfo implementations that can be used as
the 'tzinfo' argument to datetime constructors, directly passed to psycopg
functions or used to set the .tzinfo_factory attribute in cursors.
"""
# psycopg/tz.py - tzinfo implementation
#
# Copyright (C) ... |
dhwright25/npyscreen | refs/heads/master | TESTUNICODE.py | 9 | #!/usr/bin/env python
# encoding: utf-8
import npyscreen
#npyscreen.disableColor()
class TestApp(npyscreen.NPSApp):
def main(self):
# These lines create the form and populate it with widgets.
# A fairly complex screen in only 8 or so lines of code - a line for each control.
F = npyscreen.Fo... |
pbrod/scipy | refs/heads/master | scipy/optimize/_lsq/common.py | 50 | """Functions used by least-squares algorithms."""
from __future__ import division, print_function, absolute_import
from math import copysign
import numpy as np
from numpy.linalg import norm
from scipy.linalg import cho_factor, cho_solve, LinAlgError
from scipy.sparse import issparse
from scipy.sparse.linalg import L... |
VDuda/pyspider | refs/heads/master | pyspider/database/elasticsearch/projectdb.py | 12 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<roy@binux.me>
# http://binux.me
# Created on 2016-01-17 18:32:33
import time
import elasticsearch.helpers
from elasticsearch import Elasticsearch
from pyspider.database.base.projectdb import Projec... |
haoyuchen1992/osf.io | refs/heads/develop | tests/framework_tests/test_mongo.py | 37 | """
Tests related to functions in framework.mongo
"""
from unittest import TestCase
from nose.tools import * # flake8: noqa
from modularodm.exceptions import ValidationError, ValidationValueError
from framework.mongo import validators
class TestValidators(TestCase):
def _choice_validator(self, ignore_case=Fal... |
skython/eXe | refs/heads/master | twisted/test/process_tester.py | 137 | """Test program for processes."""
import sys, os
test_file_match = "process_test.log.*"
test_file = "process_test.log.%d" % os.getpid()
def main():
f = open(test_file, 'wb')
# stage 1
bytes = sys.stdin.read(4)
f.write("one: %r\n" % bytes)
# stage 2
sys.stdout.write(bytes)
sys.stdout.... |
Ecpy/ecpy_pulses | refs/heads/main | exopy_pulses/pulses/item.py | 1 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2016-2018 by ExopyPulses Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# ---------... |
GStreamer/cerbero | refs/heads/master | cerbero/packages/wix.py | 1 | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... |
JetBrains/intellij-community | refs/heads/master | python/testData/dotNet/single_class.py | 80 | import clr
clr.AddReferenceByPartialName("SingleNameSpace")
from S<caret>ingleNameSpace import MyClass
print MyClass |
batxes/4Cin | refs/heads/master | SHH_WT_models_highres/SHH_WT_models_highres_final_output_0.1_-0.1_5000/SHH_WT_models_highres41357.py | 4 | import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... |
Learningtribes/edx-platform | refs/heads/master | cms/djangoapps/contentstore/features/grading.py | 44 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import world, step
from common import *
from terrain.steps import reload_the_page
from selenium.common.exceptions import InvalidElementStateException
from contentstore.utils import reverse_course_url
from nose.tools import assert_i... |
pjryan126/solid-start-careers | refs/heads/master | store/api/zillow/venv/lib/python2.7/site-packages/pip/wheel.py | 51 | """
Support for installing and building the "wheel" binary package format.
"""
from __future__ import absolute_import
import compileall
import csv
import errno
import functools
import hashlib
import logging
import os
import os.path
import re
import shutil
import stat
import sys
import tempfile
import warnings
from ba... |
willthames/ansible | refs/heads/devel | lib/ansible/modules/network/aci/aci_rest.py | 9 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2015 Jason Edelman <jason@networktocode.com>, Network to Code, LLC
# Copyright 2017 Dag Wieers <dag@wieers.com>
# This file is part of Ansible by Red Hat
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Pu... |
privateip/ansible | refs/heads/devel | lib/ansible/modules/cloud/atomic/atomic_host.py | 23 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#... |
exploreodoo/datStruct | refs/heads/master | odoo/addons/payment_authorize/__openerp__.py | 232 | # -*- coding: utf-8 -*-
{
'name': 'Authorize.Net Payment Acquirer',
'category': 'Hidden',
'summary': 'Payment Acquirer: Authorize.net Implementation',
'version': '1.0',
'description': """Authorize.Net Payment Acquirer""",
'author': 'Odoo SA',
'depends': ['payment'],
'data': [
'v... |
ebroder/NetworkManager | refs/heads/master | examples/python/show-bssids.py | 22 | #!/usr/bin/env python
#
# 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.
#
# This program is distributed in the hope that... |
jruiperezv/ANALYSE | refs/heads/master | common/lib/xmodule/xmodule/util/duedate.py | 256 | """
Miscellaneous utility functions.
"""
from functools import partial
def get_extended_due_date(node):
"""
Gets the actual due date for the logged in student for this node, returning
the extendeded due date if one has been granted and it is later than the
global due date, otherwise returning the glob... |
philgyford/listenbrainz-server | refs/heads/master | server.py | 2 | #!/usr/bin/env python
from webserver import create_app
import argparse
from werkzeug.contrib.profiler import ProfilerMiddleware
application = create_app()
#application.config['PROFILE'] = True
#application.wsgi_app = ProfilerMiddleware(application.wsgi_app, restrictions=[30])
if __name__ == "__main__":
parser = a... |
lkhomenk/integration_tests | refs/heads/master | cfme/infrastructure/config_management.py | 3 | # -*- coding: utf-8 -*-
from cached_property import cached_property
from navmazing import NavigateToSibling, NavigateToAttribute
from widgetastic.exceptions import NoSuchElementException
from widgetastic.widget import Checkbox, TextInput, Text, View
from widgetastic_patternfly import BootstrapSelect, Dropdown, Tab
fro... |
jeffery9/mixprint_addons | refs/heads/master | ineco_thai_account/journal.py | 1 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-Today INECO LTD,. PART. (<http://www.ineco.co.th>).
#
# This program is free software: you can redistribute it and/or modify
# it under the... |
labelle/evolution | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py | 2698 | #!/usr/bin/env python
# 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.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... |
ivan-fedorov/intellij-community | refs/heads/master | python/testData/refactoring/extractmethod/ElseBody.before.py | 83 | def foo():
for arg in sys.argv[1:]:
try:
f = open(arg, 'r')
except IOError:
print('cannot open', arg)
else:
<selection>length = len(f.readlines()) #<---extract something from here
print("hi from else")</selection>
#anything else you... |
plotly/plotly.py | refs/heads/master | packages/python/plotly/plotly/validators/scatterternary/hoverlabel/font/_color.py | 1 | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name="color",
parent_name="scatterternary.hoverlabel.font",
**kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly... |
dmccue/ansible | refs/heads/devel | v1/ansible/module_utils/rax.py | 280 | # 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... |
derekjchow/models | refs/heads/master | research/vid2depth/ops/__init__.py | 10 | # 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 applicab... |
nirmeshk/oh-mainline | refs/heads/master | vendor/packages/sphinx/sphinx/util/png.py | 16 | # -*- coding: utf-8 -*-
"""
sphinx.util.png
~~~~~~~~~~~~~~~
PNG image manipulation helpers.
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import struct
import binascii
from sphinx.util.pycompat import b
LEN_IEND = 12
LEN_DEPTH = 22
... |
koslibpro/GreyIndex | refs/heads/master | services/__init__.py | 3 | __author__ = 'koslib'
|
manuzhang/incubator-beam | refs/heads/master | sdks/python/apache_beam/runners/portability/maptask_executor_runner.py | 9 | #
# 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... |
peppelinux/pyDBsync | refs/heads/master | sqlautocode/build/lib.linux-i686-2.7/sqlautocode/constants.py | 5 | # Nice print stuff
TAB = 12*' '
NLTAB = ',\n'+TAB
USAGE = """usage: autoload.py [options]
Generates python code for a given database schema.
options:
-h, --help Show this help
-u URL, --url URL Database url (e.g.: postgresql+psycopg2://postgres:user@password/Database)
... |
mdaniel/intellij-community | refs/heads/master | python/testData/resolve/multiFile/fromQualifiedPackageImportFile/mypackage/__init__.py | 166 | # obligatory
|
vongochung/buiquocviet | refs/heads/master | django/db/backends/postgresql_psycopg2/base.py | 81 | """
PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
import sys
from django.db import utils
from django.db.backends import *
from django.db.backends.signals import connection_created
from django.db.backends.postgresql_psycopg2.operations import DatabaseOperations
from... |
notionparallax/ShadowWolf | refs/heads/master | beowulf/app/model.py | 1 | import pypyodbc
class Model(object):
def __init__(self, conn_string=None):
self.conn_string = conn_string or "Driver=SQLITEY;Database=/ShadowWolf/beowulf/test.db"
def conn(self):
return pypyodbc.connect(self.conn_string)
def execute(self, query, args=[], save_result=True):
results... |
albertomurillo/ansible | refs/heads/devel | lib/ansible/modules/network/cnos/cnos_user.py | 38 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
#
# Copyright (C) 2019 Lenovo.
# (c) 2017, Ansible by Red Hat, inc
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of ... |
azraelrabbit/ShadowDNS | refs/heads/master | test.py | 79 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
sys.path.insert(0, 'shadowsocks')
import os
import signal
import select
import time
from subprocess import Popen, PIPE
p1 = Popen(['sudo', sys.executable, 'shadowdns/dnsrelay.py', '-c', sys.argv[-1]],
shell=False, bufsize=0, stdin=PIPE, stdout=PIPE, stde... |
lmorchard/django-allauth | refs/heads/master | allauth/socialaccount/providers/odnoklassniki/tests.py | 62 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from allauth.socialaccount.tests import create_oauth2_tests
from allauth.socialaccount.providers import registry
from allauth.tests import MockedResponse
from .provider import OdnoklassnikiProvider
class OdnoklassnikiTests(
create_oauth2_tests(... |
grap/odoo-eshop | refs/heads/8.0 | odoo_eshop/eshop_app/controllers/controller_sale_order.py | 1 | #! /usr/bin/env python
# -*- encoding: utf-8 -*-
# Extra Libs
from flask import request, render_template, flash, jsonify
from flask.ext.babel import gettext as _
# Custom Tools
from ..application import app
from ..tools.web import redirect_url_for
from ..tools.auth import requires_auth
from ..models.tools import curr... |
aaronfang/personal_scripts | refs/heads/master | af_scripts/tmp/freezeVtxTransform.py | 2 | import pymel.core as pm
def freezeVtxTransformation():
curSel = pm.ls(sl=1, fl=1)
for sel in curSel:
sel = sel.getShape()
pm.polyMoveVertex(sel, ch=0)
pm.select(d=True)
freezeVtxTransformation()
|
stormi/weblate | refs/heads/master | weblate/trans/tests/test_lock.py | 11 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... |
taohungyang/cloud-custodian | refs/heads/master | tests/test_ec2.py | 1 | # Copyright 2015-2017 Capital One Services, 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 ... |
miyosuda/intro-to-dl-android | refs/heads/master | HandWriting/jni-build/jni/include/tensorflow/python/framework/gen_docs_combined.py | 3 | # Copyright 2015 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 a... |
hhauer/myinfo | refs/heads/master | oam_base/settings.py | 1 | # Basic settings for django. They should enable localhost-only development.
# These settings are extended for actual production use.
# Before go-live review: https://docs.djangoproject.com/en/dev/howto/deployment/checklist/
import os.path
TEMPLATE_DEBUG = DEBUG = True
# If development is set to true, all calls to Sa... |
rldhont/Quantum-GIS | refs/heads/master | python/plugins/processing/algs/gdal/rearrange_bands.py | 16 | # -*- coding: utf-8 -*-
"""
***************************************************************************
rearrange_bands.py
---------------------
Date : August 2018
Copyright : (C) 2018 by Mathieu Pellerin
Email : nirvn dot asia at gmail dot com
************... |
yanbober/SmallReptileTraining | refs/heads/master | AndroidSpider/Spider_ethsacn2.py | 1 | #-*-coding:utf-8 -*-
# 将ETHSCAN记录保存的脚本
import urllib.request as urllib2
from urllib import request
import random
from bs4 import BeautifulSoup
'''
# user_agent是爬虫与反爬虫斗争的第一步
ua_headers = {
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0',
}'''
# 用于模拟http头的User-agent
ua_l... |
tmimori/erpnext | refs/heads/develop | erpnext/patches/v4_2/add_currency_turkish_lira.py | 77 | # 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
from frappe.geo.country_info import get_country_info
from erpnext.setup.install import add_country_and_currency
def execute():
country =... |
hugofragata/PyNEAT | refs/heads/master | species.py | 1 | from genome import Genome
class Species():
"""The number of excess and disjoint genes between a pair of genomes is a natural
measure of their compatibility distance. The more disjoint two genomes are, the less
evolutionary history they share, and thus the less compatible they are. Therefore, we
can mea... |
BrechtBa/webopt | refs/heads/master | django/webinterface/models.py | 10644 | from django.db import models
# Create your models here.
|
ywangd/pybufrkit | refs/heads/master | pybufrkit/__main__.py | 1 | from __future__ import absolute_import
from __future__ import print_function
import sys
if __name__ == '__main__':
from pybufrkit import main
sys.exit(main())
|
edx/edx-platform | refs/heads/master | common/test/acceptance/fixtures/catalog.py | 4 | """
Tools to create catalog-related data for use in bok choy tests.
"""
import json
import requests
from common.test.acceptance.fixtures import CATALOG_STUB_URL
from common.test.acceptance.fixtures.config import ConfigModelFixture
class CatalogFixture:
"""
Interface to set up mock responses from the Catal... |
certik/hermes1d | refs/heads/master | src/gen/legendre.py | 3 | #! /usr/bin/env python
print "Importing..."
import os
from jinja2 import Environment, FileSystemLoader
from sympy import Symbol
from common import horner_scheme, ccode_pow2, legendre_norm, \
legendre_shape_function
n_functions = 50
precision = 25
factor_const = True
x = Symbol("x")
env = Environment(loader=Fil... |
afdelgado/askbot | refs/heads/master | askbot/management/commands/post_emailed_questions.py | 17 | """Copyright 2011 Askbot.org and Askbot project contributors.
Custom management command that takes questions posted
via email at the IMAP server
Expects subject line of emails to have format:
[Tag1, Tag2] Question title
Tags can be entered as multiword, but the space character
within the tag may be replaced with a da... |
ncbray/pystream | refs/heads/master | bin/translator/dataflowtransform/shaderdescription.py | 1 | # Copyright 2011 Nicholas Bray
#
# 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... |
lostdj/Jaklin-OpenJFX | refs/heads/jaklin-master | modules/web/src/main/native/Tools/Scripts/webkitpy/thirdparty/mock.py | 148 | # mock.py
# Test tools for mocking and patching.
# Copyright (C) 2007-2009 Michael Foord
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# mock 0.6.0
# http://www.voidspace.org.uk/python/mock/
# Released subject to the BSD License
# Please see http://www.voidspace.org.uk/python/license.shtml
# 2009-11-25: Licence dow... |
chemlab/chemlab | refs/heads/master | chemlab/graphics/renderers/cylinder_imp.py | 6 | from .base import ShaderBaseRenderer
import pkgutil
from ..shaders import set_uniform
from ..buffers import VertexBuffer
from OpenGL.GL import *
import numpy as np
class CylinderImpostorRenderer(ShaderBaseRenderer):
"""Render pixel-perfect cylinders by using raytraced impostors.
This method provide a ver... |
elzaggo/pydoop | refs/heads/develop | examples/avro/py/avro_base.py | 1 | #!/usr/bin/env python
# BEGIN_COPYRIGHT
#
# Copyright 2009-2018 CRS4.
#
# 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 ap... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.