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 |
|---|---|---|---|---|---|
Azure/azure-sdk-for-python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_configuration.py | 1 | 3238 | # 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 may ... | mit |
jnerin/ansible | lib/ansible/modules/cloud/cloudstack/cs_vpc_offering.py | 15 | 8517 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017, David Passante (@dpassante)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'commu... | gpl-3.0 |
kronoscode/Booktype | lib/booktype/apps/core/south_migrations/0001_initial.py | 8 | 11534 | # -*- 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 model 'Permission'
db.create_table(u'core_permission', (
(u'id', self.gf('django.db.mod... | agpl-3.0 |
nagyistoce/locust | examples/events.py | 41 | 2105 | # encoding: utf-8
"""
This is an example of a locustfile that uses Locust's built in event hooks to
track the sum of the content-length header in all successful HTTP responses
"""
from locust import HttpLocust, TaskSet, task, events, web
class MyTaskSet(TaskSet):
@task(2)
def index(l):
l.client.get(... | mit |
yongshengwang/hue | build/env/lib/python2.7/site-packages/Paste-2.0.1-py2.7.egg/paste/recursive.py | 50 | 14708 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
Middleware to make internal requests and forward requests internally.
When applied, several keys are added to the environment that will allow
you ... | apache-2.0 |
town-hall-pinball/project-omega | pin/service/matrix.py | 1 | 3862 | # Copyright (c) 2014 - 2016 townhallpinball.org
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, p... | mit |
fuku-ys/earthquake | pyearthquake/OLD.orchestrator/explorer.py | 1 | 10760 | from abc import ABCMeta, abstractmethod
import colorama
import random
import json
from eventlet.greenthread import sleep
from eventlet.timeout import Timeout
from eventlet.queue import *
import six
import time
from .. import LOG as _LOG
from ..signal.signal import EventBase, ActionBase
from .digestible import Digesti... | apache-2.0 |
kmatzen/ansible | lib/ansible/plugins/action/fail.py | 227 | 1391 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2012, Dag Wieers <dag@wieers.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 ... | gpl-3.0 |
mozillazg/firefly | firefly/views/api/comment.py | 9 | 1060 | # coding=utf-8
from __future__ import absolute_import
from flask_restful import Resource
from firefly.models.topic import Comment
from firefly.views.utils import short_timesince
from firefly.views.api.consts import OK
from firefly.views.api.utils import generate_status_fields
class ReplyApi(Resource):
def get(s... | mit |
caiocsalvador/whats_the_craic | lib/python3.4/site-packages/pip/_vendor/requests/structures.py | 1160 | 2977 | # -*- coding: utf-8 -*-
"""
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
import collections
class CaseInsensitiveDict(collections.MutableMapping):
"""
A case-insensitive ``dict``-like object.
Implements all methods and operations of
``collections.MutableMapping... | mit |
tarzan0820/addons-yelizariev | base_replace_ref/models.py | 16 | 3169 | from openerp import api, models, fields, SUPERUSER_ID, exceptions
class replace_rule(models.Model):
_name = 'base_replace_ref.rule'
name = fields.Char('Name', required=True)
draft = fields.Boolean('Draft', default=True)
model_id = fields.Many2one('ir.model', 'Model', required=True)
value_line_ids... | lgpl-3.0 |
gui2dev/android_kernel_motorola_tinboost | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... | gpl-2.0 |
mancoast/CPythonPyc_test | cpython/272_test_normalization.py | 76 | 3130 | from test.test_support import run_unittest, open_urlresource
import unittest
from httplib import HTTPException
import sys
import os
from unicodedata import normalize, unidata_version
TESTDATAFILE = "NormalizationTest.txt"
TESTDATAURL = "http://www.unicode.org/Public/" + unidata_version + "/ucd/" + TESTDATAFILE
def c... | gpl-3.0 |
drawks/ansible | lib/ansible/modules/network/fortios/fortios_firewall_vip.py | 24 | 47319 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2018 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | gpl-3.0 |
izzyalonso/tndata_backend | tndata_backend/utils/mixins.py | 2 | 3723 | from django.conf import settings
from django.contrib.auth.decorators import login_required
from redis_metrics import metric
from rest_framework.exceptions import APIException
class LoginRequiredMixin(object):
"""A mixin for a class-based view that requires the user to be logged in.
Borrowed from: https://go... | mit |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/IPython/utils/decorators.py | 36 | 2071 | # encoding: utf-8
"""Decorators that don't go anywhere else.
This module contains misc. decorators that don't really go with another module
in :mod:`IPython.utils`. Beore putting something here please see if it should
go into another topical module in :mod:`IPython.utils`.
"""
#---------------------------------------... | gpl-3.0 |
synergeticsedx/deployment-wipro | pavelib/paver_tests/test_servers.py | 15 | 11645 | """Unit tests for the Paver server tasks."""
import ddt
from paver.easy import call_task
from .utils import PaverTestCase
EXPECTED_COFFEE_COMMAND = (
u"node_modules/.bin/coffee --compile `find {platform_root}/lms "
u"{platform_root}/cms {platform_root}/common -type f -name \"*.coffee\"`"
)
EXPECTED_SASS_COMM... | agpl-3.0 |
glls/Cinnamon | files/usr/share/cinnamon/cinnamon-settings-users/cinnamon-settings-users.py | 2 | 40589 | #!/usr/bin/python3
import os
import pwd
import grp
import gettext
import shutil
import re
import subprocess
from random import randint
from setproctitle import setproctitle
import PIL
from PIL import Image
import gi
gi.require_version("Gtk", "3.0")
gi.require_version("AccountsService", "1.0")
from gi.repository impor... | gpl-2.0 |
erkanay/django | django/contrib/gis/geos/__init__.py | 151 | 1154 | """
The GeoDjango GEOS module. Please consult the GeoDjango documentation
for more details:
http://geodjango.org/docs/geos.html
"""
__all__ = ['HAS_GEOS']
try:
from .libgeos import geos_version, geos_version_info # NOQA: flake8 detects only the last __all__
HAS_GEOS = True
__all__ += ['geos_version', '... | bsd-3-clause |
mcking49/apache-flask | Python/Lib/site-packages/flask_socketio/__init__.py | 2 | 10875 | import os
import sys
from socketio import socketio_manage
from socketio.server import SocketIOServer
from socketio.namespace import BaseNamespace
from flask import request, session, json
from werkzeug.debug import DebuggedApplication
from werkzeug.serving import run_with_reloader
from werkzeug._internal import _log
f... | mit |
jlnaudin/x-drone | MissionPlanner-master/packages/IronPython.StdLib.2.7.4/content/Lib/ast.py | 255 | 11805 | # -*- coding: utf-8 -*-
"""
ast
~~~
The `ast` module helps Python applications to process trees of the Python
abstract syntax grammar. The abstract syntax itself might change with
each Python release; this module helps to find out programmatically what
the current grammar looks like and allows... | gpl-3.0 |
nickmarton/Vivid | vivid/classes/parsers/point_parser.py | 1 | 2439 | """This section introduces the PointParser class."""
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from point import Point
class PointParser(object):
"""
PointParser class. The PointParser class is used for parsing Point object
related expressions.
... | mit |
ryankanno/froide | froide/foirequest/south_migrations/0013_auto__add_field_foimessage_status.py | 6 | 16723 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from froide.helper.auth_migration_util import USER_DB_NAME
APP_MODEL, APP_MODEL_NAME = 'account.User', 'account.user'
class Migration(SchemaMigration):
def forwards(self, orm):
... | mit |
github-account-because-they-want-it/django-extensions | tests/test_runscript.py | 23 | 1184 | from django.core.management import call_command
from django.test import TestCase
import django
import pytest
import six
import sys
class RunScriptTests(TestCase):
def setUp(self):
sys.stdout = six.StringIO()
sys.stderr = six.StringIO()
def test_runs(self):
# lame test...does it run?
... | mit |
cpennington/XBlock | xblock/slider.py | 13 | 1976 | """Simple XBlock with a slider interface.
WARNING: This is an experimental module, subject to future change or removal.
"""
import json
from webob import Response
from xblock.core import XBlock
from xblock.fields import Scope, Integer
from xblock.fragment import Fragment
class Slider(XBlock):
"""Base XBlock wi... | agpl-3.0 |
wjn740/linux | tools/perf/scripts/python/failed-syscalls-by-pid.py | 1996 | 2233 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
jeromecc/docker-fhio-yakkety | tty.js/node_modules/tty.js/node_modules/pty.js/deps/winpty/misc/DebugClient.py | 42 | 1558 | #!python
# Run with native CPython. Needs pywin32 extensions.
# Copyright (c) 2011-2012 Ryan Prichard
#
# 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 withou... | apache-2.0 |
jeffbryner/MozDef | tests/alerts/test_proxy_drop_executable.py | 3 | 4404 | # 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 https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
from .positive_alert_test_case import PositiveAlertTestCase
from .negative_aler... | mpl-2.0 |
meyerbe/pycles | generate_namelist.py | 1 | 70404 | import argparse
import json
import pprint
from sys import exit
import uuid
import ast
def main():
parser = argparse.ArgumentParser(prog='Namelist Generator')
parser.add_argument('case_name')
# Optional Arguments for CGILS
parser.add_argument('--perturbed_temperature', default='False',
... | gpl-3.0 |
bcorbet/SickRage | lib/hachoir_core/field/helper.py | 90 | 1905 | from lib.hachoir_core.field import (FieldError,
RawBits, RawBytes,
PaddingBits, PaddingBytes,
NullBits, NullBytes,
GenericString, GenericInteger)
from lib.hachoir_core.stream import FileOutputStream
def createRawField(parent, size, name="raw[]", description=None):
if size <= 0:
raise FieldE... | gpl-3.0 |
edwardslabs/CloudBot | plugins/brew.py | 2 | 1692 | import requests
from requests import HTTPError
from cloudbot import hook
api_url = "http://api.brewerydb.com/v2/search?format=json"
@hook.on_start()
def load_key(bot):
global api_key
api_key = bot.config.get("api_keys", {}).get("brewerydb", None)
@hook.command('brew')
def brew(text, reply):
"""<query>... | gpl-3.0 |
utecuy/edx-platform | common/test/acceptance/pages/lms/discussion.py | 36 | 25473 | from contextlib import contextmanager
from bok_choy.javascript import wait_for_js
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise, Promise
from .course_page import CoursePage
class DiscussionPageMixin(object):
def is_ajax_finished(self):
return self.browser.execute... | agpl-3.0 |
HiSPARC/station-software | user/python/Lib/site-packages/setuptools/py36compat.py | 313 | 2891 | import sys
from distutils.errors import DistutilsOptionError
from distutils.util import strtobool
from distutils.debug import DEBUG
class Distribution_parse_config_files:
"""
Mix-in providing forward-compatibility for functionality to be
included by default on Python 3.7.
Do not edit the code in this... | gpl-3.0 |
nthiep/global-ssh-server | lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/creation.py | 106 | 4554 | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.postgresql_psycopg2.creation import DatabaseCreation
from django.utils.functional import cached_property
class PostGISCreation(DatabaseCreation):
geom_index_type = 'GIST'
geom_index_ops = 'GIST_GEO... | agpl-3.0 |
pkappesser/youtube-dl | youtube_dl/extractor/pornotube.py | 128 | 3704 | from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
)
from ..utils import (
int_or_none,
)
class PornotubeIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?pornotube\.com/(?:[^?#]*?)/video/(?P<id>[0-9]+)'
_TEST = {
... | unlicense |
monikagrabowska/osf.io | api/wikis/views.py | 10 | 4490 | from rest_framework import generics, permissions as drf_permissions
from rest_framework.exceptions import NotFound
from rest_framework.views import Response
from api.base import permissions as base_permissions
from api.base.exceptions import Gone
from api.base.views import JSONAPIBaseView
from api.base.renderers impor... | apache-2.0 |
audaciouscode/Books-Mac-OS-X | Versions/Books_3.0b6/Bundled plugins/Amazon (CA).plugin/Contents/Resources/amazonScript.py | 12 | 4378 | #!/usr/bin/python
from amazon import Bag
from xml.dom.minidom import Document, parse
from difflib import SequenceMatcher
from string import replace
import amazon
import sys
searchLocale = "ca"
fieldMap = {
"Asin" : "ASIN",
"Authors" : "Authors",
"ImageUrlLarge" : "CoverImageURL",
"ImageUrlMediu... | mit |
capitalone/cloud-custodian | c7n/resources/sagemaker.py | 1 | 23243 | # Copyright 2016-2017 Capital One Services, LLC
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from c7n.actions import BaseAction
from c7n.exceptions import PolicyValidationError
from c7n.manager import resources
from c7n.query import QueryResourceManager, TypeInfo
from c7n.utils import... | apache-2.0 |
liberorbis/libernext | env/lib/python2.7/site-packages/unidecode/x08c.py | 251 | 4630 | data = (
'Yu ', # 0x00
'Shui ', # 0x01
'Shen ', # 0x02
'Diao ', # 0x03
'Chan ', # 0x04
'Liang ', # 0x05
'Zhun ', # 0x06
'Sui ', # 0x07
'Tan ', # 0x08
'Shen ', # 0x09
'Yi ', # 0x0a
'Mou ', # 0x0b
'Chen ', # 0x0c
'Die ', # 0x0d
'Huang ', # 0x0e
'Jian ', # 0x0f
'Xie ', # ... | gpl-2.0 |
jvs/stride | stride/grammar.py | 1 | 12650 | from sourcer import *
__all__ = [
'Collection',
'CommandHandler',
'Contract',
'Data',
'Definition',
'Dollar',
'For',
'Func',
'If',
'Import',
'Introduction',
'KeyValuePair',
'ModifiedStatement',
'Name',
'NamedElement',
'Namespace',
'Operation',
'P... | mit |
Chemcy/vnpy | vn.api/vn.sgit/pyscript/generate_data_type.py | 15 | 3147 | # encoding: UTF-8
__author__ = 'CHENXY'
# C++和python类型的映射字典
type_dict = {
'int': 'int',
'char': 'char',
'double': 'float',
'short': 'int',
'string': 'string'
}
def process_line(line):
"""处理每行"""
if '///' in line: # 注释
py_line = process_comment(line)
elif 'typedef' i... | mit |
tsdmgz/ansible | contrib/inventory/openshift.py | 196 | 3274 | #!/usr/bin/env python
# (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 General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... | gpl-3.0 |
eammx/proyectosWeb | proyectoPython/env/lib/python3.6/site-packages/markupsafe/_constants.py | 27 | 4690 | # -*- coding: utf-8 -*-
"""
markupsafe._constants
~~~~~~~~~~~~~~~~~~~~~
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
HTML_ENTITIES = {
"AElig": 198,
"Aacute": 193,
"Acirc": 194,
"Agrave": 192,
"Alpha": 913,
"Aring": 197,
"Atilde": 195,
"Auml": 196,
"Beta": 914,
"Ccedil":... | mit |
msduketown/SublimeKodi | libs/polib/polib.py | 1 | 61741 | # -* coding: utf-8 -*-
#
# License: MIT (see LICENSE file provided)
# vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
"""
**polib** allows you to manipulate, create, modify gettext files (pot, po and
mo files). You can load existing files, iterate through it's entries, add,
modify entries, comments or metada... | gpl-3.0 |
pgmillon/ansible | lib/ansible/modules/net_tools/nios/nios_fixed_address.py | 31 | 8390 | #!/usr/bin/python
# Copyright (c) 2018 Red Hat, 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',
'status': ['preview... | gpl-3.0 |
chokribr/inveniotest | modules/miscutil/lib/sequtils_cnum.py | 10 | 4473 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 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 ... | gpl-2.0 |
Workday/OpenFrame | tools/telemetry/third_party/gsutilz/third_party/boto/boto/s3/tagging.py | 236 | 1732 | from boto import handler
import xml.sax
class Tag(object):
def __init__(self, key=None, value=None):
self.key = key
self.value = value
def startElement(self, name, attrs, connection):
return None
def endElement(self, name, value, connection):
if name == 'Key':
... | bsd-3-clause |
dracos/QGIS | python/plugins/db_manager/dlg_create_index.py | 6 | 3022 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : Oct 13, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... | gpl-2.0 |
google-research/language | language/boolq/utils/ops_test.py | 1 | 2375 | # coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | apache-2.0 |
rhdedgar/openshift-tools | openshift_tools/monitoring/pminfo_parse.py | 13 | 4733 | #!/usr/bin/env python
# vim: expandtab:tabstop=4:shiftwidth=4
'''
PMInfo - Get metrics from Performance CoPilot
This will parse the output of pminfo and return a dictionary of
the metrics and their values
This requires that pminfo is installed on the host.
pminfo will query the localhost host, not... | apache-2.0 |
bratsche/Neutron-Drive | google_appengine/lib/jinja2/jinja2/meta.py | 406 | 4144 | # -*- coding: utf-8 -*-
"""
jinja2.meta
~~~~~~~~~~~
This module implements various functions that exposes information about
templates that might be interesting for various kinds of applications.
:copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details.
:license: BSD, see LICENSE fo... | bsd-3-clause |
alfredoavanzosc/odoo-addons | project_partner_event_registration/models/event.py | 2 | 1660 | # -*- encoding: utf-8 -*-
##############################################################################
#
# 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... | agpl-3.0 |
yephper/django | django/db/models/sql/datastructures.py | 1 | 5769 | """
Useful auxiliary data structures for query construction. Not useful outside
the SQL domain.
"""
from django.db.models.sql.constants import INNER, LOUTER
class EmptyResultSet(Exception):
pass
class MultiJoin(Exception):
"""
Used by join construction code to indicate the point at which a
... | bsd-3-clause |
Zephrys/monica | monica/monica.py | 1 | 8780 | r"""
monica is a command line chef that brings you tasty food
Usage:
monica surprise
monica restaurant <restaurant-id>
monica search [QUERY ...]
monica reviews <restaurant-id>
monica budget <budget>
monica cuisine (<cuisine-id>| list)
monica configure
monica (-h |--help)
monica
Options:
-h --help ... | mit |
Lh4cKg/sl4a | python/src/Lib/lib2to3/refactor.py | 49 | 19094 | #!/usr/bin/env python2.5
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Refactoring framework.
Used as a main program, this can refactor any number of files and/or
recursively descend down directories. Imported as a module, this
provides infrastructure to write... | apache-2.0 |
redhat-openstack/nova | nova/tests/api/openstack/compute/contrib/test_fping.py | 14 | 3754 | # Copyright 2011 Grid Dynamics
# Copyright 2011 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... | apache-2.0 |
rivimey/rwmapmaker | zziplib/docs/zzipdoc/functionheader.py | 14 | 3669 | from match import Match
class FunctionHeader:
""" parsing the comment block that is usually presented before
a function prototype - the prototype part is passed along
for further parsing through => FunctionPrototype """
def __init__(self, functionheaderlist, comment, prototype):
self.parent = f... | gpl-3.0 |
netvl/contrib-python-qubell-client | qubell/api/private/environment.py | 1 | 9095 | # Copyright (c) 2013 Qubell Inc., http://qubell.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/LICENSE-2.0
#
# Unless required by applicable law or agr... | apache-2.0 |
pombredanne/SourceForge-Allura | scripts/migrations/009-set_landing_page.py | 3 | 3217 | from allura.model import Neighborhood
from ming.orm import ThreadLocalORMSession
homepage = """<style type="text/css">
ul.ui-tab { display: none; }
div.content {
font-family: Helvetica;
}
div.content div.row > div.column {
width: 100%
}
div.welcome { margin: 2em 0; }
div.welcome p {
display: block;
po... | apache-2.0 |
slash-testing/backslash-python | backslash/api_object.py | 2 | 1450 |
class APIObject(object):
def __init__(self, client, json_data):
super(APIObject, self).__init__()
self.client = client
self._data = json_data
@property
def api_url(self):
return self.client.url.add_path(self.api_path)
@property
def ui_url(self):
raise NotI... | bsd-3-clause |
tsheets/api_python | tsheets/model.py | 1 | 5132 | import pytz
from . import helpers
import dateutil.parser
from datetime import datetime, date
class Model(object):
_accessors = {}
_default_type = "anything"
def __init__(self, **kwargs):
self._dynamic_accessors = []
if kwargs:
self.__class__.mass_assign(self, kwargs)
@clas... | mit |
dharmabumstead/ansible | lib/ansible/utils/module_docs_fragments/vmware.py | 12 | 1998 | # Copyright: (c) 2016, Charles Paul <cpaul@ansible.com>
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Parameters for VMware modules
DOCUMENTATION = '''
options:
hostname:
descript... | gpl-3.0 |
Edu-Glez/Bank_sentiment_analysis | env/lib/python3.6/site-packages/jinja2/sandbox.py | 130 | 16707 | # -*- coding: utf-8 -*-
"""
jinja2.sandbox
~~~~~~~~~~~~~~
Adds a sandbox layer to Jinja as it was the default behavior in the old
Jinja 1 releases. This sandbox is slightly different from Jinja 1 as the
default behavior is easier to use.
The behavior can be changed by subclassing the environm... | apache-2.0 |
rupakc/Kaggle-Compendium | Santas Stolen Sleigh/SantaUtil.py | 1 | 6924 | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 13 23:21:29 2016
Defines a set of utility functions to be used for prediction
@author: Rupak Chakraborty
"""
import math
from trip import Trip
from gift import Gift
import random
import time
import pandas as pd
import operator
RADIUS_EARTH = 6773
NORTH_POLE_LAT = 90
NOR... | mit |
Kilhog/odoo | addons/l10n_cr/__init__.py | 438 | 2045 | # -*- encoding: utf-8 -*-
##############################################################################
#
# __init__.py
# l10n_cr_account
# First author: Carlos Vásquez <carlos.vasquez@clearcorp.co.cr> (ClearCorp S.A.)
# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.... | agpl-3.0 |
Jens-G/thrift | contrib/zeromq/TZmqServer.py | 43 | 2709 | #
# 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 |
michhar/ms-pythonbot | msbot/__init__.py | 1 | 1583 | """
The flask application package.
"""
#####################################################################
# Create the Flask app
#####################################################################
from flask import Flask
from .callback_utils import Callbacks
import os
from flask_pyoidc.flask_pyoidc import OIDCA... | mit |
DataONEorg/d1_python | lib_common/src/d1_common/system_metadata.py | 1 | 14840 | # This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ma... | apache-2.0 |
renegelinas/mi-instrument | mi/dataset/parser/cg_stc_eng_stc.py | 5 | 71530 | #!/usr/bin/env python
"""
@package mi.dataset.parser.cg_stc_eng_stc
@file marine-integrations/mi/dataset/parser/cg_stc_eng_stc.py
@author Mike Nicoletti
@brief Parser for the cg_stc_eng_stc dataset driver
Release notes:
Starting the cg_stc_eng_stc driver
"""
__author__ = 'Mike Nicoletti'
__license__ = '... | bsd-2-clause |
mortonjt/scipy | tools/refguide_check.py | 10 | 3651 | #!/usr/bin/env python
"""
refguide_check.py [OPTIONS] [-- ARGS]
Check for a Scipy submodule whether the objects in its __all__ dict
correspond to the objects included in the reference guide.
Example of usage::
$ python refguide_check.py optimize
Note that this is a helper script to be able to check if things ar... | bsd-3-clause |
0x0mar/phpsploit | deps/pyparsing-2.0.2/examples/sql2dot.py | 6 | 3033 | #!/usr/bin/python
# sql2dot.py
#
# Creates table graphics by parsing SQL table DML commands and
# generating DOT language output.
#
# Adapted from a post at http://energyblog.blogspot.com/2006/04/blog-post_20.html.
#
sampleSQL = """
create table student
(
student_id integer primary key,
firstname varc... | gpl-3.0 |
fengshao0907/vitess | third_party/py/bson-0.3.2/bson/codec.py | 26 | 10257 | #!/usr/bin/python -OOOO
# vim: set fileencoding=utf8 shiftwidth=4 tabstop=4 textwidth=80 foldmethod=marker :
# Copyright (c) 2010, Kou Man Tong. All rights reserved.
# For licensing, see LICENSE file included in the package.
"""
Base codec functions for bson.
"""
import struct
import cStringIO
import calendar
from date... | bsd-3-clause |
rhiever/MarkovNetwork | MarkovNetwork/MarkovNetwork.py | 1 | 10471 | # -*- coding: utf-8 -*-
"""
Copyright 2016 Randal S. Olson
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... | mit |
rpmcpp/Audacity | lib-src/portmidi/pm_python/setup.py | 90 | 5532 | import sys
import os
import logging
from distutils.core import setup, Command
from distutils.extension import Extension
try:
from Cython.Distutils import build_ext
except ImportError:
logging.warn("Cython is preferred over pyrex for python3 compatibility.")
from Pyrex.Distutils import build_ext
DESCRI... | gpl-2.0 |
Rumata888/binnavi | src/main/java/com/google/security/zynamics/binnavi/scripts/dominator_tree.py | 70 | 3952 | """
Copyright 2014 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 required by applicable law or agr... | apache-2.0 |
NINAnor/QGIS | python/plugins/processing/algs/qgis/RandomSelectionWithinSubsets.py | 5 | 4966 | # -*- coding: utf-8 -*-
"""
***************************************************************************
RandomSelectionWithinSubsets.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
**********... | gpl-2.0 |
rosihorrorshow/askbot-devel | askbot/management/commands/initialize_ldap_logins.py | 3 | 2737 | """Management command to create LDAP login method for all users.
Please see description of the command in its ``help_text``.
"""
import datetime
from django.core.management.base import CommandError
from django.utils.translation import ugettext as _
from askbot.management import NoArgsJob
from askbot import models
from ... | gpl-3.0 |
andrewyoung1991/scons | test/ToolSurrogate.py | 5 | 3380 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, publish,
... | mit |
huggingface/transformers | src/transformers/models/deberta_v2/modeling_deberta_v2.py | 1 | 61698 | # coding=utf-8
# Copyright 2020 Microsoft and the Hugging Face Inc. team.
#
# 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 require... | apache-2.0 |
andresgz/django | tests/template_tests/syntax_tests/test_numpy.py | 353 | 1429 | import warnings
from unittest import skipIf
from django.test import SimpleTestCase
from ..utils import setup
try:
import numpy
except ImportError:
numpy = False
@skipIf(numpy is False, "Numpy must be installed to run these tests.")
class NumpyTests(SimpleTestCase):
# Ignore numpy deprecation warnings (... | bsd-3-clause |
googleapis/python-compute | tests/unit/gapic/compute_v1/test_reservations.py | 1 | 72826 | # -*- coding: utf-8 -*-
# Copyright 2020 Google 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... | apache-2.0 |
vipulroxx/sympy | sympy/integrals/heurisch.py | 57 | 22774 | from __future__ import print_function, division
from itertools import permutations
from sympy.core.add import Add
from sympy.core.basic import Basic
from sympy.core.mul import Mul
from sympy.core.symbol import Wild, Dummy
from sympy.core.basic import sympify
from sympy.core.numbers import Rational, pi
from sympy.core... | bsd-3-clause |
GodBlessPP/W17test_2nd_2 | static/Brython3.1.1-20150328-091302/Lib/xml/sax/saxutils.py | 730 | 11688 | """\
A library of useful helper classes to the SAX classes, for the
convenience of application and driver writers.
"""
import os, urllib.parse, urllib.request
import io
from . import handler
from . import xmlreader
def __dict_replace(s, d):
"""Replace substrings of a string using a dictionary."""
for key, val... | gpl-3.0 |
nesterione/scikit-learn | examples/cluster/plot_agglomerative_clustering.py | 343 | 2931 | """
Agglomerative clustering with and without structure
===================================================
This example shows the effect of imposing a connectivity graph to capture
local structure in the data. The graph is simply the graph of 20 nearest
neighbors.
Two consequences of imposing a connectivity can be s... | bsd-3-clause |
wangxiaomo/rivercrab | setup.py | 1 | 1426 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from distutils.core import setup
VERSION = '0.8'
LONG_DESCRIPTION = open('README.rst').read()
INSTALL_REQUIRES = [
'beautifulsoup4',
]
PY_MAJOR, PY_MINOR = sys.version_info[:2]
if (PY_MAJOR, PY_MINOR) == (2, 6):
INSTALL_REQUIRES.append('argparse')... | bsd-3-clause |
Godiyos/python-for-android | python3-alpha/python3-src/Lib/lib2to3/fixes/fix_tuple_params.py | 203 | 5565 | """Fixer for function definitions with tuple parameters.
def func(((a, b), c), d):
...
->
def func(x, d):
((a, b), c) = x
...
It will also support lambdas:
lambda (x, y): x + y -> lambda t: t[0] + t[1]
# The parens are a syntax error in Python 3
lambda (x): x + y -> lambda x: x + y
"""... | apache-2.0 |
hortonworks/hortonworks-sandbox | desktop/core/ext-py/Django-1.2.3/django/contrib/gis/db/backends/oracle/compiler.py | 360 | 1756 | from django.contrib.gis.db.models.sql.compiler import GeoSQLCompiler as BaseGeoSQLCompiler
from django.db.backends.oracle import compiler
SQLCompiler = compiler.SQLCompiler
class GeoSQLCompiler(BaseGeoSQLCompiler, SQLCompiler):
pass
class SQLInsertCompiler(compiler.SQLInsertCompiler, GeoSQLCompiler):
def pla... | apache-2.0 |
ConnorGBrewster/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/browsers/__init__.py | 3 | 1520 | """Subpackage where each product is defined. Each product is created by adding a
a .py file containing a __wptrunner__ variable in the global scope. This must be
a dictionary with the fields
"product": Name of the product, assumed to be unique.
"browser": String indicating the Browser implementation used to launch tha... | mpl-2.0 |
crawfordsm/pyspectrograph | PySpectrograph/Utilities/makeplots.py | 1 | 1688 | #
# MAKEPLOTS--A library for making plots for demaniacs
#
#
#
from pylab import *
import numpy
def plotframe(data):
"""Plot the entire data array
returns a figure
"""
nimg = 10
ywidth = 0.08
xlen = len(data[0]) / nimg
for i in range(nimg):
yax = 0.90 - ywidth * 1.1 * i
... | bsd-3-clause |
azurestandard/django | tests/regressiontests/utils/text.py | 9 | 6021 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import warnings
from django.test import SimpleTestCase
from django.utils import text
class TestUtilsText(SimpleTestCase):
# In Django 1.6 truncate_words() and truncate_html_words() will be removed
# so these tests will need to be adapted accord... | bsd-3-clause |
shuangshuangwang/spark | python/pyspark/sql/tests/test_pandas_udf.py | 1 | 10216 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
moylop260/odoo-dev | addons/crm/crm_phonecall.py | 32 | 14776 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
shenlong3030/asv-django-guestbook | django/db/backends/oracle/creation.py | 9 | 11427 | import sys, time
from django.db.backends.creation import BaseDatabaseCreation
TEST_DATABASE_PREFIX = 'test_'
PASSWORD = 'Im_a_lumberjack'
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their associated Oracle column
# types, as strings. Column-type strings can co... | bsd-3-clause |
robert-giaquinto/text-analysis | src/topic_model/build_cdtm_data.py | 1 | 2688 | from __future__ import division, print_function, absolute_import
import os
import argparse
def day_counts(keys_file, rounding_days=None):
"""
keys_file: input file with float of date (normalized so first
journals begin at zero) in the 4th column.
rounding_days: number of days to round the d... | mit |
pybee-attic/toga-cocoa | toga_cocoa/command.py | 2 | 1189 | from .libs import *
from .widgets.icon import Icon
class Command(object):
def __init__(self, action, label=None, tooltip=None, icon=None):
self.action = action
self.label = label
self.tooltip = tooltip
self.icon = Icon.load(icon)
self._enabled = True
self._widgets ... | bsd-3-clause |
PhloxAR/phloxar | PhloxAR/dc1394/mode.py | 1 | 12891 | # -*- coding: utf-8 -*-
from __future__ import division, print_function
from __future__ import absolute_import, unicode_literals
from .core import *
from ctypes import c_int32, c_uint32, c_uint64, c_float, byref, pointer
__all__ = [
'Mode', 'Format7', 'mode_map'
]
class Mode(object):
"""
Video mode fo... | apache-2.0 |
gmcastil/numpy | numpy/ma/extras.py | 10 | 55238 | """
Masked arrays add-ons.
A collection of utilities for `numpy.ma`.
:author: Pierre Gerard-Marchant
:contact: pierregm_at_uga_dot_edu
:version: $Id: extras.py 3473 2007-10-29 15:18:13Z jarrod.millman $
"""
from __future__ import division, absolute_import, print_function
__all__ = [
'apply_along_axis', 'apply_o... | bsd-3-clause |
decimalbell/redbase | third_party/src/gtest-1.7.0/scripts/fuse_gtest_files.py | 2577 | 8813 | #!/usr/bin/env python
#
# Copyright 2009, 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... | mit |
ueno/ibus | ibus/factory.py | 6 | 4043 | # vim:set et sts=4 sw=4:
#
# ibus - The Input Bus
#
# Copyright (c) 2007-2010 Peng Huang <shawn.p.huang@gmail.com>
# Copyright (c) 2007-2010 Red Hat, Inc.
#
# This library 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 Sof... | lgpl-2.1 |
CSC301H-Fall2013/JuakStore | site-packages/django/contrib/comments/models.py | 99 | 7729 | from django.conf import settings
from django.contrib.comments.managers import CommentManager
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.core import urlresolvers
from django.db import models
from djan... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.