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 |
|---|---|---|---|---|---|
gift-surg/GIFT-Grab | src/tests/blackmagic/stereo_capture.py | 1 | 4325 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Example demonstrating how stereo video frames can be captured
using a frame grabber card that supports this feature.
"""
import time
import cv2
import numpy as np
from pygiftgrab import (IObserver, VideoSourceFactory,
ColourSpace, Device, Vide... | bsd-3-clause |
arcade-lab/tia-infrastructure | tools/simulator/system.py | 1 | 9352 | """
Top-level system wrapper.
"""
import re
import sys
import pandas as pd
from simulator.exception import SimulatorException
class System:
"""
A system class to wrap a collection of processing and memory elements as well as the channels through which they
communicate.
"""
def __init__(self):
... | mit |
AlbertoPeon/invenio | modules/bibfield/lib/functions/is_type_isbn_issn_unit_tests.py | 5 | 3122 | ## This file is part of Invenio.
## Copyright (C) 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## Inv... | gpl-2.0 |
Mariaanisimova/pythonintask | IVTp/2014/Shcherbakov_R_A/task_12_22.py | 1 | 1719 | # Задача 12. Вариант 22.
# Разработайте игру "Крестики-нолики". (см. М.Доусон Программируем на Python
# гл. 6).
# Щербаков Р.А.
# 22.05.2016
print("""
Добро пожаловать на игру крестики нолики
чтобы сделать ход введите число от 0 до 8
0 | 1 | 2
---------
3 | 4 | 5
------... | apache-2.0 |
yanheven/console | openstack_dashboard/dashboards/admin/flavors/extras/urls.py | 9 | 1194 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 |
a4fr/my_nerd_bot | GoogleAppEngine/lib/werkzeug/debug/tbtools.py | 311 | 16785 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.tbtools
~~~~~~~~~~~~~~~~~~~~~~
This module provides various traceback related utility functions.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD.
"""
import re
import os
import sys
import json
import inspect
import ... | apache-2.0 |
muff1nman/duplicity | duplicity/manifest.py | 1 | 16791 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License... | gpl-2.0 |
gwpy/gwpy.github.io | docs/0.8.0/plotter/colors-1.py | 7 | 1123 | from __future__ import division
import numpy
from matplotlib import (pyplot, rcParams)
from matplotlib.colors import to_hex
from gwpy.plotter import colors
rcParams.update({
'text.usetex': False,
'font.size': 15
})
th = numpy.linspace(0, 2*numpy.pi, 512)
names = [
'gwpy:geo600',
'gwpy:kagra',
'... | gpl-3.0 |
karpeev/libmesh | doc/statistics/libmesh_citations.py | 1 | 2340 | #!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
# Number of "papers using libmesh" by year.
#
# Note 1: this does not count citations "only," the authors must have actually
# used libmesh in part of their work. Therefore, these counts do not include
# things like Wolfgang citing us in his pap... | lgpl-2.1 |
unindented/streamcode | client/static/jsrepl/extern/python/unclosured/lib/python2.7/json/__init__.py | 40 | 13818 | r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`json` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of the :m... | mit |
meisterluk/print-nonascii.py | printnonascii/char.py | 1 | 2308 | #!/usr/bin/env python3
class Character:
def __init__(self, c):
self.character = c
self.unicode_point = None
self.lineno = None
self.colno = None
self.category = None
self.description = None
self.line = None
def asciionly(self):
assert self.descri... | bsd-3-clause |
numenta/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/mlab.py | 69 | 104273 | """
Numerical python functions written for compatability with matlab(TM)
commands with the same names.
Matlab(TM) compatible functions
-------------------------------
:func:`cohere`
Coherence (normalized cross spectral density)
:func:`csd`
Cross spectral density uing Welch's average periodogram
:func:`detrend`... | agpl-3.0 |
building4theweb/soundem-api | soundem/views.py | 1 | 5875 | from flask import g, jsonify, request, abort
from flask_cors import cross_origin
from soundem import app
from .decorators import auth_token_required
from .models import Artist, Album, Song, User
@app.route('/api/v1/login', methods=['POST'])
@cross_origin(headers=['Content-Type', 'Authorization'])
def login():
d... | mit |
Cybnate/NuBits-Abe-explorer | contrib/ecdsa.py | 47 | 45627 | #!/usr/bin/env python
# Retrieved from http://ecdsa.org/ecdsa.py on 2011-10-17.
# Thanks to ThomasV.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, o... | agpl-3.0 |
ales-erjavec/scipy | scipy/sparse/dok.py | 53 | 16995 | """Dictionary Of Keys based matrix"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['dok_matrix', 'isspmatrix_dok']
import functools
import operator
import numpy as np
from scipy._lib.six import zip as izip, xrange
from scipy._lib.six import iter... | bsd-3-clause |
RomainBrault/scikit-learn | examples/decomposition/plot_kernel_pca.py | 353 | 2011 | """
==========
Kernel PCA
==========
This example shows that Kernel PCA is able to find a projection of the data
that makes data linearly separable.
"""
print(__doc__)
# Authors: Mathieu Blondel
# Andreas Mueller
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomp... | bsd-3-clause |
archf/ansible | lib/ansible/plugins/connection/funcd.py | 44 | 3714 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Based on chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2013, Michael Scherer <misc@zarb.org>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gene... | gpl-3.0 |
hypnotika/namebench | nb_third_party/graphy/backends/google_chart_api/encoders.py | 230 | 14800 | #!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
ducmanh86/server-persys | languages/my.py | 151 | 8210 | # coding: utf8
{
'!langcode!': 'my',
'!langname!': 'Malay',
'%d days ago': '%d hari yang lalu',
'%d hours ago': '%d jam yang lalu',
'%d minutes ago': '%d minit yang lalu',
'%d months ago': '%d bulan yang lalu',
'%d seconds ago': '%d saat yang lalu',
'%d seconds from now': '%d saat dari sekarang',
'%d weeks ago': '%d mi... | apache-2.0 |
mfherbst/spack | var/spack/repos/builtin/packages/py-flexx/package.py | 5 | 1619 | ##############################################################################
# Copyright (c) 2013-2018, 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 |
Jorge-Rodriguez/ansible | lib/ansible/modules/remote_management/manageiq/manageiq_policies.py | 64 | 11828 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Daniel Korn <korndaniel1@gmail.com>
# (c) 2017, Yaacov Zamir <yzamir@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANS... | gpl-3.0 |
hasanferit/trumpcrawler | crawlenv/lib/python3.5/site-packages/setuptools/command/install_lib.py | 431 | 3840 | import os
import imp
from itertools import product, starmap
import distutils.command.install_lib as orig
class install_lib(orig.install_lib):
"""Don't add compiled flags to filenames of non-Python files"""
def run(self):
self.build()
outfiles = self.install()
if outfiles is not None:
... | mit |
chromium/chromium | third_party/wpt_tools/wpt/tools/third_party/html5lib/html5lib/constants.py | 54 | 83464 | from __future__ import absolute_import, division, unicode_literals
import string
EOF = None
E = {
"null-character":
"Null character in input stream, replaced with U+FFFD.",
"invalid-codepoint":
"Invalid codepoint in stream.",
"incorrectly-placed-solidus":
"Solidus (/) incorrectly ... | bsd-3-clause |
notkarol/banjin | experiment/python_word_matching_speed.py | 1 | 4650 | #!/usr/bin/python
# Takes in a dictionary of words
# Verifies that all functions return the same answers
# Generates random hands from the probability of getting tiles from the bunch
# Then prints out how long each function takes to find all matching words
# Generates various hand sizes to see if there's any scaling
... | mit |
menardorama/ReadyNAS-Add-ons | headphones-1.0.0/files/apps/headphones/lib/cherrypy/lib/sessions.py | 55 | 33435 | """Session implementation for CherryPy.
You need to edit your config file to use sessions. Here's an example::
[/]
tools.sessions.on = True
tools.sessions.storage_type = "file"
tools.sessions.storage_path = "/home/site/sessions"
tools.sessions.timeout = 60
This sets the session to be stored in fi... | gpl-2.0 |
colede/qtcreator | tests/system/tools/findUnusedObjects.py | 4 | 5875 | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of Qt Creator.
##
## Commercial License Usage
## Licensees holding valid commercial Qt l... | lgpl-2.1 |
cloudtools/nymms | nymms/reactor/handlers/ses_handler.py | 1 | 1939 | import logging
from nymms.reactor.handlers.Handler import Handler
from nymms.utils.aws_helper import ConnectionManager
from jinja2 import Template
from nymms.utils.templates import SimpleUndefined
logger = logging.getLogger(__name__)
class SESHandler(Handler):
""" A basic handler to send alerts to people via e... | bsd-2-clause |
edunham/servo | tests/wpt/web-platform-tests/tools/wptserve/wptserve/handlers.py | 44 | 13193 | import cgi
import json
import os
import traceback
import urllib
import urlparse
from constants import content_types
from pipes import Pipeline, template
from ranges import RangeParser
from request import Authentication
from response import MultipartContent
from utils import HTTPException
__all__ = ["file_handler", "p... | mpl-2.0 |
asweigart/pyganim | examples/sprite_sheet_demo.py | 1 | 1276 | # trex image from Wyverii on http://opengameart.org/content/unsealed-terrex
import sys
import os
sys.path.append(os.path.abspath('..'))
import pygame
from pygame.locals import *
import pyganim
pygame.init()
# set up the window
windowSurface = pygame.display.set_mode((320, 240), 0, 32)
pygame.display.set_caption('Spr... | bsd-3-clause |
geminy/aidear | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/tools/grit/grit/grit_runner.py | 59 | 8519 | #!/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.
"""Command processor for GRIT. This is the script you invoke to run the various
GRIT tools.
"""
import os
import sys
if __name__ ... | gpl-3.0 |
Yahvuh/Eliza | Flask/Lib/site-packages/yaml/representer.py | 238 | 13528 |
__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',
'RepresenterError']
from .error import *
from .nodes import *
import datetime, sys, copyreg, types, base64
class RepresenterError(YAMLError):
pass
class BaseRepresenter:
yaml_representers = {}
yaml_multi_representers = {}
def __i... | gpl-2.0 |
jpwhite3/wilmu-linux-toolkit | lab_toolkit/includes/unittest2/test/test_loader.py | 17 | 60845 | import sys
import types
import warnings
import unittest2
import unittest2 as unittest
from unittest2 import util
# Decorator used in the deprecation tests to reset the warning registry for
# test isolation and reproducibility.
def warningregistry(func):
def wrapper(*args, **kws):
missing = object()
... | mit |
odoo-turkiye/odoo | addons/website_blog/__openerp__.py | 303 | 1819 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
DirtyPiece/dancestudio | Build/Tools/Python27/Lib/idlelib/ColorDelegator.py | 25 | 9780 | import time
import re
import keyword
import __builtin__
from idlelib.Delegator import Delegator
from idlelib.configHandler import idleConf
DEBUG = False
def any(name, alternates):
"Return a named group pattern matching list of alternates."
return "(?P<%s>" % name + "|".join(alternates) + ")"
def make_pat():
... | mit |
Xeralux/tensorflow | tensorflow/contrib/seq2seq/python/ops/attention_wrapper.py | 1 | 59833 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
Vladimir-Ivanov-Git/raw-packet | Scripts/DHCP/dhcp_rogue_server.py | 1 | 47873 | #!/usr/bin/env python
# region Import
from sys import path
from os.path import dirname, abspath
project_root_path = dirname(dirname(dirname(abspath(__file__))))
utils_path = project_root_path + "/Utils/"
path.append(utils_path)
from base import Base
from network import Ethernet_raw, ARP_raw, IP_raw, UDP_raw, DHCP_raw... | unlicense |
tinkerinestudio/Tinkerine-Suite | TinkerineSuite/python/Lib/asynchat.py | 247 | 11402 | # -*- Mode: Python; tab-width: 4 -*-
# Id: asynchat.py,v 2.26 2000/09/07 22:29:26 rushing Exp
# Author: Sam Rushing <rushing@nightmare.com>
# ======================================================================
# Copyright 1996 by Sam Rushing
#
# All Rights Reserved
#
# Permission... | agpl-3.0 |
PatrickOReilly/scikit-learn | examples/model_selection/plot_validation_curve.py | 141 | 1931 | """
==========================
Plotting Validation Curves
==========================
In this plot you can see the training scores and validation scores of an SVM
for different values of the kernel parameter gamma. For very low values of
gamma, you can see that both the training score and the validation score are
low. ... | bsd-3-clause |
jadhavhninad/-CSE_515_MWD_Analytics- | Phase 1/Project Code/phase1_code/differentiate_genre.py | 1 | 17298 | from mysqlConn import DbConnect
import argparse
import operator
from math import log,fabs
import pprint
#DB connector and curosor
db = DbConnect()
db_conn = db.get_connection()
cur2 = db_conn.cursor();
#Argument parser
parser = argparse.ArgumentParser()
parser.add_argument("GENRE1")
parser.add_argument("GENRE2")
par... | gpl-3.0 |
listamilton/supermilton.repository | plugin.video.efilmes/bs4/diagnose.py | 431 | 6315 | """Diagnostic functions, mainly for use when doing tech support."""
import cProfile
from StringIO import StringIO
from HTMLParser import HTMLParser
import bs4
from bs4 import BeautifulSoup, __version__
from bs4.builder import builder_registry
import os
import pstats
import random
import tempfile
import time
import tra... | gpl-2.0 |
mettadatalabs1/oncoscape-datapipeline | db/db_config.py | 1 | 2247 | from yaml import load as load_yaml
config_file = "/Users/namelessnerd/oncodata/db/connection_params.yml"
def load_db_configuration(config_file=config_file):
with open(config_file, "r") as config_file:
configs = load_yaml(config_file)
return configs
def create_mongo_protocol(project_id, connection_par... | apache-2.0 |
mohamed--abdel-maksoud/chromium.src | build/android/gyp/finalize_apk.py | 20 | 4131 | #!/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.
"""Signs and zipaligns APK.
"""
import optparse
import shutil
import sys
import tempfile
from util import build_utils
def RenameIn... | bsd-3-clause |
SnappleCap/oh-mainline | vendor/packages/Jinja2/examples/bench.py | 75 | 10922 | """\
This benchmark compares some python templating engines with Jinja 2 so
that we get a picture of how fast Jinja 2 is for a semi real world
template. If a template engine is not installed the test is skipped.\
"""
import sys
import cgi
from timeit import Timer
from jinja2 import Environment as JinjaEnvi... | agpl-3.0 |
geekaia/edx-platform | lms/djangoapps/courseware/management/commands/remove_input_state.py | 92 | 6722 | '''
This is a one-off command aimed at fixing a temporary problem encountered where input_state was added to
the same dict object in capa problems, so was accumulating. The fix is simply to remove input_state entry
from state for all problems in the affected date range.
'''
import json
import logging
from optparse im... | agpl-3.0 |
ArtsiomCh/tensorflow | tensorflow/contrib/distributions/python/ops/bijectors/masked_autoregressive_impl.py | 8 | 19398 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
ThirdProject/android_external_chromium_org | tools/telemetry/telemetry/value/value_backcompat.py | 36 | 1984 | # 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.
"""Backward compatibility for old results API.
This module helps convert the old PageMeasurementResults API into the new
style one. This exists as a bridging... | bsd-3-clause |
gregdek/ansible | lib/ansible/modules/cloud/azure/azure_rm_mysqlfirewallrule_facts.py | 22 | 5878 | #!/usr/bin/python
#
# Copyright (c) 2018 Zim Kalinowski, <zikalino@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
campaul/dicebox | dicebox/test/test_dice.py | 1 | 4083 | import mock
import pytest
from dicebox.dice import Add, Best, Die, DiceFactory, Modifier, Pool, Sort, Worst
class TestDiceFactory(object):
@pytest.fixture
def sides(self):
return 20
def test_call(self, sides):
assert type(DiceFactory()(sides)) == Die
def test_bias(self, sides):
... | mit |
DSLituiev/scikit-learn | sklearn/datasets/mldata.py | 309 | 7838 | """Automatically download MLdata datasets."""
# Copyright (c) 2011 Pietro Berkes
# License: BSD 3 clause
import os
from os.path import join, exists
import re
import numbers
try:
# Python 2
from urllib2 import HTTPError
from urllib2 import quote
from urllib2 import urlopen
except ImportError:
# Pyt... | bsd-3-clause |
bank-netforce/netforce | netforce_general/netforce_general/models/user_pref.py | 2 | 4146 | # 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 |
brettdh/rbtools | rbtools/commands/status.py | 1 | 2506 | import logging
from rbtools.commands import Command, Option
from rbtools.utils.repository import get_repository_id
from rbtools.utils.users import get_username
class Status(Command):
"""Display review requests for the current repository."""
name = "status"
author = "The Review Board Project"
descript... | mit |
urnote/urnote | note/view.py | 2 | 3437 | from note.infrastructure.error import UserError
from note.infrastructure.stdouthelper import StdoutHelper
from note.module.visitor import (ReportAfterStatus, LocatedQuestions,
ReportAfterCommit)
from note.utils import truncate_for_display
LOCATION_MSG = ' {location}:\n'.format
QUEST... | gpl-3.0 |
mennanov/django-blueprint | project_name/apps/navigation/models.py | 1 | 1661 | # -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
from mptt.models import TreeForeignKey, TreeManyToManyField, MPTTModel
class Navigation(models.Model):
"""
Navigation menu
"""
key = models.CharField(_(u'key'), max_length=32, help_text=_(u'Thi... | gpl-2.0 |
ehashman/oh-mainline | vendor/packages/webtest/tests/test_response.py | 15 | 14539 | #coding: utf-8
from __future__ import unicode_literals
import sys
import webtest
from webtest.debugapp import debug_app
from webob import Request
from webob.response import gzip_app_iter
from webtest.compat import PY3
from tests.compat import unittest
import webbrowser
def links_app(environ, start_response):
... | agpl-3.0 |
Daniel-CA/odoomrp-wip-public | mrp_production_capacity/wizard/wiz_split_production.py | 25 | 3546 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import fields, models, api, exceptions, _
cl... | agpl-3.0 |
ity/pants | src/python/pants/engine/nodes.py | 1 | 17119 | # coding=utf-8
# Copyright 2015 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 abc import abst... | apache-2.0 |
bodi000/odoo | openerp/report/custom.py | 43 | 25208 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
mfazliazran/raft | core/fuzzer/Payloads.py | 11 | 2262 | #
# Author: Nathan Hamiel
#
# Copyright (c) 2011 RAFT Team
#
# This file is part of RAFT.
#
# RAFT 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 lat... | gpl-3.0 |
Hummer12007/pomu | pomu/repo/repo.py | 1 | 9456 | """Subroutines with repositories"""
from os import path, rmdir, makedirs
from shutil import copy2
from git import Repo
from patch import PatchSet
import portage
from pomu.package import Package, PatchList
from pomu.util.cache import cached
from pomu.util.fs import remove_file, strip_prefix
from pomu.util.result impo... | gpl-2.0 |
gustavo-guimaraes/siga | backend/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/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... | mit |
di0spyr0s/pants | src/python/pants/backend/jvm/tasks/jar_task.py | 5 | 14840 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import tem... | apache-2.0 |
chiragjogi/odoo | addons/crm/wizard/crm_merge_opportunities.py | 333 | 4562 | ##############################################################################
#
# 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 Affero General Public L... | agpl-3.0 |
thisispuneet/potato-blog | django/contrib/gis/gdal/field.py | 264 | 6059 | from ctypes import byref, c_int
from datetime import date, datetime, time
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import OGRException
from django.contrib.gis.gdal.prototypes import ds as capi
# For more information, see the OGR C API source code:
# http://www.gdal.org/ogr/... | bsd-3-clause |
cubex2/ObsidianAnimator | API/src/blender/io_export_obs/__init__.py | 3 | 4701 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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.
#
# This program is distrib... | gpl-3.0 |
mattrobenolt/pip | tests/unit/test_unit_outdated.py | 3 | 4610 | import sys
import datetime
import os
from contextlib import contextmanager
import freezegun
import pytest
import pretend
import pip
from pip._vendor import lockfile
from pip.utils import outdated
@pytest.mark.parametrize(
['stored_time', 'newver', 'check', 'warn'],
[
('1970-01-01T10:00:00Z', '2.0', ... | mit |
patricmutwiri/pombola | pombola/core/kenya_import_scripts/import_member_photos.py | 4 | 1466 | #!/usr/bin/env python
import os
import sys
# Horrible boilerplate - there must be a better way :)
sys.path.append(
os.path.abspath(
os.path.dirname(__file__) + '../../..'
)
)
import simplejson
import time
import urllib
from pprint import pprint
from django.core.files.base import ContentFile
from p... | agpl-3.0 |
xingyepei/edx-platform | common/djangoapps/session_inactivity_timeout/middleware.py | 228 | 1981 | """
Middleware to auto-expire inactive sessions after N seconds, which is configurable in
settings.
To enable this feature, set in a settings.py:
SESSION_INACTIVITY_TIMEOUT_IN_SECS = 300
This was taken from StackOverflow (http://stackoverflow.com/questions/14830669/how-to-expire-django-session-in-5minutes)
"""
fro... | agpl-3.0 |
gx1997/chrome-loongson | chrome/app/policy/PRESUBMIT.py | 10 | 3819 | # 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.
# If this presubmit check fails or misbehaves, please complain to
# mnissler@chromium.org, pastarmovj@chromium.org or joaodasilva@chromium.org.
def _Ch... | bsd-3-clause |
Reroot/stagger | stagger/errors.py | 18 | 2051 | #
# errors.py
# From the stagger project: http://code.google.com/p/stagger/
#
# Copyright (c) 2009-2011 Karoly Lorentey <karoly@lorentey.hu>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
... | bsd-2-clause |
aaltinisik/OCBAltinkaya | addons/mrp/wizard/mrp_product_produce.py | 75 | 6237 | # -*- 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 |
snakeleon/YouCompleteMe-x64 | third_party/ycmd/ycmd/server_state.py | 3 | 5257 | # Copyright (C) 2013-2020 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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.
#
#... | gpl-3.0 |
eepalms/gem5-newcache | util/stats/dbinit.py | 90 | 15861 | # Copyright (c) 2003-2004 The Regents of The University of Michigan
# 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 ... | bsd-3-clause |
mgh14/470ai | bzrflag/game.py | 17 | 27895 | # Bzrflag
# Copyright 2008-2011 Brigham Young University
#
# This file is part of Bzrflag.
#
# Bzrflag 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 l... | gpl-3.0 |
Juniper/contrail-dev-neutron | neutron/tests/unit/ml2/test_ml2_plugin.py | 3 | 13799 | # Copyright (c) 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 ... | apache-2.0 |
Siosm/contextd-capture | piga-systrans/selaudit/selaudit.py | 2 | 25513 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Configuration
# Templates
basepolname = 'template/module'
base_transpol_name = 'template/temp_transition'
makefile_path = 'template/Makefile'
# Default value for the template variables
user_u_default = 'user_u'
user_r_default = 'user_r'
user_t_default = 'user_t'
module_d... | gpl-3.0 |
Gateworks/platform-external-chromium_org | third_party/closure_linter/closure_linter/fixjsstyle_test.py | 135 | 7371 | #!/usr/bin/env python
#
# Copyright 2008 The Closure Linter 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
#... | bsd-3-clause |
rossella/neutron | quantum/openstack/common/rpc/impl_zmq.py | 1 | 25519 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Cloudscaling Group, 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/LI... | apache-2.0 |
40223202/test | static/Brython3.1.3-20150514-095342/Lib/site-packages/pygame/locals.py | 603 | 1141 | ## pygame - Python Game Library
## Copyright (C) 2000-2003 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License... | agpl-3.0 |
alexg-dev/closure-library | closure/bin/build/source_test.py | 153 | 3653 | #!/usr/bin/env python
#
# Copyright 2010 The Closure Library 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
... | apache-2.0 |
aquarimeter/aquarimeter | lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.py | 714 | 4741 | # urllib3/contrib/ntlmpool.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://co... | apache-2.0 |
rebost/django | django/utils/unittest/result.py | 570 | 6105 | """Test result object"""
import sys
import traceback
import unittest
from StringIO import StringIO
from django.utils.unittest import util
from django.utils.unittest.compatibility import wraps
__unittest = True
def failfast(method):
@wraps(method)
def inner(self, *args, **kw):
if getattr(self, 'fail... | bsd-3-clause |
unsiloai/syntaxnet-ops-hack | tensorflow/contrib/boosted_trees/python/training/functions/gbdt_batch_test.py | 9 | 36473 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
cecep-edu/edx-platform | pavelib/paver_tests/test_prereqs.py | 63 | 1959 | """
Tests covering the Open edX Paver prequisites installation workflow
"""
import os
import unittest
from pavelib.prereqs import no_prereq_install
class TestPaverPrereqInstall(unittest.TestCase):
"""
Test the status of the NO_PREREQ_INSTALL variable, its presence and how
paver handles it.
"""
de... | agpl-3.0 |
etherkit/OpenBeacon2 | client/linux-arm/venv/lib/python3.5/site-packages/pip/download.py | 334 | 32171 | from __future__ import absolute_import
import cgi
import email.utils
import getpass
import json
import logging
import mimetypes
import os
import platform
import re
import shutil
import sys
import tempfile
try:
import ssl # noqa
HAS_TLS = True
except ImportError:
HAS_TLS = False
from pip._vendor.six.move... | gpl-3.0 |
MFoster/breeze | tests/modeltests/signals/tests.py | 112 | 5272 | from __future__ import absolute_import
from django.db.models import signals
from django.dispatch import receiver
from django.test import TestCase
from django.utils import six
from .models import Person, Car
# #8285: signals can be any callable
class PostDeleteHandler(object):
def __init__(self, data):
s... | bsd-3-clause |
rjawor/concordia-server | mgiza-aligner/mgiza/experimental/dual-model/MGIZA/scripts/sntpostproc.py | 8 | 2437 | #!/usr/bin/env python
# This script post process the snt file -- either in single-line format or in multi-line format
# The output, however, will always be in single-line format
from sys import *
from optparse import OptionParser
import re;
usage = """
The script post process the snt file, the input could be single-l... | lgpl-3.0 |
onecrayon/PopClip-Extensions | source/Trello/requests/packages/urllib3/connection.py | 371 | 8967 | import datetime
import sys
import socket
from socket import timeout as SocketTimeout
import warnings
from .packages import six
try: # Python 3
from http.client import HTTPConnection as _HTTPConnection, HTTPException
except ImportError:
from httplib import HTTPConnection as _HTTPConnection, HTTPException
cla... | mit |
amoya-dx/account-financial-tools | account_asset_management/report/__init__.py | 35 | 1166 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
#
# This program is ... | agpl-3.0 |
gogobook/wagtail | wagtail/wagtailadmin/tests/test_account_management.py | 2 | 21342 | from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.core import mail
from django.core.urlresolvers import reverse
from django.test import TestCase, ... | bsd-3-clause |
anlutro/botologist | plugins/qlranks.py | 1 | 2116 | import logging
log = logging.getLogger(__name__)
import requests
import requests.exceptions
import botologist.plugin
def _get_qlr_data(nick):
url = "http://www.qlranks.com/api.aspx"
response = requests.get(url, {"nick": nick}, timeout=4)
return response.json()["players"][0]
def _get_qlr_elo(nick, mod... | mit |
JamesMGreene/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/adduserstogroups.py | 124 | 3195 | # Copyright (c) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
apple/swift-llvm | docs/conf.py | 18 | 9473 | # -*- coding: utf-8 -*-
#
# LLVM documentation build configuration file.
#
# 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.
#
# All configuration values have a default; values that are commented... | apache-2.0 |
HybridF5/nova | nova/api/openstack/compute/legacy_v2/contrib/flavorextradata.py | 79 | 2440 | # Copyright 2012 OpenStack Foundation
# Copyright 2011 Canonical Ltd.
# 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/license... | apache-2.0 |
thisisALPINE/subterfuge | utilities/arpwatch.py | 27 | 2485 | #!/usr/bin/python
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
import time
import os
import sys
#Initialize Globals
gatewayip = '' #first argument
routermac = '' #second argument
myip = '' #third argument
def arp_monitor_callback(pkt):
if ARP in pkt and pkt[ARP].... | gpl-3.0 |
abzaloid/maps | django-project/lib/python2.7/site-packages/django/core/cache/backends/dummy.py | 629 | 1213 | "Dummy cache backend"
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
class DummyCache(BaseCache):
def __init__(self, host, *args, **kwargs):
BaseCache.__init__(self, *args, **kwargs)
def add(self, key, value, timeout=DEFAULT_TIMEOUT, version=None):
key = self.make_key... | mit |
embeddedarm/android_external_chromium_org | build/android/gyp/push_libraries.py | 29 | 2346 | #!/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.
"""Pushes native libraries to a device.
"""
import json
import optparse
import os
import sys
BUILD_ANDROID_DIR = os.path.join(os.p... | bsd-3-clause |
msabramo/zerorpc-python | tests/test_client_heartbeat.py | 7 | 2621 | # -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | mit |
Aloomaio/googleads-python-lib | examples/ad_manager/v201808/reconciliation_report_row_service/get_reconciliation_report_rows_for_reconciliation_report.py | 1 | 2609 | #!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | apache-2.0 |
Jgarcia-IAS/localizacion | openerp/addons-extra/odoo-pruebas/odoo-server/addons/website_mail_group/models/mail_group.py | 321 | 2678 | # -*- coding: utf-8 -*-
from openerp.osv import osv
from openerp import tools
from openerp.tools.translate import _
from openerp.tools.safe_eval import safe_eval as eval
from openerp.addons.website.models.website import slug
class MailGroup(osv.Model):
_inherit = 'mail.group'
def message_get_email_values(sel... | agpl-3.0 |
ZeitOnline/zeit.content.article | src/zeit/content/article/tests/test_article.py | 1 | 17840 | # coding: utf8
from zeit.cms.workflow.interfaces import CAN_PUBLISH_ERROR
from zeit.cms.workflow.interfaces import CAN_PUBLISH_SUCCESS
import lxml.etree
import mock
import zeit.cms.checkout.helper
import zeit.cms.content.interfaces
import zeit.cms.content.reference
import zeit.cms.interfaces
import zeit.cms.workflow.in... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.