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 |
|---|---|---|---|---|---|
keshonok/linux-3.10.10-sync_sockets | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
kirca/OpenUpgrade | addons/point_of_sale/wizard/pos_open_statement.py | 387 | 4217 | # -*- 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 |
Letractively/kay-framework | kay/i18n/__init__.py | 10 | 10059 | # -*- coding: utf-8 -*-
"""
kay.i18n
~~~~~~~~~
Kay i18n tools. This module provides various helpers for
internationalization. That is a translation system (with an API,
compatible to standard gettext), timezone helpers as well as date
parsing and formatting functions.
General Architecture
--------------------
The ... | bsd-3-clause |
bquast/rnnlib | examples/arabic_offline_handwriting/arabic_offline.py | 7 | 6600 | #!/usr/bin/env python
import netcdf_helpers
from optparse import OptionParser
import sys
from PIL import Image
from numpy import *
import re
inputMean = 226.8663
inputStd = 81.62196
#command line options
parser = OptionParser()
parser.add_option("-l", "--lookupfile", action="store", type="string", dest="lookupFile", ... | gpl-3.0 |
Weihonghao/ECM | Vpy34/lib/python3.5/site-packages/tensorflow/contrib/slim/python/slim/data/data_decoder.py | 26 | 2298 | # 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 applicable ... | agpl-3.0 |
henry-ajere/rad2py | ide2py/connector.py | 8 | 3756 | #!/usr/bin/env python
# coding:utf-8
"Connectors for ALM (Application Lifecycle Management)"
__author__ = "Mariano Reingart (reingart@gmail.com)"
__copyright__ = "Copyright (C) 2014 Mariano Reingart"
__license__ = "GPL 3.0"
# import SDKs
try:
# using https://github.com/michaelliao/githubpy/blob/master/github.py... | gpl-3.0 |
alexnowakvila/DCN | code/K-means/data_generator.py | 1 | 4780 | import numpy as np
import os
from scipy.spatial import ConvexHull
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
import matplotlib.cm as cm
class Generator(object):
def __init__(
self, num_examp... | bsd-3-clause |
walterbender/turtlepond | utils.py | 1 | 1877 | #Copyright (c) 2011 Walter Bender
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# You should have received a copy o... | gpl-3.0 |
MrLoick/python-for-android | python-modules/twisted/twisted/words/test/test_xmlstream.py | 54 | 5484 | # Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.words.xish.xmlstream}.
"""
from twisted.internet import protocol
from twisted.trial import unittest
from twisted.words.xish import domish, utility, xmlstream
class XmlStreamTest(unittest.TestCase):
def setUp... | apache-2.0 |
Renelvon/txrudp | setup.py | 1 | 1308 | """Setup module for txrudp."""
import codecs
from os import path
import sys
from setuptools import setup
_HERE = path.abspath(path.dirname(__file__))
with codecs.open(path.join(_HERE, 'README.rst'), encoding='utf-8') as f:
_LONG_DESCRIPTION = f.read()
setup(
name='txrudp',
version='0.5.1',
descript... | mit |
archtool/archtool | src/gui/details_editor.py | 1 | 33028 | '''
Created on Oct 6, 2013
@author: EHWAAL
Copyright (C) 2014 Evert van de Waal
This program is released under the conditions of the GNU General Public License.
'''
from contextlib import contextmanager
from datetime import timedelta
import os.path
from PyQt4 import QtCore, QtGui
from sqlalchemy imp... | gpl-3.0 |
neno1978/pelisalacarta | python/main-classic/lib/requests/packages/chardet/euckrprober.py | 2931 | 1675 | ######################## 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 |
howcouldyouforgetthisusername/aries-analyzer | build/main/setuptools-27.2.0-py2.7.egg/setuptools/command/egg_info.py | 49 | 17447 | """setuptools.command.egg_info
Create a distribution's .egg-info directory and contents"""
from distutils.filelist import FileList as _FileList
from distutils.util import convert_path
from distutils import log
import distutils.errors
import distutils.filelist
import os
import re
import sys
import io
import warnings
i... | mit |
sdn-ixp/iSDX | pctrl/mds_lib_old.py | 4 | 8610 | #############################################
# MDS Algorithm #
# author: Arpit Gupta (glex.qsd@gmail.com) #
#############################################
import os
import sys
import time
from multiprocessing import Process, Queue
import multiprocessing as mp
import cProfile
from math impor... | apache-2.0 |
BITalinoWorld/revolution-python-api | bitalino.py | 1 | 25419 | # -*- coding: utf-8 -*-
"""
.. module:: bitalino
:synopsis: BITalino API
*Created on Fri Jun 20 2014*
*Last Modified on Thur Jun 25 2015*
"""
__author__ = "Pedro Gonçalves & Carlos Azevedo"
__credits__ = ["Carlos Azevedo", "Pedro Gonçalves", "Hugo Silva",
"Takuma Hashimoto", "Rui Freixo", "Mar... | gpl-3.0 |
gveltri/three.js | utils/exporters/blender/tests/scripts/review.py | 305 | 3697 | import os
import json
import stat
import shutil
import argparse
os.chdir(os.path.dirname(os.path.realpath(__file__)))
os.chdir('..')
review = os.path.join(os.getcwd(), 'review')
MASK = stat.S_IRWXU|stat.S_IRGRP|stat.S_IXGRP|stat.S_IROTH|stat.S_IXOTH
HTML = '''<!doctype html>
<html lang='en'>
<head>
<title>%(t... | mit |
openstack/python-mistralclient | mistralclient/utils.py | 1 | 2662 | # Copyright 2015 - Huawei Technologies Co. Ltd
# Copyright 2015 - StackStorm, 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... | apache-2.0 |
sam-m888/gramps | gramps/gui/logger/test/rotate_handler_test.py | 9 | 3336 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
#
# 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 you... | gpl-2.0 |
mrZizik/lab_reports | DSLAB1/reducer.py | 1 | 1041 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from itertools import groupby
from operator import itemgetter
import sys
def read_mapper_output(file, separator='\t'):
for line in file:
yield line.rstrip().split(separator)
def main(separator='\t'):
data = read_mapper_output(sys.stdin, separator=separator)
... | apache-2.0 |
timodonnell/sefara | sefara/hooks.py | 1 | 7976 | # Copyright (c) 2015. Mount Sinai School of Medicine
#
# 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 |
adrian-ionescu/apache-spark | examples/src/main/python/ml/bisecting_k_means_example.py | 69 | 1777 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
qinjian623/emacs-config | .python-environments/default/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/sjisprober.py | 1182 | 3734 | ######################## 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 |
flyingfish007/tempest | tempest/services/volume/json/admin/volume_hosts_client.py | 9 | 1411 | # Copyright 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 requ... | apache-2.0 |
peak6/st2 | st2client/tests/unit/test_interactive.py | 3 | 12439 | # Licensed to the StackStorm, Inc ('StackStorm') 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 th... | apache-2.0 |
jonathonwalz/ansible | lib/ansible/modules/monitoring/monit.py | 28 | 7072 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Darryl Stoflet <stoflet@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | gpl-3.0 |
cage1016/generator-django-oscar-app | generators/app/templates/docs/conf.py | 1 | 12820 | # -*- coding: utf-8 -*-
#
# <%= packagename %> documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 29 11:35:23 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated ... | bsd-3-clause |
smartstudy/midauth | midauth/web/user.py | 1 | 7376 | # -*- coding: utf-8 -*-
import datetime
import urllib
import urllib2
import json
from flask import Blueprint
from flask import request
from flask import render_template, redirect, url_for, abort
import flask.ext.login
from flask.ext.login import login_required, current_user
from flask.ext.oauthlib.client import OAuthE... | mit |
bzbarsky/servo | tests/wpt/css-tests/tools/webdriver/webdriver/client.py | 59 | 16365 | # 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 urlparse
import error
import transport
element_key = "element-6066-11e4-a52e-4f735466cecf"
def command(func)... | mpl-2.0 |
gonboy/sl4a | python/src/Lib/bsddb/test/test_get_none.py | 36 | 2238 | """
TestCases for checking set_get_returns_none.
"""
import os, string
import unittest
from test_all import db, verbose, get_new_database_path
#----------------------------------------------------------------------
class GetReturnsNoneTestCase(unittest.TestCase):
def setUp(self):
self.filename = get_ne... | apache-2.0 |
ecolitan/fatics | venv/lib/python2.7/site-packages/twisted/news/test/test_database.py | 60 | 7548 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.news.database}.
"""
__metaclass__ = type
from email.Parser import Parser
from socket import gethostname
from twisted.trial.unittest import TestCase
from twisted.internet.defer import succeed
from twisted.mail.smtp import... | agpl-3.0 |
forpster/dotfiles | home/.emacs.d/.python-environments/default/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/eucjpprober.py | 2919 | 3678 | ######################## 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 |
joecheng511/try-wagtail | mysite/blog/migrations/0002_blogpage.py | 1 | 1039 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-12 05:04
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0033_remov... | apache-2.0 |
xpansa/stock-logistics-workflow | stock_picking_show_returns/__openerp__.py | 13 | 1591 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2013 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
# Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# $Id$
#
# This program is... | agpl-3.0 |
AVOXI/b2bua | sippy/SipContentType.py | 2 | 1766 | # Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.
# Copyright (c) 2006-2014 Sippy Software, Inc. All rights reserved.
#
# 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. Redistrib... | bsd-2-clause |
brakhane/python-mode | pymode/libs/pylama/lint/pylama_pylint/logilab/common/ureports/nodes.py | 42 | 5810 | # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... | lgpl-3.0 |
armleo/limbo-android | jni/qemu/scripts/tracetool/backend/ust.py | 114 | 2403 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
LTTng User Space Tracing backend.
"""
__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 Hajno... | gpl-2.0 |
andymckay/django | django/core/cache/backends/locmem.py | 16 | 4452 | "Thread-safe in-memory cache backend."
import time
try:
import cPickle as pickle
except ImportError:
import pickle
from django.core.cache.backends.base import BaseCache
from django.utils.synch import RWLock
# Global in-memory store of cache data. Keyed by name, to provide
# multiple named local memory caches... | bsd-3-clause |
ingadhoc/account-invoicing | account_invoice_tax/wizards/account_invoice_tax.py | 1 | 3294 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, api
class AccountInvoiceTax(models.TransientModel):
_name = 'account.invoice.tax'
_description = 'Account Invoice Tax'
move_id = fields.Many2one('account.move', required=True)
type_operation =... | agpl-3.0 |
andmos/ansible | lib/ansible/modules/network/iosxr/iosxr_facts.py | 14 | 12861 | #!/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 |
ledtvavs/repository.ledtv | script.tvguide.Vader/unidecode/x0cb.py | 253 | 5012 | data = (
'jjwaels', # 0x00
'jjwaelt', # 0x01
'jjwaelp', # 0x02
'jjwaelh', # 0x03
'jjwaem', # 0x04
'jjwaeb', # 0x05
'jjwaebs', # 0x06
'jjwaes', # 0x07
'jjwaess', # 0x08
'jjwaeng', # 0x09
'jjwaej', # 0x0a
'jjwaec', # 0x0b
'jjwaek', # 0x0c
'jjwaet', # 0x0d
'jjwaep', # 0x0e
'jjw... | gpl-3.0 |
CamelBackNotation/CarnotKE | jyhton/lib-python/2.7/plat-mac/lib-scriptpackages/Explorer/Required_Suite.py | 73 | 3327 | """Suite Required Suite: Events that every application should support
Level 1, version 1
Generated from /Applications/Internet Explorer.app
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'reqd'
from StdSuites.Required_Suite import *
class Required_Suite_Events(Required_... | apache-2.0 |
mixturemodel-flow/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/distribution_util_test.py | 8 | 12215 | # 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 |
mikehearn/bitcoinxt | qa/rpc-tests/receivedby.py | 164 | 7410 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the listreceivedbyaddress API
from test_framework import BitcoinTestFramework
from bitcoinrpc.auth... | mit |
kyoshino/bedrock | tests/pages/firefox/all.py | 1 | 1406 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from selenium.webdriver.common.by import By
from pages.firefox.base import FirefoxBasePage, FirefoxBaseRegion
class F... | mpl-2.0 |
apavlo/h-store | third_party/python/boto/route53/hostedzone.py | 59 | 2124 | # Copyright (c) 2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, 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 restrict... | gpl-3.0 |
RackSec/ansible | test/units/modules/network/vyos/vyos_module.py | 59 | 3256 | # (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 |
Gregory-Howard/spaCy | spacy/tests/tokenizer/test_exceptions.py | 4 | 1344 | # coding: utf-8
"""Test that tokenizer exceptions and emoticons are handled correctly."""
from __future__ import unicode_literals
import pytest
def test_tokenizer_handles_emoticons(tokenizer):
# Tweebo challenge (CMU)
text = """:o :/ :'( >:o (: :) >.< XD -__- o.O ;D :-) @_@ :P 8D :1 >:( :D =| ") :> ...."""... | mit |
GiedriusM/openthread | tools/harness-automation/cases/leader_5_6_6.py | 16 | 1875 | #!/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 |
Ladsgroup/sync_github_bot | sync_github_bot.py | 1 | 6745 | """
WIP
It's an script to syncronize github and gerrit
"""
import json
import os
#import codecs
from urllib.request import urlopen, urlretrieve
from urllib.error import HTTPError
from getpass import getpass
from subprocess import Popen, STDOUT, PIPE
_program_dir = os.path.dirname(os.path.realpath(__file__))
_github... | mit |
fdecourcelle/meanfde | node_modules/meanio/node_modules/mean-cli/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py | 457 | 112827 | # Copyright (c) 2012 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.
from compiler.ast import Const
from compiler.ast import Dict
from compiler.ast import Discard
from compiler.ast import List
from compiler.ast import Module
from co... | mit |
ryneeverett/mezzanine | mezzanine/pages/views.py | 9 | 4502 | from __future__ import unicode_literals
from future.builtins import str
from django.contrib.admin.views.decorators import staff_member_required
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponse, Http404
from django.shortcuts import get_object_or_404
from django.contrib import... | bsd-2-clause |
Etxea/gestioneide | matriculas/migrations/0002_auto_20200517_1032.py | 1 | 3845 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.21 on 2020-05-17 08:32
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('matriculas', '0001_initial'),
]
operations = [
... | gpl-3.0 |
ehashman/oh-mainline | vendor/packages/twisted/twisted/test/proto_helpers.py | 19 | 15298 | # -*- test-case-name: twisted.test.test_stringtransport -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Assorted functionality which is commonly useful when writing unit tests.
"""
from StringIO import StringIO
from zope.interface import implements
from twisted.internet.interfaces im... | agpl-3.0 |
undergroundtheater/gameheart | paypal/standard/pdt/migrations/0001_first_migration.py | 15 | 22555 | # -*- coding: utf-8 -*-
from south.db import db
from django.db import models
from paypal.standard.pdt.models import *
class Migration:
def forwards(self, orm):
# Adding model 'PayPalPDT'
db.create_table('paypal_pdt', (
('id', models.AutoField(primary_key=True)),
... | mit |
mattanimation/PyCommune | SideMail/messedit.py | 1 | 6177 | from PyQt4 import QtGui,QtCore
import sys
import smtplib,time,base64
import utils
from userdata import UserData
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.application import MIMEApplication
import email.iterators as iterators
class MessageEditor(QtGui.QWidget):... | mit |
tobegit3hub/deep_cnn | java_predict_client/src/main/proto/tensorflow/python/ops/nn.py | 4 | 58800 | # 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 |
Awesomeomics/webserver | env/lib/python2.7/site-packages/flask/sessions.py | 428 | 13107 | # -*- coding: utf-8 -*-
"""
flask.sessions
~~~~~~~~~~~~~~
Implements cookie based sessions based on itsdangerous.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import uuid
import hashlib
from base64 import b64encode, b64decode
from datetime import dateti... | mit |
collex100/odoo | openerp/tools/misc.py | 20 | 45940 | # -*- 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 |
ychfan/tensorflow | tensorflow/python/ops/variables.py | 2 | 60597 | # 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 |
abad623/verbalucce | verbalucce/nltk/tag/__init__.py | 5 | 4331 | # Natural Language Toolkit: Taggers
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au> (minor additions)
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
NLTK Taggers
This package contains classes ... | apache-2.0 |
40223114/2015_g4 | static/Brython3.1.1-20150328-091302/Lib/types.py | 756 | 3167 | """
Define names for built-in types that aren't directly accessible as a builtin.
"""
import sys
# Iterators in Python aren't a matter of type but of protocol. A large
# and changing number of builtin types implement *some* flavor of
# iterator. Don't check the type! Use hasattr to check for both
# "__iter__" and "... | gpl-3.0 |
ethereum/ethereum-buildbot | factories/go_ethereum_arm.py | 1 | 3942 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import factory
reload(factory)
from factory import *
import go_ethereum
reload(go_ethereum)
from go_ethereum import get_short_revision_go
def arm_go_factory(branch='develop', isPullRequest=False):
factory = BuildFactory()
env = {
"CC": "arm-linux-gnueab... | mit |
JCROM-Android/jcrom_external_chromium_org | third_party/tlslite/tlslite/integration/IntegrationHelper.py | 121 | 1788 |
class IntegrationHelper:
def __init__(self,
username=None, password=None, sharedKey=None,
certChain=None, privateKey=None,
cryptoID=None, protocol=None,
x509Fingerprint=None,
x509TrustList=None, x509CommonName=None,
settings = Non... | bsd-3-clause |
betoesquivel/fil2014 | build/django/build/lib.linux-x86_64-2.7/django/utils/deprecation.py | 133 | 2395 | import inspect
import warnings
class warn_about_renamed_method(object):
def __init__(self, class_name, old_method_name, new_method_name, deprecation_warning):
self.class_name = class_name
self.old_method_name = old_method_name
self.new_method_name = new_method_name
self.deprecation... | mit |
alconsoto/plugin-video-IPTV-3STAR-MONARCA | server.py | 31 | 7019 | import json
import urllib
import urllib2
from urlparse import urlparse, parse_qs
import load_channels
import SocketServer
import socket
import SimpleHTTPServer
import string,cgi,time
from os import curdir, sep
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import xbmc
import xbmcaddon
import xbmcgui
impo... | gpl-2.0 |
SimonSapin/servo | tests/wpt/web-platform-tests/tools/third_party/hyper/hyper/common/util.py | 36 | 1374 | # -*- coding: utf-8 -*-
"""
hyper/common/util
~~~~~~~~~~~~~~~~~
General utility functions for use with hyper.
"""
from hyper.compat import unicode, bytes, imap
from ..packages.rfc3986.uri import URIReference
from ..compat import is_py3
def to_bytestring(element):
"""
Converts a single string to a bytestring,... | mpl-2.0 |
bwasti/caffe2 | caffe2/python/mkl/mkl_LRN_op_test.py | 2 | 1315 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import hypothesis.strategies as st
from hypothesis import given, settings
import numpy as np
from caffe2.python import core, workspace
import caffe2.pytho... | apache-2.0 |
Pentadactylus/sm_openstack | sm/managers/openbaton_manager.py | 1 | 7360 | # Copyright 2014-2015 Zuercher Hochschule fuer Angewandte Wissenschaften
# 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/lice... | apache-2.0 |
cruzegoodin/TSC-ShippingDetails | venv/lib/python2.7/site-packages/setuptools/dist.py | 259 | 35320 | __all__ = ['Distribution']
import re
import os
import sys
import warnings
import numbers
import distutils.log
import distutils.core
import distutils.cmd
import distutils.dist
from distutils.core import Distribution as _Distribution
from distutils.errors import (DistutilsOptionError, DistutilsPlatformError,
Distuti... | bsd-3-clause |
factorlibre/OCB | addons/point_of_sale/report/pos_order_report.py | 1 | 4348 | # -*- 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 |
ZhaoCJ/django | tests/queryset_pickle/models.py | 5 | 1368 | import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
def standalone_number():
return 1
class Numbers(object):
@staticmethod
def get_static_number():
return 2
@classmethod
def get_class_number(cls):
return 3
def get_member_numb... | bsd-3-clause |
bokorir/bootstrap | test-infra/s3_cache.py | 2166 | 5734 | #!/usr/bin/env python2.7
# pylint: disable=C0301
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, chdir, remove as _delete_file
from os.path import dirname, basename, abspath, realpath, expandvars
from hashlib import sha256
from subpr... | mit |
emon10005/sympy | sympy/polys/domains/polynomialring.py | 101 | 4409 | """Implementation of :class:`PolynomialRing` class. """
from __future__ import print_function, division
from sympy.polys.domains.ring import Ring
from sympy.polys.domains.compositedomain import CompositeDomain
from sympy.polys.polyerrors import CoercionFailed, GeneratorsError
from sympy.utilities import public
@pub... | bsd-3-clause |
devicehive/devicehive-python | examples/echo.py | 1 | 1804 | # Copyright (C) 2018 DataArt
#
# 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 |
census-instrumentation/opencensus-python | tests/unit/stats/test_measure_to_view_map.py | 1 | 16207 | # Copyright 2018, OpenCensus 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 w... | apache-2.0 |
ylatuya/Flumotion | flumotion/admin/text/greeter.py | 4 | 6411 | # -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008 Fluendo, S.L. (www.fluendo.com).
# All rights reserved.
# This file may be distributed and/or modified under the terms of
# the GNU General Public License version 2 as published by
# the ... | gpl-2.0 |
yongshengwang/builthue | desktop/core/ext-py/Django-1.4.5/django/core/management/base.py | 78 | 13744 | """
Base classes for writing management commands (named commands which can
be executed through ``django-admin.py`` or ``manage.py``).
"""
from __future__ import with_statement
import os
import sys
from optparse import make_option, OptionParser
import traceback
import django
from django.core.exceptions import Imprope... | apache-2.0 |
yanheven/console | openstack_dashboard/dashboards/project/network_topology/ports/tables.py | 8 | 1090 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 NTT Innovation Institute 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... | apache-2.0 |
ramadhane/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/__init__.py | 392 | 1180 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
Pajinek/spacewalk | client/rhel/rhn-client-tools/src/up2date_client/transaction.py | 10 | 4193 |
#
# Client code for Update Agent
# Copyright (c) 1999--2016 Red Hat, Inc. Distributed under GPLv2.
#
# Adrian Likins <alikins@redhat.com
#
#
# a couple of classes wrapping up transactions so that we
# can share transactions instead of creating new ones all over
#
import rpm
read_ts = None
ts = None
# **... | gpl-2.0 |
alexgorban/models | research/im2txt/im2txt/inference_wrapper.py | 32 | 1866 | # 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 |
Lcaracol/ideasbox.lan | ideasbox/blog/tests/test_search.py | 1 | 1985 | # -*- coding: utf-8 -*-
import pytest
from ideasbox.search.models import Search
from ..models import Content
pytestmark = pytest.mark.django_db
def test_nothing_is_indexed_without_any_fixture():
assert Content.objects.count() == 0
def test_draft_is_indexed(draft):
assert Content.objects.count() == 1
... | mit |
idncom/odoo | addons/product/tests/test_pricelist.py | 280 | 6748 | from openerp.tests.common import TransactionCase
class TestPricelist(TransactionCase):
"""Tests for unit of measure conversion"""
def setUp(self):
super(TestPricelist, self).setUp()
cr, uid, context = self.cr, self.uid, {}
self.ir_model_data = self.registry('ir.model.data')
sel... | agpl-3.0 |
trankmichael/scipy | scipy/optimize/tnc.py | 115 | 16533 | # TNC Python interface
# @(#) $Jeannot: tnc.py,v 1.11 2005/01/28 18:27:31 js Exp $
# Copyright (c) 2004-2005, Jean-Sebastien Roy (js@jeannot.org)
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Soft... | bsd-3-clause |
davidam/python-examples | poo/fraction/test/test_fraction.py | 1 | 1131 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2018 David Arroyo Menéndez
# Author: David Arroyo Menéndez <davidam@gnu.org>
# Maintainer: David Arroyo Menéndez <davidam@gnu.org>
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | gpl-3.0 |
p4datasystems/CarnotKEdist | dist/Lib/unittest/loader.py | 29 | 13558 | """Loading unittests."""
import os
import re
import sys
import traceback
import types
from functools import cmp_to_key as _CmpToKey
from fnmatch import fnmatch
from . import case, suite
__unittest = True
# what about .pyc or .pyo (etc)
# we would need to avoid loading the same tests multiple times
# from '.py', '.... | apache-2.0 |
mheap/ansible | lib/ansible/module_utils/network/ios/ios.py | 1 | 5824 | # 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 |
sandeepdsouza93/TensorFlow-15712 | tensorflow/contrib/linear_optimizer/python/kernel_tests/sdca_ops_test.py | 6 | 45648 | # 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 |
ofilipowicz/owndb | store/models.py | 1 | 11291 | from django.db import models
from django.db.models import Q
from django.db.models.signals import post_delete, pre_delete, post_save
from django.contrib.auth.models import User
from django.utils.html import format_html
from django.utils.translation import ugettext as _
from django.contrib.contenttypes.fields import Gen... | mit |
pinterb/st2 | tools/queue_producer.py | 2 | 1923 | #!/usr/bin/env python
# Licensed to the StackStorm, Inc ('StackStorm') 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... | apache-2.0 |
procangroup/edx-platform | openedx/core/djangoapps/user_api/accounts/tests/test_api.py | 1 | 21093 | # -*- coding: utf-8 -*-
"""
Unit tests for behavior that is specific to the api methods (vs. the view methods).
Most of the functionality is covered in test_views.py.
"""
import re
import ddt
import pytest
from dateutil.parser import parse as parse_datetime
from django.conf import settings
from django.contrib.auth.mo... | agpl-3.0 |
thanhacun/odoo | addons/hr_payroll/hr_payroll.py | 144 | 49776 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it ... | agpl-3.0 |
broesamle/servo | tests/wpt/css-tests/tools/html5lib/html5lib/filters/whitespace.py | 1730 | 1142 | from __future__ import absolute_import, division, unicode_literals
import re
from . import _base
from ..constants import rcdataElements, spaceCharacters
spaceCharacters = "".join(spaceCharacters)
SPACES_REGEX = re.compile("[%s]+" % spaceCharacters)
class Filter(_base.Filter):
spacePreserveElements = frozenset... | mpl-2.0 |
Distrotech/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/tests/test_geoforms.py | 94 | 2671 | from django.forms import ValidationError
from django.contrib.gis import forms
from django.contrib.gis.geos import GEOSGeometry
from django.utils import unittest
class GeometryFieldTest(unittest.TestCase):
def test00_init(self):
"Testing GeometryField initialization with defaults."
fld = forms.Geo... | apache-2.0 |
mvo5/python-apt | doc/examples/acquire.py | 2 | 2078 | #!/usr/bin/python
import apt
import apt.progress.text
import apt_pkg
import os
def get_file(fetcher, uri, destfile):
# get the file
af = apt_pkg.AcquireFile(fetcher, uri=uri, descr="sample descr",
destfile=destfile)
print "desc_uri: %s -> %s" % (af.desc_uri, af.destfile)
... | gpl-2.0 |
talhajaved/nyuadmarket | flask/lib/python2.7/site-packages/openid/urinorm.py | 159 | 5230 | import re
# from appendix B of rfc 3986 (http://www.ietf.org/rfc/rfc3986.txt)
uri_pattern = r'^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?'
uri_re = re.compile(uri_pattern)
# gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"
#
# sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
# / "*"... | mit |
kumarkrishna/sympy | sympy/core/tests/test_function.py | 33 | 23495 | from sympy import (Lambda, Symbol, Function, Derivative, Subs, sqrt,
log, exp, Rational, Float, sin, cos, acos, diff, I, re, im,
E, expand, pi, O, Sum, S, polygamma, loggamma, expint,
Tuple, Dummy, Eq, Expr, symbols, nfloat)
from sympy.utilities.pytest import XFAIL, raises
from sympy.abc import ... | bsd-3-clause |
mwutzke/faucet | clib/mininet_test_base_topo.py | 2 | 33750 | #!/usr/bin/env python3
import os
import random
import re
import time
import ipaddress
import pprint
from functools import partial
import yaml # pytype: disable=pyi-error
from clib.mininet_test_util import timeout_cmd
from clib.mininet_test_base import FaucetTestBase, IPV4_ETH
from clib.config_generator import Faucet... | apache-2.0 |
stas/peewee | playhouse/tests/test_manytomany.py | 5 | 11641 | from peewee import *
from playhouse.fields import DeferredThroughModel
from playhouse.fields import ManyToManyField
from playhouse.tests.base import database_initializer
from playhouse.tests.base import ModelTestCase
db = database_initializer.get_in_memory_database()
class BaseModel(Model):
class Meta:
d... | mit |
james-dibble/Embedded-Systems-Assignment | EmbeddedSystems.Applications/EmbeddedSystems.Client/jsoncpp-src-0.6.0-rc2/devtools/fixeol.py | 247 | 1941 | import os.path
def fix_source_eol( path, is_dry_run = True, verbose = True, eol = '\n' ):
"""Makes sure that all sources have the specified eol sequence (default: unix)."""
if not os.path.isfile( path ):
raise ValueError( 'Path "%s" is not a file' % path )
try:
f = open(path, 'rb')
exce... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.