repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
pylover/elixir | setup.py | 1 | 2168 | from setuptools import setup, find_packages
import sys
import re
import os
extra = {}
if sys.version_info >= (3,):
extra['use_2to3'] = True
# reading cherryblog.py version without importing any modules from that package
with open(os.path.join(os.path.dirname(__file__), 'elixir', '__init__.py')) as v_file:
pac... | mit |
Novasoft-India/OperERP-AM-Motors | openerp/addons/sale_mrp/sale_mrp.py | 13 | 3353 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
synergeticsedx/deployment-wipro | cms/djangoapps/contentstore/management/commands/clone_course.py | 72 | 1997 | """
Script for cloning a course
"""
from django.core.management.base import BaseCommand, CommandError
from xmodule.modulestore.django import modulestore
from student.roles import CourseInstructorRole, CourseStaffRole
from opaque_keys.edx.keys import CourseKey
from opaque_keys import InvalidKeyError
from opaque_keys.edx... | agpl-3.0 |
chrismeyersfsu/ansible | lib/ansible/modules/database/postgresql/postgresql_schema.py | 12 | 8505 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... | gpl-3.0 |
Arno-Nymous/pyload | module/plugins/hoster/FilepostCom.py | 8 | 5115 | # -*- coding: utf-8 -*-
import re
import time
from ..captcha.ReCaptcha import ReCaptcha
from ..internal.misc import json
from ..internal.SimpleHoster import SimpleHoster
class FilepostCom(SimpleHoster):
__name__ = "FilepostCom"
__type__ = "hoster"
__version__ = "0.41"
__status__ = "testing"
__p... | gpl-3.0 |
xingyepei/edx-platform | cms/djangoapps/course_creators/models.py | 183 | 4070 | """
Table for storing information about whether or not Studio users have course creation privileges.
"""
from django.db import models
from django.db.models.signals import post_init, post_save
from django.dispatch import receiver, Signal
from django.contrib.auth.models import User
from django.utils import timezone
from... | agpl-3.0 |
rhcarvalho/origin | hack/build-local-images.py | 11 | 7127 | #!/usr/bin/env python
import sys
from shutil import copy, rmtree
import distutils.dir_util as dir_util
from subprocess import call
from tempfile import mkdtemp
from atexit import register
from os import getenv, listdir, mkdir, remove
from os.path import abspath, dirname, exists, isdir, join
if len(sys.argv) > 1 and ... | apache-2.0 |
habibmasuro/kivy | kivy/core/text/text_sdl2.py | 37 | 1288 | '''
SDL2 text provider
==================
Based on SDL2 + SDL2_ttf
'''
__all__ = ('LabelSDL2', )
from kivy.compat import PY2
from kivy.core.text import LabelBase
from kivy.core.text._text_sdl2 import (_SurfaceContainer, _get_extents,
_get_fontdescent, _get_fontascent)
class L... | mit |
CTPUG/wafer | wafer/menu.py | 1 | 4806 | import contextlib
import copy
from django.core.cache import cache
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
CACHE_KEY = "WAFER_MENU_CACHE"
def get_cached_menus():
"""Return the menus from the cache or generate them if needed."""
items = cache.get(CACHE_KEY)
i... | isc |
coderbone/SickRage-alt | lib/pgi/codegen/ctypes_backend/utils.py | 20 | 5230 | # Copyright 2012-2014 Christoph Reiter
#
# 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 Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
import ctypes
from p... | gpl-3.0 |
DJHasis/Kernel-msm8930-common | scripts/gcc-wrapper.py | 234 | 4095 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. 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 th... | gpl-2.0 |
hi2017teamB/ChatAppProject | websocket-client/websocket/_http.py | 15 | 7415 | """
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
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 Software Foundation; either
version 2.1 of the License, ... | mit |
zigitax/Empire | lib/modules/situational_awareness/network/sharefinder.py | 10 | 3885 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-ShareFinder',
'Author': ['@harmj0y'],
'Description': ('Finds shares on machines in the domain.'),
'Background' : True,
'Outpu... | bsd-3-clause |
miguelpalacio/python-for-android | python-build/python-libs/gdata/build/lib/gdata/data.py | 133 | 35748 | #!/usr/bin/env python
#
# Copyright (C) 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
ex/js | lib/closure-library/closure/bin/build/jscompiler.py | 1 | 4111 | # Copyright 2010 The Closure Library Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | mit |
flyhigher139/python_practices | exericises/exercises_3.py | 1 | 1452 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Take a list, say for example this one:
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
and write a program that prints out all the elements of the list that are less than 5.
Extras:
- Instead of printing the elements one by one,
make a new list that has all the elements... | gpl-2.0 |
kalou/gandi.cli | gandi/cli/modules/sshkey.py | 7 | 2966 | """ SSH key commands module. """
import os
from gandi.cli.core.base import GandiModule
from gandi.cli.core.utils import DuplicateResults
class Sshkey(GandiModule):
""" Module to handle CLI commands.
$ gandi sshkey create
$ gandi sshkey delete
$ gandi sshkey info
$ gandi sshkey list
"""
... | gpl-3.0 |
TrishAllin/electron-quick-start | node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | 1284 | 100329 | # Copyright (c) 2013 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.
import collections
import copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
imp... | cc0-1.0 |
TheRyuu/xy-VSFilter | src/thirdparty/gtest/test/gtest_shuffle_test.py | 3023 | 12549 | #!/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 of... | gpl-2.0 |
maestrotf/pymepps | pymepps/loader/model.py | 1 | 3223 | #!/bin/env python
# -*- coding: utf-8 -*-
#
#Created on 21.04.17
#
#Created for pymepps
#
#@author: Tobias Sebastian Finn, tobias.sebastian.finn@studium.uni-hamburg.de
#
# Copyright (C) {2017} {Tobias Sebastian Finn}
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | gpl-3.0 |
treycausey/scikit-learn | sklearn/svm/setup.py | 2 | 3246 | import os
from os.path import join
import numpy
import warnings
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info, BlasNotFoundError
config = Configurat... | bsd-3-clause |
weicia/multitheftauto | resources/resources_upload.py | 36 | 10226 | #!/usr/bin/python
"""Script that checks out files from the MTA SVN, removes .svn files, archives to a zip, and uploads them to google code."""
#Import modules
import os #basic file/dir stuff
import sys #basic system stuff
import stat #used for stat.S_IWRITE, which disables readonly on files
import shutil ... | gpl-3.0 |
srsman/odoo | addons/auth_oauth/res_users.py | 121 | 5240 | import logging
import werkzeug.urls
import urlparse
import urllib2
import simplejson
import openerp
from openerp.addons.auth_signup.res_users import SignupError
from openerp.osv import osv, fields
from openerp import SUPERUSER_ID
_logger = logging.getLogger(__name__)
class res_users(osv.Model):
_inherit = 'res.... | agpl-3.0 |
TeamExodus/external_chromium_org | chrome/common/extensions/docs/server2/test_data/api_data_source/canned_master_fs.py | 78 | 5828 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
CANNED_MASTER_FS_DATA = {
'api': {
'_api_features.json': json.dumps({
'add_rules_tester': { 'dependencies': ['permission:add_rules_... | bsd-3-clause |
zhouzhenghui/python-for-android | python-modules/twisted/twisted/internet/epollreactor.py | 56 | 8121 | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An epoll() based implementation of the twisted main loop.
To install the event loop (and you should do this before any connections,
listeners or connectors are added)::
from twisted.internet import epollreactor
epollreactor... | apache-2.0 |
metatoaster/mtj.eve.tracker | mtj/eve/tracker/pos.py | 1 | 33732 | from __future__ import absolute_import
import logging
import time
import sys
import zope.component
from evelink.constants import Corp as corp_const
from mtj.evedb.structure import ControlTower
from mtj.evedb.map import Map
from mtj.evedb.market import Group
from mtj.multimer.buffer import TimedBuffer
from mtj.eve... | gpl-3.0 |
zhoulingjun/django | django/contrib/staticfiles/management/commands/runserver.py | 216 | 1360 | from django.conf import settings
from django.contrib.staticfiles.handlers import StaticFilesHandler
from django.core.management.commands.runserver import \
Command as RunserverCommand
class Command(RunserverCommand):
help = "Starts a lightweight Web server for development and also serves static files."
d... | bsd-3-clause |
ShiYw/Sigil | 3rdparty/python/Lib/encodings/cp424.py | 272 | 12055 | """ Python Character Mapping Codec cp424 generated from 'MAPPINGS/VENDORS/MISC/CP424.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='... | gpl-3.0 |
bqbn/addons-server | src/olympia/zadmin/management/commands/removeuserfromgroup.py | 3 | 1481 | from django.core.management.base import BaseCommand, CommandError
import olympia.core.logger
from olympia.access.models import Group, GroupUser
from olympia.users.models import UserProfile
class Command(BaseCommand):
help = ('Remove a user from a group.')
log = olympia.core.logger.getLogger('z.users')
... | bsd-3-clause |
magic0704/neutron | neutron/tests/functional/agent/linux/test_async_process.py | 12 | 2572 | # Copyright 2013 Red Hat, 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 agre... | apache-2.0 |
batmancn/GarfieltBlog-webpy | models/model.py | 2 | 13719 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
GarfieltBlog(webpy) is a light weight blog system base on web.py.It is similar
to WordPress that provides commonly functions and featurs of a blog system.
Homepage and details: http://www.iscsky.net/
Copyright (c) 2012, Garfielt <liuwt123@gmail.com>.
License... | mit |
thawatchai/mrkimontour | appengine-django/lib/django/conf/locale/ko/formats.py | 404 | 2320 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'Y년 n월 j일'
TIME_FORMAT = 'A g:i'
D... | gpl-2.0 |
xhaggi/xbmc | lib/gtest/test/gtest_shuffle_test.py | 184 | 12608 | #!/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 of... | gpl-2.0 |
efiring/scipy | doc/postprocess.py | 101 | 1442 | #!/usr/bin/env python
"""
%prog MODE FILES...
Post-processes HTML and Latex files output by Sphinx.
MODE is either 'html' or 'tex'.
"""
import re, optparse
def main():
p = optparse.OptionParser(__doc__)
options, args = p.parse_args()
if len(args) < 1:
p.error('no mode given')
mode = args.po... | bsd-3-clause |
tox-dev/tox | tests/unit/session/test_list_env.py | 2 | 6300 | def test_listenvs(cmd, initproj, monkeypatch):
monkeypatch.delenv(str("TOXENV"), raising=False)
initproj(
"listenvs",
filedefs={
"tox.ini": """
[tox]
envlist=py36,py27,py37,pypi,docs
description= py27: run pytest on Python 2.7
py37: run py... | mit |
40223123/w16b_test | static/Brython3.1.1-20150328-091302/Lib/pydoc.py | 637 | 102017 | #!/usr/bin/env python3
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
Run "pydoc <name>" to show documentation ... | gpl-3.0 |
omakk/servo | tests/wpt/web-platform-tests/css/tools/apiclient/test.py | 52 | 4358 | #!/usr/bin/env python
# coding=utf-8
#
# Copyright © 2013 Hewlett-Packard Development Company, L.P.
#
# This work is distributed under the W3C® Software License [1]
# in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR P... | mpl-2.0 |
w1ll1am23/home-assistant | homeassistant/components/smarty/__init__.py | 5 | 1854 | """Support to control a Salda Smarty XP/XV ventilation unit."""
from datetime import timedelta
import ipaddress
import logging
from pysmarty import Smarty
import voluptuous as vol
from homeassistant.const import CONF_HOST, CONF_NAME
from homeassistant.helpers import discovery
import homeassistant.helpers.config_vali... | apache-2.0 |
zhukaixy/kbengine | kbe/src/lib/python/Tools/scripts/abitype.py | 68 | 5572 | #!/usr/bin/env python3
# This script converts a C file to use the PEP 384 type definition API
# Usage: abitype.py < old_code > new_code
import re, sys
###### Replacement of PyTypeObject static instances ##############
# classify each token, giving it a one-letter code:
# S: static
# T: PyTypeObject
# I: ident
# W: wh... | lgpl-3.0 |
verycumbersome/the-blue-alliance | controllers/admin/admin_offseason_scraper_controller.py | 8 | 3271 | import datetime
import logging
import os
from google.appengine.ext import ndb
from google.appengine.ext.webapp import template
from controllers.base_controller import LoggedInHandler
from datafeeds.datafeed_usfirst_offseason import DatafeedUsfirstOffseason
from consts.event_type import EventType
from helpers.event_m... | mit |
gf11speed/libgdx | extensions/gdx-freetype/jni/freetype-2.5.5/src/tools/docmaker/utils.py | 146 | 3530 | #
# utils.py
#
# Auxiliary functions for the `docmaker' tool (library file).
#
# Copyright 2002, 2004, 2007, 2008, 2014 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
# modified, and distributed under the terms of the FreeType project
# license, LICENSE.TXT. By continu... | apache-2.0 |
migonzalvar/youtube-dl | youtube_dl/extractor/huffpost.py | 132 | 2607 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_duration,
unified_strdate,
)
class HuffPostIE(InfoExtractor):
IE_DESC = 'Huffington Post'
_VALID_URL = r'''(?x)
https?://(embed\.)?live\.huffingtonpost\.com/
(?:
... | unlicense |
gundalow/ansible | lib/ansible/plugins/loader.py | 8 | 58046 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> and others
# (c) 2017, Toshio Kuratomi <tkuratomi@ansible.com>
# (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 ... | gpl-3.0 |
ContinuumIO/numpy | numpy/lib/tests/test_utils.py | 56 | 1656 | from __future__ import division, absolute_import, print_function
import sys
from numpy.core import arange
from numpy.testing import (
run_module_suite, assert_, assert_equal, assert_raises_regex, dec
)
from numpy.lib import deprecate
import numpy.lib.utils as utils
if sys.version_info[0] >= 3:
from io imp... | bsd-3-clause |
crotsos/ns-3 | src/aodv/bindings/modulegen__gcc_LP64.py | 14 | 455823 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
rackerlabs/pyopenssl | OpenSSL/test/test_rand.py | 11 | 6693 | # Copyright (c) Frederick Dean
# See LICENSE for details.
"""
Unit tests for :py:obj:`OpenSSL.rand`.
"""
from unittest import main
import os
import stat
import sys
from OpenSSL.test.util import TestCase, b
from OpenSSL import rand
class RandTests(TestCase):
def test_bytes_wrong_args(self):
"""
... | apache-2.0 |
hacknashvillereview/review_application | review_app/review_app/models.py | 1 | 1668 | from django.db import models
from django.contrib.auth.models import User
class ReviewUser(models.Model):
user = models.OneToOneField(User)
# foxycart customer id
customer_id = models.IntegerField()
class ReviewSession(models.Model):
title = models.CharField(max_length=100)
facilitator = models... | mit |
JohnReid/auxiliary-deep-generative-models | adgm/models/conv_sdgmssl.py | 1 | 26737 | import theano
import theano.tensor as T
from lasagne import init
from lasagne.layers import Conv2DLayer, TransposedConv2DLayer, ConcatLayer, SliceLayer, DropoutLayer
from base import Model
from ..lasagne_extensions.layers import (SampleLayer, MultinomialLogDensityLayer,
GaussianLo... | mit |
ThirdProject/android_external_gmock | scripts/generator/cpp/ast.py | 268 | 62296 | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | bsd-3-clause |
grundprinzip/Impala | thirdparty/hive-0.13.1-cdh5.4.0-SNAPSHOT/lib/py/thrift/transport/THttpClient.py | 71 | 2916 | #
# 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 |
lucius-feng/cookiecutter | tests/test_cookiecutters.py | 25 | 2029 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_cookiecutters
------------------
Tests formerly known from a unittest residing in test_examples.py named
TestPyPackage.test_cookiecutter_pypackage
TestJQuery.test_cookiecutter_jquery
"""
from __future__ import unicode_literals
import os
import subprocess
import ... | bsd-3-clause |
lino-framework/welfare | lino_welfare/modlib/ledger/fixtures/std.py | 1 | 2758 | # -*- coding: UTF-8 -*-
# Copyright 2015-2020 Rumma & Ko Ltd
# License: GNU Affero General Public License v3 (see file COPYING for details)
"""Defines a default accounts chart for social accounting.
Also loads :mod:`lino_xl.lib.ledger.fixtures.std`
and :mod:`lino_welfare.modlib.ledger.fixtures.std_journals`
Purchas... | agpl-3.0 |
ychfan/tensorflow | tensorflow/contrib/slim/python/slim/evaluation_test.py | 62 | 9668 | # Copyright 2016 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 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/wsgiref/validate.py | 23 | 14743 | # (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
# Also licenced under the Apache License, 2.0: http://opensource.org/licenses/apache2.0.php
# Licensed to PSF under a Contributor Agreement
"""
Middlew... | gpl-3.0 |
dNG-git/mp_core | src/dNG/data/upnp/resources/item_dlna_http_resource.py | 1 | 6063 | # -*- coding: utf-8 -*-
"""
MediaProvider
A device centric multimedia solution
----------------------------------------------------------------------------
(C) direct Netware Group - All rights reserved
https://www.direct-netware.de/redirect?mp;core
The following license agreement remains valid unless any additions o... | gpl-2.0 |
geerlingguy/ansible | test/lib/ansible_test/_internal/sanity/ignores.py | 55 | 2978 | """Sanity test for the sanity ignore file."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from ..sanity import (
SanityFailure,
SanityIgnoreParser,
SanityVersionNeutral,
SanitySuccess,
SanityMessage,
)
from ..test import (
calculate_confid... | gpl-3.0 |
michaelpacer/networkx | networkx/algorithms/matching.py | 3 | 33138 | """
********
Matching
********
"""
# Copyright (C) 2004-2015 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
# Copyright (C) 2011 by
# Nicholas Mancuso <nick.mancuso@gmail.com>
# All rights reserved.
# ... | bsd-3-clause |
XiaoMi/minos | supervisor/supervisor/medusa/filesys.py | 5 | 11311 | # -*- Mode: Python -*-
# $Id: filesys.py,v 1.9 2003/12/24 16:10:56 akuchling Exp $
# Author: Sam Rushing <rushing@nightmare.com>
#
# Generic filesystem interface.
#
# We want to provide a complete wrapper around any and all
# filesystem operations.
# this class is really just for documentation,
# identify... | apache-2.0 |
Adenilson/servo | components/script/dom/bindings/codegen/parser/tests/test_nullable_equivalency.py | 106 | 3835 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
interface TestNullableEquivalency1 {
attribute long a;
attribute long? b;
};
interface TestNullableEquivalency2 {
attribute ArrayBuffer a;
attribute ArrayBuffer? b;
};
... | mpl-2.0 |
Xeralux/tensorflow | tensorflow/python/training/server_lib_same_variables_clear_container_test.py | 134 | 3129 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
Jeevan-J/Python_Funcode | plugins/twitter.py | 2 | 2966 | """
This file is part of EmailHarvester
Copyright (C) 2016 @maldevel
https://github.com/maldevel/EmailHarvester
EmailHarvester - A tool to retrieve Domain email addresses from Search Engines.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU... | bsd-2-clause |
mlperf/training_results_v0.6 | Google/benchmarks/mask/implementations/tpu-v3-128-mask/mask_rcnn/eval_multiprocess.py | 3 | 3368 | # Copyright 2018 Google. 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 agree... | apache-2.0 |
shreyasva/tensorflow | tensorflow/python/framework/versions.py | 4 | 1375 | # 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 required by applicable law or a... | apache-2.0 |
tony/django-docutils | django_docutils/favicon/prefetch.py | 1 | 3986 | import logging
import tldextract
from django.core.files.uploadedfile import SimpleUploadedFile
from tqdm import tqdm, trange
from django_docutils.favicon.models import get_favicon_model
from django_docutils.favicon.rst.transforms.favicon import plain_references
from django_docutils.favicon.scrape import get_favicon
... | mit |
danielrichman/snowball-ticketing | bin/free_vip_upgrade.py | 1 | 1387 | import sys
import psycopg2
import logging
from snowball_ticketing import utils, users, tickets, lookup, logging_setup
logger = utils.getLogger(__name__)
def main(crsid, postgres_settings):
logger.info("Creating free VIP upgrade for %s", crsid)
logging_setup.add_postgresql_handler(postgres_settings)
lo... | gpl-3.0 |
David-J-R/Rosalind-Solutions | src/bioinformatics_stronghold/fibd/fibd.py | 1 | 1237 | '''
Created on 21.03.2014
@author: Charun
'''
class generation(object):
alive = 0
born = 0
def __init__(self, alive, born):
self.alive = alive
self.born = born
pass
def __repr__(self):
return "alive: " + str(self.alive) + " born: " + str(self.born)
... | gpl-2.0 |
kosgroup/odoo | odoo/workflow/workitem.py | 10 | 13302 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
#
# TODO:
# cr.execute('delete from wkf_triggers where model=%s and res_id=%s', (res_type,res_id))
#
import logging
import instance
from odoo.workflow.helpers import Session
from odoo.workflow.helpers import Record
from odoo.workflow.helpers ... | gpl-3.0 |
cybertk/depot_tools | third_party/gsutil/gslib/__init__.py | 51 | 1121 | # Copyright 2010 Google Inc. All Rights Reserved.
#
# 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,... | bsd-3-clause |
chagan/nicar-summary-2017 | fabfile.py | 2 | 1057 | #!/usr/bin/env python
import os
from fabric.api import execute, local, prompt, task
def bootstrap(github_username='chagan', repository_name=None):
"""
Execute the bootstrap tasks for a new project.
"""
config = {}
config['$NEW_PROJECT_SLUG'] = os.getcwd().split('/')[-1]
config['$NEW_REPOSITO... | mit |
eduNEXT/edx-platform | common/djangoapps/student/email_helpers.py | 4 | 3150 | """
Helpers for Student app emails.
"""
from string import capwords
from django.conf import settings
from lms.djangoapps.verify_student.services import IDVerificationService
from openedx.core.djangoapps.ace_common.template_context import get_base_template_context
from openedx.core.djangoapps.enrollments.api import ... | agpl-3.0 |
vvladych/forecastmgmt | src/forecastmgmt/ui/masterdata/publisher_list_mask.py | 1 | 1377 | '''
Created on 04.05.2015
@author: vvladych
'''
from gi.repository import Gtk
from masterdata_abstract_window import AbstractListMask
from forecastmgmt.model.publisher import Publisher
class PublisherListMask(AbstractListMask):
treeview_columns=[
{"column":"common_name","hide":False},
... | unlicense |
anuvrat/coursera-python27 | src/optimization-002/coloring/solver.py | 1 | 2704 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import networkx
from ortools.constraint_solver import pywrapcp
def solve_it(input_data):
lines = input_data.split('\n')
node_count, edge_count = map(int, lines[0].split())
edges = [map(int, line.split()) for line in lines[1:] if line]
graph = networkx.Gra... | mit |
D4wN/brickv | src/brickv/plugin_system/plugins/red/scripts/settings_network_get_interfaces.py | 2 | 2702 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import os
import sys
import json
import netifaces
import subprocess
return_dict = {'wireless': None,
'wired': None,
'wireless_links': None}
wl_links_dict = {}
lwireless = []
_lwired = []
for intf in netifaces.interfaces():
if os.path.i... | gpl-2.0 |
ericgriffin/metasort | lib/boost/tools/build/v2/build/property.py | 18 | 17728 | # Status: ported, except for tests and --abbreviate-paths.
# Base revision: 64070
#
# Copyright 2001, 2002, 2003 Dave Abrahams
# Copyright 2006 Rene Rivera
# Copyright 2002, 2003, 2004, 2005, 2006 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or ... | apache-2.0 |
M32Media/redash | redash/cli/__init__.py | 1 | 15511 | import json
from datetime import datetime
from dateutil.relativedelta import relativedelta
import click
from flask.cli import FlaskGroup, run_command
from flask import current_app
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
from random import randint
from redash import crea... | bsd-2-clause |
hopeall/odoo | addons/l10n_be_coda/wizard/__init__.py | 439 | 1098 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it u... | agpl-3.0 |
gymnasium/edx-platform | lms/djangoapps/courseware/features/courseware_common.py | 23 | 1186 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
from lettuce import step, world
@step('I click on View Courseware')
def i_click_on_view_courseware(step):
world.css_click('a.enter-course')
@step('I click on the "([^"]*)" tab$')
def i_click_on_the_tab(... | agpl-3.0 |
htzy/bigfour | common/djangoapps/xblock_django/migrations/0001_initial.py | 79 | 4946 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'XBlockDisableConfig'
db.create_table('xblock_django_xbloc... | agpl-3.0 |
KHP-Informatics/sleepsight-analytics | tools/tree.py | 1 | 2717 | # !/bin/python3
####################### Example ###############################################
#def rootMethod(b):
# return b
#def lower10(val):
# if val < 10:
# return (True, val)
# return (False, val)
#def greater10(val):
# if val > 10:
# return (True, val)
# return (False, val)
#def ... | apache-2.0 |
anisku11/sublimeku | Packages/CodeComplice/libs/inflector/Rules/English.py | 8 | 5789 | #!/usr/bin/env python
# Copyright (c) 2006 Bermi Ferrer Martinez
# info at bermi dot org
# See the end of this file for the free software, open source license
# (BSD-style).
import re
from .Base import Base
class English (Base):
"""
Inflector for pluralize and singularize English nouns.
This is the def... | mit |
dcelasun/thrift | test/crossrunner/run.py | 13 | 16473 | #
# 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 |
trimailov/finance | books/models.py | 1 | 1808 | from django.contrib.auth.models import User
from django.db import models
from django.db.models import fields
from django.utils import timezone
class Transaction(models.Model):
EXPENSE = 'exp'
INCOME = 'inc'
CATEGORY_CHOICES = (
(EXPENSE, 'expense'),
(INCOME, 'income'),
)
title = f... | mit |
alexlo03/ansible | lib/ansible/modules/cloud/vmware/vcenter_extension_facts.py | 52 | 3484 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata... | gpl-3.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.4/Lib/test/test_importhooks.py | 8 | 6556 | import sys
import imp
import os
import unittest
from test import test_support
test_src = """\
def get_name():
return __name__
def get_file():
return __file__
"""
reload_src = test_src+"""\
reloaded = True
"""
test_co = compile(test_src, "<???>", "exec")
reload_co = compile(reload_src, "<???>", "exec")
test... | mit |
popazerty/test-gui | lib/python/Plugins/Extensions/DVDBurn/TitleCutter.py | 98 | 3312 | from Plugins.Extensions.CutListEditor.ui import CutListEditor
from Components.ServiceEventTracker import ServiceEventTracker
from enigma import iPlayableService, iServiceInformation
from Tools.Directories import fileExists
class TitleCutter(CutListEditor):
def __init__(self, session, t):
CutListEditor.__init__(self... | gpl-2.0 |
pdellaert/ansible | lib/ansible/modules/network/netvisor/pn_vrouter_interface_ip.py | 35 | 7292 | #!/usr/bin/python
# Copyright: (c) 2018, Pluribus Networks
# 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': ['... | gpl-3.0 |
rynomster/django | django/contrib/gis/gdal/prototypes/generation.py | 349 | 4310 | """
This module contains functions that generate ctypes prototypes for the
GDAL routines.
"""
from ctypes import c_char_p, c_double, c_int, c_int64, c_void_p
from functools import partial
from django.contrib.gis.gdal.prototypes.errcheck import (
check_arg_errcode, check_const_string, check_errcode, check_geom,
... | bsd-3-clause |
candango/python-oauth2 | vagrant/create_testclient.py | 5 | 2908 | import mysql.connector
from pymongo import MongoClient
client_id = "tc"
client_secret = "abc"
authorized_grants = ["authorization_code", "client_credentials", "password",
"refresh_token"]
authorized_response_types = ["code", "token"]
redirect_uris = ["http://127.0.0.1/index.html"]
def create_in_... | mit |
RockySteveJobs/python-for-android | python3-alpha/python3-src/Lib/poplib.py | 51 | 10921 | """A POP3 client class.
Based on the J. Myers POP3 draft, Jan. 96
"""
# Author: David Ascher <david_ascher@brown.edu>
# [heavily stealing from nntplib.py]
# Updated: Piers Lauder <piers@cs.su.oz.au> [Jul '97]
# String method conversion and test jig improvements by ESR, February 2001.
# Added the POP3_SSL clas... | apache-2.0 |
rohan07/linux | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
necromuralist/boston_housing | boston_housing/common.py | 1 | 8011 |
# python standard library
from collections import namedtuple
import os
# third party
from sklearn import datasets
from tabulate import tabulate
HousingData = namedtuple("HousingData", 'features prices names'.split())
def load_housing_data():
"""
Convenience function to get the Boston housing data
:return... | mit |
cleydson/scrapy | scrapy/spidermiddlewares/offsite.py | 85 | 2120 | """
Offsite Spider Middleware
See documentation in docs/topics/spider-middleware.rst
"""
import re
import logging
from scrapy import signals
from scrapy.http import Request
from scrapy.utils.httpobj import urlparse_cached
logger = logging.getLogger(__name__)
class OffsiteMiddleware(object):
def __init__(self... | bsd-3-clause |
colloquium/spacewalk | backend/server/action/rollback.py | 1 | 1392 | #
# Copyright (c) 2008--2010 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | gpl-2.0 |
eht16/django-clear-memcache | setup.py | 1 | 1596 | # -*- coding: utf-8 -*-
import sys
from shutil import rmtree
from setuptools import setup, find_packages
NAME = 'django-clear-memcache'
VERSION = '1.4.1'
if 'bdist_wheel' in sys.argv:
# Remove previous build dir when creating a wheel build, since if files have been removed
# from the project, they'll still b... | bsd-3-clause |
TigorC/zulip | zerver/views/auth.py | 2 | 20946 | from __future__ import absolute_import
from django.conf import settings
from django.contrib.auth import authenticate, login, get_backends
from django.contrib.auth.views import login as django_login_page, \
logout_then_login as django_logout_then_login
from django.core.urlresolvers import reverse
from zerver.decora... | apache-2.0 |
nhicher/ansible | test/units/template/test_template_utilities.py | 54 | 4250 | # (c) 2015 Toshio Kuratomi <tkuratomi@ansible.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) any later ... | gpl-3.0 |
xiaoluobo/Medline-Pubmed-Search-Engine | pymetamap/app.py | 1 | 5520 | from pymetamap import MetaMap
import csv
from flask import Flask, render_template, request, session, send_from_directory, g, redirect, url_for, abort, flash
import os
import json
# create the application object
app = Flask(__name__)
#when the user comes to the main page, send them to the home template
@app.route('/')... | apache-2.0 |
AlanZheng/heekscnc | nc/rez2.py | 34 | 17238 | # -*- coding: utf-8 -*-
################################################################################
# iso.py
#
# Simple ISO NC code creator
#
# Hirutso Enni, 2009-01-13
import nc
import math
import circular_pocket as circular
###########################################################################... | bsd-3-clause |
r3tard/BartusBot | lib/system_tests/system_test_utils.py | 9 | 1688 | # 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 a... | apache-2.0 |
nicolashainaux/mathmakerlib | tests/03_calculus/01_tools_test.py | 1 | 2950 | # -*- coding: utf-8 -*-
# Mathmaker Lib offers lualatex-printable mathematical objects.
# Copyright 2006-2017 Nicolas Hainaux <nh.techn@gmail.com>
# This file is part of Mathmaker Lib.
# Mathmaker Lib is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.