repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
sf-wind/caffe2 | refs/heads/master | caffe2/python/operator_test/specialized_segment_ops_test.py | 4 | # Copyright (c) 2016-present, Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... |
pymo/pymo | refs/heads/master | symbian/PythonForS60/module-repo/dev-modules/sensor/sensor_api.py | 4 | #
# sensor.py
#
# Copyright (c) 2007 Nokia 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... |
Jgarcia-IAS/SAT | refs/heads/master | openerp/addons-extra/odoo-pruebas/odoo-server/addons-extra/account_transfer_advance/__openerp__.py | 7 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 Cubic ERP - Teradata SAC (<http://cubicerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the... |
edadesd/JARVIS-on-Messenger | refs/heads/master | modules/src/dice.py | 4 | import random
import modules
from templates.attachment import AttachmentTemplate
from templates.quick_replies import add_quick_reply
dice_sides = {
1: 'http://fa2png.io/media/icons/foundation-icon-fonts/2015-02-16/die-one/256/0/e74c3c_none.png',
2: 'http://fa2png.io/media/icons/foundation-icon-fonts/2015-02-1... |
todaychi/hue | refs/heads/master | desktop/core/src/desktop/lib/tasks/extract_archive/extract_utils.py | 1 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
siosio/intellij-community | refs/heads/master | python/testData/inspections/PyDataclassInspection/fieldsOrderInInheritanceKwOnlyNoDefaultDerived.py | 2 | import attr
# no kw_only, no default
@attr.dataclass
class Base1:
a: int
@attr.dataclass(kw_only=True)
class Derived1(Base1):
b: str
# kw_only, no default
@attr.dataclass(kw_only=True)
class Base2:
a: int
@attr.dataclass(kw_only=True)
class Derived2(Base2):
b: str
# no kw_only, default
@attr.data... |
ytjiang/thefuck | refs/heads/master | tests/rules/test_git_checkout.py | 5 | import pytest
from thefuck.rules.git_checkout import match, get_new_command
from tests.utils import Command
@pytest.fixture
def did_not_match(target, did_you_forget=False):
error = ("error: pathspec '{}' did not match any "
"file(s) known to git.".format(target))
if did_you_forget:
error ... |
GregoryVigoTorres/scrapy | refs/heads/master | tests/test_downloadermiddleware.py | 35 | from twisted.trial.unittest import TestCase
from twisted.python.failure import Failure
from scrapy.http import Request, Response
from scrapy.spiders import Spider
from scrapy.core.downloader.middleware import DownloaderMiddlewareManager
from scrapy.utils.test import get_crawler
from scrapy.utils.python import to_bytes... |
hmen89/odoo | refs/heads/master | addons/sale/sales_team.py | 61 | # -*- coding: utf-8 -*-
import calendar
from datetime import date
from dateutil import relativedelta
import json
from openerp import tools
from openerp.osv import fields, osv
class crm_case_section(osv.osv):
_inherit = 'crm.case.section'
def _get_sale_orders_data(self, cr, uid, ids, field_name, arg, contex... |
crotsos/ns-3 | refs/heads/master | src/buildings/test/examples-to-run.py | 177 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
# buildable and runnable over time. Each tuple in the list contains
#
# (example_name, do_run, do_valgrind_run).
#
... |
nopjmp/SickRage | refs/heads/master | lib/requests/packages/chardet/charsetgroupprober.py | 270 | ######################## 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 Rights R... |
hsuchie4/TACTIC | refs/heads/master | src/client/tactic_client_lib/test/handler.py | 7 | ###########################################################
#
# Copyright (c) 2005-2008, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written ... |
zstars/weblabdeusto | refs/heads/master | server/src/test/unit/weblab/experiment/devices/test_http.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
# list... |
ford-prefect/openwebrtc | refs/heads/master | bindings/java/type_registry.py | 32 | # Copyright (c) 2014-2015, Ericsson AB. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and th... |
you21979/phantomjs | refs/heads/2.0 | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py | 117 | # Copyright (C) 2010 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 ... |
0x7678/youtube-dl | refs/heads/master | youtube_dl/extractor/gametrailers.py | 151 | from __future__ import unicode_literals
from .mtv import MTVServicesInfoExtractor
class GametrailersIE(MTVServicesInfoExtractor):
_VALID_URL = r'http://www\.gametrailers\.com/(?P<type>videos|reviews|full-episodes)/(?P<id>.*?)/(?P<title>.*)'
_TEST = {
'url': 'http://www.gametrailers.com/videos/zbvr8i/... |
matchimmo/django-postman | refs/heads/master | postman/future_1_4.py | 18 | """
A forwards compatibility module.
Implements some features of Django 1.4 when the application is run with a lower version of Django:
- text truncating
"""
from __future__ import unicode_literals
from django.utils.functional import allow_lazy
from django.utils.text import truncate_words
class Truncator(object):
... |
yongshengwang/hue | refs/heads/master | desktop/core/ext-py/pycrypto-2.6.1/build/lib.linux-x86_64-2.7/Crypto/Util/py21compat.py | 125 | # -*- coding: utf-8 -*-
#
# Util/py21compat.py : Compatibility code for Python 2.1
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to ... |
zas/picard | refs/heads/master | picard/util/bitreader.py | 3 | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2014, 2020 Christoph Reiter
# Copyright (C) 2019, 2021 Philipp Wolfer
#
# 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 So... |
sekikn/ambari | refs/heads/trunk | ambari-agent/src/test/python/resource_management/TestDatanodeHelper.py | 5 | '''
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 use this ... |
DrOctogon/unwash_ecom | refs/heads/master | oscar/apps/address/migrations/0009_no_null_in_charfields.py | 8 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from oscar.core.compat import AUTH_USER_MODEL, AUTH_USER_MODEL_NAME
class Migration(DataMigration):
def forwards(self, orm):
orm.UserAddress.objects.filter(first_name__isnull=Tr... |
nwiizo/workspace_2017 | refs/heads/master | ansible-modules-core/cloud/azure/azure_rm_virtualmachineimage_facts.py | 50 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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 Soft... |
laborautonomo/youtube-dl | refs/heads/master | youtube_dl/extractor/ro220.py | 3 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
clean_html,
compat_parse_qs,
)
class Ro220IE(InfoExtractor):
IE_NAME = '220.ro'
_VALID_URL = r'(?x)(?:https?://)?(?:www\.)?220\.ro/(?P<category>[^/]+)/(?P<shorttitle>[^/]+)/(?P<video_id>[^/]+)'
... |
sidzan/netforce | refs/heads/master | netforce_mfg/netforce_mfg/models/production_order.py | 2 | # Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# 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, publ... |
dimagol/trex-core | refs/heads/master | scripts/automation/trex_control_plane/examples/zmq_server_client.py | 1 | import sys
import os
cpu_arch = 'arm' if os.uname()[4] == 'aarch64' else 'intel'
python_ver = 'python%s' % sys.version_info.major
ucs_ver = 'ucs2' if sys.maxunicode == 65535 else 'ucs4'
zmq_path = os.path.abspath(os.path.join(os.pardir,os.pardir,os.pardir,
'external_libs','pyzmq-14.5.0', python_ver, c... |
caotianwei/django | refs/heads/master | django/contrib/flatpages/__init__.py | 808 | default_app_config = 'django.contrib.flatpages.apps.FlatPagesConfig'
|
johnkit/vtk-dev | refs/heads/master | ThirdParty/Twisted/twisted/pair/test/test_ethernet.py | 22 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.trial import unittest
from twisted.python import components
from twisted.pair import ethernet, raw
from zope.interface import implements
class MyProtocol:
implements(raw.IRawPacketProtocol)
def __init__(self, expecting):
... |
diagramsoftware/odoo | refs/heads/8.0 | addons/crm_partner_assign/tests/test_partner_assign.py | 17 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from mock import patch
from openerp.tests.common import TransactionCase
class TestPartnerAssign(TransactionCase):
def setUp(self):
super(TestPartnerAssign, self).setUp()
def geo_find(addr):
... |
lopiola/integracja_wypadki | refs/heads/master | scripts/statistics/pedestrians_by_hour.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from scripts.db_api import accident
def usa_query(hour):
return '''
SELECT count(*), (select count(*) from accident
join person on(acc_id = accident.id)
where country = 'USA'
and person.type = 'PEDESTRIAN'
and date_part('hour', timestamp) = {0}) as pedest... |
pombredanne/product-definition-center | refs/heads/master | pdc/apps/auth/serializers.py | 1 | #
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
from django.contrib.auth import models
from rest_framework import serializers
from pdc.apps.common.serializers import StrictSerializerMixin
from pdc.apps.auth.models import ResourcePermission, GroupResourcePer... |
splunk/splunk-app-twitter | refs/heads/master | twitter2/bin/twython/endpoints.py | 2 | # -*- coding: utf-8 -*-
"""
twython.endpoints
~~~~~~~~~~~~~~~~~
This module provides a mixin for a :class:`Twython <Twython>` instance.
Parameters that need to be embedded in the API url just need to be passed as a keyword argument.
e.g. Twython.retweet(id=12345)
This map is organized the order functions are docume... |
SujaySKumar/django | refs/heads/master | tests/template_tests/syntax_tests/test_simple_tag.py | 475 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class SimpleTagTests(SimpleTestCase):
libraries = {'custom': 'template_tests.templatetags.custom'}
@setup({'simpletag-renamed01': '{% load custom %}{% minusone 7 %}'})
def test_simpletag_rena... |
brunosantos/Bsan-kodi-repo | refs/heads/master | plugin.video.kodi/dns/rdataset.py | 91 | # Copyright (C) 2001-2007, 2009-2011 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 "... |
DogTagRecon/Still-Leraning | refs/heads/master | qa/rpc-tests/test_framework.py | 15 | #!/usr/bin/env python
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Base class for RPC testing
# Add python-bitcoinrpc to module search path:
import os
import sys
sys.path.... |
dperpeet/cockpit | refs/heads/master | bots/github/__init__.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of Cockpit.
#
# Copyright (C) 2015 Red Hat, Inc.
#
# Cockpit 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 ... |
catroot/rethinkdb | refs/heads/next | test/common/http_support/jinja2/testsuite/__init__.py | 404 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite
~~~~~~~~~~~~~~~~
All the unittests of Jinja2. These tests can be executed by
either running run-tests.py using multiple Python versions at
the same time.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
i... |
lmazuel/azure-sdk-for-python | refs/heads/master | azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_peering_config.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 ... |
don-github/edx-platform | refs/heads/master | lms/djangoapps/mobile_api/social_facebook/preferences/urls.py | 128 | """
URLs for users sharing preferences
"""
from django.conf.urls import patterns, url
from .views import UserSharing
urlpatterns = patterns(
'mobile_api.social_facebook.preferences.views',
url(
r'^preferences/$',
UserSharing.as_view(),
name='preferences'
),
)
|
GregMilway/Exercism | refs/heads/master | python/house/house.py | 1 |
def verse(n):
"""Returns nth verse of the nursery rhyme
The house that Jack Built
"""
verse_string = ['This is ' + verse_line[n][1]]
for i in range(n-1,-1,-1):
verse_string.append(''.join(verse_line[i]))
return '\n'.join(verse_string)
def rhyme():
"""Returns the full nursery rhyme""... |
abstract-open-solutions/OCB | refs/heads/8.0 | addons/website_partner/models/res_partner.py | 244 | # -*- coding: utf-8 -*-
from openerp.osv import osv, fields
class WebsiteResPartner(osv.Model):
_name = 'res.partner'
_inherit = ['res.partner', 'website.seo.metadata']
def _get_ids(self, cr, uid, ids, flds, args, context=None):
return {i: i for i in ids}
_columns = {
'website_publi... |
damdam-s/sale-workflow | refs/heads/8.0 | partner_prepayment/model/res_partner.py | 35 | # -*- coding: utf-8 -*-
#
#
# Author: Guewen Baconnier
# 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
# published by the Free Software Foundation, either version 3 of the
# License... |
thesharp/botogram | refs/heads/master | botogram/objects/__init__.py | 1 | """
botogram.objects
Representation of the different upstream API objects
Copyright (c) 2015 Pietro Albini <pietro@pietroalbini.io>
Released under the MIT license
"""
# flake8: noqa
from .chats import User, Chat, UserProfilePhotos
from .media import PhotoSize, Photo, Audio, Voice, Document, S... |
bazzile/imScrape | refs/heads/master | Scripts/ex/auxiliary.py | 1 | import os
import zipfile
import tempfile
import ogr
def pleiades_geometry(target_xml):
with zipfile.ZipFile(target_xml.replace('DIM', 'PREVIEW').replace('.XML', '.KMZ')) as zfile:
for item in zfile.namelist():
if item.endswith(('.KML', '.kml')):
kml_data = zfile.read(item)
... |
Fat-Zer/tdeutils | refs/heads/master | superkaramba/examples/richtext/richtext.py | 3 | #Unicode Example
#For Symbol Tables look at www.unicode.org/charts/
hidden = 0
penguin = 0
penguin_hidden = 1
#this import statement allows access to the karamba functions
import karamba
#this is called when you widget is initialized
def initWidget(widget):
global richtext
global penguin
karamba.resiz... |
joel-a-eriksson/MAS | refs/heads/master | cherrypy/lib/static.py | 19 | import os
import re
import stat
import mimetypes
try:
from io import UnsupportedOperation
except ImportError:
UnsupportedOperation = object()
import cherrypy
from cherrypy._cpcompat import ntob, unquote
from cherrypy.lib import cptools, httputil, file_generator_limited
mimetypes.init()
mimetypes.types_map['... |
agat63/L720_MJA_4.3 | refs/heads/master | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
NixaSoftware/CVis | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/compat.py | 479 | try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
try:
import cPickle as pickle
except ImportError:
import pickle
from pip._vendor.requests.packages.urllib3.response import HTTPResponse
from pip._vendor.requests.packages.urllib3.util import is_fp_closed
# Replic... |
googleads/googleads-python-lib | refs/heads/master | examples/adwords/adwords_appengine_demo/appengine_config.py | 2 | #!/usr/bin/env python
#
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
brian-l/django-1.4.10 | refs/heads/master | tests/regressiontests/comment_tests/tests/comment_utils_moderators_tests.py | 92 | from __future__ import absolute_import
from django.contrib.comments.models import Comment
from django.contrib.comments.moderation import (moderator, CommentModerator,
AlreadyModerated)
from django.core import mail
from . import CommentTestCase
from ..models import Entry
class EntryModerator1(CommentModerator):
... |
Mega-DatA-Lab/mxnet | refs/heads/master | python/mxnet/gluon/model_zoo/vision/inception.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 u... |
gao-wei/qualitybots | refs/heads/master | src/appengine/handlers/handle_signup.py | 26 | #!/usr/bin/python2.4
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... |
jdsika/TUM_HOly | refs/heads/master | openrave/docs/breathe/renderer/rst/doxygen/__init__.py | 4 |
from breathe.renderer.rst.doxygen.base import Renderer
from breathe.renderer.rst.doxygen import index as indexrenderer
from breathe.renderer.rst.doxygen import compound as compoundrenderer
from breathe.parser.doxygen import index, compound, compoundsuper
class UnicodeRenderer(Renderer):
def render(self):
... |
ntuecon/server | refs/heads/master | pyenv/Lib/site-packages/twisted/internet/iocpreactor/const.py | 84 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Windows constants for IOCP
"""
# this stuff should really be gotten from Windows headers via pyrex, but it
# probably is not going to change
ERROR_PORT_UNREACHABLE = 1234
ERROR_NETWORK_UNREACHABLE = 1231
ERROR_CONNECTION_REFUSED = 1225
ERR... |
petecummings/django | refs/heads/master | tests/template_tests/filter_tests/test_striptags.py | 324 | from django.template.defaultfilters import striptags
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class StriptagsTests(SimpleTestCase):
@setup({'striptags01': '{{ a|striptags }} {{ b|striptags }}'})
def test_striptags01(self):
output ... |
nguyentruongtho/buck | refs/heads/master | test/com/facebook/buck/testutil/endtoend/testdata/mobile/ios/plist/py_cat.py | 20 | # Copyright 2018-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import argparse
def parse_file_name():
parser = argparse.ArgumentParser(description="Outputs given file.")
parser.add_argum... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/static/item/shared_wp_mle_axe_heavy_duty.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/item/shared_wp_mle_axe_heavy_duty.iff"
result.attribute_template_id = -... |
dsanders11/cartridge | refs/heads/master | runtests.py | 10 | from __future__ import unicode_literals
from mezzanine.bin.runtests import main as _main
main = lambda: _main("cartridge")
|
marty331/jakesclock | refs/heads/master | flask/lib/python2.7/site-packages/pip/_vendor/cachecontrol/compat.py | 317 | try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
try:
import cPickle as pickle
except ImportError:
import pickle
from pip._vendor.requests.packages.urllib3.response import HTTPResponse
from pip._vendor.requests.packages.urllib3.util import is_fp_closed
|
ychen820/microblog | refs/heads/master | y/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/wsgi_test_utils.py | 8 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
OpenPymeMx/bank-statement-reconcile | refs/heads/8.0 | __unported__/account_statement_base_import/parser/parser.py | 15 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Joel Grand-Guillaume
# Copyright 2011-2012 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 a... |
Kronuz/django-sentry | refs/heads/master | sentry/plugins/sentry_servers/__init__.py | 5 | """
sentry.plugins.sentry_servers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
|
PureNexusProject/android_kernel_google_molly | refs/heads/mm2 | tools/perf/scripts/python/netdev-times.py | 11271 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
mac389/computational-medical-knowledge | refs/heads/master | src/listFreqs.py | 2 | # -*- coding: utf-8 -*-
"Get frequencies and plot them"
from pdfParser import pdfparser
import nltk, matplotlib, numpy, pylab, string, codecs
from plotSave import plot_and_save
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
stop = stopwords.words('english')
READ = 'rb'
WRITE = 'wb'
lemma = n... |
egoid/baytree | refs/heads/master | lib/python2.7/site-packages/django/contrib/sessions/backends/file.py | 118 | import datetime
import errno
import logging
import os
import shutil
import tempfile
from django.conf import settings
from django.contrib.sessions.backends.base import (
VALID_KEY_CHARS, CreateError, SessionBase, UpdateError,
)
from django.contrib.sessions.exceptions import InvalidSessionKey
from django.core.except... |
roderickvd/nzbToMedia | refs/heads/master | libs/unidecode/x09b.py | 252 | data = (
'Ti ', # 0x00
'Li ', # 0x01
'Bin ', # 0x02
'Zong ', # 0x03
'Ti ', # 0x04
'Peng ', # 0x05
'Song ', # 0x06
'Zheng ', # 0x07
'Quan ', # 0x08
'Zong ', # 0x09
'Shun ', # 0x0a
'Jian ', # 0x0b
'Duo ', # 0x0c
'Hu ', # 0x0d
'La ', # 0x0e
'Jiu ', # 0x0f
'Qi ', # 0x10
'L... |
Sylrob434/CouchPotatoServer | refs/heads/develop | couchpotato/core/media/movie/providers/trailer/mechanize/_urllib2.py | 134 | # urllib2 work-alike interface
# ...from urllib2...
from urllib2 import \
URLError, \
HTTPError
# ...and from mechanize
from _auth import \
HTTPProxyPasswordMgr, \
HTTPSClientCertMgr
from _debug import \
HTTPResponseDebugProcessor, \
HTTPRedirectDebugProcessor
# crap ATM
## from _gzip impo... |
SmruthiManjunath/owncloud_friends | refs/heads/master | third_party/transifex-client/txclib/http_utils.py | 4 | # -*- coding: utf-8 -*-
"""
HTTP-related utility functions.
"""
from __future__ import with_statement
import gzip
try:
import cStringIO as StringIO
except ImportError:
import StringIO
def _gzip_decode(gzip_data):
"""
Unzip gzipped data and return them.
:param gzip_data: Gzipped data.
:retur... |
UWPCE-PythonCert/IntroPython2016 | refs/heads/master | students/cowhey/session08/test_sparse_array.py | 3 | """
tests for sparse_array.py
run with:
$python3 -m pytest test_sparse_array.py
"""
from sparse_array import SparseArray
def test_basic_sparse_array():
sa = SparseArray([1, 0, 4, 0, 0, 5, 0, 6])
def test_len():
sa = SparseArray([1, 0, 4, 0, 0, 5, 0, 6])
assert len(sa) == 8
def test_index():
sa1 = ... |
dya2/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/plat-freebsd6/IN.py | 172 | # Generated by h2py from /usr/include/netinet/in.h
# Included from sys/cdefs.h
__GNUCLIKE_ASM = 3
__GNUCLIKE_ASM = 2
__GNUCLIKE___TYPEOF = 1
__GNUCLIKE___OFFSETOF = 1
__GNUCLIKE___SECTION = 1
__GNUCLIKE_ATTRIBUTE_MODE_DI = 1
__GNUCLIKE_CTOR_SECTION_HANDLING = 1
__GNUCLIKE_BUILTIN_CONSTANT_P = 1
__GNUCLIKE_BUILTIN_VARA... |
3quarterstack/simple_blog | refs/heads/master | django/contrib/staticfiles/storage.py | 68 | from __future__ import unicode_literals
import hashlib
import os
import posixpath
import re
try:
from urllib.parse import unquote, urlsplit, urlunsplit, urldefrag
except ImportError: # Python 2
from urllib import unquote
from urlparse import urlsplit, urlunsplit, urldefrag
from django.conf import setti... |
coderbone/SickRage-alt | refs/heads/master | lib/twilio/rest/resources/transcriptions.py | 51 | from . import InstanceResource, ListResource
class Transcription(InstanceResource):
def delete(self):
"""
Delete this transcription
"""
return self.parent.delete(self.name)
class Transcriptions(ListResource):
name = "Transcriptions"
instance = Transcription
def lis... |
jinjiaho/project57 | refs/heads/master | flask/config.py | 51 | # -*- coding: utf-8 -*-
"""
flask.config
~~~~~~~~~~~~
Implements the configuration related objects.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import types
import errno
from werkzeug.utils import import_string
from ._compat import string_ty... |
pilou-/ansible | refs/heads/devel | lib/ansible/modules/source_control/github_release.py | 47 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: Ansible Team
# 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',
'... |
quanvm009/codev7 | refs/heads/master | openerp/addons/account/project/report/__init__.py | 427 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
Codefans-fan/odoo | refs/heads/8.0 | addons/marketing_campaign_crm_demo/__init__.py | 450 | # Debian packaging removes blank files, so this comment is added.
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
vv1133/home_web | refs/heads/master | django/core/management/commands/cleanup.py | 116 | import warnings
from django.contrib.sessions.management.commands import clearsessions
class Command(clearsessions.Command):
def handle_noargs(self, **options):
warnings.warn(
"The `cleanup` command has been deprecated in favor of `clearsessions`.",
DeprecationWarning)
supe... |
mluo613/osf.io | refs/heads/develop | tests/test_contributors_views.py | 10 | # -*- coding: utf-8 -*-
import time
import datetime
from nose.tools import * # noqa; PEP8 asserts
from osf_tests.factories import ProjectFactory, NodeFactory, AuthUserFactory
from tests.base import OsfTestCase
from framework.auth.decorators import Auth
from website.profile import utils
class TestContributorUtils... |
StrongPosHao/JDReviewAnalyse | refs/heads/master | PythonCrawler/Code/CommentCrawler.py | 1 | #encoding: utf-8
import json
import codecs
class CommentCrawler(object):
def __init__(self, html, productID):
s = html[27: -2]
try:
comments = json.loads(s)
except ValueError, e:
print "ValueError"
return
self.__comments = comments
self... |
NazarethCollege/heweb2017-devops-presentation | refs/heads/master | sites/tweetheat/src/backend/vendor/src/github.com/youtube/vitess/py/vtdb/dbexceptions.py | 12 | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
ricpelo/godot | refs/heads/master | platform/x11/detect.py | 10 |
import os
import sys
def is_active():
return True
def get_name():
return "X11"
def can_build():
if (os.name!="posix"):
return False
if sys.platform == "darwin":
return False # no x11 on mac for now
errorval=os.system("pkg-config --version > /dev/null")
if (errorval):
print("pkg-co... |
rasata/ansible | refs/heads/devel | lib/ansible/cli/galaxy.py | 31 | ########################################################################
#
# (C) 2013, James Cammarata <jcammarata@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 ... |
JuliBakagianni/CEF-ELRC | refs/heads/master | lib/python2.7/site-packages/django_selenium/settings.py | 3 | from django.conf import settings
# Specify the selenium test runner
SELENIUM_TEST_RUNNER = getattr(settings, 'SELENIUM_TEST_RUNNER',
'django_selenium.selenium_runner.SeleniumTestRunner')
SELENIUM_TIMEOUT = getattr(settings, 'SELENIUM_TIMEOUT', 120)
#------------------ LOCAL -------------... |
abcnews/dailygraphics | refs/heads/master | app_config.py | 2 | #!/usr/bin/env python
"""
Project-wide application configuration.
"""
import os
from authomatic.providers import oauth2
from authomatic import Authomatic
"""
NAMES
"""
# Project name in urls
# Use dashes, not underscores!
PROJECT_DIR = os.path.dirname(os.path.realpath(__file__))
PROJECT_SLUG = 'dailygraphics'
CONTE... |
hkariti/ansible | refs/heads/devel | lib/ansible/plugins/lookup/indexed_items.py | 57 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
lookup: indexed_items
author:... |
collinjackson/mojo | refs/heads/master | sky/tools/webkitpy/common/config/__init__.py | 6014 | # Required for Python to search this directory for module files
|
woozzu/pylearn2 | refs/heads/master | pylearn2/sandbox/cuda_convnet/stochastic_pool.py | 47 | """
GPU op for Stochastic max pooling as defined in:
Stochastic Pooling for Regularization of Deep Convolutional Neural Networks
Matthew D. Zeiler, Rob Fergus, ICLR 2013
The code is written around Alex Krizhevsky's cuda-convnet
"""
__authors__ = "Mehdi Mirza"
__copyright__ = "Copyright 2010-2013, Universite de Montr... |
hyrole/scrapy | refs/heads/master | docs/conf.py | 38 | # -*- coding: utf-8 -*-
#
# Scrapy documentation build configuration file, created by
# sphinx-quickstart on Mon Nov 24 12:02:52 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleab... |
philippjfr/bokeh | refs/heads/master | examples/plotting/file/color_data_map.py | 16 | import numpy as np
from bokeh.io import show
from bokeh.layouts import gridplot
from bokeh.models import (
ColumnDataSource,
ColorBar,
LinearColorMapper,
LogColorMapper,
)
from bokeh.palettes import Viridis3, Viridis256
from bokeh.plotting import figure
x = np.random.random(2500) * 140 - 20
y = np.ran... |
gladk/trunk | refs/heads/master | examples/test/force-move.py | 8 | O.bodies.append(sphere([0,0,0],1,fixed=False))
O.engines=[
ForceResetter(),
PyRunner(command='O.forces.addMove(0,(1e-2,0,0))',iterPeriod=1),
NewtonIntegrator()
]
for i in xrange(0,20):
O.step()
print O.forces.f(0),O.bodies[0].state.pos
quit()
|
geo-poland/frappe | refs/heads/develop | frappe/celery_app.py | 37 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals, absolute_import
from celery import Celery
# initiate logger
from celery.utils.log import get_task_logger
task_logger = get_task_logger(__name__)
from datetime import timedel... |
gnowgi/gnowsys-studio | refs/heads/master | gstudio/admin/attribute_bigintegerfield.py | 3 | from django.contrib import admin
from django.core.urlresolvers import NoReverseMatch
from django.utils.translation import ugettext_lazy as _
from gstudio.settings import GSTUDIO_VERSIONING
from django.template.defaultfilters import slugify
from gstudio.admin.forms import AttributeBigIntegerFieldAdminForm
import revers... |
highco-groupe/odoo | refs/heads/master | openerp/report/render/rml2pdf/color.py | 443 | # -*- 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... |
FRidh/seapy | refs/heads/master | tests/base.py | 1 | from seapy.base.base import UniqueName, NameWarning
class UniqueNameHolder:
name = UniqueName()
def __init__(self, system, name):
self.system = system
self.name = name
class UniqueNameSystem:
def __init__(self):
self._objects = list()
def objects(self):
return self... |
gitcoinco/web | refs/heads/master | app/faucet/management/commands/process_faucet_requests.py | 1 | '''
Copyright (C) 2021 Gitcoin Core
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.
This progra... |
haveal/googleads-python-lib | refs/heads/master | examples/adwords/v201506/reporting/download_criteria_report.py | 4 | #!/usr/bin/python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
anjalisood/spark-tk | refs/heads/master | python/sparktk/dicom/__init__.py | 42 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel 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 require... |
bhardesty/qpid-dispatch | refs/heads/fix-xref | tests/system_tests_ssl.py | 3 | #
# 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... |
rancher/cattle | refs/heads/v1.6 | tests/integration/cattletest/core/test_user_preferences.py | 7 | from common_fixtures import * # NOQA
from gdapi import ApiError
@pytest.fixture(scope='module')
def user_client(context):
return context.user_client
def _user_preference(client, name=None):
if name is None:
name = random_str()
preference = client.wait_success(client.create_user_preference(
... |
seishei/multiprocess | refs/heads/master | py2.6/multiprocess/connection.py | 1 | #
# A higher level module for using sockets (or Windows named pipes)
#
# multiprocessing/connection.py
#
# Copyright (c) 2006-2008, R Oudkerk --- see COPYING.txt
#
__all__ = [ 'Client', 'Listener', 'Pipe' ]
import os
import sys
import socket
import errno
import time
import tempfile
import itertools
import _multiproc... |
calvingit21/h2o-2 | refs/heads/master | h2o-docs-theme/setup.py | 84 | # -*- coding: utf-8 -*-
"""`sphinx_rtd_theme` lives on `Github`_.
.. _github: https://www.github.com/snide/sphinx_rtd_theme
"""
from setuptools import setup
from sphinx_rtd_theme import __version__
setup(
name='sphinx_rtd_theme',
version=__version__,
url='https://github.com/snide/sphinx_rtd_theme/',
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.