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 |
|---|---|---|---|---|---|
flavour/helios | models/flood.py | 3 | 6038 | # -*- coding: utf-8 -*-
"""
Flood Alerts Module - Model
@author: Fran Boon
@see: http://eden.sahanafoundation.org/wiki/Pakistan
"""
module = "flood"
if deployment_settings.has_module(module):
# -----------------------------------------------------------------------------
# Rivers
resourcenam... | mit |
feketemihai/l10n-romania | l10n_ro_config/__init__.py | 2 | 1052 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Fekete Mihai <mihai.fekete@forbiom.eu>
# Copyright (C) 2014 FOREST AND BIOMASS SERVICES ROMANIA SA
# (http://www.forbiom.eu).
#
# This program is free software: you can redistribute it and/or... | agpl-3.0 |
bigdataelephants/scikit-learn | examples/applications/topics_extraction_with_nmf.py | 106 | 2313 | """
========================================================
Topics extraction with Non-Negative Matrix Factorization
========================================================
This is a proof of concept application of Non Negative Matrix
Factorization of the term frequency matrix of a corpus of documents so
as to extra... | bsd-3-clause |
InnerFire/thunderzap_sprout | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
grzmot22/Alucard-Kernel-jfltexx | Documentation/target/tcm_mod_builder.py | 4981 | 41422 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
40223227/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/zipfile.py | 620 | 66368 | """
Read and write ZIP files.
XXX references to utf-8 need further investigation.
"""
import io
import os
import re
import imp
import sys
import time
import stat
import shutil
import struct
import binascii
try:
import zlib # We may need its compression method
crc32 = zlib.crc32
except ImportError:
zlib =... | gpl-3.0 |
vitan/hue | desktop/core/ext-py/Django-1.6.10/tests/empty/tests.py | 58 | 1221 | from __future__ import absolute_import
from django.core.exceptions import ImproperlyConfigured
from django.db.models.loading import get_app
from django.test import TestCase
from django.test.utils import override_settings
from django.utils import six
from .models import Empty
class EmptyModelTests(TestCase):
def... | apache-2.0 |
dbrattli/python-gearshift | gearshift/command/quickstart.py | 1 | 15603 | """Quickstart command to generate a new project.
Quickstart takes the files from gearshift.quickstart and processes them to produce
a new, ready-to-run project.
"""
import pkg_resources
import re
import os
import os.path
import shutil
import stat
import optparse
import sys
import gearshift
try:
from paste.script... | mit |
socrateslee/python-oauth2 | oauth2/clients/imap.py | 885 | 1685 | """
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 ... | mit |
fafaman/django | tests/template_tests/filter_tests/test_timeuntil.py | 161 | 4470 | from __future__ import unicode_literals
from datetime import datetime, timedelta
from django.template.defaultfilters import timeuntil_filter
from django.test import SimpleTestCase
from django.test.utils import requires_tz_support
from ..utils import setup
from .timezone_utils import TimezoneTestCase
class Timeunti... | bsd-3-clause |
jacekn/kubernetes | examples/cluster-dns/images/frontend/client.py | 504 | 1207 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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 appli... | apache-2.0 |
rodrigoasmacedo/l10n-brazil | __unported__/l10n_br_account/res_company.py | 2 | 3283 | # -*- encoding: utf-8 -*-
###############################################################################
# #
# Copyright (C) 2009 Renato Lima - Akretion #
# ... | agpl-3.0 |
h113331pp/kernel-3.10.17 | tools/perf/util/setup.py | 2079 | 1438 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
areitz/pants | tests/python/pants_test/backend/python/tasks/checkstyle/test_variable_names.py | 7 | 5322 | # 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 pants.backend.p... | apache-2.0 |
Sutto/cloud-custodian | tools/sandbox/c7n_sphere11/setup.py | 5 | 1198 | # Copyright 2016 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 |
sym3tri/mitro | browser-ext/login/test/common/init_webdriver.py | 26 | 2978 |
# *****************************************************************************
# Copyright (c) 2012, 2013, 2014 Lectorius, Inc.
# Authors:
# Vijay Pandurangan (vijayp@mitro.co)
# Evan Jones (ej@mitro.co)
# Adam Hilss (ahilss@mitro.co)
#
#
# This program is free software: you can redistribute it and/or modify
# ... | gpl-3.0 |
molotof/infernal-twin | build/reportlab/src/reportlab/platypus/tables.py | 25 | 68142 | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/platypus/tables.py
__version__=''' $Id$ '''
__doc__="""
Tables are created by passing the constructor a tuple of column widths, a tuple of row heights... | gpl-3.0 |
Microsoft/PTVS | Python/Tests/TestData/VirtualEnv/env/Lib/encodings/iso8859_13.py | 593 | 13527 | """ Python Character Mapping Codec iso8859_13 generated from 'MAPPINGS/ISO8859/8859-13.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 |
Vixionar/django | tests/model_fields/test_uuid.py | 81 | 6563 | import json
import uuid
from django.core import exceptions, serializers
from django.db import IntegrityError, models
from django.test import (
SimpleTestCase, TestCase, TransactionTestCase, skipUnlessDBFeature,
)
from .models import (
NullableUUIDModel, PrimaryKeyUUIDModel, RelatedToUUIDModel, UUIDGrandchild,... | bsd-3-clause |
AngryEgret/realms-wiki | realms/config/__init__.py | 1 | 3611 | import os
import json
from urlparse import urlparse
def update(data):
conf = read()
conf.update(data)
return save(data)
def read():
conf = dict()
for k, v in os.environ.items():
if k.startswith('REALMS_'):
conf[k[7:]] = v
loc = get_path()
if loc:
with open(... | gpl-2.0 |
kambysese/mne-python | examples/connectivity/plot_mne_inverse_coherence_epochs.py | 12 | 5711 | """
==============================================================
Compute coherence in source space using a MNE inverse solution
==============================================================
This example computes the coherence between a seed in the left
auditory cortex and the rest of the brain based on single-trial... | bsd-3-clause |
nitinitprof/odoo | addons/crm_partner_assign/report/__init__.py | 443 | 1096 | # -*- 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 |
mlperf/training_results_v0.7 | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/python/mxnet/contrib/onnx/onnx2mx/import_onnx.py | 5 | 9323 | # 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 |
liuxuyang/tools | kpiTest/data/mode_tag.py | 1 | 3667 | CAMERA_MODE_PHOTO2 = 100
CAMERA_MODE_PHOTO = 0
CAMERA_MODE_FACE_BEAUTY = 1
CAMERA_MODE_PANORAMA = 2
CAMERA_MODE_SELF_WIDEVIEW = 3
CAMERA_MODE_SCENE_FRAME = 4
CAMERA_MODE_GESTURE_SHOT = 5
CAMERA_MODE_LIVE_PHOTO = 6
CAMERA_MODE_VIDEO = 7
CAMERA_MODE_PROFESSIONAL = 8
CAMERA_MODE_NIGHTSHOT = 9
CAMERA_MODE_PIP = 10
CAMERA_M... | apache-2.0 |
g8os/grid | pyclient/zeroos/orchestrator/client/__init__.py | 2 | 5568 | import requests
from .Backup import Backup
from .BackupContainer import BackupContainer
from .Bridge import Bridge
from .BridgeCreate import BridgeCreate
from .BridgeCreateSetting import BridgeCreateSetting
from .CPUInfo import CPUInfo
from .CPUStats import CPUStats
from .CloudInit import CloudInit
from .Cluster impo... | apache-2.0 |
DavidPurcell/murano_temp | murano/engine/mock_context_manager.py | 1 | 5692 | # Copyright (c) 2015 Mirantis 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 writ... | apache-2.0 |
mitsuhiko/zine | zine/utils/datastructures.py | 1 | 8233 | # -*- coding: utf-8 -*-
"""
zine.utils.datastructures
~~~~~~~~~~~~~~~~~~~~~~~~~
Various data structures.
:copyright: (c) 2010 by the Zine Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from itertools import izip, imap
from copy import deepcopy
class _Missing... | bsd-3-clause |
chrisfilda/edx_platform | common/lib/capa/capa/correctmap.py | 47 | 6551 | #-----------------------------------------------------------------------------
# class used to store graded responses to CAPA questions
#
# Used by responsetypes and capa_problem
class CorrectMap(object):
"""
Stores map between answer_id and response evaluation result for each question
in a capa problem. ... | agpl-3.0 |
lisa-lab/pylearn2 | pylearn2/sandbox/rnn/space/__init__.py | 41 | 10581 | """
Spaces specific to the RNN framework, specifically the SequenceSpace
"""
from __future__ import print_function
from functools import wraps
import numpy as np
from theano import scan, config
from theano import tensor
from theano.tensor import TensorType
from pylearn2 import space
from pylearn2.space import Conv2DS... | bsd-3-clause |
spawnedc/MeCanBlog | django/db/backends/creation.py | 3 | 22557 | import sys
import time
from django.conf import settings
from django.utils.datastructures import DictWrapper
# The prefix to put on the default database name when creating
# the test database.
TEST_DATABASE_PREFIX = 'test_'
class BaseDatabaseCreation(object):
"""
This class encapsulates all backend-specific d... | bsd-3-clause |
jiangzhonghui/thumbor | vows/point_vows.py | 14 | 4576 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
from pyvows import Vows, expect
from thumbor.point import FocalPoin... | mit |
Gela/deepdive | examples/tutorial_example/step2-generic-features/experiment-reports/v00002/code/udf/ext_has_spouse_features.py | 45 | 1820 | #! /usr/bin/env python
import sys, os
import ddlib # DeepDive python utility
ARR_DELIM = '~^~'
# Load keyword dictionaries using ddlib, for domain-specific features
# Words in "married" dictionary are indicative of marriage
# Words in "non_married" dictionary are indicative of non_marriage
BASE_DIR = os.path.dir... | apache-2.0 |
coreycb/horizon | openstack_dashboard/dashboards/project/instances/console.py | 27 | 2562 | #
# 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
# ... | apache-2.0 |
migueldvb/george | document/code/exo_demo_1/results.py | 4 | 1288 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function
__all__ = ["results"]
import os
import triangle
import numpy as np
import cPickle as pickle
import matplotlib.pyplot as pl
def results(fn):
model, sampler = pickle.load(open(fn, "rb"))
mu = np.median(model.f)
... | mit |
kailIII/emaresa | aeroo/report_aeroo_printscreen/__openerp__.py | 2 | 2292 | ##############################################################################
#
# Copyright (c) 2008-2013 Alistek Ltd (http://www.alistek.com) All Rights Reserved.
# General contacts <info@alistek.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take th... | agpl-3.0 |
kakunbsc/enigma2.1 | lib/python/Plugins/Extensions/DVDBurn/TitleProperties.py | 14 | 8424 | from Screens.Screen import Screen
from Screens.ChoiceBox import ChoiceBox
from Screens.InputBox import InputBox
from Screens.MessageBox import MessageBox
from Screens.HelpMenu import HelpableScreen
from Components.ActionMap import HelpableActionMap, ActionMap
from Components.Sources.List import List
from Components.Sou... | gpl-2.0 |
johnchronis/exareme | exareme-tools/madis/src/lib/pyreadline/console/event.py | 9 | 1131 | class Event(object):
'''Represent events from the console.'''
def __init__(self, console, input):
pass
def __repr__(self):
'''Display an event for debugging.'''
if self.type in ['KeyPress', 'KeyRelease']:
chr=self.char
if ord(chr)<ord("A"):
chr... | mit |
visualputty/Landing-Lights | django/utils/decorators.py | 174 | 4290 | "Functions that help with dynamically creating decorators for views."
try:
from functools import wraps, update_wrapper, WRAPPER_ASSIGNMENTS
except ImportError:
from django.utils.functional import wraps, update_wrapper, WRAPPER_ASSIGNMENTS # Python 2.4 fallback.
class classonlymethod(classmethod):
def __g... | bsd-3-clause |
matthiasdiener/spack | var/spack/repos/builtin/packages/gasnet/package.py | 5 | 3678 | ##############################################################################
# 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 |
osvalr/odoo | addons/crm/wizard/crm_phonecall_to_phonecall.py | 337 | 4535 | # -*- 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 |
dmacvicar/spacewalk | client/solaris/smartpm/smart/backends/rpm/redcarpet.py | 3 | 9604 | #
# Copyright (c) 2004 Conectiva, Inc.
#
# Written by Gustavo Niemeyer <niemeyer@conectiva.com>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager 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 Fou... | gpl-2.0 |
joongh/robotframework | atest/testdata/standard_libraries/remote/simpleserver.py | 27 | 1535 | import sys
from SimpleXMLRPCServer import SimpleXMLRPCServer
from remoteserver import announce_port
class SimpleServer(SimpleXMLRPCServer):
def __init__(self, port=8270, port_file=None):
SimpleXMLRPCServer.__init__(self, ('127.0.0.1', int(port)))
self.register_function(self.get_keyword_names)
... | apache-2.0 |
zachjanicki/osf.io | scripts/analytics/tabulate_logs.py | 16 | 1543 | # -*- coding: utf-8 -*-
"""Scripts for aggregating recently added logs by action type; pushes results
to the specified project.
"""
import bson
import datetime
from cStringIO import StringIO
import pymongo
from framework.mongo import database
from website import models
from website.app import app, init_app
from sc... | apache-2.0 |
sciunto/rss2email | rss2email/feeds.py | 7 | 14342 | # Copyright (C) 2004-2014 Aaron Swartz
# Brian Lalor
# Dean Jackson
# Erik Hetzner
# Etienne Millon <me@emillon.org>
# Joey Hess
# Lindsey Smith <lindsey.smith@gmail.com>
# ... | gpl-2.0 |
mpercich/Calendarize | ios/dateparser/lib/python2.7/site-packages/ruamel/yaml/resolver.py | 1 | 15395 | # coding: utf-8
from __future__ import absolute_import
import re
from typing import Any, Dict # NOQA
from ruamel.yaml.error import * # NOQA
from ruamel.yaml.nodes import * # NOQA
from ruamel.yaml.compat import string_types
__all__ = ['BaseResolver', 'Res... | mit |
nswrdn/django-usage | usage/migrations/0004_period_usagesummary.py | 2 | 1302 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('usage', '0003_pagehit_summarized'),
]... | bsd-3-clause |
open-synergy/connector | connector/backend.py | 19 | 13555 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | agpl-3.0 |
segwitcoin/SegwitCoin | test/functional/txn_clone.py | 32 | 7658 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet accounts properly when there are cloned transactions with malleated scriptsigs."""
fro... | mit |
Ph0enixxx/python | zentst/0023/mysite/wsgi.py | 102 | 1419 | """
WSGI config for mysite project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` s... | mit |
fillycheezstake/MissionPlanner | Lib/ctypes/util.py | 44 | 9296 | ######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
import sys, os
# find_library(name) returns the pathname of a library, or None.
if os.name == "nt":
... | gpl-3.0 |
moijes12/treeherder | treeherder/model/management/commands/init_datasources.py | 5 | 1226 | from optparse import make_option
from django.core.management.base import BaseCommand
from django.utils.six.moves import input
from treeherder.model.models import Datasource, Repository
class Command(BaseCommand):
help = ("Populate the datasource table and"
"create the connected databases")
opti... | mpl-2.0 |
calvinpy/django-guardian | docs/conf.py | 43 | 7214 | # -*- coding: utf-8 -*-
#
# django-guardian documentation build configuration file, created by
# sphinx-quickstart on Thu Feb 18 23:18:28 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.... | bsd-2-clause |
foobarbazblarg/stayclean | stayclean-2020-december/venv/lib/python3.8/site-packages/pip/_vendor/chardet/langbulgarianmodel.py | 269 | 12839 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
xificurk/pyggs | plugins/elevations.py | 1 | 3024 | # -*- coding: utf-8 -*-
"""
plugins/elevations.py - Show distribution of found caches by elevation.
Copyright (C) 2010 Petr Morávek
This file is part of Pyggs.
Pyggs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the... | gpl-2.0 |
nthien/pulp | nodes/common/pulp_node/manifest.py | 17 | 14446 | # Copyright (c) 2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the impl... | gpl-2.0 |
luzpaz/QGIS | python/plugins/processing/algs/qgis/DefineProjection.py | 10 | 3290 | # -*- coding: utf-8 -*-
"""
***************************************************************************
SpatialIndex.py
---------------------
Date : January 2016
Copyright : (C) 2016 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
************... | gpl-2.0 |
unicefuganda/edtrac | edtrac_project/rapidsms_edtrac/education/management/commands/reprocess_missing_group_polls.py | 1 | 6792 | from django.core.exceptions import MultipleObjectsReturned
from django.core.management.base import BaseCommand
from optparse import OptionParser, make_option
from poll.models import Poll, Response, ResponseCategory
from education.models import EmisReporter
from script.models import ScriptSession, Script
from rapidsms_... | bsd-3-clause |
extremewaysback/django | django/contrib/auth/mixins.py | 305 | 4087 | from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.views import redirect_to_login
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.utils import six
from django.utils.encoding import force_text
class AccessMixin(object):
... | bsd-3-clause |
realgo/luigi | luigi/lock.py | 30 | 3248 | # -*- 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 |
Dino0631/RedRain-Bot | lib/youtube_dl/extractor/breakcom.py | 39 | 5327 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
int_or_none,
parse_age_limit,
)
class BreakIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?P<site>break|screenjunkies)\.com/video/(?P<display_id>[^/]+?)(?:-(?P... | gpl-3.0 |
deandevl/num_sci_server_projects | ThinkStats/Code/convert_dat_to_csv_file.py | 1 | 1228 | __author__ = 'Rick Dean'
__doc__ = ' '
#Created by Rick on 2017-03-19.
import re
import csv
type_map = dict(byte=int, int=int, long=int, float=float, double=float)
var_info = []
names = []
for line in open('2002FemPreg.dct'):
match = re.search( r'_column\(([^)]*)\)', line)
if match:
start = int(match.group(1... | mit |
dalegregory/odoo | addons/account/project/report/__init__.py | 427 | 1175 | # -*- 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 |
OCA/partner-contact | partner_second_lastname/models/res_config_settings.py | 1 | 1225 | # Copyright 2015 Antiun Ingenieria S.L. - Antonio Espinosa
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"
def _partner_names_order_selection(self):
options = super(ResConfig... | agpl-3.0 |
DreamerBear/awesome-py3-webapp | www/app.py | 1 | 1195 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Date : 2017/10/18 17:08
# @Author : xxc727xxc (xxc727xxc@foxmail.com)
# @Version : 1.0.0
import asyncio
import logging.config
from aiohttp import web
import core.orm.orm as orm
from biz.controller.middlewares import auth_factory, log_factory, response_factory
from... | gpl-3.0 |
tonyli71/designate | functionaltests/common/config.py | 3 | 2272 | """
Copyright 2015 Rackspace
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
dist... | apache-2.0 |
kristomu/voting-scripts | new_methods/bucklin_range/dbuck_partylist.py | 1 | 5056 | # Double Bucklin party list (Webster-based)
import numpy as np
from scipy.optimize import bisect
lcr_names = ["Left", "Center", "Right"]
lcr = np.array([
[10, 5, 0],
[0, 5, 10],
[6, 10, 0],
[0, 10, 5]
])
lcr_weights = [3, 3, 1, 1]
# https://en.wikipedia.org/wiki/Webster/Sainte-Lagu%C3%AB_method
sainte_seats = ... | gpl-3.0 |
megies/numpy | numpy/doc/indexing.py | 12 | 14353 | """
==============
Array indexing
==============
Array indexing refers to any use of the square brackets ([]) to index
array values. There are many options to indexing, which give numpy
indexing great power, but with power comes some complexity and the
potential for confusion. This section is just an overview of the
v... | bsd-3-clause |
bjolivot/ansible | lib/ansible/executor/stats.py | 57 | 2836 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
hn8841182/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/unittest/result.py | 727 | 6397 | """Test result object"""
import io
import sys
import traceback
from . import util
from functools import wraps
__unittest = True
def failfast(method):
@wraps(method)
def inner(self, *args, **kw):
if getattr(self, 'failfast', False):
self.stop()
return method(self, *args, **kw)
... | gpl-3.0 |
manueldelreal/termineter | framework/modules/brute_force_login.py | 2 | 5377 | # framework/modules/brute_force_login.py
#
# Copyright 2011 Spencer J. McIntyre <SMcIntyre [at] SecureState [dot] net>
#
# 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 ... | gpl-3.0 |
ashhher3/cvxpy | examples/geometry/convex_sets.py | 12 | 4485 | # An object oriented approach to geometric problems with convex sets.
# Convex sets can be used as Variables.
import cvxpy as cvx
import cvxpy.lin_ops.lin_utils as lu
import numpy.linalg as la
class ConvexSet(cvx.Variable):
# elem - a Variable representing an element of the set.
# constr_func - a function tha... | gpl-3.0 |
ethernetdan/libvirt | src/util/virkeycode-mapgen.py | 48 | 2059 | #!/usr/bin/python
"""
Generate the big keycodes table for virkeys.
It read keymaps.csv from stdin and put the generated code to stdout.
Please keep keymaps.csv be exactly the same as:
http://git.gnome.org/browse/gtk-vnc/plain/src/keymaps.csv.
If anything inconsistent happens, please change this file
instead of keymap... | gpl-2.0 |
kmacinnis/sympy | sympy/categories/diagram_drawing.py | 7 | 95563 | r"""
This module contains the functionality to arrange the nodes of a
diagram on an abstract grid, and then to produce a graphical
representation of the grid.
The currently supported back-ends are Xy-pic [Xypic].
Layout Algorithm
================
This section provides an overview of the algorithms implemented in
:cl... | bsd-3-clause |
Amechi101/concepteur-market-app | venv/lib/python2.7/site-packages/psycopg2/tests/testutils.py | 14 | 9867 | # testutils.py - utility module for psycopg2 testing.
#
# Copyright (C) 2010-2011 Daniele Varrazzo <daniele.varrazzo@gmail.com>
#
# psycopg2 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 vers... | mit |
wainersm/buildbot | master/buildbot/test/unit/test_scripts_start.py | 10 | 4367 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
kamenim/samba-old | third_party/dnspython/dns/zone.py | 47 | 32039 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | gpl-3.0 |
sander76/home-assistant | homeassistant/components/bt_smarthub/device_tracker.py | 5 | 3129 | """Support for BT Smart Hub (Sometimes referred to as BT Home Hub 6)."""
from collections import namedtuple
import logging
from btsmarthub_devicelist import BTSmartHub
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN,
PLATFORM_SCHEMA,
DeviceScanner,
)
from homeassistan... | apache-2.0 |
google-research/google-research | state_of_sparsity/sparse_transformer/layers/sparse_layers.py | 1 | 2248 | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | apache-2.0 |
stargaser/astropy | astropy/coordinates/tests/test_sky_coord.py | 3 | 60933 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for the SkyCoord class. Note that there are also SkyCoord tests in
test_api_ape5.py
"""
import copy
import pytest
import numpy as np
import numpy.testing as npt
from astropy import units as u
from astropy.tests.helper... | bsd-3-clause |
gangadharkadam/vervefrappe | frappe/desk/query_builder.py | 54 | 6992 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
out = frappe.response
from frappe.utils import cint
import frappe.defaults
def get_sql_tables(q):
if q.find('WHERE') != -1:
tl = q.split('FROM')[1].split('WHE... | mit |
knightmare2600/d4rkc0de | exploits/080415.py | 1 | 5954 | #!/usr/bin/python
###############################################################################
# BigAnt Server Ver 2.2 PreAuth Remote SEH Overflow (0day)
# Matteo Memelli aka ryujin
# www.be4mind.com - www.gray-world.net
# 04/13/2008
# Tested on Windows 2000 Sp4 English
# Vulnerable process is AntServer.exe
# Offse... | gpl-2.0 |
pelikanchik/edx-platform | common/djangoapps/course_modes/migrations/0002_auto__add_field_coursemode_currency.py | 69 | 1474 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'CourseMode.currency'
db.add_column('course_modes_coursemode', 'currency',
... | agpl-3.0 |
rooshilp/CMPUT410Lab6 | virt_env/virt1/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/download.py | 60 | 16874 | import cgi
import getpass
import mimetypes
import os
import re
import shutil
import sys
import tempfile
from pip.backwardcompat import (md5, copytree, xmlrpclib, urllib, urllib2,
urlparse, string_types, HTTPError)
from pip.exceptions import InstallationError
from pip.util import (splitex... | apache-2.0 |
jorik041/scikit-learn | doc/tutorial/machine_learning_map/svg2imagemap.py | 360 | 3411 | #!/usr/local/bin/python
"""
This script converts a subset of SVG into an HTML imagemap
Note *subset*. It only handles <path> elements, for which it only pays
attention to the M and L commands. Futher, it only notices the "translate"
transform.
It was written to generate the examples in the documentation f... | bsd-3-clause |
yetsky/extra | packages/my-application/python-all/files/usr/lib/python2.7/email/_parseaddr.py | 150 | 15733 | # Copyright (C) 2002-2007 Python Software Foundation
# Contact: email-sig@python.org
"""Email address parsing code.
Lifted directly from rfc822.py. This should eventually be rewritten.
"""
__all__ = [
'mktime_tz',
'parsedate',
'parsedate_tz',
'quote',
]
import time, calendar
SPACE = ' '
EMPTYS... | gpl-2.0 |
open-contracting/mapper | ocds_mapper/mapper.py | 1 | 7252 | #!/usr/bin/env python
import argparse
import contextlib
import copy
import csv
import json
import urllib2
import urlparse
import uuid
from datetime import date
def is_url(file_path_or_url):
return urlparse.urlparse(file_path_or_url).scheme != ''
@contextlib.contextmanager
def open_file_path_or_url(file_path_or_... | gpl-2.0 |
brion/lilypond | scripts/build/mass-link.py | 8 | 2618 | #!@PYTHON@
# mass-link.py
# USAGE: mass-link.py [--prepend-suffix SUFFIX] symbolic | hard SOURCEDIR DESTDIR FILES
#
# create hard or symbolic links to SOURCEDIR/FILES in DESTDIR
#
# If symbolic or hard links are not provided by the operating system,
# copies will be made instead. However, if the operating syste... | gpl-3.0 |
valentindey/pnmt | translate.py | 2 | 9094 | #!/usr/bin/env python3
import json
import logging
from multiprocessing import Process, Queue, current_process
from collections import OrderedDict
from copy import copy
import numpy as np
import click
from params import load_params
logging.basicConfig(level=logging.INFO,
format="%(asctime)s - %... | mit |
arizvisa/syringe | lib/memorymanager/win32context.py | 1 | 7811 | # this makes ctypes friendlier (for me, anyways)
from ctypes import *
## page permissions
PAGE_EXECUTE = 0x10
PAGE_EXECUTE_READ = 0x20
PAGE_EXECUTE_READWRITE = 0x40
PAGE_EXECUTE_WRITECOPY = 0x80
PAGE_NOACCESS = 0x01
PAGE_READONLY = 0x02
PAGE_READWRITE = 0x04
PAGE_WRITECOPY = 0x08
PAGE_GUARD = 0x100
PAGE_NOCACHE = 0x20... | bsd-2-clause |
ndingwall/scikit-learn | examples/multioutput/plot_classifier_chain_yeast.py | 23 | 4637 | """
============================
Classifier Chain
============================
Example of using classifier chain on a multilabel dataset.
For this example we will use the `yeast
<https://www.openml.org/d/40597>`_ dataset which contains
2417 datapoints each with 103 features and 14 possible labels. Each
data point has ... | bsd-3-clause |
cattleprod/GT-N7100 | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
aoyono/sicpy | Chapter1/exercises/exercise1_28.py | 1 | 2695 | # -*- coding: utf-8 -*-
"""
One variant of the Fermat test that cannot be fooled is called the Miller-Rabin test (Miller 1976; Rabin 1980). This
starts from an alternate form of Fermat's Little Theorem, which states that if n is a prime number and a is any positive
integer less than n, then a raised to the (n - 1)st po... | mit |
wgrose/pyflakes | pyflakes/messages.py | 13 | 3056 | # (c) 2005 Divmod, Inc. See LICENSE file for details
class Message(object):
message = ''
message_args = ()
def __init__(self, filename, lineno):
self.filename = filename
self.lineno = lineno
def __str__(self):
return '%s:%s: %s' % (self.filename, self.lineno, self.message % sel... | mit |
dmordom/nipype | nipype/caching/memory.py | 14 | 10683 | """
Using nipype with persistence and lazy recomputation but without explicit
name-steps pipeline: getting back scope in command-line based programming.
Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
>>> datadir = os.path... | bsd-3-clause |
hnakamur/django | tests/postgres_tests/test_unaccent.py | 328 | 1884 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import modify_settings
from . import PostgreSQLTestCase
from .models import CharFieldModel, TextFieldModel
@modify_settings(INSTALLED_APPS={'append': 'django.contrib.postgres'})
class UnaccentTest(PostgreSQLTestCase):
Model = Char... | bsd-3-clause |
chanderbgoel/pybrain | pybrain/unsupervised/trainers/rbm.py | 25 | 6716 | __author__ = ('Christian Osendorfer, osendorf@in.tum.de;'
'Justin S Bayer, bayerj@in.tum.de'
'SUN Yi, yi@idsia.ch')
from scipy import random, outer, zeros, ones
from pybrain.datasets import SupervisedDataSet, UnsupervisedDataSet
from pybrain.supervised.trainers import Trainer
from pybrain.... | bsd-3-clause |
Endika/c2c-rd-addons | account_financial_report_chricar/wizard/wizard_general_ledger_report.py | 5 | 7759 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# Copyright (c) 2009 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Res... | agpl-3.0 |
czgu/metaHack | env/lib/python2.7/site-packages/django/contrib/auth/urls.py | 113 | 1203 | # The views used below are normally mapped in django.contrib.admin.urls.py
# This URLs file is used to provide a reliable view deployment for test purposes.
# It is also provided as a convenience to those who want to deploy these URLs
# elsewhere.
from django.conf.urls import patterns, url
urlpatterns = patterns('',
... | apache-2.0 |
jplusui/jplusui.github.com | apps/node/node_modules/npm/node_modules/node-gyp/legacy/tools/gyp/gyptest.py | 43 | 7324 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__doc__ = """
gyptest.py -- test runner for GYP tests.
"""
import os
import optparse
import subprocess
import sys
class CommandRunner:
"... | bsd-3-clause |
Goldieashe/zen6theme | sites/all/themes/testing6zen/node_modules/pangyp/gyp/pylib/gyp/generator/gypsh.py | 2779 | 1665 | # Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""gypsh output module
gypsh is a GYP shell. It's not really a generator per se. All it does is
fire up an interactive Python session with a few local variables... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.