repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
johankaito/fufuka | microblog/venv/lib/python2.7/site-packages/requests/packages/urllib3/packages/six.py | 2375 | 11628 | """Utilities for writing code that runs on Python 2 and 3"""
#Copyright (c) 2010-2011 Benjamin Peterson
#Permission is hereby granted, free of charge, to any person obtaining a copy of
#this software and associated documentation files (the "Software"), to deal in
#the Software without restriction, including without l... | apache-2.0 |
elemel/tics | lib/tics/image.py | 1 | 3627 | # Copyright (c) 2009 Mikael Lind
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distr... | mit |
yxwzaxns/cowry | server/core/utils.py | 1 | 4227 | """functions helper."""
from ast import literal_eval
import base64
import os
import hashlib
import random
import uuid
import time
import shutil
import re
import socket
import _thread
import OpenSSL
import redis
def addAppPath(path):
"""Add a path to sys path."""
os.sys.path.append(path)
def getCwd():
""... | mit |
xorpaul/check_mk | web/plugins/userdb/user_attributes.py | 6 | 3483 | #!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | gpl-2.0 |
quarkslab/irma | probe/modules/antivirus/bitdefender/bitdefender.py | 1 | 2967 | #
# Copyright (c) 2013-2018 Quarkslab.
# This file is part of IRMA project.
#
# 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 in the top-level directory
# of this distribution and at:
#
# http:... | apache-2.0 |
shankar1093/Graphics | mrdoob-three.js-1f968fe/utils/converters/obj/split_obj.py | 369 | 12687 | """Split single OBJ model into mutliple OBJ files by materials
-------------------------------------
How to use
-------------------------------------
python split_obj.py -i infile.obj -o outfile
Will generate:
outfile_000.obj
outfile_001.obj
...
outfile_XXX.obj
-------------------------------------
Parser based ... | mit |
xin3liang/platform_external_chromium_org_third_party_WebKit | Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/util.py | 497 | 13858 | # Copyright 2011, 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 |
ludo237/euler-problems | Problems/Problem 32/Python/problem_32.py | 1 | 1427 | '''
Problem 32 from Project Euler
We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once; for example, the 5-digit number, 15234, is 1 through 5 pandigital.
The product 7254 is unusual, as the identity, 39 * 186 = 7254, containing multiplicand, multiplier, and product i... | gpl-2.0 |
multikatt/CouchPotatoServer | libs/tornado/iostream.py | 63 | 60393 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | gpl-3.0 |
wemanuel/smry | server-auth/ls/google-cloud-sdk/lib/googlecloudsdk/gcloud/sdktools/components/__init__.py | 4 | 4163 | # Copyright 2013 Google Inc. All Rights Reserved.
"""The super-group for the update manager."""
import argparse
import os
import textwrap
from googlecloudsdk.core.util import platforms
from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.core import config
from... | apache-2.0 |
freedomsponsors/www.freedomsponsors.org | djangoproject/bitcoin_frespo/models.py | 4 | 1943 | from django.db import models
from django.utils import timezone
class ReceiveAddress(models.Model):
address = models.CharField(max_length=128, blank=True)
available = models.BooleanField(default=True)
@classmethod
def newAddress(cls, address):
receive_address = cls()
receive_address.add... | agpl-3.0 |
Mistobaan/tensorflow | tensorflow/python/data/ops/readers.py | 8 | 6071 | # 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 |
deepsrijit1105/edx-platform | lms/djangoapps/courseware/tests/test_user_state_client.py | 33 | 2125 | """
Black-box tests of the DjangoUserStateClient against the semantics
defined in edx_user_state_client.
"""
from collections import defaultdict
from unittest import skip
from django.test import TestCase
from edx_user_state_client.tests import UserStateClientTestBase
from courseware.user_state_client import DjangoXB... | agpl-3.0 |
koven2049/hdfs-cloudera-cdh3u3-production | contrib/hod/testing/testHod.py | 182 | 14428 | #Licensed to the Apache Software Foundation (ASF) under one
#or more contributor license agreements. See the NOTICE file
#distributed with this work for additional information
#regarding copyright ownership. The ASF licenses this file
#to you under the Apache License, Version 2.0 (the
#"License"); you may not use thi... | apache-2.0 |
yashodhank/frappe | frappe/utils/response.py | 8 | 5467 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import json
import datetime
import mimetypes
import os
import frappe
from frappe import _
import frappe.model.document
import frappe.utils
import frappe.sessions
import werkzeug.u... | mit |
double12gzh/nova | nova/tests/unit/scheduler/filters/test_affinity_filters.py | 56 | 8801 | # 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
# d... | apache-2.0 |
dpgeorge/micropython | tests/basics/memoryview1.py | 12 | 1687 | # test memoryview
try:
memoryview
except:
print("SKIP")
raise SystemExit
try:
import uarray as array
except ImportError:
try:
import array
except ImportError:
print("SKIP")
raise SystemExit
# test reading from bytes
b = b'1234'
m = memoryview(b)
print(len(m))
print(m[0],... | mit |
rcharp/toyota-flask | numpy/numpy/fft/info.py | 68 | 6882 | """
Discrete Fourier Transform (:mod:`numpy.fft`)
=============================================
.. currentmodule:: numpy.fft
Standard FFTs
-------------
.. autosummary::
:toctree: generated/
fft Discrete Fourier transform.
ifft Inverse discrete Fourier transform.
fft2 Discrete Fourier tr... | apache-2.0 |
LiaoPan/scikit-learn | examples/exercises/plot_iris_exercise.py | 323 | 1602 | """
================================
SVM Exercise
================================
A tutorial exercise for using different SVM kernels.
This exercise is used in the :ref:`using_kernels_tut` part of the
:ref:`supervised_learning_tut` section of the :ref:`stat_learn_tut_index`.
"""
print(__doc__)
import numpy as np
i... | bsd-3-clause |
CryptoManiac/eloipool-scrypt | gmp-proxy.py | 18 | 3584 | #!/usr/bin/python3
import logging
logging.basicConfig(level=logging.DEBUG)
from binascii import b2a_hex
import bitcoin.txn
import bitcoin.varlen
import jsonrpc
import jsonrpcserver
import jsonrpc_getwork
import merkletree
import socket
from struct import pack
import sys
import threading
from time import time
from uti... | agpl-3.0 |
gangadhar-kadam/mic-erpnext | selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py | 3 | 5527 | # ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# 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 yo... | agpl-3.0 |
rkashapov/buildbot | master/buildbot/test/unit/test_scripts_base.py | 9 | 15290 | # This file is part of Buildbot. Buildbot 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 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
spnow/grr | client/client_actions/plist_test.py | 5 | 4349 | #!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
# Copyright 2010 Google Inc. All Rights Reserved.
"""Tests for grr.client.client_actions.plist."""
import os
# pylint: disable=unused-import
from grr.client import client_plugins
# pylint: enable=unused-import
from grr.client import vfs
from grr.lib ... | apache-2.0 |
naoyat/latin | lda_demo.py | 1 | 7117 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from gensim import corpora, models, similarities #, ldamodel
import sys
import re
import latin.ansi_color as ansi_color
import latin.textutil as textutil
import latin.latin_char as char
import latin.latindic as latindic
import latin.util as util
from latin.LatinObject im... | mit |
toontownfunserver/Panda3D-1.9.0 | python/Lib/binhex.py | 216 | 14476 | """Macintosh binhex compression/decompression.
easy interface:
binhex(inputfilename, outputfilename)
hexbin(inputfilename, outputfilename)
"""
#
# Jack Jansen, CWI, August 1995.
#
# The module is supposed to be as compatible as possible. Especially the
# easy interface should work "as expected" on any platform.
# XXX... | bsd-3-clause |
thumbimigwe/golber | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/shell.py | 287 | 15340 | # -*- coding: utf-8 -*-
"""
pygments.lexers.shell
~~~~~~~~~~~~~~~~~~~~~
Lexers for various shells.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, do_insertions, bygroups, inclu... | mit |
tiagochiavericosta/edx-platform | lms/djangoapps/dashboard/tests/test_sysadmin.py | 83 | 23866 | """
Provide tests for sysadmin dashboard feature in sysadmin.py
"""
import glob
import os
import re
import shutil
import unittest
from util.date_utils import get_time_display, DEFAULT_DATE_TIME_FORMAT
from nose.plugins.attrib import attr
from django.conf import settings
from django.contrib.auth.hashers import check_pa... | agpl-3.0 |
factorlibre/OCB | openerp/modules/loading.py | 7 | 21284 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
Houzz/luigi | luigi/contrib/scalding.py | 26 | 10702 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | apache-2.0 |
seppi91/CouchPotatoServer | libs/suds/plugin.py | 196 | 7228 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | gpl-3.0 |
eharney/nova | nova/virt/xenapi/network_utils.py | 5 | 1951 | # Copyright (c) 2010 Citrix Systems, 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 |
onyxfish/stovetop | atom/data.py | 19 | 8122 | #!/usr/bin/env python
#
# Copyright (C) 2009 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 ... | mit |
oliverhr/odoo | addons/sale_service/__openerp__.py | 260 | 2447 | # -*- 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 |
erjohnso/ansible | lib/ansible/modules/packaging/os/package.py | 26 | 1892 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, 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 |
eloquence/unisubs | apps/videos/migrations/0071_auto.py | 5 | 17079 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding M2M table for field followers on 'SubtitleLanguage'
db.create_table('videos_subtitlelanguage_... | agpl-3.0 |
sergeScherbakov/bgfx | 3rdparty/scintilla/scripts/ScintillaData.py | 69 | 8599 | # ScintillaData.py - implemented 2013 by Neil Hodgson neilh@scintilla.org
# Released to the public domain.
# Common code used by Scintilla and SciTE for source file regeneration.
# The ScintillaData object exposes information about Scintilla as properties:
# Version properties
# version
# versionDotted
# v... | bsd-2-clause |
soarpenguin/ansible | lib/ansible/modules/cloud/openstack/os_nova_host_aggregate.py | 72 | 6745 | #!/usr/bin/python
# Copyright 2016 Jakub Jursa <jakub.jursa1@gmail.com>
#
# This module 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 |
johnnovak/twyg | twyg/tests/css3colors_test.py | 1 | 4379 | import os, sys, unittest
sys.path.append(os.path.join('..'))
from twyg.css3colors import color_to_rgba, rgba_to_color
class TestCSS3Colors(unittest.TestCase):
def test_valid(self):
r, g, b, a = color_to_rgba('aquamarine')
c = rgba_to_color(r, g, b, a, format='rgb')
self.as... | mit |
js0701/chromium-crosswalk | tools/generate_library_loader/generate_library_loader.py | 79 | 7149 | #!/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.
"""
Creates a library loader (a header and implementation file),
which is a wrapper for dlopen or direct linking with given library... | bsd-3-clause |
Learningtribes/edx-platform | cms/djangoapps/contentstore/management/commands/cleanup_assets.py | 204 | 1226 | """
Script for removing all redundant Mac OS metadata files (with filename ".DS_Store"
or with filename which starts with "._") for all courses
"""
import logging
from django.core.management.base import BaseCommand
from xmodule.contentstore.django import contentstore
log = logging.getLogger(__name__)
class Command... | agpl-3.0 |
AngeliaGong/AngeliaGong.github.io | node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py | 1812 | 9537 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions shared amongst the Windows generators."""
import copy
import os
# A dictionary mapping supported target types to extensions.
TARGET_TYPE_EX... | mit |
LaetitiaPapaxanthos/UnionCom | train.py | 1 | 4021 | import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import random
import sys
from PrimeDual import *
from utils import save_model
import torch.backends.cudnn as cudnn
cudnn.benchmark = True
def train(Project, params, dataset, dist, P_joint... | mit |
arpitparmar5739/youtube-dl | youtube_dl/extractor/vine.py | 95 | 4636 | from __future__ import unicode_literals
import re
import itertools
from .common import InfoExtractor
from ..utils import unified_strdate
class VineIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?vine\.co/(?:v|oembed)/(?P<id>\w+)'
_TESTS = [{
'url': 'https://vine.co/v/b9KOOWX7HUx',
'md5'... | unlicense |
gitenberg-dev/pg-epubmaker | epubmaker/mydocutils/gutenberg/writers/nroff.py | 1 | 6333 | # -*- coding: utf-8 -*-
# $Id: manpage.py 6270 2010-03-18 22:32:09Z milde $
# Author: Engelbert Gruber <grubert@users.sourceforge.net>
# Copyright: This module is put into the public domain.
# Rewritten almost completely
# by Marcello Perathoner <marcello@perathoner.de>
"""
Nroff writer for reStructuredText. Tweaked ... | gpl-3.0 |
rajadhva/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/example/abort_handshake_wsh.py | 465 | 1781 | # 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 |
windyuuy/opera | chromium/src/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/abstractsequencedcommand.py | 4 | 2380 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... | bsd-3-clause |
qutip/qutip-benchmark | continuous-benchmark/benchmarks/mesolve_8spin.py | 1 | 2364 | #
# qutip benchmark: mesolve 8 spin chain
#
import time
try:
from numpy import *
from qutip import *
except:
print("nan")
import sys
sys.exit(1)
def benchmark(runs=1):
"""
mesolver evolution of 8-spin chain
"""
test_name='8-spin ME [256]'
N = 8# number of spins
# uniform pa... | bsd-3-clause |
LudditeLabs/query-reform | data/samples/Python/2.py | 1 | 9902 | #!/usr/bin/env python
# encoding: utf-8
# The benchmark is distributed under the Creative Commons,
# Attribution-NonCommercial-NoDerivatives. This license includes the benchmark database
# and its derivatives. For attribution, please cite this page, and our publications below.
# This data is provided free of charge fo... | apache-2.0 |
kaostao/sx | src/obelisk/client.py | 2 | 6958 | import struct
from decimal import Decimal
from twisted.internet import reactor
from zmqbase import ClientBase
import bitcoin
import models
import serialize
import error_code
def unpack_error(data):
value = struct.unpack_from('<I', data, 0)[0]
return error_code.error_code.name_from_id(value)
def pack_block_... | agpl-3.0 |
a-doumoulakis/tensorflow | tensorflow/contrib/rnn/python/ops/core_rnn_cell.py | 39 | 8591 | # 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 |
gavin-feng/odoo | addons/stock_account/__init__.py | 384 | 1060 | # -*- 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 |
RachaelT/UTDchess-RospyXbee | src/scripts/cmd_vel_listener.py | 1 | 4756 | #!/usr/bin/env python
import sys
import rospy
import serial
import struct
import binascii
import time
from teleop_twist_keyboard.msg import Command
from xbee import ZigBee
xbee = None
XBEE_ADDR_LONG = '\x00\x13\xA2\x00\x40\x86\x96\x4F'
XBEE_ADDR_SHORT = '\xFF\xFE'
DEVICE = '/dev/tty.usbserial-A603HA9K'
#Each bot will... | mit |
PlanTool/plantool | wrappingPlanners/Deterministic/LAMA/planning-lama(finished)/translate/search.py | 4 | 2619 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.8
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2, 6, 0):
def swig_import_helper():
from os.path imp... | gpl-2.0 |
nickster5001/ctracker | flask/lib/python3.4/site-packages/pip/_vendor/html5lib/ihatexml.py | 1727 | 16581 | from __future__ import absolute_import, division, unicode_literals
import re
import warnings
from .constants import DataLossWarning
baseChar = """
[#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] |
[#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] |
[#x014A-#x017E] | [#x0180-... | mit |
jokimies/django-pj-portfolio | portfolio/forms.py | 1 | 1749 | from django import forms
from portfolio.models import Security, Transaction, Account
from currency_history.models import Currency
class BuyForm(forms.ModelForm):
#def __init__(self, *pa, **ka):
#super(BuyForm, self).__init__(*pa, **ka)
#self.fields['security'].queryset = Security.objects.all()
... | bsd-3-clause |
ojake/django | django/contrib/gis/gdal/__init__.py | 327 | 2635 | """
This module houses ctypes interfaces for GDAL objects. The following GDAL
objects are supported:
CoordTransform: Used for coordinate transformations from one spatial
reference system to another.
Driver: Wraps an OGR data source driver.
DataSource: Wrapper for the OGR data source object, supports
OGR-su... | bsd-3-clause |
edisonlz/fruit | web_project/base/site-packages/django_extensions/db/fields/__init__.py | 39 | 14535 | """
Django Extensions additional model fields
"""
import re
import six
import warnings
try:
import uuid
HAS_UUID = True
except ImportError:
HAS_UUID = False
try:
import shortuuid
HAS_SHORT_UUID = True
except ImportError:
HAS_SHORT_UUID = False
from django.core.exceptions import ImproperlyConf... | apache-2.0 |
stefanfoulis/django-multilingual | multilingual/admin.py | 2 | 8098 | from django.contrib import admin
from django.forms.models import BaseInlineFormSet
from django.forms.fields import BooleanField
from django.forms.formsets import DELETION_FIELD_NAME
from django.forms.util import ErrorDict
from django.utils.translation import ugettext as _
from multilingual.languages import *
from mult... | mit |
t794104/ansible | test/units/modules/network/f5/test_bigip_data_group.py | 16 | 16352 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
FreeAgent/djangoappengine-starter | django/contrib/admindocs/urls.py | 336 | 1089 | from django.conf.urls.defaults import *
from django.contrib.admindocs import views
urlpatterns = patterns('',
url('^$',
views.doc_index,
name='django-admindocs-docroot'
),
url('^bookmarklets/$',
views.bookmarklets,
name='django-admindocs-bookmarklets'
),
url('^tags/$... | bsd-3-clause |
hguemar/cinder | cinder/tests/test_ibmnas.py | 1 | 18917 | # Copyright 2013 IBM Corp.
#
# 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 t... | apache-2.0 |
CanonicalLtd/subiquity | subiquitycore/ui/actionmenu.py | 1 | 4904 | # Copyright 2018 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | agpl-3.0 |
inspirehep/json-merger | json_merger/version.py | 1 | 1199 | # -*- coding: utf-8 -*-
#
# This file is part of Inspirehep.
# Copyright (C) 2016, 2017, 2018 CERN.
#
# Inspirehep 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... | gpl-2.0 |
rbardak/espresso | samples/python/debye_hueckel.py | 2 | 7857 | #
# Copyright (C) 2013,2014 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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... | gpl-3.0 |
piffey/ansible | lib/ansible/modules/cloud/ovirt/ovirt_mac_pools.py | 73 | 5430 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (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
#... | gpl-3.0 |
seanli9jan/tensorflow | tensorflow/python/kernel_tests/sparse_cross_op_test.py | 8 | 16655 | # 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 |
aerickson/xbmc | lib/gtest/test/gtest_filter_unittest.py | 2826 | 21261 | #!/usr/bin/env python
#
# Copyright 2005 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... | gpl-2.0 |
yfried/ansible | lib/ansible/modules/storage/netapp/na_ontap_net_ifgrp.py | 9 | 11332 | #!/usr/bin/python
# (c) 2018, NetApp, Inc
# 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': ['preview'],
... | gpl-3.0 |
pandeyadarsh/sympy | sympy/liealgebras/cartan_type.py | 80 | 1775 | from __future__ import print_function, division
from sympy.core import Basic
class CartanType_generator(Basic):
"""
Constructor for actually creating things
"""
def __call__(self, *args):
c = args[0]
c = list(c)
letter, n = c[0], int(c[1])
if n < 0:
raise ... | bsd-3-clause |
Kazade/NeHe-Website | google_appengine/lib/django_1_2/django/templatetags/i18n.py | 60 | 9958 | import re
from django.template import Node, Variable, VariableNode, _render_value_in_context
from django.template import TemplateSyntaxError, TokenParser, Library
from django.template import TOKEN_TEXT, TOKEN_VAR
from django.utils import translation
from django.utils.encoding import force_unicode
register = Library()... | bsd-3-clause |
rlugojr/rekall | rekall-agent/rekall_agent/ui/interactive.py | 1 | 6116 | # Rekall Memory Forensics
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# 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 v... | gpl-2.0 |
brainelectronics/towerdefense | pyglet/image/codecs/bmp.py | 25 | 12418 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | bsd-3-clause |
SLongofono/448_Project4 | Documentation/Prototype/Compare_Songs.py | 1 | 5320 | ## @file Compare_Songs.py
# Compare Songs
# @brief Functions associated with the collection of tracks to compare against
# @details This file describes the methods by which we collect songs to process
# against our user profile.
import sys
import spotipy
import spotipy.util as util
import Assemble_Profile... | mit |
vveerava/Openstack | neutron/plugins/ml2/rpc.py | 7 | 9218 | # Copyright (c) 2013 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 ... | apache-2.0 |
curtisblack/R2D2 | BluetoothSerial.py | 1 | 1624 | import os
import logging
import serial
from RPi.GPIO import *
class BluetoothSerial:
def __init__(self, usb, pin):
self.usb = usb
self.pin = pin
self.port = None
self.buffer = ""
setmode(BCM)
setup(self.pin, IN)
self.Connected = False
self.JustConnect... | mit |
theyaa/Impala | thirdparty/thrift-0.9.0/test/py/TestSocket.py | 99 | 2888 | #!/usr/bin/env python
#
# 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
# "L... | apache-2.0 |
michigraber/scikit-learn | examples/linear_model/plot_bayesian_ridge.py | 248 | 2588 | """
=========================
Bayesian Ridge Regression
=========================
Computes a Bayesian Ridge Regression on a synthetic dataset.
See :ref:`bayesian_ridge_regression` for more information on the regressor.
Compared to the OLS (ordinary least squares) estimator, the coefficient
weights are slightly shift... | bsd-3-clause |
agancsos/misc | crawler.py | 1 | 2905 | #!/bin/python
import os
import sys
import re
import urllib2
import random
import datetime
dbfile="";
def getSQLiteRows(sql):
key=str(random.randint(0,9999));
os.system("sqlite3 \""+dbfile+"\" \""+sql+"\" > db_file_"+key);
all_content="";
if(os.path.exists("db_file_"+key)):
all_content=open("db_file_"+key,"r").re... | mit |
Jionglun/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/draw.py | 603 | 6456 | from javascript import console
from browser import timer
import math
class Queue:
def __init__(self):
self._list=[]
def empty(self):
return len(self._list) == 0
def put(self, element):
self._list.append(element)
def get(self):
if len(self._list) == 0:
raise BaseError
... | gpl-3.0 |
oneminot/audacity | lib-src/lv2/sord/waflib/Tools/dbus.py | 318 | 1142 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib import Task,Errors
from waflib.TaskGen import taskgen_method,before_method
@taskgen_method
def add_dbus_file(self,filename,prefix,mode):
if not hasattr(self,'dbus... | gpl-2.0 |
promptworks/keystone | keystone/policy/core.py | 5 | 4225 | # Copyright 2012 OpenStack Foundation
#
# 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... | apache-2.0 |
nandhp/youtube-dl | youtube_dl/extractor/pornovoisines.py | 15 | 3390 | # coding: utf-8
from __future__ import unicode_literals
import re
import random
from .common import InfoExtractor
from ..utils import (
int_or_none,
float_or_none,
unified_strdate,
)
class PornoVoisinesIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?pornovoisines\.com/showvideo/(?P<id>\d+)/(?P<... | unlicense |
patchew-project/patchew | tests/test_ansi2html.py | 2 | 22373 | # Test conversion of ANSI sequences into HTML
#
# Copyright (C) 2018 Red Hat, Inc.
#
# Author: Paolo Bonzini <pbonzini@redhat.com>
import unittest
from patchew.logviewer import ansi2html, ansi2text, ANSI2TextConverter
class ANSI2HTMLTest(unittest.TestCase):
def assertAnsi(self, test, expected, **kwargs):
... | mit |
gicking/STM8_templates | Projects/General_Examples/I2C_read/build_upload.py | 16 | 3419 | #!/usr/bin/python
'''
Script for building and uploading a STM8 project with dependency auto-detection
'''
# set general options
UPLOAD = 'BSL' # select 'BSL' or 'SWIM'
TERMINAL = True # set True to open terminal after upload
RESET = 1 # STM8 reset: 0=skip, 1=manual, 2=DTR line (RS232),... | apache-2.0 |
nuagenetworks/vspk-python | vspk/v6/nusapegressqosprofile.py | 1 | 14126 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... | bsd-3-clause |
openstack/ceilometer | ceilometer/tests/unit/test_event_pipeline.py | 1 | 14208 | #
# 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 |
saeki-masaki/glance | glance/db/sqlalchemy/migrate_repo/versions/002_add_image_properties_table.py | 9 | 3450 | # 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 |
MichalMaM/ella-galleries | ella_galleries/south_migrations/0008_auto__add_field_galleryitem_slug.py | 2 | 11553 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'GalleryItem.slug'
db.add_column('ella_galleries_galleryitem', 'slug',
... | bsd-3-clause |
weimingtom/python-for-android | python-modules/twisted/twisted/internet/tksupport.py | 61 | 1716 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This module integrates Tkinter with twisted.internet's mainloop.
Maintainer: Itamar Shtull-Trauring
To use, do::
| tksupport.install(rootWidget)
and then run your reactor as usual - do *not* call Tk's mainloop(),
use Twisted... | apache-2.0 |
deadmau6/Prog5 | network.py | 1 | 9349 | '''
Created on Oct 12, 2016
@author: mwitt_000
'''
import queue
import threading
## wrapper class for a queue of packets
class Interface:
## @param maxsize - the maximum size of the queue storing packets
# @param cost - of the interface used in routing
# @param capacity - the capacity of the link in bp... | gpl-3.0 |
dhruvagarwal/django | tests/template_tests/filter_tests/test_linebreaks.py | 310 | 1920 | from django.template.defaultfilters import linebreaks_filter
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class LinebreaksTests(SimpleTestCase):
"""
The contents in "linebreaks" are escaped according to the current
autoescape setting.
... | bsd-3-clause |
xzh86/scikit-learn | sklearn/manifold/tests/test_mds.py | 324 | 1862 | import numpy as np
from numpy.testing import assert_array_almost_equal
from nose.tools import assert_raises
from sklearn.manifold import mds
def test_smacof():
# test metric smacof using the data of "Modern Multidimensional Scaling",
# Borg & Groenen, p 154
sim = np.array([[0, 5, 3, 4],
... | bsd-3-clause |
mosbasik/buzhug | javasrc/lib/Jython/Lib/test/test_pkg_jy.py | 5 | 3082 | # Test packages (dotted-name import)
# XXX: This test is borrowed from CPython 2.7 as it tickles
# http://bugs.jython.org/issue1871 so it should be removed in Jython 2.7
import sys
import os
import tempfile
import textwrap
import unittest
from test import test_support
# Helpers to create and destroy hierarchies.
de... | bsd-3-clause |
bo01ean/Stino | stino/pyarduino/base/pyserial/serialposix.py | 18 | 24318 | #!/usr/bin/env python
#
# Python Serial Port Extension for Win32, Linux, BSD, Jython
# module for serial IO for POSIX compatible systems, like Linux
# see __init__.py
#
# (C) 2001-2010 Chris Liechti <cliechti@gmx.net>
# this is distributed under a free software license, see license.txt
#
# parts based on code from Gran... | mit |
gaddman/ansible | test/units/modules/network/nxos/test_nxos_vxlan_vtep.py | 63 | 2534 | # (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 dis... | gpl-3.0 |
raycarnes/account-financial-tools | account_check_deposit/__openerp__.py | 18 | 2364 | # -*- coding: utf-8 -*-
###############################################################################
#
# account_check_deposit for Odoo/OpenERP
# Copyright (C) 2012-2015 Akretion (http://www.akretion.com/)
# @author: Benoît GUILLOT <benoit.guillot@akretion.com>
# @author: Chafique DELLI <chafique.delli@akret... | agpl-3.0 |
uclapi/uclapi | backend/uclapi/timetable/migrations/0003_auto_20171007_1558.py | 1 | 26087 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-10-07 15:58
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('timetable', '0002_caching'),
]
operations = [
migrations.AlterField(
... | mit |
uni-peter-zheng/autotest | client/shared/profiler_manager_unittest.py | 4 | 2880 | #!/usr/bin/python
import unittest
try:
import autotest.common as common
except ImportError:
import common
from autotest.client.shared import profiler_manager
# simple job stub for using in tests
class stub_job(object):
tmpdir = "/home/autotest/tmp"
autodir = "/home/autotest"
# simple profiler stub ... | gpl-2.0 |
preo/dnspython | dns/node.py | 49 | 6028 | # Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | isc |
jwvhewitt/dmeternal | old_game/monsters/misc.py | 1 | 23825 | from . import base
from .. import stats
from .. import items
from .. import dialogue
from .. import context
from .. import spells
from .. import invocations
from .. import effects
from .. import animobs
from .. import targetarea
from .. import aibrain
from . import animals
from . import treasuretype
from . import abili... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.