repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
zlsun/XX-Net | code/default/python27/1.0/lib/encodings/punycode.py | 586 | 6813 | # -*- coding: iso-8859-1 -*-
""" Codec for the Punicode encoding, as specified in RFC 3492
Written by Martin v. Löwis.
"""
import codecs
##################### Encoding #####################################
def segregate(str):
"""3.1 Basic code point segregation"""
base = []
extended = {}
for c in st... | bsd-2-clause |
stevelle/glance | glance/db/sqlalchemy/migrate_repo/versions/029_location_meta_data_pickle_to_string.py | 3 | 1660 | # Copyright 2013 Rackspace Hosting
# 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 require... | apache-2.0 |
spvkgn/youtube-dl | youtube_dl/extractor/iwara.py | 23 | 3380 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urllib_parse_urlparse
from ..utils import (
int_or_none,
mimetype2ext,
remove_end,
url_or_none,
)
class IwaraIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.|ecchi\.)?iwara\.tv... | unlicense |
FCP-INDI/nipype | nipype/interfaces/slicer/registration/brainsfit.py | 10 | 19351 | # -*- coding: utf8 -*-
"""Autogenerated file - DO NOT EDIT
If you spot a bug, please report it on the mailing list and/or change the generator."""
from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath
i... | bsd-3-clause |
Jannes123/inasafe | safe/messaging/example/error_message_example.py | 10 | 2900 | """
InaSAFE Disaster risk assessment tool by AusAid - **Error Message example.**
Contact : ole.moller.nielsen@gmail.com
.. note:: 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 ver... | gpl-3.0 |
karthik-sethuraman/Snowmass-ONFOpenTransport | RI/flask_server/tapi_server/models/tapi_path_computation_optimizep2ppath_input.py | 4 | 6111 | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server.models.tapi_path_computation_path_objective_function import TapiPathComputationPathObjectiveFunction ... | apache-2.0 |
alkaitz/starloot | src/gameengine/webSocketServer/lib/tornado-3.0.1/build/lib/tornado/test/gen_test.py | 4 | 26177 | from __future__ import absolute_import, division, print_function, with_statement
import contextlib
import functools
import sys
import textwrap
import time
from tornado.concurrent import return_future
from tornado.escape import url_escape
from tornado.httpclient import AsyncHTTPClient
from tornado.log import app_log
f... | apache-2.0 |
Chilledheart/chromium | tools/telemetry/third_party/gsutilz/gslib/commands/acl.py | 12 | 17702 | # -*- coding: utf-8 -*-
# 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 require... | bsd-3-clause |
BitWriters/Zenith_project | zango/lib/python3.5/site-packages/django/contrib/gis/db/backends/postgis/base.py | 102 | 1620 | from django.conf import settings
from django.db.backends.base.base import NO_DB_ALIAS
from django.db.backends.postgresql_psycopg2.base import \
DatabaseWrapper as Psycopg2DatabaseWrapper
from django.utils.functional import cached_property
from .creation import PostGISCreation
from .features import DatabaseFeatures... | mit |
dhruvagarwal/django | tests/urlpatterns_reverse/erroneous_urls.py | 199 | 1350 | import warnings
from django.conf.urls import url
from django.utils.deprecation import RemovedInDjango110Warning
from . import views
# Test deprecated behavior of passing strings as view to url().
# Some of these can be removed in Django 1.10 as they aren't convertable to
# callables.
with warnings.catch_warnings():
... | bsd-3-clause |
a-doumoulakis/tensorflow | tensorflow/python/keras/_impl/keras/regularizers.py | 29 | 2772 | # 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... | apache-2.0 |
trabacus-softapps/openerp-8.0-cc | openerp/addons/crm_partner_assign/wizard/crm_forward_to_partner.py | 377 | 10606 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
sursum/buckanjaren | buckanjaren/lib/python3.5/site-packages/pip/_vendor/html5lib/filters/optionaltags.py | 354 | 10534 | from __future__ import absolute_import, division, unicode_literals
from . import base
class Filter(base.Filter):
def slider(self):
previous1 = previous2 = None
for token in self.source:
if previous1 is not None:
yield previous2, previous1, token
previous2 =... | mit |
JohnGeorgiadis/invenio | invenio/ext/template/context_processor.py | 2 | 4477 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2012, 2013, 2014 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your optio... | gpl-2.0 |
13steinj/praw | praw/models/reddit/multi.py | 3 | 6290 | """Provide the Multireddit class."""
from json import dumps
import re
from ...const import API_PATH
from ..listing.mixins import SubredditListingMixin
from .base import RedditBase
from .redditor import Redditor
from .subreddit import Subreddit, SubredditStream
class Multireddit(RedditBase, SubredditListingMixin):
... | bsd-2-clause |
kennedyshead/home-assistant | homeassistant/components/simplisafe/__init__.py | 2 | 17414 | """Support for SimpliSafe alarm systems."""
import asyncio
from uuid import UUID
from simplipy import API
from simplipy.errors import EndpointUnavailable, InvalidCredentialsError, SimplipyError
import voluptuous as vol
from homeassistant.const import ATTR_CODE, CONF_CODE, CONF_TOKEN, CONF_USERNAME
from homeassistant.... | apache-2.0 |
HKUST-SING/tensorflow | tensorflow/tools/docs/gen_cc_md.py | 50 | 8418 | # 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... | apache-2.0 |
jnoortheen/nigandu | src/managebkm.py | 2 | 1697 | __author__ = 'noor'
from PySide.QtGui import (QDialog, QLabel, QIcon, QWidget, QVBoxLayout, QPushButton, QListWidget, QFont)
from PySide.QtCore import QRect
class managebkm(QDialog):
def __init__(self, parent=None):
super(managebkm, self).__init__(parent)
appicom = QIcon(":/icons/njnlogo.png")
self.setW... | gpl-2.0 |
mynew/OregonCore | dep/libmpq/bindings/python/mpq.py | 17 | 10752 | """wrapper for libmpq"""
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the ... | gpl-2.0 |
fredj/closure-library | closure/bin/labs/code/generate_jsdoc_test.py | 212 | 3494 | #!/usr/bin/env python
#
# Copyright 2013 The Closure Library 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
... | apache-2.0 |
Shawn1874/CodeSamples | CodeSamplesPython/PythonSamples/PythonStrings/UnitTests.py | 2 | 2993 | #!/usr/bin/env python3
import unittest
class StringTests(unittest.TestCase):
"""Test of string methods"""
def test_split(self):
test = "C:\\first\\second\\third"
parts = test.split("\\", 3)
self.assertEqual(len(parts), 4)
self.assertEqual("C:", parts[0])
self.assertEqu... | mit |
YOTOV-LIMITED/kuma | vendor/packages/translate/lang/identify.py | 25 | 4935 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 Zuza Software Foundation
#
# This file is part of translate.
#
# 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 o... | mpl-2.0 |
JianfengXu/crosswalk-test-suite | apptools/apptools-windows-tests/apptools/allpairs.py | 2 | 7177 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | bsd-3-clause |
jfinkels/networkx | doc/gitwash_dumper.py | 35 | 7892 | #!/usr/bin/env python
''' Checkout gitwash repo into directory and do search replace on name '''
from __future__ import print_function
import os
from os.path import join as pjoin
import shutil
import sys
import re
import glob
import fnmatch
import tempfile
from subprocess import call
from optparse import OptionParser
... | bsd-3-clause |
ivan-fedorov/intellij-community | plugins/hg4idea/testData/bin/mercurial/subrepo.py | 90 | 55623 | # subrepo.py - sub-repository handling for Mercurial
#
# Copyright 2009-2010 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import errno, os, re, xml.dom.minidom, shutil, posixpath, sys
import stat,... | apache-2.0 |
gdm/aws-cfn-resource-bridge | aws/cfn/bridge/vendored/botocore/vendored/requests/packages/charade/jpcntx.py | 200 | 19109 | ######################## 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... | apache-2.0 |
xzYue/odoo | addons/sale_layout/models/sale_layout.py | 180 | 5037 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
jor-/scipy | scipy/fftpack/tests/test_real_transforms.py | 4 | 24177 | from __future__ import division, print_function, absolute_import
from os.path import join, dirname
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_equal
import pytest
from pytest import raises as assert_raises
from scipy.fftpack.realtransforms import (
dct, idct, dst, idst, dctn, i... | bsd-3-clause |
sebastiansIT/RPI-Display-Backlight-Controller-for-Kodi | sources/screensaver.rpi-backlight-disabler/screensaver.py | 1 | 2345 | # Copyright 2016 Sebastian Spautz <sebastian@human-injection.de>
#
# This file is part of "RPI Display Backlight Control for Kodi".
#
# "RPI Display Backlight Control for Kodi" is free software: you can
# redistribute it and/or modify it under the terms of the GNU General
# Public License as publishe... | gpl-3.0 |
atosatto/ansible | lib/ansible/modules/cloud/digital_ocean/digital_ocean_tag.py | 58 | 7531 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... | gpl-3.0 |
ryancoleman/autodock-vina | boost_1_54_0/tools/build/v2/build/property_set.py | 13 | 14364 | # Status: ported.
# Base revision: 40480
# Copyright (C) Vladimir Prus 2002. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provided "as is" without express or implied
# warranty, and with no claim as to its s... | apache-2.0 |
mcanthony/oiio | testsuite/oiiotool-spi/run.py | 1 | 2476 | #!/usr/bin/env python
imagedir = parent + "spi-oiio-tests/"
refdir = imagedir + "ref/"
# Define a handy function that runs an oiiotool command, and
# also diffs the result against a reference image.
def oiiotool_and_test (inputfile, ops, outputfile, precommand="") :
cmd = oiiotool (precommand + " " + imagedir + ... | bsd-3-clause |
addition-it-solutions/project-all | addons/account/wizard/account_journal_select.py | 8 | 2000 | # -*- 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... | agpl-3.0 |
ssvsergeyev/ZenPacks.zenoss.AWS | src/boto/tests/integration/rds/test_promote_modify.py | 122 | 5425 | # Author: Bruce Pennypacker
#
# Create a temporary RDS database instance, then create a read-replica of the
# instance. Once the replica is available, promote it and verify that the
# promotion succeeds, then rename it. Delete the databases upon completion i
# of the tests.
#
# For each step (creating the databases, p... | gpl-2.0 |
enriquesanchezb/practica_utad_2016 | venv/lib/python2.7/site-packages/setuptools/ssl_support.py | 100 | 8119 | import os
import socket
import atexit
import re
from setuptools.extern.six.moves import urllib, http_client, map
import pkg_resources
from pkg_resources import ResolutionError, ExtractionError
try:
import ssl
except ImportError:
ssl = None
__all__ = [
'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_avail... | apache-2.0 |
yjmade/odoo | addons/google_drive/__openerp__.py | 320 | 1872 | # -*- 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... | agpl-3.0 |
h3biomed/ansible | lib/ansible/modules/notification/bearychat.py | 52 | 5908 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Jiangge Zhang <tonyseek@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 Li... | gpl-3.0 |
NMGRL/pychron | pychron/furnace/tasks/thermo/panes.py | 2 | 8660 | # ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... | apache-2.0 |
arcean/qtcontacts-tracker | tests/teststats.py | 1 | 10828 | #!/usr/bin/python
# This file is part of QtContacts tracker storage plugin
#
# Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
#
# Contact: Nokia Corporation (info@qt.nokia.com)
#
# GNU Lesser General Public License Usage
# This file may be used under the terms of the GNU Lesser General Public Licen... | lgpl-2.1 |
sabi0/intellij-community | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_xrange.py | 326 | 2699 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that changes xrange(...) into range(...)."""
# Local imports
from .. import fixer_base
from ..fixer_util import Name, Call, consuming_calls
from .. import patcomp
class FixXrange(fixer_base.BaseFix):
BM_... | apache-2.0 |
Anonymouslemming/ansible | lib/ansible/utils/vars.py | 34 | 5561 | # (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... | gpl-3.0 |
RockySteveJobs/python-for-android | python3-alpha/python3-src/Lib/mimetypes.py | 45 | 20413 | """Guess the MIME type of a file.
This module defines two useful functions:
guess_type(url, strict=True) -- guess the MIME type and encoding of a URL.
guess_extension(type, strict=True) -- guess the extension for a given MIME type.
It also contains the following, for tuning the behavior:
Data:
knownfiles -- list ... | apache-2.0 |
AlmostBetterNetwork/pinecast | dashboard/views_network.py | 3 | 6500 | from __future__ import absolute_import
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.http import Http404
from django.shortcuts import redirect
from django.utils.translation import ugettext
from django.views.decorators.http import require_POST
import ... | apache-2.0 |
spywhere/Javatar | commands/creates/create_class.py | 1 | 13833 | import sublime
import sublime_plugin
import os.path
from ...core import (
JavaClass,
JavaClassPath,
JavaUtils,
RE,
SnippetsManager,
StateProperty
)
from ...utils import (
ActionHistory,
StatusManager
)
EXTENDS_IMPLEMENTS_RE = "([:<])"
MAIN_TEMPLATE = "public static void main(String[] a... | mit |
Zhongqilong/kbengine | kbe/res/scripts/common/Lib/test/test_decimal.py | 60 | 203187 | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz (aahz at pobox.com)
# and Tim Peters
"""
These are the test cases for the Decim... | lgpl-3.0 |
fujunwei/chromium-crosswalk | tools/telemetry/telemetry/value/trace.py | 2 | 4819 | # Copyright 2014 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 datetime
import logging
import os
import random
import shutil
import sys
import tempfile
from telemetry.timeline import trace_data as trace_data_modu... | bsd-3-clause |
meejah/pyobfsproxy | obfsproxy/common/log.py | 1 | 1094 | # obfsproxy logging code
import logging
import sys
# XXX Add Formatter!!!
our_logger = logging.getLogger('our_logger')
default_handler = logging.StreamHandler(sys.stdout)
our_logger.addHandler(default_handler)
our_logger.propagate = False
def set_log_file(filename):
"""Set up our logger so that it starts loggin... | bsd-3-clause |
buzz/volctl | volctl/osd.py | 1 | 7911 | """
OSD volume overlay
A transparent OSD volume indicator for the bottom-right corner.
Various code snippets taken from https://github.com/kozec/sc-controller
"""
import math
import cairo
from gi.repository import Gdk, Gtk, GdkX11, GLib
import volctl.xwrappers as X
class VolumeOverlay(Gtk.Window):
"""Window t... | gpl-2.0 |
eckucukoglu/arm-linux-gnueabihf | lib/python2.7/distutils/dist.py | 175 | 50049 | """distutils.dist
Provides the Distribution class, which represents the module distribution
being built/installed/distributed.
"""
__revision__ = "$Id$"
import sys, os, re
from email import message_from_file
try:
import warnings
except ImportError:
warnings = None
from distutils.errors import (DistutilsOpt... | gpl-2.0 |
aidanlister/django | tests/contenttypes_tests/models.py | 172 | 2882 | from __future__ import unicode_literals
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.http import urlquote... | bsd-3-clause |
tmpgit/intellij-community | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_operator.py | 326 | 3472 | """Fixer for operator functions.
operator.isCallable(obj) -> hasattr(obj, '__call__')
operator.sequenceIncludes(obj) -> operator.contains(obj)
operator.isSequenceType(obj) -> isinstance(obj, collections.Sequence)
operator.isMappingType(obj) -> isinstance(obj, collections.Mapping)
operator.isNumberType(obj) ... | apache-2.0 |
cellml/libcellml | tests/bindings/python/test_generator.py | 3 | 1630 | #
# Tests the Generator class bindings
#
import unittest
class GeneratorTestCase(unittest.TestCase):
def test_create_destroy(self):
from libcellml import Generator
x = Generator()
del x
def test_algebraic_eqn_computed_var_on_rhs(self):
from libcellml import Analyser
... | apache-2.0 |
victor-prado/broker-manager | environment/lib/python3.5/site-packages/pandas/sparse/tests/test_indexing.py | 7 | 38977 | # pylint: disable-msg=E1101,W0612
import nose # noqa
import numpy as np
import pandas as pd
import pandas.util.testing as tm
class TestSparseSeriesIndexing(tm.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
self.orig = pd.Series([1, np.nan, np.nan, 3, np.nan])
self.sparse = sel... | mit |
anirudhSK/chromium | base/allocator/prep_libc.py | 31 | 2546 | #!/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.
#
# This script takes libcmt.lib for VS2005/08/10/12/13 and removes the allocation
# related functions from it.
#
# Usage: prep_lib... | bsd-3-clause |
bspink/django | django/contrib/gis/gdal/driver.py | 526 | 3260 | from ctypes import c_void_p
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi
from django.utils import six
from django.utils.encoding import force_bytes, force_text
class Driver(GDALBas... | bsd-3-clause |
rshum19/crazyflie-clients-python-matlab | lib/cfclient/ui/__init__.py | 9 | 1342 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | gpl-2.0 |
huangkebo/zulip | zerver/management/commands/add_users_to_streams.py | 113 | 2394 | from __future__ import absolute_import
from optparse import make_option
from django.core.management.base import BaseCommand
from zerver.lib.actions import create_stream_if_needed, do_add_subscription
from zerver.models import Realm, UserProfile, get_user_profile_by_email
class Command(BaseCommand):
help = """Ad... | apache-2.0 |
htwenhe/DJOA | env/Lib/site-packages/pip/_vendor/lockfile/pidlockfile.py | 536 | 6090 | # -*- coding: utf-8 -*-
# pidlockfile.py
#
# Copyright © 2008–2009 Ben Finney <ben+python@benfinney.id.au>
#
# This is free software: you may copy, modify, and/or distribute this work
# under the terms of the Python Software Foundation License, version 2 or
# later as published by the Python Software Foundation.
# No ... | mit |
compneuronmbu/NESTConnectionApp | nett_modules/python_modules/protobuf/google/protobuf/source_context_pb2.py | 11 | 2403 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/source_context.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf impo... | gpl-2.0 |
ryanj/origin | vendor/github.com/google/certificate-transparency/python/ct/cert_analysis/ip_addresses_test.py | 18 | 2888 | #!/usr/bin/env python
import unittest
import mock
from ct.cert_analysis import base_check_test
from ct.cert_analysis import ip_addresses
from ct.crypto import cert
class IpAddressesTest(base_check_test.BaseCheckTest):
class FakeIPAddress(object):
def __init__(self, *args):
self.octets = arg... | apache-2.0 |
ypid-bot/check_mk | doc/treasures/jolokia_mockup.py | 2 | 2455 | #!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | gpl-2.0 |
jhnnsnk/nest-simulator | pynest/nest/tests/test_spatial/test_layer_GetStatus_SetStatus.py | 15 | 4431 | # -*- coding: utf-8 -*-
#
# test_layer_GetStatus_SetStatus.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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... | gpl-2.0 |
drmrd/ansible | lib/ansible/modules/identity/ipa/ipa_service.py | 31 | 6542 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
isotoma/django-cms | cms/cms_toolbar.py | 2 | 23970 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.core.urlresolvers import reverse, NoReverseMatch, resolve, Resolver404
from django.utils.translation import ugettext_lazy as _
from django.contrib import admin
from django.contrib.auth.models import User, AnonymousUser
from django.contrib.sites.model... | bsd-3-clause |
mottosso/mindbender-setup | bin/windows/python36/Lib/distutils/unixccompiler.py | 7 | 14484 | """distutils.unixccompiler
Contains the UnixCCompiler class, a subclass of CCompiler that handles
the "typical" Unix-style command-line C compiler:
* macros defined with -Dname[=value]
* macros undefined with -Uname
* include search directories specified with -Idir
* libraries specified with -lllib
* library... | mit |
EmpireProject/EmPyre | lib/modules/lateral_movement/multi/ssh_launcher.py | 2 | 4852 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'SSHCommand',
# list of one or more ... | bsd-3-clause |
blaggacao/OpenUpgrade | addons/sale_stock/res_config.py | 331 | 5235 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
sho-h/ruby_env | devkit/mingw/bin/lib/macpath.py | 49 | 6467 | """Pathname and path-related operations for the Macintosh."""
import os
import warnings
from stat import *
import genericpath
from genericpath import *
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename","dirname","commonprefix","getsize","getmtime",
"getat... | mit |
edunham/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/testdata/handlers/sub/no_wsh_at_the_end.py | 499 | 1839 | # Copyright 2009, 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... | mpl-2.0 |
classcat/cc-prism-nsm | main/webapp/ccp_conf.py | 1 | 1509 | #############################################################
# ClassCat(R) Prism for HIDS
# Copyright (C) 2015 ClassCat Co.,Ltd. All rights reseerved.
##############################################################
# === Notice ===
# all python scripts were written by masao (@classcat.com)
#
# === History ===
# 02-a... | agpl-3.0 |
PrathapB/LTLMoP | src/lib/handlers/NXT/NXTLocomotionCommandHandler.py | 7 | 13146 | #!/usr/bin/env python
"""
========================================================================
NXTLocomotionCommand.py - LEGO Mindstorms NXT Locomotion Command Handler
========================================================================
Send forward, side, and angular velocity commands to the NXT.
"""
from mat... | gpl-3.0 |
jaywreddy/django | django/views/decorators/http.py | 208 | 4412 | """
Decorators for views based on HTTP headers.
"""
import logging
from calendar import timegm
from functools import wraps
from django.http import HttpResponseNotAllowed
from django.middleware.http import ConditionalGetMiddleware
from django.utils.cache import get_conditional_response
from django.utils.decorators imp... | bsd-3-clause |
shoopio/shoop | shuup/core/pricing/_price_display_options.py | 2 | 1631 | # This file is part of Shuup.
#
# Copyright (c) 2012-2019, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
class PriceDisplayOptions(object):
"""
Price display options.
Parameters on... | agpl-3.0 |
mohjaba/Health-Activity-Monitoring | 1_code/interactive_map/Demo1/twitter_stream.py | 1 | 1207 | import tweepy
import json
from pymongo import Connection
from bson import json_util
from tweepy.utils import import_simplejson
json = import_simplejson()
mongocon = Connection()
db = mongocon.twiter_data
col = db.tweets_stream
consumer_key = 'AYh6x5HIt5ubprSXeEGVqmLnT'
consumer_secret = 'wx4wC2ttf3hS34iGPMeL6VAifwIZ... | gpl-2.0 |
J861449197/edx-platform | cms/djangoapps/contentstore/views/tests/test_library.py | 114 | 9392 | """
Unit tests for contentstore.views.library
More important high-level tests are in contentstore/tests/test_libraries.py
"""
from contentstore.tests.utils import AjaxEnabledTestClient, parse_json
from contentstore.utils import reverse_course_url, reverse_library_url
from contentstore.views.component import get_compon... | agpl-3.0 |
EmrysChe/My_Python_practice | codes/extra/backup_script.py | 1 | 1043 | #!/usr/bin/python3
###################################
# for Linux #
###################################
import os
import time
source_dir = ['/root/data']
target_dir = '/root/backup'
today_log_dir = target_dir + os.sep + time.strftime('%y%m%d')
success_count = 0
fail_count = 0
if not os.path.exi... | gpl-2.0 |
gojira/tensorflow | tensorflow/contrib/solvers/python/ops/util.py | 47 | 2566 | # 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... | apache-2.0 |
thugs-rumal/rumal | interface/personalities/Personality.py | 2 | 1243 | #!/usr/bin/env python
#
# Personality.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANT... | gpl-2.0 |
nekulin/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_dbm.py | 56 | 1240 | from test import test_support
import unittest
import dbm
class DbmTestCase(unittest.TestCase):
def setUp(self):
self.filename = test_support.TESTFN
self.d = dbm.open(self.filename, 'c')
self.d.close()
def tearDown(self):
for suffix in ['', '.pag', '.dir', '.db']:
t... | apache-2.0 |
mglukhikh/intellij-community | python/lib/Lib/site-packages/django/dispatch/saferef.py | 345 | 10495 | """
"Safe weakrefs", originally from pyDispatcher.
Provides a way to safely weakref any function, including bound methods (which
aren't handled by the core weakref module).
"""
import weakref, traceback
def safeRef(target, onDelete = None):
"""Return a *safe* weak reference to a callable target
target -- th... | apache-2.0 |
DataSoft/Honeyd | webserver/support.py | 2 | 5439 | import honeyd
import urllib
import cgi
import sys
from htmltmpl import TemplateManager, TemplateProcessor
def quote(data):
"""Escapes a string so that it can safely be displayed
in an HTML document"""
escape_quotes = 1
return cgi.escape(data, escape_quotes)
def parse_query(query):
if not query:
... | gpl-2.0 |
lucciano/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/exitfuncs.py | 61 | 2402 | """SCons.exitfuncs
Register functions which are executed when SCons exits for any reason.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentat... | apache-2.0 |
handroissuazo/tensorflow | tensorflow/contrib/learn/python/learn/preprocessing/tests/categorical_vocabulary_test.py | 18 | 2412 | # encoding: utf-8
# 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 r... | apache-2.0 |
sorenh/cc | vendor/redis-py/redis/client.py | 3 | 45789 | import datetime
import errno
import socket
import threading
import time
import warnings
from itertools import chain
from redis.exceptions import ConnectionError, ResponseError, InvalidResponse
from redis.exceptions import RedisError, AuthenticationError
class ConnectionPool(threading.local):
"Manages a list of co... | apache-2.0 |
qwere/gitosis | gitosis/init.py | 19 | 4219 | """
Initialize a user account for use with gitosis.
"""
import errno
import logging
import os
import sys
from pkg_resources import resource_filename
from cStringIO import StringIO
from ConfigParser import RawConfigParser
from gitosis import repository
from gitosis import run_hook
from gitosis import ssh
from gitosis... | gpl-2.0 |
0Chencc/CTFCrackTools | Lib/Lib/lib2to3/fixes/fix_print.py | 326 | 2865 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for print.
Change:
'print' into 'print()'
'print ...' into 'print(...)'
'print ... ,' into 'print(..., end=" ")'
'print >>x, ...' into 'print(..., file=x)'
No changes are appl... | gpl-3.0 |
octavioturra/aritial | google_appengine/lib/django/django/test/testcases.py | 32 | 2036 | import re, doctest, unittest
from django.db import transaction
from django.core import management
from django.db.models import get_apps
normalize_long_ints = lambda s: re.sub(r'(?<![\w])(\d+)L(?![\w])', '\\1', s)
class OutputChecker(doctest.OutputChecker):
def check_output(self, want, got, optionflags):
... | apache-2.0 |
DominoTree/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/browsers/servo.py | 6 | 3029 | import os
from .base import NullBrowser, ExecutorBrowser, require_arg
from .base import get_timeout_multiplier # noqa: F401
from ..executors import executor_kwargs as base_executor_kwargs
from ..executors.executorservo import (ServoCrashtestExecutor, # noqa: F401
ServoTestharn... | mpl-2.0 |
0-wiz-0/audacity | lib-src/lv2/lv2/plugins/eg-sampler.lv2/waflib/Tools/gfortran.py | 276 | 1966 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import re
from waflib import Utils
from waflib.Tools import fc,fc_config,fc_scan,ar
from waflib.Configure import conf
@conf
def find_gfortran(conf):
fc=conf.find_program(['gf... | gpl-2.0 |
theaeolianmachine/hokiefinder | hokiefinder/geolocator/google_geocoding.py | 1 | 1103 | import json
import requests
GEOCODING_URL = 'http://maps.googleapis.com/maps/api/geocode/json'
ZERO_RESULTS = 'ZERO_RESULTS'
OVER_QUERY_LIMIT = 'OVER_QUERY_LIMIT'
REQUEST_DENIED = 'REQUEST_DENIED'
INVALID_REQUEST = 'INVALID_REQUEST'
ERRORS = (ZERO_RESULTS, OVER_QUERY_LIMIT, REQUEST_DENIED, INVALID_REQUEST)
def get_l... | mit |
creativcoder/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/dispatch.py | 652 | 14786 | # Copyright 2012, 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... | mpl-2.0 |
tlangerak/Multi-Agent-Systems | xmppd/modules/pubsub.py | 3 | 15056 | # -*- coding: utf-8 -*-
from uuid import uuid4
from datetime import datetime
from xmpp import *
from xmpp.protocol import *
class PSNode(object):
"""
Publish-Subscribe node.
TODO: Items must retain info about its publisher. We have only implemented
owners and subscribes, not publishers. So pu... | lgpl-2.1 |
JamesMura/sentry | tests/sentry/api/endpoints/test_project_release_commits.py | 2 | 1840 | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.models import Commit, Release, ReleaseCommit, Repository
from sentry.testutils import APITestCase
class ReleaseCommitsListTest(APITestCase):
def test_simple(self):
project = self.create_project(
n... | bsd-3-clause |
aerickson/ansible | lib/ansible/modules/cloud/rackspace/rax_network.py | 70 | 4288 | #!/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... | gpl-3.0 |
Quikling/gpdb | gpMgmt/bin/gpcheckcat_modules/unique_index_violation_check.py | 37 | 2542 | #!/usr/bin/env python
class UniqueIndexViolationCheck:
unique_indexes_query = """
select table_oid, index_name, table_name, array_agg(attname) as column_names
from pg_attribute, (
select pg_index.indrelid as table_oid, index_class.relname as index_name, table_class.relname as table_name... | apache-2.0 |
resmo/ansible | lib/ansible/modules/network/fortios/fortios_switch_controller_lldp_profile.py | 13 | 16790 | #!/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... | gpl-3.0 |
nirs/ovirt-engine | packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/upgrade/async_tasks_map.py | 8 | 3443 | #
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2013 Red Hat, 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 r... | apache-2.0 |
lakshmi-kannan/st2 | st2client/st2client/utils/interactive.py | 3 | 12716 | # Licensed to the StackStorm, Inc ('StackStorm') 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 th... | apache-2.0 |
taaviteska/django | tests/admin_views/tests.py | 17 | 286326 | import datetime
import json
import os
import re
import unittest
from urllib.parse import parse_qsl, urljoin, urlparse
import pytz
from django.contrib.admin import AdminSite, ModelAdmin
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.admin.models import ADDITION, DELETION, LogEntry
fr... | bsd-3-clause |
naturali/tensorflow | tensorflow/python/framework/tensor_shape.py | 1 | 26539 | # 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... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.