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 |
|---|---|---|---|---|---|
mastizada/kuma | vendor/packages/ipython/IPython/frontend/process/winprocess.py | 7 | 9831 | # A module to expose various thread/process/job related structures and
# methods from kernel32
#
# The MIT License
#
# Copyright (c) 2006 the Mozilla Foundation <http://www.mozilla.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentati... | mpl-2.0 |
tangfeixiong/nova | nova/virt/images.py | 25 | 5145 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in complianc... | apache-2.0 |
ston380/account-financial-reporting | mis_builder/wizard/mis_builder_dashboard.py | 9 | 4018 | # -*- encoding: utf-8 -*-
##############################################################################
#
# mis_builder module for Odoo, Management Information System Builder
# Copyright (C) 2014-2015 ACSONE SA/NV (<http://acsone.eu>)
#
# This file is a part of mis_builder
#
# mis_builder is free software:... | agpl-3.0 |
M4sse/chromium.src | tools/usb_gadget/mouse_gadget.py | 101 | 5065 | # 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.
"""Implementation of a USB HID mouse.
Two classes are provided by this module. The MouseFeature class implements
the core functionality of a HID mouse and c... | bsd-3-clause |
Nikola-K/django-recurrence | tests/test_magic_methods.py | 5 | 1095 | from datetime import datetime
from recurrence import Recurrence, Rule
import recurrence
def test_truthiness_with_single_rrule():
rule = Rule(
recurrence.DAILY
)
object = Recurrence(
rrules=[rule]
)
assert bool(object)
def test_truthiness_with_single_exrule():
rule = Rule(
... | bsd-3-clause |
40223148/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/urllib/parse.py | 735 | 35170 | """Parse (absolute and relative) URLs.
urlparse module is based upon the following RFC specifications.
RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L. Masinter, January 2005.
RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter
and L.Masinter, Decemb... | gpl-3.0 |
destijl/grr | grr/config/test.py | 2 | 2277 | #!/usr/bin/env python
"""Configuration parameters for the test subsystem."""
from grr.lib import config_lib
# Default for running in the current directory
config_lib.DEFINE_constant_string("Test.srcdir",
"%(grr|module_path)/../",
"The directory contai... | apache-2.0 |
2014cdbg4/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/select.py | 730 | 9440 | """
borrowed from jython
https://bitbucket.org/jython/jython/raw/28a66ba038620292520470a0bb4dc9bb8ac2e403/Lib/select.py
"""
#import java.nio.channels.SelectableChannel
#import java.nio.channels.SelectionKey
#import java.nio.channels.Selector
#from java.nio.channels.SelectionKey import OP_ACCEPT, OP_CONNECT, OP_WRITE, ... | gpl-2.0 |
petrus-v/odoo | addons/base_import/tests/test_cases.py | 53 | 15852 | # -*- encoding: utf-8 -*-
import csv
import io
import unittest2
from openerp.tests.common import TransactionCase
from .. import models
ID_FIELD = {
'id': 'id',
'name': 'id',
'string': "External ID",
'required': False,
'fields': [],
}
def make_field(name='value', string='unknown', required=False... | agpl-3.0 |
maartenq/ansible | lib/ansible/module_utils/network/iosxr/iosxr.py | 20 | 21182 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
kholia/pyrpm | pyrpm/installer/kickstart.py | 2 | 43138 | #
# Copyright (C) 2005 Red Hat, Inc.
# Author: Thomas Woerner <twoerner@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as published by
# the Free Software Foundation; version 2 only
#
# This program is distributed in th... | gpl-2.0 |
JuliBakagianni/META-SHARE | metashare/storage/models.py | 4 | 28918 | from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.db import models
# pylint: disable-msg=E0611
from hashlib import md5
from metashare.settings import LOG_HANDLER
from metashare import settings
from os import mkdir
from os.path import exists
import os.path
from uuid import uuid1... | bsd-3-clause |
sameerparekh/pants | src/python/pants/goal/artifact_cache_stats.py | 13 | 1902 | # 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)
import os
from colle... | apache-2.0 |
donutmonger/youtube-dl | youtube_dl/extractor/voicerepublic.py | 98 | 3813 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
compat_urlparse,
)
from ..utils import (
ExtractorError,
determine_ext,
int_or_none,
)
class VoiceRepublicIE(InfoExtractor):
_VALID_URL = r'https?://voicerepublic... | unlicense |
chvrga/outdoor-explorer | java/play-1.4.4/python/Lib/site-packages/win32/lib/win32rcparser.py | 4 | 21358 | # Windows dialog .RC file parser, by Adam Walker.
# This module was adapted from the spambayes project, and is Copyright
# 2003/2004 The Python Software Foundation and is covered by the Python
# Software Foundation license.
"""
This is a parser for Windows .rc files, which are text files which define
dialogs an... | mit |
zeha/pdns | regression-tests.recursor-dnssec/test_basicNSEC3.py | 9 | 1839 | from __future__ import print_function
from basicDNSSEC import BasicDNSSEC
import os
import subprocess
class basicNSEC3(BasicDNSSEC):
__test__ = True
_confdir = 'basicNSEC3'
@classmethod
def secureZone(cls, confdir, zonename, key=None):
zone = '.' if zonename == 'ROOT' else zonename
if ... | gpl-2.0 |
vasnake/dwg2csv | ora/fountain_p.py | 1 | 4019 | #!/usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
# (c) Valik mailto:vasnake@gmail.com
'''
Created on 2011-07-04
@author: Valik
Python >= 2.5
cx_Oracle-5.1-10g.win32-py2.5.msi
Task
select fountains (xdata like '00:"Фонтан питьевой";99:56045100')
from big table;
insert them to featureclass tab... | gpl-2.0 |
hustlbj/qemu-kvm | scripts/tracetool/format/h.py | 98 | 1062 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Generate .h file.
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajnoczi"
__email__ ... | gpl-2.0 |
tagatac/scrapy | scrapy/core/scheduler.py | 117 | 4301 | import os
import json
import logging
from os.path import join, exists
from queuelib import PriorityQueue
from scrapy.utils.reqser import request_to_dict, request_from_dict
from scrapy.utils.misc import load_object
from scrapy.utils.job import job_dir
logger = logging.getLogger(__name__)
class Scheduler(object):
... | bsd-3-clause |
r-mibu/ceilometer | ceilometer/alarm/notifier/log.py | 4 | 1539 | #
# Copyright 2013 eNovance
#
# 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 |
jravesloot/sift_app | sift/settings/local.py | 2 | 2511 | # settings/local.py
from django.utils.crypto import get_random_string
from .base import *
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.environ.get('SECRET_KEY', get_random_string(50, "abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)"))
# SECURITY WARNING: don't run with debug... | mit |
kobauman/education_tools | mastery_grids/experiment/splitAndCheck.py | 1 | 3481 | import sys
import pandas as pd
import numpy as np
from scipy import stats
def significant(array1,array2):
try:
arr1 = np.array(array1)
arr2 = np.array(array2)
print(stats.ttest_ind(arr1,arr2)[1])
return stats.ttest_ind(arr1,arr2)[1] < 0.1
except:
print('PROBLEM!')
... | apache-2.0 |
fitermay/intellij-community | python/lib/Lib/site-packages/django/contrib/auth/tests/urls.py | 90 | 1102 | from django.conf.urls.defaults import patterns
from django.contrib.auth.urls import urlpatterns
from django.contrib.auth.views import password_reset
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.template import Template, RequestContext
def remote_user_auth_v... | apache-2.0 |
le9i0nx/ansible | lib/ansible/modules/cloud/vmware/vmware_cluster.py | 47 | 9966 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.com>
# 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 |
atosatto/ansible | lib/ansible/modules/network/junos/junos_user.py | 7 | 7985 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
ddico/odoo | addons/hr_holidays/__manifest__.py | 1 | 2709 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Time Off',
'version': '1.5',
'category': 'Human Resources/Time Off',
'summary': 'Allocate time off and follow time off requests',
'website': 'https://www.odoo.com/page/leaves',
'descrip... | agpl-3.0 |
weebygames/boto | boto/plugin.py | 150 | 2711 | # Copyright 2010 Google Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# trib... | mit |
georgecpr/openthread | tools/harness-automation/cases/reed_5_2_4.py | 6 | 1872 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# notic... | bsd-3-clause |
kustodian/ansible | lib/ansible/modules/windows/win_get_url.py | 55 | 6591 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2014, Paul Durivage <paul.durivage@rackspace.com>, and others
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE_... | gpl-3.0 |
codecollision/DropboxToFlickr | djangoappengine/tests/not_return_sets.py | 107 | 4276 | from .testmodels import FieldsWithOptionsModel, OrderedModel, SelfReferenceModel
import datetime
from django.test import TestCase
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
class NonReturnSetsTest(TestCase):
floats = [5.3, 2.6, 9.1, 1.58, 2.4]
emails = ['app-engine@scholard... | bsd-3-clause |
google-code/android-scripting | python/src/Lib/test/test_mailbox.py | 53 | 78637 | import os
import sys
import time
import stat
import socket
import email
import email.message
import rfc822
import re
import StringIO
from test import test_support
import unittest
import mailbox
import glob
try:
import fcntl
except ImportError:
pass
class TestBase(unittest.TestCase):
def _check_sample(sel... | apache-2.0 |
bzbarsky/servo | components/style/properties/data.py | 13 | 14700 | # 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 re
PHYSICAL_SIDES = ["top", "left", "bottom", "right"]
LOGICAL_SIDES = ["block-start", "block-end", "inline-star... | mpl-2.0 |
akashsinghal/Speech-Memorization-App | speech/Swift/Speech-gRPC-Streaming/env/lib/python3.6/site-packages/pip/_vendor/html5lib/filters/optionaltags.py | 354 | 10534 | from __future__ import absolute_import, division, unicode_literals
from . import base
class Filter(base.Filter):
def slider(self):
previous1 = previous2 = None
for token in self.source:
if previous1 is not None:
yield previous2, previous1, token
previous2 =... | apache-2.0 |
pengutronix/aiohttp-json-rpc | aiohttp_json_rpc/client.py | 1 | 12563 | import aiohttp
import asyncio
import logging
from yarl import URL
from . import exceptions
from .protocol import (
JsonRpcMsgTyp,
encode_request,
encode_error,
decode_error,
encode_result,
decode_msg,
)
default_logger = logging.getLogger('aiohttp-json-rpc.client')
class JsonRpcClient:
... | apache-2.0 |
wildfireone/ghost | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/styles/perldoc.py | 364 | 2175 | # -*- coding: utf-8 -*-
"""
pygments.styles.perldoc
~~~~~~~~~~~~~~~~~~~~~~~
Style similar to the style used in the `perldoc`_ code blocks.
.. _perldoc: http://perldoc.perl.org/
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from... | mit |
google/material-design-icons | update/venv/lib/python3.9/site-packages/fontTools/ttLib/tables/otBase.py | 2 | 30335 | from fontTools.misc.py23 import Tag, bytesjoin
from .DefaultTable import DefaultTable
import sys
import array
import struct
import logging
log = logging.getLogger(__name__)
class OverflowErrorRecord(object):
def __init__(self, overflowTuple):
self.tableType = overflowTuple[0]
self.LookupListIndex = overflowTuple... | apache-2.0 |
opennode/nodeconductor | waldur_core/quotas/admin.py | 1 | 2301 | from django.contrib import admin
from django.contrib.contenttypes import models as ct_models
from django.contrib.contenttypes.admin import GenericTabularInline
from django.forms import ModelForm
from waldur_core.core.admin import ReversionAdmin
from waldur_core.quotas import models, utils
class QuotaScopeClassListFi... | mit |
hassoon3/odoo | addons/website_customer/controllers/main.py | 251 | 4306 | # -*- coding: utf-8 -*-
import openerp
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.website.models.website import unslug
from openerp.tools.translate import _
from openerp.addons.web.http import request
import werkzeug.urls
class WebsiteCustomer(http.Controller):
_refere... | agpl-3.0 |
zengenti/ansible | lib/ansible/modules/cloud/google/gc_storage.py | 18 | 16741 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
4shadoww/hakkuframework | core/lib/dns/rdtypes/IN/NAPTR.py | 18 | 4470 | # Copyright (C) 2003-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 "... | mit |
thaim/ansible | lib/ansible/plugins/action/net_static_route.py | 756 | 1058 | # (c) 2017, Ansible 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 di... | mit |
Delphine-L/tools-iuc | data_managers/data_manager_picard_index_builder/data_manager/picard_index_builder.py | 3 | 3527 | #!/usr/bin/env python
# Dan Blankenberg
from __future__ import print_function
import optparse
import os
import subprocess
import sys
from json import dumps, loads
DEFAULT_DATA_TABLE_NAME = "picard_indexes"
def get_id_name(params, dbkey, fasta_description=None):
# TODO: ensure sequence_id is unique and does not ... | mit |
mdalexca/marlin | scripts/rt-tester/rt-tester.py | 1106 | 5305 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
timthelion/FreeCAD | src/Mod/Import/App/PlmXmlParser.py | 11 | 7882 | # PlmXmlParser
#***************************************************************************
#* (c) Juergen Riegel (FreeCAD@juergen-riegel.net) 2015 *
#* *
#* This file is part of the FreeCAD CAx development system. ... | lgpl-2.1 |
pkreissl/espresso | testsuite/python/accumulator_time_series.py | 3 | 2207 | #
# Copyright (C) 2017-2019 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 |
zhouivy/alienbloodbath | editor/editor.py | 9 | 13796 | #!/usr/bin/python
import cairo, gobject, gtk, gtk.gdk, gtk.glade, os, pygtk, re, sys, thread
BRUSHES_ZOOM = 0.5
DOWN_KEY = 65364
INITIAL_ZOOM = 0.5
LEFT_KEY = 65361
LEVEL_WIDTH = 100
LEVEL_HEIGHT = 100
MAX_ZOOM = 4
MIN_ZOOM = 0.25
RIGHT_KEY = 65363
SCROLL_STEP = 64
SETTINGS_DIR = os.getenv("HOME") + '/.abb_editor'
L... | gpl-3.0 |
yoelk/kivy | kivy/storage/jsonstore.py | 26 | 2003 | '''
JSON store
==========
A :mod:`Storage <kivy.storage>` module used to save/load key-value pairs from
a json file.
'''
__all__ = ('JsonStore', )
from os.path import exists
from kivy.compat import iteritems
from kivy.storage import AbstractStore
from json import loads, dump
class JsonStore(AbstractStore):
''... | mit |
sschuberth/ubuntu-make | umake/frameworks/scala.py | 2 | 2540 | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Canonical
#
# Authors:
# Didier Roche
# Igor Vuk
#
# 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.
#
# This program is distributed in th... | gpl-3.0 |
naototty/vagrant-lxc-ironic | ironic/api/controllers/v1/node.py | 1 | 45494 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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... | apache-2.0 |
sbaogang/teletraan | deploy-sentinel/mysite/mysite/settings.py | 5 | 2558 | # Copyright 2016 Pinterest, 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... | apache-2.0 |
bdang2012/taiga-back | taiga/webhooks/migrations/0005_auto_20150505_1639.py | 23 | 1632 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_pgjson.fields
class Migration(migrations.Migration):
dependencies = [
('webhooks', '0004_auto_20150202_0834'),
]
operations = [
migrations.AlterField(
model... | agpl-3.0 |
uvbs/Test1 | vendor/google-breakpad/src/tools/gyp/test/mac/gyptest-bundle-resources.py | 193 | 1689 | #!/usr/bin/env python
# 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.
"""
Verifies things related to bundle resources.
"""
import TestGyp
import os
import stat
import sys
def check_attribs(path, expected_ex... | gpl-3.0 |
rusq/extool | extool.py | 1 | 9638 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
extool Copyright (C) 2017 Rustam Gilyazov
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions.
extool
======
Command line tool to rename Image and Video f... | gpl-3.0 |
quheng/scikit-learn | examples/linear_model/plot_sgd_loss_functions.py | 249 | 1095 | """
==========================
SGD: convex loss functions
==========================
A plot that compares the various convex loss functions supported by
:class:`sklearn.linear_model.SGDClassifier` .
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
def modified_huber_loss(y_true, y_pred):
z ... | bsd-3-clause |
knowsuchagency/nikola | nikola/data/themes/base/messages/messages_bs.py | 2 | 1776 | # -*- encoding:utf-8 -*-
from __future__ import unicode_literals
MESSAGES = {
"%d min remaining to read": "%d minuta preostalo za čitanje",
"(active)": "(aktivno)",
"Also available in:": "Takođe dostupan u:",
"Archive": "Arhiva",
"Authors": "Autori",
"Categories": "Kategorije",
"Comments": ... | mit |
gqwest-erp/server | openerp/addons/account_bank_statement_extensions/account_bank_statement.py | 49 | 6378 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under ... | agpl-3.0 |
the-new-sky/BlogInPy | markdown/extensions/urlize.py | 1 | 3381 | # From https://github.com/r0wb0t/markdown-urlize/blob/master/urlize.py
"""A more liberal autolinker
Inspired by Django's urlize function.
Positive examples:
>>> import markdown
>>> md = markdown.Markdown(extensions=['urlize'])
>>> md.convert('http://example.com/')
u'<p><a href="http://example.com/">http://example.... | gpl-3.0 |
spulec/moto | moto/sns/models.py | 1 | 30580 | from __future__ import unicode_literals
import datetime
import uuid
import json
import requests
import six
import re
from boto3 import Session
from moto.compat import OrderedDict
from moto.core import BaseBackend, BaseModel, CloudFormationModel
from moto.core.utils import (
iso_8601_datetime_with_milliseconds,
... | apache-2.0 |
msebire/intellij-community | plugins/hg4idea/testData/bin/mercurial/dagutil.py | 93 | 8237 | # dagutil.py - dag utilities for mercurial
#
# Copyright 2010 Benoit Boissinot <bboissin@gmail.com>
# and Peter Arrenbrecht <peter@arrenbrecht.ch>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from node import nullrev
from i18n ... | apache-2.0 |
gusai-francelabs/datafari | windows/python/Lib/idlelib/configSectionNameDialog.py | 37 | 3979 | """
Dialog that allows user to specify a new config file section name.
Used to get new highlight theme and keybinding set names.
The 'return value' for the dialog, used two placed in configDialog.py,
is the .result attribute set in the Ok and Cancel methods.
"""
from Tkinter import *
import tkMessageBox
class GetCfgSec... | apache-2.0 |
lz1988/django-web | build/lib/django/contrib/localflavor/us/forms.py | 101 | 4555 | """
USA-specific Form helpers
"""
from __future__ import absolute_import, unicode_literals
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select, CharField
from django.utils.encoding import smart_text
from django.u... | apache-2.0 |
gcodetogit/depot_tools | third_party/gsutil/gslib/__init__.py | 51 | 1121 | # Copyright 2010 Google Inc. 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 to use, copy, modify, merge,... | bsd-3-clause |
bwrsandman/OpenUpgrade | addons/hr/migrations/8.0.1.1/post-migration.py | 17 | 1303 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This migration script copyright (C) 2010-2014 Akretion
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... | agpl-3.0 |
mohabusama/togile | togile/apps/todo/tests.py | 1 | 13794 | from tastypie.test import ResourceTestCase
class TodoListResourceTest(ResourceTestCase):
fixtures = [
'todo_users.json',
'todo_lists_items.json'
]
DEFAULT_USER_ID = 1
DEFAULT_USER = 'user_1'
DEFAULT_PASSWORD = 'user_1'
LIST_URL = '/api/v1/users/%s/lists/'
DETAIL_URL = '/... | mit |
thunder-project/thunder | test/test_base.py | 1 | 5527 | import pytest
from numpy import allclose, array, asarray, add, ndarray, generic
from thunder import series, images
pytestmark = pytest.mark.usefixtures("eng")
def test_first(eng):
data = series.fromlist([array([1, 2, 3]), array([4, 5, 6])], engine=eng)
assert allclose(data.first(), [1, 2, 3])
data = ima... | apache-2.0 |
mohittahiliani/adaptive-RED-ns3 | src/wimax/bindings/modulegen__gcc_LP64.py | 14 | 775388 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
hang-qi/models | syntaxnet/dragnn/python/digraph_ops_test.py | 2 | 6102 | """Tests for digraph ops."""
import tensorflow as tf
from dragnn.python import digraph_ops
class DigraphOpsTest(tf.test.TestCase):
"""Testing rig."""
def testArcPotentialsFromTokens(self):
with self.test_session():
# Batch of two, where the second batch item is the reverse of the first.
source_... | apache-2.0 |
FNST-OpenStack/horizon | doc/source/conf.py | 17 | 14979 | # 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 t... | apache-2.0 |
ayumilong/rethinkdb | test/rql_test/connections/http_support/flask/debughelpers.py | 777 | 3508 | # -*- coding: utf-8 -*-
"""
flask.debughelpers
~~~~~~~~~~~~~~~~~~
Various helpers to make the development experience better.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from ._compat import implements_to_string
class UnexpectedUnicodeError(AssertionEr... | agpl-3.0 |
yceruto/django | django/conf/locale/hr/formats.py | 82 | 2108 | # -*- 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 = 'j. E Y.'
TIME_FORMAT = 'H:i:s'
DA... | bsd-3-clause |
adilhz/tipfy | tests/sessions_test.py | 4 | 15632 | from __future__ import with_statement
import os
import unittest
from werkzeug import cached_property
from tipfy.app import App, Request, Response
from tipfy.handler import RequestHandler
from tipfy.json import json_b64decode
from tipfy.local import local
from tipfy.routing import Rule
from tipfy.sessions import (Sec... | bsd-3-clause |
nacl-webkit/chrome_deps | third_party/tlslite/tlslite/__init__.py | 409 | 1129 | """
TLS Lite is a free python library that implements SSL v3, TLS v1, and
TLS v1.1. TLS Lite supports non-traditional authentication methods
such as SRP, shared keys, and cryptoIDs, in addition to X.509
certificates. TLS Lite is pure python, however it can access OpenSSL,
cryptlib, pycrypto, and GMPY for faster crypt... | bsd-3-clause |
hortonworks/hortonworks-sandbox | desktop/core/ext-py/Django-1.2.3/django/contrib/gis/utils/wkt.py | 419 | 1846 | """
Utilities for manipulating Geometry WKT.
"""
def precision_wkt(geom, prec):
"""
Returns WKT text of the geometry according to the given precision (an
integer or a string). If the precision is an integer, then the decimal
places of coordinates WKT will be truncated to that number:
>>> pnt =... | apache-2.0 |
superchilli/webapp | venv/lib/python2.7/site-packages/setuptools/extension.py | 299 | 1729 | import re
import functools
import distutils.core
import distutils.errors
import distutils.extension
from setuptools.extern.six.moves import map
from .monkey import get_unpatched
def _have_cython():
"""
Return True if Cython can be imported.
"""
cython_impl = 'Cython.Distutils.build_ext'
try:
... | mit |
vicky2135/lucious | sandbox/apps/gateway/views.py | 55 | 1780 | import logging
from django.views import generic
from django.contrib.auth.models import User
from django.contrib import messages
from django.core.mail import send_mail
from django import http
from django.core.urlresolvers import reverse
from django.template.loader import get_template
from django.template import Context... | bsd-3-clause |
alff0x1f/Misago | misago/threads/models/event.py | 8 | 1208 | from django.db import models
from django.utils import timezone
from misago.conf import settings
from misago.threads import threadtypes
from misago.threads.checksums import is_event_valid
class Event(models.Model):
forum = models.ForeignKey('misago_forums.Forum')
thread = models.ForeignKey('Thread')
auth... | gpl-2.0 |
barnone/EigenD | tools/detect.py | 3 | 2081 |
#
# Copyright 2009 Eigenlabs Ltd. http://www.eigenlabs.com
#
# This file is part of EigenD.
#
# EigenD 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) a... | gpl-3.0 |
ruguevara/neon | neon/optimizers/__init__.py | 9 | 1119 | # ----------------------------------------------------------------------------
# Copyright 2014 Nervana 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.o... | apache-2.0 |
zclfly/gensim | gensim/models/doc2vec.py | 1 | 38071 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Deep learning via the distributed memory and distributed bag of words models from
[1]_, using either hierarchical softmax or negative ... | gpl-3.0 |
Havate/havate-openstack | proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/dashboards/project/images_and_snapshots/utils.py | 8 | 2343 | from django.utils.translation import ugettext_lazy as _ # noqa
from horizon import exceptions
from openstack_dashboard.api import glance
def get_available_images(request, project_id=None, images_cache=None):
"""
Returns a list of images that are public or owned by the given
project_id. If project_id is... | apache-2.0 |
sergei-maertens/django | tests/validation/test_validators.py | 38 | 1428 | from __future__ import unicode_literals
from . import ValidationTestCase
from .models import ModelToValidate
class TestModelsWithValidators(ValidationTestCase):
def test_custom_validator_passes_for_correct_value(self):
mtv = ModelToValidate(number=10, name='Some Name', f_with_custom_validator=42,
... | bsd-3-clause |
fossoult/odoo | addons/hr_timesheet_sheet/__init__.py | 434 | 1127 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
moondrop-entertainment/django-nonrel-drawp | django/contrib/localflavor/at/forms.py | 273 | 2446 | """
AT-specific Form helpers
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.translation import ugettext_lazy as _
re_ssn = re.compile(r'^\d{4} \d{6}')
class ATZipCodeField(RegexField)... | bsd-3-clause |
KalleDK/compose | compose/cli/docopt_command.py | 19 | 1700 | from __future__ import absolute_import
from __future__ import unicode_literals
from inspect import getdoc
from docopt import docopt
from docopt import DocoptExit
def docopt_full_help(docstring, *args, **kwargs):
try:
return docopt(docstring, *args, **kwargs)
except DocoptExit:
raise SystemEx... | apache-2.0 |
qiubit/luminis | backend/simulator/random_series_functions.py | 1 | 1423 | #
# Copyright (C) 2017 Paweł Goliński
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
#
import numpy as np
from simulator.series_functions import SinSeries, ConstantSeries, GaussianSeries
class RandomSinSeries(SinSeries):
def __init__(se... | mit |
mancoast/CPythonPyc_test | fail/333_test_strptime.py | 24 | 26119 | """PyUnit testing against strptime"""
import unittest
import time
import locale
import re
import sys
from test import support
from datetime import date as datetime_date
import _strptime
class getlang_Tests(unittest.TestCase):
"""Test _getlang"""
def test_basic(self):
self.assertEqual(_strptime._getla... | gpl-3.0 |
def-/commandergenius | project/jni/python/src/Demo/tix/tixwidgets.py | 37 | 38464 | # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: tixwidgets.py 36560 2004-07-18 06:16:08Z tim_one $
#
# tixwidgets.py --
#
# For Tix, see http://tix.sourceforge.net
#
# This is a demo program of some of the Tix widgets available in Python.
# If you have installed... | lgpl-2.1 |
hchen1202/django-react | virtualenv/lib/python3.6/site-packages/pip/_vendor/requests/packages/chardet/gb2312freq.py | 3132 | 36011 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
pivot-libre/tideman | tests/parse_ballot.py | 1 | 2798 | import sys
import json
def make_column_to_candidate_dict(header_row):
my_dict = {}
for colIndex, candidate in enumerate(header_row):
my_dict[colIndex] = candidate.strip()
return my_dict
def return_candidates_in_order(row, col_to_candidate_dict):
ballot = []
for i in range(0,len(row)):
... | apache-2.0 |
YangSongzhou/django | tests/auth_tests/test_signals.py | 312 | 4005 | import datetime
from django.contrib.auth import signals
from django.contrib.auth.models import User
from django.test import TestCase, override_settings
from django.test.client import RequestFactory
@override_settings(USE_TZ=False,
PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLC... | bsd-3-clause |
synapse-wireless/linux-at91 | tools/perf/util/setup.py | 989 | 1543 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
Junnplus/flask-admin | flask_admin/contrib/peewee/form.py | 25 | 8737 | from wtforms import fields
from peewee import (CharField, DateTimeField, DateField, TimeField,
PrimaryKeyField, ForeignKeyField, BaseModel)
from wtfpeewee.orm import ModelConverter, model_form
from flask_admin import form
from flask_admin._compat import iteritems, itervalues
from flask_admin.mode... | bsd-3-clause |
kennethlyn/elbe | elbepack/commands/gen_update.py | 1 | 4159 | #!/usr/bin/env python
#
# ELBE - Debian Based Embedded Rootfilesystem Builder
# Copyright (C) 2013 Linutronix GmbH
#
# This file is part of ELBE.
#
# ELBE 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, eithe... | gpl-3.0 |
willprice/arduino-sphere-project | scripts/example_direction_finder/temboo/Library/USPS/AddressInformationAPI/CityStateLookup.py | 5 | 3797 | # -*- coding: utf-8 -*-
###############################################################################
#
# CityStateLookup
# Lookup city and state using incomplete address information.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");... | gpl-2.0 |
researchcompendia/researchcompendia | companionpages/users/migrations/0002_auto__add_field_user_public_name__add_field_user_biography__add_field_.py | 2 | 5176 | # -*- 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 'User.public_name'
db.add_column(u'users_user', 'public_name',
self.gf(... | mit |
atlasmapper/atlasmapper | clientResources/amc/OpenLayers/OpenLayers-2.12/tools/exampleparser.py | 111 | 8324 | #!/usr/bin/env python
import sys
import os
import re
import urllib2
import time
from xml.dom.minidom import Document
try:
import xml.etree.ElementTree as ElementTree
except ImportError:
try:
import cElementTree as ElementTree
except ImportError:
try:
import elementtree.Element... | gpl-3.0 |
yamt/ryu | ryu/lib/quantum_ifaces.py | 36 | 4289 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2012 Isaku Yamahata <yamahata at private email ne jp>
#
# 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
#
# h... | apache-2.0 |
rhyolight/nupic.son | app/mapreduce/lib/files/file.py | 4 | 17745 | #!/usr/bin/env python
#
# Copyright 2007 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 o... | apache-2.0 |
aknutas/servers | nginx/lancache/build/docopt/examples/git/git_clone.py | 17 | 1250 | """usage: git clone [options] [--] <repo> [<dir>]
-v, --verbose be more verbose
-q, --quiet be more quiet
--progress force progress reporting
-n, --no-checkout don't create a checkout
--bare create a bare repository
--mirror create a ... | gpl-2.0 |
agepoly/mezzanine | mezzanine/blog/feeds.py | 9 | 3475 | from __future__ import unicode_literals
from django.contrib.syndication.views import Feed
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404
from django.utils.feedgenerator import Atom1Feed
from django.utils.html import strip_tags
from mezzanine.core.templatetags.mezzanine_tag... | bsd-2-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.