repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
htzy/bigfour | refs/heads/master | common/lib/xmodule/xmodule/modulestore/inheritance.py | 23 | """
Support for inheritance of fields down an XBlock hierarchy.
"""
from __future__ import absolute_import
from datetime import datetime
from pytz import UTC
from xmodule.partitions.partitions import UserPartition
from xblock.fields import Scope, Boolean, String, Float, XBlockMixin, Dict, Integer, List
from xblock.run... |
michalliu/OpenWrt-Firefly-Libraries | refs/heads/master | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/test_importlib/extension/test_loader.py | 81 | from . import util as ext_util
from .. import abc
from .. import util
machinery = util.import_importlib('importlib.machinery')
import os.path
import sys
import types
import unittest
class LoaderTests(abc.LoaderTests):
"""Test load_module() for extension modules."""
def setUp(self):
self.loader = s... |
lpomfrey/django-staticpreprocessor | refs/heads/master | test_project/wsgi.py | 51 | """
WSGI config for test_project project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATI... |
GoogleCloudPlatform/marketplace-k8s-app-tools | refs/heads/master | marketplace/deployer_util/print_published_version.py | 1 | #!/usr/bin/env python3
#
# Copyright 2018 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 ... |
jvrsantacruz/click | refs/heads/master | tests/test_options.py | 17 | # -*- coding: utf-8 -*-
import re
import os
import click
import pytest
def test_prefixes(runner):
@click.command()
@click.option('++foo', is_flag=True, help='das foo')
@click.option('--bar', is_flag=True, help='das bar')
def cli(foo, bar):
click.echo('foo=%s bar=%s' % (foo, bar))
result =... |
fabian4/ceilometer | refs/heads/master | ceilometer/event/storage/base.py | 10 | #
# 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... |
birkin/rapid_exports | refs/heads/master | config/urls.py | 1 | # -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.views.generic import RedirectView
admin.autodiscover()
urlpatterns = patterns('',
url( r'^admin/', include(admin.site.urls) ),
url( r'^tasks/$', 'rapid_app.views.tasks', name='tasks_ur... |
Haravan/haravan_python_api | refs/heads/master | haravan/resources/transaction.py | 1 | from ..base import HaravanResource
class Transaction(HaravanResource):
_prefix_source = "/admin/orders/$order_id/"
|
JanDintel/ansible | refs/heads/devel | lib/ansible/modules/__init__.py | 2520 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
sunlianqiang/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/test_flufl.py | 179 | import __future__
import unittest
class FLUFLTests(unittest.TestCase):
def test_barry_as_bdfl(self):
code = "from __future__ import barry_as_FLUFL; 2 {0} 3"
compile(code.format('<>'), '<BDFL test>', 'exec',
__future__.CO_FUTURE_BARRY_AS_BDFL)
self.assertRaises(SyntaxError, ... |
fabioz/Pydev | refs/heads/master | plugins/org.python.pydev.jython/Lib/json/tests/test_check_circular.py | 145 | from json.tests import PyTest, CTest
def default_iterable(obj):
return list(obj)
class TestCheckCircular(object):
def test_circular_dict(self):
dct = {}
dct['a'] = dct
self.assertRaises(ValueError, self.dumps, dct)
def test_circular_list(self):
lst = []
lst.append... |
lakshayg/tensorflow | refs/heads/master | tensorflow/tools/docs/parser_test.py | 20 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
katstalk/android_external_chromium_org | refs/heads/kk44 | tools/checkperms/PRESUBMIT.py | 145 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for checkperms.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmit A... |
fichter/grpc | refs/heads/master | src/python/grpcio_test/grpc_test/framework/face/event_invocation_synchronous_event_service_test.py | 14 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
jerearista/pyeapi | refs/heads/develop | pyeapi/api/vlans.py | 4 | #
# Copyright (c) 2014, Arista Networks, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of condit... |
vmthunder/nova | refs/heads/master | nova/pci/pci_whitelist.py | 8 | # Copyright (c) 2013 Intel, Inc.
# Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/li... |
aschwaighofer/swift | refs/heads/master | utils/swift_build_support/swift_build_support/products/llbuild.py | 52 | # swift_build_support/products/clang.py -------------------------*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.tx... |
mlcommons/training | refs/heads/master | recommendation/pytorch/neumf.py | 1 | import numpy as np
import torch
import torch.nn as nn
from mlperf_compliance import mlperf_log
class NeuMF(nn.Module):
def __init__(self, nb_users, nb_items,
mf_dim, mf_reg,
mlp_layer_sizes, mlp_layer_regs):
if len(mlp_layer_sizes) != len(mlp_layer_regs):
rai... |
pkoutsias/SickRage | refs/heads/master | lib/requests/packages/chardet/__init__.py | 1777 | ######################## BEGIN LICENSE BLOCK ########################
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later ve... |
GradysGhost/beamie | refs/heads/master | test/test.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import hashlib
import logging
import json
import os
import requests as r
import sys
# Point these settings at a running Beamie instance
protocol = 'http'
host = 'localhost'
port = 1337
base_path = '/'
url_base = "%s://%s:%i%s" % (
protocol, host, port, base_path
... |
bhupennewalkar1337/erpnext | refs/heads/develop | erpnext/stock/doctype/manufacturer/manufacturer.py | 55 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Manufacturer(Document):
pass
|
kirananto/RAZORMOTOG3 | refs/heads/cm-12.1 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# 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.
import errno, os
FUTEX_WAIT = 0... |
James1345/django-rest-framework | refs/heads/master | rest_framework/urlpatterns.py | 88 | from __future__ import unicode_literals
from django.conf.urls import include, url
from django.core.urlresolvers import RegexURLResolver
from rest_framework.settings import api_settings
def apply_suffix_patterns(urlpatterns, suffix_pattern, suffix_required):
ret = []
for urlpattern in urlpatterns:
if... |
odoomrp/odoomrp-wip | refs/heads/8.0 | stock_picking_package_info/models/stock_picking.py | 10 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields, api
from openerp.addon... |
damdam-s/account-financial-tools | refs/heads/8.0 | __unported__/async_move_line_importer/__openerp__.py | 32 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publi... |
firmanm/ansible | refs/heads/devel | lib/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... |
tinloaf/home-assistant | refs/heads/dev | homeassistant/components/sensor/ring.py | 3 | """
This component provides HA sensor support for Ring Door Bell/Chimes.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.ring/
"""
from datetime import timedelta
import logging
import voluptuous as vol
import homeassistant.helpers.config_validati... |
aronhnt/Truth-Or-Dare-Game | refs/heads/master | ErrorCheck.py | 1 | def errorCheck(varName, type, question):
x=0
while x == 0:
try:
varName=type(varName)
#tries to convert the variable into an integer/float
x=1
#stops the loop
except ValueError:
varName = input(question)
#if it is ... |
anandology/pyjamas | refs/heads/master | examples/flowpanel/FlowPanel.py | 2 | # -*- coding: iso-8859-1 -*-
import pyjd
#Ui components
from pyjamas.ui.VerticalPanel import VerticalPanel
from pyjamas.ui.FlowPanel import FlowPanel
from pyjamas.ui.RootPanel import RootPanel
from pyjamas.ui.Label import Label
from pyjamas.ui.Image import Image
from pyjamas.ui.SimplePanel import SimplePanel
from py... |
storm-computers/odoo | refs/heads/9.0 | openerp/tools/parse_version.py | 70 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
## this functions are taken from the setuptools package (version 0.6c8)
## http://peak.telecommunity.com/DevCenter/PkgResources#parsing-utilities
import re
component_re = re.compile(r'(\d+ | [a-z]+ | \.| -)', re.VERBOS... |
ononeor12/python-social-auth | refs/heads/master | examples/tornado_example/app.py | 58 | import sys
sys.path.append('../..')
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import scoped_session, sessionmaker
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
from social.apps.tornado_app.models impor... |
calfonso/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/nxos_rollback.py | 50 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
mikrosimage/rez | refs/heads/20160619_master.mikros.1 | src/rez/utils/filesystem.py | 1 | """
Filesystem-related utilities.
"""
from threading import Lock
from tempfile import mkdtemp
import weakref
import atexit
import posixpath
import ntpath
import os.path
import shutil
import os
import re
import stat
class TempDirs(object):
"""Tempdir manager.
Makes tmpdirs and ensures they're cleaned up on pr... |
bowlofstew/changes | refs/heads/master | changes/listeners/mail.py | 2 | from __future__ import absolute_import, print_function
from itertools import imap
import logging
from changes.models.jobplan import JobPlan
import toronado
from email.utils import parseaddr
from flask import current_app, render_template
from flask_mail import Message, sanitize_address
from jinja2 import Markup
from ... |
nuncjo/odoo | refs/heads/8.0 | addons/base_geolocalize/__init__.py | 389 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013_Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
CyanogenMod/android_kernel_samsung_t1 | refs/heads/cm-10.2 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# 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.
import errno, os
FUTEX_WAIT = 0... |
qk4l/Flexget | refs/heads/develop | flexget/tests/test_include.py | 5 | from __future__ import unicode_literals, division, absolute_import
import pytest
from jinja2 import Template
class TestInclude(object):
_config = """
tasks:
include_test:
include:
- {{ tmpfile_1 }}
- {{ tmpfile_2 }}
"""
@pytest.fixture
def config... |
cloudera/hue | refs/heads/master | desktop/core/ext-py/SQLAlchemy-1.3.17/lib/sqlalchemy/dialects/oracle/zxjdbc.py | 4 | # oracle/zxjdbc.py
# Copyright (C) 2005-2020 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:: oracle+zxjdbc
:name: zxJDBC for Jython
:dbapi: zxjdbc
... |
ioam/geoviews | refs/heads/master | geoviews/data/iris.py | 1 | from __future__ import absolute_import
import sys
import datetime
from itertools import product
import numpy as np
from holoviews.core.data import Dataset
from holoviews.core.data.interface import Interface, DataError
from holoviews.core.data.grid import GridInterface
from holoviews.core.dimension import Dimension, ... |
Deepali-AddWeb/chomchom | refs/heads/master | gulp/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py | 1534 | # 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.
import collections
import os
import gyp
import gyp.common
import gyp.msvs_emulation
import json
import sys
generator_supports_multiple_toolsets = True
generator_... |
Orav/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/unittest/test/test_skipping.py | 2 | import unittest
from unittest.test.support import LoggingResult
class Test_TestSkipping(unittest.TestCase):
def test_skipping(self):
class Foo(unittest.TestCase):
def test_skip_me(self):
self.skipTest("skip")
events = []
result = LoggingResult(even... |
anguoyang/SMQTK | refs/heads/master | python/Utils/utils_parse_filename.py | 2 | """
LICENCE
-------
Copyright 2013 by Kitware, Inc. All Rights Reserved. Please refer to
KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
"""
import os
import string
import re
def get_regex_sun_attributes():
""" Generates Regul... |
danielmt/vshard | refs/heads/master | vendor/github.com/youtube/vitess/py/vtproto/tableacl_pb2.py | 4 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tableacl.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _refl... |
pselle/calibre | refs/heads/master | src/calibre/gui2/convert/comic_input.py | 14 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from calibre.gui2.convert.comic_input_ui import Ui_Form
from calibre.gui2.convert i... |
mollstam/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/pyOpenSSL-0.15.1/OpenSSL/test/test_util.py | 29 | from OpenSSL._util import exception_from_error_queue, lib
from OpenSSL.test.util import TestCase
class ErrorTests(TestCase):
"""
Tests for handling of certain OpenSSL error cases.
"""
def test_exception_from_error_queue_nonexistent_reason(self):
"""
:py:func:`exception_from_error_queu... |
kamyu104/django | refs/heads/master | django/contrib/sitemaps/views.py | 352 | import datetime
from calendar import timegm
from functools import wraps
from django.contrib.sites.shortcuts import get_current_site
from django.core import urlresolvers
from django.core.paginator import EmptyPage, PageNotAnInteger
from django.http import Http404
from django.template.response import TemplateResponse
fr... |
FashtimeDotCom/evelink | refs/heads/master | evelink/parsing/contract_items.py | 7 | def parse_contract_items(api_result):
rowset = api_result.find('rowset')
results = []
for row in rowset.findall('row'):
a = row.attrib
item = {
'id': int(a['recordID']),
'type_id': int(a['typeID']),
'quantity': int(a['quantity']),
'singleton': ... |
gangadhar-kadam/latestchurcherp | refs/heads/v5.0 | erpnext/hr/doctype/salary_slip/__init__.py | 37694 | from __future__ import unicode_literals
|
nop33/indico | refs/heads/master | indico/modules/events/contributions/controllers/management.py | 2 | # This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... |
witcxc/scipy | refs/heads/master | scipy/optimize/_minimize.py | 2 | """
Unified interfaces to minimization algorithms.
Functions
---------
- minimize : minimization of a function of several variables.
- minimize_scalar : minimization of a function of one variable.
"""
from __future__ import division, print_function, absolute_import
__all__ = ['minimize', 'minimize_scalar']
from wa... |
cataliniordache/Human-Computer-Interaction-Project | refs/heads/master | RestfulServices/flask/lib/python2.7/site-packages/migrate/tests/versioning/test_keyedinstance.py | 79 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from migrate.tests import fixture
from migrate.versioning.util.keyedinstance import *
class TestKeydInstance(fixture.Base):
def test_unique(self):
"""UniqueInstance should produce unique object instances"""
class Uniq1(KeyedInstance):
@classmet... |
kjc88/sl4a | refs/heads/master | python/src/Lib/plat-os2emx/grp.py | 67 | # this module is an OS/2 oriented replacement for the grp standard
# extension module.
# written by Andrew MacIntyre, April 2001.
# updated July 2003, adding field accessor support
# note that this implementation checks whether ":" or ";" as used as
# the field separator character.
"""Replacement for grp standard ex... |
wakamori/luigi | refs/heads/master | test/postgres_test.py | 30 | # Copyright (c) 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 or agreed to in writing, s... |
mitya57/debian-buildbot | refs/heads/master | buildbot/test/util/connector_component.py | 2 | # 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... |
bzennn/blog_flask | refs/heads/master | python/lib/python3.5/site-packages/PIL/XbmImagePlugin.py | 17 | #
# The Python Imaging Library.
# $Id$
#
# XBM File handling
#
# History:
# 1995-09-08 fl Created
# 1996-11-01 fl Added save support
# 1997-07-07 fl Made header parser more tolerant
# 1997-07-22 fl Fixed yet another parser bug
# 2001-02-17 fl Use 're' instead of 'regex' (Python 2.1) (0.4)
# 2001-05-13 fl Ad... |
whitkirkchurch/baltimore | refs/heads/master | venv/lib/python2.7/site-packages/pygame/_camera_vidcapture.py | 16 |
import pygame
def list_cameras():
return [0]
# this just cycles through all the cameras trying to open them
cameras = []
for x in range(256):
try:
c = Camera(x)
except:
break
cameras.append(x)
return cameras
def init():
global vidcap
try:... |
infoxchange/django-guardian | refs/heads/devel | example_project/manage.py | 43 | #!/usr/bin/env python
import django
import os
import sys
if django.VERSION < (1, 5):
sys.stderr.write("ERROR: guardian's example project must be run with "
"Django 1.5 or later!\n")
sys.exit(1)
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
... |
abdullah2891/remo | refs/heads/master | remo/profiles/migrations/0022_auto__chg_field_userprofile_date_joined_program.py | 3 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'UserProfile.date_joined_program'
db.alter_column('profiles_userprofile', 'date_joined_pr... |
Weihonghao/ECM | refs/heads/master | Vpy34/lib/python3.5/site-packages/tensorflow/python/training/optimizer.py | 8 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
citrix-openstack-build/nova | refs/heads/master | nova/tests/fake_crypto.py | 29 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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/li... |
1200wd/bitcoinlib | refs/heads/master | examples/services.py | 1 | # -*- coding: utf-8 -*-
#
# BitcoinLib - Python Cryptocurrency Library
#
# EXAMPLES - Creating and Using Cryptocurrency Wallets
#
# © 2017 November - 1200 Web Development <http://1200wd.com/>
#
from pprint import pprint
from bitcoinlib.services.services import *
# Tests for specific provider
srv = Service(n... |
iw3hxn/LibrERP | refs/heads/master | massive_uom_change/__init__.py | 18 | # -*- coding: utf-8 -*-
# Copyright 2012 Francesco OpenCode Apruzzese <f.apruzzese@andreacometa.it>
#
# 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 versi... |
dr-prodigy/python-holidays | refs/heads/master | test/countries/test_poland.py | 1 | # -*- coding: utf-8 -*-
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Author: ryanss <ryanssdev@icl... |
liavkoren/djangoDev | refs/heads/master | django/contrib/humanize/apps.py | 102 | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class HumanizeConfig(AppConfig):
name = 'django.contrib.humanize'
verbose_name = _("Humanize")
|
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/component/bio/bio_component_clothing_casual_entertainer.py | 85615 | import sys
def setup(core, object):
return |
agry/NGECore2 | refs/heads/master | scripts/object/static/particle/pt_light_constant_blue.py | 85615 | import sys
def setup(core, object):
return |
aforalee/keystone | refs/heads/master | keystone/tests/unit/test_auth.py | 3 | # 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 or agreed to in... |
apagac/cfme_tests | refs/heads/master | sprout/sprout/urls.py | 20 | # -*- coding: utf-8 -*-
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
from appliances import views
urlpatterns = [
# Examples:
url(r'^$', RedirectView.as_view(pattern_name=views.index, permanent=False), name='home'),
# url(r'^... |
shastikk/youtube-dl | refs/heads/master | youtube_dl/extractor/vk.py | 79 | # encoding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
orderedSet,
str_to_int,
unescapeHTML,
unified_strdate... |
uzgit/ardupilot | refs/heads/master | Tools/mavproxy_modules/lib/magcal_graph_ui.py | 108 | # Copyright (C) 2016 Intel Corporation. All rights reserved.
#
# This file 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.
#
# This fi... |
yongtang/tensorflow | refs/heads/master | tensorflow/python/lib/io/file_io_test.py | 5 | # This Python file uses the following encoding: utf-8
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.o... |
PaulWGraham/ExampleSite | refs/heads/master | brogue/example/templatetags/emails.py | 1 | from django import template
from allauth.account.models import EmailAddress
register = template.Library()
@register.simple_tag(takes_context=True)
def has_verified_primary_email(context):
try:
context.request.user.emailaddress_set.get(verified = True, primary = True)
except EmailAddress.DoesNotExist:
return Fals... |
OpServ-Monitoring/opserv-backend | refs/heads/master | app/gathering/measuring/pysensors_source.py | 1 | '''
This module is a generic not implemented source
'''
from gathering.measuring.MeasuringSource import MeasuringSource
from misc.constants import Operating_System
class GenericSource(MeasuringSource):
'''
Source description
'''
_supported_os = [Operating_System.linux]
_supported_comps = ... |
pombredanne/invenio-old | refs/heads/master | modules/bibformat/lib/elements/bfe_editors.py | 4 | # -*- coding: utf-8 -*-
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either versio... |
vlinhd11/vlinhd11-android-scripting | refs/heads/master | python/src/Lib/encodings/mac_romanian.py | 593 | """ Python Character Mapping Codec mac_romanian generated from 'MAPPINGS/VENDORS/APPLE/ROMANIAN.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... |
kanarelo/dairy | refs/heads/master | dairy/core/admin.py | 1 | from django.contrib import admin
from .models import *
from django.contrib.gis import admin
models = globals().copy()
for name, Model in models.iteritems():
if hasattr(Model, '_meta') and not Model._meta.abstract and not 'UserProfile' == name:
class Admin(admin.ModelAdmin):
model = Model
... |
tdtrask/ansible | refs/heads/devel | lib/ansible/modules/network/a10/a10_server_axapi3.py | 16 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Mischa Peters <mpeters@a10networks.com>
# (c) 2016, Eric Chou <ericc@a10networks.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__ = ty... |
NetApp/cinder | refs/heads/master | cinder/objects/group_type.py | 5 | # Copyright 2016 EMC Corporation
#
# 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... |
spennihana/h2o-3 | refs/heads/master | h2o-py/tests/testdir_munging/unop/pyunit_math_ops2.py | 8 | from __future__ import division
from builtins import zip
from builtins import range
from past.utils import old_div
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
import numpy as np
import random
import math
import scipy.special
def expr_math_ops():
sin_cos_tan_atan_sinh_cosh_t... |
kxliugang/edx-platform | refs/heads/master | lms/djangoapps/mobile_api/social_facebook/groups/__init__.py | 128 | """
Groups API
"""
|
fullkawa/aglab | refs/heads/master | test/utiltest.py | 1 | # -*- coding: utf-8 -*-
import unittest
import util
class UtilTestCase(unittest.TestCase):
def setUp(self):
unittest.TestCase.setUp(self)
def test_build_urlpath_case1(self):
lst = ['path', 'to', 'hoge']
path = util.build_urlpath(lst)
self.assertEqual(pat... |
esthermm/enco | refs/heads/master | opertek_custom/__openerp__.py | 1 | # -*- coding: utf-8 -*-
# © 2017 Esther Martín - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Opertek - Custom",
"version": "8.0.1.0.0",
"author": "AvanzOSC",
"license": "AGPL-3",
"category": "Custom module",
"website": "http://www.avanzosc.es",
"cont... |
moyogo/tachyfont | refs/heads/master | run_time/src/gae_server/third_party/fonttools/Lib/fontTools/ttLib/tables/T_S_I_S_.py | 11 | from . import asciiTable
class table_T_S_I_S_(asciiTable.asciiTable):
pass
|
oceanobservatories/mi-dataset | refs/heads/master | mi/dataset/parser/test/test_pco2w_abc.py | 7 | #!/usr/bin/env python
__author__ = 'mworden'
"""
@package mi.dataset.parser.test.test_pco2w_abc
@author Mark Worden
@brief Test code for the pco2w_abc parser
"""
import os
from nose.plugins.attrib import attr
from mi.dataset.dataset_parser import DataSetDriverConfigKeys
from mi.dataset.driver.pco2w_abc.resource im... |
openstack/tacker | refs/heads/master | tacker/vnfm/lcm_user_data/abstract_user_data.py | 2 | #
# 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 ... |
keithhendry/treadmill | refs/heads/master | treadmill/runtime/linux/_run.py | 3 | """Manages Treadmill applications lifecycle.
"""
import logging
import os
import socket
from treadmill import appcfg
from treadmill import apphook
from treadmill import cgroups
from treadmill import firewall
from treadmill import fs
from treadmill import iptables
from treadmill import newnet
from treadmill import run... |
mistercrunch/airflow | refs/heads/master | airflow/providers/google/cloud/hooks/stackdriver.py | 6 | #
# 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... |
Yannig/ansible-modules-core | refs/heads/devel | cloud/amazon/s3.py | 4 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... |
gylian/headphones | refs/heads/master | lib/requests/packages/chardet/mbcsgroupprober.py | 2768 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
geonexus/fiware-cloto | refs/heads/develop | fiware_cloto/cloto/constants.py | 1 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Copyright 2014 Telefónica Investigación y Desarrollo, S.A.U
#
# This file is part of FI-WARE project.
#
# 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 th... |
rwillmer/django | refs/heads/master | tests/migrations/test_loader.py | 165 | from __future__ import unicode_literals
from unittest import skipIf
from django.db import connection, connections
from django.db.migrations.exceptions import AmbiguityError, NodeNotFoundError
from django.db.migrations.loader import MigrationLoader
from django.db.migrations.recorder import MigrationRecorder
from djang... |
robweber/maraschino | refs/heads/master | lib/jinja2/environment.py | 111 | # -*- coding: utf-8 -*-
"""
jinja2.environment
~~~~~~~~~~~~~~~~~~
Provides a class that holds runtime and parsing time options.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from jinja2 import nodes
from jinja2.defaults import *
from ... |
SabatierBoris/CecileWebSite | refs/heads/master | pyramidapp/forms/login.py | 1 | # vim: set fileencoding=utf-8 :
"""
Login forms module
"""
from .csrfform import CSRFSecureForm
from wtforms.fields import (
TextField,
PasswordField,
)
from wtforms import validators
class LoginForm(CSRFSecureForm):
# pylint: disable=R0903
"""
Form for login a user
"""
login = TextField('... |
prabhugs/scripts | refs/heads/master | hackerearth/r.py | 1 | l1 = []
l2 = []
from collections import Counter
with open ("r", "r") as fp:
for line in fp:
a = line.split()
l1.append(a[0])
l2.append(a[1])
f= Counter(l1)
p= Counter(l2)
print sum((f-p).values())
print sum((p-f).values())
|
bfg-repo-cleaner-demos/linux-original | refs/heads/master | arch/ia64/scripts/unwcheck.py | 13143 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... |
signed/intellij-community | refs/heads/master | python/testData/postfix/isNotNone/topLevel_after.py | 39 | if True is not None:
<caret> |
WebSpider/SickRage | refs/heads/master | lib/sqlalchemy/event/registry.py | 77 | # event/registry.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
"""Provides managed registration services on behalf of :func:`.listen`
arguments.
B... |
luvten/flask | refs/heads/master | flask/exthook.py | 142 | # -*- coding: utf-8 -*-
"""
flask.exthook
~~~~~~~~~~~~~
Redirect imports for extensions. This module basically makes it possible
for us to transition from flaskext.foo to flask_foo without having to
force all extensions to upgrade at the same time.
When a user does ``from flask.ext.foo import... |
jainaman224/Algo_Ds_Notes | refs/heads/master | Centered_Square_Number/Centered_Square_Number.py | 1 | '''
Centered Square Number is a centered figurate number that gives the number
of dots in a square with a dot in the center and all other dots surrounding
the center dot in successive square layers.
Nth Centered square number can be calculated by using formula n^2 + (n-1)^2.
'''
def centeredSquare (num):
# U... |
ernestkym/mfcuk | refs/heads/master | src/pm3_mfc_parser.py | 13 | #!/usr/bin/python
# Original source: proxmark3.org community forum
import sys
import os
import string
import commands
def line_tag(line):
if string.find(line, 'TAG') > 0:
return True
return False
def line_rdr(line):
if string.find(line, 'TAG') < 1:
return True
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.