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 |
|---|---|---|---|---|---|
aut-sepanta/Sepanta3 | DCM/Speech/Audio/sound_play/scripts/say.py | 2 | 3101 | #!/usr/bin/env python
#***********************************************************
#* Software License Agreement (BSD License)
#*
#* Copyright (c) 2009, Willow Garage, Inc.
#* All rights reserved.
#*
#* Redistribution and use in source and binary forms, with or without
#* modification, are permitted provided that ... | mit |
kbdick/RecycleTracker | recyclecollector/scrap/gdata-2.0.18/build/lib.linux-x86_64-2.7/gdata/tlslite/integration/XMLRPCTransport.py | 271 | 5812 | """TLS Lite + xmlrpclib."""
import xmlrpclib
import httplib
from gdata.tlslite.integration.HTTPTLSConnection import HTTPTLSConnection
from gdata.tlslite.integration.ClientHelper import ClientHelper
class XMLRPCTransport(xmlrpclib.Transport, ClientHelper):
"""Handles an HTTPS transaction to an XML-RPC server."""
... | gpl-3.0 |
kapt/django-oscar | oscar/apps/offer/south_migrations/0006_auto__add_field_conditionaloffer_max_applications.py | 17 | 15049 | # 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 field 'ConditionalOffer.max_applications'
db.add_column('offer_conditionaloffer', 'max_applicatio... | bsd-3-clause |
yasserglez/tagfs | packages/tagfs/contrib/magic.py | 2 | 58944 | #!/usr/bin/env python
'''
magic.py
determines a file type by its magic number
(C)opyright 2000 Jason Petrone <jp_py@jsnp.net>
All Rights Reserved
Command Line Usage: running as `python magic.py file` will print
a description of what 'file' is.
Module Usage:
magic.whatis(data): when pa... | mit |
m2candre/ansible-modules-extras | cloud/cloudstack/cs_account.py | 14 | 12533 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
The-Compiler/qutebrowser | tests/unit/scripts/test_run_vulture.py | 1 | 2574 | #!/usr/bin/env python3
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... | gpl-3.0 |
loli/semisupervisedforests | examples/model_selection/plot_roc_crossval.py | 247 | 3253 | """
=============================================================
Receiver Operating Characteristic (ROC) with cross validation
=============================================================
Example of Receiver Operating Characteristic (ROC) metric to evaluate
classifier output quality using cross-validation.
ROC curv... | bsd-3-clause |
desmovalvo/virtualsib-part2 | manager/lib/SSAPLib.py | 8 | 2366 | #!/usr/bin/python
############################################################
#
# SSAP message templates
#
############################################################
SSAP_MESSAGE_CONFIRM_TEMPLATE = '''<SSAP_message>
<node_id>%s</node_id>
<space_id>%s</space_id>
<transaction_type>%s</transaction_type>
<message_type... | lgpl-3.0 |
JioCloud/heat | heat/api/aws/ec2token.py | 4 | 9426 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 |
txm/potato | django/contrib/gis/db/models/sql/where.py | 309 | 3938 | from django.db.models.fields import Field, FieldDoesNotExist
from django.db.models.sql.constants import LOOKUP_SEP
from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.sql.where import Constraint, WhereNode
from django.contrib.gis.db.models.fields import GeometryField
class GeoConstraint(Con... | bsd-3-clause |
iAmMrinal0/CouchPotatoServer | libs/chardet/utf8prober.py | 2919 | 2652 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
sarthakmeh03/django | tests/select_related_regress/models.py | 282 | 3677 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Building(models.Model):
name = models.CharField(max_length=10)
def __str__(self):
return "Building: %s" % self.name
@python_2_unicod... | bsd-3-clause |
dimroc/tensorflow-mnist-tutorial | lib/python3.6/site-packages/numpy/polynomial/hermite.py | 22 | 57847 | """
Objects for dealing with Hermite series.
This module provides a number of objects (mostly functions) useful for
dealing with Hermite series, including a `Hermite` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with such polynomials is in the
d... | apache-2.0 |
klueska/django-filebrowser | filebrowser/management/commands/fb_version_remove.py | 2 | 5312 | # coding: utf-8
# PYTHON IMPORTS
import os, re
# DJANGO IMPORTS
from django.core.management.base import BaseCommand, CommandError
# FILEBROWSER IMPORTS
from filebrowser.settings import EXTENSION_LIST, EXCLUDE, MEDIA_ROOT, DIRECTORY, VERSIONS, EXTENSIONS
class Command(BaseCommand):
args = '<media_path>'
hel... | bsd-3-clause |
40223136/-2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/html/entities.py | 814 | 75240 | """HTML character entity references."""
# maps the HTML entity name to the Unicode codepoint
name2codepoint = {
'AElig': 0x00c6, # latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1
'Aacute': 0x00c1, # latin capital letter A with acute, U+00C1 ISOlat1
'Acirc': 0x00c2, # latin capit... | gpl-3.0 |
talhajaved/nyuadmarket | flask/lib/python2.7/site-packages/werkzeug/debug/__init__.py | 310 | 7800 | # -*- coding: utf-8 -*-
"""
werkzeug.debug
~~~~~~~~~~~~~~
WSGI application traceback debugger.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import json
import mimetypes
from os.path import join, dirname, basename, isfile
... | mit |
fevxie/odoo | addons/membership/report/report_membership.py | 313 | 5267 | # -*- 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 |
shnizzedy/SM_openSMILE | openSMILE_preprocessing/mxf_to_wav.py | 1 | 1348 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mxf_to_wav.py
Script to quickly convert an mxf file to a waveform file.
Author:
– Jon Clucas, 2016 (jon.clucas@childmind.org)
© 2016, Child Mind Institute, Apache v2.0 License
Created on Fri Dec 23 12:43:40 2016
@author: jon.clucas
"""
import argparse, sub... | apache-2.0 |
mistercrunch/airflow | airflow/contrib/sensors/aws_glue_catalog_partition_sensor.py | 7 | 1222 | #
# 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... | apache-2.0 |
vmax-feihu/hue | desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/universaldetector.py | 1776 | 6840 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | apache-2.0 |
Plain-Andy-legacy/android_external_chromium_org | tools/valgrind/asan/asan_symbolize.py | 26 | 1774 | #!/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.
from third_party import asan_symbolize
import os
import sys
class LineBuffered(object):
"""Disable buffering on a file object.... | bsd-3-clause |
nanditav/15712-TensorFlow | tensorflow/python/kernel_tests/summary_image_op_test.py | 14 | 4001 | # 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 |
StephenWeber/ansible | lib/ansible/modules/cloud/openstack/os_server.py | 11 | 23393 | #!/usr/bin/python
# coding: utf-8 -*-
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
# Copyright (c) 2013, John Dewey <john@dewey.ws>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publi... | gpl-3.0 |
VIkramx89/Flights-and-Hotels | functionality/advanced_search.py | 2 | 4423 | '''
'''
from validations import ViewValidations
from exceptions import CustomExceptions
from utility import DBConnectivity
list_of_flight=[]
def search_advance():
try:
p_source=input("Enter the source:")
ViewValidations.validate_source(p_source)
p_destination=input("Enter the Destination:")
... | epl-1.0 |
user-none/calibre | src/calibre/web/feeds/recipes/__init__.py | 13 | 1888 | #!/usr/bin/env python2
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
'''
Builtin recipes.
'''
import re, time, io
from calibre.web.feeds.news import (BasicNewsRecipe, CustomIndexRecipe,
AutomaticNewsRecipe, CalibrePeriodical)
from calibre.web.feeds.jsnews import JavascriptR... | gpl-3.0 |
solvcon/solvcon | solvcon/parcel/vewave/solver.py | 2 | 10148 | # -*- coding: UTF-8 -*-
#
# Copyright (c) 2012, Yung-Yu Chen <yyc@solvcon.net>
#
# 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 |
acsone/odoo | addons/hr/res_config.py | 377 | 3452 | # -*- 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 |
google/tritious | server/app.py | 1 | 15022 | #!/usr/bin/env python
#
# Copyright 2015 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 l... | apache-2.0 |
junhuac/MQUIC | depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/third_party/boto/tests/integration/iam/test_password_policy.py | 100 | 3943 | # Copyright (c) 2014 Rocket Internet AG.
# Luca Bruno <luca.bruno@rocket-internet.de>
# All rights reserved.
#
# 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
#... | mit |
heke123/chromium-crosswalk | tools/usb_gadget/usb_descriptors_test.py | 95 | 6817 | #!/usr/bin/python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import hid_constants
import usb_descriptors
class DescriptorWithField(usb_descriptors.Descriptor):
pass
DescriptorWit... | bsd-3-clause |
iti-luebeck/BEEP | Software/beep_framework/beep_msgs/src/beep_msgs/msg/_MyColor.py | 1 | 3197 | """autogenerated by genpy from beep_msgs/MyColor.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class MyColor(genpy.Message):
_md5sum = "e0a9a6ca70c4e4476c27f745dfa4c480"
_type = "beep_msgs/MyColor"
_has_header = False #flag to mark the presen... | bsd-3-clause |
krux/zookeeper-pkg | src/contrib/huebrowser/zkui/src/zkui/urls.py | 114 | 1304 | # 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 ... | apache-2.0 |
icloudrnd/automation_tools | openstack_dashboard/dashboards/project/data_processing/data_sources/urls.py | 39 | 1311 | # 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 the... | apache-2.0 |
was4444/chromium.src | third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py | 1 | 3217 | # 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 notice, this list of con... | bsd-3-clause |
myusuf3/courtside | game/factories.py | 8 | 1871 | import factory
import datetime
from game import models
from register.models import Player, Sport
from django.contrib.auth.models import User
class SportFactory(factory.django.DjangoModelFactory):
FACTORY_FOR = Sport
sport = factory.Iterator(['soccer', 'basketball', 'volleyball', 'hockey', 'baseball'], cycle... | mit |
amaozhao/basecms | unidecode/x0d3.py | 253 | 4705 | data = (
'tim', # 0x00
'tib', # 0x01
'tibs', # 0x02
'tis', # 0x03
'tiss', # 0x04
'ting', # 0x05
'tij', # 0x06
'tic', # 0x07
'tik', # 0x08
'tit', # 0x09
'tip', # 0x0a
'tih', # 0x0b
'pa', # 0x0c
'pag', # 0x0d
'pagg', # 0x0e
'pags', # 0x0f
'pan', # 0x10
'panj', # 0x11
... | mit |
echogreens/crab | scikits/crab/recommenders/knn/neighborhood_strategies.py | 10 | 4860 | """
Strategies for users selection to be a
possible candidate to be member of a user neighborhood.
Please check the base.BaseUserNeighborhoodStrategy before
implement your own strategy.
"""
# Author: Marcel Caraciolo <marcel@muricoca.com>
#
# License: BSD Style.
from base import BaseUserNeighborhoodStrategy
import ... | bsd-3-clause |
iblis17/slick | slick/blueprints/dns/views.py | 4 | 5622 | import json
from flask import redirect, url_for, flash, render_template
from slick.utils.core import get_client
from slick.utils.session import login_required
from .forms import ZoneRecordForm
import manager
# @login_required
# def delete(key_id):
# mgr = SshKeyManager(get_client())
# mgr.delete_key(key_id... | mit |
yfried/ansible | lib/ansible/modules/network/aci/aci_tenant.py | 15 | 6198 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 |
Rona111/sale_commission | __unported__/stock_block_prodlots/product.py | 5 | 1697 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 Pexego (<www.pexego.es>). All Rights Reserved
# $Omar Castiñeira Saavedra$
#
# This program is free software: you can redistribute it ... | agpl-3.0 |
pieroproietti/penguins-eggs | conf/distros/bionic/calamares/calamares-modules/grubcfg/main.py | 1 | 8013 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# === This file is part of Calamares - <http://github.com/calamares> ===
#
# Copyright 2014-2015, Philip Müller <philm@manjaro.org>
# Copyright 2015-2017, Teo Mrnjavac <teo@kde.org>
# Copyright 2017, Alf Gaida <agaida@siduction.org>
# Copyright 2017, Adriaan de G... | gpl-2.0 |
jorsea/odoomrp-wip | stock_invoicing_type/models/procurement_order.py | 16 | 1700 | # -*- encoding: utf-8 -*-
##############################################################################
#
# 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... | agpl-3.0 |
martonw/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/path_unittest.py | 124 | 3544 | # 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 f... | bsd-3-clause |
LucasRoesler/django-archive-mixin | django_archive_mixin/utils.py | 1 | 2502 | from distutils.version import StrictVersion
import django
from django.db import models
from django.utils import timezone
def get_field_by_name(model, field):
"""
Retrieve a field instance from a model by its name.
"""
field_dict = {x.name: x for x in model._meta.get_fields()}
return field_dict[f... | mit |
mattjhayes/nmeta_systemtest | nmeta_systemtest/nmeta_systemtest.py | 1 | 26321 | #!/usr/bin/python
# 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
# di... | apache-2.0 |
yeyanchao/calibre | src/calibre/ebooks/markdown/blockparser.py | 133 | 3358 |
import markdown
class State(list):
""" Track the current and nested state of the parser.
This utility class is used to track the state of the BlockParser and
support multiple levels if nesting. It's just a simple API wrapped around
a list. Each time a state is set, that state is appended to the... | gpl-3.0 |
Aaron1992/flaskbb | flaskbb/utils/populate.py | 1 | 6801 | # -*- coding: utf-8 -*-
"""
flaskbb.utils.populate
~~~~~~~~~~~~~~~~~~~~
A module that makes creating data more easily
:copyright: (c) 2014 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
from flaskbb.management.models import Setting, SettingsGroup
from flaskbb.user.models imp... | bsd-3-clause |
akumar21NCSU/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/mux.py | 636 | 71218 | # 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 |
cruzegoodin/TSC-ShippingDetails | flask/lib/python2.7/site-packages/flask/json.py | 428 | 8113 | # -*- coding: utf-8 -*-
"""
flask.jsonimpl
~~~~~~~~~~~~~~
Implementation helpers for the JSON support in Flask.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import io
import uuid
from datetime import datetime
from .globals import current_app, request
fro... | bsd-3-clause |
thanhacun/odoo | addons/base_report_designer/base_report_designer.py | 314 | 3433 | # -*- 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 |
yelongyu/chihu | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py | 1093 | 8936 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_ide... | gpl-3.0 |
rahul-c1/scrapy | scrapy/tests/test_commands.py | 3 | 8057 | import os
import sys
import subprocess
from time import sleep
from os.path import exists, join, abspath
from shutil import rmtree
from tempfile import mkdtemp
from twisted.trial import unittest
from scrapy.utils.python import retry_on_eintr
from scrapy.utils.test import get_testenv
class ProjectTest(unittest.TestCas... | bsd-3-clause |
chemelnucfin/tensorflow | tensorflow/python/data/kernel_tests/range_test.py | 17 | 2767 | # 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 |
tridge/ardupilot | Tools/ardupilotwaf/embed.py | 16 | 3286 | #!/usr/bin/env python
'''
script to create ap_romfs_embedded.h from a set of static files
Andrew Tridgell
May 2017
'''
import os, sys, tempfile, gzip
def write_encode(out, s):
out.write(s.encode())
def embed_file(out, f, idx, embedded_name, uncompressed):
'''embed one file'''
try:
contents = op... | gpl-3.0 |
jean/sentry | src/sentry/web/frontend/debug/debug_oauth_authorize.py | 4 | 1255 | from __future__ import absolute_import, print_function
from django.views.generic import View
from sentry.models import ApiApplication
from sentry.web.helpers import render_to_response
class DebugOAuthAuthorizeView(View):
def get(self, request):
application = ApiApplication(
name='Example App... | bsd-3-clause |
deisi/home-assistant | homeassistant/components/wink.py | 1 | 3737 | """
Support for Wink hubs.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/wink/
"""
import logging
import json
from homeassistant.helpers import validate_config, discovery
from homeassistant.const import CONF_ACCESS_TOKEN, ATTR_BATTERY_LEVEL
from homea... | mit |
akash1808/nova | nova/tests/unit/virt/vmwareapi/stubs.py | 52 | 2525 | # Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 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... | apache-2.0 |
azumimuo/family-xbmc-addon | plugin.video.wolfpack/resources/lib/modules/pyaes/__init__.py | 138 | 2032 | # The MIT License (MIT)
#
# Copyright (c) 2014 Richard Moore
#
# 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, mod... | gpl-2.0 |
twz915/django | tests/forms_tests/field_tests/test_typedmultiplechoicefield.py | 106 | 3520 | import decimal
from django.forms import TypedMultipleChoiceField, ValidationError
from django.test import SimpleTestCase
class TypedMultipleChoiceFieldTest(SimpleTestCase):
def test_typedmultiplechoicefield_1(self):
f = TypedMultipleChoiceField(choices=[(1, "+1"), (-1, "-1")], coerce=int)
self.a... | bsd-3-clause |
moocowmoo/dashman | lib/pycoin/pycoin/tx/TxIn.py | 14 | 3804 | # -*- coding: utf-8 -*-
"""
Deal with the part of a Tx that specifies where the Bitcoin comes from.
The MIT License (MIT)
Copyright (c) 2013 by Richard Kiss
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 t... | mit |
racker/cloud-init-debian-pkg | tests/unittests/test_datasource/test_openstack.py | 6 | 11742 | # vi: ts=4 expandtab
#
# Copyright (C) 2014 Yahoo! Inc.
#
# Author: Joshua Harlow <harlowja@yahoo-inc.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation.
#
# This... | gpl-3.0 |
tlakshman26/cinder-bug-fix-volume-conversion-full | cinder/tests/unit/test_hp_xp_fc.py | 19 | 33282 | # Copyright (C) 2015, Hitachi, Ltd.
#
# 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 |
mibofra/olifant | usb/_debug.py | 3 | 3220 | # Copyright (C) 2009-2011 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provi... | gpl-3.0 |
daspecster/google-cloud-python | storage/unit_tests/test_acl.py | 4 | 26727 | # Copyright 2014 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 law or agreed to in writing, ... | apache-2.0 |
flyballlabs/threatdetectionservice | api/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py | 2929 | 3791 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights ... | apache-2.0 |
fkorotkov/pants | src/python/pants/source/payload_fields.py | 4 | 2589 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from hashlib import ... | apache-2.0 |
dvliman/jaikuengine | .google_appengine/lib/django-1.4/tests/regressiontests/aggregation_regress/tests.py | 29 | 34529 | from __future__ import absolute_import
import datetime
import pickle
from decimal import Decimal
from operator import attrgetter
from django.core.exceptions import FieldError
from django.db.models import Count, Max, Avg, Sum, StdDev, Variance, F, Q
from django.test import TestCase, Approximate, skipUnlessDBFeature
f... | apache-2.0 |
oswalpalash/remoteusermgmt | RUM/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.py | 2931 | 2318 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
dyyi/moneybook | venv/Lib/encodings/idna.py | 215 | 9170 | # This module implements the RFCs 3490 (IDNA) and 3491 (Nameprep)
import stringprep, re, codecs
from unicodedata import ucd_3_2_0 as unicodedata
# IDNA section 3.1
dots = re.compile("[\u002E\u3002\uFF0E\uFF61]")
# IDNA section 5
ace_prefix = b"xn--"
sace_prefix = "xn--"
# This assumes query strings, so AllowUnassig... | apache-2.0 |
endlessm/chromium-browser | third_party/grpc/src/src/python/grpcio_tests/tests/unit/_channel_ready_future_test.py | 4 | 3470 | # Copyright 2015 gRPC authors.
#
# 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... | bsd-3-clause |
stewartpark/django | django/core/management/commands/startapp.py | 513 | 1040 | from importlib import import_module
from django.core.management.base import CommandError
from django.core.management.templates import TemplateCommand
class Command(TemplateCommand):
help = ("Creates a Django app directory structure for the given app "
"name in the current directory or optionally in t... | bsd-3-clause |
zeroSteiner/king-phisher | data/server/king_phisher/alembic/versions/c9a8d520a26_schema_v9.py | 4 | 1908 | """Schema v9
Revision ID: b8443afcb9e
Revises: b76eab0a059
Create Date: 2018-10-25
"""
# revision identifiers, used by Alembic.
revision = 'c9a8d520a26'
down_revision = 'b8443afcb9e'
import os
import sys
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), *['..'] * 5)))
from alembic import o... | bsd-3-clause |
ltcmelo/psychec | cnippet/CCompilerFacade.py | 1 | 4589 | # -----------------------------------------------------------------------------
# Copyright (c) 2017 Leandro T. C. Melo (LTCMELO@GMAIL.COM)
#
# All rights reserved. Unauthorized copying of this file, through any
# medium, is strictly prohibited.
#
# This software is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR
#... | lgpl-2.1 |
jrutila/django-shop | docs/OLD-out-of-date/snippets/products.py | 20 | 1153 | # This should be read as pseudo-code, it's not meant to be executable
# Just a rough draft/proposal of how the products could be handled, similar to what Satchmo does
class Product():
# Product very general stuff goes here
name = models.CharField(mx_length=255)
class ProductAttribute():
'''
'''
name = 'ISBN... | bsd-3-clause |
zzzirk/boto | tests/integration/glacier/test_layer2.py | 136 | 2025 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | mit |
apache/libcloud | docs/examples/storage/create_directory_backup_stream_to_cf.py | 4 | 1099 | import subprocess
from datetime import datetime
from libcloud.storage.types import Provider, ContainerDoesNotExistError
from libcloud.storage.providers import get_driver
driver = get_driver(Provider.CLOUDFILES_US)('username', 'api key')
directory = '/home/some/path'
cmd = 'tar cvzpf - %s' % (directory)
object_name ... | apache-2.0 |
EricSchles/python-route53 | route53/xml_generators/change_resource_record_set.py | 1 | 4532 | from io import BytesIO
from lxml import etree
from route53.util import prettyprint_xml
def get_change_values(change):
"""
In the case of deletions, we pull the change values for the XML request
from the ResourceRecordSet._initial_vas dict, since we want the original
values. For creations, we pull from ... | mit |
griest024/PokyrimTools | blender_nif_plugin-develop/io_scene_nif/nif_import.py | 2 | 94492 | """This script imports Netimmerse/Gamebryo nif files to Blender."""
# ***** BEGIN LICENSE BLOCK *****
#
# Copyright © 2005-2012, NIF File Format Library and Tools contributors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the ... | mit |
manishpatell/erpcustomizationssaiimpex123qwe | addons/crm/report/crm_phonecall_report.py | 309 | 3982 | # -*- 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 |
cboothe/libkml | third_party/googletest-r108/test/gtest_break_on_failure_unittest.py | 15 | 6081 | #!/usr/bin/env python
#
# Copyright 2006, 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... | bsd-3-clause |
decvalts/iris | lib/iris/tests/unit/fileformats/grib/load_rules/test_convert.py | 2 | 7421 | # (C) British Crown Copyright 2013 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris 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 Software Foundation, either version 3 of the License, or
# (at your option) any l... | gpl-3.0 |
thanhacun/odoo | addons/membership/wizard/__init__.py | 432 | 1071 | # -*- 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 |
tomfotherby/tower-cli | tests/test_utils_command.py | 4 | 1663 | # Copyright 2015, Ansible, Inc.
# Luke Sneeringer <lsneeringer@ansible.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.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
barbour-em/osf.io | scripts/analytics/addons.py | 15 | 2140 | # -*- coding: utf-8 -*-
import os
import re
import matplotlib.pyplot as plt
from framework.mongo import database
from website import settings
from website.app import init_app
from .utils import plot_dates, oid_to_datetime, mkdirp
log_collection = database['nodelog']
FIG_PATH = os.path.join(settings.ANALYTICS_PATH... | apache-2.0 |
saurabhjn76/sympy | sympy/parsing/maxima.py | 105 | 1740 | from __future__ import print_function, division
import re
from sympy import sympify, Sum, product, sin, cos
class MaximaHelpers:
def maxima_expand(expr):
return expr.expand()
def maxima_float(expr):
return expr.evalf()
def maxima_trigexpand(expr):
return expr.expand(trig=True)
... | bsd-3-clause |
hamiltont/CouchPotatoServer | libs/git/repository.py | 109 | 20401 | # Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com>
# 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 li... | gpl-3.0 |
JCBarahona/edX | lms/djangoapps/instructor_task/tasks_helper.py | 1 | 69010 | """
This file contains tasks that are designed to perform background operations on the
running state of a course.
"""
import json
import re
from collections import OrderedDict
from datetime import datetime
from django.conf import settings
from eventtracking import tracker
from itertools import chain
from time import t... | agpl-3.0 |
ioanpocol/superdesk-core | superdesk/publish/formatters/__init__.py | 2 | 6138 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import loggi... | agpl-3.0 |
pamoakoy/invenio | modules/bibformat/lib/elements/bfe_record_stats.py | 35 | 2649 | ## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later versio... | gpl-2.0 |
luv/impulse-cube | deps/pyudev-0.16.1/tests/plugins/privileged.py | 3 | 2224 | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Sebastian Wiesner <lunaryorn@gmail.com>
# This library 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 Software Foundation; either version 2.1 of the License, or (at your
# opti... | gpl-3.0 |
vicky2135/lucious | oscar/lib/python2.7/site-packages/pygments/formatters/terminal256.py | 27 | 10776 | # -*- coding: utf-8 -*-
"""
pygments.formatters.terminal256
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for 256-color terminal output with ANSI sequences.
RGB-to-XTERM color conversion routines adapted from xterm256-conv
tool (http://frexx.de/xterm-256-notes/data/xterm256-conv2.tar.bz2)
by Wolfg... | bsd-3-clause |
axcheron/pydbg | pydbg/windows_h.py | 10 | 15273 | # generated by 'xml2py'
#
# $Id: windows_h.py 194 2007-04-05 15:31:53Z cameron $
#
# flags 'windows.xml -s DEBUG_EVENT -s CONTEXT -s MEMORY_BASIC_INFORMATION -s LDT_ENTRY -s PROCESS_INFORMATION -s STARTUPINFO -s SYSTEM_INFO -s TOKEN_PRIVILEGES -s LUID -s HANDLE -o windows_h.py'
# PEDRAM - line swap ... have to patc... | gpl-2.0 |
S-YOU/grumpy | compiler/block_test.py | 1 | 10738 | # coding=utf-8
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | apache-2.0 |
EvanK/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway_facts.py | 44 | 4573 | #!/usr/bin/python
# Copyright: 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',
'status': ['preview'],
... | gpl-3.0 |
rixrix/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/trie/datrie.py | 785 | 1166 | from __future__ import absolute_import, division, unicode_literals
from datrie import Trie as DATrie
from six import text_type
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
chars = set()
for key in data.keys():
if not isinstance(key, text_type):
... | mpl-2.0 |
liangazhou/django-rdp | packages/Django-1.8.6/tests/inspectdb/models.py | 17 | 2720 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
class People(models.Model):
name = models.CharField(max_length=255)
parent = models.ForeignKey('self')
class Message(models.Model):
from_field = models.ForeignKey(People, db_column='from_id')
class PeopleDa... | apache-2.0 |
MQQiang/kbengine | kbe/res/scripts/common/Lib/encodings/rot_13.py | 155 | 2428 | #!/usr/bin/env python
""" Python Character Mapping Codec for ROT13.
This codec de/encodes from str to str.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self, input, errors='strict'):
return (input.translate(rot13_map), len(input... | lgpl-3.0 |
bacaldwell/ironic | ironic/api/controllers/v1/__init__.py | 2 | 6897 | # 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 agreed to in... | apache-2.0 |
porduna/weblabdeusto | server/launch/sample_balanced2_concurrent_experiments/main_machine/lab_and_experiment1/experiment48/server_config.py | 968 | 1526 | #!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
weblab_xilinx_experiment_xilinx_device = 'FPGA'
weblab_xilinx_experiment_port_number = 1
# This should be something like this:
# import os as _os
# xilinx_home = _os.getenv('XILINX_HOME')
# if xilinx_home == None:
# if _os.name == 'nt':
# xilinx_home = r'C:... | bsd-2-clause |
jonshern/raspberrypi-indoorhealthmonitor | lib/awsiot.py | 1 | 2251 | import boto3
from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient
import sys
import logging
import time
import getopt
class AWSIOT(object):
host = ""
rootCAPath = ""
cognitoIdentityPoolID = ""
accesskeyid = ""
secretkeyid = ""
sessiontoken = ""
awsiotmqttclient = ""
def __init__... | unlicense |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.