repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ehashman/oh-mainline | refs/heads/master | vendor/packages/python-social-auth/social/apps/webpy_app/models.py | 77 | """Flask SQLAlchemy ORM models for Social Auth"""
import web
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
from social.utils import setting_name, module_member
from social.storage.sqlalchemy_orm import SQLAlch... |
dpyro/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_typedef.py | 154 | def WebIDLTest(parser, harness):
parser.parse("""
typedef long mylong;
typedef long? mynullablelong;
interface Foo {
const mylong X = 5;
const mynullablelong Y = 7;
const mynullablelong Z = null;
void foo(mylong arg);
};
""")
results = parser.finish()... |
lsaffre/lino_book | refs/heads/master | lino_book/projects/dumps/c/dumps_foo_2.py | 3 | # -*- coding: UTF-8 -*-
logger.info("Loading 3 objects (part 2 of 2) to table dumps_foo...")
# fields: id, designation, last_visit, bar
loader.save(create_dumps_foo(3,['Three', 'Drei', 'Trois'],dt(2017,10,29,3,16,6),'10'))
loader.flush_deferred_objects()
|
PeterPetrik/QGIS | refs/heads/master | python/plugins/processing/modeler/EditModelAction.py | 33 | # -*- coding: utf-8 -*-
"""
***************************************************************************
EditModelAction.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***********************... |
ccn-2m/django | refs/heads/master | django/contrib/auth/tests/views.py | 4 | import os
import re
from django.conf import global_settings, settings
from django.contrib.sites.models import Site, RequestSite
from django.contrib.auth.models import User
from django.core import mail
from django.core.exceptions import SuspiciousOperation
from django.core.urlresolvers import reverse, NoReverseMatch
fr... |
cntnboys/410Lab6 | refs/heads/master | build/django/tests/dates/models.py | 166 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Article(models.Model):
title = models.CharField(max_length=100)
pub_date = models.DateField()
categories = models.ManyToManyField("Categor... |
alexjg/sqlalchemy-migrate | refs/heads/master | migrate/tests/fixture/models.py | 124 | from sqlalchemy import *
# test rundiffs in shell
meta_old_rundiffs = MetaData()
meta_rundiffs = MetaData()
meta = MetaData()
tmp_account_rundiffs = Table('tmp_account_rundiffs', meta_rundiffs,
Column('id', Integer, primary_key=True),
Column('login', Text()),
Column('passwd', Text()),
)
tmp_sql_table = T... |
xisisu/RT-Xen | refs/heads/rt-xen_2.0 | tools/python/xen/xend/server/pciif.py | 20 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... |
agileblaze/OpenStackTwoFactorAuthentication | refs/heads/master | horizon/openstack_dashboard/dashboards/admin/routers/urls.py | 66 | # Copyright 2012, Nachi Ueno, NTT MCL, 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 applic... |
themurph/openshift-tools | refs/heads/prod | openshift/installer/vendored/openshift-ansible-3.5.28/roles/lib_openshift/library/oc_service.py | 5 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... |
drmrd/ansible | refs/heads/devel | test/units/modules/network/f5/test_bigip_routedomain.py | 27 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks 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
import os
import json
import pytest
import sys
from nose.plugins.skip i... |
PhilHarnish/forge | refs/heads/master | src/data/max_heap.py | 1 | import heapq
from typing import Generic, Iterable, Tuple, TypeVar
T = TypeVar('T')
class MaxHeap(Generic[T]):
def __init__(self) -> None:
self._heap = []
self._pool = []
self._free_positions = []
def __len__(self) -> int:
return len(self._heap)
def push(self, cost: float, o: T) -> None:
i... |
plotly/plotly.py | refs/heads/master | packages/python/plotly/plotly/validators/parcats/line/colorbar/tickformatstop/_templateitemname.py | 1 | import _plotly_utils.basevalidators
class TemplateitemnameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="templateitemname",
parent_name="parcats.line.colorbar.tickformatstop",
**kwargs
):
super(TemplateitemnameValidator, self).... |
mhbu50/erpnext | refs/heads/develop | erpnext/stock/doctype/price_list/__init__.py | 37694 | from __future__ import unicode_literals
|
moodpulse/l2 | refs/heads/develop | rest/l2_view_sets.py | 1 | #
# class UserViewSet(viewsets.ModelViewSet):
# queryset = User.objects.all()
# serializer_class = UserSerializer
#
# class UserViewSet(viewsets.ModelViewSet):
# queryset = User.objects.all()
# serializer_class = UserSerializer
#
# class UserViewSet(viewsets.ModelViewSet):
# queryset = User.objects.... |
lightcn/odoo | refs/heads/8.0 | addons/sale/report/__init__.py | 370 | # -*- 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... |
Cloudef/mpv | refs/heads/master | waftools/features.py | 38 | from waflib.Options import OptionsContext
import optparse
class Feature(object):
def __init__(self, group, feature):
self.group = group
self.identifier, self.attributes = feature['name'], feature
def add_options(self):
[self.add_option(option_rule) for option_rule in self.option_ru... |
sajeeshcs/nested_quota_latest | refs/heads/master | nova/api/openstack/compute/contrib/extended_status.py | 79 | # Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
open-switch/ops-quagga | refs/heads/master | ops-tests/feature/bgp/test_bgp_ft_routemap_metric_clear_peer_out.py | 2 | # -*- coding: utf-8 -*-
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
# 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.a... |
erkrishna9/odoo | refs/heads/master | addons/product_visible_discount/__openerp__.py | 120 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... |
SCSSG/Odoo-SCS | refs/heads/master | addons/mrp_operations/report/mrp_workorder_analysis.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... |
aschampion/CATMAID | refs/heads/master | django/applications/catmaid/control/treenodetable.py | 4 | import json
from django.db import connection
from django.http import HttpResponse
from catmaid.models import UserRole
from catmaid.control.authentication import requires_user_role
@requires_user_role(UserRole.Browse)
def treenode_table_content(request, project_id=None, skid=None):
project_id = int(project_id)
... |
rjhowe/openshift-ansible | refs/heads/master | roles/openshift_health_checker/test/curator_test.py | 55 | import pytest
from openshift_checks.logging.curator import Curator, OpenShiftCheckException
plain_curator_pod = {
"metadata": {
"labels": {"component": "curator", "deploymentconfig": "logging-curator"},
"name": "logging-curator-1",
},
"status": {
"containerStatuses": [{"ready": Tr... |
mrshelly/openerp71313 | refs/heads/master | openerp/addons/account_voucher/report/account_voucher_sales_receipt.py | 56 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... |
squilter/mavlink | refs/heads/master | pymavlink/generator/lib/minixsv/xsvalSchema.py | 79 | #
# minixsv, Release 0.9.0
# file: xsvalSchema.py
#
# Derived validator class (for validation of schema files)
#
# history:
# 2004-10-07 rl created
# 2006-08-18 rl W3C testsuite passed for supported features
# 2007-05-24 rl Features for release 0.8 added, several bugs fixed
#
# Copyright (c) 2004-2008 ... |
nishad-jobsglobal/odoo-marriot | refs/heads/master | addons/l10n_nl/__openerp__.py | 260 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009 Veritos - Jan Verlaan - www.veritos.nl
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# con... |
jacksonicson/paper.IS2015 | refs/heads/master | control/Control/generated/times/constants.py | 16 | #
# Autogenerated by Thrift Compiler (0.8.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException
from ttypes import *
|
kirca/OpenUpgrade | refs/heads/8.0 | addons/website/models/ir_ui_view.py | 17 | # -*- coding: utf-8 -*-
import copy
from lxml import etree, html
from openerp import SUPERUSER_ID, api
from openerp.addons.website.models import website
from openerp.http import request
from openerp.osv import osv, fields
class view(osv.osv):
_inherit = "ir.ui.view"
_columns = {
'page': fields.boolea... |
harshaneelhg/scikit-learn | refs/heads/master | sklearn/utils/sparsetools/__init__.py | 347 | """sparsetools - a collection of routines for sparse matrix operations"""
from ._traversal import connected_components
__all__ = ["connected_components"]
|
hroark13/prevail_kernel_fixed | refs/heads/master | Documentation/networking/cxacru-cf.py | 14668 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... |
jounex/hue | refs/heads/master | desktop/core/ext-py/python-openid-2.2.5/openid/test/test_xrires.py | 87 |
from unittest import TestCase
from openid.yadis import xrires
class ProxyQueryTestCase(TestCase):
def setUp(self):
self.proxy_url = 'http://xri.example.com/'
self.proxy = xrires.ProxyResolver(self.proxy_url)
self.servicetype = 'xri://+i-service*(+forwarding)*($v*1.0)'
self.servicet... |
psiq/gdsfactory | refs/heads/master | pp/add_pins.py | 1 | """ add markers to Devices:
- pins
- outline
"""
import numpy as np
from pp.layers import LAYER, port_type2layer
from pp.port import read_port_markers
import pp
def _rotate(v, m):
return np.dot(m, v)
def add_pin_triangle(component, port, layer=LAYER.PORT, label_layer=LAYER.TEXT):
"""
# The port visual... |
bloyl/mne-python | refs/heads/placeholder | mne/io/bti/tests/test_bti.py | 4 | # Authors: Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
from io import BytesIO
import os
import os.path as op
from functools import reduce, partial
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_allclose, assert_e... |
rjschwei/azure-sdk-for-python | refs/heads/master | azure-mgmt-monitor/azure/mgmt/monitor/models/retention_policy.py | 1 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
rancher/rancher | refs/heads/master | tests/validation/tests/v3_api/test_ingress.py | 3 | """
This test suite contains tests to validate ingress create/edit/delete with
different possible way and with different roles of users.
Test requirement:
Below Env variables need to set
CATTLE_TEST_URL - url to rancher server
ADMIN_TOKEN - Admin token from rancher
USER_TOKEN - User token from rancher
RANCHER_CLUSTER_N... |
ganeshchand/python3 | refs/heads/master | basic/variableassignment.py | 1 | __author__ = 'ganeshchand'
def main():
a = 10 # int
display(a, None)
a = 10.2 # float
display(a, None)
a = "Hello" # string
display(a, None)
a = {1, 2, 3, 4} # set of values
display(a, None)
a = [1, 2, 3, 4] # list of values
display(a, None)
a = (1, 2, 3, 4) # tuples
... |
strint/tensorflow | refs/heads/master | tensorflow/contrib/slim/python/slim/data/parallel_reader.py | 80 | # 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... |
mezz64/home-assistant | refs/heads/dev | homeassistant/components/apple_tv/media_player.py | 12 | """Support for Apple TV media player."""
import logging
import pyatv.const as atv_const
from homeassistant.components.media_player import MediaPlayerEntity
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MUSIC,
MEDIA_TYPE_TVSHOW,
MEDIA_TYPE_VIDEO,
SUPPORT_NEXT_TRACK,
SUPPORT_P... |
pv/mgutenberg | refs/heads/master | mgutenberg/main.py | 1 | #!/usr/bin/env python
import subprocess
import os
import optparse
import urllib
import math
from ui import *
from model import *
import reader
CONFIG_SCHEMA = {
'search_dirs': (list, str),
'save_dir': str,
'positions': (dict, int),
'inverse_colors': bool,
'portrait': bool,
'ui_page': int,
... |
iambibhas/django | refs/heads/master | django/forms/extras/widgets.py | 42 | """
Extra HTML Widget classes
"""
from __future__ import unicode_literals
import datetime
import re
from django.forms.widgets import Widget, Select
from django.utils import datetime_safe
from django.utils.dates import MONTHS
from django.utils.encoding import force_str
from django.utils.safestring import mark_safe
fro... |
jluellen/pygooglevoice | refs/heads/master | examples/voicemail.py | 39 | from googlevoice import Voice,util
voice = Voice()
voice.login()
for message in voice.voicemail().messages:
util.print_(message) |
Guidobelix/pyload | refs/heads/stable | module/plugins/internal/CaptchaService.py | 1 | # -*- coding: utf-8 -*-
from module.plugins.internal.Captcha import Captcha
class CaptchaService(Captcha):
__name__ = "CaptchaService"
__type__ = "captcha"
__version__ = "0.34"
__status__ = "stable"
__description__ = """Base anti-captcha service plugin"""
__license__ = "GPLv3"
... |
quake0day/oj | refs/heads/master | Count of Smaller Number.py | 1 | class Solution:
"""
@param A: A list of integer
@return: The number of element in the array that
are smaller that the given integer
"""
def countOfSmallerNumber(self, A, queries):
# write your code here
res = []
A = sorted(A)
n = len(A)
while i ... |
gauravbose/digital-menu | refs/heads/master | tests/migrations/test_graph.py | 24 | from unittest import expectedFailure
from django.db.migrations.graph import (
CircularDependencyError, MigrationGraph, NodeNotFoundError,
)
from django.test import TestCase
from django.utils.encoding import force_text
class GraphTests(TestCase):
"""
Tests the digraph structure.
"""
def test_simp... |
nwchandler/ansible | refs/heads/devel | lib/ansible/modules/storage/netapp/netapp_e_amg_role.py | 69 | #!/usr/bin/python
# (c) 2016, NetApp, Inc
#
# 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.... |
tkajtoch/python-social-auth | refs/heads/master | social/backends/odnoklassniki.py | 4 | """
Odnoklassniki OAuth2 and Iframe Application backends, docs at:
http://psa.matiasaguirre.net/docs/backends/odnoklassnikiru.html
"""
from hashlib import md5
from social.p3 import unquote
from social.backends.base import BaseAuth
from social.backends.oauth import BaseOAuth2
from social.exceptions import AuthFaile... |
laslabs/Python-Carepoint | refs/heads/feature/SMD-319-enum-image_type_cn | carepoint/models/cph/vendor.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2015-TODAY LasLabs Inc.
# License MIT (https://opensource.org/licenses/MIT).
from carepoint import Carepoint
from sqlalchemy import (Column,
Integer,
String,
DateTime,
ForeignKey,
... |
caveman-dick/ansible | refs/heads/devel | lib/ansible/modules/cloud/openstack/os_quota.py | 12 | #!/usr/bin/python
# Copyright (c) 2016 Pason System Corporation
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Thi... |
collinjackson/mojo | refs/heads/master | sky/tools/webkitpy/layout_tests/servers/apache_http.py | 11 | # Copyright (C) 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 of conditions and the ... |
HuberTRoy/MusicPlayer | refs/heads/master | MusicPlayer/apis/apiRequestsBase.py | 1 | """
提供封装好的持久连接的Http请求类。
默认返回(cookies, jsonData),
is_json参数为False时返回(cookies, text),
不提供返回二进制。
"""
__author__ = 'cyrbuzz'
import logging
import requests
from contextlib import contextmanager
logger = logging.getLogger(__name__)
# 不应该在这定义。
# 暂且放在这。
@contextmanager
def ignored(*exception):
"""
... |
richardgroves/namebench | refs/heads/master | nb_third_party/dns/node.py | 215 | # Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... |
esthermm/odoomrp-utils | refs/heads/8.0 | mrp_bom_structure_show_child/tests/test_mrp_bom_structure_show_child.py | 10 | # -*- coding: utf-8 -*-
# (c) 2015 Oihane Crucelaegui - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp.tests.common import TransactionCase
class TestMrpBomStructureShowChild(TransactionCase):
def setUp(self):
super(TestMrpBomStructureShowChild, self).setUp()
... |
40223212/2015cdbg4_6-22 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testsentinel.py | 736 | import unittest
from unittest.mock import sentinel, DEFAULT
class SentinelTest(unittest.TestCase):
def testSentinels(self):
self.assertEqual(sentinel.whatever, sentinel.whatever,
'sentinel not stored')
self.assertNotEqual(sentinel.whatever, sentinel.whateverelse,
... |
thaumos/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_device_auth.py | 38 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
466152112/hyperopt | refs/heads/master | hyperopt/tests/test_tpe.py | 7 | from functools import partial
import os
import unittest
import nose
import numpy as np
try:
import matplotlib.pyplot as plt
except ImportError:
pass
from hyperopt import pyll
from hyperopt.pyll import scope
from hyperopt import Trials
from hyperopt.base import miscs_to_idxs_vals, STATUS_OK
from hyperopt i... |
gaddman/ansible | refs/heads/devel | lib/ansible/module_utils/network/nos/nos.py | 79 | #
# (c) 2018 Extreme Networks Inc.
#
# 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.
#
# Ans... |
google-research/language | refs/heads/master | language/nqg/common/cky/cky_utils.py | 1 | # coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... |
locnet/google-api | refs/heads/master | Lesson_2/00_Conference_Central/settings.py | 109 | #!/usr/bin/env python
"""settings.py
Udacity conference server-side Python App Engine app user settings
$Id$
created/forked from conference.py by wesc on 2014 may 24
"""
# Replace the following lines with client IDs obtained from the APIs
# Console or Cloud Console.
WEB_CLIENT_ID = 'replace with Web client ID'
|
dcroc16/skunk_works | refs/heads/master | google_appengine/lib/django-1.5/tests/regressiontests/utils/termcolors.py | 138 | from django.utils import unittest
from django.utils.termcolors import parse_color_setting, PALETTES, DEFAULT_PALETTE, LIGHT_PALETTE, DARK_PALETTE, NOCOLOR_PALETTE
class TermColorTests(unittest.TestCase):
def test_empty_string(self):
self.assertEqual(parse_color_setting(''), PALETTES[DEFAULT_PALETTE])
... |
SweetheartSquad/REST-Services | refs/heads/master | api/migrations/0008_auto_20160219_1652.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0007_componentset_description'),
]
operations = [
migrations.AddField(
model_name='scenario',
... |
jmcarbo/openerp7 | refs/heads/master | openerp/addons/lunch/wizard/__init__.py | 440 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... |
xflows/textflows | refs/heads/master | workflows/subgroup_discovery/SubgroupDiscovery/targetClassLearner.py | 7 | import orange
import sys
def Learner( examples=None, **kwds):
learner = apply(Learner_Class, (), kwds)
if examples:
return learner(examples, targetClass)
else:
return learner
class Learner_Class:
def __init__(self, targetClass ,name='TargetClassClassifier'):
self.... |
mvaled/OpenUpgrade | refs/heads/8.0 | openerp/report/render/render.py | 457 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
alikins/ansible | refs/heads/devel | lib/ansible/modules/cloud/misc/proxmox.py | 49 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
sigmavirus24/charade | refs/heads/develop | charade/jpcntx.py | 49 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 Ri... |
mfraezz/osf.io | refs/heads/develop | api_tests/base/test_pagination.py | 12 | # -*- coding: utf-8 -*-
from nose.tools import * # noqa:
from osf_tests import factories
from tests.base import ApiTestCase
from api.base import settings
from api.base.pagination import MaxSizePagination
class TestMaxPagination(ApiTestCase):
def test_no_query_param_alters_page_size(self):
assert MaxSiz... |
sarantapichos/faircoop-market | refs/heads/master | addons/mrp/report/mrp_report.py | 341 | # -*- 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... |
proversity-org/edx-platform | refs/heads/master | openedx/core/djangoapps/programs/migrations/0006_programsapiconfig_xseries_ad_enabled.py | 53 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('programs', '0005_programsapiconfig_max_retries'),
]
operations = [
migrations.AddField(
model_name='programsapic... |
ice9js/servo | refs/heads/master | tests/wpt/css-tests/css-text-decor-3_dev/xhtml1/reference/support/generate-text-emphasis-style-property-tests.py | 841 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-style-property-011 ~ 020 which
cover all possible values of text-emphasis-style property, except none
and <string>, with horizontal writing mode. It outputs a list of all
tests it generated in the format of Mozilla reftest.... |
ruohoruotsi/Wavelet-Tree-Synth | refs/heads/master | nnet/VRNN_nips2015/models/iamondb/vrnn_gauss.py | 1 | import ipdb
import numpy as np
import theano
import theano.tensor as T
from os import sys, path
sys.path.append("/Users/iorife/github/Investigaciones/nnet/VRNN_nips2015")
sys.path.append("/Users/iorife/github/Investigaciones/")
from nnet.VRNN_nips2015.cle.cle.cost import BiGauss, KLGaussianGaussian
from nnet.VRNN_nip... |
JFriel/honours_project | refs/heads/master | venv/lib/python2.7/site-packages/nltk/tokenize/casual.py | 7 | # coding: utf-8
#
# Natural Language Toolkit: Twitter Tokenizer
#
# Copyright (C) 2001-2016 NLTK Project
# Author: Christopher Potts <cgpotts@stanford.edu>
# Ewan Klein <ewan@inf.ed.ac.uk> (modifications)
# Pierpaolo Pantone <> (modifications)
# URL: <http://nltk.org/>
# For license information, see LIC... |
kustodian/ansible | refs/heads/devel | lib/ansible/modules/monitoring/zabbix/zabbix_group_info.py | 9 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) me@mimiko.me
# 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.1',
'status... |
vrv/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/learn_runner.py | 7 | # 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... |
GauravSahu/odoo | refs/heads/8.0 | addons/mrp_operations/report/mrp_workorder_analysis.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... |
paolodedios/tensorflow | refs/heads/master | tensorflow/python/data/util/structure.py | 5 | # Copyright 2018 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... |
sbromley07/example-app | refs/heads/master | lib/markupsafe/tests.py | 674 | # -*- coding: utf-8 -*-
import gc
import sys
import unittest
from markupsafe import Markup, escape, escape_silent
from markupsafe._compat import text_type
class MarkupTestCase(unittest.TestCase):
def test_adding(self):
# adding two strings should escape the unsafe one
unsafe = '<script type="appl... |
slisson/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/gis/maps/google/zoom.py | 327 | from django.contrib.gis.geos import GEOSGeometry, LinearRing, Polygon, Point
from django.contrib.gis.maps.google.gmap import GoogleMapException
from math import pi, sin, cos, log, exp, atan
# Constants used for degree to radian conversion, and vice-versa.
DTOR = pi / 180.
RTOD = 180. / pi
class GoogleZoom(object):
... |
zenja/benchmarking-cloud-storage-systems | refs/heads/master | benchcloud/drivers/localfs_driver.py | 1 | import shutil
from driver import Driver
class LocalFSDriver(Driver):
"""Driver for local file system"""
def __init__(self):
super(LocalFSDriver, self).__init__()
def connect(self, include_guest=False):
pass
def acquire_access_token(self, guest=False):
pass
def upload(se... |
bobeirasa/virtualenvs | refs/heads/master | pygeckozabbix/lib/python2.7/site-packages/setuptools/depends.py | 410 | from __future__ import generators
import sys, imp, marshal
from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN
from distutils.version import StrictVersion, LooseVersion
__all__ = [
'Require', 'find_module', 'get_module_constant', 'extract_constant'
]
class Require:
"""A prerequisite to building o... |
FilloretaSyla/Techstitution | refs/heads/master | run.py | 1 | import argparse
from app import create_app
# Create the flask app.
app = create_app()
# Run the app
if __name__ == '__main__':
# Define the arguments.
parser = argparse.ArgumentParser()
parser.add_argument('--host', default='0.0.0.0', help='Host to bind to: [%(default)s].')
parser.add_argument('--po... |
cyanfish/heltour | refs/heads/master | heltour/tournament/migrations/0147_auto_20170223_2220.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-02-23 22:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tournament', '0146_league_description'),
]
operations = [
migrations.AlterField(
model_name='league',
... |
Chilledheart/depot_tools | refs/heads/master | third_party/boto/gs/acl.py | 51 | # Copyright 2010 Google Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# trib... |
ericdill/bokeh | refs/heads/master | examples/plotting/server/burtin.py | 42 | # The plot server must be running
# Go to http://localhost:5006/bokeh to view this plot
from collections import OrderedDict
from math import log, sqrt
import numpy as np
import pandas as pd
from six.moves import cStringIO as StringIO
from bokeh.plotting import figure, show, output_server
antibiotics = """
bacteria,... |
Ch00k/ansible | refs/heads/devel | lib/ansible/utils/module_docs_fragments/openstack.py | 118 | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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... |
psb-seclab/CTFStuff | refs/heads/master | utils/exploitation/100_exp.py | 1 | import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("127.0.0.1", 31337))
exploit = 'A'*1017
print exploit
welcome_msg = s.recv(21)
print welcome_msg
s.send(exploit)
data = s.recv(2048)
print data |
rouge8/pip | refs/heads/develop | src/pip/_vendor/distlib/manifest.py | 87 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""
Class representing the list of files in a distribution.
Equivalent to distutils.filelist, but fixes some problems.
"""
import fnmatch
import logging
import os
import re
import sys
from . impor... |
modulexcite/code-problems | refs/heads/master | solutions/python/largest-continuous-sum.py | 31 | """solution to the largest-continuous-sum problem"""
def largest_continuous_sum(arr):
"""returns the highest sum of a continuous sequence in a given list"""
largest = 0
queue = []
for num in arr:
if len(queue) > 0 and queue[-1] + 1 != num:
sum = reduce(lambda x, y: x + y, queue)
... |
bzamecnik/sms-tools | refs/heads/master | lectures/04-STFT/plots-code/hanning.py | 1 | # matplotlib without any blocking GUI
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
from scipy.fftpack import fft
M = 64
N = 512
hN = N / 2
hM = M / 2
fftbuffer = np.zeros(N)
mX1 = np.zeros(N)
plt.figure(1, figsize=(7.5, 3.5))
fftbuffer[hN - hM:hN + hM] = np.hanning(M)
pl... |
EmadMokhtar/Django | refs/heads/master | django/core/serializers/__init__.py | 55 | """
Interfaces for serializing Django objects.
Usage::
from django.core import serializers
json = serializers.serialize("json", some_queryset)
objects = list(serializers.deserialize("json", json))
To add your own serializers, use the SERIALIZATION_MODULES setting::
SERIALIZATION_MODULES = {
... |
xkfz007/openh264 | refs/heads/master | docs/doxygen2rst.py | 79 | from __future__ import print_function
import re, sys, os, time, glob, errno, tempfile, binascii, subprocess, shutil
from lxml import etree
from optparse import OptionParser
import textwrap
import string
VERSION = '0.1'
__all__ = ['DoxyGen2RST']
LINE_BREAKER = "\n"
MAX_COLUMN = 80
def is_valid_uuid(uuid_string):
u... |
Balachan27/django | refs/heads/master | tests/template_tests/templatetags/testtags.py | 330 | from django.template import Library, Node
register = Library()
class EchoNode(Node):
def __init__(self, contents):
self.contents = contents
def render(self, context):
return ' '.join(self.contents)
@register.tag
def echo(parser, token):
return EchoNode(token.contents.split()[1:])
regis... |
raphaelrubino/nid | refs/heads/master | misc/prepare_data_mono_sent.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from nltk.util import ngrams
import numpy as np
def format_line( line, padding = 1 ):
line = line.strip()
line = "<s> " * padding + line + " </s>" * padding
line = line.split( " " )
return line
def init_vocab():
vocab = {
"unk": 0,
"<s>": 1,
"</s>"... |
dharmabumstead/ansible | refs/heads/devel | lib/ansible/playbook/role/requirement.py | 19 | # (c) 2014 Michael DeHaan, <michael@ansible.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) any later ve... |
duyet-website/api.duyet.net | refs/heads/master | lib/faker/providers/company/__init__.py | 19 | # coding=utf-8
from __future__ import unicode_literals
from .. import BaseProvider
localized = True
class Provider(BaseProvider):
formats = ['{{last_name}} {{company_suffix}}', ]
company_suffixes = ['Ltd', ]
def company(self):
"""
:example 'Acme Ltd'
"""
pattern = self... |
muffinresearch/addons-server | refs/heads/master | apps/landfill/tests/test_names.py | 15 | # -*- coding: utf-8 -*-
from nose.tools import eq_, ok_
import amo
import amo.tests
from landfill.names import generate_names
class NamesTests(amo.tests.TestCase):
def test_names_generation(self):
eq_(len(generate_names()), 136)
ok_('Exquisite Sandwich' in generate_names())
|
lmyrefelt/CouchPotatoServer | refs/heads/develop | libs/suds/client.py | 151 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... |
trosa/forca | refs/heads/master | reportlab/graphics/samples/stacked_column.py | 4 | #Autogenerated by ReportLab guiedit do not edit
from reportlab.graphics.charts.legends import Legend
from reportlab.graphics.charts.barcharts import VerticalBarChart
from reportlab.graphics.shapes import Drawing, _DrawingEditorMixin, String
from reportlab.graphics.charts.textlabels import Label
from excelcolors im... |
swannapa/erpnext | refs/heads/develop | erpnext/buying/doctype/supplier_scorecard_criteria/test_supplier_scorecard_criteria.py | 35 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestSupplierScorecardCriteria(unittest.TestCase):
def test_variables_exist(self):
delete_test_scorecards()
for d in test_good_... |
enclose-io/compiler | refs/heads/master | current/deps/v8/tools/release/auto_tag.py | 14 | #!/usr/bin/env python
# Copyright 2014 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# for py2/py3 compatibility
from __future__ import print_function
import argparse
import sys
from common_includes import *
class ... |
ysekky/chainer | refs/heads/master | chainer/functions/pooling/spatial_pyramid_pooling_2d.py | 3 | import numpy
import six
from chainer import cuda
from chainer.functions.array import concat
from chainer.functions.pooling import max_pooling_2d
from chainer.functions.pooling import pooling_2d
class SpatialPyramidPooling2D(pooling_2d.Pooling2D):
"""Spatial pyramid pooling over a set of 2d planes."""
def _... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.