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 |
|---|---|---|---|---|---|
jamezpolley/pip | tests/unit/test_index.py | 22 | 3603 | import pytest
from pip.download import PipSession
from pip.index import HTMLPage
from pip.index import PackageFinder, Link, INSTALLED_VERSION
def test_sort_locations_file_expand_dir(data):
"""
Test that a file:// dir gets listdir run with expand_dir
"""
finder = PackageFinder([data.find_links], [], s... | mit |
chunyang-wen/dynet | examples/mnist/mnist-autobatch.py | 5 | 6853 | #! /usr/bin/env python3
import time
import random
import os
import struct
import argparse
import numpy as np
import dynet as dy
# To run this, download the four files from http://yann.lecun.com/exdb/mnist/
# using the --download option.
# Pass the path where the data should be stored (or is already stored)
# to the ... | apache-2.0 |
ElDeveloper/qiita | qiita_pet/handlers/rest/study_samples.py | 3 | 4239 | # -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | bsd-3-clause |
dani-i/bachelor-project | session/test_session.py | 1 | 5751 | from controllers.data_set_controller import DataSetController
from controllers.session_controller import SessionController
from utils.train.session_details import SessionDetails
import constants.cnn_constants as cnn_const
import neural_networks.cnn as cnn
import tensorflow as tf
import threading
import math
class... | apache-2.0 |
pbs/django-cms | cms/plugins/googlemap/south_migrations/0004_copy_address.py | 11 | 10058 |
from south.db import db
from django.db import models
from cms.plugins.googlemap.models import *
class Migration:
def forwards(self, orm):
if not db.dry_run:
for map in orm.googlemap.objects.all():
map.address = "%s %s" % (map.street, map.streetnr )
map.zip... | bsd-3-clause |
Pointedstick/ReplicatorG | skein_engines/skeinforge-44/skeinforge_application/skeinforge_plugins/meta_plugins/polyfile.py | 13 | 1319 | """
This page is in the table of contents.
Polyfile is a script to choose whether the skeinforge toolchain will operate on one file or all the files in a directory.
==Settings==
===Polyfile Choice===
Default is 'Execute File',
====Execute File====
When selected, the toolchain will operate on only the chosen file.
==... | gpl-2.0 |
mohamed-ali/PyTables | examples/vlarray1.py | 13 | 1280 | from __future__ import print_function
import tables
import numpy as np
# Create a VLArray:
fileh = tables.open_file('vlarray1.h5', mode='w')
vlarray = fileh.create_vlarray(fileh.root, 'vlarray1',
tables.Int32Atom(shape=()),
"ragged array of ints",
... | bsd-3-clause |
Gitlab11/odoo | addons/account_analytic_analysis/res_config.py | 426 | 1408 | # -*- 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 |
GheRivero/ansible | lib/ansible/plugins/lookup/cartesian.py | 141 | 2174 | # (c) 2013, Bradley Young <young.bradley@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: cartesian
version_added... | gpl-3.0 |
quaddra/engage | python_pkg/engage/drivers/standard/postgres_database__9_x/driver.py | 1 | 5516 |
"""Resource manager for postgres-database 9.x
"""
# Common stdlib imports
import sys
import os
import os.path
## import commands
# fix path if necessary (if running from source or running as test)
try:
import engage.utils
except:
sys.exc_clear()
dir_to_add_to_python_path = os.path.abspath((os.path.join(... | apache-2.0 |
mlperf/training_results_v0.5 | v0.5.0/google/cloud_v2.8/ssd-tpuv2-8/code/ssd/model/tpu/models/experimental/keras_colab/shakespeare_lstm.py | 5 | 6133 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
Teino1978-Corp/Teino1978-Corp-light_.gitignore | light_data_migrations_0008_fi_comparativo.py | 1 | 1169 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('master', '0019_periodo_tipoperiodo'),
('data', '0007_auto_20150216_0921'),
]
operations = [
migrations.CreateModel(
... | mit |
chromium/crashpad | build/gyp_crashpad_android.py | 11 | 2896 | #!/usr/bin/env python
# Copyright 2017 The Crashpad 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
#
# Unles... | apache-2.0 |
virgree/odoo | addons/hw_scale/__init__.py | 1894 | 1075 | # -*- 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... | agpl-3.0 |
chongyangtao/gmmreg | Python/_plotting.py | 14 | 2435 | #!/usr/bin/env python
#coding=utf-8
##====================================================
## $Author$
## $Date$
## $Revision$
##====================================================
from pylab import *
from configobj import ConfigObj
import matplotlib.pyplot as plt
def display2Dpointset(A):
fig = plt.figure()
... | gpl-3.0 |
chromium/chromium | third_party/tlslite/tlslite/integration/httptlsconnection.py | 115 | 4314 | # Authors:
# Trevor Perrin
# Kees Bos - Added ignoreAbruptClose parameter
# Dimitris Moraitis - Anon ciphersuites
# Martin von Loewis - python 3 port
#
# See the LICENSE file for legal information regarding use of this file.
"""TLS Lite + httplib."""
import socket
try:
import httplib
except ImportError:
... | bsd-3-clause |
googleapis/python-talent | setup.py | 1 | 2740 | # Copyright 2019 Google LLC
#
# 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 writing, s... | apache-2.0 |
PLWagner/python_koans | python3/koans/about_classes.py | 68 | 4778 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutClasses(Koan):
class Dog:
"Dogs need regular walkies. Never, ever let them drive."
def test_instances_of_classes_can_be_created_adding_parentheses(self):
# NOTE: The .__name__ attribute will convert the class
... | mit |
Antonio-Team/enigma2 | lib/python/Components/Converter/ClockToText.py | 10 | 3704 | from Converter import Converter
from time import localtime, strftime
from Components.Element import cached
class ClockToText(Converter, object):
DEFAULT = 0
WITH_SECONDS = 1
IN_MINUTES = 2
DATE = 3
FORMAT = 4
AS_LENGTH = 5
TIMESTAMP = 6
FULL = 7
SHORT_DATE = 8
LONG_DATE = 9
VFD = 10
AS_LENGTHHOURS = 11
AS... | gpl-2.0 |
cria/microSICol | py/modules/labels.py | 1 | 38937 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
This file contains a mapping from the labels found in the html
templates to translatable strings.
'''
label_dict = {
"label_Container": _("Container"),
"label_Rep_Division": _("Rep Division"),
#taxa
"label_Species_General_Comments": _("Comments"),
"label_Species_Ge... | gpl-2.0 |
matllubos/django-json-field | test_project/wsgi.py | 73 | 1146 | """
WSGI config for test_project project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATI... | bsd-3-clause |
playm2mboy/edx-platform | common/djangoapps/util/migrations/0002_default_rate_limit_config.py | 102 | 4097 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"""Ensure that rate limiting is enabled by default. """
orm['util.RateLimitConfiguration'].objects.create(enable... | agpl-3.0 |
biddisco/VTK | ThirdParty/Twisted/twisted/conch/test/test_openssh_compat.py | 10 | 3364 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.conch.openssh_compat}.
"""
import os
from twisted.trial.unittest import TestCase
from twisted.python.filepath import FilePath
from twisted.python.compat import set
try:
import Crypto.Cipher.DES3
import pyasn1
exc... | bsd-3-clause |
mlperf/training_results_v0.7 | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/tests/python/unittest/test_codegen_device.py | 1 | 4204 | # 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... | apache-2.0 |
mic4ael/indico | bin/utils/create_module.py | 1 | 6792 | # This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
import os
import re
import textwrap
from collections import defau... | mit |
SCUEvals/scuevals-api | db/alembic/env.py | 1 | 2188 | from __future__ import with_statement
import os
import sys
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
sys.path.append(os.getcwd())
from scuevals_api.models import db # noqa
# this is the Alembic Config object, which provides
# access to the valu... | agpl-3.0 |
Softmotions/edx-platform | lms/djangoapps/lms_xblock/test/test_runtime.py | 92 | 6099 | """
Tests of the LMS XBlock Runtime and associated utilities
"""
from django.contrib.auth.models import User
from django.conf import settings
from ddt import ddt, data
from mock import Mock
from unittest import TestCase
from urlparse import urlparse
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from lm... | agpl-3.0 |
BogusCurry/picup-it | picupwebapp/picupwebapp/picture/models.py | 2 | 8278 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.db import models
from tools import image_thumb, image_medium, image_smart
from django.contrib.auth import get_user_model
import hashlib
try:
from django.contrib.auth import get_user_model
User = get_user_model()
except:
from django.contrib.auth.mod... | bsd-3-clause |
henryfjordan/django | tests/update_only_fields/tests.py | 296 | 9780 | from __future__ import unicode_literals
from django.db.models.signals import post_save, pre_save
from django.test import TestCase
from .models import Account, Employee, Person, Profile, ProxyEmployee
class UpdateOnlyFieldsTests(TestCase):
def test_update_fields_basic(self):
s = Person.objects.create(nam... | bsd-3-clause |
sumedhasingla/VTK | ThirdParty/Twisted/twisted/mail/bounce.py | 26 | 2292 | # -*- test-case-name: twisted.mail.test.test_bounce -*-
#
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Support for bounce message generation.
"""
import StringIO
import rfc822
import time
import os
from twisted.mail import smtp
BOUNCE_FORMAT = """\
From: postmaster@%(failedDomain)s
... | bsd-3-clause |
kovacsbalu/ansible-modules-extras | network/citrix/netscaler.py | 143 | 5056 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage Citrix NetScaler entities
(c) 2013, Nandor Sivok <nandor@gawker.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 Softwa... | gpl-3.0 |
founders4schools/duedilv3 | duedil/resources/pro/company/__init__.py | 1 | 1180 | from __future__ import unicode_literals
from .accounts import Account
from .accounts.financial import AccountDetailsFinancial
from .accounts.gaap import AccountDetailsGAAP
from .accounts.ifrs import AccountDetailsIFRS
from .accounts.insurance import AccountDetailsInsurance
from .accounts.statutory import AccountDetail... | apache-2.0 |
michaelmurdock/mmlib | db_utils.py | 1 | 1578 | # db_utils.py
def execute_query_for_single_value(cursor, query):
'''
query is a string containing a well-formed query that is executed
against the specified cursor.
RETURNS: the following tripe: (results_flag, err_msg, value)
'''
try:
# Execute the query
cursor.exe... | bsd-2-clause |
DavidAwad/Quantum-Simulator | quantum.py | 1 | 5150 | #!/usr/bin/env python
# encoding: utf-8
from cmath import exp, pi, sqrt
from random import random
import itertools
def vectorflip(bitstring):
"""
returns flipped bits in a given string
"""
if not bitstring: raise TypeError("vectorflip passed None")
return ''.join('1' if x == '0' else '0' for x... | gpl-3.0 |
gpodder/mygpo | mygpo/administration/views.py | 1 | 13775 | import re
import socket
from itertools import count, chain
from collections import Counter
from datetime import datetime
import redis
import django
from django.db.models import Avg
from django.shortcuts import render
from django.contrib import messages
from django.urls import reverse
from django.core.cache import cac... | agpl-3.0 |
skonto/spark | python/pyspark/ml/image.py | 19 | 7777 | #
# 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 us... | apache-2.0 |
RO-ny9/python-for-android | python-modules/twisted/twisted/cred/checkers.py | 61 | 9334 | # -*- test-case-name: twisted.test.test_newcred -*-
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
import os
from zope.interface import implements, Interface, Attribute
from twisted.internet import defer
from twisted.python import failure, log
from twisted.cred import error, creden... | apache-2.0 |
andymckay/addons-server | src/olympia/amo/tests/test_helpers.py | 2 | 20575 | # -*- coding: utf-8 -*-
import mimetypes
import os
from datetime import datetime, timedelta
from urlparse import urljoin
from django.conf import settings
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test.client import RequestFactory
from django.test.utils import override_settings
from djan... | bsd-3-clause |
rjawor/concordia-server | tests/addAlignedLemmatizedTM.py | 1 | 3161 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import json
import urllib2
import sys
import host
import time
BUFFER_SIZE = 500
address = 'http://'+host.concordia_host
if len(host.concordia_port) > 0:
address += ':'+host.concordia_port
def file_len(fname):
with open(fname) as f:
for i, l ... | lgpl-3.0 |
icodedev7/customap | devkit/mingw/bin/lib/audiodev.py | 286 | 7597 | """Classes for manipulating audio devices (currently only for Sun and SGI)"""
from warnings import warnpy3k
warnpy3k("the audiodev module has been removed in Python 3.0", stacklevel=2)
del warnpy3k
__all__ = ["error","AudioDev"]
class error(Exception):
pass
class Play_Audio_sgi:
# Private instance variables
... | mit |
podsvirov/grpc | tools/run_tests/run_interop_tests.py | 3 | 28385 | #!/usr/bin/env python2.7
# 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 lis... | bsd-3-clause |
CiscoSystems/quantum | neutron/db/routedserviceinsertion_db.py | 4 | 3637 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 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/li... | apache-2.0 |
intfrr/shaka-player | third_party/gjslint/closure_linter-2.3.13/closure_linter/javascriptstatetracker.py | 107 | 5171 | #!/usr/bin/env python
# Copyright 2008 The Closure Linter 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 |
Vauxoo/hr | hr_worked_days_activity/__init__.py | 24 | 1041 | # -*- coding:utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Savoir-faire Linux. All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publish... | agpl-3.0 |
derekjchow/models | research/object_detection/legacy/trainer.py | 1 | 17662 | # 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... | apache-2.0 |
zbigniewwojna/text-rcnn | utils/object_detection_evaluation_test.py | 21 | 6171 | # 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... | apache-2.0 |
satyrius/cmsplugin-articles | cmsplugin_articles/south_migrations/0001_initial.py | 1 | 3016 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ArticlesPlugin'
db.create_table(u'cmsplugin_articles_arti... | mit |
BondAnthony/ansible | test/lib/ansible_test/_data/sanity/code-smell/future-import-boilerplate.py | 67 | 1646 | #!/usr/bin/env python
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import ast
import sys
def main():
for path in sys.argv[1:] or sys.stdin.read().splitlines():
with open(path, 'rb') as path_fd:
lines = path_fd.read().splitlines()
missing = T... | gpl-3.0 |
worden-lee/mediawiki-core | maintenance/cssjanus/cssjanus.py | 165 | 21248 | #!/usr/bin/python
#
# Copyright 2008 Google Inc. All Rights Reserved.
"""Converts a LeftToRight Cascading Style Sheet into a RightToLeft one.
This is a utility script for replacing "left" oriented things in a CSS file
like float, padding, margin with "right" oriented values.
It also does the opposite.
The... | gpl-2.0 |
liang42hao/bokeh | bokeh/compat/mplexporter/renderers/base.py | 44 | 14355 | import warnings
import itertools
from contextlib import contextmanager
import numpy as np
from matplotlib import transforms
from .. import utils
from .. import _py3k_compat as py3k
class Renderer(object):
@staticmethod
def ax_zoomable(ax):
return bool(ax and ax.get_navigate())
@staticmethod
... | bsd-3-clause |
alejolp/argentum-py-server | argentumserver/util.py | 1 | 2663 | # -*- coding: utf-8 -*-
"""
AONX Server - Pequeño servidor de Argentum Online.
Copyright (C) 2011 Alejandro Santos <alejolp@alejolp.com.ar>
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 Fo... | gpl-3.0 |
hitochan777/python-gflags | tests/flags_modules_for_testing/module_bar.py | 139 | 4840 | #!/usr/bin/env python
# Copyright (c) 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 l... | bsd-3-clause |
SYSTRAN/nlp-api-python-client | tests/test_ner.py | 1 | 2741 | #!/usr/bin/env python
# coding: utf-8
import os
import unittest
import systran_nlp_api
import systran_nlp_api.configuration
class NerApiTests(unittest.TestCase):
def setUp(self):
api_key_file = os.path.join(os.path.dirname(__file__), "../", "api_key.txt")
systran_nlp_api.configuration.load_api_ke... | apache-2.0 |
joker946/nova | nova/tests/unit/network/test_neutronv2.py | 3 | 170338 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
agconti/njode | env/lib/python2.7/site-packages/sphinx/websupport/__init__.py | 11 | 19132 | # -*- coding: utf-8 -*-
"""
sphinx.websupport
~~~~~~~~~~~~~~~~~
Base Module for web support functions.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
import cPickle as pickle
import posixpath
from os import path
from jinja2... | bsd-3-clause |
magooos/KITT | interface.py | 1 | 2476 | __author__ = 'laurentmeyer'
# Set the command type to auto
import sys, telnetlib, time
MOCK_SERVER = "192.168.2.217"
MOCK_SERVER_PORT = 35000
def beginCommunication(telnetaddr = MOCK_SERVER, telnetport = MOCK_SERVER_PORT):
telnet = telnetlib.Telnet(telnetaddr, port=telnetport)
return telnet
def startInfiniteL... | apache-2.0 |
SociedadMartinez/ToolShare | registration/views.py | 1 | 31482 | """
@authors Tina Howard, Grant Gadomski, Nick Mattis, Laura Silva, Nils Sohn
"""
from django.shortcuts import render, get_object_or_404, redirect
from django.utils.datastructures import MultiValueDictKeyError
from django.http import Http404, HttpResponseRedirect, HttpResponse #TODO Take off HttpResponse after fig... | gpl-3.0 |
kuri65536/python-for-android | python-build/python-libs/gdata/tests/atom_tests/core_test.py | 87 | 16382 | #!/usr/bin/env python
#
# Copyright (C) 2008 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 ... | apache-2.0 |
ksmaheshkumar/grr | lib/client_index.py | 2 | 6025 | #!/usr/bin/env python
"""A keyword index of client machines.
An index of client machines, associating likely identifiers to client IDs.
"""
from grr.lib import keyword_index
from grr.lib import rdfvalue
from grr.lib import utils
# The system's primary client index.
MAIN_INDEX = rdfvalue.RDFURN("aff4:/client_index")... | apache-2.0 |
CivicTechTO/open-cabinet | venv/lib/python2.7/site-packages/django/templatetags/static.py | 197 | 4052 | from django import template
from django.utils.encoding import iri_to_uri
from django.utils.six.moves.urllib.parse import urljoin
register = template.Library()
class PrefixNode(template.Node):
def __repr__(self):
return "<PrefixNode for %r>" % self.name
def __init__(self, varname=None, name=None):
... | mit |
EnviroCentre/jython-upgrade | jython/lib/cookielib.py | 90 | 64449 | r"""HTTP cookie handling for web clients.
This module has (now fairly distant) origins in Gisle Aas' Perl module
HTTP::Cookies, from the libwww-perl library.
Docstrings, comments and debug strings in this code refer to the
attributes of the HTTP cookie system as cookie-attributes, to distinguish
them clearly from Pyt... | mit |
ujuo/opencv | opencv-3.2.0/build/install/share/OpenCV/samples/python/coherence.py | 5 | 2303 | #!/usr/bin/env python
'''
Coherence-enhancing filtering example
=====================================
inspired by
Joachim Weickert "Coherence-Enhancing Shock Filters"
http://www.mia.uni-saarland.de/Publications/weickert-dagm03.pdf
'''
# Python 2/3 compatibility
from __future__ import print_function
import sys
PY... | gpl-3.0 |
traveloka/ansible | lib/ansible/plugins/callback/skippy.py | 116 | 1317 | # (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 |
sgarrity/bedrock | bedrock/mozorg/tests/test_forums.py | 35 | 1853 | # -*- coding: utf-8 -*-
# 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 collections import OrderedDict
from bedrock.mozorg import forums
from bedrock.mozorg.tests... | mpl-2.0 |
tito/pymt | pymt/ui/widgets/layout/boxlayout.py | 2 | 5981 | '''
Box layout: arrange widget in horizontal or vertical
'''
__all__ = ('MTBoxLayout', )
from pymt.ui.widgets.layout.abstractlayout import MTAbstractLayout
class MTBoxLayout(MTAbstractLayout):
'''Box layout can arrange item in horizontal or vertical orientation.
:Parameters:
`padding` : int, default... | lgpl-3.0 |
eddiep1101/django-oscar | tests/unit/customer/notification_tests.py | 43 | 1501 | from django.test import TestCase
from oscar.apps.customer.models import Notification
from oscar.apps.customer.notifications import services
from oscar.core.compat import get_user_model
from oscar.test.factories import UserFactory
User = get_user_model()
class TestANewNotification(TestCase):
def setUp(self):
... | bsd-3-clause |
Wuguanping/Server_Manage_Plugin | Openstack_Plugin/ironic-plugin-pike/ironic/tests/unit/drivers/modules/test_deploy_utils.py | 3 | 108163 | # Copyright (c) 2012 NTT DOCOMO, INC.
# Copyright 2011 OpenStack Foundation
# Copyright 2011 Ilya Alekseyev
#
# 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:... | apache-2.0 |
elimence/edx-platform | common/lib/xmodule/xmodule/contentstore/mongo.py | 1 | 4555 | from bson.son import SON
from pymongo import Connection
import gridfs
from gridfs.errors import NoFile
from xmodule.modulestore.mongo import location_to_query, Location
from xmodule.contentstore.content import XASSET_LOCATION_TAG
import logging
from .content import StaticContent, ContentStore
from xmodule.exceptions... | agpl-3.0 |
xsynergy510x/android_external_chromium_org | chrome/common/extensions/docs/server2/timer.py | 122 | 1702 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import time
class Timer(object):
'''A simple timer which starts when constructed and stops when Stop is called.
'''
def __init__(self):
self._st... | bsd-3-clause |
tyb0807/angr | angr/procedures/libc/fseek.py | 1 | 1124 | import angr
from . import io_file_data_for_arch
from ...errors import SimSolverError
######################################
# fseek
######################################
class fseek(angr.SimProcedure):
#pylint:disable=arguments-differ
def run(self, file_ptr, offset, whence):
# TODO: Support symboli... | bsd-2-clause |
musicbrainz/picard | picard/webservice/api_helpers.py | 1 | 11716 | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2017 Sambhav Kothari
# Copyright (C) 2018 Laurent Monin
# Copyright (C) 2018-2019 Philipp Wolfer
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# ... | gpl-2.0 |
valtech-mooc/edx-platform | lms/djangoapps/courseware/tests/test_navigation.py | 13 | 10429 | """
This test file will run through some LMS test scenarios regarding access and navigation of the LMS
"""
import time
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from courseware.tests.helpers import LoginEnrollmentTestCase
from coursew... | agpl-3.0 |
ProfessionalIT/professionalit-webiste | sdk/google_appengine/lib/django-1.5/django/contrib/localflavor/es/forms.py | 108 | 7737 | # -*- coding: utf-8 -*-
"""
Spanish-specific Form helpers
"""
from __future__ import absolute_import, unicode_literals
import re
from django.contrib.localflavor.es.es_provinces import PROVINCE_CHOICES
from django.contrib.localflavor.es.es_regions import REGION_CHOICES
from django.core.validators import EMPTY_VALUES
... | lgpl-3.0 |
mkaluza/external_chromium_org | tools/perf/metrics/rendering_stats_unittest.py | 23 | 7828 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import random
import unittest
from metrics.rendering_stats import RenderingStats
from telemetry.core.timeline import model
class MockTimer(object):
"""A... | bsd-3-clause |
le9i0nx/ansible | lib/ansible/module_utils/facts/namespace.py | 172 | 2366 | # 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... | gpl-3.0 |
pigeonflight/strider-plone | docker/appengine/lib/django-1.5/tests/regressiontests/mail/tests.py | 44 | 35405 | # coding: utf-8
from __future__ import unicode_literals
import asyncore
import email
import os
import shutil
import smtpd
import sys
import tempfile
import threading
from django.core import mail
from django.core.mail import (EmailMessage, mail_admins, mail_managers,
EmailMultiAlternatives, send_mail, send_mas... | mit |
bmbouter/kombu | kombu/utils/debug.py | 39 | 1668 | """
kombu.utils.debug
=================
Debugging support.
"""
from __future__ import absolute_import
import logging
from functools import wraps
from kombu.five import items
from kombu.log import get_logger
__all__ = ['setup_logging', 'Logwrapped']
def setup_logging(loglevel=logging.DEBUG, loggers=['kombu.conne... | bsd-3-clause |
sam-tsai/django | django/template/context.py | 105 | 9348 | import warnings
from contextlib import contextmanager
from copy import copy
from django.utils.deprecation import RemovedInDjango110Warning
# Hard-coded processor for easier use of CSRF protection.
_builtin_context_processors = ('django.template.context_processors.csrf',)
_current_app_undefined = object()
class Con... | bsd-3-clause |
samj1912/picard | picard/ui/ui_infostatus.py | 8 | 4621 | # -*- coding: utf-8 -*-
# Automatically generated - don't edit.
# Use `python setup.py build_ui` to update it.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_InfoStatus(object):
def setupUi(self, InfoStatus):
InfoStatus.setObjectName("InfoStatus")
InfoStatus.resize(350, 24)
sizePolic... | gpl-2.0 |
Bjay1435/capstone | rootfs/usr/lib/python3.4/lib2to3/fixer_base.py | 100 | 6706 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Base class for fixers (optional, but recommended)."""
# Python imports
import logging
import itertools
# Local imports
from .patcomp import PatternCompiler
from . import pygram
from .fixer_util import does_tree_imp... | mit |
sundhaug92/binwalk | src/binwalk/modules/entropy.py | 1 | 11569 | # Calculates and optionally plots the entropy of input files.
import os
import math
import zlib
import binwalk.core.common
from binwalk.core.compat import *
from binwalk.core.module import Module, Option, Kwarg
class Entropy(Module):
XLABEL = 'Offset'
YLABEL = 'Entropy'
XUNITS = 'B'
YUNITS = 'E'
... | mit |
neiudemo1/django | tests/admin_scripts/tests.py | 87 | 92488 | # -*- coding: utf-8 -*-
"""
A series of tests to establish that the command-line management tools work as
advertised - especially with regards to the handling of the
DJANGO_SETTINGS_MODULE and default settings.py files.
"""
from __future__ import unicode_literals
import codecs
import os
import re
import shutil
import ... | bsd-3-clause |
ntt-sic/python-novaclient | novaclient/extension.py | 8 | 1395 | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
egoid/baytree | lib/python2.7/site-packages/django/contrib/syndication/views.py | 85 | 8763 | from __future__ import unicode_literals
from calendar import timegm
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.http import Http404, HttpResponse
from django.template import Templat... | mit |
flypy/flypy | flypy/runtime/obj/stringobject.py | 1 | 2309 | # -*- coding: utf-8 -*-
"""
String implementation.
"""
from __future__ import print_function, division, absolute_import
import flypy
from flypy import sjit, jit, typeof
from .bufferobject import Buffer, newbuffer, copyto
from .pointerobject import Pointer
@sjit
class String(object):
layout = [('buf', 'Buffer[ch... | bsd-2-clause |
mohclips/k5-ansible-modules | k5_inter_project_link.py | 1 | 9324 | #!/usr/bin/python
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'version': '1.0'}
DOCUMENTATION = '''
---
module: k5_inter_project_link
short_description: Create inter-project link on K5 in particular AZ
version_added: "1.0"
description:
- K5 call ... | gpl-3.0 |
Manojkumar91/odoo_inresto | addons/point_of_sale/wizard/__init__.py | 8 | 1133 | # -*- 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... | agpl-3.0 |
lpeancovschi/cocos2d-objc | tools/compatibility_with_0_8/generate_compat_file.py | 49 | 3489 |
import sys
import os
copyright = """
/*
* cocos2d for iPhone: http://www.cocos2d-iphone.org
*
* Copyright (c) 2008-2010 Ricardo Quesada
*
* 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 Soft... | mit |
mdzhang/goodreads-api-client-python | goodreads_api_client/resources/review.py | 1 | 1247 | # -*- coding: utf-8 -*-
"""Module containing review resource class."""
from goodreads_api_client.exceptions import OauthEndpointNotImplemented
from goodreads_api_client.resources.base import Resource
class Review(Resource):
resource_name = 'review'
def create(self):
raise OauthEndpointNotImplemented... | mit |
dongjoon-hyun/tensorflow | tensorflow/contrib/learn/python/learn/estimators/linear_test.py | 23 | 77821 | # 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 |
MikkCZ/kitsune | kitsune/sumo/tests/test_locale_middleware.py | 5 | 5940 | from django.conf import settings
import mock
from nose.tools import eq_
from kitsune.sumo.tests import TestCase
from kitsune.sumo.urlresolvers import get_best_language, get_non_supported
from kitsune.users.tests import UserFactory
class TestLocaleMiddleware(TestCase):
def test_default_redirect(self):
# ... | bsd-3-clause |
songmonit/CTTMSONLINE | addons/sales_team/__init__.py | 365 | 1081 | # -*- 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 |
resmo/ansible | lib/ansible/modules/cloud/vmware/vmware_object_role_permission.py | 23 | 9216 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, Derek Rushing <derek.rushing@geekops.com>
# Copyright: (c) 2018, VMware, Inc.
# SPDX-License-Identifier: GPL-3.0-or-later
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_impor... | gpl-3.0 |
jayceyxc/hue | desktop/core/ext-py/boto-2.42.0/boto/jsonresponse.py | 150 | 6032 | # Copyright (c) 2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# withou... | apache-2.0 |
ricotabor/opendrop | opendrop/app/ift/image_processing/services/image_processing.py | 2 | 3473 | # Copyright © 2020, Joseph Berry, Rico Tabor (opendrop.dev@gmail.com)
# OpenDrop is released under the GNU GPL License. You are free to
# modify and distribute the code, but always under the same license
# (i.e. you cannot make commercial derivatives).
#
# If you use this software in your research, please cite the foll... | gpl-2.0 |
piensa/geonode | geonode/people/models.py | 1 | 7186 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
apache/aurora | src/main/python/apache/aurora/client/api/sla.py | 8 | 12463 | #
# 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 writing, software
# distributed under ... | apache-2.0 |
yeleman/snisi | snisi_reprohealth/migrations/0003_auto_20141022_1400.py | 1 | 1402 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('snisi_reprohealth', '0002_auto_20141008_1709'),
]
operations = [
migrations.RenameField(
model_name='aggpfactivi... | mit |
sarantapichos/faircoop-market | addons/edi/models/edi.py | 277 | 31944 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011-2014 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
nikolay-saskovets/Feedly | feedly/tests/utils_test.py | 5 | 1930 | import unittest
from feedly.utils import chunks, warn_on_duplicate, make_list_unique,\
warn_on_error
from feedly.exceptions import DuplicateActivityException
from functools import partial
import mock
class ChunksTest(unittest.TestCase):
def test_chunks(self):
chunked = chunks(range(6), 2)
chu... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.