repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
stanley-cheung/grpc | refs/heads/master | src/python/grpcio_tests/tests_aio/unit/__init__.py | 38 | # Copyright 2019 The gRPC Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
oihane/odoomrp-wip | refs/heads/8.0 | web_widget_float_time_second/__openerp__.py | 8 | # -*- coding: utf-8 -*-
# (c) 2016 Ainara Galdona - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Web Widget Float Time Second",
"version": "8.0.0.1.0",
"depends": ["web",
"base_setup"],
"author": "OdooMRP team, "
"AvanzOSC, "
... |
jsirois/pants | refs/heads/master | src/python/pants/backend/python/lint/docformatter/rules_integration_test.py | 1 | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import dataclasses
from typing import List, Optional, Sequence, Tuple
import pytest
from pants.backend.python.lint.docformatter.rules import DocformatterFieldSet, DocformatterRequest
fro... |
apporc/nova | refs/heads/master | nova/conf/scheduler.py | 2 | # Copyright 2015 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/licenses/LICENSE-2.0
#
# Unless requ... |
R-daneel-olivaw/mutation-tolerance-voting | refs/heads/master | pyvotecore/plurality_at_large.py | 1 | # Copyright (C) 2009, Brad Beattie
#
# 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 later version.
#
# This program is distributed in ... |
adviti/melange | refs/heads/master | app/gdata/Crypto/PublicKey/DSA.py | 228 |
#
# DSA.py : Digital Signature Algorithm
#
# Part of the Python Cryptography Toolkit
#
# Distribute and use freely; there are no restrictions on further
# dissemination and usage except those imposed by the laws of your
# country of residence. This software is provided "as is" without
# warranty of fitness for use... |
tima/ansible-modules-core | refs/heads/devel | network/netvisor/pn_show.py | 30 | #!/usr/bin/python
""" PN CLI show commands """
#
# 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 ver... |
double-y/django | refs/heads/master | django/contrib/postgres/aggregates/__init__.py | 625 | from .general import * # NOQA
from .statistics import * # NOQA
|
csridhar/58A78C12-3B74-48F6-B265-887C33ED5F98-odat-5DD613ED-1FE0-4D6A-8A20-4C26C3F2C95B | refs/heads/master | src/server.py | 1 | from flask import abort, Flask, render_template, request, Response
from github_issue_interface import GitHubIssueInterface
import json
class Serve(Flask):
"""
Serve is our AppServer that proxies between GitHub and our client.
It's dumb and only creates a new GitHub Issue.
It tracks all created issues o... |
OnShift/page_object | refs/heads/master | src/page_object/elements/paragraph.py | 1 | from .element import Element
class Paragraph(Element):
"""
Element class to represent HTML Paragraph
"""
|
hsuantien/scikit-learn | refs/heads/master | sklearn/utils/tests/test_stats.py | 304 | import numpy as np
from numpy.testing import TestCase
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.stats import rankdata
_cases = (
# values, method, expected
([100], 'max', [1.0]),
([100, 100, 100], 'max', [3.0, 3.0, 3.0]),
([100, 300, 200], 'max', [1.0, 3.0, 2.0]),
([... |
joxeankoret/diaphora | refs/heads/master | pygments/formatters/other.py | 50 | # -*- coding: utf-8 -*-
"""
pygments.formatters.other
~~~~~~~~~~~~~~~~~~~~~~~~~
Other formatters: NullFormatter, RawTokenFormatter.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments... |
rackerlabs/horizon | refs/heads/master | openstack_dashboard/test/tests/quotas.py | 3 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
# Copyright (c) 2012 X.commerce, a business unit of eBay Inc.
#
# Licensed under th... |
aaxelb/SHARE | refs/heads/develop | tests/share/tasks/test_job_consumers.py | 2 | from unittest import mock
import uuid
import pytest
from share.tasks import harvest
from share.tasks import ingest
from share.tasks.jobs import HarvestJobConsumer
from share.tasks.jobs import IngestJobConsumer
from tests import factories
@pytest.mark.parametrize('task, Consumer', [
(harvest, HarvestJobConsumer)... |
wskplho/sl4a | refs/heads/master | python/xmpppy/xmpp/auth.py | 196 | ## auth.py
##
## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov
##
## 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, or (at your option)
## any later version.
##... |
Suwmlee/XX-Net | refs/heads/python3 | Python3/lib/email/header.py | 12 | # Copyright (C) 2002-2007 Python Software Foundation
# Author: Ben Gertzfield, Barry Warsaw
# Contact: email-sig@python.org
"""Header encoding and decoding functionality."""
__all__ = [
'Header',
'decode_header',
'make_header',
]
import re
import binascii
import email.quoprimime
import email.base64m... |
Architizer/django-haystack | refs/heads/master | tests/solr_tests/tests/inputs.py | 10 | from django.test import TestCase
from haystack import connections
from haystack import inputs
class SolrInputTestCase(TestCase):
def setUp(self):
super(SolrInputTestCase, self).setUp()
self.query_obj = connections['default'].get_query()
def test_raw_init(self):
raw = inputs.Raw('hello... |
vipul-sharma20/oh-mainline | refs/heads/master | vendor/packages/python-social-auth/social/backends/fitbit.py | 32 | """
Fitbit OAuth1 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/fitbit.html
"""
from social.backends.oauth import BaseOAuth1
class FitbitOAuth(BaseOAuth1):
"""Fitbit OAuth authentication backend"""
name = 'fitbit'
AUTHORIZATION_URL = 'https://api.fitbit.com/oauth/authorize'
REQUEST_... |
f4rnham/server | refs/heads/10.1 | storage/tokudb/mysql-test/tokudb/locks-blocking-row-locks-testgen.py | 47 | # 9/23/2011 Generate blocking row lock tests
import datetime
# generate sql write queries
def mysqlgen_select_for_update(k, kv, c, cv):
print "select * from t where %s=%s for update;" % (k, kv)
def mysqlgen_select_for_update_range(k, c, where):
print "select * from t where %s%s for update;" % (k, where)
def my... |
tkaitchuck/nupic | refs/heads/master | external/darwin64/lib/python2.6/site-packages/Crypto/PublicKey/ElGamal.py | 13 | #
# ElGamal.py : ElGamal encryption/decryption and signatures
#
# Part of the Python Cryptography Toolkit
#
# Originally written by: A.M. Kuchling
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication ... |
unaizalakain/django | refs/heads/master | django/core/mail/backends/base.py | 577 | """Base email backend class."""
class BaseEmailBackend(object):
"""
Base class for email backend implementations.
Subclasses must at least overwrite send_messages().
open() and close() can be called indirectly by using a backend object as a
context manager:
with backend as connection:
... |
oscartorresco/financial | refs/heads/master | financiero/sells/views.py | 1 | # from ajax_view import ajax_view
from django.shortcuts import render_to_response
from django.template import RequestContext
def nueva_venta(request):
return render_to_response ('template_base.html', request.session, context_instance=RequestContext(request))
|
bealdav/OpenUpgrade | refs/heads/8.0 | addons/resource/tests/test_resource.py | 243 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... |
Comunitea/CMNT_004_15 | refs/heads/11.0 | project-addons/crm_claim_rma/tests/test_lp_1282584.py | 1 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Vaucher
# Copyright 2014 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
# pub... |
kbukin1/pnotify-linux-4.1.6 | refs/heads/master | tools/perf/util/setup.py | 766 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... |
SexualHealthInnovations/django-wizard-builder | refs/heads/master | wizard_builder/tests/urls.py | 2 | from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
from .. import views
urlpatterns = [
url(r'^$',
views.NewWizardView.as_view(),
),
url(r'^new/$',
views.NewWizardView.as_view(),
name='wizard_new',
... |
hpcuantwerpen/easybuild-framework | refs/heads/develop | easybuild/toolchains/iiqmpi.py | 2 | ##
# Copyright 2012-2021 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... |
ntiufalara/openerp7 | refs/heads/master | openerp/addons/membership/__init__.py | 441 | # -*- 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... |
Pythonify/awesome | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py | 346 | from io import BytesIO
class CallbackFileWrapper(object):
"""
Small wrapper around a fp object which will tee everything read into a
buffer, and when that file is closed it will execute a callback with the
contents of that buffer.
All attributes are proxied to the underlying file object.
Thi... |
jimcunderwood/MissionPlanner | refs/heads/master | Lib/email/encoders.py | 61 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Encodings and related functions."""
__all__ = [
'encode_7or8bit',
'encode_base64',
'encode_noop',
'encode_quopri',
]
import base64
from quopri import encodestring as _enc... |
snowcloud/raretunes | refs/heads/master | raretunes/apps/recordings/urlshortener.py | 1 | # Generate a [0-9a-zA-Z] string
ALPHABET = map(str,range(0, 10)) + map(chr, range(97, 123) + range(65, 91))
def encode_id(id_number, alphabet=ALPHABET):
"""Convert an integer to a string."""
if id_number == 0:
return alphabet[0]
alphabet_len = len(alphabet) # Cache
result = ''
while id_nu... |
samliu/servo | refs/heads/master | tests/wpt/harness/wptrunner/wptmanifest/tests/test_static.py | 57 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import unittest
from cStringIO import StringIO
from ..backends import static
# There aren't many tests here because i... |
microcom/odoo | refs/heads/9.0 | openerp/addons/base/tests/test_res_partner_bank.py | 42 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
from openerp.tests.common import TransactionCase
class TestResPartnerBank(TransactionCase):
"""Tests acc_number
"""
def test_sanitized_acc_number(self... |
heke123/chromium-crosswalk | refs/heads/master | build/linux/install-chromeos-fonts.py | 18 | #!/usr/bin/env python
# Copyright 2013 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.
# Script to install the Chrome OS fonts on Linux.
# This script can be run manually (as root), but is also run as part
# install-build-... |
alimony/django | refs/heads/master | tests/model_forms/test_uuid.py | 90 | from django import forms
from django.core.exceptions import ValidationError
from django.test import TestCase
from .models import UUIDPK
class UUIDPKForm(forms.ModelForm):
class Meta:
model = UUIDPK
fields = '__all__'
class ModelFormBaseTest(TestCase):
def test_create_save_error(self):
... |
zerolab/wagtail | refs/heads/main | wagtail/core/migrations/0033_remove_golive_expiry_help_text.py | 24 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-31 14:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0032_add_bulk_delete_page_permission'),
]
operations = [
migrations.AlterField(
model_nam... |
yoer/hue | refs/heads/master | desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf/draw.py | 93 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# 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 you... |
bluerover/6lbr | refs/heads/develop | examples/6lbr/test/coojagen/src/generators.py | 2 | import math
import random
def gengrid(step, xcount, ycount):
step = int(step)
xcount = int(xcount)
ycount = int(ycount)
points = []
for xcoord in range(xcount):
for ycoord in range(ycount):
point = (xcoord*step,ycoord*step, 0)
points.append(point)
return(points)
def gengrid_ratio(step, ratio, count):
s... |
Learningtribes/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/tests/test_fields.py | 78 | """Tests for classes defined in fields.py."""
import datetime
import unittest
from django.utils.timezone import UTC
from xmodule.fields import Date, Timedelta, RelativeTime
from xmodule.timeinfo import TimeInfo
class DateTest(unittest.TestCase):
date = Date()
def compare_dates(self, dt1, dt2, expected_del... |
fdupoux/ansible-modules-extras | refs/heads/fdevel | cloud/amazon/ec2_eni_facts.py | 5 | #!/usr/bin/python
#
# This is a 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 Ansible library is distributed in the hope that i... |
lecaoquochung/ddnb.django | refs/heads/master | django/contrib/sitemaps/tests/test_https.py | 13 | from __future__ import unicode_literals
from datetime import date
import warnings
from django.test import override_settings
from django.utils.deprecation import RemovedInDjango20Warning
from .base import SitemapTestsBase
@override_settings(ROOT_URLCONF='django.contrib.sitemaps.tests.urls.https')
class HTTPSSitemap... |
isandlaTech/cohorte-devtools | refs/heads/master | qualifier/deploy/cohorte-home/repo/cohorte/repositories/java/manifest.py | 2 | #!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Utility module to handle Java Manifest.mf files
:author: Thomas Calmant
:license: Apache Software License 2.0
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance... |
Kamekameha/crunchy-xml-decoder | refs/heads/master | crunchy-xml-decoder.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import argparse
import os
import subprocess
from getpass import getpass
sys.path.append('crunchy-xml-decoder')
import functtest
import ultimate
import login
import decode
import altfuncs
import re, urllib2
from collections import deque
import time
#-#-#-#-#-#-#-#-#... |
mattrobenolt/pip | refs/heads/develop | tests/data/src/simplewheel-1.0/simple/__init__.py | 9480 | #
|
VigTech/Vigtech-Services | refs/heads/master | env/lib/python2.7/site-packages/setuptools/command/install_scripts.py | 505 | from distutils import log
import distutils.command.install_scripts as orig
import os
from pkg_resources import Distribution, PathMetadata, ensure_directory
class install_scripts(orig.install_scripts):
"""Do normal script install, plus any egg_info wrapper scripts"""
def initialize_options(self):
ori... |
akhmadMizkat/odoo | refs/heads/master | addons/note/note.py | 41 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import _, SUPERUSER_ID
from openerp.osv import osv, fields
from openerp.tools import html2plaintext
class note_stage(osv.osv):
""" Category of Note """
_name = "note.stage"
_description = "Note ... |
nbcesar/sabergrade | refs/heads/master | lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/eucjpprober.py | 2918 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
superchilli/webapp | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/requests/utils.py | 319 | # -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import cgi
import codecs
import collections
import io
import os
import re
import socket
import struct
import warnings
from . import __vers... |
Xeleste/namebench | refs/heads/master | nb_third_party/jinja2/lexer.py | 211 | # -*- coding: utf-8 -*-
"""
jinja2.lexer
~~~~~~~~~~~~
This module implements a Jinja / Python combination lexer. The
`Lexer` class provided by this module is used to do some preprocessing
for Jinja.
On the one hand it filters out invalid operators like the bitshift
operators we don't allow... |
jarv/cmdchallenge-site | refs/heads/master | lambda_src/runcmd/docker/utils/decorators.py | 6 | import functools
from .. import errors
from . import utils
def check_resource(f):
@functools.wraps(f)
def wrapped(self, resource_id=None, *args, **kwargs):
if resource_id is None:
if kwargs.get('container'):
resource_id = kwargs.pop('container')
elif kwargs.get... |
rosmo/ansible | refs/heads/devel | lib/ansible/modules/cloud/cloudstack/cs_instance_nic_secondaryip.py | 26 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}... |
flar2/ElementalX-evita-8.0 | refs/heads/master | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... |
eestay/edx-platform | refs/heads/master | openedx/core/djangoapps/course_groups/cohorts.py | 14 | """
This file contains the logic for cohorts, as exposed internally to the
forums, and to the cohort admin views.
"""
import logging
import random
from django.db import transaction
from django.db.models.signals import post_save, m2m_changed
from django.dispatch import receiver
from django.http import Http404
from dja... |
stackforge/tacker | refs/heads/master | tacker/api/validation/__init__.py | 2 | # Copyright (C) 2019 NTT DATA
# 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 ... |
yephper/django | refs/heads/master | tests/postgres_tests/array_index_migrations/__init__.py | 12133432 | |
dittos/graphqllib | refs/heads/master | tests_py35/__init__.py | 12133432 | |
bingopodcast/bingos | refs/heads/master | bingo_emulator/bahama_beach/__init__.py | 12133432 | |
omaraboumrad/djanground | refs/heads/master | backend/dryorm/routing.py | 1 | from channels.routing import route
from dryorm.consumers import ws_message
channel_routing = [
route('websocket.receive', ws_message),
]
|
langyapojun/shadowsocks | refs/heads/master | tests/test_udp_src.py | 1009 | #!/usr/bin/python
import socket
import socks
SERVER_IP = '127.0.0.1'
SERVER_PORT = 1081
if __name__ == '__main__':
# Test 1: same source port IPv4
sock_out = socks.socksocket(socket.AF_INET, socket.SOCK_DGRAM,
socket.SOL_UDP)
sock_out.set_proxy(socks.SOCKS5, SERVER_IP, S... |
jiangzhuo/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/ctypes/test/test_slicing.py | 85 | import unittest
from ctypes import *
from ctypes.test import need_symbol
import _ctypes_test
class SlicesTestCase(unittest.TestCase):
def test_getslice_cint(self):
a = (c_int * 100)(*range(1100, 1200))
b = list(range(1100, 1200))
self.assertEqual(a[0:2], b[0:2])
self.assertEqual(a[... |
ksanchezcld/volatility | refs/heads/master | volatility/plugins/overlays/native_types.py | 58 | import copy
## The following is a conversion of basic C99 types to python struct
## format strings. NOTE: since volatility is analysing images which
## are not necessarily the same bit size as the currently running
## platform you may not use platform specific format specifiers here
## like l or L - you must use i or ... |
polyval/CNC | refs/heads/master | flask/Lib/site-packages/flask_wtf/form.py | 89 | # coding: utf-8
import werkzeug.datastructures
from jinja2 import Markup, escape
from flask import request, session, current_app
from wtforms.fields import HiddenField
from wtforms.widgets import HiddenInput
from wtforms.validators import ValidationError
from wtforms.ext.csrf.form import SecureForm
from ._compat impo... |
dreki/GitSavvy | refs/heads/master | core/interfaces/rebase.py | 4 | import os
import sublime
from sublime_plugin import WindowCommand, TextCommand
from ...common import ui
from ..git_command import GitCommand
from ...common import util
class GsShowRebaseCommand(WindowCommand, GitCommand):
"""
Open a status view for the active git repository.
"""
def run(self):
... |
bohlian/frappe | refs/heads/develop | frappe/core/report/document_share_report/__init__.py | 12133432 | |
leki75/ansible | refs/heads/devel | lib/ansible/modules/remote_management/ipmi/__init__.py | 12133432 | |
waheedahmed/edx-platform | refs/heads/master | common/djangoapps/monitoring/__init__.py | 12133432 | |
subutai/NAB | refs/heads/master | nab/detectors/htmjava/__init__.py | 12133432 | |
minyoungg/selfconsistency | refs/heads/master | models/exif/exif_solver.py | 1 | import os, sys, numpy as np, time
import init_paths
import tensorflow as tf
import tensorflow.contrib.slim as slim
from utils import ops, io
import traceback
from collections import deque
class ExifSolver(object):
def __init__(self, checkpoint=None, use_exif_summary=True, exp_name='no_name', init_summary=True):
... |
kutenai/django | refs/heads/master | tests/sitemaps_tests/urls/__init__.py | 12133432 | |
phoebusliang/parallel-lettuce | refs/heads/master | tests/integration/lib/Django-1.3/tests/modeltests/many_to_one_null/__init__.py | 12133432 | |
kswiat/django | refs/heads/master | django/conf/locale/kn/__init__.py | 12133432 | |
anandpdoshi/frappe | refs/heads/develop | frappe/website/doctype/blog_settings/__init__.py | 12133432 | |
MediaSapiens/autonormix | refs/heads/master | django/views/decorators/__init__.py | 12133432 | |
joeyjojo/django_offline | refs/heads/master | src/django/conf/locale/km/__init__.py | 12133432 | |
roninio/gae-boilerplate | refs/heads/Fix-Issue-253 | boilerplate/external/wtforms/ext/django/i18n.py | 119 | from django.utils.translation import ugettext, ungettext
from wtforms import form
class DjangoTranslations(object):
"""
A translations object for WTForms that gets its messages from django's
translations providers.
"""
def gettext(self, string):
return ugettext(string)
def ngettext(sel... |
40223139/203739test | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/colorsys.py | 1066 | """Conversion functions between RGB and other color systems.
This modules provides two functions for each color system ABC:
rgb_to_abc(r, g, b) --> a, b, c
abc_to_rgb(a, b, c) --> r, g, b
All inputs and outputs are triples of floats in the range [0.0...1.0]
(with the exception of I and Q, which covers a slightly... |
tersmitten/ansible | refs/heads/devel | test/units/modules/network/f5/test_bigip_software_install.py | 16 | # -*- 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
if sys.version_info < (2... |
azatoth/scons | refs/heads/master | test/CXX/SHCXXFLAGS.py | 5 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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,
... |
UpOut/objectify | refs/heads/master | objectify/model/base.py | 1 | # coding: utf-8
#In order of performance
try:
import ujson as json
except ImportError:
try:
import simplejson as json
except ImportError:
import json
from ..base import ObjectifyObject
class ObjectifyModel(ObjectifyObject):
__fetch_attr__ = None
__serializer__ = json.dumps
... |
ROB-Seismology/oq-hazardlib | refs/heads/rob-hazardlib | openquake/hazardlib/site.py | 1 | # The Hazard Library
# Copyright (C) 2012 GEM Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Th... |
ekiwi/tinyos-1.x | refs/heads/master | contrib/handhelds/apps/EKG/ekg.py | 2 | #!/usr/bin/python
#
# Copyright (c) 2004,2005 Hewlett-Packard Company
# 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
# ... |
saurabh6790/tru_app_back | refs/heads/master | hr/doctype/salary_slip_deduction/salary_slip_deduction.py | 1946 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl |
rishig/zulip | refs/heads/master | zerver/lib/profile.py | 17 |
import cProfile
from functools import wraps
from typing import Any, TypeVar, Callable
ReturnT = TypeVar('ReturnT')
def profiled(func: Callable[..., ReturnT]) -> Callable[..., ReturnT]:
"""
This decorator should obviously be used only in a dev environment.
It works best when surrounding a function that y... |
franek/weboob | refs/heads/master | modules/dresdenwetter/backend.py | 1 | # -*- coding: utf-8 -*-
# Copyright(C) 2010-2013 Romain Bignon, Florent Fourcot
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the Licen... |
Dolphman/lazyns | refs/heads/master | tests/test_api.py | 386048 | |
modulexcite/PTVS | refs/heads/master | Python/Tests/TestData/Grammar/FromImportStmt.py | 18 | from sys import winver
from sys import winver as baz
from sys.fob import winver
from sys.fob import winver as baz
from ...fob import oar
from ....fob import oar
from ......fob import oar
from .......fob import oar
from fob import (fob as oar, baz as quox) |
NeovaHealth/odoo | refs/heads/8.0 | addons/edi/controllers/main.py | 374 | import werkzeug.urls
import openerp
import openerp.addons.web.controllers.main as webmain
class EDI(openerp.http.Controller):
@openerp.http.route('/edi/import_url', type='http', auth='none')
def import_url(self, url):
# http://hostname:8069/edi/import_url?url=URIEncodedURL
req = openerp.http.... |
bulldy80/gyp_unofficial | refs/heads/master | test/win/gyptest-link-tsaware.py | 269 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Make sure tsaware setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp(f... |
VaneCloud/horizon | refs/heads/stable/kilo | openstack_dashboard/dashboards/project/images/panel.py | 46 | # Copyright 2012 Nebula, Inc.
# 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
#
# Unle... |
mhils/countershape | refs/heads/master | countershape/analysis.py | 2 | import sys
import os
from . import blog
def nicepath(b):
cwdl = len(os.getcwd())
return "." + b.src[cwdl:]
def blog_tags(d, fp=sys.stdout):
b = blog.find_blog(d)
histogram = dict()
for i in b.blogdir.sortedPosts():
for t in i.tags:
histogram[t] = histogram.get(t, 0) + 1
v... |
knehez/edx-platform | refs/heads/memooc | common/djangoapps/third_party_auth/tests/specs/test_testshib.py | 48 | """
Third_party_auth integration tests using a mock version of the TestShib provider
"""
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
import httpretty
from mock import patch
from student.tests.factories import UserFactory
from third_party_auth.tasks import fetch_saml_metadata... |
guoyu07/metagoofil | refs/heads/master | hachoir_parser/video/flv.py | 95 | """
FLV video parser.
Documentation:
- FLV File format: http://osflash.org/flv
- libavformat from ffmpeg project
- flashticle: Python project to read Flash (SWF and FLV with AMF metadata)
http://undefined.org/python/#flashticle
Author: Victor Stinner
Creation date: 4 november 2006
"""
from hachoir_parser impo... |
team-mayes/md_utils | refs/heads/master | tests/test_wham_block.py | 2 | # coding=utf-8
"""
Tests for wham_block.
"""
import filecmp
import inspect
import logging
import unittest
import tempfile
import shutil
import os
import md_utils
from md_utils.wham import DEF_BASE_SUBMIT_TPL
from md_utils.wham import DEF_LINE_SUBMIT_TPL
from md_utils.wham_block import (pair_avg, rmsd_avg, block_averag... |
vlinhd11/vlinhd11-android-scripting | refs/heads/master | python-build/python-libs/ase/scripts/say_chat.py | 40 | """Say chat messages aloud as they are received."""
__author__ = 'Damon Kohler <damonkohler@gmail.com>'
__copyright__ = 'Copyright (c) 2009, Google Inc.'
__license__ = 'Apache License, Version 2.0'
import android
import xmpp
_SERVER = 'talk.google.com', 5223
def log(droid, message):
print message
self.droid.tts... |
Gentux/imap-cli | refs/heads/master | imap_cli/const.py | 1 | # -*- coding: utf-8 -*-
"""Constant used by Imap_CLI packages """
# IMAP CLI version number
VERSION = 0.7
# IMAP Constant
#
# All those value are documented in RFC 3501
# http://tools.ietf.org/html/rfc3501#section-2.3.2
DEFAULT_DIRECTORY = 'INBOX'
DEFAULT_PORT = 143
DEFAULT_SSL_PORT = 993
STATUS_OK = 'OK'
IMAP_SPE... |
Jorge-Rodriguez/ansible | refs/heads/devel | lib/ansible/modules/network/fortios/fortios_firewall_proxy_policy.py | 24 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... |
dednal/chromium.src | refs/heads/nw12 | chrome/common/extensions/docs/server2/github_file_system_test.py | 97 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import os
import sys
import unittest
from appengine_wrappers import files
from fake_fetchers import ConfigureFakeFetch... |
keedio/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/template_tests/views.py | 206 | # Fake views for testing url reverse lookup
from django.http import HttpResponse
from django.template.response import TemplateResponse
def index(request):
pass
def client(request, id):
pass
def client_action(request, id, action):
pass
def client2(request, tag):
pass
def template_response_view(requ... |
pwarren/AGDeviceControl | refs/heads/master | agdevicecontrol/thirdparty/site-packages/darwin/twisted/test/ssl_helpers.py | 81 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.internet import ssl
from twisted.python.util import sibpath
from OpenSSL import SSL
class ClientTLSContext(ssl.ClientContextFactory):
isClient = 1
def getContext(self):
return SSL.Context(SSL.TLSv1_METHOD... |
FrenchFriesKetchup/p2pool | refs/heads/master | nattraverso/pynupnp/upnpxml.py | 288 | """
This module parse an UPnP device's XML definition in an Object.
@author: Raphael Slinckx
@copyright: Copyright 2005
@license: LGPL
@contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>}
@version: 0.1.0
"""
__revision__ = "$id"
from xml.dom import minidom
import logging
# Allowed UPnP services to use when ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.