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 |
|---|---|---|---|---|---|
allenap/python-tx-tftp | tftp/datagram.py | 1 | 12024 | '''
@author: shylent
'''
from itertools import chain
from tftp.errors import (WireProtocolError, InvalidOpcodeError,
PayloadDecodeError, InvalidErrorcodeError, OptionsDecodeError)
from twisted.python.util import OrderedDict
import struct
OP_RRQ = 1
OP_WRQ = 2
OP_DATA = 3
OP_ACK = 4
OP_ERROR = 5
OP_OACK = 6
ERR_NO... | mit |
publicRoman/spark | python/pyspark/mllib/fpm.py | 71 | 6716 | #
# 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 |
keyurpatel076/MissionPlannerGit | packages/IronPython.StdLib.2.7.4/content/Lib/Cookie.py | 41 | 25912 | #!/usr/bin/env python
#
####
# Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software
# and its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in ... | gpl-3.0 |
goal/uwsgi | tests/queue.py | 21 | 1341 | # uwsgi --queue 10 --queue-store test.queue --master --module tests.queue --socket :3031
import uwsgi
import os
from flask import Flask, render_template, request, redirect, flash
app = Flask(__name__)
app.debug = True
app.secret_key = os.urandom(24)
@app.route('/')
def index():
return render_template('queue.htm... | gpl-2.0 |
yfried/ansible | lib/ansible/plugins/terminal/cnos.py | 86 | 2824 | # (C) 2017 Red Hat Inc.
# Copyright (C) 2017 Lenovo.
#
# GNU General Public License v3.0+
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for ... | gpl-3.0 |
yetsky/extra | packages/my-application/python-all/files/usr/lib/python2.7/shelve.py | 225 | 8078 | """Manage shelves of pickled objects.
A "shelf" is a persistent, dictionary-like object. The difference
with dbm databases is that the values (not the keys!) in a shelf can
be essentially arbitrary Python objects -- anything that the "pickle"
module can handle. This includes most class instances, recursive data
type... | gpl-2.0 |
gg7/diamond | src/collectors/snmp/snmp.py | 2 | 4277 | # coding=utf-8
"""
SNMPCollector is a special collector for collecting data by using SNMP
#### Dependencies
* pysnmp
"""
import socket
import warnings
# pysnmp packages on debian 6.0 use sha and md5 which are deprecated
# packages. there is nothing to be done about it until pysnmp
# updates to use new hashlib m... | mit |
twz915/django | django/core/cache/backends/db.py | 28 | 8456 | "Database cache backend."
import base64
import pickle
from datetime import datetime
from django.conf import settings
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
from django.db import DatabaseError, connections, models, router, transaction
from django.utils import timezone
from django.utils.e... | bsd-3-clause |
bowang/tensorflow | tensorflow/python/training/session_run_hook.py | 23 | 10423 | # 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 |
rmboggs/django | tests/template_tests/filter_tests/test_truncatewords_html.py | 386 | 1607 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template.defaultfilters import truncatewords_html
from django.test import SimpleTestCase
class FunctionTests(SimpleTestCase):
def test_truncate_zero(self):
self.assertEqual(truncatewords_html('<p>one <a href="#">two - three <br>... | bsd-3-clause |
andremiller/beets | beetsplug/missing.py | 1 | 5696 | # This file is part of beets.
# Copyright 2015, Pedro Silva.
#
# 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... | mit |
nolouch/shadowsocks | shadowsocks/crypto/rc4_md5.py | 7 | 1856 | #!/usr/bin/env python
# Copyright (c) 2014 clowwindy
#
# 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, me... | mit |
OCA/stock-logistics-warehouse | stock_cycle_count/reports/report_stock_location_accuracy.py | 1 | 1330 | # Copyright 2017 Eficent Business and IT Consulting Services S.L.
# (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, models
class LocationAccuracyReport(models.AbstractModel):
_name = "report.stock_location_accuracy"
_description = "Locati... | agpl-3.0 |
HorvathLab/NGS | RNA2DNAlign/src/summary_analysis.py | 1 | 4036 | #!/bin/env python2.7
import sys
import csv
import os.path
from collections import defaultdict, Counter
from operator import itemgetter
def read_events(file):
cosmic_dic = defaultdict(list)
count = 0
count_sam = 0
l = []
total = Counter()
l_sam = []
count_A_T = 0
count_A_G = 0
count... | mit |
tonk/ansible | test/units/module_utils/common/validation/test_check_required_together.py | 44 | 1494 | # -*- coding: utf-8 -*-
# Copyright (c) 2020 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
import pytest
from ansible.module_utils._text import to_native
from ansible.m... | gpl-3.0 |
alexmandujano/django | django/core/files/temp.py | 106 | 2149 | """
The temp module provides a NamedTemporaryFile that can be re-opened on any
platform. Most platforms use the standard Python tempfile.TemporaryFile class,
but MS Windows users are given a custom class.
This is needed because in Windows NT, the default implementation of
NamedTemporaryFile uses the O_TEMPORARY flag, ... | bsd-3-clause |
madjam/mxnet | example/bi-lstm-sort/infer_sort.py | 25 | 2197 | # 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 u... | apache-2.0 |
dariomangoni/chrono | src/demos/python/core/demo_CH_coords.py | 4 | 2825 | #------------------------------------------------------------------------------
# Name: pychrono example
# Purpose:
#
# Author: Alessandro Tasora
#
# Created: 1/01/2019
# Copyright: (c) ProjectChrono 2019
#------------------------------------------------------------------------------
print ("First tu... | bsd-3-clause |
wakatime/sublime-wakatime | packages/wakatime/packages/urllib3/contrib/pyopenssl.py | 85 | 15354 | """
SSL with SNI_-support for Python 2. Follow these instructions if you would
like to verify SSL certificates in Python 2. Note, the default libraries do
*not* do certificate checking; you need to do additional work to validate
certificates yourself.
This needs the following packages installed:
* pyOpenSSL (tested w... | bsd-3-clause |
monkiineko/mbed-os | tools/export/ds5_5/__init__.py | 28 | 2044 | """
mbed SDK
Copyright (c) 2011-2016 ARM Limited
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 wr... | apache-2.0 |
nicoboss/Floatmotion | OpenGL/GL/ARB/compressed_texture_pixel_storage.py | 9 | 2196 | '''OpenGL extension ARB.compressed_texture_pixel_storage
This module customises the behaviour of the
OpenGL.raw.GL.ARB.compressed_texture_pixel_storage to provide a more
Python-friendly API
Overview (from the spec)
This extension expands the functionality of the PixelStore modes
to allow UNPACK_ROW_LENGTH, UNPA... | agpl-3.0 |
barm4ley/salt-docker-mongo | saltstack/salt/mongo/files/setup_replset.py | 1 | 2516 | #!/usr/bin/env python
import __future__
import pymongo
import argparse
{% from "mongo/map.jinja" import mongo with context %}
USERNAME = '{{ mongo.creds.superuser.name }}'
PASSWORD = '{{ mongo.creds.superuser.password }}'
def get_replset_members(client):
return [node[0] + ':' + str(node[1]) for node in client.n... | apache-2.0 |
ega1979/ros_book_programs | ros_start/scritps/color.py | 2 | 1143 | #!/usr/bin/env python
import rospy
import cv2
import numpy as np
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
class ColorExtract(object):
def __init__(self):
self._image_pub = rospy.Publisher('masked_image', Image, queue_size=1)
self._image_sub = rospy.Subscriber... | bsd-2-clause |
wazo-pbx/xivo-auth | alembic/versions/35bcf76df780_add_acl_for_new_chat_message__events.py | 1 | 2856 | """add ACL for new chat_message_* events
Revision ID: 35bcf76df780
Revises: 192f49b6ec34
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '35bcf76df780'
down_revision = '192f49b6ec34'
POLICY_NAME = 'wazo_default_user_policy'
ACL_TEMPLATES = ['events.chat.messa... | gpl-3.0 |
robojukie/app-template | fabfile/flat.py | 17 | 3311 | #!/usr/bin/env python
import copy
from cStringIO import StringIO
from fnmatch import fnmatch
import gzip
import hashlib
import mimetypes
import os
from boto.s3.key import Key
import app_config
import utils
GZIP_FILE_TYPES = ['.html', '.js', '.json', '.css', '.xml']
class FakeTime:
def time(self):
retur... | mit |
topaxi/freedomvote | app/core/models.py | 1 | 8954 | from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import force_unicode
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from django.conf import settings
import base64
import os
def generate_url():
key = base64.ur... | gpl-3.0 |
ArneBab/pypyjs | website/demo/home/rfk/repos/pypy/lib-python/conftest.py | 2 | 27366 | """
test configuration(s) for running CPython's regression
test suite on top of PyPy
"""
import py
import sys
import pypy
import re
from pypy.interpreter.gateway import ApplevelClass
from pypy.interpreter.error import OperationError
from pypy.interpreter.module import Module as PyPyModule
from pypy.interpreter.main i... | mit |
Shade5/coala-bears | bears/python/PyUnusedCodeBear.py | 7 | 1645 | import autoflake
from coalib.bears.LocalBear import LocalBear
from dependency_management.requirements.PipRequirement import PipRequirement
from coalib.results.Diff import Diff
from coalib.results.Result import Result
class PyUnusedCodeBear(LocalBear):
LANGUAGES = {'Python', 'Python 2', 'Python 3'}
REQUIREMEN... | agpl-3.0 |
fly19890211/edx-platform | common/djangoapps/third_party_auth/tests/testutil.py | 23 | 8426 | """
Utilities for writing third_party_auth tests.
Used by Django and non-Django tests; must not have Django deps.
"""
from contextlib import contextmanager
from django.conf import settings
from django.contrib.auth.models import User
import django.test
import mock
import os.path
from third_party_auth.models import (
... | agpl-3.0 |
hdinsight/hue | desktop/core/ext-py/django-auth-ldap-1.2.0/docs/source/conf.py | 36 | 6783 | # -*- coding: utf-8 -*-
#
# django-auth-ldap documentation build configuration file, created by
# sphinx-quickstart on Wed Sep 23 18:06:43 2009.
#
# 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 file... | apache-2.0 |
drunknbass/plexpy | lib/unidecode/x06c.py | 252 | 4643 | data = (
'Lu ', # 0x00
'Mu ', # 0x01
'Li ', # 0x02
'Tong ', # 0x03
'Rong ', # 0x04
'Chang ', # 0x05
'Pu ', # 0x06
'Luo ', # 0x07
'Zhan ', # 0x08
'Sao ', # 0x09
'Zhan ', # 0x0a
'Meng ', # 0x0b
'Luo ', # 0x0c
'Qu ', # 0x0d
'Die ', # 0x0e
'Shi ', # 0x0f
'Di ', # 0x10
'Min... | gpl-3.0 |
shepdelacreme/ansible | test/runner/lib/cli.py | 9 | 29982 | """Test runner for all Ansible tests."""
from __future__ import absolute_import, print_function
import errno
import os
import resource
import sys
from lib.util import (
ApplicationError,
display,
raw_command,
get_docker_completion,
generate_pip_command,
read_lines_without_comments,
)
from li... | gpl-3.0 |
pwalczysko/openmicroscopy | components/tools/OmeroWeb/test/integration/test_tree.py | 5 | 81519 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2015 Glencoe Software, Inc.
# All rights reserved.
#
# 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 o... | gpl-2.0 |
istio/tools | perf/benchmark/runner/prom.py | 1 | 13912 | # Copyright Istio 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, soft... | apache-2.0 |
tkerola/chainer | tests/chainer_tests/links_tests/connection_tests/test_bilinear.py | 9 | 7478 | import unittest
import numpy
import chainer
from chainer.backends import cuda
from chainer import gradient_check
from chainer import links
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
def _check_forward(e1, e2, f, y_expect):
e1 = chainer.Variable(e1)
e2 ... | mit |
andrewyoung1991/django-elasticmodels | elasticmodels/utils/deepdiff.py | 1 | 8340 | # utils/deepdiff.py
# author: andrew young
# email: ayoung@thewulf.org
from __future__ import print_function
import difflib
import datetime
from sys import version
py3 = version[0] == '3'
if py3:
from builtins import int
basestring = str
numbers = (int, float, complex, datetime.datetime)
from itertoo... | isc |
anastue/netforce | netforce_account_report/netforce_account_report/models/report_expense_contact.py | 4 | 1625 | # Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# 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, publ... | mit |
adamRogerson/TerminalHours | newHours/old/old-Builder.py | 2 | 2116 | #file for building up and organizing the output
from collections import defaultdict
from datetime import timedelta, datetime
from FileQuery import GetTimes
class Builder:
""" class for building up the data to be displayed by the display class
"""
def __init__(self):
self.GetTimes = GetTimes()
... | agpl-3.0 |
angr/angr | angr/analyses/decompiler/peephole_optimizations/remove_redundant_bitmasks.py | 1 | 1545 | from ailment.expression import BinaryOp, Convert, Const, ITE
from .base import PeepholeOptimizationExprBase
_MASKS = {
8: 0xff,
16: 0xffff,
32: 0xffffffff,
64: 0xffffffff_ffffffff,
}
class RemoveRedundantBitmasks(PeepholeOptimizationExprBase):
__slots__ = ()
name = "Remove redundant bitmask... | bsd-2-clause |
Chadi-akel/cere | src/cere/cere_hybrid.py | 3 | 2900 | #!/usr/bin/env python
# This file is part of CERE.
#
# Copyright (c) 2013-2016, Universite de Versailles St-Quentin-en-Yvelines
#
# CERE 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 ... | lgpl-3.0 |
M157q/django-localflavor | tests/test_mk/tests.py | 2 | 11331 | # -*- encoding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.test import TestCase
from localflavor.mk.forms import (MKIdentityCardNumberField,
MKMunicipalitySelect, UMCNField)
from .forms import MKPersonForm
class MKLocalFlavorTests(TestCase):
... | bsd-3-clause |
darren-rogan/CouchPotatoServer | libs/guessit/transfo/__init__.py | 4 | 3733 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2012 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
pavlova-marina/QGIS | tests/src/python/test_qgscolorschemeregistry.py | 11 | 2888 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsColorSchemeRegistry.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version... | gpl-2.0 |
Relin/LaZagne | Linux/src/softwares/databases/sqldeveloper.py | 11 | 4472 | import binascii, base64
from Crypto.Cipher import DES
import array
import hashlib, re, os
import xml.etree.cElementTree as ET
from config.header import Header
from config.constant import *
from config.write_output import print_debug, print_output
from config.moduleInfo import ModuleInfo
class SQLDeveloper(ModuleInfo):... | lgpl-3.0 |
weidel-p/nest-simulator | pynest/examples/tsodyks_depressing.py | 6 | 5612 | # -*- coding: utf-8 -*-
#
# tsodyks_depressing.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 Lice... | gpl-2.0 |
Ensembles/ert | python/tests/core/geometry/test_point_in_polygon.py | 3 | 1923 | from ert.geo.geometry_tools import GeometryTools
from ert.geo.polyline import Polyline
from ert.test.extended_testcase import ExtendedTestCase
class PointInPolygonTest(ExtendedTestCase):
def test_point_in_polygon(self):
p1 = (0.5, 0.5)
p2 = (2, 2)
p3 = (1, 0.5) # on the edge
poly... | gpl-3.0 |
marcuskelly/recover | Lib/site-packages/passlib/handlers/ldap_digests.py | 5 | 10109 | """passlib.handlers.digests - plain hash digests
"""
#=============================================================================
# imports
#=============================================================================
# core
from base64 import b64encode, b64decode
from hashlib import md5, sha1
import logging; log = ... | bsd-2-clause |
talhajaved/nyuadmarket | flask/lib/python2.7/site-packages/sqlalchemy/testing/config.py | 21 | 2136 | # testing/config.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import collections
requirements = None
db = None
db_url = None
db_opts = None
fil... | mit |
rbaumg/trac | trac/versioncontrol/tests/console.py | 1 | 4047 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2004-2019 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consi... | bsd-3-clause |
indrajitr/ansible-modules-extras | packaging/language/bower.py | 75 | 7251 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Michael Warkentin <mwarkentin@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 ... | gpl-3.0 |
leki75/ansible | lib/ansible/modules/cloud/docker/docker_container.py | 10 | 79822 | #!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
#
# 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 la... | gpl-3.0 |
nlevitt/youtube-dl | youtube_dl/downloader/__init__.py | 101 | 1168 | from __future__ import unicode_literals
from .common import FileDownloader
from .external import get_external_downloader
from .f4m import F4mFD
from .hls import HlsFD
from .hls import NativeHlsFD
from .http import HttpFD
from .rtsp import RtspFD
from .rtmp import RtmpFD
from .dash import DashSegmentsFD
from ..utils i... | unlicense |
hoosteeno/bedrock | bedrock/firefox/tests/test_firefox_details.py | 5 | 38730 | # -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
from urllib.parse import parse_qsl, urlparse
from django.core.cache import caches
from... | mpl-2.0 |
tpo/ansible | lib/ansible/plugins/action/gather_facts.py | 6 | 6167 | # Copyright (c) 2017 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
import os
import time
from ansible import constants as C
from ansible.executor.module_common import... | gpl-3.0 |
elainexmas/boto | boto/dynamodb2/layer1.py | 134 | 152740 | # Copyright (c) 2014 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 |
scikit-nano/scikit-nano | sknano/generators/tests/test_swnt_generator.py | 2 | 1303 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals
from pkg_resources import resource_filename
import nose
from nose.tools import *
import numpy as np
from sknano.generators import SWNTGenerator
from sknano.io import XYZReader, DATAReade... | bsd-2-clause |
vmanoria/bluemix-hue-filebrowser | hue-3.8.1-bluemix/desktop/core/ext-py/tablib-0.10.0/tablib/packages/openpyxl3/reader/worksheet.py | 55 | 3839 | # file openpyxl/reader/worksheet.py
# Copyright (c) 2010 openpyxl
#
# 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, cop... | gpl-2.0 |
silky/brotli | setup.py | 67 | 7796 | import distutils
from distutils.core import setup, Extension
from distutils.command.build_ext import build_ext
from distutils.cmd import Command
import platform
import os
import re
CURR_DIR = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
# when compiling for Windows Python 2.7, force distutils to use ... | apache-2.0 |
lynndotconfig/server-tools | mass_editing/wizard/__init__.py | 62 | 1052 | # -*- coding: utf-8 -*-
##############################################################################
#
# This module uses OpenERP, Open Source Management Solution Framework.
# Copyright (C):
# 2012-Today Serpent Consulting Services (<http://www.serpentcs.
#
# This program is free software: you can red... | agpl-3.0 |
PyConChina/QPyConChina | webapp/jsonconv.py | 1 | 4259 | # -*- coding: utf-8 -*-
'''
JSON 2 HTML convertor
=====================
(c) Varun Malhotra 2013
Source Code: https://github.com/softvar/json2html
Contributors:
-------------
1. Michel Müller(@muellermichel), patch #2 - https://github.com/softvar/json2html/pull/2
LICENSE: MIT
--------
'''
import json
import ordere... | mit |
Orav/kbengine | kbe/src/lib/python/Lib/test/test_select.py | 2 | 2825 | import errno
import os
import select
import sys
import unittest
from test import support
@unittest.skipIf((sys.platform[:3]=='win'),
"can't easily test on this system")
class SelectTestCase(unittest.TestCase):
class Nope:
pass
class Almost:
def fileno(self):
... | lgpl-3.0 |
AlexanderFabisch/scikit-learn | examples/calibration/plot_calibration_multiclass.py | 272 | 6972 | """
==================================================
Probability Calibration for 3-class classification
==================================================
This example illustrates how sigmoid calibration changes predicted
probabilities for a 3-class classification problem. Illustrated is the
standard 2-simplex, wher... | bsd-3-clause |
zhaodelong/django | django/db/backends/postgresql/operations.py | 207 | 10109 | from __future__ import unicode_literals
from psycopg2.extras import Inet
from django.conf import settings
from django.db.backends.base.operations import BaseDatabaseOperations
class DatabaseOperations(BaseDatabaseOperations):
def unification_cast_sql(self, output_field):
internal_type = output_field.get... | bsd-3-clause |
davidwilson-85/easymap | graphic_output/Pillow-4.2.1/PIL/ImageOps.py | 15 | 14694 | #
# The Python Imaging Library.
# $Id$
#
# standard image operations
#
# History:
# 2001-10-20 fl Created
# 2001-10-23 fl Added autocontrast operator
# 2001-12-18 fl Added Kevin's fit operator
# 2004-03-14 fl Fixed potential division by zero in equalize
# 2005-05-05 fl Fixed equalize for low number of values
... | gpl-3.0 |
DepthDeluxe/ansible | lib/ansible/modules/messaging/rabbitmq_policy.py | 69 | 5081 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, John Dewey <john@dewey.ws>
#
# 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, o... | gpl-3.0 |
simgunz/anki | pylib/anki/models.py | 1 | 16263 | # Copyright: Ankitects Pty Ltd and contributors
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
from __future__ import annotations
import copy
import pprint
import sys
import time
import traceback
from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
import anki # pylin... | agpl-3.0 |
harej/reports_bot | unported/no_wikidata.py | 2 | 1420 | # -*- coding: utf-8 -*-
"""
Generates a report for English Wikipedia articles with no Wikidata item
Copyright (C) 2015 James Hare
Licensed under MIT License: http://mitlicense.org
"""
from urllib.parse import quote
import pywikibot
from project_index import WikiProjectTools
def main():
wptools = WikiProjectTool... | mit |
manishpatell/erpcustomizationssaiimpex123qwe | addons/hr_holidays/report/hr_holidays_report.py | 341 | 2369 | # -*- 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 |
fritsvanveen/QGIS | cmake/FindPyQt5.py | 15 | 3370 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2007, Simon Edwards <simon@simonzone.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... | gpl-2.0 |
bzero/statsmodels | statsmodels/tools/print_version.py | 23 | 7951 | #!/usr/bin/env python
from __future__ import print_function
from statsmodels.compat.python import reduce
import sys
from os.path import dirname
def safe_version(module, attr='__version__'):
if not isinstance(attr, list):
attr = [attr]
try:
return reduce(getattr, [module] + attr)
except Att... | bsd-3-clause |
mk270/testrunner | iatidq/dqcodelists.py | 2 | 3752 |
# IATI Data Quality, tools for Data QA on IATI-formatted publications
# by Mark Brough, Martin Keegan, Ben Webb and Jennifer Smith
#
# Copyright (C) 2013 Publish What You Fund
#
# This programme is free software; you may redistribute and/or modify
# it under the terms of the GNU Affero General Public License v3... | agpl-3.0 |
matheuscas/hackathon_paypal | languages/cs.py | 52 | 23580 | # coding: utf8
{
'!langcode!': 'cs-cz',
'!langname!': 'čeština',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': 'Kolonka "Upravit" je nepovinný výraz, například "pole1=\'nováhodnota\'". Výsledky databázového JOINu nemůžete mazat ani upravovat.',
... | mit |
usc-isi/nova | nova/quota.py | 1 | 32651 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | apache-2.0 |
ewels/MultiQC_OSXApp | venv/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/etree.py | 284 | 4590 | from __future__ import absolute_import, division, unicode_literals
try:
from collections import OrderedDict
except ImportError:
try:
from ordereddict import OrderedDict
except ImportError:
OrderedDict = dict
import re
from pip._vendor.six import text_type
from . import _base
from ..utils... | mit |
bussiere/pypyjs | website/demo/home/rfk/repos/pypy/lib-python/2.7/encodings/mac_romanian.py | 593 | 13917 | """ Python Character Mapping Codec mac_romanian generated from 'MAPPINGS/VENDORS/APPLE/ROMANIAN.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,inp... | mit |
LSSTDESC/Twinkles | workflows/TW-phoSim-r3/runPhoSim.py | 2 | 7723 | #!/nfs/farm/g/lsst/u1/software/redhat6-x86_64-64bit-gcc44/anaconda/2.3.0/bin/python
## runPhoSim.py - Run phoSim (one visit)
import os,sys
import subprocess,shlex
print '\n\n=====================================================================\n Entering runPhoSim.py\n================================================... | mit |
wdlth/mariadb | storage/tokudb/mysql-test/tokudb/t/change_column_blob_data.py | 81 | 2141 | import sys
import random
import string
def main():
print "# this test is generated by change_column_blob_data.py"
print "# generate hot blob expansion test cases"
print "source include/have_tokudb.inc;"
print "--disable_warnings"
print "DROP TABLE IF EXISTS t, ti;"
print "--enable_warnings"
... | gpl-2.0 |
Fiedzia/Django-facebook | docs/docs_env/Lib/encodings/cp1026.py | 593 | 13369 | """ Python Character Mapping Codec cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP1026.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,inp... | bsd-3-clause |
Alwnikrotikz/l5rcm | dal/dataimport.py | 3 | 5932 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2011 Daniele Simonetti
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
... | gpl-3.0 |
fazlan-nazeem/incubator-zeppelin | dev/travis/save-logs.py | 144 | 1836 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | apache-2.0 |
Unity-Technologies/ml-agents | ml-agents-envs/mlagents_envs/registry/base_registry_entry.py | 1 | 1856 | from abc import abstractmethod
from typing import Any, Optional
from mlagents_envs.base_env import BaseEnv
class BaseRegistryEntry:
def __init__(
self,
identifier: str,
expected_reward: Optional[float],
description: Optional[str],
):
"""
BaseRegistryEntry allows... | apache-2.0 |
orekyuu/intellij-community | python/helpers/profiler/thriftpy3/transport/TZlibTransport.py | 44 | 8075 | #
# 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 u... | apache-2.0 |
Mirantis/mos-horizon | openstack_dashboard/dashboards/project/volumes/backups/tabs.py | 80 | 1613 | # 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 |
touilleMan/authomatic | examples/gae/dev/main.py | 16 | 5947 |
import sys
import webapp2
from authomatic.adapters import Webapp2Adapter
from authomatic import Authomatic
import config
authomatic = Authomatic(secret='YAhe[#{^VlX-cK/$ki:$</vu!B5rTW9xi:fbN/%i pIx@AH}0c/ke4M%|c9*H4#>',
config=config.PROVIDERS,
report_errors=False,
... | mit |
gpandcb/pkernel | tools/perf/scripts/python/compaction-times.py | 958 | 7950 | # report time spent in compaction
# Licensed under the terms of the GNU GPL License version 2
# testing:
# 'echo 1 > /proc/sys/vm/compact_memory' to force compaction of all zones
import os
import sys
import re
import signal
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
usage = "usage: perf script report compaction-... | gpl-2.0 |
trondkr/model2roms | runM2R.py | 1 | 1405 | import time
from datetime import datetime
import logging
import IOstation
import clim2bry
import configM2R
import decimateGrid
import model2roms
__author__ = 'Trond Kristiansen'
__email__ = 'trond.kristiansen@niva.no'
__created__ = datetime(2009, 1, 30)
__modified__ = datetime(2021, 3, 23)
__version__ = "1.6"
__status... | mit |
wweiradio/django | django/contrib/gis/geoip/prototypes.py | 535 | 3943 | from ctypes import POINTER, Structure, c_char_p, c_float, c_int, string_at
from django.contrib.gis.geoip.libgeoip import free, lgeoip
# #### GeoIP C Structure definitions ####
class GeoIPRecord(Structure):
_fields_ = [('country_code', c_char_p),
('country_code3', c_char_p),
('cou... | bsd-3-clause |
alkuzad/win-maximize-python | setup.py | 1 | 3832 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Note: To use the 'upload' functionality of this file, you must:
# $ pipenv install twine --dev
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
# Package meta-data.
NAME = 'win-maximize'
DESCRIPTION = 'Max... | mit |
atheed/servo | tests/wpt/web-platform-tests/tools/sslutils/openssl.py | 61 | 13474 | import functools
import os
import random
import shutil
import subprocess
import tempfile
from datetime import datetime
class OpenSSL(object):
def __init__(self, logger, binary, base_path, conf_path, hosts, duration,
base_conf_path=None):
"""Context manager for interacting with OpenSSL.
... | mpl-2.0 |
popazerty/obh-gui | lib/python/Screens/HarddiskSetup.py | 49 | 3036 | from Screen import Screen
from Components.ActionMap import ActionMap
from Components.Harddisk import harddiskmanager
from Components.MenuList import MenuList
from Components.Label import Label
from Components.Pixmap import Pixmap
from Screens.MessageBox import MessageBox
class HarddiskSetup(Screen):
def __init__(self... | gpl-2.0 |
Ac0lyte/eb3k | eb3k/spiders/ebook3000.py | 1 | 2374 | # -*- coding: utf-8 -*-
#<div class="index_box">
# <div class="index_box_lit"><a href='/duPont-REGISTRY-Homes---April-2015_255937.html'><img src='/upimg/allimg/150309/1939430_lit.jpg' width=85 height=113 align=left></a></div>
# <div class="index_box_title list_title"><a href='/duPont-REGISTRY-Homes---April-2015_... | gpl-2.0 |
adamncasey/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/ihatexml.py | 1727 | 16581 | from __future__ import absolute_import, division, unicode_literals
import re
import warnings
from .constants import DataLossWarning
baseChar = """
[#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] |
[#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] |
[#x014A-#x017E] | [#x0180-... | mpl-2.0 |
DomainGroupOSS/luigi | luigi/contrib/ssh.py | 19 | 12044 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
clokep/datadogpy | tests/integration/api/test_api.py | 2 | 35185 | # python
import datetime
import os
import time
import unittest
import requests
# 3p
from nose.plugins.attrib import attr
from nose.tools import assert_raises
from nose.tools import assert_equal as eq
from nose.tools import assert_true as ok
# datadog
from datadog import initialize
from datadog import api as dog
from ... | bsd-3-clause |
pruiz/asterisk | contrib/ast-db-manage/config/versions/581a4264e537_adding_extensions.py | 10 | 1449 | #
# Asterisk -- An open source telephony toolkit.
#
# Copyright (C) 2013, Digium, Inc.
#
# Scott Griepentrog <sgriepentrog@digium.com>
#
# See http://www.asterisk.org for more information about
# the Asterisk project. Please do not directly contact
# any of the maintainers of this project for assistance;
# the project ... | gpl-2.0 |
bastibl/gnuradio | gr-channels/python/channels/phase_bal.py | 1 | 3690 | #!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: IQ Phase Balancer
# Author: matt@ettus.com
# Generated: Thu Aug 1 11:49:41 2013
##################################################
from __future__ import unicode_literals
from gnuradio import blocks
from gnu... | gpl-3.0 |
alfredgamulo/cloud-custodian | tools/c7n_azure/tests_azure/tests_resources/test_postgresql_server.py | 2 | 2779 | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import collections
from netaddr import IPSet
from mock import Mock
from ..azure_common import BaseTest, arm_template
from c7n_azure.resources.postgresql_server import PostgresqlServerFirewallRulesFilter
IpRange = collections.namedtuple('IpR... | apache-2.0 |
mateor/pants | tests/python/pants_test/core_tasks/test_substitute_target_aliases_integration.py | 14 | 1603 | # coding=utf-8
# Copyright 2016 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 pants_test.pant... | apache-2.0 |
chaluemwut/fbserver | venv/lib/python2.7/site-packages/werkzeug/testsuite/security.py | 145 | 4264 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.security
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the security helpers.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import unittest
from werkzeug.testsuite import WerkzeugTestCase
from werkzeug.securit... | apache-2.0 |
summanlp/gensim | gensim/models/lda_dispatcher.py | 1 | 7953 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
USAGE: %(program)s SIZE_OF_JOBS_QUEUE
Dispatcher process which orchestrates distributed LDA computations. Run this \
script onl... | lgpl-2.1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.