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 |
|---|---|---|---|---|---|
jjmachan/activityPointsApp | activitypoints/lib/python3.5/site-packages/django/contrib/postgres/fields/ranges.py | 109 | 6308 | import json
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange, Range
from django.contrib.postgres import forms, lookups
from django.db import models
from django.utils import six
from .utils import AttributeSetter
__all__ = [
'RangeField', 'IntegerRangeField', 'BigIntegerRangeField',
'Floa... | mit |
gdreich/geonode | geonode/contrib/metadataxsl/management/commands/addmissinglinks.py | 23 | 1771 | # -*- 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 |
konstruktoid/ansible-upstream | lib/ansible/modules/cloud/cloudstack/cs_vpn_connection.py | 35 | 10273 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': ... | gpl-3.0 |
thodrek/sampler | lib/gtest-1.7.0/test/gtest_uninitialized_test.py | 2901 | 2480 | #!/usr/bin/env python
#
# Copyright 2008, 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... | apache-2.0 |
nanolearningllc/edx-platform-cypress | common/test/acceptance/pages/studio/html_component_editor.py | 115 | 1139 | from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from component_editor import ComponentEditorView
class HtmlComponentEditorView(ComponentEditorView):
"""
Represents the rendered view of an HTML component editor.
"""
def set_content_and_sa... | agpl-3.0 |
atkinson/django-registration | registration/tests/__init__.py | 59 | 1347 | from django.test import TestCase
import registration
from registration.tests.backends import *
from registration.tests.forms import *
from registration.tests.models import *
from registration.tests.views import *
class RegistrationVersionInfoTests(TestCase):
"""
Test django-registration's internal version-r... | bsd-3-clause |
hengqujushi/shadowsocks | shadowsocks/crypto/table.py | 1044 | 8108 | # !/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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... | apache-2.0 |
hvy/chainer | examples/imagenet/resnet50.py | 3 | 4807 | # Original author: yasunorikudo
# (https://github.com/yasunorikudo/chainer-ResNet)
import chainer
import chainer.functions as F
from chainer import initializers
import chainer.links as L
class BottleNeckA(chainer.Chain):
def __init__(self, in_size, ch, out_size, stride=2, groups=1):
super(BottleNeckA, s... | mit |
7kbird/chrome | mojo/tools/generate_java_callback_interfaces.py | 32 | 1702 | """Generate the org.chromium.mojo.bindings.Callbacks interface"""
import argparse
import sys
CALLBACK_TEMPLATE = ("""
/**
* A generic %d-argument callback.
*
* %s
*/
interface Callback%d<%s> {
/**
* Call the callback.
*/
public void call(%s);
}
"... | bsd-3-clause |
NINAnor/QGIS | python/plugins/processing/algs/qgis/TextToFloat.py | 10 | 3230 | # -*- coding: utf-8 -*-
"""
***************************************************************************
TextToFloat.py
---------------------
Date : May 2010
Copyright : (C) 2010 by Michael Minn
Email : pyqgis at michaelminn dot com
*************************... | gpl-2.0 |
SebasSBM/django | tests/fixtures_model_package/tests.py | 312 | 2204 | from __future__ import unicode_literals
import warnings
from django.core import management
from django.test import TestCase
from .models import Article
class SampleTestCase(TestCase):
fixtures = ['fixture1.json', 'fixture2.json']
def testClassFixtures(self):
"Test cases can load fixture objects in... | bsd-3-clause |
admetricks/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/w3c/test_converter_unittest.py | 115 | 11612 | #!/usr/bin/env python
# Copyright (C) 2013 Adobe Systems Incorporated. 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 n... | bsd-3-clause |
CTSRD-SOAAP/chromium-42.0.2311.135 | third_party/pywebsocket/src/example/abort_wsh.py | 465 | 1776 | # 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... | bsd-3-clause |
ZdrowyGosciu/kernel_lge_d802_v30d | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
oinopion/django | django/core/serializers/__init__.py | 28 | 8194 | """
Interfaces for serializing Django objects.
Usage::
from django.core import serializers
json = serializers.serialize("json", some_queryset)
objects = list(serializers.deserialize("json", json))
To add your own serializers, use the SERIALIZATION_MODULES setting::
SERIALIZATION_MODULES = {
... | bsd-3-clause |
jerpat/csmake | csmake/CsmakeModules/copyright.py | 2 | 2470 | # <copyright>
# (c) Copyright 2017 Hewlett Packard Enterprise Development LP
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later ve... | gpl-3.0 |
amir343/ansible-modules-extras | network/f5/bigip_monitor_http.py | 77 | 15434 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, serge van Ginderachter <serge@vanginderachter.be>
# based on Matt Hite's bigip_pool module
# (c) 2013, Matt Hite <mhite@hotmail.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... | gpl-3.0 |
jocelynj/weboob | weboob/backends/aum/optim/queries_queue.py | 1 | 3223 | # -*- coding: utf-8 -*-
# Copyright(C) 2010 Romain Bignon
#
# 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, version 3 of the License.
#
# This program is distributed in the hope that it will b... | gpl-3.0 |
lydiadwyer/sheparddb | data/website/modules/Excavations/controller.py | 1 | 6315 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""The Controller class for Excavations."""
import re
from flask import Blueprint, render_template, redirect, url_for, current_app, \
request, abort
from modules.Shared.database import db
from modules.Countries.model import Country
from modules.Regions.model import Region
... | apache-2.0 |
ccrook/Quantum-GIS | python/plugins/processing/algs/gdal/roughness.py | 7 | 4403 | # -*- coding: utf-8 -*-
"""
***************************************************************************
roughness.py
---------------------
Date : October 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
***************... | gpl-2.0 |
SoftwareHeritage/swh-storage | swh/storage/tests/test_tenacious.py | 1 | 13693 | # Copyright (C) 2020-2021 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
from collections import Counter
from contextlib import contextmanager... | gpl-3.0 |
yoelk/kivy | kivy/tools/stub-gl-debug.py | 75 | 13278 | from __future__ import print_function
a = '''cdef void glActiveTexture (cgl.GLenum texture)
cdef void glAttachShader (cgl.GLuint program, cgl.GLuint shader)
cdef void glBindAttribLocation (cgl.GLuint program, cgl.GLuint index, cgl.GLchar* name)
cdef void glBindBuffer (cgl.GLenum target, cgl.GLuint buffer)
cde... | mit |
robinro/ansible | lib/ansible/modules/cloud/vmware/vmware_cluster.py | 33 | 9985 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.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 |
gylian/headphones | lib/html5lib/inputstream.py | 618 | 30855 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
from six.moves import http_client
import codecs
import re
from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase
from .constants import encodings, ReparseException
from . import utils
from io import String... | gpl-3.0 |
andixlm/android_kernel_samsung_galaxys2plus-common | tools/perf/python/twatch.py | 3213 | 1338 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
fjorba/invenio | modules/bibrank/web/admin/bibrankadmin.py | 25 | 7810 | ## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012 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... | gpl-2.0 |
aam-at/tensorflow | tensorflow/python/keras/tests/model_architectures_test.py | 7 | 3745 | # Copyright 2020 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 |
webgeodatavore/django | django/contrib/gis/db/backends/postgis/models.py | 396 | 2158 | """
The GeometryColumns and SpatialRefSys models for the PostGIS backend.
"""
from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class PostGISGeometryColumns(models.Model):
... | bsd-3-clause |
kvar/ansible | lib/ansible/modules/cloud/centurylink/clc_firewall_policy.py | 21 | 21405 | #!/usr/bin/python
#
# Copyright (c) 2015 CenturyLink
# 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',
'status': ['previe... | gpl-3.0 |
burtwalsh/mongo-connector | mongo-connector/mongo_connector.py | 7 | 18958 | # Copyright 2012 10gen, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0#
# Unless required by applicable law or agreed to in writing, softw... | apache-2.0 |
kimoonkim/spark | examples/src/main/python/ml/estimator_transformer_param_example.py | 123 | 3952 | #
# 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 |
patilav/citydash | server/parcel/migrations/0001_initial.py | 3 | 1719 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.contrib.gis.db.models.fields
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Parcel',
fields=[
... | mit |
dparlevliet/zelenka-report-storage | server-local/twisted/trial/_dist/worker.py | 35 | 9030 | # -*- test-case-name: twisted.trial._dist.test.test_worker -*-
#
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This module implements the worker classes.
@since: 12.3
"""
import os
from zope.interface import implements
from twisted.internet.protocol import ProcessProtocol
from twisted... | lgpl-3.0 |
afandria/sky_engine | sky/engine/build/scripts/in_file.py | 27 | 6635 | # Copyright (C) 2013 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 ... | bsd-3-clause |
junmin-zhu/chromium-rivertrail | tools/chrome_remote_control/chrome_remote_control/browser_options_unittest.py | 3 | 2400 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from chrome_remote_control import browser_options
class BrowserOptionsTest(unittest.TestCase):
def testDefaults(self):
options = b... | bsd-3-clause |
HackBulgaria/Odin | students/south_migrations/0021_auto__chg_field_checkin_date__add_unique_checkin_student_date.py | 1 | 9304 | # -*- 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):
# Changing field 'CheckIn.date'
db.alter_column(u'students_checkin', 'da... | agpl-3.0 |
renyi533/tensorflow | tensorflow/python/kernel_tests/constant_op_eager_test.py | 33 | 21448 | # 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 |
Gravecorp/Gap | Gap/Lib/distutils/spawn.py | 72 | 6467 | """distutils.spawn
Provides the 'spawn()' function, a front-end to various platform-
specific functions for launching another program in a sub-process.
Also provides the 'find_executable()' to search the path for a given
executable name.
"""
__revision__ = "$Id$"
import sys
import os
from distutils.errors import Di... | mpl-2.0 |
wfxiang08/Nuitka | nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Scanner/IDL.py | 6 | 1807 | """SCons.Scanner.IDL
This module implements the depenency scanner for IDL (Interface
Definition Language) files.
"""
#
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Softwa... | apache-2.0 |
zverevalexei/trex-http-proxy | trex_client/external_libs/pyzmq-14.5.0/python3/fedora18/64bit/zmq/eventloop/minitornado/util.py | 29 | 6226 | """Miscellaneous utility functions and classes.
This module is used internally by Tornado. It is not necessarily expected
that the functions and classes defined here will be useful to other
applications, but they are documented here in case they are.
The one public-facing part of this module is the `Configurable` cl... | mit |
Godiyos/python-for-android | python-modules/twisted/twisted/test/test_paths.py | 49 | 47338 | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases covering L{twisted.python.filepath} and L{twisted.python.zippath}.
"""
import os, time, pickle, errno, zipfile, stat
from twisted.python.compat import set
from twisted.python.win32 import WindowsError, ERROR_DIRECTORY
fr... | apache-2.0 |
Elektropippo/kernel_852i | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... | gpl-2.0 |
lmazuel/ansible | lib/ansible/modules/source_control/github_issue.py | 41 | 3583 | #!/usr/bin/python
# (c) 2017, Abhijeet Kasurde <akasurde@redhat.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your ... | gpl-3.0 |
p0psicles/SickGear | lib/html5lib/filters/optionaltags.py | 1727 | 10500 | 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... | gpl-3.0 |
shssoichiro/servo | tests/wpt/harness/wptrunner/update/sync.py | 40 | 6328 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import shutil
import sys
import uuid
from .. import testloader
from base import Step, StepRunner
from tree i... | mpl-2.0 |
m1093782566/openstack_org_ceilometer | ceilometer/tests/alarm/test_rpc.py | 6 | 9121 | #
# Copyright 2013-2014 eNovance <licensing@enovance.com>
#
# Authors: Mehdi Abaakouk <mehdi.abaakouk@enovance.com>
#
# 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.... | apache-2.0 |
hryamzik/ansible | test/units/parsing/vault/test_vault_editor.py | 59 | 21955 | # (c) 2014, James Tanner <tanner.jc@gmail.com>
# (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 ... | gpl-3.0 |
alrifqi/django | django/conf/locale/pt_BR/formats.py | 504 | 1434 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FORMAT = '... | bsd-3-clause |
sebrandon1/nova | nova/objects/network.py | 10 | 9382 | # Copyright 2014 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 required by applicable law or a... | apache-2.0 |
sbidoul/odoo | addons/hw_escpos/controllers/main.py | 89 | 14633 | # -*- coding: utf-8 -*-
import commands
import logging
import simplejson
import os
import os.path
import io
import base64
import openerp
import time
import random
import math
import md5
import openerp.addons.hw_proxy.controllers.main as hw_proxy
import pickle
import re
import subprocess
import traceback
try:
from... | agpl-3.0 |
formiano/enigma2 | lib/python/Components/Converter/DRRefString.py | 3 | 1790 | # Embedded file name: /usr/lib/enigma2/python/Components/Converter/DRRefString.py
from Components.Converter.Converter import Converter
from Components.Element import cached
from Screens.InfoBar import InfoBar
class DRRefString(Converter, object):
CURRENT = 0
EVENT = 1
def __init__(self, type):
... | gpl-2.0 |
Elandril/Sick-Beard | lib/hachoir_parser/misc/ttf.py | 90 | 9433 | """
TrueType Font parser.
Documents:
- "An Introduction to TrueType Fonts: A look inside the TTF format"
written by "NRSI: Computers & Writing Systems"
http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=IWS-Chapter08
Author: Victor Stinner
Creation date: 2007-02-08
"""
from lib.hachoir_parser im... | gpl-3.0 |
fafaman/django | django/contrib/sessions/middleware.py | 256 | 2658 | import time
from importlib import import_module
from django.conf import settings
from django.utils.cache import patch_vary_headers
from django.utils.http import cookie_date
class SessionMiddleware(object):
def __init__(self):
engine = import_module(settings.SESSION_ENGINE)
self.SessionStore = eng... | bsd-3-clause |
Mozu/mozu-python-sdk | test/functional_test/security_test/userauthenticator_test.py | 2 | 1389 | import unittest
from mozurestsdk import mozuclient;
from mozurestsdk.security.userauthenticator import UserAuthenticator;
from mozurestsdk import util;
class UserAuthenticator_Test(unittest.TestCase):
def setUp(self):
self.config = util.readConfigFile("c:\projects\mozuconfig.txt");
mozuclient.configure(config="c... | apache-2.0 |
haakenlid/django-extensions | tests/test_models.py | 4 | 1590 | # -*- coding: utf-8 -*-
from django.test import TestCase
from django_extensions.db.models import ActivatorModel
from .testapp.models import Post
class ActivatorModelTestCase(TestCase):
def test_active_includes_active(self):
post = Post.objects.create(status=ActivatorModel.ACTIVE_STATUS)
active =... | mit |
zulip/django | tests/bash_completion/tests.py | 327 | 3888 | """
A series of tests to establish that the command-line bash completion works.
"""
import os
import sys
import unittest
from django.apps import apps
from django.core.management import ManagementUtility
from django.test.utils import captured_stdout
class BashCompletionTests(unittest.TestCase):
"""
Testing th... | bsd-3-clause |
kdart/pycopia | process/pycopia/netcat.py | 1 | 2424 | #!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 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 |
aroegies/trecrts-tools | trecrts-clients/python/dumb-topic-client/topic_client.py | 2 | 1800 | from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
import requests
import json
import argparse
cred_file = "oauth_tokens.txt"
hostname = ""
port = ""
clientid = ""
topics = dict()
api_base = ""
class TopicListener(StreamListener):
def on_status(self,status):
f... | apache-2.0 |
juanmont/one | .vscode/extensions/tht13.rst-vscode-2.0.0/src/python/docutils/parsers/rst/languages/af.py | 128 | 3677 | # $Id: af.py 7119 2011-09-02 13:00:23Z milde $
# Author: Jannie Hofmeyr <jhsh@sun.ac.za>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated for ... | apache-2.0 |
vponomaryov/manila | manila/share/drivers/maprfs/driver_util.py | 1 | 13677 | # Copyright (c) 2016, MapR Technologies
# 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 re... | apache-2.0 |
wylwang/vnpy | archive/demo/ltsdemo/lts_data_type.py | 167 | 86932 | # encoding: UTF-8
defineDict = {}
typedefDict = {}
#//////////////////////////////////////////////////////////////////////
#@company shanghai liber information Technology Co.,Ltd
#@file SecurityFtdcUserApiDataType.h
#@brief 定义业务数据类型
#//////////////////////////////////////////////////////////////////////
#/////////... | mit |
leasual/TeamTalk | win-client/3rdParty/src/json/scons-tools/targz.py | 264 | 3055 | """tarball
Tool-specific initialization for tarball.
"""
## Commands to tackle a command based implementation:
##to unpack on the fly...
##gunzip < FILE.tar.gz | tar xvf -
##to pack on the fly...
##tar cvf - FILE-LIST | gzip -c > FILE.tar.gz
import os.path
import SCons.Builder
import SCons.Node.FS
import SCons.Ut... | apache-2.0 |
computersalat/ansible | test/support/integration/plugins/modules/postgresql_set.py | 47 | 13648 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru>
# 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 = {... | gpl-3.0 |
Carlstark/SAMA5D4-XULT | linux-at91-linux-3.10/tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
gdw2/zim | zim/plugins/scoreeditor.py | 1 | 4552 | # -*- coding: utf-8 -*-
#
# scoreeditor.py
#
# This is a plugin for Zim, which allows to insert music score in zim using
# GNU Lilypond.
#
#
# Author: Shoban Preeth <shoban.preeth@gmail.com>
# Date: 2012-07-05
# Copyright (c) 2012, released under the GNU GPL v2 or higher
#
#
import glob
from zim.plugins.base.imagegen... | gpl-2.0 |
Rona111/sale-workflow | sale_quotation_sourcing/tests/__init__.py | 34 | 1037 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publi... | agpl-3.0 |
tommybobbins/Raspi_433 | Python/quick_433.py | 1 | 2225 | #!/usr/bin/python
import time
# Written tng@chegwin.org 3-Jul-2014
# Python runs slower than C, so 18.9 factor below becomes 16.9 (microseconds)
sample_length=15.6/1000000.0
# Setup Pin 18 as output (Pin 12 in Pi numbering)
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.OUT)
#Calculate our on/offs ... | gpl-2.0 |
handspring/bite-project | deps/gdata-python-client/src/gdata/Crypto/PublicKey/qNEW.py | 228 | 5545 | #
# qNEW.py : The q-NEW signature algorithm.
#
# Part of the Python Cryptography Toolkit
#
# Distribute and use freely; there are no restrictions on further
# dissemination and usage except those imposed by the laws of your
# country of residence. This software is provided "as is" without
# warranty of fitness fo... | apache-2.0 |
rcbops/keystone-buildpackage | keystone/logic/types/tenant.py | 3 | 6014 | # Copyright (c) 2010-2011 OpenStack, 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 ... | apache-2.0 |
riteshshrv/django | django/core/files/utils.py | 395 | 1338 | from django.utils import six
class FileProxyMixin(object):
"""
A mixin class used to forward file methods to an underlaying file
object. The internal file object has to be called "file"::
class FileProxy(FileProxyMixin):
def __init__(self, file):
self.file = file
... | bsd-3-clause |
taotie12010/bigfour | common/djangoapps/embargo/migrations/0003_add_countries.py | 102 | 6889 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from django_countries import countries
class Migration(DataMigration):
def forwards(self, orm):
"""Populate the available countries with all 2-character ISO country codes. """
... | agpl-3.0 |
jawed123/django-stripe-payments | payments/models.py | 4 | 33811 | import datetime
import decimal
import json
import traceback
import six
from django.conf import settings
from django.core.mail import EmailMessage
from django.db import models
from django.utils import timezone
from django.utils.encoding import smart_str
from django.template.loader import render_to_string
from django.c... | mit |
NoXPhasma/systemd | tools/make-directive-index.py | 86 | 10995 | # -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
#
# This file is part of systemd.
#
# Copyright 2012-2013 Zbigniew Jędrzejewski-Szmek
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Softwar... | gpl-2.0 |
nysan/yocto-autobuilder | lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-linux-x86_64.egg/sqlalchemy/sql/compiler.py | 8 | 65515 | # sql/compiler.py
# Copyright (C) 2005-2011 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Base SQL and DDL compiler implementations.
Classes provided include:
:class:`~sql... | gpl-2.0 |
Murdius/GW2Snapshot | app/views.py | 1 | 1917 | import urllib
from flask import render_template, request, session
from flask_restful import Resource
from app import app, api
from bank import get_bank
from inventory import *
from material import *
from sharedInventory import get_shared_inventory
from wallet import *
@app.route('/')
@app.route('/index')
def index(... | gpl-3.0 |
ykim306/ud851-Exercises | flatten.py | 35 | 4312 | #! /usr/local/bin/python
import argparse
import os
import shutil
import sys
import tempfile
import git
IGNORE_PATTERNS = ('.git', ".DS_Store")
SAFE_CHARS = ["-", "_", "."]
MAX_LENGTH = 100
STUDENT = "student"
DEVELOP = "develop-"
DEVELOP_DEFAULT = "all develop branches"
def flatten(repo_dir, target_dir, student... | apache-2.0 |
zasdfgbnm/tensorflow | tensorflow/contrib/learn/python/learn/utils/inspect_checkpoint.py | 123 | 2686 | # 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 |
lefnire/tensorforce | tensorforce/models/dpg_target_model.py | 1 | 14627 | # Copyright 2017 reinforce.io. 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 applicable law or... | apache-2.0 |
tectronics/gsiege | guadaboard/human_game_handler.py | 3 | 7167 | # -*- coding: utf-8 -*-
###############################################################################
# This file is part of Resistencia Cadiz 1812. #
# #
# This program is free software: you can redistribute it... | gpl-3.0 |
hortonworks/hortonworks-sandbox | desktop/core/ext-py/Django-1.2.3/django/core/management/commands/flush.py | 52 | 3433 | from optparse import make_option
from django.conf import settings
from django.db import connections, router, transaction, models, DEFAULT_DB_ALIAS
from django.core.management import call_command
from django.core.management.base import NoArgsCommand, CommandError
from django.core.management.color import no_style
from d... | apache-2.0 |
qingwen220/eagle | eagle-external/hadoop_jmx_collector/lib/kafka-python/kafka/consumer/simple.py | 18 | 12765 | from __future__ import absolute_import
try:
from itertools import zip_longest as izip_longest, repeat # pylint: disable-msg=E0611
except ImportError: # python 2
from itertools import izip_longest as izip_longest, repeat
import logging
import time
import six
try:
from Queue import Empty, Queue
except Im... | apache-2.0 |
hetica/webeni | main/views.py | 1 | 2128 | # -*- coding: utf-8 -*-
from django.shortcuts import render
from django.utils.encoding import smart_unicode
import sys, os, locale
from datetime import datetime, timedelta
from main.forms import StagiaireForms
# Create your views here.
def home(request):
# CISCO
# Ajouter au path
_path = os.path.dirname(os.path... | lgpl-3.0 |
deanhiller/databus | webapp/play1.3.x/python/Lib/Queue.py | 8 | 8818 | """A multi-producer, multi-consumer queue."""
from time import time as _time
from collections import deque
import heapq
__all__ = ['Empty', 'Full', 'Queue', 'PriorityQueue', 'LifoQueue']
class Empty(Exception):
"Exception raised by Queue.get(block=0)/get_nowait()."
pass
class Full(Exception):
... | mpl-2.0 |
andela-mfalade/python-pandas-csv-records-analysis | scripts/processor.py | 1 | 5798 | """Initiate file analysis.
This module is used to find the discrepancies between two given files
"""
import argparse
import csv
import logging
import pandas as pd
logger = logging.getLogger(__file__)
logging.basicConfig(level=logging.DEBUG)
mathching_records_path = 'matching_records.csv'
non_mathching_records_path... | mit |
Ichag/odoo | addons/account/report/account_print_overdue.py | 380 | 3907 | # -*- 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 |
toshywoshy/ansible | lib/ansible/modules/clustering/k8s/k8s_auth.py | 26 | 11386 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2018, KubeVirt Team <@kubevirt>
# 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 |
AMObox/teammaniac | plugin.program.maniac/plugintools.py | 37 | 16974 | # -*- coding: utf-8 -*-
#---------------------------------------------------------------------------
# Plugin Tools v1.0.8
#---------------------------------------------------------------------------
# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)
# Based on code from youtube, parsedom and pelisalacarta addon... | gpl-2.0 |
kadircet/CENG | 783/HW3/cs231n/classifiers/rnn.py | 1 | 14153 | import numpy as np
from cs231n.layers import *
from cs231n.rnn_layers import *
class CaptioningRNN(object):
"""
A CaptioningRNN produces captions from image features using a recurrent
neural network.
The RNN receives input vectors of size D, has a vocab size of V, works on
sequences of length T, has an RN... | gpl-3.0 |
stevezilla/u-boot-amherst | tools/buildman/kconfiglib.py | 13 | 139461 | #
# SPDX-License-Identifier: ISC
#
# Author: Ulf Magnusson
# https://github.com/ulfalizer/Kconfiglib
# This is Kconfiglib, a Python library for scripting, debugging, and extracting
# information from Kconfig-based configuration systems. To view the
# documentation, run
#
# $ pydoc kconfiglib
#
# or, if you prefer H... | gpl-2.0 |
onesfreedom/pybuilder | src/unittest/python/plugins/python/cram_plugin_tests.py | 7 | 8281 | # -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2015 PyBuilder Team
#
# 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/l... | apache-2.0 |
dbckz/ansible | test/units/modules/network/ios/test_ios_system.py | 59 | 5262 | #
# (c) 2016 Red Hat Inc.
#
# 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 d... | gpl-3.0 |
tony/kivy | examples/widgets/codeinput.py | 21 | 7046 | from kivy.app import App
from kivy.extras.highlight import KivyLexer
from kivy.uix.spinner import Spinner, SpinnerOption
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.codeinput import CodeInput
from kivy.uix.behaviors import EmacsBehavior
from kivy.uix.popup import Popup
from kivy.properties import ListPropert... | mit |
yyjiang/scikit-learn | sklearn/neighbors/tests/test_kd_tree.py | 129 | 7848 | import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.neighbors.kd_tree import (KDTree, NeighborsHeap,
simultaneous_sort, kernel_norm,
nodeheap_sort, DTYPE, ITYPE)
from sklearn.neighbors.dist_metrics import Dista... | bsd-3-clause |
HailStorm32/Q.bo_stacks | qbo_webi/src/teleoperation/sip2rtmp/p2p-sip/src/std/rfc4566.py | 4 | 7850 | # Copyright (c) 2007, Kundan Singh. All rights reserved. See LICENSING for details.
# @implements RFC4566 (SDP)
import socket, time
class attrs(object):
'''A generic class that allows uniformly accessing the attribute and items,
and returns None for invalid attribute instead of throwing an acception.''... | lgpl-2.1 |
felipenaselva/repo.felipe | plugin.video.superlistamilton/playtvfr.py | 297 | 8750 | import struct
import urllib2,urllib
import re
import json
import math
CRYPT_XXTEA_DELTA= 0x9E3779B9
headers = [('Accept','text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'),( 'Connection','Keep-Alive')]
class Crypt_XXTEA:
_key=None
def setKey(self,key):
if isinstance(key, basestring):
... | gpl-2.0 |
byshen/pyspider | pyspider/libs/beanstalk.py | 58 | 3652 | #!/usr/bin/env python
# coding:utf-8
"""beanstalk queue - queue based on beanstalk
Setting: you need to set max-job-size bigger(default 65535)
DAEMON_OPTS="-l $BEANSTALKD_LISTEN_ADDR -p $BEANSTALKD_LISTEN_PORT -z 524288"
"""
import time
import umsgpack
import beanstalkc
import threading
import logging
from six.move... | apache-2.0 |
apocquet/django | tests/template_tests/syntax_tests/test_filter_tag.py | 521 | 1795 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class FilterTagTests(SimpleTestCase):
@setup({'filter01': '{% filter upper %}{% endfilter %}'})
def test_filter01(self):
output = self.engine.render_to_string('filter01')
self.ass... | bsd-3-clause |
x303597316/hue | desktop/core/ext-py/Django-1.6.10/tests/comment_tests/tests/test_templatetags.py | 53 | 8243 | from __future__ import absolute_import
from django.contrib.comments.forms import CommentForm
from django.contrib.comments.models import Comment
from django.contrib.contenttypes.models import ContentType
from django.template import Template, Context, Library, libraries
from ..models import Article, Author
from . impor... | apache-2.0 |
CoDEmanX/ArangoDB | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/pythonwin/pywin/idle/FormatParagraph.py | 20 | 5735 | # Extension to format a paragraph
# Does basic, standard text formatting, and also understands Python
# comment blocks. Thus, for editing Python source code, this
# extension is really only suitable for reformatting these comment
# blocks or triple-quoted strings.
# Known problems with comment reformatting:
# * If t... | apache-2.0 |
40223125/2015cd_midterm | static/Brython3.1.0-20150301-090019/Lib/xml/sax/__init__.py | 637 | 3505 | """Simple API for XML (SAX) implementation for Python.
This module provides an implementation of the SAX 2 interface;
information about the Java version of the interface can be found at
http://www.megginson.com/SAX/. The Python version of the interface is
documented at <...>.
This package contains the following modu... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.