repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
meteorcloudy/tensorflow | tensorflow/python/kernel_tests/io_ops_test.py | 23 | 4898 | # -*- coding: utf-8 -*-
# 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
#
# Un... | apache-2.0 |
yd0str/infernal-twin | build/pip/build/lib.linux-i686-2.7/pip/_vendor/requests/packages/chardet/sbcharsetprober.py | 2927 | 4793 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-3.0 |
richardcs/ansible | lib/ansible/modules/network/f5/bigip_software_update.py | 11 | 9756 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
joshuahoman/vivisect | vstruct/qt/__init__.py | 6 | 5522 | '''
Some utils for QT code which uses vstruct...
'''
import vqt.tree as vq_tree
from PyQt4 import QtCore, QtGui
from vqt.main import idlethread, idlethreadsync
class VQStructNamespacesView(vq_tree.VQTreeView):
def __init__(self, parent=None):
vq_tree.VQTreeView.__init__(self, parent=parent)
#mode... | apache-2.0 |
infrascloudy/flask-base | app/models/user.py | 1 | 6385 | from flask import current_app
from flask_login import AnonymousUserMixin, UserMixin
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from itsdangerous import BadSignature, SignatureExpired
from werkzeug.security import check_password_hash, generate_password_hash
from app import db, login_manager
... | mit |
joernhees/git-hg-remote-bug_gae-init | main/lib/werkzeug/contrib/atom.py | 7 | 15329 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.atom
~~~~~~~~~~~~~~~~~~~~~
This module provides a class called :class:`AtomFeed` which can be
used to generate feeds in the Atom syndication format (see :rfc:`4287`).
Example::
def atom_feed(request):
feed = AtomFeed("My Blog", feed... | mit |
75651/kbengine_cloud | kbe/src/lib/python/Lib/hmac.py | 142 | 5063 | """HMAC (Keyed-Hashing for Message Authentication) Python module.
Implements the HMAC algorithm as described by RFC 2104.
"""
import warnings as _warnings
from _operator import _compare_digest as compare_digest
import hashlib as _hashlib
trans_5C = bytes((x ^ 0x5C) for x in range(256))
trans_36 = bytes((x ^ 0x36) fo... | lgpl-3.0 |
edwardzhou1980/bite-project | deps/mrtaskman/server/util/model_to_dict.py | 16 | 1536 | """Converts AppEngine db.Model's to JSON."""
from google.appengine.ext import db
from google.appengine.ext.blobstore import blobstore
import datetime
import json
import logging
import time
from util import db_properties
SIMPLE_TYPES = (int, long, float, bool, dict, basestring, list)
def ModelToDict(model):
"""... | apache-2.0 |
georgewhewell/CouchPotatoServer | libs/xmpp/auth.py | 196 | 15633 | ## auth.py
##
## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov
##
## 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, or (at your option)
## any later version.
##... | gpl-3.0 |
zakuro9715/lettuce | tests/integration/lib/Django-1.2.5/django/core/mail/backends/console.py | 308 | 1295 | """
Email backend that writes messages to console instead of sending them.
"""
import sys
import threading
from django.core.mail.backends.base import BaseEmailBackend
class EmailBackend(BaseEmailBackend):
def __init__(self, *args, **kwargs):
self.stream = kwargs.pop('stream', sys.stdout)
self._loc... | gpl-3.0 |
cnbeining/you-get | src/you_get/extractors/huaban.py | 7 | 2281 | #!/usr/bin/env python
import json
import os
import re
import math
import traceback
import urllib.parse as urlparse
from ..common import *
__all__ = ['huaban_download']
site_info = '花瓣 (Huaban)'
LIMIT = 100
class Board:
def __init__(self, title, pins):
self.title = title
self.pins = pins
... | mit |
ME-ICA/me-ica | meica.libs/mdp/graph/graph.py | 1 | 13012 | # inspired by some code by Nathan Denny (1999)
# see http://www.ece.arizona.edu/~denny/python_nest/graph_lib_1.0.1.html
try:
# use reduce against BDFL's will even on python > 2.6
from functools import reduce
except ImportError:
pass
class GraphException(Exception):
"""Base class for exception in the g... | lgpl-2.1 |
joequery/django | tests/utils_tests/test_html.py | 160 | 10711 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from datetime import datetime
from django.test import SimpleTestCase, ignore_warnings
from django.utils import html, safestring, six
from django.utils._os import upath
from django.utils.deprecation import RemovedInDjango110Warning
from django.u... | bsd-3-clause |
jjhuff/fcc-comments | lib/nltk/sem/evaluate.py | 5 | 22893 | # Natural Language Toolkit: Models for first-order languages with lambda
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Ewan Klein <ewan@inf.ed.ac.uk>,
# URL: <http://nltk.sourceforge.net>
# For license information, see LICENSE.TXT
#TODO:
#- fix tracing
#- fix iterator-based approach to existentials
"""
T... | apache-2.0 |
caffeinehit/yell | yell/backends/celery.py | 1 | 2316 | from __future__ import absolute_import
from celery.task import Task
from yell import Notification, notify, registry
class CeleryNotificationTask(Task):
""" Dispatch and run the notification. """
def run(self, name=None, backend=None, *args, **kwargs):
"""
The Celery task.
Deli... | mit |
TimYi/django | tests/one_to_one/models.py | 203 | 3343 | """
One-to-one relationships
To define a one-to-one relationship, use ``OneToOneField()``.
In this example, a ``Place`` optionally can be a ``Restaurant``.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compat... | bsd-3-clause |
CiNC0/Cartier | cartier-python-resign-linux/tests/test_versioning.py | 1 | 1194 | #!/usr/bin/env python
import os.path
import importlib
import unittest
tests_dir = os.path.abspath(os.path.dirname(__file__))
package_name = tests_dir.split(os.path.sep)[-2].replace('-', '_')
package = importlib.import_module(package_name)
class VersioningTestCase(unittest.TestCase):
def assert_proper_attribute(... | apache-2.0 |
ortylp/scipy | scipy/special/tests/test_basic.py | 4 | 122266 | # this program corresponds to special.py
### Means test is not done yet
# E Means test is giving error (E)
# F Means test is failing (F)
# EF Means test is giving error and Failing
#! Means test is segfaulting
# 8 Means test runs forever
### test_besselpoly
### test_mathieu_a
### test_mathieu_even_coef
##... | bsd-3-clause |
acogdev/ansible | test/integration/setup_gce.py | 163 | 1391 | '''
Create GCE resources for use in integration tests.
Takes a prefix as a command-line argument and creates two persistent disks named
${prefix}-base and ${prefix}-extra and a snapshot of the base disk named
${prefix}-snapshot. prefix will be forced to lowercase, to ensure the names are
legal GCE resource names.
'''
... | gpl-3.0 |
joequery/django | tests/admin_widgets/models.py | 227 | 4760 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class MyFileField(models.FileField):
pass
@python_2_unicode_compatible
class Member(models.Model):
name = models.CharField(max_lengt... | bsd-3-clause |
andykimpe/chromium-test-npapi | tools/telemetry/telemetry/core/backends/webdriver/webdriver_tab_list_backend.py | 13 | 1386 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.core.backends.webdriver import webdriver_tab_backend
class WebDriverTabListBackend(object):
def __init__(self, browser_backend):
self._... | bsd-3-clause |
zdary/intellij-community | python/helpers/pydev/pydevd_attach_to_process/winappdbg/interactive.py | 102 | 85840 | #!~/.wine/drive_c/Python25/python.exe
# -*- coding: utf-8 -*-
# Acknowledgements:
# Nicolas Economou, for his command line debugger on which this is inspired.
# http://tinyurl.com/nicolaseconomou
# Copyright (c) 2009-2014, Mario Vilas
# All rights reserved.
#
# Redistribution and use in source and binary forms, wit... | apache-2.0 |
rgerkin/pyNeuroML | pyneuroml/tune/NeuroMLSimulation.py | 1 | 5357 | '''
A class for running a single instance of a NeuroML model by generating a
LEMS file and using pyNeuroML to run in a chosen simulator
'''
import sys
import time
from pyneuroml import pynml
from pyneuroml.lems import generate_lems_file_for_neuroml
try:
import pyelectro # Not used here, just f... | lgpl-3.0 |
openhatch/new-mini-tasks | vendor/packages/Django/django/contrib/gis/geos/point.py | 224 | 4351 | from ctypes import c_uint
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos import prototypes as capi
from django.utils import six
from django.utils.six.moves import xrange
class Point(GEOSGeometry):
_minlength = 2
_ma... | apache-2.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/IPython/terminal/pt_inputhooks/wx.py | 8 | 5441 | """Enable wxPython to be used interacively in prompt_toolkit
"""
from __future__ import absolute_import
import sys
import signal
import time
from timeit import default_timer as clock
import wx
def inputhook_wx1(context):
"""Run the wx event loop by processing pending events only.
This approach seems to work... | gpl-3.0 |
bearstech/ansible | test/units/module_utils/test_network_common.py | 31 | 5437 | # -*- coding: utf-8 -*-
#
# (c) 2017 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 ... | gpl-3.0 |
heke123/chromium-crosswalk | build/android/buildbot/bb_device_status_check.py | 7 | 14834 | #!/usr/bin/env python
#
# Copyright 2013 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.
"""A class to keep track of devices across builds and report state."""
import argparse
import json
import logging
import os
import p... | bsd-3-clause |
RonnyPfannschmidt/pytest | testing/test_faulthandler.py | 3 | 5123 | import io
import sys
import pytest
from _pytest.pytester import Pytester
def test_enabled(pytester: Pytester) -> None:
"""Test single crashing test displays a traceback."""
pytester.makepyfile(
"""
import faulthandler
def test_crash():
faulthandler._sigabrt()
"""
)
result ... | mit |
shiftcontrol/UnityOpenCV | opencv/tests/swig_python/highgui/match.py | 3 | 1348 | """
This script will compare tho images and decides with a threshold
if these to images are "equal enough"
"""
# import the necessary things for OpenCV
from cv import *
from highgui import *
import frames
import sys
import os
PREFIX=os.path.join(os.environ["srcdir"],"../../opencv_extra/testdata/python/images/")
Di... | gpl-3.0 |
klaus385/openpilot | selfdrive/crash.py | 2 | 1230 | """Install exception handler for process crash."""
import os
import sys
from selfdrive.version import version, dirty
from selfdrive.swaglog import cloudlog
if os.getenv("NOLOG") or os.getenv("NOCRASH"):
def capture_exception(*exc_info):
pass
def bind_user(**kwargs):
pass
def bind_extra(**kwargs):
pa... | mit |
Azure/azure-sdk-for-python | sdk/powerbiembedded/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/operation_py3.py | 1 | 1163 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
Anderson0026/mapproxy | mapproxy/script/conf/app.py | 1 | 6606 | # -:- encoding: utf-8 -:-
# This file is part of the MapProxy project.
# Copyright (C) 2013 Omniscale <http://omniscale.de>
#
# 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.a... | apache-2.0 |
franciscod/python-telegram-bot | telegram/inlinequeryresultvideo.py | 2 | 2581 | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... | gpl-2.0 |
shingonoide/odoo | addons/purchase/report/purchase_report.py | 50 | 7689 | # -*- 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 |
2ndQuadrant/ansible | test/runner/lib/docker_util.py | 29 | 7331 | """Functions for accessing docker via the docker cli."""
from __future__ import absolute_import, print_function
import json
import os
import time
from lib.executor import (
SubprocessError,
)
from lib.util import (
ApplicationError,
run_command,
common_environment,
display,
find_executable,
... | gpl-3.0 |
huongttlan/statsmodels | statsmodels/sandbox/examples/example_sysreg.py | 31 | 8043 | """Example: statsmodels.sandbox.sysreg
"""
#TODO: this is going to change significantly once we have a panel data structure
from statsmodels.compat.python import lmap, asbytes
import numpy as np
import statsmodels.api as sm
from statsmodels.sandbox.sysreg import *
#for Python 3 compatibility
# Seemingly Unrelated Reg... | bsd-3-clause |
ossdemura/django-miniblog | Lib/site-packages/pip/_vendor/html5lib/treeadapters/sax.py | 1835 | 1661 | from __future__ import absolute_import, division, unicode_literals
from xml.sax.xmlreader import AttributesNSImpl
from ..constants import adjustForeignAttributes, unadjustForeignAttributes
prefix_mapping = {}
for prefix, localName, namespace in adjustForeignAttributes.values():
if prefix is not None:
pre... | mit |
freakynit/kaggle-ndsb | configurations/bagging_15_convroll4_big_weightdecay_resume.py | 6 | 5502 | import numpy as np
import theano
import theano.tensor as T
import lasagne as nn
import data
import load
import nn_plankton
import dihedral
import dihedral_fast
import tmp_dnn
import tta
resume_path = "metadata/bagging_15_convroll4_big_weightdecay-schaap-20150306-105118.pkl"
validation_split_path = "splits/bagging... | mit |
stefan-jonasson/home-assistant | homeassistant/components/telegram_bot/__init__.py | 2 | 26538 | """
Component to send and receive Telegram messages.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/telegram_bot/
"""
import asyncio
import io
from functools import partial
import logging
import os
import requests
from requests.auth import HTTPBasicAuth... | mit |
grangier/django-11599 | django/utils/version.py | 320 | 1361 | import django
import os.path
import re
def get_svn_revision(path=None):
"""
Returns the SVN revision in the form SVN-XXXX,
where XXXX is the revision number.
Returns SVN-unknown if anything goes wrong, such as an unexpected
format of internal SVN files.
If path is provided, it should be a dir... | bsd-3-clause |
zaxtax/scikit-learn | sklearn/utils/tests/test_seq_dataset.py | 47 | 2486 | # Author: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org>
#
# License: BSD 3 clause
import numpy as np
import scipy.sparse as sp
from sklearn.utils.seq_dataset import ArrayDataset, CSRDataset
from sklearn.datasets import load_iris
from numpy.testing import assert_array_equal
from nose.tools import assert_equal
iris =... | bsd-3-clause |
CydarLtd/ansible | lib/ansible/module_utils/connection.py | 61 | 2929 | #
# 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 ... | gpl-3.0 |
SonarOpenCommunity/sonar-cxx | cxx-sensors/src/tools/clangsa_createrules.py | 1 | 6838 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# SonarQube C++ Community Plugin (cxx plugin)
# Copyright (C) 2010-2021 SonarOpenCommunity
# http://github.com/SonarOpenCommunity/sonar-cxx
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# Lic... | lgpl-3.0 |
CingHu/neutron-ustack | neutron/db/migration/alembic_migrations/versions/1d6ee1ae5da5_db_healing.py | 6 | 1060 | # Copyright 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
TEAM-Gummy/platform_external_chromium_org | ppapi/generators/generator.py | 165 | 1776 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
import traceback
# Note: some of these files are imported to register cmdline options.
from idl_generator imp... | bsd-3-clause |
pyfidelity/rest-seed | backend/backrest/tests/test_change_password.py | 1 | 1714 | from pytest import fixture, mark
from transaction import commit
@fixture(scope='module')
def url(testing):
return testing.route_url('password-change')
@mark.user('alice')
def test_change_password(browser, url, alice):
data = dict(password='foo!', current='alice')
browser.put_json(url, data)
assert a... | bsd-2-clause |
gsnbng/erpnext | erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.py | 9 | 2552 | # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
def execute(filters=None):
if filters.from_date >= filters.to_date:
frappe.msgprint(_("To Date must be greater than From ... | agpl-3.0 |
wscullin/spack | var/spack/repos/builtin/packages/py-pytz/package.py | 3 | 1982 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
weidnem/IntroPython2016 | students/baumel/session_07/HTML_lab/test_html_render.py | 3 | 1663 | """
test code for html_render
"""
import io
from html_render import Element
def test_init():
e = Element()
e = Element("this is some text")
def test_content():
#fixme: this test internals!!!!!!!!
e = Element("this is some text")
assert "this is some text" in e.content
def test_append():
e = Element("this is ... | unlicense |
mindnervestech/mnrp | addons/sale_crm/wizard/crm_make_sale.py | 74 | 7132 | # -*- 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 |
mirkix/ardupilot | Tools/scripts/frame_sizes.py | 351 | 1117 | #!/usr/bin/env python
import re, sys, operator, os
code_line = re.compile("^\s*\d+:/")
frame_line = re.compile("^\s*\d+\s+/\* frame size = (\d+) \*/")
class frame(object):
def __init__(self, code, frame_size):
self.code = code
self.frame_size = int(frame_size)
frames = []
def process_lst(filena... | gpl-3.0 |
antb/TPT----My-old-mod | src/python/stdlib/plat-mac/Carbon/Appearance.py | 81 | 27268 | # Generated from 'Appearance.h'
def FOUR_CHAR_CODE(x): return x
kAppearanceEventClass = FOUR_CHAR_CODE('appr')
kAEAppearanceChanged = FOUR_CHAR_CODE('thme')
kAESystemFontChanged = FOUR_CHAR_CODE('sysf')
kAESmallSystemFontChanged = FOUR_CHAR_CODE('ssfn')
kAEViewsFontChanged = FOUR_CHAR_CODE('vfnt')
kThemeDataFileType =... | gpl-2.0 |
alihalabyah/flexx | flexx/pyscript/parser3.py | 21 | 22006 | """
Python Builtins
---------------
Most buildin functions (that make sense in JS) are automatically
translated to JavaScript: isinstance, issubclass, callable, hasattr,
getattr, setattr, delattr, print, len, max, min, chr, ord, dict, list,
tuple, range, pow, sum, round, int, float, str, bool, abs, divmod, all,
any, ... | bsd-2-clause |
jonycgn/scipy | scipy/stats/tests/test_binned_statistic.py | 50 | 8793 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_array_almost_equal, run_module_suite
from scipy.stats import (binned_statistic, binned_statistic_2d,
binned_statistic_dd)
from scipy._lib.six import u
from common_tests import ... | bsd-3-clause |
Shraddha512/servo | tests/wpt/run.py | 13 | 1745 | # 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 sys, os, argparse
here = os.path.split(__file__)[0]
servo_root = os.path.abspath(os.path.join(here, "..", ".."))... | mpl-2.0 |
mikedh/trimesh | trimesh/proximity.py | 1 | 19400 | """
proximity.py
---------------
Query mesh- point proximity.
"""
import numpy as np
from . import util
from .grouping import group_min
from .constants import tol, log_time
from .triangles import closest_point as closest_point_corresponding
from .triangles import points_to_barycentric
try:
from scipy.spatial im... | mit |
MSOpenTech/edx-platform | lms/djangoapps/bulk_email/tests/test_err_handling.py | 12 | 17239 | # -*- coding: utf-8 -*-
"""
Unit tests for handling email sending errors
"""
from itertools import cycle
from celery.states import SUCCESS, RETRY
from django.conf import settings
from django.core.management import call_command
from django.core.urlresolvers import reverse
from django.db import DatabaseError
import json... | agpl-3.0 |
kidaa/avmplus | test/performance/metricinfo.py | 8 | 2932 | # 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/.
# This file contains information about the different performance metrics
# It is a python file that is imported into run... | mpl-2.0 |
IptvBrasilGroup/Cleitonleonelcreton.repository | plugin.video.armagedompirata/mechanize/_firefox3cookiejar.py | 134 | 8345 | """Firefox 3 "cookies.sqlite" cookie persistence.
Copyright 2008 John J Lee <jjl@pobox.com>
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD or ZPL 2.1 licenses (see the file
COPYING.txt included with the distribution).
"""
import logging
import time
from _clientcooki... | gpl-2.0 |
JonnyWong16/plexpy | lib/apscheduler/triggers/cron/expressions.py | 3 | 9184 | """This module contains the expressions applicable for CronTrigger's fields."""
from calendar import monthrange
import re
from apscheduler.util import asint
__all__ = ('AllExpression', 'RangeExpression', 'WeekdayRangeExpression',
'WeekdayPositionExpression', 'LastDayOfMonthExpression')
WEEKDAYS = ['sun'... | gpl-3.0 |
aforalee/RRally | tests/unit/plugins/openstack/context/keystone/test_roles.py | 13 | 5273 | # Copyright 2014: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
gormanb/mongo-python-driver | bson/__init__.py | 14 | 32058 | # Copyright 2009-2015 MongoDB, 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 writin... | apache-2.0 |
kived/plyer | plyer/platforms/macosx/wifi.py | 2 | 4929 | from plyer.facades import Wifi
from pyobjus.dylib_manager import load_framework, INCLUDE
from pyobjus import autoclass
load_framework(INCLUDE.Foundation)
load_framework(INCLUDE.CoreWLAN)
CWInterface = autoclass('CWInterface')
CWNetwork = autoclass('CWNetwork')
CWWiFiClient = autoclass('CWWiFiClient')
NSArray = autocla... | mit |
evensonbryan/yocto-autobuilder | lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/test/test_sslverify.py | 5 | 21662 | # Copyright 2005 Divmod, Inc. See LICENSE file for details
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.internet._sslverify}.
"""
import itertools
try:
from OpenSSL import SSL
from OpenSSL.crypto import PKey, X509, X509Req
from OpenSSL.crypto import TYP... | gpl-2.0 |
hcseob/py_spectre | py_spectre/psf.py | 1 | 50756 | # -*- coding: latin-1 -*-
"""
Copyright (c) 2008 Pycircuit Development Team
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
a. Redistributions of source code must retain the above copyright notice,
... | mit |
jemmyw/ansible | v1/ansible/runner/lookup_plugins/inventory_hostnames.py | 173 | 1756 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2013, Steven Dossett <sdossett@panath.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 versio... | gpl-3.0 |
when30/namebench | nb_third_party/dns/rdtypes/IN/NAPTR.py | 248 | 4889 | # Copyright (C) 2003-2007, 2009, 2010 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 ... | apache-2.0 |
rebstar6/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/test_endtoend.py | 449 | 26811 | #!/usr/bin/env python
#
# Copyright 2012, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | mpl-2.0 |
jlegendary/orange | Orange/OrangeWidgets/Classify/OWKNN.py | 6 | 6326 | """
<name>k Nearest Neighbours</name>
<description>K-nearest neighbours learner/classifier.</description>
<icon>icons/kNearestNeighbours.svg</icon>
<contact>Janez Demsar (janez.demsar(@at@)fri.uni-lj.si)</contact>
<priority>25</priority>
"""
from OWWidget import *
import OWGUI
from exceptions import Exception
from orng... | gpl-3.0 |
TresysTechnology/setools | tests/nodeconquery.py | 1 | 10617 | # Copyright 2014, Tresys Technology, LLC
# Copyright 2017, Chris PeBenito <pebenito@ieee.org>
#
# This file is part of SETools.
#
# SETools 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 t... | lgpl-2.1 |
lcf258/openwrtcnwanzhen | target/linux/x86/image/mkimg_bifferboard.py | 561 | 1265 | #!/usr/bin/env python
"""
Create firmware for 4/8MB Bifferboards, suitable for uploading using
either bb_upload8.py or bb_eth_upload8.py
"""
import struct, sys
# Increase the kmax value if the script gives errors about the kernel being
# too large. You need to set the Biffboot kmax value to the same value yo... | gpl-2.0 |
jeremiahmarks/sl4a | python/src/Lib/encodings/iso8859_3.py | 593 | 13345 | """ Python Character Mapping Codec iso8859_3 generated from 'MAPPINGS/ISO8859/8859-3.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,input,errors='... | apache-2.0 |
coins4lunch/EvilCoin | share/qt/make_spinner.py | 4415 | 1035 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... | mit |
zq317157782/Narukami | external/googletest/googlemock/scripts/generator/cpp/ast.py | 16 | 62772 | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions 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... | mit |
loopCM/chromium | build/gyp_helper.py | 57 | 1598 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file helps gyp_chromium and landmines correctly set up the gyp
# environment from chromium.gyp_env on disk
import os
SCRIPT_DIR = os.path.dirnam... | bsd-3-clause |
plamut/superdesk | server/apps/legal_archive/service.py | 4 | 6656 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import loggi... | agpl-3.0 |
dzz007/photivo | scons-local-2.2.0/SCons/Tool/mwld.py | 14 | 3666 | """SCons.Tool.mwld
Tool-specific initialization for the Metrowerks CodeWarrior linker.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2... | gpl-3.0 |
Lektorium-LLC/edx-platform | openedx/core/lib/token_utils.py | 11 | 4236 | """Utilities for working with ID tokens."""
import json
from time import time
from Cryptodome.PublicKey import RSA
from django.conf import settings
from django.utils.functional import cached_property
from jwkest.jwk import KEYS, RSAKey
from jwkest.jws import JWS
from openedx.core.djangoapps.site_configuration import ... | agpl-3.0 |
8u1a/plaso | plaso/parsers/java_idx.py | 3 | 8539 | # -*- coding: utf-8 -*-
"""Parser for Java Cache IDX files."""
# TODO:
# * 6.02 files did not retain IP addresses. However, the
# deploy_resource_codebase header field may contain the host IP.
# This needs to be researched further, as that field may not always
# be present. 6.02 files will currently return '... | apache-2.0 |
snyaggarwal/pex | tests/test_environment.py | 5 | 3792 | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from contextlib import contextmanager
from twitter.common.contextutil import temporary_dir
from pex.compatibility import nested
from pex.environment import PEXEnvironment
from ... | apache-2.0 |
MIPS/external-chromium_org-third_party-skia | tools/test_pdfs.py | 231 | 1801 | '''
Compares the rendererings of serialized SkPictures to expected images.
Launch with --help to see more information.
Copyright 2012 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
'''
# common Python modules
import os
import optparse
import sys
import ... | bsd-3-clause |
unix-beard/matasano | set1/detect_single_character_xor/detect_single_character_xor.py | 1 | 1514 | #!/usr/bin/env python3
################################################################################
# The matasano crypto challenges
# http://cryptopals.com/sets/1/challenges/4/
# Set 1 Challenge 4
# Detect single-character XOR
################################################################################
# On... | mit |
igabr/Metis_Projects_Chicago_2017 | 03-Project-McNulty/web_app/src/flask-lesscss/docs/conf.py | 6 | 6500 | # -*- coding: utf-8 -*-
#
# flask-lesscss documentation build configuration file, created by
# sphinx-quickstart on Tue May 11 18:54:04 2010.
#
# 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.
#... | mit |
fajoy/nova | nova/api/openstack/urlmap.py | 12 | 10628 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# 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/... | apache-2.0 |
RaphaelKimmig/django_helpful | django_helpful/__init__.py | 1 | 1416 | # Copyright (c) 2013, Raphael Kimmig
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the fo... | bsd-2-clause |
looker/sdk-examples | python/soft_delete_dashboard.py | 1 | 1367 | import sys
from typing import Sequence
import exceptions
from looker_sdk import client, error, models
sdk = client.setup("../looker.ini")
def main():
"""Given a dashboard title, get the ids of all dashboards with matching titles
and move them to trash.
$ python soft_delete_dashboard.py "An Unused Dash... | mit |
cbanta/pjproject | tests/pjsua/mod_recvfrom.py | 39 | 2746 | # $Id$
import imp
import sys
import inc_sip as sip
import inc_const as const
import re
from inc_cfg import *
# Read configuration
cfg_file = imp.load_source("cfg_file", ARGS[1])
# Default server port (should we randomize?)
srv_port = 50070
def test_func(test):
pjsua = test.process[0]
dlg = sip.Dialog("127.0.0.1", ... | gpl-2.0 |
robmcmullen/peppy | peppy/major_modes/fortran_95.py | 1 | 1742 | # peppy Copyright (c) 2006-2009 Rob McMullen
# Licenced under the GPLv2; see http://peppy.flipturn.org for more info
"""Fortran 95 programming language editing support.
Major mode for editing Fortran 95 files.
Supporting actions and minor modes should go here only if they are uniquely
applicable to this major mode an... | gpl-2.0 |
HH890612/MiliCloud | lib/requests/api.py | 92 | 5400 | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
:par... | mit |
evernym/plenum | plenum/common/script_helper.py | 2 | 6795 | import os
from jsonpickle import json
from plenum.common.constants import CLIENT_STACK_SUFFIX
from plenum.common.roles import Roles
from plenum.common.transactions import PlenumTransactions
from storage.text_file_store import TextFileStore
NodeInfoFile = "node-info"
GenTxnFile = "genesis_txn"
ExportedTxnFile = "expo... | apache-2.0 |
clayz/crazy-quiz-web | lib/werkzeug/exceptions.py | 316 | 17799 | # -*- coding: utf-8 -*-
"""
werkzeug.exceptions
~~~~~~~~~~~~~~~~~~~
This module implements a number of Python exceptions you can raise from
within your views to trigger a standard non-200 response.
Usage Example
-------------
::
from werkzeug.wrappers import BaseRequest
... | apache-2.0 |
bhavin04890/finaldashboard | static/scripts/tools/csv2xml.py | 12 | 3028 | # -*- coding: utf-8 -*-
#
# Debug/Helper script for CSV stylesheet development
#
# >>> python csv2xml <CSV File>
# ... converts the CSV file into XML
#
# >>> python csv2xml <CSV File> <XSLT Stylesheet>
# ... converts the CSV file into XML and transforms it using the stylesheet
#
import sys
import csv
from l... | mit |
erjac77/ansible-module-f5bigip | library/f5bigip_ltm_profile_diameter.py | 2 | 8266 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016-2018, Eric Jacob <erjac77@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | apache-2.0 |
mattrobenolt/django | django/contrib/staticfiles/handlers.py | 581 | 2328 | from django.conf import settings
from django.contrib.staticfiles import utils
from django.contrib.staticfiles.views import serve
from django.core.handlers.wsgi import WSGIHandler, get_path_info
from django.utils.six.moves.urllib.parse import urlparse
from django.utils.six.moves.urllib.request import url2pathname
clas... | bsd-3-clause |
aaxelb/osf.io | framework/postcommit_tasks/handlers.py | 21 | 3764 | # -*- coding: utf-8 -*-
import functools
import hashlib
import logging
import threading
import binascii
from collections import OrderedDict
import os
from celery import chain
from framework.celery_tasks import app
from celery.local import PromiseProxy
from gevent.pool import Pool
from website import settings
_local... | apache-2.0 |
ForkedReposBak/mxnet | python/mxnet/gluon/contrib/nn/basic_layers.py | 2 | 17216 | # 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 |
jagg81/translate-toolkit | build/lib.linux-x86_64-2.6/translate/convert/prop2po.py | 3 | 9977 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2002-2006 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... | gpl-2.0 |
boumenot/azure-linux-extensions | OSPatching/azure/__init__.py | 46 | 33598 | #-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apac... | apache-2.0 |
arenadata/ambari | ambari-server/src/test/resources/TestAmbaryServer.samples/dummy_extension/HIVE/package/scripts/status_params.py | 25 | 1062 | #!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License");... | apache-2.0 |
awacha/cct | cct/qtgui/devices/motor/movemotor/movemotor.py | 1 | 4527 | import logging
from PyQt5 import QtWidgets, QtGui
from .movemotor_ui import Ui_Form
from ....core.mixins import ToolWindow
from .....core.devices import Motor
from .....core.instrument.privileges import PRIV_MOVEMOTORS
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
class MoveMotor(QtWidgets.QWi... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.