repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
danielecook/gist-alfred | refs/heads/master | github/GitTreeElement.py | 5 | # -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... |
Therp/odoo | refs/heads/8.0 | addons/portal_stock/__openerp__.py | 437 | # -*- 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... |
cberry777/dd-agent | refs/heads/master | tests/checks/mock/test_riakcs.py | 5 | # stdlib
from socket import error
import unittest
# 3p
from mock import Mock
# project
from checks import AgentCheck
from tests.checks.common import AgentCheckTest, Fixtures, load_check
class RiakCSTest(AgentCheckTest):
CHECK_NAME = "riakcs"
def __init__(self, *args, **kwargs):
unittes... |
jordiclariana/ansible | refs/heads/devel | lib/ansible/utils/encrypt.py | 49 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
aetilley/scikit-learn | refs/heads/master | doc/tutorial/text_analytics/skeletons/exercise_01_language_train_model.py | 254 | """Build a language detector model
The goal of this exercise is to train a linear classifier on text features
that represent sequences of up to 3 consecutive characters so as to be
recognize natural languages by using the frequencies of short character
sequences as 'fingerprints'.
"""
# Author: Olivier Grisel <olivie... |
marcoantoniooliveira/labweb | refs/heads/master | oscar/lib/python2.7/site-packages/whoosh/filedb/compound.py | 87 | # Copyright 2011 Matt Chaput. 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 the... |
jetskijoe/headphones | refs/heads/master | lib/yaml/representer.py | 360 |
__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',
'RepresenterError']
from error import *
from nodes import *
import datetime
import sys, copy_reg, types
class RepresenterError(YAMLError):
pass
class BaseRepresenter(object):
yaml_representers = {}
yaml_multi_representers = {}
d... |
vbannai/neutron | refs/heads/master | neutron/tests/unit/openvswitch/test_ovs_tunnel.py | 2 | # Copyright 2012 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
plotly/plotly.py | refs/heads/master | packages/python/plotly/plotly/validators/icicle/marker/colorbar/__init__.py | 36 | import sys
if sys.version_info < (3, 7):
from ._ypad import YpadValidator
from ._yanchor import YanchorValidator
from ._y import YValidator
from ._xpad import XpadValidator
from ._xanchor import XanchorValidator
from ._x import XValidator
from ._title import TitleValidator
from ._tickwi... |
diogommartins/ryu | refs/heads/master | ryu/tests/unit/packet/test_cfm.py | 23 | # Copyright (C) 2013 Nippon Telegraph and Telephone 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 applicab... |
ampyche/ampyche | refs/heads/master | amp-cgi-bin/getters/getplaylistsongsforpopup.py | 1 | #!/usr/bin/python3
import cgi
import json
import sqlite3 as lite
class GetPlaylistSongsForPopup():
def __init__(self):
self.pll_db_loc = "/usr/share/ampyche/db/ampychePlaylist.db"
def _make_a_list(self, genlist):
agen = []
for gen in genlist:
gen = ' '.join(gen)
agen.append(gen)
agen.sort()
retur... |
chenbaihu/grpc | refs/heads/master | src/python/src/grpc/framework/face/testing/coverage.py | 41 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
vrv/tensorflow | refs/heads/master | tensorflow/tools/test/system_info.py | 170 | # 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... |
adaptivelogic/django-cms | refs/heads/refactor-viewperms | cms/plugins/flash/migrations/0004_table_rename.py | 33 |
from south.db import db
from django.db import models
from cms.plugins.flash.models import *
class Migration:
def forwards(self, orm):
"Write your forwards migration here"
def backwards(self, orm):
"Write your backwards migration here"
models = {
'cms.cmsplugin': {
... |
mdworks2016/work_development | refs/heads/master | Python/20_Third_Certification/venv/lib/python3.7/site-packages/pip/_internal/utils/virtualenv.py | 3 | from __future__ import absolute_import
import logging
import os
import re
import site
import sys
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import List, Optional
logger = logging.getLogger(__name__)
_INCLUDE_SYSTEM_SITE_PACKAGES_REGEX = re.compile(
r"include... |
balthamos/plover | refs/heads/master | plover/gui/lookup.py | 7 | # Copyright (c) 2013 Hesky Fisher
# See LICENSE.txt for details.
import wx
from wx.lib.utils import AdjustRectToScreen
import sys
from plover.steno import normalize_steno
import plover.gui.util as util
TITLE = 'Plover: Lookup'
class LookupDialog(wx.Dialog):
BORDER = 3
TRANSLATION_TEXT = 'Text:'
oth... |
mesheven/pyOCD | refs/heads/master | pyocd/flash/__init__.py | 3 | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2015 ARM Limited
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 ... |
ashhher3/cvxpy | refs/heads/master | cvxpy/atoms/elementwise/log1p.py | 11 | """
Copyright 2013 Steven Diamond, Eric Chu
This file is part of CVXPY.
CVXPY 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.
CVXPY is dis... |
MechanisM/musicdb | refs/heads/master | contrib/south/tests/circular_a/migrations/0001_first.py | 174 | from south.db import db
from django.db import models
class Migration:
depends_on = [('circular_b', '0001_first')]
def forwards(self):
pass
def backwards(self):
pass
|
simonpatrick/bite-project | refs/heads/master | server/crawlers/issuetracker_crawler_test.py | 17 | #!/usr/bin/python
#
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... |
overtherain/scriptfile | refs/heads/master | software/googleAppEngine/lib/django_1_3/django/contrib/gis/gdal/tests/test_geom.py | 154 | from django.contrib.gis.gdal import OGRGeometry, OGRGeomType, \
OGRException, OGRIndexError, SpatialReference, CoordTransform, \
GDAL_VERSION
from django.utils import unittest
from django.contrib.gis.geometry.test_data import TestDataMixin
class OGRGeomTest(unittest.TestCase, TestDataMixin):
"This tests th... |
leonardowolf/bookfree | refs/heads/master | flask/lib/python2.7/site-packages/wheel/test/test_install.py | 455 | # Test wheel.
# The file has the following contents:
# hello.pyd
# hello/hello.py
# hello/__init__.py
# test-1.0.data/data/hello.dat
# test-1.0.data/headers/hello.dat
# test-1.0.data/scripts/hello.sh
# test-1.0.dist-info/WHEEL
# test-1.0.dist-info/METADATA
# test-1.0.dist-info/RECORD
# The ... |
tjsavage/tmrwmedia | refs/heads/master | django/contrib/gis/admin/__init__.py | 637 | # Getting the normal admin routines, classes, and `site` instance.
from django.contrib.admin import autodiscover, site, AdminSite, ModelAdmin, StackedInline, TabularInline, HORIZONTAL, VERTICAL
# Geographic admin options classes and widgets.
from django.contrib.gis.admin.options import GeoModelAdmin
from django.contri... |
1tush/reviewboard | refs/heads/master | reviewboard/webapi/tests/mixins_comment.py | 1 | from __future__ import unicode_literals
from reviewboard.webapi.tests.mixins import test_template
from reviewboard.webapi.tests.mixins_extra_data import (ExtraDataItemMixin,
ExtraDataListMixin)
class BaseCommentListMixin(object):
@test_template
def test... |
IllusionRom-deprecated/android_platform_external_chromium_org_tools_gyp | refs/heads/master | test/subdirectory/gyptest-SYMROOT-default.py | 399 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies building a target and a subsidiary dependent target from a
.gyp file in a subdirectory, without specifying an explicit output b... |
parente/clique | refs/heads/master | Mixin/Stability.py | 1 | '''
Defines a class that is notified whenever an event occurs in the process with
which it is associated.
@author: Peter Parente <parente@cs.unc.edu>
@copyright: Copyright (c) 2008 Peter Parente
@license: BSD License
All rights reserved. This program and the accompanying materials are made
available under the terms o... |
fast-project/fast-lib | refs/heads/master | vendor/mosquitto-1.4.12/test/broker/01-connect-invalid-id-0.py | 10 | #!/usr/bin/env python
# Test whether a CONNECT with a zero length client id results in the correct CONNACK packet.
import inspect, os, sys
# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder
cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( ... |
jrowan/zulip | refs/heads/master | zerver/webhooks/ifttt/tests.py | 43 | # -*- coding: utf-8 -*-
from zerver.lib.test_classes import WebhookTestCase
class IFTTTHookTests(WebhookTestCase):
STREAM_NAME = 'ifttt'
URL_TEMPLATE = "/api/v1/external/ifttt?stream={stream}&api_key={api_key}"
FIXTURE_DIR_NAME = 'ifttt'
def test_ifttt_when_subject_and_body_are_correct(self):
... |
javierTerry/odoo | refs/heads/8.0 | openerp/addons/test_new_api/__openerp__.py | 204 | # -*- coding: utf-8 -*-
{
'name': 'Test New API',
'version': '1.0',
'category': 'Tests',
'description': """A module to test the new API.""",
'author': 'OpenERP SA',
'maintainer': 'OpenERP SA',
'website': 'http://www.openerp.com',
'depends': ['base'],
'installable': True,
'auto_in... |
Kalyzee/edx-platform | refs/heads/master | lms/djangoapps/course_wiki/plugins/markdownedx/__init__.py | 275 | # Make sure wiki_plugin.py gets run.
from course_wiki.plugins.markdownedx.wiki_plugin import ExtendMarkdownPlugin
|
iansf/pstar | refs/heads/master | pstar/pstar.py | 1 | # -*- coding: utf-8 -*-
#
# 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 la... |
jczaplew/busMSN | refs/heads/github | node_modules/grunt-contrib-nodeunit/node_modules/nodeunit/deps/ejs/node_modules/expresso/deps/jscoverage/js/build/win32/pgomerge.py | 79 | #!/usr/bin/python
# Usage: pgomerge.py <binary basename> <dist/bin>
# Gathers .pgc files from dist/bin and merges them into
# $PWD/$basename.pgd using pgomgr, then deletes them.
# No errors if any of these files don't exist.
import sys, os, os.path, subprocess
if not sys.platform == "win32":
raise Exception("This ... |
ychen820/microblog | refs/heads/master | flask/lib/python2.7/site-packages/pbr/tests/testpackage/pbr_testpackage/cmd.py | 142 | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# 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... |
powdahound/ec2instances.info | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
from __future__ import unicode_literals
from setuptools import setup
setup(
name='ec2instances.info',
packages=['ec2instances.info'],
version='0.0.2',
description='The community-maintained dataset of aws instance types'
' and pricing',
author='Garret Heaton',
... |
Freso/listenbrainz-server | refs/heads/master | listenbrainz/domain/spotify.py | 1 | import base64
import requests
import six
import time
from flask import current_app
import spotipy.oauth2
from listenbrainz.db import spotify as db_spotify
from datetime import datetime, timezone
SPOTIFY_API_RETRIES = 5
SPOTIFY_IMPORT_PERMISSIONS = (
'user-read-currently-playing',
'user-read-recently-played',... |
NUKnightLab/StoryMapJS | refs/heads/master | stagedev.py | 1 | def build():
"""Build lib version"""
_setup_env()
# Get build config
if not 'build' in _config:
abort('Could not find "build" in config file')
# Check version
if not 'version' in _config:
_config['version'] = datetime.utcnow().strftime('%Y-%m-%... |
jstoxrocky/statsmodels | refs/heads/master | statsmodels/iolib/stata_summary_examples.py | 39 |
""". regress totemp gnpdefl gnp unemp armed pop year
Source | SS df MS Number of obs = 16
-------------+------------------------------ F( 6, 9) = 330.29
Model | 184172402 6 30695400.3 Prob > F = 0.0000
Residual | 836424.129 ... |
guyromm/greencouriers | refs/heads/master | greencouriers/lib/app_globals.py | 1 | """The application's Globals object"""
class Globals(object):
"""Globals acts as a container for objects available throughout the
life of the application
"""
def __init__(self,config):
"""One instance of Globals is created during application
initialization and is available during reque... |
thedep2/CouchPotatoServer | refs/heads/develop | libs/requests/exceptions.py | 21 | # -*- coding: utf-8 -*-
"""
requests.exceptions
~~~~~~~~~~~~~~~~~~~
This module contains the set of Requests' exceptions.
"""
from .packages.urllib3.exceptions import HTTPError as BaseHTTPError
class RequestException(IOError):
"""There was an ambiguous exception that occurred while handling your
request.""... |
JuliBakagianni/CEF-ELRC | refs/heads/master | lib/python2.7/site-packages/haystack/query.py | 9 | import logging
import operator
import warnings
from haystack import connections, connection_router
from haystack.backends import SQ
from haystack.constants import REPR_OUTPUT_SIZE, ITERATOR_LOAD_PER_QUERY, DEFAULT_OPERATOR
from haystack.exceptions import NotHandled
from haystack.inputs import Raw, Clean, AutoQuery
cl... |
zzz14/LOST-FOUND | refs/heads/master | userpage/jieba1/test/parallel/test_disable_hmm.py | 5 | #encoding=utf-8
from __future__ import print_function
import sys
sys.path.append("../../")
import jieba
jieba.enable_parallel(4)
def cuttest(test_sent):
result = jieba.cut(test_sent, HMM=False)
for word in result:
print(word, "/", end=' ')
print("")
if __name__ == "__main__":
cuttest("这是一个伸手不... |
davemerwin/blue-channel | refs/heads/master | external_apps/threadedcomments/forms.py | 15 | from django import forms
from threadedcomments.models import DEFAULT_MAX_COMMENT_LENGTH
from threadedcomments.models import FreeThreadedComment, ThreadedComment
from django.utils.translation import ugettext_lazy as _
class ThreadedCommentForm(forms.ModelForm):
"""
Form which can be used to validate data for a ... |
uwdata/termite-visualizations | refs/heads/master | web2py/gluon/contrib/pg8000/interface.py | 24 | # vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2007-2009, Mathieu Fenniak
# 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 co... |
havard024/prego | refs/heads/master | venv/lib/python2.7/site-packages/jinja2/testsuite/api.py | 15 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.api
~~~~~~~~~~~~~~~~~~~~
Tests the public API and related stuff.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import time
import tempfile
import unittest
from jinja2.testsuite import JinjaTestCase
... |
Eluvatar/zombie-radar | refs/heads/master | location_monitor.py | 1 | # Simple module to track the location of nations
# Copyright (C) 2013-2015 Eluvatar
#
# 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 o... |
FabriceSalvaire/tex-calendar | refs/heads/master | doc/sunset-sunrise.py | 1 | import ephem
import datetime
obs = ephem.Observer()
obs.lat = '38.8'
obs.long= '-75.2'
start_date = datetime.datetime(2008, 1, 1)
end_date = datetime.datetime(2008, 12, 31)
td = datetime.timedelta(days=1)
sun = ephem.Sun()
sunrises = []
sunsets = []
dates = []
date = start_date
while date < end_date:
date... |
omprakasha/odoo | refs/heads/8.0 | addons/stock/report/stock_graph.py | 326 | # -*- 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... |
mcsalgado/ansible | refs/heads/devel | lib/ansible/parsing/splitter.py | 118 | # (c) 2014 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 Foundation, either version 3 of the License, or
# (at your option) any late... |
StefanRijnhart/odoo | refs/heads/master | addons/document/report/document_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 GNU... |
anand-c-goog/tensorflow | refs/heads/master | tensorflow/tools/pip_package/simple_console.py | 603 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
dpetzold/django | refs/heads/master | django/apps/config.py | 224 | import os
from importlib import import_module
from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured
from django.utils._os import upath
from django.utils.module_loading import module_has_submodule
MODELS_MODULE_NAME = 'models'
class AppConfig(object):
"""
Class representing a Django ap... |
tcheehow/MissionPlanner | refs/heads/master | Lib/encodings/cp037.py | 93 | """ Python Character Mapping Codec cp037 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def deco... |
minhphung171093/OpenERP_V7 | refs/heads/master | openerp/addons/mrp_repair/wizard/cancel_repair.py | 52 | # -*- 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... |
darkleons/BE | refs/heads/master | addons/payment_transfer/controllers/main.py | 395 | # -*- coding: utf-8 -*-
import logging
import pprint
import werkzeug
from openerp import http, SUPERUSER_ID
from openerp.http import request
_logger = logging.getLogger(__name__)
class OgoneController(http.Controller):
_accept_url = '/payment/transfer/feedback'
@http.route([
'/payment/transfer/feed... |
40223247/2015cd_midterm2 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/test/_test_warnings.py | 858 | # helper module for test_runner.Test_TextTestRunner.test_warnings
"""
This module has a number of tests that raise different kinds of warnings.
When the tests are run, the warnings are caught and their messages are printed
to stdout. This module also accepts an arg that is then passed to
unittest.main to affect the b... |
wzbozon/statsmodels | refs/heads/master | statsmodels/datasets/stackloss/data.py | 25 | """Stack loss data"""
__docformat__ = 'restructuredtext'
COPYRIGHT = """This is public domain. """
TITLE = __doc__
SOURCE = """
Brownlee, K. A. (1965), "Statistical Theory and Methodology in
Science and Engineering", 2nd edition, New York:Wiley.
"""
DESCRSHORT = """Stack loss plant data of Brownlee (19... |
viaict/viaduct | refs/heads/develop | migrations/versions/2017_07_24_b8cea80e0a3a_add_requires_direct_payment_to_.py | 1 | """Add requires_direct_payment to CustomForm.
Revision ID: b8cea80e0a3a
Revises: 5bc8d6e5633b
Create Date: 2017-07-24 14:26:57.045590
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b8cea80e0a3a'
down_revision = '5bc8d6e5633b'
def upgrade():
op.add_column... |
j-marjanovic/myhdl | refs/heads/master | myhdl/test/conversion/toVHDL/test_signed.py | 1 | from __future__ import absolute_import
import os
path = os.path
import random
from random import randrange
from myhdl import *
from myhdl.conversion import verify
NRTESTS = 10
def binaryOps(
Bitand,
## Bitor,
## Bitxor,
## FloorDiv,
LeftShift,
Modulo,
Mul,
#... |
home-assistant/home-assistant | refs/heads/dev | tests/components/plugwise/test_binary_sensor.py | 2 | """Tests for the Plugwise binary_sensor integration."""
from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import STATE_OFF, STATE_ON
from tests.components.plugwise.common import async_init_integration
async def test_anna_climate_binary_sensor_entities(hass, mock_smile_anna):
"""... |
leeon/annotated-django | refs/heads/note | django/contrib/formtools/tests/wizard/storage.py | 6 | from datetime import datetime
from importlib import import_module
import os
import tempfile
from django.http import HttpRequest
from django.conf import settings
from django.contrib.auth.models import User
from django.core.files.storage import FileSystemStorage
from django.core.files.uploadedfile import SimpleUploadedF... |
smilezino/shadowsocks | refs/heads/master | tests/graceful_cli.py | 977 | #!/usr/bin/python
import socks
import time
SERVER_IP = '127.0.0.1'
SERVER_PORT = 8001
if __name__ == '__main__':
s = socks.socksocket()
s.set_proxy(socks.SOCKS5, SERVER_IP, 1081)
s.connect((SERVER_IP, SERVER_PORT))
s.send(b'test')
time.sleep(30)
s.close()
|
libvirt/autotest | refs/heads/master | client/bin/net/net_tc_unittest.py | 1 | #!/usr/bin/python
# TODO(chavey) complete all the unit test in this file
import unittest, os, socket, time, sys
try:
import autotest.common as common
except ImportError:
import common
from autotest_lib.client.bin import utils
from autotest_lib.client.bin.net import net_tc, net_utils, net_utils_mock
from autot... |
6112/servo | refs/heads/master | tests/wpt/css-tests/tools/wptserve/tests/functional/test_server.py | 299 | import os
import unittest
import urllib2
import json
import wptserve
from base import TestUsingServer, doc_root
class TestFileHandler(TestUsingServer):
def test_not_handled(self):
with self.assertRaises(urllib2.HTTPError) as cm:
resp = self.request("/not_existing")
self.assertEquals(c... |
eicher31/compassion-switzerland | refs/heads/10.0 | sbc_switzerland/reports/translation_yearly_report.py | 3 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py
#
#################################################... |
neuroidss/nupic | refs/heads/master | src/nupic/support/decorators.py | 28 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
Agana/MyBlogAgain | refs/heads/master | django/contrib/auth/models.py | 95 | import datetime
import urllib
from django.contrib import auth
from django.contrib.auth.signals import user_logged_in
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.db.models.manager import EmptyManager
from django.contrib.contenttypes.models import ContentType
from dja... |
bensk/CS11 | refs/heads/gh-pages | Code Examples/Classes.py | 3 | class Pet(object):
"""Represents a pet"""
my_pet_1 = Pet()
my_pet_1.type = 'direwolf'
my_pet_1.noise = 'howl'
my_pet_1.full_name = 'Ghost'
my_pet_2 = Pet()
my_pet_2.type = 'direwolf'
my_pet_2.noise = 'howl'
my_pet_2.full_name = 'Nymeria'
my_pet_3 = Pet()
my_pet_3.type = 'direwolf'
my_pet_3.noise = 'howl'
my_pet_... |
Batterfii/zulip | refs/heads/master | zerver/management/commands/check_apns_tokens.py | 125 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zerver.lib.push_notifications import check_apns_feedback
class Command(BaseCommand):
help = """Checks the Apple Push Notifications Service for any tokens that have been
invalidated, and removes them from ... |
SerCeMan/intellij-community | refs/heads/master | python/testData/quickFixes/PyMakeFunctionFromMethodQuickFixTest/updateUsage_after.py | 79 | __author__ = 'ktisha'
def foo():
print("Hello Pycharm!")
class A:
pass
foo() |
dlazz/ansible | refs/heads/devel | lib/ansible/module_utils/network/edgeswitch/edgeswitch_interface.py | 52 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... |
joelpinheiro/safebox-smartcard-auth | refs/heads/master | Server/veserver/lib/python2.7/site-packages/setuptools/tests/test_sdist.py | 332 | # -*- coding: utf-8 -*-
"""sdist tests"""
import locale
import os
import shutil
import sys
import tempfile
import unittest
import unicodedata
import re
from setuptools.tests import environment, test_svn
from setuptools.tests.py26compat import skipIf
from setuptools.compat import StringIO, unicode
from setuptools.test... |
OndrejIT/pyload | refs/heads/stable | module/plugins/hoster/DepositfilesCom.py | 6 | # -*- coding: utf-8 -*-
import re
import urllib
from ..captcha.SolveMedia import SolveMedia
from ..internal.SimpleHoster import SimpleHoster
class DepositfilesCom(SimpleHoster):
__name__ = "DepositfilesCom"
__type__ = "hoster"
__version__ = "0.63"
__status__ = "testing"
__pattern__ = r'https?:/... |
bobsilverberg/oneanddone-sugardough | refs/heads/master | oneanddone/tasks/serializers.py | 4 | # 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/.
from rest_framework import serializers
from oneanddone.tasks.models import Task, TaskKeyword, TaskAttempt
class TaskAt... |
a25kk/ssm-buildout | refs/heads/master | src/ssm.sitecontent/ssm/sitecontent/interfaces.py | 1 | # -*- coding: utf-8 -*-
"""Module where all interfaces, events and exceptions live."""
from plone.theme.interfaces import IDefaultPloneLayer
class ISsmSitecontentLayer(IDefaultPloneLayer):
"""Marker interface that defines a Zope 3 browser layer."""
|
Maspear/odoo | refs/heads/8.0 | addons/account/wizard/account_chart.py | 271 | # -*- 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... |
tvtsoft/odoo8 | refs/heads/master | addons/l10n_multilang/__openerp__.py | 2 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Multi Language Chart of Accounts',
'version': '1.1',
'author': 'OpenERP SA',
'category': 'Hidden/Dependency',
'description': """
* Multi language support for Chart of Accounts, Taxes, T... |
gautam1858/tensorflow | refs/heads/master | tensorflow/contrib/eager/python/examples/spinn/spinn_test.py | 20 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
cherrygirl/micronaet7 | refs/heads/master | pricelist_model/wizard/print_report_wizard.py | 1 | # -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... |
teochenglim/ansible-modules-extras | refs/heads/devel | cloud/amazon/ec2_vpc_nacl_facts.py | 41 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... |
GdZ/scriptfile | refs/heads/master | software/googleAppEngine/lib/yaml/lib/yaml/error.py | 692 |
__all__ = ['Mark', 'YAMLError', 'MarkedYAMLError']
class Mark(object):
def __init__(self, name, index, line, column, buffer, pointer):
self.name = name
self.index = index
self.line = line
self.column = column
self.buffer = buffer
self.pointer = pointer
def get... |
Ujjwal29/ansible | refs/heads/devel | test/units/utils/test_vars.py | 155 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2015, Toshio Kuraotmi <tkuratomi@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, eithe... |
sodexis/odoo | refs/heads/8.0 | addons/web_graph/__init__.py | 1350 | import controllers
|
abhishekmurthy/Calligra | refs/heads/master | plan/plugins/scripting/tests/resource_readwrite.py | 7 | #!/usr/bin/env kross
# -*- coding: utf-8 -*-
import traceback
import Kross
import Plan
import TestResult
TestResult.setResult( True )
asserttext1 = "Test of property '{0}' failed:\n Expected: '{2}'\n Result: '{1}'"
asserttext2 = "Failed to set property '{0}' to '{1}'. Result: {2}"
try:
project = Plan.proj... |
zanderle/django | refs/heads/master | django/contrib/flatpages/forms.py | 357 | from django import forms
from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.utils.translation import ugettext, ugettext_lazy as _
class FlatpageForm(forms.ModelForm):
url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$',
help_text=_("E... |
yamateh/robotframework | refs/heads/master | src/robot/utils/unic.py | 1 | # Copyright 2008-2013 Nokia Siemens Networks Oyj
#
# 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... |
aewallin/opencamlib | refs/heads/master | src/attic/oct_test3.py | 1 | import ocl as cam
import camvtk
import time
import vtk
import math
import datetime
red= (1,0,0)
green= (0,1,0)
blue= (0,0,1)
cyan= (0,1,1)
yellow= (1,1,0)
pink = ( float(255)/255,float(192)/255,float(203)/255)
grey = ( float(127)/255,float(127)/255,float(127)/255)
orange = ( float(255)/255,float(165)/255,float(0)/255... |
davidbgk/secateur | refs/heads/master | secateur/http.py | 1 | import json
import logging
import os
from http.client import ACCEPTED, CREATED, NOT_FOUND
from nameko.events import EventDispatcher
from nameko.rpc import rpc
from nameko.web.handlers import http
from .constants import RESULTS_FOLDER, STATUS_COMPLETE
from .logger import LoggingDependency
from .storages import RedisSt... |
hand-iemura/lightpng | refs/heads/master | boost_1_53_0/libs/python/test/printer.py | 46 | # Copyright David Abrahams 2006. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
class _printer(object):
def __init__(self):
self.results = [];
def __call__(self, *stuff):
for x in stuff:
... |
Bluehorn/requests | refs/heads/develop | requests/packages/urllib3/util.py | 65 | # urllib3/util.py
# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from base64 import b64encode
from collections import namedtuple
from socket import error as Socke... |
jiangzhuo/kbengine | refs/heads/master | kbe/src/lib/python/Lib/mailcap.py | 100 | """Mailcap file handling. See RFC 1524."""
import os
__all__ = ["getcaps","findmatch"]
# Part 1: top-level interface.
def getcaps():
"""Return a dictionary containing the mailcap database.
The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain')
to a list of dictionaries corresponding to ... |
TeslaProject/external_chromium_org | refs/heads/lp5.1 | third_party/tlslite/tlslite/utils/datefuncs.py | 206 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
import os
#Functions for manipulating datetime objects
#CCYY-MM-DDThh:mm:ssZ
def parseDateClass(s):
year, month, day = s.split("-")
day, tail = day[:2], day[2:]
hour, minute, second = tail[1:].split(":")
s... |
homework/nox | refs/heads/zaku | src/nox/netapps/user_event_log/networkeventsws.py | 9 | # -*- coding: utf8 -*-
# Copyright 2008 (C) Nicira, Inc.
#
# This file is part of NOX.
#
# NOX 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... |
ayoubg/gem5-graphics | refs/heads/master | gem5/src/arch/x86/isa/insts/simd128/floating_point/data_conversion/convert_floating_point_to_gpr_integer.py | 91 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... |
dpac-vlsi/SynchroTrace | refs/heads/master | src/arch/x86/isa/insts/general_purpose/rotate_and_shift/rotate.py | 91 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... |
vcarrera/ahmia | refs/heads/master | ahmia/solr_grouping_backend.py | 5 | # encoding: utf-8
"""Experimental Solr Grouping / Field Collapsing backend for Haystack 2.0"""
# NOTE: You must be running the latest Pysolr master - no PyPI release yet!
# See https://gist.github.com/3750774 for the current version of this code
# See http://wiki.apache.org/solr/FieldCollapsing for the Solr feature doc... |
sh-ft/mudwyrm_engine | refs/heads/master | mudwyrm_engine/console_message.py | 1 | import operator
from types import StringType, UnicodeType, TupleType, ListType, DictType
class ConsoleMessage(object):
def __init__(self, type_, attr, contents):
if type(type_) not in [StringType, UnicodeType]:
raise TypeError("type_ must be a string")
if type(attr) is not DictTy... |
BorisJeremic/Real-ESSI-Examples | refs/heads/master | education_examples/_Chapter_Modeling_and_Simulation_Examples_Static_Examples/Contact_Normal_Interface_Behaviour_SoftContact_Nonlinear_Hardening_Softening_Shear_Model/plot.py | 8 | #!/usr/bin/python
import h5py
import matplotlib.pylab as plt
import sys
import numpy as np;
# Go over each feioutput and plot each one.
thefile = "Monotonic_Contact_Behaviour_Adding_Normal_Load.h5.feioutput";
finput = h5py.File(thefile)
# Read the time and displacement
times = finput["time"][:]
shear_strain_x = fi... |
dropzonemathmo/SocialMediaLinksRecommend | refs/heads/master | TwitterScraper/SecretExample.py | 1 | """
SecretExample.py contains an example the secret login information for TwitterScraper
"""
CONSUMER_KEY = 'CONSUMER_KEY'
CONSUMER_SECRET = 'CONSUMER_SECRET'
ACCESS_TOKEN_KEY = 'ACCESS_TOKEN_KEY'
ACCESS_TOKEN_SECRET = 'ACCESS_TOKEN_SECRET' |
coolstar/coreboot | refs/heads/master | util/exynos/fixed_cksum.py | 12 | #!/usr/bin/env python2
#
# Copyright (C) 2013 Google Inc.
#
# 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... |
web30s/odoo-9.0c-20160402 | refs/heads/master | hello/templates/openerp/addons/account/models/account_journal_dashboard.py | 2 | import json
from datetime import datetime, timedelta
from babel.dates import format_datetime, format_date
from openerp import models, api, _, fields
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT as DF
from openerp.tools.misc import formatLang
class account_journal(models.Model):
_inherit = "account.journa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.