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 |
|---|---|---|---|---|---|
hosom/mandrake | plugins/pdf.py | 2 | 7869 | import sys, os.path, re
import StringIO
import xml.etree.ElementTree as ET
from lxml import etree
from pdfminer.psparser import PSKeyword, PSLiteral
from pdfminer.pdfparser import PDFParser
from pdfminer.pdfdocument import PDFDocument
from pdfminer.pdftypes import PDFObjectNotFound
from pdfminer.pdftypes import PDFStre... | bsd-3-clause |
fedora-desktop-tests/evolution | features/steps/calendar_event_editor.py | 1 | 22024 | # -*- coding: UTF-8 -*-
from behave import step, then
from dogtail.predicate import GenericPredicate
from dogtail.tree import root
from dogtail.rawinput import keyCombo, typeText
from time import sleep
from behave_common_steps import wait_until
import datetime
import os
@step(u'Create new appointment')
def create_new... | gpl-2.0 |
andmos/ansible | lib/ansible/modules/net_tools/nios/nios_naptr_record.py | 68 | 5884 | #!/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 |
phantasien/falkor | deps/bastian/deps/v8/tools/android-run.py | 95 | 4155 | #!/usr/bin/env python
#
# Copyright 2012 the V8 project authors. 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
# noti... | mit |
g-weatherill/oq-hazardlib | openquake/hazardlib/gsim/chiou_youngs_2008_swiss_coeffs.py | 4 | 10852 | # coding: utf-8
# The Hazard Library
# Copyright (C) 2012 GEM Foundation
#
# 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, or (at your option) any later... | agpl-3.0 |
woodshop/complex-chainer | tests/functions_tests/test_concat.py | 5 | 2078 | import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
if cuda.available:
cuda.init()
class ConcatTestBase(object):
def check_forward(self, xs_data, y_data, axis):
... | mit |
elioth010/lugama | src/model/orm/Model.py | 1 | 1482 | '''
Created on Jan 8, 2016
@author: elioth010
'''
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm.session import sessionmaker
from sqlalchemy.sql.expression import text
from model.orm.DB import DB
class Model(DB):
'''
classdocs
'''
base = None
SessionFactory = No... | gpl-2.0 |
mushtaqak/edx-platform | lms/envs/devstack.py | 1 | 6327 | """
Specific overrides to the base prod settings to make development easier.
"""
from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import
# Don't use S3 in devstack, fall back to filesystem
del DEFAULT_FILE_STORAGE
MEDIA_ROOT = "/edx/var/edxapp/uploads"
DEBUG = True
USE_I18N = True
TEMPLATE_DEB... | agpl-3.0 |
adbar/htmldate | htmldate/validators.py | 1 | 7114 | # pylint:disable-msg=E0611,I1101
"""
Filters for date parsing and date validators.
"""
## This file is available from https://github.com/adbar/htmldate
## under GNU GPL v3 license
# standard
import datetime
import logging
import time
from collections import Counter
from functools import lru_cache
from .settings imp... | gpl-3.0 |
openqt/algorithms | extras/kaprekar_number.py | 1 | 1328 | # coding=utf-8
"""
卡布列克数
http://group.jobbole.com/26887/
有一种数被称为卡布列克数,其形式如:45 * 45 = 2025 并且 20+25=45,这样 45 就是一个
卡布列克数。
它标准定义如下:
若正整数X在N进制下的平方可以分割为二个数字,而这二个数字相加后恰等于X,那么X就是
N进制下的卡布列克数。
分解后的数字必须是正整数才可以,例如:10*10=100 并且 10+0=10,因为0不是正整数,
所以10不是卡布列克数。
现在题目的要求是给定你一个范围[a,b](b大于等于a,a大于等于0),你需要把这个范围内的
卡布列克数全... | gpl-3.0 |
mravikumar281/staging-server | baseapp/views/education_medium_views.py | 3 | 3772 | from django.views.generic import ListView, DetailView, CreateView, \
DeleteView, UpdateView, \
ArchiveIndexView, DateDetailView, \
DayArchiveView, MonthArchiveView, \
TodayArchiveView, Wee... | mit |
robbiet480/home-assistant | tests/components/august/test_camera.py | 13 | 1084 | """The camera tests for the august platform."""
from homeassistant.const import STATE_IDLE
from tests.async_mock import patch
from tests.components.august.mocks import (
_create_august_with_devices,
_mock_doorbell_from_fixture,
)
async def test_create_doorbell(hass, aiohttp_client):
"""Test creation of ... | apache-2.0 |
niklaskorz/pyglet | experimental/mt_media/drivers/silent.py | 28 | 4929 | #!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import threading
import time
import mt_media
import pyglet
_debug = pyglet.options['debug_media']
class SilentAudioPlayer(mt_media.AbstractAudioPlayer):
# When playing video, length of audio (in secs) to buffer ahead.
... | bsd-3-clause |
google-research/google-research | simulation_research/signal_processing/spherical/spherical_harmonics.py | 1 | 5602 | # 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 |
supermurat/hamsi-manager | Bars/ToolsBar.py | 1 | 8838 | # This file is part of HamsiManager.
#
# Copyright (c) 2010 - 2015 Murat Demir <mopened@gmail.com>
#
# Hamsi 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 Foundation; either version 2 of the License, or
# (at yo... | gpl-3.0 |
pwendell/mesos | third_party/zookeeper-3.3.1/src/contrib/zkpython/src/test/clientid_test.py | 164 | 1739 | #!/usr/bin/python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Lic... | apache-2.0 |
osall2001/slimit | src/slimit/lexer.py | 7 | 15047 | ###############################################################################
#
# Copyright (c) 2011 Ruslan Spivak
#
# 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, inc... | mit |
slohse/ansible | lib/ansible/modules/system/iptables.py | 13 | 23333 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2015, Linus Unnebäck <linus@folkdatorn.se>
# Copyright: (c) 2017, Sébastien DA ROCHA <sebastien@da-rocha.net>
# 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... | gpl-3.0 |
sburnett/seattle | repy/virtual_namespace.py | 3 | 3662 | """
<Author>
Armon Dadgar
<Start Date>
October 21st, 2009
<Description>
This module provides the VirtualNamespace object. This object allows
arbitrary code to be checked for safety, and evaluated within a
specified global context.
"""
# Used for safety checking
import safe
# Used to check that an API call... | mit |
pigeonflight/strider-plone | docker/appengine/lib/django-1.2/tests/regressiontests/humanize/tests.py | 39 | 3296 | import unittest
from datetime import timedelta, date
from django.template import Template, Context, add_to_builtins
from django.utils.dateformat import DateFormat
from django.utils.translation import ugettext as _
from django.utils.html import escape
add_to_builtins('django.contrib.humanize.templatetags.humanize')
cl... | mit |
wangyanxing/Judge-at-fgdsb | judge/python/tests/coin_change_2.py | 1 | 1260 | from common import *
from solution import *
import copy
import sys
import datetime
num_test = 303
true, false = True, False
in_0 = []
in_org_0 = []
in_1 = []
in_org_1 = []
out = []
def load_test():
f = open('judge/tests/coin-change-2.txt', 'r')
global in_0, in_org_0
in_0 = read_int_matrix(f)
in_org_0... | mit |
cristiana214/cristianachavez214-cristianachavez | python/src/Tools/modulator/modulator.py | 37 | 14438 | #! /usr/bin/env python
#
# Modulator - Generate skeleton modules.
#
# The user fills out some forms with information about what the module
# should support (methods, objects), names of these things, prefixes to
# use for C code, whether the objects should also support access as numbers,
# etc etc etc.
# When the user p... | apache-2.0 |
chrisfranzen/django | django/db/models/sql/aggregates.py | 195 | 3977 | """
Classes to represent the default SQL aggregate functions
"""
from django.db.models.fields import IntegerField, FloatField
# Fake fields used to identify aggregate types in data-conversion operations.
ordinal_aggregate_field = IntegerField()
computed_aggregate_field = FloatField()
class Aggregate(object):
"""... | bsd-3-clause |
fernandezcuesta/ansible | lib/ansible/playbook/handler.py | 133 | 1974 | # (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 |
nvoron23/hue | apps/jobsub/setup.py | 39 | 1217 | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... | apache-2.0 |
aforalee/RRally | rally/common/sshutils.py | 5 | 10404 | # Copyright 2013: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
fkammer/three.js | utils/exporters/blender/addons/io_three/exporter/texture.py | 173 | 1407 | from .. import constants, logger
from . import base_classes, image, api
class Texture(base_classes.BaseNode):
"""Class that wraps a texture node"""
def __init__(self, node, parent):
logger.debug("Texture().__init__(%s)", node)
base_classes.BaseNode.__init__(self, node, parent, constants.TEXTUR... | mit |
DANCEcollaborative/forum-xblock | XBlock Integration Files/xdjangobb/xblock/lib/python2.7/site-packages/django/contrib/gis/geos/base.py | 86 | 1682 | from ctypes import c_void_p
from types import NoneType
from django.contrib.gis.geos.error import GEOSException
# Trying to import GDAL libraries, if available. Have to place in
# try/except since this package may be used outside GeoDjango.
try:
from django.contrib.gis import gdal
except ImportError:
# A 'dumm... | mit |
rootfs/origin | cmd/cluster-capacity/go/src/github.com/kubernetes-incubator/cluster-capacity/vendor/k8s.io/kubernetes/examples/cluster-dns/images/backend/server.py | 504 | 1293 | #!/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 |
tensorflow/ecosystem | data_service/tf_std_data_server.py | 1 | 2000 | # Copyright 2020 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 |
RJVB/audacity | lib-src/lv2/lv2/waflib/TaskGen.py | 85 | 11872 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import copy,re,os
from waflib import Task,Utils,Logs,Errors,ConfigSet,Node
feats=Utils.defaultdict(set)
class task_gen(object):
mappings={}
prec=Utils.defaultdict(list)
def... | gpl-2.0 |
IssamLaradji/scikit-learn | benchmarks/bench_plot_ward.py | 290 | 1260 | """
Benchmark scikit-learn's Ward implement compared to SciPy's
"""
import time
import numpy as np
from scipy.cluster import hierarchy
import pylab as pl
from sklearn.cluster import AgglomerativeClustering
ward = AgglomerativeClustering(n_clusters=3, linkage='ward')
n_samples = np.logspace(.5, 3, 9)
n_features = n... | bsd-3-clause |
openelisglobal/openelisglobal-core | liquibase/OE5.1/testCatalogKenya/Scripts/region_district.py | 4 | 2749 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
organization = []
region = []
region_dict = {}
used = ['']
county_list = []
county_name = []
county_district_file = open('input_files/county_district.txt','r')
region_file = open('input_files/region.txt', 'r')
for line in county_district_file:
if len(line... | mpl-2.0 |
dhp-denero/LibrERP | account_financial_report_horizontal/wizard/account_report_profit_loss.py | 2 | 2337 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2013 Agile Business Group sagl
# (<http://www.agilebg.com>) (<lorenzo.battistini@agilebg... | agpl-3.0 |
SVoxel/R9000 | git_home/u-boot.git/tools/patman/patchstream.py | 5 | 17615 | # Copyright (c) 2011 The Chromium OS Authors.
#
# SPDX-License-Identifier: GPL-2.0+
#
import os
import re
import shutil
import tempfile
import command
import commit
import gitutil
from series import Series
# Tags that we detect and remove
re_remove = re.compile('^BUG=|^TEST=|^BRANCH=|^Change-Id:|^Review URL:'
'|... | gpl-2.0 |
andyshinn/dx-toolkit | src/python/dxpy/bindings/dxgtable_functions.py | 2 | 3997 | # Copyright (C) 2013-2015 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at
#
# http://www.a... | apache-2.0 |
windyuuy/opera | chromium/src/tools/grit/grit/gather/txt.py | 62 | 1175 | #!/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.
'''Supports making amessage from a text file.
'''
from grit.gather import interface
from grit import tclib
class TxtFile(interfa... | bsd-3-clause |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/werkzeug/contrib/iterio.py | 147 | 10718 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.iterio
~~~~~~~~~~~~~~~~~~~~~~~
This module implements a :class:`IterIO` that converts an iterator into
a stream object and the other way round. Converting streams into
iterators requires the `greenlet`_ module.
To convert an iterator into a stream... | bsd-3-clause |
naslanidis/ansible | lib/ansible/modules/packaging/os/pkg5_publisher.py | 25 | 5926 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2014 Peter Oliver <ansible@mavit.org.uk>
#
# 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 License, or
# (at your o... | gpl-3.0 |
abramhindle/slowdraw | slowdraw.py | 1 | 5288 | #!/usr/bin/env python
''' Slowdraw watches an image file and makes animations out of the changes
'''
import sys
import cv2
import cv
import numpy as np
import logging
import time
import argparse
import watchdog
import os.path
import pickle
import math
from watchdog.observers import Observer
parser = argparse.Argument... | gpl-3.0 |
jpush/jbox | Server/venv/lib/python3.5/site-packages/jinja2/utils.py | 323 | 16560 | # -*- coding: utf-8 -*-
"""
jinja2.utils
~~~~~~~~~~~~
Utility functions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import errno
from collections import deque
from threading import Lock
from jinja2._compat import text_type, string_types, impl... | mit |
Zeken/audacity | lib-src/lv2/lv2/waflib/Tools/ruby.py | 316 | 3925 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os
from waflib import Task,Options,Utils
from waflib.TaskGen import before_method,feature,after_method,Task,extension
from waflib.Configure import conf
@feature('rubyex... | gpl-2.0 |
vFense/vFenseAgent-nix | agent/deps/mac/Python-2.7.5/lib/python2.7/idlelib/configHandler.py | 51 | 29367 | """Provides access to stored IDLE configuration information.
Refer to the comments at the beginning of config-main.def for a description of
the available configuration files and the design implemented to update user
configuration information. In particular, user configuration choices which
duplicate the defaults will... | lgpl-3.0 |
theonlynexus/gui2py | gui/__init__.py | 13 | 2100 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"gui2py: Simple and powerful GUI framework for agile development - Main Package"
__author__ = "Mariano Reingart (reingart@gmail.com)"
__copyright__ = "Copyright (C) 2013- Mariano Reingart"
__license__ = "LGPL 3.0"
__version__ = "0.9.4"
# some parts where inspired or borrowed... | lgpl-3.0 |
openshift/openshift-tools | ansible/roles/lib_oa_openshift/library/oc_edit.py | 18 | 55795 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | apache-2.0 |
digitaleric-google/GCG-3.3 | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
eduNEXT/edx-platform | openedx/core/djangoapps/content/course_overviews/tests/factories.py | 4 | 1249 | # lint-amnesty, pylint: disable=missing-module-docstring
from datetime import timedelta
import json
from django.utils import timezone
import factory
from factory.django import DjangoModelFactory
from opaque_keys.edx.locator import CourseLocator
from ..models import CourseOverview
class CourseOverviewFactory(Django... | agpl-3.0 |
Backspace-Dev/x920d-jp | scripts/gcc-wrapper.py | 501 | 3410 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, Code Aurora Forum. 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 a... | gpl-2.0 |
B0fH/dionaea | modules/python/dionaea/emu_scripts/handler.py | 3 | 2573 | import logging
import re
logger = logging.getLogger("emu_scripts")
class BaseHandler(object):
name = ""
def __init__(self, config=None):
self._config = {}
if isinstance(config, dict):
self._config = config
self.min_match_count = 0
self._regex_detect = []
... | gpl-2.0 |
applephil/headlyne | venv/lib/python2.7/site-packages/gunicorn/six.py | 13 | 13679 | """Utilities for writing code that runs on Python 2 and 3"""
import operator
import sys
import types
__author__ = "Benjamin Peterson <benjamin@python.org>"
__version__ = "1.2.0"
# True if we are running on Python 3.
PY3 = sys.version_info[0] == 3
if PY3:
string_types = str,
integer_types = int,
class_t... | apache-2.0 |
2015fallhw/cdw11 | users/a/g1/a40323105_1.py | 2 | 37865 | from flask import Blueprint, request
a40323105_1 = Blueprint('a40323105_1', __name__, url_prefix='/a40323105_1', template_folder='templates')
head_str = '''
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>網際 2D 繪圖</title>
<!-- IE 9: display inline SVG -->
<meta http-equiv="X-UA-Compatibl... | agpl-3.0 |
heeraj123/oh-mainline | vendor/packages/Django/tests/regressiontests/comment_tests/tests/model_tests.py | 126 | 2200 | from __future__ import absolute_import
from django.contrib.comments.models import Comment
from . import CommentTestCase
from ..models import Author, Article
class CommentModelTests(CommentTestCase):
def testSave(self):
for c in self.createSomeComments():
self.assertNotEqual(c.submit_date, No... | agpl-3.0 |
MadeiraCloud/opsagent | libs/requests/packages/urllib3/packages/ordered_dict.py | 1093 | 8936 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_ide... | apache-2.0 |
rhelmer/socorro-lib | socorro/unittest/external/postgresql/test_backfill.py | 1 | 12534 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from .unittestbase import PostgreSQLTestCase
from nose.plugins.attrib import attr
from nose.tools import eq_, assert_rai... | mpl-2.0 |
caphrim007/ansible | lib/ansible/plugins/filter/urlsplit.py | 146 | 1136 | # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by':... | gpl-3.0 |
HeathKang/flasky | migrations/versions/38c4e85512a9_initial_migration.py | 182 | 1163 | """initial migration
Revision ID: 38c4e85512a9
Revises: None
Create Date: 2013-12-27 01:23:59.392801
"""
# revision identifiers, used by Alembic.
revision = '38c4e85512a9'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust!... | mit |
caphrim007/ansible-modules-core | cloud/rackspace/rax_cdb_database.py | 41 | 4837 | #!/usr/bin/python -tt
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distrib... | gpl-3.0 |
PatrickChrist/scikit-learn | sklearn/feature_extraction/text.py | 110 | 50157 | # -*- coding: utf-8 -*-
# Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Lars Buitinck <L.J.Buitinck@uva.nl>
# Robert Layton <robertlayton@gmail.com>
# Jochen Wersdörfer <jochen@wersdoerfer.de>
# Roman Sinayev <roman.sinayev@gma... | bsd-3-clause |
Aaron0927/xen-4.2.1 | tools/python/xen/xend/XendProtocol.py | 49 | 7170 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
kylewray/nova | python/nova/nova_pomdp.py | 1 | 6240 | """ The MIT License (MIT)
Copyright (c) 2015 Kyle Hollins Wray, University of Massachusetts
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 ... | mit |
RyanDJLee/pyta | tests/test_type_inference/test_listcomp.py | 1 | 2140 | import astroid
import nose
from hypothesis import settings, given, HealthCheck
from typing import List
import tests.custom_hypothesis_support as cs
settings.load_profile("pyta")
@given(cs.homogeneous_iterable)
@settings(suppress_health_check=[HealthCheck.too_slow])
def test_list_comprehension_single_target_name_homog... | gpl-3.0 |
intelie/pycollector | src/helpers/yaml/error.py | 691 | 2559 |
__all__ = ['Mark', 'YAMLError', 'MarkedYAMLError']
class Mark(object):
def __init__(self, name, index, line, column, buffer, pointer):
self.name = name
self.index = index
self.line = line
self.column = column
self.buffer = buffer
self.pointer = pointer
def get... | bsd-3-clause |
haoyunfeix/crosswalk-test-suite | apptools/apptools-android-tests/apptools/manifest_versionCode.py | 12 | 3242 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | bsd-3-clause |
xen0l/ansible | lib/ansible/modules/remote_management/oneview/oneview_fcoe_network_facts.py | 125 | 2632 | #!/usr/bin/python
# Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP
# 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 |
bkloppenborg/Celero | test/gtest-1.7.0/test/gtest_list_tests_unittest.py | 1898 | 6515 | #!/usr/bin/env python
#
# Copyright 2006, 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... | apache-2.0 |
gauribhoite/personfinder | env/site-packages/jinja2/loaders.py | 333 | 17380 | # -*- coding: utf-8 -*-
"""
jinja2.loaders
~~~~~~~~~~~~~~
Jinja loader classes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import weakref
from types import ModuleType
from os import path
from hashlib import sha1
from jinja2.excepti... | apache-2.0 |
googleads/googleads-python-lib | examples/ad_manager/v202011/team_service/update_teams.py | 1 | 2271 | #!/usr/bin/env python
#
# Copyright 2015 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 |
sve-odoo/odoo | addons/portal_sale/__openerp__.py | 380 | 2183 | # -*- 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 |
starius/wt-classes | examples/make-all.py | 1 | 1140 | #!/usr/bin/python
import sys
import re
from optparse import OptionParser
entrypoints = []
anchors = []
parser = OptionParser()
parser.add_option("--cpp", dest="cpp")
parser.add_option("--template", dest="template")
parser.add_option("--wrasterimage", dest="wrasterimage", action="store_true")
(options, args) = parser... | gpl-2.0 |
ToontownUprising/src | toontown/parties/ScrolledFriendList.py | 5 | 2401 | from direct.gui.DirectGui import DirectFrame, DirectButton, DirectLabel
from direct.gui.DirectGui import DirectScrolledList, DirectCheckButton
from direct.gui.DirectCheckBox import DirectCheckBox
from direct.gui import DirectGuiGlobals
from toontown.toonbase import ToontownGlobals
from pandac.PandaModules import Vec3, ... | mit |
dcf21/meteor-pi | src/pythonModules/meteorpi_db/meteorpi_db/sql_builder.py | 2 | 15067 | # sql_builder.py
# -------------------------------------------------
# Copyright 2016 Cambridge Science Centre.
# This file is part of Meteor Pi.
# Meteor Pi 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, ... | gpl-3.0 |
SMTorg/smt | smt/applications/mfk.py | 1 | 27540 | # -*- coding: utf-8 -*-
"""
Created on Fri May 04 10:26:49 2018
@author: Mostafa Meliani <melimostafa@gmail.com>
Multi-Fidelity co-Kriging: recursive formulation with autoregressive model of
order 1 (AR1)
Adapted on January 2021 by Andres Lopez-Lopera to the new SMT version
"""
from copy import deepcopy
import numpy... | bsd-3-clause |
danalec/dotfiles | sublime/.config/sublime-text-3/Packages/anaconda_go/plugin/handlers_go/anagonda/context/motion.py | 2 | 3351 |
# Copyright (C) 2013 - 2016 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
import sys
import json
import shlex
from subprocess import PIPE
from process import spawn
from .error import AnaGondaError
from .base import AnaGondaContext
_go_get = 'github.com/fa... | mit |
MSusik/invenio | invenio/modules/formatter/format_elements/bfe_meta_files.py | 3 | 2954 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013 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) a... | gpl-2.0 |
EricRahm/log-spam-hell | logspam/bisect.py | 1 | 10157 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from collections import Counter
from logspam import WARNING_RE
from logspam.cli import BaseCommandLineArgs
from logspam... | mpl-2.0 |
sudosurootdev/external_chromium_org | third_party/markdown/extensions/wikilinks.py | 109 | 7050 | # markdown is released under the BSD license
# Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later)
# Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
# Copyright 2004 Manfred Stienstra (the original version)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or... | bsd-3-clause |
petteyg/intellij-community | python/lib/Lib/compileall.py | 251 | 5283 | """Module/script to "compile" all .py files to .pyc (or .pyo) file.
When called as a script with arguments, this compiles the directories
given as arguments recursively; the -l option prevents it from
recursing into directories.
Without arguments, if compiles all modules on sys.path, without
recursing into subdirecto... | apache-2.0 |
arjoly/scikit-learn | examples/gaussian_process/plot_gpc_iris.py | 81 | 2231 | """
=====================================================
Gaussian process classification (GPC) on iris dataset
=====================================================
This example illustrates the predicted probability of GPC for an isotropic
and anisotropic RBF kernel on a two-dimensional version for the iris-dataset.
... | bsd-3-clause |
Kefkius/pycoin | pycoin/block.py | 13 | 6490 | # -*- coding: utf-8 -*-
"""
Parse and stream Bitcoin blocks as either Block or BlockHeader structures.
The MIT License (MIT)
Copyright (c) 2013 by Richard Kiss
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
i... | mit |
damycra/django-rest-framework | rest_framework/utils/breadcrumbs.py | 15 | 2005 | from __future__ import unicode_literals
from django.core.urlresolvers import get_script_prefix, resolve
def get_breadcrumbs(url):
"""
Given a url returns a list of breadcrumbs, which are each a
tuple of (name, url).
"""
from rest_framework.settings import api_settings
from rest_framework.vie... | bsd-2-clause |
onestarshang/flask_super_config | venv/lib/python2.7/site-packages/pip/utils/__init__.py | 82 | 26144 | from __future__ import absolute_import
import contextlib
import errno
import locale
import logging
import re
import os
import posixpath
import shutil
import stat
import subprocess
import sys
import tarfile
import zipfile
from pip.exceptions import InstallationError
from pip.compat import console_to_str, stdlib_pkgs
f... | gpl-2.0 |
sunu/oppia | extensions/rich_text_components/Image/Image.py | 15 | 2465 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
morph027/ansible-modules-extras | monitoring/zabbix_screen.py | 18 | 17179 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013-2014, Epic Games, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (... | gpl-3.0 |
ghchinoy/tensorflow | tensorflow/python/data/experimental/kernel_tests/optimization/map_and_filter_fusion_test.py | 4 | 4273 | # Copyright 2018 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 |
allenp/odoo | addons/mail/models/res_partner.py | 6 | 12495 | # -*- coding: utf-8 -*-
import logging
import threading
from openerp import _, api, fields, models, tools
from openerp.osv import expression
_logger = logging.getLogger(__name__)
class Partner(models.Model):
""" Update partner to add a field about notification preferences. Add a generic opt-out field that can b... | gpl-3.0 |
chepazzo/ansible-eos | library/eos_config.py | 5 | 14405 | #!/usr/bin/python
#
# Copyright (c) 2015, Arista Networks, 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,
# t... | bsd-3-clause |
luthfii/xsched | tools/ocaml/libs/xentoollog/genlevels.py | 9 | 2642 | #!/usr/bin/python
import sys
def read_levels():
f = open('../../../libxc/xentoollog.h', 'r')
levels = []
record = False
for l in f.readlines():
if 'XTL_NUM_LEVELS' in l:
break
if record == True:
levels.append(l.split(',')[0].strip())
if 'XTL_NONE' in l:
record = True
f.close()
olevels = [level... | gpl-2.0 |
felixbuenemann/sentry | src/sentry/web/forms/fields.py | 22 | 4794 | """
sentry.web.forms.fields
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import six
from django.core.validators import URLValidator
from django.forms.widgets import RadioFiel... | bsd-3-clause |
rcarrillocruz/ansible | docs/bin/plugin_formatter.py | 33 | 16896 | #!/usr/bin/env python
# (c) 2012, Jan-Piet Mens <jpmens () gmail.com>
# (c) 2012-2014, Michael DeHaan <michael@ansible.com> and others
#
# 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 So... | gpl-3.0 |
centaurialpha/ninja-ide | ninja_ide/gui/dialogs/traceback_widget.py | 8 | 2513 | # -*- coding: utf-8 -*-
#
# This file is part of NINJA-IDE (http://ninja-ide.org).
#
# NINJA-IDE 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
# any later version.
#
# NIN... | gpl-3.0 |
tempbottle/ironpython3 | Src/StdLib/Lib/distutils/log.py | 163 | 1908 | """A simple log mechanism styled after PEP 282."""
# The class here is styled after PEP 282 so that it could later be
# replaced with a standard Python logging implementation.
DEBUG = 1
INFO = 2
WARN = 3
ERROR = 4
FATAL = 5
import sys
class Log:
def __init__(self, threshold=WARN):
self.threshold = thre... | apache-2.0 |
AndreaCrotti/django-pipeline | pipeline/compressors/__init__.py | 2 | 9095 | from __future__ import unicode_literals
import base64
import os
import posixpath
import re
from itertools import takewhile
from django.utils.encoding import smart_bytes, force_text
from pipeline.conf import settings
from pipeline.storage import default_storage
from pipeline.utils import to_class, relpath
from pipel... | mit |
mrrrgn/build-mozharness | configs/b2g_bumper/v2.1s.py | 1 | 3817 | #!/usr/bin/env python
config = {
"exes": {
# Get around the https warnings
"hg": ['/usr/local/bin/hg', "--config", "web.cacerts=/etc/pki/tls/certs/ca-bundle.crt"],
"hgtool.py": ["/usr/local/bin/hgtool.py"],
"gittool.py": ["/usr/local/bin/gittool.py"],
},
'gecko_pull_url': 'ht... | mpl-2.0 |
MarkWh1te/xueqiu_predict | python3_env/lib/python3.4/site-packages/sqlalchemy/pool.py | 3 | 49811 | # sqlalchemy/pool.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Connection pooling for DB-API connections.
Provides a number of connection p... | mit |
xe1gyq/openstack | device/iot101inc.py | 3 | 2148 | #!/usr/bin/python
import paho.mqtt.client as paho
import psutil
import pywapi
import signal
import sys
import time
from threading import Thread
def functionApiWeather():
data = pywapi.get_weather_from_weather_com('MXJO0043', 'metric')
message = data['location']['name']
message = message + ", Temperature ... | apache-2.0 |
eevee/urwid | examples/pop_up.py | 17 | 1289 | #!/usr/bin/python
import urwid
class PopUpDialog(urwid.WidgetWrap):
"""A dialog that appears with nothing but a close button """
signals = ['close']
def __init__(self):
close_button = urwid.Button("that's pretty cool")
urwid.connect_signal(close_button, 'click',
lambda button:s... | lgpl-2.1 |
lintzc/gpdb | src/test/tinc/tincrepo/mpp/models/test/mpp_tc/test_mpp_test_case.py | 9 | 7388 | """
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | apache-2.0 |
arcticshores/kivy | kivy/uix/progressbar.py | 42 | 2456 | '''
Progress Bar
============
.. versionadded:: 1.0.8
.. image:: images/progressbar.jpg
:align: right
The :class:`ProgressBar` widget is used to visualize the progress of some task.
Only the horizontal mode is currently supported: the vertical mode is not
yet available.
The progress bar has no interactive eleme... | mit |
SmartInfrastructures/neutron | neutron/tests/unit/extension_stubs.py | 41 | 1908 | # 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/LICENSE-2.0
#
# Unless req... | apache-2.0 |
a10networks/a10sdk-python | a10sdk/core/router/router_bgp_address_family_ipv6_network_synchronization.py | 2 | 1321 | from a10sdk.common.A10BaseClass import A10BaseClass
class Synchronization(A10BaseClass):
"""Class Description::
help Perform IGP synchronization.
Class synchronization supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:par... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.